@rkmodules/rules 0.0.167 → 0.0.169

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 CHANGED
@@ -2622,8 +2622,16 @@ var objectEntries = {
2622
2622
  var keys, values;
2623
2623
  var _c = _b.object, object = _c === void 0 ? {} : _c;
2624
2624
  return __generator(this, function (_d) {
2625
- keys = mapTree(object, function (obj) { return Object.keys(obj); });
2626
- values = mapTree(object, function (obj) { return Object.values(obj); });
2625
+ keys = mapTree(object, function (obj) {
2626
+ if (!obj)
2627
+ return DISCARD;
2628
+ return Object.keys(obj);
2629
+ });
2630
+ values = mapTree(object, function (obj) {
2631
+ if (!obj)
2632
+ return DISCARD;
2633
+ return Object.values(obj);
2634
+ });
2627
2635
  return [2 /*return*/, {
2628
2636
  keys: keys,
2629
2637
  values: values,
@@ -3555,7 +3563,8 @@ var Engine = /** @class */ (function () {
3555
3563
  // get inputs defaults
3556
3564
  var fn = this.fnIndex[nodeName];
3557
3565
  if (!fn) {
3558
- throw new Error("Function ".concat(nodeName, " not found in index. Use engine.build() to add custom functions."));
3566
+ console.warn("Function ".concat(nodeName, " not found in index. Use engine.build() to add custom functions."));
3567
+ return oldFn;
3559
3568
  }
3560
3569
  var inputs = {};
3561
3570
  Object.entries(fn.inputs || {}).forEach(function (_a) {
@@ -7108,6 +7117,7 @@ OutputNode.displayName = "OutputNode";
7108
7117
 
7109
7118
  var DynamicOutput = React.memo(function (_a) {
7110
7119
  var id = _a.id, data = _a.data, selected = _a.selected;
7120
+ var updateNodeInternals = react.useUpdateNodeInternals();
7111
7121
  var outputDefs = React.useMemo(function () {
7112
7122
  var outputDefs = __assign({}, (data.outputDefs || {}));
7113
7123
  Object.keys(data.outputs || {}).forEach(function (key) {
@@ -7127,6 +7137,7 @@ var DynamicOutput = React.memo(function (_a) {
7127
7137
  name,
7128
7138
  { type: "any", label: name },
7129
7139
  ]; })), outputDefs));
7140
+ updateNodeInternals(id);
7130
7141
  }
7131
7142
  });
7132
7143
  }, [outputDefs]);
@@ -7280,29 +7291,8 @@ var styles = {
7280
7291
  },
7281
7292
  };
7282
7293
  var Default = React.memo(function (_a) {
7283
- var _b, _c;
7284
7294
  var props = __rest(_a, []);
7285
7295
  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
- }
7306
7296
  if (props.sourceHandleId) {
7307
7297
  var field = deRefEdgeHandle(props.sourceHandleId).field;
7308
7298
  var value = data[field];