@dxos/app-graph 0.8.4-main.84f28bd → 0.8.4-main.b97322e
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 +2 -2
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +2 -2
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- 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 +22 -24
- package/src/node.ts +4 -2
- package/src/stories/EchoGraph.stories.tsx +8 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-graph",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.b97322e",
|
|
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,44 +26,42 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@preact/signals-core": "^1.9.0",
|
|
28
28
|
"main-thread-scheduling": "^14.1.1",
|
|
29
|
-
"@dxos/async": "0.8.4-main.
|
|
30
|
-
"@dxos/debug": "0.8.4-main.
|
|
31
|
-
"@dxos/echo": "0.8.4-main.
|
|
32
|
-
"@dxos/echo-
|
|
33
|
-
"@dxos/echo-
|
|
34
|
-
"@dxos/invariant": "0.8.4-main.
|
|
35
|
-
"@dxos/live-object": "0.8.4-main.
|
|
36
|
-
"@dxos/log": "0.8.4-main.
|
|
37
|
-
"@dxos/util": "0.8.4-main.
|
|
29
|
+
"@dxos/async": "0.8.4-main.b97322e",
|
|
30
|
+
"@dxos/debug": "0.8.4-main.b97322e",
|
|
31
|
+
"@dxos/echo": "0.8.4-main.b97322e",
|
|
32
|
+
"@dxos/echo-schema": "0.8.4-main.b97322e",
|
|
33
|
+
"@dxos/echo-signals": "0.8.4-main.b97322e",
|
|
34
|
+
"@dxos/invariant": "0.8.4-main.b97322e",
|
|
35
|
+
"@dxos/live-object": "0.8.4-main.b97322e",
|
|
36
|
+
"@dxos/log": "0.8.4-main.b97322e",
|
|
37
|
+
"@dxos/util": "0.8.4-main.b97322e"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@effect-rx/rx-react": "0.38.0",
|
|
41
|
-
"@effect/platform": "0.
|
|
42
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
41
|
+
"@effect/platform": "0.89.0",
|
|
43
42
|
"@types/react": "~18.2.0",
|
|
44
43
|
"@types/react-dom": "~18.2.0",
|
|
45
|
-
"effect": "3.
|
|
44
|
+
"effect": "3.17.0",
|
|
46
45
|
"react": "~18.2.0",
|
|
47
46
|
"react-dom": "~18.2.0",
|
|
48
47
|
"vite": "5.4.7",
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-
|
|
52
|
-
"@dxos/react-
|
|
53
|
-
"@dxos/react-ui-list": "0.8.4-main.
|
|
54
|
-
"@dxos/react-ui-tabs": "0.8.4-main.
|
|
55
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
56
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
48
|
+
"@dxos/random": "0.8.4-main.b97322e",
|
|
49
|
+
"@dxos/echo-db": "0.8.4-main.b97322e",
|
|
50
|
+
"@dxos/react-ui": "0.8.4-main.b97322e",
|
|
51
|
+
"@dxos/react-client": "0.8.4-main.b97322e",
|
|
52
|
+
"@dxos/react-ui-list": "0.8.4-main.b97322e",
|
|
53
|
+
"@dxos/react-ui-tabs": "0.8.4-main.b97322e",
|
|
54
|
+
"@dxos/storybook-utils": "0.8.4-main.b97322e",
|
|
55
|
+
"@dxos/react-ui-theme": "0.8.4-main.b97322e"
|
|
57
56
|
},
|
|
58
57
|
"peerDependencies": {
|
|
59
58
|
"@effect-rx/rx-react": "^0.34.1",
|
|
60
59
|
"@effect/platform": "^0.80.12",
|
|
61
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
62
60
|
"effect": "3.14.21",
|
|
63
61
|
"react": "~18.2.0",
|
|
64
62
|
"react-dom": "~18.2.0",
|
|
65
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
66
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
63
|
+
"@dxos/react-ui": "0.8.4-main.b97322e",
|
|
64
|
+
"@dxos/react-ui-theme": "0.8.4-main.b97322e"
|
|
67
65
|
},
|
|
68
66
|
"publishConfig": {
|
|
69
67
|
"access": "public"
|
package/src/node.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { type MaybePromise, type MakeOptional } from '@dxos/util';
|
|
6
6
|
|
|
7
|
+
import { ACTION_GROUP_TYPE, ACTION_TYPE } from './graph';
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
10
|
* Represents a node in the graph.
|
|
9
11
|
*/
|
|
@@ -84,7 +86,7 @@ export type Action<TProperties extends Record<string, any> = Record<string, any>
|
|
|
84
86
|
>;
|
|
85
87
|
|
|
86
88
|
export const isAction = (data: unknown): data is Action =>
|
|
87
|
-
isGraphNode(data) ? typeof data.data === 'function' : false;
|
|
89
|
+
isGraphNode(data) ? typeof data.data === 'function' && data.type === ACTION_TYPE : false;
|
|
88
90
|
|
|
89
91
|
export const actionGroupSymbol = Symbol('ActionGroup');
|
|
90
92
|
|
|
@@ -95,7 +97,7 @@ export type ActionGroup<TProperties extends Record<string, any> = Record<string,
|
|
|
95
97
|
>;
|
|
96
98
|
|
|
97
99
|
export const isActionGroup = (data: unknown): data is ActionGroup =>
|
|
98
|
-
isGraphNode(data) ? data.data === actionGroupSymbol : false;
|
|
100
|
+
isGraphNode(data) ? data.data === actionGroupSymbol && data.type === ACTION_GROUP_TYPE : false;
|
|
99
101
|
|
|
100
102
|
export type ActionLike = Action | ActionGroup;
|
|
101
103
|
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
7
|
import { type Registry, RegistryContext, Rx, useRxValue } from '@effect-rx/rx-react';
|
|
8
|
-
import { Pause, Play, Plus, Timer } from '@phosphor-icons/react';
|
|
9
8
|
import { type Meta } from '@storybook/react-vite';
|
|
10
9
|
import { Option, pipe } from 'effect';
|
|
11
10
|
import React, { type PropsWithChildren, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
@@ -25,7 +24,7 @@ import { Obj, Type } from '@dxos/echo';
|
|
|
25
24
|
import { faker } from '@dxos/random';
|
|
26
25
|
import { type Client, useClient } from '@dxos/react-client';
|
|
27
26
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
28
|
-
import {
|
|
27
|
+
import { Input, Select, Icon, IconButton } from '@dxos/react-ui';
|
|
29
28
|
import { Path, Tree } from '@dxos/react-ui-list';
|
|
30
29
|
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
31
30
|
import { withTheme } from '@dxos/storybook-utils';
|
|
@@ -205,7 +204,11 @@ const Controls = ({ children }: PropsWithChildren) => {
|
|
|
205
204
|
return (
|
|
206
205
|
<>
|
|
207
206
|
<div className='flex shrink-0 p-2 space-x-2'>
|
|
208
|
-
<
|
|
207
|
+
<IconButton
|
|
208
|
+
icon={generating ? 'ph--pause--regular' : 'ph--play--regular'}
|
|
209
|
+
label={generating ? 'Pause' : 'Play'}
|
|
210
|
+
onClick={() => setGenerating((generating) => !generating)}
|
|
211
|
+
/>
|
|
209
212
|
<div className='relative' title='mutation period'>
|
|
210
213
|
<Input.Root>
|
|
211
214
|
<Input.TextInput
|
|
@@ -217,11 +220,9 @@ const Controls = ({ children }: PropsWithChildren) => {
|
|
|
217
220
|
onChange={({ target: { value } }) => setActionInterval(value)}
|
|
218
221
|
/>
|
|
219
222
|
</Input.Root>
|
|
220
|
-
<
|
|
223
|
+
<Icon icon='ph--timer--regular' classNames={mx('absolute inline-end-1 block-start-1 mt-[6px]', getSize(3))} />
|
|
221
224
|
</div>
|
|
222
|
-
<
|
|
223
|
-
<Plus />
|
|
224
|
-
</Button>
|
|
225
|
+
<IconButton icon='ph--plus--regular' label='Add' onClick={() => action && runAction(client, action)} />
|
|
225
226
|
<Select.Root value={action?.toString()} onValueChange={(action) => setAction(action as unknown as Action)}>
|
|
226
227
|
<Select.TriggerButton placeholder='Select value' />
|
|
227
228
|
<Select.Portal>
|