@dxos/plugin-graph 0.6.11 → 0.6.12-main.5cc132e

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.
@@ -0,0 +1,9 @@
1
+ // packages/plugins/plugin-graph/src/meta.ts
2
+ var meta_default = {
3
+ id: "dxos.org/plugin/graph"
4
+ };
5
+
6
+ export {
7
+ meta_default
8
+ };
9
+ //# sourceMappingURL=chunk-BCEDFTWC.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport default {\n id: 'dxos.org/plugin/graph',\n};\n"],
5
+ "mappings": ";AAIA,IAAA,eAAe;EACbA,IAAI;AACN;",
6
+ "names": ["id"]
7
+ }
@@ -0,0 +1,46 @@
1
+ import {
2
+ meta_default
3
+ } from "./chunk-BCEDFTWC.mjs";
4
+
5
+ // packages/plugins/plugin-graph/src/GraphPlugin.tsx
6
+ import React from "react";
7
+ import { filterPlugins, parseGraphBuilderPlugin } from "@dxos/app-framework";
8
+ import { GraphBuilder } from "@dxos/app-graph";
9
+
10
+ // packages/plugins/plugin-graph/src/GraphContext.ts
11
+ import { createContext, useContext } from "react";
12
+ import { raise } from "@dxos/debug";
13
+ var GraphContext = createContext(null);
14
+ var useGraph = () => useContext(GraphContext) ?? raise(new Error("Missing GraphContext"));
15
+
16
+ // packages/plugins/plugin-graph/src/GraphPlugin.tsx
17
+ var GraphPlugin = () => {
18
+ const builder = new GraphBuilder();
19
+ return {
20
+ meta: meta_default,
21
+ ready: async (plugins) => {
22
+ filterPlugins(plugins, parseGraphBuilderPlugin).forEach((plugin) => builder.addExtension(plugin.provides.graph.builder(plugins)));
23
+ },
24
+ provides: {
25
+ graph: builder.graph,
26
+ // TODO(wittjosiah): This is janky.
27
+ explore: (options) => builder.explore(options),
28
+ context: ({ children }) => /* @__PURE__ */ React.createElement(GraphContext.Provider, {
29
+ value: {
30
+ graph: builder.graph
31
+ }
32
+ }, children)
33
+ }
34
+ };
35
+ };
36
+
37
+ // packages/plugins/plugin-graph/src/index.ts
38
+ export * from "@dxos/app-graph";
39
+ var src_default = GraphPlugin;
40
+ export {
41
+ GraphContext,
42
+ GraphPlugin,
43
+ src_default as default,
44
+ useGraph
45
+ };
46
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/GraphPlugin.tsx", "../../../src/GraphContext.ts", "../../../src/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { filterPlugins, type GraphProvides, type PluginDefinition, parseGraphBuilderPlugin } from '@dxos/app-framework';\nimport { GraphBuilder } from '@dxos/app-graph';\n\nimport { GraphContext } from './GraphContext';\nimport meta from './meta';\n\n/**\n * Manages the state of the graph for the application.\n * Enables other plugins to register node builders to add nodes to the graph.\n * This includes actions and annotation each other's nodes.\n */\nexport const GraphPlugin = (): PluginDefinition<GraphProvides> => {\n const builder = new GraphBuilder();\n\n return {\n meta,\n ready: async (plugins) => {\n filterPlugins(plugins, parseGraphBuilderPlugin).forEach((plugin) =>\n builder.addExtension(plugin.provides.graph.builder(plugins)),\n );\n },\n provides: {\n graph: builder.graph,\n // TODO(wittjosiah): This is janky.\n explore: (options) => builder.explore(options),\n context: ({ children }) => (\n <GraphContext.Provider value={{ graph: builder.graph }}>{children}</GraphContext.Provider>\n ),\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(wittjosiah): State can be a GraphNode.\nimport { type Context, createContext, useContext } from 'react';\n\nimport { type Graph } from '@dxos/app-graph';\nimport { raise } from '@dxos/debug';\n\nexport type GraphContext = { graph: Graph };\n\nexport const GraphContext: Context<GraphContext | null> = createContext<GraphContext | null>(null);\n\nexport const useGraph = (): GraphContext => useContext(GraphContext) ?? raise(new Error('Missing GraphContext'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { GraphPlugin } from './GraphPlugin';\n\nexport default GraphPlugin;\n\nexport * from '@dxos/app-graph';\n\nexport * from './GraphContext';\nexport * from './GraphPlugin';\n"],
5
+ "mappings": ";;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,eAA0DC,+BAA+B;AAClG,SAASC,oBAAoB;;;ACF7B,SAAuBC,eAAeC,kBAAkB;AAGxD,SAASC,aAAa;AAIf,IAAMC,eAA6CC,cAAmC,IAAA;AAEtF,IAAMC,WAAW,MAAoBC,WAAWH,YAAAA,KAAiBI,MAAM,IAAIC,MAAM,sBAAA,CAAA;;;ADGjF,IAAMC,cAAc,MAAA;AACzB,QAAMC,UAAU,IAAIC,aAAAA;AAEpB,SAAO;IACLC;IACAC,OAAO,OAAOC,YAAAA;AACZC,oBAAcD,SAASE,uBAAAA,EAAyBC,QAAQ,CAACC,WACvDR,QAAQS,aAAaD,OAAOE,SAASC,MAAMX,QAAQI,OAAAA,CAAAA,CAAAA;IAEvD;IACAM,UAAU;MACRC,OAAOX,QAAQW;;MAEfC,SAAS,CAACC,YAAYb,QAAQY,QAAQC,OAAAA;MACtCC,SAAS,CAAC,EAAEC,SAAQ,MAClB,sBAAA,cAACC,aAAaC,UAAQ;QAACC,OAAO;UAAEP,OAAOX,QAAQW;QAAM;SAAII,QAAAA;IAE7D;EACF;AACF;;;AE5BA,cAAc;AAFd,IAAA,cAAeI;",
6
+ "names": ["React", "filterPlugins", "parseGraphBuilderPlugin", "GraphBuilder", "createContext", "useContext", "raise", "GraphContext", "createContext", "useGraph", "useContext", "raise", "Error", "GraphPlugin", "builder", "GraphBuilder", "meta", "ready", "plugins", "filterPlugins", "parseGraphBuilderPlugin", "forEach", "plugin", "addExtension", "provides", "graph", "explore", "options", "context", "children", "GraphContext", "Provider", "value", "GraphPlugin"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"packages/plugins/plugin-graph/src/GraphContext.ts":{"bytes":1674,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-graph/src/meta.ts":{"bytes":584,"imports":[],"format":"esm"},"packages/plugins/plugin-graph/src/GraphPlugin.tsx":{"bytes":4155,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-graph/src/GraphContext.ts","kind":"import-statement","original":"./GraphContext"},{"path":"packages/plugins/plugin-graph/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-graph/src/index.ts":{"bytes":978,"imports":[{"path":"packages/plugins/plugin-graph/src/GraphPlugin.tsx","kind":"import-statement","original":"./GraphPlugin"},{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-graph/src/GraphContext.ts","kind":"import-statement","original":"./GraphContext"},{"path":"packages/plugins/plugin-graph/src/GraphPlugin.tsx","kind":"import-statement","original":"./GraphPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-graph/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3164},"packages/plugins/plugin-graph/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-graph/dist/lib/node-esm/chunk-BCEDFTWC.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/app-graph","kind":"import-statement","external":true}],"exports":["GraphContext","GraphPlugin","default","useGraph"],"entryPoint":"packages/plugins/plugin-graph/src/index.ts","inputs":{"packages/plugins/plugin-graph/src/GraphPlugin.tsx":{"bytesInOutput":753},"packages/plugins/plugin-graph/src/GraphContext.ts":{"bytesInOutput":219},"packages/plugins/plugin-graph/src/index.ts":{"bytesInOutput":64}},"bytes":1415},"packages/plugins/plugin-graph/dist/lib/node-esm/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-graph/dist/lib/node-esm/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-graph/dist/lib/node-esm/chunk-BCEDFTWC.mjs","kind":"import-statement"}],"exports":["default"],"entryPoint":"packages/plugins/plugin-graph/src/meta.ts","inputs":{},"bytes":127},"packages/plugins/plugin-graph/dist/lib/node-esm/chunk-BCEDFTWC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":245},"packages/plugins/plugin-graph/dist/lib/node-esm/chunk-BCEDFTWC.mjs":{"imports":[],"exports":["meta_default"],"inputs":{"packages/plugins/plugin-graph/src/meta.ts":{"bytesInOutput":54}},"bytes":171}}}
@@ -0,0 +1,7 @@
1
+ import {
2
+ meta_default
3
+ } from "./chunk-BCEDFTWC.mjs";
4
+ export {
5
+ meta_default as default
6
+ };
7
+ //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-graph",
3
- "version": "0.6.11",
3
+ "version": "0.6.12-main.5cc132e",
4
4
  "description": "DXOS Surface plugin for constructing knowledge graphs",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,14 +10,16 @@
10
10
  ".": {
11
11
  "browser": "./dist/lib/browser/index.mjs",
12
12
  "node": {
13
- "default": "./dist/lib/node/index.cjs"
13
+ "require": "./dist/lib/node/index.cjs",
14
+ "default": "./dist/lib/node-esm/index.mjs"
14
15
  },
15
16
  "types": "./dist/types/src/index.d.ts"
16
17
  },
17
18
  "./meta": {
18
19
  "browser": "./dist/lib/browser/meta.mjs",
19
20
  "node": {
20
- "default": "./dist/lib/node/meta.cjs"
21
+ "require": "./dist/lib/node/meta.cjs",
22
+ "default": "./dist/lib/node-esm/meta.mjs"
21
23
  },
22
24
  "types": "./dist/types/src/meta.d.ts"
23
25
  }
@@ -35,18 +37,18 @@
35
37
  "src"
36
38
  ],
37
39
  "dependencies": {
38
- "@dxos/app-framework": "0.6.11",
39
- "@dxos/app-graph": "0.6.11",
40
- "@dxos/debug": "0.6.11"
40
+ "@dxos/app-framework": "0.6.12-main.5cc132e",
41
+ "@dxos/debug": "0.6.12-main.5cc132e",
42
+ "@dxos/app-graph": "0.6.12-main.5cc132e"
41
43
  },
42
44
  "devDependencies": {
43
45
  "@types/react": "~18.2.0",
44
46
  "@types/react-dom": "~18.2.0",
45
47
  "react": "~18.2.0",
46
48
  "react-dom": "~18.2.0",
47
- "vite": "^5.3.4",
48
- "@dxos/storybook-utils": "0.6.11",
49
- "@dxos/react-client": "0.6.11"
49
+ "vite": "5.4.7",
50
+ "@dxos/react-client": "0.6.12-main.5cc132e",
51
+ "@dxos/storybook-utils": "0.6.12-main.5cc132e"
50
52
  },
51
53
  "peerDependencies": {
52
54
  "react": "^18.0.0",