@cocreate/cursors 1.25.2 → 1.26.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/package.json +9 -11
- package/src/index.js +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/cursors",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "Collaborative user cursor position for inputs, textarea's and contenteditable elements.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cursors",
|
|
@@ -37,16 +37,15 @@
|
|
|
37
37
|
},
|
|
38
38
|
"main": "./src/index.js",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@cocreate/local-storage": "^1.17.
|
|
41
|
-
"@cocreate/observer": "^1.20.
|
|
42
|
-
"@cocreate/random-color": "^1.13.
|
|
43
|
-
"@cocreate/selection": "^1.15.
|
|
44
|
-
"@cocreate/socket-client": "^1.41.
|
|
45
|
-
"@cocreate/utils": "^1.44.
|
|
46
|
-
"@cocreate/uuid": "^1.12.4"
|
|
40
|
+
"@cocreate/local-storage": "^1.17.2",
|
|
41
|
+
"@cocreate/observer": "^1.20.2",
|
|
42
|
+
"@cocreate/random-color": "^1.13.2",
|
|
43
|
+
"@cocreate/selection": "^1.15.2",
|
|
44
|
+
"@cocreate/socket-client": "^1.41.2",
|
|
45
|
+
"@cocreate/utils": "^1.44.3"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
|
-
"@cocreate/webpack": "^1.6.
|
|
48
|
+
"@cocreate/webpack": "^1.6.2"
|
|
50
49
|
},
|
|
51
50
|
"allowScripts": {
|
|
52
51
|
"@cocreate/actions@1.21.4": true,
|
|
@@ -65,7 +64,6 @@
|
|
|
65
64
|
"@cocreate/selection@1.14.3": true,
|
|
66
65
|
"@cocreate/socket-client@1.40.5": true,
|
|
67
66
|
"@cocreate/utils@1.42.2": true,
|
|
68
|
-
"@cocreate/uuid@1.12.4": true,
|
|
69
67
|
"@cocreate/webpack@1.4.3": true
|
|
70
68
|
}
|
|
71
|
-
}
|
|
69
|
+
}
|
package/src/index.js
CHANGED
|
@@ -22,15 +22,14 @@
|
|
|
22
22
|
|
|
23
23
|
/*globals ResizeObserver*/
|
|
24
24
|
import observer from "@cocreate/observer";
|
|
25
|
-
import { getAttributeNames } from "@cocreate/utils";
|
|
25
|
+
import { getAttributeNames, uuid } from "@cocreate/utils";
|
|
26
26
|
import socket from "@cocreate/socket-client";
|
|
27
|
-
import uuid from "@cocreate/uuid";
|
|
28
27
|
import localStorage from "@cocreate/local-storage";
|
|
29
28
|
import { getElementPosition } from "@cocreate/selection";
|
|
30
29
|
import { randomColor } from "@cocreate/random-color";
|
|
31
30
|
import "./index.css";
|
|
32
31
|
|
|
33
|
-
const clientId = socket.clientId ||
|
|
32
|
+
const clientId = socket.clientId || uuid(12);
|
|
34
33
|
const cursorBackground = randomColor();
|
|
35
34
|
|
|
36
35
|
let environment_prod = true;
|
|
@@ -163,7 +162,7 @@ function drawCursors(selection) {
|
|
|
163
162
|
let mirrorDiv;
|
|
164
163
|
let id_mirror = element.getAttribute("mirror_id");
|
|
165
164
|
if (!id_mirror) {
|
|
166
|
-
id_mirror =
|
|
165
|
+
id_mirror = uuid(8);
|
|
167
166
|
element.setAttribute("mirror_id", id_mirror);
|
|
168
167
|
|
|
169
168
|
mirrorDiv = document.createElement("cursor-container");
|