@cocreate/cursors 1.13.1 → 1.13.3
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 +15 -0
- package/docs/index.html +22 -24
- package/package.json +8 -8
- package/src/index.js +5 -8
- package/webpack.config.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.13.3](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.13.2...v1.13.3) (2022-12-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update demos and bump dependencies ([69fb4e1](https://github.com/CoCreate-app/CoCreate-cursors/commit/69fb4e12e06181464e1db1ed498c67868a62e954))
|
|
7
|
+
|
|
8
|
+
## [1.13.2](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.13.1...v1.13.2) (2022-12-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump dependencies ([7ed9e9a](https://github.com/CoCreate-app/CoCreate-cursors/commit/7ed9e9aea038886149b94d851c6ab45c1ab5f03f))
|
|
14
|
+
* remove cursor per mirror and add broadvastBrowser to message ([9df4402](https://github.com/CoCreate-app/CoCreate-cursors/commit/9df4402d595c3a4eeb98f5924f9c8631893425a8))
|
|
15
|
+
|
|
1
16
|
## [1.13.1](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.13.0...v1.13.1) (2022-12-20)
|
|
2
17
|
|
|
3
18
|
|
package/docs/index.html
CHANGED
|
@@ -76,30 +76,28 @@
|
|
|
76
76
|
<!-- SandBox -->
|
|
77
77
|
<h2 class="border-bottom:1px_solid_lightgrey padding:5px_0px">Demo</h2>
|
|
78
78
|
<div class="position:sticky top:0 padding:15px_0px height:100vh">
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
</div>
|
|
102
|
-
<!-- End SandBox -->
|
|
79
|
+
<!-- SandBox -->
|
|
80
|
+
<div class="position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px" id="playground">
|
|
81
|
+
|
|
82
|
+
<div id="demo-code" resizable class="position:relative height:50%">
|
|
83
|
+
<textarea type="code" lang="html" collection="demos" document_id="" name="demo" save="false" id="demo" class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
|
|
84
|
+
<div resize="bottom" class="background:lightgrey"></div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div id="demo-preview" class="position:relative display:flex height:100% background-color:white">
|
|
88
|
+
<div get-value="#demo" class="padding:20px"></div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
|
|
92
|
+
<a class="margin-right:10px" id="eye" show="#eye-slash" hide="#eye, #demo-preview" toggle="code-height" toggle-target="#demo-code"><i class="far fa-eye"></i></a>
|
|
93
|
+
<a class="margin-right:10px" hidden id="eye-slash" show="#eye, #demo-preview" hide="#eye-slash" toggle="code-height" toggle-target="#demo-code"><i class="fas fa-eye-slash"></i></a>
|
|
94
|
+
<a class="margin-right:10px" id="code" show="#code-slash" hide="#code, #demo-code"><i class="fa fa-code"></i></a>
|
|
95
|
+
<a class="margin-right:10px" hidden id="code-slash" show="#code, #demo-code" hide="#code-slash"><i class="fas fa-code"></i></a>
|
|
96
|
+
<a class="margin-right:5px" fullscreen target="#playground"><i class="fas fa-expand"></i></a>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
</div>
|
|
100
|
+
<!-- End SandBox -->
|
|
103
101
|
</div>
|
|
104
102
|
</div>
|
|
105
103
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/cursors",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.3",
|
|
4
4
|
"description": "Collaborative user cursor position for inputs, textarea's and contenteditable elements.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cursors",
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
"webpack-log": "^3.0.1"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@cocreate/crud-client": "^1.16.
|
|
65
|
-
"@cocreate/docs": "^1.4.
|
|
66
|
-
"@cocreate/message-client": "^1.1.
|
|
67
|
-
"@cocreate/observer": "^1.5.
|
|
68
|
-
"@cocreate/random-color": "^1.2.
|
|
69
|
-
"@cocreate/selection": "^1.4.
|
|
70
|
-
"@cocreate/uuid": "^1.2.
|
|
64
|
+
"@cocreate/crud-client": "^1.16.19",
|
|
65
|
+
"@cocreate/docs": "^1.4.22",
|
|
66
|
+
"@cocreate/message-client": "^1.1.113",
|
|
67
|
+
"@cocreate/observer": "^1.5.44",
|
|
68
|
+
"@cocreate/random-color": "^1.2.61",
|
|
69
|
+
"@cocreate/selection": "^1.4.49",
|
|
70
|
+
"@cocreate/uuid": "^1.2.43"
|
|
71
71
|
}
|
|
72
72
|
}
|
package/src/index.js
CHANGED
|
@@ -177,13 +177,9 @@ function drawCursors(selection) {
|
|
|
177
177
|
let cursor, cursorFlag;
|
|
178
178
|
let details = {collection, document_id, name};
|
|
179
179
|
if (socket_id) {
|
|
180
|
-
let
|
|
181
|
-
if (
|
|
182
|
-
|
|
183
|
-
if (userSelection.details != details)
|
|
184
|
-
userSelection.remove();
|
|
185
|
-
}
|
|
186
|
-
}
|
|
180
|
+
let userSelection = mirrorDiv.querySelector(`selection[socket_id="${socket_id}"]`);
|
|
181
|
+
if (userSelection && userSelection.details != details)
|
|
182
|
+
userSelection.remove();
|
|
187
183
|
let selection_user = mirrorDiv.querySelector(`selection[socket_id="${socket_id}"]`);
|
|
188
184
|
if (!selection_user){
|
|
189
185
|
selection_user = document.createElement('selection');
|
|
@@ -325,7 +321,8 @@ function sendPosition(info) {
|
|
|
325
321
|
background: info.background || localStorage.getItem("cursorBackground") || cursorBackground,
|
|
326
322
|
userName: info.userName || localStorage.getItem("userName") || clientId,
|
|
327
323
|
user_id: info.user_id || localStorage.getItem("user_id") || clientId
|
|
328
|
-
}
|
|
324
|
+
},
|
|
325
|
+
broadcastBrowser: 'once'
|
|
329
326
|
});
|
|
330
327
|
}
|
|
331
328
|
catch (e) {
|