@cocreate/cursors 1.11.7 → 1.11.11

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,31 @@
1
+ ## [1.11.11](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.10...v1.11.11) (2022-02-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * replaced show and hide class hidden with attribute hidden ([c93182d](https://github.com/CoCreate-app/CoCreate-cursors/commit/c93182d850410c9ad3aea6b133f2df56e5694769))
7
+
8
+ ## [1.11.10](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.9...v1.11.10) (2022-02-01)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * update dependency versions ([21eb6ef](https://github.com/CoCreate-app/CoCreate-cursors/commit/21eb6ef01911e8128274285c11e7673b5ec8ccd3))
14
+
15
+ ## [1.11.9](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.8...v1.11.9) (2022-01-15)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * cursor was not displaying on inputs ([d608657](https://github.com/CoCreate-app/CoCreate-cursors/commit/d608657598178c16bae66b715f1b79fc4610b1c1))
21
+
22
+ ## [1.11.8](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.7...v1.11.8) (2022-01-13)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * If element is not contenteditable do not display cursors unless cursors=true ([be7d653](https://github.com/CoCreate-app/CoCreate-cursors/commit/be7d65339d73234f95bbec4400d6ead0adfec9ef))
28
+
1
29
  ## [1.11.7](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.6...v1.11.7) (2022-01-13)
2
30
 
3
31
 
package/docs/index.html CHANGED
@@ -80,7 +80,7 @@
80
80
  <div class="container svColumn overflow:hidden card position:relative border-radius:2px width:auto height:100%" id="sandbox">
81
81
  <div class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
82
82
  <a class="margin-right:10px" id="code" show="#preview" hide="#code, #view"><i class="far fa-eye"></i></a>
83
- <a class="margin-right:10px hidden" id="preview" show="#code, #view" hide="#preview"><i class="fas fa-code"></i></a>
83
+ <a class="margin-right:10px" id="preview" show="#code, #view" hide="#preview" hidden><i class="fas fa-code"></i></a>
84
84
  <a class="margin-right:5px" fullscreen target="#playground"><i class="fas fa-expand"></i></a>
85
85
  </div>
86
86
  <div class="svRow">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cursors",
3
- "version": "1.11.7",
3
+ "version": "1.11.11",
4
4
  "description": "Collaborative user cursor position for inputs, textarea's and contenteditable elements.",
5
5
  "keywords": [
6
6
  "cursors",
@@ -62,12 +62,12 @@
62
62
  "webpack-log": "^3.0.1"
63
63
  },
64
64
  "dependencies": {
65
- "@cocreate/crud-client": "^1.4.41",
66
- "@cocreate/docs": "^1.2.63",
67
- "@cocreate/message-client": "^1.1.59",
68
- "@cocreate/observer": "^1.3.55",
69
- "@cocreate/random-color": "^1.2.16",
70
- "@cocreate/selection": "^1.3.2",
71
- "@cocreate/uuid": "^1.1.52"
65
+ "@cocreate/crud-client": "^1.4.43",
66
+ "@cocreate/docs": "^1.2.65",
67
+ "@cocreate/message-client": "^1.1.60",
68
+ "@cocreate/observer": "^1.4.0",
69
+ "@cocreate/random-color": "^1.2.17",
70
+ "@cocreate/selection": "^1.4.0",
71
+ "@cocreate/uuid": "^1.1.55"
72
72
  }
73
73
  }
package/src/index.js CHANGED
@@ -54,7 +54,7 @@ function drawCursors(selection) {
54
54
  let elements = selection.element;
55
55
  if (!elements) {
56
56
  let selector = '[collection="' + collection + '"][document_id="' + document_id + '"][name="' + name + '"]';
57
- selector += ':not(.codemirror, .quill, .monaco, [actions])';
57
+ selector += ':not(.codemirror, .monaco, [actions])';
58
58
  elements = document.querySelectorAll(selector);
59
59
  }
60
60
  for (let element of elements) {
@@ -64,7 +64,12 @@ function drawCursors(selection) {
64
64
  }
65
65
  let realtime = element.getAttribute('realtime');
66
66
  let cursors = element.getAttribute('cursors');
67
+ let contenteditable = element.getAttribute('contenteditable');
67
68
  if (realtime == 'false' || cursors == 'false') continue;
69
+ if (element.tagName != 'INPUT' && element.tagName != 'TEXTAREA')
70
+ if (contenteditable == 'false' || contenteditable == null)
71
+ if (cursors != 'true') continue;
72
+
68
73
  if (element.hasAttribute('contenteditable')) {
69
74
  let domTextEditor = element;
70
75
  if (element.tagName == 'IFRAME'){
@@ -84,6 +89,7 @@ function drawCursors(selection) {
84
89
  start = pos.start;
85
90
  }
86
91
  }
92
+
87
93
  if(!element) continue;
88
94
  let document = element.ownerDocument;
89
95
  let mirrorDiv;