@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.esm.js
CHANGED
|
@@ -5752,11 +5752,11 @@ var InputText = React.memo(function (_a) {
|
|
|
5752
5752
|
});
|
|
5753
5753
|
function Control(_a) {
|
|
5754
5754
|
var _b;
|
|
5755
|
-
var value = _a.value, vardef = _a.vardef, onChange = _a.onChange;
|
|
5755
|
+
var value = _a.value, vardef = _a.vardef, data = _a.data, onChange = _a.onChange;
|
|
5756
5756
|
var customControls = useControls();
|
|
5757
5757
|
if (vardef.type in customControls) {
|
|
5758
5758
|
var ControlComponent = customControls[vardef.type];
|
|
5759
|
-
return (React.createElement(ControlComponent, { value: value, vardef: vardef, onChange: onChange }));
|
|
5759
|
+
return (React.createElement(ControlComponent, { value: value, vardef: vardef, onChange: onChange, data: data }));
|
|
5760
5760
|
}
|
|
5761
5761
|
if (vardef.options) {
|
|
5762
5762
|
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)); })));
|
|
@@ -5800,7 +5800,7 @@ var Input = function (_a) {
|
|
|
5800
5800
|
"--type-color": "var(--color-".concat(normalized.type, ")"),
|
|
5801
5801
|
}, onClick: onClick },
|
|
5802
5802
|
React.createElement("span", { className: styles$1.PortLabel }, normalized.label || name),
|
|
5803
|
-
!isRef && (React.createElement(Control, { vardef: normalized, value: value, onChange: handleInputChange(name) }))));
|
|
5803
|
+
!isRef && (React.createElement(Control, { vardef: normalized, value: value, onChange: handleInputChange(name), data: data }))));
|
|
5804
5804
|
};
|
|
5805
5805
|
|
|
5806
5806
|
var Param = function (_a) {
|
|
@@ -5819,7 +5819,7 @@ var Param = function (_a) {
|
|
|
5819
5819
|
"--type-color": "var(--color-".concat(normalized.type, ")"),
|
|
5820
5820
|
}, onClick: onClick },
|
|
5821
5821
|
React.createElement("span", { className: styles$1.PortLabel }, normalized.label || name),
|
|
5822
|
-
!isRef && (React.createElement(Control, { vardef: normalized, value: value, onChange: handleParamChange(name) }))));
|
|
5822
|
+
!isRef && (React.createElement(Control, { vardef: normalized, value: value, onChange: handleParamChange(name), data: data }))));
|
|
5823
5823
|
};
|
|
5824
5824
|
|
|
5825
5825
|
var Output = function (_a) {
|
|
@@ -5995,17 +5995,17 @@ function GenericNode(_a) {
|
|
|
5995
5995
|
React.createElement("div", { className: styles.Description }, data.description),
|
|
5996
5996
|
children,
|
|
5997
5997
|
React.createElement("div", { className: styles.Ports },
|
|
5998
|
-
outputEntries.map(function (_a) {
|
|
5998
|
+
outputEntries.map(function (_a, index) {
|
|
5999
5999
|
var _b = __read(_a, 2), name = _b[0], varDef = _b[1];
|
|
6000
|
-
return (React.createElement(Output, { key: name, name: name, varDef: varDef, id: id, onClick: function () { return setFocus(name); }, focus: showPreview && focus === name }));
|
|
6000
|
+
return (React.createElement(Output, { key: "".concat(name, "_").concat(index), name: name, varDef: varDef, id: id, onClick: function () { return setFocus(name); }, focus: showPreview && focus === name }));
|
|
6001
6001
|
}),
|
|
6002
|
-
inputEntries.map(function (_a) {
|
|
6002
|
+
inputEntries.map(function (_a, index) {
|
|
6003
6003
|
var _b = __read(_a, 2), name = _b[0], varDef = _b[1];
|
|
6004
|
-
return (React.createElement(Input, { key: name, name: name, varDef: varDef, id: id, data: data }));
|
|
6004
|
+
return (React.createElement(Input, { key: "".concat(name, "_").concat(index), name: name, varDef: varDef, id: id, data: data }));
|
|
6005
6005
|
}),
|
|
6006
|
-
paramEntries.map(function (_a) {
|
|
6006
|
+
paramEntries.map(function (_a, index) {
|
|
6007
6007
|
var _b = __read(_a, 2), name = _b[0], varDef = _b[1];
|
|
6008
|
-
return (React.createElement(Param, { key: name, name: name, varDef: varDef, id: id, data: data }));
|
|
6008
|
+
return (React.createElement(Param, { key: "".concat(name, "_").concat(index), name: name, varDef: varDef, id: id, data: data }));
|
|
6009
6009
|
})),
|
|
6010
6010
|
React.createElement("div", { className: classNames(styles.PreviewHead, (_b = {},
|
|
6011
6011
|
_b[styles.expanded] = showPreview,
|
|
@@ -6621,14 +6621,14 @@ var ConnectionLine = (function (_a) {
|
|
|
6621
6621
|
*/
|
|
6622
6622
|
var emptyObject = {};
|
|
6623
6623
|
function FlowInner(_a) {
|
|
6624
|
-
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;
|
|
6625
|
-
var
|
|
6624
|
+
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;
|
|
6625
|
+
var _e = __read(React.useState(null), 2), instance = _e[0], setInstance = _e[1];
|
|
6626
6626
|
var handleInit = function (instance) {
|
|
6627
6627
|
setInstance(instance);
|
|
6628
6628
|
onInit === null || onInit === void 0 ? void 0 : onInit(instance);
|
|
6629
6629
|
};
|
|
6630
6630
|
var updatePosition = useUpdatePositions(fn);
|
|
6631
|
-
var
|
|
6631
|
+
var _f = __read(usePositions(fn), 2), positions = _f[0], setPositions = _f[1];
|
|
6632
6632
|
var options = React.useMemo(function () {
|
|
6633
6633
|
var handleDataChange = function (id) { return function (newData) {
|
|
6634
6634
|
onChange === null || onChange === void 0 ? void 0 : onChange(function (fn) {
|
|
@@ -6658,7 +6658,7 @@ function FlowInner(_a) {
|
|
|
6658
6658
|
React.useEffect(function () {
|
|
6659
6659
|
setPositions(__assign(__assign({}, positions), defaultPositions));
|
|
6660
6660
|
}, [defaultPositions]);
|
|
6661
|
-
var
|
|
6661
|
+
var _g = useFlow(fn, engine, options), nodes = _g.nodes, edges = _g.edges, setNodes = _g.setNodes, setEdges = _g.setEdges;
|
|
6662
6662
|
// node selection handler
|
|
6663
6663
|
var handleSelect = React.useCallback(function (_a) {
|
|
6664
6664
|
var nodes = _a.nodes;
|
|
@@ -6668,7 +6668,7 @@ function FlowInner(_a) {
|
|
|
6668
6668
|
onChange: handleSelect,
|
|
6669
6669
|
});
|
|
6670
6670
|
// dropping nodes
|
|
6671
|
-
var
|
|
6671
|
+
var _h = __read(useDrop({
|
|
6672
6672
|
accept: "flow-node",
|
|
6673
6673
|
drop: function (item, monitor) {
|
|
6674
6674
|
var pos = monitor.getClientOffset();
|
|
@@ -6688,7 +6688,7 @@ function FlowInner(_a) {
|
|
|
6688
6688
|
isOver: monitor.isOver(),
|
|
6689
6689
|
};
|
|
6690
6690
|
},
|
|
6691
|
-
}), 2);
|
|
6691
|
+
}), 2); _h[0].isOver; var drop = _h[1];
|
|
6692
6692
|
// connecting nodes
|
|
6693
6693
|
var onConnect = React.useCallback(function (params) {
|
|
6694
6694
|
var _a, _b;
|
|
@@ -6755,7 +6755,7 @@ function FlowInner(_a) {
|
|
|
6755
6755
|
return applyEdgeChanges(changes, edgesSnapshot);
|
|
6756
6756
|
});
|
|
6757
6757
|
}, []);
|
|
6758
|
-
return (React.createElement(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: {
|
|
6758
|
+
return (React.createElement(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: {
|
|
6759
6759
|
minZoom: fitView ? undefined : 1,
|
|
6760
6760
|
maxZoom: fitView ? undefined : 1,
|
|
6761
6761
|
},
|