@processmaker/modeler 1.39.27 → 1.39.28
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 +43 -32
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +43 -32
- 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 +20 -13
package/dist/modeler.umd.js
CHANGED
|
@@ -75879,6 +75879,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75879
75879
|
};
|
|
75880
75880
|
_this.modeler.addPlayer(newPlayer);
|
|
75881
75881
|
});
|
|
75882
|
+
_this.syncLocalNodes(_this.clientIO.id);
|
|
75882
75883
|
}
|
|
75883
75884
|
});
|
|
75884
75885
|
this.clientIO.on('clientLeft', function (payload) {
|
|
@@ -75892,22 +75893,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
75892
75893
|
|
|
75893
75894
|
// Check if the current client is the first client
|
|
75894
75895
|
if (firstClient.id === _this.clientIO.id) {
|
|
75895
|
-
|
|
75896
|
-
var nodes = _this.modeler.nodes.map(function (node) {
|
|
75897
|
-
return _this.modeler.multiplayerHook(node, false, true);
|
|
75898
|
-
});
|
|
75899
|
-
nodes.forEach(function (node) {
|
|
75900
|
-
var yMapNested = new YMap();
|
|
75901
|
-
_this.doTransact(yMapNested, node);
|
|
75902
|
-
_this.yArray.push([yMapNested]);
|
|
75903
|
-
// Encode the state as an update and send it to the server
|
|
75904
|
-
var stateUpdate = encodeStateAsUpdate(_this.yDoc);
|
|
75905
|
-
// Send the update to the web socket server
|
|
75906
|
-
_this.clientIO.emit('createElement', {
|
|
75907
|
-
updateDoc: stateUpdate,
|
|
75908
|
-
clientId: clientId
|
|
75909
|
-
});
|
|
75910
|
-
});
|
|
75896
|
+
_this.syncLocalNodes(clientId);
|
|
75911
75897
|
}
|
|
75912
75898
|
});
|
|
75913
75899
|
|
|
@@ -76030,6 +76016,31 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76030
76016
|
}
|
|
76031
76017
|
});
|
|
76032
76018
|
}
|
|
76019
|
+
/**
|
|
76020
|
+
* Sync the modeler nodes with the microservice
|
|
76021
|
+
* @param {String} clientId
|
|
76022
|
+
*/
|
|
76023
|
+
}, {
|
|
76024
|
+
key: "syncLocalNodes",
|
|
76025
|
+
value: function syncLocalNodes(clientId) {
|
|
76026
|
+
var _this2 = this;
|
|
76027
|
+
// Get the process definition
|
|
76028
|
+
var nodes = this.modeler.nodes.map(function (node) {
|
|
76029
|
+
return _this2.modeler.multiplayerHook(node, false, true);
|
|
76030
|
+
});
|
|
76031
|
+
nodes.forEach(function (node) {
|
|
76032
|
+
var yMapNested = new YMap();
|
|
76033
|
+
_this2.doTransact(yMapNested, node);
|
|
76034
|
+
_this2.yArray.push([yMapNested]);
|
|
76035
|
+
// Encode the state as an update and send it to the server
|
|
76036
|
+
var stateUpdate = encodeStateAsUpdate(_this2.yDoc);
|
|
76037
|
+
// Send the update to the web socket server
|
|
76038
|
+
_this2.clientIO.emit('createElement', {
|
|
76039
|
+
updateDoc: stateUpdate,
|
|
76040
|
+
clientId: clientId
|
|
76041
|
+
});
|
|
76042
|
+
});
|
|
76043
|
+
}
|
|
76033
76044
|
}, {
|
|
76034
76045
|
key: "addNode",
|
|
76035
76046
|
value: function addNode(data) {
|
|
@@ -76062,10 +76073,10 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76062
76073
|
}, {
|
|
76063
76074
|
key: "createRemoteShape",
|
|
76064
76075
|
value: function createRemoteShape(changes) {
|
|
76065
|
-
var
|
|
76076
|
+
var _this3 = this;
|
|
76066
76077
|
return new Promise(function (resolve) {
|
|
76067
76078
|
changes.map(function (data) {
|
|
76068
|
-
|
|
76079
|
+
_this3.createShape(data);
|
|
76069
76080
|
});
|
|
76070
76081
|
resolve();
|
|
76071
76082
|
});
|
|
@@ -76131,14 +76142,14 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76131
76142
|
}, {
|
|
76132
76143
|
key: "updateNodes",
|
|
76133
76144
|
value: function updateNodes(data) {
|
|
76134
|
-
var
|
|
76145
|
+
var _this4 = this;
|
|
76135
76146
|
data.forEach(function (value) {
|
|
76136
|
-
var index =
|
|
76137
|
-
var nodeToUpdate =
|
|
76147
|
+
var index = _this4.getIndex(value.id);
|
|
76148
|
+
var nodeToUpdate = _this4.yArray.get(index);
|
|
76138
76149
|
var updateData = value.poolId ? _objectSpread2(_objectSpread2({}, value.properties), {
|
|
76139
76150
|
poolId: value.poolId
|
|
76140
76151
|
}) : value.properties;
|
|
76141
|
-
|
|
76152
|
+
_this4.doTransact(nodeToUpdate, updateData);
|
|
76142
76153
|
});
|
|
76143
76154
|
}
|
|
76144
76155
|
}, {
|
|
@@ -76219,7 +76230,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76219
76230
|
key: "updateShapes",
|
|
76220
76231
|
value: function () {
|
|
76221
76232
|
var _updateShapes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
|
|
76222
|
-
var
|
|
76233
|
+
var _this5 = this;
|
|
76223
76234
|
var paper, element, newPool, sourceElem, targetElem, waypoint, startWaypoint, endWaypoint, newWaypoint, node;
|
|
76224
76235
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
76225
76236
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -76239,14 +76250,14 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76239
76250
|
startWaypoint = waypoint.shift();
|
|
76240
76251
|
endWaypoint = waypoint.pop(); // Update the element's waypoints
|
|
76241
76252
|
newWaypoint = waypoint.map(function (point) {
|
|
76242
|
-
return
|
|
76253
|
+
return _this5.modeler.moddle.create('dc:Point', point);
|
|
76243
76254
|
});
|
|
76244
76255
|
element.set('vertices', newWaypoint);
|
|
76245
76256
|
|
|
76246
76257
|
// Update the element's source anchor
|
|
76247
76258
|
element.source(sourceElem, {
|
|
76248
76259
|
anchor: function anchor() {
|
|
76249
|
-
return getDefaultAnchorPoint(
|
|
76260
|
+
return getDefaultAnchorPoint(_this5.getConnectionPoint(sourceElem, startWaypoint), sourceElem.findView(paper));
|
|
76250
76261
|
},
|
|
76251
76262
|
connectionPoint: {
|
|
76252
76263
|
name: 'boundary'
|
|
@@ -76256,7 +76267,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76256
76267
|
// Update the element's target anchor
|
|
76257
76268
|
element.target(targetElem, {
|
|
76258
76269
|
anchor: function anchor() {
|
|
76259
|
-
return getDefaultAnchorPoint(
|
|
76270
|
+
return getDefaultAnchorPoint(_this5.getConnectionPoint(targetElem, endWaypoint), targetElem.findView(paper));
|
|
76260
76271
|
},
|
|
76261
76272
|
connectionPoint: {
|
|
76262
76273
|
name: 'boundary'
|
|
@@ -76344,7 +76355,7 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76344
76355
|
}, {
|
|
76345
76356
|
key: "addLaneNodes",
|
|
76346
76357
|
value: function addLaneNodes(lanes) {
|
|
76347
|
-
var
|
|
76358
|
+
var _this6 = this;
|
|
76348
76359
|
var pool = this.getPool(lanes);
|
|
76349
76360
|
window.ProcessMaker.EventBus.$emit('multiplayer-updateNodes', [{
|
|
76350
76361
|
id: pool.component.node.definition.id,
|
|
@@ -76359,11 +76370,11 @@ var Multiplayer = /*#__PURE__*/function () {
|
|
|
76359
76370
|
this.yDoc.transact(function () {
|
|
76360
76371
|
lanes.forEach(function (lane) {
|
|
76361
76372
|
var yMapNested = new YMap();
|
|
76362
|
-
var data =
|
|
76363
|
-
|
|
76364
|
-
|
|
76365
|
-
var stateUpdate = encodeStateAsUpdate(
|
|
76366
|
-
|
|
76373
|
+
var data = _this6.prepareLaneData(lane);
|
|
76374
|
+
_this6.doTransact(yMapNested, data);
|
|
76375
|
+
_this6.yArray.push([yMapNested]);
|
|
76376
|
+
var stateUpdate = encodeStateAsUpdate(_this6.yDoc);
|
|
76377
|
+
_this6.clientIO.emit('createElement', {
|
|
76367
76378
|
updateDoc: stateUpdate
|
|
76368
76379
|
});
|
|
76369
76380
|
});
|