@dxos/plugin-explorer 0.8.4-main.2e9d522 → 0.8.4-main.406dc2a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/ExplorerContainer-6SHZJ6AK.mjs +50 -0
- package/dist/lib/browser/ExplorerContainer-6SHZJ6AK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UL5EDJPE.mjs → chunk-2DGFNLRO.mjs} +2 -4
- package/dist/lib/browser/chunk-2DGFNLRO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OAOY7SHY.mjs → chunk-2MKBRIUT.mjs} +6 -5
- package/dist/lib/browser/chunk-2MKBRIUT.mjs.map +7 -0
- package/dist/lib/browser/chunk-BZ65T5M3.mjs +79 -0
- package/dist/lib/browser/chunk-BZ65T5M3.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-S5A2EUSJ.mjs → browser/chunk-MOM5KCKC.mjs} +36 -26
- package/dist/lib/browser/{chunk-PVFZFKQ6.mjs.map → chunk-MOM5KCKC.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-J2BBZOSF.mjs → chunk-NXGP6NTP.mjs} +28 -12
- package/dist/lib/browser/chunk-NXGP6NTP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +25 -19
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-K57C3LIX.mjs +31 -0
- package/dist/lib/browser/intent-resolver-K57C3LIX.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +2 -3
- package/dist/lib/browser/react-surface-OPBND5W3.mjs +35 -0
- package/dist/lib/browser/react-surface-OPBND5W3.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -6
- package/dist/lib/node-esm/ExplorerContainer-FRTDXZI5.mjs +51 -0
- package/dist/lib/node-esm/ExplorerContainer-FRTDXZI5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PPBUWC7F.mjs → chunk-3ODK27PU.mjs} +6 -5
- package/dist/lib/node-esm/chunk-3ODK27PU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4VMSNXYL.mjs → chunk-6JACZE7E.mjs} +28 -12
- package/dist/lib/node-esm/chunk-6JACZE7E.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ES6AOMCY.mjs +80 -0
- package/dist/lib/node-esm/chunk-ES6AOMCY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PIAXA43R.mjs → chunk-PX6LHR2N.mjs} +2 -4
- package/dist/lib/node-esm/chunk-PX6LHR2N.mjs.map +7 -0
- package/dist/lib/{browser/chunk-PVFZFKQ6.mjs → node-esm/chunk-ZCV4U7LT.mjs} +38 -24
- package/dist/lib/node-esm/{chunk-S5A2EUSJ.mjs.map → chunk-ZCV4U7LT.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +25 -19
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-BLPPTTEY.mjs +32 -0
- package/dist/lib/node-esm/intent-resolver-BLPPTTEY.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +2 -3
- package/dist/lib/node-esm/react-surface-HCKQSHKJ.mjs +36 -0
- package/dist/lib/node-esm/react-surface-HCKQSHKJ.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -6
- package/dist/types/src/ExplorerPlugin.d.ts +1 -1
- package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/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 +8 -4
- package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/types/src/components/ExplorerContainer.d.ts +2 -2
- package/dist/types/src/components/ExplorerContainer.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +8 -4
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts +2 -2
- package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +1 -1
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +13 -4
- package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +13 -4
- package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
- package/dist/types/src/components/Graph/testing.d.ts +1 -1
- package/dist/types/src/components/Graph/testing.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +13 -16
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/types/tree.d.ts +1 -1
- package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/hooks/useGraphModel.d.ts +2 -2
- package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +14 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/ExplorerAction.d.ts +23 -0
- package/dist/types/src/types/ExplorerAction.d.ts.map +1 -0
- package/dist/types/src/types/Graph.d.ts +33 -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 +40 -36
- package/src/ExplorerPlugin.tsx +48 -47
- package/src/capabilities/intent-resolver.ts +10 -8
- package/src/capabilities/react-surface.tsx +9 -5
- package/src/components/Chart/Chart.stories.tsx +9 -7
- package/src/components/Chart/Chart.tsx +1 -1
- package/src/components/ExplorerContainer.tsx +24 -6
- package/src/components/Globe/Globe.stories.tsx +14 -12
- package/src/components/Globe/Globe.tsx +1 -1
- package/src/components/Graph/D3ForceGraph.stories.tsx +30 -17
- package/src/components/Graph/D3ForceGraph.tsx +5 -5
- package/src/components/Graph/ForceGraph.stories.tsx +30 -17
- package/src/components/Graph/ForceGraph.tsx +4 -4
- package/src/components/Graph/testing.ts +2 -2
- package/src/components/Tree/Tree.stories.tsx +28 -22
- package/src/components/Tree/Tree.tsx +3 -3
- package/src/components/Tree/types/tree.test.ts +2 -1
- package/src/components/Tree/types/tree.ts +1 -1
- package/src/hooks/useGraphModel.ts +5 -4
- package/src/meta.ts +1 -3
- package/src/translations.ts +4 -2
- package/src/types/ExplorerAction.ts +29 -0
- package/src/types/Graph.ts +45 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/ExplorerContainer-OGHSHZD5.mjs +0 -37
- package/dist/lib/browser/ExplorerContainer-OGHSHZD5.mjs.map +0 -7
- package/dist/lib/browser/chunk-EF4BFHTI.mjs +0 -38
- package/dist/lib/browser/chunk-EF4BFHTI.mjs.map +0 -7
- package/dist/lib/browser/chunk-J2BBZOSF.mjs.map +0 -7
- package/dist/lib/browser/chunk-OAOY7SHY.mjs.map +0 -7
- package/dist/lib/browser/chunk-UL5EDJPE.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-XH2UO2FM.mjs +0 -24
- package/dist/lib/browser/intent-resolver-XH2UO2FM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-65VQ42HX.mjs +0 -31
- package/dist/lib/browser/react-surface-65VQ42HX.mjs.map +0 -7
- package/dist/lib/node-esm/ExplorerContainer-6ON5NA2P.mjs +0 -38
- package/dist/lib/node-esm/ExplorerContainer-6ON5NA2P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4VMSNXYL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PIAXA43R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PPBUWC7F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VKCOKQRG.mjs +0 -39
- package/dist/lib/node-esm/chunk-VKCOKQRG.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-AGBBNA67.mjs +0 -25
- package/dist/lib/node-esm/intent-resolver-AGBBNA67.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-IJIMYAST.mjs +0 -32
- package/dist/lib/node-esm/react-surface-IJIMYAST.mjs.map +0 -7
- 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/types/schema.ts +0 -16
- package/src/types/types.ts +0 -21
|
@@ -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-PPBUWC7F.mjs";
|
|
5
|
-
import {
|
|
6
|
-
D3ForceGraph
|
|
7
|
-
} from "./chunk-4VMSNXYL.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-6ON5NA2P.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 { D3ForceGraph } from './Graph';\nimport { useGraphModel } from '../hooks';\nimport { type ViewType } from '../types';\n\ntype ExplorerContainerProps = {\n role: string;\n view: ViewType;\n};\n\nconst ExplorerContainer = ({ role, view }: ExplorerContainerProps) => {\n const space = getSpace(view);\n const model = useGraphModel(space);\n const { match } = useGlobalSearch();\n\n if (!space || !model) {\n return null;\n }\n\n return (\n <StackItem.Content size={role === 'section' ? 'square' : 'intrinsic'}>\n <D3ForceGraph model={model} match={match} />\n </StackItem.Content>\n );\n};\n\nexport default ExplorerContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAW1B,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,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Graph/D3ForceGraph.tsx", "../../../src/components/Graph/ForceGraph.tsx", "../../../src/components/Graph/adapter.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { SelectionModel } from '@dxos/graph';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n type GraphController,\n GraphForceProjector,\n type GraphLayoutNode,\n type GraphProps,\n SVG,\n type SVGContext,\n} from '@dxos/react-ui-graph';\nimport { getHashColor } from '@dxos/react-ui-theme';\nimport { type SpaceGraphNode, type SpaceGraphModel, type SpaceGraphEdge } from '@dxos/schema';\n\nimport '@dxos/react-ui-graph/styles/graph.css';\n\nexport type D3ForceGraphProps = ThemedClassName<\n {\n model?: SpaceGraphModel;\n match?: RegExp;\n selection?: SelectionModel;\n grid?: boolean;\n } & Pick<GraphProps, 'drag'>\n>;\n\nexport const D3ForceGraph: FC<D3ForceGraphProps> = ({ classNames, model, selection: _selection, grid, ...props }) => {\n const context = useRef<SVGContext>(null);\n const projector = useMemo<GraphForceProjector | undefined>(() => {\n if (context.current) {\n return new GraphForceProjector(context.current, {\n attributes: {\n linkForce: (edge) => {\n // TODO(burdon): Check type (currently assumes Employee property).\n // Edge shouldn't contribute to force if it's not active.\n return edge.data?.object?.active !== false;\n },\n },\n forces: {\n point: {\n strength: 0.01,\n },\n },\n });\n }\n }, [context.current]);\n\n const graph = useRef<GraphController>(null);\n const selection = useMemo(() => _selection ?? new SelectionModel(), [_selection]);\n useEffect(() => graph.current?.repaint(), [selection.selected.value]);\n\n const handleSelect = useCallback<NonNullable<GraphProps['onSelect']>>(\n (node) => {\n if (selection.contains(node.id)) {\n selection.remove(node.id);\n } else {\n selection.add(node.id);\n }\n },\n [selection],\n );\n\n return (\n <SVG.Root ref={context} classNames={classNames}>\n <SVG.Markers />\n {grid && <SVG.Grid axis />}\n <SVG.Zoom extent={[1 / 2, 2]}>\n <SVG.Graph<SpaceGraphNode, SpaceGraphEdge>\n {...props}\n ref={graph}\n model={model}\n projector={projector}\n labels={{\n text: (node) => {\n return node.data?.data.label ?? node.id;\n },\n }}\n attributes={{\n node: (node: GraphLayoutNode<SpaceGraphNode>) => {\n const obj = node.data?.data.object;\n return {\n data: {\n color: getHashColor(obj && Obj.getTypename(obj))?.color,\n },\n classes: {\n 'dx-selected': selection.contains(node.id),\n },\n };\n },\n }}\n onSelect={handleSelect}\n />\n </SVG.Zoom>\n </SVG.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { forceLink, forceManyBody } from 'd3';\nimport NativeForceGraph from 'force-graph';\nimport React, { type FC, useEffect, useRef, useState } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { filterObjectsSync, type SearchResult } from '@dxos/plugin-search';\nimport { type SpaceGraphModel } from '@dxos/schema';\n\nimport { GraphAdapter } from './adapter';\n\nexport type ForceGraphProps = {\n model?: SpaceGraphModel;\n match?: RegExp;\n};\n\nexport const ForceGraph: FC<ForceGraphProps> = ({ model, match }) => {\n const { ref, width, height } = useResizeDetector({ refreshRate: 200 });\n const rootRef = useRef<HTMLDivElement>(null);\n const forceGraph = useRef<NativeForceGraph>();\n\n const filteredRef = useRef<SearchResult[]>();\n filteredRef.current = filterObjectsSync(model?.objects ?? [], match);\n\n const [data, setData] = useState<GraphAdapter>();\n useEffect(() => {\n return model?.subscribe((model) => {\n setData(new GraphAdapter(model.graph));\n });\n }, [model]);\n\n useEffect(() => {\n if (rootRef.current) {\n // https://github.com/vasturiano/force-graph\n // https://github.com/vasturiano/3d-force-graph\n forceGraph.current = new NativeForceGraph(rootRef.current)\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#node-styling\n .nodeRelSize(6)\n .nodeLabel((node: any) => (node.type === 'schema' ? node.data.typename : (node.data.label ?? node.id)))\n .nodeAutoColorBy((node: any) => (node.type === 'schema' ? 'schema' : node.data.typename))\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#link-styling\n .linkAutoColorBy((link: any) => link.type);\n }\n\n return () => {\n forceGraph.current?.pauseAnimation().graphData({ nodes: [], links: [] });\n forceGraph.current = undefined;\n };\n }, []);\n\n useEffect(() => {\n if (!data || !width || !height || !forceGraph.current) {\n return;\n }\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#container-layout\n forceGraph.current\n .pauseAnimation()\n .width(width)\n .height(height)\n .onEngineStop(() => {\n handleZoomToFit();\n })\n .onNodeClick((node: any) => {\n forceGraph.current?.emitParticle(node);\n })\n\n // https://github.com/vasturiano/force-graph?tab=readme-ov-file#force-engine-d3-force-configuration\n // .d3Force('center', forceCenter().strength(0.9))\n .d3Force('link', forceLink().distance(160).strength(0.5))\n .d3Force('charge', forceManyBody().strength(-30))\n\n .graphData(data)\n .warmupTicks(100)\n .cooldownTime(1_000)\n .resumeAnimation();\n }, [data, width, height, forceGraph.current]);\n\n const handleZoomToFit = () => {\n forceGraph.current?.zoomToFit(400, 40);\n };\n\n return (\n <div ref={ref} className='relative grow' onClick={handleZoomToFit}>\n <div ref={rootRef} className='absolute inset-0' />\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Graph } from '@dxos/graph';\n\nexport type GraphNode = {\n id?: string;\n};\n\nexport type GraphLink = {\n source?: string;\n target?: string;\n};\n\nexport type GraphData = {\n nodes: GraphNode[];\n links: GraphLink[];\n};\n\n/**\n * Map common graph to force-graph format.\n */\nexport class GraphAdapter implements GraphData {\n private readonly _nodes: GraphNode[] = [];\n private readonly _links: GraphLink[] = [];\n\n constructor(private readonly graph: Graph) {\n this._nodes = graph.nodes.map((node) => ({\n id: node.id,\n type: node.type,\n data: node.data,\n }));\n\n this._links = graph.edges.map((edge) => ({\n type: edge.type,\n source: edge.source,\n target: edge.target,\n data: edge.data,\n }));\n }\n\n get nodes() {\n return this._nodes;\n }\n\n get links() {\n return this._links;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;AAIA,OAAOA,SAAkBC,aAAaC,WAAWC,SAASC,cAAc;AAExE,SAASC,WAAW;AACpB,SAASC,sBAAsB;AAE/B,SAEEC,qBAGAC,WAEK;AACP,SAASC,oBAAoB;AAG7B,OAAO;AAWA,IAAMC,eAAsC,CAAC,EAAEC,YAAYC,OAAOC,WAAWC,YAAYC,MAAM,GAAGC,MAAAA,MAAO;;;AAC9G,UAAMC,UAAUC,OAAmB,IAAA;AACnC,UAAMC,YAAYC,QAAyC,MAAA;AACzD,UAAIH,QAAQI,SAAS;AACnB,eAAO,IAAIC,oBAAoBL,QAAQI,SAAS;UAC9CE,YAAY;YACVC,WAAW,CAACC,SAAAA;AAGV,qBAAOA,KAAKC,MAAMC,QAAQC,WAAW;YACvC;UACF;UACAC,QAAQ;YACNC,OAAO;cACLC,UAAU;YACZ;UACF;QACF,CAAA;MACF;IACF,GAAG;MAACd,QAAQI;KAAQ;AAEpB,UAAMW,QAAQd,OAAwB,IAAA;AACtC,UAAML,YAAYO,QAAQ,MAAMN,cAAc,IAAImB,eAAAA,GAAkB;MAACnB;KAAW;AAChFoB,cAAU,MAAMF,MAAMX,SAASc,QAAAA,GAAW;MAACtB,UAAUuB,SAASC;KAAM;AAEpE,UAAMC,eAAeC,YACnB,CAACC,SAAAA;AACC,UAAI3B,UAAU4B,SAASD,KAAKE,EAAE,GAAG;AAC/B7B,kBAAU8B,OAAOH,KAAKE,EAAE;MAC1B,OAAO;AACL7B,kBAAU+B,IAAIJ,KAAKE,EAAE;MACvB;IACF,GACA;MAAC7B;KAAU;AAGb,WACE,sBAAA,cAACgC,IAAIC,MAAI;MAACC,KAAK9B;MAASN;OACtB,sBAAA,cAACkC,IAAIG,SAAO,IAAA,GACXjC,QAAQ,sBAAA,cAAC8B,IAAII,MAAI;MAACC,MAAAA;QACnB,sBAAA,cAACL,IAAIM,MAAI;MAACC,QAAQ;QAAC,IAAI;QAAG;;OACxB,sBAAA,cAACP,IAAIQ,OAAK;MACP,GAAGrC;MACJ+B,KAAKf;MACLpB;MACAO;MACAmC,QAAQ;QACNC,MAAM,CAACf,SAAAA;AACL,iBAAOA,KAAKd,MAAMA,KAAK8B,SAAShB,KAAKE;QACvC;MACF;MACAnB,YAAY;QACViB,MAAM,CAACA,SAAAA;AACL,gBAAMiB,MAAMjB,KAAKd,MAAMA,KAAKC;AAC5B,iBAAO;YACLD,MAAM;cACJgC,OAAOC,aAAaF,OAAOG,IAAIC,YAAYJ,GAAAA,CAAAA,GAAOC;YACpD;YACAI,SAAS;cACP,eAAejD,UAAU4B,SAASD,KAAKE,EAAE;YAC3C;UACF;QACF;MACF;MACAqB,UAAUzB;;;;;AAKpB;;;;AChGA,SAAS0B,WAAWC,qBAAqB;AACzC,OAAOC,sBAAsB;AAC7B,OAAOC,UAAkBC,aAAAA,YAAWC,UAAAA,SAAQC,gBAAgB;AAC5D,SAASC,yBAAyB;AAElC,SAASC,yBAA4C;;;ACc9C,IAAMC,eAAN,MAAMA;EAIX,YAA6BC,OAAc;SAAdA,QAAAA;SAHZC,SAAsB,CAAA;SACtBC,SAAsB,CAAA;AAGrC,SAAKD,SAASD,MAAMG,MAAMC,IAAI,CAACC,UAAU;MACvCC,IAAID,KAAKC;MACTC,MAAMF,KAAKE;MACXC,MAAMH,KAAKG;IACb,EAAA;AAEA,SAAKN,SAASF,MAAMS,MAAML,IAAI,CAACM,UAAU;MACvCH,MAAMG,KAAKH;MACXI,QAAQD,KAAKC;MACbC,QAAQF,KAAKE;MACbJ,MAAME,KAAKF;IACb,EAAA;EACF;EAEA,IAAIL,QAAQ;AACV,WAAO,KAAKF;EACd;EAEA,IAAIY,QAAQ;AACV,WAAO,KAAKX;EACd;AACF;;;AD9BO,IAAMY,aAAkC,CAAC,EAAEC,OAAOC,MAAK,MAAE;;;AAC9D,UAAM,EAAEC,KAAKC,OAAOC,OAAM,IAAKC,kBAAkB;MAAEC,aAAa;IAAI,CAAA;AACpE,UAAMC,UAAUC,QAAuB,IAAA;AACvC,UAAMC,aAAaD,QAAAA;AAEnB,UAAME,cAAcF,QAAAA;AACpBE,gBAAYC,UAAUC,kBAAkBZ,OAAOa,WAAW,CAAA,GAAIZ,KAAAA;AAE9D,UAAM,CAACa,MAAMC,OAAAA,IAAWC,SAAAA;AACxBC,IAAAA,WAAU,MAAA;AACR,aAAOjB,OAAOkB,UAAU,CAAClB,WAAAA;AACvBe,gBAAQ,IAAII,aAAanB,OAAMoB,KAAK,CAAA;MACtC,CAAA;IACF,GAAG;MAACpB;KAAM;AAEViB,IAAAA,WAAU,MAAA;AACR,UAAIV,QAAQI,SAAS;AAGnBF,mBAAWE,UAAU,IAAIU,iBAAiBd,QAAQI,OAAO,EAEtDW,YAAY,CAAA,EACZC,UAAU,CAACC,SAAeA,KAAKC,SAAS,WAAWD,KAAKV,KAAKY,WAAYF,KAAKV,KAAKa,SAASH,KAAKI,EAAE,EACnGC,gBAAgB,CAACL,SAAeA,KAAKC,SAAS,WAAW,WAAWD,KAAKV,KAAKY,QAAQ,EAGtFI,gBAAgB,CAACC,SAAcA,KAAKN,IAAI;MAC7C;AAEA,aAAO,MAAA;AACLhB,mBAAWE,SAASqB,eAAAA,EAAiBC,UAAU;UAAEC,OAAO,CAAA;UAAIC,OAAO,CAAA;QAAG,CAAA;AACtE1B,mBAAWE,UAAUyB;MACvB;IACF,GAAG,CAAA,CAAE;AAELnB,IAAAA,WAAU,MAAA;AACR,UAAI,CAACH,QAAQ,CAACX,SAAS,CAACC,UAAU,CAACK,WAAWE,SAAS;AACrD;MACF;AAGAF,iBAAWE,QACRqB,eAAc,EACd7B,MAAMA,KAAAA,EACNC,OAAOA,MAAAA,EACPiC,aAAa,MAAA;AACZC,wBAAAA;MACF,CAAA,EACCC,YAAY,CAACf,SAAAA;AACZf,mBAAWE,SAAS6B,aAAahB,IAAAA;MACnC,CAAA,EAICiB,QAAQ,QAAQC,UAAAA,EAAYC,SAAS,GAAA,EAAKC,SAAS,GAAA,CAAA,EACnDH,QAAQ,UAAUI,cAAAA,EAAgBD,SAAS,GAAC,CAAA,EAE5CX,UAAUnB,IAAAA,EACVgC,YAAY,GAAA,EACZC,aAAa,GAAA,EACbC,gBAAe;IACpB,GAAG;MAAClC;MAAMX;MAAOC;MAAQK,WAAWE;KAAQ;AAE5C,UAAM2B,kBAAkB,MAAA;AACtB7B,iBAAWE,SAASsC,UAAU,KAAK,EAAA;IACrC;AAEA,WACE,gBAAAC,OAAA,cAACC,OAAAA;MAAIjD;MAAUkD,WAAU;MAAgBC,SAASf;OAChD,gBAAAY,OAAA,cAACC,OAAAA;MAAIjD,KAAKK;MAAS6C,WAAU;;;;;AAGnC;",
|
|
6
|
-
"names": ["React", "useCallback", "useEffect", "useMemo", "useRef", "Obj", "SelectionModel", "GraphForceProjector", "SVG", "getHashColor", "D3ForceGraph", "classNames", "model", "selection", "_selection", "grid", "props", "context", "useRef", "projector", "useMemo", "current", "GraphForceProjector", "attributes", "linkForce", "edge", "data", "object", "active", "forces", "point", "strength", "graph", "SelectionModel", "useEffect", "repaint", "selected", "value", "handleSelect", "useCallback", "node", "contains", "id", "remove", "add", "SVG", "Root", "ref", "Markers", "Grid", "axis", "Zoom", "extent", "Graph", "labels", "text", "label", "obj", "color", "getHashColor", "Obj", "getTypename", "classes", "onSelect", "forceLink", "forceManyBody", "NativeForceGraph", "React", "useEffect", "useRef", "useState", "useResizeDetector", "filterObjectsSync", "GraphAdapter", "graph", "_nodes", "_links", "nodes", "map", "node", "id", "type", "data", "edges", "edge", "source", "target", "links", "ForceGraph", "model", "match", "ref", "width", "height", "useResizeDetector", "refreshRate", "rootRef", "useRef", "forceGraph", "filteredRef", "current", "filterObjectsSync", "objects", "data", "setData", "useState", "useEffect", "subscribe", "GraphAdapter", "graph", "NativeForceGraph", "nodeRelSize", "nodeLabel", "node", "type", "typename", "label", "id", "nodeAutoColorBy", "linkAutoColorBy", "link", "pauseAnimation", "graphData", "nodes", "links", "undefined", "onEngineStop", "handleZoomToFit", "onNodeClick", "emitParticle", "d3Force", "forceLink", "distance", "strength", "forceManyBody", "warmupTicks", "cooldownTime", "resumeAnimation", "zoomToFit", "React", "div", "className", "onClick"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const EXPLORER_PLUGIN = 'dxos.org/plugin/explorer';\n\nexport const meta: PluginMeta = {\n id: EXPLORER_PLUGIN,\n name: 'Explorer',\n description: 'Install this plugin to view a hypergraph of all objects inside of your Space.',\n icon: 'ph--graph--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n tags: ['labs'],\n screenshots: ['https://dxos.network/plugin-details-explorer-dark.png'],\n};\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,kBAAkB;AAExB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
|
|
6
|
-
"names": ["EXPLORER_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags", "screenshots"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useGraphModel.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type Filter, type Space } from '@dxos/client/echo';\nimport { SpaceGraphModel, type SpaceGraphModelOptions } from '@dxos/schema';\n\n// TODO(burdon): Factor out.\nexport const useGraphModel = (\n space: Space | undefined,\n filter?: Filter.Any | undefined,\n options?: SpaceGraphModelOptions,\n): SpaceGraphModel | undefined => {\n const [model, setModel] = useState<SpaceGraphModel | undefined>(undefined);\n useEffect(() => {\n if (!space) {\n void model?.close();\n setModel(undefined);\n return;\n }\n\n // TODO(burdon): Does this need to be a dependency?\n if (!model) {\n const model = new SpaceGraphModel().setFilter(filter).setOptions(options);\n void model.open(space);\n setModel(model);\n } else {\n model.setFilter(filter).setOptions(options);\n }\n }, [space, filter, options]);\n\n return model;\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,WAAWC,gBAAgB;AAGpC,SAASC,uBAAoD;AAGtD,IAAMC,gBAAgB,CAC3BC,OACAC,QACAC,YAAAA;AAEA,QAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAsCC,MAAAA;AAChEC,YAAU,MAAA;AACR,QAAI,CAACP,OAAO;AACV,WAAKG,OAAOK,MAAAA;AACZJ,eAASE,MAAAA;AACT;IACF;AAGA,QAAI,CAACH,OAAO;AACV,YAAMA,SAAQ,IAAIM,gBAAAA,EAAkBC,UAAUT,MAAAA,EAAQU,WAAWT,OAAAA;AACjE,WAAKC,OAAMS,KAAKZ,KAAAA;AAChBI,eAASD,MAAAA;IACX,OAAO;AACLA,YAAMO,UAAUT,MAAAA,EAAQU,WAAWT,OAAAA;IACrC;EACF,GAAG;IAACF;IAAOC;IAAQC;GAAQ;AAE3B,SAAOC;AACT;",
|
|
6
|
-
"names": ["useEffect", "useState", "SpaceGraphModel", "useGraphModel", "space", "filter", "options", "model", "setModel", "useState", "undefined", "useEffect", "close", "SpaceGraphModel", "setFilter", "setOptions", "open"]
|
|
7
|
-
}
|
|
@@ -1,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-VKCOKQRG.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 { ViewType } from './schema';\nimport { EXPLORER_PLUGIN } from '../meta';\n\nexport namespace ExplorerAction {\n const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;\n\n export class Create extends Schema.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: ViewType,\n }),\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,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;UAKNC,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,25 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
ExplorerAction,
|
|
4
|
-
ViewType
|
|
5
|
-
} from "./chunk-VKCOKQRG.mjs";
|
|
6
|
-
import "./chunk-PIAXA43R.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/intent-resolver.ts
|
|
9
|
-
import { contributes, Capabilities, createResolver } from "@dxos/app-framework";
|
|
10
|
-
import { Obj } from "@dxos/echo";
|
|
11
|
-
var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
|
|
12
|
-
intent: ExplorerAction.Create,
|
|
13
|
-
resolve: ({ name }) => ({
|
|
14
|
-
data: {
|
|
15
|
-
object: Obj.make(ViewType, {
|
|
16
|
-
name,
|
|
17
|
-
type: ""
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
}));
|
|
22
|
-
export {
|
|
23
|
-
intent_resolver_default as default
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=intent-resolver-AGBBNA67.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 { contributes, Capabilities, 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,aAAaC,cAAcC,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": ["contributes", "Capabilities", "createResolver", "Obj", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ExplorerAction", "Create", "resolve", "name", "data", "object", "Obj", "make", "ViewType", "type"]
|
|
7
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
ExplorerContainer
|
|
4
|
-
} from "./chunk-S5A2EUSJ.mjs";
|
|
5
|
-
import "./chunk-4VMSNXYL.mjs";
|
|
6
|
-
import {
|
|
7
|
-
ViewType
|
|
8
|
-
} from "./chunk-VKCOKQRG.mjs";
|
|
9
|
-
import {
|
|
10
|
-
EXPLORER_PLUGIN
|
|
11
|
-
} from "./chunk-PIAXA43R.mjs";
|
|
12
|
-
|
|
13
|
-
// src/capabilities/react-surface.tsx
|
|
14
|
-
import React from "react";
|
|
15
|
-
import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
|
|
16
|
-
import { Obj } from "@dxos/echo";
|
|
17
|
-
var react_surface_default = () => contributes(Capabilities.ReactSurface, createSurface({
|
|
18
|
-
id: `${EXPLORER_PLUGIN}/article`,
|
|
19
|
-
role: [
|
|
20
|
-
"article",
|
|
21
|
-
"section"
|
|
22
|
-
],
|
|
23
|
-
filter: (data) => Obj.instanceOf(ViewType, data.subject),
|
|
24
|
-
component: ({ data, role }) => /* @__PURE__ */ React.createElement(ExplorerContainer, {
|
|
25
|
-
view: data.subject,
|
|
26
|
-
role
|
|
27
|
-
})
|
|
28
|
-
}));
|
|
29
|
-
export {
|
|
30
|
-
react_surface_default as default
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=react-surface-IJIMYAST.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,12 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
|
-
declare const ViewType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
|
|
3
|
-
name: Schema.optional<typeof Schema.String>;
|
|
4
|
-
type: typeof Schema.String;
|
|
5
|
-
}, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<{
|
|
6
|
-
name: Schema.optional<typeof Schema.String>;
|
|
7
|
-
type: typeof Schema.String;
|
|
8
|
-
}>>;
|
|
9
|
-
export declare class ViewType extends ViewType_base {
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;;;;AAKhC,qBAAa,QAAS,SAAQ,aAM5B;CAAG"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
|
-
import { ViewType } from './schema';
|
|
3
|
-
export declare namespace ExplorerAction {
|
|
4
|
-
const Create_base: Schema.TaggedClass<Create, "dxos.org/plugin/explorer/action/create", {
|
|
5
|
-
readonly _tag: Schema.tag<"dxos.org/plugin/explorer/action/create">;
|
|
6
|
-
} & {
|
|
7
|
-
input: Schema.Struct<{
|
|
8
|
-
name: Schema.optional<typeof Schema.String>;
|
|
9
|
-
}>;
|
|
10
|
-
output: Schema.Struct<{
|
|
11
|
-
object: typeof ViewType;
|
|
12
|
-
}>;
|
|
13
|
-
}>;
|
|
14
|
-
export class Create extends Create_base {
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,yBAAiB,cAAc,CAAC;;;;;;;;;;;IAG9B,MAAM,OAAO,MAAO,SAAQ,WAO1B;KAAG;;CACN"}
|
package/src/types/schema.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { TypedObject } from '@dxos/echo-schema';
|
|
8
|
-
|
|
9
|
-
// TODO(burdon): Clashes with sdk/view.
|
|
10
|
-
export class ViewType extends TypedObject({
|
|
11
|
-
typename: 'dxos.org/type/ExplorerView',
|
|
12
|
-
version: '0.1.0',
|
|
13
|
-
})({
|
|
14
|
-
name: Schema.optional(Schema.String),
|
|
15
|
-
type: Schema.String,
|
|
16
|
-
}) {}
|
package/src/types/types.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { ViewType } from './schema';
|
|
8
|
-
import { EXPLORER_PLUGIN } from '../meta';
|
|
9
|
-
|
|
10
|
-
export namespace ExplorerAction {
|
|
11
|
-
const EXPLORER_ACTION = `${EXPLORER_PLUGIN}/action`;
|
|
12
|
-
|
|
13
|
-
export class Create extends Schema.TaggedClass<Create>()(`${EXPLORER_ACTION}/create`, {
|
|
14
|
-
input: Schema.Struct({
|
|
15
|
-
name: Schema.optional(Schema.String),
|
|
16
|
-
}),
|
|
17
|
-
output: Schema.Struct({
|
|
18
|
-
object: ViewType,
|
|
19
|
-
}),
|
|
20
|
-
}) {}
|
|
21
|
-
}
|