@xxmachina/components 19.3.2 → 19.4.0
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/fesm2022/xxmachina-components-extras-flow.mjs +9 -1
- package/fesm2022/xxmachina-components-extras-flow.mjs.map +1 -1
- package/fesm2022/xxmachina-components-molecules-weekly-header.mjs +2 -2
- package/fesm2022/xxmachina-components-molecules-weekly-header.mjs.map +1 -1
- package/fesm2022/xxmachina-components-organisms-calendar-section.mjs +2 -2
- package/fesm2022/xxmachina-components-organisms-calendar-section.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-command.mjs +2 -2
- package/fesm2022/xxmachina-components-pages-command.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-query.mjs +2 -2
- package/fesm2022/xxmachina-components-pages-query.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-thread.mjs +2 -2
- package/fesm2022/xxmachina-components-pages-thread.mjs.map +1 -1
- package/fesm2022/xxmachina-components-templates-agent.mjs +2 -2
- package/fesm2022/xxmachina-components-templates-agent.mjs.map +1 -1
- package/fesm2022/xxmachina-components.mjs +2 -2
- package/fesm2022/xxmachina-components.mjs.map +1 -1
- package/package.json +21 -21
|
@@ -7,7 +7,7 @@ import { createRoot } from 'react-dom/client';
|
|
|
7
7
|
import ReactFlow, { ReactFlowProvider, MiniMap, Controls, Background, BackgroundVariant, NodeResizer, Handle, Position } from 'reactflow';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const ReactFlowWrapperComponent = ({ props }) => {
|
|
11
11
|
const minimapStyle = {
|
|
12
12
|
height: 120,
|
|
13
13
|
};
|
|
@@ -20,6 +20,14 @@ const ReactFlowWrapper = ({ props }) => {
|
|
|
20
20
|
};
|
|
21
21
|
return React.createElement(ReactFlowProvider, null, React.createElement(ReactFlow, mergedProps, React.createElement(MiniMap, { style: minimapStyle, zoomable: true, pannable: true }), React.createElement(Controls, null), React.createElement(Background, { variant: BackgroundVariant.Dots, gap: 16, size: 1 })));
|
|
22
22
|
};
|
|
23
|
+
// Memoize ReactFlowWrapper to prevent unnecessary re-renders
|
|
24
|
+
// Only re-render when nodes or edges reference changes
|
|
25
|
+
const ReactFlowWrapper = React.memo(ReactFlowWrapperComponent, (prevProps, nextProps) => {
|
|
26
|
+
// Return true to skip re-render (props are equal)
|
|
27
|
+
// Return false to re-render (props have changed)
|
|
28
|
+
return (prevProps.props.nodes === nextProps.props.nodes &&
|
|
29
|
+
prevProps.props.edges === nextProps.props.edges);
|
|
30
|
+
});
|
|
23
31
|
|
|
24
32
|
class ReactFlowComponentStore {
|
|
25
33
|
constructor() {
|