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