@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.mjs CHANGED
@@ -985,17 +985,19 @@ renderColumn_fn = function(ctx, position, graphScale, scaledFillableSpace) {
985
985
  };
986
986
 
987
987
  // src/elements/text.ts
988
- var _text, _align, _verticalAlign;
988
+ var _text, _align, _verticalAlign, _lineHeight;
989
989
  var TextElement = class extends RenderElementBase {
990
990
  constructor(text, styling) {
991
- var _a, _b;
991
+ var _a, _b, _c;
992
992
  super(styling);
993
993
  __privateAdd(this, _text);
994
994
  __privateAdd(this, _align);
995
995
  __privateAdd(this, _verticalAlign);
996
+ __privateAdd(this, _lineHeight);
996
997
  __privateSet(this, _text, text);
997
998
  __privateSet(this, _align, (_a = styling == null ? void 0 : styling.Align) != null ? _a : "left" /* Left */);
998
999
  __privateSet(this, _verticalAlign, (_b = styling == null ? void 0 : styling.VerticalAlign) != null ? _b : "top" /* Top */);
1000
+ __privateSet(this, _lineHeight, (_c = styling == null ? void 0 : styling.LineHeight) != null ? _c : 1);
999
1001
  }
1000
1002
  doRender(ctx, position, graphScale, scaledFillableSpace) {
1001
1003
  const scale = Zero();
@@ -1037,7 +1039,7 @@ var TextElement = class extends RenderElementBase {
1037
1039
  for (let i = 0; i < eles.length; i++) {
1038
1040
  eles[i].render(ctx, graphScale, justifiedPosition);
1039
1041
  eles[i].size(ctx, 1, tempSize);
1040
- justifiedPosition.y += tempSize.y;
1042
+ justifiedPosition.y += __privateGet(this, _text).style().getSize() * __privateGet(this, _lineHeight);
1041
1043
  }
1042
1044
  }
1043
1045
  }
@@ -1049,17 +1051,17 @@ var TextElement = class extends RenderElementBase {
1049
1051
  const eles = __privateGet(this, _text).breakIntoLines(ctx, limitations.x);
1050
1052
  const tempSize = { x: 0, y: 0 };
1051
1053
  out.x = 0;
1052
- out.y = 0;
1054
+ out.y = __privateGet(this, _text).style().getSize() * eles.length * __privateGet(this, _lineHeight);
1053
1055
  for (let i = 0; i < eles.length; i++) {
1054
1056
  eles[i].size(ctx, 1, tempSize);
1055
1057
  out.x = Math.max(tempSize.x, out.x);
1056
- out.y += tempSize.y;
1057
1058
  }
1058
1059
  }
1059
1060
  };
1060
1061
  _text = new WeakMap();
1061
1062
  _align = new WeakMap();
1062
1063
  _verticalAlign = new WeakMap();
1064
+ _lineHeight = new WeakMap();
1063
1065
 
1064
1066
  // src/utils/string.ts
1065
1067
  var binarySearch = ({ max, getValue, match }) => {
@@ -1401,15 +1403,16 @@ var Port = class {
1401
1403
  new Text(description, { color: "white", style: "italic" /* Italic */ }),
1402
1404
  {
1403
1405
  Align: "center" /* Center */,
1404
- Padding: { Top: 8 },
1405
- MaxWidth: 300
1406
+ Padding: { Top: 16 },
1407
+ MaxWidth: 400,
1408
+ LineHeight: 1.5
1406
1409
  }
1407
1410
  ));
1408
1411
  }
1409
1412
  __privateSet(this, _dataTypePopupElement, new ContainerRenderElement(
1410
1413
  containerElements,
1411
1414
  {
1412
- BackgroundColor: "rgba(0, 0, 0, 0.75)",
1415
+ BackgroundColor: "rgba(0, 0, 0, 0.85)",
1413
1416
  Border: {
1414
1417
  Radius: 6
1415
1418
  },
@@ -3089,8 +3092,9 @@ recurseBuildMenu_fn = function(graph, name, subMenu, position) {
3089
3092
  const items = [];
3090
3093
  const subMenus = /* @__PURE__ */ new Map();
3091
3094
  for (let [key, nodeConfig] of subMenu) {
3092
- const elements = key.split("/");
3093
- if (elements.length === 1) {
3095
+ const slashIndex = key.indexOf("/");
3096
+ const bracketIndex = key.indexOf("[");
3097
+ if (slashIndex === -1 || bracketIndex < slashIndex) {
3094
3098
  items.push({
3095
3099
  name: key,
3096
3100
  callback: () => {
@@ -3100,6 +3104,7 @@ recurseBuildMenu_fn = function(graph, name, subMenu, position) {
3100
3104
  }
3101
3105
  });
3102
3106
  } else {
3107
+ const elements = key.split("/");
3103
3108
  if (!subMenus.has(elements[0])) {
3104
3109
  subMenus.set(elements[0], /* @__PURE__ */ new Map());
3105
3110
  }