@processmaker/modeler 1.30.1 → 1.30.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/modeler",
3
- "version": "1.30.1",
3
+ "version": "1.30.2",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "open-cypress": "TZ=UTC cypress open",
package/src/.DS_Store CHANGED
Binary file
@@ -222,6 +222,8 @@ export default {
222
222
  if (!store.getters.allowSavingElementPosition) {
223
223
  return;
224
224
  }
225
+
226
+ this.$emit('save-state');
225
227
  },
226
228
  repositionCrown() {
227
229
  const shapeView = this.shape.findView(this.paper);
@@ -1190,6 +1190,7 @@ export default {
1190
1190
  if (!this.isDragging && this.dragStart) {
1191
1191
  // is clicked over the shape
1192
1192
  if (cellView) {
1193
+ this.$refs.selector.stopDrag(event);
1193
1194
  this.$refs.selector.selectElement(cellView, event.shiftKey);
1194
1195
  } else {
1195
1196
  this.clearSelection();
@@ -53,7 +53,6 @@ export default {
53
53
  isSelecting: false,
54
54
  isSelected: false,
55
55
  selected: [],
56
- conectedLinks:[],
57
56
  dragging: false,
58
57
  style: {
59
58
  left: '0px',
@@ -97,7 +96,6 @@ export default {
97
96
  watch: {
98
97
  // whenever selected changes
99
98
  selected(newSelected) {
100
- this.prepareConectedLinks(newSelected);
101
99
  this.addToHighlightedNodes(newSelected);
102
100
  },
103
101
  },
@@ -296,24 +294,6 @@ export default {
296
294
  });
297
295
  return elements;
298
296
  },
299
- /**
300
- * Prepare the conectedLinks collection
301
- * @param {Array} shapes
302
- */
303
- prepareConectedLinks(shapes){
304
- const { paper } = this.paperManager;
305
- this.conectedLinks = [];
306
- shapes.forEach((shape) => {
307
- const conectedLinks = this.graph.getConnectedLinks(shape.model);
308
- conectedLinks.forEach((link) => {
309
- const linkView = paper.findViewByModel(link);
310
- if (!this.conectedLinks.some(obj => obj.id === linkView.id)) {
311
- this.conectedLinks.push(linkView);
312
- }
313
- });
314
-
315
- });
316
- },
317
297
  /**
318
298
  * Return the bounding box of the selected elements,
319
299
  * @param {Array} selected
@@ -495,27 +475,13 @@ export default {
495
475
  * @param {Object} event
496
476
  */
497
477
  stopDrag() {
478
+ this.overPoolStopDrag();
479
+ this.$emit('save-state');
498
480
  this.dragging = false;
499
481
  this.stopForceMove = false;
500
482
  // Readjusts the selection box, taking into consideration elements
501
483
  // that are anchored and did not move, such as boundary events.
502
484
  this.updateSelectionBox();
503
- this.updateFlowsWaypoint();
504
- this.overPoolStopDrag();
505
- },
506
- /**
507
- * Selector will update the waypoints of the related flows
508
- */
509
- updateFlowsWaypoint(){
510
- this.conectedLinks.forEach((link)=> {
511
- if (link.model.component && link.model.get('type') === 'standard.Link'){
512
- const start = link.sourceAnchor;
513
- const end = link.targetAnchor;
514
- link.model.component.node.diagram.waypoint = [start,
515
- ...link.model.component.shape.vertices(),
516
- end].map(point => link.model.component.moddle.create('dc:Point', point));
517
- }
518
- });
519
485
  },
520
486
  /**
521
487
  * Translate the Selected shapes adding some custom validations
@@ -666,14 +632,12 @@ export default {
666
632
  */
667
633
  overPoolStopDrag(){
668
634
  if (this.isNotPoolChilds(this.selected)) {
669
- this.$emit('save-state');
670
635
  return;
671
636
  }
672
637
  if (this.isOutOfThePool) {
673
638
  this.rollbackSelection();
674
639
  } else {
675
640
  this.expandToFitElement(this.selected);
676
- this.$emit('save-state');
677
641
  }
678
642
  },
679
643
  /**
@@ -695,7 +659,6 @@ export default {
695
659
  shape.model.translate(deltaX/scale.sx, deltaY/scale.sy);
696
660
  });
697
661
  this.isOutOfThePool = false;
698
- this.updateFlowsWaypoint();
699
662
  await store.commit('allowSavingElementPosition');
700
663
  this.paperManager.setStateValid();
701
664
  await this.$nextTick();
@@ -771,6 +734,7 @@ export default {
771
734
  node: pool.component.node,
772
735
  bounds: pool.getBBox(),
773
736
  });
737
+ this.$emit('save-state');
774
738
  }
775
739
  }
776
740
  },
@@ -218,6 +218,7 @@ export default {
218
218
  this.updateShapePosition(task);
219
219
 
220
220
  this.shape.on('change:position', this.turnInvalidTargetRed);
221
+ this.shape.listenTo(this.paper, 'element:pointerdown', this.attachToValidTarget);
221
222
  },
222
223
  };
223
224
  </script>
@@ -118,23 +118,14 @@ export default {
118
118
  const targetShape = this.shape.getTargetElement();
119
119
  resetShapeColor(targetShape);
120
120
 
121
- this.shape.on('change:vertices', this.onChangeVertices);
121
+ this.shape.listenTo(this.sourceShape, 'change:position', this.updateWaypoints);
122
+ this.shape.listenTo(targetShape, 'change:position', this.updateWaypoints);
123
+ this.shape.on('change:vertices change:source change:target', this.updateWaypoints);
122
124
 
123
125
  const sourceShape = this.shape.getSourceElement();
124
126
  sourceShape.embed(this.shape);
125
127
  this.$emit('set-shape-stacking', sourceShape);
126
128
  },
127
- /**
128
- * On Change vertices handler
129
- * @param {Object} link
130
- * @param {Array} vertices
131
- * @param {Object} options
132
- */
133
- onChangeVertices(link, vertices, options){
134
- if (options && options.ui) {
135
- this.updateWaypoints();
136
- }
137
- },
138
129
  updateWaypoints() {
139
130
  const linkView = this.shape.findView(this.paper);
140
131
  const start = linkView.sourceAnchor;