@ckeditor/ckeditor5-operations-compressor 40.0.0 → 40.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +16 -16
  2. package/LICENSE.md +7 -8
  3. package/README.md +1 -1
  4. package/package.json +2 -2
  5. package/src/actioncompressor/actioncompressor.d.ts +60 -60
  6. package/src/actioncompressor/actioncompressor.js +1 -1
  7. package/src/actioncompressor/deletingactioncompressor.d.ts +28 -28
  8. package/src/actioncompressor/deletingactioncompressor.js +1 -1
  9. package/src/actioncompressor/forwarddeletingactioncompressor.d.ts +28 -28
  10. package/src/actioncompressor/forwarddeletingactioncompressor.js +1 -1
  11. package/src/actioncompressor/typingactioncompressor.d.ts +28 -28
  12. package/src/actioncompressor/typingactioncompressor.js +1 -1
  13. package/src/actioncompressor/userselectionactioncompressor.d.ts +16 -16
  14. package/src/actioncompressor/userselectionactioncompressor.js +1 -1
  15. package/src/compressor.d.ts +45 -45
  16. package/src/compressor.js +1 -1
  17. package/src/lib/compiledmessages.js +1 -1
  18. package/src/operationcompressor/annotationmarkeroperationcompressor.d.ts +22 -22
  19. package/src/operationcompressor/annotationmarkeroperationcompressor.js +1 -1
  20. package/src/operationcompressor/attributeoperationcompressor.d.ts +17 -17
  21. package/src/operationcompressor/attributeoperationcompressor.js +1 -1
  22. package/src/operationcompressor/insertoperationcompressor.d.ts +17 -17
  23. package/src/operationcompressor/insertoperationcompressor.js +1 -1
  24. package/src/operationcompressor/markeroperationcompressor.d.ts +13 -13
  25. package/src/operationcompressor/markeroperationcompressor.js +1 -1
  26. package/src/operationcompressor/nooperationcompressor.d.ts +20 -20
  27. package/src/operationcompressor/nooperationcompressor.js +1 -1
  28. package/src/operationcompressor/operationcompressor.d.ts +28 -28
  29. package/src/operationcompressor/operationcompressor.js +1 -1
  30. package/src/protobufdescriptions.d.ts +4 -4
  31. package/src/protobufdescriptions.js +1 -1
  32. package/src/protobuffactory.d.ts +5 -5
  33. package/src/protobuffactory.js +1 -1
  34. package/src/utils.d.ts +30 -30
  35. package/src/utils.js +1 -1
@@ -1,45 +1,45 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * Compresses and decompresses given set of operations in JSON format to/from the binary format using `Protocol Buffers`.
7
- */
8
- export default class Compressor {
9
- constructor();
10
- /**
11
- * Compress given list of operations in JSON format.
12
- *
13
- * **Note** It tries to combine typing-like or deleting-like operations into the one buffer.
14
- * **Note** Input data will be consumed and modified during compression process. If you need untouched data
15
- * you need to copy it before the compression.
16
- */
17
- compress(operations: Array<any>): CompressedOperationsData;
18
- /**
19
- * Decompress given data to the list of operations in JSON format.
20
- *
21
- * **Note** Input data will be consumed during decompression process. If you need untouched data
22
- * you need to copy it before the decompression.
23
- *
24
- * @param data Compressed operations.
25
- * @returns List of operations in JSON format.
26
- */
27
- decompress(data: CompressedOperationsData): Array<any>;
28
- }
29
- /**
30
- * Compressed operations data.
31
- */
32
- export type CompressedOperationsData = {
33
- /**
34
- * List of operations compressed to the binary format.
35
- */
36
- buffers: Array<Uint8Array>;
37
- /**
38
- * List of compressor identifiers. According to this types a proper compressor will be used for the decompression.
39
- */
40
- types: Array<number>;
41
- /**
42
- * Base version of the first compressed operation.
43
- */
44
- baseVersion: number;
45
- };
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * Compresses and decompresses given set of operations in JSON format to/from the binary format using `Protocol Buffers`.
7
+ */
8
+ export default class Compressor {
9
+ constructor();
10
+ /**
11
+ * Compress given list of operations in JSON format.
12
+ *
13
+ * **Note** It tries to combine typing-like or deleting-like operations into the one buffer.
14
+ * **Note** Input data will be consumed and modified during compression process. If you need untouched data
15
+ * you need to copy it before the compression.
16
+ */
17
+ compress(operations: Array<any>): CompressedOperationsData;
18
+ /**
19
+ * Decompress given data to the list of operations in JSON format.
20
+ *
21
+ * **Note** Input data will be consumed during decompression process. If you need untouched data
22
+ * you need to copy it before the decompression.
23
+ *
24
+ * @param data Compressed operations.
25
+ * @returns List of operations in JSON format.
26
+ */
27
+ decompress(data: CompressedOperationsData): Array<any>;
28
+ }
29
+ /**
30
+ * Compressed operations data.
31
+ */
32
+ export type CompressedOperationsData = {
33
+ /**
34
+ * List of operations compressed to the binary format.
35
+ */
36
+ buffers: Array<Uint8Array>;
37
+ /**
38
+ * List of compressor identifiers. According to this types a proper compressor will be used for the decompression.
39
+ */
40
+ types: Array<number>;
41
+ /**
42
+ * Base version of the first compressed operation.
43
+ */
44
+ baseVersion: number;
45
+ };
package/src/compressor.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2850=['_registerActionCompressor','SuggestionMarkerOperation','_compressorByName','ForwardDeletingAction','forEach','_protobufFactory','MergeOperation','suggestion','getDescriptor','MoveOperation','RootAttributeOperation','compress','DeletingAction','baseVersion','NoOperation','_compressorById','_registerOperationCompressor','get','set','MarkerOperation','__className','CommentMarkerOperation','no-operations-provided','RenameOperation','decompress','length','_getCompressorByName','types','RootOperation','_registerCompressor'];(function(_0x448602,_0x285045){const _0x42eaf7=function(_0x50e052){while(--_0x50e052){_0x448602['push'](_0x448602['shift']());}};_0x42eaf7(++_0x285045);}(_0x2850,0x75));const _0x42ea=function(_0x448602,_0x285045){_0x448602=_0x448602-0x0;let _0x42eaf7=_0x2850[_0x448602];return _0x42eaf7;};import{CKEditorError as _0x1effc6}from'ckeditor5/src/utils';import _0x249653 from'./protobuffactory';import _0x14476f from'./operationcompressor/operationcompressor';import _0x59f9e2 from'./operationcompressor/attributeoperationcompressor';import _0xb34dfa from'./operationcompressor/insertoperationcompressor';import _0x10a13c from'./operationcompressor/markeroperationcompressor';import _0x5c681b from'./operationcompressor/nooperationcompressor';import _0x436435 from'./operationcompressor/annotationmarkeroperationcompressor';import _0x401fa8 from'./actioncompressor/typingactioncompressor';import _0x126bd1 from'./actioncompressor/deletingactioncompressor';import _0x4b208a from'./actioncompressor/forwarddeletingactioncompressor';import _0x1459a4 from'./actioncompressor/userselectionactioncompressor';export default class g{constructor(){this[_0x42ea('0x12')]=new Map(),this['_compressorByName']=new Map(),this[_0x42ea('0x8')]=new _0x249653();const _0x19ee3c=this[_0x42ea('0x8')]['getDescriptor'](_0x42ea('0x16'));this[_0x42ea('0x2')](0x1,_0x42ea('0x11'),new _0x5c681b(0x1,_0x42ea('0x11'),void 0x0)),this[_0x42ea('0x13')](0xa,'AttributeOperation',_0x59f9e2),this[_0x42ea('0x13')](0xb,'InsertOperation',_0xb34dfa),this[_0x42ea('0x13')](0xc,'MarkerOperation',_0x10a13c),this[_0x42ea('0x13')](0xd,_0x42ea('0x9'),_0x14476f),this[_0x42ea('0x13')](0xe,_0x42ea('0xc'),_0x14476f),this[_0x42ea('0x13')](0xf,_0x42ea('0x1a'),_0x14476f),this[_0x42ea('0x13')](0x10,_0x42ea('0xd'),_0x59f9e2),this[_0x42ea('0x13')](0x11,'SplitOperation',_0x14476f),this[_0x42ea('0x2')](0x12,_0x42ea('0x18'),new _0x436435(0x12,'MarkerOperation',_0x19ee3c,'comment')),this[_0x42ea('0x2')](0x13,_0x42ea('0x4'),new _0x436435(0x13,'MarkerOperation',_0x19ee3c,_0x42ea('0xa'))),this[_0x42ea('0x13')](0x14,_0x42ea('0x1'),_0x14476f),this[_0x42ea('0x3')](0x64,'TypingAction',_0x401fa8),this[_0x42ea('0x3')](0x65,_0x42ea('0xf'),_0x126bd1),this[_0x42ea('0x3')](0x66,_0x42ea('0x6'),_0x4b208a),this[_0x42ea('0x3')](0x67,'UserSelectionAction',_0x1459a4);}[_0x42ea('0xe')](_0x5b7411){if(!_0x5b7411||!_0x5b7411[0x0])throw new _0x1effc6(_0x42ea('0x19'),this);const _0x317ccc={'types':[],'buffers':[],'baseVersion':_0x5b7411[0x0][_0x42ea('0x10')]};for(;_0x5b7411[_0x42ea('0x1c')];)this[_0x42ea('0x1d')]('UserSelectionAction')[_0x42ea('0xe')](_0x317ccc,_0x5b7411)||this[_0x42ea('0x1d')]('TypingAction')[_0x42ea('0xe')](_0x317ccc,_0x5b7411)||this[_0x42ea('0x1d')]('DeletingAction')[_0x42ea('0xe')](_0x317ccc,_0x5b7411)||this['_getCompressorByName'](_0x42ea('0x6'))[_0x42ea('0xe')](_0x317ccc,_0x5b7411)||this[_0x42ea('0x1d')](_0x42ea('0x18'))['compress'](_0x317ccc,_0x5b7411)||this[_0x42ea('0x1d')](_0x42ea('0x4'))[_0x42ea('0xe')](_0x317ccc,_0x5b7411)||this['_getCompressorByName'](_0x5b7411[0x0][_0x42ea('0x17')])[_0x42ea('0xe')](_0x317ccc,_0x5b7411);return _0x317ccc;}['decompress'](_0x15ee15){const _0x3b92bf=[];for(;_0x15ee15[_0x42ea('0x0')][_0x42ea('0x1c')];){this[_0x42ea('0x12')][_0x42ea('0x14')](_0x15ee15[_0x42ea('0x0')][0x0])[_0x42ea('0x1b')](_0x3b92bf,_0x15ee15);}return _0x3b92bf[_0x42ea('0x7')]((_0xc9b2dc,_0x38b0be)=>_0xc9b2dc[_0x42ea('0x10')]=_0x15ee15[_0x42ea('0x10')]+_0x38b0be),_0x3b92bf;}[_0x42ea('0x1d')](_0x270c2b){return this[_0x42ea('0x5')][_0x42ea('0x14')](_0x270c2b);}[_0x42ea('0x13')](_0x4996cb,_0x5f1345,_0x143b35){const _0x180d4a=new _0x143b35(_0x4996cb,_0x5f1345,this[_0x42ea('0x8')][_0x42ea('0xb')](_0x5f1345));this['_registerCompressor'](_0x4996cb,_0x5f1345,_0x180d4a);}['_registerActionCompressor'](_0xb1a99c,_0x2a735b,_0x1d167b){const _0x399a3d=new _0x1d167b(_0xb1a99c,this);this[_0x42ea('0x2')](_0xb1a99c,_0x2a735b,_0x399a3d);}[_0x42ea('0x2')](_0x48687f,_0x13d974,_0xf20e8){this[_0x42ea('0x12')][_0x42ea('0x15')](_0x48687f,_0xf20e8),this[_0x42ea('0x5')][_0x42ea('0x15')](_0x13d974,_0xf20e8);}}
23
+ const _0x4d06=['MarkerOperation','CommentMarkerOperation','SplitOperation','getDescriptor','set','_protobufFactory','TypingAction','_getCompressorByName','comment','SuggestionMarkerOperation','DeletingAction','_compressorByName','baseVersion','__className','RootAttributeOperation','forEach','AttributeOperation','_compressorById','NoOperation','suggestion','compress','decompress','_registerActionCompressor','MoveOperation','_registerCompressor','_registerOperationCompressor','RenameOperation','length','types','ForwardDeletingAction','UserSelectionAction','get'];(function(_0x40f043,_0x4d06c1){const _0x37288b=function(_0x1b4c98){while(--_0x1b4c98){_0x40f043['push'](_0x40f043['shift']());}};_0x37288b(++_0x4d06c1);}(_0x4d06,0x75));const _0x3728=function(_0x40f043,_0x4d06c1){_0x40f043=_0x40f043-0x0;let _0x37288b=_0x4d06[_0x40f043];return _0x37288b;};import{CKEditorError as _0xdd095}from'ckeditor5/src/utils';import _0x29d182 from'./protobuffactory';import _0x4aba4d from'./operationcompressor/operationcompressor';import _0x13f5e4 from'./operationcompressor/attributeoperationcompressor';import _0x427809 from'./operationcompressor/insertoperationcompressor';import _0x2c3470 from'./operationcompressor/markeroperationcompressor';import _0x304d59 from'./operationcompressor/nooperationcompressor';import _0x12bc84 from'./operationcompressor/annotationmarkeroperationcompressor';import _0x536f1d from'./actioncompressor/typingactioncompressor';import _0x371bc5 from'./actioncompressor/deletingactioncompressor';import _0x4d7a86 from'./actioncompressor/forwarddeletingactioncompressor';import _0x35c6aa from'./actioncompressor/userselectionactioncompressor';export default class g{constructor(){this[_0x3728('0x1c')]=new Map(),this[_0x3728('0x16')]=new Map(),this[_0x3728('0x10')]=new _0x29d182();const _0x4c54ec=this[_0x3728('0x10')][_0x3728('0xe')](_0x3728('0xb'));this[_0x3728('0x3')](0x1,_0x3728('0x1d'),new _0x304d59(0x1,_0x3728('0x1d'),void 0x0)),this[_0x3728('0x4')](0xa,_0x3728('0x1b'),_0x13f5e4),this[_0x3728('0x4')](0xb,'InsertOperation',_0x427809),this[_0x3728('0x4')](0xc,'MarkerOperation',_0x2c3470),this['_registerOperationCompressor'](0xd,'MergeOperation',_0x4aba4d),this[_0x3728('0x4')](0xe,_0x3728('0x2'),_0x4aba4d),this[_0x3728('0x4')](0xf,_0x3728('0x5'),_0x4aba4d),this[_0x3728('0x4')](0x10,_0x3728('0x19'),_0x13f5e4),this[_0x3728('0x4')](0x11,_0x3728('0xd'),_0x4aba4d),this['_registerCompressor'](0x12,_0x3728('0xc'),new _0x12bc84(0x12,_0x3728('0xb'),_0x4c54ec,_0x3728('0x13'))),this[_0x3728('0x3')](0x13,_0x3728('0x14'),new _0x12bc84(0x13,_0x3728('0xb'),_0x4c54ec,_0x3728('0x1e'))),this[_0x3728('0x4')](0x14,'RootOperation',_0x4aba4d),this['_registerActionCompressor'](0x64,_0x3728('0x11'),_0x536f1d),this[_0x3728('0x1')](0x65,_0x3728('0x15'),_0x371bc5),this[_0x3728('0x1')](0x66,_0x3728('0x8'),_0x4d7a86),this[_0x3728('0x1')](0x67,_0x3728('0x9'),_0x35c6aa);}['compress'](_0x3ce696){if(!_0x3ce696||!_0x3ce696[0x0])throw new _0xdd095('no-operations-provided',this);const _0x12c7c5={'types':[],'buffers':[],'baseVersion':_0x3ce696[0x0]['baseVersion']};for(;_0x3ce696[_0x3728('0x6')];)this['_getCompressorByName'](_0x3728('0x9'))['compress'](_0x12c7c5,_0x3ce696)||this[_0x3728('0x12')](_0x3728('0x11'))[_0x3728('0x1f')](_0x12c7c5,_0x3ce696)||this[_0x3728('0x12')](_0x3728('0x15'))[_0x3728('0x1f')](_0x12c7c5,_0x3ce696)||this[_0x3728('0x12')](_0x3728('0x8'))[_0x3728('0x1f')](_0x12c7c5,_0x3ce696)||this[_0x3728('0x12')]('CommentMarkerOperation')[_0x3728('0x1f')](_0x12c7c5,_0x3ce696)||this[_0x3728('0x12')](_0x3728('0x14'))[_0x3728('0x1f')](_0x12c7c5,_0x3ce696)||this[_0x3728('0x12')](_0x3ce696[0x0][_0x3728('0x18')])['compress'](_0x12c7c5,_0x3ce696);return _0x12c7c5;}[_0x3728('0x0')](_0x2ccf00){const _0x2ebb39=[];for(;_0x2ccf00[_0x3728('0x7')][_0x3728('0x6')];){this['_compressorById'][_0x3728('0xa')](_0x2ccf00[_0x3728('0x7')][0x0])[_0x3728('0x0')](_0x2ebb39,_0x2ccf00);}return _0x2ebb39[_0x3728('0x1a')]((_0x6bc300,_0x1838b7)=>_0x6bc300[_0x3728('0x17')]=_0x2ccf00[_0x3728('0x17')]+_0x1838b7),_0x2ebb39;}[_0x3728('0x12')](_0x479c20){return this['_compressorByName'][_0x3728('0xa')](_0x479c20);}[_0x3728('0x4')](_0x4ad401,_0x525826,_0x335ab5){const _0x4c03b4=new _0x335ab5(_0x4ad401,_0x525826,this[_0x3728('0x10')][_0x3728('0xe')](_0x525826));this[_0x3728('0x3')](_0x4ad401,_0x525826,_0x4c03b4);}[_0x3728('0x1')](_0x45ae5b,_0xb3cf2,_0x301c0b){const _0x9230c7=new _0x301c0b(_0x45ae5b,this);this[_0x3728('0x3')](_0x45ae5b,_0xb3cf2,_0x9230c7);}[_0x3728('0x3')](_0x7d157,_0x58f9ee,_0xc8e4b1){this[_0x3728('0x1c')][_0x3728('0xf')](_0x7d157,_0xc8e4b1),this[_0x3728('0x16')][_0x3728('0xf')](_0x58f9ee,_0xc8e4b1);}}