@ckeditor/ckeditor5-export-inline-styles
Version:
The export with inline styles feature for CKEditor 5.
23 lines • 7.44 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 _0x68a4dd=_0x9ea1;(function(_0x4d5f82,_0x31b6da){const _0x22d7a3=_0x9ea1,_0x37a585=_0x4d5f82();while(!![]){try{const _0x41195f=-parseInt(_0x22d7a3(0xf7))/0x1*(parseInt(_0x22d7a3(0x10c))/0x2)+parseInt(_0x22d7a3(0x112))/0x3*(-parseInt(_0x22d7a3(0x111))/0x4)+-parseInt(_0x22d7a3(0xfd))/0x5*(parseInt(_0x22d7a3(0x11c))/0x6)+parseInt(_0x22d7a3(0x12a))/0x7+-parseInt(_0x22d7a3(0x10f))/0x8*(-parseInt(_0x22d7a3(0x10d))/0x9)+-parseInt(_0x22d7a3(0x118))/0xa+parseInt(_0x22d7a3(0x120))/0xb;if(_0x41195f===_0x31b6da)break;else _0x37a585['push'](_0x37a585['shift']());}catch(_0x54aae5){_0x37a585['push'](_0x37a585['shift']());}}}(_0x403f,0x1ce20));import{Command as _0x4a574d}from'ckeditor5/src/core.js';import{createElement as _0x2c1448}from'ckeditor5/src/utils.js';import{collectAndProcessStylesheets as _0x4e6378}from'./utils/exportinlinestylescollector.js';import{getElementInlineStyles as _0x536e06,concatStylesMaps as _0x17dd1a}from'./utils/exportinlinestylesmatcher.js';import{addMarginStylesRules as _0x5a5894,addPaddingStylesRules as _0x5e3d1a}from'ckeditor5/src/engine.js';export class ExportInlineStylesCommand extends _0x4a574d{[_0x68a4dd(0x122)];constructor(_0x150cc5){const _0x5ebb52=_0x68a4dd;super(_0x150cc5),this[_0x5ebb52(0x12f)](_0x5ebb52(0x10b),!0x1),this[_0x5ebb52(0x122)]=this[_0x5ebb52(0xfc)][_0x5ebb52(0x128)][_0x5ebb52(0x109)],_0x5a5894(this[_0x5ebb52(0x122)]),_0x5e3d1a(this[_0x5ebb52(0x122)]),this[_0x5ebb52(0x125)]=!0x1;}[_0x68a4dd(0x11a)](){const _0x5d02b9=_0x68a4dd;this[_0x5d02b9(0x116)]=!this[_0x5d02b9(0x10b)],this[_0x5d02b9(0xff)]=this[_0x5d02b9(0x10b)]?_0x5d02b9(0xf8):void 0x0;}async[_0x68a4dd(0x12e)](_0x4a3726){const _0x4bfdf4=_0x68a4dd,_0x59f102=this[_0x4bfdf4(0xfc)][_0x4bfdf4(0x115)][_0x4bfdf4(0x106)](_0x4bfdf4(0x11d)),{contentLanguageDirection:_0x106e52}=this[_0x4bfdf4(0xfc)][_0x4bfdf4(0x100)],{rootName:_0x292188=_0x4bfdf4(0xf4),dataControllerDowncastOptions:_0x259e9b={},transformations:_0x43e9a5=_0x59f102[_0x4bfdf4(0x119)]||[]}=_0x4a3726||{};this[_0x4bfdf4(0x10b)]=!0x0,this[_0x4bfdf4(0x11a)]();const _0x5b10f1=this[_0x4bfdf4(0x113)](_0x292188,_0x259e9b),_0x51f7ba=_0x2c1448(_0x5b10f1[_0x4bfdf4(0x12b)],_0x4bfdf4(0x11b),{'dir':_0x106e52,'class':_0x4bfdf4(0x121)},[_0x5b10f1]);return this[_0x4bfdf4(0x108)](_0x43e9a5,_0x51f7ba)[_0x4bfdf4(0x124)](()=>{const _0x58c78c=_0x4bfdf4,_0x3e5227=function(_0x499c27){const _0xe522a8=_0x9ea1,_0xcf8f31=_0x499c27[_0xe522a8(0x12b)][_0xe522a8(0x11f)]();for(;_0x499c27[_0xe522a8(0x127)];)_0xcf8f31[_0xe522a8(0xf3)](_0x499c27[_0xe522a8(0x127)]);return _0xcf8f31;}(_0x51f7ba),_0x53acf4=_0x51f7ba[_0x58c78c(0x101)](_0x58c78c(0x11e));if(_0x53acf4)for(const _0x577778 of _0x3e5227[_0x58c78c(0x10a)]){const _0x54ab65=_0x577778[_0x58c78c(0x101)](_0x58c78c(0x11e)),_0x3a72a8=_0x17dd1a(this[_0x58c78c(0x122)],[_0x53acf4,_0x54ab65]);_0x577778[_0x58c78c(0x117)](_0x58c78c(0x11e),p(_0x3a72a8));}return this[_0x58c78c(0xfc)][_0x58c78c(0x128)][_0x58c78c(0x12d)][_0x58c78c(0x105)][_0x58c78c(0x102)](_0x3e5227);})[_0x4bfdf4(0x114)](()=>{const _0x3d5412=_0x4bfdf4;this[_0x3d5412(0x10b)]=!0x1,this[_0x3d5412(0x11a)]();});}[_0x68a4dd(0x113)](_0x2cd8db,_0x35f5fd){const _0x347d2c=_0x68a4dd,{data:_0x510699,model:_0x2b48e0}=this[_0x347d2c(0xfc)],_0x2bfa14=_0x2b48e0[_0x347d2c(0xfe)][_0x347d2c(0x10e)](_0x2cd8db),_0x2d9b1d=_0x510699[_0x347d2c(0x129)](_0x2bfa14,_0x35f5fd);return _0x510699[_0x347d2c(0x12d)][_0x347d2c(0x123)][_0x347d2c(0xfb)](_0x2d9b1d);}async[_0x68a4dd(0x108)](_0xfe1d39,_0x5c8c08){const _0x38ef7a=_0x68a4dd,{stylesheets:_0x16abf5,inlineCss:_0x499f77,stripCssClasses:_0x1a35e1}=this[_0x38ef7a(0xfc)][_0x38ef7a(0x115)][_0x38ef7a(0x106)](_0x38ef7a(0x11d)),{parsedCssRules:_0x2738db,rootCssVariables:_0x1ee6f8}=await _0x4e6378({'stylesheets':_0x16abf5||[_0x38ef7a(0xf9)],'stylesProcessor':this[_0x38ef7a(0x122)],'inlineCss':_0x499f77});this[_0x38ef7a(0xf6)]({'transformations':_0xfe1d39,'parsedCssRules':_0x2738db,'element':_0x5c8c08,'stripCssClasses':_0x1a35e1,'parentCSSVariablesLookup':_0x1ee6f8[_0x38ef7a(0x106)][_0x38ef7a(0x12c)](_0x1ee6f8)});}[_0x68a4dd(0xf6)]({element:_0x356cc4,parsedCssRules:_0x39c050,parentCSSVariablesLookup:_0x3dbf62,stripCssClasses:_0x522b28,transformations:_0x4ff91f}){const _0xcdbf43=_0x68a4dd,{stylesMap:_0x3f8289,localCSSVariables:_0x2991e1}=_0x536e06({'stylesProcessor':this[_0xcdbf43(0x122)],'fallbackCSSVariablesLookup':_0x3dbf62,'parsedCssRules':_0x39c050,'element':_0x356cc4});for(const _0x47c589 of _0x4ff91f)_0x47c589(_0x356cc4,_0x3f8289);_0x3f8289[_0xcdbf43(0x110)]?_0x356cc4[_0xcdbf43(0x117)](_0xcdbf43(0x11e),p(_0x3f8289)):_0x356cc4[_0xcdbf43(0x107)](_0xcdbf43(0x11e));const _0x2c2390=_0x18d133=>_0x2991e1[_0xcdbf43(0x104)](_0x18d133)?_0x2991e1[_0xcdbf43(0x106)](_0x18d133):_0x3dbf62(_0x18d133);for(const _0x1d97b5 of _0x356cc4[_0xcdbf43(0x10a)])_0x1d97b5 instanceof HTMLElement&&this[_0xcdbf43(0xf6)]({'element':_0x1d97b5,'parentCSSVariablesLookup':_0x2c2390,'parsedCssRules':_0x39c050,'stripCssClasses':_0x522b28,'transformations':_0x4ff91f});_0x522b28&&_0x356cc4[_0xcdbf43(0x107)](_0xcdbf43(0xfa));}}function _0x403f(){const _0x27a89e=['ownerDocument','bind','htmlProcessor','execute','set','appendChild','main','getStylesEntries','_processElementTree','60266oBDuAE','pending','EDITOR_STYLES','class','viewToDom','editor','135215aKWNtJ','document','value','locale','getAttribute','getHtml','join','has','htmlWriter','get','removeAttribute','_collectAndApplyStyles','stylesProcessor','children','isBusy','2gfAoXX','42093cQZxtw','getRoot','216KAyFhz','size','4xkjzmV','699456UhUIWi','_getRootDataHTMLFragment','finally','config','isEnabled','setAttribute','2328690AWNjvv','transformations','refresh','div','36hhavIe','exportInlineStyles','style','createDocumentFragment','7380978jtcJAd','ck-content','_stylesProcessor','domConverter','then','affectsData','map','firstChild','data','toView','67004JJXzXb'];_0x403f=function(){return _0x27a89e;};return _0x403f();}function _0x9ea1(_0x2331cb,_0x58bbfb){const _0x403f65=_0x403f();return _0x9ea1=function(_0x9ea1e6,_0x148b2b){_0x9ea1e6=_0x9ea1e6-0xf3;let _0x3160a7=_0x403f65[_0x9ea1e6];return _0x3160a7;},_0x9ea1(_0x2331cb,_0x58bbfb);}function p(_0x561762){const _0x2ab7f1=_0x68a4dd;return _0x561762[_0x2ab7f1(0xf5)]()[_0x2ab7f1(0x126)](_0x46dfa9=>_0x46dfa9[_0x2ab7f1(0x103)](':'))[_0x2ab7f1(0x103)](';')+';';}