@ckeditor/ckeditor5-operations-compressor 40.0.0 → 40.1.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/LICENSE.md +7 -8
- package/package.json +2 -2
- package/src/actioncompressor/actioncompressor.d.ts +60 -60
- package/src/actioncompressor/actioncompressor.js +1 -1
- package/src/actioncompressor/deletingactioncompressor.d.ts +28 -28
- package/src/actioncompressor/deletingactioncompressor.js +1 -1
- package/src/actioncompressor/forwarddeletingactioncompressor.d.ts +28 -28
- package/src/actioncompressor/forwarddeletingactioncompressor.js +1 -1
- package/src/actioncompressor/typingactioncompressor.d.ts +28 -28
- package/src/actioncompressor/typingactioncompressor.js +1 -1
- package/src/actioncompressor/userselectionactioncompressor.d.ts +16 -16
- package/src/actioncompressor/userselectionactioncompressor.js +1 -1
- package/src/compressor.d.ts +45 -45
- package/src/compressor.js +1 -1
- package/src/lib/compiledmessages.js +1 -1
- package/src/operationcompressor/annotationmarkeroperationcompressor.d.ts +22 -22
- package/src/operationcompressor/annotationmarkeroperationcompressor.js +1 -1
- package/src/operationcompressor/attributeoperationcompressor.d.ts +17 -17
- package/src/operationcompressor/attributeoperationcompressor.js +1 -1
- package/src/operationcompressor/insertoperationcompressor.d.ts +17 -17
- package/src/operationcompressor/insertoperationcompressor.js +1 -1
- package/src/operationcompressor/markeroperationcompressor.d.ts +13 -13
- package/src/operationcompressor/markeroperationcompressor.js +1 -1
- package/src/operationcompressor/nooperationcompressor.d.ts +20 -20
- package/src/operationcompressor/nooperationcompressor.js +1 -1
- package/src/operationcompressor/operationcompressor.d.ts +28 -28
- package/src/operationcompressor/operationcompressor.js +1 -1
- package/src/protobufdescriptions.d.ts +4 -4
- package/src/protobufdescriptions.js +1 -1
- package/src/protobuffactory.d.ts +5 -5
- package/src/protobuffactory.js +1 -1
- package/src/utils.d.ts +30 -30
- package/src/utils.js +1 -1
package/LICENSE.md
CHANGED
|
@@ -2,7 +2,7 @@ Software License Agreement
|
|
|
2
2
|
==========================
|
|
3
3
|
|
|
4
4
|
**CKEditor 5 operations compressor**<br>
|
|
5
|
-
Copyright (c) 2003
|
|
5
|
+
Copyright (c) 2003–2023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
|
6
6
|
|
|
7
7
|
CKEditor 5 operations compressor is licensed under a commercial license and is protected by copyright law.
|
|
8
8
|
For more details about available licensing options please contact us at sales@cksource.com.
|
|
@@ -10,18 +10,17 @@ For more details about available licensing options please contact us at sales@ck
|
|
|
10
10
|
Sources of Intellectual Property Included in CKEditor 5 operations compressor
|
|
11
11
|
-----------------------------------------------------
|
|
12
12
|
|
|
13
|
-
Where not otherwise indicated, all CKEditor 5
|
|
14
|
-
Any attempts to deobfuscate or disassemble the code are forbidden and will result in legal consequences.
|
|
13
|
+
Where not otherwise indicated, all CKEditor 5 operations compressor content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
|
|
15
14
|
|
|
16
|
-
The following libraries are included in CKEditor 5
|
|
15
|
+
The following libraries are included in CKEditor 5 operations compressor under the [MIT license](https://opensource.org/licenses/MIT):
|
|
17
16
|
|
|
18
|
-
*
|
|
17
|
+
* Lodash - Copyright (c) JS Foundation and other contributors https://js.foundation/. Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors http://underscorejs.org/.
|
|
19
18
|
|
|
20
|
-
The following libraries are included in CKEditor 5
|
|
19
|
+
The following libraries are included in CKEditor 5 operations compressor under the [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause):
|
|
21
20
|
|
|
22
|
-
*
|
|
21
|
+
* protobuf.js - Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
|
23
22
|
|
|
24
23
|
Trademarks
|
|
25
24
|
----------
|
|
26
25
|
|
|
27
|
-
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
|
|
26
|
+
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-operations-compressor",
|
|
3
|
-
"version": "40.
|
|
3
|
+
"version": "40.1.0",
|
|
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": "40.
|
|
33
|
+
"ckeditor5": "40.1.0",
|
|
34
34
|
"lodash-es": "4.17.21",
|
|
35
35
|
"protobufjs": "7.2.4"
|
|
36
36
|
},
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
import type { CompressedOperationsData, default as Compressor } from '../compressor';
|
|
6
|
-
/**
|
|
7
|
-
* * Compresses and decompresses multiple operations into the one buffer.
|
|
8
|
-
*/
|
|
9
|
-
export default abstract class ActionCompressor {
|
|
10
|
-
constructor(id: number, context: Compressor);
|
|
11
|
-
/**
|
|
12
|
-
* Combines and compress operations from the list.
|
|
13
|
-
* Operations are consumed as long as match this compressor.
|
|
14
|
-
*
|
|
15
|
-
* @param result Object to which compression result should be added.
|
|
16
|
-
* @param operations List of operations in JSON format to compress.
|
|
17
|
-
* @returns `true` when operation is consumed `false` otherwise.
|
|
18
|
-
*/
|
|
19
|
-
compress(result: CompressedOperationsData, operations: Array<any>): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Decompress and split compressed operations. Decompressed operations are consumed (removed from the input data).
|
|
22
|
-
*
|
|
23
|
-
* @param result Decompressed operations in JSON format.
|
|
24
|
-
* @param data Compressed operations data.
|
|
25
|
-
*/
|
|
26
|
-
decompress(result: Array<any>, data: CompressedOperationsData): void;
|
|
27
|
-
/**
|
|
28
|
-
* Compresses single operation using a proper compressor.
|
|
29
|
-
*
|
|
30
|
-
* @param operation Operation in JSON format.
|
|
31
|
-
* @returns Operation JSON compressed to the binary format.
|
|
32
|
-
*/
|
|
33
|
-
protected abstract _compressSingleOperation(operation: any): Uint8Array;
|
|
34
|
-
/**
|
|
35
|
-
* Decompresses combined operation using a proper compressor.
|
|
36
|
-
*
|
|
37
|
-
* @param data Data to compress.
|
|
38
|
-
* @returns Decompressed operation in JSON format.
|
|
39
|
-
*/
|
|
40
|
-
protected abstract _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
41
|
-
/**
|
|
42
|
-
* Combine next operation into the combined one.
|
|
43
|
-
*
|
|
44
|
-
* @param nextOperation Operation to combine in JSON format.
|
|
45
|
-
* @param combined Combined operation in JSON format.
|
|
46
|
-
* @returns Combined operation in JSON format.
|
|
47
|
-
*/
|
|
48
|
-
protected abstract _combineNext(nextOperation: any, combined: any): any;
|
|
49
|
-
/**
|
|
50
|
-
* Split operation from combined one.
|
|
51
|
-
*
|
|
52
|
-
* @param combined Combined operation in JSON format.
|
|
53
|
-
* @returns Split operation in JSON format.
|
|
54
|
-
*/
|
|
55
|
-
protected abstract _splitCurrent(combined: any): any;
|
|
56
|
-
/**
|
|
57
|
-
* Checks if two operations can be combined.
|
|
58
|
-
*/
|
|
59
|
-
protected abstract _compareOperations(opA: any, opB: any): boolean;
|
|
60
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import type { CompressedOperationsData, default as Compressor } from '../compressor';
|
|
6
|
+
/**
|
|
7
|
+
* * Compresses and decompresses multiple operations into the one buffer.
|
|
8
|
+
*/
|
|
9
|
+
export default abstract class ActionCompressor {
|
|
10
|
+
constructor(id: number, context: Compressor);
|
|
11
|
+
/**
|
|
12
|
+
* Combines and compress operations from the list.
|
|
13
|
+
* Operations are consumed as long as match this compressor.
|
|
14
|
+
*
|
|
15
|
+
* @param result Object to which compression result should be added.
|
|
16
|
+
* @param operations List of operations in JSON format to compress.
|
|
17
|
+
* @returns `true` when operation is consumed `false` otherwise.
|
|
18
|
+
*/
|
|
19
|
+
compress(result: CompressedOperationsData, operations: Array<any>): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Decompress and split compressed operations. Decompressed operations are consumed (removed from the input data).
|
|
22
|
+
*
|
|
23
|
+
* @param result Decompressed operations in JSON format.
|
|
24
|
+
* @param data Compressed operations data.
|
|
25
|
+
*/
|
|
26
|
+
decompress(result: Array<any>, data: CompressedOperationsData): void;
|
|
27
|
+
/**
|
|
28
|
+
* Compresses single operation using a proper compressor.
|
|
29
|
+
*
|
|
30
|
+
* @param operation Operation in JSON format.
|
|
31
|
+
* @returns Operation JSON compressed to the binary format.
|
|
32
|
+
*/
|
|
33
|
+
protected abstract _compressSingleOperation(operation: any): Uint8Array;
|
|
34
|
+
/**
|
|
35
|
+
* Decompresses combined operation using a proper compressor.
|
|
36
|
+
*
|
|
37
|
+
* @param data Data to compress.
|
|
38
|
+
* @returns Decompressed operation in JSON format.
|
|
39
|
+
*/
|
|
40
|
+
protected abstract _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
41
|
+
/**
|
|
42
|
+
* Combine next operation into the combined one.
|
|
43
|
+
*
|
|
44
|
+
* @param nextOperation Operation to combine in JSON format.
|
|
45
|
+
* @param combined Combined operation in JSON format.
|
|
46
|
+
* @returns Combined operation in JSON format.
|
|
47
|
+
*/
|
|
48
|
+
protected abstract _combineNext(nextOperation: any, combined: any): any;
|
|
49
|
+
/**
|
|
50
|
+
* Split operation from combined one.
|
|
51
|
+
*
|
|
52
|
+
* @param combined Combined operation in JSON format.
|
|
53
|
+
* @returns Split operation in JSON format.
|
|
54
|
+
*/
|
|
55
|
+
protected abstract _splitCurrent(combined: any): any;
|
|
56
|
+
/**
|
|
57
|
+
* Checks if two operations can be combined.
|
|
58
|
+
*/
|
|
59
|
+
protected abstract _compareOperations(opA: any, opB: any): boolean;
|
|
60
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5950=['push','types','shift','_id','compress','_combineNext','_compareOperations','_splitCurrent','_compressSingleOperation','decompress','length','_decompressSingleOperation','buffers','_context'];(function(_0x58f15c,_0x595059){const _0x31b023=function(_0x2376f2){while(--_0x2376f2){_0x58f15c['push'](_0x58f15c['shift']());}};_0x31b023(++_0x595059);}(_0x5950,0x1d9));const _0x31b0=function(_0x58f15c,_0x595059){_0x58f15c=_0x58f15c-0x0;let _0x31b023=_0x5950[_0x58f15c];return _0x31b023;};import{cloneDeep as _0x3bfe87}from'lodash-es';export default class b{constructor(_0x11ca35,_0x1f6e20){this[_0x31b0('0x6')]=_0x11ca35,this[_0x31b0('0x2')]=_0x1f6e20;}[_0x31b0('0x7')](_0x49ee6a,_0x8e103d){let _0x55ae6f;for(;_0x8e103d[_0x31b0('0xd')]>0x1&&this[_0x31b0('0x9')](_0x8e103d[0x0],_0x8e103d[0x1]);)_0x55ae6f?(_0x55ae6f=this[_0x31b0('0x8')](_0x8e103d[_0x31b0('0x5')](),_0x55ae6f),_0x49ee6a['types'][_0x31b0('0x3')](0x0)):(_0x55ae6f=_0x3bfe87(_0x8e103d['shift']()),_0x49ee6a['types'][_0x31b0('0x3')](this[_0x31b0('0x6')]));return!!_0x55ae6f&&(_0x55ae6f=this[_0x31b0('0x8')](_0x8e103d[_0x31b0('0x5')](),_0x55ae6f),_0x49ee6a[_0x31b0('0x4')][_0x31b0('0x3')](0x0),_0x49ee6a[_0x31b0('0x1')][_0x31b0('0x3')](this[_0x31b0('0xb')](_0x55ae6f)),!0x0);}[_0x31b0('0xc')](_0x3beb1f,_0x54db08){const _0xc5d46d=this[_0x31b0('0x0')](_0x54db08);for(;0x0==_0x54db08[_0x31b0('0x4')][0x0];)_0x54db08['types'][_0x31b0('0x5')](),_0x3beb1f['push'](this[_0x31b0('0xa')](_0xc5d46d));_0x3beb1f[_0x31b0('0x3')](_0xc5d46d);}}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
import ActionCompressor from './actioncompressor';
|
|
6
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
7
|
-
export default class DeletingActionCompressor extends ActionCompressor {
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
protected _combineNext(nextOperation: any, combined: any): any;
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
protected _splitCurrent(combined: any): any;
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
protected _compareOperations(opA: any, opB: any): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
28
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import ActionCompressor from './actioncompressor';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
7
|
+
export default class DeletingActionCompressor extends ActionCompressor {
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
protected _combineNext(nextOperation: any, combined: any): any;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
protected _splitCurrent(combined: any): any;
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
protected _compareOperations(opA: any, opB: any): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
28
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x240d=['_compressSingleOperation','$graveyard','_context','_combineNext','targetPosition','_decompressSingleOperation','compress','_checkOperation','_compareOperations','sourcePosition','decompress','howMany','wasUndone','MoveOperation','_splitCurrent'];(function(_0xccd6f9,_0x240d37){const _0xec4a1=function(_0x6e0b1d){while(--_0x6e0b1d){_0xccd6f9['push'](_0xccd6f9['shift']());}};_0xec4a1(++_0x240d37);}(_0x240d,0x99));const _0xec4a=function(_0xccd6f9,_0x240d37){_0xccd6f9=_0xccd6f9-0x0;let _0xec4a1=_0x240d[_0xccd6f9];return _0xec4a1;};import _0x25d2bd from'./actioncompressor';import{arePositionsEqual as _0x3f76ad,getPositionShiftedBy as _0x330ac7}from'../utils';import{cloneDeep as _0x324d8b}from'lodash-es';export default class c extends _0x25d2bd{[_0xec4a('0x0')](_0x9a3ae5,_0xcf80cb){return _0xcf80cb[_0xec4a('0x8')]++,_0xcf80cb['sourcePosition']=_0x324d8b(_0x9a3ae5[_0xec4a('0x6')]),_0xcf80cb;}[_0xec4a('0xb')](_0x528fc1){const _0x261abf=_0x324d8b(_0x528fc1);return _0x528fc1[_0xec4a('0x8')]--,_0x261abf[_0xec4a('0x8')]=0x1,_0x261abf[_0xec4a('0x6')]=_0x330ac7(_0x261abf[_0xec4a('0x6')],_0x528fc1[_0xec4a('0x8')]),_0x261abf;}[_0xec4a('0x5')](_0x248bc4,_0x5f353d){return!(!this[_0xec4a('0x4')](_0x248bc4)||!this[_0xec4a('0x4')](_0x5f353d))&&(_0x3f76ad(_0x330ac7(_0x248bc4[_0xec4a('0x6')],-0x1),_0x5f353d[_0xec4a('0x6')])&&_0x3f76ad(_0x248bc4[_0xec4a('0x1')],_0x5f353d['targetPosition']));}[_0xec4a('0xc')](_0x5910cd){const _0x372740={'types':[],'buffers':[],'baseVersion':0x0};return this['_context']['_getCompressorByName']('MoveOperation')[_0xec4a('0x3')](_0x372740,[_0x5910cd]),_0x372740['buffers'][0x0];}[_0xec4a('0x2')](_0x699313){const _0x210f72=[];return this[_0xec4a('0xe')]['_getCompressorByName'](_0xec4a('0xa'))[_0xec4a('0x7')](_0x210f72,_0x699313),_0x210f72[0x0];}[_0xec4a('0x4')](_0x4ce6f1){return'MoveOperation'==_0x4ce6f1['__className']&&_0xec4a('0xd')==_0x4ce6f1[_0xec4a('0x1')]['root']&&0x1==_0x4ce6f1[_0xec4a('0x8')]&&!_0x4ce6f1[_0xec4a('0x9')];}}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
import ActionCompressor from './actioncompressor';
|
|
6
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
7
|
-
export default class ForwardDeletingActionCompressor extends ActionCompressor {
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
protected _combineNext(nextOperation: any, combined: any): any;
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
protected _splitCurrent(combined: any): any;
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
protected _compareOperations(opA: any, opB: any): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
28
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import ActionCompressor from './actioncompressor';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
7
|
+
export default class ForwardDeletingActionCompressor extends ActionCompressor {
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
protected _combineNext(nextOperation: any, combined: any): any;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
protected _splitCurrent(combined: any): any;
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
protected _compareOperations(opA: any, opB: any): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
28
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5909=['decompress','_combineNext','buffers','_compareOperations','_getCompressorByName','targetPosition','wasUndone','root','compress','_splitCurrent','__className','_checkOperation','sourcePosition','howMany','MoveOperation'];(function(_0x25e87d,_0x590979){const _0x530365=function(_0xd3592f){while(--_0xd3592f){_0x25e87d['push'](_0x25e87d['shift']());}};_0x530365(++_0x590979);}(_0x5909,0x103));const _0x5303=function(_0x25e87d,_0x590979){_0x25e87d=_0x25e87d-0x0;let _0x530365=_0x5909[_0x25e87d];return _0x530365;};import _0x32cf48 from'./actioncompressor';import{arePositionsEqual as _0x18f681}from'../utils';import{cloneDeep as _0x51adb5}from'lodash-es';export default class h extends _0x32cf48{[_0x5303('0xc')](_0x30b76b,_0x191207){return _0x191207[_0x5303('0x9')]++,_0x191207;}[_0x5303('0x5')](_0x407ba5){const _0x192769=_0x51adb5(_0x407ba5);return _0x192769[_0x5303('0x9')]=0x1,_0x407ba5[_0x5303('0x9')]--,_0x192769;}[_0x5303('0xe')](_0x5347f6,_0xba1239){return!(!this[_0x5303('0x7')](_0x5347f6)||!this[_0x5303('0x7')](_0xba1239))&&(_0x18f681(_0x5347f6[_0x5303('0x8')],_0xba1239['sourcePosition'])&&_0x18f681(_0x5347f6['targetPosition'],_0xba1239[_0x5303('0x1')]));}['_compressSingleOperation'](_0x1648e2){const _0x39f9c2={'types':[],'buffers':[],'baseVersion':0x0};return this['_context'][_0x5303('0x0')](_0x5303('0xa'))[_0x5303('0x4')](_0x39f9c2,[_0x1648e2]),_0x39f9c2[_0x5303('0xd')][0x0];}['_decompressSingleOperation'](_0x19c499){const _0x1f9aeb=[];return this['_context']['_getCompressorByName'](_0x5303('0xa'))[_0x5303('0xb')](_0x1f9aeb,_0x19c499),_0x1f9aeb[0x0];}[_0x5303('0x7')](_0x272424){return _0x5303('0xa')==_0x272424[_0x5303('0x6')]&&'$graveyard'==_0x272424[_0x5303('0x1')][_0x5303('0x3')]&&0x1==_0x272424[_0x5303('0x9')]&&!_0x272424[_0x5303('0x2')];}}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
import ActionCompressor from './actioncompressor';
|
|
6
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
7
|
-
export default class TypingActionCompressor extends ActionCompressor {
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDocs
|
|
10
|
-
*/
|
|
11
|
-
protected _combineNext(nextOperation: any, combined: any): any;
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
protected _splitCurrent(combined: any): any;
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
protected _compareOperations(opA: any, opB: any): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
28
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import ActionCompressor from './actioncompressor';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
7
|
+
export default class TypingActionCompressor extends ActionCompressor {
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDocs
|
|
10
|
+
*/
|
|
11
|
+
protected _combineNext(nextOperation: any, combined: any): any;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
protected _splitCurrent(combined: any): any;
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
protected _compareOperations(opA: any, opB: any): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
protected _compressSingleOperation(operation: any): Uint8Array;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
protected _decompressSingleOperation(data: CompressedOperationsData): any;
|
|
28
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x423d=['iterator','_context','nodes','buffers','attributes','position','_splitCurrent','next','keys','wasUndone','_getCompressorByName','from','InsertOperation','length','data','_compareAttributes','__className','decompress','every','compress','_checkOperation','value','_decompressSingleOperation','_combineNext'];(function(_0x1d95a1,_0x423d46){const _0x54e90d=function(_0xec9b88){while(--_0xec9b88){_0x1d95a1['push'](_0x1d95a1['shift']());}};_0x54e90d(++_0x423d46);}(_0x423d,0xe0));const _0x54e9=function(_0x1d95a1,_0x423d46){_0x1d95a1=_0x1d95a1-0x0;let _0x54e90d=_0x423d[_0x1d95a1];return _0x54e90d;};import _0x53423a from'./actioncompressor';import{arePositionsEqual as _0xea0d8b,getPositionShiftedBy as _0xc1574}from'../utils';import{cloneDeep as _0x3a81c3}from'lodash-es';export default class m extends _0x53423a{[_0x54e9('0xf')](_0xfe6c63,_0x1fcd97){return _0x1fcd97[_0x54e9('0x12')][0x0][_0x54e9('0x6')]+=_0xfe6c63[_0x54e9('0x12')][0x0]['data'],_0x1fcd97;}[_0x54e9('0x16')](_0x45988e){const _0x1abb77=_0x3a81c3(_0x45988e),_0x14df66=_0x1abb77[_0x54e9('0x12')][0x0],_0x54b818=_0x45988e[_0x54e9('0x12')][0x0],_0x59c737=_0x54b818[_0x54e9('0x6')][Symbol[_0x54e9('0x10')]]()[_0x54e9('0x17')]()[_0x54e9('0xd')],_0x456541=_0x59c737[_0x54e9('0x5')];return _0x14df66['data']=_0x59c737,_0x54b818[_0x54e9('0x6')]=_0x54b818[_0x54e9('0x6')]['substr'](_0x456541),_0x45988e[_0x54e9('0x15')]=_0xc1574(_0x45988e['position'],_0x456541),_0x1abb77;}['_compareOperations'](_0x316c0f,_0x30d4d2){if(this[_0x54e9('0xc')](_0x316c0f)&&this[_0x54e9('0xc')](_0x30d4d2)){const _0x49f030=_0x316c0f[_0x54e9('0x12')][0x0][_0x54e9('0x6')][_0x54e9('0x5')],_0x1bf95c=_0xea0d8b(_0xc1574(_0x316c0f['position'],_0x49f030),_0x30d4d2[_0x54e9('0x15')]),_0x23954e=_0x316c0f[_0x54e9('0x12')][0x0],_0x7d6181=_0x30d4d2[_0x54e9('0x12')][0x0];return _0x1bf95c&&this[_0x54e9('0x7')](_0x23954e,_0x7d6181);}return!0x1;}['_compressSingleOperation'](_0x26f888){const _0x23da8e={'types':[],'buffers':[],'baseVersion':0x0};return this['_context'][_0x54e9('0x2')](_0x54e9('0x4'))[_0x54e9('0xb')](_0x23da8e,[_0x26f888]),_0x23da8e[_0x54e9('0x13')][0x0];}[_0x54e9('0xe')](_0x29d8c0){const _0x504b95=[];return this[_0x54e9('0x11')]['_getCompressorByName'](_0x54e9('0x4'))[_0x54e9('0x9')](_0x504b95,_0x29d8c0),_0x504b95[0x0];}[_0x54e9('0xc')](_0x46004d){return'InsertOperation'==_0x46004d[_0x54e9('0x8')]&&0x1==_0x46004d[_0x54e9('0x12')][_0x54e9('0x5')]&&_0x46004d['nodes'][0x0][_0x54e9('0x6')]&&!_0x46004d[_0x54e9('0x1')]&&0x1==Array[_0x54e9('0x3')](_0x46004d[_0x54e9('0x12')][0x0][_0x54e9('0x6')])[_0x54e9('0x5')];}[_0x54e9('0x7')](_0x30d0de,_0x3a288e){const _0x216081=Object['keys'](_0x30d0de[_0x54e9('0x14')]||{}),_0x2c16e0=Object[_0x54e9('0x0')](_0x3a288e[_0x54e9('0x14')]||{});return _0x216081[_0x54e9('0x5')]===_0x2c16e0[_0x54e9('0x5')]&&_0x216081[_0x54e9('0xa')](_0x1d14ae=>_0x3a288e[_0x54e9('0x14')][_0x1d14ae]&&_0x3a288e[_0x54e9('0x14')][_0x1d14ae]===_0x30d0de[_0x54e9('0x14')][_0x1d14ae]);}}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
import ActionCompressor from './actioncompressor';
|
|
6
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
7
|
-
export default class UserSelectionActionCompressor extends ActionCompressor {
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
compress(result: CompressedOperationsData, operations: Array<any>): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
decompress(result: Array<any>, data: CompressedOperationsData): void;
|
|
16
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import ActionCompressor from './actioncompressor';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
7
|
+
export default class UserSelectionActionCompressor extends ActionCompressor {
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
compress(result: CompressedOperationsData, operations: Array<any>): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
decompress(result: Array<any>, data: CompressedOperationsData): void;
|
|
16
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1e25=['_getCompressorByName','name','MarkerOperation','start','startsWith','split','toNone','_compareOperations','shift','push','user:position:','buffers','stickiness','newRange','end','_compressSingleOperation','__className','_decompressSingleOperation','_context','decompress','user:','types'];(function(_0x348391,_0x1e25d0){const _0x4cdf22=function(_0x5d9122){while(--_0x5d9122){_0x348391['push'](_0x348391['shift']());}};_0x4cdf22(++_0x1e25d0);}(_0x1e25,0x140));const _0x4cdf=function(_0x348391,_0x1e25d0){_0x348391=_0x348391-0x0;let _0x4cdf22=_0x1e25[_0x348391];return _0x4cdf22;};import _0x2f4236 from'./actioncompressor';import{arePositionsEqual as _0x4b6ad6}from'../utils';import{cloneDeep as _0x1ee79b}from'lodash-es';export default class f extends _0x2f4236{['compress'](_0x47dd71,_0x12e6cb){if(!this[_0x4cdf('0x11')](_0x12e6cb[0x0],_0x12e6cb[0x1]))return!0x1;const _0x586f43=_0x12e6cb[_0x4cdf('0x12')]();return _0x586f43['oldRange']=null,_0x586f43[_0x4cdf('0x1')]&&_0x4b6ad6(_0x586f43['newRange']['start'],_0x586f43[_0x4cdf('0x1')][_0x4cdf('0x2')])&&(_0x586f43[_0x4cdf('0x1')][_0x4cdf('0x2')]=null),_0x12e6cb[_0x4cdf('0x12')](),_0x47dd71[_0x4cdf('0x9')]['push'](this['_id']),_0x47dd71[_0x4cdf('0x9')][_0x4cdf('0x13')](0x0),_0x47dd71['buffers']['push'](this[_0x4cdf('0x3')](_0x586f43)),!0x0;}[_0x4cdf('0x7')](_0x3a38fc,_0x194467){const _0xfe5703=this[_0x4cdf('0x5')](_0x194467);_0xfe5703[_0x4cdf('0x1')]&&!_0xfe5703[_0x4cdf('0x1')][_0x4cdf('0x2')]&&(_0xfe5703['newRange'][_0x4cdf('0x2')]=_0x1ee79b(_0xfe5703[_0x4cdf('0x1')][_0x4cdf('0xd')]));const _0x24c47f=_0x1ee79b(_0xfe5703);_0x24c47f[_0x4cdf('0x1')]&&(_0x24c47f[_0x4cdf('0x1')][_0x4cdf('0xd')][_0x4cdf('0x0')]=_0x4cdf('0x10'),_0x24c47f[_0x4cdf('0x1')][_0x4cdf('0x2')]=_0x1ee79b(_0x24c47f[_0x4cdf('0x1')][_0x4cdf('0xd')])),_0x24c47f[_0x4cdf('0xb')]=_0x4cdf('0x14')+_0x24c47f[_0x4cdf('0xb')][_0x4cdf('0xf')](':')[0x2],_0x194467['types'][_0x4cdf('0x12')](),_0x3a38fc['push'](_0xfe5703),_0x3a38fc[_0x4cdf('0x13')](_0x24c47f);}[_0x4cdf('0x3')](_0x16c330){const _0x45c440={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x4cdf('0x6')]['_getCompressorByName'](_0x4cdf('0xc'))['compress'](_0x45c440,[_0x16c330]),_0x45c440[_0x4cdf('0x15')][0x0];}[_0x4cdf('0x5')](_0xccdf66){const _0x2d52ec=[];return this['_context'][_0x4cdf('0xa')](_0x4cdf('0xc'))['decompress'](_0x2d52ec,_0xccdf66),_0x2d52ec[0x0];}['_compareOperations'](_0x418445,_0x20a43a){return!(!_0x418445||!_0x20a43a)&&('MarkerOperation'==_0x418445[_0x4cdf('0x4')]&&_0x4cdf('0xc')==_0x20a43a[_0x4cdf('0x4')]&&!(!_0x418445[_0x4cdf('0xb')]['startsWith']('user:')||!_0x20a43a[_0x4cdf('0xb')][_0x4cdf('0xe')](_0x4cdf('0x8'))||_0x418445[_0x4cdf('0xb')]==_0x20a43a[_0x4cdf('0xb')]));}}
|
package/src/compressor.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Compresses and decompresses given set of operations in JSON format to/from the binary format using `Protocol Buffers`.
|
|
7
|
-
*/
|
|
8
|
-
export default class Compressor {
|
|
9
|
-
constructor();
|
|
10
|
-
/**
|
|
11
|
-
* Compress given list of operations in JSON format.
|
|
12
|
-
*
|
|
13
|
-
* **Note** It tries to combine typing-like or deleting-like operations into the one buffer.
|
|
14
|
-
* **Note** Input data will be consumed and modified during compression process. If you need untouched data
|
|
15
|
-
* you need to copy it before the compression.
|
|
16
|
-
*/
|
|
17
|
-
compress(operations: Array<any>): CompressedOperationsData;
|
|
18
|
-
/**
|
|
19
|
-
* Decompress given data to the list of operations in JSON format.
|
|
20
|
-
*
|
|
21
|
-
* **Note** Input data will be consumed during decompression process. If you need untouched data
|
|
22
|
-
* you need to copy it before the decompression.
|
|
23
|
-
*
|
|
24
|
-
* @param data Compressed operations.
|
|
25
|
-
* @returns List of operations in JSON format.
|
|
26
|
-
*/
|
|
27
|
-
decompress(data: CompressedOperationsData): Array<any>;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Compressed operations data.
|
|
31
|
-
*/
|
|
32
|
-
export type CompressedOperationsData = {
|
|
33
|
-
/**
|
|
34
|
-
* List of operations compressed to the binary format.
|
|
35
|
-
*/
|
|
36
|
-
buffers: Array<Uint8Array>;
|
|
37
|
-
/**
|
|
38
|
-
* List of compressor identifiers. According to this types a proper compressor will be used for the decompression.
|
|
39
|
-
*/
|
|
40
|
-
types: Array<number>;
|
|
41
|
-
/**
|
|
42
|
-
* Base version of the first compressed operation.
|
|
43
|
-
*/
|
|
44
|
-
baseVersion: number;
|
|
45
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Compresses and decompresses given set of operations in JSON format to/from the binary format using `Protocol Buffers`.
|
|
7
|
+
*/
|
|
8
|
+
export default class Compressor {
|
|
9
|
+
constructor();
|
|
10
|
+
/**
|
|
11
|
+
* Compress given list of operations in JSON format.
|
|
12
|
+
*
|
|
13
|
+
* **Note** It tries to combine typing-like or deleting-like operations into the one buffer.
|
|
14
|
+
* **Note** Input data will be consumed and modified during compression process. If you need untouched data
|
|
15
|
+
* you need to copy it before the compression.
|
|
16
|
+
*/
|
|
17
|
+
compress(operations: Array<any>): CompressedOperationsData;
|
|
18
|
+
/**
|
|
19
|
+
* Decompress given data to the list of operations in JSON format.
|
|
20
|
+
*
|
|
21
|
+
* **Note** Input data will be consumed during decompression process. If you need untouched data
|
|
22
|
+
* you need to copy it before the decompression.
|
|
23
|
+
*
|
|
24
|
+
* @param data Compressed operations.
|
|
25
|
+
* @returns List of operations in JSON format.
|
|
26
|
+
*/
|
|
27
|
+
decompress(data: CompressedOperationsData): Array<any>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Compressed operations data.
|
|
31
|
+
*/
|
|
32
|
+
export type CompressedOperationsData = {
|
|
33
|
+
/**
|
|
34
|
+
* List of operations compressed to the binary format.
|
|
35
|
+
*/
|
|
36
|
+
buffers: Array<Uint8Array>;
|
|
37
|
+
/**
|
|
38
|
+
* List of compressor identifiers. According to this types a proper compressor will be used for the decompression.
|
|
39
|
+
*/
|
|
40
|
+
types: Array<number>;
|
|
41
|
+
/**
|
|
42
|
+
* Base version of the first compressed operation.
|
|
43
|
+
*/
|
|
44
|
+
baseVersion: number;
|
|
45
|
+
};
|