@rkmodules/rules 0.0.27 → 0.0.29
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.css +19 -2
- package/dist/index.js +39 -29
- package/dist/index.js.map +1 -1
- package/dist/lib/Flow/types.d.ts +2 -0
- package/dist/lib/Primitives/List/{graftTree.d.ts → mergeGroup.d.ts} +1 -1
- package/dist/lib/Primitives/List/{trimTree.d.ts → splitGroup.d.ts} +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -50,6 +50,16 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
|
|
53
|
+
.Description_f9s4l {
|
|
54
|
+
font-size: 0.8em;
|
|
55
|
+
opacity: 0.7;
|
|
56
|
+
margin: 2px auto;
|
|
57
|
+
font-style: italic;
|
|
58
|
+
text-align: center;
|
|
59
|
+
padding: 8px;
|
|
60
|
+
max-width: 200px;
|
|
61
|
+
}
|
|
62
|
+
|
|
53
63
|
.Input_Yhvzf {
|
|
54
64
|
color: var(--type-color);
|
|
55
65
|
--xy-handle-background-color: var(--type-color);
|
|
@@ -69,8 +79,7 @@
|
|
|
69
79
|
align-items: center;
|
|
70
80
|
justify-content: center;
|
|
71
81
|
gap: 8px;
|
|
72
|
-
color: #
|
|
73
|
-
text-shadow: -1px -1px 0px white;
|
|
82
|
+
color: #444;
|
|
74
83
|
}
|
|
75
84
|
.PreviewHead_oFT4K::before, .PreviewHead_oFT4K::after {
|
|
76
85
|
content: '🠻';
|
|
@@ -87,6 +96,14 @@
|
|
|
87
96
|
overflow: auto;
|
|
88
97
|
}
|
|
89
98
|
|
|
99
|
+
.Duration_0jqWx {
|
|
100
|
+
font-size: 0.8em;
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
padding-top: 8px;
|
|
105
|
+
border-top: 1px solid var(--ln);
|
|
106
|
+
}
|
|
90
107
|
|
|
91
108
|
|
|
92
109
|
.Table_aZyRT {
|
package/dist/index.js
CHANGED
|
@@ -189,7 +189,7 @@ function expandTree(tree, fn) {
|
|
|
189
189
|
* @param tree
|
|
190
190
|
* @returns
|
|
191
191
|
*/
|
|
192
|
-
function graftTree
|
|
192
|
+
function graftTree(tree) {
|
|
193
193
|
return Object.fromEntries(Object.entries(tree).reduce(function (entries, _a) {
|
|
194
194
|
var _b = __read(_a, 2), path = _b[0], values = _b[1];
|
|
195
195
|
entries.push.apply(entries, __spreadArray([], __read(values.map(function (value, index) {
|
|
@@ -202,7 +202,7 @@ function graftTree$1(tree) {
|
|
|
202
202
|
* Reduce the complexity of a tree by merging the outermost branches.
|
|
203
203
|
* @param tree
|
|
204
204
|
*/
|
|
205
|
-
function trimTree
|
|
205
|
+
function trimTree(tree, depth) {
|
|
206
206
|
var _a;
|
|
207
207
|
if (depth === void 0) { depth = 1; }
|
|
208
208
|
if (depth <= 0)
|
|
@@ -504,6 +504,7 @@ function interpolate(inputs, scope) {
|
|
|
504
504
|
var getValue = {
|
|
505
505
|
name: "getValue",
|
|
506
506
|
label: "Get Value",
|
|
507
|
+
description: "Get a value from an object at a specified path.",
|
|
507
508
|
inputs: {
|
|
508
509
|
tree: "any",
|
|
509
510
|
path: "string",
|
|
@@ -552,6 +553,7 @@ var log = {
|
|
|
552
553
|
var value = {
|
|
553
554
|
name: "value",
|
|
554
555
|
label: "Value",
|
|
556
|
+
description: "Outputs a constant value of a specified type",
|
|
555
557
|
inputs: {},
|
|
556
558
|
params: {
|
|
557
559
|
value: "string",
|
|
@@ -810,7 +812,7 @@ var primitives$5 = (_a$4 = {},
|
|
|
810
812
|
var filterList = {
|
|
811
813
|
name: "filterList",
|
|
812
814
|
label: "Filter List",
|
|
813
|
-
description: "
|
|
815
|
+
description: "Filters the list by a boolean value",
|
|
814
816
|
inputs: {
|
|
815
817
|
list: "any",
|
|
816
818
|
keep: "boolean",
|
|
@@ -832,10 +834,10 @@ var filterList = {
|
|
|
832
834
|
}); },
|
|
833
835
|
};
|
|
834
836
|
|
|
835
|
-
var
|
|
836
|
-
name: "
|
|
837
|
-
label: "
|
|
838
|
-
description: "
|
|
837
|
+
var splitGroup = {
|
|
838
|
+
name: "splitGroup",
|
|
839
|
+
label: "Split Group",
|
|
840
|
+
description: "Splits every item of a group into its own group",
|
|
839
841
|
inputs: {
|
|
840
842
|
tree: "any",
|
|
841
843
|
},
|
|
@@ -845,7 +847,7 @@ var graftTree = {
|
|
|
845
847
|
impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
|
|
846
848
|
return __generator(this, function (_a) {
|
|
847
849
|
return [2 /*return*/, {
|
|
848
|
-
tree: graftTree
|
|
850
|
+
tree: graftTree(inputs.tree),
|
|
849
851
|
}];
|
|
850
852
|
});
|
|
851
853
|
}); },
|
|
@@ -905,15 +907,15 @@ var listLength = {
|
|
|
905
907
|
}); },
|
|
906
908
|
};
|
|
907
909
|
|
|
908
|
-
var
|
|
909
|
-
name: "
|
|
910
|
-
label: "
|
|
911
|
-
description: "
|
|
910
|
+
var mergeGroup = {
|
|
911
|
+
name: "mergeGroup",
|
|
912
|
+
label: "Merge Group",
|
|
913
|
+
description: "Merge the deepest groups into their parent.",
|
|
912
914
|
inputs: {
|
|
913
915
|
tree: "any",
|
|
914
916
|
},
|
|
915
917
|
params: {
|
|
916
|
-
depth: "number", // Optional depth to trim the tree
|
|
918
|
+
depth: { type: "number", default: 1 }, // Optional depth to trim the tree
|
|
917
919
|
},
|
|
918
920
|
outputs: {
|
|
919
921
|
tree: "any", // Return the trimed nodes
|
|
@@ -924,7 +926,7 @@ var trimTree = {
|
|
|
924
926
|
return __generator(this, function (_b) {
|
|
925
927
|
depth = (_a = params.depth) !== null && _a !== void 0 ? _a : 1;
|
|
926
928
|
return [2 /*return*/, {
|
|
927
|
-
tree: trimTree
|
|
929
|
+
tree: trimTree(inputs.tree, depth),
|
|
928
930
|
}];
|
|
929
931
|
});
|
|
930
932
|
}); },
|
|
@@ -932,8 +934,8 @@ var trimTree = {
|
|
|
932
934
|
|
|
933
935
|
var _a$3;
|
|
934
936
|
var primitives$4 = (_a$3 = {},
|
|
935
|
-
_a$3[
|
|
936
|
-
_a$3[
|
|
937
|
+
_a$3[splitGroup.name] = splitGroup,
|
|
938
|
+
_a$3[mergeGroup.name] = mergeGroup,
|
|
937
939
|
_a$3[listItem.name] = listItem,
|
|
938
940
|
_a$3[listLength.name] = listLength,
|
|
939
941
|
_a$3[filterList.name] = filterList,
|
|
@@ -955,9 +957,9 @@ var series = {
|
|
|
955
957
|
return __generator(this, function (_a) {
|
|
956
958
|
return [2 /*return*/, {
|
|
957
959
|
series: nAryOnTreeBranch([
|
|
958
|
-
graftTree
|
|
959
|
-
graftTree
|
|
960
|
-
graftTree
|
|
960
|
+
graftTree(inputs.start),
|
|
961
|
+
graftTree(inputs.step),
|
|
962
|
+
graftTree(inputs.count),
|
|
961
963
|
], function (_a) {
|
|
962
964
|
var _b = __read(_a, 3), _c = __read(_b[0], 1), _d = _c[0], start = _d === void 0 ? 0 : _d, _e = __read(_b[1], 1), _f = _e[0], step = _f === void 0 ? 1 : _f, _g = __read(_b[2], 1), _h = _g[0], count = _h === void 0 ? 10 : _h;
|
|
963
965
|
var series = [];
|
|
@@ -1240,7 +1242,7 @@ var Engine = /** @class */ (function () {
|
|
|
1240
1242
|
endTime: endTime,
|
|
1241
1243
|
duration: endTime - startTime,
|
|
1242
1244
|
});
|
|
1243
|
-
|
|
1245
|
+
console.log("Engine run done", result, context, endTime - startTime);
|
|
1244
1246
|
return [2 /*return*/, result];
|
|
1245
1247
|
}
|
|
1246
1248
|
});
|
|
@@ -1357,7 +1359,7 @@ var Engine = /** @class */ (function () {
|
|
|
1357
1359
|
return [4 /*yield*/, ((_a = node.impl) === null || _a === void 0 ? void 0 : _a.call(node, mappedInputs, {}))];
|
|
1358
1360
|
case 1:
|
|
1359
1361
|
result = _b.sent();
|
|
1360
|
-
console.log("Engine run complete", result);
|
|
1362
|
+
// console.log("Engine run complete", result);
|
|
1361
1363
|
return [2 /*return*/, result];
|
|
1362
1364
|
}
|
|
1363
1365
|
});
|
|
@@ -1480,7 +1482,7 @@ function Control(_a) {
|
|
|
1480
1482
|
}
|
|
1481
1483
|
}
|
|
1482
1484
|
|
|
1483
|
-
var styles = {"DefaultNode":"DefaultNode_R2P6c","selected":"selected_VmB-F","active":"active_zjUzx","Log":"Log_dsq5e","Label":"Label_wBwWA","Input":"Input_Yhvzf","Output":"Output_e4yF-","PreviewHead":"PreviewHead_oFT4K","expanded":"expanded_3vnbi","Preview":"Preview_HbkZ6","Table":"Table_aZyRT","GroupHead":"GroupHead_QJhST","GroupChildren":"GroupChildren_NKx-B","GroupLeaf":"GroupLeaf_eliT8"};
|
|
1485
|
+
var styles = {"DefaultNode":"DefaultNode_R2P6c","selected":"selected_VmB-F","active":"active_zjUzx","Log":"Log_dsq5e","Label":"Label_wBwWA","Description":"Description_f9s4l","Input":"Input_Yhvzf","Output":"Output_e4yF-","PreviewHead":"PreviewHead_oFT4K","expanded":"expanded_3vnbi","Preview":"Preview_HbkZ6","Duration":"Duration_0jqWx","Table":"Table_aZyRT","GroupHead":"GroupHead_QJhST","GroupChildren":"GroupChildren_NKx-B","GroupLeaf":"GroupLeaf_eliT8"};
|
|
1484
1486
|
|
|
1485
1487
|
var Input = function (_a) {
|
|
1486
1488
|
var _b;
|
|
@@ -1616,7 +1618,7 @@ function TreeBranchView(_a) {
|
|
|
1616
1618
|
function TreeView(_a) {
|
|
1617
1619
|
var value = _a.value;
|
|
1618
1620
|
var structure = createTreeStructure(value || {});
|
|
1619
|
-
return (React.createElement("div", null, structure.map(function (branch, index) { return (React.createElement(TreeBranchView, { branch: branch, name: index })); })));
|
|
1621
|
+
return (React.createElement("div", null, structure.map(function (branch, index) { return (React.createElement(TreeBranchView, { key: index, branch: branch, name: index })); })));
|
|
1620
1622
|
}
|
|
1621
1623
|
var Log = React.memo(function (_a) {
|
|
1622
1624
|
var id = _a.id, data = _a.data, selected = _a.selected;
|
|
@@ -1646,17 +1648,20 @@ function GenericNode(_a) {
|
|
|
1646
1648
|
var paramEntries = Object.entries(params || data.paramDefs || {});
|
|
1647
1649
|
var engine = useEngine();
|
|
1648
1650
|
var _d = __read(React.useState({}), 2), result = _d[0], setResult = _d[1];
|
|
1649
|
-
var _e = __read(React.useState(
|
|
1650
|
-
var _f = __read(React.useState(
|
|
1651
|
+
var _e = __read(React.useState(null), 2), duration = _e[0], setDuration = _e[1];
|
|
1652
|
+
var _f = __read(React.useState(((_c = outputEntries[0]) === null || _c === void 0 ? void 0 : _c[0]) || null), 2), focus = _f[0], setFocus = _f[1];
|
|
1653
|
+
var _g = __read(React.useState(false), 2), showPreview = _g[0], setShowPreview = _g[1];
|
|
1651
1654
|
var previewValue = focus ? result[focus] : Object.values(result)[0];
|
|
1652
1655
|
React.useEffect(function () {
|
|
1653
1656
|
return engine.subscribe("functionResult", function (event) {
|
|
1654
1657
|
if (event.name === id) {
|
|
1655
1658
|
setResult(event.result || {});
|
|
1659
|
+
setDuration(event.duration || null);
|
|
1656
1660
|
}
|
|
1657
1661
|
});
|
|
1658
1662
|
}, []);
|
|
1659
|
-
return (React.createElement(NodeContainer, { label: data.
|
|
1663
|
+
return (React.createElement(NodeContainer, { label: data.label, selected: selected, id: id },
|
|
1664
|
+
React.createElement("div", { className: styles.Description }, data.description),
|
|
1660
1665
|
children,
|
|
1661
1666
|
React.createElement("table", null,
|
|
1662
1667
|
React.createElement("tbody", null,
|
|
@@ -1676,7 +1681,10 @@ function GenericNode(_a) {
|
|
|
1676
1681
|
_b[styles.expanded] = showPreview,
|
|
1677
1682
|
_b)), onClick: function () { return setShowPreview(!showPreview); } }, "Preview"),
|
|
1678
1683
|
showPreview && (React.createElement("div", { className: styles.Preview },
|
|
1679
|
-
React.createElement(TreeView, { value: previewValue })
|
|
1684
|
+
React.createElement(TreeView, { value: previewValue }),
|
|
1685
|
+
duration && (React.createElement("div", { className: styles.Duration },
|
|
1686
|
+
duration.toFixed(2),
|
|
1687
|
+
" ms"))))));
|
|
1680
1688
|
}
|
|
1681
1689
|
|
|
1682
1690
|
var math = mathjs.create(mathjs.all, {});
|
|
@@ -1931,6 +1939,8 @@ function createNode(engine, id, fncall, options) {
|
|
|
1931
1939
|
id: id,
|
|
1932
1940
|
data: {
|
|
1933
1941
|
name: fncall.name,
|
|
1942
|
+
label: (calledFn === null || calledFn === void 0 ? void 0 : calledFn.label) || fncall.name,
|
|
1943
|
+
description: calledFn === null || calledFn === void 0 ? void 0 : calledFn.description,
|
|
1934
1944
|
inputs: fncall.inputs,
|
|
1935
1945
|
params: fncall.params,
|
|
1936
1946
|
inputDefs: (calledFn === null || calledFn === void 0 ? void 0 : calledFn.inputs) || {},
|
|
@@ -2134,7 +2144,7 @@ exports.expandTree = expandTree;
|
|
|
2134
2144
|
exports.getBranch = getBranch;
|
|
2135
2145
|
exports.getReferences = getReferences;
|
|
2136
2146
|
exports.getValue = getValue$1;
|
|
2137
|
-
exports.graftTree = graftTree
|
|
2147
|
+
exports.graftTree = graftTree;
|
|
2138
2148
|
exports.interpolate = interpolate;
|
|
2139
2149
|
exports.isReference = isReference;
|
|
2140
2150
|
exports.isSingleTon = isSingleTon;
|
|
@@ -2151,7 +2161,7 @@ exports.simplifyTree = simplifyTree;
|
|
|
2151
2161
|
exports.toArray = toArray;
|
|
2152
2162
|
exports.topSort = topSort;
|
|
2153
2163
|
exports.treeSize = treeSize;
|
|
2154
|
-
exports.trimTree = trimTree
|
|
2164
|
+
exports.trimTree = trimTree;
|
|
2155
2165
|
exports.uid = uid$1;
|
|
2156
2166
|
exports.useDraggableNode = useDraggableNode;
|
|
2157
2167
|
exports.useFlow = useFlow;
|