@processmaker/modeler 1.39.2 → 1.39.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.
@@ -27142,6 +27142,7 @@ function isPoint(item) {
27142
27142
  sourceShape: null,
27143
27143
  target: null,
27144
27144
  listeningToMouseup: false,
27145
+ listeningToMouseleave: false,
27145
27146
  vertices: null,
27146
27147
  anchorPointFunction: getDefaultAnchorPoint
27147
27148
  };
@@ -27273,10 +27274,11 @@ function isPoint(item) {
27273
27274
  var targetShape = this.shape.getTargetElement();
27274
27275
  resetShapeColor(targetShape);
27275
27276
  this.shape.on('change:vertices', this.onChangeVertices);
27276
- this.shape.on('change:source', this.onChangeVertices);
27277
- this.shape.on('change:target', this.onChangeVertices);
27277
+ this.shape.on('change:source', this.onChangeTargets);
27278
+ this.shape.on('change:target', this.onChangeTargets);
27278
27279
  this.shape.listenTo(this.sourceShape, 'change:position', this.updateWaypoints);
27279
27280
  this.shape.listenTo(targetShape, 'change:position', this.updateWaypoints);
27281
+ this.shape.listenTo(this.paper, 'link:mouseleave', this.storeWaypoints);
27280
27282
  var sourceShape = this.shape.getSourceElement();
27281
27283
  sourceShape.embed(this.shape);
27282
27284
  this.$emit('set-shape-stacking', sourceShape);
@@ -27289,46 +27291,90 @@ function isPoint(item) {
27289
27291
  resolve();
27290
27292
  });
27291
27293
  },
27294
+ storeWaypoints: function storeWaypoints() {
27295
+ var _this4 = this;
27296
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
27297
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
27298
+ while (1) switch (_context.prev = _context.next) {
27299
+ case 0:
27300
+ if (!(_this4.highlighted && !_this4.listeningToMouseleave)) {
27301
+ _context.next = 6;
27302
+ break;
27303
+ }
27304
+ _this4.updateWaypoints();
27305
+ _context.next = 4;
27306
+ return _this4.$nextTick();
27307
+ case 4:
27308
+ _this4.listeningToMouseleave = true;
27309
+ _this4.$emit('save-state');
27310
+ case 6:
27311
+ case "end":
27312
+ return _context.stop();
27313
+ }
27314
+ }, _callee);
27315
+ }))();
27316
+ },
27292
27317
  /**
27293
27318
  * On Change vertices handler
27294
27319
  * @param {Object} link
27295
27320
  * @param {Array} vertices
27296
27321
  * @param {Object} options
27297
27322
  */
27298
- onChangeVertices: function onChangeVertices(link, vertices, options) {
27299
- var _this4 = this;
27300
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
27301
- return _regeneratorRuntime().wrap(function _callee$(_context) {
27302
- while (1) switch (_context.prev = _context.next) {
27323
+ onChangeTargets: function onChangeTargets(link, vertices, options) {
27324
+ var _this5 = this;
27325
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
27326
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
27327
+ while (1) switch (_context2.prev = _context2.next) {
27303
27328
  case 0:
27304
27329
  if (!(options && options.ui)) {
27305
- _context.next = 8;
27330
+ _context2.next = 7;
27306
27331
  break;
27307
27332
  }
27308
- _context.next = 3;
27309
- return _this4.$nextTick();
27333
+ _context2.next = 3;
27334
+ return _this5.$nextTick();
27310
27335
  case 3:
27311
- _context.next = 5;
27312
- return _this4.waitForUpdateWaypoints();
27336
+ _context2.next = 5;
27337
+ return _this5.waitForUpdateWaypoints();
27313
27338
  case 5:
27314
- _context.next = 7;
27315
- return _this4.$nextTick();
27339
+ _context2.next = 7;
27340
+ return _this5.storeWaypoints();
27316
27341
  case 7:
27317
- _this4.$emit('save-state');
27318
- case 8:
27319
27342
  case "end":
27320
- return _context.stop();
27343
+ return _context2.stop();
27321
27344
  }
27322
- }, _callee);
27345
+ }, _callee2);
27346
+ }))();
27347
+ },
27348
+ onChangeVertices: function onChangeVertices(link, vertices, options) {
27349
+ var _this6 = this;
27350
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
27351
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
27352
+ while (1) switch (_context3.prev = _context3.next) {
27353
+ case 0:
27354
+ if (!(options && options.ui)) {
27355
+ _context3.next = 6;
27356
+ break;
27357
+ }
27358
+ _this6.updateWaypoints();
27359
+ _context3.next = 4;
27360
+ return _this6.$nextTick();
27361
+ case 4:
27362
+ _this6.listeningToMouseleave = false;
27363
+ _this6.$emit('save-state');
27364
+ case 6:
27365
+ case "end":
27366
+ return _context3.stop();
27367
+ }
27368
+ }, _callee3);
27323
27369
  }))();
27324
27370
  },
27325
27371
  updateWaypoints: function updateWaypoints() {
27326
- var _this5 = this;
27372
+ var _this7 = this;
27327
27373
  var linkView = this.shape.findView(this.paper);
27328
27374
  var start = linkView.sourceAnchor;
27329
27375
  var end = linkView.targetAnchor;
27330
27376
  this.node.diagram.waypoint = [start].concat(_toConsumableArray(this.shape.vertices()), [end]).map(function (point) {
27331
- return _this5.moddle.create('dc:Point', point);
27377
+ return _this7.moddle.create('dc:Point', point);
27332
27378
  });
27333
27379
  if (!this.listeningToMouseup) {
27334
27380
  this.listeningToMouseup = true;
@@ -27336,7 +27382,7 @@ function isPoint(item) {
27336
27382
  }
27337
27383
  },
27338
27384
  updateLinkTarget: function updateLinkTarget(_ref) {
27339
- var _this6 = this;
27385
+ var _this8 = this;
27340
27386
  var clientX = _ref.clientX,
27341
27387
  clientY = _ref.clientY;
27342
27388
  var localMousePosition = this.paper.clientToLocalPoint({
@@ -27365,19 +27411,19 @@ function isPoint(item) {
27365
27411
  setShapeColor(this.target, validNodeColor);
27366
27412
  this.paper.el.removeEventListener('mousemove', this.updateLinkTarget);
27367
27413
  this.shape.listenToOnce(this.paper, 'cell:pointerclick', function () {
27368
- _this6.completeLink();
27369
- _this6.updateWaypoints();
27370
- _this6.updateWaypoints.flush();
27371
- if (_this6.updateDefinitionLinks) {
27372
- _this6.updateDefinitionLinks();
27414
+ _this8.completeLink();
27415
+ _this8.updateWaypoints();
27416
+ _this8.updateWaypoints.flush();
27417
+ if (_this8.updateDefinitionLinks) {
27418
+ _this8.updateDefinitionLinks();
27373
27419
  }
27374
- _this6.$emit('save-state');
27420
+ _this8.$emit('save-state');
27375
27421
  });
27376
27422
  this.shape.listenToOnce(this.paper, 'cell:mouseleave', function () {
27377
- _this6.paper.el.addEventListener('mousemove', _this6.updateLinkTarget);
27378
- _this6.shape.stopListening(_this6.paper, 'cell:pointerclick');
27379
- resetShapeColor(_this6.target);
27380
- _this6.$emit('set-cursor', 'not-allowed');
27423
+ _this8.paper.el.addEventListener('mousemove', _this8.updateLinkTarget);
27424
+ _this8.shape.stopListening(_this8.paper, 'cell:pointerclick');
27425
+ resetShapeColor(_this8.target);
27426
+ _this8.$emit('set-cursor', 'not-allowed');
27381
27427
  });
27382
27428
  },
27383
27429
  removeLink: function removeLink() {
@@ -27427,49 +27473,49 @@ function isPoint(item) {
27427
27473
  this.emitSave.bind(this);
27428
27474
  },
27429
27475
  mounted: function mounted() {
27430
- var _this7 = this;
27431
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
27432
- var targetRef, targetShape, sequenceFlowWaypoints, sourceAnchorPoint, targetAnchorPoint, _targetShape$position, targetX, targetY, targetAnchorOffset, _this7$sourceShape$po, sourceX, sourceY, sourceAnchorOffset, sequenceVertices;
27433
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
27434
- while (1) switch (_context2.prev = _context2.next) {
27476
+ var _this9 = this;
27477
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
27478
+ var targetRef, targetShape, sequenceFlowWaypoints, sourceAnchorPoint, targetAnchorPoint, _targetShape$position, targetX, targetY, targetAnchorOffset, _this9$sourceShape$po, sourceX, sourceY, sourceAnchorOffset, sequenceVertices;
27479
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
27480
+ while (1) switch (_context4.prev = _context4.next) {
27435
27481
  case 0:
27436
- _context2.next = 2;
27437
- return _this7.$nextTick();
27482
+ _context4.next = 2;
27483
+ return _this9.$nextTick();
27438
27484
  case 2:
27439
27485
  /* Use nextTick to ensure this code runs after the component it is mixed into mounts.
27440
27486
  * This will ensure this.shape is defined. */
27441
27487
 
27442
- _this7.sourceShape = _this7.findSourceShape();
27443
- _this7.setSource(_this7.sourceShape);
27444
- _this7.$once('click', function () {
27445
- _this7.$nextTick(function () {
27488
+ _this9.sourceShape = _this9.findSourceShape();
27489
+ _this9.setSource(_this9.sourceShape);
27490
+ _this9.$once('click', function () {
27491
+ _this9.$nextTick(function () {
27446
27492
  if (store.getters.isReadOnly) {
27447
27493
  return;
27448
27494
  }
27449
- _this7.setupLinkTools();
27495
+ _this9.setupLinkTools();
27450
27496
  });
27451
27497
  });
27452
- targetRef = _this7.getTargetRef ? _this7.getTargetRef() : _this7.node.definition.get('targetRef'); // if flow doesn't have a targetRef such as incomplete node, return
27498
+ targetRef = _this9.getTargetRef ? _this9.getTargetRef() : _this9.node.definition.get('targetRef'); // if flow doesn't have a targetRef such as incomplete node, return
27453
27499
  if (targetRef) {
27454
- _context2.next = 8;
27500
+ _context4.next = 8;
27455
27501
  break;
27456
27502
  }
27457
- return _context2.abrupt("return");
27503
+ return _context4.abrupt("return");
27458
27504
  case 8:
27459
27505
  if (targetRef.id) {
27460
- targetShape = _this7.graph.getElements().find(function (element) {
27506
+ targetShape = _this9.graph.getElements().find(function (element) {
27461
27507
  return element.component && element.component.node.definition === targetRef;
27462
27508
  });
27463
- _this7.target = targetShape;
27464
- sequenceFlowWaypoints = _this7.node.diagram.waypoint;
27465
- sourceAnchorPoint = _this7.node.diagram.waypoint[0];
27509
+ _this9.target = targetShape;
27510
+ sequenceFlowWaypoints = _this9.node.diagram.waypoint;
27511
+ sourceAnchorPoint = _this9.node.diagram.waypoint[0];
27466
27512
  targetAnchorPoint = sequenceFlowWaypoints[sequenceFlowWaypoints.length - 1];
27467
27513
  _targetShape$position = targetShape.position(), targetX = _targetShape$position.x, targetY = _targetShape$position.y;
27468
27514
  targetAnchorOffset = {
27469
27515
  x: targetAnchorPoint.x - targetX,
27470
27516
  y: targetAnchorPoint.y - targetY
27471
27517
  };
27472
- _this7$sourceShape$po = _this7.sourceShape.position(), sourceX = _this7$sourceShape$po.x, sourceY = _this7$sourceShape$po.y;
27518
+ _this9$sourceShape$po = _this9.sourceShape.position(), sourceX = _this9$sourceShape$po.x, sourceY = _this9$sourceShape$po.y;
27473
27519
  sourceAnchorOffset = {
27474
27520
  x: sourceAnchorPoint.x - sourceX,
27475
27521
  y: sourceAnchorPoint.y - sourceY
@@ -27483,38 +27529,38 @@ function isPoint(item) {
27483
27529
  y: y
27484
27530
  };
27485
27531
  });
27486
- _this7.shape.vertices(sequenceVertices);
27532
+ _this9.shape.vertices(sequenceVertices);
27487
27533
  }
27488
- _this7.setSource(_this7.sourceShape, sourceAnchorOffset);
27489
- _this7.setTarget(targetShape, targetAnchorOffset);
27490
- _this7.completeLink();
27534
+ _this9.setSource(_this9.sourceShape, sourceAnchorOffset);
27535
+ _this9.setTarget(targetShape, targetAnchorOffset);
27536
+ _this9.completeLink();
27491
27537
  } else {
27492
- _this7.setTarget(targetRef);
27493
- _this7.paper.setInteractivity(false);
27494
- _this7.paper.el.addEventListener('mousemove', _this7.updateLinkTarget);
27495
- _this7.$emit('set-cursor', 'not-allowed');
27496
- if (_this7.isValidConnection) {
27497
- _this7.shape.stopListening(_this7.paper, 'blank:pointerdown link:pointerdown element:pointerdown', _this7.removeLink);
27538
+ _this9.setTarget(targetRef);
27539
+ _this9.paper.setInteractivity(false);
27540
+ _this9.paper.el.addEventListener('mousemove', _this9.updateLinkTarget);
27541
+ _this9.$emit('set-cursor', 'not-allowed');
27542
+ if (_this9.isValidConnection) {
27543
+ _this9.shape.stopListening(_this9.paper, 'blank:pointerdown link:pointerdown element:pointerdown', _this9.removeLink);
27498
27544
  } else {
27499
- _this7.shape.listenToOnce(_this7.paper, 'blank:pointerdown link:pointerdown element:pointerdown', _this7.removeLink);
27545
+ _this9.shape.listenToOnce(_this9.paper, 'blank:pointerdown link:pointerdown element:pointerdown', _this9.removeLink);
27500
27546
  }
27501
27547
  }
27502
- _this7.updateRouter();
27503
- _this7.shape.on('change:vertices', function () {
27548
+ _this9.updateRouter();
27549
+ _this9.shape.on('change:vertices', function () {
27504
27550
  this.component.$emit('shape-resize');
27505
27551
  });
27506
27552
  if (store.getters.isReadOnly) {
27507
- _this7.$nextTick(function () {
27508
- _this7.paperManager.awaitScheduledUpdates().then(function () {
27509
- _this7.setShapeHighlight();
27553
+ _this9.$nextTick(function () {
27554
+ _this9.paperManager.awaitScheduledUpdates().then(function () {
27555
+ _this9.setShapeHighlight();
27510
27556
  });
27511
27557
  });
27512
27558
  }
27513
27559
  case 12:
27514
27560
  case "end":
27515
- return _context2.stop();
27561
+ return _context4.stop();
27516
27562
  }
27517
- }, _callee2);
27563
+ }, _callee4);
27518
27564
  }))();
27519
27565
  },
27520
27566
  beforeDestroy: function beforeDestroy() {