@ckeditor/ckeditor5-export-inline-styles
Version:
The export with inline styles feature for CKEditor 5.
23 lines • 4.62 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 _0xff2f(_0x196a23,_0x5f5008){const _0x159c26=_0x159c();return _0xff2f=function(_0xff2f58,_0x3ba179){_0xff2f58=_0xff2f58-0x122;let _0x4fcfb2=_0x159c26[_0xff2f58];return _0x4fcfb2;},_0xff2f(_0x196a23,_0x5f5008);}(function(_0x16e08e,_0x4febd6){const _0x201a63=_0xff2f,_0x2bd9db=_0x16e08e();while(!![]){try{const _0x34d2a9=-parseInt(_0x201a63(0x128))/0x1+-parseInt(_0x201a63(0x12d))/0x2+parseInt(_0x201a63(0x13c))/0x3+parseInt(_0x201a63(0x130))/0x4+parseInt(_0x201a63(0x127))/0x5*(parseInt(_0x201a63(0x138))/0x6)+-parseInt(_0x201a63(0x12a))/0x7*(parseInt(_0x201a63(0x12e))/0x8)+-parseInt(_0x201a63(0x13b))/0x9*(parseInt(_0x201a63(0x12b))/0xa);if(_0x34d2a9===_0x4febd6)break;else _0x2bd9db['push'](_0x2bd9db['shift']());}catch(_0x2b81e9){_0x2bd9db['push'](_0x2bd9db['shift']());}}}(_0x159c,0xb8292));import{calculate as _0x32dcca,compare as _0x248b6c}from'specificity';import{StylesMap as _0x277c7b}from'ckeditor5/src/engine.js';import{collectStylesheets as _0x38eb44}from'ckeditor5/src/utils.js';import{collectRootStylesheetsVariables as _0x11a405}from'./exportinlinestylescssvariables.js';import{splitByTopLevelComma as _0x28ad23}from'../exportinlinestylesutils.js';function _0x159c(){const _0x56a258=['cssRules','specificity','inlineCss','flatMap','stylesheets','sort','setTo','6vyLHRC','specificityArray','map','139527Mvelqr','1557174YgWwbI','trim','stylesProcessor','join','from','cssText','6281115VcimWC','165008VsjiWO','replace','49XGXBTh','930zUbHfb','length','427004IWnpJJ','687632vEXBGJ','filter','5604032BYXcNe'];_0x159c=function(){return _0x56a258;};return _0x159c();}export async function collectAndProcessStylesheets(_0x46b330){const _0x20253e=_0xff2f,_0x3ec05c=[await _0x38eb44(_0x46b330[_0x20253e(0x135)]),_0x46b330[_0x20253e(0x133)]][_0x20253e(0x12f)](_0x43966a=>_0x43966a&&_0x43966a[_0x20253e(0x12c)])[_0x20253e(0x124)]('\x0a'),_0x1bef1b=await async function(_0x2674d8,_0x1c0c64){const _0x48a4aa=_0x20253e,_0x5a38c9=new CSSStyleSheet();return await _0x5a38c9[_0x48a4aa(0x129)](_0x1c0c64),C(Array[_0x48a4aa(0x125)](_0x5a38c9[_0x48a4aa(0x131)])[_0x48a4aa(0x12f)](_0x2fcbd3=>_0x2fcbd3 instanceof CSSStyleRule))[_0x48a4aa(0x134)](({selectorText:_0x4c5c4e,contentCssText:_0x2e8c05})=>{const _0x4f6840=_0x48a4aa,_0x5c4af3=_0x28ad23(_0x4c5c4e),_0x7c17c0=new _0x277c7b(_0x2674d8)[_0x4f6840(0x137)](_0x2e8c05);return _0x5c4af3[_0x4f6840(0x13a)](_0xcbd7bd=>({'stylesMap':_0x7c17c0,'flatSelector':_0xcbd7bd,'specificity':_0x32dcca(_0xcbd7bd)[0x0][_0x4f6840(0x139)]}));})[_0x48a4aa(0x136)]((_0x160669,_0x3e863e)=>_0x248b6c(_0x160669[_0x48a4aa(0x132)],_0x3e863e[_0x48a4aa(0x132)]));}(_0x46b330[_0x20253e(0x123)],_0x3ec05c);return{'parsedCssRules':_0x1bef1b,'rootCssVariables':_0x11a405(_0x1bef1b)};}function C(_0x13131a,_0x3b1226=''){const _0x4635ee=_0xff2f;return _0x13131a[_0x4635ee(0x134)](_0x571524=>{const _0x63753a=_0x4635ee,{selectorText:_0x1f1aeb,cssText:_0x25b728,cssRules:_0x3322ba}=_0x571524;if(!_0x1f1aeb)return[];const _0x40992c=_0x1f1aeb[_0x63753a(0x129)](/&/g,_0x3b1226);let _0x1272b4=_0x25b728[_0x63753a(0x129)](_0x1f1aeb,'')[_0x63753a(0x122)]()[_0x63753a(0x129)](/^{|}$/g,'');if(!_0x3322ba||!_0x3322ba[_0x63753a(0x12c)])return[{'selectorText':_0x40992c,'contentCssText':_0x1272b4}];for(const _0x52fef2 of _0x3322ba)_0x1272b4=_0x1272b4[_0x63753a(0x129)](_0x52fef2[_0x63753a(0x126)],'')[_0x63753a(0x122)]();return[{'selectorText':_0x40992c,'contentCssText':_0x1272b4},...C(Array[_0x63753a(0x125)](_0x3322ba),_0x40992c)];});}