@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.esm.js CHANGED
@@ -1474,6 +1474,36 @@ var stringEqualTo = {
1474
1474
  }); },
1475
1475
  };
1476
1476
 
1477
+ var stringTemplate = {
1478
+ name: "stringTemplate",
1479
+ label: "String Template",
1480
+ description: "Assembles a string from inputs",
1481
+ nodeType: "DynamicInput",
1482
+ inputs: {
1483
+ template: { type: "string", default: "" },
1484
+ },
1485
+ outputs: {
1486
+ tree: { type: "string", label: "string" },
1487
+ },
1488
+ impl: function (_a, params) { return __awaiter(void 0, void 0, void 0, function () {
1489
+ var trees;
1490
+ var _b = _a.template, template = _b === void 0 ? {} : _b, inputs = __rest(_a, ["template"]);
1491
+ return __generator(this, function (_c) {
1492
+ trees = __spreadArray([template], __read(Object.values(inputs)), false);
1493
+ return [2 /*return*/, {
1494
+ tree: nAryOnTree(trees, function (_a) {
1495
+ var _b = __read(_a), template = _b[0], values = _b.slice(1);
1496
+ return template.replace(/{D(\d+)}/g, function (match, number) {
1497
+ return typeof values[number - 1] !== "undefined"
1498
+ ? values[number - 1]
1499
+ : match;
1500
+ });
1501
+ }, true),
1502
+ }];
1503
+ });
1504
+ }); },
1505
+ };
1506
+
1477
1507
  var toString = {
1478
1508
  name: "toString",
1479
1509
  label: "To String",
@@ -1502,6 +1532,7 @@ var primitives$7 = (_a$7 = {},
1502
1532
  _a$7[toString.name] = toString,
1503
1533
  _a$7[joinStrings.name] = joinStrings,
1504
1534
  _a$7[stringEqualTo.name] = stringEqualTo,
1535
+ _a$7[stringTemplate.name] = stringTemplate,
1505
1536
  _a$7);
1506
1537
 
1507
1538
  var filterList = {
@@ -6672,12 +6703,20 @@ function uid() {
6672
6703
  }
6673
6704
  var DynamicInput = React.memo(function (_a) {
6674
6705
  var id = _a.id, data = _a.data, selected = _a.selected;
6675
- var inputs = Object.fromEntries(Object.keys(data.inputs || {}).map(function (name, i) { return [
6676
- name,
6677
- { type: "any", label: "D".concat(i + 1) },
6678
- ]; }));
6679
- var inputCount = Object.keys(inputs).length;
6680
- inputs[uid()] = { type: "any", label: "D".concat(inputCount + 1) };
6706
+ var inputs = __assign({}, data.inputDefs);
6707
+ var dynIndex = 1;
6708
+ Object.keys(data.inputs || {}).forEach(function (name) {
6709
+ if (!(inputs === null || inputs === void 0 ? void 0 : inputs[name]) && dynIndex < 10) {
6710
+ inputs[name] = { type: "any", label: "D".concat(dynIndex) };
6711
+ dynIndex++;
6712
+ }
6713
+ });
6714
+ var inputCount = Object.keys(data.inputs || {}).length;
6715
+ var fixedInputCount = Object.keys(data.inputDefs || {}).length;
6716
+ inputs[uid()] = {
6717
+ type: "any",
6718
+ label: "D".concat(inputCount - fixedInputCount + 1),
6719
+ };
6681
6720
  return (React.createElement(GenericNode, { inputs: inputs, id: id, data: data, selected: selected }));
6682
6721
  });
6683
6722
  DynamicInput.displayName = "DynamicInputNode";
@@ -8280,5 +8319,5 @@ function DDContext(_a) {
8280
8319
  return React.createElement(DndProvider, { backend: HTML5Backend }, children);
8281
8320
  }
8282
8321
 
8283
- export { DDContext, DISCARD, Engine, Flow, FlowContext, GenericNode, Lib, binaryOnTree, binaryOnTreeBranch, broadCast, ensureBranch, expandTree, forEachBranch, forEachItem, getBranch, getBranches, getItem, getPaths, getPositions, getReferences, getValue$1 as getValue, getVariable, graftTree, hasReference, interpolate, isEmpty, isEmptyTree, isReference, isSingleTon, isTree, mapTree, mapTreeBranch, nAryOnTree, nAryOnTreeBranch, normalizePaths, normalizeVarDef, parseReference, primitives, pushItem, sameShape, simplifyTree$1 as simplifyTree, toArray, topSort, treeSize, treeStats, trimTree, uid$1 as uid, useControls, useDraggableNode, useEngine, useFlow, useFunction, useGraphedFunction, usePositions, usePrompts, useUpdatePositions, useVariable, variableStore };
8322
+ export { DDContext, DISCARD, Engine, Flow, FlowContext, GenericNode, Input, Lib, Output, Param, binaryOnTree, binaryOnTreeBranch, broadCast, ensureBranch, expandTree, forEachBranch, forEachItem, getBranch, getBranches, getItem, getPaths, getPositions, getReferences, getValue$1 as getValue, getVariable, graftTree, hasReference, interpolate, isEmpty, isEmptyTree, isReference, isSingleTon, isTree, mapTree, mapTreeBranch, nAryOnTree, nAryOnTreeBranch, normalizePaths, normalizeVarDef, parseReference, primitives, pushItem, sameShape, simplifyTree$1 as simplifyTree, toArray, topSort, treeSize, treeStats, trimTree, uid$1 as uid, useControls, useDraggableNode, useEngine, useFlow, useFunction, useGraphedFunction, usePositions, usePrompts, useUpdatePositions, useVariable, variableStore };
8284
8323
  //# sourceMappingURL=index.esm.js.map