@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.
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.1",
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.1.1",
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 _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);}}
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 _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')];}}
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 _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')];}}
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 _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]);}}
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 _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')]));}}
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')]));}}
@@ -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 _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);}}
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);}}