@ckeditor/ckeditor5-line-height 48.5.0-alpha.1 → 48.5.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x4716b7,Plugin as _0x4e71a1}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x183b17,Collection as _0x3a25b8,first as _0x2ad3ef,uid as _0x311381}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x28613b,isPercentageStyleValue as _0x57ca43}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x6f2e18,MenuBarMenuListItemView as _0x2f447a,MenuBarMenuListView as _0x4230ef,MenuBarMenuView as _0x10825a,UIModel as _0x1370bf,addListToDropdown as _0x3e8e28,createDropdown as _0x379325}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x14c72e}from'@ckeditor/ckeditor5-icons';var p=class extends _0x4716b7{['refresh'](){const _0x4180dd=this['editor']['model']['document'],_0x3be4fa=_0x2ad3ef(_0x4180dd['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x3be4fa)&&this['_canHaveLineHeight'](_0x3be4fa),this['value']=this['isEnabled']&&_0x3be4fa['getAttribute']('lineHeight');}execute(_0x547375={}){const _0x1fa8af=this['editor']['model'],_0x238c44=_0x1fa8af['document']['selection'],_0x5ea6fd=_0x547375['value'];_0x1fa8af['change'](_0x47668c=>{const _0x14e4e5=Array['from'](_0x238c44['getSelectedBlocks']())['filter'](_0x1f8fd5=>this['_canHaveLineHeight'](_0x1f8fd5));for(const _0x1d99e3 of _0x14e4e5)_0x5ea6fd?_0x47668c['setAttribute']('lineHeight',_0x5ea6fd,_0x1d99e3):_0x47668c['removeAttribute']('lineHeight',_0x1d99e3);});}_canHaveLineHeight(_0x31ff28){return this['editor']['model']['schema']['checkAttribute'](_0x31ff28,'lineHeight');}};const y={get 'single'(){return{'title':'Single','model':'single','view':{'key':'class','value':'line-height-single'}};},get 'double'(){return{'title':'Double','model':'double','view':{'key':'class','value':'line-height-double'}};}};function H(_0x329c8a){return'string'==typeof _0x329c8a&&'default'===_0x329c8a['toLowerCase']();}function L(_0x48c85a){return _0x48c85a['options']['map'](_0x2ac0f5=>{return H(_0x2ac0f5)?{'title':String(_0x48c85a['defaultValue']),'model':'default'}:('number'==typeof _0x2ac0f5&&(_0x2ac0f5=String(_0x2ac0f5)),'string'!=typeof _0x2ac0f5?_0x2ac0f5:parseFloat(_0x2ac0f5)?{'title':_0x2ac0f5,'model':_0x2ac0f5,'view':{'name':'span','styles':{'line-height':_0x2ac0f5}}}:'string'==typeof(_0x3fdb76=_0x2ac0f5)?y[_0x3fdb76]:y[_0x3fdb76['model']]);var _0x3fdb76;})['filter'](_0x26de6a=>void 0x0!==_0x26de6a);}var v=class extends _0x4e71a1{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x2054d3,conversion:_0x27e2bd}=this['editor'];_0x2054d3['has']('ListEditing')&&_0x2054d3['has']('TodoListEditing')&&(_0x2054d3['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x57a487,_0x4d7538,_0x4f2c17,_0x244d64,_0x237cae){'todo'==_0x237cae['getAttribute']('listType')&&_0x4d7538&&(_0x57a487['addClass']('ck-list-marker-line-height',_0x4f2c17),_0x57a487['setStyle']('--ck-content-list-marker-line-height',_0x4d7538,_0x4f2c17));}}),_0x27e2bd['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x27e2bd['for']('upcast')['add'](_0x234fa1=>{_0x234fa1['on']('element:li',function(_0x42fe76){const _0x210c00=new _0x28613b(_0x42fe76);return(_0x31a70a,_0x5da578,_0x15a1af)=>{const _0x4786e4=_0x210c00['match'](_0x5da578['viewItem']);if(!_0x4786e4)return;const _0x2d5dcc=_0x4786e4['match'];_0x2d5dcc['name']=!0x1,_0x15a1af['consumable']['consume'](_0x5da578['viewItem'],_0x2d5dcc);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x4e71a1{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50e6d4){super(_0x50e6d4),_0x50e6d4['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x21bf29=this['editor'];this['_validateConfig'](),_0x21bf29['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x21bf29['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x21bf29['commands']['add']('lineHeight',new p(_0x21bf29)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x17841a){const _0x39ffe6='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x58247c=0x793e0,_0x75d8fd={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x4a6506(_0x4640a3){const _0x3c7434=new window['Promise'](_0x3efce8=>{_0x4640a3['once']('ready',_0x3efce8);}),_0x346cf5=window['Date']['now'](),_0x4669fd=_0x4640a3['config']['get']('licenseKey');async function _0x3c5f85(){let _0x57f5d9,_0x301601=null,_0x2b47cd=null;try{return'GPL'==_0x4669fd?'NotAllowed':(_0x57f5d9=_0x396030(),_0x57f5d9?(_0x57f5d9['usageEndpoint']&&(_0x2b47cd=_0x3af0e1(_0x57f5d9['usageEndpoint'],_0x57f5d9['jti'])),await _0xc10491()?_0x1ac141()?_0x37a63d()?'Expired':_0x2058ee()?('evaluation'==_0x57f5d9['licenseType']&&(_0x301601=_0x4e1151('EvaluationLimit')),await _0x24e985()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x37a63d(){const _0x59334e=['evaluation','trial']['includes'](_0x57f5d9['licenseType'])?_0x346cf5/0x3e8:0xe10*_0x58247c;return _0x57f5d9['exp']<_0x59334e;}function _0x1ac141(){const _0xd34e4f=_0x57f5d9['features'];return!!_0xd34e4f&&(!!_0xd34e4f['includes']('*')||!!_0xd34e4f['includes']('LH'));}function _0x2058ee(){const _0x13dd6f=_0x57f5d9['licensedHosts'];if(!_0x13dd6f||0x0==_0x13dd6f['length'])return!0x0;const {hostname:_0x4299c1}=new URL(window['location']['href']);if(_0x13dd6f['includes'](_0x4299c1))return!0x0;const _0x5c8e67=_0x4299c1['split']('.');return _0x13dd6f['filter'](_0xeb8f0d=>_0xeb8f0d['includes']('*'))['map'](_0x45d7e4=>_0x45d7e4['split']('.'))['filter'](_0x486970=>_0x486970['length']<=_0x5c8e67['length'])['map'](_0x4ee296=>Array(_0x5c8e67['length']-_0x4ee296['length'])['fill']('*'===_0x4ee296[0x0]?'*':'')['concat'](_0x4ee296))['some'](_0x2efde8=>_0x5c8e67['every']((_0x6838a5,_0x393c60)=>_0x2efde8[_0x393c60]===_0x6838a5||'*'===_0x2efde8[_0x393c60]));}function _0x24e985(){return _0x301601&&_0x2b47cd?new window['Promise']((_0xb32513,_0x2183db)=>{_0x301601['then'](_0xb32513,_0x2183db),_0x2b47cd['then'](_0x51878f=>{'Valid'!=_0x51878f&&_0xb32513(_0x51878f);},_0x2183db);}):_0x301601||_0x2b47cd||'Valid';}}function _0x3af0e1(_0x4e78ee,_0x28c0d8){return new window['Promise'](_0x3fc5c3=>{if(_0x3e6233())return _0x3fc5c3('Valid');_0x27206e(),_0x4640a3['decorate']('_sendUsageRequest');let _0x2918a7=!0x1;const _0x3f8a66=_0x311381();function _0x56fa0a(_0x51fb8c){return!!_0x51fb8c&&('object'==typeof _0x51fb8c||'function'==typeof _0x51fb8c)&&'function'==typeof _0x51fb8c['then']&&'function'==typeof _0x51fb8c['catch'];}function _0x48af91(_0x3f56e3){_0x43f8dc(_0x3f56e3)['then'](_0x30d1b8=>_0x30d1b8&&'ok'==_0x30d1b8['status']?_0x2de1dc(_0x9d9076(_0x3f8a66+_0x28c0d8))!=_0x30d1b8['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0xba995a=>(_0x361124(),_0xba995a),()=>{const _0x21828f=_0x2105d4();return null==_0x21828f?(_0x361124(),'Valid'):_0x346cf5-_0x21828f>0x240c8400?'UsageLimit':'Valid';})['then'](_0x3fc5c3)['catch'](()=>{_0x3fc5c3('UsageLimit');});const _0x427f37=0x36ee80;function _0x361124(){const _0x13b29d='llct-'+_0x2de1dc(_0x9d9076(_0x4e78ee)),_0x32f122=_0x2ccc81(_0x2de1dc(window['Math']['ceil'](_0x346cf5/_0x427f37)));window['localStorage']['setItem'](_0x13b29d,_0x32f122);}function _0x2105d4(){const _0x583660='llct-'+_0x2de1dc(_0x9d9076(_0x4e78ee)),_0xea7d4b=window['localStorage']['getItem'](_0x583660);return _0xea7d4b?window['parseInt'](_0x2ccc81(_0xea7d4b),0x10)*_0x427f37:null;}function _0x43f8dc(_0x22f44f){return new window['Promise']((_0x36e973,_0x5e6ad6)=>{_0x22f44f['then'](_0x36e973,_0x5e6ad6),window['setTimeout'](_0x5e6ad6,0x1d4c0);});}}_0x4640a3['on']('_sendUsageRequest',(_0x32bc8c,_0x544d40)=>{if(_0x544d40[0x0]!=_0x4e78ee)return _0x3fc5c3('UsageLimit');_0x544d40[0x1]={..._0x544d40[0x1],'requestId':_0x3f8a66};},{'priority':'high'}),_0x4640a3['on']('_sendUsageRequest',_0x47d0cd=>{_0x56fa0a(_0x47d0cd['return'])&&(_0x2918a7=!0x0,_0x48af91(_0x47d0cd['return']));},{'priority':'low'}),_0x3c7434['then'](()=>{_0x2918a7||_0x3fc5c3('UsageLimit');});});function _0x3e6233(){return'auto'==_0x4640a3['editing']['view']['_overlayModeHint'];}function _0x27206e(){_0x4640a3['editing']['view']['_overlayModeHint']='auto';}}function _0x4e1151(_0x449afb){const _0x2cdf3b=[new window['Promise'](_0x1a7282=>setTimeout(_0x1a7282,0x93ecc)),_0x3c7434['then'](()=>new window['Promise'](_0xe019ea=>{let _0x4b71f=0x0;_0x4640a3['model']['on']('applyOperation',(_0xf5c4e2,_0xf24184)=>{_0xf24184[0x0]['isDocumentOperation']&&_0x4b71f++,0x5e8==_0x4b71f&&(_0xe019ea(),_0xf5c4e2['off']());});}))];return window['Promise']['race'](_0x2cdf3b)['then'](()=>_0x449afb);}async function _0x439c5d(){await _0x3c7434,_0x4640a3['model']['change']=_0x47806a,_0x4640a3['model']['enqueueChange']=_0x47806a,_0x4640a3['enableReadOnlyMode']('model');}function _0x3bc51a(_0x586ff5){const _0x2de243=_0x2c032c();_0x4640a3[_0x2de243]='lineHeightLicenseKey'+_0x586ff5,'Valid'!=_0x586ff5&&_0x439c5d();}function _0x2c032c(){const _0x385021=window['String'](window['performance']['now']())['replace']('.','');let _0x1f0c92='c';for(let _0x4c84ca=0x0;_0x4c84ca<_0x385021['length'];_0x4c84ca+=0x2){let _0x51ca95=window['parseInt'](_0x385021['substring'](_0x4c84ca,_0x4c84ca+0x2));_0x51ca95>=0x3e&&(_0x51ca95-=0x3e),_0x1f0c92+=_0x39ffe6[_0x51ca95];}return _0x1f0c92;}function _0x396030(){const _0x4d3ea6=_0x4669fd['split']('.');if(0x3!=_0x4d3ea6['length'])return null;return _0x55ccd1(_0x4d3ea6[0x1]);function _0x55ccd1(_0x328373){const _0x4f6e80=_0x378f96(_0x328373);return _0x4f6e80&&_0x20c403()?_0x4f6e80:null;function _0x20c403(){const _0x2d0996=_0x4f6e80['jti'],_0x45e41c=window['parseInt'](_0x2d0996['substring'](_0x2d0996['length']-0x8),0x10),_0x6bb2c3={..._0x4f6e80,'jti':_0x2d0996['substring'](0x0,_0x2d0996['length']-0x8)};return delete _0x6bb2c3['vc'],_0x9d9076(_0x6bb2c3)==_0x45e41c;}}}async function _0xc10491(){let _0x32349a=!0x0;try{const [_0x22695b,_0x397a72,_0x2921db]=_0x4669fd['split']('.');return _0x2e4583(_0x22695b),await _0x52f1d0(_0x22695b,_0x397a72,_0x2921db),_0x32349a;}catch{return!0x1;}function _0x2e4583(_0x254ab0){const _0x3cc7d2=_0x378f96(_0x254ab0);_0x3cc7d2&&'ES256'==_0x3cc7d2['alg']||(_0x32349a=!0x1);}async function _0x52f1d0(_0x14f413,_0x6c28d1,_0x3d7627){const _0x1680fe=window['Uint8Array']['from'](_0x123a8e(_0x3d7627),_0x504007=>_0x504007['charCodeAt'](0x0)),_0x1c7745=new window['TextEncoder']()['encode'](_0x14f413+'.'+_0x6c28d1),_0x5ae7d8=window['crypto']['subtle'];if(!_0x5ae7d8)return;const _0x4dcfa9=await _0x5ae7d8['importKey']('jwk',_0x75d8fd,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x5ae7d8['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4dcfa9,_0x1680fe,_0x1c7745)||(_0x32349a=!0x1);}}function _0x378f96(_0x3707a0){return _0x3707a0['startsWith']('ey')?JSON['parse'](_0x123a8e(_0x3707a0)):null;}function _0x123a8e(_0x5e619c){return window['atob'](_0x5e619c['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x9d9076(_0x514567){let _0x487663=0x1505;function _0xe6c3da(_0x16921a){for(let _0x18cef0=0x0;_0x18cef0<_0x16921a['length'];_0x18cef0++){const _0x50c1bc=_0x16921a['charCodeAt'](_0x18cef0);_0x487663=(_0x487663<<0x5)+_0x487663+_0x50c1bc,_0x487663&=_0x487663;}}function _0x4b2624(_0x5260e4){Array['isArray'](_0x5260e4)?_0x5260e4['forEach'](_0x4b2624):_0x5260e4&&'object'==typeof _0x5260e4?Object['entries'](_0x5260e4)['sort']()['forEach'](([_0x502edf,_0x26528c])=>{_0xe6c3da(_0x502edf),_0x4b2624(_0x26528c);}):_0xe6c3da(window['String'](_0x5260e4));}return _0x4b2624(_0x514567),_0x487663>>>0x0;}function _0x2de1dc(_0x13e25f){return _0x13e25f['toString'](0x10)['padStart'](0x8,'0');}function _0x2ccc81(_0x3520ee){return _0x3520ee['split']('')['reverse']()['join']('');}function _0x47806a(){}_0x3bc51a(await _0x3c5f85());}_0x4a6506(_0x17841a['editor']);}(this);}_validateConfig(){const _0x2c6ab3=this['editor'];if(!_0x2c6ab3['config']['get']('lineHeight.supportAllValues'))return;const _0x3f8d2a=_0x2c6ab3['config']['get']('lineHeight.options')['filter'](_0x50f92c=>'string'==typeof _0x50f92c&&(!H(_0x50f92c)&&isNaN(Number(_0x50f92c))));if(_0x3f8d2a['length'])throw new _0x183b17('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x3f8d2a});}_prepareAnyValueConverters(){const _0xf49684=this['editor'],_0x727bd0=this['editor']['config']['get']('lineHeight.defaultValue');_0xf49684['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x20285e=>String(_0x20285e)===String(_0x727bd0)?null:{'key':'style','value':{'line-height':_0x20285e}}}),_0xf49684['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x23aaed=>{let _0x183672=_0x23aaed['getStyle']('line-height');return _0x57ca43(_0x183672)&&(_0x183672=String(Number(_0x183672['slice'](0x0,-0x1))/0x64)),String(_0x183672)===String(_0x727bd0)?null:_0x183672;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x56871b=this['editor'],_0x1bfb8f=this['editor']['config']['get']('lineHeight.defaultValue'),_0x18cb95=function(_0x45f54f,_0x54cabc){const _0xb9cd49={'model':{'key':_0x45f54f,'values':[]},'view':{}};for(const _0x1c1dc8 of _0x54cabc)'class'===_0x1c1dc8['view']?.['key']?(_0xb9cd49['model']['values']['push'](_0x1c1dc8['model']),_0xb9cd49['view'][_0x1c1dc8['model']]={'key':'class','value':_0x1c1dc8['view']['value']}):(_0xb9cd49['model']['values']['push'](_0x1c1dc8['model']),_0xb9cd49['view'][_0x1c1dc8['model']]={'key':'style','value':'line-height:'+_0x1c1dc8['model']+';'});return _0xb9cd49;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0xafa710=>_0xafa710['model']));_0x56871b['conversion']['attributeToAttribute'](_0x18cb95),_0x56871b['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x36331d=>{let _0x3e7c1d=_0x36331d['getStyle']('line-height');return _0x57ca43(_0x3e7c1d)&&(_0x3e7c1d=String(Number(_0x3e7c1d['slice'](0x0,-0x1))/0x64)),_0x3e7c1d===String(_0x1bfb8f)?null:_0x18cb95['model']['values']['includes'](_0x3e7c1d)?_0x3e7c1d:null;}}});}},k=class extends _0x4e71a1{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x78598b={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x78598b),this['_registerMenuBarComponent'](_0x78598b),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x495791=[this['editor']];for(const _0x82fbb8 of _0x495791){let _0x58115c;for(const _0x506e83 in _0x82fbb8){const _0x554d8c=_0x506e83,_0x2d9368=_0x82fbb8[_0x554d8c];if('lineHeightLicenseKeyValid'==_0x2d9368||'lineHeightLicenseKeyInvalid'==_0x2d9368||'lineHeightLicenseKeyExpired'==_0x2d9368||'lineHeightLicenseKeyDomainLimit'==_0x2d9368||'lineHeightLicenseKeyNotAllowed'==_0x2d9368||'lineHeightLicenseKeyEvaluationLimit'==_0x2d9368||'lineHeightLicenseKeyUsageLimit'==_0x2d9368){delete _0x82fbb8[_0x554d8c],_0x58115c=_0x2d9368,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x58115c&&_0x82fbb8['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x58115c&&_0x82fbb8['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x58115c&&_0x82fbb8['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x58115c&&_0x82fbb8['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x58115c&&_0x82fbb8['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x58115c&&_0x82fbb8['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x26f4a6=this['editor'],t=_0x26f4a6['t'],_0x27d319=_0x26f4a6['config']['get']('lineHeight'),_0x40cb01={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x27d319)['map'](_0x413e0a=>{const _0x4599b7=_0x40cb01[_0x413e0a['title']];return _0x4599b7&&_0x4599b7!=_0x413e0a['title']&&(_0x413e0a=Object['assign']({},_0x413e0a,{'title':_0x4599b7})),_0x413e0a;});}_prepareListOptions(){const _0x578452=this['editor']['commands']['get']('lineHeight'),_0x532f14=this['editor']['config']['get']('lineHeight.defaultValue'),_0x1d9143=this['_getLocalizedLineHeightOptions'](),_0x362047=new _0x3a25b8(),_0x38b5c1=_0x1ba9a0=>'default'===_0x1ba9a0||String(_0x532f14)===_0x1ba9a0;for(const _0x13e2af of _0x1d9143){const _0x1f8a74={'type':'button','model':new _0x1370bf({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x13e2af['title'],'withText':!0x0})};_0x38b5c1(_0x13e2af['model'])?(_0x1f8a74['model']['bind']('isOn')['to'](_0x578452,'value',_0x11cd27=>!_0x11cd27),_0x1f8a74['model']['commandParam']=void 0x0):(_0x1f8a74['model']['bind']('isOn')['to'](_0x578452,'value',_0x4ee134=>_0x4ee134===_0x13e2af['model']),_0x1f8a74['model']['commandParam']=_0x13e2af['model']),_0x362047['add'](_0x1f8a74);}if(this['_shouldRenderCustomValueOption']()){const _0x4373af=this['_getCustomValueOptionDefinition'](_0x1d9143);_0x362047['add'](_0x4373af);}return _0x362047;}_getCustomValueOptionDefinition(_0xa61d98){const _0x12b39c=this['editor'],t=_0x12b39c['t'],_0x1eb059=_0x12b39c['commands']['get']('lineHeight'),_0x31cf86=_0xa61d98['map'](_0x20adf6=>_0x20adf6['model']),_0x2c53f0={'type':'button','model':new _0x1370bf({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x2c53f0['model']['bind']('commandParam')['to'](_0x1eb059,'value'),_0x2c53f0['model']['bind']('isOn')['to'](_0x1eb059,'value',_0x599aab=>!!_0x599aab&&!_0x31cf86['includes'](String(_0x599aab))),_0x2c53f0['model']['bind']('label')['to'](_0x1eb059,'value',_0x1a9635=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x1a9635))),_0x2c53f0;}_registerToolbarComponent({accessibleLabel:_0x50be04,options:_0x1953a4}){const _0x1b50b8=this['editor'],_0x32b6e0=_0x1b50b8['commands']['get']('lineHeight');_0x1b50b8['ui']['componentFactory']['add']('lineHeight',_0x355a92=>{const _0x13d47c=_0x379325(_0x355a92);return _0x3e8e28(_0x13d47c,_0x1953a4,{'role':'menu','ariaLabel':_0x50be04}),_0x13d47c['buttonView']['set']({'label':_0x50be04,'tooltip':!0x0,'icon':_0x14c72e}),_0x13d47c['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x13d47c['bind']('isEnabled')['to'](_0x32b6e0),this['listenTo'](_0x13d47c,'execute',_0x3b30de=>{_0x1b50b8['execute'](_0x3b30de['source']['commandName'],{'value':_0x3b30de['source']['commandParam']}),_0x1b50b8['editing']['view']['focus']();}),_0x13d47c['once']('change:isOpen',()=>{const _0x1c5771=_0x13d47c['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x13d47c,_0x1953a4,_0x1c5771);}),_0x13d47c;});}_registerMenuBarComponent({accessibleLabel:_0x540ad6,options:_0x3fc31f}){const _0x50ffb7=this['editor'],_0x1748ca=_0x50ffb7['commands']['get']('lineHeight');_0x50ffb7['ui']['componentFactory']['add']('menuBar:lineHeight',_0x338bb1=>{const _0x56d2bd=new _0x10825a(_0x338bb1);_0x56d2bd['buttonView']['set']({'label':_0x540ad6,'icon':_0x14c72e}),_0x56d2bd['bind']('isEnabled')['to'](_0x1748ca);const _0x59d807=new _0x4230ef(_0x338bb1);for(const _0x1a4aed of _0x3fc31f){const _0x1c90e6=new _0x2f447a(_0x338bb1,_0x56d2bd),_0x2ce539=new _0x6f2e18(_0x338bb1);_0x2ce539['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x2ce539['bind'](...Object['keys'](_0x1a4aed['model']))['to'](_0x1a4aed['model']),_0x2ce539['delegate']('execute')['to'](_0x56d2bd),_0x2ce539['on']('execute',()=>{_0x50ffb7['execute'](_0x1a4aed['model']['commandName'],{'value':_0x1a4aed['model']['commandParam']}),_0x50ffb7['editing']['view']['focus']();}),_0x1c90e6['children']['add'](_0x2ce539),_0x59d807['items']['add'](_0x1c90e6);}return _0x56d2bd['panelView']['children']['add'](_0x59d807),this['_attachCustomOptionVisibilityHandler'](_0x56d2bd,_0x3fc31f,_0x59d807),_0x56d2bd;});}_attachCustomOptionVisibilityHandler(_0x394303,_0x25fdba,_0x34e72e){if(!this['_shouldRenderCustomValueOption']())return;const _0x508ad7=()=>{if(!_0x394303['isOpen'])return;_0x34e72e['items']['last']['isVisible']=Boolean(_0x25fdba['last']['model']['isOn']);};_0x508ad7(),_0x394303['on']('change:isOpen',()=>{_0x508ad7();});}},_=class extends _0x4e71a1{static get requires(){return[b,k];}static get['pluginName'](){return'LineHeight';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{_ as LineHeight,p as LineHeightCommand,b as LineHeightEditing,v as LineHeightTodoListIntegration,k as LineHeightUI};
23
+ import{Command as _0x1b2de8,Plugin as _0x44ed52}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x561132,Collection as _0x1a01d9,first as _0x4ba204,uid as _0x469505}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x47f5b3,isPercentageStyleValue as _0x20f581}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x3c4dc1,MenuBarMenuListItemView as _0x3100d6,MenuBarMenuListView as _0x152ff1,MenuBarMenuView as _0x29da89,UIModel as _0x1759ba,addListToDropdown as _0x3ed2ed,createDropdown as _0x2f7737}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x2d6370}from'@ckeditor/ckeditor5-icons';var p=class extends _0x1b2de8{['refresh'](){const _0x4500c9=this['editor']['model']['document'],_0x5cca14=_0x4ba204(_0x4500c9['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x5cca14)&&this['_canHaveLineHeight'](_0x5cca14),this['value']=this['isEnabled']&&_0x5cca14['getAttribute']('lineHeight');}execute(_0x488c1c={}){const _0xf95827=this['editor']['model'],_0x5618b4=_0xf95827['document']['selection'],_0x2f9a7c=_0x488c1c['value'];_0xf95827['change'](_0x258a53=>{const _0x3c4cfd=Array['from'](_0x5618b4['getSelectedBlocks']())['filter'](_0x4b9482=>this['_canHaveLineHeight'](_0x4b9482));for(const _0x396e5a of _0x3c4cfd)_0x2f9a7c?_0x258a53['setAttribute']('lineHeight',_0x2f9a7c,_0x396e5a):_0x258a53['removeAttribute']('lineHeight',_0x396e5a);});}_canHaveLineHeight(_0x4e3a4f){return this['editor']['model']['schema']['checkAttribute'](_0x4e3a4f,'lineHeight');}};const y={get 'single'(){return{'title':'Single','model':'single','view':{'key':'class','value':'line-height-single'}};},get 'double'(){return{'title':'Double','model':'double','view':{'key':'class','value':'line-height-double'}};}};function H(_0x37389b){return'string'==typeof _0x37389b&&'default'===_0x37389b['toLowerCase']();}function L(_0x7332cf){return _0x7332cf['options']['map'](_0x43e940=>{return H(_0x43e940)?{'title':String(_0x7332cf['defaultValue']),'model':'default'}:('number'==typeof _0x43e940&&(_0x43e940=String(_0x43e940)),'string'!=typeof _0x43e940?_0x43e940:parseFloat(_0x43e940)?{'title':_0x43e940,'model':_0x43e940,'view':{'name':'span','styles':{'line-height':_0x43e940}}}:'string'==typeof(_0x315d8a=_0x43e940)?y[_0x315d8a]:y[_0x315d8a['model']]);var _0x315d8a;})['filter'](_0x592016=>void 0x0!==_0x592016);}var v=class extends _0x44ed52{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x2c0fb2,conversion:_0x504c46}=this['editor'];_0x2c0fb2['has']('ListEditing')&&_0x2c0fb2['has']('TodoListEditing')&&(_0x2c0fb2['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x3bfb8d,_0x271346,_0x3ab87b,_0x5e0056,_0x36aa2c){'todo'==_0x36aa2c['getAttribute']('listType')&&_0x271346&&(_0x3bfb8d['addClass']('ck-list-marker-line-height',_0x3ab87b),_0x3bfb8d['setStyle']('--ck-content-list-marker-line-height',_0x271346,_0x3ab87b));}}),_0x504c46['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x504c46['for']('upcast')['add'](_0xfabd75=>{_0xfabd75['on']('element:li',function(_0x2f2f66){const _0x4368a3=new _0x47f5b3(_0x2f2f66);return(_0x5df3e8,_0x1305bc,_0x449415)=>{const _0x30d6dc=_0x4368a3['match'](_0x1305bc['viewItem']);if(!_0x30d6dc)return;const _0x13c20f=_0x30d6dc['match'];_0x13c20f['name']=!0x1,_0x449415['consumable']['consume'](_0x1305bc['viewItem'],_0x13c20f);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x44ed52{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4e58d9){super(_0x4e58d9),_0x4e58d9['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x41ef48=this['editor'];this['_validateConfig'](),_0x41ef48['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x41ef48['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x41ef48['commands']['add']('lineHeight',new p(_0x41ef48)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x1b6d51){const _0x34d51c='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x25d916=0x793f8,_0x2c0043={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x4966fd(_0x2fc23e){const _0x2b312e=new window['Promise'](_0x5e40ff=>{_0x2fc23e['once']('ready',_0x5e40ff);}),_0x5413a8=window['Date']['now'](),_0x47b58b=_0x2fc23e['config']['get']('licenseKey');async function _0x30d5b9(){let _0x4c9d1b,_0x36f9eb=null,_0x2a622e=null;try{return'GPL'==_0x47b58b?'NotAllowed':(_0x4c9d1b=_0x4450e9(),_0x4c9d1b?(_0x4c9d1b['usageEndpoint']&&(_0x2a622e=_0x3f5321(_0x4c9d1b['usageEndpoint'],_0x4c9d1b['jti'])),await _0x339399()?_0x4d75ab()?_0xa6af89()?'Expired':_0xa26906()?('evaluation'==_0x4c9d1b['licenseType']&&(_0x36f9eb=_0x532dfd('EvaluationLimit')),await _0x2390a7()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0xa6af89(){const _0x3a5481=['evaluation','trial']['includes'](_0x4c9d1b['licenseType'])?_0x5413a8/0x3e8:0xe10*_0x25d916;return _0x4c9d1b['exp']<_0x3a5481;}function _0x4d75ab(){const _0x56aec3=_0x4c9d1b['features'];return!!_0x56aec3&&(!!_0x56aec3['includes']('*')||!!_0x56aec3['includes']('LH'));}function _0xa26906(){const _0x4f1ece=_0x4c9d1b['licensedHosts'];if(!_0x4f1ece||0x0==_0x4f1ece['length'])return!0x0;const {hostname:_0x2929da}=new URL(window['location']['href']);if(_0x4f1ece['includes'](_0x2929da))return!0x0;const _0xeaba80=_0x2929da['split']('.');return _0x4f1ece['filter'](_0x4a93af=>_0x4a93af['includes']('*'))['map'](_0x4d9893=>_0x4d9893['split']('.'))['filter'](_0x37f04c=>_0x37f04c['length']<=_0xeaba80['length'])['map'](_0x67acb3=>Array(_0xeaba80['length']-_0x67acb3['length'])['fill']('*'===_0x67acb3[0x0]?'*':'')['concat'](_0x67acb3))['some'](_0x38f554=>_0xeaba80['every']((_0x1d3a31,_0x52eba6)=>_0x38f554[_0x52eba6]===_0x1d3a31||'*'===_0x38f554[_0x52eba6]));}function _0x2390a7(){return _0x36f9eb&&_0x2a622e?new window['Promise']((_0x28a331,_0x53c7f8)=>{_0x36f9eb['then'](_0x28a331,_0x53c7f8),_0x2a622e['then'](_0x342357=>{'Valid'!=_0x342357&&_0x28a331(_0x342357);},_0x53c7f8);}):_0x36f9eb||_0x2a622e||'Valid';}}function _0x3f5321(_0x41f2e8,_0xfe0984){return new window['Promise'](_0x3644c0=>{if(_0xcee93d())return _0x3644c0('Valid');_0x19d29a(),_0x2fc23e['decorate']('_sendUsageRequest');let _0x1f7f5e=!0x1;const _0x10936a=_0x469505();function _0x458429(_0x4059bb){return!!_0x4059bb&&('object'==typeof _0x4059bb||'function'==typeof _0x4059bb)&&'function'==typeof _0x4059bb['then']&&'function'==typeof _0x4059bb['catch'];}function _0x2de620(_0x56ae6d){_0x2fb889(_0x56ae6d)['then'](_0xee2fe7=>_0xee2fe7&&'ok'==_0xee2fe7['status']?_0x5e98aa(_0x109a08(_0x10936a+_0xfe0984))!=_0xee2fe7['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x27c9c6=>(_0xce9700(),_0x27c9c6),()=>{const _0x1bcd32=_0x5bcf5f();return null==_0x1bcd32?(_0xce9700(),'Valid'):_0x5413a8-_0x1bcd32>0x240c8400?'UsageLimit':'Valid';})['then'](_0x3644c0)['catch'](()=>{_0x3644c0('UsageLimit');});const _0x5d5aa8=0x36ee80;function _0xce9700(){const _0x414e89='llct-'+_0x5e98aa(_0x109a08(_0x41f2e8)),_0x31ffcb=_0x3c99eb(_0x5e98aa(window['Math']['ceil'](_0x5413a8/_0x5d5aa8)));window['localStorage']['setItem'](_0x414e89,_0x31ffcb);}function _0x5bcf5f(){const _0x16fe43='llct-'+_0x5e98aa(_0x109a08(_0x41f2e8)),_0x4d9ebb=window['localStorage']['getItem'](_0x16fe43);return _0x4d9ebb?window['parseInt'](_0x3c99eb(_0x4d9ebb),0x10)*_0x5d5aa8:null;}function _0x2fb889(_0x1c8b87){return new window['Promise']((_0x3f322e,_0x1977d4)=>{_0x1c8b87['then'](_0x3f322e,_0x1977d4),window['setTimeout'](_0x1977d4,0x1d4c0);});}}_0x2fc23e['on']('_sendUsageRequest',(_0x5d80f3,_0x198402)=>{if(_0x198402[0x0]!=_0x41f2e8)return _0x3644c0('UsageLimit');_0x198402[0x1]={..._0x198402[0x1],'requestId':_0x10936a};},{'priority':'high'}),_0x2fc23e['on']('_sendUsageRequest',_0x41d5a8=>{_0x458429(_0x41d5a8['return'])&&(_0x1f7f5e=!0x0,_0x2de620(_0x41d5a8['return']));},{'priority':'low'}),_0x2b312e['then'](()=>{_0x1f7f5e||_0x3644c0('UsageLimit');});});function _0xcee93d(){return'auto'==_0x2fc23e['editing']['view']['_overlayModeHint'];}function _0x19d29a(){_0x2fc23e['editing']['view']['_overlayModeHint']='auto';}}function _0x532dfd(_0x17f7d7){const _0x128829=[new window['Promise'](_0x4957c6=>setTimeout(_0x4957c6,0x93ecc)),_0x2b312e['then'](()=>new window['Promise'](_0x818fa1=>{let _0x54990f=0x0;_0x2fc23e['model']['on']('applyOperation',(_0x4b4c0b,_0x3c5818)=>{_0x3c5818[0x0]['isDocumentOperation']&&_0x54990f++,0x5e8==_0x54990f&&(_0x818fa1(),_0x4b4c0b['off']());});}))];return window['Promise']['race'](_0x128829)['then'](()=>_0x17f7d7);}async function _0x295f80(){await _0x2b312e,_0x2fc23e['model']['change']=_0x288f08,_0x2fc23e['model']['enqueueChange']=_0x288f08,_0x2fc23e['enableReadOnlyMode']('model');}function _0x133cb3(_0x11f019){const _0x1d3cdd=_0x1006f2();_0x2fc23e[_0x1d3cdd]='lineHeightLicenseKey'+_0x11f019,'Valid'!=_0x11f019&&_0x295f80();}function _0x1006f2(){const _0x4212d9=window['String'](window['performance']['now']())['replace']('.','');let _0x40e420='c';for(let _0x4f1739=0x0;_0x4f1739<_0x4212d9['length'];_0x4f1739+=0x2){let _0x4ea317=window['parseInt'](_0x4212d9['substring'](_0x4f1739,_0x4f1739+0x2));_0x4ea317>=0x3e&&(_0x4ea317-=0x3e),_0x40e420+=_0x34d51c[_0x4ea317];}return _0x40e420;}function _0x4450e9(){const _0x3c1937=_0x47b58b['split']('.');if(0x3!=_0x3c1937['length'])return null;return _0x18f688(_0x3c1937[0x1]);function _0x18f688(_0x126285){const _0x27ac64=_0x17c0b1(_0x126285);return _0x27ac64&&_0x1985fe()?_0x27ac64:null;function _0x1985fe(){const _0x1040bf=_0x27ac64['jti'],_0x39b299=window['parseInt'](_0x1040bf['substring'](_0x1040bf['length']-0x8),0x10),_0x167723={..._0x27ac64,'jti':_0x1040bf['substring'](0x0,_0x1040bf['length']-0x8)};return delete _0x167723['vc'],_0x109a08(_0x167723)==_0x39b299;}}}async function _0x339399(){let _0x279659=!0x0;try{const [_0x578c54,_0x1eea69,_0x2e3bc7]=_0x47b58b['split']('.');return _0x2f734f(_0x578c54),await _0x10847b(_0x578c54,_0x1eea69,_0x2e3bc7),_0x279659;}catch{return!0x1;}function _0x2f734f(_0x1b9cef){const _0x16ab5a=_0x17c0b1(_0x1b9cef);_0x16ab5a&&'ES256'==_0x16ab5a['alg']||(_0x279659=!0x1);}async function _0x10847b(_0x4afbd4,_0x4817b4,_0x5a3272){const _0x138651=window['Uint8Array']['from'](_0x258b67(_0x5a3272),_0x18b836=>_0x18b836['charCodeAt'](0x0)),_0x22f1af=new window['TextEncoder']()['encode'](_0x4afbd4+'.'+_0x4817b4),_0x8e663c=window['crypto']['subtle'];if(!_0x8e663c)return;const _0x2a288c=await _0x8e663c['importKey']('jwk',_0x2c0043,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x8e663c['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x2a288c,_0x138651,_0x22f1af)||(_0x279659=!0x1);}}function _0x17c0b1(_0x12f295){return _0x12f295['startsWith']('ey')?JSON['parse'](_0x258b67(_0x12f295)):null;}function _0x258b67(_0x1ed82d){return window['atob'](_0x1ed82d['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x109a08(_0x54126c){let _0xf4123d=0x1505;function _0x19d006(_0x95313f){for(let _0x2018b6=0x0;_0x2018b6<_0x95313f['length'];_0x2018b6++){const _0x577b15=_0x95313f['charCodeAt'](_0x2018b6);_0xf4123d=(_0xf4123d<<0x5)+_0xf4123d+_0x577b15,_0xf4123d&=_0xf4123d;}}function _0x10a206(_0x4a02dc){Array['isArray'](_0x4a02dc)?_0x4a02dc['forEach'](_0x10a206):_0x4a02dc&&'object'==typeof _0x4a02dc?Object['entries'](_0x4a02dc)['sort']()['forEach'](([_0x220e33,_0x243668])=>{_0x19d006(_0x220e33),_0x10a206(_0x243668);}):_0x19d006(window['String'](_0x4a02dc));}return _0x10a206(_0x54126c),_0xf4123d>>>0x0;}function _0x5e98aa(_0x40f666){return _0x40f666['toString'](0x10)['padStart'](0x8,'0');}function _0x3c99eb(_0x1ec0da){return _0x1ec0da['split']('')['reverse']()['join']('');}function _0x288f08(){}_0x133cb3(await _0x30d5b9());}_0x4966fd(_0x1b6d51['editor']);}(this);}_validateConfig(){const _0x2d55d5=this['editor'];if(!_0x2d55d5['config']['get']('lineHeight.supportAllValues'))return;const _0x53c279=_0x2d55d5['config']['get']('lineHeight.options')['filter'](_0x250037=>'string'==typeof _0x250037&&(!H(_0x250037)&&isNaN(Number(_0x250037))));if(_0x53c279['length'])throw new _0x561132('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x53c279});}_prepareAnyValueConverters(){const _0x10d269=this['editor'],_0x45b40f=this['editor']['config']['get']('lineHeight.defaultValue');_0x10d269['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x46bcfe=>String(_0x46bcfe)===String(_0x45b40f)?null:{'key':'style','value':{'line-height':_0x46bcfe}}}),_0x10d269['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x514bc5=>{let _0x4b28bd=_0x514bc5['getStyle']('line-height');return _0x20f581(_0x4b28bd)&&(_0x4b28bd=String(Number(_0x4b28bd['slice'](0x0,-0x1))/0x64)),String(_0x4b28bd)===String(_0x45b40f)?null:_0x4b28bd;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x5dcefe=this['editor'],_0x1b7895=this['editor']['config']['get']('lineHeight.defaultValue'),_0xa03c33=function(_0x552b97,_0x45335b){const _0x2eb179={'model':{'key':_0x552b97,'values':[]},'view':{}};for(const _0x5b830a of _0x45335b)'class'===_0x5b830a['view']?.['key']?(_0x2eb179['model']['values']['push'](_0x5b830a['model']),_0x2eb179['view'][_0x5b830a['model']]={'key':'class','value':_0x5b830a['view']['value']}):(_0x2eb179['model']['values']['push'](_0x5b830a['model']),_0x2eb179['view'][_0x5b830a['model']]={'key':'style','value':'line-height:'+_0x5b830a['model']+';'});return _0x2eb179;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x4a5f3a=>_0x4a5f3a['model']));_0x5dcefe['conversion']['attributeToAttribute'](_0xa03c33),_0x5dcefe['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x1b4efa=>{let _0x4dbc4c=_0x1b4efa['getStyle']('line-height');return _0x20f581(_0x4dbc4c)&&(_0x4dbc4c=String(Number(_0x4dbc4c['slice'](0x0,-0x1))/0x64)),_0x4dbc4c===String(_0x1b7895)?null:_0xa03c33['model']['values']['includes'](_0x4dbc4c)?_0x4dbc4c:null;}}});}},k=class extends _0x44ed52{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x427442={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x427442),this['_registerMenuBarComponent'](_0x427442),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x1efd25=[this['editor']];for(const _0x4b5cc7 of _0x1efd25){let _0x5d1a03;for(const _0x300793 in _0x4b5cc7){const _0x223c93=_0x300793,_0x3cc51c=_0x4b5cc7[_0x223c93];if('lineHeightLicenseKeyValid'==_0x3cc51c||'lineHeightLicenseKeyInvalid'==_0x3cc51c||'lineHeightLicenseKeyExpired'==_0x3cc51c||'lineHeightLicenseKeyDomainLimit'==_0x3cc51c||'lineHeightLicenseKeyNotAllowed'==_0x3cc51c||'lineHeightLicenseKeyEvaluationLimit'==_0x3cc51c||'lineHeightLicenseKeyUsageLimit'==_0x3cc51c){delete _0x4b5cc7[_0x223c93],_0x5d1a03=_0x3cc51c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x5d1a03&&_0x4b5cc7['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x5d1a03&&_0x4b5cc7['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x5d1a03&&_0x4b5cc7['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x5d1a03&&_0x4b5cc7['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x5d1a03&&_0x4b5cc7['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x5d1a03&&_0x4b5cc7['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x52609b=this['editor'],t=_0x52609b['t'],_0x5f0dc6=_0x52609b['config']['get']('lineHeight'),_0xa037b7={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x5f0dc6)['map'](_0x17cc91=>{const _0x294f89=_0xa037b7[_0x17cc91['title']];return _0x294f89&&_0x294f89!=_0x17cc91['title']&&(_0x17cc91=Object['assign']({},_0x17cc91,{'title':_0x294f89})),_0x17cc91;});}_prepareListOptions(){const _0x2d0c37=this['editor']['commands']['get']('lineHeight'),_0x3779cc=this['editor']['config']['get']('lineHeight.defaultValue'),_0x42143e=this['_getLocalizedLineHeightOptions'](),_0x379154=new _0x1a01d9(),_0x1ccfbb=_0x53523b=>'default'===_0x53523b||String(_0x3779cc)===_0x53523b;for(const _0x58ee47 of _0x42143e){const _0x2bc776={'type':'button','model':new _0x1759ba({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x58ee47['title'],'withText':!0x0})};_0x1ccfbb(_0x58ee47['model'])?(_0x2bc776['model']['bind']('isOn')['to'](_0x2d0c37,'value',_0x2354b8=>!_0x2354b8),_0x2bc776['model']['commandParam']=void 0x0):(_0x2bc776['model']['bind']('isOn')['to'](_0x2d0c37,'value',_0x2d69e1=>_0x2d69e1===_0x58ee47['model']),_0x2bc776['model']['commandParam']=_0x58ee47['model']),_0x379154['add'](_0x2bc776);}if(this['_shouldRenderCustomValueOption']()){const _0x3a4e80=this['_getCustomValueOptionDefinition'](_0x42143e);_0x379154['add'](_0x3a4e80);}return _0x379154;}_getCustomValueOptionDefinition(_0x3841ba){const _0x195c30=this['editor'],t=_0x195c30['t'],_0x2358fb=_0x195c30['commands']['get']('lineHeight'),_0x4c8355=_0x3841ba['map'](_0x58b7b7=>_0x58b7b7['model']),_0x164af4={'type':'button','model':new _0x1759ba({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x164af4['model']['bind']('commandParam')['to'](_0x2358fb,'value'),_0x164af4['model']['bind']('isOn')['to'](_0x2358fb,'value',_0x54a8ad=>!!_0x54a8ad&&!_0x4c8355['includes'](String(_0x54a8ad))),_0x164af4['model']['bind']('label')['to'](_0x2358fb,'value',_0x17e0f4=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x17e0f4))),_0x164af4;}_registerToolbarComponent({accessibleLabel:_0x5a7ff6,options:_0x4459ee}){const _0x2eeef6=this['editor'],_0x3f4db3=_0x2eeef6['commands']['get']('lineHeight');_0x2eeef6['ui']['componentFactory']['add']('lineHeight',_0x3c6851=>{const _0x457990=_0x2f7737(_0x3c6851);return _0x3ed2ed(_0x457990,_0x4459ee,{'role':'menu','ariaLabel':_0x5a7ff6}),_0x457990['buttonView']['set']({'label':_0x5a7ff6,'tooltip':!0x0,'icon':_0x2d6370}),_0x457990['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x457990['bind']('isEnabled')['to'](_0x3f4db3),this['listenTo'](_0x457990,'execute',_0x5b617f=>{_0x2eeef6['execute'](_0x5b617f['source']['commandName'],{'value':_0x5b617f['source']['commandParam']}),_0x2eeef6['editing']['view']['focus']();}),_0x457990['once']('change:isOpen',()=>{const _0x40e11a=_0x457990['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x457990,_0x4459ee,_0x40e11a);}),_0x457990;});}_registerMenuBarComponent({accessibleLabel:_0x3f6ee4,options:_0x35140e}){const _0x2f96f5=this['editor'],_0x391110=_0x2f96f5['commands']['get']('lineHeight');_0x2f96f5['ui']['componentFactory']['add']('menuBar:lineHeight',_0x2e6192=>{const _0x1fdee8=new _0x29da89(_0x2e6192);_0x1fdee8['buttonView']['set']({'label':_0x3f6ee4,'icon':_0x2d6370}),_0x1fdee8['bind']('isEnabled')['to'](_0x391110);const _0x4c99d5=new _0x152ff1(_0x2e6192);for(const _0x332aa3 of _0x35140e){const _0x359925=new _0x3100d6(_0x2e6192,_0x1fdee8),_0x389ae9=new _0x3c4dc1(_0x2e6192);_0x389ae9['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x389ae9['bind'](...Object['keys'](_0x332aa3['model']))['to'](_0x332aa3['model']),_0x389ae9['delegate']('execute')['to'](_0x1fdee8),_0x389ae9['on']('execute',()=>{_0x2f96f5['execute'](_0x332aa3['model']['commandName'],{'value':_0x332aa3['model']['commandParam']}),_0x2f96f5['editing']['view']['focus']();}),_0x359925['children']['add'](_0x389ae9),_0x4c99d5['items']['add'](_0x359925);}return _0x1fdee8['panelView']['children']['add'](_0x4c99d5),this['_attachCustomOptionVisibilityHandler'](_0x1fdee8,_0x35140e,_0x4c99d5),_0x1fdee8;});}_attachCustomOptionVisibilityHandler(_0x4c7999,_0x401593,_0x41cc72){if(!this['_shouldRenderCustomValueOption']())return;const _0x32f608=()=>{if(!_0x4c7999['isOpen'])return;_0x41cc72['items']['last']['isVisible']=Boolean(_0x401593['last']['model']['isOn']);};_0x32f608(),_0x4c7999['on']('change:isOpen',()=>{_0x32f608();});}},_=class extends _0x44ed52{static get requires(){return[b,k];}static get['pluginName'](){return'LineHeight';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{_ as LineHeight,p as LineHeightCommand,b as LineHeightEditing,v as LineHeightTodoListIntegration,k as LineHeightUI};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-line-height",
3
- "version": "48.5.0-alpha.1",
3
+ "version": "48.5.0-alpha.2",
4
4
  "description": "Line height feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (https://cksource.com/)",
@@ -26,12 +26,12 @@
26
26
  "dist/translations/*.umd.js"
27
27
  ],
28
28
  "dependencies": {
29
- "@ckeditor/ckeditor5-core": "48.5.0-alpha.1",
30
- "@ckeditor/ckeditor5-engine": "48.5.0-alpha.1",
31
- "@ckeditor/ckeditor5-icons": "48.5.0-alpha.1",
32
- "@ckeditor/ckeditor5-list": "48.5.0-alpha.1",
33
- "@ckeditor/ckeditor5-ui": "48.5.0-alpha.1",
34
- "@ckeditor/ckeditor5-utils": "48.5.0-alpha.1"
29
+ "@ckeditor/ckeditor5-core": "48.5.0-alpha.2",
30
+ "@ckeditor/ckeditor5-engine": "48.5.0-alpha.2",
31
+ "@ckeditor/ckeditor5-icons": "48.5.0-alpha.2",
32
+ "@ckeditor/ckeditor5-list": "48.5.0-alpha.2",
33
+ "@ckeditor/ckeditor5-ui": "48.5.0-alpha.2",
34
+ "@ckeditor/ckeditor5-utils": "48.5.0-alpha.2"
35
35
  },
36
36
  "files": [
37
37
  "dist",