@rkmodules/rules 0.0.139 → 0.0.141

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
@@ -1476,6 +1476,36 @@ var stringEqualTo = {
1476
1476
  }); },
1477
1477
  };
1478
1478
 
1479
+ var stringTemplate = {
1480
+ name: "stringTemplate",
1481
+ label: "String Template",
1482
+ description: "Assembles a string from inputs",
1483
+ nodeType: "DynamicInput",
1484
+ inputs: {
1485
+ template: { type: "string", default: "" },
1486
+ },
1487
+ outputs: {
1488
+ tree: { type: "string", label: "string" },
1489
+ },
1490
+ impl: function (_a, params) { return __awaiter(void 0, void 0, void 0, function () {
1491
+ var trees;
1492
+ var _b = _a.template, template = _b === void 0 ? {} : _b, inputs = __rest(_a, ["template"]);
1493
+ return __generator(this, function (_c) {
1494
+ trees = __spreadArray([template], __read(Object.values(inputs)), false);
1495
+ return [2 /*return*/, {
1496
+ tree: nAryOnTree(trees, function (_a) {
1497
+ var _b = __read(_a), template = _b[0], values = _b.slice(1);
1498
+ return template.replace(/{D(\d+)}/g, function (match, number) {
1499
+ return typeof values[number - 1] !== "undefined"
1500
+ ? values[number - 1]
1501
+ : match;
1502
+ });
1503
+ }, true),
1504
+ }];
1505
+ });
1506
+ }); },
1507
+ };
1508
+
1479
1509
  var toString = {
1480
1510
  name: "toString",
1481
1511
  label: "To String",
@@ -1504,6 +1534,7 @@ var primitives$7 = (_a$7 = {},
1504
1534
  _a$7[toString.name] = toString,
1505
1535
  _a$7[joinStrings.name] = joinStrings,
1506
1536
  _a$7[stringEqualTo.name] = stringEqualTo,
1537
+ _a$7[stringTemplate.name] = stringTemplate,
1507
1538
  _a$7);
1508
1539
 
1509
1540
  var filterList = {
@@ -6674,12 +6705,20 @@ function uid() {
6674
6705
  }
6675
6706
  var DynamicInput = React.memo(function (_a) {
6676
6707
  var id = _a.id, data = _a.data, selected = _a.selected;
6677
- var inputs = Object.fromEntries(Object.keys(data.inputs || {}).map(function (name, i) { return [
6678
- name,
6679
- { type: "any", label: "D".concat(i + 1) },
6680
- ]; }));
6681
- var inputCount = Object.keys(inputs).length;
6682
- inputs[uid()] = { type: "any", label: "D".concat(inputCount + 1) };
6708
+ var inputs = __assign({}, data.inputDefs);
6709
+ var dynIndex = 1;
6710
+ Object.keys(data.inputs || {}).forEach(function (name) {
6711
+ if (!(inputs === null || inputs === void 0 ? void 0 : inputs[name]) && dynIndex < 10) {
6712
+ inputs[name] = { type: "any", label: "D".concat(dynIndex) };
6713
+ dynIndex++;
6714
+ }
6715
+ });
6716
+ var inputCount = Object.keys(data.inputs || {}).length;
6717
+ var fixedInputCount = Object.keys(data.inputDefs || {}).length;
6718
+ inputs[uid()] = {
6719
+ type: "any",
6720
+ label: "D".concat(inputCount - fixedInputCount + 1),
6721
+ };
6683
6722
  return (React.createElement(GenericNode, { inputs: inputs, id: id, data: data, selected: selected }));
6684
6723
  });
6685
6724
  DynamicInput.displayName = "DynamicInputNode";
@@ -8288,7 +8327,10 @@ exports.Engine = Engine;
8288
8327
  exports.Flow = Flow;
8289
8328
  exports.FlowContext = FlowContext;
8290
8329
  exports.GenericNode = GenericNode;
8330
+ exports.Input = Input;
8291
8331
  exports.Lib = Lib;
8332
+ exports.Output = Output;
8333
+ exports.Param = Param;
8292
8334
  exports.binaryOnTree = binaryOnTree;
8293
8335
  exports.binaryOnTreeBranch = binaryOnTreeBranch;
8294
8336
  exports.broadCast = broadCast;