@processmaker/modeler 1.43.11 → 1.43.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modeler.common.js +97 -85
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +97 -85
- package/dist/modeler.umd.js.map +1 -1
- package/dist/modeler.umd.min.js +1 -1
- package/dist/modeler.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/multiplayer/multiplayer.js +13 -1
package/dist/modeler.common.js
CHANGED
|
@@ -77152,11 +77152,13 @@ var ColorUtil = /*#__PURE__*/function () {
|
|
|
77152
77152
|
|
|
77153
77153
|
|
|
77154
77154
|
|
|
77155
|
+
|
|
77155
77156
|
|
|
77156
77157
|
|
|
77157
77158
|
var _nodeIdGenerator = /*#__PURE__*/new WeakMap();
|
|
77158
77159
|
var Multiplayer = /*#__PURE__*/function () {
|
|
77159
77160
|
function Multiplayer(modeler) {
|
|
77161
|
+
var _this = this;
|
|
77160
77162
|
_classCallCheck(this, Multiplayer);
|
|
77161
77163
|
_defineProperty(this, "clientIO", null);
|
|
77162
77164
|
_defineProperty(this, "yDoc", null);
|
|
@@ -77170,6 +77172,15 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77170
77172
|
_defineProperty(this, "inspector", null);
|
|
77171
77173
|
_defineProperty(this, "deletedItem", null);
|
|
77172
77174
|
_defineProperty(this, "colorUtil", null);
|
|
77175
|
+
/**
|
|
77176
|
+
* Debounces the updatedSelectedNodes function to avoid triggering multiple times
|
|
77177
|
+
* the update
|
|
77178
|
+
*
|
|
77179
|
+
* @param {Object} payload
|
|
77180
|
+
*/
|
|
77181
|
+
_defineProperty(this, "debouncedUpdateSelectedNodes", (0,external_lodash_.debounce)(function (data) {
|
|
77182
|
+
_this.updateSelectedNodes(data);
|
|
77183
|
+
}, 400));
|
|
77173
77184
|
// define document
|
|
77174
77185
|
this.yDoc = new Doc();
|
|
77175
77186
|
// Create a shared array
|
|
@@ -77203,42 +77214,42 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77203
77214
|
}, {
|
|
77204
77215
|
key: "webSocketEvents",
|
|
77205
77216
|
value: function webSocketEvents() {
|
|
77206
|
-
var
|
|
77217
|
+
var _this2 = this;
|
|
77207
77218
|
this.clientIO.on('connect', function () {
|
|
77208
77219
|
var _window$ProcessMaker$2, _window$ProcessMaker$3, _window$ProcessMaker$4, _window$ProcessMaker$5;
|
|
77209
77220
|
// Join the room
|
|
77210
|
-
|
|
77211
|
-
|
|
77212
|
-
roomName:
|
|
77221
|
+
_this2.modeler.emptyPlayers();
|
|
77222
|
+
_this2.clientIO.emit('joinRoom', {
|
|
77223
|
+
roomName: _this2.room.getRoom(),
|
|
77213
77224
|
clientName: (_window$ProcessMaker$2 = window.ProcessMaker.user) === null || _window$ProcessMaker$2 === void 0 ? void 0 : _window$ProcessMaker$2.fullName,
|
|
77214
77225
|
clientAvatar: (_window$ProcessMaker$3 = window.ProcessMaker.user) === null || _window$ProcessMaker$3 === void 0 ? void 0 : _window$ProcessMaker$3.avatar,
|
|
77215
|
-
clientColor: ((_window$ProcessMaker$4 = window.ProcessMaker.user) === null || _window$ProcessMaker$4 === void 0 ? void 0 : _window$ProcessMaker$4.color) ||
|
|
77226
|
+
clientColor: ((_window$ProcessMaker$4 = window.ProcessMaker.user) === null || _window$ProcessMaker$4 === void 0 ? void 0 : _window$ProcessMaker$4.color) || _this2.colorUtil.randomColor((_window$ProcessMaker$5 = window.ProcessMaker.user) === null || _window$ProcessMaker$5 === void 0 ? void 0 : _window$ProcessMaker$5.fullName),
|
|
77216
77227
|
clientCursor: {
|
|
77217
77228
|
coordinates: {
|
|
77218
77229
|
clientX: 300,
|
|
77219
77230
|
clientY: 300
|
|
77220
77231
|
},
|
|
77221
|
-
paperTranslate:
|
|
77222
|
-
paperScale:
|
|
77232
|
+
paperTranslate: _this2.modeler.paper.translate(),
|
|
77233
|
+
paperScale: _this2.modeler.paper.scale()
|
|
77223
77234
|
}
|
|
77224
77235
|
});
|
|
77225
77236
|
});
|
|
77226
77237
|
this.clientIO.on('clientJoined', function (payload) {
|
|
77227
|
-
|
|
77228
|
-
|
|
77238
|
+
_this2.modeler.enableMultiplayer(payload.isMultiplayer);
|
|
77239
|
+
_this2.addPlayers(payload);
|
|
77229
77240
|
});
|
|
77230
77241
|
this.clientIO.on('clientLeft', function (payload) {
|
|
77231
77242
|
// Unhighlight nodes
|
|
77232
|
-
|
|
77243
|
+
_this2.modeler.unhightligtNodes(payload.clientId);
|
|
77233
77244
|
// Remove the player from the multiplayer list
|
|
77234
|
-
|
|
77235
|
-
|
|
77245
|
+
_this2.modeler.removePlayer(payload.clientId);
|
|
77246
|
+
_this2.modeler.enableMultiplayer(payload.isMultiplayer);
|
|
77236
77247
|
});
|
|
77237
77248
|
this.clientIO.on('requestProcess', function (payload) {
|
|
77238
77249
|
var clientId = payload.clientId;
|
|
77239
77250
|
// Sync the local Nodes
|
|
77240
77251
|
if (clientId) {
|
|
77241
|
-
|
|
77252
|
+
_this2.syncLocalNodes(clientId);
|
|
77242
77253
|
}
|
|
77243
77254
|
});
|
|
77244
77255
|
|
|
@@ -77248,7 +77259,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77248
77259
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
77249
77260
|
while (1) switch (_context.prev = _context.next) {
|
|
77250
77261
|
case 0:
|
|
77251
|
-
|
|
77262
|
+
_this2.updateClientCursor(payload);
|
|
77252
77263
|
case 1:
|
|
77253
77264
|
case "end":
|
|
77254
77265
|
return _context.stop();
|
|
@@ -77266,7 +77277,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77266
77277
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
77267
77278
|
while (1) switch (_context2.prev = _context2.next) {
|
|
77268
77279
|
case 0:
|
|
77269
|
-
|
|
77280
|
+
_this2.updateHightligtedNodes(payload);
|
|
77270
77281
|
case 1:
|
|
77271
77282
|
case "end":
|
|
77272
77283
|
return _context2.stop();
|
|
@@ -77285,10 +77296,10 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77285
77296
|
while (1) switch (_context3.prev = _context3.next) {
|
|
77286
77297
|
case 0:
|
|
77287
77298
|
_context3.next = 2;
|
|
77288
|
-
return
|
|
77299
|
+
return _this2.createRemoteShape(payload.changes);
|
|
77289
77300
|
case 2:
|
|
77290
77301
|
// Add the new element to the shared array
|
|
77291
|
-
applyUpdate(
|
|
77302
|
+
applyUpdate(_this2.yDoc, new Uint8Array(payload.updateDoc));
|
|
77292
77303
|
case 3:
|
|
77293
77304
|
case "end":
|
|
77294
77305
|
return _context3.stop();
|
|
@@ -77306,15 +77317,15 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77306
77317
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
77307
77318
|
while (1) switch (_context4.prev = _context4.next) {
|
|
77308
77319
|
case 0:
|
|
77309
|
-
if (!(payload.clientId ===
|
|
77320
|
+
if (!(payload.clientId === _this2.clientIO.id)) {
|
|
77310
77321
|
_context4.next = 4;
|
|
77311
77322
|
break;
|
|
77312
77323
|
}
|
|
77313
77324
|
_context4.next = 3;
|
|
77314
|
-
return
|
|
77325
|
+
return _this2.createRemoteShape(payload.changes);
|
|
77315
77326
|
case 3:
|
|
77316
77327
|
// Add the new element to the shared array
|
|
77317
|
-
applyUpdate(
|
|
77328
|
+
applyUpdate(_this2.yDoc, new Uint8Array(payload.updateDoc));
|
|
77318
77329
|
case 4:
|
|
77319
77330
|
case "end":
|
|
77320
77331
|
return _context4.stop();
|
|
@@ -77330,12 +77341,12 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77330
77341
|
this.clientIO.on('removeElement', function (payload) {
|
|
77331
77342
|
payload.deletedNodes.forEach(function (nodeId) {
|
|
77332
77343
|
// Get the node id
|
|
77333
|
-
var node =
|
|
77344
|
+
var node = _this2.getNodeById(nodeId);
|
|
77334
77345
|
// Remove the element from the process
|
|
77335
|
-
|
|
77346
|
+
_this2.removeShape(node);
|
|
77336
77347
|
});
|
|
77337
77348
|
// Remove the element from the shared array
|
|
77338
|
-
applyUpdate(
|
|
77349
|
+
applyUpdate(_this2.yDoc, new Uint8Array(payload.updateDoc));
|
|
77339
77350
|
});
|
|
77340
77351
|
|
|
77341
77352
|
// Listen for updates when a element is updated
|
|
@@ -77345,16 +77356,16 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77345
77356
|
isReplaced = payload.isReplaced;
|
|
77346
77357
|
if (isReplaced) {
|
|
77347
77358
|
// Replace the element in the process
|
|
77348
|
-
|
|
77359
|
+
_this2.replaceShape(updatedNodes[0]);
|
|
77349
77360
|
} else {
|
|
77350
77361
|
// Update the elements in the process
|
|
77351
77362
|
updatedNodes.forEach(function (data) {
|
|
77352
|
-
|
|
77363
|
+
_this2.updateShapes(data);
|
|
77353
77364
|
});
|
|
77354
77365
|
}
|
|
77355
77366
|
|
|
77356
77367
|
// Update the element in the shared array
|
|
77357
|
-
applyUpdate(
|
|
77368
|
+
applyUpdate(_this2.yDoc, new Uint8Array(updateDoc));
|
|
77358
77369
|
});
|
|
77359
77370
|
this.clientIO.on('updateInspector', function (payload) {
|
|
77360
77371
|
var updateDoc = payload.updateDoc,
|
|
@@ -77362,70 +77373,70 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77362
77373
|
|
|
77363
77374
|
// Update the elements in the process
|
|
77364
77375
|
updatedNodes.forEach(function (data) {
|
|
77365
|
-
|
|
77376
|
+
_this2.updateShapeFromInspector(data);
|
|
77366
77377
|
});
|
|
77367
77378
|
|
|
77368
77379
|
// Update the element in the shared array
|
|
77369
|
-
applyUpdate(
|
|
77380
|
+
applyUpdate(_this2.yDoc, new Uint8Array(updateDoc));
|
|
77370
77381
|
});
|
|
77371
77382
|
this.clientIO.on('updateFlows', function (payload) {
|
|
77372
77383
|
var updateDoc = payload.updateDoc,
|
|
77373
77384
|
updatedNodes = payload.updatedNodes;
|
|
77374
77385
|
// Update the elements in the process
|
|
77375
77386
|
updatedNodes.forEach(function (data) {
|
|
77376
|
-
|
|
77387
|
+
_this2.updateFlowClient(data);
|
|
77377
77388
|
});
|
|
77378
77389
|
// Update the element in the shared array
|
|
77379
|
-
applyUpdate(
|
|
77390
|
+
applyUpdate(_this2.yDoc, new Uint8Array(updateDoc));
|
|
77380
77391
|
});
|
|
77381
77392
|
}
|
|
77382
77393
|
}, {
|
|
77383
77394
|
key: "multiplayerEvents",
|
|
77384
77395
|
value: function multiplayerEvents() {
|
|
77385
|
-
var
|
|
77396
|
+
var _this3 = this;
|
|
77386
77397
|
window.ProcessMaker.EventBus.$on('multiplayer-addNode', function (data) {
|
|
77387
|
-
|
|
77398
|
+
_this3.addNode(data);
|
|
77388
77399
|
});
|
|
77389
77400
|
window.ProcessMaker.EventBus.$on('multiplayer-removeNode', function (data) {
|
|
77390
|
-
|
|
77401
|
+
_this3.removeNode(data);
|
|
77391
77402
|
});
|
|
77392
77403
|
window.ProcessMaker.EventBus.$on('multiplayer-updateNodes', function (data) {
|
|
77393
|
-
if (
|
|
77394
|
-
|
|
77404
|
+
if (_this3.modeler.isMultiplayer) {
|
|
77405
|
+
_this3.updateNodes(data);
|
|
77395
77406
|
}
|
|
77396
77407
|
});
|
|
77397
77408
|
window.ProcessMaker.EventBus.$on('multiplayer-replaceNode', function (_ref5) {
|
|
77398
77409
|
var nodeData = _ref5.nodeData,
|
|
77399
77410
|
newControl = _ref5.newControl;
|
|
77400
|
-
|
|
77411
|
+
_this3.replaceNode(nodeData, newControl);
|
|
77401
77412
|
});
|
|
77402
77413
|
window.ProcessMaker.EventBus.$on('multiplayer-addFlow', function (data) {
|
|
77403
|
-
|
|
77414
|
+
_this3.addCommonElement(data);
|
|
77404
77415
|
});
|
|
77405
77416
|
window.ProcessMaker.EventBus.$on('multiplayer-addBoundaryEvent', function (data) {
|
|
77406
|
-
|
|
77417
|
+
_this3.addCommonElement(data);
|
|
77407
77418
|
});
|
|
77408
77419
|
window.ProcessMaker.EventBus.$on('multiplayer-addLanes', function (lanes) {
|
|
77409
|
-
|
|
77420
|
+
_this3.addLaneNodes(lanes);
|
|
77410
77421
|
});
|
|
77411
77422
|
window.ProcessMaker.EventBus.$on('multiplayer-updateInspectorProperty', function (data) {
|
|
77412
|
-
if (
|
|
77413
|
-
|
|
77423
|
+
if (_this3.modeler.isMultiplayer) {
|
|
77424
|
+
_this3.updateInspectorProperty(data);
|
|
77414
77425
|
}
|
|
77415
77426
|
});
|
|
77416
77427
|
window.ProcessMaker.EventBus.$on('multiplayer-updateFlows', function (data) {
|
|
77417
|
-
if (
|
|
77418
|
-
|
|
77428
|
+
if (_this3.modeler.isMultiplayer) {
|
|
77429
|
+
_this3.updateFlows(data);
|
|
77419
77430
|
}
|
|
77420
77431
|
});
|
|
77421
77432
|
window.ProcessMaker.EventBus.$on('multiplayer-updateSelectedNodes', function (data) {
|
|
77422
|
-
if (
|
|
77423
|
-
|
|
77433
|
+
if (_this3.modeler.isMultiplayer) {
|
|
77434
|
+
_this3.debouncedUpdateSelectedNodes(data);
|
|
77424
77435
|
}
|
|
77425
77436
|
});
|
|
77426
77437
|
window.ProcessMaker.EventBus.$on('multiplayer-updateMousePosition', function (data) {
|
|
77427
|
-
if (
|
|
77428
|
-
|
|
77438
|
+
if (_this3.modeler.isMultiplayer) {
|
|
77439
|
+
_this3.updateMousePosition(data);
|
|
77429
77440
|
}
|
|
77430
77441
|
});
|
|
77431
77442
|
}
|
|
@@ -77436,7 +77447,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77436
77447
|
}, {
|
|
77437
77448
|
key: "addPlayers",
|
|
77438
77449
|
value: function addPlayers(payload) {
|
|
77439
|
-
var
|
|
77450
|
+
var _this4 = this;
|
|
77440
77451
|
if (payload.isMultiplayer) {
|
|
77441
77452
|
payload.clients.map(function (client) {
|
|
77442
77453
|
var newPlayer = {
|
|
@@ -77446,7 +77457,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77446
77457
|
avatar: client.avatar,
|
|
77447
77458
|
cursor: client.cursor
|
|
77448
77459
|
};
|
|
77449
|
-
|
|
77460
|
+
_this4.modeler.addPlayer(newPlayer);
|
|
77450
77461
|
});
|
|
77451
77462
|
}
|
|
77452
77463
|
}
|
|
@@ -77470,18 +77481,19 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77470
77481
|
}, {
|
|
77471
77482
|
key: "updateClientCursor",
|
|
77472
77483
|
value: function updateClientCursor(payload) {
|
|
77473
|
-
var
|
|
77484
|
+
var _this5 = this;
|
|
77474
77485
|
payload.clients.map(function (client) {
|
|
77475
|
-
|
|
77486
|
+
_this5.modeler.updateClientCursor(client);
|
|
77476
77487
|
});
|
|
77477
77488
|
}
|
|
77489
|
+
}, {
|
|
77490
|
+
key: "updateSelectedNodes",
|
|
77491
|
+
value:
|
|
77478
77492
|
/**
|
|
77479
77493
|
* Updates the selected nodes by the user
|
|
77480
77494
|
* @param {Object} data
|
|
77481
77495
|
*/
|
|
77482
|
-
|
|
77483
|
-
key: "updateSelectedNodes",
|
|
77484
|
-
value: function updateSelectedNodes(data) {
|
|
77496
|
+
function updateSelectedNodes(data) {
|
|
77485
77497
|
var warningMessage = 'Another user is working on this object, wait until they finish making changes.';
|
|
77486
77498
|
if (this.modeler.isMultiplayerSelected(data)) {
|
|
77487
77499
|
window.ProcessMaker.alert(warningMessage, 'warning');
|
|
@@ -77499,9 +77511,9 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77499
77511
|
}, {
|
|
77500
77512
|
key: "updateHightligtedNodes",
|
|
77501
77513
|
value: function updateHightligtedNodes(payload) {
|
|
77502
|
-
var
|
|
77514
|
+
var _this6 = this;
|
|
77503
77515
|
payload.clients.map(function (client) {
|
|
77504
|
-
|
|
77516
|
+
_this6.modeler.updateHightligtedNodes(client);
|
|
77505
77517
|
});
|
|
77506
77518
|
}
|
|
77507
77519
|
|
|
@@ -77512,25 +77524,25 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77512
77524
|
}, {
|
|
77513
77525
|
key: "syncLocalNodes",
|
|
77514
77526
|
value: function syncLocalNodes(clientId) {
|
|
77515
|
-
var
|
|
77527
|
+
var _this7 = this;
|
|
77516
77528
|
// Get the process definition
|
|
77517
77529
|
var nodes = this.modeler.nodes.map(function (node) {
|
|
77518
77530
|
if (node.definition.$type === 'bpmn:BoundaryEvent') {
|
|
77519
77531
|
return getBoundaryEventData(node);
|
|
77520
77532
|
}
|
|
77521
77533
|
if (node.definition.$type === 'bpmn:Lane') {
|
|
77522
|
-
return
|
|
77534
|
+
return _this7.prepareLaneData(node);
|
|
77523
77535
|
}
|
|
77524
|
-
return
|
|
77536
|
+
return _this7.modeler.multiplayerHook(node, false, true);
|
|
77525
77537
|
});
|
|
77526
77538
|
nodes.forEach(function (node) {
|
|
77527
77539
|
var yMapNested = new YMap();
|
|
77528
|
-
|
|
77529
|
-
|
|
77540
|
+
_this7.doTransact(yMapNested, node);
|
|
77541
|
+
_this7.yArray.push([yMapNested]);
|
|
77530
77542
|
// Encode the state as an update and send it to the server
|
|
77531
|
-
var stateUpdate = encodeStateAsUpdate(
|
|
77543
|
+
var stateUpdate = encodeStateAsUpdate(_this7.yDoc);
|
|
77532
77544
|
// Send the update to the web socket server
|
|
77533
|
-
|
|
77545
|
+
_this7.clientIO.emit('createElement', {
|
|
77534
77546
|
updateDoc: stateUpdate,
|
|
77535
77547
|
clientId: clientId
|
|
77536
77548
|
});
|
|
@@ -77569,10 +77581,10 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77569
77581
|
}, {
|
|
77570
77582
|
key: "createRemoteShape",
|
|
77571
77583
|
value: function createRemoteShape(changes) {
|
|
77572
|
-
var
|
|
77584
|
+
var _this8 = this;
|
|
77573
77585
|
return new Promise(function (resolve) {
|
|
77574
77586
|
changes.map(function (data) {
|
|
77575
|
-
|
|
77587
|
+
_this8.createShape(data);
|
|
77576
77588
|
});
|
|
77577
77589
|
resolve();
|
|
77578
77590
|
});
|
|
@@ -77639,14 +77651,14 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77639
77651
|
}, {
|
|
77640
77652
|
key: "updateNodes",
|
|
77641
77653
|
value: function updateNodes(data) {
|
|
77642
|
-
var
|
|
77654
|
+
var _this9 = this;
|
|
77643
77655
|
data.forEach(function (value) {
|
|
77644
|
-
var index =
|
|
77645
|
-
var nodeToUpdate =
|
|
77656
|
+
var index = _this9.getIndex(value.id);
|
|
77657
|
+
var nodeToUpdate = _this9.yArray.get(index);
|
|
77646
77658
|
var updateData = value.poolId ? _objectSpread2(_objectSpread2({}, value.properties), {
|
|
77647
77659
|
poolId: value.poolId
|
|
77648
77660
|
}) : value.properties;
|
|
77649
|
-
|
|
77661
|
+
_this9.doTransact(nodeToUpdate, updateData);
|
|
77650
77662
|
});
|
|
77651
77663
|
}
|
|
77652
77664
|
}, {
|
|
@@ -77828,7 +77840,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77828
77840
|
}, {
|
|
77829
77841
|
key: "updateMovedWaypoint",
|
|
77830
77842
|
value: function updateMovedWaypoint(element, data) {
|
|
77831
|
-
var
|
|
77843
|
+
var _this10 = this;
|
|
77832
77844
|
var waypoint = data.waypoint;
|
|
77833
77845
|
var paper = this.modeler.paper;
|
|
77834
77846
|
// Update the element's waypoints
|
|
@@ -77841,14 +77853,14 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77841
77853
|
element.vertices(waypoint);
|
|
77842
77854
|
// update bpmn waypoints
|
|
77843
77855
|
element.component.node.diagram.waypoint = waypoint.map(function (point) {
|
|
77844
|
-
return
|
|
77856
|
+
return _this10.modeler.moddle.create('dc:Point', point);
|
|
77845
77857
|
});
|
|
77846
77858
|
// Force Remount Flow
|
|
77847
77859
|
element.component.node._modelerId += '_replaced';
|
|
77848
77860
|
// Update the element's source anchor
|
|
77849
77861
|
element.source(sourceElem, {
|
|
77850
77862
|
anchor: function anchor() {
|
|
77851
|
-
return getDefaultAnchorPoint(
|
|
77863
|
+
return getDefaultAnchorPoint(_this10.getConnectionPoint(sourceElem, startWaypoint), sourceElem.findView(paper));
|
|
77852
77864
|
},
|
|
77853
77865
|
connectionPoint: {
|
|
77854
77866
|
name: 'boundary'
|
|
@@ -77858,7 +77870,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77858
77870
|
// Update the element's target anchor
|
|
77859
77871
|
element.target(targetElem, {
|
|
77860
77872
|
anchor: function anchor() {
|
|
77861
|
-
return getDefaultAnchorPoint(
|
|
77873
|
+
return getDefaultAnchorPoint(_this10.getConnectionPoint(targetElem, endWaypoint), targetElem.findView(paper));
|
|
77862
77874
|
},
|
|
77863
77875
|
connectionPoint: {
|
|
77864
77876
|
name: 'boundary'
|
|
@@ -77901,7 +77913,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77901
77913
|
}, {
|
|
77902
77914
|
key: "addLaneNodes",
|
|
77903
77915
|
value: function addLaneNodes(lanes) {
|
|
77904
|
-
var
|
|
77916
|
+
var _this11 = this;
|
|
77905
77917
|
var pool = this.getPool(lanes);
|
|
77906
77918
|
var defaultPoolData = {
|
|
77907
77919
|
id: pool.component.node.definition.id,
|
|
@@ -77917,11 +77929,11 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
77917
77929
|
this.yDoc.transact(function () {
|
|
77918
77930
|
lanes.forEach(function (lane) {
|
|
77919
77931
|
var yMapNested = new YMap();
|
|
77920
|
-
var data =
|
|
77921
|
-
|
|
77922
|
-
|
|
77923
|
-
var stateUpdate = encodeStateAsUpdate(
|
|
77924
|
-
|
|
77932
|
+
var data = _this11.prepareLaneData(lane);
|
|
77933
|
+
_this11.doTransact(yMapNested, data);
|
|
77934
|
+
_this11.yArray.push([yMapNested]);
|
|
77935
|
+
var stateUpdate = encodeStateAsUpdate(_this11.yDoc);
|
|
77936
|
+
_this11.clientIO.emit('createElement', {
|
|
77925
77937
|
updateDoc: stateUpdate
|
|
77926
77938
|
});
|
|
77927
77939
|
});
|
|
@@ -78061,11 +78073,11 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
78061
78073
|
}, {
|
|
78062
78074
|
key: "updateFlows",
|
|
78063
78075
|
value: function updateFlows(data) {
|
|
78064
|
-
var
|
|
78076
|
+
var _this12 = this;
|
|
78065
78077
|
data.forEach(function (value) {
|
|
78066
|
-
var index =
|
|
78067
|
-
var nodeToUpdate =
|
|
78068
|
-
|
|
78078
|
+
var index = _this12.getIndex(value.id);
|
|
78079
|
+
var nodeToUpdate = _this12.yArray.get(index);
|
|
78080
|
+
_this12.yDoc.transact(function () {
|
|
78069
78081
|
for (var key in value) {
|
|
78070
78082
|
if (Object.hasOwn(value, key)) {
|
|
78071
78083
|
nodeToUpdate.set(key, value[key]);
|
|
@@ -78128,12 +78140,12 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
78128
78140
|
}, {
|
|
78129
78141
|
key: "refreshNodeWaypoint",
|
|
78130
78142
|
value: function refreshNodeWaypoint(element) {
|
|
78131
|
-
var
|
|
78143
|
+
var _this13 = this;
|
|
78132
78144
|
var linkView = this.modeler.paper.findViewByModel(element);
|
|
78133
78145
|
var start = linkView.sourceAnchor;
|
|
78134
78146
|
var end = linkView.targetAnchor;
|
|
78135
78147
|
element.component.node.diagram.waypoint = [start].concat(_toConsumableArray(element.component.shape.vertices()), [end]).map(function (point) {
|
|
78136
|
-
return
|
|
78148
|
+
return _this13.modeler.moddle.create('dc:Point', point);
|
|
78137
78149
|
});
|
|
78138
78150
|
}
|
|
78139
78151
|
}]);
|