@ckeditor/ckeditor5-operations-compressor 38.0.1 → 38.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/package.json +9 -6
  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.0.1",
3
+ "version": "38.1.1",
4
4
  "description": "CKEditor 5 operations compressor for real-time collaboration.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://ckeditor.com/collaboration/real-time/",
@@ -26,19 +26,22 @@
26
26
  "framework"
27
27
  ],
28
28
  "author": "CKSource (http://cksource.com/)",
29
+ "bugs": {
30
+ "url": "https://support.ckeditor.com/hc/en-us/requests/new"
31
+ },
29
32
  "dependencies": {
30
- "ckeditor5": "^38.0.1",
33
+ "ckeditor5": "38.1.1",
31
34
  "lodash-es": "^4.17.11",
32
35
  "protobufjs": "^7.0.0"
33
36
  },
37
+ "engines": {
38
+ "node": ">=16.0.0",
39
+ "npm": ">=5.7.1"
40
+ },
34
41
  "files": [
35
42
  "src/**/*.js",
36
43
  "src/**/*.d.ts",
37
44
  "CHANGELOG.md"
38
45
  ],
39
- "scripts": {
40
- "build": "tsc -p ./tsconfig.json",
41
- "postversion": "npm run build"
42
- },
43
46
  "obfuscated": true
44
47
  }
@@ -1,56 +1,56 @@
1
- import type { CompressedOperationsData, default as Compressor } from '../compressor';
2
- /**
3
- * * Compresses and decompresses multiple operations into the one buffer.
4
- */
5
- export default abstract class ActionCompressor {
6
- constructor(id: number, context: Compressor);
7
- /**
8
- * Combines and compress operations from the list.
9
- * Operations are consumed as long as match this compressor.
10
- *
11
- * @param result Object to which compression result should be added.
12
- * @param operations List of operations in JSON format to compress.
13
- * @returns `true` when operation is consumed `false` otherwise.
14
- */
15
- compress(result: CompressedOperationsData, operations: Array<any>): boolean;
16
- /**
17
- * Decompress and split compressed operations. Decompressed operations are consumed (removed from the input data).
18
- *
19
- * @param result Decompressed operations in JSON format.
20
- * @param data Compressed operations data.
21
- */
22
- decompress(result: Array<any>, data: CompressedOperationsData): void;
23
- /**
24
- * Compresses single operation using a proper compressor.
25
- *
26
- * @param operation Operation in JSON format.
27
- * @returns Operation JSON compressed to the binary format.
28
- */
29
- protected abstract _compressSingleOperation(operation: any): Uint8Array;
30
- /**
31
- * Decompresses combined operation using a proper compressor.
32
- *
33
- * @param data Data to compress.
34
- * @returns Decompressed operation in JSON format.
35
- */
36
- protected abstract _decompressSingleOperation(data: CompressedOperationsData): any;
37
- /**
38
- * Combine next operation into the combined one.
39
- *
40
- * @param nextOperation Operation to combine in JSON format.
41
- * @param combined Combined operation in JSON format.
42
- * @returns Combined operation in JSON format.
43
- */
44
- protected abstract _combineNext(nextOperation: any, combined: any): any;
45
- /**
46
- * Split operation from combined one.
47
- *
48
- * @param combined Combined operation in JSON format.
49
- * @returns Split operation in JSON format.
50
- */
51
- protected abstract _splitCurrent(combined: any): any;
52
- /**
53
- * Checks if two operations can be combined.
54
- */
55
- protected abstract _compareOperations(opA: any, opB: any): boolean;
56
- }
1
+ import type { CompressedOperationsData, default as Compressor } from '../compressor';
2
+ /**
3
+ * * Compresses and decompresses multiple operations into the one buffer.
4
+ */
5
+ export default abstract class ActionCompressor {
6
+ constructor(id: number, context: Compressor);
7
+ /**
8
+ * Combines and compress operations from the list.
9
+ * Operations are consumed as long as match this compressor.
10
+ *
11
+ * @param result Object to which compression result should be added.
12
+ * @param operations List of operations in JSON format to compress.
13
+ * @returns `true` when operation is consumed `false` otherwise.
14
+ */
15
+ compress(result: CompressedOperationsData, operations: Array<any>): boolean;
16
+ /**
17
+ * Decompress and split compressed operations. Decompressed operations are consumed (removed from the input data).
18
+ *
19
+ * @param result Decompressed operations in JSON format.
20
+ * @param data Compressed operations data.
21
+ */
22
+ decompress(result: Array<any>, data: CompressedOperationsData): void;
23
+ /**
24
+ * Compresses single operation using a proper compressor.
25
+ *
26
+ * @param operation Operation in JSON format.
27
+ * @returns Operation JSON compressed to the binary format.
28
+ */
29
+ protected abstract _compressSingleOperation(operation: any): Uint8Array;
30
+ /**
31
+ * Decompresses combined operation using a proper compressor.
32
+ *
33
+ * @param data Data to compress.
34
+ * @returns Decompressed operation in JSON format.
35
+ */
36
+ protected abstract _decompressSingleOperation(data: CompressedOperationsData): any;
37
+ /**
38
+ * Combine next operation into the combined one.
39
+ *
40
+ * @param nextOperation Operation to combine in JSON format.
41
+ * @param combined Combined operation in JSON format.
42
+ * @returns Combined operation in JSON format.
43
+ */
44
+ protected abstract _combineNext(nextOperation: any, combined: any): any;
45
+ /**
46
+ * Split operation from combined one.
47
+ *
48
+ * @param combined Combined operation in JSON format.
49
+ * @returns Split operation in JSON format.
50
+ */
51
+ protected abstract _splitCurrent(combined: any): any;
52
+ /**
53
+ * Checks if two operations can be combined.
54
+ */
55
+ protected abstract _compareOperations(opA: any, opB: any): boolean;
56
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x13fe=['compress','buffers','length','_context','_id','types','shift','decompress','_decompressSingleOperation','push','_splitCurrent','_combineNext'];(function(_0x504630,_0x13fec4){const _0x518ac8=function(_0x19cd02){while(--_0x19cd02){_0x504630['push'](_0x504630['shift']());}};_0x518ac8(++_0x13fec4);}(_0x13fe,0x79));const _0x518a=function(_0x504630,_0x13fec4){_0x504630=_0x504630-0x0;let _0x518ac8=_0x13fe[_0x504630];return _0x518ac8;};import{cloneDeep as _0x813e88}from'lodash-es';export default class b{constructor(_0x28f44a,_0x755784){this[_0x518a('0x3')]=_0x28f44a,this[_0x518a('0x2')]=_0x755784;}[_0x518a('0xb')](_0x4ad69b,_0x257ed4){let _0x37ef25;for(;_0x257ed4[_0x518a('0x1')]>0x1&&this['_compareOperations'](_0x257ed4[0x0],_0x257ed4[0x1]);)_0x37ef25?(_0x37ef25=this['_combineNext'](_0x257ed4[_0x518a('0x5')](),_0x37ef25),_0x4ad69b[_0x518a('0x4')][_0x518a('0x8')](0x0)):(_0x37ef25=_0x813e88(_0x257ed4[_0x518a('0x5')]()),_0x4ad69b[_0x518a('0x4')][_0x518a('0x8')](this[_0x518a('0x3')]));return!!_0x37ef25&&(_0x37ef25=this[_0x518a('0xa')](_0x257ed4[_0x518a('0x5')](),_0x37ef25),_0x4ad69b[_0x518a('0x4')][_0x518a('0x8')](0x0),_0x4ad69b[_0x518a('0x0')][_0x518a('0x8')](this['_compressSingleOperation'](_0x37ef25)),!0x0);}[_0x518a('0x6')](_0x1e47c3,_0x2d68fc){const _0x67dac=this[_0x518a('0x7')](_0x2d68fc);for(;0x0==_0x2d68fc[_0x518a('0x4')][0x0];)_0x2d68fc['types']['shift'](),_0x1e47c3[_0x518a('0x8')](this[_0x518a('0x9')](_0x67dac));_0x1e47c3[_0x518a('0x8')](_0x67dac);}}
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 _0x4f49=['howMany','_context','_compressSingleOperation','sourcePosition','_combineNext','_decompressSingleOperation','__className','_checkOperation','_splitCurrent','targetPosition','root','decompress','MoveOperation','_getCompressorByName','$graveyard'];(function(_0x2f1fcc,_0x4f4969){const _0x44ab9e=function(_0x167593){while(--_0x167593){_0x2f1fcc['push'](_0x2f1fcc['shift']());}};_0x44ab9e(++_0x4f4969);}(_0x4f49,0x12a));const _0x44ab=function(_0x2f1fcc,_0x4f4969){_0x2f1fcc=_0x2f1fcc-0x0;let _0x44ab9e=_0x4f49[_0x2f1fcc];return _0x44ab9e;};import _0x50470b from'./actioncompressor';import{arePositionsEqual as _0x2069b7,getPositionShiftedBy as _0x55920f}from'../utils';import{cloneDeep as _0x5dc1b5}from'lodash-es';export default class c extends _0x50470b{[_0x44ab('0x6')](_0x5e4806,_0x261bde){return _0x261bde[_0x44ab('0x2')]++,_0x261bde[_0x44ab('0x5')]=_0x5dc1b5(_0x5e4806[_0x44ab('0x5')]),_0x261bde;}[_0x44ab('0xa')](_0x4a7324){const _0x22db0e=_0x5dc1b5(_0x4a7324);return _0x4a7324['howMany']--,_0x22db0e['howMany']=0x1,_0x22db0e[_0x44ab('0x5')]=_0x55920f(_0x22db0e['sourcePosition'],_0x4a7324[_0x44ab('0x2')]),_0x22db0e;}['_compareOperations'](_0x5436f0,_0x174b23){return!(!this[_0x44ab('0x9')](_0x5436f0)||!this[_0x44ab('0x9')](_0x174b23))&&(_0x2069b7(_0x55920f(_0x5436f0[_0x44ab('0x5')],-0x1),_0x174b23[_0x44ab('0x5')])&&_0x2069b7(_0x5436f0[_0x44ab('0xb')],_0x174b23['targetPosition']));}[_0x44ab('0x4')](_0x194b06){const _0x256e25={'types':[],'buffers':[],'baseVersion':0x0};return this['_context']['_getCompressorByName']('MoveOperation')['compress'](_0x256e25,[_0x194b06]),_0x256e25['buffers'][0x0];}[_0x44ab('0x7')](_0x50e984){const _0x47fa49=[];return this[_0x44ab('0x3')][_0x44ab('0x0')](_0x44ab('0xe'))[_0x44ab('0xd')](_0x47fa49,_0x50e984),_0x47fa49[0x0];}['_checkOperation'](_0x1f130b){return'MoveOperation'==_0x1f130b[_0x44ab('0x8')]&&_0x44ab('0x1')==_0x1f130b[_0x44ab('0xb')][_0x44ab('0xc')]&&0x1==_0x1f130b[_0x44ab('0x2')]&&!_0x1f130b['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 _0x5497=['sourcePosition','buffers','MoveOperation','_getCompressorByName','$graveyard','howMany','_compareOperations','root','decompress','_checkOperation','targetPosition','_compressSingleOperation','_context'];(function(_0x32bb94,_0x549772){const _0x119449=function(_0x59efd7){while(--_0x59efd7){_0x32bb94['push'](_0x32bb94['shift']());}};_0x119449(++_0x549772);}(_0x5497,0x71));const _0x1194=function(_0x32bb94,_0x549772){_0x32bb94=_0x32bb94-0x0;let _0x119449=_0x5497[_0x32bb94];return _0x119449;};import _0x55741d from'./actioncompressor';import{arePositionsEqual as _0xff78c9}from'../utils';import{cloneDeep as _0x29511c}from'lodash-es';export default class h extends _0x55741d{['_combineNext'](_0x4f1706,_0x26114f){return _0x26114f['howMany']++,_0x26114f;}['_splitCurrent'](_0x47333c){const _0x2aa457=_0x29511c(_0x47333c);return _0x2aa457[_0x1194('0x9')]=0x1,_0x47333c[_0x1194('0x9')]--,_0x2aa457;}[_0x1194('0xa')](_0x14f75e,_0x4818b6){return!(!this[_0x1194('0x0')](_0x14f75e)||!this[_0x1194('0x0')](_0x4818b6))&&(_0xff78c9(_0x14f75e[_0x1194('0x4')],_0x4818b6[_0x1194('0x4')])&&_0xff78c9(_0x14f75e[_0x1194('0x1')],_0x4818b6[_0x1194('0x1')]));}[_0x1194('0x2')](_0x598eb0){const _0xcdfd34={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x1194('0x3')][_0x1194('0x7')]('MoveOperation')['compress'](_0xcdfd34,[_0x598eb0]),_0xcdfd34[_0x1194('0x5')][0x0];}['_decompressSingleOperation'](_0x5510d8){const _0x20cad6=[];return this[_0x1194('0x3')][_0x1194('0x7')](_0x1194('0x6'))[_0x1194('0xc')](_0x20cad6,_0x5510d8),_0x20cad6[0x0];}['_checkOperation'](_0x272b99){return _0x1194('0x6')==_0x272b99['__className']&&_0x1194('0x8')==_0x272b99[_0x1194('0x1')][_0x1194('0xb')]&&0x1==_0x272b99[_0x1194('0x9')]&&!_0x272b99['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 _0x5110=['__className','_compareOperations','position','nodes','length','_combineNext','buffers','compress','keys','_compressSingleOperation','_splitCurrent','InsertOperation','attributes','wasUndone','_context','_decompressSingleOperation','next','data','_compareAttributes','_getCompressorByName','substr','iterator','every','_checkOperation','value','from'];(function(_0x367ba7,_0x51100c){const _0x2e6762=function(_0x526fee){while(--_0x526fee){_0x367ba7['push'](_0x367ba7['shift']());}};_0x2e6762(++_0x51100c);}(_0x5110,0x149));const _0x2e67=function(_0x367ba7,_0x51100c){_0x367ba7=_0x367ba7-0x0;let _0x2e6762=_0x5110[_0x367ba7];return _0x2e6762;};import _0x28927f from'./actioncompressor';import{arePositionsEqual as _0x40d726,getPositionShiftedBy as _0x463d59}from'../utils';import{cloneDeep as _0xcaf11e}from'lodash-es';export default class m extends _0x28927f{[_0x2e67('0xe')](_0x29273c,_0x21e853){return _0x21e853[_0x2e67('0xc')][0x0][_0x2e67('0x0')]+=_0x29273c[_0x2e67('0xc')][0x0][_0x2e67('0x0')],_0x21e853;}[_0x2e67('0x13')](_0x493553){const _0x56b5bf=_0xcaf11e(_0x493553),_0x44dc4c=_0x56b5bf[_0x2e67('0xc')][0x0],_0x307d90=_0x493553[_0x2e67('0xc')][0x0],_0x2a5c56=_0x307d90['data'][Symbol[_0x2e67('0x4')]]()[_0x2e67('0x19')]()[_0x2e67('0x7')],_0x3e347a=_0x2a5c56[_0x2e67('0xd')];return _0x44dc4c[_0x2e67('0x0')]=_0x2a5c56,_0x307d90[_0x2e67('0x0')]=_0x307d90[_0x2e67('0x0')][_0x2e67('0x3')](_0x3e347a),_0x493553[_0x2e67('0xb')]=_0x463d59(_0x493553[_0x2e67('0xb')],_0x3e347a),_0x56b5bf;}[_0x2e67('0xa')](_0x46436a,_0x45859a){if(this[_0x2e67('0x6')](_0x46436a)&&this[_0x2e67('0x6')](_0x45859a)){const _0x2fb270=_0x46436a[_0x2e67('0xc')][0x0][_0x2e67('0x0')][_0x2e67('0xd')],_0x17e19d=_0x40d726(_0x463d59(_0x46436a[_0x2e67('0xb')],_0x2fb270),_0x45859a[_0x2e67('0xb')]),_0x42a71f=_0x46436a[_0x2e67('0xc')][0x0],_0x20e5ff=_0x45859a['nodes'][0x0];return _0x17e19d&&this[_0x2e67('0x1')](_0x42a71f,_0x20e5ff);}return!0x1;}[_0x2e67('0x12')](_0x476c16){const _0x4e3826={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x2e67('0x17')][_0x2e67('0x2')](_0x2e67('0x14'))[_0x2e67('0x10')](_0x4e3826,[_0x476c16]),_0x4e3826[_0x2e67('0xf')][0x0];}[_0x2e67('0x18')](_0x254b8d){const _0x1a679c=[];return this[_0x2e67('0x17')]['_getCompressorByName'](_0x2e67('0x14'))['decompress'](_0x1a679c,_0x254b8d),_0x1a679c[0x0];}[_0x2e67('0x6')](_0x2a7536){return _0x2e67('0x14')==_0x2a7536[_0x2e67('0x9')]&&0x1==_0x2a7536['nodes'][_0x2e67('0xd')]&&_0x2a7536[_0x2e67('0xc')][0x0][_0x2e67('0x0')]&&!_0x2a7536[_0x2e67('0x16')]&&0x1==Array[_0x2e67('0x8')](_0x2a7536[_0x2e67('0xc')][0x0]['data'])[_0x2e67('0xd')];}[_0x2e67('0x1')](_0x37bbe1,_0xe5d4ad){const _0x30c8fb=Object[_0x2e67('0x11')](_0x37bbe1['attributes']||{}),_0x12276b=Object['keys'](_0xe5d4ad[_0x2e67('0x15')]||{});return _0x30c8fb[_0x2e67('0xd')]===_0x12276b['length']&&_0x30c8fb[_0x2e67('0x5')](_0x93d3d=>_0xe5d4ad[_0x2e67('0x15')][_0x93d3d]&&_0xe5d4ad[_0x2e67('0x15')][_0x93d3d]===_0x37bbe1['attributes'][_0x93d3d]);}}
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 _0x1bfb=['oldRange','newRange','start','_compressSingleOperation','compress','toNone','__className','_decompressSingleOperation','end','types','user:','push','stickiness','shift','buffers','_id','startsWith','MarkerOperation','name','split','_context','_getCompressorByName'];(function(_0x165f60,_0x1bfb84){const _0x2830be=function(_0x3ba3a6){while(--_0x3ba3a6){_0x165f60['push'](_0x165f60['shift']());}};_0x2830be(++_0x1bfb84);}(_0x1bfb,0xc2));const _0x2830=function(_0x165f60,_0x1bfb84){_0x165f60=_0x165f60-0x0;let _0x2830be=_0x1bfb[_0x165f60];return _0x2830be;};import _0x120bf4 from'./actioncompressor';import{arePositionsEqual as _0x34582a}from'../utils';import{cloneDeep as _0x53be41}from'lodash-es';export default class f extends _0x120bf4{[_0x2830('0x8')](_0x46e147,_0x4841ec){if(!this['_compareOperations'](_0x4841ec[0x0],_0x4841ec[0x1]))return!0x1;const _0x353ab1=_0x4841ec[_0x2830('0x11')]();return _0x353ab1[_0x2830('0x4')]=null,_0x353ab1[_0x2830('0x5')]&&_0x34582a(_0x353ab1[_0x2830('0x5')][_0x2830('0x6')],_0x353ab1[_0x2830('0x5')]['end'])&&(_0x353ab1[_0x2830('0x5')][_0x2830('0xc')]=null),_0x4841ec[_0x2830('0x11')](),_0x46e147[_0x2830('0xd')]['push'](this[_0x2830('0x13')]),_0x46e147[_0x2830('0xd')][_0x2830('0xf')](0x0),_0x46e147['buffers']['push'](this[_0x2830('0x7')](_0x353ab1)),!0x0;}['decompress'](_0x449042,_0x45a4ed){const _0x4906b0=this[_0x2830('0xb')](_0x45a4ed);_0x4906b0[_0x2830('0x5')]&&!_0x4906b0['newRange'][_0x2830('0xc')]&&(_0x4906b0[_0x2830('0x5')][_0x2830('0xc')]=_0x53be41(_0x4906b0[_0x2830('0x5')][_0x2830('0x6')]));const _0x40aed4=_0x53be41(_0x4906b0);_0x40aed4[_0x2830('0x5')]&&(_0x40aed4[_0x2830('0x5')][_0x2830('0x6')][_0x2830('0x10')]=_0x2830('0x9'),_0x40aed4[_0x2830('0x5')][_0x2830('0xc')]=_0x53be41(_0x40aed4[_0x2830('0x5')]['start'])),_0x40aed4['name']='user:position:'+_0x40aed4[_0x2830('0x0')][_0x2830('0x1')](':')[0x2],_0x45a4ed[_0x2830('0xd')][_0x2830('0x11')](),_0x449042['push'](_0x4906b0),_0x449042['push'](_0x40aed4);}['_compressSingleOperation'](_0x5caaf0){const _0xafda05={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x2830('0x2')][_0x2830('0x3')](_0x2830('0x15'))[_0x2830('0x8')](_0xafda05,[_0x5caaf0]),_0xafda05[_0x2830('0x12')][0x0];}[_0x2830('0xb')](_0x2ca928){const _0x697aa7=[];return this[_0x2830('0x2')]['_getCompressorByName'](_0x2830('0x15'))['decompress'](_0x697aa7,_0x2ca928),_0x697aa7[0x0];}['_compareOperations'](_0x3996d9,_0x202c9f){return!(!_0x3996d9||!_0x202c9f)&&(_0x2830('0x15')==_0x3996d9[_0x2830('0xa')]&&'MarkerOperation'==_0x202c9f[_0x2830('0xa')]&&!(!_0x3996d9[_0x2830('0x0')]['startsWith']('user:')||!_0x202c9f['name'][_0x2830('0x14')](_0x2830('0xe'))||_0x3996d9[_0x2830('0x0')]==_0x202c9f[_0x2830('0x0')]));}}
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 _0x2165=['CommentMarkerOperation','types','RootAttributeOperation','DeletingAction','length','decompress','ForwardDeletingAction','set','baseVersion','AttributeOperation','comment','getDescriptor','UserSelectionAction','MarkerOperation','SuggestionMarkerOperation','RenameOperation','_registerActionCompressor','_getCompressorByName','TypingAction','RootOperation','compress','no-operations-provided','_registerCompressor','_compressorByName','_registerOperationCompressor','MergeOperation','MoveOperation','_protobufFactory','_compressorById','get','SplitOperation','NoOperation'];(function(_0x5db50e,_0x21655f){const _0xcb9cd1=function(_0x1f69b7){while(--_0x1f69b7){_0x5db50e['push'](_0x5db50e['shift']());}};_0xcb9cd1(++_0x21655f);}(_0x2165,0x1ee));const _0xcb9c=function(_0x5db50e,_0x21655f){_0x5db50e=_0x5db50e-0x0;let _0xcb9cd1=_0x2165[_0x5db50e];return _0xcb9cd1;};import{CKEditorError as _0xe3a380}from'ckeditor5/src/utils';import _0x276184 from'./protobuffactory';import _0x35da17 from'./operationcompressor/operationcompressor';import _0x8c8e83 from'./operationcompressor/attributeoperationcompressor';import _0x18c867 from'./operationcompressor/insertoperationcompressor';import _0x181c76 from'./operationcompressor/markeroperationcompressor';import _0x1e41c6 from'./operationcompressor/nooperationcompressor';import _0x3f5d22 from'./operationcompressor/annotationmarkeroperationcompressor';import _0x2af286 from'./actioncompressor/typingactioncompressor';import _0x4b4d7c from'./actioncompressor/deletingactioncompressor';import _0x41b93b from'./actioncompressor/forwarddeletingactioncompressor';import _0x2fe4e3 from'./actioncompressor/userselectionactioncompressor';export default class g{constructor(){this['_compressorById']=new Map(),this[_0xcb9c('0x9')]=new Map(),this['_protobufFactory']=new _0x276184();const _0x319460=this[_0xcb9c('0xd')]['getDescriptor'](_0xcb9c('0x1f'));this[_0xcb9c('0x8')](0x1,_0xcb9c('0x11'),new _0x1e41c6(0x1,_0xcb9c('0x11'),void 0x0)),this[_0xcb9c('0xa')](0xa,_0xcb9c('0x1b'),_0x8c8e83),this[_0xcb9c('0xa')](0xb,'InsertOperation',_0x18c867),this[_0xcb9c('0xa')](0xc,_0xcb9c('0x1f'),_0x181c76),this[_0xcb9c('0xa')](0xd,_0xcb9c('0xb'),_0x35da17),this[_0xcb9c('0xa')](0xe,_0xcb9c('0xc'),_0x35da17),this[_0xcb9c('0xa')](0xf,_0xcb9c('0x1'),_0x35da17),this[_0xcb9c('0xa')](0x10,_0xcb9c('0x14'),_0x8c8e83),this[_0xcb9c('0xa')](0x11,_0xcb9c('0x10'),_0x35da17),this[_0xcb9c('0x8')](0x12,_0xcb9c('0x12'),new _0x3f5d22(0x12,'MarkerOperation',_0x319460,_0xcb9c('0x1c'))),this[_0xcb9c('0x8')](0x13,_0xcb9c('0x0'),new _0x3f5d22(0x13,'MarkerOperation',_0x319460,'suggestion')),this[_0xcb9c('0xa')](0x14,_0xcb9c('0x5'),_0x35da17),this[_0xcb9c('0x2')](0x64,_0xcb9c('0x4'),_0x2af286),this[_0xcb9c('0x2')](0x65,'DeletingAction',_0x4b4d7c),this[_0xcb9c('0x2')](0x66,'ForwardDeletingAction',_0x41b93b),this['_registerActionCompressor'](0x67,_0xcb9c('0x1e'),_0x2fe4e3);}[_0xcb9c('0x6')](_0x1b3433){if(!_0x1b3433||!_0x1b3433[0x0])throw new _0xe3a380(_0xcb9c('0x7'),this);const _0x445d32={'types':[],'buffers':[],'baseVersion':_0x1b3433[0x0][_0xcb9c('0x1a')]};for(;_0x1b3433[_0xcb9c('0x16')];)this[_0xcb9c('0x3')](_0xcb9c('0x1e'))[_0xcb9c('0x6')](_0x445d32,_0x1b3433)||this[_0xcb9c('0x3')]('TypingAction')[_0xcb9c('0x6')](_0x445d32,_0x1b3433)||this[_0xcb9c('0x3')](_0xcb9c('0x15'))[_0xcb9c('0x6')](_0x445d32,_0x1b3433)||this['_getCompressorByName'](_0xcb9c('0x18'))[_0xcb9c('0x6')](_0x445d32,_0x1b3433)||this[_0xcb9c('0x3')](_0xcb9c('0x12'))[_0xcb9c('0x6')](_0x445d32,_0x1b3433)||this['_getCompressorByName']('SuggestionMarkerOperation')['compress'](_0x445d32,_0x1b3433)||this[_0xcb9c('0x3')](_0x1b3433[0x0]['__className'])['compress'](_0x445d32,_0x1b3433);return _0x445d32;}[_0xcb9c('0x17')](_0x5744d9){const _0x374607=[];for(;_0x5744d9[_0xcb9c('0x13')]['length'];){this[_0xcb9c('0xe')][_0xcb9c('0xf')](_0x5744d9['types'][0x0])[_0xcb9c('0x17')](_0x374607,_0x5744d9);}return _0x374607['forEach']((_0x1289fc,_0x31da8e)=>_0x1289fc['baseVersion']=_0x5744d9[_0xcb9c('0x1a')]+_0x31da8e),_0x374607;}[_0xcb9c('0x3')](_0x333ddb){return this[_0xcb9c('0x9')][_0xcb9c('0xf')](_0x333ddb);}[_0xcb9c('0xa')](_0x5d1d4d,_0x3e3ab8,_0x265a84){const _0x2be793=new _0x265a84(_0x5d1d4d,_0x3e3ab8,this[_0xcb9c('0xd')][_0xcb9c('0x1d')](_0x3e3ab8));this[_0xcb9c('0x8')](_0x5d1d4d,_0x3e3ab8,_0x2be793);}[_0xcb9c('0x2')](_0x4b326a,_0x4c02c5,_0x252104){const _0xdd8282=new _0x252104(_0x4b326a,this);this[_0xcb9c('0x8')](_0x4b326a,_0x4c02c5,_0xdd8282);}['_registerCompressor'](_0x4f730e,_0x4e09ba,_0x469ec4){this['_compressorById'][_0xcb9c('0x19')](_0x4f730e,_0x469ec4),this[_0xcb9c('0x9')][_0xcb9c('0x19')](_0x4e09ba,_0x469ec4);}}
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);}}