@ajuhos/react-flow-chart
Advanced tools
Comparing version 0.0.37 to 0.0.38
{ | ||
"name": "@ajuhos/react-flow-chart", | ||
"version": "0.0.37", | ||
"version": "0.0.38", | ||
"description": "A flexible, stateless flow chart library for react.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -14,3 +14,3 @@ "use strict"; | ||
var zoomScale = React.useContext(CanvasContext_1.default).zoomScale; | ||
var _c = React.useState({ width: 0, height: 0 }), setSize = _c[1]; | ||
var _c = React.useState({ width: 0, height: 0 }), size = _c[0], setSize = _c[1]; | ||
var _d = React.useState({ width: 0, height: 0 }), portsSize = _d[0], setPortsSize = _d[1]; | ||
@@ -53,16 +53,14 @@ var isDragging = React.useRef(false); | ||
var compRef = React.useRef(null); | ||
/* // TODO: probably should add an observer to track node component size changes | ||
React.useLayoutEffect(() => { | ||
const el = compRef.current as HTMLInputElement | ||
// TODO: probably should add an observer to track node component size changes | ||
React.useLayoutEffect(function () { | ||
var el = compRef.current; | ||
if (el) { | ||
if ( | ||
(node.size && node.size.width) !== el.offsetWidth || | ||
(node.size && node.size.height) !== el.offsetHeight | ||
) { | ||
const newSize = { width: el.offsetWidth, height: el.offsetHeight } | ||
setSize(newSize) | ||
onNodeSizeChange({ config, nodeId: node.id, size: newSize }) | ||
} | ||
if ((node.size && node.size.width) !== el.offsetWidth || | ||
(node.size && node.size.height) !== el.offsetHeight) { | ||
var newSize = { width: el.offsetWidth, height: el.offsetHeight }; | ||
setSize(newSize); | ||
onNodeSizeChange({ config: config, nodeId: node.id, size: newSize }); | ||
} | ||
} | ||
}, [node, compRef.current, size.width, size.height])*/ | ||
}, [node, compRef.current, size.width, size.height]); | ||
var children = (React.createElement("div", { style: { minWidth: portsSize.width, minHeight: portsSize.height } }, | ||
@@ -69,0 +67,0 @@ React.createElement(react_resize_observer_1.default, { onResize: function (rect) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
187403
2779