@rkmodules/rules 0.0.178 → 0.0.180

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
@@ -1967,15 +1967,23 @@ var listLength = {
1967
1967
  inputs: {
1968
1968
  list: "any",
1969
1969
  },
1970
+ params: {
1971
+ merge: "boolean",
1972
+ },
1970
1973
  outputs: {
1971
1974
  length: "number",
1972
1975
  },
1973
- impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
1976
+ impl: function (inputs, params) { return __awaiter(void 0, void 0, void 0, function () {
1977
+ var length;
1974
1978
  return __generator(this, function (_a) {
1979
+ length = mapTreeBranch(inputs.list || {}, function (branch) {
1980
+ return [branch.length];
1981
+ });
1982
+ if (params.merge) {
1983
+ length = trimTree(length, 1);
1984
+ }
1975
1985
  return [2 /*return*/, {
1976
- length: mapTreeBranch(inputs.list || {}, function (branch) {
1977
- return [branch.length];
1978
- }),
1986
+ length: length,
1979
1987
  }];
1980
1988
  });
1981
1989
  }); },
@@ -3870,7 +3878,10 @@ var Engine = /** @class */ (function () {
3870
3878
  // register the primitive
3871
3879
  this.fnIndex[primitive.name] = primitive;
3872
3880
  this.graphDefinitions.set(primitive, node);
3873
- this.fireEvent("functionBuilt", { name: primitive.name, fn: primitive });
3881
+ this.fireEvent("functionBuilt", {
3882
+ name: primitive.name,
3883
+ fn: primitive,
3884
+ });
3874
3885
  return primitive;
3875
3886
  };
3876
3887
  Engine.prototype.mount = function (node, inputs, options) {
@@ -7057,6 +7068,7 @@ function Control(_a) {
7057
7068
 
7058
7069
  function Menu(_a) {
7059
7070
  var handle = _a.handle, children = _a.children;
7071
+ var menuRef = React.useRef(null);
7060
7072
  var _b = __read(React.useState(false), 2), open = _b[0], setOpen = _b[1];
7061
7073
  var handleOpen = function () {
7062
7074
  setOpen(!open);
@@ -7068,7 +7080,8 @@ function Menu(_a) {
7068
7080
  if (!open)
7069
7081
  return;
7070
7082
  var handleClickOutside = function (event) {
7071
- if (!event.target.closest(".".concat(styles$2.MenuCanvas))) {
7083
+ var _a;
7084
+ if (!((_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
7072
7085
  setOpen(false);
7073
7086
  }
7074
7087
  };
@@ -7077,7 +7090,7 @@ function Menu(_a) {
7077
7090
  document.removeEventListener("click", handleClickOutside);
7078
7091
  };
7079
7092
  }, [open]);
7080
- return (React.createElement("div", { className: styles$2.Menu },
7093
+ return (React.createElement("div", { ref: menuRef, className: styles$2.Menu },
7081
7094
  React.createElement("div", { onClick: handleOpen }, handle),
7082
7095
  open && (React.createElement("div", { className: styles$2.MenuCanvas, onClick: handleClose }, children))));
7083
7096
  }