@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cursors",
3
- "version": "1.11.15",
3
+ "version": "1.11.16",
4
4
  "description": "Collaborative user cursor position for inputs, textarea's and contenteditable elements.",
5
5
  "keywords": [
6
6
  "cursors",
package/src/index.js CHANGED
@@ -311,21 +311,19 @@ function sendPosition(info) {
311
311
  try {
312
312
  message.send({
313
313
  room: "",
314
- emit: {
315
- message: "cursor",
316
- data: {
317
- collection: info.collection,
318
- document_id: info.document_id,
319
- name: info.name,
320
- start: info.start,
321
- end: info.end,
322
- clientId: clientId,
323
- color: info.color || localStorage.getItem("cursorColor"),
324
- background: info.background || localStorage.getItem("cursorBackground") || cursorBackground,
325
- userName: info.userName || localStorage.getItem("userName") || clientId,
326
- user_id: info.user_id || localStorage.getItem("user_id") || clientId
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(selection) {
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