@dxos/react-ui-menu 0.8.4-main.937b3ca → 0.8.4-main.9735255
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 +10 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +10 -5
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/hooks/useMenuActions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/src/hooks/useMenuActions.ts +8 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-menu",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.9735255",
|
|
4
4
|
"description": "Components for facilitating reactive and consistent menus.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@radix-ui/react-context": "1.1.1",
|
|
33
33
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/keyboard": "0.8.4-main.
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/ui-
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/util": "0.8.4-main.
|
|
34
|
+
"@dxos/effect": "0.8.4-main.9735255",
|
|
35
|
+
"@dxos/app-graph": "0.8.4-main.9735255",
|
|
36
|
+
"@dxos/keyboard": "0.8.4-main.9735255",
|
|
37
|
+
"@dxos/invariant": "0.8.4-main.9735255",
|
|
38
|
+
"@dxos/react-ui-attention": "0.8.4-main.9735255",
|
|
39
|
+
"@dxos/ui-types": "0.8.4-main.9735255",
|
|
40
|
+
"@dxos/util": "0.8.4-main.9735255"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@effect-atom/atom-react": "^0.4.6",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"react": "~19.2.3",
|
|
49
49
|
"react-dom": "~19.2.3",
|
|
50
50
|
"vite": "7.1.9",
|
|
51
|
-
"@dxos/random": "0.8.4-main.
|
|
52
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
53
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
54
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
51
|
+
"@dxos/random": "0.8.4-main.9735255",
|
|
52
|
+
"@dxos/react-ui": "0.8.4-main.9735255",
|
|
53
|
+
"@dxos/storybook-utils": "0.8.4-main.9735255",
|
|
54
|
+
"@dxos/ui-theme": "0.8.4-main.9735255"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@effect-atom/atom-react": "^0.4.6",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"effect": "3.19.11",
|
|
60
60
|
"react": "~19.2.3",
|
|
61
61
|
"react-dom": "~19.2.3",
|
|
62
|
-
"@dxos/ui
|
|
63
|
-
"@dxos/
|
|
62
|
+
"@dxos/react-ui": "0.8.4-main.9735255",
|
|
63
|
+
"@dxos/ui-theme": "0.8.4-main.9735255"
|
|
64
64
|
},
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Atom, RegistryContext, useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
-
import { useCallback, useContext, useRef } from 'react';
|
|
6
|
+
import { useCallback, useContext, useEffect, useRef } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Graph, Node } from '@dxos/app-graph';
|
|
9
9
|
|
|
@@ -62,13 +62,14 @@ export const useMenuActions = (props: Atom.Atom<ActionGraphProps>): MenuActions
|
|
|
62
62
|
}
|
|
63
63
|
const graph = graphRef.current;
|
|
64
64
|
|
|
65
|
-
// Update graph nodes
|
|
66
|
-
// Using a ref to track the previous value to detect changes.
|
|
65
|
+
// Update graph nodes when props change (after render completes).
|
|
67
66
|
const prevPropsRef = useRef(menuGraphProps);
|
|
68
|
-
|
|
69
|
-
prevPropsRef.current
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (prevPropsRef.current !== menuGraphProps) {
|
|
69
|
+
prevPropsRef.current = menuGraphProps;
|
|
70
|
+
graph.pipe(Graph.addNodes(menuGraphProps.nodes), Graph.addEdges(menuGraphProps.edges));
|
|
71
|
+
}
|
|
72
|
+
}, [graph, menuGraphProps]);
|
|
72
73
|
|
|
73
74
|
const useGroupItems = useCallback(
|
|
74
75
|
(sourceNode?: MenuItemGroup) => {
|