@dxos/plugin-explorer 0.8.4-main.7ace549 → 0.8.4-main.8baae0fced
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/dist/lib/neutral/ExplorerArticle-EAKRB55W.mjs +277 -0
- package/dist/lib/neutral/ExplorerArticle-EAKRB55W.mjs.map +7 -0
- package/dist/lib/neutral/ExplorerPlugin.mjs +10 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7SPMPHRS.mjs +72 -0
- package/dist/lib/neutral/chunk-7SPMPHRS.mjs.map +7 -0
- package/dist/lib/{browser/chunk-UBHZGWZQ.mjs → neutral/chunk-DXIWQFYO.mjs} +3 -5
- package/dist/lib/neutral/chunk-DXIWQFYO.mjs.map +7 -0
- package/dist/lib/neutral/chunk-EM2BV4PF.mjs +290 -0
- package/dist/lib/neutral/chunk-EM2BV4PF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GRJXLL4Z.mjs +25 -0
- package/dist/lib/neutral/chunk-GRJXLL4Z.mjs.map +7 -0
- package/dist/lib/neutral/chunk-V2OFO6PI.mjs +14 -0
- package/dist/lib/neutral/chunk-V2OFO6PI.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ARBGXQFH.mjs → neutral/components/index.mjs} +858 -307
- 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 +1 -1
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-APBW2VQG.mjs +26 -0
- package/dist/lib/neutral/react-surface-APBW2VQG.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +193 -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/{browser → neutral}/types/index.mjs +1 -2
- package/dist/types/data/cities.d.ts +4 -4
- package/dist/types/data/cities.d.ts.map +1 -1
- package/dist/types/data/countries-110m.d.ts +19 -22
- package/dist/types/data/countries-110m.d.ts.map +1 -1
- package/dist/types/src/ExplorerPlugin.d.ts +3 -1
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/ExplorerPlugin.test.d.ts +2 -0
- package/dist/types/src/ExplorerPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.d.ts +1 -1
- package/dist/types/src/components/Chart/Chart.d.ts.map +1 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts +4 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +5 -2
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/CanvasForceGraph.d.ts +13 -0
- package/dist/types/src/components/Graph/CanvasForceGraph.d.ts.map +1 -0
- package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts +17 -0
- package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts.map +1 -0
- package/dist/types/src/components/Graph/ForceGraph.d.ts +12 -5
- package/dist/types/src/components/Graph/ForceGraph.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +4 -2
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/{adapter.d.ts → graph-adapter.d.ts} +2 -2
- package/dist/types/src/components/Graph/graph-adapter.d.ts.map +1 -0
- package/dist/types/src/components/Graph/index.d.ts +1 -1
- package/dist/types/src/components/Graph/index.d.ts.map +1 -1
- package/dist/types/src/components/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 +5 -12
- 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 +18 -16
- package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/types/types.d.ts +14 -4
- package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts +9 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts +29 -0
- package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/experimental.stories.d.ts +7 -0
- package/dist/types/src/containers/ExplorerArticle/experimental.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ExplorerArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useGraphModel.d.ts +2 -2
- package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/{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 +47 -0
- package/dist/types/src/testing/relations.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +29 -28
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ExplorerAction.d.ts +0 -17
- package/dist/types/src/types/ExplorerAction.d.ts.map +1 -1
- package/dist/types/src/types/Graph.d.ts +10 -20
- package/dist/types/src/types/Graph.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 -62
- package/src/ExplorerPlugin.test.ts +26 -0
- package/src/ExplorerPlugin.tsx +15 -45
- package/src/capabilities/create-object.ts +36 -0
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/react-surface.tsx +24 -18
- package/src/components/Chart/Chart.stories.tsx +16 -23
- package/src/components/Chart/Chart.tsx +1 -1
- package/src/components/Globe/Globe.stories.tsx +19 -22
- package/src/components/Globe/Globe.tsx +1 -1
- package/src/components/Graph/CanvasForceGraph.stories.tsx +83 -0
- package/src/components/Graph/CanvasForceGraph.tsx +124 -0
- package/src/components/Graph/ForceGraph.stories.tsx +83 -44
- package/src/components/Graph/ForceGraph.tsx +104 -85
- package/src/components/Graph/{adapter.ts → graph-adapter.ts} +14 -8
- package/src/components/Graph/index.ts +1 -1
- package/src/components/Lattice/Lattice.stories.tsx +90 -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 +20 -38
- package/src/components/Tree/Tree.tsx +69 -95
- package/src/components/Tree/index.ts +2 -0
- package/src/components/Tree/layout/HierarchicalEdgeBundling.tsx +296 -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 +6 -5
- package/src/components/Tree/types/tree.ts +41 -20
- package/src/components/Tree/types/types.ts +38 -29
- package/src/components/index.ts +1 -4
- package/src/containers/ExplorerArticle/ExplorerArticle.stories.tsx +136 -0
- package/src/containers/ExplorerArticle/ExplorerArticle.tsx +465 -0
- package/src/containers/ExplorerArticle/experimental.stories.tsx +446 -0
- package/src/containers/ExplorerArticle/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/hooks/useGraphModel.ts +25 -14
- package/src/index.ts +1 -4
- package/src/meta.ts +4 -4
- package/src/plugin.ts +9 -0
- package/src/{components/Tree/testing → testing}/generator.ts +5 -3
- package/src/testing/index.ts +9 -0
- package/src/testing/relations.ts +192 -0
- package/src/translations.ts +14 -13
- package/src/types/ExplorerAction.ts +1 -18
- package/src/types/Graph.ts +13 -28
- 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/dist/lib/browser/ExplorerContainer-NOLLVUTE.mjs +0 -50
- package/dist/lib/browser/ExplorerContainer-NOLLVUTE.mjs.map +0 -7
- package/dist/lib/browser/chunk-2MKBRIUT.mjs +0 -31
- package/dist/lib/browser/chunk-2MKBRIUT.mjs.map +0 -7
- package/dist/lib/browser/chunk-6BVXZQPP.mjs +0 -188
- package/dist/lib/browser/chunk-6BVXZQPP.mjs.map +0 -7
- package/dist/lib/browser/chunk-ARBGXQFH.mjs.map +0 -7
- package/dist/lib/browser/chunk-P6FFFVPM.mjs +0 -100
- package/dist/lib/browser/chunk-P6FFFVPM.mjs.map +0 -7
- package/dist/lib/browser/chunk-UBHZGWZQ.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-EWB3H5KH.mjs +0 -35
- package/dist/lib/browser/intent-resolver-EWB3H5KH.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-BY2DYCTH.mjs +0 -34
- package/dist/lib/browser/react-surface-BY2DYCTH.mjs.map +0 -7
- package/dist/lib/node-esm/ExplorerContainer-N3S5KSUX.mjs +0 -51
- package/dist/lib/node-esm/ExplorerContainer-N3S5KSUX.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-4BY2XZET.mjs +0 -101
- package/dist/lib/node-esm/chunk-4BY2XZET.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CRSVAZNA.mjs +0 -190
- package/dist/lib/node-esm/chunk-CRSVAZNA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NPIP4VEH.mjs +0 -11091
- package/dist/lib/node-esm/chunk-NPIP4VEH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UXZM5VJB.mjs +0 -26
- package/dist/lib/node-esm/chunk-UXZM5VJB.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -113
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SH6PW7VF.mjs +0 -36
- package/dist/lib/node-esm/intent-resolver-SH6PW7VF.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -9
- package/dist/lib/node-esm/react-surface-7AAV7GBG.mjs +0 -35
- package/dist/lib/node-esm/react-surface-7AAV7GBG.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -12
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/ExplorerContainer.d.ts +0 -9
- package/dist/types/src/components/ExplorerContainer.d.ts.map +0 -1
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts +0 -14
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +0 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +0 -15
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +0 -1
- package/dist/types/src/components/Graph/adapter.d.ts.map +0 -1
- package/dist/types/src/components/Graph/testing.d.ts +0 -14
- package/dist/types/src/components/Graph/testing.d.ts.map +0 -1
- package/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/src/capabilities/intent-resolver.ts +0 -23
- package/src/components/ExplorerContainer.tsx +0 -54
- package/src/components/Graph/D3ForceGraph.stories.tsx +0 -80
- 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/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ExplorerPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser/meta.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/meta.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/types/index.mjs.map +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/containers/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const ExplorerArticle: ComponentType<any> = lazy(() => import('./ExplorerArticle'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAA6BA,YAAY;AAElC,IAAMC,kBAAsCD,KAAK,MAAM,OAAO,iCAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "ExplorerArticle"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/create-object.ts
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { Capability } from "@dxos/app-framework";
|
|
6
|
+
import { Operation } from "@dxos/compute";
|
|
7
|
+
import { Type } from "@dxos/echo";
|
|
8
|
+
import { SpaceOperation } from "@dxos/plugin-space";
|
|
9
|
+
import { SpaceCapabilities } from "@dxos/plugin-space";
|
|
10
|
+
import { ViewModel } from "@dxos/schema";
|
|
11
|
+
import { ExplorerAction, Graph } from "#types";
|
|
12
|
+
var create_object_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
13
|
+
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
14
|
+
id: Type.getTypename(Graph.Graph),
|
|
15
|
+
inputSchema: ExplorerAction.GraphProps,
|
|
16
|
+
createObject: (props, options) => Effect.gen(function* () {
|
|
17
|
+
const object = yield* Effect.promise(async () => {
|
|
18
|
+
const { view } = await ViewModel.makeFromDatabase({
|
|
19
|
+
db: options.db,
|
|
20
|
+
typename: props.typename
|
|
21
|
+
});
|
|
22
|
+
return Graph.make({
|
|
23
|
+
name: props.name,
|
|
24
|
+
view
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
28
|
+
object,
|
|
29
|
+
target: options.target,
|
|
30
|
+
hidden: true,
|
|
31
|
+
targetNodeId: options.targetNodeId
|
|
32
|
+
});
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
}));
|
|
36
|
+
export {
|
|
37
|
+
create_object_default as default
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=create-object-F6TKVAGV.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/create-object.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Type } from '@dxos/echo';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { ViewModel } from '@dxos/schema';\n\nimport { ExplorerAction, Graph } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {\n id: Type.getTypename(Graph.Graph),\n inputSchema: ExplorerAction.GraphProps,\n createObject: (props, options) =>\n Effect.gen(function* () {\n const object = yield* Effect.promise(async () => {\n const { view } = await ViewModel.makeFromDatabase({ db: options.db, typename: props.typename });\n return Graph.make({ name: props.name, view });\n });\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n hidden: true,\n targetNodeId: options.targetNodeId,\n });\n }),\n });\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,yBAAyB;AAClC,SAASC,iBAAiB;AAE1B,SAASC,gBAAgBC,aAAa;AAEtC,IAAA,wBAAeP,WAAWQ,WACjBC,kBAAW,aAAA;AAChB,SAAOT,WAAWU,YAAYN,kBAAkBO,mBAAmB;IACjEC,IAAIV,KAAKW,YAAYN,MAAMA,KAAK;IAChCO,aAAaR,eAAeS;IAC5BC,cAAc,CAACC,OAAOC,YACbC,WAAI,aAAA;AACT,YAAMC,SAAS,OAAcC,eAAQ,YAAA;AACnC,cAAM,EAAEC,KAAI,IAAK,MAAMjB,UAAUkB,iBAAiB;UAAEC,IAAIN,QAAQM;UAAIC,UAAUR,MAAMQ;QAAS,CAAA;AAC7F,eAAOlB,MAAMmB,KAAK;UAAEC,MAAMV,MAAMU;UAAML;QAAK,CAAA;MAC7C,CAAA;AACA,aAAO,OAAOrB,UAAU2B,OAAOzB,eAAe0B,WAAW;QACvDT;QACAU,QAAQZ,QAAQY;QAChBC,QAAQ;QACRC,cAAcd,QAAQc;MACxB,CAAA;IACF,CAAA;EACJ,CAAA;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capability", "Operation", "Type", "SpaceOperation", "SpaceCapabilities", "ViewModel", "ExplorerAction", "Graph", "makeModule", "fnUntraced", "contributes", "CreateObjectEntry", "id", "getTypename", "inputSchema", "GraphProps", "createObject", "props", "options", "gen", "object", "promise", "view", "makeFromDatabase", "db", "typename", "make", "name", "invoke", "AddObject", "target", "hidden", "targetNodeId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/hooks/useGraphModel.ts
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { Capabilities } from "@dxos/app-framework";
|
|
6
|
+
import { useCapability } from "@dxos/app-framework/ui";
|
|
7
|
+
import { SpaceGraphModel } from "@dxos/schema";
|
|
8
|
+
var useGraphModel = (db, filter, options, items) => {
|
|
9
|
+
const registry = useCapability(Capabilities.AtomRegistry);
|
|
10
|
+
const [model, setModel] = useState(void 0);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!db) {
|
|
13
|
+
setModel(void 0);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const newModel = new SpaceGraphModel(registry);
|
|
17
|
+
void newModel.open(db);
|
|
18
|
+
setModel(newModel);
|
|
19
|
+
return () => {
|
|
20
|
+
setModel(void 0);
|
|
21
|
+
void newModel.close();
|
|
22
|
+
};
|
|
23
|
+
}, [
|
|
24
|
+
db,
|
|
25
|
+
registry
|
|
26
|
+
]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
model?.setFilter(filter).setOptions(options);
|
|
29
|
+
}, [
|
|
30
|
+
model,
|
|
31
|
+
filter,
|
|
32
|
+
options
|
|
33
|
+
]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
model?.setItems(items);
|
|
36
|
+
}, [
|
|
37
|
+
model,
|
|
38
|
+
items
|
|
39
|
+
]);
|
|
40
|
+
return model;
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
useGraphModel
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 { Capabilities } from '@dxos/app-framework';\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { type Database, type Entity, type Filter } from '@dxos/echo';\nimport { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';\n\n// TODO(burdon): Factor out.\nexport const useGraphModel = (\n db: Database.Database | undefined,\n filter?: Filter.Any | undefined,\n options?: SpaceGraphModelOptions,\n items?: readonly Entity.Unknown[],\n): SpaceGraphModel | undefined => {\n const registry = useCapability(Capabilities.AtomRegistry);\n const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);\n\n useEffect(() => {\n if (!db) {\n setModel(undefined);\n return;\n }\n\n const newModel = new SpaceGraphModel(registry);\n void newModel.open(db);\n setModel(newModel);\n\n return () => {\n setModel(undefined);\n void newModel.close();\n };\n }, [db, registry]);\n\n useEffect(() => {\n model?.setFilter(filter).setOptions(options);\n }, [model, filter, options]);\n\n useEffect(() => {\n model?.setItems(items);\n }, [model, items]);\n\n return model;\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,WAAWC,gBAAgB;AAEpC,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB;AAE9B,SAASC,uBAAoD;AAGtD,IAAMC,gBAAgB,CAC3BC,IACAC,QACAC,SACAC,UAAAA;AAEA,QAAMC,WAAWP,cAAcD,aAAaS,YAAY;AACxD,QAAM,CAACC,OAAOC,QAAAA,IAAYZ,SAAsCa,MAAAA;AAEhEd,YAAU,MAAA;AACR,QAAI,CAACM,IAAI;AACPO,eAASC,MAAAA;AACT;IACF;AAEA,UAAMC,WAAW,IAAIX,gBAAgBM,QAAAA;AACrC,SAAKK,SAASC,KAAKV,EAAAA;AACnBO,aAASE,QAAAA;AAET,WAAO,MAAA;AACLF,eAASC,MAAAA;AACT,WAAKC,SAASE,MAAK;IACrB;EACF,GAAG;IAACX;IAAII;GAAS;AAEjBV,YAAU,MAAA;AACRY,WAAOM,UAAUX,MAAAA,EAAQY,WAAWX,OAAAA;EACtC,GAAG;IAACI;IAAOL;IAAQC;GAAQ;AAE3BR,YAAU,MAAA;AACRY,WAAOQ,SAASX,KAAAA;EAClB,GAAG;IAACG;IAAOH;GAAM;AAEjB,SAAOG;AACT;",
|
|
6
|
+
"names": ["useEffect", "useState", "Capabilities", "useCapability", "SpaceGraphModel", "useGraphModel", "db", "filter", "options", "items", "registry", "AtomRegistry", "model", "setModel", "undefined", "newModel", "open", "close", "setFilter", "setOptions", "setItems"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ExplorerAction_exports,
|
|
3
|
+
Graph_exports
|
|
4
|
+
} from "./chunk-7SPMPHRS.mjs";
|
|
5
|
+
import {
|
|
6
|
+
meta
|
|
7
|
+
} from "./chunk-DXIWQFYO.mjs";
|
|
8
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
9
|
+
export {
|
|
10
|
+
ExplorerAction_exports as ExplorerAction,
|
|
11
|
+
Graph_exports as Graph,
|
|
12
|
+
meta
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":2105,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/ExplorerAction.ts":{"bytes":2116,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true}],"format":"esm"},"src/types/Graph.ts":{"bytes":4799,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":610,"imports":[{"path":"src/types/ExplorerAction.ts","kind":"import-statement","original":"./ExplorerAction"},{"path":"src/types/Graph.ts","kind":"import-statement","original":"./Graph"}],"format":"esm"},"src/index.ts":{"bytes":449,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/ExplorerPlugin.tsx":{"bytes":2641,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/create-object.ts":{"bytes":4859,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":3709,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1130,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/create-object.ts","kind":"dynamic-import","original":"./create-object"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/util/node-color.ts":{"bytes":2624,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/util/plot.ts":{"bytes":1374,"imports":[],"format":"esm"},"src/util/index.ts":{"bytes":458,"imports":[{"path":"src/util/node-color.ts","kind":"import-statement","original":"./node-color"},{"path":"src/util/plot.ts","kind":"import-statement","original":"./plot"}],"format":"esm"},"src/components/Chart/Chart.tsx":{"bytes":4719,"imports":[{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"}],"format":"esm"},"src/components/Chart/index.ts":{"bytes":369,"imports":[{"path":"src/components/Chart/Chart.tsx","kind":"import-statement","original":"./Chart"}],"format":"esm"},"data/countries-110m.js":{"bytes":187226,"imports":[],"format":"esm"},"src/components/Globe/Globe.tsx":{"bytes":7283,"imports":[{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"data/countries-110m.js","kind":"import-statement","original":"../../../data/countries-110m.js"},{"path":"src/util/index.ts","kind":"import-statement","original":"../../util"}],"format":"esm"},"src/components/Globe/index.ts":{"bytes":369,"imports":[{"path":"src/components/Globe/Globe.tsx","kind":"import-statement","original":"./Globe"}],"format":"esm"},"src/components/Graph/graph-adapter.ts":{"bytes":4073,"imports":[],"format":"esm"},"src/components/Graph/CanvasForceGraph.tsx":{"bytes":12816,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"force-graph","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/Graph/graph-adapter.ts","kind":"import-statement","original":"./graph-adapter"}],"format":"esm"},"src/components/Graph/ForceGraph.tsx":{"bytes":12052,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/graph","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true}],"format":"esm"},"src/components/Graph/index.ts":{"bytes":490,"imports":[{"path":"src/components/Graph/CanvasForceGraph.tsx","kind":"import-statement","original":"./CanvasForceGraph"},{"path":"src/components/Graph/ForceGraph.tsx","kind":"import-statement","original":"./ForceGraph"}],"format":"esm"},"src/components/Tree/layout/useContainerSize.ts":{"bytes":5144,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/Lattice/Lattice.tsx":{"bytes":19160,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/util/node-color.ts","kind":"import-statement","original":"../../util/node-color"},{"path":"src/components/Tree/layout/useContainerSize.ts","kind":"import-statement","original":"../Tree/layout/useContainerSize"}],"format":"esm"},"src/components/Lattice/index.ts":{"bytes":375,"imports":[{"path":"src/components/Lattice/Lattice.tsx","kind":"import-statement","original":"./Lattice"}],"format":"esm"},"src/components/Tree/layout/slots.ts":{"bytes":2263,"imports":[],"format":"esm"},"src/components/Tree/layout/HierarchicalEdgeBundling.tsx":{"bytes":29822,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/util/node-color.ts","kind":"import-statement","original":"../../../util/node-color"},{"path":"src/components/Tree/layout/slots.ts","kind":"import-statement","original":"./slots"},{"path":"src/components/Tree/layout/useContainerSize.ts","kind":"import-statement","original":"./useContainerSize"}],"format":"esm"},"src/components/Tree/layout/hierarchy.ts":{"bytes":3401,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/layout/RadialTree.tsx":{"bytes":25201,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/util/node-color.ts","kind":"import-statement","original":"../../../util/node-color"},{"path":"src/components/Tree/layout/hierarchy.ts","kind":"import-statement","original":"./hierarchy"},{"path":"src/components/Tree/layout/slots.ts","kind":"import-statement","original":"./slots"},{"path":"src/components/Tree/layout/useContainerSize.ts","kind":"import-statement","original":"./useContainerSize"}],"format":"esm"},"src/components/Tree/layout/TidyTree.tsx":{"bytes":24597,"imports":[{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/Tree/layout/hierarchy.ts","kind":"import-statement","original":"./hierarchy"},{"path":"src/components/Tree/layout/slots.ts","kind":"import-statement","original":"./slots"},{"path":"src/components/Tree/layout/useContainerSize.ts","kind":"import-statement","original":"./useContainerSize"}],"format":"esm"},"src/components/Tree/layout/index.ts":{"bytes":768,"imports":[{"path":"src/components/Tree/layout/HierarchicalEdgeBundling.tsx","kind":"import-statement","original":"./HierarchicalEdgeBundling"},{"path":"src/components/Tree/layout/RadialTree.tsx","kind":"import-statement","original":"./RadialTree"},{"path":"src/components/Tree/layout/TidyTree.tsx","kind":"import-statement","original":"./TidyTree"},{"path":"src/components/Tree/layout/hierarchy.ts","kind":"import-statement","original":"./hierarchy"},{"path":"src/components/Tree/layout/slots.ts","kind":"import-statement","original":"./slots"}],"format":"esm"},"src/components/Tree/Tree.tsx":{"bytes":6327,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/Tree/layout/index.ts","kind":"import-statement","original":"./layout"}],"format":"esm"},"src/components/Tree/types/tree.ts":{"bytes":27886,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/types/types.ts":{"bytes":3987,"imports":[],"format":"esm"},"src/components/Tree/types/index.ts":{"bytes":449,"imports":[{"path":"src/components/Tree/types/tree.ts","kind":"import-statement","original":"./tree"},{"path":"src/components/Tree/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/components/Tree/index.ts":{"bytes":644,"imports":[{"path":"src/components/Tree/Tree.tsx","kind":"import-statement","original":"./Tree"},{"path":"src/components/Tree/layout/index.ts","kind":"import-statement","original":"./layout"},{"path":"src/components/Tree/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/components/index.ts":{"bytes":694,"imports":[{"path":"src/components/Chart/index.ts","kind":"import-statement","original":"./Chart"},{"path":"src/components/Globe/index.ts","kind":"import-statement","original":"./Globe"},{"path":"src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"},{"path":"src/components/Lattice/index.ts","kind":"import-statement","original":"./Lattice"},{"path":"src/components/Tree/index.ts","kind":"import-statement","original":"./Tree"}],"format":"esm"},"src/containers/ExplorerArticle/ExplorerArticle.tsx":{"bytes":50144,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-query","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-components","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true},{"path":"#hooks","kind":"import-statement","external":true},{"path":"src/util/node-color.ts","kind":"import-statement","original":"../../util/node-color"}],"format":"esm"},"src/containers/ExplorerArticle/index.ts":{"bytes":524,"imports":[{"path":"src/containers/ExplorerArticle/ExplorerArticle.tsx","kind":"import-statement","original":"./ExplorerArticle"}],"format":"esm"},"src/containers/index.ts":{"bytes":720,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/ExplorerArticle/index.ts","kind":"dynamic-import","original":"./ExplorerArticle"}],"format":"esm"},"src/hooks/useGraphModel.ts":{"bytes":4086,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":389,"imports":[{"path":"src/hooks/useGraphModel.ts","kind":"import-statement","original":"./useGraphModel"}],"format":"esm"},"src/plugin.ts":{"bytes":865,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/testing/generator.ts":{"bytes":5095,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/components/Tree/types/index.ts","kind":"import-statement","original":"../components/Tree/types"}],"format":"esm"},"src/testing/relations.ts":{"bytes":19577,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema/testing","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/testing/index.ts":{"bytes":827,"imports":[{"path":"src/ExplorerPlugin.tsx","kind":"import-statement","original":"../ExplorerPlugin"},{"path":"src/testing/generator.ts","kind":"import-statement","original":"./generator"},{"path":"src/testing/relations.ts","kind":"import-statement","original":"./relations"}],"format":"esm"},"src/translations.ts":{"bytes":3236,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-components/translations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13000},"dist/lib/neutral/testing/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-GRJXLL4Z.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-EM2BV4PF.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema/testing","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["ExplorerPlugin","buildOrgHierarchy","connectionsToEdges","createTree","generate","generateConnectedOrgs"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/index.ts":{"bytesInOutput":0},"src/testing/generator.ts":{"bytesInOutput":1006},"src/testing/relations.ts":{"bytesInOutput":3883}},"bytes":5243},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1564},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-components/translations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":841}},"bytes":965},"dist/lib/neutral/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/types/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-7SPMPHRS.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ExplorerAction","Graph"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":231},"dist/lib/neutral/create-object-F6TKVAGV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2465},"dist/lib/neutral/create-object-F6TKVAGV.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/create-object.ts","inputs":{"src/capabilities/create-object.ts":{"bytesInOutput":1158}},"bytes":1326},"dist/lib/neutral/react-surface-APBW2VQG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1907},"dist/lib/neutral/react-surface-APBW2VQG.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":906}},"bytes":1075},"dist/lib/neutral/ExplorerArticle-EAKRB55W.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":26369},"dist/lib/neutral/ExplorerArticle-EAKRB55W.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-V2OFO6PI.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-query","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-components","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true},{"path":"#hooks","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/ExplorerArticle/index.ts","inputs":{"src/containers/ExplorerArticle/ExplorerArticle.tsx":{"bytesInOutput":9893},"src/containers/ExplorerArticle/index.ts":{"bytesInOutput":0}},"bytes":10137},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-7SPMPHRS.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-DXIWQFYO.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ExplorerAction","Graph","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":284},"dist/lib/neutral/chunk-7SPMPHRS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3569},"dist/lib/neutral/chunk-7SPMPHRS.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"exports":["ExplorerAction_exports","Graph_exports"],"inputs":{"src/types/ExplorerAction.ts":{"bytesInOutput":574},"src/types/index.ts":{"bytesInOutput":0},"src/types/Graph.ts":{"bytesInOutput":1062}},"bytes":1841},"dist/lib/neutral/ExplorerPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/ExplorerPlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-GRJXLL4Z.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ExplorerPlugin","default"],"entryPoint":"src/ExplorerPlugin.tsx","inputs":{},"bytes":224},"dist/lib/neutral/chunk-GRJXLL4Z.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1390},"dist/lib/neutral/chunk-GRJXLL4Z.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["ExplorerPlugin","ExplorerPlugin_default"],"inputs":{"src/ExplorerPlugin.tsx":{"bytesInOutput":604}},"bytes":730},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":602},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/create-object-F6TKVAGV.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/react-surface-APBW2VQG.mjs","kind":"dynamic-import"}],"exports":["CreateObject","ReactSurface"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":248}},"bytes":388},"dist/lib/neutral/components/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":528969},"dist/lib/neutral/components/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-EM2BV4PF.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-V2OFO6PI.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"force-graph","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/graph","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["CanvasForceGraph","Chart","ForceGraph","Globe","HierarchicalEdgeBundling","Lattice","RadialTree","TidyTree","Tree","buildHierarchy","defaultTreeLayoutSlots","isCollapsed","isLeaf","treeTypeToTreeNode"],"entryPoint":"src/components/index.ts","inputs":{"src/components/Chart/Chart.tsx":{"bytesInOutput":1031},"src/util/index.ts":{"bytesInOutput":0},"src/util/plot.ts":{"bytesInOutput":133},"src/components/Chart/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/components/Globe/Globe.tsx":{"bytesInOutput":1707},"data/countries-110m.js":{"bytesInOutput":188376},"src/components/Globe/index.ts":{"bytesInOutput":0},"src/components/Graph/CanvasForceGraph.tsx":{"bytesInOutput":2568},"src/components/Graph/graph-adapter.ts":{"bytesInOutput":619},"src/components/Graph/index.ts":{"bytesInOutput":0},"src/components/Graph/ForceGraph.tsx":{"bytesInOutput":2755},"src/components/Lattice/Lattice.tsx":{"bytesInOutput":3651},"src/components/Tree/layout/useContainerSize.ts":{"bytesInOutput":871},"src/components/Lattice/index.ts":{"bytesInOutput":0},"src/components/Tree/Tree.tsx":{"bytesInOutput":1069},"src/components/Tree/layout/HierarchicalEdgeBundling.tsx":{"bytesInOutput":5686},"src/components/Tree/layout/slots.ts":{"bytesInOutput":668},"src/components/Tree/layout/index.ts":{"bytesInOutput":0},"src/components/Tree/layout/RadialTree.tsx":{"bytesInOutput":5009},"src/components/Tree/layout/hierarchy.ts":{"bytesInOutput":420},"src/components/Tree/layout/TidyTree.tsx":{"bytesInOutput":4855},"src/components/Tree/index.ts":{"bytesInOutput":0}},"bytes":220735},"dist/lib/neutral/chunk-EM2BV4PF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15154},"dist/lib/neutral/chunk-EM2BV4PF.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"exports":["Tree","treeTypeToTreeNode"],"inputs":{"src/components/Tree/types/types.ts":{"bytesInOutput":609},"src/components/Tree/types/tree.ts":{"bytesInOutput":6684},"src/components/Tree/types/index.ts":{"bytesInOutput":0}},"bytes":7455},"dist/lib/neutral/chunk-V2OFO6PI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1296},"dist/lib/neutral/chunk-V2OFO6PI.mjs":{"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["getNodeFillForObject"],"inputs":{"src/util/node-color.ts":{"bytesInOutput":292}},"bytes":398},"dist/lib/neutral/containers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":407},"dist/lib/neutral/containers/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/neutral/ExplorerArticle-EAKRB55W.mjs","kind":"dynamic-import"}],"exports":["ExplorerArticle"],"entryPoint":"src/containers/index.ts","inputs":{"src/containers/index.ts":{"bytesInOutput":107}},"bytes":232},"dist/lib/neutral/hooks/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2277},"dist/lib/neutral/hooks/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"exports":["useGraphModel"],"entryPoint":"src/hooks/index.ts","inputs":{"src/hooks/useGraphModel.ts":{"bytesInOutput":877},"src/hooks/index.ts":{"bytesInOutput":0}},"bytes":1003},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-DXIWQFYO.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":131},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":446},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-DXIWQFYO.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["ExplorerPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":111}},"bytes":272},"dist/lib/neutral/chunk-DXIWQFYO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1036},"dist/lib/neutral/chunk-DXIWQFYO.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":562}},"bytes":641},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-DXIWQFYO.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/plugin.ts
|
|
7
|
+
import { Plugin } from "@dxos/app-framework";
|
|
8
|
+
var ExplorerPlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
9
|
+
export {
|
|
10
|
+
ExplorerPlugin
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugin.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const ExplorerPlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,cAAc;AAIhB,IAAMC,iBAAiBC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
|
|
6
|
+
"names": ["Plugin", "ExplorerPlugin", "Plugin", "lazy", "meta"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/react-surface.tsx
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
7
|
+
import { Surface } from "@dxos/app-framework/ui";
|
|
8
|
+
import { AppSurface } from "@dxos/app-toolkit/ui";
|
|
9
|
+
import { ExplorerArticle } from "#containers";
|
|
10
|
+
import { Graph } from "#types";
|
|
11
|
+
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, Surface.create({
|
|
12
|
+
id: "article",
|
|
13
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
14
|
+
filter: AppSurface.oneOf(AppSurface.object(AppSurface.Article, Graph.Graph), AppSurface.object(AppSurface.Section, Graph.Graph)),
|
|
15
|
+
component: ({ data, role }) => {
|
|
16
|
+
return /* @__PURE__ */ React.createElement(ExplorerArticle, {
|
|
17
|
+
role,
|
|
18
|
+
subject: data.subject,
|
|
19
|
+
attendableId: data.attendableId
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}))));
|
|
23
|
+
export {
|
|
24
|
+
react_surface_default as default
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=react-surface-APBW2VQG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\n\nimport { ExplorerArticle } from '#containers';\nimport { Graph } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(\n Capabilities.ReactSurface,\n Surface.create({\n id: 'article',\n // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.\n filter: AppSurface.oneOf(\n AppSurface.object(AppSurface.Article, Graph.Graph),\n AppSurface.object(AppSurface.Section, Graph.Graph),\n ),\n component: ({ data, role }) => {\n return <ExplorerArticle role={role} subject={data.subject} attendableId={data.attendableId} />;\n },\n }),\n ),\n ),\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,kBAAkB;AAE3B,SAASC,uBAAuB;AAChC,SAASC,aAAa;AAEtB,IAAA,wBAAeJ,WAAWK,WAAW,MAC5BC,eACLN,WAAWO,YACTR,aAAaS,cACbP,QAAQQ,OAAO;EACbC,IAAI;;EAEJC,QAAQT,WAAWU,MACjBV,WAAWW,OAAOX,WAAWY,SAASV,MAAMA,KAAK,GACjDF,WAAWW,OAAOX,WAAWa,SAASX,MAAMA,KAAK,CAAA;EAEnDY,WAAW,CAAC,EAAEC,MAAMC,KAAI,MAAE;AACxB,WAAO,sBAAA,cAACf,iBAAAA;MAAgBe;MAAYC,SAASF,KAAKE;MAASC,cAAcH,KAAKG;;EAChF;AACF,CAAA,CAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "AppSurface", "ExplorerArticle", "Graph", "makeModule", "succeed", "contributes", "ReactSurface", "create", "id", "filter", "oneOf", "object", "Article", "Section", "component", "data", "role", "subject", "attendableId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ExplorerPlugin
|
|
3
|
+
} from "../chunk-GRJXLL4Z.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Tree
|
|
6
|
+
} from "../chunk-EM2BV4PF.mjs";
|
|
7
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
8
|
+
|
|
9
|
+
// src/testing/generator.ts
|
|
10
|
+
import { Key, Obj } from "@dxos/echo";
|
|
11
|
+
import { range } from "@dxos/util";
|
|
12
|
+
var random = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
|
|
13
|
+
var createTree = (spec = [], createText) => {
|
|
14
|
+
const tree = new Tree();
|
|
15
|
+
Obj.update(tree.tree, () => {
|
|
16
|
+
tree.root.data = {
|
|
17
|
+
text: "root"
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
const createNodes = (parent, spec2 = 0) => {
|
|
21
|
+
const count = Array.isArray(spec2) ? random(spec2[0], spec2[1]) : spec2;
|
|
22
|
+
return range(count, (i) => ({
|
|
23
|
+
id: Key.ObjectId.random(),
|
|
24
|
+
children: [],
|
|
25
|
+
data: {
|
|
26
|
+
text: createText?.() ?? [
|
|
27
|
+
parent.data.text,
|
|
28
|
+
i + 1
|
|
29
|
+
].join(".")
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
const createChildNodes = (parent, [count = 0, ...rest]) => {
|
|
34
|
+
const nodes = createNodes(parent, count);
|
|
35
|
+
nodes.forEach((n) => tree.addNode(parent, n));
|
|
36
|
+
if (rest.length) {
|
|
37
|
+
for (const node of nodes) {
|
|
38
|
+
createChildNodes(node, rest);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return parent;
|
|
42
|
+
};
|
|
43
|
+
createChildNodes(tree.root, spec);
|
|
44
|
+
return tree;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/testing/relations.ts
|
|
48
|
+
import { Query, Relation } from "@dxos/echo";
|
|
49
|
+
import { createObjectFactory } from "@dxos/schema/testing";
|
|
50
|
+
import { HasConnection, HasRelationship, Organization, Person, Pipeline } from "@dxos/types";
|
|
51
|
+
import { range as range2 } from "@dxos/util";
|
|
52
|
+
var SECTORS = [
|
|
53
|
+
"Technology",
|
|
54
|
+
"Finance",
|
|
55
|
+
"Research",
|
|
56
|
+
"Media"
|
|
57
|
+
];
|
|
58
|
+
var CONNECTION_KINDS = [
|
|
59
|
+
"partner",
|
|
60
|
+
"investor",
|
|
61
|
+
"vendor",
|
|
62
|
+
"customer"
|
|
63
|
+
];
|
|
64
|
+
var pick = (arr, rng = Math.random) => arr[Math.floor(rng() * arr.length)];
|
|
65
|
+
var generateConnectedOrgs = async (space, generator, { organizationCount = 12, personCount = 24, connectionCount = 18 } = {}) => {
|
|
66
|
+
const specs = [
|
|
67
|
+
{
|
|
68
|
+
type: Organization.Organization,
|
|
69
|
+
count: organizationCount
|
|
70
|
+
},
|
|
71
|
+
// Person has a Ref to Organization — generator fills it from objects already in db.
|
|
72
|
+
{
|
|
73
|
+
type: Person.Person,
|
|
74
|
+
count: personCount
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
const factory = createObjectFactory(space.db, generator);
|
|
78
|
+
await factory(specs);
|
|
79
|
+
const organizations = await space.db.query(Query.type(Organization.Organization)).run();
|
|
80
|
+
const people = await space.db.query(Query.type(Person.Person)).run();
|
|
81
|
+
const connections = [];
|
|
82
|
+
const seen = /* @__PURE__ */ new Set();
|
|
83
|
+
for (let i = 0; i < connectionCount && organizations.length >= 2; i++) {
|
|
84
|
+
const source = pick(organizations);
|
|
85
|
+
const target = pick(organizations);
|
|
86
|
+
if (source.id === target.id) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const key = `${source.id}->${target.id}`;
|
|
90
|
+
if (seen.has(key)) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
seen.add(key);
|
|
94
|
+
const relation = Relation.make(HasConnection.HasConnection, {
|
|
95
|
+
[Relation.Source]: source,
|
|
96
|
+
[Relation.Target]: target,
|
|
97
|
+
kind: pick(CONNECTION_KINDS)
|
|
98
|
+
});
|
|
99
|
+
connections.push(space.db.add(relation));
|
|
100
|
+
}
|
|
101
|
+
await space.db.flush();
|
|
102
|
+
return {
|
|
103
|
+
organizations,
|
|
104
|
+
people,
|
|
105
|
+
connections
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
var buildOrgHierarchy = (organizations, sectors = SECTORS) => {
|
|
109
|
+
const activeSectors = sectors.length > 0 ? sectors : [
|
|
110
|
+
"Uncategorized"
|
|
111
|
+
];
|
|
112
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
113
|
+
for (const sector of activeSectors) {
|
|
114
|
+
buckets.set(sector, []);
|
|
115
|
+
}
|
|
116
|
+
for (let i = 0; i < organizations.length; i++) {
|
|
117
|
+
const org = organizations[i];
|
|
118
|
+
const sector = activeSectors[i % activeSectors.length];
|
|
119
|
+
buckets.get(sector).push({
|
|
120
|
+
id: org.id,
|
|
121
|
+
label: org.name ?? org.id.slice(0, 6)
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
id: "root",
|
|
126
|
+
label: "Organizations",
|
|
127
|
+
children: activeSectors.map((sector) => ({
|
|
128
|
+
id: `sector:${sector}`,
|
|
129
|
+
label: sector,
|
|
130
|
+
children: buckets.get(sector) ?? []
|
|
131
|
+
}))
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
var defaultGenerateTypes = [
|
|
135
|
+
{
|
|
136
|
+
type: Organization.Organization,
|
|
137
|
+
count: 20
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
type: Person.Person,
|
|
141
|
+
count: 20
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
type: Pipeline.Pipeline,
|
|
145
|
+
count: 20
|
|
146
|
+
}
|
|
147
|
+
];
|
|
148
|
+
var defaultGenerateRelations = {
|
|
149
|
+
kind: "friend",
|
|
150
|
+
count: 10
|
|
151
|
+
};
|
|
152
|
+
var generate = async (space, generator, { spec = defaultGenerateTypes, relations = defaultGenerateRelations } = {}) => {
|
|
153
|
+
const createObjects = createObjectFactory(space.db, generator);
|
|
154
|
+
await createObjects(spec);
|
|
155
|
+
const contacts = await space.db.query(Query.type(Person.Person)).run();
|
|
156
|
+
if (contacts.length < 2 || relations.count <= 0) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
for (const _ of range2(relations.count)) {
|
|
160
|
+
const source = pick(contacts);
|
|
161
|
+
const target = pick(contacts);
|
|
162
|
+
if (source.id !== target.id) {
|
|
163
|
+
space.db.add(Relation.make(HasRelationship.HasRelationship, {
|
|
164
|
+
[Relation.Source]: source,
|
|
165
|
+
[Relation.Target]: target,
|
|
166
|
+
kind: relations.kind
|
|
167
|
+
}));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
var connectionsToEdges = (connections) => {
|
|
172
|
+
return connections.map((relation) => {
|
|
173
|
+
const source = Relation.getSource(relation);
|
|
174
|
+
const target = Relation.getTarget(relation);
|
|
175
|
+
if (!source?.id || !target?.id) {
|
|
176
|
+
return void 0;
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
source: source.id,
|
|
180
|
+
target: target.id,
|
|
181
|
+
kind: relation.kind
|
|
182
|
+
};
|
|
183
|
+
}).filter((e) => Boolean(e));
|
|
184
|
+
};
|
|
185
|
+
export {
|
|
186
|
+
ExplorerPlugin,
|
|
187
|
+
buildOrgHierarchy,
|
|
188
|
+
connectionsToEdges,
|
|
189
|
+
createTree,
|
|
190
|
+
generate,
|
|
191
|
+
generateConnectedOrgs
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/testing/generator.ts", "../../../../src/testing/relations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Key, Obj } from '@dxos/echo';\nimport { range } from '@dxos/util';\n\nimport { Tree, type TreeNodeType } from '../components/Tree/types';\n\ntype NumberOrNumberArray = number | number[];\n\nconst random = (min: number, max: number) => Math.floor(Math.random() * (max - min + 1)) + min;\n\n/**\n * Create hierarchical tree.\n */\nexport const createTree = (spec: NumberOrNumberArray[] = [], createText?: () => string): Tree => {\n const tree = new Tree();\n Obj.update(tree.tree, () => {\n tree.root.data = { text: 'root' };\n });\n\n const createNodes = (parent: TreeNodeType, spec: NumberOrNumberArray = 0): TreeNodeType[] => {\n const count = Array.isArray(spec) ? random(spec[0], spec[1]) : spec;\n return range(count, (i) => ({\n id: Key.ObjectId.random(),\n children: [],\n data: {\n text: createText?.() ?? [parent.data.text, i + 1].join('.'),\n },\n }));\n };\n\n const createChildNodes = (parent: TreeNodeType, [count = 0, ...rest]: NumberOrNumberArray[]): TreeNodeType => {\n const nodes = createNodes(parent, count);\n nodes.forEach((n) => tree.addNode(parent, n));\n if (rest.length) {\n for (const node of nodes) {\n createChildNodes(node, rest);\n }\n }\n\n return parent;\n };\n\n createChildNodes(tree.root, spec);\n return tree;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Space } from '@dxos/client/echo';\nimport { Obj, Query, Relation } from '@dxos/echo';\nimport { type TypeSpec, type ValueGenerator, createObjectFactory } from '@dxos/schema/testing';\nimport { HasConnection, HasRelationship, Organization, Person, Pipeline } from '@dxos/types';\nimport { range } from '@dxos/util';\n\nimport { type BundleEdge } from '../components/Tree/layout';\nimport { type TreeNode } from '../components/Tree/types';\n\nconst SECTORS = ['Technology', 'Finance', 'Research', 'Media'];\nconst CONNECTION_KINDS = ['partner', 'investor', 'vendor', 'customer'];\n\nconst pick = <T>(arr: readonly T[], rng = Math.random): T => arr[Math.floor(rng() * arr.length)];\n\nexport type ConnectedOrgsResult = {\n organizations: Obj.Any[];\n people: Obj.Any[];\n connections: Obj.Any[];\n};\n\nexport type ConnectedOrgsOptions = {\n organizationCount?: number;\n personCount?: number;\n connectionCount?: number;\n};\n\n/**\n * Populate a space with Organizations, People, and HasConnection relations between organizations.\n * Uses `createObjectFactory` to generate Org/Person properties from their `GeneratorAnnotation`s,\n * then layers manual HasConnection relations on top — the connection schema is fixed\n * (Org→Org) so it isn't a fit for the generator's reference inference.\n */\nexport const generateConnectedOrgs = async (\n space: Space,\n generator: ValueGenerator,\n { organizationCount = 12, personCount = 24, connectionCount = 18 }: ConnectedOrgsOptions = {},\n): Promise<ConnectedOrgsResult> => {\n const specs: TypeSpec[] = [\n { type: Organization.Organization, count: organizationCount },\n // Person has a Ref to Organization — generator fills it from objects already in db.\n { type: Person.Person, count: personCount },\n ];\n\n const factory = createObjectFactory(space.db, generator);\n await factory(specs);\n\n const organizations = await space.db.query(Query.type(Organization.Organization)).run();\n const people = await space.db.query(Query.type(Person.Person)).run();\n\n const connections: Obj.Any[] = [];\n const seen = new Set<string>();\n for (let i = 0; i < connectionCount && organizations.length >= 2; i++) {\n const source = pick(organizations);\n const target = pick(organizations);\n if (source.id === target.id) {\n continue;\n }\n const key = `${source.id}->${target.id}`;\n if (seen.has(key)) {\n continue;\n }\n seen.add(key);\n\n const relation = Relation.make(HasConnection.HasConnection, {\n [Relation.Source]: source as any,\n [Relation.Target]: target as any,\n kind: pick(CONNECTION_KINDS),\n });\n connections.push(space.db.add(relation as any));\n }\n\n await space.db.flush();\n return { organizations, people, connections };\n};\n\n/**\n * Build a TreeNode hierarchy: Root → Sector → Organization (leaf).\n * Organizations are deterministically bucketed into `SECTORS` so the demo has visible groups.\n */\nexport const buildOrgHierarchy = (organizations: Obj.Any[], sectors: readonly string[] = SECTORS): TreeNode => {\n // Avoid modulo-by-zero / missing-bucket crashes when the caller passes an empty sectors list.\n const activeSectors = sectors.length > 0 ? sectors : ['Uncategorized'];\n const buckets = new Map<string, TreeNode[]>();\n for (const sector of activeSectors) {\n buckets.set(sector, []);\n }\n for (let i = 0; i < organizations.length; i++) {\n const org = organizations[i] as any;\n const sector = activeSectors[i % activeSectors.length];\n buckets.get(sector)!.push({\n id: org.id,\n label: org.name ?? org.id.slice(0, 6),\n });\n }\n\n return {\n id: 'root',\n label: 'Organizations',\n children: activeSectors.map((sector) => ({\n id: `sector:${sector}`,\n label: sector,\n children: buckets.get(sector) ?? [],\n })),\n };\n};\n\nexport type GenerateOptions = {\n spec?: TypeSpec[];\n relations?: {\n count: number;\n kind: string;\n };\n};\n\nconst defaultGenerateTypes: TypeSpec[] = [\n {\n type: Organization.Organization,\n count: 20,\n },\n {\n type: Person.Person,\n count: 20,\n },\n {\n type: Pipeline.Pipeline,\n count: 20,\n },\n];\n\nconst defaultGenerateRelations: NonNullable<GenerateOptions['relations']> = {\n kind: 'friend',\n count: 10,\n};\n\n/**\n * Populate a space with a mixed dataset (Orgs, Pipelines, People) plus\n * `HasRelationship` edges between random pairs of People.\n *\n * Used by the force-directed and canvas-force graph stories that want a\n * heterogeneous typed dataset without caring about the precise shape of relations.\n */\nexport const generate = async (\n space: Space,\n generator: ValueGenerator,\n { spec = defaultGenerateTypes, relations = defaultGenerateRelations }: GenerateOptions = {},\n) => {\n const createObjects = createObjectFactory(space.db, generator);\n await createObjects(spec);\n\n const contacts: Obj.Any[] = await space.db.query(Query.type(Person.Person)).run();\n if (contacts.length < 2 || relations.count <= 0) {\n return;\n }\n\n for (const _ of range(relations.count)) {\n const source = pick(contacts);\n const target = pick(contacts);\n if (source.id !== target.id) {\n space.db.add(\n Relation.make(HasRelationship.HasRelationship, {\n [Relation.Source]: source as any,\n [Relation.Target]: target as any,\n kind: relations.kind,\n }) as any,\n );\n }\n }\n};\n\n/**\n * Convert HasConnection relations into bundle edges between organization ids.\n */\nexport const connectionsToEdges = (connections: Obj.Any[]): BundleEdge[] => {\n return connections\n .map((relation): BundleEdge | undefined => {\n const source = Relation.getSource(relation as any) as any;\n const target = Relation.getTarget(relation as any) as any;\n if (!source?.id || !target?.id) {\n return undefined;\n }\n return {\n source: source.id,\n target: target.id,\n kind: (relation as any).kind,\n };\n })\n .filter((e): e is BundleEdge => Boolean(e));\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Key", "Obj", "range", "random", "min", "max", "Math", "floor", "createTree", "spec", "createText", "tree", "Tree", "Obj", "update", "root", "data", "text", "createNodes", "parent", "count", "Array", "isArray", "range", "i", "id", "Key", "ObjectId", "children", "join", "createChildNodes", "rest", "nodes", "forEach", "n", "addNode", "length", "node", "Query", "Relation", "createObjectFactory", "HasConnection", "HasRelationship", "Organization", "Person", "Pipeline", "range", "SECTORS", "CONNECTION_KINDS", "pick", "arr", "rng", "Math", "random", "floor", "length", "generateConnectedOrgs", "space", "generator", "organizationCount", "personCount", "connectionCount", "specs", "type", "count", "factory", "db", "organizations", "query", "run", "people", "connections", "seen", "Set", "i", "source", "target", "id", "key", "has", "add", "relation", "make", "Source", "Target", "kind", "push", "flush", "buildOrgHierarchy", "sectors", "activeSectors", "buckets", "Map", "sector", "set", "org", "get", "label", "name", "slice", "children", "map", "defaultGenerateTypes", "defaultGenerateRelations", "generate", "spec", "relations", "createObjects", "contacts", "_", "connectionsToEdges", "getSource", "getTarget", "undefined", "filter", "e", "Boolean"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/translations.ts
|
|
4
|
+
import { Type } from "@dxos/echo";
|
|
5
|
+
import { translations as componentsTranslations } from "@dxos/react-ui-components/translations";
|
|
6
|
+
import { meta } from "#meta";
|
|
7
|
+
import { Graph } from "#types";
|
|
8
|
+
var translations = [
|
|
9
|
+
{
|
|
10
|
+
"en-US": {
|
|
11
|
+
[Type.getTypename(Graph.Graph)]: {
|
|
12
|
+
"typename.label": "Explorer",
|
|
13
|
+
"typename.label_zero": "Explorers",
|
|
14
|
+
"typename.label_one": "Explorer",
|
|
15
|
+
"typename.label_other": "Explorers",
|
|
16
|
+
"object-name.placeholder": "New explorer",
|
|
17
|
+
"add-object.label": "Add explorer",
|
|
18
|
+
"rename-object.label": "Rename explorer",
|
|
19
|
+
"delete-object.label": "Delete explorer",
|
|
20
|
+
"object-deleted.label": "Explorer deleted"
|
|
21
|
+
},
|
|
22
|
+
[meta.id]: {
|
|
23
|
+
"plugin.name": "Explorer",
|
|
24
|
+
"object-title.label": "Title"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
...componentsTranslations
|
|
29
|
+
];
|
|
30
|
+
export {
|
|
31
|
+
translations
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=translations.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Type } from '@dxos/echo';\nimport { type Resource } from '@dxos/react-ui';\nimport { translations as componentsTranslations } from '@dxos/react-ui-components/translations';\n\nimport { meta } from '#meta';\nimport { Graph } from '#types';\n\nexport const translations = [\n {\n 'en-US': {\n [Type.getTypename(Graph.Graph)]: {\n 'typename.label': 'Explorer',\n 'typename.label_zero': 'Explorers',\n 'typename.label_one': 'Explorer',\n 'typename.label_other': 'Explorers',\n 'object-name.placeholder': 'New explorer',\n 'add-object.label': 'Add explorer',\n 'rename-object.label': 'Rename explorer',\n 'delete-object.label': 'Delete explorer',\n 'object-deleted.label': 'Explorer deleted',\n },\n [meta.id]: {\n 'plugin.name': 'Explorer',\n 'object-title.label': 'Title',\n },\n },\n },\n ...componentsTranslations,\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,YAAY;AAErB,SAASC,gBAAgBC,8BAA8B;AAEvD,SAASC,YAAY;AACrB,SAASC,aAAa;AAEf,IAAMH,eAAe;EAC1B;IACE,SAAS;MACP,CAACD,KAAKK,YAAYD,MAAMA,KAAK,CAAA,GAAI;QAC/B,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;QAC3B,oBAAoB;QACpB,uBAAuB;QACvB,uBAAuB;QACvB,wBAAwB;MAC1B;MACA,CAACD,KAAKG,EAAE,GAAG;QACT,eAAe;QACf,sBAAsB;MACxB;IACF;EACF;KACGJ;;",
|
|
6
|
+
"names": ["Type", "translations", "componentsTranslations", "meta", "Graph", "getTypename", "id"]
|
|
7
|
+
}
|