@ckeditor/ckeditor5-operations-compressor 39.0.1 → 40.0.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 +1 -1
  2. package/LICENSE.md +7 -7
  3. package/README.md +9 -9
  4. package/package.json +2 -6
  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 _0x3e32=['RenameOperation','no-operations-provided','ForwardDeletingAction','SuggestionMarkerOperation','_compressorById','get','_registerActionCompressor','RootAttributeOperation','InsertOperation','suggestion','types','decompress','comment','_protobufFactory','_compressorByName','DeletingAction','_registerOperationCompressor','length','__className','forEach','NoOperation','getDescriptor','MarkerOperation','set','compress','_registerCompressor','MergeOperation','UserSelectionAction','AttributeOperation','SplitOperation','_getCompressorByName','baseVersion'];(function(_0x3fa424,_0x3e3273){const _0xf017fa=function(_0x51bfd6){while(--_0x51bfd6){_0x3fa424['push'](_0x3fa424['shift']());}};_0xf017fa(++_0x3e3273);}(_0x3e32,0x16f));const _0xf017=function(_0x3fa424,_0x3e3273){_0x3fa424=_0x3fa424-0x0;let _0xf017fa=_0x3e32[_0x3fa424];return _0xf017fa;};import{CKEditorError as _0x4a57b0}from'ckeditor5/src/utils';import _0x305e20 from'./protobuffactory';import _0x1faa85 from'./operationcompressor/operationcompressor';import _0x492834 from'./operationcompressor/attributeoperationcompressor';import _0x2301b4 from'./operationcompressor/insertoperationcompressor';import _0x4ae45d from'./operationcompressor/markeroperationcompressor';import _0x536fdc from'./operationcompressor/nooperationcompressor';import _0x2761a8 from'./operationcompressor/annotationmarkeroperationcompressor';import _0x5575e9 from'./actioncompressor/typingactioncompressor';import _0x3cd53f from'./actioncompressor/deletingactioncompressor';import _0x476257 from'./actioncompressor/forwarddeletingactioncompressor';import _0x3a56a1 from'./actioncompressor/userselectionactioncompressor';export default class g{constructor(){this[_0xf017('0x15')]=new Map(),this[_0xf017('0x1f')]=new Map(),this[_0xf017('0x1e')]=new _0x305e20();const _0x35d721=this['_protobufFactory']['getDescriptor']('MarkerOperation');this['_registerCompressor'](0x1,'NoOperation',new _0x536fdc(0x1,_0xf017('0x5'),void 0x0)),this[_0xf017('0x1')](0xa,_0xf017('0xd'),_0x492834),this[_0xf017('0x1')](0xb,_0xf017('0x19'),_0x2301b4),this[_0xf017('0x1')](0xc,_0xf017('0x7'),_0x4ae45d),this[_0xf017('0x1')](0xd,_0xf017('0xb'),_0x1faa85),this[_0xf017('0x1')](0xe,'MoveOperation',_0x1faa85),this[_0xf017('0x1')](0xf,_0xf017('0x11'),_0x1faa85),this['_registerOperationCompressor'](0x10,_0xf017('0x18'),_0x492834),this[_0xf017('0x1')](0x11,_0xf017('0xe'),_0x1faa85),this[_0xf017('0xa')](0x12,'CommentMarkerOperation',new _0x2761a8(0x12,'MarkerOperation',_0x35d721,_0xf017('0x1d'))),this['_registerCompressor'](0x13,_0xf017('0x14'),new _0x2761a8(0x13,'MarkerOperation',_0x35d721,_0xf017('0x1a'))),this[_0xf017('0x1')](0x14,'RootOperation',_0x1faa85),this[_0xf017('0x17')](0x64,'TypingAction',_0x5575e9),this[_0xf017('0x17')](0x65,_0xf017('0x0'),_0x3cd53f),this['_registerActionCompressor'](0x66,_0xf017('0x13'),_0x476257),this[_0xf017('0x17')](0x67,_0xf017('0xc'),_0x3a56a1);}[_0xf017('0x9')](_0x16f826){if(!_0x16f826||!_0x16f826[0x0])throw new _0x4a57b0(_0xf017('0x12'),this);const _0x11d184={'types':[],'buffers':[],'baseVersion':_0x16f826[0x0][_0xf017('0x10')]};for(;_0x16f826[_0xf017('0x2')];)this[_0xf017('0xf')](_0xf017('0xc'))[_0xf017('0x9')](_0x11d184,_0x16f826)||this['_getCompressorByName']('TypingAction')[_0xf017('0x9')](_0x11d184,_0x16f826)||this['_getCompressorByName'](_0xf017('0x0'))[_0xf017('0x9')](_0x11d184,_0x16f826)||this[_0xf017('0xf')](_0xf017('0x13'))['compress'](_0x11d184,_0x16f826)||this[_0xf017('0xf')]('CommentMarkerOperation')[_0xf017('0x9')](_0x11d184,_0x16f826)||this[_0xf017('0xf')]('SuggestionMarkerOperation')['compress'](_0x11d184,_0x16f826)||this[_0xf017('0xf')](_0x16f826[0x0][_0xf017('0x3')])[_0xf017('0x9')](_0x11d184,_0x16f826);return _0x11d184;}['decompress'](_0x2a5506){const _0x94b3ff=[];for(;_0x2a5506[_0xf017('0x1b')]['length'];){this['_compressorById'][_0xf017('0x16')](_0x2a5506['types'][0x0])[_0xf017('0x1c')](_0x94b3ff,_0x2a5506);}return _0x94b3ff[_0xf017('0x4')]((_0x1ec71a,_0x36517a)=>_0x1ec71a['baseVersion']=_0x2a5506['baseVersion']+_0x36517a),_0x94b3ff;}[_0xf017('0xf')](_0x58b413){return this[_0xf017('0x1f')][_0xf017('0x16')](_0x58b413);}['_registerOperationCompressor'](_0x2f91d0,_0xecc7ac,_0x4e2586){const _0xe145a0=new _0x4e2586(_0x2f91d0,_0xecc7ac,this[_0xf017('0x1e')][_0xf017('0x6')](_0xecc7ac));this['_registerCompressor'](_0x2f91d0,_0xecc7ac,_0xe145a0);}['_registerActionCompressor'](_0x2ea79f,_0x1931c2,_0x35ae10){const _0x35ebbb=new _0x35ae10(_0x2ea79f,this);this['_registerCompressor'](_0x2ea79f,_0x1931c2,_0x35ebbb);}['_registerCompressor'](_0x23d7f9,_0xfbce7,_0x3d618d){this[_0xf017('0x15')][_0xf017('0x8')](_0x23d7f9,_0x3d618d),this['_compressorByName'][_0xf017('0x8')](_0xfbce7,_0x3d618d);}}
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);}}