@ckeditor/ckeditor5-line-height 49.0.0-alpha.3 → 49.0.0-alpha.5

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 _0x1822eb,Plugin as _0x2949f1}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x2d8e18,Collection as _0xfb46a4,first as _0x3266aa,uid as _0xdab7a6}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x2ecfdf,isPercentageStyleValue as _0x7ee25a}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x3a7b95,MenuBarMenuListItemView as _0x222373,MenuBarMenuListView as _0x4fa2b3,MenuBarMenuView as _0xc824ef,UIModel as _0x9e0436,addListToDropdown as _0x3a9fbf,createDropdown as _0x5325a7}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x44d807}from'@ckeditor/ckeditor5-icons';var p=class extends _0x1822eb{['refresh'](){const _0x4656e3=this['editor']['model']['document'],_0x183339=_0x3266aa(_0x4656e3['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x183339)&&this['_canHaveLineHeight'](_0x183339),this['value']=this['isEnabled']&&_0x183339['getAttribute']('lineHeight');}execute(_0x33ea02={}){const _0x467311=this['editor']['model'],_0xe0dad8=_0x467311['document']['selection'],_0x535a49=_0x33ea02['value'];_0x467311['change'](_0x1380e4=>{const _0x24435d=Array['from'](_0xe0dad8['getSelectedBlocks']())['filter'](_0x2444ac=>this['_canHaveLineHeight'](_0x2444ac));for(const _0x26a3e0 of _0x24435d)_0x535a49?_0x1380e4['setAttribute']('lineHeight',_0x535a49,_0x26a3e0):_0x1380e4['removeAttribute']('lineHeight',_0x26a3e0);});}_canHaveLineHeight(_0x408c70){return this['editor']['model']['schema']['checkAttribute'](_0x408c70,'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(_0x29f4e4){return'string'==typeof _0x29f4e4&&'default'===_0x29f4e4['toLowerCase']();}function L(_0x8eb1af){return _0x8eb1af['options']['map'](_0xcf96f5=>{return H(_0xcf96f5)?{'title':String(_0x8eb1af['defaultValue']),'model':'default'}:('number'==typeof _0xcf96f5&&(_0xcf96f5=String(_0xcf96f5)),'string'!=typeof _0xcf96f5?_0xcf96f5:parseFloat(_0xcf96f5)?{'title':_0xcf96f5,'model':_0xcf96f5,'view':{'name':'span','styles':{'line-height':_0xcf96f5}}}:'string'==typeof(_0x15b171=_0xcf96f5)?y[_0x15b171]:y[_0x15b171['model']]);var _0x15b171;})['filter'](_0x4f4c37=>void 0x0!==_0x4f4c37);}var v=class extends _0x2949f1{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x479cbd,conversion:_0x39c259}=this['editor'];_0x479cbd['has']('ListEditing')&&_0x479cbd['has']('TodoListEditing')&&(_0x479cbd['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x27b064,_0x38fd45,_0x6b379f,_0x2b8c8b,_0x377d26){'todo'==_0x377d26['getAttribute']('listType')&&_0x38fd45&&(_0x27b064['addClass']('ck-list-marker-line-height',_0x6b379f),_0x27b064['setStyle']('--ck-content-list-marker-line-height',_0x38fd45,_0x6b379f));}}),_0x39c259['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x39c259['for']('upcast')['add'](_0x419471=>{_0x419471['on']('element:li',function(_0x57ffcc){const _0x483c4c=new _0x2ecfdf(_0x57ffcc);return(_0x15e73c,_0x3387f3,_0x56103d)=>{const _0x45da47=_0x483c4c['match'](_0x3387f3['viewItem']);if(!_0x45da47)return;const _0x5f5d2e=_0x45da47['match'];_0x5f5d2e['name']=!0x1,_0x56103d['consumable']['consume'](_0x3387f3['viewItem'],_0x5f5d2e);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x2949f1{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x36ae03){super(_0x36ae03),_0x36ae03['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x53afb9=this['editor'];this['_validateConfig'](),_0x53afb9['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x53afb9['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x53afb9['commands']['add']('lineHeight',new p(_0x53afb9)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x540a65){const _0x2b72a2='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x4192dc=0x79758,_0x588bfc={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x261366(_0x29037f){const _0x5a0b32=new window['Promise'](_0xd1eaa6=>{_0x29037f['once']('ready',_0xd1eaa6);}),_0x5134b4=window['Date']['now'](),_0x35c830=_0x29037f['config']['get']('licenseKey');async function _0x2f2dff(){let _0x174943,_0x17af58=null,_0x2a8c04=null;try{return'GPL'==_0x35c830?'NotAllowed':(_0x174943=_0x2071fe(),_0x174943?(_0x174943['usageEndpoint']&&(_0x2a8c04=_0x466482(_0x174943['usageEndpoint'],_0x174943['jti'])),await _0x935ece()?_0xf62f3f()?_0x544b20()?'Expired':_0x22257f()?('evaluation'==_0x174943['licenseType']&&(_0x17af58=_0x2ed23b('EvaluationLimit')),await _0x3410ec()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x544b20(){const _0x428ccb=['evaluation','trial']['includes'](_0x174943['licenseType'])?_0x5134b4/0x3e8:0xe10*_0x4192dc;return _0x174943['exp']<_0x428ccb;}function _0xf62f3f(){const _0x14ce16=_0x174943['features'];return!!_0x14ce16&&(!!_0x14ce16['includes']('*')||!!_0x14ce16['includes']('LH'));}function _0x22257f(){const _0x4b8a12=_0x174943['licensedHosts'];if(!_0x4b8a12||0x0==_0x4b8a12['length'])return!0x0;const {hostname:_0x306db7}=new URL(window['location']['href']);if(_0x4b8a12['includes'](_0x306db7))return!0x0;const _0x3d6bf2=_0x306db7['split']('.');return _0x4b8a12['filter'](_0x286abc=>_0x286abc['includes']('*'))['map'](_0x5314b4=>_0x5314b4['split']('.'))['filter'](_0x29ccc0=>_0x29ccc0['length']<=_0x3d6bf2['length'])['map'](_0x47438d=>Array(_0x3d6bf2['length']-_0x47438d['length'])['fill']('*'===_0x47438d[0x0]?'*':'')['concat'](_0x47438d))['some'](_0xfe8b28=>_0x3d6bf2['every']((_0x424310,_0x320857)=>_0xfe8b28[_0x320857]===_0x424310||'*'===_0xfe8b28[_0x320857]));}function _0x3410ec(){return _0x17af58&&_0x2a8c04?new window['Promise']((_0x5e8431,_0x5031a7)=>{_0x17af58['then'](_0x5e8431,_0x5031a7),_0x2a8c04['then'](_0x3da62c=>{'Valid'!=_0x3da62c&&_0x5e8431(_0x3da62c);},_0x5031a7);}):_0x17af58||_0x2a8c04||'Valid';}}function _0x466482(_0x260ae1,_0x3b0d32){return new window['Promise'](_0x32fd9a=>{if(_0x2b5d66())return _0x32fd9a('Valid');_0x33b0c6(),_0x29037f['decorate']('_sendUsageRequest');let _0x548787=!0x1;const _0x5c0b7c=_0xdab7a6();function _0x388397(_0x1ee369){return!!_0x1ee369&&('object'==typeof _0x1ee369||'function'==typeof _0x1ee369)&&'function'==typeof _0x1ee369['then']&&'function'==typeof _0x1ee369['catch'];}function _0x4c017a(_0x9de1c4){_0x51cc68(_0x9de1c4)['then'](_0x1ca5fd=>_0x1ca5fd&&'ok'==_0x1ca5fd['status']?_0x54a497(_0x13fc7f(_0x5c0b7c+_0x3b0d32))!=_0x1ca5fd['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x1ef107=>(_0x4c046f(),_0x1ef107),()=>{const _0x355693=_0x40f0f8();return null==_0x355693?(_0x4c046f(),'Valid'):_0x5134b4-_0x355693>0x240c8400?'UsageLimit':'Valid';})['then'](_0x32fd9a)['catch'](()=>{_0x32fd9a('UsageLimit');});const _0x5b5ee6=0x36ee80;function _0x4c046f(){const _0x45fa35='llct-'+_0x54a497(_0x13fc7f(_0x260ae1)),_0x2f9049=_0x16944d(_0x54a497(window['Math']['ceil'](_0x5134b4/_0x5b5ee6)));window['localStorage']['setItem'](_0x45fa35,_0x2f9049);}function _0x40f0f8(){const _0x4807ef='llct-'+_0x54a497(_0x13fc7f(_0x260ae1)),_0x8e799=window['localStorage']['getItem'](_0x4807ef);return _0x8e799?window['parseInt'](_0x16944d(_0x8e799),0x10)*_0x5b5ee6:null;}function _0x51cc68(_0x3e918d){return new window['Promise']((_0x2eed57,_0x256010)=>{_0x3e918d['then'](_0x2eed57,_0x256010),window['setTimeout'](_0x256010,0x1d4c0);});}}_0x29037f['on']('_sendUsageRequest',(_0x3e863e,_0x566a0d)=>{if(_0x566a0d[0x0]!=_0x260ae1)return _0x32fd9a('UsageLimit');_0x566a0d[0x1]={..._0x566a0d[0x1],'requestId':_0x5c0b7c};},{'priority':'high'}),_0x29037f['on']('_sendUsageRequest',_0x5e342a=>{_0x388397(_0x5e342a['return'])&&(_0x548787=!0x0,_0x4c017a(_0x5e342a['return']));},{'priority':'low'}),_0x5a0b32['then'](()=>{_0x548787||_0x32fd9a('UsageLimit');});});function _0x2b5d66(){return'auto'==_0x29037f['editing']['view']['_overlayModeHint'];}function _0x33b0c6(){_0x29037f['editing']['view']['_overlayModeHint']='auto';}}function _0x2ed23b(_0x3e4f9f){const _0x3d6ac1=[new window['Promise'](_0x55820f=>setTimeout(_0x55820f,0x93ecc)),_0x5a0b32['then'](()=>new window['Promise'](_0x4f73bc=>{let _0x41ae25=0x0;_0x29037f['model']['on']('applyOperation',(_0x3c630d,_0x4fd1d6)=>{_0x4fd1d6[0x0]['isDocumentOperation']&&_0x41ae25++,0x5e8==_0x41ae25&&(_0x4f73bc(),_0x3c630d['off']());});}))];return window['Promise']['race'](_0x3d6ac1)['then'](()=>_0x3e4f9f);}async function _0x322107(){await _0x5a0b32,_0x29037f['model']['change']=_0x3f8d09,_0x29037f['model']['enqueueChange']=_0x3f8d09,_0x29037f['enableReadOnlyMode']('model');}function _0x32f48a(_0x33e27d){const _0x46023a=_0x40dc6c();_0x29037f[_0x46023a]='lineHeightLicenseKey'+_0x33e27d,'Valid'!=_0x33e27d&&_0x322107();}function _0x40dc6c(){const _0x42f428=window['String'](window['performance']['now']())['replace']('.','');let _0x1a0f6d='c';for(let _0x2e5fec=0x0;_0x2e5fec<_0x42f428['length'];_0x2e5fec+=0x2){let _0x5f2f5f=window['parseInt'](_0x42f428['substring'](_0x2e5fec,_0x2e5fec+0x2));_0x5f2f5f>=0x3e&&(_0x5f2f5f-=0x3e),_0x1a0f6d+=_0x2b72a2[_0x5f2f5f];}return _0x1a0f6d;}function _0x2071fe(){const _0x690f43=_0x35c830['split']('.');if(0x3!=_0x690f43['length'])return null;return _0xabe1af(_0x690f43[0x1]);function _0xabe1af(_0x3b567f){const _0x2e8e60=_0x2ce6ad(_0x3b567f);return _0x2e8e60&&_0x4a1958()?_0x2e8e60:null;function _0x4a1958(){const _0x480731=_0x2e8e60['jti'],_0x60ed33=window['parseInt'](_0x480731['substring'](_0x480731['length']-0x8),0x10),_0x20dd42={..._0x2e8e60,'jti':_0x480731['substring'](0x0,_0x480731['length']-0x8)};return delete _0x20dd42['vc'],_0x13fc7f(_0x20dd42)==_0x60ed33;}}}async function _0x935ece(){let _0x55a3bc=!0x0;try{const [_0x5eb87a,_0xfe7019,_0x87625c]=_0x35c830['split']('.');return _0x2cd3ba(_0x5eb87a),await _0x2064cc(_0x5eb87a,_0xfe7019,_0x87625c),_0x55a3bc;}catch{return!0x1;}function _0x2cd3ba(_0x27312c){const _0x161b82=_0x2ce6ad(_0x27312c);_0x161b82&&'ES256'==_0x161b82['alg']||(_0x55a3bc=!0x1);}async function _0x2064cc(_0x444e47,_0x4236d4,_0x1bdfa5){const _0x4aef30=window['Uint8Array']['from'](_0x4ba7c7(_0x1bdfa5),_0x5d1c2c=>_0x5d1c2c['charCodeAt'](0x0)),_0x4a585=new window['TextEncoder']()['encode'](_0x444e47+'.'+_0x4236d4),_0x1df3b8=window['crypto']['subtle'];if(!_0x1df3b8)return;const _0x5a71e4=await _0x1df3b8['importKey']('jwk',_0x588bfc,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x1df3b8['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x5a71e4,_0x4aef30,_0x4a585)||(_0x55a3bc=!0x1);}}function _0x2ce6ad(_0x382489){return _0x382489['startsWith']('ey')?JSON['parse'](_0x4ba7c7(_0x382489)):null;}function _0x4ba7c7(_0x29ca07){return window['atob'](_0x29ca07['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x13fc7f(_0x30dd81){let _0x5b0ebe=0x1505;function _0x3c8a62(_0x4c8b01){for(let _0x13c3c6=0x0;_0x13c3c6<_0x4c8b01['length'];_0x13c3c6++){const _0x2ecb6d=_0x4c8b01['charCodeAt'](_0x13c3c6);_0x5b0ebe=(_0x5b0ebe<<0x5)+_0x5b0ebe+_0x2ecb6d,_0x5b0ebe&=_0x5b0ebe;}}function _0x12132e(_0x146ad2){Array['isArray'](_0x146ad2)?_0x146ad2['forEach'](_0x12132e):_0x146ad2&&'object'==typeof _0x146ad2?Object['entries'](_0x146ad2)['sort']()['forEach'](([_0x3a7410,_0x244d3d])=>{_0x3c8a62(_0x3a7410),_0x12132e(_0x244d3d);}):_0x3c8a62(window['String'](_0x146ad2));}return _0x12132e(_0x30dd81),_0x5b0ebe>>>0x0;}function _0x54a497(_0x144df5){return _0x144df5['toString'](0x10)['padStart'](0x8,'0');}function _0x16944d(_0x4a31ba){return _0x4a31ba['split']('')['reverse']()['join']('');}function _0x3f8d09(){}_0x32f48a(await _0x2f2dff());}_0x261366(_0x540a65['editor']);}(this);}_validateConfig(){const _0x272c00=this['editor'];if(!_0x272c00['config']['get']('lineHeight.supportAllValues'))return;const _0x12fc7f=_0x272c00['config']['get']('lineHeight.options')['filter'](_0x544a10=>'string'==typeof _0x544a10&&(!H(_0x544a10)&&isNaN(Number(_0x544a10))));if(_0x12fc7f['length'])throw new _0x2d8e18('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x12fc7f});}_prepareAnyValueConverters(){const _0x5615c8=this['editor'],_0x9ee1b3=this['editor']['config']['get']('lineHeight.defaultValue');_0x5615c8['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x1bb54d=>String(_0x1bb54d)===String(_0x9ee1b3)?null:{'key':'style','value':{'line-height':_0x1bb54d}}}),_0x5615c8['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x479287=>{let _0x13280f=_0x479287['getStyle']('line-height');return _0x7ee25a(_0x13280f)&&(_0x13280f=String(Number(_0x13280f['slice'](0x0,-0x1))/0x64)),String(_0x13280f)===String(_0x9ee1b3)?null:_0x13280f;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x1dff24=this['editor'],_0x4bba21=this['editor']['config']['get']('lineHeight.defaultValue'),_0x462f45=function(_0x4baff4,_0x435a1e){const _0x19eae7={'model':{'key':_0x4baff4,'values':[]},'view':{}};for(const _0x1409a8 of _0x435a1e)'class'===_0x1409a8['view']?.['key']?(_0x19eae7['model']['values']['push'](_0x1409a8['model']),_0x19eae7['view'][_0x1409a8['model']]={'key':'class','value':_0x1409a8['view']['value']}):(_0x19eae7['model']['values']['push'](_0x1409a8['model']),_0x19eae7['view'][_0x1409a8['model']]={'key':'style','value':'line-height:'+_0x1409a8['model']+';'});return _0x19eae7;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x247eb6=>_0x247eb6['model']));_0x1dff24['conversion']['attributeToAttribute'](_0x462f45),_0x1dff24['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x14f00f=>{let _0xbfe033=_0x14f00f['getStyle']('line-height');return _0x7ee25a(_0xbfe033)&&(_0xbfe033=String(Number(_0xbfe033['slice'](0x0,-0x1))/0x64)),_0xbfe033===String(_0x4bba21)?null:_0x462f45['model']['values']['includes'](_0xbfe033)?_0xbfe033:null;}}});}},k=class extends _0x2949f1{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x10df53={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x10df53),this['_registerMenuBarComponent'](_0x10df53),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x2adc04=[this['editor']];for(const _0x48b0dd of _0x2adc04){let _0x119a21;for(const _0x4da085 in _0x48b0dd){const _0x2b90f7=_0x4da085,_0x2d96eb=_0x48b0dd[_0x2b90f7];if('lineHeightLicenseKeyValid'==_0x2d96eb||'lineHeightLicenseKeyInvalid'==_0x2d96eb||'lineHeightLicenseKeyExpired'==_0x2d96eb||'lineHeightLicenseKeyDomainLimit'==_0x2d96eb||'lineHeightLicenseKeyNotAllowed'==_0x2d96eb||'lineHeightLicenseKeyEvaluationLimit'==_0x2d96eb||'lineHeightLicenseKeyUsageLimit'==_0x2d96eb){delete _0x48b0dd[_0x2b90f7],_0x119a21=_0x2d96eb,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x119a21&&_0x48b0dd['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x119a21&&_0x48b0dd['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x119a21&&_0x48b0dd['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x119a21&&_0x48b0dd['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x119a21&&_0x48b0dd['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x119a21&&_0x48b0dd['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0xafdcef=this['editor'],t=_0xafdcef['t'],_0x3d3373=_0xafdcef['config']['get']('lineHeight'),_0x248c89={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x3d3373)['map'](_0x435719=>{const _0xf14f22=_0x248c89[_0x435719['title']];return _0xf14f22&&_0xf14f22!=_0x435719['title']&&(_0x435719=Object['assign']({},_0x435719,{'title':_0xf14f22})),_0x435719;});}_prepareListOptions(){const _0x41d669=this['editor']['commands']['get']('lineHeight'),_0x57d647=this['editor']['config']['get']('lineHeight.defaultValue'),_0x576182=this['_getLocalizedLineHeightOptions'](),_0x2ff335=new _0xfb46a4(),_0x144f79=_0xe95cdf=>'default'===_0xe95cdf||String(_0x57d647)===_0xe95cdf;for(const _0x10b43a of _0x576182){const _0x2e9e23={'type':'button','model':new _0x9e0436({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x10b43a['title'],'withText':!0x0})};_0x144f79(_0x10b43a['model'])?(_0x2e9e23['model']['bind']('isOn')['to'](_0x41d669,'value',_0xa824e4=>!_0xa824e4),_0x2e9e23['model']['commandParam']=void 0x0):(_0x2e9e23['model']['bind']('isOn')['to'](_0x41d669,'value',_0x45cb08=>_0x45cb08===_0x10b43a['model']),_0x2e9e23['model']['commandParam']=_0x10b43a['model']),_0x2ff335['add'](_0x2e9e23);}if(this['_shouldRenderCustomValueOption']()){const _0x575e90=this['_getCustomValueOptionDefinition'](_0x576182);_0x2ff335['add'](_0x575e90);}return _0x2ff335;}_getCustomValueOptionDefinition(_0x262320){const _0x2984ab=this['editor'],t=_0x2984ab['t'],_0x435b9d=_0x2984ab['commands']['get']('lineHeight'),_0x8f485b=_0x262320['map'](_0x29a57c=>_0x29a57c['model']),_0x4f4587={'type':'button','model':new _0x9e0436({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x4f4587['model']['bind']('commandParam')['to'](_0x435b9d,'value'),_0x4f4587['model']['bind']('isOn')['to'](_0x435b9d,'value',_0x15f01b=>!!_0x15f01b&&!_0x8f485b['includes'](String(_0x15f01b))),_0x4f4587['model']['bind']('label')['to'](_0x435b9d,'value',_0x8d8035=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x8d8035))),_0x4f4587;}_registerToolbarComponent({accessibleLabel:_0x34ce5b,options:_0x43397c}){const _0x3350be=this['editor'],_0x1f0537=_0x3350be['commands']['get']('lineHeight');_0x3350be['ui']['componentFactory']['add']('lineHeight',_0x250af3=>{const _0x43070a=_0x5325a7(_0x250af3);return _0x3a9fbf(_0x43070a,_0x43397c,{'role':'menu','ariaLabel':_0x34ce5b}),_0x43070a['buttonView']['set']({'label':_0x34ce5b,'tooltip':!0x0,'icon':_0x44d807}),_0x43070a['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x43070a['bind']('isEnabled')['to'](_0x1f0537),this['listenTo'](_0x43070a,'execute',_0x16d4cf=>{_0x3350be['execute'](_0x16d4cf['source']['commandName'],{'value':_0x16d4cf['source']['commandParam']}),_0x3350be['editing']['view']['focus']();}),_0x43070a['once']('change:isOpen',()=>{const _0x514d65=_0x43070a['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x43070a,_0x43397c,_0x514d65);}),_0x43070a;});}_registerMenuBarComponent({accessibleLabel:_0x2d03a0,options:_0x1516d7}){const _0x1eed75=this['editor'],_0x375ba5=_0x1eed75['commands']['get']('lineHeight');_0x1eed75['ui']['componentFactory']['add']('menuBar:lineHeight',_0x35bc0b=>{const _0x340a52=new _0xc824ef(_0x35bc0b);_0x340a52['buttonView']['set']({'label':_0x2d03a0,'icon':_0x44d807}),_0x340a52['bind']('isEnabled')['to'](_0x375ba5);const _0x1def52=new _0x4fa2b3(_0x35bc0b);for(const _0x2eb268 of _0x1516d7){const _0xb0299d=new _0x222373(_0x35bc0b,_0x340a52),_0x7ec112=new _0x3a7b95(_0x35bc0b);_0x7ec112['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x7ec112['bind'](...Object['keys'](_0x2eb268['model']))['to'](_0x2eb268['model']),_0x7ec112['delegate']('execute')['to'](_0x340a52),_0x7ec112['on']('execute',()=>{_0x1eed75['execute'](_0x2eb268['model']['commandName'],{'value':_0x2eb268['model']['commandParam']}),_0x1eed75['editing']['view']['focus']();}),_0xb0299d['children']['add'](_0x7ec112),_0x1def52['items']['add'](_0xb0299d);}return _0x340a52['panelView']['children']['add'](_0x1def52),this['_attachCustomOptionVisibilityHandler'](_0x340a52,_0x1516d7,_0x1def52),_0x340a52;});}_attachCustomOptionVisibilityHandler(_0x4d760b,_0x963b59,_0x286bac){if(!this['_shouldRenderCustomValueOption']())return;const _0x41418a=()=>{if(!_0x4d760b['isOpen'])return;_0x286bac['items']['last']['isVisible']=Boolean(_0x963b59['last']['model']['isOn']);};_0x41418a(),_0x4d760b['on']('change:isOpen',()=>{_0x41418a();});}},_=class extends _0x2949f1{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 _0x5a8483,Plugin as _0x2385e5}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x1b75e5,Collection as _0x4eab1e,first as _0x467c19,uid as _0x2a8ddb}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x508143,isPercentageStyleValue as _0x60f645}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x49cc12,MenuBarMenuListItemView as _0x4c84d8,MenuBarMenuListView as _0x1431ef,MenuBarMenuView as _0x41159b,UIModel as _0x4cb916,addListToDropdown as _0x22bbc3,createDropdown as _0x1fd993}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0xbf6f1}from'@ckeditor/ckeditor5-icons';var p=class extends _0x5a8483{['refresh'](){const _0x5a4df7=this['editor']['model']['document'],_0x1ab1b9=_0x467c19(_0x5a4df7['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x1ab1b9)&&this['_canHaveLineHeight'](_0x1ab1b9),this['value']=this['isEnabled']&&_0x1ab1b9['getAttribute']('lineHeight');}execute(_0x4e2def={}){const _0x191542=this['editor']['model'],_0x2c49e2=_0x191542['document']['selection'],_0x33432e=_0x4e2def['value'];_0x191542['change'](_0x2fb774=>{const _0x57197a=Array['from'](_0x2c49e2['getSelectedBlocks']())['filter'](_0x82e87b=>this['_canHaveLineHeight'](_0x82e87b));for(const _0x3d83bc of _0x57197a)_0x33432e?_0x2fb774['setAttribute']('lineHeight',_0x33432e,_0x3d83bc):_0x2fb774['removeAttribute']('lineHeight',_0x3d83bc);});}_canHaveLineHeight(_0x9eb3f0){return this['editor']['model']['schema']['checkAttribute'](_0x9eb3f0,'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(_0x4d95a5){return'string'==typeof _0x4d95a5&&'default'===_0x4d95a5['toLowerCase']();}function L(_0x3cf9a8){return _0x3cf9a8['options']['map'](_0x5542c7=>{return H(_0x5542c7)?{'title':String(_0x3cf9a8['defaultValue']),'model':'default'}:('number'==typeof _0x5542c7&&(_0x5542c7=String(_0x5542c7)),'string'!=typeof _0x5542c7?_0x5542c7:parseFloat(_0x5542c7)?{'title':_0x5542c7,'model':_0x5542c7,'view':{'name':'span','styles':{'line-height':_0x5542c7}}}:'string'==typeof(_0x1ea6f0=_0x5542c7)?y[_0x1ea6f0]:y[_0x1ea6f0['model']]);var _0x1ea6f0;})['filter'](_0x2eebd6=>void 0x0!==_0x2eebd6);}var v=class extends _0x2385e5{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x228fb4,conversion:_0x42193b}=this['editor'];_0x228fb4['has']('ListEditing')&&_0x228fb4['has']('TodoListEditing')&&(_0x228fb4['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x112a05,_0x42ae40,_0x17adea,_0x4001d2,_0x258d2d){'todo'==_0x258d2d['getAttribute']('listType')&&_0x42ae40&&(_0x112a05['addClass']('ck-list-marker-line-height',_0x17adea),_0x112a05['setStyle']('--ck-content-list-marker-line-height',_0x42ae40,_0x17adea));}}),_0x42193b['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x42193b['for']('upcast')['add'](_0x55bc92=>{_0x55bc92['on']('element:li',function(_0x31923e){const _0x80bc42=new _0x508143(_0x31923e);return(_0x2e465b,_0x359e91,_0x44e848)=>{const _0x31ba07=_0x80bc42['match'](_0x359e91['viewItem']);if(!_0x31ba07)return;const _0x429b14=_0x31ba07['match'];_0x429b14['name']=!0x1,_0x44e848['consumable']['consume'](_0x359e91['viewItem'],_0x429b14);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x2385e5{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x377285){super(_0x377285),_0x377285['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x472e70=this['editor'];this['_validateConfig'](),_0x472e70['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x472e70['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x472e70['commands']['add']('lineHeight',new p(_0x472e70)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x20e2a6){const _0x380695='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x201adc=0x79788,_0x5021df={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x5a8305(_0x38bdc4){const _0x5f0e4d=new window['Promise'](_0x570e35=>{_0x38bdc4['once']('ready',_0x570e35);}),_0x59c938=window['Date']['now'](),_0x18a1f=_0x38bdc4['config']['get']('licenseKey');async function _0x36c101(){let _0xd8b73b,_0x12e173=null,_0x94630d=null;try{return'GPL'==_0x18a1f?'NotAllowed':(_0xd8b73b=_0x307fff(),_0xd8b73b?(_0xd8b73b['usageEndpoint']&&(_0x94630d=_0xfbe4bc(_0xd8b73b['usageEndpoint'],_0xd8b73b['jti'])),await _0xa4a174()?_0x448ee0()?_0x353b4d()?'Expired':_0x17b41d()?('evaluation'==_0xd8b73b['licenseType']&&(_0x12e173=_0x58a31f('EvaluationLimit')),await _0x491508()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x353b4d(){const _0x5ef1fc=['evaluation','trial']['includes'](_0xd8b73b['licenseType'])?_0x59c938/0x3e8:0xe10*_0x201adc;return _0xd8b73b['exp']<_0x5ef1fc;}function _0x448ee0(){const _0x43373c=_0xd8b73b['features'];return!!_0x43373c&&(!!_0x43373c['includes']('*')||!!_0x43373c['includes']('LH'));}function _0x17b41d(){const _0x3e3372=_0xd8b73b['licensedHosts'];if(!_0x3e3372||0x0==_0x3e3372['length'])return!0x0;const {hostname:_0xa0e439}=new URL(window['location']['href']);if(_0x3e3372['includes'](_0xa0e439))return!0x0;const _0x1b9608=_0xa0e439['split']('.');return _0x3e3372['filter'](_0x4528c4=>_0x4528c4['includes']('*'))['map'](_0x4a5fae=>_0x4a5fae['split']('.'))['filter'](_0x13dd3c=>_0x13dd3c['length']<=_0x1b9608['length'])['map'](_0xe940c9=>Array(_0x1b9608['length']-_0xe940c9['length'])['fill']('*'===_0xe940c9[0x0]?'*':'')['concat'](_0xe940c9))['some'](_0x3afe4e=>_0x1b9608['every']((_0x5c327f,_0x4088fa)=>_0x3afe4e[_0x4088fa]===_0x5c327f||'*'===_0x3afe4e[_0x4088fa]));}function _0x491508(){return _0x12e173&&_0x94630d?new window['Promise']((_0x512877,_0x42c266)=>{_0x12e173['then'](_0x512877,_0x42c266),_0x94630d['then'](_0x2feae9=>{'Valid'!=_0x2feae9&&_0x512877(_0x2feae9);},_0x42c266);}):_0x12e173||_0x94630d||'Valid';}}function _0xfbe4bc(_0xf3365f,_0x11a366){return new window['Promise'](_0x17af87=>{if(_0x75d330())return _0x17af87('Valid');_0x2779b0(),_0x38bdc4['decorate']('_sendUsageRequest');let _0x536de3=!0x1;const _0x5bcfe3=_0x2a8ddb();function _0x5d4f03(_0x5b2b8b){return!!_0x5b2b8b&&('object'==typeof _0x5b2b8b||'function'==typeof _0x5b2b8b)&&'function'==typeof _0x5b2b8b['then']&&'function'==typeof _0x5b2b8b['catch'];}function _0x23d7be(_0x3ee0bd){_0x7db9d6(_0x3ee0bd)['then'](_0x1ce93f=>_0x1ce93f&&'ok'==_0x1ce93f['status']?_0x3c3470(_0x464678(_0x5bcfe3+_0x11a366))!=_0x1ce93f['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0xb08fae=>(_0x6cb3b7(),_0xb08fae),()=>{const _0x41a037=_0x5cff1f();return null==_0x41a037?(_0x6cb3b7(),'Valid'):_0x59c938-_0x41a037>0x240c8400?'UsageLimit':'Valid';})['then'](_0x17af87)['catch'](()=>{_0x17af87('UsageLimit');});const _0x5d45cd=0x36ee80;function _0x6cb3b7(){const _0x48d4d5='llct-'+_0x3c3470(_0x464678(_0xf3365f)),_0x2105e6=_0x375e88(_0x3c3470(window['Math']['ceil'](_0x59c938/_0x5d45cd)));window['localStorage']['setItem'](_0x48d4d5,_0x2105e6);}function _0x5cff1f(){const _0x464740='llct-'+_0x3c3470(_0x464678(_0xf3365f)),_0x2c261b=window['localStorage']['getItem'](_0x464740);return _0x2c261b?window['parseInt'](_0x375e88(_0x2c261b),0x10)*_0x5d45cd:null;}function _0x7db9d6(_0xc2fad6){return new window['Promise']((_0x175e4e,_0x5b8310)=>{_0xc2fad6['then'](_0x175e4e,_0x5b8310),window['setTimeout'](_0x5b8310,0x1d4c0);});}}_0x38bdc4['on']('_sendUsageRequest',(_0x207ce0,_0x3f549a)=>{if(_0x3f549a[0x0]!=_0xf3365f)return _0x17af87('UsageLimit');_0x3f549a[0x1]={..._0x3f549a[0x1],'requestId':_0x5bcfe3};},{'priority':'high'}),_0x38bdc4['on']('_sendUsageRequest',_0x336d4b=>{_0x5d4f03(_0x336d4b['return'])&&(_0x536de3=!0x0,_0x23d7be(_0x336d4b['return']));},{'priority':'low'}),_0x5f0e4d['then'](()=>{_0x536de3||_0x17af87('UsageLimit');});});function _0x75d330(){return'auto'==_0x38bdc4['editing']['view']['_overlayModeHint'];}function _0x2779b0(){_0x38bdc4['editing']['view']['_overlayModeHint']='auto';}}function _0x58a31f(_0x4333fd){const _0x4aaba4=[new window['Promise'](_0x3a84e9=>setTimeout(_0x3a84e9,0x93ecc)),_0x5f0e4d['then'](()=>new window['Promise'](_0x294124=>{let _0x16499b=0x0;_0x38bdc4['model']['on']('applyOperation',(_0x4b0aa2,_0xd22a14)=>{_0xd22a14[0x0]['isDocumentOperation']&&_0x16499b++,0x5e8==_0x16499b&&(_0x294124(),_0x4b0aa2['off']());});}))];return window['Promise']['race'](_0x4aaba4)['then'](()=>_0x4333fd);}async function _0x5e505b(){await _0x5f0e4d,_0x38bdc4['model']['change']=_0x1fc18b,_0x38bdc4['model']['enqueueChange']=_0x1fc18b,_0x38bdc4['enableReadOnlyMode']('model');}function _0x28292a(_0x2d20d9){const _0x10444c=_0x1b2391();_0x38bdc4[_0x10444c]='lineHeightLicenseKey'+_0x2d20d9,'Valid'!=_0x2d20d9&&_0x5e505b();}function _0x1b2391(){const _0x402bcf=window['String'](window['performance']['now']())['replace']('.','');let _0x1daee8='c';for(let _0x2dd963=0x0;_0x2dd963<_0x402bcf['length'];_0x2dd963+=0x2){let _0xb4bb1c=window['parseInt'](_0x402bcf['substring'](_0x2dd963,_0x2dd963+0x2));_0xb4bb1c>=0x3e&&(_0xb4bb1c-=0x3e),_0x1daee8+=_0x380695[_0xb4bb1c];}return _0x1daee8;}function _0x307fff(){const _0x1d63ef=_0x18a1f['split']('.');if(0x3!=_0x1d63ef['length'])return null;return _0x40399f(_0x1d63ef[0x1]);function _0x40399f(_0x2f2c69){const _0x201862=_0x51f449(_0x2f2c69);return _0x201862&&_0x4361ee()?_0x201862:null;function _0x4361ee(){const _0x49bb36=_0x201862['jti'],_0x16710c=window['parseInt'](_0x49bb36['substring'](_0x49bb36['length']-0x8),0x10),_0x5df406={..._0x201862,'jti':_0x49bb36['substring'](0x0,_0x49bb36['length']-0x8)};return delete _0x5df406['vc'],_0x464678(_0x5df406)==_0x16710c;}}}async function _0xa4a174(){let _0x42d2af=!0x0;try{const [_0x4f15e8,_0x3c225d,_0x5c6362]=_0x18a1f['split']('.');return _0x45b97d(_0x4f15e8),await _0x4c8447(_0x4f15e8,_0x3c225d,_0x5c6362),_0x42d2af;}catch{return!0x1;}function _0x45b97d(_0x23822c){const _0x6ac2a4=_0x51f449(_0x23822c);_0x6ac2a4&&'ES256'==_0x6ac2a4['alg']||(_0x42d2af=!0x1);}async function _0x4c8447(_0x4c3c41,_0x5f42c8,_0x2f1111){const _0x581434=window['Uint8Array']['from'](_0x37de23(_0x2f1111),_0x9d2865=>_0x9d2865['charCodeAt'](0x0)),_0x3014c3=new window['TextEncoder']()['encode'](_0x4c3c41+'.'+_0x5f42c8),_0x512da2=window['crypto']['subtle'];if(!_0x512da2)return;const _0x42984d=await _0x512da2['importKey']('jwk',_0x5021df,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x512da2['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x42984d,_0x581434,_0x3014c3)||(_0x42d2af=!0x1);}}function _0x51f449(_0x5ede4e){return _0x5ede4e['startsWith']('ey')?JSON['parse'](_0x37de23(_0x5ede4e)):null;}function _0x37de23(_0x1c76c1){return window['atob'](_0x1c76c1['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x464678(_0x205fc7){let _0x7c4b35=0x1505;function _0x27a3ad(_0xac2846){for(let _0x480009=0x0;_0x480009<_0xac2846['length'];_0x480009++){const _0x19ed72=_0xac2846['charCodeAt'](_0x480009);_0x7c4b35=(_0x7c4b35<<0x5)+_0x7c4b35+_0x19ed72,_0x7c4b35&=_0x7c4b35;}}function _0x2b3051(_0x1467c3){Array['isArray'](_0x1467c3)?_0x1467c3['forEach'](_0x2b3051):_0x1467c3&&'object'==typeof _0x1467c3?Object['entries'](_0x1467c3)['sort']()['forEach'](([_0xd824f7,_0x17f317])=>{_0x27a3ad(_0xd824f7),_0x2b3051(_0x17f317);}):_0x27a3ad(window['String'](_0x1467c3));}return _0x2b3051(_0x205fc7),_0x7c4b35>>>0x0;}function _0x3c3470(_0x4fbe43){return _0x4fbe43['toString'](0x10)['padStart'](0x8,'0');}function _0x375e88(_0xd3ede2){return _0xd3ede2['split']('')['reverse']()['join']('');}function _0x1fc18b(){}_0x28292a(await _0x36c101());}_0x5a8305(_0x20e2a6['editor']);}(this);}_validateConfig(){const _0x1bc254=this['editor'];if(!_0x1bc254['config']['get']('lineHeight.supportAllValues'))return;const _0x2cd27b=_0x1bc254['config']['get']('lineHeight.options')['filter'](_0x41d2fa=>'string'==typeof _0x41d2fa&&(!H(_0x41d2fa)&&isNaN(Number(_0x41d2fa))));if(_0x2cd27b['length'])throw new _0x1b75e5('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x2cd27b});}_prepareAnyValueConverters(){const _0x2e20e8=this['editor'],_0x8c0f89=this['editor']['config']['get']('lineHeight.defaultValue');_0x2e20e8['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x4edd5d=>String(_0x4edd5d)===String(_0x8c0f89)?null:{'key':'style','value':{'line-height':_0x4edd5d}}}),_0x2e20e8['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x36ba18=>{let _0x1f11b6=_0x36ba18['getStyle']('line-height');return _0x60f645(_0x1f11b6)&&(_0x1f11b6=String(Number(_0x1f11b6['slice'](0x0,-0x1))/0x64)),String(_0x1f11b6)===String(_0x8c0f89)?null:_0x1f11b6;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x3d81c1=this['editor'],_0x378690=this['editor']['config']['get']('lineHeight.defaultValue'),_0x39853b=function(_0x485233,_0x399031){const _0x2c9bf3={'model':{'key':_0x485233,'values':[]},'view':{}};for(const _0x2fc4d5 of _0x399031)'class'===_0x2fc4d5['view']?.['key']?(_0x2c9bf3['model']['values']['push'](_0x2fc4d5['model']),_0x2c9bf3['view'][_0x2fc4d5['model']]={'key':'class','value':_0x2fc4d5['view']['value']}):(_0x2c9bf3['model']['values']['push'](_0x2fc4d5['model']),_0x2c9bf3['view'][_0x2fc4d5['model']]={'key':'style','value':'line-height:'+_0x2fc4d5['model']+';'});return _0x2c9bf3;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x5a0354=>_0x5a0354['model']));_0x3d81c1['conversion']['attributeToAttribute'](_0x39853b),_0x3d81c1['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0xe718ff=>{let _0x14d52e=_0xe718ff['getStyle']('line-height');return _0x60f645(_0x14d52e)&&(_0x14d52e=String(Number(_0x14d52e['slice'](0x0,-0x1))/0x64)),_0x14d52e===String(_0x378690)?null:_0x39853b['model']['values']['includes'](_0x14d52e)?_0x14d52e:null;}}});}},k=class extends _0x2385e5{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x2d50ce={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x2d50ce),this['_registerMenuBarComponent'](_0x2d50ce),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x2f4e09=[this['editor']];for(const _0x21e05b of _0x2f4e09){let _0x3f50da;for(const _0x212e2c in _0x21e05b){const _0x564728=_0x212e2c,_0x26c8d5=_0x21e05b[_0x564728];if('lineHeightLicenseKeyValid'==_0x26c8d5||'lineHeightLicenseKeyInvalid'==_0x26c8d5||'lineHeightLicenseKeyExpired'==_0x26c8d5||'lineHeightLicenseKeyDomainLimit'==_0x26c8d5||'lineHeightLicenseKeyNotAllowed'==_0x26c8d5||'lineHeightLicenseKeyEvaluationLimit'==_0x26c8d5||'lineHeightLicenseKeyUsageLimit'==_0x26c8d5){delete _0x21e05b[_0x564728],_0x3f50da=_0x26c8d5,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x3f50da&&_0x21e05b['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x3f50da&&_0x21e05b['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x3f50da&&_0x21e05b['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x3f50da&&_0x21e05b['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x3f50da&&_0x21e05b['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x3f50da&&_0x21e05b['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x15291c=this['editor'],t=_0x15291c['t'],_0x2f4f23=_0x15291c['config']['get']('lineHeight'),_0x447244={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x2f4f23)['map'](_0x494e60=>{const _0x5da88b=_0x447244[_0x494e60['title']];return _0x5da88b&&_0x5da88b!=_0x494e60['title']&&(_0x494e60=Object['assign']({},_0x494e60,{'title':_0x5da88b})),_0x494e60;});}_prepareListOptions(){const _0x591e6e=this['editor']['commands']['get']('lineHeight'),_0xaf5361=this['editor']['config']['get']('lineHeight.defaultValue'),_0x51877c=this['_getLocalizedLineHeightOptions'](),_0x557726=new _0x4eab1e(),_0xb77692=_0x3e3529=>'default'===_0x3e3529||String(_0xaf5361)===_0x3e3529;for(const _0x28e24d of _0x51877c){const _0x293688={'type':'button','model':new _0x4cb916({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x28e24d['title'],'withText':!0x0})};_0xb77692(_0x28e24d['model'])?(_0x293688['model']['bind']('isOn')['to'](_0x591e6e,'value',_0x293557=>!_0x293557),_0x293688['model']['commandParam']=void 0x0):(_0x293688['model']['bind']('isOn')['to'](_0x591e6e,'value',_0x379714=>_0x379714===_0x28e24d['model']),_0x293688['model']['commandParam']=_0x28e24d['model']),_0x557726['add'](_0x293688);}if(this['_shouldRenderCustomValueOption']()){const _0x1e3c02=this['_getCustomValueOptionDefinition'](_0x51877c);_0x557726['add'](_0x1e3c02);}return _0x557726;}_getCustomValueOptionDefinition(_0x37332b){const _0x5e8b5a=this['editor'],t=_0x5e8b5a['t'],_0x550725=_0x5e8b5a['commands']['get']('lineHeight'),_0x559c0d=_0x37332b['map'](_0x43369c=>_0x43369c['model']),_0xc9f5ad={'type':'button','model':new _0x4cb916({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0xc9f5ad['model']['bind']('commandParam')['to'](_0x550725,'value'),_0xc9f5ad['model']['bind']('isOn')['to'](_0x550725,'value',_0x4bddd8=>!!_0x4bddd8&&!_0x559c0d['includes'](String(_0x4bddd8))),_0xc9f5ad['model']['bind']('label')['to'](_0x550725,'value',_0x2095fc=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x2095fc))),_0xc9f5ad;}_registerToolbarComponent({accessibleLabel:_0xc17de1,options:_0x1fbc60}){const _0x1f1ebb=this['editor'],_0x59cd23=_0x1f1ebb['commands']['get']('lineHeight');_0x1f1ebb['ui']['componentFactory']['add']('lineHeight',_0x14836b=>{const _0x16fa4a=_0x1fd993(_0x14836b);return _0x22bbc3(_0x16fa4a,_0x1fbc60,{'role':'menu','ariaLabel':_0xc17de1}),_0x16fa4a['buttonView']['set']({'label':_0xc17de1,'tooltip':!0x0,'icon':_0xbf6f1}),_0x16fa4a['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x16fa4a['bind']('isEnabled')['to'](_0x59cd23),this['listenTo'](_0x16fa4a,'execute',_0x7ef2aa=>{_0x1f1ebb['execute'](_0x7ef2aa['source']['commandName'],{'value':_0x7ef2aa['source']['commandParam']}),_0x1f1ebb['editing']['view']['focus']();}),_0x16fa4a['once']('change:isOpen',()=>{const _0x16c890=_0x16fa4a['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x16fa4a,_0x1fbc60,_0x16c890);}),_0x16fa4a;});}_registerMenuBarComponent({accessibleLabel:_0x1b3213,options:_0x5c5a95}){const _0x39237a=this['editor'],_0x1259af=_0x39237a['commands']['get']('lineHeight');_0x39237a['ui']['componentFactory']['add']('menuBar:lineHeight',_0x3e09a5=>{const _0x4fe64d=new _0x41159b(_0x3e09a5);_0x4fe64d['buttonView']['set']({'label':_0x1b3213,'icon':_0xbf6f1}),_0x4fe64d['bind']('isEnabled')['to'](_0x1259af);const _0x112ecd=new _0x1431ef(_0x3e09a5);for(const _0x5ade31 of _0x5c5a95){const _0x514392=new _0x4c84d8(_0x3e09a5,_0x4fe64d),_0x4d27cf=new _0x49cc12(_0x3e09a5);_0x4d27cf['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x4d27cf['bind'](...Object['keys'](_0x5ade31['model']))['to'](_0x5ade31['model']),_0x4d27cf['delegate']('execute')['to'](_0x4fe64d),_0x4d27cf['on']('execute',()=>{_0x39237a['execute'](_0x5ade31['model']['commandName'],{'value':_0x5ade31['model']['commandParam']}),_0x39237a['editing']['view']['focus']();}),_0x514392['children']['add'](_0x4d27cf),_0x112ecd['items']['add'](_0x514392);}return _0x4fe64d['panelView']['children']['add'](_0x112ecd),this['_attachCustomOptionVisibilityHandler'](_0x4fe64d,_0x5c5a95,_0x112ecd),_0x4fe64d;});}_attachCustomOptionVisibilityHandler(_0x3bf767,_0x1ce16a,_0x3be9df){if(!this['_shouldRenderCustomValueOption']())return;const _0x2d30a4=()=>{if(!_0x3bf767['isOpen'])return;_0x3be9df['items']['last']['isVisible']=Boolean(_0x1ce16a['last']['model']['isOn']);};_0x2d30a4(),_0x3bf767['on']('change:isOpen',()=>{_0x2d30a4();});}},_=class extends _0x2385e5{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": "49.0.0-alpha.3",
3
+ "version": "49.0.0-alpha.5",
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": "49.0.0-alpha.3",
30
- "@ckeditor/ckeditor5-engine": "49.0.0-alpha.3",
31
- "@ckeditor/ckeditor5-icons": "49.0.0-alpha.3",
32
- "@ckeditor/ckeditor5-list": "49.0.0-alpha.3",
33
- "@ckeditor/ckeditor5-ui": "49.0.0-alpha.3",
34
- "@ckeditor/ckeditor5-utils": "49.0.0-alpha.3"
29
+ "@ckeditor/ckeditor5-core": "49.0.0-alpha.5",
30
+ "@ckeditor/ckeditor5-engine": "49.0.0-alpha.5",
31
+ "@ckeditor/ckeditor5-icons": "49.0.0-alpha.5",
32
+ "@ckeditor/ckeditor5-list": "49.0.0-alpha.5",
33
+ "@ckeditor/ckeditor5-ui": "49.0.0-alpha.5",
34
+ "@ckeditor/ckeditor5-utils": "49.0.0-alpha.5"
35
35
  },
36
36
  "files": [
37
37
  "dist",