@elicdavis/node-flow 0.1.9 → 0.1.10

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
@@ -3903,14 +3903,16 @@ var NodeState = /* @__PURE__ */ ((NodeState2) => {
3903
3903
  NodeState2[NodeState2["Grabbed"] = 2] = "Grabbed";
3904
3904
  return NodeState2;
3905
3905
  })(NodeState || {});
3906
- var _text7;
3906
+ var _text7, _alwaysShow;
3907
3907
  var MessageRenderer = class {
3908
3908
  constructor(config) {
3909
3909
  __privateAdd(this, _text7);
3910
+ __privateAdd(this, _alwaysShow);
3911
+ __privateSet(this, _alwaysShow, config.alwaysShow ? config.alwaysShow : false);
3910
3912
  __privateSet(this, _text7, new Text(
3911
3913
  config.message,
3912
3914
  {
3913
- color: MessageTypeColor(config.type ? config.type : "info" /* Info */)
3915
+ color: config.color ? config.color : MessageTypeColor(config.type ? config.type : "info" /* Info */)
3914
3916
  },
3915
3917
  {
3916
3918
  LineSpacing: 2.5,
@@ -3918,13 +3920,17 @@ var MessageRenderer = class {
3918
3920
  }
3919
3921
  ));
3920
3922
  }
3921
- render(ctx, scale, position) {
3923
+ render(ctx, scale, position, hovering) {
3924
+ if (!__privateGet(this, _alwaysShow) && !hovering) {
3925
+ return 0;
3926
+ }
3922
3927
  ctx.textAlign = "center" /* Center */;
3923
3928
  __privateGet(this, _text7).render(ctx, scale, position);
3924
3929
  return __privateGet(this, _text7).height(ctx) * scale;
3925
3930
  }
3926
3931
  };
3927
3932
  _text7 = new WeakMap();
3933
+ _alwaysShow = new WeakMap();
3928
3934
  var _position, _title2, _subTitle, _infoSymbol, _infoText, _messages, _input, _output, _widgets, _locked, _canEditTitle, _canEditInfo, _canEditPorts, _contextMenu2, _metadata, _onSelect, _onUnselect, _onFiledrop, _onDragStop, _titleChangeCallback, _infoChangeCallback, _titleColor, _selectedStyle, _stateStyles, _padding2, _portTextStyle, _elementSpacing, _selected, _inputPortPositions, _outputPortPositions, _widgetPositions, _data, _registeredAnyPropertyChangeCallbacks, _registeredPropertyChangeCallbacks, _FlowNode_instances, popupNodeTitleSelection_fn, popupNodeInfoSelection_fn, popupNewButtonWidget_fn, widgetSubmenu_fn, calculateStyle_fn;
3929
3935
  var FlowNode = class {
3930
3936
  constructor(config) {
@@ -4620,7 +4626,7 @@ var FlowNode = class {
4620
4626
  messageStart.y = nodeBounds.Position.y + nodeBounds.Size.y + 15 * camera.zoom;
4621
4627
  for (let i = 0; i < __privateGet(this, _messages).length; i++) {
4622
4628
  const message = __privateGet(this, _messages)[i];
4623
- messageStart.y += message.render(ctx, camera.zoom, messageStart) + 10 * camera.zoom;
4629
+ messageStart.y += message.render(ctx, camera.zoom, messageStart, !(state === 0 /* Idle */)) + 10 * camera.zoom;
4624
4630
  }
4625
4631
  });
4626
4632
  }