@ckeditor/ckeditor5-operations-compressor 38.1.0 → 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.
Files changed (32) hide show
  1. package/package.json +2 -2
  2. package/src/actioncompressor/actioncompressor.d.ts +56 -56
  3. package/src/actioncompressor/actioncompressor.js +1 -1
  4. package/src/actioncompressor/deletingactioncompressor.d.ts +24 -24
  5. package/src/actioncompressor/deletingactioncompressor.js +1 -1
  6. package/src/actioncompressor/forwarddeletingactioncompressor.d.ts +24 -24
  7. package/src/actioncompressor/forwarddeletingactioncompressor.js +1 -1
  8. package/src/actioncompressor/typingactioncompressor.d.ts +24 -24
  9. package/src/actioncompressor/typingactioncompressor.js +1 -1
  10. package/src/actioncompressor/userselectionactioncompressor.d.ts +12 -12
  11. package/src/actioncompressor/userselectionactioncompressor.js +1 -1
  12. package/src/compressor.d.ts +41 -41
  13. package/src/compressor.js +1 -1
  14. package/src/lib/compiledmessages.js +1 -1
  15. package/src/operationcompressor/annotationmarkeroperationcompressor.d.ts +18 -18
  16. package/src/operationcompressor/annotationmarkeroperationcompressor.js +1 -1
  17. package/src/operationcompressor/attributeoperationcompressor.d.ts +13 -13
  18. package/src/operationcompressor/attributeoperationcompressor.js +1 -1
  19. package/src/operationcompressor/insertoperationcompressor.d.ts +13 -13
  20. package/src/operationcompressor/insertoperationcompressor.js +1 -1
  21. package/src/operationcompressor/markeroperationcompressor.d.ts +9 -9
  22. package/src/operationcompressor/markeroperationcompressor.js +1 -1
  23. package/src/operationcompressor/nooperationcompressor.d.ts +16 -16
  24. package/src/operationcompressor/nooperationcompressor.js +1 -1
  25. package/src/operationcompressor/operationcompressor.d.ts +24 -24
  26. package/src/operationcompressor/operationcompressor.js +1 -1
  27. package/src/protobufdescriptions.d.ts +12 -12
  28. package/src/protobufdescriptions.js +1 -1
  29. package/src/protobuffactory.d.ts +1 -1
  30. package/src/protobuffactory.js +1 -1
  31. package/src/utils.d.ts +26 -26
  32. 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.1.0",
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/",
@@ -30,7 +30,7 @@
30
30
  "url": "https://support.ckeditor.com/hc/en-us/requests/new"
31
31
  },
32
32
  "dependencies": {
33
- "ckeditor5": "38.1.0",
33
+ "ckeditor5": "38.1.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';
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 _0x25e4=['compress','_compressSingleOperation','_combineNext','_context','_id','_splitCurrent','buffers','types','_compareOperations','shift','push'];(function(_0x5dff2e,_0x25e4dc){const _0x464a1c=function(_0x1f0ed8){while(--_0x1f0ed8){_0x5dff2e['push'](_0x5dff2e['shift']());}};_0x464a1c(++_0x25e4dc);}(_0x25e4,0x7c));const _0x464a=function(_0x5dff2e,_0x25e4dc){_0x5dff2e=_0x5dff2e-0x0;let _0x464a1c=_0x25e4[_0x5dff2e];return _0x464a1c;};import{cloneDeep as _0x253bd8}from'lodash-es';export default class b{constructor(_0x551644,_0x521170){this[_0x464a('0x1')]=_0x551644,this[_0x464a('0x0')]=_0x521170;}[_0x464a('0x8')](_0x399e2f,_0x7d321f){let _0x50b17d;for(;_0x7d321f['length']>0x1&&this[_0x464a('0x5')](_0x7d321f[0x0],_0x7d321f[0x1]);)_0x50b17d?(_0x50b17d=this[_0x464a('0xa')](_0x7d321f[_0x464a('0x6')](),_0x50b17d),_0x399e2f[_0x464a('0x4')][_0x464a('0x7')](0x0)):(_0x50b17d=_0x253bd8(_0x7d321f[_0x464a('0x6')]()),_0x399e2f['types'][_0x464a('0x7')](this[_0x464a('0x1')]));return!!_0x50b17d&&(_0x50b17d=this[_0x464a('0xa')](_0x7d321f['shift'](),_0x50b17d),_0x399e2f[_0x464a('0x4')][_0x464a('0x7')](0x0),_0x399e2f[_0x464a('0x3')][_0x464a('0x7')](this[_0x464a('0x9')](_0x50b17d)),!0x0);}['decompress'](_0x12733d,_0x14d5a1){const _0xbcf4e1=this['_decompressSingleOperation'](_0x14d5a1);for(;0x0==_0x14d5a1['types'][0x0];)_0x14d5a1['types'][_0x464a('0x6')](),_0x12733d['push'](this[_0x464a('0x2')](_0xbcf4e1));_0x12733d[_0x464a('0x7')](_0xbcf4e1);}}
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 _0x47e7=['$graveyard','decompress','__className','_combineNext','MoveOperation','_splitCurrent','_checkOperation','howMany','sourcePosition','_getCompressorByName','_context','_compareOperations','targetPosition'];(function(_0x4b839e,_0x47e7ca){const _0x4baedb=function(_0x3c7cef){while(--_0x3c7cef){_0x4b839e['push'](_0x4b839e['shift']());}};_0x4baedb(++_0x47e7ca);}(_0x47e7,0x1a1));const _0x4bae=function(_0x4b839e,_0x47e7ca){_0x4b839e=_0x4b839e-0x0;let _0x4baedb=_0x47e7[_0x4b839e];return _0x4baedb;};import _0x3a339a from'./actioncompressor';import{arePositionsEqual as _0x34f006,getPositionShiftedBy as _0x52d25f}from'../utils';import{cloneDeep as _0xeb3a58}from'lodash-es';export default class c extends _0x3a339a{[_0x4bae('0x2')](_0x131fae,_0x519a74){return _0x519a74[_0x4bae('0x6')]++,_0x519a74[_0x4bae('0x7')]=_0xeb3a58(_0x131fae[_0x4bae('0x7')]),_0x519a74;}[_0x4bae('0x4')](_0x3e0b50){const _0x2e8de7=_0xeb3a58(_0x3e0b50);return _0x3e0b50[_0x4bae('0x6')]--,_0x2e8de7[_0x4bae('0x6')]=0x1,_0x2e8de7[_0x4bae('0x7')]=_0x52d25f(_0x2e8de7[_0x4bae('0x7')],_0x3e0b50[_0x4bae('0x6')]),_0x2e8de7;}[_0x4bae('0xa')](_0x346255,_0x47b4c2){return!(!this[_0x4bae('0x5')](_0x346255)||!this[_0x4bae('0x5')](_0x47b4c2))&&(_0x34f006(_0x52d25f(_0x346255[_0x4bae('0x7')],-0x1),_0x47b4c2[_0x4bae('0x7')])&&_0x34f006(_0x346255['targetPosition'],_0x47b4c2[_0x4bae('0xb')]));}['_compressSingleOperation'](_0x50aec2){const _0x286603={'types':[],'buffers':[],'baseVersion':0x0};return this['_context'][_0x4bae('0x8')]('MoveOperation')['compress'](_0x286603,[_0x50aec2]),_0x286603['buffers'][0x0];}['_decompressSingleOperation'](_0x5c0d69){const _0x334d33=[];return this[_0x4bae('0x9')][_0x4bae('0x8')](_0x4bae('0x3'))[_0x4bae('0x0')](_0x334d33,_0x5c0d69),_0x334d33[0x0];}[_0x4bae('0x5')](_0x245869){return _0x4bae('0x3')==_0x245869[_0x4bae('0x1')]&&_0x4bae('0xc')==_0x245869['targetPosition']['root']&&0x1==_0x245869[_0x4bae('0x6')]&&!_0x245869['wasUndone'];}}
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 _0x4464=['targetPosition','MoveOperation','_compressSingleOperation','_context','__className','_getCompressorByName','_compareOperations','_combineNext','howMany','$graveyard','_checkOperation','compress','decompress','sourcePosition','_splitCurrent'];(function(_0x4d8515,_0x44647a){const _0x5ee7c2=function(_0x247aa4){while(--_0x247aa4){_0x4d8515['push'](_0x4d8515['shift']());}};_0x5ee7c2(++_0x44647a);}(_0x4464,0x1a9));const _0x5ee7=function(_0x4d8515,_0x44647a){_0x4d8515=_0x4d8515-0x0;let _0x5ee7c2=_0x4464[_0x4d8515];return _0x5ee7c2;};import _0x118194 from'./actioncompressor';import{arePositionsEqual as _0x2b741e}from'../utils';import{cloneDeep as _0x1b2571}from'lodash-es';export default class h extends _0x118194{[_0x5ee7('0x2')](_0x2978cc,_0x48868d){return _0x48868d[_0x5ee7('0x3')]++,_0x48868d;}[_0x5ee7('0x9')](_0x37416e){const _0x49bd5b=_0x1b2571(_0x37416e);return _0x49bd5b[_0x5ee7('0x3')]=0x1,_0x37416e[_0x5ee7('0x3')]--,_0x49bd5b;}[_0x5ee7('0x1')](_0x2ca12d,_0x393859){return!(!this[_0x5ee7('0x5')](_0x2ca12d)||!this[_0x5ee7('0x5')](_0x393859))&&(_0x2b741e(_0x2ca12d[_0x5ee7('0x8')],_0x393859['sourcePosition'])&&_0x2b741e(_0x2ca12d['targetPosition'],_0x393859[_0x5ee7('0xa')]));}[_0x5ee7('0xc')](_0x4be10a){const _0x5ade18={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x5ee7('0xd')][_0x5ee7('0x0')]('MoveOperation')[_0x5ee7('0x6')](_0x5ade18,[_0x4be10a]),_0x5ade18['buffers'][0x0];}['_decompressSingleOperation'](_0x1047f2){const _0x447787=[];return this[_0x5ee7('0xd')]['_getCompressorByName'](_0x5ee7('0xb'))[_0x5ee7('0x7')](_0x447787,_0x1047f2),_0x447787[0x0];}[_0x5ee7('0x5')](_0x8c2bca){return _0x5ee7('0xb')==_0x8c2bca[_0x5ee7('0xe')]&&_0x5ee7('0x4')==_0x8c2bca[_0x5ee7('0xa')]['root']&&0x1==_0x8c2bca[_0x5ee7('0x3')]&&!_0x8c2bca['wasUndone'];}}
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 _0x2acc=['iterator','_compareAttributes','from','_getCompressorByName','keys','position','_compareOperations','attributes','wasUndone','__className','length','next','compress','_combineNext','nodes','every','_checkOperation','decompress','data','InsertOperation','_context'];(function(_0x16e866,_0x2acc9d){const _0x29b4ce=function(_0xe45774){while(--_0xe45774){_0x16e866['push'](_0x16e866['shift']());}};_0x29b4ce(++_0x2acc9d);}(_0x2acc,0x69));const _0x29b4=function(_0x16e866,_0x2acc9d){_0x16e866=_0x16e866-0x0;let _0x29b4ce=_0x2acc[_0x16e866];return _0x29b4ce;};import _0x299125 from'./actioncompressor';import{arePositionsEqual as _0x1e9586,getPositionShiftedBy as _0xa7eea0}from'../utils';import{cloneDeep as _0x5130b3}from'lodash-es';export default class m extends _0x299125{[_0x29b4('0xd')](_0x2076c9,_0x89f48c){return _0x89f48c[_0x29b4('0xe')][0x0]['data']+=_0x2076c9['nodes'][0x0][_0x29b4('0x12')],_0x89f48c;}['_splitCurrent'](_0x3bf1cc){const _0x1eaf58=_0x5130b3(_0x3bf1cc),_0x1dae39=_0x1eaf58[_0x29b4('0xe')][0x0],_0x44bb01=_0x3bf1cc[_0x29b4('0xe')][0x0],_0x268c00=_0x44bb01['data'][Symbol[_0x29b4('0x0')]]()[_0x29b4('0xb')]()['value'],_0x3f562f=_0x268c00[_0x29b4('0xa')];return _0x1dae39['data']=_0x268c00,_0x44bb01['data']=_0x44bb01[_0x29b4('0x12')]['substr'](_0x3f562f),_0x3bf1cc['position']=_0xa7eea0(_0x3bf1cc[_0x29b4('0x5')],_0x3f562f),_0x1eaf58;}[_0x29b4('0x6')](_0x15674a,_0x592b00){if(this['_checkOperation'](_0x15674a)&&this[_0x29b4('0x10')](_0x592b00)){const _0x4e01fd=_0x15674a[_0x29b4('0xe')][0x0][_0x29b4('0x12')][_0x29b4('0xa')],_0x2182ba=_0x1e9586(_0xa7eea0(_0x15674a[_0x29b4('0x5')],_0x4e01fd),_0x592b00[_0x29b4('0x5')]),_0x2bcd42=_0x15674a['nodes'][0x0],_0x3be6cc=_0x592b00[_0x29b4('0xe')][0x0];return _0x2182ba&&this['_compareAttributes'](_0x2bcd42,_0x3be6cc);}return!0x1;}['_compressSingleOperation'](_0x5de57a){const _0x1d54bf={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x29b4('0x14')][_0x29b4('0x3')](_0x29b4('0x13'))[_0x29b4('0xc')](_0x1d54bf,[_0x5de57a]),_0x1d54bf['buffers'][0x0];}['_decompressSingleOperation'](_0x4fa7ae){const _0x399b8c=[];return this['_context'][_0x29b4('0x3')](_0x29b4('0x13'))[_0x29b4('0x11')](_0x399b8c,_0x4fa7ae),_0x399b8c[0x0];}[_0x29b4('0x10')](_0x42d8f2){return _0x29b4('0x13')==_0x42d8f2[_0x29b4('0x9')]&&0x1==_0x42d8f2[_0x29b4('0xe')][_0x29b4('0xa')]&&_0x42d8f2['nodes'][0x0][_0x29b4('0x12')]&&!_0x42d8f2[_0x29b4('0x8')]&&0x1==Array[_0x29b4('0x2')](_0x42d8f2['nodes'][0x0][_0x29b4('0x12')])[_0x29b4('0xa')];}[_0x29b4('0x1')](_0x8ef6d7,_0x162bde){const _0x567a89=Object[_0x29b4('0x4')](_0x8ef6d7[_0x29b4('0x7')]||{}),_0x484308=Object[_0x29b4('0x4')](_0x162bde['attributes']||{});return _0x567a89[_0x29b4('0xa')]===_0x484308[_0x29b4('0xa')]&&_0x567a89[_0x29b4('0xf')](_0x1e5884=>_0x162bde['attributes'][_0x1e5884]&&_0x162bde[_0x29b4('0x7')][_0x1e5884]===_0x8ef6d7[_0x29b4('0x7')][_0x1e5884]);}}
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 _0x1963=['oldRange','_id','start','_compareOperations','end','types','MarkerOperation','newRange','shift','buffers','_context','toNone','push','decompress','_decompressSingleOperation','user:position:','_compressSingleOperation','__className','_getCompressorByName','name','compress','startsWith','user:'];(function(_0x56a8d5,_0x1963bd){const _0x540a90=function(_0x567b72){while(--_0x567b72){_0x56a8d5['push'](_0x56a8d5['shift']());}};_0x540a90(++_0x1963bd);}(_0x1963,0x1d0));const _0x540a=function(_0x56a8d5,_0x1963bd){_0x56a8d5=_0x56a8d5-0x0;let _0x540a90=_0x1963[_0x56a8d5];return _0x540a90;};import _0x43f7d6 from'./actioncompressor';import{arePositionsEqual as _0x46667e}from'../utils';import{cloneDeep as _0x3fa8fc}from'lodash-es';export default class f extends _0x43f7d6{['compress'](_0x54e1ee,_0x75dc51){if(!this['_compareOperations'](_0x75dc51[0x0],_0x75dc51[0x1]))return!0x1;const _0x11e245=_0x75dc51[_0x540a('0x4')]();return _0x11e245[_0x540a('0x13')]=null,_0x11e245[_0x540a('0x3')]&&_0x46667e(_0x11e245[_0x540a('0x3')][_0x540a('0x15')],_0x11e245[_0x540a('0x3')]['end'])&&(_0x11e245[_0x540a('0x3')]['end']=null),_0x75dc51[_0x540a('0x4')](),_0x54e1ee['types'][_0x540a('0x8')](this[_0x540a('0x14')]),_0x54e1ee[_0x540a('0x1')][_0x540a('0x8')](0x0),_0x54e1ee[_0x540a('0x5')][_0x540a('0x8')](this['_compressSingleOperation'](_0x11e245)),!0x0;}['decompress'](_0x2509d7,_0xb4b1bd){const _0x4594af=this[_0x540a('0xa')](_0xb4b1bd);_0x4594af[_0x540a('0x3')]&&!_0x4594af[_0x540a('0x3')][_0x540a('0x0')]&&(_0x4594af[_0x540a('0x3')]['end']=_0x3fa8fc(_0x4594af[_0x540a('0x3')][_0x540a('0x15')]));const _0x95cad6=_0x3fa8fc(_0x4594af);_0x95cad6[_0x540a('0x3')]&&(_0x95cad6[_0x540a('0x3')]['start']['stickiness']=_0x540a('0x7'),_0x95cad6[_0x540a('0x3')][_0x540a('0x0')]=_0x3fa8fc(_0x95cad6[_0x540a('0x3')][_0x540a('0x15')])),_0x95cad6['name']=_0x540a('0xb')+_0x95cad6[_0x540a('0xf')]['split'](':')[0x2],_0xb4b1bd[_0x540a('0x1')][_0x540a('0x4')](),_0x2509d7[_0x540a('0x8')](_0x4594af),_0x2509d7[_0x540a('0x8')](_0x95cad6);}[_0x540a('0xc')](_0x4044df){const _0xea984d={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x540a('0x6')][_0x540a('0xe')](_0x540a('0x2'))[_0x540a('0x10')](_0xea984d,[_0x4044df]),_0xea984d[_0x540a('0x5')][0x0];}[_0x540a('0xa')](_0x4559b8){const _0xcd0dd7=[];return this['_context'][_0x540a('0xe')](_0x540a('0x2'))[_0x540a('0x9')](_0xcd0dd7,_0x4559b8),_0xcd0dd7[0x0];}[_0x540a('0x16')](_0x291c0e,_0x347be1){return!(!_0x291c0e||!_0x347be1)&&(_0x540a('0x2')==_0x291c0e[_0x540a('0xd')]&&_0x540a('0x2')==_0x347be1[_0x540a('0xd')]&&!(!_0x291c0e[_0x540a('0xf')][_0x540a('0x11')](_0x540a('0x12'))||!_0x347be1[_0x540a('0xf')]['startsWith'](_0x540a('0x12'))||_0x291c0e[_0x540a('0xf')]==_0x347be1['name']));}}
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')]));}}
@@ -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 _0x53f9=['baseVersion','MarkerOperation','SuggestionMarkerOperation','_registerActionCompressor','_registerOperationCompressor','length','get','comment','TypingAction','set','_compressorById','_registerCompressor','types','AttributeOperation','getDescriptor','decompress','MoveOperation','suggestion','NoOperation','compress','_protobufFactory','_getCompressorByName','no-operations-provided','ForwardDeletingAction','forEach','CommentMarkerOperation','DeletingAction','_compressorByName','RootAttributeOperation','__className','UserSelectionAction','RootOperation'];(function(_0x573fb4,_0x53f9d0){const _0x2e3970=function(_0x313a5b){while(--_0x313a5b){_0x573fb4['push'](_0x573fb4['shift']());}};_0x2e3970(++_0x53f9d0);}(_0x53f9,0x1d2));const _0x2e39=function(_0x573fb4,_0x53f9d0){_0x573fb4=_0x573fb4-0x0;let _0x2e3970=_0x53f9[_0x573fb4];return _0x2e3970;};import{CKEditorError as _0x526a00}from'ckeditor5/src/utils';import _0x264356 from'./protobuffactory';import _0x473b90 from'./operationcompressor/operationcompressor';import _0x315737 from'./operationcompressor/attributeoperationcompressor';import _0x40aed1 from'./operationcompressor/insertoperationcompressor';import _0x44c239 from'./operationcompressor/markeroperationcompressor';import _0x19503c from'./operationcompressor/nooperationcompressor';import _0x47007d from'./operationcompressor/annotationmarkeroperationcompressor';import _0x5697b9 from'./actioncompressor/typingactioncompressor';import _0x572d7d from'./actioncompressor/deletingactioncompressor';import _0xdfe865 from'./actioncompressor/forwarddeletingactioncompressor';import _0x10ecd3 from'./actioncompressor/userselectionactioncompressor';export default class g{constructor(){this[_0x2e39('0x18')]=new Map(),this[_0x2e39('0x9')]=new Map(),this['_protobufFactory']=new _0x264356();const _0x1b9a82=this[_0x2e39('0x2')][_0x2e39('0x1c')](_0x2e39('0xf'));this[_0x2e39('0x19')](0x1,'NoOperation',new _0x19503c(0x1,_0x2e39('0x0'),void 0x0)),this[_0x2e39('0x12')](0xa,_0x2e39('0x1b'),_0x315737),this[_0x2e39('0x12')](0xb,'InsertOperation',_0x40aed1),this['_registerOperationCompressor'](0xc,_0x2e39('0xf'),_0x44c239),this[_0x2e39('0x12')](0xd,'MergeOperation',_0x473b90),this[_0x2e39('0x12')](0xe,_0x2e39('0x1e'),_0x473b90),this[_0x2e39('0x12')](0xf,'RenameOperation',_0x473b90),this[_0x2e39('0x12')](0x10,_0x2e39('0xa'),_0x315737),this[_0x2e39('0x12')](0x11,'SplitOperation',_0x473b90),this[_0x2e39('0x19')](0x12,_0x2e39('0x7'),new _0x47007d(0x12,_0x2e39('0xf'),_0x1b9a82,_0x2e39('0x15'))),this[_0x2e39('0x19')](0x13,_0x2e39('0x10'),new _0x47007d(0x13,_0x2e39('0xf'),_0x1b9a82,_0x2e39('0x1f'))),this[_0x2e39('0x12')](0x14,_0x2e39('0xd'),_0x473b90),this['_registerActionCompressor'](0x64,'TypingAction',_0x5697b9),this['_registerActionCompressor'](0x65,_0x2e39('0x8'),_0x572d7d),this[_0x2e39('0x11')](0x66,_0x2e39('0x5'),_0xdfe865),this[_0x2e39('0x11')](0x67,_0x2e39('0xc'),_0x10ecd3);}['compress'](_0x1a8b8f){if(!_0x1a8b8f||!_0x1a8b8f[0x0])throw new _0x526a00(_0x2e39('0x4'),this);const _0x2204f9={'types':[],'buffers':[],'baseVersion':_0x1a8b8f[0x0][_0x2e39('0xe')]};for(;_0x1a8b8f[_0x2e39('0x13')];)this['_getCompressorByName'](_0x2e39('0xc'))[_0x2e39('0x1')](_0x2204f9,_0x1a8b8f)||this[_0x2e39('0x3')](_0x2e39('0x16'))['compress'](_0x2204f9,_0x1a8b8f)||this['_getCompressorByName']('DeletingAction')['compress'](_0x2204f9,_0x1a8b8f)||this['_getCompressorByName']('ForwardDeletingAction')['compress'](_0x2204f9,_0x1a8b8f)||this['_getCompressorByName'](_0x2e39('0x7'))['compress'](_0x2204f9,_0x1a8b8f)||this[_0x2e39('0x3')](_0x2e39('0x10'))[_0x2e39('0x1')](_0x2204f9,_0x1a8b8f)||this[_0x2e39('0x3')](_0x1a8b8f[0x0][_0x2e39('0xb')])[_0x2e39('0x1')](_0x2204f9,_0x1a8b8f);return _0x2204f9;}[_0x2e39('0x1d')](_0x3edc29){const _0x278bab=[];for(;_0x3edc29[_0x2e39('0x1a')]['length'];){this['_compressorById'][_0x2e39('0x14')](_0x3edc29['types'][0x0])[_0x2e39('0x1d')](_0x278bab,_0x3edc29);}return _0x278bab[_0x2e39('0x6')]((_0x9184f2,_0x26b123)=>_0x9184f2['baseVersion']=_0x3edc29[_0x2e39('0xe')]+_0x26b123),_0x278bab;}[_0x2e39('0x3')](_0x536e59){return this[_0x2e39('0x9')][_0x2e39('0x14')](_0x536e59);}['_registerOperationCompressor'](_0x1bf6ca,_0x243d81,_0x18962e){const _0x274f8e=new _0x18962e(_0x1bf6ca,_0x243d81,this['_protobufFactory'][_0x2e39('0x1c')](_0x243d81));this[_0x2e39('0x19')](_0x1bf6ca,_0x243d81,_0x274f8e);}[_0x2e39('0x11')](_0x5c2e86,_0x3f534e,_0x3c7a16){const _0x1c77bd=new _0x3c7a16(_0x5c2e86,this);this['_registerCompressor'](_0x5c2e86,_0x3f534e,_0x1c77bd);}[_0x2e39('0x19')](_0x58e620,_0x5ace00,_0x4795eb){this['_compressorById'][_0x2e39('0x17')](_0x58e620,_0x4795eb),this[_0x2e39('0x9')][_0x2e39('0x17')](_0x5ace00,_0x4795eb);}}
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);}}