@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/modeler",
3
- "version": "1.43.11",
3
+ "version": "1.43.12",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve --mode development",
6
6
  "test:unit": "vue-cli-service test:unit",
@@ -7,6 +7,7 @@ import store from '@/store';
7
7
  import { getBoundaryEventData } from '@/components/nodes/boundaryEvent/boundaryEventUtils';
8
8
  import { InspectorUtils } from './inspector.utils';
9
9
  import ColorUtil from '../colorUtil';
10
+ import { debounce } from 'lodash';
10
11
  export default class Multiplayer {
11
12
  clientIO = null;
12
13
  yDoc = null;
@@ -211,7 +212,7 @@ export default class Multiplayer {
211
212
  });
212
213
  window.ProcessMaker.EventBus.$on('multiplayer-updateSelectedNodes', ( data ) => {
213
214
  if (this.modeler.isMultiplayer) {
214
- this.updateSelectedNodes(data);
215
+ this.debouncedUpdateSelectedNodes(data);
215
216
  }
216
217
  });
217
218
  window.ProcessMaker.EventBus.$on('multiplayer-updateMousePosition', ( data ) => {
@@ -258,6 +259,17 @@ export default class Multiplayer {
258
259
  this.modeler.updateClientCursor(client);
259
260
  });
260
261
  }
262
+
263
+ /**
264
+ * Debounces the updatedSelectedNodes function to avoid triggering multiple times
265
+ * the update
266
+ *
267
+ * @param {Object} payload
268
+ */
269
+ debouncedUpdateSelectedNodes = debounce((data) => {
270
+ this.updateSelectedNodes(data);
271
+ }, 400);
272
+
261
273
  /**
262
274
  * Updates the selected nodes by the user
263
275
  * @param {Object} data