@cocreate/cursors 1.13.0 → 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 +15 -0
- package/package.json +8 -8
- package/src/index.js +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
|
|
9
|
+
## [1.13.1](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.13.0...v1.13.1) (2022-12-20)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* bump dependencies ([525f021](https://github.com/CoCreate-app/CoCreate-cursors/commit/525f02150cd4359e299d00e4b039952d75df138e))
|
|
15
|
+
|
|
1
16
|
# [1.13.0](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.12.23...v1.13.0) (2022-12-17)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/cursors",
|
|
3
|
-
"version": "1.13.
|
|
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.
|
|
65
|
-
"@cocreate/docs": "^1.4.
|
|
66
|
-
"@cocreate/message-client": "^1.1.
|
|
67
|
-
"@cocreate/observer": "^1.5.
|
|
68
|
-
"@cocreate/random-color": "^1.2.
|
|
69
|
-
"@cocreate/selection": "^1.4.
|
|
70
|
-
"@cocreate/uuid": "^1.2.
|
|
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
|
|
181
|
-
if (
|
|
182
|
-
|
|
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) {
|