@ckeditor/ckeditor5-track-changes
Version:
CKEditor 5 track changes plugin.
23 lines • 10.5 kB
JavaScript
/*
* 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 _0x37f81c=_0x2ded;(function(_0x259fef,_0x5836ea){const _0x32bd54=_0x2ded,_0x471e61=_0x259fef();while(!![]){try{const _0x5fe3f0=-parseInt(_0x32bd54(0x158))/0x1+-parseInt(_0x32bd54(0x150))/0x2*(-parseInt(_0x32bd54(0x138))/0x3)+parseInt(_0x32bd54(0x136))/0x4*(parseInt(_0x32bd54(0x12a))/0x5)+-parseInt(_0x32bd54(0x10b))/0x6*(parseInt(_0x32bd54(0x11c))/0x7)+-parseInt(_0x32bd54(0x11d))/0x8*(-parseInt(_0x32bd54(0x144))/0x9)+parseInt(_0x32bd54(0x117))/0xa*(parseInt(_0x32bd54(0xef))/0xb)+parseInt(_0x32bd54(0x120))/0xc*(-parseInt(_0x32bd54(0x128))/0xd);if(_0x5fe3f0===_0x5836ea)break;else _0x471e61['push'](_0x471e61['shift']());}catch(_0x982110){_0x471e61['push'](_0x471e61['shift']());}}}(_0x3c9b,0x7e630));import{Command as _0x532b73}from'ckeditor5/src/core.js';import{BodyCollection as _0x537a11}from'ckeditor5/src/ui.js';import{ViewDowncastWriter as _0xd48750}from'ckeditor5/src/engine.js';import{TrackChangesPreviewView as _0x2cc2a0}from'../ui/view/trackchangespreviewview.js';function _0x2ded(_0x57dec0,_0x35fa37){const _0x3c9baa=_0x3c9b();return _0x2ded=function(_0x2ded61,_0x4c3588){_0x2ded61=_0x2ded61-0xec;let _0x1b5e5a=_0x3c9baa[_0x2ded61];return _0x1b5e5a;},_0x2ded(_0x57dec0,_0x35fa37);}import{getTranslation as _0x4a14e8}from'../utils/common-translations.js';function _0x3c9b(){const _0x43b3c7=['render','ck-focused','replace','ck-media__wrapper','entries','getDefaultValues','3530TMnVka','getLabel','class','domConverter','view','175VVOVet','2651512ycmHjJ','isEnabled','show','24OOkmDQ','destroy','value','locale','attachToDom','innerHTML','getDomRoot','config','2439281QvHqOj','contentView','2617215cLsaDf','classList','string','_fixMediaEmbeds','document','$labels','updatePosition','children','querySelector','editable','refresh','figure.media','4ZvCzOm','add','15apwawL','getMergeFieldsIds','execute','_standarizeRootsData','getClientRects','values','previewMode','forEach','max','ck-reset_all','height','previewDataReady','27TOFQne','ck-track-changes-preview-dialog','remove','getAttribute','getMediaViewElement','get','trackChanges.preview.renderFunction','editables','then','oembed','has','editing','112006LBXuHI','_getMergeFieldsData','detachFromDom','getDataWithAcceptedSuggestions','div','url','_sortRoots','Final\x20content\x20preview','319366hdRqRW','createElement','width','headerView','1265qewRHr','getRootsAttributes','classes','getDataSetValues','innerHeight','model','element','finalContentPreview','once','item','MediaEmbedEditing','push','editor','MergeFieldsEditing','reduce','documentElement','\x20ck-reset_all','Dialog','clientHeight','querySelectorAll','getBoundingClientRect','registry','getRootNames','$defaultValues','set','sort','replaceWith','setPreviewData','150252YczntB','TrackChangesData','affectsData','plugins','bodyCollectionContainer','min'];_0x3c9b=function(){return _0x43b3c7;};return _0x3c9b();}export class PreviewFinalContentCommand extends _0x532b73{constructor(_0x34bdf1){const _0x42461d=_0x2ded;super(_0x34bdf1),this[_0x42461d(0x10d)]=!0x1,this[_0x42461d(0x11e)]=!0x0;}[_0x37f81c(0x134)](){const _0x28cc56=_0x37f81c;this[_0x28cc56(0x11e)]=!0x0;}[_0x37f81c(0x13a)](){const _0x4e48af=_0x37f81c,_0x3d1ae7=this[_0x4e48af(0xfb)],_0x1fd111=_0x3d1ae7[_0x4e48af(0x123)],_0x301088=_0x3d1ae7[_0x4e48af(0x10e)][_0x4e48af(0x149)](_0x4e48af(0x100));let _0xc0fa79;const _0x21a460=function(_0x16796){const _0x461d23=_0x4e48af,_0x5b3a97={};if(_0x461d23(0x14b)in _0x16796['ui'][_0x461d23(0x11b)]){for(const [_0x4510ee,_0x505d90]of Object[_0x461d23(0x115)](_0x16796['ui'][_0x461d23(0x11b)][_0x461d23(0x14b)]))_0x5b3a97[_0x4510ee]=_0x505d90[_0x461d23(0xf5)];}else _0x5b3a97[_0x16796[_0x461d23(0xf4)][_0x461d23(0x12e)][_0x461d23(0x105)]()[0x0]]=_0x16796['ui'][_0x461d23(0x11b)][_0x461d23(0x133)][_0x461d23(0xf5)];return _0x5b3a97;}(_0x3d1ae7),_0x412cca=function(_0x2f80d0){const _0x2f2930=_0x4e48af;let _0x46f26e=0x0;for(const _0x15e98d of Object[_0x2f2930(0x13d)](_0x2f80d0))_0x46f26e=Math[_0x2f2930(0x140)](_0x46f26e,_0x15e98d[_0x2f2930(0x103)]()[_0x2f2930(0xed)]);let _0x4b717d=0x0;for(const _0x575728 of Object[_0x2f2930(0x13d)](_0x2f80d0))_0x4b717d+=_0x575728[_0x2f2930(0x103)]()[_0x2f2930(0x142)];const _0x494c94=0.8*Math[_0x2f2930(0x140)](document[_0x2f2930(0xfe)][_0x2f2930(0x101)],window[_0x2f2930(0xf3)]),_0x3d6746=Math[_0x2f2930(0x110)](_0x4b717d,_0x494c94);return{'width':_0x46f26e,'height':_0x3d6746};}(_0x21a460);_0x301088[_0x4e48af(0x11f)]({'id':_0x4e48af(0xf6),'title':_0x4a14e8(_0x1fd111,_0x4e48af(0x157)),'isModal':!0x0,'className':_0x4e48af(0x145),'content':new _0x2cc2a0(_0x1fd111,{'dialogRects':_0x412cca}),'onHide':()=>{const _0x4c9971=_0x4e48af;_0xc0fa79[_0x4c9971(0x152)]();},'onShow':()=>{const _0x30ea2c=_0x4e48af;_0x3d1ae7[_0x30ea2c(0x10e)][_0x30ea2c(0x149)](_0x30ea2c(0x10c))[_0x30ea2c(0x153)]({...this[_0x30ea2c(0x151)]()})[_0x30ea2c(0x14c)](_0x36dccf=>{const _0x11f7a0=_0x30ea2c,_0x27527f=this[_0x11f7a0(0x13b)](_0x36dccf,_0x3d1ae7,_0x21a460);_0x301088[_0x11f7a0(0x11b)][_0x11f7a0(0x129)][_0x11f7a0(0x131)][_0x11f7a0(0x149)](0x0)[_0x11f7a0(0x10a)](_0x27527f,_0x3d1ae7[_0x11f7a0(0x127)][_0x11f7a0(0x149)](_0x11f7a0(0x14a)));}),_0xc0fa79=new _0x537a11(_0x1fd111,[_0x301088[_0x30ea2c(0x11b)]]),_0xc0fa79[_0x30ea2c(0x124)](),_0xc0fa79[_0x30ea2c(0x10f)][_0x30ea2c(0x12b)][_0x30ea2c(0x146)](_0x30ea2c(0x141)),_0x3d1ae7[_0x30ea2c(0xf7)](_0x30ea2c(0x121),()=>{const _0xa9d780=_0x30ea2c;_0xc0fa79[_0xa9d780(0x152)]();});const _0x23ca26=_0x301088[_0x30ea2c(0x11b)][_0x30ea2c(0xee)][_0x30ea2c(0x119)];_0x301088[_0x30ea2c(0x11b)][_0x30ea2c(0xee)][_0x30ea2c(0x119)]=_0x23ca26?_0x23ca26+_0x30ea2c(0xff):_0x30ea2c(0x141),_0x301088[_0x30ea2c(0x11b)][_0x30ea2c(0x129)][_0x30ea2c(0x131)][_0x30ea2c(0x149)](0x0)['on'](_0x30ea2c(0x143),()=>{const _0x1b4e41=_0x30ea2c;_0x301088[_0x1b4e41(0x11b)][_0x1b4e41(0x130)]();});}});}[_0x37f81c(0x151)](){const _0x24d343=_0x37f81c;if(!this[_0x24d343(0xfb)][_0x24d343(0x10e)][_0x24d343(0x14e)](_0x24d343(0xfc)))return{};const _0x2e5d6e=this[_0x24d343(0xfb)][_0x24d343(0x10e)][_0x24d343(0x149)](_0x24d343(0xfc)),_0x144b40=_0x2e5d6e[_0x24d343(0x13e)],_0x1aa776={};if(_0x24d343(0x12f)===_0x144b40){for(const _0x2c54d8 of _0x2e5d6e[_0x24d343(0x139)]())_0x1aa776[_0x2c54d8]=_0x2e5d6e[_0x24d343(0x118)](_0x2c54d8)||_0x2c54d8;}else{const _0x175bad=_0x24d343(0x106)===_0x144b40?_0x2e5d6e[_0x24d343(0x116)]():_0x2e5d6e[_0x24d343(0xf2)](_0x144b40,!0x0);for(const _0x180c33 of Object[_0x24d343(0x115)](_0x175bad)){const [_0xcc99f,_0xc6fb88]=_0x180c33;_0x1aa776[_0xcc99f]=null!==_0xc6fb88?_0xc6fb88:_0x2e5d6e[_0x24d343(0x118)](_0xcc99f)||_0xcc99f;}}return{'mergeFieldsData':_0x1aa776};}[_0x37f81c(0x13b)](_0x47127c,_0x283ff4,_0x95b683){const _0x41c4ff=_0x37f81c;let _0x204759;if(_0x41c4ff(0x12c)==typeof _0x47127c){const _0x3cbd35=_0x283ff4[_0x41c4ff(0xf4)][_0x41c4ff(0x12e)][_0x41c4ff(0x105)]()[0x0];_0x204759={[_0x3cbd35]:_0x47127c};}else _0x204759=_0x47127c;const _0x37e7c7=this[_0x41c4ff(0x12d)](_0x204759,_0x283ff4),_0x151542=function(_0x48d6b3,_0x328e54){const _0x2e5d37=_0x41c4ff;for(const [_0x1fdbea,_0xd55b05]of _0x48d6b3)_0xd55b05[_0x2e5d37(0xf1)]=_0x328e54[_0x1fdbea][_0x2e5d37(0x12b)][_0x2e5d37(0x122)][_0x2e5d37(0x113)](_0x2e5d37(0x112),'');return _0x48d6b3;}(this[_0x41c4ff(0x156)](_0x283ff4)[_0x41c4ff(0xfd)]((_0x401af6,_0x4901f3)=>(_0x401af6[_0x41c4ff(0xfa)]([_0x4901f3,{'content':_0x37e7c7[_0x4901f3],'classes':''}]),_0x401af6),[]),_0x95b683);return _0x151542;}[_0x37f81c(0x12d)](_0x312bba,_0x44dc71){const _0x6add1=_0x37f81c;if(!_0x44dc71[_0x6add1(0x10e)][_0x6add1(0x14e)](_0x6add1(0xf9)))return _0x312bba;const _0x271522=_0x44dc71[_0x6add1(0x10e)][_0x6add1(0x149)](_0x6add1(0xf9));for(const [_0x4946b0,_0x123b7f]of Object[_0x6add1(0x115)](_0x312bba)){const _0x2a489b=document[_0x6add1(0xec)](_0x6add1(0x154));_0x2a489b[_0x6add1(0x125)]=_0x123b7f,(_0x2a489b[_0x6add1(0x102)](_0x6add1(0x135))[_0x6add1(0x13f)](_0x343003=>{const _0x521849=_0x6add1,_0x2008b3=_0x343003[_0x521849(0x132)](_0x521849(0x14d));if(_0x2008b3){const _0x81cdfb=_0x2008b3[_0x521849(0x147)](_0x521849(0x155));if(_0x81cdfb){const _0x4ba250=_0x271522[_0x521849(0x104)][_0x521849(0x148)](new _0xd48750(_0x44dc71[_0x521849(0x14f)][_0x521849(0x11b)][_0x521849(0x12e)]),_0x81cdfb,{'elementName':'','renderForEditingView':!0x0}),_0x2dbaa5=document[_0x521849(0xec)](_0x521849(0x154));_0x2dbaa5[_0x521849(0x12b)][_0x521849(0x137)](_0x521849(0x114)),_0x4ba250[_0x521849(0x111)](_0x2dbaa5,_0x44dc71[_0x521849(0x14f)][_0x521849(0x11b)][_0x521849(0x11a)]),_0x2008b3[_0x521849(0x109)](_0x2dbaa5);}}}),_0x312bba[_0x4946b0]=_0x2a489b[_0x6add1(0x125)]);}return _0x312bba;}[_0x37f81c(0x156)](_0x106b13){const _0x47ff18=_0x37f81c;if(!function(_0x3100e1){const _0xe359b8=_0x2ded;return void 0x0!==_0x3100e1[_0xe359b8(0xf0)];}(_0x106b13))return _0x106b13[_0x47ff18(0xf4)][_0x47ff18(0x12e)][_0x47ff18(0x105)]();const _0x33cce0=[],_0x379237=new Map();for(const _0x1b69a0 of _0x106b13[_0x47ff18(0xf4)][_0x47ff18(0x12e)][_0x47ff18(0x105)]()){const _0x34c469=_0x106b13[_0x47ff18(0x14f)][_0x47ff18(0x11b)][_0x47ff18(0x126)](_0x1b69a0)[_0x47ff18(0x13c)]()[_0x47ff18(0xf8)](0x0);_0x33cce0[_0x47ff18(0xfa)](_0x1b69a0),_0x379237[_0x47ff18(0x107)](_0x1b69a0,_0x34c469);}return _0x33cce0[_0x47ff18(0x108)]((_0x267b61,_0x3738f4)=>{const _0x1f834b=_0x47ff18,_0x1c5e1f=_0x379237[_0x1f834b(0x149)](_0x267b61),_0xb067ec=_0x379237[_0x1f834b(0x149)](_0x3738f4);return _0x1c5e1f['y']-_0xb067ec['y']||_0x1c5e1f['x']-_0xb067ec['x'];}),_0x33cce0;}}