@ckeditor/ckeditor5-export-inline-styles
Version:
The export with inline styles feature for CKEditor 5.
23 lines • 7.51 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 _0x343722=_0x47a1;function _0x47a1(_0x41a316,_0x34376f){const _0x459e39=_0x459e();return _0x47a1=function(_0x47a10b,_0x512d82){_0x47a10b=_0x47a10b-0x111;let _0x186050=_0x459e39[_0x47a10b];return _0x186050;},_0x47a1(_0x41a316,_0x34376f);}(function(_0x444ebc,_0xc73a5c){const _0x10603b=_0x47a1,_0x8eaaf8=_0x444ebc();while(!![]){try{const _0x6c8dbc=-parseInt(_0x10603b(0x14b))/0x1+-parseInt(_0x10603b(0x120))/0x2*(-parseInt(_0x10603b(0x12d))/0x3)+parseInt(_0x10603b(0x132))/0x4*(parseInt(_0x10603b(0x121))/0x5)+-parseInt(_0x10603b(0x140))/0x6*(-parseInt(_0x10603b(0x149))/0x7)+parseInt(_0x10603b(0x13c))/0x8*(parseInt(_0x10603b(0x13a))/0x9)+parseInt(_0x10603b(0x143))/0xa*(parseInt(_0x10603b(0x129))/0xb)+-parseInt(_0x10603b(0x11f))/0xc;if(_0x6c8dbc===_0xc73a5c)break;else _0x8eaaf8['push'](_0x8eaaf8['shift']());}catch(_0x7efe69){_0x8eaaf8['push'](_0x8eaaf8['shift']());}}}(_0x459e,0x28218));import{Command as _0x41ff80}from'ckeditor5/src/core.js';import{createElement as _0x11fb97}from'ckeditor5/src/utils.js';import{collectAndProcessStylesheets as _0x52ba29}from'./utils/exportinlinestylescollector.js';import{getElementInlineStyles as _0x44b18e,concatStylesMaps as _0x45c899}from'./utils/exportinlinestylesmatcher.js';import{addMarginStylesRules as _0xff949d,addPaddingStylesRules as _0x2afa73}from'ckeditor5/src/engine.js';export class ExportInlineStylesCommand extends _0x41ff80{[_0x343722(0x138)];constructor(_0x51776f){const _0x5cdeaf=_0x343722;super(_0x51776f),this[_0x5cdeaf(0x11b)](_0x5cdeaf(0x117),!0x1),this[_0x5cdeaf(0x138)]=this[_0x5cdeaf(0x14a)][_0x5cdeaf(0x127)][_0x5cdeaf(0x11a)],_0xff949d(this[_0x5cdeaf(0x138)]),_0x2afa73(this[_0x5cdeaf(0x138)]),this[_0x5cdeaf(0x12a)]=!0x1;}[_0x343722(0x118)](){const _0x1f7510=_0x343722;this[_0x1f7510(0x144)]=!this[_0x1f7510(0x117)],this[_0x1f7510(0x133)]=this[_0x1f7510(0x117)]?_0x1f7510(0x116):void 0x0;}async[_0x343722(0x14c)](_0x57fb09){const _0x4d71c5=_0x343722,_0x513e28=this[_0x4d71c5(0x14a)][_0x4d71c5(0x11e)][_0x4d71c5(0x139)](_0x4d71c5(0x12e)),{contentLanguageDirection:_0x2d48f4}=this[_0x4d71c5(0x14a)][_0x4d71c5(0x111)],{rootName:_0x133ced=_0x4d71c5(0x14d),dataControllerDowncastOptions:_0x79dc9b={},transformations:_0x8e9080=_0x513e28[_0x4d71c5(0x135)]||[]}=_0x57fb09||{};this[_0x4d71c5(0x117)]=!0x0,this[_0x4d71c5(0x118)]();const _0x45198d=this[_0x4d71c5(0x14e)](_0x133ced,_0x79dc9b),_0x446c62=_0x11fb97(_0x45198d[_0x4d71c5(0x136)],_0x4d71c5(0x141),{'dir':_0x2d48f4,'class':_0x4d71c5(0x123)},[_0x45198d]);return this[_0x4d71c5(0x11d)](_0x8e9080,_0x446c62)[_0x4d71c5(0x146)](()=>{const _0x4b93f2=_0x4d71c5,_0x1193f9=function(_0x4ec251){const _0x501175=_0x47a1,_0xeaaea5=_0x4ec251[_0x501175(0x136)][_0x501175(0x114)]();for(;_0x4ec251[_0x501175(0x131)];)_0xeaaea5[_0x501175(0x11c)](_0x4ec251[_0x501175(0x131)]);return _0xeaaea5;}(_0x446c62),_0x3480d3=_0x446c62[_0x4b93f2(0x134)](_0x4b93f2(0x137));if(_0x3480d3)for(const _0x299f16 of _0x1193f9[_0x4b93f2(0x128)]){const _0x1cf7c8=_0x299f16[_0x4b93f2(0x134)](_0x4b93f2(0x137)),_0x4311a1=_0x45c899(this[_0x4b93f2(0x138)],[_0x3480d3,_0x1cf7c8]);_0x299f16[_0x4b93f2(0x126)](_0x4b93f2(0x137),p(_0x4311a1));}return this[_0x4b93f2(0x14a)][_0x4b93f2(0x127)][_0x4b93f2(0x125)][_0x4b93f2(0x145)][_0x4b93f2(0x142)](_0x1193f9);})[_0x4d71c5(0x12b)](()=>{const _0x20ef81=_0x4d71c5;this[_0x20ef81(0x117)]=!0x1,this[_0x20ef81(0x118)]();});}[_0x343722(0x14e)](_0x3837a0,_0x14c050){const _0x49559a=_0x343722,{data:_0x8a00b8,model:_0x53507f}=this[_0x49559a(0x14a)],_0x272778=_0x53507f[_0x49559a(0x13e)][_0x49559a(0x148)](_0x3837a0),_0x88fb70=_0x8a00b8[_0x49559a(0x130)](_0x272778,_0x14c050);return _0x8a00b8[_0x49559a(0x125)][_0x49559a(0x122)][_0x49559a(0x115)](_0x88fb70);}async[_0x343722(0x11d)](_0x150fbd,_0x34759b){const _0x8f1de9=_0x343722,{stylesheets:_0x47943b,inlineCss:_0x344c50,stripCssClasses:_0x1040a4}=this[_0x8f1de9(0x14a)][_0x8f1de9(0x11e)][_0x8f1de9(0x139)](_0x8f1de9(0x12e)),{parsedCssRules:_0x2d7712,rootCssVariables:_0x3adb58}=await _0x52ba29({'stylesheets':_0x47943b||[_0x8f1de9(0x12f)],'stylesProcessor':this[_0x8f1de9(0x138)],'inlineCss':_0x344c50});this[_0x8f1de9(0x13d)]({'transformations':_0x150fbd,'parsedCssRules':_0x2d7712,'element':_0x34759b,'stripCssClasses':_0x1040a4,'parentCSSVariablesLookup':_0x3adb58[_0x8f1de9(0x139)][_0x8f1de9(0x124)](_0x3adb58)});}[_0x343722(0x13d)]({element:_0x37a80f,parsedCssRules:_0x35aeaf,parentCSSVariablesLookup:_0x1c6647,stripCssClasses:_0x5da5f4,transformations:_0x3fafb1}){const _0x44c317=_0x343722,{stylesMap:_0x5bd1c2,localCSSVariables:_0x44c0de}=_0x44b18e({'stylesProcessor':this[_0x44c317(0x138)],'fallbackCSSVariablesLookup':_0x1c6647,'parsedCssRules':_0x35aeaf,'element':_0x37a80f});for(const _0x2be715 of _0x3fafb1)_0x2be715(_0x37a80f,_0x5bd1c2);_0x5bd1c2[_0x44c317(0x113)]?_0x37a80f[_0x44c317(0x126)](_0x44c317(0x137),p(_0x5bd1c2)):_0x37a80f[_0x44c317(0x13f)](_0x44c317(0x137));const _0x2f757e=_0x2b42ce=>_0x44c0de[_0x44c317(0x12c)](_0x2b42ce)?_0x44c0de[_0x44c317(0x139)](_0x2b42ce):_0x1c6647(_0x2b42ce);for(const _0x4ec5a6 of _0x37a80f[_0x44c317(0x128)])_0x4ec5a6 instanceof HTMLElement&&this[_0x44c317(0x13d)]({'element':_0x4ec5a6,'parentCSSVariablesLookup':_0x2f757e,'parsedCssRules':_0x35aeaf,'stripCssClasses':_0x5da5f4,'transformations':_0x3fafb1});_0x5da5f4&&_0x37a80f[_0x44c317(0x13f)](_0x44c317(0x147));}}function _0x459e(){const _0x532cfe=['3416cohffw','_processElementTree','document','removeAttribute','6DtIfzV','div','getHtml','8130RqAAXD','isEnabled','htmlWriter','then','class','getRoot','601055WcTuNs','editor','21342blpMfw','execute','main','_getRootDataHTMLFragment','locale','join','size','createDocumentFragment','viewToDom','pending','isBusy','refresh','getStylesEntries','stylesProcessor','set','appendChild','_collectAndApplyStyles','config','3530544IXhfFG','2XWPbvM','45830ASqXOk','domConverter','ck-content','bind','htmlProcessor','setAttribute','data','children','1353UPnJOI','affectsData','finally','has','18381gOWfmx','exportInlineStyles','EDITOR_STYLES','toView','firstChild','20KbyXFZ','value','getAttribute','transformations','ownerDocument','style','_stylesProcessor','get','5103lhOByb','map'];_0x459e=function(){return _0x532cfe;};return _0x459e();}function p(_0x397101){const _0x294fe3=_0x343722;return _0x397101[_0x294fe3(0x119)]()[_0x294fe3(0x13b)](_0x17e49d=>_0x17e49d[_0x294fe3(0x112)](':'))[_0x294fe3(0x112)](';')+';';}