@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
@@ -1,13 +1,13 @@
1
- import OperationCompressor from './operationcompressor';
2
- import type { CompressedOperationsData } from '../compressor';
3
- import type { InsertOperation } from 'ckeditor5/src/engine';
4
- export default class InsertOperationCompressor extends OperationCompressor {
5
- /**
6
- * @inheritDoc
7
- */
8
- compress(result: CompressedOperationsData, operations: Array<InsertOperation>): boolean;
9
- /**
10
- * @inheritDoc
11
- */
12
- decompress(result: Array<InsertOperation>, data: CompressedOperationsData): void;
13
- }
1
+ import OperationCompressor from './operationcompressor';
2
+ import type { CompressedOperationsData } from '../compressor';
3
+ import type { InsertOperation } from 'ckeditor5/src/engine';
4
+ export default class InsertOperationCompressor extends OperationCompressor {
5
+ /**
6
+ * @inheritDoc
7
+ */
8
+ compress(result: CompressedOperationsData, operations: Array<InsertOperation>): boolean;
9
+ /**
10
+ * @inheritDoc
11
+ */
12
+ decompress(result: Array<InsertOperation>, data: CompressedOperationsData): void;
13
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4e94=['push','nodes','buffers','decompress','shift','attributes','_id','boolean','compress','_operationName','keys','_areValuesBoolean','attributesBoolean','_protobufDescriptor','children','attributesJson','parse','_serializeNodesAttributes','_deserializeNodesAttributes'];(function(_0x5f2d68,_0x4e9416){const _0x24125a=function(_0x4fa68c){while(--_0x4fa68c){_0x5f2d68['push'](_0x5f2d68['shift']());}};_0x24125a(++_0x4e9416);}(_0x4e94,0x1f4));const _0x2412=function(_0x5f2d68,_0x4e9416){_0x5f2d68=_0x5f2d68-0x0;let _0x24125a=_0x4e94[_0x5f2d68];return _0x24125a;};import _0x1ef660 from'./operationcompressor';import{parsePositionBeforeCompression as _0x357a88,parsePositionAfterCompression as _0x34fa4f}from'../utils';export default class s extends _0x1ef660{[_0x2412('0x2')](_0x1b4342,_0x538b95){const _0x43a420=_0x538b95[_0x2412('0x11')]();return this[_0x2412('0xb')](_0x43a420['nodes']),_0x357a88(_0x43a420),_0x1b4342[_0x2412('0xf')][_0x2412('0xd')](this['_protobufDescriptor'][_0x2412('0x2')](_0x43a420)),_0x1b4342['types'][_0x2412('0xd')](this[_0x2412('0x0')]),!0x0;}[_0x2412('0x10')](_0x24de8a,_0x43078a){const {types:_0xca5caf,buffers:_0x5ce4b3}=_0x43078a,_0x10d72c=this[_0x2412('0x7')][_0x2412('0x10')](_0x5ce4b3['shift']());_0xca5caf['shift'](),_0x10d72c[_0x2412('0xe')]||(_0x10d72c[_0x2412('0xe')]=[]),this[_0x2412('0xc')](_0x10d72c[_0x2412('0xe')]),_0x34fa4f(_0x10d72c),_0x10d72c['__className']=this[_0x2412('0x3')],_0x24de8a[_0x2412('0xd')](_0x10d72c);}['_serializeNodesAttributes'](_0x4e6548){for(const _0x91f9bc of _0x4e6548){if(_0x91f9bc[_0x2412('0x12')]){const _0x4396e7=_0x91f9bc[_0x2412('0x12')];this[_0x2412('0x5')](_0x4396e7)?_0x91f9bc[_0x2412('0x6')]=_0x4396e7:_0x91f9bc[_0x2412('0x9')]=JSON['stringify'](_0x4396e7);}_0x91f9bc['children']&&this[_0x2412('0xb')](_0x91f9bc[_0x2412('0x8')]);}}[_0x2412('0xc')](_0x5b12f1){for(const _0x208edd of _0x5b12f1)(_0x208edd[_0x2412('0x6')]||_0x208edd['attributesJson'])&&(_0x208edd['attributesBoolean']?(_0x208edd[_0x2412('0x12')]=_0x208edd[_0x2412('0x6')],delete _0x208edd[_0x2412('0x6')]):(_0x208edd[_0x2412('0x12')]=JSON[_0x2412('0xa')](_0x208edd[_0x2412('0x9')]),delete _0x208edd[_0x2412('0x9')])),_0x208edd['children']&&this[_0x2412('0xc')](_0x208edd[_0x2412('0x8')]);}[_0x2412('0x5')](_0x50f859){return Object[_0x2412('0x4')](_0x50f859)['every'](_0x1e10f4=>_0x2412('0x1')==typeof _0x50f859[_0x1e10f4]);}}
23
+ const _0x3d75=['decompress','_serializeNodesAttributes','push','attributesBoolean','attributesJson','stringify','_deserializeNodesAttributes','shift','boolean','nodes','keys','parse','every','compress','_areValuesBoolean','_id','types','_protobufDescriptor','_operationName','buffers','children','attributes'];(function(_0x1bc224,_0x3d7525){const _0x588213=function(_0x4c917a){while(--_0x4c917a){_0x1bc224['push'](_0x1bc224['shift']());}};_0x588213(++_0x3d7525);}(_0x3d75,0xd8));const _0x5882=function(_0x1bc224,_0x3d7525){_0x1bc224=_0x1bc224-0x0;let _0x588213=_0x3d75[_0x1bc224];return _0x588213;};import _0x4c020b from'./operationcompressor';import{parsePositionBeforeCompression as _0x179074,parsePositionAfterCompression as _0x359fd9}from'../utils';export default class s extends _0x4c020b{[_0x5882('0x11')](_0x24b2b7,_0x50055f){const _0x520125=_0x50055f[_0x5882('0xb')]();return this['_serializeNodesAttributes'](_0x520125['nodes']),_0x179074(_0x520125),_0x24b2b7[_0x5882('0x1')]['push'](this[_0x5882('0x15')][_0x5882('0x11')](_0x520125)),_0x24b2b7[_0x5882('0x14')]['push'](this[_0x5882('0x13')]),!0x0;}[_0x5882('0x4')](_0xde1514,_0x16e4d2){const {types:_0x3bc51e,buffers:_0x25a6a9}=_0x16e4d2,_0x421ca3=this[_0x5882('0x15')][_0x5882('0x4')](_0x25a6a9[_0x5882('0xb')]());_0x3bc51e[_0x5882('0xb')](),_0x421ca3['nodes']||(_0x421ca3[_0x5882('0xd')]=[]),this[_0x5882('0xa')](_0x421ca3[_0x5882('0xd')]),_0x359fd9(_0x421ca3),_0x421ca3['__className']=this[_0x5882('0x0')],_0xde1514[_0x5882('0x6')](_0x421ca3);}[_0x5882('0x5')](_0x5de824){for(const _0x1c77fc of _0x5de824){if(_0x1c77fc['attributes']){const _0x265163=_0x1c77fc[_0x5882('0x3')];this[_0x5882('0x12')](_0x265163)?_0x1c77fc[_0x5882('0x7')]=_0x265163:_0x1c77fc['attributesJson']=JSON[_0x5882('0x9')](_0x265163);}_0x1c77fc[_0x5882('0x2')]&&this[_0x5882('0x5')](_0x1c77fc[_0x5882('0x2')]);}}[_0x5882('0xa')](_0x44027b){for(const _0x1cebbe of _0x44027b)(_0x1cebbe[_0x5882('0x7')]||_0x1cebbe[_0x5882('0x8')])&&(_0x1cebbe['attributesBoolean']?(_0x1cebbe[_0x5882('0x3')]=_0x1cebbe['attributesBoolean'],delete _0x1cebbe['attributesBoolean']):(_0x1cebbe[_0x5882('0x3')]=JSON[_0x5882('0xf')](_0x1cebbe[_0x5882('0x8')]),delete _0x1cebbe[_0x5882('0x8')])),_0x1cebbe['children']&&this[_0x5882('0xa')](_0x1cebbe['children']);}[_0x5882('0x12')](_0x5193ee){return Object[_0x5882('0xe')](_0x5193ee)[_0x5882('0x10')](_0x17184a=>_0x5882('0xc')==typeof _0x5193ee[_0x17184a]);}}
@@ -1,9 +1,9 @@
1
- import OperationCompressor from './operationcompressor';
2
- import type { CompressedOperationsData } from '../compressor';
3
- import type { MarkerOperation } from 'ckeditor5/src/engine';
4
- export default class MarkerOperationCompressor extends OperationCompressor {
5
- /**
6
- * @inheritDoc
7
- */
8
- decompress(result: Array<MarkerOperation>, data: CompressedOperationsData): void;
9
- }
1
+ import OperationCompressor from './operationcompressor';
2
+ import type { CompressedOperationsData } from '../compressor';
3
+ import type { MarkerOperation } from 'ckeditor5/src/engine';
4
+ export default class MarkerOperationCompressor extends OperationCompressor {
5
+ /**
6
+ * @inheritDoc
7
+ */
8
+ decompress(result: Array<MarkerOperation>, data: CompressedOperationsData): void;
9
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4011=['decompress','newRange','oldRange'];(function(_0x2add04,_0x4011ac){const _0x453e66=function(_0x5dbbfe){while(--_0x5dbbfe){_0x2add04['push'](_0x2add04['shift']());}};_0x453e66(++_0x4011ac);}(_0x4011,0x118));const _0x453e=function(_0x2add04,_0x4011ac){_0x2add04=_0x2add04-0x0;let _0x453e66=_0x4011[_0x2add04];return _0x453e66;};import _0x489bb7 from'./operationcompressor';export default class n extends _0x489bb7{[_0x453e('0x2')](_0x1472e2,_0x5d5c63){super[_0x453e('0x2')](_0x1472e2,_0x5d5c63);const _0x1d36a1=_0x1472e2[_0x1472e2['length']-0x1];_0x1d36a1[_0x453e('0x1')]||(_0x1d36a1[_0x453e('0x1')]=null),_0x1d36a1[_0x453e('0x0')]||(_0x1d36a1[_0x453e('0x0')]=null);}}
23
+ const _0xae22=['newRange','oldRange','decompress'];(function(_0x5165e4,_0xae2253){const _0x52fe5c=function(_0x6db12b){while(--_0x6db12b){_0x5165e4['push'](_0x5165e4['shift']());}};_0x52fe5c(++_0xae2253);}(_0xae22,0x1ba));const _0x52fe=function(_0x5165e4,_0xae2253){_0x5165e4=_0x5165e4-0x0;let _0x52fe5c=_0xae22[_0x5165e4];return _0x52fe5c;};import _0xb1a6d6 from'./operationcompressor';export default class n extends _0xb1a6d6{[_0x52fe('0x1')](_0x5d6843,_0x153f68){super[_0x52fe('0x1')](_0x5d6843,_0x153f68);const _0xe7ca3e=_0x5d6843[_0x5d6843['length']-0x1];_0xe7ca3e[_0x52fe('0x0')]||(_0xe7ca3e[_0x52fe('0x0')]=null),_0xe7ca3e['newRange']||(_0xe7ca3e[_0x52fe('0x2')]=null);}}
@@ -1,16 +1,16 @@
1
- import OperationCompressor from './operationcompressor';
2
- import type { CompressedOperationsData } from '../compressor';
3
- import type { Operation } from 'ckeditor5/src/engine';
4
- /**
5
- * @extends OperationCompressor
6
- */
7
- export default class NoOperationCompressor extends OperationCompressor {
8
- /**
9
- * @inheritDoc
10
- */
11
- compress(result: CompressedOperationsData, operations: Array<Operation>): boolean;
12
- /**
13
- * @inheritDoc
14
- */
15
- decompress(result: Array<any>, data: CompressedOperationsData): void;
16
- }
1
+ import OperationCompressor from './operationcompressor';
2
+ import type { CompressedOperationsData } from '../compressor';
3
+ import type { Operation } from 'ckeditor5/src/engine';
4
+ /**
5
+ * @extends OperationCompressor
6
+ */
7
+ export default class NoOperationCompressor extends OperationCompressor {
8
+ /**
9
+ * @inheritDoc
10
+ */
11
+ compress(result: CompressedOperationsData, operations: Array<Operation>): boolean;
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ decompress(result: Array<any>, data: CompressedOperationsData): void;
16
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- var _0x1410=['shift','push','decompress','_id','compress'];(function(_0x1755d6,_0x141012){var _0x30cc90=function(_0x5cd3b6){while(--_0x5cd3b6){_0x1755d6['push'](_0x1755d6['shift']());}};_0x30cc90(++_0x141012);}(_0x1410,0xc6));var _0x30cc=function(_0x1755d6,_0x141012){_0x1755d6=_0x1755d6-0x0;var _0x30cc90=_0x1410[_0x1755d6];return _0x30cc90;};import _0xbb166f from'./operationcompressor';export default class p extends _0xbb166f{[_0x30cc('0x1')](_0x15952b,_0x2c0c41){return _0x2c0c41[_0x30cc('0x2')](),_0x15952b['types'][_0x30cc('0x3')](this[_0x30cc('0x0')]),!0x0;}[_0x30cc('0x4')](_0x407576,_0x725e9c){_0x725e9c['types'][_0x30cc('0x2')](),_0x407576[_0x30cc('0x3')]({'__className':this['_operationName']});}}
23
+ var _0x3f69=['compress','shift','push','_operationName','types','decompress'];(function(_0xb17a49,_0x3f69bc){var _0x449e0e=function(_0x3dca3f){while(--_0x3dca3f){_0xb17a49['push'](_0xb17a49['shift']());}};_0x449e0e(++_0x3f69bc);}(_0x3f69,0x92));var _0x449e=function(_0xb17a49,_0x3f69bc){_0xb17a49=_0xb17a49-0x0;var _0x449e0e=_0x3f69[_0xb17a49];return _0x449e0e;};import _0x2e7d80 from'./operationcompressor';export default class p extends _0x2e7d80{[_0x449e('0x4')](_0x107966,_0x25dc90){return _0x25dc90['shift'](),_0x107966[_0x449e('0x2')][_0x449e('0x0')](this['_id']),!0x0;}[_0x449e('0x3')](_0x5d97f2,_0x391bfc){_0x391bfc['types'][_0x449e('0x5')](),_0x5d97f2[_0x449e('0x0')]({'__className':this[_0x449e('0x1')]});}}
@@ -1,24 +1,24 @@
1
- import type { CompressedOperationsData } from '../compressor';
2
- import type { ProtobufDescriptor } from '../protobuffactory';
3
- import type { Operation } from 'ckeditor5/src/engine';
4
- /**
5
- * Compresses and decompresses single operation to the binary format.
6
- */
7
- export default class OperationCompressor {
8
- constructor(id: number, operationName: string, protobufDescriptor: ProtobufDescriptor);
9
- /**
10
- * Serializes and consumes the first operation from the list.
11
- *
12
- * @param result Object to which compression result will be added.
13
- * @param operations List of operations to compress. The first one will be compressed
14
- * and removed from the list.
15
- */
16
- compress(result: CompressedOperationsData, operations: Array<Operation>): boolean;
17
- /**
18
- * Deserializes and consumes buffered operation.
19
- *
20
- * @param result Decompressed operation.
21
- * @param data Data to decompress.
22
- */
23
- decompress(result: Array<Operation>, data: CompressedOperationsData): void;
24
- }
1
+ import type { CompressedOperationsData } from '../compressor';
2
+ import type { ProtobufDescriptor } from '../protobuffactory';
3
+ import type { Operation } from 'ckeditor5/src/engine';
4
+ /**
5
+ * Compresses and decompresses single operation to the binary format.
6
+ */
7
+ export default class OperationCompressor {
8
+ constructor(id: number, operationName: string, protobufDescriptor: ProtobufDescriptor);
9
+ /**
10
+ * Serializes and consumes the first operation from the list.
11
+ *
12
+ * @param result Object to which compression result will be added.
13
+ * @param operations List of operations to compress. The first one will be compressed
14
+ * and removed from the list.
15
+ */
16
+ compress(result: CompressedOperationsData, operations: Array<Operation>): boolean;
17
+ /**
18
+ * Deserializes and consumes buffered operation.
19
+ *
20
+ * @param result Decompressed operation.
21
+ * @param data Data to decompress.
22
+ */
23
+ decompress(result: Array<Operation>, data: CompressedOperationsData): void;
24
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2304=['decompress','_operationName','push','__className','_protobufDescriptor','shift','_id','buffers','types','compress'];(function(_0x49dd10,_0x2304fc){const _0x239069=function(_0x1f98d8){while(--_0x1f98d8){_0x49dd10['push'](_0x49dd10['shift']());}};_0x239069(++_0x2304fc);}(_0x2304,0x19a));const _0x2390=function(_0x49dd10,_0x2304fc){_0x49dd10=_0x49dd10-0x0;let _0x239069=_0x2304[_0x49dd10];return _0x239069;};import{parsePositionBeforeCompression as _0x42f4f2,parsePositionAfterCompression as _0x2885b9}from'../utils';export default class e{constructor(_0x5a8ec4,_0x3e4e6d,_0x35863c){this[_0x2390('0x6')]=_0x5a8ec4,this[_0x2390('0x1')]=_0x3e4e6d,this[_0x2390('0x4')]=_0x35863c;}[_0x2390('0x9')](_0xb71d50,_0x2a7376){const _0x555c7d=_0x2a7376[_0x2390('0x5')]();return _0x42f4f2(_0x555c7d),_0xb71d50[_0x2390('0x7')][_0x2390('0x2')](this[_0x2390('0x4')][_0x2390('0x9')](_0x555c7d)),_0xb71d50[_0x2390('0x8')][_0x2390('0x2')](this[_0x2390('0x6')]),!0x0;}[_0x2390('0x0')](_0x5e996c,_0x563aaf){_0x563aaf[_0x2390('0x8')][_0x2390('0x5')]();const _0x2a7767=this[_0x2390('0x4')][_0x2390('0x0')](_0x563aaf[_0x2390('0x7')][_0x2390('0x5')]());_0x2885b9(_0x2a7767),_0x2a7767[_0x2390('0x3')]=this[_0x2390('0x1')],_0x5e996c['push'](_0x2a7767);}}
23
+ const _0x53c5=['push','shift','_id','_operationName','buffers','types','__className','_protobufDescriptor','compress'];(function(_0x4ae12a,_0x53c5c1){const _0xda17f2=function(_0x917ad5){while(--_0x917ad5){_0x4ae12a['push'](_0x4ae12a['shift']());}};_0xda17f2(++_0x53c5c1);}(_0x53c5,0x19e));const _0xda17=function(_0x4ae12a,_0x53c5c1){_0x4ae12a=_0x4ae12a-0x0;let _0xda17f2=_0x53c5[_0x4ae12a];return _0xda17f2;};import{parsePositionBeforeCompression as _0x2ea378,parsePositionAfterCompression as _0x142152}from'../utils';export default class e{constructor(_0x3fc259,_0x5c8fdb,_0x1ea41b){this[_0xda17('0x2')]=_0x3fc259,this[_0xda17('0x3')]=_0x5c8fdb,this['_protobufDescriptor']=_0x1ea41b;}[_0xda17('0x8')](_0x2622f1,_0x49f91a){const _0x516777=_0x49f91a[_0xda17('0x1')]();return _0x2ea378(_0x516777),_0x2622f1[_0xda17('0x4')][_0xda17('0x0')](this[_0xda17('0x7')][_0xda17('0x8')](_0x516777)),_0x2622f1[_0xda17('0x5')]['push'](this['_id']),!0x0;}['decompress'](_0x5a86e8,_0xe953f){_0xe953f['types'][_0xda17('0x1')]();const _0x45c040=this[_0xda17('0x7')]['decompress'](_0xe953f['buffers'][_0xda17('0x1')]());_0x142152(_0x45c040),_0x45c040[_0xda17('0x6')]=this[_0xda17('0x3')],_0x5a86e8['push'](_0x45c040);}}
@@ -1,12 +1,12 @@
1
- /**
2
- * Descriptions used by protobuf.
3
- *
4
- * If something fails regarding operations serialization, most probably you forgot to update and recompile protobuf descriptions.
5
- *
6
- * Change the below descriptions accordingly to changes done to the data that is compressed.
7
- * Then, rebuild compiled messages. To do that run `node dev/scripts/compilemessages.js` from main directory.
8
- *
9
- * If you added a new operation type, add it also in `compressor.ts`.
10
- *
11
- * Make sure that the new `compiledmessages.js` is pushed to GH repository.
12
- */
1
+ /**
2
+ * Descriptions used by protobuf.
3
+ *
4
+ * If something fails regarding operations serialization, most probably you forgot to update and recompile protobuf descriptions.
5
+ *
6
+ * Change the below descriptions accordingly to changes done to the data that is compressed.
7
+ * Then, rebuild compiled messages. To do that run `node dev/scripts/compilemessages.js` from main directory.
8
+ *
9
+ * If you added a new operation type, add it also in `compressor.ts`.
10
+ *
11
+ * Make sure that the new `compiledmessages.js` is pushed to GH repository.
12
+ */
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- var _0x17cc=['Position','string','repeated','uint32','exports','Element','bool'];(function(_0x3170cd,_0x17cc2e){var _0x407cd1=function(_0x32815b){while(--_0x32815b){_0x3170cd['push'](_0x3170cd['shift']());}};_0x407cd1(++_0x17cc2e);}(_0x17cc,0x133));var _0x407c=function(_0x3170cd,_0x17cc2e){_0x3170cd=_0x3170cd-0x0;var _0x407cd1=_0x17cc[_0x3170cd];return _0x407cd1;};'use strict';module[_0x407c('0x5')]={'AttributeOperation':{'fields':{'range':{'type':'Range','id':0x1},'key':{'type':'string','id':0x2},'oldValueBoolean':{'type':'bool','id':0x3},'oldValueJson':{'type':_0x407c('0x2'),'id':0x4},'newValueBoolean':{'type':_0x407c('0x0'),'id':0x5},'newValueJson':{'type':_0x407c('0x2'),'id':0x6},'wasUndone':{'type':_0x407c('0x0'),'id':0x7}}},'InsertOperation':{'fields':{'position':{'type':_0x407c('0x1'),'id':0x1},'nodes':{'rule':_0x407c('0x3'),'type':_0x407c('0x6'),'id':0x2},'shouldReceiveAttributes':{'type':_0x407c('0x0'),'id':0x3},'wasUndone':{'type':_0x407c('0x0'),'id':0x4}}},'MarkerOperation':{'fields':{'name':{'type':_0x407c('0x2'),'id':0x1},'oldRange':{'type':'Range','id':0x2},'newRange':{'type':'Range','id':0x3},'affectsData':{'type':'bool','id':0x4},'wasUndone':{'type':_0x407c('0x0'),'id':0x5}}},'MergeOperation':{'fields':{'sourcePosition':{'type':_0x407c('0x1'),'id':0x1},'targetPosition':{'type':_0x407c('0x1'),'id':0x2},'graveyardPosition':{'type':'Position','id':0x3},'howMany':{'type':'uint32','id':0x4},'wasUndone':{'type':_0x407c('0x0'),'id':0x5}}},'MoveOperation':{'fields':{'sourcePosition':{'type':_0x407c('0x1'),'id':0x1},'howMany':{'type':_0x407c('0x4'),'id':0x2},'targetPosition':{'type':_0x407c('0x1'),'id':0x3},'wasUndone':{'type':_0x407c('0x0'),'id':0x4}}},'RenameOperation':{'fields':{'position':{'type':_0x407c('0x1'),'id':0x1},'oldName':{'type':'string','id':0x2},'newName':{'type':_0x407c('0x2'),'id':0x3},'wasUndone':{'type':'bool','id':0x4}}},'RootAttributeOperation':{'fields':{'root':{'type':_0x407c('0x2'),'id':0x1},'key':{'type':_0x407c('0x2'),'id':0x2},'oldValueBoolean':{'type':_0x407c('0x0'),'id':0x3},'oldValueJson':{'type':_0x407c('0x2'),'id':0x4},'newValueBoolean':{'type':_0x407c('0x0'),'id':0x5},'newValueJson':{'type':_0x407c('0x2'),'id':0x6},'wasUndone':{'type':_0x407c('0x0'),'id':0x7}}},'RootOperation':{'fields':{'rootName':{'type':_0x407c('0x2'),'id':0x1},'elementName':{'type':'string','id':0x2},'isAdd':{'type':'bool','id':0x3},'wasUndone':{'type':_0x407c('0x0'),'id':0x4}}},'SplitOperation':{'fields':{'splitPosition':{'type':_0x407c('0x1'),'id':0x1},'graveyardPosition':{'type':_0x407c('0x1'),'id':0x2},'howMany':{'type':_0x407c('0x4'),'id':0x3},'insertionPosition':{'type':'Position','id':0x4},'wasUndone':{'type':'bool','id':0x5}}},'Position':{'fields':{'root':{'type':_0x407c('0x2'),'id':0x1},'rootMain':{'type':_0x407c('0x0'),'id':0x2},'rootGraveyard':{'type':_0x407c('0x0'),'id':0x3},'path':{'rule':_0x407c('0x3'),'type':'uint32','id':0x4},'stickiness':{'type':_0x407c('0x2'),'id':0x5}}},'Range':{'fields':{'start':{'type':_0x407c('0x1'),'id':0x1},'end':{'type':_0x407c('0x1'),'id':0x2}}},'Element':{'fields':{'name':{'type':_0x407c('0x2'),'id':0x1},'children':{'rule':_0x407c('0x3'),'type':_0x407c('0x6'),'id':0x2},'data':{'type':_0x407c('0x2'),'id':0x3},'attributesBoolean':{'keyType':'string','type':_0x407c('0x0'),'id':0x4},'attributesJson':{'type':'string','id':0x5}}}};
23
+ var _0x5080=['Element','repeated','string','bool','Range','uint32','Position'];(function(_0xea604,_0x5080c6){var _0x29cdef=function(_0x45f78d){while(--_0x45f78d){_0xea604['push'](_0xea604['shift']());}};_0x29cdef(++_0x5080c6);}(_0x5080,0x67));var _0x29cd=function(_0xea604,_0x5080c6){_0xea604=_0xea604-0x0;var _0x29cdef=_0x5080[_0xea604];return _0x29cdef;};'use strict';module['exports']={'AttributeOperation':{'fields':{'range':{'type':_0x29cd('0x6'),'id':0x1},'key':{'type':_0x29cd('0x4'),'id':0x2},'oldValueBoolean':{'type':_0x29cd('0x5'),'id':0x3},'oldValueJson':{'type':_0x29cd('0x4'),'id':0x4},'newValueBoolean':{'type':_0x29cd('0x5'),'id':0x5},'newValueJson':{'type':'string','id':0x6},'wasUndone':{'type':_0x29cd('0x5'),'id':0x7}}},'InsertOperation':{'fields':{'position':{'type':_0x29cd('0x1'),'id':0x1},'nodes':{'rule':'repeated','type':'Element','id':0x2},'shouldReceiveAttributes':{'type':_0x29cd('0x5'),'id':0x3},'wasUndone':{'type':'bool','id':0x4}}},'MarkerOperation':{'fields':{'name':{'type':_0x29cd('0x4'),'id':0x1},'oldRange':{'type':_0x29cd('0x6'),'id':0x2},'newRange':{'type':_0x29cd('0x6'),'id':0x3},'affectsData':{'type':_0x29cd('0x5'),'id':0x4},'wasUndone':{'type':_0x29cd('0x5'),'id':0x5}}},'MergeOperation':{'fields':{'sourcePosition':{'type':_0x29cd('0x1'),'id':0x1},'targetPosition':{'type':_0x29cd('0x1'),'id':0x2},'graveyardPosition':{'type':_0x29cd('0x1'),'id':0x3},'howMany':{'type':_0x29cd('0x0'),'id':0x4},'wasUndone':{'type':_0x29cd('0x5'),'id':0x5}}},'MoveOperation':{'fields':{'sourcePosition':{'type':_0x29cd('0x1'),'id':0x1},'howMany':{'type':_0x29cd('0x0'),'id':0x2},'targetPosition':{'type':_0x29cd('0x1'),'id':0x3},'wasUndone':{'type':_0x29cd('0x5'),'id':0x4}}},'RenameOperation':{'fields':{'position':{'type':_0x29cd('0x1'),'id':0x1},'oldName':{'type':_0x29cd('0x4'),'id':0x2},'newName':{'type':'string','id':0x3},'wasUndone':{'type':'bool','id':0x4}}},'RootAttributeOperation':{'fields':{'root':{'type':_0x29cd('0x4'),'id':0x1},'key':{'type':_0x29cd('0x4'),'id':0x2},'oldValueBoolean':{'type':_0x29cd('0x5'),'id':0x3},'oldValueJson':{'type':'string','id':0x4},'newValueBoolean':{'type':_0x29cd('0x5'),'id':0x5},'newValueJson':{'type':_0x29cd('0x4'),'id':0x6},'wasUndone':{'type':'bool','id':0x7}}},'RootOperation':{'fields':{'rootName':{'type':_0x29cd('0x4'),'id':0x1},'elementName':{'type':_0x29cd('0x4'),'id':0x2},'isAdd':{'type':_0x29cd('0x5'),'id':0x3},'wasUndone':{'type':_0x29cd('0x5'),'id':0x4}}},'SplitOperation':{'fields':{'splitPosition':{'type':_0x29cd('0x1'),'id':0x1},'graveyardPosition':{'type':_0x29cd('0x1'),'id':0x2},'howMany':{'type':_0x29cd('0x0'),'id':0x3},'insertionPosition':{'type':'Position','id':0x4},'wasUndone':{'type':_0x29cd('0x5'),'id':0x5}}},'Position':{'fields':{'root':{'type':_0x29cd('0x4'),'id':0x1},'rootMain':{'type':_0x29cd('0x5'),'id':0x2},'rootGraveyard':{'type':_0x29cd('0x5'),'id':0x3},'path':{'rule':'repeated','type':_0x29cd('0x0'),'id':0x4},'stickiness':{'type':_0x29cd('0x4'),'id':0x5}}},'Range':{'fields':{'start':{'type':_0x29cd('0x1'),'id':0x1},'end':{'type':'Position','id':0x2}}},'Element':{'fields':{'name':{'type':_0x29cd('0x4'),'id':0x1},'children':{'rule':_0x29cd('0x3'),'type':_0x29cd('0x2'),'id':0x2},'data':{'type':_0x29cd('0x4'),'id':0x3},'attributesBoolean':{'keyType':_0x29cd('0x4'),'type':_0x29cd('0x5'),'id':0x4},'attributesJson':{'type':_0x29cd('0x4'),'id':0x5}}}};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4b2e=['decode','getDescriptor','_protobufRoot','finish','create','_protobuf','compress','toObject','decompress'];(function(_0x712c7c,_0x4b2ebf){const _0xa845d5=function(_0x34c97a){while(--_0x34c97a){_0x712c7c['push'](_0x712c7c['shift']());}};_0xa845d5(++_0x4b2ebf);}(_0x4b2e,0x81));const _0xa845=function(_0x712c7c,_0x4b2ebf){_0x712c7c=_0x712c7c-0x0;let _0xa845d5=_0x4b2e[_0x712c7c];return _0xa845d5;};import*as _0xca5621 from'./lib/compiledmessages';export default class r{constructor(){this[_0xa845('0x8')]=_0xca5621;}[_0xa845('0x7')](_0x58ecf9){return new ProtobufDescriptor(this[_0xa845('0x8')][_0x58ecf9]);}}export class ProtobufDescriptor{constructor(_0x5bf2a6){this[_0xa845('0x2')]=_0x5bf2a6;}[_0xa845('0x3')](_0x210c83){const _0x569333=this[_0xa845('0x2')]['verify'](_0x210c83);if(_0x569333)throw Error(_0x569333);return this[_0xa845('0x2')]['encode'](this['_protobuf'][_0xa845('0x1')](_0x210c83))[_0xa845('0x0')]();}[_0xa845('0x5')](_0x42d128){return this['_protobuf'][_0xa845('0x4')](this[_0xa845('0x2')][_0xa845('0x6')](_0x42d128),{'oneofs':!0x0});}}
23
+ const _0xa005=['decompress','_protobufRoot','toObject','compress','encode','create','_protobuf','verify','getDescriptor'];(function(_0x321414,_0xa005eb){const _0x18d1d9=function(_0x5ceda3){while(--_0x5ceda3){_0x321414['push'](_0x321414['shift']());}};_0x18d1d9(++_0xa005eb);}(_0xa005,0x136));const _0x18d1=function(_0x321414,_0xa005eb){_0x321414=_0x321414-0x0;let _0x18d1d9=_0xa005[_0x321414];return _0x18d1d9;};import*as _0x1685bb from'./lib/compiledmessages';export default class r{constructor(){this[_0x18d1('0x6')]=_0x1685bb;}[_0x18d1('0x4')](_0x2297a7){return new ProtobufDescriptor(this[_0x18d1('0x6')][_0x2297a7]);}}export class ProtobufDescriptor{constructor(_0x57d394){this[_0x18d1('0x2')]=_0x57d394;}[_0x18d1('0x8')](_0x56a077){const _0x876175=this[_0x18d1('0x2')][_0x18d1('0x3')](_0x56a077);if(_0x876175)throw Error(_0x876175);return this[_0x18d1('0x2')][_0x18d1('0x0')](this[_0x18d1('0x2')][_0x18d1('0x1')](_0x56a077))['finish']();}[_0x18d1('0x5')](_0xf5cd8e){return this[_0x18d1('0x2')][_0x18d1('0x7')](this[_0x18d1('0x2')]['decode'](_0xf5cd8e),{'oneofs':!0x0});}}
package/src/utils.d.ts CHANGED
@@ -1,26 +1,26 @@
1
- /**
2
- * Return new position in JSON format shifted by given offset.
3
- *
4
- * @param positionJSON Position serialized to JSON.
5
- * @param shift Offset shift. Can be a negative value.
6
- * @returns New position in JSON format.
7
- */
8
- export declare function getPositionShiftedBy(positionJSON: any, shift: number): any;
9
- /**
10
- * Checks whether one position serialized to JSON is equal to other position serialized to JSON.
11
- */
12
- export declare function arePositionsEqual(positionA: any, positionB: any): boolean;
13
- /**
14
- * For the better compression result one of the two common roots (`main` or `$graveyard`)
15
- * is compressed to the `Boolean` format.
16
- *
17
- * Due tu the Protobuf limitation `Position` descriptor has no dedicated compressor
18
- * so we need to find and format all positions in the operation.
19
- */
20
- export declare function parsePositionBeforeCompression(operation: any): void;
21
- /**
22
- * Position reformatting after decompression.
23
- *
24
- * @see {parsePositionBeforeCompression}.
25
- */
26
- export declare function parsePositionAfterCompression(operation: any): void;
1
+ /**
2
+ * Return new position in JSON format shifted by given offset.
3
+ *
4
+ * @param positionJSON Position serialized to JSON.
5
+ * @param shift Offset shift. Can be a negative value.
6
+ * @returns New position in JSON format.
7
+ */
8
+ export declare function getPositionShiftedBy(positionJSON: any, shift: number): any;
9
+ /**
10
+ * Checks whether one position serialized to JSON is equal to other position serialized to JSON.
11
+ */
12
+ export declare function arePositionsEqual(positionA: any, positionB: any): boolean;
13
+ /**
14
+ * For the better compression result one of the two common roots (`main` or `$graveyard`)
15
+ * is compressed to the `Boolean` format.
16
+ *
17
+ * Due tu the Protobuf limitation `Position` descriptor has no dedicated compressor
18
+ * so we need to find and format all positions in the operation.
19
+ */
20
+ export declare function parsePositionBeforeCompression(operation: any): void;
21
+ /**
22
+ * Position reformatting after decompression.
23
+ *
24
+ * @see {parsePositionBeforeCompression}.
25
+ */
26
+ export declare function parsePositionAfterCompression(operation: any): void;
package/src/utils.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x149b=['root','rootGraveyard','rootMain','$graveyard','main','nodes','path'];(function(_0x1af983,_0x149b6e){const _0x3bdfcb=function(_0x52e955){while(--_0x52e955){_0x1af983['push'](_0x1af983['shift']());}};_0x3bdfcb(++_0x149b6e);}(_0x149b,0xd5));const _0x3bdf=function(_0x1af983,_0x149b6e){_0x1af983=_0x1af983-0x0;let _0x3bdfcb=_0x149b[_0x1af983];return _0x3bdfcb;};import{cloneDeep as _0x176b47,isEqual as _0x43ab42,isObject as _0x29605f}from'lodash-es';export function getPositionShiftedBy(_0x3d9876,_0x56f6fe){const _0x2ea72a=_0x176b47(_0x3d9876);return _0x2ea72a[_0x3bdf('0x3')][_0x2ea72a['path']['length']-0x1]+=_0x56f6fe,_0x2ea72a;}export function arePositionsEqual(_0x6c5b62,_0x5bcd37){return _0x6c5b62[_0x3bdf('0x4')]===_0x5bcd37[_0x3bdf('0x4')]&&_0x43ab42(_0x6c5b62[_0x3bdf('0x3')],_0x5bcd37['path']);}export function parsePositionBeforeCompression(_0x1cfc32){P(_0x1cfc32,_0xe3167f=>(_0x3bdf('0x1')==_0xe3167f[_0x3bdf('0x4')]?(_0xe3167f[_0x3bdf('0x6')]=!0x0,delete _0xe3167f['root']):_0x3bdf('0x0')==_0xe3167f[_0x3bdf('0x4')]&&(_0xe3167f['rootGraveyard']=!0x0,delete _0xe3167f[_0x3bdf('0x4')]),_0xe3167f));}export function parsePositionAfterCompression(_0x58e05f){P(_0x58e05f,_0x32a2c7=>(_0x32a2c7[_0x3bdf('0x6')]?(_0x32a2c7[_0x3bdf('0x4')]=_0x3bdf('0x1'),delete _0x32a2c7[_0x3bdf('0x6')]):_0x32a2c7[_0x3bdf('0x5')]&&(_0x32a2c7['root']=_0x3bdf('0x0'),delete _0x32a2c7[_0x3bdf('0x5')]),_0x32a2c7));}function P(_0x3cf6c8,_0x46cbc1){for(const _0x111f3b in _0x3cf6c8){const _0x4a6c0e=_0x3cf6c8[_0x111f3b];_0x3bdf('0x2')!==_0x111f3b&&_0x29605f(_0x4a6c0e)&&(_0x4a6c0e['path']&&(_0x4a6c0e[_0x3bdf('0x4')]||_0x4a6c0e[_0x3bdf('0x6')]||_0x4a6c0e[_0x3bdf('0x5')])?_0x3cf6c8[_0x111f3b]=_0x46cbc1(_0x4a6c0e):P(_0x4a6c0e,_0x46cbc1));}return _0x3cf6c8;}
23
+ const _0xa09d=['$graveyard','main','path','root','rootMain','rootGraveyard','nodes','length'];(function(_0x369830,_0xa09d0e){const _0x1a33bf=function(_0x257591){while(--_0x257591){_0x369830['push'](_0x369830['shift']());}};_0x1a33bf(++_0xa09d0e);}(_0xa09d,0x149));const _0x1a33=function(_0x369830,_0xa09d0e){_0x369830=_0x369830-0x0;let _0x1a33bf=_0xa09d[_0x369830];return _0x1a33bf;};import{cloneDeep as _0x5ebfff,isEqual as _0x12a83e,isObject as _0x45c0d1}from'lodash-es';export function getPositionShiftedBy(_0x4f8e77,_0x3dec32){const _0x6c8878=_0x5ebfff(_0x4f8e77);return _0x6c8878[_0x1a33('0x1')][_0x6c8878[_0x1a33('0x1')][_0x1a33('0x6')]-0x1]+=_0x3dec32,_0x6c8878;}export function arePositionsEqual(_0x28018c,_0x2df688){return _0x28018c[_0x1a33('0x2')]===_0x2df688['root']&&_0x12a83e(_0x28018c[_0x1a33('0x1')],_0x2df688[_0x1a33('0x1')]);}export function parsePositionBeforeCompression(_0x9bb6e4){P(_0x9bb6e4,_0x333af0=>('main'==_0x333af0[_0x1a33('0x2')]?(_0x333af0[_0x1a33('0x3')]=!0x0,delete _0x333af0[_0x1a33('0x2')]):_0x1a33('0x7')==_0x333af0[_0x1a33('0x2')]&&(_0x333af0['rootGraveyard']=!0x0,delete _0x333af0[_0x1a33('0x2')]),_0x333af0));}export function parsePositionAfterCompression(_0x3af8e4){P(_0x3af8e4,_0x1e6c28=>(_0x1e6c28[_0x1a33('0x3')]?(_0x1e6c28[_0x1a33('0x2')]=_0x1a33('0x0'),delete _0x1e6c28[_0x1a33('0x3')]):_0x1e6c28[_0x1a33('0x4')]&&(_0x1e6c28['root']=_0x1a33('0x7'),delete _0x1e6c28[_0x1a33('0x4')]),_0x1e6c28));}function P(_0x1a774f,_0x4af2e4){for(const _0x239f5f in _0x1a774f){const _0x186023=_0x1a774f[_0x239f5f];_0x1a33('0x5')!==_0x239f5f&&_0x45c0d1(_0x186023)&&(_0x186023['path']&&(_0x186023['root']||_0x186023[_0x1a33('0x3')]||_0x186023[_0x1a33('0x4')])?_0x1a774f[_0x239f5f]=_0x4af2e4(_0x186023):P(_0x186023,_0x4af2e4));}return _0x1a774f;}