@ckeditor/ckeditor5-operations-compressor 38.1.1 → 38.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/package.json +2 -2
  2. package/src/actioncompressor/actioncompressor.d.ts +56 -56
  3. package/src/actioncompressor/actioncompressor.js +1 -1
  4. package/src/actioncompressor/deletingactioncompressor.d.ts +24 -24
  5. package/src/actioncompressor/deletingactioncompressor.js +1 -1
  6. package/src/actioncompressor/forwarddeletingactioncompressor.d.ts +24 -24
  7. package/src/actioncompressor/forwarddeletingactioncompressor.js +1 -1
  8. package/src/actioncompressor/typingactioncompressor.d.ts +24 -24
  9. package/src/actioncompressor/typingactioncompressor.js +1 -1
  10. package/src/actioncompressor/userselectionactioncompressor.d.ts +12 -12
  11. package/src/actioncompressor/userselectionactioncompressor.js +1 -1
  12. package/src/compressor.d.ts +41 -41
  13. package/src/compressor.js +1 -1
  14. package/src/lib/compiledmessages.js +1 -1
  15. package/src/operationcompressor/annotationmarkeroperationcompressor.d.ts +18 -18
  16. package/src/operationcompressor/annotationmarkeroperationcompressor.js +1 -1
  17. package/src/operationcompressor/attributeoperationcompressor.d.ts +13 -13
  18. package/src/operationcompressor/attributeoperationcompressor.js +1 -1
  19. package/src/operationcompressor/insertoperationcompressor.d.ts +13 -13
  20. package/src/operationcompressor/insertoperationcompressor.js +1 -1
  21. package/src/operationcompressor/markeroperationcompressor.d.ts +9 -9
  22. package/src/operationcompressor/markeroperationcompressor.js +1 -1
  23. package/src/operationcompressor/nooperationcompressor.d.ts +16 -16
  24. package/src/operationcompressor/nooperationcompressor.js +1 -1
  25. package/src/operationcompressor/operationcompressor.d.ts +24 -24
  26. package/src/operationcompressor/operationcompressor.js +1 -1
  27. package/src/protobufdescriptions.d.ts +12 -12
  28. package/src/protobufdescriptions.js +1 -1
  29. package/src/protobuffactory.d.ts +1 -1
  30. package/src/protobuffactory.js +1 -1
  31. package/src/utils.d.ts +26 -26
  32. package/src/utils.js +1 -1
@@ -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.js';
2
+ import type { CompressedOperationsData } from '../compressor.js';
3
+ import type { InsertOperation } from 'ckeditor5/src/engine.js';
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 _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]);}}
23
+ const _0x3c55=['compress','parse','stringify','buffers','every','_protobufDescriptor','children','attributes','attributesBoolean','nodes','__className','_deserializeNodesAttributes','boolean','keys','push','_serializeNodesAttributes','_areValuesBoolean','attributesJson','types','_id','decompress','shift','_operationName'];(function(_0xb09f96,_0x3c55d1){const _0x468a27=function(_0x9f60e0){while(--_0x9f60e0){_0xb09f96['push'](_0xb09f96['shift']());}};_0x468a27(++_0x3c55d1);}(_0x3c55,0x92));const _0x468a=function(_0xb09f96,_0x3c55d1){_0xb09f96=_0xb09f96-0x0;let _0x468a27=_0x3c55[_0xb09f96];return _0x468a27;};import _0x4f2f25 from'./operationcompressor.js';import{parsePositionBeforeCompression as _0x582970,parsePositionAfterCompression as _0x40d1ee}from'../utils.js';export default class i extends _0x4f2f25{[_0x468a('0xf')](_0x4f3017,_0x1f552e){const _0x5c50f9=_0x1f552e['shift']();return this[_0x468a('0x7')](_0x5c50f9[_0x468a('0x1')]),_0x582970(_0x5c50f9),_0x4f3017[_0x468a('0x12')][_0x468a('0x6')](this['_protobufDescriptor']['compress'](_0x5c50f9)),_0x4f3017[_0x468a('0xa')][_0x468a('0x6')](this[_0x468a('0xb')]),!0x0;}[_0x468a('0xc')](_0x5344ad,_0x36a26b){const {types:_0x3b5050,buffers:_0x5b8003}=_0x36a26b,_0x561747=this[_0x468a('0x14')]['decompress'](_0x5b8003['shift']());_0x3b5050[_0x468a('0xd')](),_0x561747[_0x468a('0x1')]||(_0x561747[_0x468a('0x1')]=[]),this['_deserializeNodesAttributes'](_0x561747['nodes']),_0x40d1ee(_0x561747),_0x561747[_0x468a('0x2')]=this[_0x468a('0xe')],_0x5344ad[_0x468a('0x6')](_0x561747);}[_0x468a('0x7')](_0x40e6f2){for(const _0x38dec3 of _0x40e6f2){if(_0x38dec3['attributes']){const _0x50453d=_0x38dec3['attributes'];this['_areValuesBoolean'](_0x50453d)?_0x38dec3[_0x468a('0x0')]=_0x50453d:_0x38dec3[_0x468a('0x9')]=JSON[_0x468a('0x11')](_0x50453d);}_0x38dec3[_0x468a('0x15')]&&this[_0x468a('0x7')](_0x38dec3[_0x468a('0x15')]);}}[_0x468a('0x3')](_0x279c7a){for(const _0x3d37e2 of _0x279c7a)(_0x3d37e2[_0x468a('0x0')]||_0x3d37e2[_0x468a('0x9')])&&(_0x3d37e2[_0x468a('0x0')]?(_0x3d37e2[_0x468a('0x16')]=_0x3d37e2[_0x468a('0x0')],delete _0x3d37e2[_0x468a('0x0')]):(_0x3d37e2[_0x468a('0x16')]=JSON[_0x468a('0x10')](_0x3d37e2['attributesJson']),delete _0x3d37e2[_0x468a('0x9')])),_0x3d37e2[_0x468a('0x15')]&&this[_0x468a('0x3')](_0x3d37e2[_0x468a('0x15')]);}[_0x468a('0x8')](_0x54608c){return Object[_0x468a('0x5')](_0x54608c)[_0x468a('0x13')](_0x427147=>_0x468a('0x4')==typeof _0x54608c[_0x427147]);}}
@@ -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.js';
2
+ import type { CompressedOperationsData } from '../compressor.js';
3
+ import type { MarkerOperation } from 'ckeditor5/src/engine.js';
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 _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);}}
23
+ const _0x579d=['length','decompress','oldRange','newRange'];(function(_0x2b7873,_0x579db5){const _0x37b2a9=function(_0x58e502){while(--_0x58e502){_0x2b7873['push'](_0x2b7873['shift']());}};_0x37b2a9(++_0x579db5);}(_0x579d,0x11a));const _0x37b2=function(_0x2b7873,_0x579db5){_0x2b7873=_0x2b7873-0x0;let _0x37b2a9=_0x579d[_0x2b7873];return _0x37b2a9;};import _0x5721d6 from'./operationcompressor.js';export default class n extends _0x5721d6{[_0x37b2('0x3')](_0x12a974,_0x1017c8){super[_0x37b2('0x3')](_0x12a974,_0x1017c8);const _0x518404=_0x12a974[_0x12a974[_0x37b2('0x2')]-0x1];_0x518404[_0x37b2('0x0')]||(_0x518404[_0x37b2('0x0')]=null),_0x518404[_0x37b2('0x1')]||(_0x518404[_0x37b2('0x1')]=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.js';
2
+ import type { CompressedOperationsData } from '../compressor.js';
3
+ import type { Operation } from 'ckeditor5/src/engine.js';
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 _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')]});}}
23
+ var _0x34d2=['_id','shift','_operationName','push','compress','types'];(function(_0x2a9bb6,_0x34d244){var _0x577d4b=function(_0x9d5b06){while(--_0x9d5b06){_0x2a9bb6['push'](_0x2a9bb6['shift']());}};_0x577d4b(++_0x34d244);}(_0x34d2,0x117));var _0x577d=function(_0x2a9bb6,_0x34d244){_0x2a9bb6=_0x2a9bb6-0x0;var _0x577d4b=_0x34d2[_0x2a9bb6];return _0x577d4b;};import _0x57446e from'./operationcompressor.js';export default class p extends _0x57446e{[_0x577d('0x1')](_0x1c0e43,_0x17ac72){return _0x17ac72[_0x577d('0x4')](),_0x1c0e43['types']['push'](this[_0x577d('0x3')]),!0x0;}['decompress'](_0xfe446a,_0x1b6387){_0x1b6387[_0x577d('0x2')][_0x577d('0x4')](),_0xfe446a[_0x577d('0x0')]({'__className':this[_0x577d('0x5')]});}}
@@ -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.js';
2
+ import type { ProtobufDescriptor } from '../protobuffactory.js';
3
+ import type { Operation } from 'ckeditor5/src/engine.js';
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 _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);}}
23
+ const _0x2535=['__className','decompress','_operationName','push','_id','compress','shift','buffers','types','_protobufDescriptor'];(function(_0x37b82a,_0x2535e0){const _0x3e2a90=function(_0x5d90f0){while(--_0x5d90f0){_0x37b82a['push'](_0x37b82a['shift']());}};_0x3e2a90(++_0x2535e0);}(_0x2535,0x14e));const _0x3e2a=function(_0x37b82a,_0x2535e0){_0x37b82a=_0x37b82a-0x0;let _0x3e2a90=_0x2535[_0x37b82a];return _0x3e2a90;};import{parsePositionBeforeCompression as _0xb7c10f,parsePositionAfterCompression as _0x1e3ce3}from'../utils.js';export default class e{constructor(_0xfe7187,_0x1b90f0,_0x19dc6f){this['_id']=_0xfe7187,this[_0x3e2a('0x8')]=_0x1b90f0,this[_0x3e2a('0x5')]=_0x19dc6f;}[_0x3e2a('0x1')](_0x5621d2,_0x5e04bd){const _0x23c575=_0x5e04bd[_0x3e2a('0x2')]();return _0xb7c10f(_0x23c575),_0x5621d2[_0x3e2a('0x3')]['push'](this[_0x3e2a('0x5')][_0x3e2a('0x1')](_0x23c575)),_0x5621d2[_0x3e2a('0x4')]['push'](this[_0x3e2a('0x0')]),!0x0;}['decompress'](_0xb0847e,_0x13f284){_0x13f284[_0x3e2a('0x4')][_0x3e2a('0x2')]();const _0x5c608a=this['_protobufDescriptor'][_0x3e2a('0x7')](_0x13f284['buffers'][_0x3e2a('0x2')]());_0x1e3ce3(_0x5c608a),_0x5c608a[_0x3e2a('0x6')]=this[_0x3e2a('0x8')],_0xb0847e[_0x3e2a('0x9')](_0x5c608a);}}
@@ -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 _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}}}};
23
+ var _0x2c82=['bool','string','repeated','Range','uint32','Position','exports'];(function(_0x5182dd,_0x2c824a){var _0x19ef8d=function(_0x5c3812){while(--_0x5c3812){_0x5182dd['push'](_0x5182dd['shift']());}};_0x19ef8d(++_0x2c824a);}(_0x2c82,0x1ba));var _0x19ef=function(_0x5182dd,_0x2c824a){_0x5182dd=_0x5182dd-0x0;var _0x19ef8d=_0x2c82[_0x5182dd];return _0x19ef8d;};'use strict';module[_0x19ef('0x5')]={'AttributeOperation':{'fields':{'range':{'type':'Range','id':0x1},'key':{'type':_0x19ef('0x0'),'id':0x2},'oldValueBoolean':{'type':_0x19ef('0x6'),'id':0x3},'oldValueJson':{'type':_0x19ef('0x0'),'id':0x4},'newValueBoolean':{'type':_0x19ef('0x6'),'id':0x5},'newValueJson':{'type':_0x19ef('0x0'),'id':0x6},'wasUndone':{'type':_0x19ef('0x6'),'id':0x7}}},'InsertOperation':{'fields':{'position':{'type':_0x19ef('0x4'),'id':0x1},'nodes':{'rule':'repeated','type':'Element','id':0x2},'shouldReceiveAttributes':{'type':'bool','id':0x3},'wasUndone':{'type':_0x19ef('0x6'),'id':0x4}}},'MarkerOperation':{'fields':{'name':{'type':_0x19ef('0x0'),'id':0x1},'oldRange':{'type':'Range','id':0x2},'newRange':{'type':_0x19ef('0x2'),'id':0x3},'affectsData':{'type':_0x19ef('0x6'),'id':0x4},'wasUndone':{'type':_0x19ef('0x6'),'id':0x5}}},'MergeOperation':{'fields':{'sourcePosition':{'type':_0x19ef('0x4'),'id':0x1},'targetPosition':{'type':_0x19ef('0x4'),'id':0x2},'graveyardPosition':{'type':'Position','id':0x3},'howMany':{'type':_0x19ef('0x3'),'id':0x4},'wasUndone':{'type':_0x19ef('0x6'),'id':0x5}}},'MoveOperation':{'fields':{'sourcePosition':{'type':'Position','id':0x1},'howMany':{'type':_0x19ef('0x3'),'id':0x2},'targetPosition':{'type':'Position','id':0x3},'wasUndone':{'type':_0x19ef('0x6'),'id':0x4}}},'RenameOperation':{'fields':{'position':{'type':_0x19ef('0x4'),'id':0x1},'oldName':{'type':_0x19ef('0x0'),'id':0x2},'newName':{'type':_0x19ef('0x0'),'id':0x3},'wasUndone':{'type':_0x19ef('0x6'),'id':0x4}}},'RootAttributeOperation':{'fields':{'root':{'type':_0x19ef('0x0'),'id':0x1},'key':{'type':'string','id':0x2},'oldValueBoolean':{'type':_0x19ef('0x6'),'id':0x3},'oldValueJson':{'type':_0x19ef('0x0'),'id':0x4},'newValueBoolean':{'type':_0x19ef('0x6'),'id':0x5},'newValueJson':{'type':_0x19ef('0x0'),'id':0x6},'wasUndone':{'type':_0x19ef('0x6'),'id':0x7}}},'RootOperation':{'fields':{'rootName':{'type':_0x19ef('0x0'),'id':0x1},'elementName':{'type':'string','id':0x2},'isAdd':{'type':'bool','id':0x3},'wasUndone':{'type':_0x19ef('0x6'),'id':0x4}}},'SplitOperation':{'fields':{'splitPosition':{'type':_0x19ef('0x4'),'id':0x1},'graveyardPosition':{'type':_0x19ef('0x4'),'id':0x2},'howMany':{'type':_0x19ef('0x3'),'id':0x3},'insertionPosition':{'type':_0x19ef('0x4'),'id':0x4},'wasUndone':{'type':'bool','id':0x5}}},'Position':{'fields':{'root':{'type':_0x19ef('0x0'),'id':0x1},'rootMain':{'type':_0x19ef('0x6'),'id':0x2},'rootGraveyard':{'type':_0x19ef('0x6'),'id':0x3},'path':{'rule':_0x19ef('0x1'),'type':_0x19ef('0x3'),'id':0x4},'stickiness':{'type':_0x19ef('0x0'),'id':0x5}}},'Range':{'fields':{'start':{'type':_0x19ef('0x4'),'id':0x1},'end':{'type':_0x19ef('0x4'),'id':0x2}}},'Element':{'fields':{'name':{'type':_0x19ef('0x0'),'id':0x1},'children':{'rule':_0x19ef('0x1'),'type':'Element','id':0x2},'data':{'type':_0x19ef('0x0'),'id':0x3},'attributesBoolean':{'keyType':'string','type':'bool','id':0x4},'attributesJson':{'type':_0x19ef('0x0'),'id':0x5}}}};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
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});}}
23
+ const _0x18de=['toObject','verify','decode','finish','_protobuf','_protobufRoot','getDescriptor','compress','encode'];(function(_0x36cbe6,_0x18decd){const _0x507791=function(_0x227f05){while(--_0x227f05){_0x36cbe6['push'](_0x36cbe6['shift']());}};_0x507791(++_0x18decd);}(_0x18de,0x14a));const _0x5077=function(_0x36cbe6,_0x18decd){_0x36cbe6=_0x36cbe6-0x0;let _0x507791=_0x18de[_0x36cbe6];return _0x507791;};import*as _0x512e8d from'./lib/compiledmessages.js';export default class r{constructor(){this[_0x5077('0x8')]=_0x512e8d;}[_0x5077('0x0')](_0x4c967b){return new ProtobufDescriptor(this[_0x5077('0x8')][_0x4c967b]);}}export class ProtobufDescriptor{constructor(_0x58187b){this[_0x5077('0x7')]=_0x58187b;}[_0x5077('0x1')](_0x5a52fd){const _0x43146b=this[_0x5077('0x7')][_0x5077('0x4')](_0x5a52fd);if(_0x43146b)throw Error(_0x43146b);return this[_0x5077('0x7')][_0x5077('0x2')](this[_0x5077('0x7')]['create'](_0x5a52fd))[_0x5077('0x6')]();}['decompress'](_0x134eb5){return this[_0x5077('0x7')][_0x5077('0x3')](this[_0x5077('0x7')][_0x5077('0x5')](_0x134eb5),{'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 _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;}
23
+ const _0x1745=['$graveyard','path','root','rootGraveyard','main','rootMain','nodes','length'];(function(_0x564207,_0x17455f){const _0x42f529=function(_0x2ecd8b){while(--_0x2ecd8b){_0x564207['push'](_0x564207['shift']());}};_0x42f529(++_0x17455f);}(_0x1745,0x1ce));const _0x42f5=function(_0x564207,_0x17455f){_0x564207=_0x564207-0x0;let _0x42f529=_0x1745[_0x564207];return _0x42f529;};import{cloneDeep as _0x52db35,isEqual as _0x27ac1e,isObject as _0x442f9a}from'lodash-es';export function getPositionShiftedBy(_0x4151cb,_0x5052cd){const _0x13fcbd=_0x52db35(_0x4151cb);return _0x13fcbd[_0x42f5('0x3')][_0x13fcbd[_0x42f5('0x3')][_0x42f5('0x1')]-0x1]+=_0x5052cd,_0x13fcbd;}export function arePositionsEqual(_0x1fbdb8,_0x344159){return _0x1fbdb8[_0x42f5('0x4')]===_0x344159[_0x42f5('0x4')]&&_0x27ac1e(_0x1fbdb8['path'],_0x344159[_0x42f5('0x3')]);}export function parsePositionBeforeCompression(_0x33a030){P(_0x33a030,_0x24a02c=>(_0x42f5('0x6')==_0x24a02c[_0x42f5('0x4')]?(_0x24a02c[_0x42f5('0x7')]=!0x0,delete _0x24a02c['root']):_0x42f5('0x2')==_0x24a02c[_0x42f5('0x4')]&&(_0x24a02c[_0x42f5('0x5')]=!0x0,delete _0x24a02c[_0x42f5('0x4')]),_0x24a02c));}export function parsePositionAfterCompression(_0x403377){P(_0x403377,_0x4d133d=>(_0x4d133d['rootMain']?(_0x4d133d[_0x42f5('0x4')]='main',delete _0x4d133d[_0x42f5('0x7')]):_0x4d133d[_0x42f5('0x5')]&&(_0x4d133d['root']=_0x42f5('0x2'),delete _0x4d133d[_0x42f5('0x5')]),_0x4d133d));}function P(_0x386f5b,_0x1360b3){for(const _0x46d655 in _0x386f5b){const _0x12faac=_0x386f5b[_0x46d655];_0x42f5('0x0')!==_0x46d655&&_0x442f9a(_0x12faac)&&(_0x12faac[_0x42f5('0x3')]&&(_0x12faac[_0x42f5('0x4')]||_0x12faac['rootMain']||_0x12faac[_0x42f5('0x5')])?_0x386f5b[_0x46d655]=_0x1360b3(_0x12faac):P(_0x12faac,_0x1360b3));}return _0x386f5b;}