@dxos/plugin-explorer 0.6.12-main.15a606f → 0.6.12-main.2d19bf1

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 (52) hide show
  1. package/dist/lib/browser/{ExplorerArticle-2LF7QANN.mjs → ExplorerArticle-5SNS2WNJ.mjs} +2 -2
  2. package/dist/lib/browser/{ExplorerMain-K6Z6UVZR.mjs → ExplorerMain-ZEXQSLWN.mjs} +2 -2
  3. package/dist/lib/browser/{chunk-5OVYH5FD.mjs → chunk-NIYKOKPC.mjs} +4 -5
  4. package/dist/lib/browser/chunk-NIYKOKPC.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-DOI4BI5E.mjs → chunk-OUWTEFDV.mjs} +2 -2
  6. package/dist/lib/browser/{chunk-XKITKIPQ.mjs → chunk-WNQNMDOO.mjs} +2 -2
  7. package/dist/lib/browser/{chunk-XKITKIPQ.mjs.map → chunk-WNQNMDOO.mjs.map} +3 -3
  8. package/dist/lib/browser/index.mjs +5 -5
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/meta.mjs +1 -1
  11. package/dist/lib/browser/types/index.mjs +2 -2
  12. package/dist/lib/node/{ExplorerArticle-PQEEN244.cjs → ExplorerArticle-QWLRFTJ3.cjs} +6 -6
  13. package/dist/lib/node/{ExplorerMain-IGUMYIAN.cjs → ExplorerMain-YHTGV7H5.cjs} +6 -6
  14. package/dist/lib/node/{chunk-K4PB5A4K.cjs → chunk-B3DD7UMY.cjs} +4 -4
  15. package/dist/lib/node/{chunk-K4PB5A4K.cjs.map → chunk-B3DD7UMY.cjs.map} +1 -1
  16. package/dist/lib/node/{chunk-OJOGTJXQ.cjs → chunk-XPJ3TJZY.cjs} +6 -6
  17. package/dist/lib/node/{chunk-BODO2FF3.cjs → chunk-XSC6U7EH.cjs} +6 -7
  18. package/dist/lib/node/chunk-XSC6U7EH.cjs.map +7 -0
  19. package/dist/lib/node/index.cjs +23 -23
  20. package/dist/lib/node/meta.cjs +3 -3
  21. package/dist/lib/node/meta.cjs.map +1 -1
  22. package/dist/lib/node/meta.json +1 -1
  23. package/dist/lib/node/types/index.cjs +4 -4
  24. package/dist/lib/node/types/index.cjs.map +1 -1
  25. package/dist/lib/node-esm/{ExplorerArticle-NJ7EHCBX.mjs → ExplorerArticle-5NBIKSBJ.mjs} +2 -2
  26. package/dist/lib/node-esm/{ExplorerMain-O7X6HTMU.mjs → ExplorerMain-2M5RWFU4.mjs} +2 -2
  27. package/dist/lib/node-esm/{chunk-2A6TYAA2.mjs → chunk-BMZO4IJU.mjs} +2 -2
  28. package/dist/lib/node-esm/{chunk-NSJKKBIS.mjs → chunk-T6BPVYCJ.mjs} +2 -2
  29. package/dist/lib/node-esm/{chunk-NSJKKBIS.mjs.map → chunk-T6BPVYCJ.mjs.map} +3 -3
  30. package/dist/lib/node-esm/{chunk-ZYRYGGWK.mjs → chunk-W2DSGFVW.mjs} +4 -5
  31. package/dist/lib/node-esm/chunk-W2DSGFVW.mjs.map +7 -0
  32. package/dist/lib/node-esm/index.mjs +5 -5
  33. package/dist/lib/node-esm/meta.json +1 -1
  34. package/dist/lib/node-esm/meta.mjs +1 -1
  35. package/dist/lib/node-esm/types/index.mjs +2 -2
  36. package/dist/types/src/meta.d.ts +4 -6
  37. package/dist/types/src/meta.d.ts.map +1 -1
  38. package/package.json +24 -23
  39. package/src/components/Graph/graph-model.ts +1 -1
  40. package/src/{meta.tsx → meta.ts} +3 -3
  41. package/dist/lib/browser/chunk-5OVYH5FD.mjs.map +0 -7
  42. package/dist/lib/node/chunk-BODO2FF3.cjs.map +0 -7
  43. package/dist/lib/node-esm/chunk-ZYRYGGWK.mjs.map +0 -7
  44. /package/dist/lib/browser/{ExplorerArticle-2LF7QANN.mjs.map → ExplorerArticle-5SNS2WNJ.mjs.map} +0 -0
  45. /package/dist/lib/browser/{ExplorerMain-K6Z6UVZR.mjs.map → ExplorerMain-ZEXQSLWN.mjs.map} +0 -0
  46. /package/dist/lib/browser/{chunk-DOI4BI5E.mjs.map → chunk-OUWTEFDV.mjs.map} +0 -0
  47. /package/dist/lib/node/{ExplorerArticle-PQEEN244.cjs.map → ExplorerArticle-QWLRFTJ3.cjs.map} +0 -0
  48. /package/dist/lib/node/{ExplorerMain-IGUMYIAN.cjs.map → ExplorerMain-YHTGV7H5.cjs.map} +0 -0
  49. /package/dist/lib/node/{chunk-OJOGTJXQ.cjs.map → chunk-XPJ3TJZY.cjs.map} +0 -0
  50. /package/dist/lib/node-esm/{ExplorerArticle-NJ7EHCBX.mjs.map → ExplorerArticle-5NBIKSBJ.mjs.map} +0 -0
  51. /package/dist/lib/node-esm/{ExplorerMain-O7X6HTMU.mjs.map → ExplorerMain-2M5RWFU4.mjs.map} +0 -0
  52. /package/dist/lib/node-esm/{chunk-2A6TYAA2.mjs.map → chunk-BMZO4IJU.mjs.map} +0 -0
@@ -26,14 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_K4PB5A4K_exports = {};
30
- __export(chunk_K4PB5A4K_exports, {
29
+ var chunk_B3DD7UMY_exports = {};
30
+ __export(chunk_B3DD7UMY_exports, {
31
31
  Graph: () => Graph,
32
32
  SpaceGraphModel: () => SpaceGraphModel,
33
33
  Tree: () => Tree,
34
34
  defaultTreeLayoutSlots: () => defaultTreeLayoutSlots
35
35
  });
36
- module.exports = __toCommonJS(chunk_K4PB5A4K_exports);
36
+ module.exports = __toCommonJS(chunk_B3DD7UMY_exports);
37
37
  var import_echo_schema = require("@dxos/echo-schema");
38
38
  var import_gem_spore = require("@dxos/gem-spore");
39
39
  var import_log = require("@dxos/log");
@@ -492,4 +492,4 @@ var Tree = ({ space, selected, variant = "tidy", onNodeClick }) => {
492
492
  Tree,
493
493
  defaultTreeLayoutSlots
494
494
  });
495
- //# sourceMappingURL=chunk-K4PB5A4K.cjs.map
495
+ //# sourceMappingURL=chunk-B3DD7UMY.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Graph/graph-model.ts", "../../../src/components/Tree/Tree.tsx", "../../../src/components/Tree/layout/HierarchicalEdgeBundling.ts", "../../../src/components/Tree/layout/RadialTree.ts", "../../../src/components/Tree/layout/TidyTree.ts", "../../../src/components/Tree/types.ts", "../../../src/components/Graph/Graph.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n AST,\n DynamicSchema,\n getSchema,\n getType,\n ReferenceAnnotationId,\n type S,\n SchemaValidator,\n StoredSchema,\n} from '@dxos/echo-schema';\nimport { type GraphData, type GraphLink, GraphModel } from '@dxos/gem-spore';\nimport { log } from '@dxos/log';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { type EchoReactiveObject, type Space, type Subscription } from '@dxos/react-client/echo';\n\nexport type SpaceGraphModelOptions = {\n schema?: boolean;\n};\n\nexport type EchoGraphNode = SchemaGraphNode | EchoObjectGraphNode;\n\ntype EchoObjectGraphNode = {\n id: string;\n type: 'echo-object';\n object: EchoReactiveObject<any>;\n};\n\ntype SchemaGraphNode = {\n id: string;\n type: 'schema';\n schema: S.Schema<any>;\n};\n\n/**\n * Converts ECHO objects to a graph.\n */\nexport class SpaceGraphModel extends GraphModel<EchoGraphNode> {\n private readonly _graph: GraphData<EchoGraphNode> = {\n nodes: [],\n links: [],\n };\n\n private _subscription?: Subscription;\n private _objects?: EchoReactiveObject<any>[];\n\n constructor(private readonly _options: SpaceGraphModelOptions = {}) {\n super();\n }\n\n override get graph(): GraphData<EchoGraphNode> {\n return this._graph;\n }\n\n get objects(): EchoReactiveObject<any>[] {\n return this._objects ?? [];\n }\n\n open(space: Space, objectId?: string) {\n if (!this._subscription) {\n // TODO(burdon): Filter.\n const query = space.db.query((object: EchoReactiveObject<any>) => !(object instanceof CollectionType));\n\n this._subscription = query.subscribe(\n ({ objects }) => {\n this._objects = objects;\n this._graph.nodes = objects.map((object) => {\n if (object instanceof StoredSchema) {\n const effectSchema = space.db.schema.getSchemaById(object.id)!;\n return { type: 'schema', id: object.id, schema: effectSchema.schema };\n }\n return { type: 'echo-object', id: object.id, object };\n });\n this._graph.links = objects.reduce<GraphLink[]>((links, object) => {\n const objectSchema = getSchema(object);\n const typename = getType(object)?.objectId;\n if (objectSchema == null || typename == null) {\n log.info('no schema for object:', { id: object.id.slice(0, 8) });\n return links;\n }\n\n if (!(objectSchema instanceof DynamicSchema)) {\n const idx = objects.findIndex((obj) => obj.id === typename);\n if (idx === -1) {\n this._graph.nodes.push({\n id: typename,\n type: 'schema',\n schema: objectSchema,\n });\n }\n }\n\n // Link to schema.\n if (this._options.schema) {\n links.push({\n id: `${object.id}-${typename}`,\n source: object.id,\n target: typename,\n });\n }\n\n // Parse schema to follow referenced objects.\n AST.getPropertySignatures(objectSchema.ast).forEach((prop) => {\n if (!SchemaValidator.hasTypeAnnotation(objectSchema, prop.name.toString(), ReferenceAnnotationId)) {\n return;\n }\n const value = object[String(prop.name)];\n if (value) {\n const refs = Array.isArray(value) ? value : [value];\n for (const ref of refs) {\n if (objects.findIndex((obj) => obj.id === ref.id) !== -1) {\n links.push({\n id: `${object.id}-${String(prop.name)}-${ref.id}`,\n source: object.id,\n target: ref.id,\n });\n }\n }\n }\n });\n\n return links;\n }, []);\n\n this.triggerUpdate();\n },\n { fire: true },\n );\n }\n\n this.setSelected(objectId);\n return this;\n }\n\n close() {\n if (this._subscription) {\n this._subscription();\n this._subscription = undefined;\n }\n\n return this;\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type Space } from '@dxos/client/echo';\nimport { createSvgContext, SVG, SVGRoot } from '@dxos/gem-core';\n\nimport { HierarchicalEdgeBundling, RadialTree, TidyTree } from './layout';\nimport { mapGraphToTreeData, type TreeNode } from './types';\nimport { SpaceGraphModel } from '../Graph';\n\n// TODO(burdon): Create dge bundling graph using d3.hierarchy.\n// https://observablehq.com/@d3/hierarchical-edge-bundling?intent=fork\n\ntype Renderer = (svg: SVGSVGElement, data: any, options: any) => void;\n\nexport type LayoutVariant = 'tidy' | 'radial' | 'edge';\n\n// TODO(burdon): Remove slots?\nexport type TreeLayoutSlots = {\n node?: string;\n path?: string;\n text?: string;\n};\n\nexport type TreeOptions = {\n label: (d: any) => string;\n\n slots?: TreeLayoutSlots;\n radius?: number;\n\n width: number;\n height: number;\n margin?: number;\n\n padding?: number;\n // Radius of nodes.\n r?: number;\n};\n\nexport const defaultTreeLayoutSlots: TreeLayoutSlots = {\n node: 'fill-blue-600',\n path: 'fill-none stroke-blue-400 stroke-[0.5px]',\n text: 'stroke-[0.5px] stroke-neutral-700 text-xs', // TODO(burdon): Create box instead of halo.\n};\n\nconst renderers = new Map<LayoutVariant, Renderer>([\n ['tidy', TidyTree],\n ['radial', RadialTree],\n ['edge', HierarchicalEdgeBundling],\n]);\n\nexport type TreeComponentProps<N = unknown> = {\n space: Space;\n selected?: string;\n variant?: LayoutVariant;\n onNodeClick?: (node?: N) => void;\n};\n\n// TODO(burdon): Label accessor.\nexport const Tree = <N,>({ space, selected, variant = 'tidy', onNodeClick }: TreeComponentProps<N>) => {\n const model = useMemo(() => (space ? new SpaceGraphModel().open(space, selected) : undefined), [space, selected]);\n const [tree, setTree] = useState<TreeNode>();\n useEffect(() => {\n return model?.subscribe(() => {\n const tree = mapGraphToTreeData(model);\n setTree(tree);\n }, true);\n }, [model]);\n\n const context = createSvgContext();\n const { ref, width = 0, height = 0 } = useResizeDetector();\n\n useEffect(() => {\n if (width && height) {\n const size = Math.min(width, height);\n const radius = size * 0.4;\n const options = {\n // TODO(burdon): Type.\n label: (d: any) => d.label ?? d.id,\n width,\n height,\n radius,\n marginLeft: (width - radius * 2) / 2,\n marginRight: (width - radius * 2) / 2,\n marginTop: (height - radius * 2) / 2,\n marginBottom: (height - radius * 2) / 2,\n slots: defaultTreeLayoutSlots,\n };\n\n if (tree) {\n const renderer = renderers.get(variant);\n renderer?.(context.ref.current!, tree, options);\n }\n }\n }, [tree, width, height]);\n\n // TODO(burdon): Provider should expand.\n return (\n <div ref={ref} className='flex grow overflow-hidden' onClick={() => onNodeClick?.()}>\n <SVGRoot context={context}>\n <SVG />\n </SVGRoot>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n// Copyright 2022 Observable, Inc.\n//\n\nimport * as d3 from 'd3';\nimport { type HierarchyNode } from 'd3-hierarchy';\n\nimport { type TreeOptions } from '../Tree';\nimport { type TreeNode } from '../types';\n\n// Create hierarchical ID.\n// eslint-disable-next-line unused-imports/no-unused-vars\nconst getId = (node: HierarchyNode<TreeNode>): string =>\n `${node.parent ? getId(node.parent) + '/' : ''}${node.data.id.slice(0, 4)}`;\n\n// https://github.com/d3/d3-hierarchy\n// https://observablehq.com/@d3/hierarchical-edge-bundling?intent=fork\nconst HierarchicalEdgeBundling = (s: SVGSVGElement, data: TreeNode, options: TreeOptions) => {\n const svg = d3.select(s);\n svg.selectAll('*').remove();\n\n const { radius = 600, padding = 100, slots } = options;\n\n // https://d3js.org/d3-hierarchy/hierarchy\n const root = d3.hierarchy(flatten(data));\n // .sort((a, b) => d3.ascending(a.height, b.height) || d3.ascending(getName(a.data), getName(b.data)));\n\n const tree = d3.cluster<TreeNode>().size([2 * Math.PI, radius - padding]);\n const layout = tree(addLinks(root));\n\n // eslint-disable-next-line unused-imports/no-unused-vars\n const node = svg\n .append('g')\n .selectAll()\n .data(layout.leaves())\n .join('g')\n .attr('transform', (d) => `rotate(${d.x * (180 / Math.PI) - 90}) translate(${d.y},0)`)\n .append('text')\n .attr('class', slots?.text ?? '')\n .attr('dy', '0.31em') // TODO(burdon): Based on font size.\n .attr('x', (d) => (d.x < Math.PI ? 6 : -6))\n .attr('text-anchor', (d) => (d.x < Math.PI ? 'start' : 'end'))\n .attr('transform', (d) => (d.x >= Math.PI ? 'rotate(180)' : null))\n // .text((d: any) => d.data.id)\n // .each(function (d: any) {\n // d.text = this;\n // })\n // .on('mouseover', overed)\n // .on('mouseout', outed)\n .call(\n (text) => text.text((d: any) => d.data.id.slice(0, 8)),\n // .text((d: any) => `${getId(d)} [${[(d as any).outgoing?.length ?? 0]}]`),\n );\n\n // https://d3js.org/d3-shape/radial-line\n const line = d3\n .lineRadial()\n .curve(d3.curveBundle.beta(0.85))\n .radius((d: any) => d.y)\n .angle((d: any) => d.x);\n\n // eslint-disable-next-line unused-imports/no-unused-vars\n const links = svg\n .append('g')\n .selectAll()\n .data(layout.leaves().flatMap((leaf: any) => leaf.outgoing))\n .join('path')\n .style('mix-blend-mode', 'multiply')\n .attr('class', slots?.path ?? '')\n .attr('d', ([i, o]) => {\n return line(i.path(o));\n })\n .each(function (d) {\n d.path = this;\n });\n\n // function overed(event: any, d: X) {\n // link.style('mix-blend-mode', null);\n // d3.select(this).attr('font-weight', 'bold');\n // d3.selectAll(d.incoming.map((d) => d.path))\n // .attr('stroke', color.in)\n // .raise();\n // d3.selectAll((d as any).incoming.map(([d]) => d.text))\n // .attr('fill', color.in)\n // .attr('font-weight', 'bold');\n // d3.selectAll(d.outgoing.map((d) => d.path))\n // .attr('stroke', color.out)\n // .raise();\n // d3.selectAll(d.outgoing.map(([, d]) => d.text))\n // .attr('fill', color.out)\n // .attr('font-weight', 'bold');\n // }\n\n // function outed(event: any, d: HierarchyNode<Datum>) {\n // // @ts-ignore\n // d3.select(this).attr('font-weight', null);\n // d3.selectAll(d.incoming.map((d) => d.path)).attr('stroke', null);\n // d3.selectAll(d.incoming.map(([d]) => d.text))\n // .attr('fill', null)\n // .attr('font-weight', null);\n // d3.selectAll(d.outgoing.map((d) => d.path)).attr('stroke', null);\n // d3.selectAll(d.outgoing.map(([, d]) => d.text))\n // .attr('fill', null)\n // .attr('font-weight', null);\n // }\n};\n\n// Monkey-patch with incoming/outgoing nodes.\nconst addLinks = (root: HierarchyNode<TreeNode>) => {\n // Map of nodes indexed by ID.\n const nodes = new Map(root.descendants().map((d) => [d.data.id, d]));\n const parents = root.descendants().reduce((map, d) => {\n if (d.children?.length) {\n map.set(d.data.id, d);\n }\n return map;\n }, new Map<string, HierarchyNode<TreeNode>>());\n\n for (const d of root.leaves()) {\n // (d as any).incoming = [];\n\n const parent = parents.get(d.data.id);\n if (parent) {\n // Skip the first node which is a placeholder created by flatten().\n (d as any).outgoing =\n parent.data.children?.slice(1).map((child) => {\n return [d, nodes.get(child.id)!];\n }) ?? [];\n } else {\n (d as any).outgoing = [];\n }\n }\n\n // for (const d of root.leaves()) {\n // for (const [_, o] of (d as any).outgoing) {\n // o.incoming.push(o);\n // }\n // }\n\n return root;\n};\n\n/**\n * We are using a hierarchy in order to group nodes by parent, but we want the parent\n * nodes to be positioned at the first level along with all descendents.\n * So we add a placeholder for all parents at the head of each group.\n * @param node\n */\nconst flatten = (node: TreeNode) => {\n const clone: TreeNode = {\n id: node.id,\n };\n\n // TODO(burdon): NOTE: Should exclude schema (since requires a tree).\n if (node.children?.length) {\n const children = node.children.map((child) => flatten(child));\n clone.children = [{ id: node.id }, ...children];\n }\n\n return clone;\n};\n\nexport default HierarchicalEdgeBundling;\n", "//\n// Copyright 2023 DXOS.org\n// Copyright 2022 Observable, Inc.\n//\n\nimport * as d3 from 'd3';\n\nimport { type TreeOptions } from '../Tree';\n\n// Released under the ISC license.\n// https://observablehq.com/@d3/radial-tree\n// https://observablehq.com/@d3/tree\nconst RadialTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {\n const svg = d3.select(s);\n svg.selectAll('*').remove();\n\n const {\n label, // given a node d, returns the display name\n radius = 400,\n r = 4, // radius of nodes\n slots,\n } = options;\n\n const arc = 2 * Math.PI;\n\n const root = d3.hierarchy(data);\n\n // Sort the nodes.\n // if (sort) {\n // root.sort(sort);\n // }\n\n // Compute labels and titles.\n const descendants = root.descendants();\n const getLabel = label === null ? null : descendants.map((d) => label(d.data));\n\n // Compute the layout.\n const layout = d3\n .tree()\n .size([arc, radius])\n .separation((a: any, b: any) => (a.parent === b.parent ? 1 : 2) / a.depth);\n layout(root);\n\n // Links.\n svg\n .append('g')\n .selectAll('path')\n .data(root.links())\n .join('path')\n .attr('class', slots?.path ?? '')\n .attr(\n 'd',\n d3\n .linkRadial()\n .angle((d: any) => d.x + Math.PI / 2)\n .radius((d: any) => d.y) as any,\n );\n\n // Nodes.\n const node = svg\n .append('g')\n .selectAll('a')\n .data(root.descendants())\n .join('a')\n // .attr('xlink:href', link == null ? null : (d) => link(d.data, d))\n // .attr('target', link == null ? null : linkTarget)\n .attr('transform', (d: any) => `rotate(${(d.x * 180) / Math.PI}) translate(${d.y},0)`);\n\n node\n .append('circle')\n .attr('class', slots?.node ?? '')\n .attr('r', r);\n\n // if (title != null) {\n // node.append('title').text((d) => title(d.data, d));\n // }\n\n // Text.\n if (getLabel) {\n node\n .append('text')\n .attr('transform', (d: any) => `rotate(${d.x >= Math.PI ? 180 : 0})`)\n .attr('dy', '0.32em')\n // eslint-disable-next-line no-mixed-operators\n .attr('x', (d: any) => (d.x < Math.PI === !d.children ? 6 : -6))\n // eslint-disable-next-line no-mixed-operators\n .attr('text-anchor', (d: any) => (d.x < Math.PI === !d.children ? 'start' : 'end'))\n // .attr('paint-order', 'stroke')\n .attr('class', slots?.text ?? '')\n .text((d, i) => getLabel[i]);\n }\n\n return svg.node();\n};\n\nexport default RadialTree;\n", "//\n// Copyright 2023 DXOS.org\n// Copyright 2021 Observable, Inc.\n//\n\nimport * as d3 from 'd3';\n\nimport { type TreeOptions } from '../Tree';\n\n// Released under the ISC license.\n// https://observablehq.com/@d3/tree\nconst TidyTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {\n const svg = d3.select(s);\n svg.selectAll('*').remove();\n\n const { label, width, height, r = 4, padding = 4, margin = 60, slots } = options;\n\n const root = d3.hierarchy(data);\n\n // Compute labels and titles.\n const descendants = root.descendants();\n const getLabel = label == null ? null : descendants.map((d) => label(d.data));\n\n // Compute the layout.\n const dx = 16;\n const dy = width / (root.height + padding);\n const layout = d3.tree().nodeSize([dx, dy]);\n layout(root);\n\n // Center the tree.\n let x0 = Infinity;\n let x1 = -x0;\n let y0 = Infinity;\n let y1 = -y0;\n root.each((d: any) => {\n if (d.x > x1) {\n x1 = d.x;\n }\n if (d.x < x0) {\n x0 = d.x;\n }\n if (d.y > y1) {\n y1 = d.y;\n }\n if (d.y < y0) {\n y0 = d.y;\n }\n });\n\n // TODO(burdon): Option to expand.\n // NOTE: x and y are flipped.\n const sx = Math.min(2, Math.max(1, (height - margin * 2) / (x1 - x0)));\n const oy = -(width - (y1 - y0)) / 2;\n\n // Links.\n svg\n .append('g')\n .selectAll('path')\n .data(root.links())\n .join('path')\n .attr('class', slots?.path ?? '')\n .attr(\n 'd',\n d3\n .link(d3.curveBumpX)\n .x((d: any) => d.y + oy)\n .y((d: any) => d.x * sx) as any,\n );\n\n // Nodes.\n const node = svg\n .append('g')\n .selectAll('a')\n .data(root.descendants())\n .join('a')\n // .attr('xlink:href', link == null ? null : (d) => link(d.data, d))\n // .attr('target', link == null ? null : linkTarget)\n .attr('transform', (d: any) => `translate(${d.y + oy},${d.x * sx})`);\n\n node\n .append('circle')\n .attr('class', slots?.node ?? '')\n .attr('r', r);\n\n // if (title != null) {\n // node.append('title').text((d) => title(d.data, d));\n // }\n\n if (getLabel) {\n node\n .append('text')\n\n .attr('dy', '0.32em')\n .attr('x', (d) => (d.children ? -6 : 6))\n .attr('text-anchor', (d) => (d.children ? 'end' : 'start'))\n // .attr('paint-order', 'stroke')\n .attr('class', slots?.text ?? '')\n .text((d, i) => getLabel[i]);\n }\n};\n\nexport default TidyTree;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { GraphModel } from '@dxos/gem-spore';\n\nexport type TreeNode = {\n id: string;\n label?: string;\n children?: TreeNode[];\n};\n\nexport const mapGraphToTreeData = <N>(model: GraphModel<N>, maxDepth = 8): TreeNode | undefined => {\n const mapNode = (node: N, depth = 0): TreeNode => {\n const treeNode: TreeNode = {\n id: model.idAccessor(node),\n label: model.idAccessor(node).slice(0, 8),\n };\n\n const links = model.graph.links.filter((link) => link.source === treeNode.id);\n if (depth < maxDepth) {\n treeNode.children = links.map((link) =>\n mapNode(model.graph.nodes.find((node) => model.idAccessor(node) === link.target)!, depth + 1),\n );\n }\n\n return treeNode;\n };\n\n let data: TreeNode | undefined;\n if (model.selected) {\n const node = model.graph.nodes.find((node) => model.idAccessor(node) === model.selected);\n if (node) {\n data = mapNode(node);\n }\n }\n\n return data;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { type Space } from '@dxos/client/echo';\nimport { type EchoReactiveObject, getType } from '@dxos/echo-schema';\nimport { createSvgContext, defaultGridStyles, Grid, SVG, SVGRoot, Zoom } from '@dxos/gem-core';\nimport {\n defaultStyles,\n Graph as GraphComponent,\n GraphForceProjector,\n type GraphLayoutNode,\n Markers,\n} from '@dxos/gem-spore';\nimport { filterObjectsSync, type SearchResult } from '@dxos/plugin-search';\nimport { useThemeContext } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport '@dxos/gem-spore/styles';\n\nimport { type EchoGraphNode, SpaceGraphModel } from './graph-model';\nimport { Tree } from '../Tree';\n\ntype Slots = {\n root?: { className?: string };\n grid?: { className?: string };\n};\n\nconst slots: Slots = {};\n\nconst colors = [\n '[&>circle]:!fill-black-300 [&>circle]:!stroke-black-600',\n '[&>circle]:!fill-slate-300 [&>circle]:!stroke-slate-600',\n '[&>circle]:!fill-green-300 [&>circle]:!stroke-green-600',\n '[&>circle]:!fill-sky-300 [&>circle]:!stroke-sky-600',\n '[&>circle]:!fill-cyan-300 [&>circle]:!stroke-cyan-600',\n '[&>circle]:!fill-rose-300 [&>circle]:!stroke-rose-600',\n '[&>circle]:!fill-purple-300 [&>circle]:!stroke-purple-600',\n '[&>circle]:!fill-orange-300 [&>circle]:!stroke-orange-600',\n '[&>circle]:!fill-teal-300 [&>circle]:!stroke-teal-600',\n '[&>circle]:!fill-indigo-300 [&>circle]:!stroke-indigo-600',\n];\n\nexport type GraphProps = {\n space: Space;\n match?: RegExp;\n};\n\nexport const Graph: FC<GraphProps> = ({ space, match }) => {\n const model = useMemo(() => (space ? new SpaceGraphModel({ schema: true }).open(space) : undefined), [space]);\n const [selected, setSelected] = useState<string>();\n const { themeMode } = useThemeContext();\n\n const context = createSvgContext();\n const projector = useMemo(\n () =>\n new GraphForceProjector<EchoGraphNode>(context, {\n forces: {\n manyBody: {\n strength: -100,\n },\n link: {\n distance: 180,\n },\n radial: {\n radius: 200,\n strength: 0.05,\n },\n },\n attributes: {\n radius: (node: GraphLayoutNode<EchoGraphNode>) => (node.data?.type === 'schema' ? 24 : 12),\n },\n }),\n [],\n );\n\n const filteredRef = useRef<SearchResult[]>();\n filteredRef.current = filterObjectsSync(model?.objects ?? [], match);\n useEffect(() => {\n void projector.start();\n }, [match]);\n\n const [colorMap] = useState(new Map<string, string>());\n\n if (!model) {\n return null;\n }\n\n if (selected) {\n return <Tree space={space} selected={selected} variant='tidy' onNodeClick={() => setSelected(undefined)} />;\n }\n\n return (\n <SVGRoot context={context}>\n <SVG className={mx(defaultStyles, slots?.root?.className)}>\n <Markers arrowSize={6} />\n <Grid className={slots?.grid?.className ?? defaultGridStyles(themeMode)} />\n <Zoom extent={[1 / 2, 4]}>\n <GraphComponent\n model={model}\n projector={projector}\n drag\n arrows\n onSelect={(node) => setSelected(node?.data?.id)}\n labels={{\n text: (node: GraphLayoutNode<EchoReactiveObject<any>>) => {\n if (filteredRef.current?.length && !filteredRef.current.some((object) => object.id === node.data?.id)) {\n return undefined;\n }\n\n // TODO(burdon): Use schema.\n return node.data?.label ?? node.data?.title ?? node.data?.name ?? node.data?.id.slice(0, 8);\n },\n }}\n attributes={{\n node: (node: GraphLayoutNode<EchoReactiveObject<any>>) => {\n let className: string | undefined;\n if (node.data) {\n const typename = getType(node.data)?.objectId;\n if (typename) {\n className = colorMap.get(typename);\n if (!className) {\n className = colors[colorMap.size % colors.length];\n colorMap.set(typename, className);\n }\n }\n }\n\n const selected = filteredRef.current?.some((object) => object.id === node.data?.id);\n return {\n class: mx(\n filteredRef.current?.length\n ? selected\n ? [className]\n : '[&>text]:!fill-neutral-300'\n : ['[&>text]:!fill-neutral-700', className],\n ),\n };\n },\n link: () => ({\n class: '[&>path]:!stroke-neutral-300',\n }),\n }}\n />\n </Zoom>\n </SVG>\n </SVGRoot>\n );\n};\n"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n AST,\n getSchema,\n getType,\n DynamicSchema,\n ReferenceAnnotationId,\n type S,\n SchemaValidator,\n StoredSchema,\n} from '@dxos/echo-schema';\nimport { type GraphData, type GraphLink, GraphModel } from '@dxos/gem-spore';\nimport { log } from '@dxos/log';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { type EchoReactiveObject, type Space, type Subscription } from '@dxos/react-client/echo';\n\nexport type SpaceGraphModelOptions = {\n schema?: boolean;\n};\n\nexport type EchoGraphNode = SchemaGraphNode | EchoObjectGraphNode;\n\ntype EchoObjectGraphNode = {\n id: string;\n type: 'echo-object';\n object: EchoReactiveObject<any>;\n};\n\ntype SchemaGraphNode = {\n id: string;\n type: 'schema';\n schema: S.Schema<any>;\n};\n\n/**\n * Converts ECHO objects to a graph.\n */\nexport class SpaceGraphModel extends GraphModel<EchoGraphNode> {\n private readonly _graph: GraphData<EchoGraphNode> = {\n nodes: [],\n links: [],\n };\n\n private _subscription?: Subscription;\n private _objects?: EchoReactiveObject<any>[];\n\n constructor(private readonly _options: SpaceGraphModelOptions = {}) {\n super();\n }\n\n override get graph(): GraphData<EchoGraphNode> {\n return this._graph;\n }\n\n get objects(): EchoReactiveObject<any>[] {\n return this._objects ?? [];\n }\n\n open(space: Space, objectId?: string) {\n if (!this._subscription) {\n // TODO(burdon): Filter.\n const query = space.db.query((object: EchoReactiveObject<any>) => !(object instanceof CollectionType));\n\n this._subscription = query.subscribe(\n ({ objects }) => {\n this._objects = objects;\n this._graph.nodes = objects.map((object) => {\n if (object instanceof StoredSchema) {\n const effectSchema = space.db.schema.getSchemaById(object.id)!;\n return { type: 'schema', id: object.id, schema: effectSchema.schema };\n }\n return { type: 'echo-object', id: object.id, object };\n });\n this._graph.links = objects.reduce<GraphLink[]>((links, object) => {\n const objectSchema = getSchema(object);\n const typename = getType(object)?.objectId;\n if (objectSchema == null || typename == null) {\n log.info('no schema for object:', { id: object.id.slice(0, 8) });\n return links;\n }\n\n if (!(objectSchema instanceof DynamicSchema)) {\n const idx = objects.findIndex((obj) => obj.id === typename);\n if (idx === -1) {\n this._graph.nodes.push({\n id: typename,\n type: 'schema',\n schema: objectSchema,\n });\n }\n }\n\n // Link to schema.\n if (this._options.schema) {\n links.push({\n id: `${object.id}-${typename}`,\n source: object.id,\n target: typename,\n });\n }\n\n // Parse schema to follow referenced objects.\n AST.getPropertySignatures(objectSchema.ast).forEach((prop) => {\n if (!SchemaValidator.hasTypeAnnotation(objectSchema, prop.name.toString(), ReferenceAnnotationId)) {\n return;\n }\n const value = object[String(prop.name)];\n if (value) {\n const refs = Array.isArray(value) ? value : [value];\n for (const ref of refs) {\n if (objects.findIndex((obj) => obj.id === ref.id) !== -1) {\n links.push({\n id: `${object.id}-${String(prop.name)}-${ref.id}`,\n source: object.id,\n target: ref.id,\n });\n }\n }\n }\n });\n\n return links;\n }, []);\n\n this.triggerUpdate();\n },\n { fire: true },\n );\n }\n\n this.setSelected(objectId);\n return this;\n }\n\n close() {\n if (this._subscription) {\n this._subscription();\n this._subscription = undefined;\n }\n\n return this;\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type Space } from '@dxos/client/echo';\nimport { createSvgContext, SVG, SVGRoot } from '@dxos/gem-core';\n\nimport { HierarchicalEdgeBundling, RadialTree, TidyTree } from './layout';\nimport { mapGraphToTreeData, type TreeNode } from './types';\nimport { SpaceGraphModel } from '../Graph';\n\n// TODO(burdon): Create dge bundling graph using d3.hierarchy.\n// https://observablehq.com/@d3/hierarchical-edge-bundling?intent=fork\n\ntype Renderer = (svg: SVGSVGElement, data: any, options: any) => void;\n\nexport type LayoutVariant = 'tidy' | 'radial' | 'edge';\n\n// TODO(burdon): Remove slots?\nexport type TreeLayoutSlots = {\n node?: string;\n path?: string;\n text?: string;\n};\n\nexport type TreeOptions = {\n label: (d: any) => string;\n\n slots?: TreeLayoutSlots;\n radius?: number;\n\n width: number;\n height: number;\n margin?: number;\n\n padding?: number;\n // Radius of nodes.\n r?: number;\n};\n\nexport const defaultTreeLayoutSlots: TreeLayoutSlots = {\n node: 'fill-blue-600',\n path: 'fill-none stroke-blue-400 stroke-[0.5px]',\n text: 'stroke-[0.5px] stroke-neutral-700 text-xs', // TODO(burdon): Create box instead of halo.\n};\n\nconst renderers = new Map<LayoutVariant, Renderer>([\n ['tidy', TidyTree],\n ['radial', RadialTree],\n ['edge', HierarchicalEdgeBundling],\n]);\n\nexport type TreeComponentProps<N = unknown> = {\n space: Space;\n selected?: string;\n variant?: LayoutVariant;\n onNodeClick?: (node?: N) => void;\n};\n\n// TODO(burdon): Label accessor.\nexport const Tree = <N,>({ space, selected, variant = 'tidy', onNodeClick }: TreeComponentProps<N>) => {\n const model = useMemo(() => (space ? new SpaceGraphModel().open(space, selected) : undefined), [space, selected]);\n const [tree, setTree] = useState<TreeNode>();\n useEffect(() => {\n return model?.subscribe(() => {\n const tree = mapGraphToTreeData(model);\n setTree(tree);\n }, true);\n }, [model]);\n\n const context = createSvgContext();\n const { ref, width = 0, height = 0 } = useResizeDetector();\n\n useEffect(() => {\n if (width && height) {\n const size = Math.min(width, height);\n const radius = size * 0.4;\n const options = {\n // TODO(burdon): Type.\n label: (d: any) => d.label ?? d.id,\n width,\n height,\n radius,\n marginLeft: (width - radius * 2) / 2,\n marginRight: (width - radius * 2) / 2,\n marginTop: (height - radius * 2) / 2,\n marginBottom: (height - radius * 2) / 2,\n slots: defaultTreeLayoutSlots,\n };\n\n if (tree) {\n const renderer = renderers.get(variant);\n renderer?.(context.ref.current!, tree, options);\n }\n }\n }, [tree, width, height]);\n\n // TODO(burdon): Provider should expand.\n return (\n <div ref={ref} className='flex grow overflow-hidden' onClick={() => onNodeClick?.()}>\n <SVGRoot context={context}>\n <SVG />\n </SVGRoot>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n// Copyright 2022 Observable, Inc.\n//\n\nimport * as d3 from 'd3';\nimport { type HierarchyNode } from 'd3-hierarchy';\n\nimport { type TreeOptions } from '../Tree';\nimport { type TreeNode } from '../types';\n\n// Create hierarchical ID.\n// eslint-disable-next-line unused-imports/no-unused-vars\nconst getId = (node: HierarchyNode<TreeNode>): string =>\n `${node.parent ? getId(node.parent) + '/' : ''}${node.data.id.slice(0, 4)}`;\n\n// https://github.com/d3/d3-hierarchy\n// https://observablehq.com/@d3/hierarchical-edge-bundling?intent=fork\nconst HierarchicalEdgeBundling = (s: SVGSVGElement, data: TreeNode, options: TreeOptions) => {\n const svg = d3.select(s);\n svg.selectAll('*').remove();\n\n const { radius = 600, padding = 100, slots } = options;\n\n // https://d3js.org/d3-hierarchy/hierarchy\n const root = d3.hierarchy(flatten(data));\n // .sort((a, b) => d3.ascending(a.height, b.height) || d3.ascending(getName(a.data), getName(b.data)));\n\n const tree = d3.cluster<TreeNode>().size([2 * Math.PI, radius - padding]);\n const layout = tree(addLinks(root));\n\n // eslint-disable-next-line unused-imports/no-unused-vars\n const node = svg\n .append('g')\n .selectAll()\n .data(layout.leaves())\n .join('g')\n .attr('transform', (d) => `rotate(${d.x * (180 / Math.PI) - 90}) translate(${d.y},0)`)\n .append('text')\n .attr('class', slots?.text ?? '')\n .attr('dy', '0.31em') // TODO(burdon): Based on font size.\n .attr('x', (d) => (d.x < Math.PI ? 6 : -6))\n .attr('text-anchor', (d) => (d.x < Math.PI ? 'start' : 'end'))\n .attr('transform', (d) => (d.x >= Math.PI ? 'rotate(180)' : null))\n // .text((d: any) => d.data.id)\n // .each(function (d: any) {\n // d.text = this;\n // })\n // .on('mouseover', overed)\n // .on('mouseout', outed)\n .call(\n (text) => text.text((d: any) => d.data.id.slice(0, 8)),\n // .text((d: any) => `${getId(d)} [${[(d as any).outgoing?.length ?? 0]}]`),\n );\n\n // https://d3js.org/d3-shape/radial-line\n const line = d3\n .lineRadial()\n .curve(d3.curveBundle.beta(0.85))\n .radius((d: any) => d.y)\n .angle((d: any) => d.x);\n\n // eslint-disable-next-line unused-imports/no-unused-vars\n const links = svg\n .append('g')\n .selectAll()\n .data(layout.leaves().flatMap((leaf: any) => leaf.outgoing))\n .join('path')\n .style('mix-blend-mode', 'multiply')\n .attr('class', slots?.path ?? '')\n .attr('d', ([i, o]) => {\n return line(i.path(o));\n })\n .each(function (d) {\n d.path = this;\n });\n\n // function overed(event: any, d: X) {\n // link.style('mix-blend-mode', null);\n // d3.select(this).attr('font-weight', 'bold');\n // d3.selectAll(d.incoming.map((d) => d.path))\n // .attr('stroke', color.in)\n // .raise();\n // d3.selectAll((d as any).incoming.map(([d]) => d.text))\n // .attr('fill', color.in)\n // .attr('font-weight', 'bold');\n // d3.selectAll(d.outgoing.map((d) => d.path))\n // .attr('stroke', color.out)\n // .raise();\n // d3.selectAll(d.outgoing.map(([, d]) => d.text))\n // .attr('fill', color.out)\n // .attr('font-weight', 'bold');\n // }\n\n // function outed(event: any, d: HierarchyNode<Datum>) {\n // // @ts-ignore\n // d3.select(this).attr('font-weight', null);\n // d3.selectAll(d.incoming.map((d) => d.path)).attr('stroke', null);\n // d3.selectAll(d.incoming.map(([d]) => d.text))\n // .attr('fill', null)\n // .attr('font-weight', null);\n // d3.selectAll(d.outgoing.map((d) => d.path)).attr('stroke', null);\n // d3.selectAll(d.outgoing.map(([, d]) => d.text))\n // .attr('fill', null)\n // .attr('font-weight', null);\n // }\n};\n\n// Monkey-patch with incoming/outgoing nodes.\nconst addLinks = (root: HierarchyNode<TreeNode>) => {\n // Map of nodes indexed by ID.\n const nodes = new Map(root.descendants().map((d) => [d.data.id, d]));\n const parents = root.descendants().reduce((map, d) => {\n if (d.children?.length) {\n map.set(d.data.id, d);\n }\n return map;\n }, new Map<string, HierarchyNode<TreeNode>>());\n\n for (const d of root.leaves()) {\n // (d as any).incoming = [];\n\n const parent = parents.get(d.data.id);\n if (parent) {\n // Skip the first node which is a placeholder created by flatten().\n (d as any).outgoing =\n parent.data.children?.slice(1).map((child) => {\n return [d, nodes.get(child.id)!];\n }) ?? [];\n } else {\n (d as any).outgoing = [];\n }\n }\n\n // for (const d of root.leaves()) {\n // for (const [_, o] of (d as any).outgoing) {\n // o.incoming.push(o);\n // }\n // }\n\n return root;\n};\n\n/**\n * We are using a hierarchy in order to group nodes by parent, but we want the parent\n * nodes to be positioned at the first level along with all descendents.\n * So we add a placeholder for all parents at the head of each group.\n * @param node\n */\nconst flatten = (node: TreeNode) => {\n const clone: TreeNode = {\n id: node.id,\n };\n\n // TODO(burdon): NOTE: Should exclude schema (since requires a tree).\n if (node.children?.length) {\n const children = node.children.map((child) => flatten(child));\n clone.children = [{ id: node.id }, ...children];\n }\n\n return clone;\n};\n\nexport default HierarchicalEdgeBundling;\n", "//\n// Copyright 2023 DXOS.org\n// Copyright 2022 Observable, Inc.\n//\n\nimport * as d3 from 'd3';\n\nimport { type TreeOptions } from '../Tree';\n\n// Released under the ISC license.\n// https://observablehq.com/@d3/radial-tree\n// https://observablehq.com/@d3/tree\nconst RadialTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {\n const svg = d3.select(s);\n svg.selectAll('*').remove();\n\n const {\n label, // given a node d, returns the display name\n radius = 400,\n r = 4, // radius of nodes\n slots,\n } = options;\n\n const arc = 2 * Math.PI;\n\n const root = d3.hierarchy(data);\n\n // Sort the nodes.\n // if (sort) {\n // root.sort(sort);\n // }\n\n // Compute labels and titles.\n const descendants = root.descendants();\n const getLabel = label === null ? null : descendants.map((d) => label(d.data));\n\n // Compute the layout.\n const layout = d3\n .tree()\n .size([arc, radius])\n .separation((a: any, b: any) => (a.parent === b.parent ? 1 : 2) / a.depth);\n layout(root);\n\n // Links.\n svg\n .append('g')\n .selectAll('path')\n .data(root.links())\n .join('path')\n .attr('class', slots?.path ?? '')\n .attr(\n 'd',\n d3\n .linkRadial()\n .angle((d: any) => d.x + Math.PI / 2)\n .radius((d: any) => d.y) as any,\n );\n\n // Nodes.\n const node = svg\n .append('g')\n .selectAll('a')\n .data(root.descendants())\n .join('a')\n // .attr('xlink:href', link == null ? null : (d) => link(d.data, d))\n // .attr('target', link == null ? null : linkTarget)\n .attr('transform', (d: any) => `rotate(${(d.x * 180) / Math.PI}) translate(${d.y},0)`);\n\n node\n .append('circle')\n .attr('class', slots?.node ?? '')\n .attr('r', r);\n\n // if (title != null) {\n // node.append('title').text((d) => title(d.data, d));\n // }\n\n // Text.\n if (getLabel) {\n node\n .append('text')\n .attr('transform', (d: any) => `rotate(${d.x >= Math.PI ? 180 : 0})`)\n .attr('dy', '0.32em')\n // eslint-disable-next-line no-mixed-operators\n .attr('x', (d: any) => (d.x < Math.PI === !d.children ? 6 : -6))\n // eslint-disable-next-line no-mixed-operators\n .attr('text-anchor', (d: any) => (d.x < Math.PI === !d.children ? 'start' : 'end'))\n // .attr('paint-order', 'stroke')\n .attr('class', slots?.text ?? '')\n .text((d, i) => getLabel[i]);\n }\n\n return svg.node();\n};\n\nexport default RadialTree;\n", "//\n// Copyright 2023 DXOS.org\n// Copyright 2021 Observable, Inc.\n//\n\nimport * as d3 from 'd3';\n\nimport { type TreeOptions } from '../Tree';\n\n// Released under the ISC license.\n// https://observablehq.com/@d3/tree\nconst TidyTree = (s: SVGSVGElement, data: any, options: TreeOptions) => {\n const svg = d3.select(s);\n svg.selectAll('*').remove();\n\n const { label, width, height, r = 4, padding = 4, margin = 60, slots } = options;\n\n const root = d3.hierarchy(data);\n\n // Compute labels and titles.\n const descendants = root.descendants();\n const getLabel = label == null ? null : descendants.map((d) => label(d.data));\n\n // Compute the layout.\n const dx = 16;\n const dy = width / (root.height + padding);\n const layout = d3.tree().nodeSize([dx, dy]);\n layout(root);\n\n // Center the tree.\n let x0 = Infinity;\n let x1 = -x0;\n let y0 = Infinity;\n let y1 = -y0;\n root.each((d: any) => {\n if (d.x > x1) {\n x1 = d.x;\n }\n if (d.x < x0) {\n x0 = d.x;\n }\n if (d.y > y1) {\n y1 = d.y;\n }\n if (d.y < y0) {\n y0 = d.y;\n }\n });\n\n // TODO(burdon): Option to expand.\n // NOTE: x and y are flipped.\n const sx = Math.min(2, Math.max(1, (height - margin * 2) / (x1 - x0)));\n const oy = -(width - (y1 - y0)) / 2;\n\n // Links.\n svg\n .append('g')\n .selectAll('path')\n .data(root.links())\n .join('path')\n .attr('class', slots?.path ?? '')\n .attr(\n 'd',\n d3\n .link(d3.curveBumpX)\n .x((d: any) => d.y + oy)\n .y((d: any) => d.x * sx) as any,\n );\n\n // Nodes.\n const node = svg\n .append('g')\n .selectAll('a')\n .data(root.descendants())\n .join('a')\n // .attr('xlink:href', link == null ? null : (d) => link(d.data, d))\n // .attr('target', link == null ? null : linkTarget)\n .attr('transform', (d: any) => `translate(${d.y + oy},${d.x * sx})`);\n\n node\n .append('circle')\n .attr('class', slots?.node ?? '')\n .attr('r', r);\n\n // if (title != null) {\n // node.append('title').text((d) => title(d.data, d));\n // }\n\n if (getLabel) {\n node\n .append('text')\n\n .attr('dy', '0.32em')\n .attr('x', (d) => (d.children ? -6 : 6))\n .attr('text-anchor', (d) => (d.children ? 'end' : 'start'))\n // .attr('paint-order', 'stroke')\n .attr('class', slots?.text ?? '')\n .text((d, i) => getLabel[i]);\n }\n};\n\nexport default TidyTree;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { GraphModel } from '@dxos/gem-spore';\n\nexport type TreeNode = {\n id: string;\n label?: string;\n children?: TreeNode[];\n};\n\nexport const mapGraphToTreeData = <N>(model: GraphModel<N>, maxDepth = 8): TreeNode | undefined => {\n const mapNode = (node: N, depth = 0): TreeNode => {\n const treeNode: TreeNode = {\n id: model.idAccessor(node),\n label: model.idAccessor(node).slice(0, 8),\n };\n\n const links = model.graph.links.filter((link) => link.source === treeNode.id);\n if (depth < maxDepth) {\n treeNode.children = links.map((link) =>\n mapNode(model.graph.nodes.find((node) => model.idAccessor(node) === link.target)!, depth + 1),\n );\n }\n\n return treeNode;\n };\n\n let data: TreeNode | undefined;\n if (model.selected) {\n const node = model.graph.nodes.find((node) => model.idAccessor(node) === model.selected);\n if (node) {\n data = mapNode(node);\n }\n }\n\n return data;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { type Space } from '@dxos/client/echo';\nimport { type EchoReactiveObject, getType } from '@dxos/echo-schema';\nimport { createSvgContext, defaultGridStyles, Grid, SVG, SVGRoot, Zoom } from '@dxos/gem-core';\nimport {\n defaultStyles,\n Graph as GraphComponent,\n GraphForceProjector,\n type GraphLayoutNode,\n Markers,\n} from '@dxos/gem-spore';\nimport { filterObjectsSync, type SearchResult } from '@dxos/plugin-search';\nimport { useThemeContext } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport '@dxos/gem-spore/styles';\n\nimport { type EchoGraphNode, SpaceGraphModel } from './graph-model';\nimport { Tree } from '../Tree';\n\ntype Slots = {\n root?: { className?: string };\n grid?: { className?: string };\n};\n\nconst slots: Slots = {};\n\nconst colors = [\n '[&>circle]:!fill-black-300 [&>circle]:!stroke-black-600',\n '[&>circle]:!fill-slate-300 [&>circle]:!stroke-slate-600',\n '[&>circle]:!fill-green-300 [&>circle]:!stroke-green-600',\n '[&>circle]:!fill-sky-300 [&>circle]:!stroke-sky-600',\n '[&>circle]:!fill-cyan-300 [&>circle]:!stroke-cyan-600',\n '[&>circle]:!fill-rose-300 [&>circle]:!stroke-rose-600',\n '[&>circle]:!fill-purple-300 [&>circle]:!stroke-purple-600',\n '[&>circle]:!fill-orange-300 [&>circle]:!stroke-orange-600',\n '[&>circle]:!fill-teal-300 [&>circle]:!stroke-teal-600',\n '[&>circle]:!fill-indigo-300 [&>circle]:!stroke-indigo-600',\n];\n\nexport type GraphProps = {\n space: Space;\n match?: RegExp;\n};\n\nexport const Graph: FC<GraphProps> = ({ space, match }) => {\n const model = useMemo(() => (space ? new SpaceGraphModel({ schema: true }).open(space) : undefined), [space]);\n const [selected, setSelected] = useState<string>();\n const { themeMode } = useThemeContext();\n\n const context = createSvgContext();\n const projector = useMemo(\n () =>\n new GraphForceProjector<EchoGraphNode>(context, {\n forces: {\n manyBody: {\n strength: -100,\n },\n link: {\n distance: 180,\n },\n radial: {\n radius: 200,\n strength: 0.05,\n },\n },\n attributes: {\n radius: (node: GraphLayoutNode<EchoGraphNode>) => (node.data?.type === 'schema' ? 24 : 12),\n },\n }),\n [],\n );\n\n const filteredRef = useRef<SearchResult[]>();\n filteredRef.current = filterObjectsSync(model?.objects ?? [], match);\n useEffect(() => {\n void projector.start();\n }, [match]);\n\n const [colorMap] = useState(new Map<string, string>());\n\n if (!model) {\n return null;\n }\n\n if (selected) {\n return <Tree space={space} selected={selected} variant='tidy' onNodeClick={() => setSelected(undefined)} />;\n }\n\n return (\n <SVGRoot context={context}>\n <SVG className={mx(defaultStyles, slots?.root?.className)}>\n <Markers arrowSize={6} />\n <Grid className={slots?.grid?.className ?? defaultGridStyles(themeMode)} />\n <Zoom extent={[1 / 2, 4]}>\n <GraphComponent\n model={model}\n projector={projector}\n drag\n arrows\n onSelect={(node) => setSelected(node?.data?.id)}\n labels={{\n text: (node: GraphLayoutNode<EchoReactiveObject<any>>) => {\n if (filteredRef.current?.length && !filteredRef.current.some((object) => object.id === node.data?.id)) {\n return undefined;\n }\n\n // TODO(burdon): Use schema.\n return node.data?.label ?? node.data?.title ?? node.data?.name ?? node.data?.id.slice(0, 8);\n },\n }}\n attributes={{\n node: (node: GraphLayoutNode<EchoReactiveObject<any>>) => {\n let className: string | undefined;\n if (node.data) {\n const typename = getType(node.data)?.objectId;\n if (typename) {\n className = colorMap.get(typename);\n if (!className) {\n className = colors[colorMap.size % colors.length];\n colorMap.set(typename, className);\n }\n }\n }\n\n const selected = filteredRef.current?.some((object) => object.id === node.data?.id);\n return {\n class: mx(\n filteredRef.current?.length\n ? selected\n ? [className]\n : '[&>text]:!fill-neutral-300'\n : ['[&>text]:!fill-neutral-700', className],\n ),\n };\n },\n link: () => ({\n class: '[&>path]:!stroke-neutral-300',\n }),\n }}\n />\n </Zoom>\n </SVG>\n </SVGRoot>\n );\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBASO;AACP,uBAA2D;AAC3D,iBAAoB;AACpB,mBAA+B;ACZ/B,mBAAoD;AACpD,mCAAkC;AAGlC,sBAA+C;ACH/C,SAAoB;ACApB,UAAoB;ACApB,UAAoB;AEDpB,IAAAA,gBAAqE;AAGrE,IAAAC,sBAAiD;AACjD,IAAAC,mBAA8E;AAC9E,IAAAC,oBAMO;AACP,2BAAqD;AACrD,sBAAgC;AAChC,4BAAmB;AAEnB,oBAAO;;ANoBA,IAAMC,kBAAN,cAA8BC,4BAAAA;EASnCC,YAA6BC,WAAmC,CAAC,GAAG;AAClE,UAAK;SADsBA,WAAAA;SARZC,SAAmC;MAClDC,OAAO,CAAA;MACPC,OAAO,CAAA;IACT;EAOA;EAEA,IAAaC,QAAkC;AAC7C,WAAO,KAAKH;EACd;EAEA,IAAII,UAAqC;AACvC,WAAO,KAAKC,YAAY,CAAA;EAC1B;EAEAC,KAAKC,OAAcC,UAAmB;AACpC,QAAI,CAAC,KAAKC,eAAe;AAEvB,YAAMC,QAAQH,MAAMI,GAAGD,MAAM,CAACE,WAAoC,EAAEA,kBAAkBC,4BAAa;AAEnG,WAAKJ,gBAAgBC,MAAMI,UACzB,CAAC,EAAEV,QAAO,MAAE;AACV,aAAKC,WAAWD;AAChB,aAAKJ,OAAOC,QAAQG,QAAQW,IAAI,CAACH,WAAAA;AAC/B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SAAS,EAAC,QAAK4E,gDAAAA;AAEvC9B,mBAAAA,WAAU,MAAA;AACR,QAAI/C,SAASC,QAAQ;AACnB,YAAMnD,OAAOC,KAAK6D,IAAIZ,OAAOC,MAAAA;AAC7B,YAAM3D,SAASQ,OAAO;AACtB,YAAMb,UAAU;;QAEdqD,OAAO,CAAC9B,MAAWA,EAAE8B,SAAS9B,EAAEhE;QAChCwG;QACAC;QACA3D;QACAwI,aAAa9E,QAAQ1D,SAAS,KAAK;QACnCyI,cAAc/E,QAAQ1D,SAAS,KAAK;QACpC0I,YAAY/E,SAAS3D,SAAS,KAAK;QACnC2I,eAAehF,SAAS3D,SAAS,KAAK;QACtCE,OAAOkI;MACT;AAEA,UAAI9H,OAAM;AACR,cAAMsI,WAAWP,UAAUzF,IAAIkE,OAAAA;AAC/B8B,mBAAWjD,QAAQzG,IAAIqH,SAAUjG,OAAMX,OAAAA;MACzC;IACF;EACF,GAAG;IAACW;IAAMoD;IAAOC;GAAO;AAGxB,SACEiD,6BAAAA,QAAA,cAACiC,OAAAA;IAAI3J;IAAUgI,WAAU;IAA4B4B,SAAS,MAAM/B,cAAAA;KAClEH,6BAAAA,QAAA,cAACI,gBAAAA,SAAAA;IAAQrB;KACPiB,6BAAAA,QAAA,cAACK,gBAAAA,KAAAA,IAAAA,CAAAA,CAAAA;AAIT;",
6
6
  "names": ["import_react", "import_echo_schema", "import_gem_core", "import_gem_spore", "SpaceGraphModel", "GraphModel", "constructor", "_options", "_graph", "nodes", "links", "graph", "objects", "_objects", "open", "space", "objectId", "_subscription", "query", "db", "object", "CollectionType", "subscribe", "map", "StoredSchema", "effectSchema", "schema", "getSchemaById", "id", "type", "reduce", "objectSchema", "getSchema", "typename", "getType", "log", "info", "slice", "DynamicSchema", "idx", "findIndex", "obj", "push", "source", "target", "AST", "getPropertySignatures", "ast", "forEach", "prop", "SchemaValidator", "hasTypeAnnotation", "name", "toString", "ReferenceAnnotationId", "value", "String", "refs", "Array", "isArray", "ref", "triggerUpdate", "fire", "setSelected", "close", "undefined", "HierarchicalEdgeBundling", "s", "data", "options", "svg", "select", "selectAll", "remove", "radius", "padding", "slots", "root", "hierarchy", "flatten", "tree", "cluster", "size", "Math", "PI", "layout", "addLinks", "node", "append", "leaves", "join", "attr", "d", "x", "y", "text", "call", "line", "lineRadial", "curve", "curveBundle", "beta", "angle", "flatMap", "leaf", "outgoing", "style", "path", "i", "o", "each", "Map", "descendants", "parents", "children", "length", "set", "parent", "get", "child", "clone", "RadialTree", "label", "r", "arc", "getLabel", "separation", "a", "b", "depth", "linkRadial", "TidyTree", "width", "height", "margin", "dx", "dy", "nodeSize", "x0", "Infinity", "x1", "y0", "y1", "sx", "min", "max", "oy", "link", "curveBumpX", "mapGraphToTreeData", "model", "maxDepth", "mapNode", "treeNode", "idAccessor", "filter", "find", "selected", "colors", "Graph", "match", "useMemo", "useState", "themeMode", "useThemeContext", "context", "createSvgContext", "projector", "GraphForceProjector", "forces", "manyBody", "strength", "distance", "radial", "attributes", "filteredRef", "useRef", "current", "filterObjectsSync", "useEffect", "start", "colorMap", "React", "Tree", "variant", "onNodeClick", "SVGRoot", "SVG", "className", "mx", "defaultStyles", "Markers", "arrowSize", "Grid", "grid", "defaultGridStyles", "Zoom", "extent", "GraphComponent", "drag", "arrows", "onSelect", "labels", "some", "title", "class", "defaultTreeLayoutSlots", "renderers", "setTree", "useResizeDetector", "marginLeft", "marginRight", "marginTop", "marginBottom", "renderer", "div", "onClick"]
7
7
  }
@@ -16,13 +16,13 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_OJOGTJXQ_exports = {};
20
- __export(chunk_OJOGTJXQ_exports, {
19
+ var chunk_XPJ3TJZY_exports = {};
20
+ __export(chunk_XPJ3TJZY_exports, {
21
21
  ExplorerAction: () => ExplorerAction,
22
22
  ViewType: () => ViewType
23
23
  });
24
- module.exports = __toCommonJS(chunk_OJOGTJXQ_exports);
25
- var import_chunk_BODO2FF3 = require("./chunk-BODO2FF3.cjs");
24
+ module.exports = __toCommonJS(chunk_XPJ3TJZY_exports);
25
+ var import_chunk_XSC6U7EH = require("./chunk-XSC6U7EH.cjs");
26
26
  var import_echo_schema = require("@dxos/echo-schema");
27
27
  var ViewType = class extends (0, import_echo_schema.TypedObject)({
28
28
  typename: "dxos.org/type/View",
@@ -32,7 +32,7 @@ var ViewType = class extends (0, import_echo_schema.TypedObject)({
32
32
  type: import_echo_schema.S.String
33
33
  }) {
34
34
  };
35
- var EXPLORER_ACTION = `${import_chunk_BODO2FF3.EXPLORER_PLUGIN}/action`;
35
+ var EXPLORER_ACTION = `${import_chunk_XSC6U7EH.EXPLORER_PLUGIN}/action`;
36
36
  var ExplorerAction;
37
37
  (function(ExplorerAction2) {
38
38
  ExplorerAction2[ExplorerAction2["CREATE"] = `${EXPLORER_ACTION}/create`] = "CREATE";
@@ -42,4 +42,4 @@ var ExplorerAction;
42
42
  ExplorerAction,
43
43
  ViewType
44
44
  });
45
- //# sourceMappingURL=chunk-OJOGTJXQ.cjs.map
45
+ //# sourceMappingURL=chunk-XPJ3TJZY.cjs.map
@@ -16,15 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_BODO2FF3_exports = {};
20
- __export(chunk_BODO2FF3_exports, {
19
+ var chunk_XSC6U7EH_exports = {};
20
+ __export(chunk_XSC6U7EH_exports, {
21
21
  EXPLORER_PLUGIN: () => EXPLORER_PLUGIN,
22
22
  meta_default: () => meta_default
23
23
  });
24
- module.exports = __toCommonJS(chunk_BODO2FF3_exports);
25
- var import_app_framework = require("@dxos/app-framework");
24
+ module.exports = __toCommonJS(chunk_XSC6U7EH_exports);
26
25
  var EXPLORER_PLUGIN = "dxos.org/plugin/explorer";
27
- var meta_default = (0, import_app_framework.pluginMeta)({
26
+ var meta_default = {
28
27
  id: EXPLORER_PLUGIN,
29
28
  name: "Explorer",
30
29
  description: "Explore the ECHO hypergraph.",
@@ -32,10 +31,10 @@ var meta_default = (0, import_app_framework.pluginMeta)({
32
31
  "experimental"
33
32
  ],
34
33
  icon: "ph--graph--regular"
35
- });
34
+ };
36
35
  // Annotate the CommonJS export names for ESM import in node:
37
36
  0 && (module.exports = {
38
37
  EXPLORER_PLUGIN,
39
38
  meta_default
40
39
  });
41
- //# sourceMappingURL=chunk-BODO2FF3.cjs.map
40
+ //# sourceMappingURL=chunk-XSC6U7EH.cjs.map
@@ -0,0 +1,7 @@
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 default {\n id: EXPLORER_PLUGIN,\n name: 'Explorer',\n description: 'Explore the ECHO hypergraph.',\n tags: ['experimental'],\n icon: 'ph--graph--regular',\n} satisfies PluginMeta;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,kBAAkB;AAE/B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;EACNC,aAAa;EACbC,MAAM;IAAC;;EACPC,MAAM;AACR;",
6
+ "names": ["EXPLORER_PLUGIN", "id", "name", "description", "tags", "icon"]
7
+ }
@@ -33,16 +33,16 @@ __export(node_exports, {
33
33
  ExplorerMain: () => ExplorerMain,
34
34
  ExplorerPlugin: () => ExplorerPlugin,
35
35
  Globe: () => Globe,
36
- Graph: () => import_chunk_K4PB5A4K.Graph,
37
- SpaceGraphModel: () => import_chunk_K4PB5A4K.SpaceGraphModel,
38
- Tree: () => import_chunk_K4PB5A4K.Tree,
36
+ Graph: () => import_chunk_B3DD7UMY.Graph,
37
+ SpaceGraphModel: () => import_chunk_B3DD7UMY.SpaceGraphModel,
38
+ Tree: () => import_chunk_B3DD7UMY.Tree,
39
39
  default: () => src_default,
40
- defaultTreeLayoutSlots: () => import_chunk_K4PB5A4K.defaultTreeLayoutSlots
40
+ defaultTreeLayoutSlots: () => import_chunk_B3DD7UMY.defaultTreeLayoutSlots
41
41
  });
42
42
  module.exports = __toCommonJS(node_exports);
43
- var import_chunk_OJOGTJXQ = require("./chunk-OJOGTJXQ.cjs");
44
- var import_chunk_BODO2FF3 = require("./chunk-BODO2FF3.cjs");
45
- var import_chunk_K4PB5A4K = require("./chunk-K4PB5A4K.cjs");
43
+ var import_chunk_XPJ3TJZY = require("./chunk-XPJ3TJZY.cjs");
44
+ var import_chunk_XSC6U7EH = require("./chunk-XSC6U7EH.cjs");
45
+ var import_chunk_B3DD7UMY = require("./chunk-B3DD7UMY.cjs");
46
46
  var import_react = __toESM(require("react"));
47
47
  var import_app_framework = require("@dxos/app-framework");
48
48
  var import_plugin_client = require("@dxos/plugin-client");
@@ -10860,12 +10860,12 @@ var Globe = ({ items = [], accessor, projection = "orthographic", options = defa
10860
10860
  className: "grow p-4"
10861
10861
  });
10862
10862
  };
10863
- var ExplorerMain = import_react2.default.lazy(() => import("./ExplorerMain-IGUMYIAN.cjs"));
10864
- var ExplorerArticle = import_react2.default.lazy(() => import("./ExplorerArticle-PQEEN244.cjs"));
10863
+ var ExplorerMain = import_react2.default.lazy(() => import("./ExplorerMain-YHTGV7H5.cjs"));
10864
+ var ExplorerArticle = import_react2.default.lazy(() => import("./ExplorerArticle-QWLRFTJ3.cjs"));
10865
10865
  var translations_default = [
10866
10866
  {
10867
10867
  "en-US": {
10868
- [import_chunk_BODO2FF3.EXPLORER_PLUGIN]: {
10868
+ [import_chunk_XSC6U7EH.EXPLORER_PLUGIN]: {
10869
10869
  "plugin name": "Explorer",
10870
10870
  "object title label": "Title",
10871
10871
  "object title placeholder": "New explorer",
@@ -10876,15 +10876,15 @@ var translations_default = [
10876
10876
  ];
10877
10877
  var ExplorerPlugin = () => {
10878
10878
  return {
10879
- meta: import_chunk_BODO2FF3.meta_default,
10879
+ meta: import_chunk_XSC6U7EH.meta_default,
10880
10880
  provides: {
10881
10881
  metadata: {
10882
10882
  records: {
10883
- [import_chunk_OJOGTJXQ.ViewType.typename]: {
10883
+ [import_chunk_XPJ3TJZY.ViewType.typename]: {
10884
10884
  placeholder: [
10885
10885
  "object title placeholder",
10886
10886
  {
10887
- ns: import_chunk_BODO2FF3.EXPLORER_PLUGIN
10887
+ ns: import_chunk_XSC6U7EH.EXPLORER_PLUGIN
10888
10888
  }
10889
10889
  ],
10890
10890
  icon: "ph--graph--regular"
@@ -10894,7 +10894,7 @@ var ExplorerPlugin = () => {
10894
10894
  translations: translations_default,
10895
10895
  echo: {
10896
10896
  schema: [
10897
- import_chunk_OJOGTJXQ.ViewType
10897
+ import_chunk_XPJ3TJZY.ViewType
10898
10898
  ]
10899
10899
  },
10900
10900
  graph: {
@@ -10905,7 +10905,7 @@ var ExplorerPlugin = () => {
10905
10905
  return [];
10906
10906
  }
10907
10907
  return (0, import_plugin_graph.createExtension)({
10908
- id: import_chunk_OJOGTJXQ.ExplorerAction.CREATE,
10908
+ id: import_chunk_XPJ3TJZY.ExplorerAction.CREATE,
10909
10909
  filter: (node) => (0, import_plugin_graph.isActionGroup)(node) && node.id.startsWith(import_plugin_space.SpaceAction.ADD_OBJECT),
10910
10910
  actions: ({ node }) => {
10911
10911
  const id = node.id.split("/").at(-1);
@@ -10918,12 +10918,12 @@ var ExplorerPlugin = () => {
10918
10918
  }
10919
10919
  return [
10920
10920
  {
10921
- id: `${import_chunk_BODO2FF3.EXPLORER_PLUGIN}/create/${node.id}`,
10921
+ id: `${import_chunk_XSC6U7EH.EXPLORER_PLUGIN}/create/${node.id}`,
10922
10922
  data: async () => {
10923
10923
  await dispatch([
10924
10924
  {
10925
- plugin: import_chunk_BODO2FF3.EXPLORER_PLUGIN,
10926
- action: import_chunk_OJOGTJXQ.ExplorerAction.CREATE
10925
+ plugin: import_chunk_XSC6U7EH.EXPLORER_PLUGIN,
10926
+ action: import_chunk_XPJ3TJZY.ExplorerAction.CREATE
10927
10927
  },
10928
10928
  {
10929
10929
  action: import_plugin_space.SpaceAction.ADD_OBJECT,
@@ -10940,7 +10940,7 @@ var ExplorerPlugin = () => {
10940
10940
  label: [
10941
10941
  "create object label",
10942
10942
  {
10943
- ns: import_chunk_BODO2FF3.EXPLORER_PLUGIN
10943
+ ns: import_chunk_XSC6U7EH.EXPLORER_PLUGIN
10944
10944
  }
10945
10945
  ],
10946
10946
  icon: "ph--graph--regular",
@@ -10956,11 +10956,11 @@ var ExplorerPlugin = () => {
10956
10956
  component: ({ data, role }) => {
10957
10957
  switch (role) {
10958
10958
  case "main":
10959
- return data.active instanceof import_chunk_OJOGTJXQ.ViewType ? /* @__PURE__ */ import_react.default.createElement(ExplorerMain, {
10959
+ return data.active instanceof import_chunk_XPJ3TJZY.ViewType ? /* @__PURE__ */ import_react.default.createElement(ExplorerMain, {
10960
10960
  view: data.active
10961
10961
  }) : null;
10962
10962
  case "article":
10963
- return data.object instanceof import_chunk_OJOGTJXQ.ViewType ? /* @__PURE__ */ import_react.default.createElement(ExplorerArticle, {
10963
+ return data.object instanceof import_chunk_XPJ3TJZY.ViewType ? /* @__PURE__ */ import_react.default.createElement(ExplorerArticle, {
10964
10964
  view: data.object
10965
10965
  }) : null;
10966
10966
  default:
@@ -10971,9 +10971,9 @@ var ExplorerPlugin = () => {
10971
10971
  intent: {
10972
10972
  resolver: (intent) => {
10973
10973
  switch (intent.action) {
10974
- case import_chunk_OJOGTJXQ.ExplorerAction.CREATE: {
10974
+ case import_chunk_XPJ3TJZY.ExplorerAction.CREATE: {
10975
10975
  return {
10976
- data: (0, import_echo.create)(import_chunk_OJOGTJXQ.ViewType, {
10976
+ data: (0, import_echo.create)(import_chunk_XPJ3TJZY.ViewType, {
10977
10977
  name: "",
10978
10978
  type: ""
10979
10979
  })
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var meta_exports = {};
20
20
  __export(meta_exports, {
21
- EXPLORER_PLUGIN: () => import_chunk_BODO2FF3.EXPLORER_PLUGIN,
22
- default: () => import_chunk_BODO2FF3.meta_default
21
+ EXPLORER_PLUGIN: () => import_chunk_XSC6U7EH.EXPLORER_PLUGIN,
22
+ default: () => import_chunk_XSC6U7EH.meta_default
23
23
  });
24
24
  module.exports = __toCommonJS(meta_exports);
25
- var import_chunk_BODO2FF3 = require("./chunk-BODO2FF3.cjs");
25
+ var import_chunk_XSC6U7EH = require("./chunk-XSC6U7EH.cjs");
26
26
  // Annotate the CommonJS export names for ESM import in node:
27
27
  0 && (module.exports = {
28
28
  EXPLORER_PLUGIN
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["meta.cjs"],
4
- "sourcesContent": ["import {\n EXPLORER_PLUGIN,\n meta_default\n} from \"./chunk-BODO2FF3.cjs\";\nexport {\n EXPLORER_PLUGIN,\n meta_default as default\n};\n//# sourceMappingURL=meta.cjs.map\n"],
4
+ "sourcesContent": ["import {\n EXPLORER_PLUGIN,\n meta_default\n} from \"./chunk-XSC6U7EH.cjs\";\nexport {\n EXPLORER_PLUGIN,\n meta_default as default\n};\n//# sourceMappingURL=meta.cjs.map\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAGO;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/experimental/plugin-explorer/src/components/plot.ts":{"bytes":1465,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Chart/Chart.tsx":{"bytes":4935,"imports":[{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/plot.ts","kind":"import-statement","original":"../plot"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Chart/index.ts":{"bytes":527,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/components/Chart/Chart.tsx","kind":"import-statement","original":"./Chart"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/data/countries-110m.js":{"bytes":187226,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Globe/Globe.tsx":{"bytes":7523,"imports":[{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/data/countries-110m.js","kind":"import-statement","original":"../../../data/countries-110m.js"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/plot.ts","kind":"import-statement","original":"../plot"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Globe/index.ts":{"bytes":527,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/components/Globe/Globe.tsx","kind":"import-statement","original":"./Globe"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts":{"bytes":15323,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/gem-spore","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/HierarchicalEdgeBundling.ts":{"bytes":17760,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/RadialTree.ts":{"bytes":8819,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/TidyTree.ts":{"bytes":9322,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/index.ts":{"bytes":1156,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/HierarchicalEdgeBundling.ts","kind":"import-statement","original":"./HierarchicalEdgeBundling"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/RadialTree.ts","kind":"import-statement","original":"./RadialTree"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/TidyTree.ts","kind":"import-statement","original":"./TidyTree"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/types.ts":{"bytes":3749,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/Tree.tsx":{"bytes":9943,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/gem-core","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/index.ts","kind":"import-statement","original":"./layout"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts","kind":"import-statement","original":"../Graph"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/index.ts":{"bytes":525,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/Tree.tsx","kind":"import-statement","original":"./Tree"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Graph/Graph.tsx":{"bytes":16574,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/gem-core","kind":"import-statement","external":true},{"path":"@dxos/gem-spore","kind":"import-statement","external":true},{"path":"@dxos/plugin-search","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/gem-spore/styles","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts","kind":"import-statement","original":"./graph-model"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/index.ts","kind":"import-statement","original":"../Tree"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts":{"bytes":630,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts","kind":"import-statement","original":"./graph-model"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/Graph.tsx","kind":"import-statement","original":"./Graph"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/ExplorerMain.tsx":{"bytes":3322,"imports":[{"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","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/ExplorerArticle.tsx":{"bytes":2443,"imports":[{"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":"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/index.ts":{"bytes":1576,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Chart/index.ts","kind":"import-statement","original":"./Chart"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Globe/index.ts","kind":"import-statement","original":"./Globe"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/index.ts","kind":"import-statement","original":"./Tree"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/ExplorerMain.tsx","kind":"dynamic-import","original":"./ExplorerMain"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/ExplorerArticle.tsx","kind":"dynamic-import","original":"./ExplorerArticle"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/meta.tsx":{"bytes":1451,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/translations.ts":{"bytes":1473,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/types/view.ts":{"bytes":1394,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/types/types.ts":{"bytes":1762,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/types/index.ts":{"bytes":596,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/types/view.ts","kind":"import-statement","original":"./view"},{"path":"packages/plugins/experimental/plugin-explorer/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/ExplorerPlugin.tsx":{"bytes":14586,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-explorer/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-explorer/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-explorer/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-explorer/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/index.ts":{"bytes":1004,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/ExplorerPlugin.tsx","kind":"import-statement","original":"./ExplorerPlugin"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-explorer/src/ExplorerPlugin.tsx","kind":"import-statement","original":"./ExplorerPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-explorer/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":458310},"packages/plugins/experimental/plugin-explorer/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-OJOGTJXQ.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-BODO2FF3.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-K4PB5A4K.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"react","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":"@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":"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerMain-IGUMYIAN.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerArticle-PQEEN244.cjs","kind":"dynamic-import"}],"exports":["Chart","ExplorerArticle","ExplorerMain","ExplorerPlugin","Globe","Graph","SpaceGraphModel","Tree","default","defaultTreeLayoutSlots"],"entryPoint":"packages/plugins/experimental/plugin-explorer/src/index.ts","inputs":{"packages/plugins/experimental/plugin-explorer/src/ExplorerPlugin.tsx":{"bytesInOutput":3736},"packages/plugins/experimental/plugin-explorer/src/components/index.ts":{"bytesInOutput":188},"packages/plugins/experimental/plugin-explorer/src/components/Chart/Chart.tsx":{"bytesInOutput":1031},"packages/plugins/experimental/plugin-explorer/src/components/plot.ts":{"bytesInOutput":133},"packages/plugins/experimental/plugin-explorer/src/components/Chart/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-explorer/src/components/Globe/Globe.tsx":{"bytesInOutput":1707},"packages/plugins/experimental/plugin-explorer/data/countries-110m.js":{"bytesInOutput":188376},"packages/plugins/experimental/plugin-explorer/src/components/Globe/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-explorer/src/translations.ts":{"bytesInOutput":271},"packages/plugins/experimental/plugin-explorer/src/index.ts":{"bytesInOutput":34}},"bytes":196822},"packages/plugins/experimental/plugin-explorer/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-explorer/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-BODO2FF3.cjs","kind":"import-statement"}],"exports":["EXPLORER_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-explorer/src/meta.tsx","inputs":{},"bytes":165},"packages/plugins/experimental/plugin-explorer/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-explorer/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-OJOGTJXQ.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-BODO2FF3.cjs","kind":"import-statement"}],"exports":["ExplorerAction","ViewType"],"entryPoint":"packages/plugins/experimental/plugin-explorer/src/types/index.ts","inputs":{},"bytes":178},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-OJOGTJXQ.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1523},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-OJOGTJXQ.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-BODO2FF3.cjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["ExplorerAction","ViewType"],"inputs":{"packages/plugins/experimental/plugin-explorer/src/types/view.ts":{"bytesInOutput":208},"packages/plugins/experimental/plugin-explorer/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-explorer/src/types/types.ts":{"bytesInOutput":232}},"bytes":721},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-BODO2FF3.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":679},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-BODO2FF3.cjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["EXPLORER_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-explorer/src/meta.tsx":{"bytesInOutput":289}},"bytes":442},"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerMain-IGUMYIAN.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1722},"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerMain-IGUMYIAN.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-K4PB5A4K.cjs","kind":"import-statement"},{"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","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-explorer/src/components/ExplorerMain.tsx","inputs":{"packages/plugins/experimental/plugin-explorer/src/components/ExplorerMain.tsx":{"bytesInOutput":757}},"bytes":984},"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerArticle-PQEEN244.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1213},"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerArticle-PQEEN244.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-K4PB5A4K.cjs","kind":"import-statement"},{"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}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-explorer/src/components/ExplorerArticle.tsx","inputs":{"packages/plugins/experimental/plugin-explorer/src/components/ExplorerArticle.tsx":{"bytesInOutput":522}},"bytes":758},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-K4PB5A4K.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":40431},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-K4PB5A4K.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/gem-spore","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/gem-core","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":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/gem-core","kind":"import-statement","external":true},{"path":"@dxos/gem-spore","kind":"import-statement","external":true},{"path":"@dxos/plugin-search","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/gem-spore/styles","kind":"import-statement","external":true}],"exports":["Graph","SpaceGraphModel","Tree","defaultTreeLayoutSlots"],"inputs":{"packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts":{"bytesInOutput":3490},"packages/plugins/experimental/plugin-explorer/src/components/Tree/Tree.tsx":{"bytesInOutput":2073},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/HierarchicalEdgeBundling.ts":{"bytesInOutput":2144},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/RadialTree.ts":{"bytesInOutput":1324},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/TidyTree.ts":{"bytesInOutput":1553},"packages/plugins/experimental/plugin-explorer/src/components/Tree/types.ts":{"bytesInOutput":699},"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-explorer/src/components/Graph/Graph.tsx":{"bytesInOutput":4022},"packages/plugins/experimental/plugin-explorer/src/components/Tree/index.ts":{"bytesInOutput":0}},"bytes":16111}}}
1
+ {"inputs":{"packages/plugins/experimental/plugin-explorer/src/components/plot.ts":{"bytes":1465,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Chart/Chart.tsx":{"bytes":4935,"imports":[{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/plot.ts","kind":"import-statement","original":"../plot"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Chart/index.ts":{"bytes":527,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/components/Chart/Chart.tsx","kind":"import-statement","original":"./Chart"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/data/countries-110m.js":{"bytes":187226,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Globe/Globe.tsx":{"bytes":7523,"imports":[{"path":"@observablehq/plot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"topojson-client","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/data/countries-110m.js","kind":"import-statement","original":"../../../data/countries-110m.js"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/plot.ts","kind":"import-statement","original":"../plot"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Globe/index.ts":{"bytes":527,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/components/Globe/Globe.tsx","kind":"import-statement","original":"./Globe"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts":{"bytes":15323,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/gem-spore","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/HierarchicalEdgeBundling.ts":{"bytes":17760,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/RadialTree.ts":{"bytes":8819,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/TidyTree.ts":{"bytes":9322,"imports":[{"path":"d3","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/index.ts":{"bytes":1156,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/HierarchicalEdgeBundling.ts","kind":"import-statement","original":"./HierarchicalEdgeBundling"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/RadialTree.ts","kind":"import-statement","original":"./RadialTree"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/TidyTree.ts","kind":"import-statement","original":"./TidyTree"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/types.ts":{"bytes":3749,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/Tree.tsx":{"bytes":9943,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/gem-core","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/index.ts","kind":"import-statement","original":"./layout"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts","kind":"import-statement","original":"../Graph"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Tree/index.ts":{"bytes":525,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/Tree.tsx","kind":"import-statement","original":"./Tree"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Graph/Graph.tsx":{"bytes":16574,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/gem-core","kind":"import-statement","external":true},{"path":"@dxos/gem-spore","kind":"import-statement","external":true},{"path":"@dxos/plugin-search","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/gem-spore/styles","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts","kind":"import-statement","original":"./graph-model"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/index.ts","kind":"import-statement","original":"../Tree"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts":{"bytes":630,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts","kind":"import-statement","original":"./graph-model"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/Graph.tsx","kind":"import-statement","original":"./Graph"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/ExplorerMain.tsx":{"bytes":3322,"imports":[{"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","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/ExplorerArticle.tsx":{"bytes":2443,"imports":[{"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":"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/components/index.ts":{"bytes":1576,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Chart/index.ts","kind":"import-statement","original":"./Chart"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Globe/index.ts","kind":"import-statement","original":"./Globe"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts","kind":"import-statement","original":"./Graph"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/Tree/index.ts","kind":"import-statement","original":"./Tree"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/ExplorerMain.tsx","kind":"dynamic-import","original":"./ExplorerMain"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/ExplorerArticle.tsx","kind":"dynamic-import","original":"./ExplorerArticle"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/meta.ts":{"bytes":1340,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/translations.ts":{"bytes":1473,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/types/view.ts":{"bytes":1394,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/types/types.ts":{"bytes":1762,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/types/index.ts":{"bytes":596,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/types/view.ts","kind":"import-statement","original":"./view"},{"path":"packages/plugins/experimental/plugin-explorer/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/ExplorerPlugin.tsx":{"bytes":14586,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-explorer/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-explorer/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-explorer/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-explorer/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-explorer/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-explorer/src/index.ts":{"bytes":1004,"imports":[{"path":"packages/plugins/experimental/plugin-explorer/src/ExplorerPlugin.tsx","kind":"import-statement","original":"./ExplorerPlugin"},{"path":"packages/plugins/experimental/plugin-explorer/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-explorer/src/ExplorerPlugin.tsx","kind":"import-statement","original":"./ExplorerPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-explorer/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":458310},"packages/plugins/experimental/plugin-explorer/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-XPJ3TJZY.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-XSC6U7EH.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-B3DD7UMY.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"react","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":"@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":"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerMain-YHTGV7H5.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerArticle-QWLRFTJ3.cjs","kind":"dynamic-import"}],"exports":["Chart","ExplorerArticle","ExplorerMain","ExplorerPlugin","Globe","Graph","SpaceGraphModel","Tree","default","defaultTreeLayoutSlots"],"entryPoint":"packages/plugins/experimental/plugin-explorer/src/index.ts","inputs":{"packages/plugins/experimental/plugin-explorer/src/ExplorerPlugin.tsx":{"bytesInOutput":3736},"packages/plugins/experimental/plugin-explorer/src/components/index.ts":{"bytesInOutput":188},"packages/plugins/experimental/plugin-explorer/src/components/Chart/Chart.tsx":{"bytesInOutput":1031},"packages/plugins/experimental/plugin-explorer/src/components/plot.ts":{"bytesInOutput":133},"packages/plugins/experimental/plugin-explorer/src/components/Chart/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-explorer/src/components/Globe/Globe.tsx":{"bytesInOutput":1707},"packages/plugins/experimental/plugin-explorer/data/countries-110m.js":{"bytesInOutput":188376},"packages/plugins/experimental/plugin-explorer/src/components/Globe/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-explorer/src/translations.ts":{"bytesInOutput":271},"packages/plugins/experimental/plugin-explorer/src/index.ts":{"bytesInOutput":34}},"bytes":196822},"packages/plugins/experimental/plugin-explorer/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-explorer/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-XSC6U7EH.cjs","kind":"import-statement"}],"exports":["EXPLORER_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-explorer/src/meta.ts","inputs":{},"bytes":165},"packages/plugins/experimental/plugin-explorer/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-explorer/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-XPJ3TJZY.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-XSC6U7EH.cjs","kind":"import-statement"}],"exports":["ExplorerAction","ViewType"],"entryPoint":"packages/plugins/experimental/plugin-explorer/src/types/index.ts","inputs":{},"bytes":178},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-XPJ3TJZY.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1523},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-XPJ3TJZY.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-XSC6U7EH.cjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["ExplorerAction","ViewType"],"inputs":{"packages/plugins/experimental/plugin-explorer/src/types/view.ts":{"bytesInOutput":208},"packages/plugins/experimental/plugin-explorer/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-explorer/src/types/types.ts":{"bytesInOutput":232}},"bytes":721},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-XSC6U7EH.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":633},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-XSC6U7EH.cjs":{"imports":[],"exports":["EXPLORER_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-explorer/src/meta.ts":{"bytesInOutput":227}},"bytes":379},"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerMain-YHTGV7H5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1722},"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerMain-YHTGV7H5.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-B3DD7UMY.cjs","kind":"import-statement"},{"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","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-explorer/src/components/ExplorerMain.tsx","inputs":{"packages/plugins/experimental/plugin-explorer/src/components/ExplorerMain.tsx":{"bytesInOutput":757}},"bytes":984},"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerArticle-QWLRFTJ3.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1213},"packages/plugins/experimental/plugin-explorer/dist/lib/node/ExplorerArticle-QWLRFTJ3.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-B3DD7UMY.cjs","kind":"import-statement"},{"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}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-explorer/src/components/ExplorerArticle.tsx","inputs":{"packages/plugins/experimental/plugin-explorer/src/components/ExplorerArticle.tsx":{"bytesInOutput":522}},"bytes":758},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-B3DD7UMY.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":40431},"packages/plugins/experimental/plugin-explorer/dist/lib/node/chunk-B3DD7UMY.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/gem-spore","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/gem-core","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":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/gem-core","kind":"import-statement","external":true},{"path":"@dxos/gem-spore","kind":"import-statement","external":true},{"path":"@dxos/plugin-search","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/gem-spore/styles","kind":"import-statement","external":true}],"exports":["Graph","SpaceGraphModel","Tree","defaultTreeLayoutSlots"],"inputs":{"packages/plugins/experimental/plugin-explorer/src/components/Graph/graph-model.ts":{"bytesInOutput":3490},"packages/plugins/experimental/plugin-explorer/src/components/Tree/Tree.tsx":{"bytesInOutput":2073},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/HierarchicalEdgeBundling.ts":{"bytesInOutput":2144},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/RadialTree.ts":{"bytesInOutput":1324},"packages/plugins/experimental/plugin-explorer/src/components/Tree/layout/TidyTree.ts":{"bytesInOutput":1553},"packages/plugins/experimental/plugin-explorer/src/components/Tree/types.ts":{"bytesInOutput":699},"packages/plugins/experimental/plugin-explorer/src/components/Graph/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-explorer/src/components/Graph/Graph.tsx":{"bytesInOutput":4022},"packages/plugins/experimental/plugin-explorer/src/components/Tree/index.ts":{"bytesInOutput":0}},"bytes":16111}}}
@@ -18,12 +18,12 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var types_exports = {};
20
20
  __export(types_exports, {
21
- ExplorerAction: () => import_chunk_OJOGTJXQ.ExplorerAction,
22
- ViewType: () => import_chunk_OJOGTJXQ.ViewType
21
+ ExplorerAction: () => import_chunk_XPJ3TJZY.ExplorerAction,
22
+ ViewType: () => import_chunk_XPJ3TJZY.ViewType
23
23
  });
24
24
  module.exports = __toCommonJS(types_exports);
25
- var import_chunk_OJOGTJXQ = require("../chunk-OJOGTJXQ.cjs");
26
- var import_chunk_BODO2FF3 = require("../chunk-BODO2FF3.cjs");
25
+ var import_chunk_XPJ3TJZY = require("../chunk-XPJ3TJZY.cjs");
26
+ var import_chunk_XSC6U7EH = require("../chunk-XSC6U7EH.cjs");
27
27
  // Annotate the CommonJS export names for ESM import in node:
28
28
  0 && (module.exports = {
29
29
  ExplorerAction,