@cocreate/cursors 1.11.15 → 1.11.16
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 +7 -0
- package/package.json +1 -1
- package/src/index.js +15 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.11.16](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.15...v1.11.16) (2022-03-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* removed emit from message.send and message.listen ([344cb05](https://github.com/CoCreate-app/CoCreate-cursors/commit/344cb0599ae4d50706c9e9fe48cb55a5b678740e))
|
|
7
|
+
|
|
1
8
|
## [1.11.15](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.14...v1.11.15) (2022-02-24)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -311,21 +311,19 @@ function sendPosition(info) {
|
|
|
311
311
|
try {
|
|
312
312
|
message.send({
|
|
313
313
|
room: "",
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
},
|
|
314
|
+
message: "cursor",
|
|
315
|
+
data: {
|
|
316
|
+
collection: info.collection,
|
|
317
|
+
document_id: info.document_id,
|
|
318
|
+
name: info.name,
|
|
319
|
+
start: info.start,
|
|
320
|
+
end: info.end,
|
|
321
|
+
clientId: clientId,
|
|
322
|
+
color: info.color || localStorage.getItem("cursorColor"),
|
|
323
|
+
background: info.background || localStorage.getItem("cursorBackground") || cursorBackground,
|
|
324
|
+
userName: info.userName || localStorage.getItem("userName") || clientId,
|
|
325
|
+
user_id: info.user_id || localStorage.getItem("user_id") || clientId
|
|
326
|
+
}
|
|
329
327
|
});
|
|
330
328
|
}
|
|
331
329
|
catch (e) {
|
|
@@ -334,8 +332,9 @@ function sendPosition(info) {
|
|
|
334
332
|
}
|
|
335
333
|
|
|
336
334
|
|
|
337
|
-
message.listen('cursor', function(
|
|
335
|
+
message.listen('cursor', function(response) {
|
|
338
336
|
// if (selection.clientId == clientId) return;
|
|
337
|
+
let selection = response.data
|
|
339
338
|
if (selection.start != null && selection.end != null)
|
|
340
339
|
drawCursors(selection);
|
|
341
340
|
else
|