@dxos/plugin-explorer 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/neutral/ExplorerContainer-5TOK2ZEY.mjs +40 -0
- package/dist/lib/neutral/ExplorerContainer-5TOK2ZEY.mjs.map +7 -0
- package/dist/lib/neutral/ExplorerPlugin.mjs +26 -0
- package/dist/lib/neutral/ExplorerPlugin.mjs.map +7 -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-5X5ATGCS.mjs +73 -0
- package/dist/lib/neutral/chunk-5X5ATGCS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HPIS2WXY.mjs +24 -0
- package/dist/lib/neutral/chunk-HPIS2WXY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/{browser/chunk-VNOGW2JS.mjs → neutral/components/index.mjs} +344 -411
- package/dist/lib/{node-esm/chunk-ODMJ7DPA.mjs.map → neutral/components/index.mjs.map} +4 -4
- 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 +40 -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-U3JEY7V7.mjs +26 -0
- package/dist/lib/neutral/react-surface-U3JEY7V7.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/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.map +1 -1
- package/dist/types/src/components/Chart/Chart.stories.d.ts +7 -2
- package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +8 -3
- 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 +7 -3
- 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/Graph/testing.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +5 -2
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/HierarchicalEdgeBundling.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/RadialTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/layout/TidyTree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing/generator.d.ts.map +1 -1
- package/dist/types/src/components/Tree/types/tree.d.ts +19 -17
- package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/types/types.d.ts +1 -1
- package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/plot.d.ts.map +1 -1
- package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts +6 -0
- package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ExplorerContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ExplorerContainer/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.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/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 +23 -0
- package/dist/types/src/types/Graph.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +107 -59
- package/src/ExplorerPlugin.test.ts +26 -0
- package/src/ExplorerPlugin.tsx +15 -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 +19 -25
- package/src/components/Globe/Globe.stories.tsx +22 -24
- 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 -35
- 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/Graph/testing.ts +11 -8
- package/src/components/Tree/Tree.stories.tsx +44 -38
- package/src/components/Tree/Tree.tsx +10 -5
- package/src/components/Tree/testing/generator.ts +4 -2
- package/src/components/Tree/types/tree.test.ts +7 -6
- package/src/components/Tree/types/tree.ts +42 -21
- package/src/components/Tree/types/types.ts +1 -1
- package/src/components/index.ts +0 -4
- package/src/containers/ExplorerContainer/ExplorerContainer.tsx +51 -0
- package/src/containers/ExplorerContainer/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/hooks/useGraphModel.ts +17 -10
- package/src/index.ts +1 -4
- package/src/meta.ts +9 -6
- package/src/plugin.ts +9 -0
- package/src/translations.ts +17 -12
- package/src/types/ExplorerAction.ts +20 -0
- package/src/types/Graph.ts +49 -0
- package/src/types/index.ts +2 -2
- package/src/typings.d.ts +8 -0
- package/dist/lib/browser/ExplorerContainer-7MTDS2TQ.mjs +0 -37
- package/dist/lib/browser/ExplorerContainer-7MTDS2TQ.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-3YITRGGW.mjs +0 -203
- package/dist/lib/browser/chunk-3YITRGGW.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-UL5EDJPE.mjs +0 -21
- package/dist/lib/browser/chunk-UL5EDJPE.mjs.map +0 -7
- package/dist/lib/browser/chunk-VNOGW2JS.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-VLGQKYBI.mjs +0 -31
- package/dist/lib/browser/react-surface-VLGQKYBI.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/lib/node-esm/ExplorerContainer-OBSRVHZZ.mjs +0 -38
- package/dist/lib/node-esm/ExplorerContainer-OBSRVHZZ.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-GFYXDQQV.mjs +0 -205
- package/dist/lib/node-esm/chunk-GFYXDQQV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ODMJ7DPA.mjs +0 -11343
- 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/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-BYJABDS5.mjs +0 -32
- package/dist/lib/node-esm/react-surface-BYJABDS5.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 -20
- 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/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 -67
- package/src/components/Graph/D3ForceGraph.tsx +0 -101
- package/src/types/schema.ts +0 -16
- package/src/types/types.ts +0 -22
- /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
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useGraphModel
|
|
3
|
-
} from "./chunk-2MKBRIUT.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Chart,
|
|
6
|
-
ExplorerContainer,
|
|
7
|
-
Globe,
|
|
8
|
-
Tree,
|
|
9
|
-
defaultTreeLayoutSlots
|
|
10
|
-
} from "./chunk-VNOGW2JS.mjs";
|
|
11
|
-
import {
|
|
12
|
-
D3ForceGraph,
|
|
13
|
-
ForceGraph
|
|
14
|
-
} from "./chunk-3YITRGGW.mjs";
|
|
15
|
-
import {
|
|
16
|
-
ExplorerAction,
|
|
17
|
-
ViewType
|
|
18
|
-
} from "./chunk-CZZ3DDR7.mjs";
|
|
19
|
-
import {
|
|
20
|
-
EXPLORER_PLUGIN,
|
|
21
|
-
meta
|
|
22
|
-
} from "./chunk-UL5EDJPE.mjs";
|
|
23
|
-
|
|
24
|
-
// src/ExplorerPlugin.tsx
|
|
25
|
-
import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from "@dxos/app-framework";
|
|
26
|
-
import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
|
|
27
|
-
import { SpaceCapabilities } from "@dxos/plugin-space";
|
|
28
|
-
import { defineObjectForm } from "@dxos/plugin-space/types";
|
|
29
|
-
|
|
30
|
-
// src/capabilities/index.ts
|
|
31
|
-
import { lazy } from "@dxos/app-framework";
|
|
32
|
-
var IntentResolver = lazy(() => import("./intent-resolver-7MVEYNX7.mjs"));
|
|
33
|
-
var ReactSurface = lazy(() => import("./react-surface-VLGQKYBI.mjs"));
|
|
34
|
-
|
|
35
|
-
// src/translations.ts
|
|
36
|
-
var translations = [
|
|
37
|
-
{
|
|
38
|
-
"en-US": {
|
|
39
|
-
[ViewType.typename]: {
|
|
40
|
-
"typename label": "Explorer",
|
|
41
|
-
"typename label_zero": "Explorers",
|
|
42
|
-
"typename label_one": "Explorer",
|
|
43
|
-
"typename label_other": "Explorers",
|
|
44
|
-
"object name placeholder": "New explorer",
|
|
45
|
-
"rename object label": "Rename explorer",
|
|
46
|
-
"delete object label": "Delete explorer"
|
|
47
|
-
},
|
|
48
|
-
[meta.id]: {
|
|
49
|
-
"plugin name": "Explorer",
|
|
50
|
-
"object title label": "Title"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
];
|
|
55
|
-
|
|
56
|
-
// src/ExplorerPlugin.tsx
|
|
57
|
-
var ExplorerPlugin = () => definePlugin(meta, [
|
|
58
|
-
defineModule({
|
|
59
|
-
id: `${meta.id}/module/translations`,
|
|
60
|
-
activatesOn: Events.SetupTranslations,
|
|
61
|
-
activate: () => contributes(Capabilities.Translations, translations)
|
|
62
|
-
}),
|
|
63
|
-
defineModule({
|
|
64
|
-
id: `${meta.id}/module/metadata`,
|
|
65
|
-
activatesOn: Events.SetupMetadata,
|
|
66
|
-
activate: () => contributes(Capabilities.Metadata, {
|
|
67
|
-
id: ViewType.typename,
|
|
68
|
-
metadata: {
|
|
69
|
-
icon: "ph--graph--regular"
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
}),
|
|
73
|
-
defineModule({
|
|
74
|
-
id: `${meta.id}/module/object-form`,
|
|
75
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
76
|
-
activate: () => contributes(SpaceCapabilities.ObjectForm, defineObjectForm({
|
|
77
|
-
objectSchema: ViewType,
|
|
78
|
-
getIntent: () => createIntent(ExplorerAction.Create)
|
|
79
|
-
}))
|
|
80
|
-
}),
|
|
81
|
-
defineModule({
|
|
82
|
-
id: `${meta.id}/module/schema`,
|
|
83
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
84
|
-
activate: () => contributes(ClientCapabilities.Schema, [
|
|
85
|
-
ViewType
|
|
86
|
-
])
|
|
87
|
-
}),
|
|
88
|
-
defineModule({
|
|
89
|
-
id: `${meta.id}/module/react-surface`,
|
|
90
|
-
activatesOn: Events.SetupReactSurface,
|
|
91
|
-
activate: ReactSurface
|
|
92
|
-
}),
|
|
93
|
-
defineModule({
|
|
94
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
95
|
-
activatesOn: Events.SetupIntentResolver,
|
|
96
|
-
activate: IntentResolver
|
|
97
|
-
})
|
|
98
|
-
]);
|
|
99
|
-
export {
|
|
100
|
-
Chart,
|
|
101
|
-
D3ForceGraph,
|
|
102
|
-
EXPLORER_PLUGIN,
|
|
103
|
-
ExplorerContainer,
|
|
104
|
-
ExplorerPlugin,
|
|
105
|
-
ForceGraph,
|
|
106
|
-
Globe,
|
|
107
|
-
Tree,
|
|
108
|
-
defaultTreeLayoutSlots,
|
|
109
|
-
meta,
|
|
110
|
-
useGraphModel
|
|
111
|
-
};
|
|
112
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/ExplorerPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { defineObjectForm } from '@dxos/plugin-space/types';\n\nimport { IntentResolver, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\nimport { ExplorerAction, ViewType } from './types';\n\nexport const ExplorerPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: ViewType.typename,\n metadata: {\n icon: 'ph--graph--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/object-form`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () =>\n contributes(\n SpaceCapabilities.ObjectForm,\n defineObjectForm({\n objectSchema: ViewType,\n getIntent: () => createIntent(ExplorerAction.Create),\n }),\n ),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, [ViewType]),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\nimport { ViewType } from './types';\n\nexport const translations = [\n {\n 'en-US': {\n [ViewType.typename]: {\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 'rename object label': 'Rename explorer',\n 'delete object label': 'Delete explorer',\n },\n [meta.id]: {\n 'plugin name': 'Explorer',\n 'object title label': 'Title',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,cAAcC,QAAQC,aAAaC,cAAcC,cAAcC,oBAAoB;AAC5F,SAASC,oBAAoBC,oBAAoB;AACjD,SAASC,yBAAyB;AAClC,SAASC,wBAAwB;;;ACHjC,SAASC,YAAY;AAEd,IAAMC,iBAAiBC,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMC,eAAeD,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACEvC,IAAME,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,SAASC,QAAQ,GAAG;QACnB,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;QAC3B,uBAAuB;QACvB,uBAAuB;MACzB;MACA,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,sBAAsB;MACxB;IACF;EACF;;;;AFZK,IAAMC,iBAAiB,MAC5BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,YAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAU,MACRC,YAAYC,aAAaI,UAAU;MACjCV,IAAIW,SAASC;MACbC,UAAU;QACRC,MAAM;MACR;IACF,CAAA;EACJ,CAAA;EACAf,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAac,aAAaC;IAC1BZ,UAAU,MACRC,YACEY,kBAAkBC,YAClBC,iBAAiB;MACfC,cAAcT;MACdU,WAAW,MAAMC,aAAaC,eAAeC,MAAM;IACrD,CAAA,CAAA;EAEN,CAAA;EACAzB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAac,aAAaC;IAC1BZ,UAAU,MAAMC,YAAYoB,mBAAmBC,QAAQ;MAACf;KAAS;EACnE,CAAA;EACAZ,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOyB;IACpBvB,UAAUwB;EACZ,CAAA;EACA7B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAO2B;IACpBzB,UAAU0B;EACZ,CAAA;CACD;",
|
|
6
|
-
"names": ["Capabilities", "Events", "contributes", "createIntent", "defineModule", "definePlugin", "ClientCapabilities", "ClientEvents", "SpaceCapabilities", "defineObjectForm", "lazy", "IntentResolver", "lazy", "ReactSurface", "translations", "ViewType", "typename", "meta", "id", "ExplorerPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "ViewType", "typename", "metadata", "icon", "ClientEvents", "SetupSchema", "SpaceCapabilities", "ObjectForm", "defineObjectForm", "objectSchema", "getIntent", "createIntent", "ExplorerAction", "Create", "ClientCapabilities", "Schema", "SetupReactSurface", "ReactSurface", "SetupIntentResolver", "IntentResolver"]
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ExplorerAction,
|
|
3
|
-
ViewType
|
|
4
|
-
} from "./chunk-CZZ3DDR7.mjs";
|
|
5
|
-
import "./chunk-UL5EDJPE.mjs";
|
|
6
|
-
|
|
7
|
-
// src/capabilities/intent-resolver.ts
|
|
8
|
-
import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
|
|
9
|
-
import { Obj } from "@dxos/echo";
|
|
10
|
-
var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
|
|
11
|
-
intent: ExplorerAction.Create,
|
|
12
|
-
resolve: ({ name }) => ({
|
|
13
|
-
data: {
|
|
14
|
-
object: Obj.make(ViewType, {
|
|
15
|
-
name,
|
|
16
|
-
type: ""
|
|
17
|
-
})
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
}));
|
|
21
|
-
export {
|
|
22
|
-
intent_resolver_default as default
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=intent-resolver-7MVEYNX7.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { ExplorerAction, ViewType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ExplorerAction.Create,\n resolve: ({ name }) => ({\n data: { object: Obj.make(ViewType, { name, type: '' }) },\n }),\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,SAASA,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,WAAW;AAIpB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,eAAeC;EACvBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MAAEC,QAAQC,IAAIC,KAAKC,UAAU;QAAEL;QAAMM,MAAM;MAAG,CAAA;IAAG;EACzD;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "createResolver", "Obj", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ExplorerAction", "Create", "resolve", "name", "data", "object", "Obj", "make", "ViewType", "type"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/components/plot.ts":{"bytes":1407,"imports":[],"format":"esm"},"src/components/Chart/Chart.tsx":{"bytes":5135,"imports":[{"path":"@preact-signals/safe-react/tracking","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":"src/components/plot.ts","kind":"import-statement","original":"../plot"}],"format":"esm"},"src/components/Chart/index.ts":{"bytes":469,"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":7783,"imports":[{"path":"@preact-signals/safe-react/tracking","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":"data/countries-110m.js","kind":"import-statement","original":"../../../data/countries-110m.js"},{"path":"src/components/plot.ts","kind":"import-statement","original":"../plot"}],"format":"esm"},"src/components/Globe/index.ts":{"bytes":469,"imports":[{"path":"src/components/Globe/Globe.tsx","kind":"import-statement","original":"./Globe"}],"format":"esm"},"src/components/Graph/D3ForceGraph.tsx":{"bytes":10389,"imports":[{"path":"@preact-signals/safe-react/tracking","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/react-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/adapter.ts":{"bytes":3662,"imports":[],"format":"esm"},"src/components/Graph/ForceGraph.tsx":{"bytes":11049,"imports":[{"path":"@preact-signals/safe-react/tracking","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/plugin-search","kind":"import-statement","external":true},{"path":"src/components/Graph/adapter.ts","kind":"import-statement","original":"./adapter"}],"format":"esm"},"src/components/Graph/index.ts":{"bytes":582,"imports":[{"path":"src/components/Graph/D3ForceGraph.tsx","kind":"import-statement","original":"./D3ForceGraph"},{"path":"src/components/Graph/ForceGraph.tsx","kind":"import-statement","original":"./ForceGraph"}],"format":"esm"},"src/components/Tree/layout/HierarchicalEdgeBundling.ts":{"bytes":17479,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/layout/RadialTree.ts":{"bytes":8705,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/layout/TidyTree.ts":{"bytes":9207,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/layout/index.ts":{"bytes":1094,"imports":[{"path":"src/components/Tree/layout/HierarchicalEdgeBundling.ts","kind":"import-statement","original":"./HierarchicalEdgeBundling"},{"path":"src/components/Tree/layout/RadialTree.ts","kind":"import-statement","original":"./RadialTree"},{"path":"src/components/Tree/layout/TidyTree.ts","kind":"import-statement","original":"./TidyTree"}],"format":"esm"},"src/components/Tree/types/tree.ts":{"bytes":26396,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/types/types.ts":{"bytes":3303,"imports":[],"format":"esm"},"src/components/Tree/types/index.ts":{"bytes":554,"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/Tree.tsx":{"bytes":9666,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"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/Tree/index.ts":{"bytes":467,"imports":[{"path":"src/components/Tree/Tree.tsx","kind":"import-statement","original":"./Tree"}],"format":"esm"},"src/hooks/useGraphModel.ts":{"bytes":3466,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":482,"imports":[{"path":"src/hooks/useGraphModel.ts","kind":"import-statement","original":"./useGraphModel"}],"format":"esm"},"src/components/ExplorerContainer.tsx":{"bytes":3345,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-search","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"}],"format":"esm"},"src/components/index.ts":{"bytes":1097,"imports":[{"path":"react","kind":"import-statement","external":true},{"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/Tree/index.ts","kind":"import-statement","original":"./Tree"},{"path":"src/components/ExplorerContainer.tsx","kind":"dynamic-import","original":"./ExplorerContainer"}],"format":"esm"},"src/meta.ts":{"bytes":1861,"imports":[],"format":"esm"},"src/types/schema.ts":{"bytes":1503,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"src/types/types.ts":{"bytes":2239,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"},"src/types/index.ts":{"bytes":544,"imports":[{"path":"src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/capabilities/intent-resolver.ts":{"bytes":2169,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":2866,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1038,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":2488,"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":7389,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":732,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/ExplorerPlugin.tsx","kind":"import-statement","original":"./ExplorerPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5186},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-2MKBRIUT.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-VNOGW2JS.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-3YITRGGW.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZZ3DDR7.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-UL5EDJPE.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/intent-resolver-7MVEYNX7.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/react-surface-VLGQKYBI.mjs","kind":"dynamic-import"}],"exports":["Chart","D3ForceGraph","EXPLORER_PLUGIN","ExplorerContainer","ExplorerPlugin","ForceGraph","Globe","Tree","defaultTreeLayoutSlots","meta","useGraphModel"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/ExplorerPlugin.tsx":{"bytesInOutput":1538},"src/capabilities/index.ts":{"bytesInOutput":190},"src/translations.ts":{"bytesInOutput":510}},"bytes":2929},"dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/meta.mjs":{"imports":[{"path":"dist/lib/browser/chunk-UL5EDJPE.mjs","kind":"import-statement"}],"exports":["EXPLORER_PLUGIN","meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":138},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CZZ3DDR7.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-UL5EDJPE.mjs","kind":"import-statement"}],"exports":["ExplorerAction","ViewType"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":178},"dist/lib/browser/ExplorerContainer-7MTDS2TQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1639},"dist/lib/browser/ExplorerContainer-7MTDS2TQ.mjs":{"imports":[{"path":"dist/lib/browser/chunk-2MKBRIUT.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-3YITRGGW.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-search","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/components/ExplorerContainer.tsx","inputs":{"src/components/ExplorerContainer.tsx":{"bytesInOutput":824}},"bytes":1083},"dist/lib/browser/chunk-2MKBRIUT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1896},"dist/lib/browser/chunk-2MKBRIUT.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"exports":["useGraphModel"],"inputs":{"src/hooks/useGraphModel.ts":{"bytesInOutput":640},"src/hooks/index.ts":{"bytesInOutput":0}},"bytes":743},"dist/lib/browser/intent-resolver-7MVEYNX7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1089},"dist/lib/browser/intent-resolver-7MVEYNX7.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CZZ3DDR7.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-UL5EDJPE.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/intent-resolver.ts","inputs":{"src/capabilities/intent-resolver.ts":{"bytesInOutput":373}},"bytes":616},"dist/lib/browser/react-surface-VLGQKYBI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1419},"dist/lib/browser/react-surface-VLGQKYBI.mjs":{"imports":[{"path":"dist/lib/browser/chunk-VNOGW2JS.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-3YITRGGW.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CZZ3DDR7.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-UL5EDJPE.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":503}},"bytes":841},"dist/lib/browser/chunk-VNOGW2JS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":487594},"dist/lib/browser/chunk-VNOGW2JS.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","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":"@preact-signals/safe-react/tracking","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":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"d3","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/browser/ExplorerContainer-7MTDS2TQ.mjs","kind":"dynamic-import"}],"exports":["Chart","ExplorerContainer","Globe","Tree","defaultTreeLayoutSlots"],"inputs":{"src/components/Chart/Chart.tsx":{"bytesInOutput":1254},"src/components/plot.ts":{"bytesInOutput":133},"src/components/Globe/Globe.tsx":{"bytesInOutput":1968},"data/countries-110m.js":{"bytesInOutput":188376},"src/components/Tree/Tree.tsx":{"bytesInOutput":2157},"src/components/Tree/layout/HierarchicalEdgeBundling.ts":{"bytesInOutput":2167},"src/components/Tree/layout/RadialTree.ts":{"bytesInOutput":1355},"src/components/Tree/layout/TidyTree.ts":{"bytesInOutput":1596},"src/components/Tree/types/tree.ts":{"bytesInOutput":6548},"src/components/Tree/types/index.ts":{"bytesInOutput":0},"src/components/Tree/types/types.ts":{"bytesInOutput":82},"src/components/index.ts":{"bytesInOutput":110},"src/components/Chart/index.ts":{"bytesInOutput":0},"src/components/Globe/index.ts":{"bytesInOutput":0},"src/components/Tree/index.ts":{"bytesInOutput":0}},"bytes":206395},"dist/lib/browser/chunk-3YITRGGW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12597},"dist/lib/browser/chunk-3YITRGGW.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","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/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-graph/styles/graph.css","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","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/plugin-search","kind":"import-statement","external":true}],"exports":["D3ForceGraph","ForceGraph"],"inputs":{"src/components/Graph/D3ForceGraph.tsx":{"bytesInOutput":2402},"src/components/Graph/ForceGraph.tsx":{"bytesInOutput":2413},"src/components/Graph/adapter.ts":{"bytesInOutput":873},"src/components/Graph/index.ts":{"bytesInOutput":0}},"bytes":5931},"dist/lib/browser/chunk-CZZ3DDR7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1807},"dist/lib/browser/chunk-CZZ3DDR7.mjs":{"imports":[{"path":"dist/lib/browser/chunk-UL5EDJPE.mjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true}],"exports":["ExplorerAction","ViewType"],"inputs":{"src/types/schema.ts":{"bytesInOutput":261},"src/types/index.ts":{"bytesInOutput":0},"src/types/types.ts":{"bytesInOutput":455}},"bytes":907},"dist/lib/browser/chunk-UL5EDJPE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":896},"dist/lib/browser/chunk-UL5EDJPE.mjs":{"imports":[],"exports":["EXPLORER_PLUGIN","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":427}},"bytes":525}}}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ExplorerContainer
|
|
3
|
-
} from "./chunk-VNOGW2JS.mjs";
|
|
4
|
-
import "./chunk-3YITRGGW.mjs";
|
|
5
|
-
import {
|
|
6
|
-
ViewType
|
|
7
|
-
} from "./chunk-CZZ3DDR7.mjs";
|
|
8
|
-
import {
|
|
9
|
-
EXPLORER_PLUGIN
|
|
10
|
-
} from "./chunk-UL5EDJPE.mjs";
|
|
11
|
-
|
|
12
|
-
// src/capabilities/react-surface.tsx
|
|
13
|
-
import React from "react";
|
|
14
|
-
import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
|
|
15
|
-
import { Obj } from "@dxos/echo";
|
|
16
|
-
var react_surface_default = () => contributes(Capabilities.ReactSurface, createSurface({
|
|
17
|
-
id: `${EXPLORER_PLUGIN}/article`,
|
|
18
|
-
role: [
|
|
19
|
-
"article",
|
|
20
|
-
"section"
|
|
21
|
-
],
|
|
22
|
-
filter: (data) => Obj.instanceOf(ViewType, data.subject),
|
|
23
|
-
component: ({ data, role }) => /* @__PURE__ */ React.createElement(ExplorerContainer, {
|
|
24
|
-
view: data.subject,
|
|
25
|
-
role
|
|
26
|
-
})
|
|
27
|
-
}));
|
|
28
|
-
export {
|
|
29
|
-
react_surface_default as default
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=react-surface-VLGQKYBI.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { ExplorerContainer } from '../components';\nimport { EXPLORER_PLUGIN } from '../meta';\nimport { ViewType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.ReactSurface,\n createSurface({\n id: `${EXPLORER_PLUGIN}/article`,\n role: ['article', 'section'],\n filter: (data): data is { subject: ViewType } => Obj.instanceOf(ViewType, data.subject),\n component: ({ data, role }) => <ExplorerContainer view={data.subject} role={role} />,\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;AAMpB,IAAA,wBAAe,MACbC,YACEC,aAAaC,cACbC,cAAc;EACZC,IAAI,GAAGC,eAAAA;EACPC,MAAM;IAAC;IAAW;;EAClBC,QAAQ,CAACC,SAAwCC,IAAIC,WAAWC,UAAUH,KAAKI,OAAO;EACtFC,WAAW,CAAC,EAAEL,MAAMF,KAAI,MAAO,sBAAA,cAACQ,mBAAAA;IAAkBC,MAAMP,KAAKI;IAASN;;AACxE,CAAA,CAAA;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "EXPLORER_PLUGIN", "role", "filter", "data", "Obj", "instanceOf", "ViewType", "subject", "component", "ExplorerContainer", "view"]
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
useGraphModel
|
|
4
|
-
} from "./chunk-3ODK27PU.mjs";
|
|
5
|
-
import {
|
|
6
|
-
D3ForceGraph
|
|
7
|
-
} from "./chunk-GFYXDQQV.mjs";
|
|
8
|
-
|
|
9
|
-
// src/components/ExplorerContainer.tsx
|
|
10
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
11
|
-
import React from "react";
|
|
12
|
-
import { useGlobalSearch } from "@dxos/plugin-search";
|
|
13
|
-
import { getSpace } from "@dxos/react-client/echo";
|
|
14
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
15
|
-
var ExplorerContainer = ({ role, view }) => {
|
|
16
|
-
var _effect = _useSignals();
|
|
17
|
-
try {
|
|
18
|
-
const space = getSpace(view);
|
|
19
|
-
const model = useGraphModel(space);
|
|
20
|
-
const { match } = useGlobalSearch();
|
|
21
|
-
if (!space || !model) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
25
|
-
size: role === "section" ? "square" : "intrinsic"
|
|
26
|
-
}, /* @__PURE__ */ React.createElement(D3ForceGraph, {
|
|
27
|
-
model,
|
|
28
|
-
match
|
|
29
|
-
}));
|
|
30
|
-
} finally {
|
|
31
|
-
_effect.f();
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
var ExplorerContainer_default = ExplorerContainer;
|
|
35
|
-
export {
|
|
36
|
-
ExplorerContainer_default as default
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=ExplorerContainer-OBSRVHZZ.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,33 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/hooks/useGraphModel.ts
|
|
4
|
-
import { useEffect, useState } from "react";
|
|
5
|
-
import { SpaceGraphModel } from "@dxos/schema";
|
|
6
|
-
var useGraphModel = (space, filter, options, queue) => {
|
|
7
|
-
const [model, setModel] = useState(void 0);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (!space) {
|
|
10
|
-
void model?.close();
|
|
11
|
-
setModel(void 0);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
if (!model || model.queue !== queue) {
|
|
15
|
-
const model2 = new SpaceGraphModel().setFilter(filter).setOptions(options);
|
|
16
|
-
void model2.open(space, queue);
|
|
17
|
-
setModel(model2);
|
|
18
|
-
} else {
|
|
19
|
-
model.setFilter(filter).setOptions(options);
|
|
20
|
-
}
|
|
21
|
-
}, [
|
|
22
|
-
space,
|
|
23
|
-
filter,
|
|
24
|
-
options,
|
|
25
|
-
queue
|
|
26
|
-
]);
|
|
27
|
-
return model;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
useGraphModel
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=chunk-3ODK27PU.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,39 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
EXPLORER_PLUGIN
|
|
4
|
-
} from "./chunk-PIAXA43R.mjs";
|
|
5
|
-
|
|
6
|
-
// src/types/schema.ts
|
|
7
|
-
import { Schema } from "effect";
|
|
8
|
-
import { TypedObject } from "@dxos/echo-schema";
|
|
9
|
-
var ViewType = class extends TypedObject({
|
|
10
|
-
typename: "dxos.org/type/ExplorerView",
|
|
11
|
-
version: "0.1.0"
|
|
12
|
-
})({
|
|
13
|
-
name: Schema.optional(Schema.String),
|
|
14
|
-
type: Schema.String
|
|
15
|
-
}) {
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// src/types/types.ts
|
|
19
|
-
import { Schema as Schema2 } from "effect";
|
|
20
|
-
(function(ExplorerAction2) {
|
|
21
|
-
const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;
|
|
22
|
-
class Create extends Schema2.TaggedClass()(`${EXPLORER_ACTION}/create`, {
|
|
23
|
-
input: Schema2.Struct({
|
|
24
|
-
name: Schema2.optional(Schema2.String)
|
|
25
|
-
}),
|
|
26
|
-
output: Schema2.Struct({
|
|
27
|
-
object: ViewType
|
|
28
|
-
})
|
|
29
|
-
}) {
|
|
30
|
-
}
|
|
31
|
-
ExplorerAction2.Create = Create;
|
|
32
|
-
})(ExplorerAction || (ExplorerAction = {}));
|
|
33
|
-
var ExplorerAction;
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
ViewType,
|
|
37
|
-
ExplorerAction
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=chunk-4GWDNZ4Z.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
|
-
}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/components/Graph/D3ForceGraph.tsx
|
|
4
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
5
|
-
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
6
|
-
import { Obj } from "@dxos/echo";
|
|
7
|
-
import { SelectionModel } from "@dxos/graph";
|
|
8
|
-
import { GraphForceProjector, SVG } from "@dxos/react-ui-graph";
|
|
9
|
-
import { getHashColor } from "@dxos/react-ui-theme";
|
|
10
|
-
import "@dxos/react-ui-graph/styles/graph.css";
|
|
11
|
-
var D3ForceGraph = ({ classNames, model, selection: _selection, grid, ...props }) => {
|
|
12
|
-
var _effect = _useSignals();
|
|
13
|
-
try {
|
|
14
|
-
const context = useRef(null);
|
|
15
|
-
const projector = useMemo(() => {
|
|
16
|
-
if (context.current) {
|
|
17
|
-
return new GraphForceProjector(context.current, {
|
|
18
|
-
attributes: {
|
|
19
|
-
linkForce: (edge) => {
|
|
20
|
-
return edge.data?.object?.active !== false;
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
forces: {
|
|
24
|
-
point: {
|
|
25
|
-
strength: 0.01
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}, [
|
|
31
|
-
context.current
|
|
32
|
-
]);
|
|
33
|
-
const graph = useRef(null);
|
|
34
|
-
const selection = useMemo(() => _selection ?? new SelectionModel(), [
|
|
35
|
-
_selection
|
|
36
|
-
]);
|
|
37
|
-
useEffect(() => graph.current?.repaint(), [
|
|
38
|
-
selection.selected.value
|
|
39
|
-
]);
|
|
40
|
-
const handleSelect = useCallback((node) => {
|
|
41
|
-
if (selection.contains(node.id)) {
|
|
42
|
-
selection.remove(node.id);
|
|
43
|
-
} else {
|
|
44
|
-
selection.add(node.id);
|
|
45
|
-
}
|
|
46
|
-
}, [
|
|
47
|
-
selection
|
|
48
|
-
]);
|
|
49
|
-
return /* @__PURE__ */ React.createElement(SVG.Root, {
|
|
50
|
-
ref: context,
|
|
51
|
-
classNames
|
|
52
|
-
}, /* @__PURE__ */ React.createElement(SVG.Markers, null), grid && /* @__PURE__ */ React.createElement(SVG.Grid, {
|
|
53
|
-
axis: true
|
|
54
|
-
}), /* @__PURE__ */ React.createElement(SVG.Zoom, {
|
|
55
|
-
extent: [
|
|
56
|
-
1 / 2,
|
|
57
|
-
2
|
|
58
|
-
]
|
|
59
|
-
}, /* @__PURE__ */ React.createElement(SVG.Graph, {
|
|
60
|
-
...props,
|
|
61
|
-
ref: graph,
|
|
62
|
-
model,
|
|
63
|
-
projector,
|
|
64
|
-
labels: {
|
|
65
|
-
text: (node) => {
|
|
66
|
-
return node.data?.data.label ?? node.id;
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
attributes: {
|
|
70
|
-
node: (node) => {
|
|
71
|
-
const obj = node.data?.data.object;
|
|
72
|
-
return {
|
|
73
|
-
data: {
|
|
74
|
-
color: getHashColor(obj && Obj.getTypename(obj))?.color
|
|
75
|
-
},
|
|
76
|
-
classes: {
|
|
77
|
-
"dx-selected": selection.contains(node.id)
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
onSelect: handleSelect
|
|
83
|
-
})));
|
|
84
|
-
} finally {
|
|
85
|
-
_effect.f();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
// src/components/Graph/ForceGraph.tsx
|
|
90
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
91
|
-
import { forceLink, forceManyBody } from "d3";
|
|
92
|
-
import NativeForceGraph from "force-graph";
|
|
93
|
-
import React2, { useEffect as useEffect2, useRef as useRef2, useState } from "react";
|
|
94
|
-
import { useResizeDetector } from "react-resize-detector";
|
|
95
|
-
import { filterObjectsSync } from "@dxos/plugin-search";
|
|
96
|
-
|
|
97
|
-
// src/components/Graph/adapter.ts
|
|
98
|
-
function _define_property(obj, key, value) {
|
|
99
|
-
if (key in obj) {
|
|
100
|
-
Object.defineProperty(obj, key, {
|
|
101
|
-
value,
|
|
102
|
-
enumerable: true,
|
|
103
|
-
configurable: true,
|
|
104
|
-
writable: true
|
|
105
|
-
});
|
|
106
|
-
} else {
|
|
107
|
-
obj[key] = value;
|
|
108
|
-
}
|
|
109
|
-
return obj;
|
|
110
|
-
}
|
|
111
|
-
var GraphAdapter = class {
|
|
112
|
-
get nodes() {
|
|
113
|
-
return this._nodes;
|
|
114
|
-
}
|
|
115
|
-
get links() {
|
|
116
|
-
return this._links;
|
|
117
|
-
}
|
|
118
|
-
constructor(graph) {
|
|
119
|
-
_define_property(this, "graph", void 0);
|
|
120
|
-
_define_property(this, "_nodes", void 0);
|
|
121
|
-
_define_property(this, "_links", void 0);
|
|
122
|
-
this.graph = graph;
|
|
123
|
-
this._nodes = [];
|
|
124
|
-
this._links = [];
|
|
125
|
-
this._nodes = graph.nodes.map((node) => ({
|
|
126
|
-
id: node.id,
|
|
127
|
-
type: node.type,
|
|
128
|
-
data: node.data
|
|
129
|
-
}));
|
|
130
|
-
this._links = graph.edges.map((edge) => ({
|
|
131
|
-
type: edge.type,
|
|
132
|
-
source: edge.source,
|
|
133
|
-
target: edge.target,
|
|
134
|
-
data: edge.data
|
|
135
|
-
}));
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
// src/components/Graph/ForceGraph.tsx
|
|
140
|
-
var ForceGraph = ({ model, match }) => {
|
|
141
|
-
var _effect = _useSignals2();
|
|
142
|
-
try {
|
|
143
|
-
const { ref, width, height } = useResizeDetector({
|
|
144
|
-
refreshRate: 200
|
|
145
|
-
});
|
|
146
|
-
const rootRef = useRef2(null);
|
|
147
|
-
const forceGraph = useRef2();
|
|
148
|
-
const filteredRef = useRef2();
|
|
149
|
-
filteredRef.current = filterObjectsSync(model?.objects ?? [], match);
|
|
150
|
-
const [data, setData] = useState();
|
|
151
|
-
useEffect2(() => {
|
|
152
|
-
return model?.subscribe((model2) => {
|
|
153
|
-
setData(new GraphAdapter(model2.graph));
|
|
154
|
-
});
|
|
155
|
-
}, [
|
|
156
|
-
model
|
|
157
|
-
]);
|
|
158
|
-
useEffect2(() => {
|
|
159
|
-
if (rootRef.current) {
|
|
160
|
-
forceGraph.current = new NativeForceGraph(rootRef.current).nodeRelSize(6).nodeLabel((node) => node.type === "schema" ? node.data.typename : node.data.label ?? node.id).nodeAutoColorBy((node) => node.type === "schema" ? "schema" : node.data.typename).linkAutoColorBy((link) => link.type);
|
|
161
|
-
}
|
|
162
|
-
return () => {
|
|
163
|
-
forceGraph.current?.pauseAnimation().graphData({
|
|
164
|
-
nodes: [],
|
|
165
|
-
links: []
|
|
166
|
-
});
|
|
167
|
-
forceGraph.current = void 0;
|
|
168
|
-
};
|
|
169
|
-
}, []);
|
|
170
|
-
useEffect2(() => {
|
|
171
|
-
if (!data || !width || !height || !forceGraph.current) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
forceGraph.current.pauseAnimation().width(width).height(height).onEngineStop(() => {
|
|
175
|
-
handleZoomToFit();
|
|
176
|
-
}).onNodeClick((node) => {
|
|
177
|
-
forceGraph.current?.emitParticle(node);
|
|
178
|
-
}).d3Force("link", forceLink().distance(160).strength(0.5)).d3Force("charge", forceManyBody().strength(-30)).graphData(data).warmupTicks(100).cooldownTime(1e3).resumeAnimation();
|
|
179
|
-
}, [
|
|
180
|
-
data,
|
|
181
|
-
width,
|
|
182
|
-
height,
|
|
183
|
-
forceGraph.current
|
|
184
|
-
]);
|
|
185
|
-
const handleZoomToFit = () => {
|
|
186
|
-
forceGraph.current?.zoomToFit(400, 40);
|
|
187
|
-
};
|
|
188
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
189
|
-
ref,
|
|
190
|
-
className: "relative grow",
|
|
191
|
-
onClick: handleZoomToFit
|
|
192
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
193
|
-
ref: rootRef,
|
|
194
|
-
className: "absolute inset-0"
|
|
195
|
-
}));
|
|
196
|
-
} finally {
|
|
197
|
-
_effect.f();
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
export {
|
|
202
|
-
D3ForceGraph,
|
|
203
|
-
ForceGraph
|
|
204
|
-
};
|
|
205
|
-
//# sourceMappingURL=chunk-GFYXDQQV.mjs.map
|