@rkmodules/rules 0.0.166 → 0.0.167
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/index.cjs.js +22 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +22 -2
- package/dist/index.esm.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7118,7 +7118,6 @@ var DynamicOutput = React.memo(function (_a) {
|
|
|
7118
7118
|
return outputDefs;
|
|
7119
7119
|
}, [data.outputDefs, data.outputs]);
|
|
7120
7120
|
var _b = __read(React.useState({}), 2), outputs = _b[0], setOutputs = _b[1];
|
|
7121
|
-
// console.log(id, outputs, data.outputs, data.outputDefs, outputDefs);
|
|
7122
7121
|
var engine = useEngine();
|
|
7123
7122
|
React.useEffect(function () {
|
|
7124
7123
|
return engine.subscribe("functionResult", function (event) {
|
|
@@ -7131,7 +7130,7 @@ var DynamicOutput = React.memo(function (_a) {
|
|
|
7131
7130
|
}
|
|
7132
7131
|
});
|
|
7133
7132
|
}, [outputDefs]);
|
|
7134
|
-
return (React.createElement(GenericNode, { outputs: outputs, id: id, data: data, selected: selected }
|
|
7133
|
+
return (React.createElement(GenericNode, { outputs: outputs, id: id, data: data, selected: selected }));
|
|
7135
7134
|
});
|
|
7136
7135
|
DynamicOutput.displayName = "DynamicOutputNode";
|
|
7137
7136
|
|
|
@@ -7281,8 +7280,29 @@ var styles = {
|
|
|
7281
7280
|
},
|
|
7282
7281
|
};
|
|
7283
7282
|
var Default = React.memo(function (_a) {
|
|
7283
|
+
var _b, _c;
|
|
7284
7284
|
var props = __rest(_a, []);
|
|
7285
7285
|
var data = useNodeResult(props.source);
|
|
7286
|
+
var flow = react.useReactFlow();
|
|
7287
|
+
var src = flow.getInternalNode(props.source);
|
|
7288
|
+
if ((src === null || src === void 0 ? void 0 : src.type) === "DynamicOutput") {
|
|
7289
|
+
/**
|
|
7290
|
+
* fix for dynamic output nodes. As connection order can change,
|
|
7291
|
+
* the position of the handles is not updated internally with react-flow
|
|
7292
|
+
* so we need to get the position of the handle and update the
|
|
7293
|
+
* source position manually.
|
|
7294
|
+
*/
|
|
7295
|
+
var el = document.querySelector("[data-handleid=\"".concat(props.sourceHandleId, "\"]"));
|
|
7296
|
+
var bbox = el === null || el === void 0 ? void 0 : el.getBoundingClientRect();
|
|
7297
|
+
if (bbox) {
|
|
7298
|
+
var pos = flow.screenToFlowPosition({
|
|
7299
|
+
x: (bbox === null || bbox === void 0 ? void 0 : bbox.x) + (bbox === null || bbox === void 0 ? void 0 : bbox.width),
|
|
7300
|
+
y: (bbox === null || bbox === void 0 ? void 0 : bbox.y) + (bbox === null || bbox === void 0 ? void 0 : bbox.height) / 2,
|
|
7301
|
+
});
|
|
7302
|
+
props.sourceX = (_b = pos === null || pos === void 0 ? void 0 : pos.x) !== null && _b !== void 0 ? _b : props.sourceX;
|
|
7303
|
+
props.sourceY = (_c = pos === null || pos === void 0 ? void 0 : pos.y) !== null && _c !== void 0 ? _c : props.sourceY;
|
|
7304
|
+
}
|
|
7305
|
+
}
|
|
7286
7306
|
if (props.sourceHandleId) {
|
|
7287
7307
|
var field = deRefEdgeHandle(props.sourceHandleId).field;
|
|
7288
7308
|
var value = data[field];
|