@processmaker/modeler 1.39.20 → 1.39.21

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.
@@ -47786,10 +47786,10 @@ var ValidationStatus_component = normalizeComponent(
47786
47786
  )
47787
47787
 
47788
47788
  /* harmony default export */ var ValidationStatus = (ValidationStatus_component.exports);
47789
- ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/modeler/Modeler.vue?vue&type=template&id=83a477c8&
47789
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/modeler/Modeler.vue?vue&type=template&id=5fd6d55f&
47790
47790
 
47791
47791
 
47792
- var Modelervue_type_template_id_83a477c8_render = function render() {
47792
+ var Modelervue_type_template_id_5fd6d55f_render = function render() {
47793
47793
  var _vm = this,
47794
47794
  _c = _vm._self._c;
47795
47795
  return _c('span', {
@@ -48008,9 +48008,9 @@ var Modelervue_type_template_id_83a477c8_render = function render() {
48008
48008
  }
48009
48009
  }) : _vm._e()], 2)], 1);
48010
48010
  };
48011
- var Modelervue_type_template_id_83a477c8_staticRenderFns = [];
48011
+ var Modelervue_type_template_id_5fd6d55f_staticRenderFns = [];
48012
48012
 
48013
- ;// CONCATENATED MODULE: ./src/components/modeler/Modeler.vue?vue&type=template&id=83a477c8&
48013
+ ;// CONCATENATED MODULE: ./src/components/modeler/Modeler.vue?vue&type=template&id=5fd6d55f&
48014
48014
 
48015
48015
  ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/nodes/boundaryEvent/boundaryEvent.vue?vue&type=template&id=2979ecac&
48016
48016
  var boundaryEventvue_type_template_id_2979ecac_render = function render() {
@@ -75679,6 +75679,30 @@ var Multiplayer = /*#__PURE__*/function () {
75679
75679
  _this.modeler.removePlayer(payload.clientId);
75680
75680
  _this.modeler.enableMultiplayer(payload.isMultiplayer);
75681
75681
  });
75682
+ this.clientIO.on('requestProcess', function (payload) {
75683
+ var firstClient = payload.firstClient,
75684
+ clientId = payload.clientId;
75685
+
75686
+ // Check if the current client is the first client
75687
+ if (firstClient.id === _this.clientIO.id) {
75688
+ // Get the process definition
75689
+ var nodes = _this.modeler.nodes.map(function (node) {
75690
+ return _this.modeler.multiplayerHook(node, false, true);
75691
+ });
75692
+ nodes.forEach(function (node) {
75693
+ var yMapNested = new YMap();
75694
+ _this.doTransact(yMapNested, node);
75695
+ _this.yArray.push([yMapNested]);
75696
+ // Encode the state as an update and send it to the server
75697
+ var stateUpdate = encodeStateAsUpdate(_this.yDoc);
75698
+ // Send the update to the web socket server
75699
+ _this.clientIO.emit('createElement', {
75700
+ updateDoc: stateUpdate,
75701
+ clientId: clientId
75702
+ });
75703
+ });
75704
+ }
75705
+ });
75682
75706
 
75683
75707
  // Listen for updates when a new element is added
75684
75708
  this.clientIO.on('createElement', /*#__PURE__*/function () {
@@ -75702,6 +75726,32 @@ var Multiplayer = /*#__PURE__*/function () {
75702
75726
  };
75703
75727
  }());
75704
75728
 
75729
+ // Listen for updates when a new element is requested
75730
+ this.clientIO.on('createRequestedElement', /*#__PURE__*/function () {
75731
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(payload) {
75732
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
75733
+ while (1) switch (_context2.prev = _context2.next) {
75734
+ case 0:
75735
+ if (!(payload.clientId === _this.clientIO.id)) {
75736
+ _context2.next = 4;
75737
+ break;
75738
+ }
75739
+ _context2.next = 3;
75740
+ return _this.createRemoteShape(payload.changes);
75741
+ case 3:
75742
+ // Add the new element to the shared array
75743
+ applyUpdate(_this.yDoc, new Uint8Array(payload.updateDoc));
75744
+ case 4:
75745
+ case "end":
75746
+ return _context2.stop();
75747
+ }
75748
+ }, _callee2);
75749
+ }));
75750
+ return function (_x2) {
75751
+ return _ref2.apply(this, arguments);
75752
+ };
75753
+ }());
75754
+
75705
75755
  // Listen for updates when an element is removed
75706
75756
  this.clientIO.on('removeElement', function (payload) {
75707
75757
  payload.deletedNodes.forEach(function (nodeId) {
@@ -75741,9 +75791,9 @@ var Multiplayer = /*#__PURE__*/function () {
75741
75791
  window.ProcessMaker.EventBus.$on('multiplayer-updateNodes', function (data) {
75742
75792
  _this.updateNodes(data);
75743
75793
  });
75744
- window.ProcessMaker.EventBus.$on('multiplayer-replaceNode', function (_ref2) {
75745
- var nodeData = _ref2.nodeData,
75746
- newControl = _ref2.newControl;
75794
+ window.ProcessMaker.EventBus.$on('multiplayer-replaceNode', function (_ref3) {
75795
+ var nodeData = _ref3.nodeData,
75796
+ newControl = _ref3.newControl;
75747
75797
  _this.replaceNode(nodeData, newControl);
75748
75798
  });
75749
75799
  window.ProcessMaker.EventBus.$on('multiplayer-addFlow', function (data) {
@@ -75763,7 +75813,9 @@ var Multiplayer = /*#__PURE__*/function () {
75763
75813
  // Encode the state as an update and send it to the server
75764
75814
  var stateUpdate = encodeStateAsUpdate(this.yDoc);
75765
75815
  // Send the update to the web socket server
75766
- this.clientIO.emit('createElement', stateUpdate);
75816
+ this.clientIO.emit('createElement', {
75817
+ updateDoc: stateUpdate
75818
+ });
75767
75819
  }
75768
75820
  }, {
75769
75821
  key: "createShape",
@@ -75926,17 +75978,17 @@ var Multiplayer = /*#__PURE__*/function () {
75926
75978
  }, {
75927
75979
  key: "updateShapes",
75928
75980
  value: function () {
75929
- var _updateShapes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {
75981
+ var _updateShapes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
75930
75982
  var _this4 = this;
75931
75983
  var paper, element, newPool, sourceElem, targetElem, waypoint, startWaypoint, endWaypoint, newWaypoint, node;
75932
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
75933
- while (1) switch (_context2.prev = _context2.next) {
75984
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
75985
+ while (1) switch (_context3.prev = _context3.next) {
75934
75986
  case 0:
75935
75987
  paper = this.modeler.paper;
75936
75988
  element = this.modeler.getElementByNodeId(data.id);
75937
75989
  newPool = this.modeler.getElementByNodeId(data.poolId);
75938
75990
  if (!this.modeler.flowTypes.includes(data.type)) {
75939
- _context2.next = 15;
75991
+ _context3.next = 15;
75940
75992
  break;
75941
75993
  }
75942
75994
  // Update the element's waypoints
@@ -75970,7 +76022,7 @@ var Multiplayer = /*#__PURE__*/function () {
75970
76022
  name: 'boundary'
75971
76023
  }
75972
76024
  });
75973
- _context2.next = 26;
76025
+ _context3.next = 26;
75974
76026
  break;
75975
76027
  case 15:
75976
76028
  // Update the element's position attribute
@@ -75988,13 +76040,13 @@ var Multiplayer = /*#__PURE__*/function () {
75988
76040
  });
75989
76041
 
75990
76042
  // Trigger a rendering of the element on the paper
75991
- _context2.next = 21;
76043
+ _context3.next = 21;
75992
76044
  return paper.findViewByModel(element).update();
75993
76045
  case 21:
75994
- _context2.next = 23;
76046
+ _context3.next = 23;
75995
76047
  return element.component.$nextTick();
75996
76048
  case 23:
75997
- _context2.next = 25;
76049
+ _context3.next = 25;
75998
76050
  return this.modeler.paperManager.awaitScheduledUpdates();
75999
76051
  case 25:
76000
76052
  if (newPool && element.component.node.pool && element.component.node.pool.component.id !== data.poolId) {
@@ -76002,11 +76054,11 @@ var Multiplayer = /*#__PURE__*/function () {
76002
76054
  }
76003
76055
  case 26:
76004
76056
  case "end":
76005
- return _context2.stop();
76057
+ return _context3.stop();
76006
76058
  }
76007
- }, _callee2, this);
76059
+ }, _callee3, this);
76008
76060
  }));
76009
- function updateShapes(_x2) {
76061
+ function updateShapes(_x3) {
76010
76062
  return _updateShapes.apply(this, arguments);
76011
76063
  }
76012
76064
  return updateShapes;
@@ -76020,7 +76072,9 @@ var Multiplayer = /*#__PURE__*/function () {
76020
76072
  // Encode the state as an update and send it to the server
76021
76073
  var stateUpdate = encodeStateAsUpdate(this.yDoc);
76022
76074
  // Send the update to the web socket server
76023
- this.clientIO.emit('createElement', stateUpdate);
76075
+ this.clientIO.emit('createElement', {
76076
+ updateDoc: stateUpdate
76077
+ });
76024
76078
  _classPrivateFieldGet(this, _nodeIdGenerator).updateCounters();
76025
76079
  }
76026
76080
  }, {
@@ -76045,7 +76099,9 @@ var Multiplayer = /*#__PURE__*/function () {
76045
76099
  _this5.doTransact(yMapNested, data);
76046
76100
  _this5.yArray.push([yMapNested]);
76047
76101
  var stateUpdate = encodeStateAsUpdate(_this5.yDoc);
76048
- _this5.clientIO.emit('createElement', stateUpdate);
76102
+ _this5.clientIO.emit('createElement', {
76103
+ updateDoc: stateUpdate
76104
+ });
76049
76105
  });
76050
76106
  });
76051
76107
  }
@@ -77066,7 +77122,11 @@ var Multiplayer = /*#__PURE__*/function () {
77066
77122
  while (1) switch (_context8.prev = _context8.next) {
77067
77123
  case 0:
77068
77124
  node = _this21.createNode(type, definition, diagram);
77069
- store.commit('addNode', node);
77125
+ if (!_this21.isMultiplayer) {
77126
+ store.commit('addNode', node);
77127
+ } else {
77128
+ _this21.loadNodeForMultiplayer(node);
77129
+ }
77070
77130
  case 2:
77071
77131
  case "end":
77072
77132
  return _context8.stop();
@@ -77074,6 +77134,39 @@ var Multiplayer = /*#__PURE__*/function () {
77074
77134
  }, _callee8);
77075
77135
  }))();
77076
77136
  },
77137
+ loadNodeForMultiplayer: function loadNodeForMultiplayer(node) {
77138
+ var _this22 = this;
77139
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
77140
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
77141
+ while (1) switch (_context9.prev = _context9.next) {
77142
+ case 0:
77143
+ if (!(node.type === 'processmaker-modeler-lane')) {
77144
+ _context9.next = 10;
77145
+ break;
77146
+ }
77147
+ _context9.next = 3;
77148
+ return _this22.addNode(node, node.definition.id, true);
77149
+ case 3:
77150
+ _this22.nodeIdGenerator.updateCounters();
77151
+ _context9.next = 6;
77152
+ return _this22.$nextTick();
77153
+ case 6:
77154
+ _context9.next = 8;
77155
+ return _this22.paperManager.awaitScheduledUpdates();
77156
+ case 8:
77157
+ window.ProcessMaker.EventBus.$emit('multiplayer-addLanes', [node]);
77158
+ return _context9.abrupt("return");
77159
+ case 10:
77160
+ _this22.multiplayerHook(node, false);
77161
+ store.commit('addNode', node);
77162
+ _this22.poolTarget = null;
77163
+ case 13:
77164
+ case "end":
77165
+ return _context9.stop();
77166
+ }
77167
+ }, _callee9);
77168
+ }))();
77169
+ },
77077
77170
  createNode: function createNode(type, definition, diagram) {
77078
77171
  if (Node.isTimerType(type)) {
77079
77172
  return new TimerEventNode(type, definition, diagram);
@@ -77092,95 +77185,95 @@ var Multiplayer = /*#__PURE__*/function () {
77092
77185
  return hasSource && hasTarget;
77093
77186
  },
77094
77187
  waitForCursorToChange: function waitForCursorToChange() {
77095
- var _this22 = this;
77096
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
77188
+ var _this23 = this;
77189
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
77097
77190
  var cursorWaitTime;
77098
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
77099
- while (1) switch (_context9.prev = _context9.next) {
77191
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
77192
+ while (1) switch (_context10.prev = _context10.next) {
77100
77193
  case 0:
77101
77194
  cursorWaitTime = 300;
77102
- _context9.next = 3;
77103
- return _this22.$nextTick();
77195
+ _context10.next = 3;
77196
+ return _this23.$nextTick();
77104
77197
  case 3:
77105
- return _context9.abrupt("return", new Promise(function (resolve) {
77198
+ return _context10.abrupt("return", new Promise(function (resolve) {
77106
77199
  return setTimeout(resolve, cursorWaitTime);
77107
77200
  }));
77108
77201
  case 4:
77109
77202
  case "end":
77110
- return _context9.stop();
77203
+ return _context10.stop();
77111
77204
  }
77112
- }, _callee9);
77205
+ }, _callee10);
77113
77206
  }))();
77114
77207
  },
77115
77208
  renderPaper: function renderPaper() {
77116
- var _this23 = this;
77117
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
77118
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
77119
- while (1) switch (_context11.prev = _context11.next) {
77209
+ var _this24 = this;
77210
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
77211
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
77212
+ while (1) switch (_context12.prev = _context12.next) {
77120
77213
  case 0:
77121
- _this23.isRendering = true;
77122
- _context11.next = 3;
77123
- return _this23.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
77124
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
77125
- while (1) switch (_context10.prev = _context10.next) {
77214
+ _this24.isRendering = true;
77215
+ _context12.next = 3;
77216
+ return _this24.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
77217
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
77218
+ while (1) switch (_context11.prev = _context11.next) {
77126
77219
  case 0:
77127
- _context10.next = 2;
77128
- return _this23.waitForCursorToChange();
77220
+ _context11.next = 2;
77221
+ return _this24.waitForCursorToChange();
77129
77222
  case 2:
77130
- _this23.parse();
77131
- _this23.addPools();
77132
- _this23.setUpDiagram();
77223
+ _this24.parse();
77224
+ _this24.addPools();
77225
+ _this24.setUpDiagram();
77133
77226
  case 5:
77134
77227
  case "end":
77135
- return _context10.stop();
77228
+ return _context11.stop();
77136
77229
  }
77137
- }, _callee10);
77230
+ }, _callee11);
77138
77231
  })));
77139
77232
  case 3:
77140
- _context11.next = 5;
77141
- return _this23.paperManager.awaitScheduledUpdates();
77233
+ _context12.next = 5;
77234
+ return _this24.paperManager.awaitScheduledUpdates();
77142
77235
  case 5:
77143
- _this23.isRendering = false;
77144
- _this23.$emit('parsed');
77236
+ _this24.isRendering = false;
77237
+ _this24.$emit('parsed');
77145
77238
  case 7:
77146
77239
  case "end":
77147
- return _context11.stop();
77240
+ return _context12.stop();
77148
77241
  }
77149
- }, _callee11);
77242
+ }, _callee12);
77150
77243
  }))();
77151
77244
  },
77152
77245
  loadXML: function loadXML() {
77153
77246
  var _arguments3 = arguments,
77154
- _this24 = this;
77155
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
77247
+ _this25 = this;
77248
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
77156
77249
  var xml, emitChangeEvent;
77157
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
77158
- while (1) switch (_context12.prev = _context12.next) {
77250
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
77251
+ while (1) switch (_context13.prev = _context13.next) {
77159
77252
  case 0:
77160
77253
  xml = _arguments3.length > 0 && _arguments3[0] !== undefined ? _arguments3[0] : null;
77161
77254
  emitChangeEvent = false;
77162
77255
  if (xml === null) {
77163
- xml = _this24.currentXML;
77256
+ xml = _this25.currentXML;
77164
77257
  emitChangeEvent = true;
77165
77258
  }
77166
- _context12.next = 5;
77167
- return _this24.xmlManager.getDefinitionsFromXml(xml);
77259
+ _context13.next = 5;
77260
+ return _this25.xmlManager.getDefinitionsFromXml(xml);
77168
77261
  case 5:
77169
- _this24.definitions = _context12.sent;
77170
- _this24.xmlManager.definitions = _this24.definitions;
77171
- _this24.nodeIdGenerator = getNodeIdGenerator(_this24.definitions);
77262
+ _this25.definitions = _context13.sent;
77263
+ _this25.xmlManager.definitions = _this25.definitions;
77264
+ _this25.nodeIdGenerator = getNodeIdGenerator(_this25.definitions);
77172
77265
  store.commit('clearNodes');
77173
- _context12.next = 11;
77174
- return _this24.renderPaper();
77266
+ _context13.next = 11;
77267
+ return _this25.renderPaper();
77175
77268
  case 11:
77176
77269
  if (emitChangeEvent) {
77177
77270
  window.ProcessMaker.EventBus.$emit('modeler-change');
77178
77271
  }
77179
77272
  case 12:
77180
77273
  case "end":
77181
- return _context12.stop();
77274
+ return _context13.stop();
77182
77275
  }
77183
- }, _callee12);
77276
+ }, _callee13);
77184
77277
  }))();
77185
77278
  },
77186
77279
  getBoundaryEvents: function getBoundaryEvents(process) {
@@ -77204,13 +77297,13 @@ var Multiplayer = /*#__PURE__*/function () {
77204
77297
  return boundaryEvent;
77205
77298
  },
77206
77299
  ensureCancelActivityIsAddedToBoundaryEvents: function ensureCancelActivityIsAddedToBoundaryEvents(process) {
77207
- var _this25 = this;
77300
+ var _this26 = this;
77208
77301
  this.getBoundaryEvents(process).forEach(function (definition) {
77209
- var boundaryEvent = _this25.createBoundaryEvent(definition);
77302
+ var boundaryEvent = _this26.createBoundaryEvent(definition);
77210
77303
  definition.get('outgoing').forEach(function (outgoing) {
77211
77304
  return outgoing.set('sourceRef', boundaryEvent);
77212
77305
  });
77213
- _this25.replaceDefinition(definition, boundaryEvent, process);
77306
+ _this26.replaceDefinition(definition, boundaryEvent, process);
77214
77307
  });
77215
77308
  },
77216
77309
  replaceDefinition: function replaceDefinition(definition, boundaryEvent, process) {
@@ -77236,82 +77329,82 @@ var Multiplayer = /*#__PURE__*/function () {
77236
77329
  });
77237
77330
  },
77238
77331
  addRemoteNode: function addRemoteNode(data) {
77239
- var _this26 = this;
77240
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
77332
+ var _this27 = this;
77333
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
77241
77334
  var definition, diagram, newNode;
77242
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
77243
- while (1) switch (_context13.prev = _context13.next) {
77335
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
77336
+ while (1) switch (_context14.prev = _context14.next) {
77244
77337
  case 0:
77245
- definition = _this26.nodeRegistry[data.type].definition(_this26.moddle, _this26.$t);
77246
- diagram = _this26.nodeRegistry[data.type].diagram(_this26.moddle);
77338
+ definition = _this27.nodeRegistry[data.type].definition(_this27.moddle, _this27.$t);
77339
+ diagram = _this27.nodeRegistry[data.type].diagram(_this27.moddle);
77247
77340
  diagram.bounds.x = data.x;
77248
77341
  diagram.bounds.y = data.y;
77249
- newNode = _this26.createNode(data.type, definition, diagram);
77250
- _context13.next = 7;
77251
- return _this26.addNode(newNode, data.id, true);
77342
+ newNode = _this27.createNode(data.type, definition, diagram);
77343
+ _context14.next = 7;
77344
+ return _this27.addNode(newNode, data.id, true);
77252
77345
  case 7:
77253
- _context13.next = 9;
77254
- return _this26.$nextTick();
77346
+ _context14.next = 9;
77347
+ return _this27.$nextTick();
77255
77348
  case 9:
77256
- _context13.next = 11;
77257
- return _this26.paperManager.awaitScheduledUpdates();
77349
+ _context14.next = 11;
77350
+ return _this27.paperManager.awaitScheduledUpdates();
77258
77351
  case 11:
77259
- if (_this26.autoValidate) {
77260
- _this26.validateBpmnDiagram();
77352
+ if (_this27.autoValidate) {
77353
+ _this27.validateBpmnDiagram();
77261
77354
  }
77262
77355
  case 12:
77263
77356
  case "end":
77264
- return _context13.stop();
77357
+ return _context14.stop();
77265
77358
  }
77266
- }, _callee13);
77359
+ }, _callee14);
77267
77360
  }))();
77268
77361
  },
77269
77362
  handleDrop: function handleDrop(data) {
77270
- var _this27 = this;
77271
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
77272
- var clientX, clientY, control, nodeThatWillBeReplaced, definition, diagram, _this27$paperManager$, x, y, newNode, nodeMigrator;
77273
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
77274
- while (1) switch (_context14.prev = _context14.next) {
77363
+ var _this28 = this;
77364
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
77365
+ var clientX, clientY, control, nodeThatWillBeReplaced, definition, diagram, _this28$paperManager$, x, y, newNode, nodeMigrator;
77366
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
77367
+ while (1) switch (_context15.prev = _context15.next) {
77275
77368
  case 0:
77276
77369
  clientX = data.clientX, clientY = data.clientY, control = data.control, nodeThatWillBeReplaced = data.nodeThatWillBeReplaced;
77277
- _this27.validateDropTarget({
77370
+ _this28.validateDropTarget({
77278
77371
  clientX: clientX,
77279
77372
  clientY: clientY,
77280
77373
  control: control
77281
77374
  });
77282
- if (_this27.allowDrop) {
77283
- _context14.next = 4;
77375
+ if (_this28.allowDrop) {
77376
+ _context15.next = 4;
77284
77377
  break;
77285
77378
  }
77286
- return _context14.abrupt("return");
77379
+ return _context15.abrupt("return");
77287
77380
  case 4:
77288
- definition = _this27.nodeRegistry[control.type].definition(_this27.moddle, _this27.$t);
77289
- diagram = _this27.nodeRegistry[control.type].diagram(_this27.moddle);
77290
- _this27$paperManager$ = _this27.paperManager.clientToGridPoint(clientX, clientY), x = _this27$paperManager$.x, y = _this27$paperManager$.y;
77381
+ definition = _this28.nodeRegistry[control.type].definition(_this28.moddle, _this28.$t);
77382
+ diagram = _this28.nodeRegistry[control.type].diagram(_this28.moddle);
77383
+ _this28$paperManager$ = _this28.paperManager.clientToGridPoint(clientX, clientY), x = _this28$paperManager$.x, y = _this28$paperManager$.y;
77291
77384
  diagram.bounds.x = x;
77292
77385
  diagram.bounds.y = y;
77293
- newNode = _this27.createNode(control.type, definition, diagram);
77386
+ newNode = _this28.createNode(control.type, definition, diagram);
77294
77387
  if (newNode.isBpmnType('bpmn:BoundaryEvent')) {
77295
- _this27.setShapeCenterUnderCursor(diagram);
77388
+ _this28.setShapeCenterUnderCursor(diagram);
77296
77389
  }
77297
- _this27.highlightNode(newNode);
77298
- _context14.next = 14;
77299
- return _this27.addNode(newNode);
77390
+ _this28.highlightNode(newNode);
77391
+ _context15.next = 14;
77392
+ return _this28.addNode(newNode);
77300
77393
  case 14:
77301
77394
  if (nodeThatWillBeReplaced) {
77302
- _context14.next = 16;
77395
+ _context15.next = 16;
77303
77396
  break;
77304
77397
  }
77305
- return _context14.abrupt("return");
77398
+ return _context15.abrupt("return");
77306
77399
  case 16:
77307
- nodeMigrator = new NodeMigrator(nodeThatWillBeReplaced, definition, _this27.graph, newNode, _this27.processes, _this27.collaboration);
77400
+ nodeMigrator = new NodeMigrator(nodeThatWillBeReplaced, definition, _this28.graph, newNode, _this28.processes, _this28.collaboration);
77308
77401
  nodeMigrator.migrate();
77309
- return _context14.abrupt("return", newNode);
77402
+ return _context15.abrupt("return", newNode);
77310
77403
  case 19:
77311
77404
  case "end":
77312
- return _context14.stop();
77405
+ return _context15.stop();
77313
77406
  }
77314
- }, _callee14);
77407
+ }, _callee15);
77315
77408
  }))();
77316
77409
  },
77317
77410
  setShapeCenterUnderCursor: function setShapeCenterUnderCursor(diagram) {
@@ -77319,32 +77412,33 @@ var Multiplayer = /*#__PURE__*/function () {
77319
77412
  diagram.bounds.y -= diagram.bounds.height / 2;
77320
77413
  },
77321
77414
  selectNewNode: function selectNewNode(node) {
77322
- var _this28 = this;
77323
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
77415
+ var _this29 = this;
77416
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
77324
77417
  var newNodeComponent, view;
77325
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
77326
- while (1) switch (_context15.prev = _context15.next) {
77418
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
77419
+ while (1) switch (_context16.prev = _context16.next) {
77327
77420
  case 0:
77328
- _context15.next = 2;
77329
- return _this28.$nextTick();
77421
+ _context16.next = 2;
77422
+ return _this29.$nextTick();
77330
77423
  case 2:
77331
- _context15.next = 4;
77332
- return _this28.paperManager.awaitScheduledUpdates();
77424
+ _context16.next = 4;
77425
+ return _this29.paperManager.awaitScheduledUpdates();
77333
77426
  case 4:
77334
- newNodeComponent = _this28.$refs.nodeComponent.find(function (component) {
77427
+ newNodeComponent = _this29.$refs.nodeComponent.find(function (component) {
77335
77428
  return component.node === node;
77336
77429
  });
77337
77430
  view = newNodeComponent.shapeView;
77338
- _context15.next = 8;
77339
- return _this28.$refs.selector.selectElement(view);
77431
+ _context16.next = 8;
77432
+ return _this29.$refs.selector.selectElement(view);
77340
77433
  case 8:
77341
77434
  case "end":
77342
- return _context15.stop();
77435
+ return _context16.stop();
77343
77436
  }
77344
- }, _callee15);
77437
+ }, _callee16);
77345
77438
  }))();
77346
77439
  },
77347
77440
  multiplayerHook: function multiplayerHook(node, fromClient) {
77441
+ var isProcessRequested = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
77348
77442
  var blackList = ['processmaker-modeler-lane', 'processmaker-modeler-generic-flow', 'processmaker-modeler-sequence-flow', 'processmaker-modeler-association', 'processmaker-modeler-data-input-association', 'processmaker-modeler-data-output-association'];
77349
77443
  if (!this.isMultiplayer) {
77350
77444
  return;
@@ -77365,6 +77459,9 @@ var Multiplayer = /*#__PURE__*/function () {
77365
77459
  if (node !== null && node !== void 0 && (_node$pool = node.pool) !== null && _node$pool !== void 0 && _node$pool.component) {
77366
77460
  defaultData['poolId'] = node.pool.component.id;
77367
77461
  }
77462
+ if (isProcessRequested) {
77463
+ return defaultData;
77464
+ }
77368
77465
  window.ProcessMaker.EventBus.$emit('multiplayer-addNode', defaultData);
77369
77466
  }
77370
77467
  if (this.flowTypes.includes(node.type)) {
@@ -77372,218 +77469,222 @@ var Multiplayer = /*#__PURE__*/function () {
77372
77469
  var sourceRefId = (_node$definition$sour = node.definition.sourceRef) === null || _node$definition$sour === void 0 ? void 0 : _node$definition$sour.id;
77373
77470
  var targetRefId = (_node$definition$targ = node.definition.targetRef) === null || _node$definition$targ === void 0 ? void 0 : _node$definition$targ.id;
77374
77471
  if (node.type === 'processmaker-modeler-data-input-association') {
77375
- var _node$definition$sour2, _node$definition$targ2, _node$definition$targ3;
77472
+ var _node$definition$sour2, _node$definition$targ2, _node$definition$targ3, _node$definition$targ4;
77376
77473
  sourceRefId = Array.isArray(node.definition.sourceRef) && ((_node$definition$sour2 = node.definition.sourceRef[0]) === null || _node$definition$sour2 === void 0 ? void 0 : _node$definition$sour2.id);
77377
- targetRefId = (_node$definition$targ2 = node.definition.targetRef) === null || _node$definition$targ2 === void 0 ? void 0 : (_node$definition$targ3 = _node$definition$targ2.$parent) === null || _node$definition$targ3 === void 0 ? void 0 : _node$definition$targ3.$parent.get('id');
77474
+ targetRefId = (_node$definition$targ2 = node.definition.targetRef) === null || _node$definition$targ2 === void 0 ? void 0 : (_node$definition$targ3 = _node$definition$targ2.$parent) === null || _node$definition$targ3 === void 0 ? void 0 : (_node$definition$targ4 = _node$definition$targ3.$parent) === null || _node$definition$targ4 === void 0 ? void 0 : _node$definition$targ4.get('id');
77378
77475
  }
77379
77476
  if (sourceRefId && targetRefId) {
77380
- window.ProcessMaker.EventBus.$emit('multiplayer-addFlow', {
77477
+ var flowData = {
77381
77478
  id: node.definition.id,
77382
77479
  type: node.type,
77383
77480
  sourceRefId: sourceRefId,
77384
77481
  targetRefId: targetRefId,
77385
77482
  waypoint: node.diagram.waypoint
77386
- });
77483
+ };
77484
+ if (isProcessRequested) {
77485
+ return flowData;
77486
+ }
77487
+ window.ProcessMaker.EventBus.$emit('multiplayer-addFlow', flowData);
77387
77488
  }
77388
77489
  }
77389
77490
  }
77390
77491
  },
77391
77492
  addNode: function addNode(node) {
77392
77493
  var _arguments4 = arguments,
77393
- _this29 = this;
77394
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
77494
+ _this30 = this;
77495
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
77395
77496
  var id, fromClient, targetProcess;
77396
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
77397
- while (1) switch (_context16.prev = _context16.next) {
77497
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
77498
+ while (1) switch (_context17.prev = _context17.next) {
77398
77499
  case 0:
77399
77500
  id = _arguments4.length > 1 && _arguments4[1] !== undefined ? _arguments4[1] : null;
77400
77501
  fromClient = _arguments4.length > 2 && _arguments4[2] !== undefined ? _arguments4[2] : false;
77401
77502
  if (!node.pool) {
77402
- node.pool = _this29.poolTarget;
77503
+ node.pool = _this30.poolTarget;
77403
77504
  }
77404
- targetProcess = node.getTargetProcess(_this29.processes, _this29.processNode);
77505
+ targetProcess = node.getTargetProcess(_this30.processes, _this30.processNode);
77405
77506
  addNodeToProcess(node, targetProcess);
77406
- node.setIds(_this29.nodeIdGenerator, id);
77407
- _this29.planeElements.push(node.diagram);
77507
+ node.setIds(_this30.nodeIdGenerator, id);
77508
+ _this30.planeElements.push(node.diagram);
77408
77509
  // add multiplayer logic as a hook
77409
- _this29.multiplayerHook(node, fromClient);
77510
+ _this30.multiplayerHook(node, fromClient);
77410
77511
  store.commit('addNode', node);
77411
- _this29.poolTarget = null;
77512
+ _this30.poolTarget = null;
77412
77513
 
77413
77514
  // add processmaker-modeler-generic-flow
77414
77515
  if (![sequenceFlow_id, poolLane_config_id, associationConfig_id, messageFlow_config_id, config_id, dataInputAssociation_config_id, genericFlow_config_id].includes(node.type)) {
77415
- _context16.next = 12;
77516
+ _context17.next = 12;
77416
77517
  break;
77417
77518
  }
77418
- return _context16.abrupt("return");
77519
+ return _context17.abrupt("return");
77419
77520
  case 12:
77420
77521
  if (!fromClient) {
77421
77522
  // Select the node after it has been added to the store (does not apply to flows)
77422
- _this29.selectNewNode(node);
77523
+ _this30.selectNewNode(node);
77423
77524
  }
77424
- return _context16.abrupt("return", new Promise(function (resolve) {
77525
+ return _context17.abrupt("return", new Promise(function (resolve) {
77425
77526
  setTimeout(function () {
77426
- _this29.pushToUndoStack();
77527
+ _this30.pushToUndoStack();
77427
77528
  resolve();
77428
77529
  });
77429
77530
  }));
77430
77531
  case 14:
77431
77532
  case "end":
77432
- return _context16.stop();
77533
+ return _context17.stop();
77433
77534
  }
77434
- }, _callee16);
77535
+ }, _callee17);
77435
77536
  }))();
77436
77537
  },
77437
77538
  addClonedNodes: function addClonedNodes(nodes) {
77438
- var _this30 = this;
77439
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
77440
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
77441
- while (1) switch (_context17.prev = _context17.next) {
77539
+ var _this31 = this;
77540
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
77541
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
77542
+ while (1) switch (_context18.prev = _context18.next) {
77442
77543
  case 0:
77443
77544
  nodes.forEach(function (node) {
77444
77545
  if (!node.pool) {
77445
- node.pool = _this30.poolTarget;
77546
+ node.pool = _this31.poolTarget;
77446
77547
  }
77447
- var targetProcess = node.getTargetProcess(_this30.processes, _this30.processNode);
77548
+ var targetProcess = node.getTargetProcess(_this31.processes, _this31.processNode);
77448
77549
  addNodeToProcess(node, targetProcess);
77449
- _this30.planeElements.push(node.diagram);
77450
- _this30.multiplayerHook(node, false);
77550
+ _this31.planeElements.push(node.diagram);
77551
+ _this31.multiplayerHook(node, false);
77451
77552
  store.commit('addNode', node);
77452
- _this30.poolTarget = null;
77553
+ _this31.poolTarget = null;
77453
77554
  });
77454
77555
  case 1:
77455
77556
  case "end":
77456
- return _context17.stop();
77557
+ return _context18.stop();
77457
77558
  }
77458
- }, _callee17);
77559
+ }, _callee18);
77459
77560
  }))();
77460
77561
  },
77461
77562
  removeNode: function removeNode(node, options) {
77462
- var _this31 = this;
77463
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
77464
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
77465
- while (1) switch (_context18.prev = _context18.next) {
77563
+ var _this32 = this;
77564
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
77565
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
77566
+ while (1) switch (_context19.prev = _context19.next) {
77466
77567
  case 0:
77467
77568
  // Check if the node is not replaced
77468
- if (_this31.isMultiplayer && !(options !== null && options !== void 0 && options.isReplaced)) {
77569
+ if (_this32.isMultiplayer && !(options !== null && options !== void 0 && options.isReplaced)) {
77469
77570
  // Emit event to server to remove node
77470
77571
  window.ProcessMaker.EventBus.$emit('multiplayer-removeNode', node);
77471
77572
  }
77472
- _this31.removeNodeProcedure(node, options);
77573
+ _this32.removeNodeProcedure(node, options);
77473
77574
  case 2:
77474
77575
  case "end":
77475
- return _context18.stop();
77576
+ return _context19.stop();
77476
77577
  }
77477
- }, _callee18);
77578
+ }, _callee19);
77478
77579
  }))();
77479
77580
  },
77480
77581
  removeNodeProcedure: function removeNodeProcedure(node) {
77481
77582
  var _arguments5 = arguments,
77482
- _this32 = this;
77483
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
77583
+ _this33 = this;
77584
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
77484
77585
  var _ref6, _ref6$removeRelations, removeRelationships;
77485
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
77486
- while (1) switch (_context19.prev = _context19.next) {
77586
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
77587
+ while (1) switch (_context20.prev = _context20.next) {
77487
77588
  case 0:
77488
77589
  _ref6 = _arguments5.length > 1 && _arguments5[1] !== undefined ? _arguments5[1] : {}, _ref6$removeRelations = _ref6.removeRelationships, removeRelationships = _ref6$removeRelations === void 0 ? true : _ref6$removeRelations;
77489
77590
  if (node) {
77490
- _context19.next = 3;
77591
+ _context20.next = 3;
77491
77592
  break;
77492
77593
  }
77493
- return _context19.abrupt("return");
77594
+ return _context20.abrupt("return");
77494
77595
  case 3:
77495
77596
  if (removeRelationships) {
77496
- removeNodeFlows(node, _this32);
77497
- removeNodeMessageFlows(node, _this32);
77498
- removeNodeAssociations(node, _this32);
77597
+ removeNodeFlows(node, _this33);
77598
+ removeNodeMessageFlows(node, _this33);
77599
+ removeNodeAssociations(node, _this33);
77499
77600
  }
77500
77601
  removeOutgoingAndIncomingRefsToFlow(node);
77501
- removeBoundaryEvents(_this32.graph, node, _this32.removeNode);
77602
+ removeBoundaryEvents(_this33.graph, node, _this33.removeNode);
77502
77603
  removeSourceDefault(node);
77503
- _this32.removeNodesFromLane(node);
77504
- _this32.removeNodesFromPool(node);
77604
+ _this33.removeNodesFromLane(node);
77605
+ _this33.removeNodesFromPool(node);
77505
77606
  store.commit('removeNode', node);
77506
- store.commit('highlightNode', _this32.processNode);
77507
- _this32.$refs.selector.clearSelection();
77508
- _context19.next = 14;
77509
- return _this32.$nextTick();
77607
+ store.commit('highlightNode', _this33.processNode);
77608
+ _this33.$refs.selector.clearSelection();
77609
+ _context20.next = 14;
77610
+ return _this33.$nextTick();
77510
77611
  case 14:
77511
- _context19.next = 16;
77512
- return _this32.pushToUndoStack();
77612
+ _context20.next = 16;
77613
+ return _this33.pushToUndoStack();
77513
77614
  case 16:
77514
77615
  // force to update the processNode property in every delete
77515
- _this32.processes = _this32.getProcesses();
77516
- if (_this32.processes && _this32.processes.length > 0) {
77517
- _this32.processNode = new Node('processmaker-modeler-process', _this32.processes[0], _this32.planeElements.find(function (diagram) {
77518
- return diagram.bpmnElement.id === _this32.processes[0].id;
77616
+ _this33.processes = _this33.getProcesses();
77617
+ if (_this33.processes && _this33.processes.length > 0) {
77618
+ _this33.processNode = new Node('processmaker-modeler-process', _this33.processes[0], _this33.planeElements.find(function (diagram) {
77619
+ return diagram.bpmnElement.id === _this33.processes[0].id;
77519
77620
  }));
77520
77621
  }
77521
77622
  case 18:
77522
77623
  case "end":
77523
- return _context19.stop();
77624
+ return _context20.stop();
77524
77625
  }
77525
- }, _callee19);
77626
+ }, _callee20);
77526
77627
  }))();
77527
77628
  },
77528
77629
  removeNodes: function removeNodes() {
77529
- var _this33 = this;
77530
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
77531
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
77532
- while (1) switch (_context22.prev = _context22.next) {
77630
+ var _this34 = this;
77631
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
77632
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
77633
+ while (1) switch (_context23.prev = _context23.next) {
77533
77634
  case 0:
77534
- _context22.next = 2;
77535
- return _this33.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
77536
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
77537
- while (1) switch (_context21.prev = _context21.next) {
77635
+ _context23.next = 2;
77636
+ return _this34.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
77637
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
77638
+ while (1) switch (_context22.prev = _context22.next) {
77538
77639
  case 0:
77539
- _context21.next = 2;
77540
- return _this33.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
77640
+ _context22.next = 2;
77641
+ return _this34.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
77541
77642
  var waitPromises;
77542
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
77543
- while (1) switch (_context20.prev = _context20.next) {
77643
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
77644
+ while (1) switch (_context21.prev = _context21.next) {
77544
77645
  case 0:
77545
77646
  waitPromises = [];
77546
- _this33.highlightedNodes.forEach(function (node) {
77547
- return waitPromises.push(_this33.removeNode(node, {
77647
+ _this34.highlightedNodes.forEach(function (node) {
77648
+ return waitPromises.push(_this34.removeNode(node, {
77548
77649
  removeRelationships: true
77549
77650
  }));
77550
77651
  });
77551
- _context20.next = 4;
77652
+ _context21.next = 4;
77552
77653
  return Promise.all(waitPromises);
77553
77654
  case 4:
77554
77655
  store.commit('highlightNode');
77555
77656
  case 5:
77556
77657
  case "end":
77557
- return _context20.stop();
77658
+ return _context21.stop();
77558
77659
  }
77559
- }, _callee20);
77660
+ }, _callee21);
77560
77661
  })));
77561
77662
  case 2:
77562
77663
  case "end":
77563
- return _context21.stop();
77664
+ return _context22.stop();
77564
77665
  }
77565
- }, _callee21);
77666
+ }, _callee22);
77566
77667
  })));
77567
77668
  case 2:
77568
77669
  case "end":
77569
- return _context22.stop();
77670
+ return _context23.stop();
77570
77671
  }
77571
- }, _callee22);
77672
+ }, _callee23);
77572
77673
  }))();
77573
77674
  },
77574
77675
  replaceNode: function replaceNode(_ref9) {
77575
- var _this34 = this;
77676
+ var _this35 = this;
77576
77677
  var node = _ref9.node,
77577
77678
  typeToReplaceWith = _ref9.typeToReplaceWith;
77578
- this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
77579
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
77580
- while (1) switch (_context24.prev = _context24.next) {
77679
+ this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
77680
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
77681
+ while (1) switch (_context25.prev = _context25.next) {
77581
77682
  case 0:
77582
- _context24.next = 2;
77583
- return _this34.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
77584
- var _node$diagram$bounds, x, y, nodeData, nodeTypes, newControl;
77585
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
77586
- while (1) switch (_context23.prev = _context23.next) {
77683
+ _context25.next = 2;
77684
+ return _this35.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
77685
+ var _node$diagram$bounds, x, y, nodeData;
77686
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
77687
+ while (1) switch (_context24.prev = _context24.next) {
77587
77688
  case 0:
77588
77689
  _node$diagram$bounds = node.diagram.bounds, x = _node$diagram$bounds.x, y = _node$diagram$bounds.y;
77589
77690
  nodeData = {
@@ -77594,96 +77695,89 @@ var Multiplayer = /*#__PURE__*/function () {
77594
77695
  },
77595
77696
  nodeThatWillBeReplaced: node
77596
77697
  };
77597
- if (!_this34.isMultiplayer) {
77598
- _context23.next = 8;
77599
- break;
77600
- }
77601
- // Get all node types
77602
- nodeTypes = nodeTypesStore.getters.getNodeTypes; // Get the new control
77603
- newControl = nodeTypes.flatMap(function (nodeType) {
77604
- var _nodeType$items;
77605
- return (_nodeType$items = nodeType.items) === null || _nodeType$items === void 0 ? void 0 : _nodeType$items.filter(function (item) {
77606
- return item.type === typeToReplaceWith;
77607
- });
77608
- }).filter(Boolean); // If the new control is found, emit event to server to replace node
77609
- if (newControl.length === 1) {
77610
- window.ProcessMaker.EventBus.$emit('multiplayer-replaceNode', {
77611
- nodeData: nodeData,
77612
- newControl: newControl[0].type
77613
- });
77614
- }
77615
- _context23.next = 10;
77616
- break;
77617
- case 8:
77618
- _context23.next = 10;
77619
- return _this34.replaceNodeProcedure(nodeData, true);
77620
- case 10:
77698
+ _context24.next = 4;
77699
+ return _this35.replaceNodeProcedure(nodeData);
77700
+ case 4:
77621
77701
  case "end":
77622
- return _context23.stop();
77702
+ return _context24.stop();
77623
77703
  }
77624
- }, _callee23);
77704
+ }, _callee24);
77625
77705
  })));
77626
77706
  case 2:
77627
77707
  case "end":
77628
- return _context24.stop();
77708
+ return _context25.stop();
77629
77709
  }
77630
- }, _callee24);
77710
+ }, _callee25);
77631
77711
  })));
77632
77712
  },
77633
77713
  replaceNodeProcedure: function replaceNodeProcedure(data) {
77634
77714
  var _arguments6 = arguments,
77635
- _this35 = this;
77636
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
77637
- var isReplaced, _this35$paper$localTo, clientX, clientY, newNode;
77638
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
77639
- while (1) switch (_context25.prev = _context25.next) {
77715
+ _this36 = this;
77716
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
77717
+ var isReplaced, _this36$paper$localTo, clientX, clientY, newNode, nodeTypes, newControl;
77718
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
77719
+ while (1) switch (_context26.prev = _context26.next) {
77640
77720
  case 0:
77641
77721
  isReplaced = _arguments6.length > 1 && _arguments6[1] !== undefined ? _arguments6[1] : false;
77642
- if (isReplaced) {
77643
- // Get the clientX and clientY from the node that will be replaced
77644
- _this35$paper$localTo = _this35.paper.localToClientPoint(data.nodeThatWillBeReplaced.diagram.bounds), clientX = _this35$paper$localTo.x, clientY = _this35$paper$localTo.y;
77645
- data.clientX = clientX;
77646
- data.clientY = clientY;
77647
- }
77648
- _context25.next = 4;
77649
- return _this35.handleDrop(data);
77650
- case 4:
77651
- newNode = _context25.sent;
77652
- _context25.next = 7;
77653
- return _this35.removeNode(data.nodeThatWillBeReplaced, {
77722
+ // Get the clientX and clientY from the node that will be replaced
77723
+ _this36$paper$localTo = _this36.paper.localToClientPoint(data.nodeThatWillBeReplaced.diagram.bounds), clientX = _this36$paper$localTo.x, clientY = _this36$paper$localTo.y;
77724
+ data.clientX = clientX;
77725
+ data.clientY = clientY;
77726
+ _context26.next = 6;
77727
+ return _this36.handleDrop(data);
77728
+ case 6:
77729
+ newNode = _context26.sent;
77730
+ _context26.next = 9;
77731
+ return _this36.removeNode(data.nodeThatWillBeReplaced, {
77654
77732
  removeRelationships: false,
77655
77733
  isReplaced: isReplaced
77656
77734
  });
77657
- case 7:
77658
- _this35.highlightNode(newNode);
77659
- _this35.selectNewNode(newNode);
77660
77735
  case 9:
77736
+ _this36.highlightNode(newNode);
77737
+ _this36.selectNewNode(newNode);
77738
+ if (_this36.isMultiplayer && !isReplaced) {
77739
+ // Get all node types
77740
+ nodeTypes = nodeTypesStore.getters.getNodeTypes; // Get the new control
77741
+ newControl = nodeTypes.flatMap(function (nodeType) {
77742
+ var _nodeType$items;
77743
+ return (_nodeType$items = nodeType.items) === null || _nodeType$items === void 0 ? void 0 : _nodeType$items.filter(function (item) {
77744
+ return item.type === data.typeToReplaceWith;
77745
+ });
77746
+ }).filter(Boolean); // If the new control is found, emit event to server to replace node
77747
+ if (newControl.length === 1) {
77748
+ window.ProcessMaker.EventBus.$emit('multiplayer-replaceNode', {
77749
+ data: data,
77750
+ newControl: newControl[0].type
77751
+ });
77752
+ }
77753
+ }
77754
+ case 12:
77661
77755
  case "end":
77662
- return _context25.stop();
77756
+ return _context26.stop();
77663
77757
  }
77664
- }, _callee25);
77758
+ }, _callee26);
77665
77759
  }))();
77666
77760
  },
77667
77761
  replaceAiNode: function replaceAiNode(_ref12) {
77668
- var _this36 = this;
77762
+ var _this37 = this;
77669
77763
  var node = _ref12.node,
77670
77764
  typeToReplaceWith = _ref12.typeToReplaceWith,
77671
77765
  assetId = _ref12.assetId,
77672
77766
  assetName = _ref12.assetName,
77673
77767
  redirectTo = _ref12.redirectTo;
77674
- this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
77675
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
77676
- while (1) switch (_context27.prev = _context27.next) {
77768
+ this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
77769
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
77770
+ while (1) switch (_context28.prev = _context28.next) {
77677
77771
  case 0:
77678
- _context27.next = 2;
77679
- return _this36.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
77680
- var _this36$paper$localTo, clientX, clientY, newNode;
77681
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
77682
- while (1) switch (_context26.prev = _context26.next) {
77772
+ _context28.next = 2;
77773
+ return _this37.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
77774
+ var _this37$paper$localTo, clientX, clientY, newNode;
77775
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
77776
+ while (1) switch (_context27.prev = _context27.next) {
77683
77777
  case 0:
77684
- _this36$paper$localTo = _this36.paper.localToClientPoint(node.diagram.bounds), clientX = _this36$paper$localTo.x, clientY = _this36$paper$localTo.y;
77685
- _context26.next = 3;
77686
- return _this36.handleDrop({
77778
+ _this37$paper$localTo = _this37.paper.localToClientPoint(node.diagram.bounds), clientX = _this37$paper$localTo.x, clientY = _this37$paper$localTo.y;
77779
+ _context27.next = 3;
77780
+ return _this37.handleDrop({
77687
77781
  clientX: clientX,
77688
77782
  clientY: clientY,
77689
77783
  control: {
@@ -77692,7 +77786,7 @@ var Multiplayer = /*#__PURE__*/function () {
77692
77786
  nodeThatWillBeReplaced: node
77693
77787
  });
77694
77788
  case 3:
77695
- newNode = _context26.sent;
77789
+ newNode = _context27.sent;
77696
77790
  if (typeToReplaceWith === 'processmaker-modeler-task') {
77697
77791
  newNode.definition.screenRef = assetId;
77698
77792
  newNode.definition.name = assetName;
@@ -77707,98 +77801,98 @@ var Multiplayer = /*#__PURE__*/function () {
77707
77801
  newNode.definition.config = "{\"calledElement\":\"ProcessId-".concat(assetId, "\",\"processId\":").concat(assetId, ",\"startEvent\":\"node_1\",\"name\":\"").concat(assetName, "\"}");
77708
77802
  redirectTo = "".concat(redirectTo, "/").concat(newNode.id);
77709
77803
  }
77710
- _context26.next = 9;
77711
- return _this36.removeNode(node, {
77804
+ _context27.next = 9;
77805
+ return _this37.removeNode(node, {
77712
77806
  removeRelationships: false
77713
77807
  });
77714
77808
  case 9:
77715
- _this36.highlightNode(newNode);
77716
- _this36.selectNewNode(newNode);
77717
- _context26.next = 13;
77718
- return _this36.pushToUndoStack();
77809
+ _this37.highlightNode(newNode);
77810
+ _this37.selectNewNode(newNode);
77811
+ _context27.next = 13;
77812
+ return _this37.pushToUndoStack();
77719
77813
  case 13:
77720
- _context26.next = 15;
77721
- return _this36.$nextTick();
77814
+ _context27.next = 15;
77815
+ return _this37.$nextTick();
77722
77816
  case 15:
77723
- _this36.saveBpmn(redirectTo, newNode.id);
77817
+ _this37.saveBpmn(redirectTo, newNode.id);
77724
77818
  case 16:
77725
77819
  case "end":
77726
- return _context26.stop();
77820
+ return _context27.stop();
77727
77821
  }
77728
- }, _callee26);
77822
+ }, _callee27);
77729
77823
  })));
77730
77824
  case 2:
77731
77825
  case "end":
77732
- return _context27.stop();
77826
+ return _context28.stop();
77733
77827
  }
77734
- }, _callee27);
77828
+ }, _callee28);
77735
77829
  })));
77736
77830
  },
77737
77831
  replaceGenericFlow: function replaceGenericFlow(_ref15) {
77738
- var _this37 = this;
77832
+ var _this38 = this;
77739
77833
  var actualFlow = _ref15.actualFlow,
77740
77834
  genericFlow = _ref15.genericFlow,
77741
77835
  targetNode = _ref15.targetNode;
77742
- this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
77743
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
77744
- while (1) switch (_context29.prev = _context29.next) {
77836
+ this.performSingleUndoRedoTransaction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
77837
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
77838
+ while (1) switch (_context30.prev = _context30.next) {
77745
77839
  case 0:
77746
- _context29.next = 2;
77747
- return _this37.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
77748
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
77749
- while (1) switch (_context28.prev = _context28.next) {
77840
+ _context30.next = 2;
77841
+ return _this38.paperManager.performAtomicAction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
77842
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
77843
+ while (1) switch (_context29.prev = _context29.next) {
77750
77844
  case 0:
77751
- _context28.next = 2;
77752
- return _this37.highlightNode(null);
77845
+ _context29.next = 2;
77846
+ return _this38.highlightNode(null);
77753
77847
  case 2:
77754
- _context28.next = 4;
77755
- return _this37.$nextTick();
77848
+ _context29.next = 4;
77849
+ return _this38.$nextTick();
77756
77850
  case 4:
77757
- _context28.next = 6;
77851
+ _context29.next = 6;
77758
77852
  return store.commit('removeNode', genericFlow);
77759
77853
  case 6:
77760
- _context28.next = 8;
77761
- return _this37.$nextTick();
77854
+ _context29.next = 8;
77855
+ return _this38.$nextTick();
77762
77856
  case 8:
77763
- _context28.next = 10;
77764
- return _this37.addNode(actualFlow, genericFlow.definition.id);
77857
+ _context29.next = 10;
77858
+ return _this38.addNode(actualFlow, genericFlow.definition.id);
77765
77859
  case 10:
77766
- _context28.next = 12;
77767
- return _this37.$nextTick();
77860
+ _context29.next = 12;
77861
+ return _this38.$nextTick();
77768
77862
  case 12:
77769
- _context28.next = 14;
77770
- return _this37.highlightNode(targetNode);
77863
+ _context29.next = 14;
77864
+ return _this38.highlightNode(targetNode);
77771
77865
  case 14:
77772
77866
  case "end":
77773
- return _context28.stop();
77867
+ return _context29.stop();
77774
77868
  }
77775
- }, _callee28);
77869
+ }, _callee29);
77776
77870
  })));
77777
77871
  case 2:
77778
77872
  case "end":
77779
- return _context29.stop();
77873
+ return _context30.stop();
77780
77874
  }
77781
- }, _callee29);
77875
+ }, _callee30);
77782
77876
  })));
77783
77877
  },
77784
77878
  performSingleUndoRedoTransaction: function performSingleUndoRedoTransaction(cb) {
77785
- var _this38 = this;
77786
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
77787
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
77788
- while (1) switch (_context30.prev = _context30.next) {
77879
+ var _this39 = this;
77880
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
77881
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
77882
+ while (1) switch (_context31.prev = _context31.next) {
77789
77883
  case 0:
77790
77884
  undoRedoStore.commit('disableSavingState');
77791
- _context30.next = 3;
77885
+ _context31.next = 3;
77792
77886
  return cb();
77793
77887
  case 3:
77794
77888
  undoRedoStore.commit('enableSavingState');
77795
- _context30.next = 6;
77796
- return _this38.pushToUndoStack();
77889
+ _context31.next = 6;
77890
+ return _this39.pushToUndoStack();
77797
77891
  case 6:
77798
77892
  case "end":
77799
- return _context30.stop();
77893
+ return _context31.stop();
77800
77894
  }
77801
- }, _callee30);
77895
+ }, _callee31);
77802
77896
  }))();
77803
77897
  },
77804
77898
  removeNodesFromLane: function removeNodesFromLane(node) {
@@ -77811,36 +77905,36 @@ var Multiplayer = /*#__PURE__*/function () {
77811
77905
  pull_default()(containingLane.get('flowNodeRef'), node.definition);
77812
77906
  },
77813
77907
  removeNodesFromPool: function removeNodesFromPool(node) {
77814
- var _this39 = this;
77908
+ var _this40 = this;
77815
77909
  if (node.type === 'processmaker-modeler-pool' && node.definition.processRef) {
77816
77910
  if (node.definition.processRef.artifacts) {
77817
77911
  node.definition.processRef.artifacts.forEach(function (artifact) {
77818
- var nodeToRemove = _this39.nodes.find(function (n) {
77912
+ var nodeToRemove = _this40.nodes.find(function (n) {
77819
77913
  return n.definition === artifact;
77820
77914
  });
77821
77915
  if (nodeToRemove) {
77822
- _this39.removeNode(nodeToRemove);
77916
+ _this40.removeNode(nodeToRemove);
77823
77917
  }
77824
77918
  });
77825
77919
  }
77826
77920
  if (node.definition.processRef.flowElements) {
77827
77921
  node.definition.processRef.flowElements.forEach(function (flowElement) {
77828
- var nodeToRemove = _this39.nodes.find(function (n) {
77922
+ var nodeToRemove = _this40.nodes.find(function (n) {
77829
77923
  return n.definition === flowElement;
77830
77924
  });
77831
77925
  if (nodeToRemove) {
77832
- _this39.removeNode(nodeToRemove);
77926
+ _this40.removeNode(nodeToRemove);
77833
77927
  }
77834
77928
  });
77835
77929
  }
77836
77930
  var laneSets = node.definition.processRef.laneSets;
77837
77931
  if (!!laneSets && laneSets.length > 0) {
77838
77932
  laneSets[0].lanes.forEach(function (lane) {
77839
- var nodeToRemove = _this39.nodes.find(function (n) {
77933
+ var nodeToRemove = _this40.nodes.find(function (n) {
77840
77934
  return n.definition === lane;
77841
77935
  });
77842
77936
  if (nodeToRemove) {
77843
- _this39.removeNode(nodeToRemove);
77937
+ _this40.removeNode(nodeToRemove);
77844
77938
  }
77845
77939
  });
77846
77940
  }
@@ -77868,13 +77962,13 @@ var Multiplayer = /*#__PURE__*/function () {
77868
77962
  return shape.component != null;
77869
77963
  },
77870
77964
  setShapeStacking: function setShapeStacking(shape) {
77871
- var _this40 = this;
77965
+ var _this41 = this;
77872
77966
  if (this.isRendering || !shape.component.node.isType('processmaker-modeler-pool') && shape === this.previouslyStackedShape) {
77873
77967
  return;
77874
77968
  }
77875
77969
  this.previouslyStackedShape = shape;
77876
77970
  this.paperManager.performAtomicAction(function () {
77877
- return ensureShapeIsNotCovered(shape, _this40.graph);
77971
+ return ensureShapeIsNotCovered(shape, _this41.graph);
77878
77972
  });
77879
77973
  },
77880
77974
  showSavedNotification: function showSavedNotification() {
@@ -77908,49 +78002,49 @@ var Multiplayer = /*#__PURE__*/function () {
77908
78002
  return false;
77909
78003
  },
77910
78004
  pointerDowInShape: function pointerDowInShape(event, element) {
77911
- var _this41 = this;
77912
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
78005
+ var _this42 = this;
78006
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
77913
78007
  var x, y, shapeView;
77914
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
77915
- while (1) switch (_context31.prev = _context31.next) {
78008
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
78009
+ while (1) switch (_context32.prev = _context32.next) {
77916
78010
  case 0:
77917
78011
  x = event.clientX, y = event.clientY;
77918
- shapeView = _this41.paper.findViewByModel(element);
77919
- _this41.isDragging = false;
77920
- _this41.isSelecting = false;
77921
- _this41.isIntoTheSelection = false;
77922
- _this41.dragStart = {
78012
+ shapeView = _this42.paper.findViewByModel(element);
78013
+ _this42.isDragging = false;
78014
+ _this42.isSelecting = false;
78015
+ _this42.isIntoTheSelection = false;
78016
+ _this42.dragStart = {
77923
78017
  x: x,
77924
78018
  y: y
77925
78019
  };
77926
78020
  // Verify if is in the selection box
77927
- if (!_this41.isPointInSelection(event)) {
77928
- _context31.next = 10;
78021
+ if (!_this42.isPointInSelection(event)) {
78022
+ _context32.next = 10;
77929
78023
  break;
77930
78024
  }
77931
- _this41.isIntoTheSelection = true;
77932
- _context31.next = 15;
78025
+ _this42.isIntoTheSelection = true;
78026
+ _context32.next = 15;
77933
78027
  break;
77934
78028
  case 10:
77935
78029
  if (event.shiftKey) {
77936
- _context31.next = 15;
78030
+ _context32.next = 15;
77937
78031
  break;
77938
78032
  }
77939
- _context31.next = 13;
77940
- return _this41.$refs.selector.selectElement(shapeView);
78033
+ _context32.next = 13;
78034
+ return _this42.$refs.selector.selectElement(shapeView);
77941
78035
  case 13:
77942
- _context31.next = 15;
77943
- return _this41.$nextTick();
78036
+ _context32.next = 15;
78037
+ return _this42.$nextTick();
77944
78038
  case 15:
77945
- _this41.$refs.selector.startDrag({
78039
+ _this42.$refs.selector.startDrag({
77946
78040
  clientX: event.clientX,
77947
78041
  clientY: event.clientY
77948
78042
  });
77949
78043
  case 16:
77950
78044
  case "end":
77951
- return _context31.stop();
78045
+ return _context32.stop();
77952
78046
  }
77953
- }, _callee31);
78047
+ }, _callee32);
77954
78048
  }))();
77955
78049
  },
77956
78050
  pointerDownHandler: function pointerDownHandler(event) {
@@ -78071,7 +78165,7 @@ var Multiplayer = /*#__PURE__*/function () {
78071
78165
  this.$emit('set-xml-manager', this.xmlManager);
78072
78166
  },
78073
78167
  mounted: function mounted() {
78074
- var _this42 = this;
78168
+ var _this43 = this;
78075
78169
  store.commit('setReadOnly', this.readOnly);
78076
78170
  this.graph = new external_jointjs_.dia.Graph();
78077
78171
  store.commit('setGraph', this.graph);
@@ -78090,47 +78184,47 @@ var Multiplayer = /*#__PURE__*/function () {
78090
78184
  store.commit('setPaper', this.paperManager.paper);
78091
78185
  this.paperManager.addEventHandler('element:pointerclick', this.blurFocusedScreenBuilderElement, this);
78092
78186
  this.paperManager.addEventHandler('blank:pointerdown', function (event, x, y) {
78093
- if (_this42.isGrabbing) return;
78187
+ if (_this43.isGrabbing) return;
78094
78188
  if (store.getters.isReadOnly) {
78095
- _this42.isGrabbing = true;
78189
+ _this43.isGrabbing = true;
78096
78190
  }
78097
- var scale = _this42.paperManager.scale;
78098
- _this42.canvasDragPosition = {
78191
+ var scale = _this43.paperManager.scale;
78192
+ _this43.canvasDragPosition = {
78099
78193
  x: x * scale.sx,
78100
78194
  y: y * scale.sy
78101
78195
  };
78102
- _this42.isOverShape = false;
78103
- _this42.pointerDownHandler(event);
78196
+ _this43.isOverShape = false;
78197
+ _this43.pointerDownHandler(event);
78104
78198
  }, this);
78105
78199
  this.paperManager.addEventHandler('cell:mouseover element:mouseover', function (_ref19) {
78106
78200
  var shape = _ref19.model;
78107
- if (_this42.isBpmnNode(shape) && shape.attr('body/cursor') !== 'default' && !_this42.isGrabbing) {
78201
+ if (_this43.isBpmnNode(shape) && shape.attr('body/cursor') !== 'default' && !_this43.isGrabbing) {
78108
78202
  shape.attr('body/cursor', 'move');
78109
78203
  }
78110
78204
  // If the user is panning the Paper while hovering an element, ignore the default move cursor
78111
- if (_this42.isGrabbing && _this42.isBpmnNode(shape)) {
78205
+ if (_this43.isGrabbing && _this43.isBpmnNode(shape)) {
78112
78206
  shape.attr('body/cursor', 'grabbing');
78113
78207
  }
78114
78208
  });
78115
78209
  this.paperManager.addEventHandler('blank:pointerup', function (event) {
78116
- _this42.isGrabbing = false;
78117
- _this42.canvasDragPosition = null;
78118
- _this42.activeNode = null;
78119
- _this42.pointerUpHandler(event);
78210
+ _this43.isGrabbing = false;
78211
+ _this43.canvasDragPosition = null;
78212
+ _this43.activeNode = null;
78213
+ _this43.pointerUpHandler(event);
78120
78214
  }, this);
78121
78215
  this.paperManager.addEventHandler('cell:pointerup', function (cellView, event) {
78122
- _this42.canvasDragPosition = null;
78123
- _this42.activeNode = null;
78124
- _this42.pointerUpHandler(event, cellView);
78216
+ _this43.canvasDragPosition = null;
78217
+ _this43.activeNode = null;
78218
+ _this43.pointerUpHandler(event, cellView);
78125
78219
  }, this);
78126
78220
  this.$refs['paper-container'].addEventListener('mouseenter', function () {
78127
78221
  store.commit('setClientLeftPaper', false);
78128
78222
  });
78129
78223
  this.$el.addEventListener('mousemove', function (event) {
78130
- _this42.pointerMoveHandler(event);
78224
+ _this43.pointerMoveHandler(event);
78131
78225
  });
78132
78226
  this.$refs['paper-container'].addEventListener('mouseleave', function () {
78133
- _this42.paperManager.removeEventHandler('blank:pointermove');
78227
+ _this43.paperManager.removeEventHandler('blank:pointermove');
78134
78228
  store.commit('setClientLeftPaper', true);
78135
78229
  });
78136
78230
  this.paperManager.addEventHandler('cell:pointerclick', function (cellView, evt, x, y) {
@@ -78141,44 +78235,44 @@ var Multiplayer = /*#__PURE__*/function () {
78141
78235
  });
78142
78236
  this.paperManager.addEventHandler('cell:pointerclick', function (_ref20, event) {
78143
78237
  var shape = _ref20.model;
78144
- if (!_this42.isBpmnNode(shape)) {
78238
+ if (!_this43.isBpmnNode(shape)) {
78145
78239
  return;
78146
78240
  }
78147
78241
 
78148
78242
  // ignore click event if the user is Grabbing the paper
78149
- if (_this42.isGrabbing) return;
78243
+ if (_this43.isGrabbing) return;
78150
78244
  shape.component.$emit('click', event);
78151
- _this42.$emit('click', {
78245
+ _this43.$emit('click', {
78152
78246
  event: event,
78153
- node: _this42.highlightedNode.definition
78247
+ node: _this43.highlightedNode.definition
78154
78248
  });
78155
78249
  });
78156
78250
  this.paperManager.addEventHandler('cell:pointerdown', function (_ref21, event) {
78157
78251
  var shape = _ref21.model;
78158
- if (!_this42.isBpmnNode(shape)) {
78252
+ if (!_this43.isBpmnNode(shape)) {
78159
78253
  return;
78160
78254
  }
78161
78255
  // If the user is pressing Space (grabbing) and clicking on a Cell, return
78162
- if (_this42.isGrabbing) {
78256
+ if (_this43.isGrabbing) {
78163
78257
  return;
78164
78258
  }
78165
- _this42.setShapeStacking(shape);
78166
- _this42.activeNode = shape.component.node;
78167
- _this42.isOverShape = true;
78168
- _this42.pointerDowInShape(event, shape);
78259
+ _this43.setShapeStacking(shape);
78260
+ _this43.activeNode = shape.component.node;
78261
+ _this43.isOverShape = true;
78262
+ _this43.pointerDowInShape(event, shape);
78169
78263
  });
78170
78264
  // If the user is grabbing the paper while he clicked in a cell, move the paper and not the cell
78171
78265
  this.paperManager.addEventHandler('cell:pointermove', function (_, event, x, y) {
78172
- if (_this42.isGrabbing) {
78173
- if (!_this42.canvasDragPosition) {
78174
- var scale = _this42.paperManager.scale;
78175
- _this42.canvasDragPosition = {
78266
+ if (_this43.isGrabbing) {
78267
+ if (!_this43.canvasDragPosition) {
78268
+ var scale = _this43.paperManager.scale;
78269
+ _this43.canvasDragPosition = {
78176
78270
  x: x * scale.sx,
78177
78271
  y: y * scale.sy
78178
78272
  };
78179
78273
  }
78180
- if (_this42.canvasDragPosition && !_this42.clientLeftPaper) {
78181
- _this42.paperManager.translate(event.offsetX - _this42.canvasDragPosition.x, event.offsetY - _this42.canvasDragPosition.y);
78274
+ if (_this43.canvasDragPosition && !_this43.clientLeftPaper) {
78275
+ _this43.paperManager.translate(event.offsetX - _this43.canvasDragPosition.x, event.offsetY - _this43.canvasDragPosition.y);
78182
78276
  }
78183
78277
  }
78184
78278
  });
@@ -78189,28 +78283,29 @@ var Multiplayer = /*#__PURE__*/function () {
78189
78283
  modeler: this,
78190
78284
  registerMenuAction: this.registerMenuAction,
78191
78285
  loadXML: function () {
78192
- var _loadXML = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(xml) {
78286
+ var _loadXML = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(xml) {
78193
78287
  var multiplayer;
78194
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
78195
- while (1) switch (_context32.prev = _context32.next) {
78288
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
78289
+ while (1) switch (_context33.prev = _context33.next) {
78196
78290
  case 0:
78197
- _context32.next = 2;
78198
- return _this42.loadXML(xml);
78291
+ _context33.next = 2;
78292
+ return _this43.loadXML(xml);
78199
78293
  case 2:
78200
- _context32.next = 4;
78294
+ _context33.next = 4;
78201
78295
  return undoRedoStore.dispatch('pushState', xml);
78202
78296
  case 4:
78203
78297
  try {
78204
- multiplayer = new Multiplayer(_this42);
78298
+ multiplayer = new Multiplayer(_this43);
78205
78299
  multiplayer.init();
78300
+ _this43.multiplayer = multiplayer;
78206
78301
  } catch (error) {
78207
78302
  console.warn('Could not initialize multiplayer', error);
78208
78303
  }
78209
78304
  case 5:
78210
78305
  case "end":
78211
- return _context32.stop();
78306
+ return _context33.stop();
78212
78307
  }
78213
- }, _callee32);
78308
+ }, _callee33);
78214
78309
  }));
78215
78310
  function loadXML(_x) {
78216
78311
  return _loadXML.apply(this, arguments);
@@ -78218,18 +78313,18 @@ var Multiplayer = /*#__PURE__*/function () {
78218
78313
  return loadXML;
78219
78314
  }(),
78220
78315
  addWarnings: function addWarnings(warnings) {
78221
- return _this42.$emit('warnings', warnings);
78316
+ return _this43.$emit('warnings', warnings);
78222
78317
  },
78223
78318
  addBreadcrumbs: function addBreadcrumbs(breadcrumbs) {
78224
- return _this42.breadcrumbData.push(breadcrumbs);
78319
+ return _this43.breadcrumbData.push(breadcrumbs);
78225
78320
  }
78226
78321
  });
78227
78322
  this.$root.$on('replace-ai-node', function (data) {
78228
- _this42.replaceAiNode(data);
78323
+ _this43.replaceAiNode(data);
78229
78324
  });
78230
78325
  window.ProcessMaker.EventBus.$on('save-changes', function (redirectUrl) {
78231
78326
  if (redirectUrl) {
78232
- _this42.redirect(redirectUrl);
78327
+ _this43.redirect(redirectUrl);
78233
78328
  }
78234
78329
  });
78235
78330
  }
@@ -78251,8 +78346,8 @@ var modelervue_type_style_index_0_prod_lang_scss_ = __webpack_require__(26695);
78251
78346
 
78252
78347
  var Modeler_component = normalizeComponent(
78253
78348
  modeler_Modelervue_type_script_lang_js_,
78254
- Modelervue_type_template_id_83a477c8_render,
78255
- Modelervue_type_template_id_83a477c8_staticRenderFns,
78349
+ Modelervue_type_template_id_5fd6d55f_render,
78350
+ Modelervue_type_template_id_5fd6d55f_staticRenderFns,
78256
78351
  false,
78257
78352
  null,
78258
78353
  null,