@dxos/plugin-graph 0.6.12-main.ed7cda7 → 0.6.12-staging.0b4bb48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -13
- package/dist/lib/node-esm/chunk-C7WERESZ.mjs +0 -11
- package/dist/lib/node-esm/chunk-C7WERESZ.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -47
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -8
- package/dist/lib/node-esm/meta.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-graph",
|
|
3
|
-
"version": "0.6.12-
|
|
3
|
+
"version": "0.6.12-staging.0b4bb48",
|
|
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,16 +10,14 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"browser": "./dist/lib/browser/index.mjs",
|
|
12
12
|
"node": {
|
|
13
|
-
"
|
|
14
|
-
"default": "./dist/lib/node-esm/index.mjs"
|
|
13
|
+
"default": "./dist/lib/node/index.cjs"
|
|
15
14
|
},
|
|
16
15
|
"types": "./dist/types/src/index.d.ts"
|
|
17
16
|
},
|
|
18
17
|
"./meta": {
|
|
19
18
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
20
19
|
"node": {
|
|
21
|
-
"
|
|
22
|
-
"default": "./dist/lib/node-esm/meta.mjs"
|
|
20
|
+
"default": "./dist/lib/node/meta.cjs"
|
|
23
21
|
},
|
|
24
22
|
"types": "./dist/types/src/meta.d.ts"
|
|
25
23
|
}
|
|
@@ -37,22 +35,22 @@
|
|
|
37
35
|
"src"
|
|
38
36
|
],
|
|
39
37
|
"dependencies": {
|
|
40
|
-
"@dxos/app-framework": "0.6.12-
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
38
|
+
"@dxos/app-framework": "0.6.12-staging.0b4bb48",
|
|
39
|
+
"@dxos/debug": "0.6.12-staging.0b4bb48",
|
|
40
|
+
"@dxos/app-graph": "0.6.12-staging.0b4bb48"
|
|
43
41
|
},
|
|
44
42
|
"devDependencies": {
|
|
45
43
|
"@types/react": "~18.2.0",
|
|
46
44
|
"@types/react-dom": "~18.2.0",
|
|
47
45
|
"react": "~18.2.0",
|
|
48
46
|
"react-dom": "~18.2.0",
|
|
49
|
-
"vite": "5.4
|
|
50
|
-
"@dxos/react-client": "0.6.12-
|
|
51
|
-
"@dxos/storybook-utils": "0.6.12-
|
|
47
|
+
"vite": "^5.3.4",
|
|
48
|
+
"@dxos/react-client": "0.6.12-staging.0b4bb48",
|
|
49
|
+
"@dxos/storybook-utils": "0.6.12-staging.0b4bb48"
|
|
52
50
|
},
|
|
53
51
|
"peerDependencies": {
|
|
54
|
-
"react": "
|
|
55
|
-
"react-dom": "
|
|
52
|
+
"react": "^18.0.0",
|
|
53
|
+
"react-dom": "^18.0.0"
|
|
56
54
|
},
|
|
57
55
|
"publishConfig": {
|
|
58
56
|
"access": "public"
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// packages/plugins/plugin-graph/src/meta.ts
|
|
4
|
-
var meta_default = {
|
|
5
|
-
id: "dxos.org/plugin/graph"
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
meta_default
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=chunk-C7WERESZ.mjs.map
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
meta_default
|
|
4
|
-
} from "./chunk-C7WERESZ.mjs";
|
|
5
|
-
|
|
6
|
-
// packages/plugins/plugin-graph/src/GraphPlugin.tsx
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { filterPlugins, parseGraphBuilderPlugin } from "@dxos/app-framework";
|
|
9
|
-
import { GraphBuilder } from "@dxos/app-graph";
|
|
10
|
-
|
|
11
|
-
// packages/plugins/plugin-graph/src/GraphContext.ts
|
|
12
|
-
import { createContext, useContext } from "react";
|
|
13
|
-
import { raise } from "@dxos/debug";
|
|
14
|
-
var GraphContext = createContext(null);
|
|
15
|
-
var useGraph = () => useContext(GraphContext) ?? raise(new Error("Missing GraphContext"));
|
|
16
|
-
|
|
17
|
-
// packages/plugins/plugin-graph/src/GraphPlugin.tsx
|
|
18
|
-
var GraphPlugin = () => {
|
|
19
|
-
const builder = new GraphBuilder();
|
|
20
|
-
return {
|
|
21
|
-
meta: meta_default,
|
|
22
|
-
ready: async (plugins) => {
|
|
23
|
-
filterPlugins(plugins, parseGraphBuilderPlugin).forEach((plugin) => builder.addExtension(plugin.provides.graph.builder(plugins)));
|
|
24
|
-
},
|
|
25
|
-
provides: {
|
|
26
|
-
graph: builder.graph,
|
|
27
|
-
// TODO(wittjosiah): This is janky.
|
|
28
|
-
explore: (options) => builder.explore(options),
|
|
29
|
-
context: ({ children }) => /* @__PURE__ */ React.createElement(GraphContext.Provider, {
|
|
30
|
-
value: {
|
|
31
|
-
graph: builder.graph
|
|
32
|
-
}
|
|
33
|
-
}, children)
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// packages/plugins/plugin-graph/src/index.ts
|
|
39
|
-
export * from "@dxos/app-graph";
|
|
40
|
-
var src_default = GraphPlugin;
|
|
41
|
-
export {
|
|
42
|
-
GraphContext,
|
|
43
|
-
GraphPlugin,
|
|
44
|
-
src_default as default,
|
|
45
|
-
useGraph
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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":3165},"packages/plugins/plugin-graph/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-graph/dist/lib/node-esm/chunk-C7WERESZ.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":1507},"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-C7WERESZ.mjs","kind":"import-statement"}],"exports":["default"],"entryPoint":"packages/plugins/plugin-graph/src/meta.ts","inputs":{},"bytes":219},"packages/plugins/plugin-graph/dist/lib/node-esm/chunk-C7WERESZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":247},"packages/plugins/plugin-graph/dist/lib/node-esm/chunk-C7WERESZ.mjs":{"imports":[],"exports":["meta_default"],"inputs":{"packages/plugins/plugin-graph/src/meta.ts":{"bytesInOutput":54}},"bytes":264}}}
|