@cocreate/crdt 1.14.17 → 1.14.19
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 +14 -0
- package/package.json +4 -4
- package/src/index.js +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.14.19](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.14.18...v1.14.19) (2022-12-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bump dependencies ([1c3cc17](https://github.com/CoCreate-app/CoCreate-crdt/commit/1c3cc17edf0ef64e41d8179e0f85df1516608dc0))
|
|
7
|
+
|
|
8
|
+
## [1.14.18](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.14.17...v1.14.18) (2022-12-09)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* replaceText will overwirte current changeLog ([5a426a4](https://github.com/CoCreate-app/CoCreate-crdt/commit/5a426a4ac7291b70761edb5ed7f892832752234d))
|
|
14
|
+
|
|
1
15
|
## [1.14.17](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.14.16...v1.14.17) (2022-12-08)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/crdt",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.19",
|
|
4
4
|
"description": "CoCreate crdt",
|
|
5
5
|
"author": "CoCreate LLC",
|
|
6
6
|
"license": "SEE LICENSE",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"webpack-log": "^3.0.1"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@cocreate/crud-client": "^1.16.
|
|
47
|
-
"@cocreate/message-client": "^1.1.
|
|
48
|
-
"@cocreate/utils": "^1.15.
|
|
46
|
+
"@cocreate/crud-client": "^1.16.5",
|
|
47
|
+
"@cocreate/message-client": "^1.1.105",
|
|
48
|
+
"@cocreate/utils": "^1.15.1"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/src/index.js
CHANGED
|
@@ -150,6 +150,7 @@ function insertChange(data, flag) {
|
|
|
150
150
|
let lastChange = changeLog[changeLog.length - 1];
|
|
151
151
|
if (lastChange && change.datetime && lastChange.datetime){
|
|
152
152
|
if (change.datetime < lastChange.datetime){
|
|
153
|
+
// ToDo: insert change at index position and update start and end postions for every element after insert
|
|
153
154
|
console.log('requires changeLog rebuild');
|
|
154
155
|
}
|
|
155
156
|
if (flag != 'replace') {
|
|
@@ -178,7 +179,14 @@ function insertChange(data, flag) {
|
|
|
178
179
|
if (change.length > 0)
|
|
179
180
|
change.removedValue = string.substr(change.start, change.length);
|
|
180
181
|
|
|
181
|
-
|
|
182
|
+
if (flag == 'replace') {
|
|
183
|
+
// ToDo get current string and create new changeLog array then push new change
|
|
184
|
+
changeLog = [change];
|
|
185
|
+
name.set('changeLog', changeLog)
|
|
186
|
+
} else {
|
|
187
|
+
changeLog.push(change);
|
|
188
|
+
}
|
|
189
|
+
|
|
182
190
|
name.set('text', string.customSplice(change.start, change.length, change.value));
|
|
183
191
|
string = {string: name.get('text')};
|
|
184
192
|
|