@cocreate/cursors 1.27.0 → 1.30.0

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/CONTRIBUTING.md CHANGED
@@ -13,7 +13,7 @@ Fork the [project on Github](https://github.com/CoCreate-app/CoCreate-cursors) a
13
13
  ```
14
14
  git cursors https://github.com/contributor/CoCreate-cursors.git
15
15
  cd CoCreate-cursors
16
- git remote add upstream https://github.com/CoCreate-app/CoCreate-cursors.git
16
+ git remote add upstream https://gitlab.com/cocreatejs/CoCreate-cursors.git
17
17
  ```
18
18
 
19
19
  ## Create a Topic Branch
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cursors",
3
- "version": "1.27.0",
3
+ "version": "1.30.0",
4
4
  "description": "Collaborative user cursor position for inputs, textarea's and contenteditable elements.",
5
5
  "keywords": [
6
6
  "cursors",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
26
- "url": "git+https://github.com/CoCreate-app/CoCreate-cursors.git"
26
+ "url": "git+https://gitlab.com/cocreatejs/CoCreate-cursors.git"
27
27
  },
28
28
  "author": "CoCreate LLC",
29
29
  "license": "AGPL-3.0",
@@ -37,15 +37,15 @@
37
37
  },
38
38
  "main": "./src/index.js",
39
39
  "dependencies": {
40
- "@cocreate/local-storage": "^1.18.0",
41
- "@cocreate/observer": "^1.21.0",
42
- "@cocreate/random-color": "^1.14.0",
43
- "@cocreate/selection": "^1.16.0",
44
- "@cocreate/socket-client": "^1.42.0",
45
- "@cocreate/utils": "^1.50.3"
40
+ "@cocreate/local-storage": "^1.20.0",
41
+ "@cocreate/observer": "^1.23.0",
42
+ "@cocreate/random-color": "^1.15.0",
43
+ "@cocreate/selection": "^1.18.0",
44
+ "@cocreate/socket-client": "^1.43.0",
45
+ "@cocreate/utils": "^1.54.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@cocreate/webpack": "^1.7.0"
48
+ "@cocreate/webpack": "^1.9.0"
49
49
  },
50
50
  "allowScripts": {
51
51
  "@cocreate/actions@1.21.4": true,
package/src/index.js CHANGED
@@ -34,7 +34,8 @@ const cursorBackground = randomColor();
34
34
 
35
35
  let environment_prod = true;
36
36
 
37
- let selector = "[array][object][key]:not([contentEditable='false'])";
37
+ let selector =
38
+ "[array][object][key][crdt='true']:not([contentEditable='false'])";
38
39
 
39
40
  function init() {
40
41
  let elements = document.querySelectorAll(selector);
@@ -532,7 +533,7 @@ function sendPosition(info) {
532
533
  user_id:
533
534
  info.user_id || localStorage.getItem("user_id") || clientId
534
535
  },
535
- broadcastBrowser: true
536
+ broadcastClient: true
536
537
  });
537
538
  } catch (e) {
538
539
  console.error(e);
@@ -552,7 +553,7 @@ socket.listen("cursor", function (response) {
552
553
  observer.init({
553
554
  name: "CoCreateCursor",
554
555
  types: ["addedNodes"],
555
- selector: "[array][object][key]",
556
+ selector,
556
557
  callback: function (mutation) {
557
558
  initElement(mutation.target);
558
559
  }
@@ -561,7 +562,7 @@ observer.init({
561
562
  observer.init({
562
563
  name: "CoCreateCursorAtt",
563
564
  types: ["attributes"],
564
- attributeFilter: getAttributeNames(["array", "object", "key"]),
565
+ attributeFilter: getAttributeNames(["array", "object", "key", "crdt"]),
565
566
  callback: function (mutation) {
566
567
  initElement(mutation.target);
567
568
  }