@rkmodules/rules 0.0.119 → 0.0.121

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
@@ -5754,11 +5754,11 @@ var InputText = React.memo(function (_a) {
5754
5754
  });
5755
5755
  function Control(_a) {
5756
5756
  var _b;
5757
- var value = _a.value, vardef = _a.vardef, onChange = _a.onChange;
5757
+ var value = _a.value, vardef = _a.vardef, data = _a.data, onChange = _a.onChange;
5758
5758
  var customControls = useControls();
5759
5759
  if (vardef.type in customControls) {
5760
5760
  var ControlComponent = customControls[vardef.type];
5761
- return (React.createElement(ControlComponent, { value: value, vardef: vardef, onChange: onChange }));
5761
+ return (React.createElement(ControlComponent, { value: value, vardef: vardef, onChange: onChange, data: data }));
5762
5762
  }
5763
5763
  if (vardef.options) {
5764
5764
  return (React.createElement("select", { value: value || "", onChange: function (e) { return onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value); } }, vardef.options.map(function (option) { return (React.createElement("option", { key: option, value: option }, option)); })));
@@ -5802,7 +5802,7 @@ var Input = function (_a) {
5802
5802
  "--type-color": "var(--color-".concat(normalized.type, ")"),
5803
5803
  }, onClick: onClick },
5804
5804
  React.createElement("span", { className: styles$1.PortLabel }, normalized.label || name),
5805
- !isRef && (React.createElement(Control, { vardef: normalized, value: value, onChange: handleInputChange(name) }))));
5805
+ !isRef && (React.createElement(Control, { vardef: normalized, value: value, onChange: handleInputChange(name), data: data }))));
5806
5806
  };
5807
5807
 
5808
5808
  var Param = function (_a) {
@@ -5821,7 +5821,7 @@ var Param = function (_a) {
5821
5821
  "--type-color": "var(--color-".concat(normalized.type, ")"),
5822
5822
  }, onClick: onClick },
5823
5823
  React.createElement("span", { className: styles$1.PortLabel }, normalized.label || name),
5824
- !isRef && (React.createElement(Control, { vardef: normalized, value: value, onChange: handleParamChange(name) }))));
5824
+ !isRef && (React.createElement(Control, { vardef: normalized, value: value, onChange: handleParamChange(name), data: data }))));
5825
5825
  };
5826
5826
 
5827
5827
  var Output = function (_a) {
@@ -5997,17 +5997,17 @@ function GenericNode(_a) {
5997
5997
  React.createElement("div", { className: styles.Description }, data.description),
5998
5998
  children,
5999
5999
  React.createElement("div", { className: styles.Ports },
6000
- outputEntries.map(function (_a) {
6000
+ outputEntries.map(function (_a, index) {
6001
6001
  var _b = __read(_a, 2), name = _b[0], varDef = _b[1];
6002
- return (React.createElement(Output, { key: name, name: name, varDef: varDef, id: id, onClick: function () { return setFocus(name); }, focus: showPreview && focus === name }));
6002
+ return (React.createElement(Output, { key: "".concat(name, "_").concat(index), name: name, varDef: varDef, id: id, onClick: function () { return setFocus(name); }, focus: showPreview && focus === name }));
6003
6003
  }),
6004
- inputEntries.map(function (_a) {
6004
+ inputEntries.map(function (_a, index) {
6005
6005
  var _b = __read(_a, 2), name = _b[0], varDef = _b[1];
6006
- return (React.createElement(Input, { key: name, name: name, varDef: varDef, id: id, data: data }));
6006
+ return (React.createElement(Input, { key: "".concat(name, "_").concat(index), name: name, varDef: varDef, id: id, data: data }));
6007
6007
  }),
6008
- paramEntries.map(function (_a) {
6008
+ paramEntries.map(function (_a, index) {
6009
6009
  var _b = __read(_a, 2), name = _b[0], varDef = _b[1];
6010
- return (React.createElement(Param, { key: name, name: name, varDef: varDef, id: id, data: data }));
6010
+ return (React.createElement(Param, { key: "".concat(name, "_").concat(index), name: name, varDef: varDef, id: id, data: data }));
6011
6011
  })),
6012
6012
  React.createElement("div", { className: classNames(styles.PreviewHead, (_b = {},
6013
6013
  _b[styles.expanded] = showPreview,
@@ -6623,14 +6623,14 @@ var ConnectionLine = (function (_a) {
6623
6623
  */
6624
6624
  var emptyObject = {};
6625
6625
  function FlowInner(_a) {
6626
- var fn = _a.function, _b = _a.positions, defaultPositions = _b === void 0 ? emptyObject : _b, engine = _a.engine, _c = _a.center, center = _c === void 0 ? true : _c, fitView = _a.fitView, onChange = _a.onChange, onClick = _a.onClick, onSelect = _a.onSelect, onInit = _a.onInit;
6627
- var _d = __read(React.useState(null), 2), instance = _d[0], setInstance = _d[1];
6626
+ var fn = _a.function, _b = _a.positions, defaultPositions = _b === void 0 ? emptyObject : _b, engine = _a.engine, _c = _a.center, center = _c === void 0 ? true : _c, fitView = _a.fitView, _d = _a.customNodes, customNodes = _d === void 0 ? {} : _d, onChange = _a.onChange, onClick = _a.onClick, onSelect = _a.onSelect, onInit = _a.onInit;
6627
+ var _e = __read(React.useState(null), 2), instance = _e[0], setInstance = _e[1];
6628
6628
  var handleInit = function (instance) {
6629
6629
  setInstance(instance);
6630
6630
  onInit === null || onInit === void 0 ? void 0 : onInit(instance);
6631
6631
  };
6632
6632
  var updatePosition = useUpdatePositions(fn);
6633
- var _e = __read(usePositions(fn), 2), positions = _e[0], setPositions = _e[1];
6633
+ var _f = __read(usePositions(fn), 2), positions = _f[0], setPositions = _f[1];
6634
6634
  var options = React.useMemo(function () {
6635
6635
  var handleDataChange = function (id) { return function (newData) {
6636
6636
  onChange === null || onChange === void 0 ? void 0 : onChange(function (fn) {
@@ -6660,7 +6660,7 @@ function FlowInner(_a) {
6660
6660
  React.useEffect(function () {
6661
6661
  setPositions(__assign(__assign({}, positions), defaultPositions));
6662
6662
  }, [defaultPositions]);
6663
- var _f = useFlow(fn, engine, options), nodes = _f.nodes, edges = _f.edges, setNodes = _f.setNodes, setEdges = _f.setEdges;
6663
+ var _g = useFlow(fn, engine, options), nodes = _g.nodes, edges = _g.edges, setNodes = _g.setNodes, setEdges = _g.setEdges;
6664
6664
  // node selection handler
6665
6665
  var handleSelect = React.useCallback(function (_a) {
6666
6666
  var nodes = _a.nodes;
@@ -6670,7 +6670,7 @@ function FlowInner(_a) {
6670
6670
  onChange: handleSelect,
6671
6671
  });
6672
6672
  // dropping nodes
6673
- var _g = __read(useDrop({
6673
+ var _h = __read(useDrop({
6674
6674
  accept: "flow-node",
6675
6675
  drop: function (item, monitor) {
6676
6676
  var pos = monitor.getClientOffset();
@@ -6690,7 +6690,7 @@ function FlowInner(_a) {
6690
6690
  isOver: monitor.isOver(),
6691
6691
  };
6692
6692
  },
6693
- }), 2); _g[0].isOver; var drop = _g[1];
6693
+ }), 2); _h[0].isOver; var drop = _h[1];
6694
6694
  // connecting nodes
6695
6695
  var onConnect = React.useCallback(function (params) {
6696
6696
  var _a, _b;
@@ -6757,7 +6757,7 @@ function FlowInner(_a) {
6757
6757
  return react.applyEdgeChanges(changes, edgesSnapshot);
6758
6758
  });
6759
6759
  }, []);
6760
- return (React.createElement(react.ReactFlow, { ref: drop, nodes: nodes, edges: edges, nodeTypes: nodeTypes, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onNodeDragStop: function (e, n) { return updatePosition(n.id, n.position); }, onConnect: onConnect, onInit: handleInit, onPaneClick: handleClick, fitView: center || fitView, fitViewOptions: {
6760
+ return (React.createElement(react.ReactFlow, { ref: drop, nodes: nodes, edges: edges, nodeTypes: __assign(__assign({}, nodeTypes), customNodes), onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onNodeDragStop: function (e, n) { return updatePosition(n.id, n.position); }, onConnect: onConnect, onInit: handleInit, onPaneClick: handleClick, fitView: center || fitView, fitViewOptions: {
6761
6761
  minZoom: fitView ? undefined : 1,
6762
6762
  maxZoom: fitView ? undefined : 1,
6763
6763
  },