@dxos/app-graph 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446
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/dist/lib/browser/index.mjs +789 -541
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +780 -533
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +789 -541
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/graph-builder.d.ts +91 -48
- package/dist/types/src/graph-builder.d.ts.map +1 -1
- package/dist/types/src/graph.d.ts +98 -191
- package/dist/types/src/graph.d.ts.map +1 -1
- package/dist/types/src/node.d.ts +3 -3
- package/dist/types/src/node.d.ts.map +1 -1
- package/dist/types/src/stories/EchoGraph.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -23
- package/src/graph-builder.test.ts +310 -293
- package/src/graph-builder.ts +317 -209
- package/src/graph.test.ts +463 -314
- package/src/graph.ts +455 -452
- package/src/node.ts +4 -4
- package/src/stories/EchoGraph.stories.tsx +78 -57
- package/dist/types/src/experimental/graph-projections.test.d.ts +0 -25
- package/dist/types/src/experimental/graph-projections.test.d.ts.map +0 -1
- package/dist/types/src/signals-integration.test.d.ts +0 -2
- package/dist/types/src/signals-integration.test.d.ts.map +0 -1
- package/dist/types/src/testing.d.ts +0 -5
- package/dist/types/src/testing.d.ts.map +0 -1
- package/src/experimental/graph-projections.test.ts +0 -56
- package/src/signals-integration.test.ts +0 -218
- package/src/testing.ts +0 -20
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Registry, Rx } from '@effect-rx/rx-react';
|
|
2
|
-
import { Option } from 'effect';
|
|
3
|
-
import { Event } from '@dxos/async';
|
|
4
1
|
import { type MakeOptional } from '@dxos/util';
|
|
5
|
-
import { type
|
|
6
|
-
/**
|
|
7
|
-
* Get the Graph a Node is currently associated with.
|
|
8
|
-
*/
|
|
2
|
+
import { type Node, type NodeFilter, type Relation } from './node';
|
|
9
3
|
export declare const getGraph: (node: Node) => Graph;
|
|
10
4
|
export declare const ROOT_ID = "root";
|
|
11
5
|
export declare const ROOT_TYPE = "dxos.org/type/GraphRoot";
|
|
12
6
|
export declare const ACTION_TYPE = "dxos.org/type/GraphAction";
|
|
13
7
|
export declare const ACTION_GROUP_TYPE = "dxos.org/type/GraphActionGroup";
|
|
8
|
+
export type NodesOptions<T = any, U extends Record<string, any> = Record<string, any>> = {
|
|
9
|
+
relation?: Relation;
|
|
10
|
+
filter?: NodeFilter<T, U>;
|
|
11
|
+
expansion?: boolean;
|
|
12
|
+
type?: string;
|
|
13
|
+
};
|
|
14
14
|
export type GraphTraversalOptions = {
|
|
15
15
|
/**
|
|
16
16
|
* A callback which is called for each node visited during traversal.
|
|
@@ -21,244 +21,151 @@ export type GraphTraversalOptions = {
|
|
|
21
21
|
/**
|
|
22
22
|
* The node to start traversing from.
|
|
23
23
|
*
|
|
24
|
-
* @default
|
|
24
|
+
* @default root
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
node?: Node;
|
|
27
27
|
/**
|
|
28
28
|
* The relation to traverse graph edges.
|
|
29
29
|
*
|
|
30
30
|
* @default 'outbound'
|
|
31
31
|
*/
|
|
32
32
|
relation?: Relation;
|
|
33
|
+
/**
|
|
34
|
+
* Allow traversal to trigger expansion of the graph via `onInitialNodes`.
|
|
35
|
+
*/
|
|
36
|
+
expansion?: boolean;
|
|
33
37
|
};
|
|
34
38
|
export type GraphParams = {
|
|
35
|
-
registry?: Registry.Registry;
|
|
36
39
|
nodes?: MakeOptional<Node, 'data' | 'cacheable'>[];
|
|
37
|
-
edges?: Record<string,
|
|
38
|
-
|
|
40
|
+
edges?: Record<string, string[]>;
|
|
41
|
+
onInitialNode?: Graph['_onInitialNode'];
|
|
42
|
+
onInitialNodes?: Graph['_onInitialNodes'];
|
|
39
43
|
onRemoveNode?: Graph['_onRemoveNode'];
|
|
40
44
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The Graph represents the structure of the application constructed via plugins.
|
|
47
|
+
*/
|
|
48
|
+
export declare class Graph {
|
|
49
|
+
private readonly _onInitialNode?;
|
|
50
|
+
private readonly _onInitialNodes?;
|
|
51
|
+
private readonly _onRemoveNode?;
|
|
52
|
+
private readonly _waitingForNodes;
|
|
53
|
+
private readonly _initialized;
|
|
54
|
+
constructor({ nodes, edges, onInitialNode, onInitialNodes, onRemoveNode }?: GraphParams);
|
|
55
|
+
static from(pickle: string, options?: Omit<GraphParams, 'nodes' | 'edges'>): Graph;
|
|
50
56
|
/**
|
|
51
|
-
*
|
|
57
|
+
* Alias for `findNode('root')`.
|
|
52
58
|
*/
|
|
53
|
-
|
|
59
|
+
get root(): Readonly<{
|
|
54
60
|
id: string;
|
|
55
|
-
|
|
61
|
+
type: string;
|
|
62
|
+
cacheable?: string[];
|
|
63
|
+
properties: Readonly<Record<string, any>>;
|
|
64
|
+
data: any;
|
|
56
65
|
}>;
|
|
57
66
|
/**
|
|
58
67
|
* Convert the graph to a JSON object.
|
|
59
68
|
*/
|
|
60
|
-
toJSON(id?:
|
|
61
|
-
|
|
69
|
+
toJSON({ id, maxLength }?: {
|
|
70
|
+
id?: string;
|
|
71
|
+
maxLength?: number;
|
|
72
|
+
}): any;
|
|
73
|
+
pickle(): string;
|
|
62
74
|
/**
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
* Get the rx key for the node with the given id.
|
|
68
|
-
*/
|
|
69
|
-
nodeOrThrow(id: string): Rx.Rx<Node>;
|
|
70
|
-
/**
|
|
71
|
-
* Get the rx key for the connections of the node with the given id.
|
|
75
|
+
* Find the node with the given id in the graph.
|
|
76
|
+
*
|
|
77
|
+
* If a node is not found within the graph and an `onInitialNode` callback is provided,
|
|
78
|
+
* it is called with the id and type of the node, potentially initializing the node.
|
|
72
79
|
*/
|
|
73
|
-
|
|
80
|
+
findNode(id: string, expansion?: boolean): Node | undefined;
|
|
74
81
|
/**
|
|
75
|
-
*
|
|
82
|
+
* Wait for a node to be added to the graph.
|
|
83
|
+
*
|
|
84
|
+
* If the node is already present in the graph, the promise resolves immediately.
|
|
85
|
+
*
|
|
86
|
+
* @param id The id of the node to wait for.
|
|
87
|
+
* @param timeout The time in milliseconds to wait for the node to be added.
|
|
76
88
|
*/
|
|
77
|
-
|
|
89
|
+
waitForNode(id: string, timeout?: number): Promise<Node>;
|
|
78
90
|
/**
|
|
79
|
-
*
|
|
91
|
+
* Nodes that this node is connected to in default order.
|
|
80
92
|
*/
|
|
81
|
-
|
|
93
|
+
nodes<T = any, U extends Record<string, any> = Record<string, any>>(node: Node, options?: NodesOptions<T, U>): Readonly<{
|
|
94
|
+
id: string;
|
|
95
|
+
type: string;
|
|
96
|
+
cacheable?: string[];
|
|
97
|
+
properties: Readonly<Record<string, any>>;
|
|
98
|
+
data: any;
|
|
99
|
+
}>[];
|
|
82
100
|
/**
|
|
83
|
-
*
|
|
101
|
+
* Edges that this node is connected to in default order.
|
|
84
102
|
*/
|
|
85
|
-
|
|
103
|
+
edges(node: Node, { relation }?: {
|
|
104
|
+
relation?: Relation;
|
|
105
|
+
}): string[];
|
|
86
106
|
/**
|
|
87
|
-
*
|
|
107
|
+
* Actions or action groups that this node is connected to in default order.
|
|
88
108
|
*/
|
|
89
|
-
|
|
109
|
+
actions(node: Node, { expansion }?: {
|
|
110
|
+
expansion?: boolean;
|
|
111
|
+
}): Readonly<{
|
|
112
|
+
id: string;
|
|
113
|
+
type: string;
|
|
114
|
+
cacheable?: string[];
|
|
115
|
+
properties: Readonly<Record<string, any>>;
|
|
116
|
+
data: any;
|
|
117
|
+
}>[];
|
|
118
|
+
expand(node: Node, relation?: Relation, type?: string): Promise<void>;
|
|
119
|
+
private _key;
|
|
90
120
|
/**
|
|
91
|
-
*
|
|
121
|
+
* Recursive depth-first traversal of the graph.
|
|
92
122
|
*
|
|
93
|
-
* @
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Get all nodes connected to the node with the given id by the given relation from the graph's registry.
|
|
98
|
-
*/
|
|
99
|
-
getConnections(id: string, relation?: Relation): Node[];
|
|
100
|
-
/**
|
|
101
|
-
* Get all actions connected to the node with the given id from the graph's registry.
|
|
102
|
-
*/
|
|
103
|
-
getActions(id: string): Node[];
|
|
104
|
-
/**
|
|
105
|
-
* Get the edges from the node with the given id from the graph's registry.
|
|
123
|
+
* @param options.node The node to start traversing from.
|
|
124
|
+
* @param options.relation The relation to traverse graph edges.
|
|
125
|
+
* @param options.visitor A callback which is called for each node visited during traversal.
|
|
106
126
|
*/
|
|
107
|
-
|
|
127
|
+
traverse({ visitor, node, relation, expansion }: GraphTraversalOptions, path?: string[]): void;
|
|
108
128
|
/**
|
|
109
|
-
* Recursive depth-first traversal of the graph.
|
|
129
|
+
* Recursive depth-first traversal of the graph wrapping each visitor call in an effect.
|
|
110
130
|
*
|
|
111
131
|
* @param options.node The node to start traversing from.
|
|
112
132
|
* @param options.relation The relation to traverse graph edges.
|
|
113
133
|
* @param options.visitor A callback which is called for each node visited during traversal.
|
|
114
134
|
*/
|
|
115
|
-
|
|
135
|
+
subscribeTraverse({ visitor, node, relation, expansion }: GraphTraversalOptions, currentPath?: string[]): () => void;
|
|
116
136
|
/**
|
|
117
137
|
* Get the path between two nodes in the graph.
|
|
118
138
|
*/
|
|
119
|
-
getPath(
|
|
139
|
+
getPath({ source, target }: {
|
|
120
140
|
source?: string;
|
|
121
141
|
target: string;
|
|
122
|
-
}):
|
|
142
|
+
}): string[] | undefined;
|
|
123
143
|
/**
|
|
124
144
|
* Wait for the path between two nodes in the graph to be established.
|
|
125
145
|
*/
|
|
126
146
|
waitForPath(params: {
|
|
127
147
|
source?: string;
|
|
128
148
|
target: string;
|
|
129
|
-
},
|
|
149
|
+
}, { timeout, interval }?: {
|
|
130
150
|
timeout?: number;
|
|
131
151
|
interval?: number;
|
|
132
152
|
}): Promise<string[]>;
|
|
133
|
-
|
|
134
|
-
|
|
153
|
+
private _addNode;
|
|
154
|
+
private _removeNode;
|
|
155
|
+
private _addEdge;
|
|
156
|
+
private _removeEdge;
|
|
135
157
|
/**
|
|
136
|
-
*
|
|
158
|
+
* Sort edges for a node.
|
|
137
159
|
*
|
|
138
|
-
*
|
|
139
|
-
*/
|
|
140
|
-
/**
|
|
141
|
-
* Expand a node in the graph.
|
|
160
|
+
* Edges not included in the sorted list are appended to the end of the list.
|
|
142
161
|
*
|
|
143
|
-
*
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
export interface WritableGraph extends ExpandableGraph {
|
|
152
|
-
/**
|
|
153
|
-
* Add nodes to the graph.
|
|
154
|
-
*/
|
|
155
|
-
addNodes(nodes: NodeArg<any, Record<string, any>>[]): void;
|
|
156
|
-
/**
|
|
157
|
-
* Add a node to the graph.
|
|
158
|
-
*/
|
|
159
|
-
addNode(node: NodeArg<any, Record<string, any>>): void;
|
|
160
|
-
/**
|
|
161
|
-
* Remove nodes from the graph.
|
|
162
|
-
*/
|
|
163
|
-
removeNodes(ids: string[], edges?: boolean): void;
|
|
164
|
-
/**
|
|
165
|
-
* Remove a node from the graph.
|
|
166
|
-
*/
|
|
167
|
-
removeNode(id: string, edges?: boolean): void;
|
|
168
|
-
/**
|
|
169
|
-
* Add edges to the graph.
|
|
170
|
-
*/
|
|
171
|
-
addEdges(edges: Edge[]): void;
|
|
172
|
-
/**
|
|
173
|
-
* Add an edge to the graph.
|
|
174
|
-
*/
|
|
175
|
-
addEdge(edge: Edge): void;
|
|
176
|
-
/**
|
|
177
|
-
* Remove edges from the graph.
|
|
178
|
-
*/
|
|
179
|
-
removeEdges(edges: Edge[], removeOrphans?: boolean): void;
|
|
180
|
-
/**
|
|
181
|
-
* Remove an edge from the graph.
|
|
182
|
-
*/
|
|
183
|
-
removeEdge(edge: Edge, removeOrphans?: boolean): void;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* The Graph represents the user interface information architecture of the application constructed via plugins.
|
|
187
|
-
*/
|
|
188
|
-
export declare class Graph implements WritableGraph {
|
|
189
|
-
readonly onNodeChanged: Event<{
|
|
190
|
-
id: string;
|
|
191
|
-
node: Option.Option<Node>;
|
|
192
|
-
}>;
|
|
193
|
-
private readonly _onExpand?;
|
|
194
|
-
private readonly _onRemoveNode?;
|
|
195
|
-
private readonly _registry;
|
|
196
|
-
private readonly _expanded;
|
|
197
|
-
private readonly _initialized;
|
|
198
|
-
private readonly _initialEdges;
|
|
199
|
-
private readonly _initialNodes;
|
|
200
|
-
private readonly _nodeOrThrow;
|
|
201
|
-
private readonly _edges;
|
|
202
|
-
private readonly _connections;
|
|
203
|
-
private readonly _actions;
|
|
204
|
-
private readonly _json;
|
|
205
|
-
constructor({ registry, nodes, edges, onExpand, onRemoveNode }?: GraphParams);
|
|
206
|
-
toJSON(id?: string): any;
|
|
207
|
-
json(id?: string): Rx.Rx<any>;
|
|
208
|
-
node(id: string): Rx.Rx<Option.Option<Node>>;
|
|
209
|
-
nodeOrThrow(id: string): Rx.Rx<Node>;
|
|
210
|
-
connections(id: string, relation?: Relation): Rx.Rx<Node[]>;
|
|
211
|
-
actions(id: string): Rx.Rx<(Readonly<Omit<Readonly<{
|
|
212
|
-
id: string;
|
|
213
|
-
type: string;
|
|
214
|
-
cacheable?: string[];
|
|
215
|
-
properties: Readonly<Record<string, any>>;
|
|
216
|
-
data: import("./node").ActionData;
|
|
217
|
-
}>, "properties"> & {
|
|
218
|
-
properties: Readonly<Record<string, any>>;
|
|
219
|
-
}> | Readonly<Omit<Readonly<{
|
|
220
|
-
id: string;
|
|
221
|
-
type: string;
|
|
222
|
-
cacheable?: string[];
|
|
223
|
-
properties: Readonly<Record<string, any>>;
|
|
224
|
-
data: typeof import("./node").actionGroupSymbol;
|
|
225
|
-
}>, "properties"> & {
|
|
226
|
-
properties: Readonly<Record<string, any>>;
|
|
227
|
-
}>)[]>;
|
|
228
|
-
edges(id: string): Rx.Rx<Edges>;
|
|
229
|
-
get root(): Readonly<{
|
|
230
|
-
id: string;
|
|
231
|
-
type: string;
|
|
232
|
-
cacheable?: string[];
|
|
233
|
-
properties: Readonly<Record<string, any>>;
|
|
234
|
-
data: any;
|
|
235
|
-
}>;
|
|
236
|
-
getNode(id: string): Option.Option<Node>;
|
|
237
|
-
getNodeOrThrow(id: string): Node;
|
|
238
|
-
getConnections(id: string, relation?: Relation): Node[];
|
|
239
|
-
getActions(id: string): Node[];
|
|
240
|
-
getEdges(id: string): Edges;
|
|
241
|
-
expand(id: string, relation?: Relation): void;
|
|
242
|
-
addNodes(nodes: NodeArg<any, Record<string, any>>[]): void;
|
|
243
|
-
addNode({ nodes, edges, ...nodeArg }: NodeArg<any, Record<string, any>>): void;
|
|
244
|
-
removeNodes(ids: string[], edges?: boolean): void;
|
|
245
|
-
removeNode(id: string, edges?: boolean): void;
|
|
246
|
-
addEdges(edges: Edge[]): void;
|
|
247
|
-
addEdge(edgeArg: Edge): void;
|
|
248
|
-
removeEdges(edges: Edge[], removeOrphans?: boolean): void;
|
|
249
|
-
removeEdge(edgeArg: Edge, removeOrphans?: boolean): void;
|
|
250
|
-
sortEdges(id: string, relation: Relation, order: string[]): void;
|
|
251
|
-
traverse({ visitor, source, relation }: GraphTraversalOptions, path?: string[]): void;
|
|
252
|
-
getPath({ source, target }: {
|
|
253
|
-
source?: string;
|
|
254
|
-
target: string;
|
|
255
|
-
}): Option.Option<string[]>;
|
|
256
|
-
waitForPath(params: {
|
|
257
|
-
source?: string;
|
|
258
|
-
target: string;
|
|
259
|
-
}, { timeout, interval }?: {
|
|
260
|
-
timeout?: number;
|
|
261
|
-
interval?: number;
|
|
262
|
-
}): Promise<string[]>;
|
|
162
|
+
* @param nodeId The id of the node to sort edges for.
|
|
163
|
+
* @param relation The relation of the edges from the node to sort.
|
|
164
|
+
* @param edges The ordered list of edges.
|
|
165
|
+
* @ignore
|
|
166
|
+
*/
|
|
167
|
+
_sortEdges(nodeId: string, relation: Relation, edges: string[]): void;
|
|
168
|
+
private _constructNode;
|
|
169
|
+
private _getNodes;
|
|
263
170
|
}
|
|
264
171
|
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/graph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/graph.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,KAAK,IAAI,EAAgB,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAmC,MAAM,QAAQ,CAAC;AAMlH,eAAO,MAAM,QAAQ,SAAU,IAAI,KAAG,KAIrC,CAAC;AAEF,eAAO,MAAM,OAAO,SAAS,CAAC;AAC9B,eAAO,MAAM,SAAS,4BAA4B,CAAC;AACnD,eAAO,MAAM,WAAW,8BAA8B,CAAC;AACvD,eAAO,MAAM,iBAAiB,mCAAmC,CAAC;AAElE,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;IACvF,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAKF,MAAM,MAAM,qBAAq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O,CAAC,EAAE,MAAe,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,EAAE,GAAG,SAAS;IAuB/F;;OAEG;IACG,WAAW,CACf,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAC3C,EAAE,OAAe,EAAE,QAAc,EAAE,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO;IA6BnF,OAAO,CAAC,QAAQ;IAgEhB,OAAO,CAAC,WAAW;IAwCnB,OAAO,CAAC,QAAQ;IA6BhB,OAAO,CAAC,WAAW;IAiCnB;;;;;;;;;OASG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;IAa9D,OAAO,CAAC,cAAc,CAEpB;IAEF,OAAO,CAAC,SAAS;CAyBlB"}
|
package/dist/types/src/node.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type Node<TData = any, TProperties extends Record<string, any> = Record<s
|
|
|
26
26
|
*/
|
|
27
27
|
data: TData;
|
|
28
28
|
}>;
|
|
29
|
-
export type NodeFilter<
|
|
29
|
+
export type NodeFilter<T = any, U extends Record<string, any> = Record<string, any>> = (node: Node<unknown, Record<string, any>>, connectedNode: Node) => node is Node<T, U>;
|
|
30
30
|
export type Relation = 'outbound' | 'inbound';
|
|
31
31
|
export declare const isGraphNode: (data: unknown) => data is Node;
|
|
32
32
|
export type NodeArg<TData, TProperties extends Record<string, any> = Record<string, any>> = MakeOptional<Node<TData, TProperties>, 'data' | 'properties' | 'cacheable'> & {
|
|
@@ -37,10 +37,10 @@ export type NodeArg<TData, TProperties extends Record<string, any> = Record<stri
|
|
|
37
37
|
};
|
|
38
38
|
export type InvokeParams = {
|
|
39
39
|
/** Node the invoked action is connected to. */
|
|
40
|
-
|
|
40
|
+
node: Node;
|
|
41
41
|
caller?: string;
|
|
42
42
|
};
|
|
43
|
-
export type ActionData = (params
|
|
43
|
+
export type ActionData = (params: InvokeParams) => MaybePromise<void>;
|
|
44
44
|
export type Action<TProperties extends Record<string, any> = Record<string, any>> = Readonly<Omit<Node<ActionData, TProperties>, 'properties'> & {
|
|
45
45
|
properties: Readonly<TProperties>;
|
|
46
46
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAElE;;GAEG;AAGH,MAAM,MAAM,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,QAAQ,CAAC;IACtG;;OAEG;IAEH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAElC;;OAEG;IAGH,IAAI,EAAE,KAAK,CAAC;CACb,CAAC,CAAC;AAEH,MAAM,MAAM,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAElE;;GAEG;AAGH,MAAM,MAAM,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAA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E,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;AAEtE,MAAM,MAAM,MAAM,CAAC,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,QAAQ,CAC1F,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,YAAY,CAAC,GAAG;IAClD,UAAU,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;CACnC,CACF,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,OAAO,KAAG,IAAI,IAAI,MACY,CAAC;AAE9D,eAAO,MAAM,iBAAiB,eAAwB,CAAC;AAEvD,MAAM,MAAM,WAAW,CAAC,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,QAAQ,CAC/F,IAAI,CAAC,IAAI,CAAC,OAAO,iBAAiB,EAAE,WAAW,CAAC,EAAE,YAAY,CAAC,GAAG;IAChE,UAAU,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;CACnC,CACF,CAAC;AAEF,eAAO,MAAM,aAAa,SAAU,OAAO,KAAG,IAAI,IAAI,WACO,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;AAE9C,eAAO,MAAM,YAAY,SAAU,OAAO,KAAG,IAAI,IAAI,MAAM,GAAG,WAAoD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EchoGraph.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/EchoGraph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"EchoGraph.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/EchoGraph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAA8B,MAAM,OAAO,CAAC;;;;;;AAoPnD,wBAaE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-graph",
|
|
3
|
-
"version": "0.8.2-
|
|
3
|
+
"version": "0.8.2-staging.7ac8446",
|
|
4
4
|
"description": "Constructs knowledge graphs for the purpose of building applications on top of",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -26,41 +26,34 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@preact/signals-core": "^1.6.0",
|
|
28
28
|
"main-thread-scheduling": "^14.1.1",
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/echo-schema": "0.8.2-
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/util": "0.8.2-
|
|
29
|
+
"@dxos/debug": "0.8.2-staging.7ac8446",
|
|
30
|
+
"@dxos/async": "0.8.2-staging.7ac8446",
|
|
31
|
+
"@dxos/echo-schema": "0.8.2-staging.7ac8446",
|
|
32
|
+
"@dxos/echo-signals": "0.8.2-staging.7ac8446",
|
|
33
|
+
"@dxos/invariant": "0.8.2-staging.7ac8446",
|
|
34
|
+
"@dxos/log": "0.8.2-staging.7ac8446",
|
|
35
|
+
"@dxos/live-object": "0.8.2-staging.7ac8446",
|
|
36
|
+
"@dxos/util": "0.8.2-staging.7ac8446"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@effect-rx/rx-react": "^0.34.1",
|
|
40
|
-
"@effect/platform": "0.80.12",
|
|
41
39
|
"@phosphor-icons/react": "^2.1.5",
|
|
42
40
|
"@types/react": "~18.2.0",
|
|
43
41
|
"@types/react-dom": "~18.2.0",
|
|
44
|
-
"effect": "3.14.21",
|
|
45
42
|
"react": "~18.2.0",
|
|
46
43
|
"react-dom": "~18.2.0",
|
|
47
44
|
"vite": "5.4.7",
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/react-ui": "0.8.2-
|
|
51
|
-
"@dxos/react-
|
|
52
|
-
"@dxos/storybook-utils": "0.8.2-
|
|
53
|
-
"@dxos/react-ui-theme": "0.8.2-main.fbd8ed0"
|
|
45
|
+
"@dxos/random": "0.8.2-staging.7ac8446",
|
|
46
|
+
"@dxos/react-client": "0.8.2-staging.7ac8446",
|
|
47
|
+
"@dxos/react-ui": "0.8.2-staging.7ac8446",
|
|
48
|
+
"@dxos/react-ui-theme": "0.8.2-staging.7ac8446",
|
|
49
|
+
"@dxos/storybook-utils": "0.8.2-staging.7ac8446"
|
|
54
50
|
},
|
|
55
51
|
"peerDependencies": {
|
|
56
|
-
"@effect-rx/rx-react": "^0.34.1",
|
|
57
|
-
"@effect/platform": "0.80.12",
|
|
58
52
|
"@phosphor-icons/react": "^2.1.5",
|
|
59
|
-
"effect": "3.14.21",
|
|
60
53
|
"react": "~18.2.0",
|
|
61
54
|
"react-dom": "~18.2.0",
|
|
62
|
-
"@dxos/react-ui": "0.8.2-
|
|
63
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
55
|
+
"@dxos/react-ui": "0.8.2-staging.7ac8446",
|
|
56
|
+
"@dxos/react-ui-theme": "0.8.2-staging.7ac8446"
|
|
64
57
|
},
|
|
65
58
|
"publishConfig": {
|
|
66
59
|
"access": "public"
|