@rkmodules/rules 0.0.166 → 0.0.168

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