@dxos/plugin-explorer 0.8.4-main.406dc2a → 0.8.4-main.422d1c7879

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.
Files changed (122) hide show
  1. package/dist/lib/browser/chunk-LSUP47BZ.mjs +24 -0
  2. package/dist/lib/browser/chunk-LSUP47BZ.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +11342 -86
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/meta.mjs +1 -1
  7. package/dist/lib/browser/types/index.mjs +64 -5
  8. package/dist/lib/browser/types/index.mjs.map +4 -4
  9. package/dist/lib/node-esm/{chunk-PX6LHR2N.mjs → chunk-EN3JZNEY.mjs} +8 -3
  10. package/dist/lib/node-esm/chunk-EN3JZNEY.mjs.map +7 -0
  11. package/dist/lib/node-esm/index.mjs +11342 -86
  12. package/dist/lib/node-esm/index.mjs.map +4 -4
  13. package/dist/lib/node-esm/meta.json +1 -1
  14. package/dist/lib/node-esm/meta.mjs +1 -1
  15. package/dist/lib/node-esm/types/index.mjs +64 -5
  16. package/dist/lib/node-esm/types/index.mjs.map +4 -4
  17. package/dist/types/src/ExplorerPlugin.d.ts +2 -1
  18. package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
  19. package/dist/types/src/capabilities/index.d.ts +2 -2
  20. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  21. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  22. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  23. package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
  24. package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
  25. package/dist/types/src/components/Graph/D3ForceGraph.d.ts +6 -5
  26. package/dist/types/src/components/Graph/D3ForceGraph.d.ts.map +1 -1
  27. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts +4 -2
  28. package/dist/types/src/components/Graph/D3ForceGraph.stories.d.ts.map +1 -1
  29. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +1 -1
  30. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
  31. package/dist/types/src/components/Graph/adapter.d.ts +1 -1
  32. package/dist/types/src/components/Graph/adapter.d.ts.map +1 -1
  33. package/dist/types/src/components/Graph/testing.d.ts.map +1 -1
  34. package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
  35. package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
  36. package/dist/types/src/components/Tree/testing/generator.d.ts.map +1 -1
  37. package/dist/types/src/components/Tree/types/tree.d.ts +18 -16
  38. package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
  39. package/dist/types/src/components/Tree/types/types.d.ts +1 -1
  40. package/dist/types/src/components/Tree/types/types.d.ts.map +1 -1
  41. package/dist/types/src/components/index.d.ts +0 -4
  42. package/dist/types/src/components/index.d.ts.map +1 -1
  43. package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts +6 -0
  44. package/dist/types/src/containers/ExplorerContainer/ExplorerContainer.d.ts.map +1 -0
  45. package/dist/types/src/containers/ExplorerContainer/index.d.ts +2 -0
  46. package/dist/types/src/containers/ExplorerContainer/index.d.ts.map +1 -0
  47. package/dist/types/src/containers/index.d.ts +3 -0
  48. package/dist/types/src/containers/index.d.ts.map +1 -0
  49. package/dist/types/src/hooks/useGraphModel.d.ts.map +1 -1
  50. package/dist/types/src/meta.d.ts +2 -2
  51. package/dist/types/src/meta.d.ts.map +1 -1
  52. package/dist/types/src/translations.d.ts +31 -22
  53. package/dist/types/src/translations.d.ts.map +1 -1
  54. package/dist/types/src/types/ExplorerAction.d.ts +1 -18
  55. package/dist/types/src/types/ExplorerAction.d.ts.map +1 -1
  56. package/dist/types/src/types/Graph.d.ts +14 -24
  57. package/dist/types/src/types/Graph.d.ts.map +1 -1
  58. package/dist/types/tsconfig.tsbuildinfo +1 -1
  59. package/package.json +59 -55
  60. package/src/ExplorerPlugin.tsx +42 -53
  61. package/src/capabilities/index.ts +2 -3
  62. package/src/capabilities/react-surface.tsx +24 -19
  63. package/src/components/Chart/Chart.stories.tsx +3 -4
  64. package/src/components/Globe/Globe.stories.tsx +3 -4
  65. package/src/components/Graph/D3ForceGraph.stories.tsx +30 -24
  66. package/src/components/Graph/D3ForceGraph.tsx +82 -75
  67. package/src/components/Graph/ForceGraph.stories.tsx +30 -24
  68. package/src/components/Graph/adapter.ts +14 -8
  69. package/src/components/Graph/testing.ts +11 -8
  70. package/src/components/Tree/Tree.stories.tsx +9 -6
  71. package/src/components/Tree/Tree.tsx +8 -3
  72. package/src/components/Tree/testing/generator.ts +4 -2
  73. package/src/components/Tree/types/tree.test.ts +7 -6
  74. package/src/components/Tree/types/tree.ts +41 -20
  75. package/src/components/Tree/types/types.ts +1 -1
  76. package/src/components/index.ts +0 -4
  77. package/src/containers/ExplorerContainer/ExplorerContainer.tsx +53 -0
  78. package/src/containers/ExplorerContainer/index.ts +5 -0
  79. package/src/containers/index.ts +7 -0
  80. package/src/hooks/useGraphModel.ts +17 -10
  81. package/src/meta.ts +9 -4
  82. package/src/translations.ts +15 -12
  83. package/src/types/ExplorerAction.ts +10 -19
  84. package/src/types/Graph.ts +25 -21
  85. package/src/typings.d.ts +8 -0
  86. package/dist/lib/browser/ExplorerContainer-6SHZJ6AK.mjs +0 -50
  87. package/dist/lib/browser/ExplorerContainer-6SHZJ6AK.mjs.map +0 -7
  88. package/dist/lib/browser/chunk-2DGFNLRO.mjs +0 -19
  89. package/dist/lib/browser/chunk-2DGFNLRO.mjs.map +0 -7
  90. package/dist/lib/browser/chunk-2MKBRIUT.mjs +0 -31
  91. package/dist/lib/browser/chunk-2MKBRIUT.mjs.map +0 -7
  92. package/dist/lib/browser/chunk-BZ65T5M3.mjs +0 -79
  93. package/dist/lib/browser/chunk-BZ65T5M3.mjs.map +0 -7
  94. package/dist/lib/browser/chunk-MOM5KCKC.mjs +0 -11341
  95. package/dist/lib/browser/chunk-MOM5KCKC.mjs.map +0 -7
  96. package/dist/lib/browser/chunk-NXGP6NTP.mjs +0 -203
  97. package/dist/lib/browser/chunk-NXGP6NTP.mjs.map +0 -7
  98. package/dist/lib/browser/intent-resolver-K57C3LIX.mjs +0 -31
  99. package/dist/lib/browser/intent-resolver-K57C3LIX.mjs.map +0 -7
  100. package/dist/lib/browser/react-surface-OPBND5W3.mjs +0 -35
  101. package/dist/lib/browser/react-surface-OPBND5W3.mjs.map +0 -7
  102. package/dist/lib/node-esm/ExplorerContainer-FRTDXZI5.mjs +0 -51
  103. package/dist/lib/node-esm/ExplorerContainer-FRTDXZI5.mjs.map +0 -7
  104. package/dist/lib/node-esm/chunk-3ODK27PU.mjs +0 -33
  105. package/dist/lib/node-esm/chunk-3ODK27PU.mjs.map +0 -7
  106. package/dist/lib/node-esm/chunk-6JACZE7E.mjs +0 -205
  107. package/dist/lib/node-esm/chunk-6JACZE7E.mjs.map +0 -7
  108. package/dist/lib/node-esm/chunk-ES6AOMCY.mjs +0 -80
  109. package/dist/lib/node-esm/chunk-ES6AOMCY.mjs.map +0 -7
  110. package/dist/lib/node-esm/chunk-PX6LHR2N.mjs.map +0 -7
  111. package/dist/lib/node-esm/chunk-ZCV4U7LT.mjs +0 -11343
  112. package/dist/lib/node-esm/chunk-ZCV4U7LT.mjs.map +0 -7
  113. package/dist/lib/node-esm/intent-resolver-BLPPTTEY.mjs +0 -32
  114. package/dist/lib/node-esm/intent-resolver-BLPPTTEY.mjs.map +0 -7
  115. package/dist/lib/node-esm/react-surface-HCKQSHKJ.mjs +0 -36
  116. package/dist/lib/node-esm/react-surface-HCKQSHKJ.mjs.map +0 -7
  117. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  118. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  119. package/dist/types/src/components/ExplorerContainer.d.ts +0 -9
  120. package/dist/types/src/components/ExplorerContainer.d.ts.map +0 -1
  121. package/src/capabilities/intent-resolver.ts +0 -21
  122. package/src/components/ExplorerContainer.tsx +0 -54
@@ -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, { 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 { getHashStyles } from '@dxos/react-ui-theme';\nimport { type SpaceGraphEdge, type SpaceGraphModel, type SpaceGraphNode } 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 = ({ classNames, model, selection: _selection, grid, ...props }: D3ForceGraphProps) => {\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: getHashStyles(obj && Obj.getTypename(obj))?.hue,\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 { type SearchResult, filterObjectsSync } 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>(null);\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 = null;\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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d,SAAAA;AACZf,mBAAWE,SAAS4B,aAAaf,IAAAA;MACnC,CAAA,EAICgB,QAAQ,QAAQC,UAAAA,EAAYC,SAAS,GAAA,EAAKC,SAAS,GAAA,CAAA,EACnDH,QAAQ,UAAUI,cAAAA,EAAgBD,SAAS,GAAC,CAAA,EAE5CV,UAAUnB,IAAAA,EACV+B,YAAY,GAAA,EACZC,aAAa,GAAA,EACbC,gBAAe;IACpB,GAAG;MAACjC;MAAMX;MAAOC;MAAQK,WAAWE;KAAQ;AAE5C,UAAM0B,kBAAkB,MAAA;AACtB5B,iBAAWE,SAASqC,UAAU,KAAK,EAAA;IACrC;AAEA,WACE,gBAAAC,OAAA,cAACC,OAAAA;MAAIhD;MAAUiD,WAAU;MAAgBC,SAASf;OAChD,gBAAAY,OAAA,cAACC,OAAAA;MAAIhD,KAAKK;MAAS4C,WAAU;;;;;AAGnC;",
6
- "names": ["React", "useCallback", "useEffect", "useMemo", "useRef", "Obj", "SelectionModel", "GraphForceProjector", "SVG", "getHashStyles", "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", "getHashStyles", "Obj", "getTypename", "hue", "classes", "onSelect", "forceLink", "forceManyBody", "NativeForceGraph", "React", "useEffect", "useRef", "useState", "useResizeDetector", "filterObjectsSync", "GraphAdapter", "nodes", "_nodes", "links", "_links", "graph", "map", "node", "id", "type", "data", "edges", "edge", "source", "target", "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", "onEngineStop", "handleZoomToFit", "onNodeClick", "emitParticle", "d3Force", "forceLink", "distance", "strength", "forceManyBody", "warmupTicks", "cooldownTime", "resumeAnimation", "zoomToFit", "React", "div", "className", "onClick"]
7
- }
@@ -1,80 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- meta
4
- } from "./chunk-PX6LHR2N.mjs";
5
- import {
6
- __export
7
- } from "./chunk-HSLMI22Q.mjs";
8
-
9
- // src/types/ExplorerAction.ts
10
- var ExplorerAction_exports = {};
11
- __export(ExplorerAction_exports, {
12
- CreateGraph: () => CreateGraph,
13
- GraphProps: () => GraphProps
14
- });
15
- import * as Schema from "effect/Schema";
16
- import { SpaceSchema } from "@dxos/react-client/echo";
17
- import { DataType, TypenameAnnotationId } from "@dxos/schema";
18
- var EXPLORER_ACTION = `${meta.id}/action`;
19
- var GraphProps = Schema.Struct({
20
- name: Schema.optional(Schema.String),
21
- typename: Schema.String.annotations({
22
- [TypenameAnnotationId]: [
23
- "used-static",
24
- "dynamic"
25
- ],
26
- title: "Select graph record type"
27
- })
28
- });
29
- var CreateGraph = class extends Schema.TaggedClass()(`${EXPLORER_ACTION}/create-graph`, {
30
- input: Schema.Struct({
31
- space: SpaceSchema
32
- }).pipe(Schema.extend(GraphProps)),
33
- output: Schema.Struct({
34
- object: DataType.View
35
- })
36
- }) {
37
- };
38
-
39
- // src/types/Graph.ts
40
- var Graph_exports = {};
41
- __export(Graph_exports, {
42
- Graph: () => Graph,
43
- make: () => make,
44
- makeView: () => makeView
45
- });
46
- import * as Schema2 from "effect/Schema";
47
- import { Filter, Obj, Query, QueryAST, Type } from "@dxos/echo";
48
- import { LabelAnnotation, ViewAnnotation } from "@dxos/echo/internal";
49
- import { createViewFromSpace } from "@dxos/schema";
50
- var Graph = Schema2.Struct({
51
- name: Schema2.optional(Schema2.String),
52
- query: Schema2.Struct({
53
- raw: Schema2.optional(Schema2.String),
54
- ast: QueryAST.Query
55
- }).pipe(Schema2.mutable)
56
- }).pipe(Type.Obj({
57
- typename: "dxos.org/type/Graph",
58
- version: "0.1.0"
59
- }), LabelAnnotation.set([
60
- "name"
61
- ]), ViewAnnotation.set(true));
62
- var make = (props = {
63
- query: {
64
- raw: "",
65
- ast: Query.select(Filter.nothing()).ast
66
- }
67
- }) => Obj.make(Graph, props);
68
- var makeView = async ({ presentation, ...props }) => {
69
- const graph = make(presentation);
70
- return createViewFromSpace({
71
- ...props,
72
- presentation: graph
73
- });
74
- };
75
-
76
- export {
77
- ExplorerAction_exports,
78
- Graph_exports
79
- };
80
- //# sourceMappingURL=chunk-ES6AOMCY.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/ExplorerAction.ts", "../../../src/types/Graph.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { SpaceSchema } from '@dxos/react-client/echo';\nimport { DataType, TypenameAnnotationId } from '@dxos/schema';\n\nimport { meta } from '../meta';\n\nconst EXPLORER_ACTION = `${meta.id}/action`;\n\nexport const GraphProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n typename: Schema.String.annotations({\n [TypenameAnnotationId]: ['used-static', 'dynamic'],\n title: 'Select graph record type',\n }),\n});\n\nexport class CreateGraph extends Schema.TaggedClass<CreateGraph>()(`${EXPLORER_ACTION}/create-graph`, {\n input: Schema.Struct({\n space: SpaceSchema,\n }).pipe(Schema.extend(GraphProps)),\n output: Schema.Struct({\n object: DataType.View,\n }),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Filter, Obj, Query, QueryAST, Type } from '@dxos/echo';\nimport { LabelAnnotation, ViewAnnotation } from '@dxos/echo/internal';\nimport { type CreateViewFromSpaceProps, createViewFromSpace } from '@dxos/schema';\n\nexport const Graph = Schema.Struct({\n name: Schema.optional(Schema.String),\n query: Schema.Struct({\n raw: Schema.optional(Schema.String),\n ast: QueryAST.Query,\n }).pipe(Schema.mutable),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Graph',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(true),\n);\n\nexport type Graph = Schema.Schema.Type<typeof Graph>;\n\n/**\n * Make a graph object.\n */\nexport const make = (\n props: Obj.MakeProps<typeof Graph> = { query: { raw: '', ast: Query.select(Filter.nothing()).ast } },\n) => Obj.make(Graph, props);\n\ntype MakeViewProps = Omit<CreateViewFromSpaceProps, 'presentation'> & {\n presentation?: Omit<Obj.MakeProps<typeof Graph>, 'name'>;\n};\n\n/**\n * Make a graph as a view of a data set.\n */\nexport const makeView = async ({ presentation, ...props }: MakeViewProps) => {\n const graph = make(presentation);\n return createViewFromSpace({ ...props, presentation: graph });\n};\n"],
5
- "mappings": ";;;;;;;;;AAAA;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,mBAAmB;AAC5B,SAASC,UAAUC,4BAA4B;AAI/C,IAAMC,kBAAkB,GAAGC,KAAKC,EAAE;AAE3B,IAAMC,aAAoBC,cAAO;EACtCC,MAAaC,gBAAgBC,aAAM;EACnCC,UAAiBD,cAAOE,YAAY;IAClC,CAACC,oBAAAA,GAAuB;MAAC;MAAe;;IACxCC,OAAO;EACT,CAAA;AACF,CAAA;AAEO,IAAMC,cAAN,cAAiCC,mBAAW,EAAgB,GAAGb,eAAAA,iBAAgC;EACpGc,OAAcV,cAAO;IACnBW,OAAOC;EACT,CAAA,EAAGC,KAAYC,cAAOf,UAAAA,CAAAA;EACtBgB,QAAef,cAAO;IACpBgB,QAAQC,SAASC;EACnB,CAAA;AACF,CAAA,EAAA;AAAI;;;AC5BJ;;;;;;AAIA,YAAYC,aAAY;AAExB,SAASC,QAAQC,KAAKC,OAAOC,UAAUC,YAAY;AACnD,SAASC,iBAAiBC,sBAAsB;AAChD,SAAwCC,2BAA2B;AAE5D,IAAMC,QAAeC,eAAO;EACjCC,MAAaC,iBAAgBC,cAAM;EACnCC,OAAcJ,eAAO;IACnBK,KAAYH,iBAAgBC,cAAM;IAClCG,KAAKC,SAASC;EAChB,CAAA,EAAGC,KAAYC,eAAO;AACxB,CAAA,EAAGD,KACDE,KAAKC,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBC,IAAI;EAAC;CAAO,GAC5BC,eAAeD,IAAI,IAAA,CAAA;AAQd,IAAME,OAAO,CAClBC,QAAqC;EAAEf,OAAO;IAAEC,KAAK;IAAIC,KAAKE,MAAMY,OAAOC,OAAOC,QAAO,CAAA,EAAIhB;EAAI;AAAE,MAChGM,IAAIM,KAAKnB,OAAOoB,KAAAA;AASd,IAAMI,WAAW,OAAO,EAAEC,cAAc,GAAGL,MAAAA,MAAsB;AACtE,QAAMM,QAAQP,KAAKM,YAAAA;AACnB,SAAOE,oBAAoB;IAAE,GAAGP;IAAOK,cAAcC;EAAM,CAAA;AAC7D;",
6
- "names": ["Schema", "SpaceSchema", "DataType", "TypenameAnnotationId", "EXPLORER_ACTION", "meta", "id", "GraphProps", "Struct", "name", "optional", "String", "typename", "annotations", "TypenameAnnotationId", "title", "CreateGraph", "TaggedClass", "input", "space", "SpaceSchema", "pipe", "extend", "output", "object", "DataType", "View", "Schema", "Filter", "Obj", "Query", "QueryAST", "Type", "LabelAnnotation", "ViewAnnotation", "createViewFromSpace", "Graph", "Struct", "name", "optional", "String", "query", "raw", "ast", "QueryAST", "Query", "pipe", "mutable", "Type", "Obj", "typename", "version", "LabelAnnotation", "set", "ViewAnnotation", "make", "props", "select", "Filter", "nothing", "makeView", "presentation", "graph", "createViewFromSpace"]
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 meta: PluginMeta = {\n id: 'dxos.org/plugin/explorer',\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,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa;IAAC;;AAChB;",
6
- "names": ["meta", "id", "name", "description", "icon", "source", "tags", "screenshots"]
7
- }