@node-red/editor-client 3.0.0-beta.1 → 3.0.0-beta.2

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/public/red/red.js CHANGED
@@ -6084,6 +6084,8 @@ RED.nodes = (function() {
6084
6084
  workspacesOrder = [];
6085
6085
  groups = {};
6086
6086
  groupsByZ = {};
6087
+ junctions = {};
6088
+ junctionsByZ = {};
6087
6089
 
6088
6090
  var subflowIds = Object.keys(subflows);
6089
6091
  subflowIds.forEach(function(id) {
@@ -14615,10 +14617,7 @@ RED.stack = (function() {
14615
14617
  $(opt.icon).prependTo(this.selectLabel);
14616
14618
  }
14617
14619
  else if (opt.icon.indexOf("/") !== -1) {
14618
- image = new Image();
14619
- image.name = opt.icon;
14620
- image.src = mapDeprecatedIcon(opt.icon);
14621
- $('<img>',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel);
14620
+ $('<i>',{class:"red-ui-typedInput-icon", style:"mask-image: url("+opt.icon+"); -webkit-mask-image: url("+opt.icon+"); margin-right: 4px;height: 18px;width:13px"}).prependTo(this.selectLabel);
14622
14621
  }
14623
14622
  else {
14624
14623
  $('<i>',{class:"red-ui-typedInput-icon "+opt.icon,style:"min-width: 13px; margin-right: 4px;"}).prependTo(this.selectLabel);
@@ -19552,7 +19551,6 @@ RED.view = (function() {
19552
19551
  var selectNodesOptions;
19553
19552
 
19554
19553
  let flashingNodeId;
19555
- let flashingNodeTimer;
19556
19554
 
19557
19555
  var clipboard = "";
19558
19556
 
@@ -19632,7 +19630,8 @@ RED.view = (function() {
19632
19630
  length: function() { return set.length},
19633
19631
  get: function(i) { return set[i] },
19634
19632
  forEach: function(func) { set.forEach(func) },
19635
- nodes: function() { return set.map(function(n) { return n.n })}
19633
+ nodes: function() { return set.map(function(n) { return n.n })},
19634
+ has: function(node) { return setIds.has(node.id) }
19636
19635
  }
19637
19636
  return api;
19638
19637
  })();
@@ -19664,11 +19663,6 @@ RED.view = (function() {
19664
19663
 
19665
19664
  function init() {
19666
19665
 
19667
- // setTimeout(function() {
19668
- // function snap(p) { return RED.view.gridSize() * Math.round(p/RED.view.gridSize())}; for (var i = 0;i<10;i++) {
19669
- // RED.nodes.addJunction({_def:{defaults:{}}, type:'junction', z:"0ccdc1d81f2729cc",id:RED.nodes.id(),x:snap(Math.floor(Math.random()*600)),y:snap(Math.floor(Math.random()*600)), w:0,h:0})
19670
- // } ; RED.view.redraw(true)
19671
- // },2000)
19672
19666
  chart = $("#red-ui-workspace-chart");
19673
19667
 
19674
19668
  outer = d3.select("#red-ui-workspace-chart")
@@ -20419,8 +20413,9 @@ RED.view = (function() {
20419
20413
  }
20420
20414
 
20421
20415
  function canvasMouseDown() {
20422
- if (RED.view.DEBUG) { console.warn("canvasMouseDown", mouse_mode); }
20423
- var point;
20416
+ if (RED.view.DEBUG) {
20417
+ console.warn("canvasMouseDown", { mouse_mode, point: d3.mouse(this), event: d3.event });
20418
+ }
20424
20419
  if (mouse_mode === RED.state.SELECTING_NODE) {
20425
20420
  d3.event.stopPropagation();
20426
20421
  return;
@@ -20437,45 +20432,49 @@ RED.view = (function() {
20437
20432
  selectedLinks.clear();
20438
20433
  updateSelection();
20439
20434
  }
20440
- if (mouse_mode === 0) {
20441
- if (lasso) {
20442
- lasso.remove();
20443
- lasso = null;
20444
- }
20435
+ if (mouse_mode === 0 && lasso) {
20436
+ lasso.remove();
20437
+ lasso = null;
20445
20438
  }
20446
- if ((mouse_mode === 0 || mouse_mode === RED.state.QUICK_JOINING) && (d3.event.touches || d3.event.button === 0) && (d3.event.metaKey || d3.event.ctrlKey)) {
20447
- // Trigger quick add dialog
20448
- d3.event.stopPropagation();
20449
- clearSelection();
20450
- point = d3.mouse(this);
20451
- var clickedGroup = getGroupAt(point[0],point[1]);
20452
- if (drag_lines.length > 0) {
20453
- clickedGroup = clickedGroup || RED.nodes.group(drag_lines[0].node.g)
20454
- }
20455
- showQuickAddDialog({position:point, group:clickedGroup});
20456
- } else if (mouse_mode === 0 && (d3.event.touches || d3.event.button === 0) && !(d3.event.metaKey || d3.event.ctrlKey)) {
20457
- // Tigger lasso
20458
- if (!touchStartTime) {
20459
- point = d3.mouse(this);
20460
- lasso = eventLayer.append("rect")
20461
- .attr("ox",point[0])
20462
- .attr("oy",point[1])
20463
- .attr("rx",1)
20464
- .attr("ry",1)
20465
- .attr("x",point[0])
20466
- .attr("y",point[1])
20467
- .attr("width",0)
20468
- .attr("height",0)
20469
- .attr("class","nr-ui-view-lasso");
20470
- d3.event.preventDefault();
20439
+ if (d3.event.touches || d3.event.button === 0) {
20440
+ if ((mouse_mode === 0 || mouse_mode === RED.state.QUICK_JOINING) && (d3.event.metaKey || d3.event.ctrlKey) && !(d3.event.altKey || d3.event.shiftKey)) {
20441
+ // Trigger quick add dialog
20442
+ d3.event.stopPropagation();
20443
+ clearSelection();
20444
+ const point = d3.mouse(this);
20445
+ var clickedGroup = getGroupAt(point[0], point[1]);
20446
+ if (drag_lines.length > 0) {
20447
+ clickedGroup = clickedGroup || RED.nodes.group(drag_lines[0].node.g)
20448
+ }
20449
+ showQuickAddDialog({ position: point, group: clickedGroup });
20450
+ } else if (mouse_mode === 0 && !(d3.event.metaKey || d3.event.ctrlKey)) {
20451
+ // CTRL not being held
20452
+ if (!d3.event.altKey) {
20453
+ // ALT not held (shift is allowed) Trigger lasso
20454
+ if (!touchStartTime) {
20455
+ const point = d3.mouse(this);
20456
+ lasso = eventLayer.append("rect")
20457
+ .attr("ox", point[0])
20458
+ .attr("oy", point[1])
20459
+ .attr("rx", 1)
20460
+ .attr("ry", 1)
20461
+ .attr("x", point[0])
20462
+ .attr("y", point[1])
20463
+ .attr("width", 0)
20464
+ .attr("height", 0)
20465
+ .attr("class", "nr-ui-view-lasso");
20466
+ d3.event.preventDefault();
20467
+ }
20468
+ } else if (d3.event.altKey) {
20469
+ //Alt [+shift] held - Begin slicing
20470
+ clearSelection();
20471
+ mouse_mode = (d3.event.shiftKey) ? RED.state.SLICING_JUNCTION : RED.state.SLICING;
20472
+ const point = d3.mouse(this);
20473
+ slicePath = eventLayer.append("path").attr("class", "nr-ui-view-slice").attr("d", `M${point[0]} ${point[1]}`)
20474
+ slicePathLast = point;
20475
+ RED.view.redraw();
20476
+ }
20471
20477
  }
20472
- } else if (mouse_mode === 0 && d3.event.button === 2 && (d3.event.metaKey || d3.event.ctrlKey || d3.event.shiftKey)) {
20473
- clearSelection();
20474
- mouse_mode = (d3.event.metaKey || d3.event.ctrlKey)?RED.state.SLICING : RED.state.SLICING_JUNCTION;
20475
- point = d3.mouse(this);
20476
- slicePath = eventLayer.append("path").attr("class","nr-ui-view-slice").attr("d",`M${point[0]} ${point[1]}`)
20477
- slicePathLast = point;
20478
- RED.view.redraw();
20479
20478
  }
20480
20479
  }
20481
20480
 
@@ -21178,7 +21177,9 @@ RED.view = (function() {
21178
21177
 
21179
21178
  function canvasMouseUp() {
21180
21179
  lastClickPosition = [d3.event.offsetX/scaleFactor,d3.event.offsetY/scaleFactor];
21181
- if (RED.view.DEBUG) { console.warn("canvasMouseUp", mouse_mode); }
21180
+ if (RED.view.DEBUG) {
21181
+ console.warn("canvasMouseUp", { mouse_mode, point: d3.mouse(this), event: d3.event });
21182
+ }
21182
21183
  var i;
21183
21184
  var historyEvent;
21184
21185
  if (mouse_mode === RED.state.PANNING) {
@@ -21321,7 +21322,7 @@ RED.view = (function() {
21321
21322
  slicePath = null;
21322
21323
  RED.view.redraw(true);
21323
21324
  } else if (mouse_mode == RED.state.SLICING_JUNCTION) {
21324
- var removedLinks = []
21325
+ var removedLinks = new Set()
21325
21326
  var addedLinks = []
21326
21327
  var addedJunctions = []
21327
21328
 
@@ -21330,8 +21331,14 @@ RED.view = (function() {
21330
21331
  var sourceId = l.source.id+":"+l.sourcePort
21331
21332
  groupedLinks[sourceId] = groupedLinks[sourceId] || []
21332
21333
  groupedLinks[sourceId].push(l)
21334
+
21335
+ groupedLinks[l.target.id] = groupedLinks[l.target.id] || []
21336
+ groupedLinks[l.target.id].push(l)
21333
21337
  });
21334
21338
  var linkGroups = Object.keys(groupedLinks)
21339
+ linkGroups.sort(function(A,B) {
21340
+ return groupedLinks[B].length - groupedLinks[A].length
21341
+ })
21335
21342
  linkGroups.forEach(function(gid) {
21336
21343
  var links = groupedLinks[gid]
21337
21344
  var junction = {
@@ -21346,6 +21353,10 @@ RED.view = (function() {
21346
21353
  inputs: 1,
21347
21354
  dirty: true
21348
21355
  }
21356
+ links = links.filter(function(l) { return !removedLinks.has(l) })
21357
+ if (links.length === 0) {
21358
+ return
21359
+ }
21349
21360
  links.forEach(function(l) {
21350
21361
  junction.x += l._sliceLocation.x
21351
21362
  junction.y += l._sliceLocation.y
@@ -21361,20 +21372,38 @@ RED.view = (function() {
21361
21372
 
21362
21373
  RED.nodes.addJunction(junction)
21363
21374
  addedJunctions.push(junction)
21364
- var newLink = {
21365
- source: links[0].source,
21366
- sourcePort: links[0].sourcePort,
21367
- target: junction
21375
+ let newLink
21376
+ if (gid === links[0].source.id+":"+links[0].sourcePort) {
21377
+ newLink = {
21378
+ source: links[0].source,
21379
+ sourcePort: links[0].sourcePort,
21380
+ target: junction
21381
+ }
21382
+ } else {
21383
+ newLink = {
21384
+ source: junction,
21385
+ sourcePort: 0,
21386
+ target: links[0].target
21387
+ }
21368
21388
  }
21369
21389
  addedLinks.push(newLink)
21370
21390
  RED.nodes.addLink(newLink)
21371
21391
  links.forEach(function(l) {
21372
- removedLinks.push(l)
21392
+ removedLinks.add(l)
21373
21393
  RED.nodes.removeLink(l)
21374
- var newLink = {
21375
- source: junction,
21376
- sourcePort: 0,
21377
- target: l.target
21394
+ let newLink
21395
+ if (gid === l.target.id) {
21396
+ newLink = {
21397
+ source: l.source,
21398
+ sourcePort: l.sourcePort,
21399
+ target: junction
21400
+ }
21401
+ } else {
21402
+ newLink = {
21403
+ source: junction,
21404
+ sourcePort: 0,
21405
+ target: l.target
21406
+ }
21378
21407
  }
21379
21408
  addedLinks.push(newLink)
21380
21409
  RED.nodes.addLink(newLink)
@@ -21396,7 +21425,7 @@ RED.view = (function() {
21396
21425
  t: 'add',
21397
21426
  links: addedLinks,
21398
21427
  junctions: addedJunctions,
21399
- removedLinks: removedLinks
21428
+ removedLinks: Array.from(removedLinks)
21400
21429
  })
21401
21430
  RED.nodes.dirty(true)
21402
21431
  }
@@ -22377,7 +22406,7 @@ RED.view = (function() {
22377
22406
  } else if (drag_line.portType === PORT_TYPE_INPUT) {
22378
22407
  src = mouseup_node;
22379
22408
  dst = drag_line.node;
22380
- src_port = portIndex;
22409
+ src_port = portIndex || 0;
22381
22410
  }
22382
22411
  var link = {source: src, sourcePort:src_port, target: dst};
22383
22412
  if (drag_line.virtualLink) {
@@ -22668,52 +22697,16 @@ RED.view = (function() {
22668
22697
  port.classed("red-ui-flow-port-hovered",false);
22669
22698
  }
22670
22699
 
22671
- function junctionMouseOver(junction, d) {
22672
- junction.classed("red-ui-flow-junction-hovered",true);
22700
+ function junctionMouseOver(junction, d, portType) {
22701
+ var active = (portType === undefined) ||
22702
+ (mouse_mode !== RED.state.JOINING && mouse_mode !== RED.state.QUICK_JOINING) ||
22703
+ (drag_lines.length > 0 && drag_lines[0].portType !== portType && !drag_lines[0].virtualLink)
22704
+ junction.classed("red-ui-flow-junction-hovered", active);
22673
22705
  }
22674
22706
  function junctionMouseOut(junction, d) {
22675
22707
  junction.classed("red-ui-flow-junction-hovered",false);
22676
22708
  }
22677
22709
 
22678
- function junctionMouseDown(junction, d, evt) {
22679
- if (RED.view.DEBUG) { console.warn("junctionMouseDown", d); }
22680
- evt = evt || d3.event;
22681
- d3.event = evt
22682
- if (evt === 1) {
22683
- return;
22684
- }
22685
- if (mouse_mode === RED.state.SELECTING_NODE) {
22686
- evt.stopPropagation();
22687
- return;
22688
- }
22689
- if (mouse_mode == RED.state.QUICK_JOINING) {
22690
- d3.event.stopPropagation();
22691
- return;
22692
- }
22693
-
22694
- // mousedown_node = d;
22695
- // mousedown_port_type = portType;
22696
- // mousedown_port_index = portIndex || 0;
22697
- if (mouse_mode !== RED.state.QUICK_JOINING && (evt.ctrlKey || evt.metaKey)) {
22698
- mouse_mode = RED.state.QUICK_JOINING;
22699
- document.body.style.cursor = "crosshair";
22700
- showDragLines([{node:d,port:0,portType: PORT_TYPE_OUTPUT}]);
22701
- $(window).on('keyup',disableQuickJoinEventHandler);
22702
- } else if (event.button != 2) {
22703
- nodeMouseDown.call(junction[0][0],d)
22704
- // clearSelection();
22705
- // movingSet.add(d);
22706
- // mousedown_node = d;
22707
- // mouse_mode = RED.state.MOVING;
22708
- // var mouse = d3.touches(junction[0][0])[0]||d3.mouse(junction[0][0]);
22709
- // mouse[0] += d.x-d.w/2;
22710
- // mouse[1] += d.y-d.h/2;
22711
- // prepareDrag(mouse);
22712
- }
22713
- evt.stopPropagation();
22714
- evt.preventDefault();
22715
- }
22716
-
22717
22710
  function prepareDrag(mouse) {
22718
22711
  mouse_mode = RED.state.MOVING;
22719
22712
  // Called when movingSet should be prepared to be dragged
@@ -22873,6 +22866,9 @@ RED.view = (function() {
22873
22866
  return;
22874
22867
  } else if (mouse_mode === RED.state.SELECTING_NODE) {
22875
22868
  d3.event.stopPropagation();
22869
+ if (d.type === 'junction') {
22870
+ return
22871
+ }
22876
22872
  if (selectNodesOptions.single) {
22877
22873
  selectNodesOptions.done(d);
22878
22874
  return;
@@ -22899,12 +22895,12 @@ RED.view = (function() {
22899
22895
  var now = Date.now();
22900
22896
  clickElapsed = now-clickTime;
22901
22897
  clickTime = now;
22902
- dblClickPrimed = (lastClickNode == mousedown_node &&
22898
+ dblClickPrimed = lastClickNode == mousedown_node &&
22903
22899
  (d3.event.touches || d3.event.button === 0) &&
22904
22900
  !d3.event.shiftKey && !d3.event.altKey &&
22905
- clickElapsed < dblClickInterval
22906
- )
22907
- lastClickNode = mousedown_node;
22901
+ clickElapsed < dblClickInterval &&
22902
+ d.type !== 'junction'
22903
+ lastClickNode = mousedown_node;
22908
22904
 
22909
22905
  if (!d.selected && d.g /*&& !RED.nodes.group(d.g).selected*/) {
22910
22906
  var nodeGroup = RED.nodes.group(d.g);
@@ -23030,9 +23026,9 @@ RED.view = (function() {
23030
23026
  clearSelection();
23031
23027
  }
23032
23028
  var clickPosition = (d3.event.offsetX/scaleFactor - mousedown_node.x)
23033
- var edgeDelta = (mousedown_node.w/2) - Math.abs(clickPosition);
23029
+ var edgeDelta = ((mousedown_node.w||10)/2) - Math.abs(clickPosition);
23034
23030
  var cnodes;
23035
- var targetEdgeDelta = mousedown_node.w > 30 ? 25 : 8;
23031
+ var targetEdgeDelta = mousedown_node.w > 30 ? 25 : (mousedown_node.w > 0 ? 8 : 3);
23036
23032
  if (edgeDelta < targetEdgeDelta) {
23037
23033
  if (clickPosition < 0) {
23038
23034
  cnodes = [mousedown_node].concat(RED.nodes.getAllUpstreamNodes(mousedown_node));
@@ -23177,12 +23173,13 @@ RED.view = (function() {
23177
23173
  function portMouseOverProxy(e) { portMouseOver(d3.select(this), this.__data__,this.__portType__,this.__portIndex__, e); }
23178
23174
  function portMouseOutProxy(e) { portMouseOut(d3.select(this), this.__data__,this.__portType__,this.__portIndex__, e); }
23179
23175
 
23180
- function junctionMouseOverProxy(e) { junctionMouseOver(d3.select(this), this.__data__) }
23176
+ function junctionMouseOverProxy(e) { junctionMouseOver(d3.select(this), this.__data__, this.__portType__) }
23181
23177
  function junctionMouseOutProxy(e) { junctionMouseOut(d3.select(this), this.__data__) }
23182
- function junctionMouseDownProxy(e) { junctionMouseDown(d3.select(this), this.__data__, e) }
23183
- function junctionMouseUpProxy(e) { junctionMouseUp(d3.select(this), this.__data__) }
23184
23178
 
23185
23179
  function linkMouseDown(d) {
23180
+ if (RED.view.DEBUG) {
23181
+ console.warn("linkMouseDown", { mouse_mode, point: d3.mouse(this), event: d3.event });
23182
+ }
23186
23183
  if (mouse_mode === RED.state.SELECTING_NODE) {
23187
23184
  d3.event.stopPropagation();
23188
23185
  return;
@@ -24331,22 +24328,56 @@ RED.view = (function() {
24331
24328
  junctionBack.setAttribute("y",-5);
24332
24329
  junctionBack.setAttribute("width",10);
24333
24330
  junctionBack.setAttribute("height",10);
24334
- junctionBack.setAttribute("rx",5);
24335
- junctionBack.setAttribute("ry",5);
24331
+ junctionBack.setAttribute("rx",3);
24332
+ junctionBack.setAttribute("ry",3);
24336
24333
  junctionBack.__data__ = d;
24337
24334
  this.__junctionBack__ = junctionBack;
24338
24335
  contents.appendChild(junctionBack);
24339
24336
 
24337
+ var junctionInput = document.createElementNS("http://www.w3.org/2000/svg","rect");
24338
+ junctionInput.setAttribute("class","red-ui-flow-junction-port red-ui-flow-junction-port-input");
24339
+ junctionInput.setAttribute("x",-5);
24340
+ junctionInput.setAttribute("y",-5);
24341
+ junctionInput.setAttribute("width",10);
24342
+ junctionInput.setAttribute("height",10);
24343
+ junctionInput.setAttribute("rx",3);
24344
+ junctionInput.setAttribute("ry",3);
24345
+ junctionInput.__data__ = d;
24346
+ junctionInput.__portType__ = PORT_TYPE_INPUT;
24347
+ junctionInput.__portIndex__ = 0;
24348
+ this.__junctionInput__ = junctionOutput;
24349
+ contents.appendChild(junctionInput);
24350
+ junctionInput.addEventListener("mouseup", portMouseUpProxy);
24351
+ junctionInput.addEventListener("mousedown", portMouseDownProxy);
24352
+
24353
+
24354
+ this.__junctionInput__ = junctionInput;
24355
+ contents.appendChild(junctionInput);
24356
+ var junctionOutput = document.createElementNS("http://www.w3.org/2000/svg","rect");
24357
+ junctionOutput.setAttribute("class","red-ui-flow-junction-port red-ui-flow-junction-port-output");
24358
+ junctionOutput.setAttribute("x",-5);
24359
+ junctionOutput.setAttribute("y",-5);
24360
+ junctionOutput.setAttribute("width",10);
24361
+ junctionOutput.setAttribute("height",10);
24362
+ junctionOutput.setAttribute("rx",3);
24363
+ junctionOutput.setAttribute("ry",3);
24364
+ junctionOutput.__data__ = d;
24365
+ junctionOutput.__portType__ = PORT_TYPE_OUTPUT;
24366
+ junctionOutput.__portIndex__ = 0;
24367
+ this.__junctionOutput__ = junctionOutput;
24368
+ contents.appendChild(junctionOutput);
24369
+ junctionOutput.addEventListener("mouseup", portMouseUpProxy);
24370
+ junctionOutput.addEventListener("mousedown", portMouseDownProxy);
24371
+
24372
+ junctionOutput.addEventListener("mouseover", junctionMouseOverProxy);
24373
+ junctionOutput.addEventListener("mouseout", junctionMouseOutProxy);
24374
+ junctionInput.addEventListener("mouseover", junctionMouseOverProxy);
24375
+ junctionInput.addEventListener("mouseout", junctionMouseOutProxy);
24340
24376
  junctionBack.addEventListener("mouseover", junctionMouseOverProxy);
24341
24377
  junctionBack.addEventListener("mouseout", junctionMouseOutProxy);
24342
- junctionBack.addEventListener("mouseup", portMouseUpProxy);
24343
- junctionBack.addEventListener("mousedown", junctionMouseDownProxy);
24344
-
24345
- // d3.select(junctionBack).on("mousedown", nodeMouseDown);
24346
24378
 
24347
- this.__portType__ = PORT_TYPE_INPUT
24348
- this.__portIndex__ = 0
24349
- // function portMouseUpProxy(e) { portMouseUp(this.__data__,this.__portType__,this.__portIndex__, e); }
24379
+ // These handlers expect to be registered as d3 events
24380
+ d3.select(junctionBack).on("mousedown", nodeMouseDown).on("mouseup", nodeMouseUp);
24350
24381
 
24351
24382
  junction[0][0].appendChild(contents);
24352
24383
  })
@@ -24355,6 +24386,7 @@ RED.view = (function() {
24355
24386
  var junction = d3.select(this);
24356
24387
  this.setAttribute("transform", "translate(" + (d.x) + "," + (d.y) + ")");
24357
24388
  if (d.dirty) {
24389
+ junction.classed("red-ui-flow-junction-dragging", mouse_mode === RED.state.MOVING_ACTIVE && movingSet.has(d))
24358
24390
  junction.classed("selected", !!d.selected)
24359
24391
  dirtyNodes[d.id] = d;
24360
24392
 
@@ -24395,10 +24427,11 @@ RED.view = (function() {
24395
24427
  .on("touchstart",linkTouchStart)
24396
24428
  .on("mousemove", function(d) {
24397
24429
  if (mouse_mode === RED.state.SLICING) {
24430
+
24398
24431
  selectedLinks.add(d)
24399
24432
  l.classed("red-ui-flow-link-splice",true)
24400
24433
  redraw()
24401
- } else if (mouse_mode === RED.state.SLICING_JUNCTION) {
24434
+ } else if (mouse_mode === RED.state.SLICING_JUNCTION && !d.link) {
24402
24435
  if (!l.classed("red-ui-flow-link-splice")) {
24403
24436
  // Find intersection point
24404
24437
  var lineLength = pathLine.getTotalLength();
@@ -25312,27 +25345,26 @@ RED.view = (function() {
25312
25345
  if(typeof node === "string") { node = RED.nodes.node(n); }
25313
25346
  if(!node) { return; }
25314
25347
 
25315
- const flashingNode = flashingNodeTimer && flashingNodeId && RED.nodes.node(flashingNodeId);
25348
+ const flashingNode = flashingNodeId && RED.nodes.node(flashingNodeId);
25316
25349
  if(flashingNode) {
25317
25350
  //cancel current flashing node before flashing new node
25318
- clearInterval(flashingNodeTimer);
25319
- flashingNodeTimer = null;
25351
+ clearInterval(flashingNode.__flashTimer);
25352
+ delete flashingNode.__flashTimer;
25320
25353
  flashingNode.dirty = true;
25321
25354
  flashingNode.highlighted = false;
25322
25355
  }
25323
-
25324
- flashingNodeTimer = setInterval(function(flashEndTime) {
25325
- node.dirty = true;
25356
+ node.__flashTimer = setInterval(function(flashEndTime, n) {
25357
+ n.dirty = true;
25326
25358
  if (flashEndTime >= Date.now()) {
25327
- node.highlighted = !node.highlighted;
25359
+ n.highlighted = !n.highlighted;
25328
25360
  } else {
25329
- clearInterval(flashingNodeTimer);
25330
- flashingNodeTimer = null;
25331
- node.highlighted = false;
25361
+ clearInterval(n.__flashTimer);
25362
+ delete n.__flashTimer;
25332
25363
  flashingNodeId = null;
25364
+ n.highlighted = false;
25333
25365
  }
25334
25366
  RED.view.redraw();
25335
- }, 100, Date.now() + 2200)
25367
+ }, 100, Date.now() + 2200, node)
25336
25368
  flashingNodeId = node.id;
25337
25369
  node.highlighted = true;
25338
25370
  RED.view.redraw();
@@ -34472,7 +34504,6 @@ RED.editor = (function() {
34472
34504
  this.tabflowEditor = RED.editor.createEditor({
34473
34505
  id: 'node-input-info',
34474
34506
  mode: 'ace/mode/markdown',
34475
- stateId: options.stateId,
34476
34507
  value: ""
34477
34508
  });
34478
34509
 
@@ -36920,8 +36951,8 @@ RED.editor = (function() {
36920
36951
  types:[
36921
36952
  'str','num','bool',
36922
36953
  {value:"null",label:RED._("common.type.null"),hasValue:false},
36923
- {value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.png"},
36924
- {value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.png"}
36954
+ {value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.svg"},
36955
+ {value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.svg"}
36925
36956
  ],
36926
36957
  default: valType
36927
36958
  });
@@ -42300,7 +42331,6 @@ RED.search = (function() {
42300
42331
 
42301
42332
  function search(val) {
42302
42333
  var results = [];
42303
- var keys = [];
42304
42334
  var typeFilter;
42305
42335
  var m = /(?:^| )type:([^ ]+)/.exec(val);
42306
42336
  if (m) {
@@ -42314,19 +42344,24 @@ RED.search = (function() {
42314
42344
  val = extractFlag(val,"subflow",flags);
42315
42345
  val = extractFlag(val,"hidden",flags);
42316
42346
  val = extractFlag(val,"modified",flags);
42317
- // uses:<node-id>
42318
- val = extractValue(val,"uses",flags);
42319
-
42320
- var hasFlags = Object.keys(flags).length > 0;
42321
-
42347
+ val = extractValue(val,"flow",flags);// flow:active or flow:<flow-id>
42348
+ val = extractValue(val,"uses",flags);// uses:<node-id>
42322
42349
  val = val.trim();
42323
-
42350
+ var hasFlags = Object.keys(flags).length > 0;
42351
+ if (flags.flow && flags.flow.indexOf("current") >= 0) {
42352
+ let idx = flags.flow.indexOf("current");
42353
+ flags.flow[idx] = RED.workspaces.active();//convert active to flow ID
42354
+ }
42355
+ if (flags.flow && flags.flow.length) {
42356
+ flags.flow = [ ...new Set(flags.flow) ]; //deduplicate
42357
+ }
42324
42358
  if (val.length > 0 || typeFilter || hasFlags) {
42325
42359
  val = val.toLowerCase();
42326
42360
  var i;
42327
42361
  var j;
42328
42362
  var list = [];
42329
42363
  var nodes = {};
42364
+ let keys = [];
42330
42365
  if (flags.uses) {
42331
42366
  keys = flags.uses;
42332
42367
  } else {
@@ -42336,7 +42371,7 @@ RED.search = (function() {
42336
42371
  var key = keys[i];
42337
42372
  var kpos = keys[i].indexOf(val);
42338
42373
  if (kpos > -1) {
42339
- var ids = Object.keys(index[key]);
42374
+ var ids = Object.keys(index[key]||{});
42340
42375
  for (j=0;j<ids.length;j++) {
42341
42376
  var node = index[key][ids[j]];
42342
42377
  var isConfigNode = node.node._def.category === "config" && node.node.type !== 'group';
@@ -42380,6 +42415,11 @@ RED.search = (function() {
42380
42415
  continue;
42381
42416
  }
42382
42417
  }
42418
+ if (flags.hasOwnProperty("flow")) {
42419
+ if (flags.flow.indexOf(node.node.z || node.node.id) < 0) {
42420
+ continue;
42421
+ }
42422
+ }
42383
42423
  if (!typeFilter || node.node.type === typeFilter) {
42384
42424
  nodes[node.node.id] = nodes[node.node.id] = {
42385
42425
  node: node.node,
@@ -42447,7 +42487,7 @@ RED.search = (function() {
42447
42487
  }
42448
42488
  currentResults = search(value);
42449
42489
  if (currentResults.length > 0) {
42450
- for (i=0;i<Math.min(currentResults.length,25);i++) {
42490
+ for (let i=0;i<Math.min(currentResults.length,25);i++) {
42451
42491
  searchResults.editableList('addItem',currentResults[i])
42452
42492
  }
42453
42493
  if (currentResults.length > 25) {
@@ -42784,8 +42824,8 @@ RED.search = (function() {
42784
42824
  {label:RED._("search.options.uknownNodes"), value: "type:unknown"},
42785
42825
  {label:RED._("search.options.unusedSubflows"), value:"is:subflow is:unused"},
42786
42826
  {label:RED._("search.options.hiddenFlows"), value:"is:hidden"},
42827
+ {label:RED._("search.options.thisFlow"), value:"flow:current"},
42787
42828
  ]
42788
-
42789
42829
  }
42790
42830
 
42791
42831
  function init() {
@@ -45123,9 +45163,6 @@ RED.group = (function() {
45123
45163
  groups: [ ],
45124
45164
  dirty: RED.nodes.dirty()
45125
45165
  }
45126
- RED.history.push(historyEvent);
45127
-
45128
-
45129
45166
  groups.forEach(function(g) {
45130
45167
  newSelection = newSelection.concat(ungroup(g))
45131
45168
  historyEvent.groups.push(g);