@ckeditor/ckeditor5-operations-compressor 40.2.0 → 41.1.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.
- package/LICENSE.md +1 -1
- package/README.md +2 -2
- package/package.json +3 -2
- package/src/actioncompressor/actioncompressor.d.ts +2 -2
- package/src/actioncompressor/actioncompressor.js +2 -2
- package/src/actioncompressor/deletingactioncompressor.d.ts +3 -3
- package/src/actioncompressor/deletingactioncompressor.js +2 -2
- package/src/actioncompressor/forwarddeletingactioncompressor.d.ts +3 -3
- package/src/actioncompressor/forwarddeletingactioncompressor.js +2 -2
- package/src/actioncompressor/typingactioncompressor.d.ts +3 -3
- package/src/actioncompressor/typingactioncompressor.js +2 -2
- package/src/actioncompressor/userselectionactioncompressor.d.ts +3 -3
- package/src/actioncompressor/userselectionactioncompressor.js +2 -2
- package/src/compressor.d.ts +1 -1
- package/src/compressor.js +2 -2
- package/src/lib/compiledmessages.js +2 -2
- package/src/operationcompressor/annotationmarkeroperationcompressor.d.ts +5 -5
- package/src/operationcompressor/annotationmarkeroperationcompressor.js +2 -2
- package/src/operationcompressor/attributeoperationcompressor.d.ts +4 -4
- package/src/operationcompressor/attributeoperationcompressor.js +2 -2
- package/src/operationcompressor/insertoperationcompressor.d.ts +4 -4
- package/src/operationcompressor/insertoperationcompressor.js +2 -2
- package/src/operationcompressor/markeroperationcompressor.d.ts +4 -4
- package/src/operationcompressor/markeroperationcompressor.js +2 -2
- package/src/operationcompressor/nooperationcompressor.d.ts +4 -4
- package/src/operationcompressor/nooperationcompressor.js +2 -2
- package/src/operationcompressor/operationcompressor.d.ts +4 -4
- package/src/operationcompressor/operationcompressor.js +2 -2
- package/src/protobufdescriptions.d.ts +1 -1
- package/src/protobufdescriptions.js +2 -2
- package/src/protobuffactory.d.ts +1 -1
- package/src/protobuffactory.js +2 -2
- package/src/utils.d.ts +1 -1
- package/src/utils.js +2 -2
package/LICENSE.md
CHANGED
|
@@ -2,7 +2,7 @@ Software License Agreement
|
|
|
2
2
|
==========================
|
|
3
3
|
|
|
4
4
|
**CKEditor 5 operations compressor**<br>
|
|
5
|
-
Copyright (c) 2003–
|
|
5
|
+
Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
|
6
6
|
|
|
7
7
|
CKEditor 5 operations compressor is licensed under a commercial license and is protected by copyright law.
|
|
8
8
|
For more details about available licensing options please contact us at sales@cksource.com.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-operations-compressor)
|
|
4
4
|
|
|
5
|
-
CKEditor 5 operations compressor is a low-level API that compresses and decompresses operations to a normalized binary format
|
|
5
|
+
CKEditor 5 operations compressor is a low-level API that compresses and decompresses operations to a normalized binary format 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/).
|
|
6
6
|
|
|
7
7
|
## Documentation
|
|
8
8
|
|
|
@@ -19,7 +19,7 @@ As a licensed CKEditor 5 Collaboration features user you can report bugs an
|
|
|
19
19
|
## License
|
|
20
20
|
|
|
21
21
|
**CKEditor 5 operations compressor**<br>
|
|
22
|
-
Copyright (c) 2003–
|
|
22
|
+
Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
|
23
23
|
|
|
24
24
|
CKEditor 5 operations compressor is licensed under a commercial license and is protected by copyright law.
|
|
25
25
|
For more details about available licensing options please contact us at sales@cksource.com.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-operations-compressor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "41.1.0",
|
|
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/",
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
"bugs": {
|
|
30
30
|
"url": "https://support.ckeditor.com/hc/en-us/requests/new"
|
|
31
31
|
},
|
|
32
|
+
"type": "module",
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"ckeditor5": "
|
|
34
|
+
"ckeditor5": "41.1.0",
|
|
34
35
|
"lodash-es": "4.17.21",
|
|
35
36
|
"protobufjs": "7.2.4"
|
|
36
37
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import type { CompressedOperationsData, default as Compressor } from '../compressor';
|
|
5
|
+
import type { CompressedOperationsData, default as Compressor } from '../compressor.js';
|
|
6
6
|
/**
|
|
7
7
|
* * Compresses and decompresses multiple operations into the one buffer.
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
2
|
+
* Copyright (c) 2003-2024, 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 _0x184e=['_splitCurrent','_combineNext','_id','shift','types','push','buffers','compress','_compressSingleOperation','length','_decompressSingleOperation'];(function(_0x4b875c,_0x184e6c){const _0x492122=function(_0x4347f1){while(--_0x4347f1){_0x4b875c['push'](_0x4b875c['shift']());}};_0x492122(++_0x184e6c);}(_0x184e,0x1a1));const _0x4921=function(_0x4b875c,_0x184e6c){_0x4b875c=_0x4b875c-0x0;let _0x492122=_0x184e[_0x4b875c];return _0x492122;};import{cloneDeep as _0x24c57c}from'lodash-es';export default class b{constructor(_0x2239cd,_0x3157d9){this[_0x4921('0x3')]=_0x2239cd,this['_context']=_0x3157d9;}[_0x4921('0x8')](_0x28d307,_0x43c6cf){let _0x36a96b;for(;_0x43c6cf[_0x4921('0xa')]>0x1&&this['_compareOperations'](_0x43c6cf[0x0],_0x43c6cf[0x1]);)_0x36a96b?(_0x36a96b=this[_0x4921('0x2')](_0x43c6cf[_0x4921('0x4')](),_0x36a96b),_0x28d307[_0x4921('0x5')][_0x4921('0x6')](0x0)):(_0x36a96b=_0x24c57c(_0x43c6cf[_0x4921('0x4')]()),_0x28d307[_0x4921('0x5')][_0x4921('0x6')](this[_0x4921('0x3')]));return!!_0x36a96b&&(_0x36a96b=this[_0x4921('0x2')](_0x43c6cf[_0x4921('0x4')](),_0x36a96b),_0x28d307['types'][_0x4921('0x6')](0x0),_0x28d307[_0x4921('0x7')][_0x4921('0x6')](this[_0x4921('0x9')](_0x36a96b)),!0x0);}['decompress'](_0x4a9161,_0x487b9a){const _0x9d2e17=this[_0x4921('0x0')](_0x487b9a);for(;0x0==_0x487b9a[_0x4921('0x5')][0x0];)_0x487b9a[_0x4921('0x5')][_0x4921('0x4')](),_0x4a9161[_0x4921('0x6')](this[_0x4921('0x1')](_0x9d2e17));_0x4a9161[_0x4921('0x6')](_0x9d2e17);}}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import ActionCompressor from './actioncompressor';
|
|
6
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
5
|
+
import ActionCompressor from './actioncompressor.js';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
7
7
|
export default class DeletingActionCompressor extends ActionCompressor {
|
|
8
8
|
/**
|
|
9
9
|
* @inheritDoc
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
2
|
+
* Copyright (c) 2003-2024, 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 _0x4706=['root','MoveOperation','_checkOperation','howMany','buffers','targetPosition','wasUndone','_splitCurrent','__className','$graveyard','_context','sourcePosition','_getCompressorByName','_combineNext','_compareOperations','_decompressSingleOperation','_compressSingleOperation','compress'];(function(_0x36c05e,_0x4706db){const _0x1970ac=function(_0x2a8a54){while(--_0x2a8a54){_0x36c05e['push'](_0x36c05e['shift']());}};_0x1970ac(++_0x4706db);}(_0x4706,0x14a));const _0x1970=function(_0x36c05e,_0x4706db){_0x36c05e=_0x36c05e-0x0;let _0x1970ac=_0x4706[_0x36c05e];return _0x1970ac;};import _0x616bba from'./actioncompressor.js';import{arePositionsEqual as _0x5c493e,getPositionShiftedBy as _0x6d4fb3}from'../utils.js';import{cloneDeep as _0x5d1d94}from'lodash-es';export default class c extends _0x616bba{[_0x1970('0x7')](_0x594d60,_0x13f104){return _0x13f104[_0x1970('0xf')]++,_0x13f104[_0x1970('0x5')]=_0x5d1d94(_0x594d60['sourcePosition']),_0x13f104;}[_0x1970('0x1')](_0x4c622e){const _0x19a091=_0x5d1d94(_0x4c622e);return _0x4c622e[_0x1970('0xf')]--,_0x19a091[_0x1970('0xf')]=0x1,_0x19a091['sourcePosition']=_0x6d4fb3(_0x19a091['sourcePosition'],_0x4c622e['howMany']),_0x19a091;}[_0x1970('0x8')](_0x397877,_0x502898){return!(!this[_0x1970('0xe')](_0x397877)||!this['_checkOperation'](_0x502898))&&(_0x5c493e(_0x6d4fb3(_0x397877['sourcePosition'],-0x1),_0x502898[_0x1970('0x5')])&&_0x5c493e(_0x397877[_0x1970('0x11')],_0x502898['targetPosition']));}[_0x1970('0xa')](_0x2aec37){const _0x3e5774={'types':[],'buffers':[],'baseVersion':0x0};return this['_context'][_0x1970('0x6')](_0x1970('0xd'))[_0x1970('0xb')](_0x3e5774,[_0x2aec37]),_0x3e5774[_0x1970('0x10')][0x0];}[_0x1970('0x9')](_0xcd173f){const _0x71e37f=[];return this[_0x1970('0x4')][_0x1970('0x6')]('MoveOperation')['decompress'](_0x71e37f,_0xcd173f),_0x71e37f[0x0];}['_checkOperation'](_0x417f99){return _0x1970('0xd')==_0x417f99[_0x1970('0x2')]&&_0x1970('0x3')==_0x417f99[_0x1970('0x11')][_0x1970('0xc')]&&0x1==_0x417f99['howMany']&&!_0x417f99[_0x1970('0x0')];}}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import ActionCompressor from './actioncompressor';
|
|
6
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
5
|
+
import ActionCompressor from './actioncompressor.js';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
7
7
|
export default class ForwardDeletingActionCompressor extends ActionCompressor {
|
|
8
8
|
/**
|
|
9
9
|
* @inheritDoc
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
2
|
+
* Copyright (c) 2003-2024, 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 _0x52f5=['_compressSingleOperation','__className','_compareOperations','_checkOperation','decompress','buffers','targetPosition','root','MoveOperation','compress','_getCompressorByName','$graveyard','sourcePosition','_combineNext','_splitCurrent','_decompressSingleOperation','_context','howMany'];(function(_0x4929a3,_0x52f540){const _0x2c89e9=function(_0x33f9c4){while(--_0x33f9c4){_0x4929a3['push'](_0x4929a3['shift']());}};_0x2c89e9(++_0x52f540);}(_0x52f5,0x197));const _0x2c89=function(_0x4929a3,_0x52f540){_0x4929a3=_0x4929a3-0x0;let _0x2c89e9=_0x52f5[_0x4929a3];return _0x2c89e9;};import _0x36e367 from'./actioncompressor.js';import{arePositionsEqual as _0x2de4a5}from'../utils.js';import{cloneDeep as _0xda3efa}from'lodash-es';export default class h extends _0x36e367{[_0x2c89('0x2')](_0xee2225,_0x24ba69){return _0x24ba69[_0x2c89('0x6')]++,_0x24ba69;}[_0x2c89('0x3')](_0x303051){const _0x18c131=_0xda3efa(_0x303051);return _0x18c131['howMany']=0x1,_0x303051[_0x2c89('0x6')]--,_0x18c131;}[_0x2c89('0x9')](_0x50831f,_0x29ed4f){return!(!this[_0x2c89('0xa')](_0x50831f)||!this[_0x2c89('0xa')](_0x29ed4f))&&(_0x2de4a5(_0x50831f['sourcePosition'],_0x29ed4f[_0x2c89('0x1')])&&_0x2de4a5(_0x50831f[_0x2c89('0xd')],_0x29ed4f[_0x2c89('0xd')]));}[_0x2c89('0x7')](_0x5d9c08){const _0x495153={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x2c89('0x5')][_0x2c89('0x11')](_0x2c89('0xf'))[_0x2c89('0x10')](_0x495153,[_0x5d9c08]),_0x495153[_0x2c89('0xc')][0x0];}[_0x2c89('0x4')](_0x14ddb7){const _0x55c857=[];return this[_0x2c89('0x5')]['_getCompressorByName'](_0x2c89('0xf'))[_0x2c89('0xb')](_0x55c857,_0x14ddb7),_0x55c857[0x0];}[_0x2c89('0xa')](_0x44306e){return _0x2c89('0xf')==_0x44306e[_0x2c89('0x8')]&&_0x2c89('0x0')==_0x44306e[_0x2c89('0xd')][_0x2c89('0xe')]&&0x1==_0x44306e[_0x2c89('0x6')]&&!_0x44306e['wasUndone'];}}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import ActionCompressor from './actioncompressor';
|
|
6
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
5
|
+
import ActionCompressor from './actioncompressor.js';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
7
7
|
export default class TypingActionCompressor extends ActionCompressor {
|
|
8
8
|
/**
|
|
9
9
|
* @inheritDocs
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
2
|
+
* Copyright (c) 2003-2024, 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 _0x14eb=['_checkOperation','substr','data','iterator','_compareAttributes','every','next','nodes','_splitCurrent','compress','_decompressSingleOperation','InsertOperation','attributes','from','_context','_compressSingleOperation','_compareOperations','value','position','length','__className'];(function(_0x1d7cf9,_0x14eb9a){const _0x3b24a0=function(_0xe5f9a4){while(--_0xe5f9a4){_0x1d7cf9['push'](_0x1d7cf9['shift']());}};_0x3b24a0(++_0x14eb9a);}(_0x14eb,0xdf));const _0x3b24=function(_0x1d7cf9,_0x14eb9a){_0x1d7cf9=_0x1d7cf9-0x0;let _0x3b24a0=_0x14eb[_0x1d7cf9];return _0x3b24a0;};import _0x44ea55 from'./actioncompressor.js';import{arePositionsEqual as _0x1cbcc8,getPositionShiftedBy as _0x1cc31f}from'../utils.js';import{cloneDeep as _0x57c9d0}from'lodash-es';export default class m extends _0x44ea55{['_combineNext'](_0x208218,_0x5a0212){return _0x5a0212['nodes'][0x0]['data']+=_0x208218[_0x3b24('0xf')][0x0][_0x3b24('0xa')],_0x5a0212;}[_0x3b24('0x10')](_0x2456c8){const _0x5a5030=_0x57c9d0(_0x2456c8),_0x12316b=_0x5a5030[_0x3b24('0xf')][0x0],_0x41ef64=_0x2456c8[_0x3b24('0xf')][0x0],_0x4fbea4=_0x41ef64['data'][Symbol[_0x3b24('0xb')]]()[_0x3b24('0xe')]()[_0x3b24('0x4')],_0x2ba9e2=_0x4fbea4['length'];return _0x12316b['data']=_0x4fbea4,_0x41ef64[_0x3b24('0xa')]=_0x41ef64[_0x3b24('0xa')][_0x3b24('0x9')](_0x2ba9e2),_0x2456c8[_0x3b24('0x5')]=_0x1cc31f(_0x2456c8['position'],_0x2ba9e2),_0x5a5030;}[_0x3b24('0x3')](_0x502e91,_0xfba030){if(this[_0x3b24('0x8')](_0x502e91)&&this[_0x3b24('0x8')](_0xfba030)){const _0x13ac4a=_0x502e91[_0x3b24('0xf')][0x0][_0x3b24('0xa')][_0x3b24('0x6')],_0x1b7a82=_0x1cbcc8(_0x1cc31f(_0x502e91[_0x3b24('0x5')],_0x13ac4a),_0xfba030[_0x3b24('0x5')]),_0x367ea6=_0x502e91[_0x3b24('0xf')][0x0],_0x2fbd2e=_0xfba030[_0x3b24('0xf')][0x0];return _0x1b7a82&&this['_compareAttributes'](_0x367ea6,_0x2fbd2e);}return!0x1;}[_0x3b24('0x2')](_0x59cb06){const _0x525106={'types':[],'buffers':[],'baseVersion':0x0};return this[_0x3b24('0x1')]['_getCompressorByName'](_0x3b24('0x13'))[_0x3b24('0x11')](_0x525106,[_0x59cb06]),_0x525106['buffers'][0x0];}[_0x3b24('0x12')](_0x29ebde){const _0x4792ed=[];return this[_0x3b24('0x1')]['_getCompressorByName'](_0x3b24('0x13'))['decompress'](_0x4792ed,_0x29ebde),_0x4792ed[0x0];}[_0x3b24('0x8')](_0x42f48f){return _0x3b24('0x13')==_0x42f48f[_0x3b24('0x7')]&&0x1==_0x42f48f['nodes'][_0x3b24('0x6')]&&_0x42f48f['nodes'][0x0][_0x3b24('0xa')]&&!_0x42f48f['wasUndone']&&0x1==Array[_0x3b24('0x0')](_0x42f48f['nodes'][0x0]['data'])['length'];}[_0x3b24('0xc')](_0xe90ca0,_0x5447de){const _0x25ce8a=Object['keys'](_0xe90ca0[_0x3b24('0x14')]||{}),_0x3419f8=Object['keys'](_0x5447de['attributes']||{});return _0x25ce8a[_0x3b24('0x6')]===_0x3419f8[_0x3b24('0x6')]&&_0x25ce8a[_0x3b24('0xd')](_0x5a497a=>_0x5447de[_0x3b24('0x14')][_0x5a497a]&&_0x5447de[_0x3b24('0x14')][_0x5a497a]===_0xe90ca0[_0x3b24('0x14')][_0x5a497a]);}}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import ActionCompressor from './actioncompressor';
|
|
6
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
5
|
+
import ActionCompressor from './actioncompressor.js';
|
|
6
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
7
7
|
export default class UserSelectionActionCompressor extends ActionCompressor {
|
|
8
8
|
/**
|
|
9
9
|
* @inheritDoc
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
2
|
+
* Copyright (c) 2003-2024, 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 _0x776d=['startsWith','_context','user:position:','types','_decompressSingleOperation','oldRange','buffers','end','MarkerOperation','_compressSingleOperation','decompress','newRange','user:','start','split','__className','name','_getCompressorByName','_compareOperations','toNone','shift','compress','push','_id'];(function(_0xdb0047,_0x776d26){const _0x3ff996=function(_0x50d3d4){while(--_0x50d3d4){_0xdb0047['push'](_0xdb0047['shift']());}};_0x3ff996(++_0x776d26);}(_0x776d,0x9d));const _0x3ff9=function(_0xdb0047,_0x776d26){_0xdb0047=_0xdb0047-0x0;let _0x3ff996=_0x776d[_0xdb0047];return _0x3ff996;};import _0x163ecd from'./actioncompressor.js';import{arePositionsEqual as _0x4ba9f5}from'../utils.js';import{cloneDeep as _0x2692c7}from'lodash-es';export default class f extends _0x163ecd{[_0x3ff9('0x8')](_0x32239a,_0x4f21be){if(!this[_0x3ff9('0x5')](_0x4f21be[0x0],_0x4f21be[0x1]))return!0x1;const _0x19eb0e=_0x4f21be['shift']();return _0x19eb0e[_0x3ff9('0x10')]=null,_0x19eb0e['newRange']&&_0x4ba9f5(_0x19eb0e[_0x3ff9('0x16')][_0x3ff9('0x0')],_0x19eb0e['newRange']['end'])&&(_0x19eb0e[_0x3ff9('0x16')][_0x3ff9('0x12')]=null),_0x4f21be[_0x3ff9('0x7')](),_0x32239a['types'][_0x3ff9('0x9')](this[_0x3ff9('0xa')]),_0x32239a['types'][_0x3ff9('0x9')](0x0),_0x32239a[_0x3ff9('0x11')]['push'](this[_0x3ff9('0x14')](_0x19eb0e)),!0x0;}[_0x3ff9('0x15')](_0x357eda,_0x42a4fe){const _0x30cbc1=this['_decompressSingleOperation'](_0x42a4fe);_0x30cbc1['newRange']&&!_0x30cbc1['newRange'][_0x3ff9('0x12')]&&(_0x30cbc1[_0x3ff9('0x16')][_0x3ff9('0x12')]=_0x2692c7(_0x30cbc1[_0x3ff9('0x16')]['start']));const _0x595771=_0x2692c7(_0x30cbc1);_0x595771[_0x3ff9('0x16')]&&(_0x595771[_0x3ff9('0x16')][_0x3ff9('0x0')]['stickiness']=_0x3ff9('0x6'),_0x595771['newRange']['end']=_0x2692c7(_0x595771['newRange']['start'])),_0x595771[_0x3ff9('0x3')]=_0x3ff9('0xd')+_0x595771[_0x3ff9('0x3')][_0x3ff9('0x1')](':')[0x2],_0x42a4fe[_0x3ff9('0xe')]['shift'](),_0x357eda[_0x3ff9('0x9')](_0x30cbc1),_0x357eda['push'](_0x595771);}[_0x3ff9('0x14')](_0x3ba196){const _0x4e11d1={'types':[],'buffers':[],'baseVersion':0x0};return this['_context'][_0x3ff9('0x4')]('MarkerOperation')['compress'](_0x4e11d1,[_0x3ba196]),_0x4e11d1[_0x3ff9('0x11')][0x0];}[_0x3ff9('0xf')](_0x426152){const _0x2bee91=[];return this[_0x3ff9('0xc')]['_getCompressorByName'](_0x3ff9('0x13'))[_0x3ff9('0x15')](_0x2bee91,_0x426152),_0x2bee91[0x0];}[_0x3ff9('0x5')](_0x583800,_0x375676){return!(!_0x583800||!_0x375676)&&('MarkerOperation'==_0x583800[_0x3ff9('0x2')]&&_0x3ff9('0x13')==_0x375676['__className']&&!(!_0x583800[_0x3ff9('0x3')]['startsWith'](_0x3ff9('0x17'))||!_0x375676['name'][_0x3ff9('0xb')]('user:')||_0x583800['name']==_0x375676[_0x3ff9('0x3')]));}}
|
package/src/compressor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
package/src/compressor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
2
|
+
* Copyright (c) 2003-2024, 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 _0x35d9=['MergeOperation','_protobufFactory','getDescriptor','types','ForwardDeletingAction','decompress','length','_getCompressorByName','MarkerOperation','suggestion','SuggestionMarkerOperation','_registerActionCompressor','TypingAction','AttributeOperation','RenameOperation','UserSelectionAction','baseVersion','set','comment','compress','DeletingAction','CommentMarkerOperation','MoveOperation','SplitOperation','_compressorByName','RootOperation','forEach','_registerCompressor','_registerOperationCompressor','NoOperation','_compressorById','get'];(function(_0x340f56,_0x35d9e4){const _0x498eaf=function(_0x3b18a6){while(--_0x3b18a6){_0x340f56['push'](_0x340f56['shift']());}};_0x498eaf(++_0x35d9e4);}(_0x35d9,0x13e));const _0x498e=function(_0x340f56,_0x35d9e4){_0x340f56=_0x340f56-0x0;let _0x498eaf=_0x35d9[_0x340f56];return _0x498eaf;};import{CKEditorError as _0x25e5bf}from'ckeditor5/src/utils.js';import _0x4279d3 from'./protobuffactory.js';import _0x5221e6 from'./operationcompressor/operationcompressor.js';import _0x111b5f from'./operationcompressor/attributeoperationcompressor.js';import _0x442533 from'./operationcompressor/insertoperationcompressor.js';import _0x163ce6 from'./operationcompressor/markeroperationcompressor.js';import _0xe56455 from'./operationcompressor/nooperationcompressor.js';import _0xa8c763 from'./operationcompressor/annotationmarkeroperationcompressor.js';import _0x545a86 from'./actioncompressor/typingactioncompressor.js';import _0x393980 from'./actioncompressor/deletingactioncompressor.js';import _0x31c5ac from'./actioncompressor/forwarddeletingactioncompressor.js';import _0x2bee32 from'./actioncompressor/userselectionactioncompressor.js';export default class g{constructor(){this[_0x498e('0x0')]=new Map(),this[_0x498e('0x1a')]=new Map(),this['_protobufFactory']=new _0x4279d3();const _0x26d320=this['_protobufFactory'][_0x498e('0x4')](_0x498e('0xa'));this[_0x498e('0x1d')](0x1,_0x498e('0x1f'),new _0xe56455(0x1,_0x498e('0x1f'),void 0x0)),this[_0x498e('0x1e')](0xa,_0x498e('0xf'),_0x111b5f),this[_0x498e('0x1e')](0xb,'InsertOperation',_0x442533),this[_0x498e('0x1e')](0xc,'MarkerOperation',_0x163ce6),this[_0x498e('0x1e')](0xd,_0x498e('0x2'),_0x5221e6),this[_0x498e('0x1e')](0xe,_0x498e('0x18'),_0x5221e6),this[_0x498e('0x1e')](0xf,_0x498e('0x10'),_0x5221e6),this[_0x498e('0x1e')](0x10,'RootAttributeOperation',_0x111b5f),this[_0x498e('0x1e')](0x11,_0x498e('0x19'),_0x5221e6),this['_registerCompressor'](0x12,_0x498e('0x17'),new _0xa8c763(0x12,_0x498e('0xa'),_0x26d320,_0x498e('0x14'))),this[_0x498e('0x1d')](0x13,_0x498e('0xc'),new _0xa8c763(0x13,_0x498e('0xa'),_0x26d320,_0x498e('0xb'))),this[_0x498e('0x1e')](0x14,_0x498e('0x1b'),_0x5221e6),this[_0x498e('0xd')](0x64,'TypingAction',_0x545a86),this[_0x498e('0xd')](0x65,_0x498e('0x16'),_0x393980),this[_0x498e('0xd')](0x66,_0x498e('0x6'),_0x31c5ac),this['_registerActionCompressor'](0x67,_0x498e('0x11'),_0x2bee32);}['compress'](_0x32abd3){if(!_0x32abd3||!_0x32abd3[0x0])throw new _0x25e5bf('no-operations-provided',this);const _0x5ca09a={'types':[],'buffers':[],'baseVersion':_0x32abd3[0x0][_0x498e('0x12')]};for(;_0x32abd3[_0x498e('0x8')];)this['_getCompressorByName'](_0x498e('0x11'))[_0x498e('0x15')](_0x5ca09a,_0x32abd3)||this[_0x498e('0x9')](_0x498e('0xe'))[_0x498e('0x15')](_0x5ca09a,_0x32abd3)||this[_0x498e('0x9')](_0x498e('0x16'))[_0x498e('0x15')](_0x5ca09a,_0x32abd3)||this[_0x498e('0x9')](_0x498e('0x6'))[_0x498e('0x15')](_0x5ca09a,_0x32abd3)||this[_0x498e('0x9')](_0x498e('0x17'))['compress'](_0x5ca09a,_0x32abd3)||this[_0x498e('0x9')](_0x498e('0xc'))[_0x498e('0x15')](_0x5ca09a,_0x32abd3)||this[_0x498e('0x9')](_0x32abd3[0x0]['__className'])[_0x498e('0x15')](_0x5ca09a,_0x32abd3);return _0x5ca09a;}[_0x498e('0x7')](_0x38789b){const _0x57814f=[];for(;_0x38789b['types']['length'];){this[_0x498e('0x0')][_0x498e('0x1')](_0x38789b[_0x498e('0x5')][0x0])[_0x498e('0x7')](_0x57814f,_0x38789b);}return _0x57814f[_0x498e('0x1c')]((_0x177eaf,_0x43de0e)=>_0x177eaf[_0x498e('0x12')]=_0x38789b[_0x498e('0x12')]+_0x43de0e),_0x57814f;}['_getCompressorByName'](_0x59c309){return this[_0x498e('0x1a')][_0x498e('0x1')](_0x59c309);}[_0x498e('0x1e')](_0x34bdf3,_0x270387,_0x20c8af){const _0xa714c7=new _0x20c8af(_0x34bdf3,_0x270387,this[_0x498e('0x3')][_0x498e('0x4')](_0x270387));this[_0x498e('0x1d')](_0x34bdf3,_0x270387,_0xa714c7);}[_0x498e('0xd')](_0x3cfbf4,_0x59a0c6,_0x3703c5){const _0x331c6f=new _0x3703c5(_0x3cfbf4,this);this[_0x498e('0x1d')](_0x3cfbf4,_0x59a0c6,_0x331c6f);}[_0x498e('0x1d')](_0x55f3b9,_0x2e7108,_0x55b68c){this['_compressorById'][_0x498e('0x13')](_0x55f3b9,_0x55b68c),this[_0x498e('0x1a')][_0x498e('0x13')](_0x2e7108,_0x55b68c);}}
|