@dxos/app-graph 0.8.1 → 0.8.2-main.2f9c567
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 +8 -8
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +6 -6
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +8 -8
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/graph-builder.d.ts.map +1 -1
- package/dist/types/src/graph.d.ts +3 -3
- package/dist/types/src/graph.d.ts.map +1 -1
- package/dist/types/src/node.d.ts +1 -1
- package/dist/types/src/node.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/graph-builder.ts +2 -2
- package/src/graph.ts +14 -11
- package/src/node.ts +2 -2
- package/src/stories/EchoGraph.stories.tsx +4 -4
package/src/node.ts
CHANGED
|
@@ -41,10 +41,10 @@ export type Node<TData = any, TProperties extends Record<string, any> = Record<s
|
|
|
41
41
|
data: TData;
|
|
42
42
|
}>;
|
|
43
43
|
|
|
44
|
-
export type NodeFilter<
|
|
44
|
+
export type NodeFilter<TData = any, TProperties extends Record<string, any> = Record<string, any>> = (
|
|
45
45
|
node: Node<unknown, Record<string, any>>,
|
|
46
46
|
connectedNode: Node,
|
|
47
|
-
) => node is Node<
|
|
47
|
+
) => node is Node<TData, TProperties>;
|
|
48
48
|
|
|
49
49
|
export type Relation = 'outbound' | 'inbound';
|
|
50
50
|
|
|
@@ -8,16 +8,16 @@ import { Pause, Play, Plus, Timer } from '@phosphor-icons/react';
|
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
live,
|
|
12
12
|
isSpace,
|
|
13
13
|
type Echo,
|
|
14
14
|
type FilterSource,
|
|
15
|
-
type ReactiveEchoObject,
|
|
16
15
|
type Space,
|
|
17
16
|
SpaceState,
|
|
18
17
|
type QueryOptions,
|
|
19
18
|
type Query,
|
|
20
19
|
} from '@dxos/client/echo';
|
|
20
|
+
import type { BaseObject } from '@dxos/echo-schema';
|
|
21
21
|
import { faker } from '@dxos/random';
|
|
22
22
|
import { type Client, useClient } from '@dxos/react-client';
|
|
23
23
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
@@ -54,7 +54,7 @@ const actionWeights = {
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
// TODO(wittjosiah): Factor out.
|
|
57
|
-
const memoizeQuery = <T extends
|
|
57
|
+
const memoizeQuery = <T extends BaseObject>(
|
|
58
58
|
spaceOrEcho?: Space | Echo,
|
|
59
59
|
filter?: FilterSource<T>,
|
|
60
60
|
options?: QueryOptions,
|
|
@@ -160,7 +160,7 @@ const runAction = async (client: Client, action: Action) => {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
case Action.ADD_OBJECT:
|
|
163
|
-
getRandomSpace(client)?.db.add(
|
|
163
|
+
getRandomSpace(client)?.db.add(live({ type: 'test', name: faker.commerce.productName() }));
|
|
164
164
|
break;
|
|
165
165
|
|
|
166
166
|
case Action.REMOVE_OBJECT: {
|