@rkmodules/rules 0.0.168 → 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,
@@ -7109,6 +7117,7 @@ OutputNode.displayName = "OutputNode";
7109
7117
 
7110
7118
  var DynamicOutput = React.memo(function (_a) {
7111
7119
  var id = _a.id, data = _a.data, selected = _a.selected;
7120
+ var updateNodeInternals = react.useUpdateNodeInternals();
7112
7121
  var outputDefs = React.useMemo(function () {
7113
7122
  var outputDefs = __assign({}, (data.outputDefs || {}));
7114
7123
  Object.keys(data.outputs || {}).forEach(function (key) {
@@ -7128,6 +7137,7 @@ var DynamicOutput = React.memo(function (_a) {
7128
7137
  name,
7129
7138
  { type: "any", label: name },
7130
7139
  ]; })), outputDefs));
7140
+ updateNodeInternals(id);
7131
7141
  }
7132
7142
  });
7133
7143
  }, [outputDefs]);
@@ -7281,29 +7291,8 @@ var styles = {
7281
7291
  },
7282
7292
  };
7283
7293
  var Default = React.memo(function (_a) {
7284
- var _b, _c;
7285
7294
  var props = __rest(_a, []);
7286
7295
  var data = useNodeResult(props.source);
7287
- var flow = react.useReactFlow();
7288
- var src = flow.getInternalNode(props.source);
7289
- if ((src === null || src === void 0 ? void 0 : src.type) === "DynamicOutput") {
7290
- /**
7291
- * fix for dynamic output nodes. As connection order can change,
7292
- * the position of the handles is not updated internally with react-flow
7293
- * so we need to get the position of the handle and update the
7294
- * source position manually.
7295
- */
7296
- var el = document.querySelector("[data-handleid=\"".concat(props.sourceHandleId, "\"]"));
7297
- var bbox = el === null || el === void 0 ? void 0 : el.getBoundingClientRect();
7298
- if (bbox) {
7299
- var pos = flow.screenToFlowPosition({
7300
- x: (bbox === null || bbox === void 0 ? void 0 : bbox.x) + (bbox === null || bbox === void 0 ? void 0 : bbox.width),
7301
- y: (bbox === null || bbox === void 0 ? void 0 : bbox.y) + (bbox === null || bbox === void 0 ? void 0 : bbox.height) / 2,
7302
- });
7303
- props.sourceX = (_b = pos === null || pos === void 0 ? void 0 : pos.x) !== null && _b !== void 0 ? _b : props.sourceX;
7304
- props.sourceY = (_c = pos === null || pos === void 0 ? void 0 : pos.y) !== null && _c !== void 0 ? _c : props.sourceY;
7305
- }
7306
- }
7307
7296
  if (props.sourceHandleId) {
7308
7297
  var field = deRefEdgeHandle(props.sourceHandleId).field;
7309
7298
  var value = data[field];