@cocreate/cursors 1.13.1 → 1.13.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.13.2](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.13.1...v1.13.2) (2022-12-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump dependencies ([7ed9e9a](https://github.com/CoCreate-app/CoCreate-cursors/commit/7ed9e9aea038886149b94d851c6ab45c1ab5f03f))
7
+ * remove cursor per mirror and add broadvastBrowser to message ([9df4402](https://github.com/CoCreate-app/CoCreate-cursors/commit/9df4402d595c3a4eeb98f5924f9c8631893425a8))
8
+
1
9
  ## [1.13.1](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.13.0...v1.13.1) (2022-12-20)
2
10
 
3
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cursors",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "description": "Collaborative user cursor position for inputs, textarea's and contenteditable elements.",
5
5
  "keywords": [
6
6
  "cursors",
@@ -61,12 +61,12 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/crud-client": "^1.16.16",
65
- "@cocreate/docs": "^1.4.20",
66
- "@cocreate/message-client": "^1.1.111",
67
- "@cocreate/observer": "^1.5.42",
68
- "@cocreate/random-color": "^1.2.59",
69
- "@cocreate/selection": "^1.4.47",
70
- "@cocreate/uuid": "^1.2.41"
64
+ "@cocreate/crud-client": "^1.16.18",
65
+ "@cocreate/docs": "^1.4.21",
66
+ "@cocreate/message-client": "^1.1.112",
67
+ "@cocreate/observer": "^1.5.43",
68
+ "@cocreate/random-color": "^1.2.60",
69
+ "@cocreate/selection": "^1.4.48",
70
+ "@cocreate/uuid": "^1.2.42"
71
71
  }
72
72
  }
package/src/index.js CHANGED
@@ -177,13 +177,9 @@ function drawCursors(selection) {
177
177
  let cursor, cursorFlag;
178
178
  let details = {collection, document_id, name};
179
179
  if (socket_id) {
180
- let userSelections = document.querySelectorAll(`selection[socket_id="${socket_id}"]`);
181
- if (userSelections) {
182
- for (let userSelection of userSelections){
183
- if (userSelection.details != details)
184
- userSelection.remove();
185
- }
186
- }
180
+ let userSelection = mirrorDiv.querySelector(`selection[socket_id="${socket_id}"]`);
181
+ if (userSelection && userSelection.details != details)
182
+ userSelection.remove();
187
183
  let selection_user = mirrorDiv.querySelector(`selection[socket_id="${socket_id}"]`);
188
184
  if (!selection_user){
189
185
  selection_user = document.createElement('selection');
@@ -325,7 +321,8 @@ function sendPosition(info) {
325
321
  background: info.background || localStorage.getItem("cursorBackground") || cursorBackground,
326
322
  userName: info.userName || localStorage.getItem("userName") || clientId,
327
323
  user_id: info.user_id || localStorage.getItem("user_id") || clientId
328
- }
324
+ },
325
+ broadcastBrowser: 'once'
329
326
  });
330
327
  }
331
328
  catch (e) {