@elicdavis/node-flow 0.1.2 → 0.1.4

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.js CHANGED
@@ -1022,17 +1022,19 @@ renderColumn_fn = function(ctx, position, graphScale, scaledFillableSpace) {
1022
1022
  };
1023
1023
 
1024
1024
  // src/elements/text.ts
1025
- var _text, _align, _verticalAlign;
1025
+ var _text, _align, _verticalAlign, _lineHeight;
1026
1026
  var TextElement = class extends RenderElementBase {
1027
1027
  constructor(text, styling) {
1028
- var _a, _b;
1028
+ var _a, _b, _c;
1029
1029
  super(styling);
1030
1030
  __privateAdd(this, _text);
1031
1031
  __privateAdd(this, _align);
1032
1032
  __privateAdd(this, _verticalAlign);
1033
+ __privateAdd(this, _lineHeight);
1033
1034
  __privateSet(this, _text, text);
1034
1035
  __privateSet(this, _align, (_a = styling == null ? void 0 : styling.Align) != null ? _a : "left" /* Left */);
1035
1036
  __privateSet(this, _verticalAlign, (_b = styling == null ? void 0 : styling.VerticalAlign) != null ? _b : "top" /* Top */);
1037
+ __privateSet(this, _lineHeight, (_c = styling == null ? void 0 : styling.LineHeight) != null ? _c : 1);
1036
1038
  }
1037
1039
  doRender(ctx, position, graphScale, scaledFillableSpace) {
1038
1040
  const scale = Zero();
@@ -1074,7 +1076,7 @@ var TextElement = class extends RenderElementBase {
1074
1076
  for (let i = 0; i < eles.length; i++) {
1075
1077
  eles[i].render(ctx, graphScale, justifiedPosition);
1076
1078
  eles[i].size(ctx, 1, tempSize);
1077
- justifiedPosition.y += tempSize.y;
1079
+ justifiedPosition.y += __privateGet(this, _text).style().getSize() * __privateGet(this, _lineHeight);
1078
1080
  }
1079
1081
  }
1080
1082
  }
@@ -1086,17 +1088,17 @@ var TextElement = class extends RenderElementBase {
1086
1088
  const eles = __privateGet(this, _text).breakIntoLines(ctx, limitations.x);
1087
1089
  const tempSize = { x: 0, y: 0 };
1088
1090
  out.x = 0;
1089
- out.y = 0;
1091
+ out.y = __privateGet(this, _text).style().getSize() * eles.length * __privateGet(this, _lineHeight);
1090
1092
  for (let i = 0; i < eles.length; i++) {
1091
1093
  eles[i].size(ctx, 1, tempSize);
1092
1094
  out.x = Math.max(tempSize.x, out.x);
1093
- out.y += tempSize.y;
1094
1095
  }
1095
1096
  }
1096
1097
  };
1097
1098
  _text = new WeakMap();
1098
1099
  _align = new WeakMap();
1099
1100
  _verticalAlign = new WeakMap();
1101
+ _lineHeight = new WeakMap();
1100
1102
 
1101
1103
  // src/utils/string.ts
1102
1104
  var binarySearch = ({ max, getValue, match }) => {
@@ -1438,15 +1440,16 @@ var Port = class {
1438
1440
  new Text(description, { color: "white", style: "italic" /* Italic */ }),
1439
1441
  {
1440
1442
  Align: "center" /* Center */,
1441
- Padding: { Top: 8 },
1442
- MaxWidth: 300
1443
+ Padding: { Top: 16 },
1444
+ MaxWidth: 400,
1445
+ LineHeight: 1.5
1443
1446
  }
1444
1447
  ));
1445
1448
  }
1446
1449
  __privateSet(this, _dataTypePopupElement, new ContainerRenderElement(
1447
1450
  containerElements,
1448
1451
  {
1449
- BackgroundColor: "rgba(0, 0, 0, 0.75)",
1452
+ BackgroundColor: "rgba(0, 0, 0, 0.85)",
1450
1453
  Border: {
1451
1454
  Radius: 6
1452
1455
  },
@@ -3126,8 +3129,9 @@ recurseBuildMenu_fn = function(graph, name, subMenu, position) {
3126
3129
  const items = [];
3127
3130
  const subMenus = /* @__PURE__ */ new Map();
3128
3131
  for (let [key, nodeConfig] of subMenu) {
3129
- const elements = key.split("/");
3130
- if (elements.length === 1) {
3132
+ const slashIndex = key.indexOf("/");
3133
+ const bracketIndex = key.indexOf("[");
3134
+ if (slashIndex === -1 || bracketIndex < slashIndex) {
3131
3135
  items.push({
3132
3136
  name: key,
3133
3137
  callback: () => {
@@ -3137,6 +3141,7 @@ recurseBuildMenu_fn = function(graph, name, subMenu, position) {
3137
3141
  }
3138
3142
  });
3139
3143
  } else {
3144
+ const elements = key.split("/");
3140
3145
  if (!subMenus.has(elements[0])) {
3141
3146
  subMenus.set(elements[0], /* @__PURE__ */ new Map());
3142
3147
  }