@dxos/plugin-graph 0.13.0 → 0.16.0-next-60712ab191a99ba90316cc4be753e9e11b17100a

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.
@@ -1,16 +1 @@
1
- import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
- import * as Plugin from "@dxos/app-framework/Plugin";
3
- import { meta as meta$1 } from "#meta";
4
- //#region src/GraphPlugin.ts
5
- var GraphPlugin_exports = /* @__PURE__ */ __exportAll({
6
- make: () => make,
7
- meta: () => meta
8
- });
9
- /** Plugin metadata, available without loading the plugin body. */
10
- var meta = meta$1;
11
- /** Constructs the plugin; the body loads on first enable. */
12
- var make = Plugin.lazy(meta, () => import("#plugin"));
13
- //#endregion
14
- export { make, meta, GraphPlugin_exports as t };
15
-
16
- //# sourceMappingURL=GraphPlugin.mjs.map
1
+ export { n as make, r as meta } from "./chunk-GraphPlugin.mjs";
@@ -0,0 +1,8 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { t as runAction } from "./chunk-action.mjs";
3
+ //#region src/GraphAction.ts
4
+ var GraphAction_exports = /* @__PURE__ */ __exportAll({ run: () => runAction });
5
+ //#endregion
6
+ export { GraphAction_exports as t };
7
+
8
+ //# sourceMappingURL=chunk-GraphAction.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-GraphAction.mjs","names":[],"sources":["../../src/GraphAction.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport { runAction as run } from './action.ts';\n"],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import * as Plugin from "@dxos/app-framework/Plugin";
3
+ import { meta } from "#meta";
4
+ //#region src/GraphPlugin.ts
5
+ var GraphPlugin_exports = /* @__PURE__ */ __exportAll({
6
+ make: () => make,
7
+ meta: () => meta$1
8
+ });
9
+ /** Plugin metadata, available without loading the plugin body. */
10
+ var meta$1 = meta;
11
+ /** Constructs the plugin; the body loads on first enable. */
12
+ var make = Plugin.lazy(meta$1, () => import("#plugin"));
13
+ //#endregion
14
+ export { make as n, meta$1 as r, GraphPlugin_exports as t };
15
+
16
+ //# sourceMappingURL=chunk-GraphPlugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-GraphPlugin.mjs","names":["meta","pluginMeta"],"sources":["../../src/GraphPlugin.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\n\nimport { meta as pluginMeta } from '#meta';\n\n/** Plugin metadata, available without loading the plugin body. */\nexport const meta = pluginMeta;\n\n/** Constructs the plugin; the body loads on first enable. */\nexport const make = Plugin.lazy(meta, () => import('#plugin'));\n"],"mappings":";;;;;;;;;AAWA,IAAaA,SAAOC;;AAGpB,IAAa,OAAO,OAAO,KAAKD,cAAY,OAAO,UAAU"}
@@ -0,0 +1,9 @@
1
+ import { n as __reExport, t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ //#region src/Hooks.ts
3
+ var Hooks_exports = /* @__PURE__ */ __exportAll({});
4
+ import * as import__hooks from "#hooks";
5
+ __reExport(Hooks_exports, import__hooks);
6
+ //#endregion
7
+ export { Hooks_exports as t };
8
+
9
+ //# sourceMappingURL=chunk-Hooks.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-Hooks.mjs","names":[],"sources":["../../src/Hooks.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport * from '#hooks';\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.mjs","names":[],"sources":["../../src/hooks/useActionRunner.ts","../../src/hooks/useGraphTreeModel.ts","../../src/hooks/useNode.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport * as Hooks from '@dxos/app-framework/Hooks';\nimport * as PluginManagerProvider from '@dxos/app-framework/PluginManagerProvider';\nimport type * as AppGraphNode from '@dxos/app-graph/AppGraphNode';\n\nimport { runAction } from '../action.ts';\n\n/**\n * Hook that returns a function to run action Effects.\n * Provides Operation.Service, PluginContextService, and captured plugin context.\n */\nexport const useActionRunner = () => {\n const invoker = Hooks.useOperationInvoker();\n const pluginManager = PluginManagerProvider.usePluginManager();\n\n return useCallback(\n (action: AppGraphNode.Action, params: AppGraphNode.InvokeProps = {}) =>\n runAction(invoker, pluginManager.capabilities, action, params),\n [invoker, pluginManager.capabilities],\n );\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Option from 'effect/Option';\nimport * as Atom from 'effect/reactivity/Atom';\nimport { useMemo } from 'react';\n\nimport type * as AppGraph from '@dxos/app-graph/AppGraph';\nimport * as AppGraphNode from '@dxos/app-graph/AppGraphNode';\nimport * as Hooks from '@dxos/app-toolkit/Hooks';\nimport { Path, type TreeModel } from '@dxos/react-ui-list';\nimport { mx } from '@dxos/ui-theme';\n\nexport type GraphTreeState = {\n /** Open state keyed by the joined path (`Path.create`). */\n itemOpen: (path: string[]) => Atom.Atom<boolean>;\n /** Selected state keyed by the joined path. */\n itemCurrent: (path: string[]) => Atom.Atom<boolean>;\n};\n\n/** Rows the tree lists: not hidden, and either a plain node or an action the graph marks as an item. */\nconst isItem = (node: AppGraphNode.Node): boolean =>\n !AppGraphNode.hasDisposition(node, 'hidden') &&\n (!AppGraphNode.isAction(node) || AppGraphNode.hasDisposition(node, 'item'));\n\n/**\n * A `TreeModel` over the app graph: topology and row props come from the graph, open/current state\n * from the caller, so one mapping serves the navtree (persisted state) and any other tree host.\n */\nexport const createGraphTreeModel = (\n graph: AppGraph.ReadableGraph,\n rootId: string,\n { itemOpen, itemCurrent }: GraphTreeState,\n): TreeModel<AppGraphNode.Node> => {\n const isVisibleChild = (node: AppGraphNode.Node) => !AppGraphNode.hasDisposition(node, 'hidden');\n\n const itemPropsFamily = Atom.family((pathKey: string) => {\n const path = Path.parts(pathKey);\n const id = Path.last(pathKey);\n return Atom.make((get) => {\n const node = Option.getOrUndefined(get(graph.node(id)));\n if (!node) {\n return { id, label: id };\n }\n const safeChildren = get(graph.connections(node.id, 'child')).filter((child) => !path.includes(child.id));\n const visibleChildren = safeChildren.filter(isVisibleChild);\n const parentOf =\n visibleChildren.length > 0\n ? visibleChildren.map((child) => child.id)\n : node.properties.role === 'branch'\n ? []\n : undefined;\n const parentId = path.length >= 2 ? path[path.length - 2] : undefined;\n const parentNode = parentId ? Option.getOrUndefined(get(graph.node(parentId))) : undefined;\n const droppable =\n node.properties.droppable === false || parentNode?.properties.childrenDroppable === false ? false : undefined;\n const disposition = node.properties.disposition as string | undefined;\n const isGroup = disposition === 'group';\n return {\n id: node.id,\n parentOf: isGroup ? undefined : parentOf,\n disposition,\n disabled: isGroup || node.properties.disabled,\n draggable: isGroup ? false : node.properties.draggable,\n droppable: isGroup ? false : droppable,\n label: node.properties.label ?? node.id,\n className: mx(node.properties.className, node.properties.modified && 'italic'),\n headingClassName: node.properties.headingClassName,\n icon: node.properties.icon,\n iconHue: node.properties.iconHue,\n testId: node.properties.testId,\n count: node.properties.count,\n modifiedCount: node.properties.modifiedCount,\n };\n }).pipe(Atom.keepAlive);\n });\n\n const childIdsFamily = Atom.family((id: string) =>\n Atom.make((get) =>\n get(graph.connections(id, 'child'))\n .filter(isVisibleChild)\n .map((child) => child.id),\n ).pipe(Atom.keepAlive),\n );\n\n const itemFamily = Atom.family((id: string) =>\n Atom.make((get) => {\n const node = Option.getOrUndefined(get(graph.node(id)));\n return node && isItem(node) ? node : undefined;\n }).pipe(Atom.keepAlive),\n );\n\n const itemOpenFamily = Atom.family((pathKey: string) => itemOpen(Path.parts(pathKey)));\n const itemCurrentFamily = Atom.family((pathKey: string) => itemCurrent(Path.parts(pathKey)));\n\n return {\n item: (id) => itemFamily(id),\n itemProps: (path) => itemPropsFamily(Path.create(...path)),\n itemOpen: (path) => itemOpenFamily(Path.create(...path)),\n itemCurrent: (path) => itemCurrentFamily(Path.create(...path)),\n childIds: (parentId) => childIdsFamily(parentId ?? rootId),\n };\n};\n\n/** {@link createGraphTreeModel} over the app graph capability, memoised on its inputs. */\nexport const useGraphTreeModel = (rootId: string, options: GraphTreeState): TreeModel<AppGraphNode.Node> => {\n const { graph } = Hooks.useAppGraph();\n const { itemOpen, itemCurrent } = options;\n return useMemo(\n () => createGraphTreeModel(graph, rootId, { itemOpen, itemCurrent }),\n [graph, rootId, itemOpen, itemCurrent],\n );\n};\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport { useAtomValue } from '@effect/atom-react/Hooks';\nimport * as Option from 'effect/Option';\nimport { useMemo } from 'react';\n\nimport type * as AppGraph from '@dxos/app-graph/AppGraph';\nimport type * as AppGraphNode from '@dxos/app-graph/AppGraphNode';\n\n/**\n * React hook to get a node from the graph.\n *\n * @param graph Graph to find the node in.\n * @param id Id of the node to find.\n * @param timeout Optional timeout in milliseconds to wait for the node to be found.\n * @returns Node if found, undefined otherwise.\n */\n// TODO(wittjosiah): Factor out to @dxos/app-graph/react.\nexport const useNode = <T = any>(graph: AppGraph.ReadableGraph, id?: string): AppGraphNode.Node<T> | undefined => {\n const atom = useMemo(() => graph.node(id ?? ''), [graph, id]);\n return Option.getOrElse(useAtomValue(atom), () => undefined);\n};\n\nexport const useConnections = (\n graph: AppGraph.ReadableGraph,\n id: string | undefined,\n relation: AppGraphNode.RelationInput,\n): AppGraphNode.Node[] => {\n return useAtomValue(graph.connections(id ?? '', relation));\n};\n\n/**\n * React hook to get actions available for a node.\n *\n * @param graph Graph containing the node.\n * @param id Id of the node.\n * @returns Actions available for the node.\n */\nexport const useActions = (graph: AppGraph.ReadableGraph, id?: string): AppGraphNode.Node[] => {\n const atom = useMemo(() => graph.actions(id ?? ''), [graph, id]);\n return useAtomValue(atom);\n};\n\n/**\n * Subscribe to just the edge topology (inbound/outbound IDs) of a node without subscribing to node content.\n *\n * @param graph Graph containing the node.\n * @param id Id of the node.\n * @returns Edge topology for the node.\n */\nexport const useEdges = (graph: AppGraph.ReadableGraph, id?: string): AppGraph.Edges => {\n const atom = useMemo(() => graph.edges(id ?? ''), [graph, id]);\n return useAtomValue(atom);\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAa,wBAAwB;CACnC,MAAM,UAAU,QAAM,oBAAoB;CAC1C,MAAM,gBAAgB,sBAAsB,iBAAiB;CAE7D,OAAO,aACJ,QAA6B,SAAmC,CAAC,MAChE,UAAU,SAAS,cAAc,cAAc,QAAQ,MAAM,GAC/D,CAAC,SAAS,cAAc,YAAY,CACtC;AACF;;;;ACHA,IAAM,UAAU,SACd,CAAC,aAAa,eAAe,MAAM,QAAQ,MAC1C,CAAC,aAAa,SAAS,IAAI,KAAK,aAAa,eAAe,MAAM,MAAM;;;;;AAM3E,IAAa,wBACX,OACA,QACA,EAAE,UAAU,kBACqB;CACjC,MAAM,kBAAkB,SAA4B,CAAC,aAAa,eAAe,MAAM,QAAQ;CAE/F,MAAM,kBAAkB,KAAK,QAAQ,YAAoB;EACvD,MAAM,OAAO,KAAK,MAAM,OAAO;EAC/B,MAAM,KAAK,KAAK,KAAK,OAAO;EAC5B,OAAO,KAAK,MAAM,QAAQ;GACxB,MAAM,OAAO,OAAO,eAAe,IAAI,MAAM,KAAK,EAAE,CAAC,CAAC;GACtD,IAAI,CAAC,MACH,OAAO;IAAE;IAAI,OAAO;GAAG;GAGzB,MAAM,kBADe,IAAI,MAAM,YAAY,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,QAAQ,UAAU,CAAC,KAAK,SAAS,MAAM,EAAE,CAC/E,CAAA,CAAa,OAAO,cAAc;GAC1D,MAAM,WACJ,gBAAgB,SAAS,IACrB,gBAAgB,KAAK,UAAU,MAAM,EAAE,IACvC,KAAK,WAAW,SAAS,WACvB,CAAC,IACD,KAAA;GACR,MAAM,WAAW,KAAK,UAAU,IAAI,KAAK,KAAK,SAAS,KAAK,KAAA;GAC5D,MAAM,aAA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CAAC,CAAC;CAE3F,OAAO;EACL,OAAO,OAAO,WAAW,EAAE;EAC3B,YAAY,SAAS,gBAAgB,KAAK,OAAO,GAAG,IAAI,CAAC;EACzD,WAAW,SAAS,eAAe,KAAK,OAAO,GAAG,IAAI,CAAC;EACvD,cAAc,SAAS,kBAAkB,KAAK,OAAO,GAAG,IAAI,CAAC;EAC7D,WAAW,aAAa,eAAe,YAAY,MAAM;CAC3D;AACF;;AAGA,IAAa,qBAAqB,QAAgB,YAA0D;CAC1G,MAAM,EAAE,UAAU,MAAM,YAAY;CACpC,MAAM,EAAE,UAAU,gBAAgB;CAClC,OAAO,cACC,qBAAqB,OAAO,QAAQ;EAAE;EAAU;CAAY,CAAC,GACnE;EAAC;EAAO;EAAQ;EAAU;CAAW,CACvC;AACF;;;;;;;;;;;AC7FA,IAAa,WAAoB,OAA+B,OAAkD;CAChH,MAAM,OAAO,cAAc,MAAM,KAAK,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;CAC5D,OAAO,OAAO,UAAU,aAAa,IAAI,SAAS,KAAA,CAAS;AAC7D;AAEA,IAAa,kBACX,OACA,IACA,aACwB;CACxB,OAAO,aAAa,MAAM,YAAY,MAAM,IAAI,QAAQ,CAAC;AAC3D;;;;;;;;AASA,IAAa,cAAc,OAA+B,OAAqC;CAC7F,MAAM,OAAO,cAAc,MAAM,QAAQ,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;CAC/D,OAAO,aAAa,IAAI;AAC1B;;;;;;;;AASA,IAAa,YAAY,OAA+B,OAAgC;CACtF,MAAM,OAAO,cAAc,MAAM,MAAM,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;CAC7D,OAAO,aAAa,IAAI;AAC1B"}
1
+ {"version":3,"file":"hooks.mjs","names":["Hooks"],"sources":["../../src/hooks/useActionRunner.ts","../../src/hooks/useGraphTreeModel.ts","../../src/hooks/useNode.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport * as Hooks from '@dxos/app-framework/Hooks';\nimport * as PluginManagerProvider from '@dxos/app-framework/PluginManagerProvider';\nimport type * as AppGraphNode from '@dxos/app-graph/AppGraphNode';\n\nimport { runAction } from '../action.ts';\n\n/**\n * Hook that returns a function to run action Effects.\n * Provides Operation.Service, PluginContextService, and captured plugin context.\n */\nexport const useActionRunner = () => {\n const invoker = Hooks.useOperationInvoker();\n const pluginManager = PluginManagerProvider.usePluginManager();\n\n return useCallback(\n (action: AppGraphNode.Action, params: AppGraphNode.InvokeProps = {}) =>\n runAction(invoker, pluginManager.capabilities, action, params),\n [invoker, pluginManager.capabilities],\n );\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Option from 'effect/Option';\nimport * as Atom from 'effect/reactivity/Atom';\nimport { useMemo } from 'react';\n\nimport type * as AppGraph from '@dxos/app-graph/AppGraph';\nimport * as AppGraphNode from '@dxos/app-graph/AppGraphNode';\nimport * as Hooks from '@dxos/app-toolkit/Hooks';\nimport { Path, type TreeModel } from '@dxos/react-ui-list';\nimport { mx } from '@dxos/ui-theme';\n\nexport type GraphTreeState = {\n /** Open state keyed by the joined path (`Path.create`). */\n itemOpen: (path: string[]) => Atom.Atom<boolean>;\n /** Selected state keyed by the joined path. */\n itemCurrent: (path: string[]) => Atom.Atom<boolean>;\n};\n\n/** Rows the tree lists: not hidden, and either a plain node or an action the graph marks as an item. */\nconst isItem = (node: AppGraphNode.Node): boolean =>\n !AppGraphNode.hasDisposition(node, 'hidden') &&\n (!AppGraphNode.isAction(node) || AppGraphNode.hasDisposition(node, 'item'));\n\n/**\n * A `TreeModel` over the app graph: topology and row props come from the graph, open/current state\n * from the caller, so one mapping serves the navtree (persisted state) and any other tree host.\n */\nexport const createGraphTreeModel = (\n graph: AppGraph.ReadableGraph,\n rootId: string,\n { itemOpen, itemCurrent }: GraphTreeState,\n): TreeModel<AppGraphNode.Node> => {\n const isVisibleChild = (node: AppGraphNode.Node) => !AppGraphNode.hasDisposition(node, 'hidden');\n\n const itemPropsFamily = Atom.family((pathKey: string) => {\n const path = Path.parts(pathKey);\n const id = Path.last(pathKey);\n return Atom.make((get) => {\n const node = Option.getOrUndefined(get(graph.node(id)));\n if (!node) {\n return { id, label: id };\n }\n const safeChildren = get(graph.connections(node.id, 'child')).filter((child) => !path.includes(child.id));\n const visibleChildren = safeChildren.filter(isVisibleChild);\n const parentOf =\n visibleChildren.length > 0\n ? visibleChildren.map((child) => child.id)\n : node.properties.role === 'branch'\n ? []\n : undefined;\n const parentId = path.length >= 2 ? path[path.length - 2] : undefined;\n const parentNode = parentId ? Option.getOrUndefined(get(graph.node(parentId))) : undefined;\n const droppable =\n node.properties.droppable === false || parentNode?.properties.childrenDroppable === false ? false : undefined;\n const disposition = node.properties.disposition as string | undefined;\n const isGroup = disposition === 'group';\n return {\n id: node.id,\n parentOf: isGroup ? undefined : parentOf,\n disposition,\n disabled: isGroup || node.properties.disabled,\n draggable: isGroup ? false : node.properties.draggable,\n droppable: isGroup ? false : droppable,\n label: node.properties.label ?? node.id,\n className: mx(node.properties.className, node.properties.modified && 'italic'),\n headingClassName: node.properties.headingClassName,\n icon: node.properties.icon,\n iconHue: node.properties.iconHue,\n testId: node.properties.testId,\n count: node.properties.count,\n modifiedCount: node.properties.modifiedCount,\n };\n }).pipe(Atom.keepAlive);\n });\n\n const childIdsFamily = Atom.family((id: string) =>\n Atom.make((get) =>\n get(graph.connections(id, 'child'))\n .filter(isVisibleChild)\n .map((child) => child.id),\n ).pipe(Atom.keepAlive),\n );\n\n const itemFamily = Atom.family((id: string) =>\n Atom.make((get) => {\n const node = Option.getOrUndefined(get(graph.node(id)));\n return node && isItem(node) ? node : undefined;\n }).pipe(Atom.keepAlive),\n );\n\n const itemOpenFamily = Atom.family((pathKey: string) => itemOpen(Path.parts(pathKey)));\n const itemCurrentFamily = Atom.family((pathKey: string) => itemCurrent(Path.parts(pathKey)));\n\n return {\n item: (id) => itemFamily(id),\n itemProps: (path) => itemPropsFamily(Path.create(...path)),\n itemOpen: (path) => itemOpenFamily(Path.create(...path)),\n itemCurrent: (path) => itemCurrentFamily(Path.create(...path)),\n childIds: (parentId) => childIdsFamily(parentId ?? rootId),\n };\n};\n\n/** {@link createGraphTreeModel} over the app graph capability, memoised on its inputs. */\nexport const useGraphTreeModel = (rootId: string, options: GraphTreeState): TreeModel<AppGraphNode.Node> => {\n const { graph } = Hooks.useAppGraph();\n const { itemOpen, itemCurrent } = options;\n return useMemo(\n () => createGraphTreeModel(graph, rootId, { itemOpen, itemCurrent }),\n [graph, rootId, itemOpen, itemCurrent],\n );\n};\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport { useAtomValue } from '@effect/atom-react/Hooks';\nimport * as Option from 'effect/Option';\nimport { useMemo } from 'react';\n\nimport type * as AppGraph from '@dxos/app-graph/AppGraph';\nimport type * as AppGraphNode from '@dxos/app-graph/AppGraphNode';\n\n/**\n * React hook to get a node from the graph.\n *\n * @param graph Graph to find the node in.\n * @param id Id of the node to find.\n * @param timeout Optional timeout in milliseconds to wait for the node to be found.\n * @returns Node if found, undefined otherwise.\n */\n// TODO(wittjosiah): Factor out to @dxos/app-graph/react.\nexport const useNode = <T = any>(graph: AppGraph.ReadableGraph, id?: string): AppGraphNode.Node<T> | undefined => {\n const atom = useMemo(() => graph.node(id ?? ''), [graph, id]);\n return Option.getOrElse(useAtomValue(atom), () => undefined);\n};\n\nexport const useConnections = (\n graph: AppGraph.ReadableGraph,\n id: string | undefined,\n relation: AppGraphNode.RelationInput,\n): AppGraphNode.Node[] => {\n return useAtomValue(graph.connections(id ?? '', relation));\n};\n\n/**\n * React hook to get actions available for a node.\n *\n * @param graph Graph containing the node.\n * @param id Id of the node.\n * @returns Actions available for the node.\n */\nexport const useActions = (graph: AppGraph.ReadableGraph, id?: string): AppGraphNode.Node[] => {\n const atom = useMemo(() => graph.actions(id ?? ''), [graph, id]);\n return useAtomValue(atom);\n};\n\n/**\n * Subscribe to just the edge topology (inbound/outbound IDs) of a node without subscribing to node content.\n *\n * @param graph Graph containing the node.\n * @param id Id of the node.\n * @returns Edge topology for the node.\n */\nexport const useEdges = (graph: AppGraph.ReadableGraph, id?: string): AppGraph.Edges => {\n const atom = useMemo(() => graph.edges(id ?? ''), [graph, id]);\n return useAtomValue(atom);\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAa,wBAAwB;CACnC,MAAM,UAAUA,QAAM,oBAAoB;CAC1C,MAAM,gBAAgB,sBAAsB,iBAAiB;CAE7D,OAAO,aACJ,QAA6B,SAAmC,CAAC,MAChE,UAAU,SAAS,cAAc,cAAc,QAAQ,MAAM,GAC/D,CAAC,SAAS,cAAc,YAAY,CACtC;AACF;;;;ACHA,IAAM,UAAU,SACd,CAAC,aAAa,eAAe,MAAM,QAAQ,MAC1C,CAAC,aAAa,SAAS,IAAI,KAAK,aAAa,eAAe,MAAM,MAAM;;;;;AAM3E,IAAa,wBACX,OACA,QACA,EAAE,UAAU,kBACqB;CACjC,MAAM,kBAAkB,SAA4B,CAAC,aAAa,eAAe,MAAM,QAAQ;CAE/F,MAAM,kBAAkB,KAAK,QAAQ,YAAoB;EACvD,MAAM,OAAO,KAAK,MAAM,OAAO;EAC/B,MAAM,KAAK,KAAK,KAAK,OAAO;EAC5B,OAAO,KAAK,MAAM,QAAQ;GACxB,MAAM,OAAO,OAAO,eAAe,IAAI,MAAM,KAAK,EAAE,CAAC,CAAC;GACtD,IAAI,CAAC,MACH,OAAO;IAAE;IAAI,OAAO;GAAG;GAGzB,MAAM,kBADe,IAAI,MAAM,YAAY,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,QAAQ,UAAU,CAAC,KAAK,SAAS,MAAM,EAAE,CAC/E,CAAA,CAAa,OAAO,cAAc;GAC1D,MAAM,WACJ,gBAAgB,SAAS,IACrB,gBAAgB,KAAK,UAAU,MAAM,EAAE,IACvC,KAAK,WAAW,SAAS,WACvB,CAAC,IACD,KAAA;GACR,MAAM,WAAW,KAAK,UAAU,IAAI,KAA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ugin_exports } from "./GraphPlugin.mjs";
1
+ import { t as GraphAction_exports } from "./chunk-GraphAction.mjs";
2
+ import { t as Hooks_exports } from "./chunk-Hooks.mjs";
3
+ import { t as GraphPlugin_exports } from "./chunk-GraphPlugin.mjs";
4
4
  export { GraphAction_exports as GraphAction, GraphPlugin_exports as GraphPlugin, Hooks_exports as Hooks };
@@ -1 +1 @@
1
- {"version":3,"file":"meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.graph',\n name: 'Graph',\n author: 'DXOS',\n description: trim`\n Graph database layer providing relationship modeling and queries for workspace objects.\n Build knowledge graphs and explore complex data relationships.\n `,\n tags: ['system'],\n },\n});\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\n\nimport config from '../dx.config.ts';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n"],"mappings":";;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;CAIjB,MAAM,CAAC,QAAQ;AACjB,EACF,CAAC;;;ACVD,IAAa,OAAO,OAAO,kBAAkB,iBAAM"}
1
+ {"version":3,"file":"meta.mjs","names":["config"],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.graph',\n name: 'Graph',\n author: 'DXOS',\n description: trim`\n Graph database layer providing relationship modeling and queries for workspace objects.\n Build knowledge graphs and explore complex data relationships.\n `,\n tags: ['system'],\n },\n});\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\n\nimport config from '../dx.config.ts';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n"],"mappings":";;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;CAIjB,MAAM,CAAC,QAAQ;AACjB,EACF,CAAC;;;ACVD,IAAa,OAAO,OAAO,kBAAkBA,iBAAM"}
@@ -1,8 +1,2 @@
1
- import { t as __exportAll } from "../chunk-rolldown-runtime.mjs";
2
- import { t as runAction } from "../chunk-action.mjs";
3
- //#region src/GraphAction.ts
4
- var GraphAction_exports = /* @__PURE__ */ __exportAll({ run: () => runAction });
5
- //#endregion
6
- export { runAction as run, GraphAction_exports as t };
7
-
8
- //# sourceMappingURL=GraphAction.mjs.map
1
+ export { t as run } from "../chunk-action.mjs";
2
+ import "../chunk-GraphAction.mjs";
@@ -1,10 +1,2 @@
1
- import { n as __reExport, t as __exportAll } from "../chunk-rolldown-runtime.mjs";
1
+ import "../chunk-Hooks.mjs";
2
2
  export * from "#hooks";
3
- //#region src/Hooks.ts
4
- var Hooks_exports = /* @__PURE__ */ __exportAll({});
5
- import * as import__hooks from "#hooks";
6
- __reExport(Hooks_exports, import__hooks);
7
- //#endregion
8
- export { Hooks_exports as t };
9
-
10
- //# sourceMappingURL=Hooks.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.mjs","names":[],"sources":["../../src/GraphPlugin.testing.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { meta as pluginMeta } from '#meta';\nimport { GraphPlugin } from '#plugin';\n\n/** Plugin metadata, available without loading the plugin body. */\nexport const meta = pluginMeta;\n\n/**\n * Constructs the plugin. Eager by design, unlike the lazy `make` on `GraphPlugin`: storybook runs\n * under vite-dev, where webkit cannot reliably settle the lazy stub's dynamic import (see\n * `@dxos/plugin-testing/src/core.ts`).\n */\nexport const make = GraphPlugin;\n"],"mappings":";;;;;;;;;AAQA,IAAa,SAAO;;;;;;AAOpB,IAAa,OAAO"}
1
+ {"version":3,"file":"testing.mjs","names":["meta","pluginMeta"],"sources":["../../src/GraphPlugin.testing.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { meta as pluginMeta } from '#meta';\nimport { GraphPlugin } from '#plugin';\n\n/** Plugin metadata, available without loading the plugin body. */\nexport const meta = pluginMeta;\n\n/**\n * Constructs the plugin. Eager by design, unlike the lazy `make` on `GraphPlugin`: storybook runs\n * under vite-dev, where webkit cannot reliably settle the lazy stub's dynamic import (see\n * `@dxos/plugin-testing/src/core.ts`).\n */\nexport const make = GraphPlugin;\n"],"mappings":";;;;;;;;;AAQA,IAAaA,SAAOC;;;;;;AAOpB,IAAa,OAAO"}