@ckeditor/ckeditor5-operations-compressor 38.1.1 → 38.2.0-alpha.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 +2 -2
- 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.2.0-alpha.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/",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"url": "https://support.ckeditor.com/hc/en-us/requests/new"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"ckeditor5": "38.
|
|
33
|
+
"ckeditor5": "38.2.0-alpha.1",
|
|
34
34
|
"lodash-es": "^4.17.11",
|
|
35
35
|
"protobufjs": "^7.0.0"
|
|
36
36
|
},
|
|
@@ -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.js';
|
|
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 _0x30ad=['push','_compressSingleOperation','buffers','_splitCurrent','shift','_compareOperations','types','_id','_decompressSingleOperation','_combineNext'];(function(_0x36ee0b,_0x30ad8c){const _0x1dd4cc=function(_0x95d9a2){while(--_0x95d9a2){_0x36ee0b['push'](_0x36ee0b['shift']());}};_0x1dd4cc(++_0x30ad8c);}(_0x30ad,0x14a));const _0x1dd4=function(_0x36ee0b,_0x30ad8c){_0x36ee0b=_0x36ee0b-0x0;let _0x1dd4cc=_0x30ad[_0x36ee0b];return _0x1dd4cc;};import{cloneDeep as _0x3ca784}from'lodash-es';export default class b{constructor(_0x46cdb2,_0x7783f4){this[_0x1dd4('0x7')]=_0x46cdb2,this['_context']=_0x7783f4;}['compress'](_0x18435a,_0x1c8f5f){let _0x1d87bb;for(;_0x1c8f5f['length']>0x1&&this[_0x1dd4('0x5')](_0x1c8f5f[0x0],_0x1c8f5f[0x1]);)_0x1d87bb?(_0x1d87bb=this[_0x1dd4('0x9')](_0x1c8f5f[_0x1dd4('0x4')](),_0x1d87bb),_0x18435a[_0x1dd4('0x6')]['push'](0x0)):(_0x1d87bb=_0x3ca784(_0x1c8f5f[_0x1dd4('0x4')]()),_0x18435a[_0x1dd4('0x6')][_0x1dd4('0x0')](this[_0x1dd4('0x7')]));return!!_0x1d87bb&&(_0x1d87bb=this[_0x1dd4('0x9')](_0x1c8f5f[_0x1dd4('0x4')](),_0x1d87bb),_0x18435a[_0x1dd4('0x6')]['push'](0x0),_0x18435a[_0x1dd4('0x2')][_0x1dd4('0x0')](this[_0x1dd4('0x1')](_0x1d87bb)),!0x0);}['decompress'](_0x56e1d5,_0x2e48fd){const _0x3a31c5=this[_0x1dd4('0x8')](_0x2e48fd);for(;0x0==_0x2e48fd[_0x1dd4('0x6')][0x0];)_0x2e48fd['types'][_0x1dd4('0x4')](),_0x56e1d5[_0x1dd4('0x0')](this[_0x1dd4('0x3')](_0x3a31c5));_0x56e1d5[_0x1dd4('0x0')](_0x3a31c5);}}
|
|
@@ -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.js';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
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 _0x5ef3=['_getCompressorByName','_decompressSingleOperation','MoveOperation','_context','$graveyard','__className','wasUndone','sourcePosition','root','howMany','_splitCurrent','_checkOperation','_compressSingleOperation','targetPosition','_combineNext'];(function(_0x5a48a9,_0x5ef3d6){const _0x5ae12f=function(_0x3d714e){while(--_0x3d714e){_0x5a48a9['push'](_0x5a48a9['shift']());}};_0x5ae12f(++_0x5ef3d6);}(_0x5ef3,0x1df));const _0x5ae1=function(_0x5a48a9,_0x5ef3d6){_0x5a48a9=_0x5a48a9-0x0;let _0x5ae12f=_0x5ef3[_0x5a48a9];return _0x5ae12f;};import _0x1bbf01 from'./actioncompressor.js';import{arePositionsEqual as _0xa47abd,getPositionShiftedBy as _0x209e43}from'../utils.js';import{cloneDeep as _0x47df12}from'lodash-es';export default class c extends _0x1bbf01{[_0x5ae1('0x0')](_0x20e974,_0x3f3bc7){return _0x3f3bc7[_0x5ae1('0xa')]++,_0x3f3bc7['sourcePosition']=_0x47df12(_0x20e974['sourcePosition']),_0x3f3bc7;}[_0x5ae1('0xb')](_0x16d9f8){const _0x5e3335=_0x47df12(_0x16d9f8);return _0x16d9f8[_0x5ae1('0xa')]--,_0x5e3335['howMany']=0x1,_0x5e3335[_0x5ae1('0x8')]=_0x209e43(_0x5e3335[_0x5ae1('0x8')],_0x16d9f8[_0x5ae1('0xa')]),_0x5e3335;}['_compareOperations'](_0x49f30d,_0x46e9f6){return!(!this[_0x5ae1('0xc')](_0x49f30d)||!this[_0x5ae1('0xc')](_0x46e9f6))&&(_0xa47abd(_0x209e43(_0x49f30d[_0x5ae1('0x8')],-0x1),_0x46e9f6[_0x5ae1('0x8')])&&_0xa47abd(_0x49f30d[_0x5ae1('0xe')],_0x46e9f6[_0x5ae1('0xe')]));}[_0x5ae1('0xd')](_0x2115fd){const _0x8a033e={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x5ae1('0x4')]['_getCompressorByName']('MoveOperation')['compress'](_0x8a033e,[_0x2115fd]),_0x8a033e['buffers'][0x0];}[_0x5ae1('0x2')](_0x1d67bf){const _0x283111=[];return this[_0x5ae1('0x4')][_0x5ae1('0x1')](_0x5ae1('0x3'))['decompress'](_0x283111,_0x1d67bf),_0x283111[0x0];}[_0x5ae1('0xc')](_0x2c792c){return _0x5ae1('0x3')==_0x2c792c[_0x5ae1('0x6')]&&_0x5ae1('0x5')==_0x2c792c[_0x5ae1('0xe')][_0x5ae1('0x9')]&&0x1==_0x2c792c[_0x5ae1('0xa')]&&!_0x2c792c[_0x5ae1('0x7')];}}
|
|
@@ -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.js';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
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 _0x5a58=['__className','_context','sourcePosition','decompress','MoveOperation','_compressSingleOperation','targetPosition','_splitCurrent','buffers','_compareOperations','_checkOperation','_getCompressorByName','_decompressSingleOperation','howMany'];(function(_0x3ab03a,_0x5a5804){const _0x1bffcc=function(_0x24e6c4){while(--_0x24e6c4){_0x3ab03a['push'](_0x3ab03a['shift']());}};_0x1bffcc(++_0x5a5804);}(_0x5a58,0x15a));const _0x1bff=function(_0x3ab03a,_0x5a5804){_0x3ab03a=_0x3ab03a-0x0;let _0x1bffcc=_0x5a58[_0x3ab03a];return _0x1bffcc;};import _0x22375e from'./actioncompressor.js';import{arePositionsEqual as _0x3082e8}from'../utils.js';import{cloneDeep as _0x1fca41}from'lodash-es';export default class h extends _0x22375e{['_combineNext'](_0x477d0f,_0x42c30a){return _0x42c30a[_0x1bff('0x3')]++,_0x42c30a;}[_0x1bff('0xb')](_0x498b63){const _0x2deee3=_0x1fca41(_0x498b63);return _0x2deee3[_0x1bff('0x3')]=0x1,_0x498b63[_0x1bff('0x3')]--,_0x2deee3;}[_0x1bff('0xd')](_0x28d478,_0x352859){return!(!this[_0x1bff('0x0')](_0x28d478)||!this[_0x1bff('0x0')](_0x352859))&&(_0x3082e8(_0x28d478['sourcePosition'],_0x352859[_0x1bff('0x6')])&&_0x3082e8(_0x28d478['targetPosition'],_0x352859['targetPosition']));}[_0x1bff('0x9')](_0x1c97c9){const _0xa3c8c8={'types':[],'buffers':[],'baseVersion':0x0};return this['_context'][_0x1bff('0x1')](_0x1bff('0x8'))['compress'](_0xa3c8c8,[_0x1c97c9]),_0xa3c8c8[_0x1bff('0xc')][0x0];}[_0x1bff('0x2')](_0x3d02a0){const _0x379469=[];return this[_0x1bff('0x5')][_0x1bff('0x1')](_0x1bff('0x8'))[_0x1bff('0x7')](_0x379469,_0x3d02a0),_0x379469[0x0];}['_checkOperation'](_0x52898f){return _0x1bff('0x8')==_0x52898f[_0x1bff('0x4')]&&'$graveyard'==_0x52898f[_0x1bff('0xa')]['root']&&0x1==_0x52898f['howMany']&&!_0x52898f['wasUndone'];}}
|
|
@@ -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.js';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
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 _0x5334=['_decompressSingleOperation','InsertOperation','decompress','keys','iterator','wasUndone','_splitCurrent','__className','value','from','_context','substr','position','length','every','data','attributes','nodes','next','_combineNext','_compressSingleOperation','_compareAttributes','_checkOperation','_getCompressorByName'];(function(_0x220b97,_0x5334c0){const _0x53c02c=function(_0x2a55f4){while(--_0x2a55f4){_0x220b97['push'](_0x220b97['shift']());}};_0x53c02c(++_0x5334c0);}(_0x5334,0xf3));const _0x53c0=function(_0x220b97,_0x5334c0){_0x220b97=_0x220b97-0x0;let _0x53c02c=_0x5334[_0x220b97];return _0x53c02c;};import _0x1aec44 from'./actioncompressor.js';import{arePositionsEqual as _0x5dc8e6,getPositionShiftedBy as _0x3155bc}from'../utils.js';import{cloneDeep as _0x5e10b4}from'lodash-es';export default class m extends _0x1aec44{[_0x53c0('0x10')](_0x1e9f59,_0x5ef98e){return _0x5ef98e['nodes'][0x0][_0x53c0('0xc')]+=_0x1e9f59[_0x53c0('0xe')][0x0]['data'],_0x5ef98e;}[_0x53c0('0x3')](_0x3c0dc3){const _0x40e7e1=_0x5e10b4(_0x3c0dc3),_0x11bc49=_0x40e7e1[_0x53c0('0xe')][0x0],_0x44864a=_0x3c0dc3[_0x53c0('0xe')][0x0],_0x150305=_0x44864a[_0x53c0('0xc')][Symbol[_0x53c0('0x1')]]()[_0x53c0('0xf')]()[_0x53c0('0x5')],_0x2df48c=_0x150305[_0x53c0('0xa')];return _0x11bc49[_0x53c0('0xc')]=_0x150305,_0x44864a[_0x53c0('0xc')]=_0x44864a[_0x53c0('0xc')][_0x53c0('0x8')](_0x2df48c),_0x3c0dc3[_0x53c0('0x9')]=_0x3155bc(_0x3c0dc3[_0x53c0('0x9')],_0x2df48c),_0x40e7e1;}['_compareOperations'](_0x1b3069,_0x15d208){if(this['_checkOperation'](_0x1b3069)&&this[_0x53c0('0x13')](_0x15d208)){const _0x5c69cd=_0x1b3069[_0x53c0('0xe')][0x0][_0x53c0('0xc')]['length'],_0x12fb9e=_0x5dc8e6(_0x3155bc(_0x1b3069['position'],_0x5c69cd),_0x15d208[_0x53c0('0x9')]),_0x185514=_0x1b3069[_0x53c0('0xe')][0x0],_0x4b305a=_0x15d208[_0x53c0('0xe')][0x0];return _0x12fb9e&&this[_0x53c0('0x12')](_0x185514,_0x4b305a);}return!0x1;}[_0x53c0('0x11')](_0x1cde56){const _0x5d4789={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x53c0('0x7')][_0x53c0('0x14')](_0x53c0('0x16'))['compress'](_0x5d4789,[_0x1cde56]),_0x5d4789['buffers'][0x0];}[_0x53c0('0x15')](_0x3eab4a){const _0xb2b812=[];return this[_0x53c0('0x7')]['_getCompressorByName'](_0x53c0('0x16'))[_0x53c0('0x17')](_0xb2b812,_0x3eab4a),_0xb2b812[0x0];}['_checkOperation'](_0x165d88){return _0x53c0('0x16')==_0x165d88[_0x53c0('0x4')]&&0x1==_0x165d88['nodes'][_0x53c0('0xa')]&&_0x165d88[_0x53c0('0xe')][0x0][_0x53c0('0xc')]&&!_0x165d88[_0x53c0('0x2')]&&0x1==Array[_0x53c0('0x6')](_0x165d88[_0x53c0('0xe')][0x0][_0x53c0('0xc')])[_0x53c0('0xa')];}[_0x53c0('0x12')](_0x275782,_0x5a50f5){const _0x554be2=Object[_0x53c0('0x0')](_0x275782[_0x53c0('0xd')]||{}),_0x4b3bff=Object[_0x53c0('0x0')](_0x5a50f5[_0x53c0('0xd')]||{});return _0x554be2[_0x53c0('0xa')]===_0x4b3bff['length']&&_0x554be2[_0x53c0('0xb')](_0x374cfa=>_0x5a50f5[_0x53c0('0xd')][_0x374cfa]&&_0x5a50f5[_0x53c0('0xd')][_0x374cfa]===_0x275782[_0x53c0('0xd')][_0x374cfa]);}}
|
|
@@ -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.js';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
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 _0x2b64=['name','types','toNone','user:position:','__className','newRange','_decompressSingleOperation','_compareOperations','_context','buffers','MarkerOperation','_getCompressorByName','shift','_compressSingleOperation','compress','push','end','startsWith','decompress','start','oldRange','_id','user:'];(function(_0x5cf6a6,_0x2b645e){const _0x2097ef=function(_0x694b61){while(--_0x694b61){_0x5cf6a6['push'](_0x5cf6a6['shift']());}};_0x2097ef(++_0x2b645e);}(_0x2b64,0x1ea));const _0x2097=function(_0x5cf6a6,_0x2b645e){_0x5cf6a6=_0x5cf6a6-0x0;let _0x2097ef=_0x2b64[_0x5cf6a6];return _0x2097ef;};import _0x167a77 from'./actioncompressor.js';import{arePositionsEqual as _0xb1a147}from'../utils.js';import{cloneDeep as _0x79678b}from'lodash-es';export default class f extends _0x167a77{[_0x2097('0x7')](_0x3019e7,_0x1f06b0){if(!this[_0x2097('0x0')](_0x1f06b0[0x0],_0x1f06b0[0x1]))return!0x1;const _0x2e83cb=_0x1f06b0['shift']();return _0x2e83cb[_0x2097('0xd')]=null,_0x2e83cb[_0x2097('0x15')]&&_0xb1a147(_0x2e83cb[_0x2097('0x15')][_0x2097('0xc')],_0x2e83cb[_0x2097('0x15')][_0x2097('0x9')])&&(_0x2e83cb[_0x2097('0x15')][_0x2097('0x9')]=null),_0x1f06b0[_0x2097('0x5')](),_0x3019e7[_0x2097('0x11')]['push'](this[_0x2097('0xe')]),_0x3019e7[_0x2097('0x11')]['push'](0x0),_0x3019e7[_0x2097('0x2')]['push'](this[_0x2097('0x6')](_0x2e83cb)),!0x0;}[_0x2097('0xb')](_0x192641,_0x4492d7){const _0x3605cc=this[_0x2097('0x16')](_0x4492d7);_0x3605cc[_0x2097('0x15')]&&!_0x3605cc[_0x2097('0x15')]['end']&&(_0x3605cc[_0x2097('0x15')]['end']=_0x79678b(_0x3605cc[_0x2097('0x15')]['start']));const _0x14f95e=_0x79678b(_0x3605cc);_0x14f95e[_0x2097('0x15')]&&(_0x14f95e[_0x2097('0x15')][_0x2097('0xc')]['stickiness']=_0x2097('0x12'),_0x14f95e[_0x2097('0x15')]['end']=_0x79678b(_0x14f95e[_0x2097('0x15')][_0x2097('0xc')])),_0x14f95e[_0x2097('0x10')]=_0x2097('0x13')+_0x14f95e[_0x2097('0x10')]['split'](':')[0x2],_0x4492d7[_0x2097('0x11')]['shift'](),_0x192641[_0x2097('0x8')](_0x3605cc),_0x192641[_0x2097('0x8')](_0x14f95e);}[_0x2097('0x6')](_0x29f656){const _0x16823a={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x2097('0x1')][_0x2097('0x4')](_0x2097('0x3'))[_0x2097('0x7')](_0x16823a,[_0x29f656]),_0x16823a[_0x2097('0x2')][0x0];}[_0x2097('0x16')](_0x42826c){const _0x41eef0=[];return this[_0x2097('0x1')][_0x2097('0x4')](_0x2097('0x3'))[_0x2097('0xb')](_0x41eef0,_0x42826c),_0x41eef0[0x0];}[_0x2097('0x0')](_0x3da0ce,_0x5e1219){return!(!_0x3da0ce||!_0x5e1219)&&(_0x2097('0x3')==_0x3da0ce[_0x2097('0x14')]&&_0x2097('0x3')==_0x5e1219[_0x2097('0x14')]&&!(!_0x3da0ce[_0x2097('0x10')]['startsWith'](_0x2097('0xf'))||!_0x5e1219[_0x2097('0x10')][_0x2097('0xa')](_0x2097('0xf'))||_0x3da0ce['name']==_0x5e1219[_0x2097('0x10')]));}}
|
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 _0x4160=['getDescriptor','_compressorByName','_getCompressorByName','SplitOperation','__className','InsertOperation','MarkerOperation','RenameOperation','set','_registerActionCompressor','suggestion','_registerCompressor','UserSelectionAction','_registerOperationCompressor','TypingAction','NoOperation','RootAttributeOperation','CommentMarkerOperation','DeletingAction','decompress','_protobufFactory','ForwardDeletingAction','SuggestionMarkerOperation','forEach','compress','MergeOperation','_compressorById','RootOperation','types','no-operations-provided','AttributeOperation','get','MoveOperation','baseVersion'];(function(_0x54c608,_0x41605f){const _0x4e254a=function(_0x3a2165){while(--_0x3a2165){_0x54c608['push'](_0x54c608['shift']());}};_0x4e254a(++_0x41605f);}(_0x4160,0x1c8));const _0x4e25=function(_0x54c608,_0x41605f){_0x54c608=_0x54c608-0x0;let _0x4e254a=_0x4160[_0x54c608];return _0x4e254a;};import{CKEditorError as _0x5e7228}from'ckeditor5/src/utils.js';import _0x23986c from'./protobuffactory.js';import _0x3e05e9 from'./operationcompressor/operationcompressor.js';import _0x55e120 from'./operationcompressor/attributeoperationcompressor.js';import _0x39272a from'./operationcompressor/insertoperationcompressor.js';import _0x29980e from'./operationcompressor/markeroperationcompressor.js';import _0x4f5902 from'./operationcompressor/nooperationcompressor.js';import _0x32d2b3 from'./operationcompressor/annotationmarkeroperationcompressor.js';import _0x54fae0 from'./actioncompressor/typingactioncompressor.js';import _0x4312ca from'./actioncompressor/deletingactioncompressor.js';import _0x55ab38 from'./actioncompressor/forwarddeletingactioncompressor.js';import _0x55ed00 from'./actioncompressor/userselectionactioncompressor.js';export default class g{constructor(){this[_0x4e25('0xc')]=new Map(),this[_0x4e25('0x15')]=new Map(),this[_0x4e25('0x6')]=new _0x23986c();const _0x595e84=this[_0x4e25('0x6')][_0x4e25('0x14')]('MarkerOperation');this[_0x4e25('0x1f')](0x1,_0x4e25('0x1'),new _0x4f5902(0x1,_0x4e25('0x1'),void 0x0)),this[_0x4e25('0x21')](0xa,_0x4e25('0x10'),_0x55e120),this[_0x4e25('0x21')](0xb,_0x4e25('0x19'),_0x39272a),this[_0x4e25('0x21')](0xc,_0x4e25('0x1a'),_0x29980e),this[_0x4e25('0x21')](0xd,_0x4e25('0xb'),_0x3e05e9),this[_0x4e25('0x21')](0xe,_0x4e25('0x12'),_0x3e05e9),this[_0x4e25('0x21')](0xf,_0x4e25('0x1b'),_0x3e05e9),this[_0x4e25('0x21')](0x10,_0x4e25('0x2'),_0x55e120),this[_0x4e25('0x21')](0x11,_0x4e25('0x17'),_0x3e05e9),this[_0x4e25('0x1f')](0x12,_0x4e25('0x3'),new _0x32d2b3(0x12,_0x4e25('0x1a'),_0x595e84,'comment')),this['_registerCompressor'](0x13,_0x4e25('0x8'),new _0x32d2b3(0x13,_0x4e25('0x1a'),_0x595e84,_0x4e25('0x1e'))),this[_0x4e25('0x21')](0x14,_0x4e25('0xd'),_0x3e05e9),this['_registerActionCompressor'](0x64,_0x4e25('0x0'),_0x54fae0),this[_0x4e25('0x1d')](0x65,'DeletingAction',_0x4312ca),this['_registerActionCompressor'](0x66,_0x4e25('0x7'),_0x55ab38),this[_0x4e25('0x1d')](0x67,_0x4e25('0x20'),_0x55ed00);}[_0x4e25('0xa')](_0x4907d0){if(!_0x4907d0||!_0x4907d0[0x0])throw new _0x5e7228(_0x4e25('0xf'),this);const _0x4dc8e0={'types':[],'buffers':[],'baseVersion':_0x4907d0[0x0][_0x4e25('0x13')]};for(;_0x4907d0['length'];)this['_getCompressorByName'](_0x4e25('0x20'))['compress'](_0x4dc8e0,_0x4907d0)||this['_getCompressorByName'](_0x4e25('0x0'))[_0x4e25('0xa')](_0x4dc8e0,_0x4907d0)||this[_0x4e25('0x16')](_0x4e25('0x4'))[_0x4e25('0xa')](_0x4dc8e0,_0x4907d0)||this[_0x4e25('0x16')]('ForwardDeletingAction')[_0x4e25('0xa')](_0x4dc8e0,_0x4907d0)||this[_0x4e25('0x16')](_0x4e25('0x3'))['compress'](_0x4dc8e0,_0x4907d0)||this[_0x4e25('0x16')](_0x4e25('0x8'))['compress'](_0x4dc8e0,_0x4907d0)||this[_0x4e25('0x16')](_0x4907d0[0x0][_0x4e25('0x18')])['compress'](_0x4dc8e0,_0x4907d0);return _0x4dc8e0;}['decompress'](_0x952cec){const _0x1d9124=[];for(;_0x952cec[_0x4e25('0xe')]['length'];){this[_0x4e25('0xc')][_0x4e25('0x11')](_0x952cec['types'][0x0])[_0x4e25('0x5')](_0x1d9124,_0x952cec);}return _0x1d9124[_0x4e25('0x9')]((_0x46f730,_0x5735c8)=>_0x46f730[_0x4e25('0x13')]=_0x952cec[_0x4e25('0x13')]+_0x5735c8),_0x1d9124;}[_0x4e25('0x16')](_0x3dcd8a){return this['_compressorByName']['get'](_0x3dcd8a);}['_registerOperationCompressor'](_0x27d4d,_0x533a38,_0x17f1eb){const _0x48329f=new _0x17f1eb(_0x27d4d,_0x533a38,this[_0x4e25('0x6')][_0x4e25('0x14')](_0x533a38));this[_0x4e25('0x1f')](_0x27d4d,_0x533a38,_0x48329f);}[_0x4e25('0x1d')](_0xc47502,_0x409d8e,_0x4a3a96){const _0x42cd83=new _0x4a3a96(_0xc47502,this);this[_0x4e25('0x1f')](_0xc47502,_0x409d8e,_0x42cd83);}[_0x4e25('0x1f')](_0x43a8eb,_0x424b1d,_0x13d166){this[_0x4e25('0xc')][_0x4e25('0x1c')](_0x43a8eb,_0x13d166),this[_0x4e25('0x15')][_0x4e25('0x1c')](_0x424b1d,_0x13d166);}}
|