@ckeditor/ckeditor5-line-height 48.5.0-alpha.1 → 48.5.0-alpha.3
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.
- package/dist/index.js +1 -1
- 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 _0x5642c4,Plugin as _0x2df8bc}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x4c12f3,Collection as _0x4e0734,first as _0x468237,uid as _0x3b7e7f}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x4d759e,isPercentageStyleValue as _0x16e951}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x2fb419,MenuBarMenuListItemView as _0x5e521c,MenuBarMenuListView as _0x2bd843,MenuBarMenuView as _0x1cede2,UIModel as _0x343f6f,addListToDropdown as _0x46d838,createDropdown as _0x4b2e88}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x2bcafb}from'@ckeditor/ckeditor5-icons';var p=class extends _0x5642c4{['refresh'](){const _0x34c5e3=this['editor']['model']['document'],_0x326579=_0x468237(_0x34c5e3['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x326579)&&this['_canHaveLineHeight'](_0x326579),this['value']=this['isEnabled']&&_0x326579['getAttribute']('lineHeight');}execute(_0x3864ec={}){const _0x41a618=this['editor']['model'],_0x38fa1a=_0x41a618['document']['selection'],_0x1c9ad4=_0x3864ec['value'];_0x41a618['change'](_0x481875=>{const _0xc39119=Array['from'](_0x38fa1a['getSelectedBlocks']())['filter'](_0x2ef110=>this['_canHaveLineHeight'](_0x2ef110));for(const _0x5e3af7 of _0xc39119)_0x1c9ad4?_0x481875['setAttribute']('lineHeight',_0x1c9ad4,_0x5e3af7):_0x481875['removeAttribute']('lineHeight',_0x5e3af7);});}_canHaveLineHeight(_0x2c4223){return this['editor']['model']['schema']['checkAttribute'](_0x2c4223,'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(_0x563972){return'string'==typeof _0x563972&&'default'===_0x563972['toLowerCase']();}function L(_0x17da0b){return _0x17da0b['options']['map'](_0x8caa21=>{return H(_0x8caa21)?{'title':String(_0x17da0b['defaultValue']),'model':'default'}:('number'==typeof _0x8caa21&&(_0x8caa21=String(_0x8caa21)),'string'!=typeof _0x8caa21?_0x8caa21:parseFloat(_0x8caa21)?{'title':_0x8caa21,'model':_0x8caa21,'view':{'name':'span','styles':{'line-height':_0x8caa21}}}:'string'==typeof(_0x23b844=_0x8caa21)?y[_0x23b844]:y[_0x23b844['model']]);var _0x23b844;})['filter'](_0x31071a=>void 0x0!==_0x31071a);}var v=class extends _0x2df8bc{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x628ace,conversion:_0x27bb92}=this['editor'];_0x628ace['has']('ListEditing')&&_0x628ace['has']('TodoListEditing')&&(_0x628ace['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x42d9c5,_0x448c2d,_0x35a182,_0x49f7ad,_0x5686b6){'todo'==_0x5686b6['getAttribute']('listType')&&_0x448c2d&&(_0x42d9c5['addClass']('ck-list-marker-line-height',_0x35a182),_0x42d9c5['setStyle']('--ck-content-list-marker-line-height',_0x448c2d,_0x35a182));}}),_0x27bb92['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x27bb92['for']('upcast')['add'](_0x4a0301=>{_0x4a0301['on']('element:li',function(_0x10753e){const _0x12574c=new _0x4d759e(_0x10753e);return(_0x546339,_0x5e5dc0,_0x59272c)=>{const _0x398d2d=_0x12574c['match'](_0x5e5dc0['viewItem']);if(!_0x398d2d)return;const _0x3d1888=_0x398d2d['match'];_0x3d1888['name']=!0x1,_0x59272c['consumable']['consume'](_0x5e5dc0['viewItem'],_0x3d1888);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x2df8bc{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4a7f1c){super(_0x4a7f1c),_0x4a7f1c['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x126a30=this['editor'];this['_validateConfig'](),_0x126a30['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x126a30['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x126a30['commands']['add']('lineHeight',new p(_0x126a30)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x5aa206){const _0x382bec='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x3b3e70=0x79410,_0x3afb2a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x50c981(_0xe9e2b9){const _0x48bb58=new window['Promise'](_0x2a17d3=>{_0xe9e2b9['once']('ready',_0x2a17d3);}),_0x36b3b5=window['Date']['now'](),_0x38ac52=_0xe9e2b9['config']['get']('licenseKey');async function _0x63e780(){let _0x5afd2c,_0x1a5429=null,_0x2e9554=null;try{return'GPL'==_0x38ac52?'NotAllowed':(_0x5afd2c=_0x196f66(),_0x5afd2c?(_0x5afd2c['usageEndpoint']&&(_0x2e9554=_0x578b09(_0x5afd2c['usageEndpoint'],_0x5afd2c['jti'])),await _0xef463()?_0x482720()?_0x1101fd()?'Expired':_0x1e276c()?('evaluation'==_0x5afd2c['licenseType']&&(_0x1a5429=_0x5aa819('EvaluationLimit')),await _0x3d29e6()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x1101fd(){const _0x2c6f5c=['evaluation','trial']['includes'](_0x5afd2c['licenseType'])?_0x36b3b5/0x3e8:0xe10*_0x3b3e70;return _0x5afd2c['exp']<_0x2c6f5c;}function _0x482720(){const _0x1b8d06=_0x5afd2c['features'];return!!_0x1b8d06&&(!!_0x1b8d06['includes']('*')||!!_0x1b8d06['includes']('LH'));}function _0x1e276c(){const _0x2679bb=_0x5afd2c['licensedHosts'];if(!_0x2679bb||0x0==_0x2679bb['length'])return!0x0;const {hostname:_0x3f491b}=new URL(window['location']['href']);if(_0x2679bb['includes'](_0x3f491b))return!0x0;const _0x5a22a3=_0x3f491b['split']('.');return _0x2679bb['filter'](_0x4adc8b=>_0x4adc8b['includes']('*'))['map'](_0x58ca91=>_0x58ca91['split']('.'))['filter'](_0x17ac03=>_0x17ac03['length']<=_0x5a22a3['length'])['map'](_0x392d19=>Array(_0x5a22a3['length']-_0x392d19['length'])['fill']('*'===_0x392d19[0x0]?'*':'')['concat'](_0x392d19))['some'](_0x5c93f5=>_0x5a22a3['every']((_0x387ecb,_0x35cce0)=>_0x5c93f5[_0x35cce0]===_0x387ecb||'*'===_0x5c93f5[_0x35cce0]));}function _0x3d29e6(){return _0x1a5429&&_0x2e9554?new window['Promise']((_0xd09da,_0x4a2119)=>{_0x1a5429['then'](_0xd09da,_0x4a2119),_0x2e9554['then'](_0x4c9a07=>{'Valid'!=_0x4c9a07&&_0xd09da(_0x4c9a07);},_0x4a2119);}):_0x1a5429||_0x2e9554||'Valid';}}function _0x578b09(_0x4d6df3,_0x14efd6){return new window['Promise'](_0x23b683=>{if(_0x4b7eec())return _0x23b683('Valid');_0xcc718d(),_0xe9e2b9['decorate']('_sendUsageRequest');let _0xbaef5c=!0x1;const _0x1b3c10=_0x3b7e7f();function _0x3cbb72(_0x48891d){return!!_0x48891d&&('object'==typeof _0x48891d||'function'==typeof _0x48891d)&&'function'==typeof _0x48891d['then']&&'function'==typeof _0x48891d['catch'];}function _0x2af87b(_0xda17c4){_0x22b384(_0xda17c4)['then'](_0x58fb07=>_0x58fb07&&'ok'==_0x58fb07['status']?_0x5cc887(_0x5211ce(_0x1b3c10+_0x14efd6))!=_0x58fb07['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5b431f=>(_0xf0c4b0(),_0x5b431f),()=>{const _0x297bc7=_0x12b93f();return null==_0x297bc7?(_0xf0c4b0(),'Valid'):_0x36b3b5-_0x297bc7>0x240c8400?'UsageLimit':'Valid';})['then'](_0x23b683)['catch'](()=>{_0x23b683('UsageLimit');});const _0x1750f3=0x36ee80;function _0xf0c4b0(){const _0x54389f='llct-'+_0x5cc887(_0x5211ce(_0x4d6df3)),_0x35a296=_0x221788(_0x5cc887(window['Math']['ceil'](_0x36b3b5/_0x1750f3)));window['localStorage']['setItem'](_0x54389f,_0x35a296);}function _0x12b93f(){const _0x1b9ddb='llct-'+_0x5cc887(_0x5211ce(_0x4d6df3)),_0x5442bd=window['localStorage']['getItem'](_0x1b9ddb);return _0x5442bd?window['parseInt'](_0x221788(_0x5442bd),0x10)*_0x1750f3:null;}function _0x22b384(_0x3cfd74){return new window['Promise']((_0x15d3bd,_0x166be4)=>{_0x3cfd74['then'](_0x15d3bd,_0x166be4),window['setTimeout'](_0x166be4,0x1d4c0);});}}_0xe9e2b9['on']('_sendUsageRequest',(_0x2ab018,_0xc85c40)=>{if(_0xc85c40[0x0]!=_0x4d6df3)return _0x23b683('UsageLimit');_0xc85c40[0x1]={..._0xc85c40[0x1],'requestId':_0x1b3c10};},{'priority':'high'}),_0xe9e2b9['on']('_sendUsageRequest',_0x56ddb9=>{_0x3cbb72(_0x56ddb9['return'])&&(_0xbaef5c=!0x0,_0x2af87b(_0x56ddb9['return']));},{'priority':'low'}),_0x48bb58['then'](()=>{_0xbaef5c||_0x23b683('UsageLimit');});});function _0x4b7eec(){return'auto'==_0xe9e2b9['editing']['view']['_overlayModeHint'];}function _0xcc718d(){_0xe9e2b9['editing']['view']['_overlayModeHint']='auto';}}function _0x5aa819(_0x2e0641){const _0xc6ae79=[new window['Promise'](_0x51de26=>setTimeout(_0x51de26,0x93ecc)),_0x48bb58['then'](()=>new window['Promise'](_0xb41c8a=>{let _0x3be9c5=0x0;_0xe9e2b9['model']['on']('applyOperation',(_0x3e1953,_0x345eb3)=>{_0x345eb3[0x0]['isDocumentOperation']&&_0x3be9c5++,0x5e8==_0x3be9c5&&(_0xb41c8a(),_0x3e1953['off']());});}))];return window['Promise']['race'](_0xc6ae79)['then'](()=>_0x2e0641);}async function _0x29224a(){await _0x48bb58,_0xe9e2b9['model']['change']=_0x55b3fb,_0xe9e2b9['model']['enqueueChange']=_0x55b3fb,_0xe9e2b9['enableReadOnlyMode']('model');}function _0x31a6ba(_0x5d4c01){const _0x3ad532=_0x50bf47();_0xe9e2b9[_0x3ad532]='lineHeightLicenseKey'+_0x5d4c01,'Valid'!=_0x5d4c01&&_0x29224a();}function _0x50bf47(){const _0x23acff=window['String'](window['performance']['now']())['replace']('.','');let _0x2b3ebd='c';for(let _0x36b9bf=0x0;_0x36b9bf<_0x23acff['length'];_0x36b9bf+=0x2){let _0x3ac523=window['parseInt'](_0x23acff['substring'](_0x36b9bf,_0x36b9bf+0x2));_0x3ac523>=0x3e&&(_0x3ac523-=0x3e),_0x2b3ebd+=_0x382bec[_0x3ac523];}return _0x2b3ebd;}function _0x196f66(){const _0x42fcdb=_0x38ac52['split']('.');if(0x3!=_0x42fcdb['length'])return null;return _0x3609a7(_0x42fcdb[0x1]);function _0x3609a7(_0x236b04){const _0x66cbff=_0x53d217(_0x236b04);return _0x66cbff&&_0x383303()?_0x66cbff:null;function _0x383303(){const _0x4fe931=_0x66cbff['jti'],_0x4cd03b=window['parseInt'](_0x4fe931['substring'](_0x4fe931['length']-0x8),0x10),_0x4018e6={..._0x66cbff,'jti':_0x4fe931['substring'](0x0,_0x4fe931['length']-0x8)};return delete _0x4018e6['vc'],_0x5211ce(_0x4018e6)==_0x4cd03b;}}}async function _0xef463(){let _0x35cc69=!0x0;try{const [_0x1b3475,_0x15933e,_0x7e70b]=_0x38ac52['split']('.');return _0x3ea02b(_0x1b3475),await _0x352f75(_0x1b3475,_0x15933e,_0x7e70b),_0x35cc69;}catch{return!0x1;}function _0x3ea02b(_0xc32654){const _0x3c9520=_0x53d217(_0xc32654);_0x3c9520&&'ES256'==_0x3c9520['alg']||(_0x35cc69=!0x1);}async function _0x352f75(_0x43974f,_0x284304,_0xa8a9a7){const _0x218caf=window['Uint8Array']['from'](_0x532ac6(_0xa8a9a7),_0x2d126e=>_0x2d126e['charCodeAt'](0x0)),_0x78a75f=new window['TextEncoder']()['encode'](_0x43974f+'.'+_0x284304),_0x55f11b=window['crypto']['subtle'];if(!_0x55f11b)return;const _0x4286b4=await _0x55f11b['importKey']('jwk',_0x3afb2a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x55f11b['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4286b4,_0x218caf,_0x78a75f)||(_0x35cc69=!0x1);}}function _0x53d217(_0x1927bc){return _0x1927bc['startsWith']('ey')?JSON['parse'](_0x532ac6(_0x1927bc)):null;}function _0x532ac6(_0x436471){return window['atob'](_0x436471['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5211ce(_0x550492){let _0x358948=0x1505;function _0x56d511(_0x140925){for(let _0x11745b=0x0;_0x11745b<_0x140925['length'];_0x11745b++){const _0x5a646d=_0x140925['charCodeAt'](_0x11745b);_0x358948=(_0x358948<<0x5)+_0x358948+_0x5a646d,_0x358948&=_0x358948;}}function _0x1792a6(_0x38252d){Array['isArray'](_0x38252d)?_0x38252d['forEach'](_0x1792a6):_0x38252d&&'object'==typeof _0x38252d?Object['entries'](_0x38252d)['sort']()['forEach'](([_0x4490e4,_0x565146])=>{_0x56d511(_0x4490e4),_0x1792a6(_0x565146);}):_0x56d511(window['String'](_0x38252d));}return _0x1792a6(_0x550492),_0x358948>>>0x0;}function _0x5cc887(_0x3e4c16){return _0x3e4c16['toString'](0x10)['padStart'](0x8,'0');}function _0x221788(_0x5c1be9){return _0x5c1be9['split']('')['reverse']()['join']('');}function _0x55b3fb(){}_0x31a6ba(await _0x63e780());}_0x50c981(_0x5aa206['editor']);}(this);}_validateConfig(){const _0x5b137a=this['editor'];if(!_0x5b137a['config']['get']('lineHeight.supportAllValues'))return;const _0x41ed48=_0x5b137a['config']['get']('lineHeight.options')['filter'](_0x2d6da2=>'string'==typeof _0x2d6da2&&(!H(_0x2d6da2)&&isNaN(Number(_0x2d6da2))));if(_0x41ed48['length'])throw new _0x4c12f3('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x41ed48});}_prepareAnyValueConverters(){const _0x546efb=this['editor'],_0xa550f=this['editor']['config']['get']('lineHeight.defaultValue');_0x546efb['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x12453f=>String(_0x12453f)===String(_0xa550f)?null:{'key':'style','value':{'line-height':_0x12453f}}}),_0x546efb['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x5c721a=>{let _0x120798=_0x5c721a['getStyle']('line-height');return _0x16e951(_0x120798)&&(_0x120798=String(Number(_0x120798['slice'](0x0,-0x1))/0x64)),String(_0x120798)===String(_0xa550f)?null:_0x120798;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x312ab1=this['editor'],_0x11c91f=this['editor']['config']['get']('lineHeight.defaultValue'),_0x11fa3d=function(_0x1b5f51,_0x14e6cd){const _0x1a3231={'model':{'key':_0x1b5f51,'values':[]},'view':{}};for(const _0x6146d1 of _0x14e6cd)'class'===_0x6146d1['view']?.['key']?(_0x1a3231['model']['values']['push'](_0x6146d1['model']),_0x1a3231['view'][_0x6146d1['model']]={'key':'class','value':_0x6146d1['view']['value']}):(_0x1a3231['model']['values']['push'](_0x6146d1['model']),_0x1a3231['view'][_0x6146d1['model']]={'key':'style','value':'line-height:'+_0x6146d1['model']+';'});return _0x1a3231;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x110d7c=>_0x110d7c['model']));_0x312ab1['conversion']['attributeToAttribute'](_0x11fa3d),_0x312ab1['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x1f0d5e=>{let _0x45f2a8=_0x1f0d5e['getStyle']('line-height');return _0x16e951(_0x45f2a8)&&(_0x45f2a8=String(Number(_0x45f2a8['slice'](0x0,-0x1))/0x64)),_0x45f2a8===String(_0x11c91f)?null:_0x11fa3d['model']['values']['includes'](_0x45f2a8)?_0x45f2a8:null;}}});}},k=class extends _0x2df8bc{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xef9770={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0xef9770),this['_registerMenuBarComponent'](_0xef9770),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x2f5f94=[this['editor']];for(const _0x3e832e of _0x2f5f94){let _0x5ac059;for(const _0x222464 in _0x3e832e){const _0x3608ea=_0x222464,_0x2bde15=_0x3e832e[_0x3608ea];if('lineHeightLicenseKeyValid'==_0x2bde15||'lineHeightLicenseKeyInvalid'==_0x2bde15||'lineHeightLicenseKeyExpired'==_0x2bde15||'lineHeightLicenseKeyDomainLimit'==_0x2bde15||'lineHeightLicenseKeyNotAllowed'==_0x2bde15||'lineHeightLicenseKeyEvaluationLimit'==_0x2bde15||'lineHeightLicenseKeyUsageLimit'==_0x2bde15){delete _0x3e832e[_0x3608ea],_0x5ac059=_0x2bde15,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x5ac059&&_0x3e832e['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x5ac059&&_0x3e832e['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x5ac059&&_0x3e832e['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x5ac059&&_0x3e832e['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x5ac059&&_0x3e832e['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x5ac059&&_0x3e832e['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x23d383=this['editor'],t=_0x23d383['t'],_0x13018f=_0x23d383['config']['get']('lineHeight'),_0x2b9055={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x13018f)['map'](_0x5782db=>{const _0x15b6c5=_0x2b9055[_0x5782db['title']];return _0x15b6c5&&_0x15b6c5!=_0x5782db['title']&&(_0x5782db=Object['assign']({},_0x5782db,{'title':_0x15b6c5})),_0x5782db;});}_prepareListOptions(){const _0x33b2f7=this['editor']['commands']['get']('lineHeight'),_0x25989e=this['editor']['config']['get']('lineHeight.defaultValue'),_0x2700be=this['_getLocalizedLineHeightOptions'](),_0x3a49af=new _0x4e0734(),_0x20d529=_0x583c9c=>'default'===_0x583c9c||String(_0x25989e)===_0x583c9c;for(const _0xaa1a31 of _0x2700be){const _0x2ae18c={'type':'button','model':new _0x343f6f({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0xaa1a31['title'],'withText':!0x0})};_0x20d529(_0xaa1a31['model'])?(_0x2ae18c['model']['bind']('isOn')['to'](_0x33b2f7,'value',_0x921737=>!_0x921737),_0x2ae18c['model']['commandParam']=void 0x0):(_0x2ae18c['model']['bind']('isOn')['to'](_0x33b2f7,'value',_0x426f6e=>_0x426f6e===_0xaa1a31['model']),_0x2ae18c['model']['commandParam']=_0xaa1a31['model']),_0x3a49af['add'](_0x2ae18c);}if(this['_shouldRenderCustomValueOption']()){const _0x25ef06=this['_getCustomValueOptionDefinition'](_0x2700be);_0x3a49af['add'](_0x25ef06);}return _0x3a49af;}_getCustomValueOptionDefinition(_0x100ab6){const _0x1f8f71=this['editor'],t=_0x1f8f71['t'],_0x38c829=_0x1f8f71['commands']['get']('lineHeight'),_0x32d2fa=_0x100ab6['map'](_0x408664=>_0x408664['model']),_0x340f07={'type':'button','model':new _0x343f6f({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x340f07['model']['bind']('commandParam')['to'](_0x38c829,'value'),_0x340f07['model']['bind']('isOn')['to'](_0x38c829,'value',_0x1336fb=>!!_0x1336fb&&!_0x32d2fa['includes'](String(_0x1336fb))),_0x340f07['model']['bind']('label')['to'](_0x38c829,'value',_0x45e9fa=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x45e9fa))),_0x340f07;}_registerToolbarComponent({accessibleLabel:_0x1450c2,options:_0x1290b1}){const _0xcc082c=this['editor'],_0x59237a=_0xcc082c['commands']['get']('lineHeight');_0xcc082c['ui']['componentFactory']['add']('lineHeight',_0x4631e2=>{const _0x3f05b4=_0x4b2e88(_0x4631e2);return _0x46d838(_0x3f05b4,_0x1290b1,{'role':'menu','ariaLabel':_0x1450c2}),_0x3f05b4['buttonView']['set']({'label':_0x1450c2,'tooltip':!0x0,'icon':_0x2bcafb}),_0x3f05b4['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x3f05b4['bind']('isEnabled')['to'](_0x59237a),this['listenTo'](_0x3f05b4,'execute',_0x27e35e=>{_0xcc082c['execute'](_0x27e35e['source']['commandName'],{'value':_0x27e35e['source']['commandParam']}),_0xcc082c['editing']['view']['focus']();}),_0x3f05b4['once']('change:isOpen',()=>{const _0x23b8a6=_0x3f05b4['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x3f05b4,_0x1290b1,_0x23b8a6);}),_0x3f05b4;});}_registerMenuBarComponent({accessibleLabel:_0xbeca6,options:_0x557673}){const _0x1d1aea=this['editor'],_0x159f9d=_0x1d1aea['commands']['get']('lineHeight');_0x1d1aea['ui']['componentFactory']['add']('menuBar:lineHeight',_0x255e99=>{const _0x1cd314=new _0x1cede2(_0x255e99);_0x1cd314['buttonView']['set']({'label':_0xbeca6,'icon':_0x2bcafb}),_0x1cd314['bind']('isEnabled')['to'](_0x159f9d);const _0x11e3dd=new _0x2bd843(_0x255e99);for(const _0xb0541c of _0x557673){const _0x29082c=new _0x5e521c(_0x255e99,_0x1cd314),_0x176cf3=new _0x2fb419(_0x255e99);_0x176cf3['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x176cf3['bind'](...Object['keys'](_0xb0541c['model']))['to'](_0xb0541c['model']),_0x176cf3['delegate']('execute')['to'](_0x1cd314),_0x176cf3['on']('execute',()=>{_0x1d1aea['execute'](_0xb0541c['model']['commandName'],{'value':_0xb0541c['model']['commandParam']}),_0x1d1aea['editing']['view']['focus']();}),_0x29082c['children']['add'](_0x176cf3),_0x11e3dd['items']['add'](_0x29082c);}return _0x1cd314['panelView']['children']['add'](_0x11e3dd),this['_attachCustomOptionVisibilityHandler'](_0x1cd314,_0x557673,_0x11e3dd),_0x1cd314;});}_attachCustomOptionVisibilityHandler(_0xeeefbf,_0x578858,_0x237cbd){if(!this['_shouldRenderCustomValueOption']())return;const _0x3d5ac0=()=>{if(!_0xeeefbf['isOpen'])return;_0x237cbd['items']['last']['isVisible']=Boolean(_0x578858['last']['model']['isOn']);};_0x3d5ac0(),_0xeeefbf['on']('change:isOpen',()=>{_0x3d5ac0();});}},_=class extends _0x2df8bc{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.
|
|
3
|
+
"version": "48.5.0-alpha.3",
|
|
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.
|
|
30
|
-
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-list": "48.5.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.
|
|
34
|
-
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.
|
|
29
|
+
"@ckeditor/ckeditor5-core": "48.5.0-alpha.3",
|
|
30
|
+
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.3",
|
|
31
|
+
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.3",
|
|
32
|
+
"@ckeditor/ckeditor5-list": "48.5.0-alpha.3",
|
|
33
|
+
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.3",
|
|
34
|
+
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.3"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist",
|