UNPKG

@ckeditor/ckeditor5-track-changes

Version:

CKEditor 5 track changes plugin.

23 lines • 15.4 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x195e90=_0xb547;(function(_0xbb98fb,_0x29831f){const _0x37cf96=_0xb547,_0x3a71f2=_0xbb98fb();while(!![]){try{const _0x34a7c2=parseInt(_0x37cf96(0x1f2))/0x1*(parseInt(_0x37cf96(0x1f6))/0x2)+-parseInt(_0x37cf96(0x1d0))/0x3+-parseInt(_0x37cf96(0x205))/0x4+parseInt(_0x37cf96(0x207))/0x5+-parseInt(_0x37cf96(0x1f1))/0x6+parseInt(_0x37cf96(0x211))/0x7+-parseInt(_0x37cf96(0x1d4))/0x8;if(_0x34a7c2===_0x29831f)break;else _0x3a71f2['push'](_0x3a71f2['shift']());}catch(_0x662d49){_0x3a71f2['push'](_0x3a71f2['shift']());}}}(_0x1ee7,0x52cab));function _0x1ee7(){const _0x3d142a=['getContainedElement','getNearestSelectionRange','isCollapsed','*Set\x20image\x20width:*\x20%0','start','convertBlockImageToInline','_suggestionFactory','*Set\x20image\x20text\x20alternative:*\x20%0','end','ImageResize','_findSuggestions','chain','ImageUtils','imageTypeBlock','find','enableCommand','TrackChangesEditing','ImageEditing','markDeletion','PictureEditing','183792KaPhBV','1HPqYjl','removeObject','editor','filter','45926thaicR','registerCustomCallback','width','formatInline','createRange','getClosestSelectedImageElement','newValue','getCaptionFromImageModelElement','has','toggleImageCaption','change','ImageTextAlternativeEditing','imageBlock','imageTypeInline','detach','1103572OTUQQx','attribute','3329205fuXSeE','ImageCaptionUtils','subType','resizedWidth','ImageSizeAttributes','ImageCaptionEditing','model','enableDefaultAttributesIntegration','Block\x20image\x20to\x20inline\x20image','FORMAT_IMAGE_SIZE','4735066xpRFzi','imageStylePreApply','*Remove\x20image\x20text\x20alternative*','fromPosition','deletion','join','createRangeOn','plugins','addObject','_registerLegacyDescription','height','getFirstRange','insertImage','imageTextAlternative','ELEMENT_CAPTION','type','format','key','get','isIntersecting','formatBlock','nodeAfter','registerAttributeLabel','convertInlineImageToBlock','selection','locale','imageInline','discard','element','ImageUploadEditing','nodeBefore','markInsertion','Inline\x20image\x20to\x20block\x20image','*Reset\x20image\x20width*','backward','toPrevious','sources','ELEMENT_INLINE_IMAGE','forward','forceDefaultExecution','afterInit','insertion','registerBlockAttribute','markBlockFormat','commandParams','commandName','descriptionFactory','isBlockImage','isOwn','getSuggestionCallback','registerDescriptionCallback','uploadImage','schema','toNext','accept','caption','previous','ImageInlineEditing','1514058DBkjTD','findIndex','document','length','1719328fhrNqM','ImageBlockEditing','resizeImage','alt','isBefore','ELEMENT_IMAGE','isEqual','imageCaption','registerElementLabel'];_0x1ee7=function(){return _0x3d142a;};return _0x1ee7();}import{Plugin as _0x3f620c}from'ckeditor5/src/core.js';import{ModelLivePosition as _0x21565f}from'ckeditor5/src/engine.js';import{getTranslation as _0x585b2c}from'../utils/common-translations.js';function _0xb547(_0x45d601,_0x4022d6){const _0x1ee7ee=_0x1ee7();return _0xb547=function(_0xb547da,_0x20d73c){_0xb547da=_0xb547da-0x1cc;let _0x597227=_0x1ee7ee[_0xb547da];return _0x597227;},_0xb547(_0x45d601,_0x4022d6);}export class TrackChangesImage extends _0x3f620c{[_0x195e90(0x239)](){const _0x411ac7=_0x195e90,_0x4f1e0f=this[_0x411ac7(0x1f4)];if(!_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x1fe)](_0x411ac7(0x1ee)))return;const _0x14d1f6=_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x223)](_0x411ac7(0x1ed)),_0x724c50=_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x223)](_0x411ac7(0x1e9)),_0x2b3304=_0x4f1e0f[_0x411ac7(0x22a)];_0x14d1f6[_0x411ac7(0x1ec)](_0x411ac7(0x21d)),_0x14d1f6[_0x411ac7(0x23f)][_0x411ac7(0x1dc)](_0x411ac7(0x202),_0x4aeda7=>_0x585b2c(_0x2b3304,_0x411ac7(0x1d9),_0x4aeda7)),_0x14d1f6[_0x411ac7(0x23f)][_0x411ac7(0x1dc)](_0x411ac7(0x22b),_0x27871a=>_0x585b2c(_0x2b3304,_0x411ac7(0x236),_0x27871a)),_0x14d1f6[_0x411ac7(0x23f)][_0x411ac7(0x1dc)](_0x411ac7(0x1cd),()=>_0x585b2c(_0x2b3304,_0x411ac7(0x21f))),_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x1fe)](_0x411ac7(0x22e))&&_0x14d1f6[_0x411ac7(0x1ec)](_0x411ac7(0x244)),_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x1fe)](_0x411ac7(0x1d5))&&_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x1fe)](_0x411ac7(0x1cf))&&(_0x14d1f6[_0x411ac7(0x1ec)](_0x411ac7(0x203),(_0x14abd4,_0x3f221d)=>{const _0x2339a9=_0x411ac7,_0x5b0c0e=_0x724c50[_0x2339a9(0x1fb)](_0x4f1e0f[_0x2339a9(0x20d)][_0x2339a9(0x1d2)][_0x2339a9(0x229)]);_0x4f1e0f[_0x2339a9(0x20d)][_0x2339a9(0x200)](()=>{const _0x2816cf=_0x2339a9;_0x14d1f6[_0x2816cf(0x23c)](_0x5b0c0e,{'commandName':_0x2816cf(0x203),'commandParams':[_0x3f221d]},[],_0x2816cf(0x1e2));});}),_0x14d1f6[_0x411ac7(0x1ec)](_0x411ac7(0x1ea),(_0x5b54e8,_0xf26f7)=>{const _0x41c1d3=_0x411ac7;_0x4f1e0f[_0x41c1d3(0x20d)][_0x41c1d3(0x200)](_0x33fc8b=>{const _0x4f7085=_0x41c1d3;let _0x348e5a=_0x724c50[_0x4f7085(0x1fb)](_0x4f1e0f[_0x4f7085(0x20d)][_0x4f7085(0x1d2)][_0x4f7085(0x229)]),_0x4e1259=_0x33fc8b[_0x4f7085(0x217)](_0x348e5a);const _0x36837e=_0x21565f[_0x4f7085(0x214)](_0x4e1259[_0x4f7085(0x1e1)],_0x4f7085(0x234)),_0x4b7666=_0x21565f[_0x4f7085(0x214)](_0x4e1259[_0x4f7085(0x1e5)],_0x4f7085(0x246));_0x14d1f6[_0x4f7085(0x238)](()=>_0x5b54e8(_0xf26f7)),_0x348e5a=_0x724c50[_0x4f7085(0x1fb)](_0x4f1e0f[_0x4f7085(0x20d)][_0x4f7085(0x1d2)][_0x4f7085(0x229)]),_0x4e1259=_0x33fc8b[_0x4f7085(0x217)](_0x348e5a);const _0x578a55=_0x33fc8b[_0x4f7085(0x1fa)](_0x36837e,_0x4b7666);_0x36837e[_0x4f7085(0x204)](),_0x4b7666[_0x4f7085(0x204)](),_0x14d1f6[_0x4f7085(0x23c)](_0x348e5a,{'commandName':_0x4f7085(0x203),'commandParams':[_0xf26f7]},[],_0x4f7085(0x228)),_0x578a55[_0x4f7085(0x1e1)][_0x4f7085(0x1d8)](_0x4e1259[_0x4f7085(0x1e1)])&&_0x14d1f6[_0x4f7085(0x230)](_0x33fc8b[_0x4f7085(0x1fa)](_0x578a55[_0x4f7085(0x1e1)],_0x4e1259[_0x4f7085(0x1e1)]),_0x4f7085(0x228)),_0x4e1259[_0x4f7085(0x1e5)][_0x4f7085(0x1d8)](_0x578a55[_0x4f7085(0x1e5)])&&_0x14d1f6[_0x4f7085(0x230)](_0x33fc8b[_0x4f7085(0x1fa)](_0x4e1259[_0x4f7085(0x1e5)],_0x578a55[_0x4f7085(0x1e5)]),_0x4f7085(0x228));});}),_0x14d1f6[_0x411ac7(0x1e3)][_0x411ac7(0x1f7)](_0x411ac7(0x225),_0x411ac7(0x228),_0x411ac7(0x216),()=>!0x1),_0x14d1f6[_0x411ac7(0x1e3)][_0x411ac7(0x1f7)](_0x411ac7(0x225),_0x411ac7(0x228),_0x411ac7(0x1cc),()=>!0x1),_0x14d1f6[_0x411ac7(0x1e3)][_0x411ac7(0x1f7)](_0x411ac7(0x225),_0x411ac7(0x228),_0x411ac7(0x22c),_0x14d1f6[_0x411ac7(0x1e3)][_0x411ac7(0x242)](_0x411ac7(0x225),'',_0x411ac7(0x1cc))),_0x14d1f6[_0x411ac7(0x1e3)][_0x411ac7(0x1f7)](_0x411ac7(0x23a),_0x411ac7(0x228),_0x411ac7(0x216),()=>!0x1),_0x14d1f6[_0x411ac7(0x1e3)][_0x411ac7(0x1f7)](_0x411ac7(0x23a),_0x411ac7(0x228),_0x411ac7(0x22c),([_0x21f5ba])=>{const _0x1243c4=_0x411ac7,_0x2bc6e5=_0x14d1f6[_0x1243c4(0x1e3)][_0x1243c4(0x242)](_0x1243c4(0x23a),'',_0x1243c4(0x22c));let _0x130c8f=_0x21f5ba[_0x1243c4(0x1e1)],_0x7342eb=_0x21f5ba[_0x1243c4(0x1e5)];const _0x162bb5=_0x4f1e0f[_0x1243c4(0x20d)][_0x1243c4(0x245)][_0x1243c4(0x1de)](_0x130c8f,_0x1243c4(0x233)),_0x7b5d0c=_0x4f1e0f[_0x1243c4(0x20d)][_0x1243c4(0x245)][_0x1243c4(0x1de)](_0x7342eb,_0x1243c4(0x237));_0x162bb5[_0x1243c4(0x1df)]&&(_0x130c8f=_0x162bb5[_0x1243c4(0x1e1)]),_0x7b5d0c[_0x1243c4(0x1df)]&&(_0x7342eb=_0x7b5d0c[_0x1243c4(0x1e5)]),_0x2bc6e5([_0x4f1e0f[_0x1243c4(0x20d)][_0x1243c4(0x1fa)](_0x130c8f,_0x7342eb)]);}),_0x14d1f6[_0x411ac7(0x1e3)][_0x411ac7(0x1f7)](_0x411ac7(0x225),_0x411ac7(0x228),_0x411ac7(0x1e8),_0x99f505),_0x14d1f6[_0x411ac7(0x1e3)][_0x411ac7(0x1f7)](_0x411ac7(0x23a),_0x411ac7(0x228),_0x411ac7(0x1e8),_0x99f505)),_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x1fe)](_0x411ac7(0x20c))&&(_0x14d1f6[_0x411ac7(0x1ec)](_0x411ac7(0x1ff),(_0x672369,_0x19e45f)=>{const _0x223c71=_0x411ac7,_0x380c31=_0x4f1e0f[_0x223c71(0x218)][_0x223c71(0x223)](_0x223c71(0x208));let _0x16424f=_0x724c50[_0x223c71(0x1fb)](_0x4f1e0f[_0x223c71(0x20d)][_0x223c71(0x1d2)][_0x223c71(0x229)]),_0xfeced2=_0x380c31[_0x223c71(0x1fd)](_0x16424f);_0x4f1e0f[_0x223c71(0x20d)][_0x223c71(0x200)](()=>{const _0x3379de=_0x223c71;if(_0xfeced2)return void _0x14d1f6[_0x3379de(0x1ef)](_0x4f1e0f[_0x3379de(0x20d)][_0x3379de(0x217)](_0xfeced2));const _0x143ab6=_0x724c50[_0x3379de(0x240)](_0x16424f);_0x672369(_0x19e45f),_0x16424f=_0x724c50[_0x3379de(0x1fb)](_0x4f1e0f[_0x3379de(0x20d)][_0x3379de(0x1d2)][_0x3379de(0x229)]),_0xfeced2=_0x380c31[_0x3379de(0x1fd)](_0x16424f),_0x14d1f6[_0x3379de(0x230)](_0x4f1e0f[_0x3379de(0x20d)][_0x3379de(0x217)](_0xfeced2),_0x143ab6?null:_0x3379de(0x1db));});}),_0x14d1f6[_0x411ac7(0x1e3)][_0x411ac7(0x1f7)](_0x411ac7(0x23a),_0x411ac7(0x1db),_0x411ac7(0x1e8),_0x99f505));const _0x221f1a=[{'type':_0x411ac7(0x225),'subType':_0x411ac7(0x212)},{'type':_0x411ac7(0x23a),'subType':_0x411ac7(0x1db)},{'type':_0x411ac7(0x225),'subType':_0x411ac7(0x228)},{'type':_0x411ac7(0x23a),'subType':_0x411ac7(0x228)}];function _0x431683(_0x2efd48,_0xed4776){const _0xcef496=_0x411ac7,_0x21057d=_0x221f1a[_0xcef496(0x1d1)](({type:_0x421f72,subType:_0x4f2b03})=>_0x2efd48[_0xcef496(0x220)]==_0x421f72&&_0x2efd48[_0xcef496(0x209)]==_0x4f2b03),_0x50610a=_0x221f1a[_0xcef496(0x1d1)](({type:_0x38f998,subType:_0x1022b4})=>_0xed4776[_0xcef496(0x220)]==_0x38f998&&_0xed4776[_0xcef496(0x209)]==_0x1022b4);if(_0x21057d<0x0||_0x50610a<0x0)return!0x1;const _0x52d47d=_0x2efd48[_0xcef496(0x21c)](),_0x39c799=_0xed4776[_0xcef496(0x21c)]();if((0x0==_0x21057d||0x1==_0x21057d)&&0x2==_0x50610a&&_0x52d47d[_0xcef496(0x224)](_0x39c799))return!0x0;if(0x2==_0x21057d&&0x3==_0x50610a){const _0x2ead1c=_0x14d1f6[_0xcef496(0x1e7)](_0x52d47d,_0xcef496(0x23a))[_0xcef496(0x1f5)](({suggestion:_0x5052d4,meta:_0x5315b5})=>_0x5315b5[_0xcef496(0x241)]&&_0xcef496(0x228)==_0x5052d4[_0xcef496(0x209)]);if(_0x2ead1c[_0xcef496(0x1d3)]>0x1&&_0x39c799[_0xcef496(0x1e5)][_0xcef496(0x1da)](_0x52d47d[_0xcef496(0x1e1)]))return!0x0;if(0x1==_0x2ead1c[_0xcef496(0x1d3)]&&(_0x52d47d[_0xcef496(0x1e1)][_0xcef496(0x1da)](_0x39c799[_0xcef496(0x1e5)])||_0x52d47d[_0xcef496(0x1e5)][_0xcef496(0x1da)](_0x39c799[_0xcef496(0x1e1)])))return!0x0;}if(0x3==_0x21057d&&0x3==_0x50610a&&_0x52d47d[_0xcef496(0x1e1)][_0xcef496(0x1d8)](_0x39c799[_0xcef496(0x1e1)])){const _0x20d197=_0x52d47d[_0xcef496(0x1e5)][_0xcef496(0x226)],_0x525c50=_0x39c799[_0xcef496(0x1e1)][_0xcef496(0x22f)];return _0x724c50[_0xcef496(0x240)](_0x20d197)&&_0x20d197===_0x525c50;}return!0x1;}function _0x99f505(_0x168862,_0x124570){return _0x431683(_0x168862,_0x124570)?[_0x168862,_0x124570]:_0x431683(_0x124570,_0x168862)?[_0x124570,_0x168862]:null;}_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x1fe)](_0x411ac7(0x1e6))&&(_0x14d1f6[_0x411ac7(0x20e)](_0x411ac7(0x1d6)),_0x14d1f6[_0x411ac7(0x23b)](_0x411ac7(0x20a)),_0x14d1f6[_0x411ac7(0x23f)][_0x411ac7(0x227)](_0x411ac7(0x20a),_0x585b2c(_0x2b3304,_0x411ac7(0x210)))),_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x1fe)](_0x411ac7(0x201))&&(_0x14d1f6[_0x411ac7(0x20e)](_0x411ac7(0x21e)),_0x14d1f6[_0x411ac7(0x23b)](_0x411ac7(0x1d7))),_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x1fe)](_0x411ac7(0x1f0))&&(_0x14d1f6[_0x411ac7(0x23b)](_0x411ac7(0x235)),_0x14d1f6[_0x411ac7(0x23f)][_0x411ac7(0x243)](_0x1043aa=>{const _0xd8265b=_0x411ac7;if(_0xd8265b(0x206)!=_0x1043aa[_0xd8265b(0x220)])return;const {data:_0x1bea29}=_0x1043aa;return _0x1bea29&&_0xd8265b(0x235)==_0x1bea29[_0xd8265b(0x222)]?{'type':_0xd8265b(0x221),'content':''}:void 0x0;})),_0x4f1e0f[_0x411ac7(0x218)][_0x411ac7(0x1fe)](_0x411ac7(0x20b))&&(_0x14d1f6[_0x411ac7(0x23b)](_0x411ac7(0x1f8)),_0x14d1f6[_0x411ac7(0x23b)](_0x411ac7(0x21b)),_0x14d1f6[_0x411ac7(0x23f)][_0x411ac7(0x243)](_0x178e71=>{const _0x5ed27b=_0x411ac7;if(_0x5ed27b(0x206)!=_0x178e71[_0x5ed27b(0x220)])return;const {data:_0x3846fb}=_0x178e71;return!_0x3846fb||_0x5ed27b(0x1f8)!=_0x3846fb[_0x5ed27b(0x222)]&&_0x5ed27b(0x21b)!=_0x3846fb[_0x5ed27b(0x222)]?void 0x0:{'type':_0x5ed27b(0x221),'content':''};})),_0x14d1f6[_0x411ac7(0x23f)][_0x411ac7(0x243)](_0x10d6fe=>{const _0x41b3b5=_0x411ac7;if(!!_0x221f1a[_0x41b3b5(0x1eb)](({type:_0x24bf30,subType:_0x56330d})=>_0x10d6fe[_0x41b3b5(0x220)]==_0x24bf30&&_0x10d6fe[_0x41b3b5(0x209)]==_0x56330d))return _0x10d6fe[_0x41b3b5(0x1ce)]?{}:void 0x0;}),_0x14d1f6[_0x411ac7(0x23f)][_0x411ac7(0x243)](_0x2cc6ba=>{const _0x281f14=_0x411ac7;if(_0x281f14(0x23a)==_0x2cc6ba[_0x281f14(0x220)]||_0x281f14(0x215)==_0x2cc6ba[_0x281f14(0x220)]){const _0x1d1864=_0x2cc6ba[_0x281f14(0x1dd)]();if(_0x1d1864&&_0x1d1864['is'](_0x281f14(0x22d),_0x281f14(0x1cd)))return{'type':_0x281f14(0x23a)==_0x2cc6ba[_0x281f14(0x220)]?_0x281f14(0x219):_0x281f14(0x1f3),'element':_0x1d1864,'quantity':0x1};}}),_0x14d1f6[_0x411ac7(0x23f)][_0x411ac7(0x243)](_0x54fc2d=>_0x411ac7(0x225)==_0x54fc2d[_0x411ac7(0x220)]&&_0x411ac7(0x228)==_0x54fc2d[_0x411ac7(0x209)]?{'type':_0x411ac7(0x221),'content':_0x411ac7(0x231)}:_0x411ac7(0x225)==_0x54fc2d[_0x411ac7(0x220)]&&_0x411ac7(0x1e2)==_0x54fc2d[_0x411ac7(0x209)]?{'type':_0x411ac7(0x221),'content':_0x411ac7(0x20f)}:void 0x0),_0x14d1f6[_0x411ac7(0x23f)][_0x411ac7(0x243)](_0x58e2d8=>{const _0x1c4e56=_0x411ac7;if(_0x1c4e56(0x206)!=_0x58e2d8[_0x1c4e56(0x220)])return;const {data:_0x5c7694}=_0x58e2d8;if(!_0x5c7694||_0x1c4e56(0x1d7)!=_0x5c7694[_0x1c4e56(0x222)])return;const _0x20de4f=_0x5c7694[_0x1c4e56(0x1fc)];return _0x20de4f?{'type':_0x1c4e56(0x221),'content':_0x585b2c(_0x2b3304,_0x1c4e56(0x1e4),'\x22'+_0x20de4f+'\x22')}:{'type':_0x1c4e56(0x221),'content':_0x585b2c(_0x2b3304,_0x1c4e56(0x213))};}),this[_0x411ac7(0x21a)]();}[_0x195e90(0x21a)](){const _0x7ab6d8=_0x195e90,_0x104ffc=this[_0x7ab6d8(0x1f4)],_0x3dd902=_0x104ffc[_0x7ab6d8(0x22a)];_0x104ffc[_0x7ab6d8(0x218)][_0x7ab6d8(0x223)](_0x7ab6d8(0x1ed))[_0x7ab6d8(0x23f)][_0x7ab6d8(0x243)](_0x3b3b06=>{const _0x1a974c=_0x7ab6d8;if(_0x1a974c(0x225)!=_0x3b3b06[_0x1a974c(0x220)]&&_0x1a974c(0x1f9)!=_0x3b3b06[_0x1a974c(0x220)])return;const {data:_0x433a5a}=_0x3b3b06;if(_0x433a5a){if(_0x1a974c(0x21e)==_0x433a5a[_0x1a974c(0x23e)]){const _0x40d629=_0x433a5a[_0x1a974c(0x23d)][0x0][_0x1a974c(0x1fc)];return _0x40d629?{'type':_0x1a974c(0x221),'content':_0x585b2c(_0x3dd902,_0x1a974c(0x1e4),'\x22'+_0x40d629+'\x22')}:{'type':_0x1a974c(0x221),'content':_0x585b2c(_0x3dd902,_0x1a974c(0x213))};}if(_0x1a974c(0x1d6)==_0x433a5a[_0x1a974c(0x23e)]){const _0x3b30d9=_0x433a5a[_0x1a974c(0x23d)][0x0][_0x1a974c(0x1f8)];return _0x3b30d9?{'type':_0x1a974c(0x221),'content':_0x585b2c(_0x3dd902,_0x1a974c(0x1e0),_0x3b30d9)}:{'type':_0x1a974c(0x221),'content':_0x585b2c(_0x3dd902,_0x1a974c(0x232))};}}});}}