@ckeditor/ckeditor5-track-changes
Version:
CKEditor 5 track changes plugin.
23 lines • 10.4 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. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
function _0x4f72(_0x2f9f14,_0x357c13){const _0x1f1f19=_0x1f1f();return _0x4f72=function(_0x4f7235,_0x336fe9){_0x4f7235=_0x4f7235-0x1e7;let _0x50753c=_0x1f1f19[_0x4f7235];return _0x50753c;},_0x4f72(_0x2f9f14,_0x357c13);}const _0x539f17=_0x4f72;(function(_0x3e405e,_0x595a87){const _0x3be040=_0x4f72,_0x4fd7c5=_0x3e405e();while(!![]){try{const _0x5967bf=parseInt(_0x3be040(0x219))/0x1+-parseInt(_0x3be040(0x1f4))/0x2+parseInt(_0x3be040(0x1f2))/0x3*(parseInt(_0x3be040(0x218))/0x4)+parseInt(_0x3be040(0x212))/0x5*(-parseInt(_0x3be040(0x22f))/0x6)+parseInt(_0x3be040(0x217))/0x7+-parseInt(_0x3be040(0x1ed))/0x8+parseInt(_0x3be040(0x248))/0x9;if(_0x5967bf===_0x595a87)break;else _0x4fd7c5['push'](_0x4fd7c5['shift']());}catch(_0x2e9727){_0x4fd7c5['push'](_0x4fd7c5['shift']());}}}(_0x1f1f,0xcab7d));function _0x1f1f(){const _0x3ee3dd=['updatePosition','set','innerHTML','then','attachToDom','class','querySelector','13260616pUZjkj','add','get','getDomRoot','push','153597iGSoVn','replace','833594TTjQVM','locale','MergeFieldsEditing','contentView','TrackChangesData','sort','min','show','reduce','destroy','editing','document','figure.media','item','querySelectorAll','width','max','remove','$defaultValues','setPreviewData','previewDataReady','_fixMediaEmbeds','classList','ck-media__wrapper','getAttribute','element','createElement','entries','registry','forEach','72865CRXMcj','isEnabled','\x20ck-reset_all','has','finalContentPreview','4294115yhYFev','36MKmrik','1529551wBycTD','innerHeight','$labels','domConverter','MediaEmbedEditing','editables','execute','getLabel','value','getClientRects','affectsData','div','bodyCollectionContainer','children','getMergeFieldsIds','editable','trackChanges.preview.renderFunction','plugins','ck-reset_all','_standarizeRootsData','editor','getDefaultValues','90SZoIzr','classes','headerView','render','documentElement','url','config','detachFromDom','getRootNames','getRootsAttributes','getMediaViewElement','view','getDataWithAcceptedSuggestions','string','clientHeight','once','values','refresh','replaceWith','Final\x20content\x20preview','oembed','_getMergeFieldsData','getBoundingClientRect','Dialog','_sortRoots','4675635lfvNSF','ck-track-changes-preview-dialog','previewMode','getDataSetValues','model','height','ck-focused'];_0x1f1f=function(){return _0x3ee3dd;};return _0x1f1f();}import{Command as _0x46983b}from'ckeditor5/src/core.js';import{BodyCollection as _0x5b5992}from'ckeditor5/src/ui.js';import{ViewDowncastWriter as _0xdb8000}from'ckeditor5/src/engine.js';import{TrackChangesPreviewView as _0x1895e0}from'../ui/view/trackchangespreviewview.js';import{getTranslation as _0x2d31ac}from'../utils/common-translations.js';export class PreviewFinalContentCommand extends _0x46983b{constructor(_0x216e18){const _0x16174e=_0x4f72;super(_0x216e18),this[_0x16174e(0x223)]=!0x1,this[_0x16174e(0x213)]=!0x0;}[_0x539f17(0x240)](){const _0x43ee04=_0x539f17;this[_0x43ee04(0x213)]=!0x0;}[_0x539f17(0x21f)](){const _0x446883=_0x539f17,_0x23128d=this[_0x446883(0x22d)],_0x478db6=_0x23128d[_0x446883(0x1f5)],_0x33a9e3=_0x23128d[_0x446883(0x22a)][_0x446883(0x1ef)](_0x446883(0x246));let _0x12958f;const _0x189cc4=function(_0x12ed18){const _0x438368=_0x446883,_0x4213ae={};if(_0x438368(0x21e)in _0x12ed18['ui'][_0x438368(0x23a)]){for(const [_0x200021,_0x55cae2]of Object[_0x438368(0x20f)](_0x12ed18['ui'][_0x438368(0x23a)][_0x438368(0x21e)]))_0x4213ae[_0x200021]=_0x55cae2[_0x438368(0x20d)];}else _0x4213ae[_0x12ed18[_0x438368(0x24c)][_0x438368(0x1ff)][_0x438368(0x237)]()[0x0]]=_0x12ed18['ui'][_0x438368(0x23a)][_0x438368(0x228)][_0x438368(0x20d)];return _0x4213ae;}(_0x23128d),_0x16a652=function(_0x108f34){const _0x3bed40=_0x446883;let _0x17ec30=0x0;for(const _0x563812 of Object[_0x3bed40(0x23f)](_0x108f34))_0x17ec30=Math[_0x3bed40(0x204)](_0x17ec30,_0x563812[_0x3bed40(0x245)]()[_0x3bed40(0x203)]);let _0x42c917=0x0;for(const _0x211405 of Object[_0x3bed40(0x23f)](_0x108f34))_0x42c917+=_0x211405[_0x3bed40(0x245)]()[_0x3bed40(0x24d)];const _0x1ce468=0.8*Math[_0x3bed40(0x204)](document[_0x3bed40(0x233)][_0x3bed40(0x23d)],window[_0x3bed40(0x21a)]),_0x11ef92=Math[_0x3bed40(0x1fa)](_0x42c917,_0x1ce468);return{'width':_0x17ec30,'height':_0x11ef92};}(_0x189cc4);_0x33a9e3[_0x446883(0x1fb)]({'id':_0x446883(0x216),'title':_0x2d31ac(_0x478db6,_0x446883(0x242)),'isModal':!0x0,'className':_0x446883(0x249),'content':new _0x1895e0(_0x478db6,{'dialogRects':_0x16a652}),'onHide':()=>{const _0x3ba35b=_0x446883;_0x12958f[_0x3ba35b(0x236)]();},'onShow':()=>{const _0x2b9340=_0x446883;_0x23128d[_0x2b9340(0x22a)][_0x2b9340(0x1ef)](_0x2b9340(0x1f8))[_0x2b9340(0x23b)]({...this[_0x2b9340(0x244)]()})[_0x2b9340(0x1e9)](_0x4d230c=>{const _0x3ad618=_0x2b9340,_0x4e5cb1=this[_0x3ad618(0x22c)](_0x4d230c,_0x23128d,_0x189cc4);_0x33a9e3[_0x3ad618(0x23a)][_0x3ad618(0x1f7)][_0x3ad618(0x226)][_0x3ad618(0x1ef)](0x0)[_0x3ad618(0x207)](_0x4e5cb1,_0x23128d[_0x3ad618(0x235)][_0x3ad618(0x1ef)](_0x3ad618(0x229)));}),_0x12958f=new _0x5b5992(_0x478db6,[_0x33a9e3[_0x2b9340(0x23a)]]),_0x12958f[_0x2b9340(0x1ea)](),_0x12958f[_0x2b9340(0x225)][_0x2b9340(0x20a)][_0x2b9340(0x205)](_0x2b9340(0x22b)),_0x23128d[_0x2b9340(0x23e)](_0x2b9340(0x1fd),()=>{const _0x5033e8=_0x2b9340;_0x12958f[_0x5033e8(0x236)]();});const _0x75a1d1=_0x33a9e3[_0x2b9340(0x23a)][_0x2b9340(0x231)][_0x2b9340(0x1eb)];_0x33a9e3[_0x2b9340(0x23a)][_0x2b9340(0x231)][_0x2b9340(0x1eb)]=_0x75a1d1?_0x75a1d1+_0x2b9340(0x214):_0x2b9340(0x22b),_0x33a9e3[_0x2b9340(0x23a)][_0x2b9340(0x1f7)][_0x2b9340(0x226)][_0x2b9340(0x1ef)](0x0)['on'](_0x2b9340(0x208),()=>{const _0x266df9=_0x2b9340;_0x33a9e3[_0x266df9(0x23a)][_0x266df9(0x24f)]();});}});}[_0x539f17(0x244)](){const _0x5bd59d=_0x539f17;if(!this[_0x5bd59d(0x22d)][_0x5bd59d(0x22a)][_0x5bd59d(0x215)](_0x5bd59d(0x1f6)))return{};const _0x5cc49d=this[_0x5bd59d(0x22d)][_0x5bd59d(0x22a)][_0x5bd59d(0x1ef)](_0x5bd59d(0x1f6)),_0x31efd1=_0x5cc49d[_0x5bd59d(0x24a)],_0x429bfc={};if(_0x5bd59d(0x21b)===_0x31efd1){for(const _0x18f06e of _0x5cc49d[_0x5bd59d(0x227)]())_0x429bfc[_0x18f06e]=_0x5cc49d[_0x5bd59d(0x220)](_0x18f06e)||_0x18f06e;}else{const _0x22fc26=_0x5bd59d(0x206)===_0x31efd1?_0x5cc49d[_0x5bd59d(0x22e)]():_0x5cc49d[_0x5bd59d(0x24b)](_0x31efd1,!0x0);for(const _0x106120 of Object[_0x5bd59d(0x20f)](_0x22fc26)){const [_0x4fd663,_0x361834]=_0x106120;_0x429bfc[_0x4fd663]=null!==_0x361834?_0x361834:_0x5cc49d[_0x5bd59d(0x220)](_0x4fd663)||_0x4fd663;}}return{'mergeFieldsData':_0x429bfc};}[_0x539f17(0x22c)](_0xa608b,_0x4aa281,_0x5f529e){const _0x450996=_0x539f17;let _0x2bbaa1;if(_0x450996(0x23c)==typeof _0xa608b){const _0x2a13f5=_0x4aa281[_0x450996(0x24c)][_0x450996(0x1ff)][_0x450996(0x237)]()[0x0];_0x2bbaa1={[_0x2a13f5]:_0xa608b};}else _0x2bbaa1=_0xa608b;const _0xac6872=this[_0x450996(0x209)](_0x2bbaa1,_0x4aa281),_0x3da83e=function(_0x32a977,_0x3f9dbc){const _0x521016=_0x450996;for(const [_0x5747da,_0x24c6a7]of _0x32a977)_0x24c6a7[_0x521016(0x230)]=_0x3f9dbc[_0x5747da][_0x521016(0x20a)][_0x521016(0x221)][_0x521016(0x1f3)](_0x521016(0x24e),'');return _0x32a977;}(this[_0x450996(0x247)](_0x4aa281)[_0x450996(0x1fc)]((_0x119674,_0x411326)=>(_0x119674[_0x450996(0x1f1)]([_0x411326,{'content':_0xac6872[_0x411326],'classes':''}]),_0x119674),[]),_0x5f529e);return _0x3da83e;}[_0x539f17(0x209)](_0x45920a,_0x2f949f){const _0xa45d3a=_0x539f17;if(!_0x2f949f[_0xa45d3a(0x22a)][_0xa45d3a(0x215)](_0xa45d3a(0x21d)))return _0x45920a;const _0x45b1f2=_0x2f949f[_0xa45d3a(0x22a)][_0xa45d3a(0x1ef)](_0xa45d3a(0x21d));for(const [_0x4bd5ac,_0x2b76f2]of Object[_0xa45d3a(0x20f)](_0x45920a)){const _0x12bc5b=document[_0xa45d3a(0x20e)](_0xa45d3a(0x224));_0x12bc5b[_0xa45d3a(0x1e8)]=_0x2b76f2,(_0x12bc5b[_0xa45d3a(0x202)](_0xa45d3a(0x200))[_0xa45d3a(0x211)](_0x29df55=>{const _0xba3ca0=_0xa45d3a,_0x9fa74d=_0x29df55[_0xba3ca0(0x1ec)](_0xba3ca0(0x243));if(_0x9fa74d){const _0x3a9ef8=_0x9fa74d[_0xba3ca0(0x20c)](_0xba3ca0(0x234));if(_0x3a9ef8){const _0x493cd2=_0x45b1f2[_0xba3ca0(0x210)][_0xba3ca0(0x239)](new _0xdb8000(_0x2f949f[_0xba3ca0(0x1fe)][_0xba3ca0(0x23a)][_0xba3ca0(0x1ff)]),_0x3a9ef8,{'elementName':'','renderForEditingView':!0x0}),_0x53132b=document[_0xba3ca0(0x20e)](_0xba3ca0(0x224));_0x53132b[_0xba3ca0(0x20a)][_0xba3ca0(0x1ee)](_0xba3ca0(0x20b)),_0x493cd2[_0xba3ca0(0x232)](_0x53132b,_0x2f949f[_0xba3ca0(0x1fe)][_0xba3ca0(0x23a)][_0xba3ca0(0x21c)]),_0x9fa74d[_0xba3ca0(0x241)](_0x53132b);}}}),_0x45920a[_0x4bd5ac]=_0x12bc5b[_0xa45d3a(0x1e8)]);}return _0x45920a;}[_0x539f17(0x247)](_0x374249){const _0x5446bc=_0x539f17;if(!function(_0x261389){const _0xc95a9b=_0x4f72;return void 0x0!==_0x261389[_0xc95a9b(0x238)];}(_0x374249))return _0x374249[_0x5446bc(0x24c)][_0x5446bc(0x1ff)][_0x5446bc(0x237)]();const _0xe9e071=[],_0x479a8b=new Map();for(const _0xd07a57 of _0x374249[_0x5446bc(0x24c)][_0x5446bc(0x1ff)][_0x5446bc(0x237)]()){const _0x4107e7=_0x374249[_0x5446bc(0x1fe)][_0x5446bc(0x23a)][_0x5446bc(0x1f0)](_0xd07a57)[_0x5446bc(0x222)]()[_0x5446bc(0x201)](0x0);_0xe9e071[_0x5446bc(0x1f1)](_0xd07a57),_0x479a8b[_0x5446bc(0x1e7)](_0xd07a57,_0x4107e7);}return _0xe9e071[_0x5446bc(0x1f9)]((_0x337f20,_0x10c82e)=>{const _0x509bd2=_0x5446bc,_0x1569a8=_0x479a8b[_0x509bd2(0x1ef)](_0x337f20),_0xa7c0a8=_0x479a8b[_0x509bd2(0x1ef)](_0x10c82e);return _0x1569a8['y']-_0xa7c0a8['y']||_0x1569a8['x']-_0xa7c0a8['x'];}),_0xe9e071;}}