@ckeditor/ckeditor5-line-height 48.3.0-alpha.5 → 48.3.0-alpha.6
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 _0x44d9fe,Plugin as _0x5d59cc}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x397821,Collection as _0x510678,first as _0xd641d,uid as _0x3e54ef}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x41e888,isPercentageStyleValue as _0x383fc2}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x2c5941,MenuBarMenuListItemView as _0x371ed5,MenuBarMenuListView as _0x537356,MenuBarMenuView as _0x48a510,UIModel as _0x3d00b8,addListToDropdown as _0x1eb78b,createDropdown as _0x2dbad8}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x155a22}from'@ckeditor/ckeditor5-icons';var p=class extends _0x44d9fe{['refresh'](){const _0x58172f=this['editor']['model']['document'],_0x2e320b=_0xd641d(_0x58172f['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x2e320b)&&this['_canHaveLineHeight'](_0x2e320b),this['value']=this['isEnabled']&&_0x2e320b['getAttribute']('lineHeight');}['execute'](_0x8a6fc7={}){const _0x2ba824=this['editor']['model'],_0x586125=_0x2ba824['document']['selection'],_0x3f5964=_0x8a6fc7['value'];_0x2ba824['change'](_0x1bbb3b=>{const _0x34e838=Array['from'](_0x586125['getSelectedBlocks']())['filter'](_0x4e6dbb=>this['_canHaveLineHeight'](_0x4e6dbb));for(const _0x31c2e8 of _0x34e838)_0x3f5964?_0x1bbb3b['setAttribute']('lineHeight',_0x3f5964,_0x31c2e8):_0x1bbb3b['removeAttribute']('lineHeight',_0x31c2e8);});}['_canHaveLineHeight'](_0x4039d3){return this['editor']['model']['schema']['checkAttribute'](_0x4039d3,'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(_0x1dfd53){return'string'==typeof _0x1dfd53&&'default'===_0x1dfd53['toLowerCase']();}function L(_0x365fc6){return _0x365fc6['options']['map'](_0x406fee=>{return H(_0x406fee)?{'title':String(_0x365fc6['defaultValue']),'model':'default'}:('number'==typeof _0x406fee&&(_0x406fee=String(_0x406fee)),'string'!=typeof _0x406fee?_0x406fee:parseFloat(_0x406fee)?{'title':_0x406fee,'model':_0x406fee,'view':{'name':'span','styles':{'line-height':_0x406fee}}}:'string'==typeof(_0x5b1420=_0x406fee)?y[_0x5b1420]:y[_0x5b1420['model']]);var _0x5b1420;})['filter'](_0x377635=>void 0x0!==_0x377635);}var v=class extends _0x5d59cc{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {plugins:_0x287c0a,conversion:_0x4ee4da}=this['editor'];_0x287c0a['has']('ListEditing')&&_0x287c0a['has']('TodoListEditing')&&(_0x287c0a['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x27e856,_0x5ec063,_0x2613a0,_0x587ee8,_0x3d5d5f){'todo'==_0x3d5d5f['getAttribute']('listType')&&_0x5ec063&&(_0x27e856['addClass']('ck-list-marker-line-height',_0x2613a0),_0x27e856['setStyle']('--ck-content-list-marker-line-height',_0x5ec063,_0x2613a0));}}),_0x4ee4da['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x4ee4da['for']('upcast')['add'](_0x504162=>{_0x504162['on']('element:li',function(_0x565d4e){const _0x387d5c=new _0x41e888(_0x565d4e);return(_0x3e7ca9,_0x45cd0b,_0x21a0c2)=>{const _0x538c4a=_0x387d5c['match'](_0x45cd0b['viewItem']);if(!_0x538c4a)return;const _0x4f2741=_0x538c4a['match'];_0x4f2741['name']=!0x1,_0x21a0c2['consumable']['consume'](_0x45cd0b['viewItem'],_0x4f2741);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x5d59cc{static get['pluginName'](){return'LineHeightEditing';}static get['requires'](){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4702dd){super(_0x4702dd),_0x4702dd['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}['init'](){const _0x38e05b=this['editor'];this['_validateConfig'](),_0x38e05b['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x38e05b['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x38e05b['commands']['add']('lineHeight',new p(_0x38e05b)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}['afterInit'](){!async function(_0x4c2ec2){const _0x14f7e3='PHQ3YUIBrl0XdnwG9kez8sfpMv1ytWFRNZOV5jJaq7Tc2ogub64xCKDEALSihm',_0x141fd3=0x78e40,_0x5db99a=window['Date']['now'](),_0x28b308=_0x4c2ec2['editor'],_0x51a11e=new window['Promise'](_0x485466=>{_0x28b308['once']('ready',_0x485466);}),_0x2390de={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x125ee8=_0x28b308['config']['get']('licenseKey');async function _0x9e51ed(){let _0x4c60da,_0x4d5bea=null,_0x25d038=null;try{return'GPL'==_0x125ee8?'NotAllowed':(_0x4c60da=_0x47ab6c(),_0x4c60da?(_0x4c60da['usageEndpoint']&&(_0x25d038=_0x13e7e9(_0x4c60da['usageEndpoint'],_0x4c60da['jti'])),await _0x151962()?_0x4eb08f()?_0x5b3987()?'Expired':_0x289d4e()?('evaluation'==_0x4c60da['licenseType']&&(_0x4d5bea=_0x4b69dc('EvaluationLimit')),await _0x458a27()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x5b3987(){const _0x334ba5=['evaluation','trial']['includes'](_0x4c60da['licenseType'])?_0x5db99a/0x3e8:0xe10*_0x141fd3;return _0x4c60da['exp']<_0x334ba5;}function _0x4eb08f(){const _0x76cd43=_0x4c60da['features'];return!!_0x76cd43&&(!!_0x76cd43['includes']('*')||!!_0x76cd43['includes']('LH'));}function _0x289d4e(){const _0x1b3246=_0x4c60da['licensedHosts'];if(!_0x1b3246||0x0==_0x1b3246['length'])return!0x0;const {hostname:_0x53066b}=new URL(window['location']['href']);if(_0x1b3246['includes'](_0x53066b))return!0x0;const _0x3e4f39=_0x53066b['split']('.');return _0x1b3246['filter'](_0x3a7267=>_0x3a7267['includes']('*'))['map'](_0x4a4102=>_0x4a4102['split']('.'))['filter'](_0x10d00b=>_0x10d00b['length']<=_0x3e4f39['length'])['map'](_0x4e6dab=>Array(_0x3e4f39['length']-_0x4e6dab['length'])['fill']('*'===_0x4e6dab[0x0]?'*':'')['concat'](_0x4e6dab))['some'](_0x3d681b=>_0x3e4f39['every']((_0x36c1ea,_0xaf3030)=>_0x3d681b[_0xaf3030]===_0x36c1ea||'*'===_0x3d681b[_0xaf3030]));}function _0x458a27(){return _0x4d5bea&&_0x25d038?new window['Promise']((_0x3fcdd9,_0x58f67a)=>{_0x4d5bea['then'](_0x3fcdd9,_0x58f67a),_0x25d038['then'](_0x54ab3e=>{'Valid'!=_0x54ab3e&&_0x3fcdd9(_0x54ab3e);},_0x58f67a);}):_0x4d5bea||_0x25d038||'Valid';}}function _0x13e7e9(_0x2d0082,_0x3b972e){return new window['Promise'](_0x1a40ed=>{if(_0x34d3e2())return _0x1a40ed('Valid');_0x44e189(),_0x28b308['decorate']('_sendUsageRequest');let _0x43d9d5=!0x1;const _0x36eb2d=_0x3e54ef();function _0x30f6c2(_0x24fdff){return!!_0x24fdff&&('object'==typeof _0x24fdff||'function'==typeof _0x24fdff)&&'function'==typeof _0x24fdff['then']&&'function'==typeof _0x24fdff['catch'];}function _0x5a12fb(_0x4ee04f){_0x8314ed(_0x4ee04f)['then'](_0x3f0504=>_0x3f0504&&'ok'==_0x3f0504['status']?_0x10eca5(_0x543749(_0x36eb2d+_0x3b972e))!=_0x3f0504['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x203a8d=>(_0x56a2c3(),_0x203a8d),()=>{const _0x216e79=_0x538c14();return null==_0x216e79?(_0x56a2c3(),'Valid'):_0x5db99a-_0x216e79>0x240c8400?'UsageLimit':'Valid';})['then'](_0x1a40ed)['catch'](()=>{_0x1a40ed('UsageLimit');});const _0x525989=0x36ee80;function _0x56a2c3(){const _0x28657f='llct-'+_0x10eca5(_0x543749(_0x2d0082)),_0x36ed28=_0x16e3ea(_0x10eca5(window['Math']['ceil'](_0x5db99a/_0x525989)));window['localStorage']['setItem'](_0x28657f,_0x36ed28);}function _0x538c14(){const _0x43c6db='llct-'+_0x10eca5(_0x543749(_0x2d0082)),_0x172e5b=window['localStorage']['getItem'](_0x43c6db);return _0x172e5b?window['parseInt'](_0x16e3ea(_0x172e5b),0x10)*_0x525989:null;}function _0x8314ed(_0x480b76){return new window['Promise']((_0x56f0a0,_0x41e487)=>{_0x480b76['then'](_0x56f0a0,_0x41e487),window['setTimeout'](_0x41e487,0x1d4c0);});}}_0x28b308['on']('_sendUsageRequest',(_0x2f1025,_0x3e83ce)=>{if(_0x3e83ce[0x0]!=_0x2d0082)return _0x1a40ed('UsageLimit');_0x3e83ce[0x1]={..._0x3e83ce[0x1],'requestId':_0x36eb2d};},{'priority':'high'}),_0x28b308['on']('_sendUsageRequest',_0x1689d8=>{_0x30f6c2(_0x1689d8['return'])&&(_0x43d9d5=!0x0,_0x5a12fb(_0x1689d8['return']));},{'priority':'low'}),_0x51a11e['then'](()=>{_0x43d9d5||_0x1a40ed('UsageLimit');});});function _0x34d3e2(){return'auto'==_0x28b308['editing']['view']['_overlayModeHint'];}function _0x44e189(){_0x28b308['editing']['view']['_overlayModeHint']='auto';}}function _0x4b69dc(_0x5ab518){const _0x55b211=[new window['Promise'](_0x5d66c6=>setTimeout(_0x5d66c6,0x93ecc)),_0x51a11e['then'](()=>new window['Promise'](_0x2a96f3=>{let _0x284603=0x0;_0x28b308['model']['on']('applyOperation',(_0x10f8eb,_0x45e8f9)=>{_0x45e8f9[0x0]['isDocumentOperation']&&_0x284603++,0x5e8==_0x284603&&(_0x2a96f3(),_0x10f8eb['off']());});}))];return window['Promise']['race'](_0x55b211)['then'](()=>_0x5ab518);}async function _0x9f2aa1(){await _0x51a11e,_0x28b308['model']['change']=_0x2d01bf,_0x28b308['model']['enqueueChange']=_0x2d01bf,_0x28b308['enableReadOnlyMode']('model');}function _0x5d004a(_0x26e91c){const _0x2abe45=_0x3f6588();_0x28b308[_0x2abe45]='lineHeightLicenseKey'+_0x26e91c,'Valid'!=_0x26e91c&&_0x9f2aa1();}function _0x3f6588(){const _0x1cc43d=window['String'](window['performance']['now']())['replace']('.','');let _0x1007fb='P';for(let _0x5d204a=0x0;_0x5d204a<_0x1cc43d['length'];_0x5d204a+=0x2){let _0x1e9147=window['parseInt'](_0x1cc43d['substring'](_0x5d204a,_0x5d204a+0x2));_0x1e9147>=0x3e&&(_0x1e9147-=0x3e),_0x1007fb+=_0x14f7e3[_0x1e9147];}return _0x1007fb;}function _0x47ab6c(){const _0x3956c8=_0x125ee8['split']('.');if(0x3!=_0x3956c8['length'])return null;return _0x4cfbea(_0x3956c8[0x1]);function _0x4cfbea(_0x1ce998){const _0x51085f=_0x5ca533(_0x1ce998);return _0x51085f&&_0x17e1f8()?_0x51085f:null;function _0x17e1f8(){const _0x26a1e7=_0x51085f['jti'],_0x581038=window['parseInt'](_0x26a1e7['substring'](_0x26a1e7['length']-0x8),0x10),_0x49f4ea={..._0x51085f,'jti':_0x26a1e7['substring'](0x0,_0x26a1e7['length']-0x8)};return delete _0x49f4ea['vc'],_0x543749(_0x49f4ea)==_0x581038;}}}async function _0x151962(){let _0x1a29b9=!0x0;try{const [_0x32f695,_0x3485c2,_0x3861e9]=_0x125ee8['split']('.');return _0x7c01ed(_0x32f695),await _0x2a2c71(_0x32f695,_0x3485c2,_0x3861e9),_0x1a29b9;}catch{return!0x1;}function _0x7c01ed(_0x31a8ba){const _0x471105=_0x5ca533(_0x31a8ba);_0x471105&&'ES256'==_0x471105['alg']||(_0x1a29b9=!0x1);}async function _0x2a2c71(_0x599d42,_0x5838c8,_0x55813b){const _0x5f2c40=window['Uint8Array']['from'](_0x29d03f(_0x55813b),_0x1a2556=>_0x1a2556['charCodeAt'](0x0)),_0x209a80=new window['TextEncoder']()['encode'](_0x599d42+'.'+_0x5838c8),_0x5528e8=window['crypto']['subtle'];if(!_0x5528e8)return;const _0x25483b=await _0x5528e8['importKey']('jwk',_0x2390de,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x5528e8['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x25483b,_0x5f2c40,_0x209a80)||(_0x1a29b9=!0x1);}}function _0x5ca533(_0x4ce555){return _0x4ce555['startsWith']('ey')?JSON['parse'](_0x29d03f(_0x4ce555)):null;}function _0x29d03f(_0x4ae488){return window['atob'](_0x4ae488['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x543749(_0x38c978){let _0x47572d=0x1505;function _0x3f88c7(_0x5334ef){for(let _0x36f1e5=0x0;_0x36f1e5<_0x5334ef['length'];_0x36f1e5++){const _0x3cd635=_0x5334ef['charCodeAt'](_0x36f1e5);_0x47572d=(_0x47572d<<0x5)+_0x47572d+_0x3cd635,_0x47572d&=_0x47572d;}}function _0x245eb7(_0x5557da){Array['isArray'](_0x5557da)?_0x5557da['forEach'](_0x245eb7):_0x5557da&&'object'==typeof _0x5557da?Object['entries'](_0x5557da)['sort']()['forEach'](([_0xe2c346,_0x2cf723])=>{_0x3f88c7(_0xe2c346),_0x245eb7(_0x2cf723);}):_0x3f88c7(window['String'](_0x5557da));}return _0x245eb7(_0x38c978),_0x47572d>>>0x0;}function _0x10eca5(_0x34c970){return _0x34c970['toString'](0x10)['padStart'](0x8,'0');}function _0x16e3ea(_0x5513d5){return _0x5513d5['split']('')['reverse']()['join']('');}function _0x2d01bf(){}_0x5d004a(await _0x9e51ed());}(this);}['_validateConfig'](){const _0x93c186=this['editor'];if(!_0x93c186['config']['get']('lineHeight.supportAllValues'))return;const _0x1e4ef9=_0x93c186['config']['get']('lineHeight.options')['filter'](_0x2eeb8f=>'string'==typeof _0x2eeb8f&&(!H(_0x2eeb8f)&&isNaN(Number(_0x2eeb8f))));if(_0x1e4ef9['length'])throw new _0x397821('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x1e4ef9});}['_prepareAnyValueConverters'](){const _0x43421b=this['editor'],_0x4ba7a8=this['editor']['config']['get']('lineHeight.defaultValue');_0x43421b['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0xd2e4e1=>String(_0xd2e4e1)===String(_0x4ba7a8)?null:{'key':'style','value':{'line-height':_0xd2e4e1}}}),_0x43421b['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x3695f8=>{let _0x34e2c2=_0x3695f8['getStyle']('line-height');return _0x383fc2(_0x34e2c2)&&(_0x34e2c2=String(Number(_0x34e2c2['slice'](0x0,-0x1))/0x64)),String(_0x34e2c2)===String(_0x4ba7a8)?null:_0x34e2c2;}},'view':{'styles':{'line-height':/.*/}}});}['_preparePredefinedConverters'](){const _0x50b0cb=this['editor'],_0x579c3e=this['editor']['config']['get']('lineHeight.defaultValue'),_0x28d378=function(_0x101ecc,_0x46a04b){const _0x46214a={'model':{'key':_0x101ecc,'values':[]},'view':{}};for(const _0x186cad of _0x46a04b)'class'===_0x186cad['view']?.['key']?(_0x46214a['model']['values']['push'](_0x186cad['model']),_0x46214a['view'][_0x186cad['model']]={'key':'class','value':_0x186cad['view']['value']}):(_0x46214a['model']['values']['push'](_0x186cad['model']),_0x46214a['view'][_0x186cad['model']]={'key':'style','value':'line-height:'+_0x186cad['model']+';'});return _0x46214a;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x36076a=>_0x36076a['model']));_0x50b0cb['conversion']['attributeToAttribute'](_0x28d378),_0x50b0cb['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x562b36=>{let _0x26e5a0=_0x562b36['getStyle']('line-height');return _0x383fc2(_0x26e5a0)&&(_0x26e5a0=String(Number(_0x26e5a0['slice'](0x0,-0x1))/0x64)),_0x26e5a0===String(_0x579c3e)?null:_0x28d378['model']['values']['includes'](_0x26e5a0)?_0x26e5a0:null;}}});}},k=class extends _0x5d59cc{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x379c02={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x379c02),this['_registerMenuBarComponent'](_0x379c02),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3724bc=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x349f64;for(const _0x501d8b in _0x3724bc){const _0x233f21=_0x501d8b,_0x5461d4=_0x3724bc[_0x233f21];if('lineHeightLicenseKeyValid'==_0x5461d4||'lineHeightLicenseKeyInvalid'==_0x5461d4||'lineHeightLicenseKeyExpired'==_0x5461d4||'lineHeightLicenseKeyDomainLimit'==_0x5461d4||'lineHeightLicenseKeyNotAllowed'==_0x5461d4||'lineHeightLicenseKeyEvaluationLimit'==_0x5461d4||'lineHeightLicenseKeyUsageLimit'==_0x5461d4){delete _0x3724bc[_0x233f21],_0x349f64=_0x5461d4,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x349f64&&_0x3724bc['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x349f64&&_0x3724bc['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x349f64&&_0x3724bc['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x349f64&&_0x3724bc['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x349f64&&_0x3724bc['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x349f64&&_0x3724bc['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_shouldRenderCustomValueOption'](){return this['editor']['config']['get']('lineHeight.supportAllValues');}['_getLocalizedLineHeightOptions'](){const _0x216b1f=this['editor'],t=_0x216b1f['t'],_0x1fa7e5=_0x216b1f['config']['get']('lineHeight'),_0x511996={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x1fa7e5)['map'](_0xe71bc1=>{const _0x487a49=_0x511996[_0xe71bc1['title']];return _0x487a49&&_0x487a49!=_0xe71bc1['title']&&(_0xe71bc1=Object['assign']({},_0xe71bc1,{'title':_0x487a49})),_0xe71bc1;});}['_prepareListOptions'](){const _0x19d8ab=this['editor']['commands']['get']('lineHeight'),_0xc2829e=this['editor']['config']['get']('lineHeight.defaultValue'),_0x36123d=this['_getLocalizedLineHeightOptions'](),_0x2f767d=new _0x510678(),_0x118f69=_0x1f47ff=>'default'===_0x1f47ff||String(_0xc2829e)===_0x1f47ff;for(const _0x125942 of _0x36123d){const _0x56a91f={'type':'button','model':new _0x3d00b8({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x125942['title'],'withText':!0x0})};_0x118f69(_0x125942['model'])?(_0x56a91f['model']['bind']('isOn')['to'](_0x19d8ab,'value',_0x10ffc4=>!_0x10ffc4),_0x56a91f['model']['commandParam']=void 0x0):(_0x56a91f['model']['bind']('isOn')['to'](_0x19d8ab,'value',_0x5c159f=>_0x5c159f===_0x125942['model']),_0x56a91f['model']['commandParam']=_0x125942['model']),_0x2f767d['add'](_0x56a91f);}if(this['_shouldRenderCustomValueOption']()){const _0x1bb218=this['_getCustomValueOptionDefinition'](_0x36123d);_0x2f767d['add'](_0x1bb218);}return _0x2f767d;}['_getCustomValueOptionDefinition'](_0x4678d9){const _0x38d601=this['editor'],t=_0x38d601['t'],_0x3f08f8=_0x38d601['commands']['get']('lineHeight'),_0x117cf8=_0x4678d9['map'](_0xeb7f48=>_0xeb7f48['model']),_0x825796={'type':'button','model':new _0x3d00b8({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x825796['model']['bind']('commandParam')['to'](_0x3f08f8,'value'),_0x825796['model']['bind']('isOn')['to'](_0x3f08f8,'value',_0xeb8262=>!!_0xeb8262&&!_0x117cf8['includes'](String(_0xeb8262))),_0x825796['model']['bind']('label')['to'](_0x3f08f8,'value',_0x398030=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x398030))),_0x825796;}['_registerToolbarComponent']({accessibleLabel:_0x121300,options:_0x1ee24e}){const _0xac0dae=this['editor'],_0x10148c=_0xac0dae['commands']['get']('lineHeight');_0xac0dae['ui']['componentFactory']['add']('lineHeight',_0x3c5cb7=>{const _0x4091d0=_0x2dbad8(_0x3c5cb7);return _0x1eb78b(_0x4091d0,_0x1ee24e,{'role':'menu','ariaLabel':_0x121300}),_0x4091d0['buttonView']['set']({'label':_0x121300,'tooltip':!0x0,'icon':_0x155a22}),_0x4091d0['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x4091d0['bind']('isEnabled')['to'](_0x10148c),this['listenTo'](_0x4091d0,'execute',_0x219dcf=>{_0xac0dae['execute'](_0x219dcf['source']['commandName'],{'value':_0x219dcf['source']['commandParam']}),_0xac0dae['editing']['view']['focus']();}),_0x4091d0['once']('change:isOpen',()=>{const _0x546ba1=_0x4091d0['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x4091d0,_0x1ee24e,_0x546ba1);}),_0x4091d0;});}['_registerMenuBarComponent']({accessibleLabel:_0x3541c3,options:_0x4a2430}){const _0x2b568b=this['editor'],_0x4849a2=_0x2b568b['commands']['get']('lineHeight');_0x2b568b['ui']['componentFactory']['add']('menuBar:lineHeight',_0x1b24be=>{const _0x8d5126=new _0x48a510(_0x1b24be);_0x8d5126['buttonView']['set']({'label':_0x3541c3,'icon':_0x155a22}),_0x8d5126['bind']('isEnabled')['to'](_0x4849a2);const _0x2a80c2=new _0x537356(_0x1b24be);for(const _0x503e75 of _0x4a2430){const _0x51833d=new _0x371ed5(_0x1b24be,_0x8d5126),_0x8d9772=new _0x2c5941(_0x1b24be);_0x8d9772['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x8d9772['bind'](...Object['keys'](_0x503e75['model']))['to'](_0x503e75['model']),_0x8d9772['delegate']('execute')['to'](_0x8d5126),_0x8d9772['on']('execute',()=>{_0x2b568b['execute'](_0x503e75['model']['commandName'],{'value':_0x503e75['model']['commandParam']}),_0x2b568b['editing']['view']['focus']();}),_0x51833d['children']['add'](_0x8d9772),_0x2a80c2['items']['add'](_0x51833d);}return _0x8d5126['panelView']['children']['add'](_0x2a80c2),this['_attachCustomOptionVisibilityHandler'](_0x8d5126,_0x4a2430,_0x2a80c2),_0x8d5126;});}['_attachCustomOptionVisibilityHandler'](_0x2120c9,_0x6d2d88,_0x17ee8d){if(!this['_shouldRenderCustomValueOption']())return;const _0x4e9e89=()=>{if(!_0x2120c9['isOpen'])return;_0x17ee8d['items']['last']['isVisible']=Boolean(_0x6d2d88['last']['model']['isOn']);};_0x4e9e89(),_0x2120c9['on']('change:isOpen',()=>{_0x4e9e89();});}},_=class extends _0x5d59cc{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 _0x44c19b,Plugin as _0x4ef410}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x28b51e,Collection as _0x241c88,first as _0x1c93b5,uid as _0x516a77}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x293e27,isPercentageStyleValue as _0x3e34b2}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x3d9787,MenuBarMenuListItemView as _0x1182ac,MenuBarMenuListView as _0xb30685,MenuBarMenuView as _0x2ee97c,UIModel as _0x50187e,addListToDropdown as _0x43bbdb,createDropdown as _0x5cac11}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x29df28}from'@ckeditor/ckeditor5-icons';var p=class extends _0x44c19b{['refresh'](){const _0x4e548a=this['editor']['model']['document'],_0x55ae2a=_0x1c93b5(_0x4e548a['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x55ae2a)&&this['_canHaveLineHeight'](_0x55ae2a),this['value']=this['isEnabled']&&_0x55ae2a['getAttribute']('lineHeight');}['execute'](_0x48ba35={}){const _0xc1d70e=this['editor']['model'],_0x18f6ae=_0xc1d70e['document']['selection'],_0xc17f19=_0x48ba35['value'];_0xc1d70e['change'](_0x480e53=>{const _0x51da2f=Array['from'](_0x18f6ae['getSelectedBlocks']())['filter'](_0x3f4908=>this['_canHaveLineHeight'](_0x3f4908));for(const _0x1c5f2b of _0x51da2f)_0xc17f19?_0x480e53['setAttribute']('lineHeight',_0xc17f19,_0x1c5f2b):_0x480e53['removeAttribute']('lineHeight',_0x1c5f2b);});}['_canHaveLineHeight'](_0x4c85e3){return this['editor']['model']['schema']['checkAttribute'](_0x4c85e3,'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(_0x17cb91){return'string'==typeof _0x17cb91&&'default'===_0x17cb91['toLowerCase']();}function L(_0x1bc4da){return _0x1bc4da['options']['map'](_0x4732da=>{return H(_0x4732da)?{'title':String(_0x1bc4da['defaultValue']),'model':'default'}:('number'==typeof _0x4732da&&(_0x4732da=String(_0x4732da)),'string'!=typeof _0x4732da?_0x4732da:parseFloat(_0x4732da)?{'title':_0x4732da,'model':_0x4732da,'view':{'name':'span','styles':{'line-height':_0x4732da}}}:'string'==typeof(_0x287ec8=_0x4732da)?y[_0x287ec8]:y[_0x287ec8['model']]);var _0x287ec8;})['filter'](_0x849a03=>void 0x0!==_0x849a03);}var v=class extends _0x4ef410{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {plugins:_0x5acd42,conversion:_0x1f1612}=this['editor'];_0x5acd42['has']('ListEditing')&&_0x5acd42['has']('TodoListEditing')&&(_0x5acd42['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x1ec70a,_0xd937b6,_0x31ec99,_0x524277,_0x37a51a){'todo'==_0x37a51a['getAttribute']('listType')&&_0xd937b6&&(_0x1ec70a['addClass']('ck-list-marker-line-height',_0x31ec99),_0x1ec70a['setStyle']('--ck-content-list-marker-line-height',_0xd937b6,_0x31ec99));}}),_0x1f1612['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x1f1612['for']('upcast')['add'](_0x3b043a=>{_0x3b043a['on']('element:li',function(_0x28a030){const _0x46da79=new _0x293e27(_0x28a030);return(_0x4ec1c0,_0xc907c2,_0x59e0c3)=>{const _0x42e879=_0x46da79['match'](_0xc907c2['viewItem']);if(!_0x42e879)return;const _0x52b62f=_0x42e879['match'];_0x52b62f['name']=!0x1,_0x59e0c3['consumable']['consume'](_0xc907c2['viewItem'],_0x52b62f);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x4ef410{static get['pluginName'](){return'LineHeightEditing';}static get['requires'](){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x435678){super(_0x435678),_0x435678['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}['init'](){const _0x501a40=this['editor'];this['_validateConfig'](),_0x501a40['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x501a40['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x501a40['commands']['add']('lineHeight',new p(_0x501a40)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}['afterInit'](){!async function(_0xfa8648){const _0x4bac85='PHQ3YUIBrl0XdnwG9kez8sfpMv1ytWFRNZOV5jJaq7Tc2ogub64xCKDEALSihm',_0x336f47=0x78e58,_0x2df0ee=window['Date']['now'](),_0x2d245d=_0xfa8648['editor'],_0x56e1ea=new window['Promise'](_0xb08f2=>{_0x2d245d['once']('ready',_0xb08f2);}),_0x5eb4fb={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x2423f9=_0x2d245d['config']['get']('licenseKey');async function _0x1d4caf(){let _0x3b4e7a,_0x130058=null,_0x20d68c=null;try{return'GPL'==_0x2423f9?'NotAllowed':(_0x3b4e7a=_0x1de784(),_0x3b4e7a?(_0x3b4e7a['usageEndpoint']&&(_0x20d68c=_0x28c4cb(_0x3b4e7a['usageEndpoint'],_0x3b4e7a['jti'])),await _0x1e3f3e()?_0xfda6e8()?_0x325dcf()?'Expired':_0x42e34e()?('evaluation'==_0x3b4e7a['licenseType']&&(_0x130058=_0x12fda5('EvaluationLimit')),await _0x3a5846()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x325dcf(){const _0x11d2d5=['evaluation','trial']['includes'](_0x3b4e7a['licenseType'])?_0x2df0ee/0x3e8:0xe10*_0x336f47;return _0x3b4e7a['exp']<_0x11d2d5;}function _0xfda6e8(){const _0x2b9777=_0x3b4e7a['features'];return!!_0x2b9777&&(!!_0x2b9777['includes']('*')||!!_0x2b9777['includes']('LH'));}function _0x42e34e(){const _0x450339=_0x3b4e7a['licensedHosts'];if(!_0x450339||0x0==_0x450339['length'])return!0x0;const {hostname:_0x1b1279}=new URL(window['location']['href']);if(_0x450339['includes'](_0x1b1279))return!0x0;const _0x49b700=_0x1b1279['split']('.');return _0x450339['filter'](_0x22dba9=>_0x22dba9['includes']('*'))['map'](_0x33a9d2=>_0x33a9d2['split']('.'))['filter'](_0x7a3d0a=>_0x7a3d0a['length']<=_0x49b700['length'])['map'](_0x13f14e=>Array(_0x49b700['length']-_0x13f14e['length'])['fill']('*'===_0x13f14e[0x0]?'*':'')['concat'](_0x13f14e))['some'](_0x36cfdd=>_0x49b700['every']((_0x274658,_0x89cef5)=>_0x36cfdd[_0x89cef5]===_0x274658||'*'===_0x36cfdd[_0x89cef5]));}function _0x3a5846(){return _0x130058&&_0x20d68c?new window['Promise']((_0x598c4a,_0x36aa7a)=>{_0x130058['then'](_0x598c4a,_0x36aa7a),_0x20d68c['then'](_0x36b1b6=>{'Valid'!=_0x36b1b6&&_0x598c4a(_0x36b1b6);},_0x36aa7a);}):_0x130058||_0x20d68c||'Valid';}}function _0x28c4cb(_0x30cb9b,_0x3b5d56){return new window['Promise'](_0x2a326a=>{if(_0x403806())return _0x2a326a('Valid');_0x34af6c(),_0x2d245d['decorate']('_sendUsageRequest');let _0x3b1bea=!0x1;const _0x16af32=_0x516a77();function _0x222c31(_0x3adcc6){return!!_0x3adcc6&&('object'==typeof _0x3adcc6||'function'==typeof _0x3adcc6)&&'function'==typeof _0x3adcc6['then']&&'function'==typeof _0x3adcc6['catch'];}function _0x3f0622(_0x1c4b6d){_0x8b7fc1(_0x1c4b6d)['then'](_0x4285ee=>_0x4285ee&&'ok'==_0x4285ee['status']?_0x4e3ed9(_0x2a01ab(_0x16af32+_0x3b5d56))!=_0x4285ee['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0xb116ad=>(_0x3ac9d7(),_0xb116ad),()=>{const _0x142bf4=_0xcf8856();return null==_0x142bf4?(_0x3ac9d7(),'Valid'):_0x2df0ee-_0x142bf4>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2a326a)['catch'](()=>{_0x2a326a('UsageLimit');});const _0x1faadf=0x36ee80;function _0x3ac9d7(){const _0x566394='llct-'+_0x4e3ed9(_0x2a01ab(_0x30cb9b)),_0x4e04a5=_0x1b6093(_0x4e3ed9(window['Math']['ceil'](_0x2df0ee/_0x1faadf)));window['localStorage']['setItem'](_0x566394,_0x4e04a5);}function _0xcf8856(){const _0x34f7af='llct-'+_0x4e3ed9(_0x2a01ab(_0x30cb9b)),_0xc8c0a8=window['localStorage']['getItem'](_0x34f7af);return _0xc8c0a8?window['parseInt'](_0x1b6093(_0xc8c0a8),0x10)*_0x1faadf:null;}function _0x8b7fc1(_0x5a514e){return new window['Promise']((_0x479145,_0x136a47)=>{_0x5a514e['then'](_0x479145,_0x136a47),window['setTimeout'](_0x136a47,0x1d4c0);});}}_0x2d245d['on']('_sendUsageRequest',(_0x28f1fe,_0x112a7d)=>{if(_0x112a7d[0x0]!=_0x30cb9b)return _0x2a326a('UsageLimit');_0x112a7d[0x1]={..._0x112a7d[0x1],'requestId':_0x16af32};},{'priority':'high'}),_0x2d245d['on']('_sendUsageRequest',_0x17ae40=>{_0x222c31(_0x17ae40['return'])&&(_0x3b1bea=!0x0,_0x3f0622(_0x17ae40['return']));},{'priority':'low'}),_0x56e1ea['then'](()=>{_0x3b1bea||_0x2a326a('UsageLimit');});});function _0x403806(){return'auto'==_0x2d245d['editing']['view']['_overlayModeHint'];}function _0x34af6c(){_0x2d245d['editing']['view']['_overlayModeHint']='auto';}}function _0x12fda5(_0x480ead){const _0x4ec7f8=[new window['Promise'](_0x50cab7=>setTimeout(_0x50cab7,0x93ecc)),_0x56e1ea['then'](()=>new window['Promise'](_0x4fcd47=>{let _0x280c19=0x0;_0x2d245d['model']['on']('applyOperation',(_0x37c9e4,_0x191bfc)=>{_0x191bfc[0x0]['isDocumentOperation']&&_0x280c19++,0x5e8==_0x280c19&&(_0x4fcd47(),_0x37c9e4['off']());});}))];return window['Promise']['race'](_0x4ec7f8)['then'](()=>_0x480ead);}async function _0x1a6db6(){await _0x56e1ea,_0x2d245d['model']['change']=_0x21f4a3,_0x2d245d['model']['enqueueChange']=_0x21f4a3,_0x2d245d['enableReadOnlyMode']('model');}function _0x4eeab2(_0x1ffaff){const _0x17a3a9=_0x41284c();_0x2d245d[_0x17a3a9]='lineHeightLicenseKey'+_0x1ffaff,'Valid'!=_0x1ffaff&&_0x1a6db6();}function _0x41284c(){const _0x382697=window['String'](window['performance']['now']())['replace']('.','');let _0x2d4c88='P';for(let _0x3cdb0f=0x0;_0x3cdb0f<_0x382697['length'];_0x3cdb0f+=0x2){let _0x479bdb=window['parseInt'](_0x382697['substring'](_0x3cdb0f,_0x3cdb0f+0x2));_0x479bdb>=0x3e&&(_0x479bdb-=0x3e),_0x2d4c88+=_0x4bac85[_0x479bdb];}return _0x2d4c88;}function _0x1de784(){const _0x1db5b1=_0x2423f9['split']('.');if(0x3!=_0x1db5b1['length'])return null;return _0x1bc199(_0x1db5b1[0x1]);function _0x1bc199(_0x67e5b6){const _0x5ab8ad=_0x94e2db(_0x67e5b6);return _0x5ab8ad&&_0x16e451()?_0x5ab8ad:null;function _0x16e451(){const _0x4c1e29=_0x5ab8ad['jti'],_0x538c47=window['parseInt'](_0x4c1e29['substring'](_0x4c1e29['length']-0x8),0x10),_0x1b61ed={..._0x5ab8ad,'jti':_0x4c1e29['substring'](0x0,_0x4c1e29['length']-0x8)};return delete _0x1b61ed['vc'],_0x2a01ab(_0x1b61ed)==_0x538c47;}}}async function _0x1e3f3e(){let _0x30d2e2=!0x0;try{const [_0x1c9cb4,_0x56be69,_0x290f1f]=_0x2423f9['split']('.');return _0x5d3f22(_0x1c9cb4),await _0x3fde41(_0x1c9cb4,_0x56be69,_0x290f1f),_0x30d2e2;}catch{return!0x1;}function _0x5d3f22(_0x25c533){const _0x2608cd=_0x94e2db(_0x25c533);_0x2608cd&&'ES256'==_0x2608cd['alg']||(_0x30d2e2=!0x1);}async function _0x3fde41(_0x296241,_0x24966e,_0x3a308a){const _0x2ca358=window['Uint8Array']['from'](_0x3412e3(_0x3a308a),_0x12c371=>_0x12c371['charCodeAt'](0x0)),_0xed4cff=new window['TextEncoder']()['encode'](_0x296241+'.'+_0x24966e),_0x2c1fba=window['crypto']['subtle'];if(!_0x2c1fba)return;const _0x4a5328=await _0x2c1fba['importKey']('jwk',_0x5eb4fb,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2c1fba['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4a5328,_0x2ca358,_0xed4cff)||(_0x30d2e2=!0x1);}}function _0x94e2db(_0x5ef9a2){return _0x5ef9a2['startsWith']('ey')?JSON['parse'](_0x3412e3(_0x5ef9a2)):null;}function _0x3412e3(_0x4e8fe0){return window['atob'](_0x4e8fe0['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2a01ab(_0x3cf684){let _0x285813=0x1505;function _0xc39657(_0x4cb49a){for(let _0xad0de5=0x0;_0xad0de5<_0x4cb49a['length'];_0xad0de5++){const _0x23fa3b=_0x4cb49a['charCodeAt'](_0xad0de5);_0x285813=(_0x285813<<0x5)+_0x285813+_0x23fa3b,_0x285813&=_0x285813;}}function _0x44c9bf(_0x3c268f){Array['isArray'](_0x3c268f)?_0x3c268f['forEach'](_0x44c9bf):_0x3c268f&&'object'==typeof _0x3c268f?Object['entries'](_0x3c268f)['sort']()['forEach'](([_0x274c25,_0x4781e2])=>{_0xc39657(_0x274c25),_0x44c9bf(_0x4781e2);}):_0xc39657(window['String'](_0x3c268f));}return _0x44c9bf(_0x3cf684),_0x285813>>>0x0;}function _0x4e3ed9(_0xf72e9c){return _0xf72e9c['toString'](0x10)['padStart'](0x8,'0');}function _0x1b6093(_0x7a263d){return _0x7a263d['split']('')['reverse']()['join']('');}function _0x21f4a3(){}_0x4eeab2(await _0x1d4caf());}(this);}['_validateConfig'](){const _0x52dd04=this['editor'];if(!_0x52dd04['config']['get']('lineHeight.supportAllValues'))return;const _0x8f8d4b=_0x52dd04['config']['get']('lineHeight.options')['filter'](_0x207ab0=>'string'==typeof _0x207ab0&&(!H(_0x207ab0)&&isNaN(Number(_0x207ab0))));if(_0x8f8d4b['length'])throw new _0x28b51e('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x8f8d4b});}['_prepareAnyValueConverters'](){const _0x33f0a8=this['editor'],_0x57a9fc=this['editor']['config']['get']('lineHeight.defaultValue');_0x33f0a8['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x4bf961=>String(_0x4bf961)===String(_0x57a9fc)?null:{'key':'style','value':{'line-height':_0x4bf961}}}),_0x33f0a8['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x296c3c=>{let _0x48ca50=_0x296c3c['getStyle']('line-height');return _0x3e34b2(_0x48ca50)&&(_0x48ca50=String(Number(_0x48ca50['slice'](0x0,-0x1))/0x64)),String(_0x48ca50)===String(_0x57a9fc)?null:_0x48ca50;}},'view':{'styles':{'line-height':/.*/}}});}['_preparePredefinedConverters'](){const _0x54ca72=this['editor'],_0x20e123=this['editor']['config']['get']('lineHeight.defaultValue'),_0x43930c=function(_0x1755f3,_0x3d4892){const _0x50d258={'model':{'key':_0x1755f3,'values':[]},'view':{}};for(const _0x5a9ec8 of _0x3d4892)'class'===_0x5a9ec8['view']?.['key']?(_0x50d258['model']['values']['push'](_0x5a9ec8['model']),_0x50d258['view'][_0x5a9ec8['model']]={'key':'class','value':_0x5a9ec8['view']['value']}):(_0x50d258['model']['values']['push'](_0x5a9ec8['model']),_0x50d258['view'][_0x5a9ec8['model']]={'key':'style','value':'line-height:'+_0x5a9ec8['model']+';'});return _0x50d258;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x1faf62=>_0x1faf62['model']));_0x54ca72['conversion']['attributeToAttribute'](_0x43930c),_0x54ca72['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x31bd58=>{let _0x2dc5fc=_0x31bd58['getStyle']('line-height');return _0x3e34b2(_0x2dc5fc)&&(_0x2dc5fc=String(Number(_0x2dc5fc['slice'](0x0,-0x1))/0x64)),_0x2dc5fc===String(_0x20e123)?null:_0x43930c['model']['values']['includes'](_0x2dc5fc)?_0x2dc5fc:null;}}});}},k=class extends _0x4ef410{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x13fcfd={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x13fcfd),this['_registerMenuBarComponent'](_0x13fcfd),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x13f84b=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3888a9;for(const _0x5ba907 in _0x13f84b){const _0x30e9ce=_0x5ba907,_0x4e3fcd=_0x13f84b[_0x30e9ce];if('lineHeightLicenseKeyValid'==_0x4e3fcd||'lineHeightLicenseKeyInvalid'==_0x4e3fcd||'lineHeightLicenseKeyExpired'==_0x4e3fcd||'lineHeightLicenseKeyDomainLimit'==_0x4e3fcd||'lineHeightLicenseKeyNotAllowed'==_0x4e3fcd||'lineHeightLicenseKeyEvaluationLimit'==_0x4e3fcd||'lineHeightLicenseKeyUsageLimit'==_0x4e3fcd){delete _0x13f84b[_0x30e9ce],_0x3888a9=_0x4e3fcd,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x3888a9&&_0x13f84b['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x3888a9&&_0x13f84b['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x3888a9&&_0x13f84b['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x3888a9&&_0x13f84b['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x3888a9&&_0x13f84b['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x3888a9&&_0x13f84b['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_shouldRenderCustomValueOption'](){return this['editor']['config']['get']('lineHeight.supportAllValues');}['_getLocalizedLineHeightOptions'](){const _0xefc918=this['editor'],t=_0xefc918['t'],_0x1e16ef=_0xefc918['config']['get']('lineHeight'),_0x3149be={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x1e16ef)['map'](_0x2ec346=>{const _0x4af2e2=_0x3149be[_0x2ec346['title']];return _0x4af2e2&&_0x4af2e2!=_0x2ec346['title']&&(_0x2ec346=Object['assign']({},_0x2ec346,{'title':_0x4af2e2})),_0x2ec346;});}['_prepareListOptions'](){const _0x3b932d=this['editor']['commands']['get']('lineHeight'),_0x28947e=this['editor']['config']['get']('lineHeight.defaultValue'),_0x396580=this['_getLocalizedLineHeightOptions'](),_0x1d1d08=new _0x241c88(),_0x2c6d8d=_0x4da173=>'default'===_0x4da173||String(_0x28947e)===_0x4da173;for(const _0x4bd9d5 of _0x396580){const _0x5d03f9={'type':'button','model':new _0x50187e({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x4bd9d5['title'],'withText':!0x0})};_0x2c6d8d(_0x4bd9d5['model'])?(_0x5d03f9['model']['bind']('isOn')['to'](_0x3b932d,'value',_0x1454ca=>!_0x1454ca),_0x5d03f9['model']['commandParam']=void 0x0):(_0x5d03f9['model']['bind']('isOn')['to'](_0x3b932d,'value',_0xab800b=>_0xab800b===_0x4bd9d5['model']),_0x5d03f9['model']['commandParam']=_0x4bd9d5['model']),_0x1d1d08['add'](_0x5d03f9);}if(this['_shouldRenderCustomValueOption']()){const _0x563f9c=this['_getCustomValueOptionDefinition'](_0x396580);_0x1d1d08['add'](_0x563f9c);}return _0x1d1d08;}['_getCustomValueOptionDefinition'](_0x428bfc){const _0x3d69ca=this['editor'],t=_0x3d69ca['t'],_0x49588b=_0x3d69ca['commands']['get']('lineHeight'),_0xa4aa0f=_0x428bfc['map'](_0x50cfe9=>_0x50cfe9['model']),_0x5cdf15={'type':'button','model':new _0x50187e({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x5cdf15['model']['bind']('commandParam')['to'](_0x49588b,'value'),_0x5cdf15['model']['bind']('isOn')['to'](_0x49588b,'value',_0x3ecb01=>!!_0x3ecb01&&!_0xa4aa0f['includes'](String(_0x3ecb01))),_0x5cdf15['model']['bind']('label')['to'](_0x49588b,'value',_0x160d93=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x160d93))),_0x5cdf15;}['_registerToolbarComponent']({accessibleLabel:_0x208672,options:_0x1f888a}){const _0x2a19dc=this['editor'],_0x4b3048=_0x2a19dc['commands']['get']('lineHeight');_0x2a19dc['ui']['componentFactory']['add']('lineHeight',_0x5330f2=>{const _0x37b82a=_0x5cac11(_0x5330f2);return _0x43bbdb(_0x37b82a,_0x1f888a,{'role':'menu','ariaLabel':_0x208672}),_0x37b82a['buttonView']['set']({'label':_0x208672,'tooltip':!0x0,'icon':_0x29df28}),_0x37b82a['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x37b82a['bind']('isEnabled')['to'](_0x4b3048),this['listenTo'](_0x37b82a,'execute',_0x2b551b=>{_0x2a19dc['execute'](_0x2b551b['source']['commandName'],{'value':_0x2b551b['source']['commandParam']}),_0x2a19dc['editing']['view']['focus']();}),_0x37b82a['once']('change:isOpen',()=>{const _0x1cc877=_0x37b82a['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x37b82a,_0x1f888a,_0x1cc877);}),_0x37b82a;});}['_registerMenuBarComponent']({accessibleLabel:_0x2ce115,options:_0x4bc9ae}){const _0x5937e3=this['editor'],_0x27664b=_0x5937e3['commands']['get']('lineHeight');_0x5937e3['ui']['componentFactory']['add']('menuBar:lineHeight',_0x179dbd=>{const _0x475f9a=new _0x2ee97c(_0x179dbd);_0x475f9a['buttonView']['set']({'label':_0x2ce115,'icon':_0x29df28}),_0x475f9a['bind']('isEnabled')['to'](_0x27664b);const _0x416953=new _0xb30685(_0x179dbd);for(const _0x447d9a of _0x4bc9ae){const _0x56c098=new _0x1182ac(_0x179dbd,_0x475f9a),_0x3f3f5f=new _0x3d9787(_0x179dbd);_0x3f3f5f['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x3f3f5f['bind'](...Object['keys'](_0x447d9a['model']))['to'](_0x447d9a['model']),_0x3f3f5f['delegate']('execute')['to'](_0x475f9a),_0x3f3f5f['on']('execute',()=>{_0x5937e3['execute'](_0x447d9a['model']['commandName'],{'value':_0x447d9a['model']['commandParam']}),_0x5937e3['editing']['view']['focus']();}),_0x56c098['children']['add'](_0x3f3f5f),_0x416953['items']['add'](_0x56c098);}return _0x475f9a['panelView']['children']['add'](_0x416953),this['_attachCustomOptionVisibilityHandler'](_0x475f9a,_0x4bc9ae,_0x416953),_0x475f9a;});}['_attachCustomOptionVisibilityHandler'](_0x5a8021,_0x3f29ca,_0x3ac664){if(!this['_shouldRenderCustomValueOption']())return;const _0x1fd658=()=>{if(!_0x5a8021['isOpen'])return;_0x3ac664['items']['last']['isVisible']=Boolean(_0x3f29ca['last']['model']['isOn']);};_0x1fd658(),_0x5a8021['on']('change:isOpen',()=>{_0x1fd658();});}},_=class extends _0x4ef410{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.3.0-alpha.
|
|
3
|
+
"version": "48.3.0-alpha.6",
|
|
4
4
|
"description": "Line height feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (https://cksource.com/)",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"dist/translations/*.umd.js"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ckeditor/ckeditor5-core": "48.3.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-engine": "48.3.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-list": "48.3.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.
|
|
28
|
+
"@ckeditor/ckeditor5-core": "48.3.0-alpha.6",
|
|
29
|
+
"@ckeditor/ckeditor5-engine": "48.3.0-alpha.6",
|
|
30
|
+
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.6",
|
|
31
|
+
"@ckeditor/ckeditor5-list": "48.3.0-alpha.6",
|
|
32
|
+
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.6",
|
|
33
|
+
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.6"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"dist",
|