@ckeditor/ckeditor5-operations-compressor 38.2.0-alpha.1 → 39.0.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.
- package/README.md +0 -1
- package/package.json +4 -4
- package/src/actioncompressor/actioncompressor.d.ts +5 -1
- package/src/actioncompressor/actioncompressor.js +2 -2
- package/src/actioncompressor/deletingactioncompressor.d.ts +6 -2
- package/src/actioncompressor/deletingactioncompressor.js +2 -2
- package/src/actioncompressor/forwarddeletingactioncompressor.d.ts +6 -2
- package/src/actioncompressor/forwarddeletingactioncompressor.js +2 -2
- package/src/actioncompressor/typingactioncompressor.d.ts +6 -2
- package/src/actioncompressor/typingactioncompressor.js +2 -2
- package/src/actioncompressor/userselectionactioncompressor.d.ts +6 -2
- package/src/actioncompressor/userselectionactioncompressor.js +2 -2
- package/src/compressor.d.ts +4 -0
- package/src/compressor.js +2 -2
- package/src/lib/compiledmessages.js +2 -2
- package/src/operationcompressor/annotationmarkeroperationcompressor.d.ts +8 -4
- package/src/operationcompressor/annotationmarkeroperationcompressor.js +2 -2
- package/src/operationcompressor/attributeoperationcompressor.d.ts +7 -3
- package/src/operationcompressor/attributeoperationcompressor.js +2 -2
- package/src/operationcompressor/insertoperationcompressor.d.ts +7 -3
- package/src/operationcompressor/insertoperationcompressor.js +2 -2
- package/src/operationcompressor/markeroperationcompressor.d.ts +7 -3
- package/src/operationcompressor/markeroperationcompressor.js +2 -2
- package/src/operationcompressor/nooperationcompressor.d.ts +7 -3
- package/src/operationcompressor/nooperationcompressor.js +2 -2
- package/src/operationcompressor/operationcompressor.d.ts +7 -3
- package/src/operationcompressor/operationcompressor.js +2 -2
- package/src/protobufdescriptions.d.ts +2 -10
- package/src/protobufdescriptions.js +2 -2
- package/src/protobuffactory.d.ts +4 -0
- package/src/protobuffactory.js +2 -2
- package/src/utils.d.ts +4 -0
- package/src/utils.js +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# CKEditor 5 operations compressor
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-operations-compressor)
|
|
4
|
-

|
|
5
4
|
|
|
6
5
|
CKEditor 5 operations compressor is a low-level API that compresses and decompresses operations to a normalized binary format in order to decrease network usage during real-time collaborative editing. It is required by the [CKEditor 5 real-time collaborative editing](https://ckeditor.com/collaboration/real-time/) feature to enable collaboration in [CKEditor 5](https://ckeditor.com/ckeditor-5/).
|
|
7
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-operations-compressor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "39.0.1",
|
|
4
4
|
"description": "CKEditor 5 operations compressor for real-time collaboration.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://ckeditor.com/collaboration/real-time/",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"url": "https://support.ckeditor.com/hc/en-us/requests/new"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"ckeditor5": "
|
|
34
|
-
"lodash-es": "
|
|
35
|
-
"protobufjs": "
|
|
33
|
+
"ckeditor5": "39.0.1",
|
|
34
|
+
"lodash-es": "4.17.21",
|
|
35
|
+
"protobufjs": "7.2.4"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=16.0.0",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
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
|
+
import type { CompressedOperationsData, default as Compressor } from '../compressor';
|
|
2
6
|
/**
|
|
3
7
|
* * Compresses and decompresses multiple operations into the one buffer.
|
|
4
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1573=['_compressSingleOperation','_compareOperations','types','compress','shift','_combineNext','_splitCurrent','_id','push','_decompressSingleOperation'];(function(_0x18ee09,_0x15737f){const _0x35ce97=function(_0x30b7ec){while(--_0x30b7ec){_0x18ee09['push'](_0x18ee09['shift']());}};_0x35ce97(++_0x15737f);}(_0x1573,0xcc));const _0x35ce=function(_0x18ee09,_0x15737f){_0x18ee09=_0x18ee09-0x0;let _0x35ce97=_0x1573[_0x18ee09];return _0x35ce97;};import{cloneDeep as _0x264606}from'lodash-es';export default class b{constructor(_0x4309fa,_0x45830b){this[_0x35ce('0x3')]=_0x4309fa,this['_context']=_0x45830b;}[_0x35ce('0x9')](_0x3ece8f,_0x22335c){let _0x34902f;for(;_0x22335c['length']>0x1&&this[_0x35ce('0x7')](_0x22335c[0x0],_0x22335c[0x1]);)_0x34902f?(_0x34902f=this['_combineNext'](_0x22335c['shift'](),_0x34902f),_0x3ece8f['types'][_0x35ce('0x4')](0x0)):(_0x34902f=_0x264606(_0x22335c[_0x35ce('0x0')]()),_0x3ece8f['types'][_0x35ce('0x4')](this[_0x35ce('0x3')]));return!!_0x34902f&&(_0x34902f=this[_0x35ce('0x1')](_0x22335c[_0x35ce('0x0')](),_0x34902f),_0x3ece8f[_0x35ce('0x8')][_0x35ce('0x4')](0x0),_0x3ece8f['buffers'][_0x35ce('0x4')](this[_0x35ce('0x6')](_0x34902f)),!0x0);}['decompress'](_0x1626cc,_0x40f076){const _0x303b7b=this[_0x35ce('0x5')](_0x40f076);for(;0x0==_0x40f076[_0x35ce('0x8')][0x0];)_0x40f076[_0x35ce('0x8')]['shift'](),_0x1626cc[_0x35ce('0x4')](this[_0x35ce('0x2')](_0x303b7b));_0x1626cc[_0x35ce('0x4')](_0x303b7b);}}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
import ActionCompressor from './actioncompressor';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
3
7
|
export default class DeletingActionCompressor extends ActionCompressor {
|
|
4
8
|
/**
|
|
5
9
|
* @inheritDoc
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x308a=['__className','_compressSingleOperation','_getCompressorByName','howMany','targetPosition','MoveOperation','sourcePosition','_combineNext','wasUndone','_splitCurrent','_compareOperations','decompress','_checkOperation','root','_context'];(function(_0x543cb0,_0x308ac2){const _0xd8c292=function(_0x1cf398){while(--_0x1cf398){_0x543cb0['push'](_0x543cb0['shift']());}};_0xd8c292(++_0x308ac2);}(_0x308a,0x1c6));const _0xd8c2=function(_0x543cb0,_0x308ac2){_0x543cb0=_0x543cb0-0x0;let _0xd8c292=_0x308a[_0x543cb0];return _0xd8c292;};import _0x18aaac from'./actioncompressor';import{arePositionsEqual as _0x379d94,getPositionShiftedBy as _0x1220a2}from'../utils';import{cloneDeep as _0x5e1c44}from'lodash-es';export default class c extends _0x18aaac{[_0xd8c2('0x3')](_0x1bec46,_0x4ea2ca){return _0x4ea2ca['howMany']++,_0x4ea2ca['sourcePosition']=_0x5e1c44(_0x1bec46[_0xd8c2('0x2')]),_0x4ea2ca;}[_0xd8c2('0x5')](_0x446104){const _0x1650bc=_0x5e1c44(_0x446104);return _0x446104[_0xd8c2('0xe')]--,_0x1650bc[_0xd8c2('0xe')]=0x1,_0x1650bc[_0xd8c2('0x2')]=_0x1220a2(_0x1650bc['sourcePosition'],_0x446104[_0xd8c2('0xe')]),_0x1650bc;}[_0xd8c2('0x6')](_0x1602cd,_0x3f6867){return!(!this[_0xd8c2('0x8')](_0x1602cd)||!this['_checkOperation'](_0x3f6867))&&(_0x379d94(_0x1220a2(_0x1602cd[_0xd8c2('0x2')],-0x1),_0x3f6867[_0xd8c2('0x2')])&&_0x379d94(_0x1602cd[_0xd8c2('0x0')],_0x3f6867[_0xd8c2('0x0')]));}[_0xd8c2('0xc')](_0x5bdd5e){const _0x24eee0={'types':[],'buffers':[],'baseVersion':0x0};return this[_0xd8c2('0xa')][_0xd8c2('0xd')](_0xd8c2('0x1'))['compress'](_0x24eee0,[_0x5bdd5e]),_0x24eee0['buffers'][0x0];}['_decompressSingleOperation'](_0x5e7053){const _0x3a25dd=[];return this[_0xd8c2('0xa')]['_getCompressorByName'](_0xd8c2('0x1'))[_0xd8c2('0x7')](_0x3a25dd,_0x5e7053),_0x3a25dd[0x0];}[_0xd8c2('0x8')](_0x7f7271){return _0xd8c2('0x1')==_0x7f7271[_0xd8c2('0xb')]&&'$graveyard'==_0x7f7271[_0xd8c2('0x0')][_0xd8c2('0x9')]&&0x1==_0x7f7271['howMany']&&!_0x7f7271[_0xd8c2('0x4')];}}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
import ActionCompressor from './actioncompressor';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
3
7
|
export default class ForwardDeletingActionCompressor extends ActionCompressor {
|
|
4
8
|
/**
|
|
5
9
|
* @inheritDoc
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1874=['_getCompressorByName','MoveOperation','_combineNext','_compareOperations','$graveyard','root','targetPosition','__className','sourcePosition','decompress','buffers','wasUndone','howMany','_checkOperation','_compressSingleOperation'];(function(_0x4883b3,_0x1874a6){const _0x3c45a4=function(_0x20380e){while(--_0x20380e){_0x4883b3['push'](_0x4883b3['shift']());}};_0x3c45a4(++_0x1874a6);}(_0x1874,0x194));const _0x3c45=function(_0x4883b3,_0x1874a6){_0x4883b3=_0x4883b3-0x0;let _0x3c45a4=_0x1874[_0x4883b3];return _0x3c45a4;};import _0x572f30 from'./actioncompressor';import{arePositionsEqual as _0x5bf6ad}from'../utils';import{cloneDeep as _0x3655e8}from'lodash-es';export default class h extends _0x572f30{[_0x3c45('0x3')](_0x13c980,_0x24621b){return _0x24621b[_0x3c45('0xd')]++,_0x24621b;}['_splitCurrent'](_0x3d66b5){const _0x5f1fdb=_0x3655e8(_0x3d66b5);return _0x5f1fdb[_0x3c45('0xd')]=0x1,_0x3d66b5['howMany']--,_0x5f1fdb;}[_0x3c45('0x4')](_0x5f68f1,_0x3eb25f){return!(!this[_0x3c45('0xe')](_0x5f68f1)||!this['_checkOperation'](_0x3eb25f))&&(_0x5bf6ad(_0x5f68f1[_0x3c45('0x9')],_0x3eb25f[_0x3c45('0x9')])&&_0x5bf6ad(_0x5f68f1[_0x3c45('0x7')],_0x3eb25f[_0x3c45('0x7')]));}[_0x3c45('0x0')](_0x3118a4){const _0x3bfc4b={'types':[],'buffers':[],'baseVersion':0x0};return this['_context'][_0x3c45('0x1')](_0x3c45('0x2'))['compress'](_0x3bfc4b,[_0x3118a4]),_0x3bfc4b[_0x3c45('0xb')][0x0];}['_decompressSingleOperation'](_0x122941){const _0x19b6a9=[];return this['_context'][_0x3c45('0x1')](_0x3c45('0x2'))[_0x3c45('0xa')](_0x19b6a9,_0x122941),_0x19b6a9[0x0];}[_0x3c45('0xe')](_0xccf5a7){return'MoveOperation'==_0xccf5a7[_0x3c45('0x8')]&&_0x3c45('0x5')==_0xccf5a7['targetPosition'][_0x3c45('0x6')]&&0x1==_0xccf5a7['howMany']&&!_0xccf5a7[_0x3c45('0xc')];}}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
import ActionCompressor from './actioncompressor';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
3
7
|
export default class TypingActionCompressor extends ActionCompressor {
|
|
4
8
|
/**
|
|
5
9
|
* @inheritDocs
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2918=['_context','substr','data','attributes','nodes','__className','from','keys','buffers','_compareAttributes','_compressSingleOperation','_getCompressorByName','_decompressSingleOperation','next','wasUndone','iterator','position','_splitCurrent','_combineNext','decompress','length','InsertOperation','_checkOperation','compress'];(function(_0x3782a8,_0x291897){const _0x574bdc=function(_0x1b63e7){while(--_0x1b63e7){_0x3782a8['push'](_0x3782a8['shift']());}};_0x574bdc(++_0x291897);}(_0x2918,0x14d));const _0x574b=function(_0x3782a8,_0x291897){_0x3782a8=_0x3782a8-0x0;let _0x574bdc=_0x2918[_0x3782a8];return _0x574bdc;};import _0x2cdf33 from'./actioncompressor';import{arePositionsEqual as _0x1184a9,getPositionShiftedBy as _0x321c28}from'../utils';import{cloneDeep as _0x50c35c}from'lodash-es';export default class m extends _0x2cdf33{[_0x574b('0x15')](_0x13dd3e,_0x497e0b){return _0x497e0b[_0x574b('0x7')][0x0][_0x574b('0x5')]+=_0x13dd3e[_0x574b('0x7')][0x0]['data'],_0x497e0b;}[_0x574b('0x14')](_0x241b51){const _0x52dc73=_0x50c35c(_0x241b51),_0x169a55=_0x52dc73['nodes'][0x0],_0x1f1082=_0x241b51[_0x574b('0x7')][0x0],_0x537d34=_0x1f1082[_0x574b('0x5')][Symbol[_0x574b('0x12')]]()[_0x574b('0x10')]()['value'],_0x1265b5=_0x537d34[_0x574b('0x17')];return _0x169a55['data']=_0x537d34,_0x1f1082[_0x574b('0x5')]=_0x1f1082[_0x574b('0x5')][_0x574b('0x4')](_0x1265b5),_0x241b51[_0x574b('0x13')]=_0x321c28(_0x241b51[_0x574b('0x13')],_0x1265b5),_0x52dc73;}['_compareOperations'](_0x59c941,_0x3efc36){if(this[_0x574b('0x1')](_0x59c941)&&this['_checkOperation'](_0x3efc36)){const _0x32409f=_0x59c941[_0x574b('0x7')][0x0]['data'][_0x574b('0x17')],_0x3a3a58=_0x1184a9(_0x321c28(_0x59c941[_0x574b('0x13')],_0x32409f),_0x3efc36[_0x574b('0x13')]),_0x724446=_0x59c941[_0x574b('0x7')][0x0],_0x485d95=_0x3efc36[_0x574b('0x7')][0x0];return _0x3a3a58&&this[_0x574b('0xc')](_0x724446,_0x485d95);}return!0x1;}[_0x574b('0xd')](_0x54e56e){const _0x56ab9e={'types':[],'buffers':[],'baseVersion':0x0};return this['_context']['_getCompressorByName']('InsertOperation')[_0x574b('0x2')](_0x56ab9e,[_0x54e56e]),_0x56ab9e[_0x574b('0xb')][0x0];}[_0x574b('0xf')](_0x3098be){const _0x28b300=[];return this[_0x574b('0x3')][_0x574b('0xe')](_0x574b('0x0'))[_0x574b('0x16')](_0x28b300,_0x3098be),_0x28b300[0x0];}[_0x574b('0x1')](_0x4a0227){return _0x574b('0x0')==_0x4a0227[_0x574b('0x8')]&&0x1==_0x4a0227[_0x574b('0x7')][_0x574b('0x17')]&&_0x4a0227[_0x574b('0x7')][0x0]['data']&&!_0x4a0227[_0x574b('0x11')]&&0x1==Array[_0x574b('0x9')](_0x4a0227['nodes'][0x0][_0x574b('0x5')])[_0x574b('0x17')];}[_0x574b('0xc')](_0x39e7cf,_0x1d6424){const _0x4632cd=Object['keys'](_0x39e7cf[_0x574b('0x6')]||{}),_0x313949=Object[_0x574b('0xa')](_0x1d6424['attributes']||{});return _0x4632cd['length']===_0x313949['length']&&_0x4632cd['every'](_0x48526d=>_0x1d6424[_0x574b('0x6')][_0x48526d]&&_0x1d6424['attributes'][_0x48526d]===_0x39e7cf['attributes'][_0x48526d]);}}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
import ActionCompressor from './actioncompressor';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor';
|
|
3
7
|
export default class UserSelectionActionCompressor extends ActionCompressor {
|
|
4
8
|
/**
|
|
5
9
|
* @inheritDoc
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x3364=['shift','buffers','_compareOperations','_id','_decompressSingleOperation','_context','start','user:position:','MarkerOperation','types','user:','oldRange','newRange','startsWith','_compressSingleOperation','name','_getCompressorByName','push','end','compress','decompress','split'];(function(_0x172d66,_0x3364af){const _0x54ca38=function(_0x1a37f0){while(--_0x1a37f0){_0x172d66['push'](_0x172d66['shift']());}};_0x54ca38(++_0x3364af);}(_0x3364,0xc5));const _0x54ca=function(_0x172d66,_0x3364af){_0x172d66=_0x172d66-0x0;let _0x54ca38=_0x3364[_0x172d66];return _0x54ca38;};import _0x5955ee from'./actioncompressor';import{arePositionsEqual as _0x2a9621}from'../utils';import{cloneDeep as _0x57b57e}from'lodash-es';export default class f extends _0x5955ee{[_0x54ca('0x14')](_0xc0c697,_0x3e9d02){if(!this[_0x54ca('0x3')](_0x3e9d02[0x0],_0x3e9d02[0x1]))return!0x1;const _0x12ca26=_0x3e9d02[_0x54ca('0x1')]();return _0x12ca26[_0x54ca('0xc')]=null,_0x12ca26[_0x54ca('0xd')]&&_0x2a9621(_0x12ca26['newRange']['start'],_0x12ca26[_0x54ca('0xd')]['end'])&&(_0x12ca26['newRange'][_0x54ca('0x13')]=null),_0x3e9d02[_0x54ca('0x1')](),_0xc0c697[_0x54ca('0xa')][_0x54ca('0x12')](this[_0x54ca('0x4')]),_0xc0c697['types'][_0x54ca('0x12')](0x0),_0xc0c697['buffers'][_0x54ca('0x12')](this[_0x54ca('0xf')](_0x12ca26)),!0x0;}['decompress'](_0x3469a8,_0x1aa875){const _0xedcadc=this[_0x54ca('0x5')](_0x1aa875);_0xedcadc[_0x54ca('0xd')]&&!_0xedcadc[_0x54ca('0xd')][_0x54ca('0x13')]&&(_0xedcadc[_0x54ca('0xd')]['end']=_0x57b57e(_0xedcadc[_0x54ca('0xd')][_0x54ca('0x7')]));const _0x57adf1=_0x57b57e(_0xedcadc);_0x57adf1[_0x54ca('0xd')]&&(_0x57adf1[_0x54ca('0xd')]['start']['stickiness']='toNone',_0x57adf1[_0x54ca('0xd')][_0x54ca('0x13')]=_0x57b57e(_0x57adf1[_0x54ca('0xd')][_0x54ca('0x7')])),_0x57adf1['name']=_0x54ca('0x8')+_0x57adf1[_0x54ca('0x10')][_0x54ca('0x0')](':')[0x2],_0x1aa875[_0x54ca('0xa')][_0x54ca('0x1')](),_0x3469a8[_0x54ca('0x12')](_0xedcadc),_0x3469a8['push'](_0x57adf1);}['_compressSingleOperation'](_0x245bcd){const _0x5ac0f5={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x54ca('0x6')][_0x54ca('0x11')](_0x54ca('0x9'))[_0x54ca('0x14')](_0x5ac0f5,[_0x245bcd]),_0x5ac0f5[_0x54ca('0x2')][0x0];}[_0x54ca('0x5')](_0x517213){const _0x5f72e9=[];return this['_context'][_0x54ca('0x11')]('MarkerOperation')[_0x54ca('0x15')](_0x5f72e9,_0x517213),_0x5f72e9[0x0];}[_0x54ca('0x3')](_0x457d3a,_0x4bebf2){return!(!_0x457d3a||!_0x4bebf2)&&(_0x54ca('0x9')==_0x457d3a['__className']&&_0x54ca('0x9')==_0x4bebf2['__className']&&!(!_0x457d3a[_0x54ca('0x10')][_0x54ca('0xe')]('user:')||!_0x4bebf2['name'][_0x54ca('0xe')](_0x54ca('0xb'))||_0x457d3a[_0x54ca('0x10')]==_0x4bebf2['name']));}}
|
package/src/compressor.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* Compresses and decompresses given set of operations in JSON format to/from the binary format using `Protocol Buffers`.
|
|
3
7
|
*/
|
package/src/compressor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
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);}}
|