@ckeditor/ckeditor5-operations-compressor 38.0.1 → 38.1.1
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 -6
- package/src/actioncompressor/actioncompressor.d.ts +56 -56
- package/src/actioncompressor/actioncompressor.js +1 -1
- package/src/actioncompressor/deletingactioncompressor.d.ts +24 -24
- package/src/actioncompressor/deletingactioncompressor.js +1 -1
- package/src/actioncompressor/forwarddeletingactioncompressor.d.ts +24 -24
- package/src/actioncompressor/forwarddeletingactioncompressor.js +1 -1
- package/src/actioncompressor/typingactioncompressor.d.ts +24 -24
- package/src/actioncompressor/typingactioncompressor.js +1 -1
- package/src/actioncompressor/userselectionactioncompressor.d.ts +12 -12
- package/src/actioncompressor/userselectionactioncompressor.js +1 -1
- package/src/compressor.d.ts +41 -41
- package/src/compressor.js +1 -1
- package/src/lib/compiledmessages.js +1 -1
- package/src/operationcompressor/annotationmarkeroperationcompressor.d.ts +18 -18
- package/src/operationcompressor/annotationmarkeroperationcompressor.js +1 -1
- package/src/operationcompressor/attributeoperationcompressor.d.ts +13 -13
- package/src/operationcompressor/attributeoperationcompressor.js +1 -1
- package/src/operationcompressor/insertoperationcompressor.d.ts +13 -13
- package/src/operationcompressor/insertoperationcompressor.js +1 -1
- package/src/operationcompressor/markeroperationcompressor.d.ts +9 -9
- package/src/operationcompressor/markeroperationcompressor.js +1 -1
- package/src/operationcompressor/nooperationcompressor.d.ts +16 -16
- package/src/operationcompressor/nooperationcompressor.js +1 -1
- package/src/operationcompressor/operationcompressor.d.ts +24 -24
- package/src/operationcompressor/operationcompressor.js +1 -1
- package/src/protobufdescriptions.d.ts +12 -12
- package/src/protobufdescriptions.js +1 -1
- package/src/protobuffactory.d.ts +1 -1
- package/src/protobuffactory.js +1 -1
- package/src/utils.d.ts +26 -26
- package/src/utils.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-operations-compressor",
|
|
3
|
-
"version": "38.
|
|
3
|
+
"version": "38.1.1",
|
|
4
4
|
"description": "CKEditor 5 operations compressor for real-time collaboration.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://ckeditor.com/collaboration/real-time/",
|
|
@@ -26,19 +26,22 @@
|
|
|
26
26
|
"framework"
|
|
27
27
|
],
|
|
28
28
|
"author": "CKSource (http://cksource.com/)",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://support.ckeditor.com/hc/en-us/requests/new"
|
|
31
|
+
},
|
|
29
32
|
"dependencies": {
|
|
30
|
-
"ckeditor5": "
|
|
33
|
+
"ckeditor5": "38.1.1",
|
|
31
34
|
"lodash-es": "^4.17.11",
|
|
32
35
|
"protobufjs": "^7.0.0"
|
|
33
36
|
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=16.0.0",
|
|
39
|
+
"npm": ">=5.7.1"
|
|
40
|
+
},
|
|
34
41
|
"files": [
|
|
35
42
|
"src/**/*.js",
|
|
36
43
|
"src/**/*.d.ts",
|
|
37
44
|
"CHANGELOG.md"
|
|
38
45
|
],
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "tsc -p ./tsconfig.json",
|
|
41
|
-
"postversion": "npm run build"
|
|
42
|
-
},
|
|
43
46
|
"obfuscated": true
|
|
44
47
|
}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import type { CompressedOperationsData, default as Compressor } from '../compressor';
|
|
2
|
-
/**
|
|
3
|
-
* * Compresses and decompresses multiple operations into the one buffer.
|
|
4
|
-
*/
|
|
5
|
-
export default abstract class ActionCompressor {
|
|
6
|
-
constructor(id: number, context: Compressor);
|
|
7
|
-
/**
|
|
8
|
-
* Combines and compress operations from the list.
|
|
9
|
-
* Operations are consumed as long as match this compressor.
|
|
10
|
-
*
|
|
11
|
-
* @param result Object to which compression result should be added.
|
|
12
|
-
* @param operations List of operations in JSON format to compress.
|
|
13
|
-
* @returns `true` when operation is consumed `false` otherwise.
|
|
14
|
-
*/
|
|
15
|
-
compress(result: CompressedOperationsData, operations: Array<any>): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Decompress and split compressed operations. Decompressed operations are consumed (removed from the input data).
|
|
18
|
-
*
|
|
19
|
-
* @param result Decompressed operations in JSON format.
|
|
20
|
-
* @param data Compressed operations data.
|
|
21
|
-
*/
|
|
22
|
-
decompress(result: Array<any>, data: CompressedOperationsData): void;
|
|
23
|
-
/**
|
|
24
|
-
* Compresses single operation using a proper compressor.
|
|
25
|
-
*
|
|
26
|
-
* @param operation Operation in JSON format.
|
|
27
|
-
* @returns Operation JSON compressed to the binary format.
|
|
28
|
-
*/
|
|
29
|
-
protected abstract _compressSingleOperation(operation: any): Uint8Array;
|
|
30
|
-
/**
|
|
31
|
-
* Decompresses combined operation using a proper compressor.
|
|
32
|
-
*
|
|
33
|
-
* @param data Data to compress.
|
|
34
|
-
* @returns Decompressed operation in JSON format.
|
|
35
|
-
*/
|
|
36
|
-
protected abstract _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
37
|
-
/**
|
|
38
|
-
* Combine next operation into the combined one.
|
|
39
|
-
*
|
|
40
|
-
* @param nextOperation Operation to combine in JSON format.
|
|
41
|
-
* @param combined Combined operation in JSON format.
|
|
42
|
-
* @returns Combined operation in JSON format.
|
|
43
|
-
*/
|
|
44
|
-
protected abstract _combineNext(nextOperation: any, combined: any): any;
|
|
45
|
-
/**
|
|
46
|
-
* Split operation from combined one.
|
|
47
|
-
*
|
|
48
|
-
* @param combined Combined operation in JSON format.
|
|
49
|
-
* @returns Split operation in JSON format.
|
|
50
|
-
*/
|
|
51
|
-
protected abstract _splitCurrent(combined: any): any;
|
|
52
|
-
/**
|
|
53
|
-
* Checks if two operations can be combined.
|
|
54
|
-
*/
|
|
55
|
-
protected abstract _compareOperations(opA: any, opB: any): boolean;
|
|
56
|
-
}
|
|
1
|
+
import type { CompressedOperationsData, default as Compressor } from '../compressor';
|
|
2
|
+
/**
|
|
3
|
+
* * Compresses and decompresses multiple operations into the one buffer.
|
|
4
|
+
*/
|
|
5
|
+
export default abstract class ActionCompressor {
|
|
6
|
+
constructor(id: number, context: Compressor);
|
|
7
|
+
/**
|
|
8
|
+
* Combines and compress operations from the list.
|
|
9
|
+
* Operations are consumed as long as match this compressor.
|
|
10
|
+
*
|
|
11
|
+
* @param result Object to which compression result should be added.
|
|
12
|
+
* @param operations List of operations in JSON format to compress.
|
|
13
|
+
* @returns `true` when operation is consumed `false` otherwise.
|
|
14
|
+
*/
|
|
15
|
+
compress(result: CompressedOperationsData, operations: Array<any>): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Decompress and split compressed operations. Decompressed operations are consumed (removed from the input data).
|
|
18
|
+
*
|
|
19
|
+
* @param result Decompressed operations in JSON format.
|
|
20
|
+
* @param data Compressed operations data.
|
|
21
|
+
*/
|
|
22
|
+
decompress(result: Array<any>, data: CompressedOperationsData): void;
|
|
23
|
+
/**
|
|
24
|
+
* Compresses single operation using a proper compressor.
|
|
25
|
+
*
|
|
26
|
+
* @param operation Operation in JSON format.
|
|
27
|
+
* @returns Operation JSON compressed to the binary format.
|
|
28
|
+
*/
|
|
29
|
+
protected abstract _compressSingleOperation(operation: any): Uint8Array;
|
|
30
|
+
/**
|
|
31
|
+
* Decompresses combined operation using a proper compressor.
|
|
32
|
+
*
|
|
33
|
+
* @param data Data to compress.
|
|
34
|
+
* @returns Decompressed operation in JSON format.
|
|
35
|
+
*/
|
|
36
|
+
protected abstract _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
37
|
+
/**
|
|
38
|
+
* Combine next operation into the combined one.
|
|
39
|
+
*
|
|
40
|
+
* @param nextOperation Operation to combine in JSON format.
|
|
41
|
+
* @param combined Combined operation in JSON format.
|
|
42
|
+
* @returns Combined operation in JSON format.
|
|
43
|
+
*/
|
|
44
|
+
protected abstract _combineNext(nextOperation: any, combined: any): any;
|
|
45
|
+
/**
|
|
46
|
+
* Split operation from combined one.
|
|
47
|
+
*
|
|
48
|
+
* @param combined Combined operation in JSON format.
|
|
49
|
+
* @returns Split operation in JSON format.
|
|
50
|
+
*/
|
|
51
|
+
protected abstract _splitCurrent(combined: any): any;
|
|
52
|
+
/**
|
|
53
|
+
* Checks if two operations can be combined.
|
|
54
|
+
*/
|
|
55
|
+
protected abstract _compareOperations(opA: any, opB: any): boolean;
|
|
56
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x4d21=['_combineNext','_compareOperations','shift','length','_context','buffers','types','_decompressSingleOperation','_compressSingleOperation','push','_id','decompress'];(function(_0x355704,_0x4d215a){const _0x246269=function(_0x54911d){while(--_0x54911d){_0x355704['push'](_0x355704['shift']());}};_0x246269(++_0x4d215a);}(_0x4d21,0x144));const _0x2462=function(_0x355704,_0x4d215a){_0x355704=_0x355704-0x0;let _0x246269=_0x4d21[_0x355704];return _0x246269;};import{cloneDeep as _0x30a40f}from'lodash-es';export default class b{constructor(_0x4eab28,_0x35a8c5){this[_0x2462('0xa')]=_0x4eab28,this[_0x2462('0x4')]=_0x35a8c5;}['compress'](_0xc99fe1,_0x58457d){let _0x4f8bb9;for(;_0x58457d[_0x2462('0x3')]>0x1&&this[_0x2462('0x1')](_0x58457d[0x0],_0x58457d[0x1]);)_0x4f8bb9?(_0x4f8bb9=this[_0x2462('0x0')](_0x58457d[_0x2462('0x2')](),_0x4f8bb9),_0xc99fe1['types'][_0x2462('0x9')](0x0)):(_0x4f8bb9=_0x30a40f(_0x58457d[_0x2462('0x2')]()),_0xc99fe1['types'][_0x2462('0x9')](this['_id']));return!!_0x4f8bb9&&(_0x4f8bb9=this[_0x2462('0x0')](_0x58457d['shift'](),_0x4f8bb9),_0xc99fe1['types']['push'](0x0),_0xc99fe1[_0x2462('0x5')]['push'](this[_0x2462('0x8')](_0x4f8bb9)),!0x0);}[_0x2462('0xb')](_0x397fe9,_0x1d55c7){const _0x58db06=this[_0x2462('0x7')](_0x1d55c7);for(;0x0==_0x1d55c7[_0x2462('0x6')][0x0];)_0x1d55c7[_0x2462('0x6')][_0x2462('0x2')](),_0x397fe9[_0x2462('0x9')](this['_splitCurrent'](_0x58db06));_0x397fe9[_0x2462('0x9')](_0x58db06);}}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import ActionCompressor from './actioncompressor';
|
|
2
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
-
export default class DeletingActionCompressor extends ActionCompressor {
|
|
4
|
-
/**
|
|
5
|
-
* @inheritDoc
|
|
6
|
-
*/
|
|
7
|
-
protected _combineNext(nextOperation: any, combined: any): any;
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
protected _splitCurrent(combined: any): any;
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
protected _compareOperations(opA: any, opB: any): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
24
|
-
}
|
|
1
|
+
import ActionCompressor from './actioncompressor';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
+
export default class DeletingActionCompressor extends ActionCompressor {
|
|
4
|
+
/**
|
|
5
|
+
* @inheritDoc
|
|
6
|
+
*/
|
|
7
|
+
protected _combineNext(nextOperation: any, combined: any): any;
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
protected _splitCurrent(combined: any): any;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
protected _compareOperations(opA: any, opB: any): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
24
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x586c=['MoveOperation','howMany','_getCompressorByName','_context','$graveyard','_decompressSingleOperation','buffers','_combineNext','sourcePosition','root','targetPosition','__className','decompress','compress','wasUndone','_splitCurrent','_checkOperation'];(function(_0x5a9843,_0x586cfa){const _0x56796b=function(_0xcc76d){while(--_0xcc76d){_0x5a9843['push'](_0x5a9843['shift']());}};_0x56796b(++_0x586cfa);}(_0x586c,0x1e0));const _0x5679=function(_0x5a9843,_0x586cfa){_0x5a9843=_0x5a9843-0x0;let _0x56796b=_0x586c[_0x5a9843];return _0x56796b;};import _0x222333 from'./actioncompressor';import{arePositionsEqual as _0x257ee7,getPositionShiftedBy as _0x5450d4}from'../utils';import{cloneDeep as _0xb9315b}from'lodash-es';export default class c extends _0x222333{[_0x5679('0x3')](_0xbb8e7a,_0x3bd704){return _0x3bd704[_0x5679('0xe')]++,_0x3bd704['sourcePosition']=_0xb9315b(_0xbb8e7a[_0x5679('0x4')]),_0x3bd704;}[_0x5679('0xb')](_0x5e1ac0){const _0xb22de2=_0xb9315b(_0x5e1ac0);return _0x5e1ac0[_0x5679('0xe')]--,_0xb22de2['howMany']=0x1,_0xb22de2[_0x5679('0x4')]=_0x5450d4(_0xb22de2[_0x5679('0x4')],_0x5e1ac0[_0x5679('0xe')]),_0xb22de2;}['_compareOperations'](_0x174f6d,_0x168cb0){return!(!this[_0x5679('0xc')](_0x174f6d)||!this[_0x5679('0xc')](_0x168cb0))&&(_0x257ee7(_0x5450d4(_0x174f6d[_0x5679('0x4')],-0x1),_0x168cb0[_0x5679('0x4')])&&_0x257ee7(_0x174f6d['targetPosition'],_0x168cb0[_0x5679('0x6')]));}['_compressSingleOperation'](_0x210604){const _0x4cf100={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x5679('0x10')][_0x5679('0xf')]('MoveOperation')[_0x5679('0x9')](_0x4cf100,[_0x210604]),_0x4cf100[_0x5679('0x2')][0x0];}[_0x5679('0x1')](_0x278c18){const _0x5dbe67=[];return this[_0x5679('0x10')][_0x5679('0xf')]('MoveOperation')[_0x5679('0x8')](_0x5dbe67,_0x278c18),_0x5dbe67[0x0];}[_0x5679('0xc')](_0x52aee5){return _0x5679('0xd')==_0x52aee5[_0x5679('0x7')]&&_0x5679('0x0')==_0x52aee5[_0x5679('0x6')][_0x5679('0x5')]&&0x1==_0x52aee5['howMany']&&!_0x52aee5[_0x5679('0xa')];}}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import ActionCompressor from './actioncompressor';
|
|
2
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
-
export default class ForwardDeletingActionCompressor extends ActionCompressor {
|
|
4
|
-
/**
|
|
5
|
-
* @inheritDoc
|
|
6
|
-
*/
|
|
7
|
-
protected _combineNext(nextOperation: any, combined: any): any;
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
protected _splitCurrent(combined: any): any;
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
protected _compareOperations(opA: any, opB: any): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
24
|
-
}
|
|
1
|
+
import ActionCompressor from './actioncompressor';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
+
export default class ForwardDeletingActionCompressor extends ActionCompressor {
|
|
4
|
+
/**
|
|
5
|
+
* @inheritDoc
|
|
6
|
+
*/
|
|
7
|
+
protected _combineNext(nextOperation: any, combined: any): any;
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
protected _splitCurrent(combined: any): any;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
protected _compareOperations(opA: any, opB: any): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
24
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x10f5=['_context','_decompressSingleOperation','_getCompressorByName','decompress','_splitCurrent','wasUndone','_combineNext','_compareOperations','_compressSingleOperation','sourcePosition','targetPosition','howMany','_checkOperation','MoveOperation','root','buffers','compress'];(function(_0x26b5ae,_0x10f578){const _0x9f7f18=function(_0x2e9230){while(--_0x2e9230){_0x26b5ae['push'](_0x26b5ae['shift']());}};_0x9f7f18(++_0x10f578);}(_0x10f5,0x106));const _0x9f7f=function(_0x26b5ae,_0x10f578){_0x26b5ae=_0x26b5ae-0x0;let _0x9f7f18=_0x10f5[_0x26b5ae];return _0x9f7f18;};import _0x5ad6eb from'./actioncompressor';import{arePositionsEqual as _0x2212f4}from'../utils';import{cloneDeep as _0x15faea}from'lodash-es';export default class h extends _0x5ad6eb{[_0x9f7f('0x10')](_0x118e7e,_0x10e9a9){return _0x10e9a9[_0x9f7f('0x4')]++,_0x10e9a9;}[_0x9f7f('0xe')](_0x257ae3){const _0x3128a8=_0x15faea(_0x257ae3);return _0x3128a8[_0x9f7f('0x4')]=0x1,_0x257ae3[_0x9f7f('0x4')]--,_0x3128a8;}[_0x9f7f('0x0')](_0x245f46,_0x218229){return!(!this[_0x9f7f('0x5')](_0x245f46)||!this['_checkOperation'](_0x218229))&&(_0x2212f4(_0x245f46[_0x9f7f('0x2')],_0x218229['sourcePosition'])&&_0x2212f4(_0x245f46[_0x9f7f('0x3')],_0x218229[_0x9f7f('0x3')]));}[_0x9f7f('0x1')](_0xcdaf80){const _0x52eb9d={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x9f7f('0xa')][_0x9f7f('0xc')](_0x9f7f('0x6'))[_0x9f7f('0x9')](_0x52eb9d,[_0xcdaf80]),_0x52eb9d[_0x9f7f('0x8')][0x0];}[_0x9f7f('0xb')](_0xfbd95){const _0x4781e3=[];return this[_0x9f7f('0xa')][_0x9f7f('0xc')](_0x9f7f('0x6'))[_0x9f7f('0xd')](_0x4781e3,_0xfbd95),_0x4781e3[0x0];}[_0x9f7f('0x5')](_0x3adad6){return _0x9f7f('0x6')==_0x3adad6['__className']&&'$graveyard'==_0x3adad6[_0x9f7f('0x3')][_0x9f7f('0x7')]&&0x1==_0x3adad6['howMany']&&!_0x3adad6[_0x9f7f('0xf')];}}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import ActionCompressor from './actioncompressor';
|
|
2
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
-
export default class TypingActionCompressor extends ActionCompressor {
|
|
4
|
-
/**
|
|
5
|
-
* @inheritDocs
|
|
6
|
-
*/
|
|
7
|
-
protected _combineNext(nextOperation: any, combined: any): any;
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
protected _splitCurrent(combined: any): any;
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
protected _compareOperations(opA: any, opB: any): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
24
|
-
}
|
|
1
|
+
import ActionCompressor from './actioncompressor';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
+
export default class TypingActionCompressor extends ActionCompressor {
|
|
4
|
+
/**
|
|
5
|
+
* @inheritDocs
|
|
6
|
+
*/
|
|
7
|
+
protected _combineNext(nextOperation: any, combined: any): any;
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
protected _splitCurrent(combined: any): any;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
protected _compareOperations(opA: any, opB: any): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
24
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0xf74c=['nodes','buffers','data','position','_compressSingleOperation','length','attributes','InsertOperation','next','iterator','_splitCurrent','_checkOperation','from','keys','_compareOperations','decompress','_compareAttributes','substr','_decompressSingleOperation','_context','wasUndone','_getCompressorByName'];(function(_0xc810c7,_0xf74c0b){const _0x1ea605=function(_0x5eec46){while(--_0x5eec46){_0xc810c7['push'](_0xc810c7['shift']());}};_0x1ea605(++_0xf74c0b);}(_0xf74c,0x98));const _0x1ea6=function(_0xc810c7,_0xf74c0b){_0xc810c7=_0xc810c7-0x0;let _0x1ea605=_0xf74c[_0xc810c7];return _0x1ea605;};import _0x2a25c7 from'./actioncompressor';import{arePositionsEqual as _0x2e76e3,getPositionShiftedBy as _0x969485}from'../utils';import{cloneDeep as _0x5d634c}from'lodash-es';export default class m extends _0x2a25c7{['_combineNext'](_0x3a0f77,_0x2a0eb2){return _0x2a0eb2[_0x1ea6('0x2')][0x0][_0x1ea6('0x4')]+=_0x3a0f77[_0x1ea6('0x2')][0x0][_0x1ea6('0x4')],_0x2a0eb2;}[_0x1ea6('0xc')](_0x459743){const _0x53a3f5=_0x5d634c(_0x459743),_0x502f2d=_0x53a3f5[_0x1ea6('0x2')][0x0],_0x208d27=_0x459743[_0x1ea6('0x2')][0x0],_0x1385d1=_0x208d27['data'][Symbol[_0x1ea6('0xb')]]()[_0x1ea6('0xa')]()['value'],_0x162d95=_0x1385d1[_0x1ea6('0x7')];return _0x502f2d['data']=_0x1385d1,_0x208d27[_0x1ea6('0x4')]=_0x208d27[_0x1ea6('0x4')][_0x1ea6('0x13')](_0x162d95),_0x459743['position']=_0x969485(_0x459743[_0x1ea6('0x5')],_0x162d95),_0x53a3f5;}[_0x1ea6('0x10')](_0x5ef4bc,_0x2c89fa){if(this[_0x1ea6('0xd')](_0x5ef4bc)&&this['_checkOperation'](_0x2c89fa)){const _0x2940be=_0x5ef4bc[_0x1ea6('0x2')][0x0]['data'][_0x1ea6('0x7')],_0x307b70=_0x2e76e3(_0x969485(_0x5ef4bc[_0x1ea6('0x5')],_0x2940be),_0x2c89fa[_0x1ea6('0x5')]),_0x267a59=_0x5ef4bc[_0x1ea6('0x2')][0x0],_0x4693fe=_0x2c89fa[_0x1ea6('0x2')][0x0];return _0x307b70&&this[_0x1ea6('0x12')](_0x267a59,_0x4693fe);}return!0x1;}[_0x1ea6('0x6')](_0x5de7aa){const _0x42e7b7={'types':[],'buffers':[],'baseVersion':0x0};return this['_context'][_0x1ea6('0x1')](_0x1ea6('0x9'))['compress'](_0x42e7b7,[_0x5de7aa]),_0x42e7b7[_0x1ea6('0x3')][0x0];}[_0x1ea6('0x14')](_0x517471){const _0x500d91=[];return this[_0x1ea6('0x15')][_0x1ea6('0x1')](_0x1ea6('0x9'))[_0x1ea6('0x11')](_0x500d91,_0x517471),_0x500d91[0x0];}[_0x1ea6('0xd')](_0x2f3b8d){return _0x1ea6('0x9')==_0x2f3b8d['__className']&&0x1==_0x2f3b8d['nodes']['length']&&_0x2f3b8d[_0x1ea6('0x2')][0x0][_0x1ea6('0x4')]&&!_0x2f3b8d[_0x1ea6('0x0')]&&0x1==Array[_0x1ea6('0xe')](_0x2f3b8d[_0x1ea6('0x2')][0x0][_0x1ea6('0x4')])[_0x1ea6('0x7')];}[_0x1ea6('0x12')](_0x5d6b95,_0x286fc5){const _0x735619=Object['keys'](_0x5d6b95[_0x1ea6('0x8')]||{}),_0x513223=Object[_0x1ea6('0xf')](_0x286fc5[_0x1ea6('0x8')]||{});return _0x735619[_0x1ea6('0x7')]===_0x513223[_0x1ea6('0x7')]&&_0x735619['every'](_0x2323df=>_0x286fc5[_0x1ea6('0x8')][_0x2323df]&&_0x286fc5[_0x1ea6('0x8')][_0x2323df]===_0x5d6b95['attributes'][_0x2323df]);}}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import ActionCompressor from './actioncompressor';
|
|
2
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
-
export default class UserSelectionActionCompressor extends ActionCompressor {
|
|
4
|
-
/**
|
|
5
|
-
* @inheritDoc
|
|
6
|
-
*/
|
|
7
|
-
compress(result: CompressedOperationsData, operations: Array<any>): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
decompress(result: Array<any>, data: CompressedOperationsData): void;
|
|
12
|
-
}
|
|
1
|
+
import ActionCompressor from './actioncompressor';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
+
export default class UserSelectionActionCompressor extends ActionCompressor {
|
|
4
|
+
/**
|
|
5
|
+
* @inheritDoc
|
|
6
|
+
*/
|
|
7
|
+
compress(result: CompressedOperationsData, operations: Array<any>): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
decompress(result: Array<any>, data: CompressedOperationsData): void;
|
|
12
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x4a2a=['shift','_decompressSingleOperation','MarkerOperation','_context','newRange','stickiness','push','name','user:','split','buffers','start','oldRange','decompress','_getCompressorByName','types','user:position:','end','__className','compress','_id','startsWith'];(function(_0x35a855,_0x4a2a7a){const _0x449beb=function(_0x3ec15b){while(--_0x3ec15b){_0x35a855['push'](_0x35a855['shift']());}};_0x449beb(++_0x4a2a7a);}(_0x4a2a,0x145));const _0x449b=function(_0x35a855,_0x4a2a7a){_0x35a855=_0x35a855-0x0;let _0x449beb=_0x4a2a[_0x35a855];return _0x449beb;};import _0x1ff0a6 from'./actioncompressor';import{arePositionsEqual as _0x3dffca}from'../utils';import{cloneDeep as _0xe160c4}from'lodash-es';export default class f extends _0x1ff0a6{[_0x449b('0x2')](_0x3953f2,_0x440577){if(!this['_compareOperations'](_0x440577[0x0],_0x440577[0x1]))return!0x1;const _0x5556a3=_0x440577[_0x449b('0x5')]();return _0x5556a3[_0x449b('0x11')]=null,_0x5556a3['newRange']&&_0x3dffca(_0x5556a3['newRange'][_0x449b('0x10')],_0x5556a3[_0x449b('0x9')][_0x449b('0x0')])&&(_0x5556a3['newRange'][_0x449b('0x0')]=null),_0x440577[_0x449b('0x5')](),_0x3953f2[_0x449b('0x14')][_0x449b('0xb')](this[_0x449b('0x3')]),_0x3953f2[_0x449b('0x14')][_0x449b('0xb')](0x0),_0x3953f2['buffers'][_0x449b('0xb')](this['_compressSingleOperation'](_0x5556a3)),!0x0;}[_0x449b('0x12')](_0x249d7b,_0x312e72){const _0x4177ec=this[_0x449b('0x6')](_0x312e72);_0x4177ec[_0x449b('0x9')]&&!_0x4177ec[_0x449b('0x9')][_0x449b('0x0')]&&(_0x4177ec[_0x449b('0x9')][_0x449b('0x0')]=_0xe160c4(_0x4177ec[_0x449b('0x9')][_0x449b('0x10')]));const _0x4a6590=_0xe160c4(_0x4177ec);_0x4a6590[_0x449b('0x9')]&&(_0x4a6590['newRange'][_0x449b('0x10')][_0x449b('0xa')]='toNone',_0x4a6590[_0x449b('0x9')]['end']=_0xe160c4(_0x4a6590[_0x449b('0x9')][_0x449b('0x10')])),_0x4a6590[_0x449b('0xc')]=_0x449b('0x15')+_0x4a6590[_0x449b('0xc')][_0x449b('0xe')](':')[0x2],_0x312e72[_0x449b('0x14')][_0x449b('0x5')](),_0x249d7b[_0x449b('0xb')](_0x4177ec),_0x249d7b[_0x449b('0xb')](_0x4a6590);}['_compressSingleOperation'](_0x120091){const _0xb0342c={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x449b('0x8')][_0x449b('0x13')](_0x449b('0x7'))[_0x449b('0x2')](_0xb0342c,[_0x120091]),_0xb0342c[_0x449b('0xf')][0x0];}[_0x449b('0x6')](_0x470ade){const _0x331895=[];return this[_0x449b('0x8')][_0x449b('0x13')](_0x449b('0x7'))['decompress'](_0x331895,_0x470ade),_0x331895[0x0];}['_compareOperations'](_0x2d6a54,_0x344f6b){return!(!_0x2d6a54||!_0x344f6b)&&(_0x449b('0x7')==_0x2d6a54[_0x449b('0x1')]&&'MarkerOperation'==_0x344f6b[_0x449b('0x1')]&&!(!_0x2d6a54[_0x449b('0xc')][_0x449b('0x4')]('user:')||!_0x344f6b[_0x449b('0xc')][_0x449b('0x4')](_0x449b('0xd'))||_0x2d6a54[_0x449b('0xc')]==_0x344f6b[_0x449b('0xc')]));}}
|
package/src/compressor.d.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compresses and decompresses given set of operations in JSON format to/from the binary format using `Protocol Buffers`.
|
|
3
|
-
*/
|
|
4
|
-
export default class Compressor {
|
|
5
|
-
constructor();
|
|
6
|
-
/**
|
|
7
|
-
* Compress given list of operations in JSON format.
|
|
8
|
-
*
|
|
9
|
-
* **Note** It tries to combine typing-like or deleting-like operations into the one buffer.
|
|
10
|
-
* **Note** Input data will be consumed and modified during compression process. If you need untouched data
|
|
11
|
-
* you need to copy it before the compression.
|
|
12
|
-
*/
|
|
13
|
-
compress(operations: Array<any>): CompressedOperationsData;
|
|
14
|
-
/**
|
|
15
|
-
* Decompress given data to the list of operations in JSON format.
|
|
16
|
-
*
|
|
17
|
-
* **Note** Input data will be consumed during decompression process. If you need untouched data
|
|
18
|
-
* you need to copy it before the decompression.
|
|
19
|
-
*
|
|
20
|
-
* @param data Compressed operations.
|
|
21
|
-
* @returns List of operations in JSON format.
|
|
22
|
-
*/
|
|
23
|
-
decompress(data: CompressedOperationsData): Array<any>;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Compressed operations data.
|
|
27
|
-
*/
|
|
28
|
-
export type CompressedOperationsData = {
|
|
29
|
-
/**
|
|
30
|
-
* List of operations compressed to the binary format.
|
|
31
|
-
*/
|
|
32
|
-
buffers: Array<Uint8Array>;
|
|
33
|
-
/**
|
|
34
|
-
* List of compressor identifiers. According to this types a proper compressor will be used for the decompression.
|
|
35
|
-
*/
|
|
36
|
-
types: Array<number>;
|
|
37
|
-
/**
|
|
38
|
-
* Base version of the first compressed operation.
|
|
39
|
-
*/
|
|
40
|
-
baseVersion: number;
|
|
41
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Compresses and decompresses given set of operations in JSON format to/from the binary format using `Protocol Buffers`.
|
|
3
|
+
*/
|
|
4
|
+
export default class Compressor {
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* Compress given list of operations in JSON format.
|
|
8
|
+
*
|
|
9
|
+
* **Note** It tries to combine typing-like or deleting-like operations into the one buffer.
|
|
10
|
+
* **Note** Input data will be consumed and modified during compression process. If you need untouched data
|
|
11
|
+
* you need to copy it before the compression.
|
|
12
|
+
*/
|
|
13
|
+
compress(operations: Array<any>): CompressedOperationsData;
|
|
14
|
+
/**
|
|
15
|
+
* Decompress given data to the list of operations in JSON format.
|
|
16
|
+
*
|
|
17
|
+
* **Note** Input data will be consumed during decompression process. If you need untouched data
|
|
18
|
+
* you need to copy it before the decompression.
|
|
19
|
+
*
|
|
20
|
+
* @param data Compressed operations.
|
|
21
|
+
* @returns List of operations in JSON format.
|
|
22
|
+
*/
|
|
23
|
+
decompress(data: CompressedOperationsData): Array<any>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Compressed operations data.
|
|
27
|
+
*/
|
|
28
|
+
export type CompressedOperationsData = {
|
|
29
|
+
/**
|
|
30
|
+
* List of operations compressed to the binary format.
|
|
31
|
+
*/
|
|
32
|
+
buffers: Array<Uint8Array>;
|
|
33
|
+
/**
|
|
34
|
+
* List of compressor identifiers. According to this types a proper compressor will be used for the decompression.
|
|
35
|
+
*/
|
|
36
|
+
types: Array<number>;
|
|
37
|
+
/**
|
|
38
|
+
* Base version of the first compressed operation.
|
|
39
|
+
*/
|
|
40
|
+
baseVersion: number;
|
|
41
|
+
};
|
package/src/compressor.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x25c0=['set','baseVersion','MoveOperation','_registerActionCompressor','ForwardDeletingAction','compress','_registerOperationCompressor','InsertOperation','TypingAction','MergeOperation','AttributeOperation','_registerCompressor','RenameOperation','_protobufFactory','getDescriptor','forEach','suggestion','decompress','RootAttributeOperation','MarkerOperation','get','__className','types','_getCompressorByName','_compressorById','_compressorByName','RootOperation','NoOperation','SplitOperation','SuggestionMarkerOperation','no-operations-provided','length','CommentMarkerOperation','DeletingAction','UserSelectionAction'];(function(_0x512387,_0x25c0ca){const _0x5eb0ce=function(_0x333245){while(--_0x333245){_0x512387['push'](_0x512387['shift']());}};_0x5eb0ce(++_0x25c0ca);}(_0x25c0,0x1b9));const _0x5eb0=function(_0x512387,_0x25c0ca){_0x512387=_0x512387-0x0;let _0x5eb0ce=_0x25c0[_0x512387];return _0x5eb0ce;};import{CKEditorError as _0x4bed12}from'ckeditor5/src/utils';import _0x32cc22 from'./protobuffactory';import _0x17ed32 from'./operationcompressor/operationcompressor';import _0x271ba8 from'./operationcompressor/attributeoperationcompressor';import _0x44cd0b from'./operationcompressor/insertoperationcompressor';import _0x464d1b from'./operationcompressor/markeroperationcompressor';import _0x336180 from'./operationcompressor/nooperationcompressor';import _0x12bd9e from'./operationcompressor/annotationmarkeroperationcompressor';import _0x3ba745 from'./actioncompressor/typingactioncompressor';import _0x1d6a57 from'./actioncompressor/deletingactioncompressor';import _0x58c6ab from'./actioncompressor/forwarddeletingactioncompressor';import _0x5915bc from'./actioncompressor/userselectionactioncompressor';export default class g{constructor(){this[_0x5eb0('0x3')]=new Map(),this[_0x5eb0('0x4')]=new Map(),this[_0x5eb0('0x1b')]=new _0x32cc22();const _0x23e688=this[_0x5eb0('0x1b')][_0x5eb0('0x1c')](_0x5eb0('0x21'));this['_registerCompressor'](0x1,_0x5eb0('0x6'),new _0x336180(0x1,_0x5eb0('0x6'),void 0x0)),this[_0x5eb0('0x14')](0xa,_0x5eb0('0x18'),_0x271ba8),this[_0x5eb0('0x14')](0xb,_0x5eb0('0x15'),_0x44cd0b),this[_0x5eb0('0x14')](0xc,_0x5eb0('0x21'),_0x464d1b),this[_0x5eb0('0x14')](0xd,_0x5eb0('0x17'),_0x17ed32),this[_0x5eb0('0x14')](0xe,_0x5eb0('0x10'),_0x17ed32),this['_registerOperationCompressor'](0xf,_0x5eb0('0x1a'),_0x17ed32),this[_0x5eb0('0x14')](0x10,_0x5eb0('0x20'),_0x271ba8),this['_registerOperationCompressor'](0x11,_0x5eb0('0x7'),_0x17ed32),this[_0x5eb0('0x19')](0x12,'CommentMarkerOperation',new _0x12bd9e(0x12,_0x5eb0('0x21'),_0x23e688,'comment')),this[_0x5eb0('0x19')](0x13,'SuggestionMarkerOperation',new _0x12bd9e(0x13,'MarkerOperation',_0x23e688,_0x5eb0('0x1e'))),this[_0x5eb0('0x14')](0x14,_0x5eb0('0x5'),_0x17ed32),this[_0x5eb0('0x11')](0x64,_0x5eb0('0x16'),_0x3ba745),this[_0x5eb0('0x11')](0x65,_0x5eb0('0xc'),_0x1d6a57),this['_registerActionCompressor'](0x66,_0x5eb0('0x12'),_0x58c6ab),this['_registerActionCompressor'](0x67,_0x5eb0('0xd'),_0x5915bc);}[_0x5eb0('0x13')](_0x5d80ee){if(!_0x5d80ee||!_0x5d80ee[0x0])throw new _0x4bed12(_0x5eb0('0x9'),this);const _0x18f415={'types':[],'buffers':[],'baseVersion':_0x5d80ee[0x0][_0x5eb0('0xf')]};for(;_0x5d80ee[_0x5eb0('0xa')];)this[_0x5eb0('0x2')](_0x5eb0('0xd'))[_0x5eb0('0x13')](_0x18f415,_0x5d80ee)||this['_getCompressorByName']('TypingAction')['compress'](_0x18f415,_0x5d80ee)||this[_0x5eb0('0x2')](_0x5eb0('0xc'))[_0x5eb0('0x13')](_0x18f415,_0x5d80ee)||this['_getCompressorByName'](_0x5eb0('0x12'))[_0x5eb0('0x13')](_0x18f415,_0x5d80ee)||this[_0x5eb0('0x2')](_0x5eb0('0xb'))['compress'](_0x18f415,_0x5d80ee)||this['_getCompressorByName'](_0x5eb0('0x8'))[_0x5eb0('0x13')](_0x18f415,_0x5d80ee)||this[_0x5eb0('0x2')](_0x5d80ee[0x0][_0x5eb0('0x0')])['compress'](_0x18f415,_0x5d80ee);return _0x18f415;}[_0x5eb0('0x1f')](_0x5b089b){const _0x3717bc=[];for(;_0x5b089b[_0x5eb0('0x1')][_0x5eb0('0xa')];){this['_compressorById'][_0x5eb0('0x22')](_0x5b089b[_0x5eb0('0x1')][0x0])[_0x5eb0('0x1f')](_0x3717bc,_0x5b089b);}return _0x3717bc[_0x5eb0('0x1d')]((_0x2fcb4e,_0x482dad)=>_0x2fcb4e[_0x5eb0('0xf')]=_0x5b089b[_0x5eb0('0xf')]+_0x482dad),_0x3717bc;}['_getCompressorByName'](_0x5e4343){return this[_0x5eb0('0x4')]['get'](_0x5e4343);}['_registerOperationCompressor'](_0x4f78bd,_0x16f441,_0x1a1835){const _0xc299a6=new _0x1a1835(_0x4f78bd,_0x16f441,this[_0x5eb0('0x1b')][_0x5eb0('0x1c')](_0x16f441));this[_0x5eb0('0x19')](_0x4f78bd,_0x16f441,_0xc299a6);}[_0x5eb0('0x11')](_0x168769,_0x2b28f6,_0x46c1b1){const _0x8d7cf3=new _0x46c1b1(_0x168769,this);this['_registerCompressor'](_0x168769,_0x2b28f6,_0x8d7cf3);}[_0x5eb0('0x19')](_0x5448ff,_0x1651a8,_0x3876b8){this[_0x5eb0('0x3')][_0x5eb0('0xe')](_0x5448ff,_0x3876b8),this[_0x5eb0('0x4')][_0x5eb0('0xe')](_0x1651a8,_0x3876b8);}}
|