@ckeditor/ckeditor5-line-height 48.4.0-alpha.4 → 48.4.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.
- 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 _0x36089f,Plugin as _0x3289f4}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x8e2518,Collection as _0x29f1d8,first as _0x4f419c,uid as _0x1bc464}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x36d70b,isPercentageStyleValue as _0x3dbc1d}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0xc93881,MenuBarMenuListItemView as _0x10ce97,MenuBarMenuListView as _0x4c4396,MenuBarMenuView as _0x4f8831,UIModel as _0x4cb159,addListToDropdown as _0x3ffe32,createDropdown as _0x53dabc}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x189a01}from'@ckeditor/ckeditor5-icons';var p=class extends _0x36089f{['refresh'](){const _0x204faa=this['editor']['model']['document'],_0x384399=_0x4f419c(_0x204faa['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x384399)&&this['_canHaveLineHeight'](_0x384399),this['value']=this['isEnabled']&&_0x384399['getAttribute']('lineHeight');}execute(_0x3f1520={}){const _0x30c126=this['editor']['model'],_0x47c394=_0x30c126['document']['selection'],_0x457838=_0x3f1520['value'];_0x30c126['change'](_0x2bf57b=>{const _0x576c9f=Array['from'](_0x47c394['getSelectedBlocks']())['filter'](_0x4c2726=>this['_canHaveLineHeight'](_0x4c2726));for(const _0x372da8 of _0x576c9f)_0x457838?_0x2bf57b['setAttribute']('lineHeight',_0x457838,_0x372da8):_0x2bf57b['removeAttribute']('lineHeight',_0x372da8);});}_canHaveLineHeight(_0x2d72f7){return this['editor']['model']['schema']['checkAttribute'](_0x2d72f7,'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(_0x5b911d){return'string'==typeof _0x5b911d&&'default'===_0x5b911d['toLowerCase']();}function L(_0x360ea9){return _0x360ea9['options']['map'](_0x18a8ef=>{return H(_0x18a8ef)?{'title':String(_0x360ea9['defaultValue']),'model':'default'}:('number'==typeof _0x18a8ef&&(_0x18a8ef=String(_0x18a8ef)),'string'!=typeof _0x18a8ef?_0x18a8ef:parseFloat(_0x18a8ef)?{'title':_0x18a8ef,'model':_0x18a8ef,'view':{'name':'span','styles':{'line-height':_0x18a8ef}}}:'string'==typeof(_0x3901a9=_0x18a8ef)?y[_0x3901a9]:y[_0x3901a9['model']]);var _0x3901a9;})['filter'](_0x42730a=>void 0x0!==_0x42730a);}var v=class extends _0x3289f4{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x3b96d0,conversion:_0x3a2035}=this['editor'];_0x3b96d0['has']('ListEditing')&&_0x3b96d0['has']('TodoListEditing')&&(_0x3b96d0['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x3afabf,_0x5d65b5,_0x33b8fa,_0x2a019f,_0x577caf){'todo'==_0x577caf['getAttribute']('listType')&&_0x5d65b5&&(_0x3afabf['addClass']('ck-list-marker-line-height',_0x33b8fa),_0x3afabf['setStyle']('--ck-content-list-marker-line-height',_0x5d65b5,_0x33b8fa));}}),_0x3a2035['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x3a2035['for']('upcast')['add'](_0x592a1b=>{_0x592a1b['on']('element:li',function(_0x7ae085){const _0x1df42b=new _0x36d70b(_0x7ae085);return(_0x5c29c2,_0x229d2f,_0x2f3593)=>{const _0x154a38=_0x1df42b['match'](_0x229d2f['viewItem']);if(!_0x154a38)return;const _0x421df8=_0x154a38['match'];_0x421df8['name']=!0x1,_0x2f3593['consumable']['consume'](_0x229d2f['viewItem'],_0x421df8);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x3289f4{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x22b868){super(_0x22b868),_0x22b868['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x1b3ab7=this['editor'];this['_validateConfig'](),_0x1b3ab7['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x1b3ab7['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x1b3ab7['commands']['add']('lineHeight',new p(_0x1b3ab7)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x515fb2){const _0x1c8290='PHQ3YUIBrl0XdnwG9kez8sfpMv1ytWFRNZOV5jJaq7Tc2ogub64xCKDEALSihm',_0x4ef69a=0x79188,_0x2847ea=window['Date']['now'](),_0x415b5d=_0x515fb2['editor'],_0x37cfc9=new window['Promise'](_0xf0ae1f=>{_0x415b5d['once']('ready',_0xf0ae1f);}),_0x566aca={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x30f984=_0x415b5d['config']['get']('licenseKey');async function _0x54141f(){let _0x2f1b6f,_0x20683e=null,_0x4e386d=null;try{return'GPL'==_0x30f984?'NotAllowed':(_0x2f1b6f=_0xd1bcbd(),_0x2f1b6f?(_0x2f1b6f['usageEndpoint']&&(_0x4e386d=_0x3dc70d(_0x2f1b6f['usageEndpoint'],_0x2f1b6f['jti'])),await _0x247da3()?_0x2279ef()?_0x51f885()?'Expired':_0x13ceb8()?('evaluation'==_0x2f1b6f['licenseType']&&(_0x20683e=_0x58fe7c('EvaluationLimit')),await _0x538197()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x51f885(){const _0x3dcb2b=['evaluation','trial']['includes'](_0x2f1b6f['licenseType'])?_0x2847ea/0x3e8:0xe10*_0x4ef69a;return _0x2f1b6f['exp']<_0x3dcb2b;}function _0x2279ef(){const _0x38295f=_0x2f1b6f['features'];return!!_0x38295f&&(!!_0x38295f['includes']('*')||!!_0x38295f['includes']('LH'));}function _0x13ceb8(){const _0x4701c7=_0x2f1b6f['licensedHosts'];if(!_0x4701c7||0x0==_0x4701c7['length'])return!0x0;const {hostname:_0x2bbe12}=new URL(window['location']['href']);if(_0x4701c7['includes'](_0x2bbe12))return!0x0;const _0x4c6ee6=_0x2bbe12['split']('.');return _0x4701c7['filter'](_0xcc4a45=>_0xcc4a45['includes']('*'))['map'](_0x49b98a=>_0x49b98a['split']('.'))['filter'](_0x55abcd=>_0x55abcd['length']<=_0x4c6ee6['length'])['map'](_0x1bf343=>Array(_0x4c6ee6['length']-_0x1bf343['length'])['fill']('*'===_0x1bf343[0x0]?'*':'')['concat'](_0x1bf343))['some'](_0x35c717=>_0x4c6ee6['every']((_0x32419e,_0x3d2a30)=>_0x35c717[_0x3d2a30]===_0x32419e||'*'===_0x35c717[_0x3d2a30]));}function _0x538197(){return _0x20683e&&_0x4e386d?new window['Promise']((_0x4ac419,_0x33d581)=>{_0x20683e['then'](_0x4ac419,_0x33d581),_0x4e386d['then'](_0x222b11=>{'Valid'!=_0x222b11&&_0x4ac419(_0x222b11);},_0x33d581);}):_0x20683e||_0x4e386d||'Valid';}}function _0x3dc70d(_0x2900b0,_0x5cd183){return new window['Promise'](_0x2e05b8=>{if(_0x1798ce())return _0x2e05b8('Valid');_0x4c9443(),_0x415b5d['decorate']('_sendUsageRequest');let _0x37372c=!0x1;const _0x22f852=_0x1bc464();function _0x1ede53(_0x3b26f0){return!!_0x3b26f0&&('object'==typeof _0x3b26f0||'function'==typeof _0x3b26f0)&&'function'==typeof _0x3b26f0['then']&&'function'==typeof _0x3b26f0['catch'];}function _0x4bb109(_0x102b9f){_0x43488d(_0x102b9f)['then'](_0x3f88ad=>_0x3f88ad&&'ok'==_0x3f88ad['status']?_0x599556(_0x378086(_0x22f852+_0x5cd183))!=_0x3f88ad['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3b3f4d=>(_0xb9c1e9(),_0x3b3f4d),()=>{const _0x33bad6=_0x2fdb4e();return null==_0x33bad6?(_0xb9c1e9(),'Valid'):_0x2847ea-_0x33bad6>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2e05b8)['catch'](()=>{_0x2e05b8('UsageLimit');});const _0x190b71=0x36ee80;function _0xb9c1e9(){const _0x43b4c7='llct-'+_0x599556(_0x378086(_0x2900b0)),_0x40a534=_0x23448b(_0x599556(window['Math']['ceil'](_0x2847ea/_0x190b71)));window['localStorage']['setItem'](_0x43b4c7,_0x40a534);}function _0x2fdb4e(){const _0x2a6802='llct-'+_0x599556(_0x378086(_0x2900b0)),_0x3b7ac9=window['localStorage']['getItem'](_0x2a6802);return _0x3b7ac9?window['parseInt'](_0x23448b(_0x3b7ac9),0x10)*_0x190b71:null;}function _0x43488d(_0x3689bc){return new window['Promise']((_0xf7f64b,_0x142e23)=>{_0x3689bc['then'](_0xf7f64b,_0x142e23),window['setTimeout'](_0x142e23,0x1d4c0);});}}_0x415b5d['on']('_sendUsageRequest',(_0x289bce,_0x8df45c)=>{if(_0x8df45c[0x0]!=_0x2900b0)return _0x2e05b8('UsageLimit');_0x8df45c[0x1]={..._0x8df45c[0x1],'requestId':_0x22f852};},{'priority':'high'}),_0x415b5d['on']('_sendUsageRequest',_0x45974e=>{_0x1ede53(_0x45974e['return'])&&(_0x37372c=!0x0,_0x4bb109(_0x45974e['return']));},{'priority':'low'}),_0x37cfc9['then'](()=>{_0x37372c||_0x2e05b8('UsageLimit');});});function _0x1798ce(){return'auto'==_0x415b5d['editing']['view']['_overlayModeHint'];}function _0x4c9443(){_0x415b5d['editing']['view']['_overlayModeHint']='auto';}}function _0x58fe7c(_0x619ae8){const _0x296d68=[new window['Promise'](_0x31dd69=>setTimeout(_0x31dd69,0x93ecc)),_0x37cfc9['then'](()=>new window['Promise'](_0x1775f8=>{let _0x79801=0x0;_0x415b5d['model']['on']('applyOperation',(_0x4a5966,_0x26de3c)=>{_0x26de3c[0x0]['isDocumentOperation']&&_0x79801++,0x5e8==_0x79801&&(_0x1775f8(),_0x4a5966['off']());});}))];return window['Promise']['race'](_0x296d68)['then'](()=>_0x619ae8);}async function _0x45e317(){await _0x37cfc9,_0x415b5d['model']['change']=_0x36827b,_0x415b5d['model']['enqueueChange']=_0x36827b,_0x415b5d['enableReadOnlyMode']('model');}function _0x3d6a2e(_0x3907b){const _0x2875f4=_0x4810ba();_0x415b5d[_0x2875f4]='lineHeightLicenseKey'+_0x3907b,'Valid'!=_0x3907b&&_0x45e317();}function _0x4810ba(){const _0x228d02=window['String'](window['performance']['now']())['replace']('.','');let _0xba0b1d='P';for(let _0x540575=0x0;_0x540575<_0x228d02['length'];_0x540575+=0x2){let _0x42eb2b=window['parseInt'](_0x228d02['substring'](_0x540575,_0x540575+0x2));_0x42eb2b>=0x3e&&(_0x42eb2b-=0x3e),_0xba0b1d+=_0x1c8290[_0x42eb2b];}return _0xba0b1d;}function _0xd1bcbd(){const _0xb9ca82=_0x30f984['split']('.');if(0x3!=_0xb9ca82['length'])return null;return _0x3be2ee(_0xb9ca82[0x1]);function _0x3be2ee(_0x559770){const _0x4db621=_0x461e30(_0x559770);return _0x4db621&&_0x46029a()?_0x4db621:null;function _0x46029a(){const _0x512726=_0x4db621['jti'],_0x27a541=window['parseInt'](_0x512726['substring'](_0x512726['length']-0x8),0x10),_0x2e8f7d={..._0x4db621,'jti':_0x512726['substring'](0x0,_0x512726['length']-0x8)};return delete _0x2e8f7d['vc'],_0x378086(_0x2e8f7d)==_0x27a541;}}}async function _0x247da3(){let _0xc17f63=!0x0;try{const [_0x50af14,_0x38fbb5,_0x5dcbfc]=_0x30f984['split']('.');return _0x51280c(_0x50af14),await _0x3b0160(_0x50af14,_0x38fbb5,_0x5dcbfc),_0xc17f63;}catch{return!0x1;}function _0x51280c(_0x1c1905){const _0xe8f306=_0x461e30(_0x1c1905);_0xe8f306&&'ES256'==_0xe8f306['alg']||(_0xc17f63=!0x1);}async function _0x3b0160(_0x2112ac,_0x12d349,_0x514fd2){const _0x13396=window['Uint8Array']['from'](_0x5e55e0(_0x514fd2),_0x9003a3=>_0x9003a3['charCodeAt'](0x0)),_0x6e9a79=new window['TextEncoder']()['encode'](_0x2112ac+'.'+_0x12d349),_0x46a350=window['crypto']['subtle'];if(!_0x46a350)return;const _0xe2998e=await _0x46a350['importKey']('jwk',_0x566aca,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x46a350['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0xe2998e,_0x13396,_0x6e9a79)||(_0xc17f63=!0x1);}}function _0x461e30(_0x3c02c9){return _0x3c02c9['startsWith']('ey')?JSON['parse'](_0x5e55e0(_0x3c02c9)):null;}function _0x5e55e0(_0xec8c4f){return window['atob'](_0xec8c4f['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x378086(_0x288c39){let _0x5ad22e=0x1505;function _0x15b83c(_0x472a92){for(let _0x408522=0x0;_0x408522<_0x472a92['length'];_0x408522++){const _0x3fc54e=_0x472a92['charCodeAt'](_0x408522);_0x5ad22e=(_0x5ad22e<<0x5)+_0x5ad22e+_0x3fc54e,_0x5ad22e&=_0x5ad22e;}}function _0xd6e3c1(_0x158321){Array['isArray'](_0x158321)?_0x158321['forEach'](_0xd6e3c1):_0x158321&&'object'==typeof _0x158321?Object['entries'](_0x158321)['sort']()['forEach'](([_0x5870f,_0x2cb595])=>{_0x15b83c(_0x5870f),_0xd6e3c1(_0x2cb595);}):_0x15b83c(window['String'](_0x158321));}return _0xd6e3c1(_0x288c39),_0x5ad22e>>>0x0;}function _0x599556(_0x13e380){return _0x13e380['toString'](0x10)['padStart'](0x8,'0');}function _0x23448b(_0x50f593){return _0x50f593['split']('')['reverse']()['join']('');}function _0x36827b(){}_0x3d6a2e(await _0x54141f());}(this);}_validateConfig(){const _0x181f3d=this['editor'];if(!_0x181f3d['config']['get']('lineHeight.supportAllValues'))return;const _0xbc3793=_0x181f3d['config']['get']('lineHeight.options')['filter'](_0x2b7a25=>'string'==typeof _0x2b7a25&&(!H(_0x2b7a25)&&isNaN(Number(_0x2b7a25))));if(_0xbc3793['length'])throw new _0x8e2518('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0xbc3793});}_prepareAnyValueConverters(){const _0x516728=this['editor'],_0x21e225=this['editor']['config']['get']('lineHeight.defaultValue');_0x516728['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x198d10=>String(_0x198d10)===String(_0x21e225)?null:{'key':'style','value':{'line-height':_0x198d10}}}),_0x516728['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x50409f=>{let _0x57fb4d=_0x50409f['getStyle']('line-height');return _0x3dbc1d(_0x57fb4d)&&(_0x57fb4d=String(Number(_0x57fb4d['slice'](0x0,-0x1))/0x64)),String(_0x57fb4d)===String(_0x21e225)?null:_0x57fb4d;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x502bbd=this['editor'],_0x21dc0b=this['editor']['config']['get']('lineHeight.defaultValue'),_0x40d1a9=function(_0x3e80c0,_0x4ae137){const _0x57a0ab={'model':{'key':_0x3e80c0,'values':[]},'view':{}};for(const _0x21251e of _0x4ae137)'class'===_0x21251e['view']?.['key']?(_0x57a0ab['model']['values']['push'](_0x21251e['model']),_0x57a0ab['view'][_0x21251e['model']]={'key':'class','value':_0x21251e['view']['value']}):(_0x57a0ab['model']['values']['push'](_0x21251e['model']),_0x57a0ab['view'][_0x21251e['model']]={'key':'style','value':'line-height:'+_0x21251e['model']+';'});return _0x57a0ab;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x309829=>_0x309829['model']));_0x502bbd['conversion']['attributeToAttribute'](_0x40d1a9),_0x502bbd['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x2b10f8=>{let _0x5b59e1=_0x2b10f8['getStyle']('line-height');return _0x3dbc1d(_0x5b59e1)&&(_0x5b59e1=String(Number(_0x5b59e1['slice'](0x0,-0x1))/0x64)),_0x5b59e1===String(_0x21dc0b)?null:_0x40d1a9['model']['values']['includes'](_0x5b59e1)?_0x5b59e1:null;}}});}},k=class extends _0x3289f4{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x37b048={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x37b048),this['_registerMenuBarComponent'](_0x37b048),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3e4729=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x31f760;for(const _0x12e177 in _0x3e4729){const _0x41f133=_0x12e177,_0x235ca1=_0x3e4729[_0x41f133];if('lineHeightLicenseKeyValid'==_0x235ca1||'lineHeightLicenseKeyInvalid'==_0x235ca1||'lineHeightLicenseKeyExpired'==_0x235ca1||'lineHeightLicenseKeyDomainLimit'==_0x235ca1||'lineHeightLicenseKeyNotAllowed'==_0x235ca1||'lineHeightLicenseKeyEvaluationLimit'==_0x235ca1||'lineHeightLicenseKeyUsageLimit'==_0x235ca1){delete _0x3e4729[_0x41f133],_0x31f760=_0x235ca1,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x31f760&&_0x3e4729['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x31f760&&_0x3e4729['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x31f760&&_0x3e4729['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x31f760&&_0x3e4729['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x31f760&&_0x3e4729['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x31f760&&_0x3e4729['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x294584=this['editor'],t=_0x294584['t'],_0x5ba025=_0x294584['config']['get']('lineHeight'),_0x548e2a={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x5ba025)['map'](_0x41ca4c=>{const _0xf5933f=_0x548e2a[_0x41ca4c['title']];return _0xf5933f&&_0xf5933f!=_0x41ca4c['title']&&(_0x41ca4c=Object['assign']({},_0x41ca4c,{'title':_0xf5933f})),_0x41ca4c;});}_prepareListOptions(){const _0x5a10e5=this['editor']['commands']['get']('lineHeight'),_0x430813=this['editor']['config']['get']('lineHeight.defaultValue'),_0x1e5089=this['_getLocalizedLineHeightOptions'](),_0x92989e=new _0x29f1d8(),_0x1d65ff=_0x39dc36=>'default'===_0x39dc36||String(_0x430813)===_0x39dc36;for(const _0x485f4a of _0x1e5089){const _0x155679={'type':'button','model':new _0x4cb159({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x485f4a['title'],'withText':!0x0})};_0x1d65ff(_0x485f4a['model'])?(_0x155679['model']['bind']('isOn')['to'](_0x5a10e5,'value',_0x4516c6=>!_0x4516c6),_0x155679['model']['commandParam']=void 0x0):(_0x155679['model']['bind']('isOn')['to'](_0x5a10e5,'value',_0x40fbec=>_0x40fbec===_0x485f4a['model']),_0x155679['model']['commandParam']=_0x485f4a['model']),_0x92989e['add'](_0x155679);}if(this['_shouldRenderCustomValueOption']()){const _0x334ffc=this['_getCustomValueOptionDefinition'](_0x1e5089);_0x92989e['add'](_0x334ffc);}return _0x92989e;}_getCustomValueOptionDefinition(_0x3d742e){const _0x5cee2c=this['editor'],t=_0x5cee2c['t'],_0x32151a=_0x5cee2c['commands']['get']('lineHeight'),_0x322cfd=_0x3d742e['map'](_0x14f819=>_0x14f819['model']),_0x16a01e={'type':'button','model':new _0x4cb159({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x16a01e['model']['bind']('commandParam')['to'](_0x32151a,'value'),_0x16a01e['model']['bind']('isOn')['to'](_0x32151a,'value',_0x1dcb6a=>!!_0x1dcb6a&&!_0x322cfd['includes'](String(_0x1dcb6a))),_0x16a01e['model']['bind']('label')['to'](_0x32151a,'value',_0x108c3e=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x108c3e))),_0x16a01e;}_registerToolbarComponent({accessibleLabel:_0x102a13,options:_0x4cc61f}){const _0x599764=this['editor'],_0x268097=_0x599764['commands']['get']('lineHeight');_0x599764['ui']['componentFactory']['add']('lineHeight',_0xb1aad9=>{const _0x3dc077=_0x53dabc(_0xb1aad9);return _0x3ffe32(_0x3dc077,_0x4cc61f,{'role':'menu','ariaLabel':_0x102a13}),_0x3dc077['buttonView']['set']({'label':_0x102a13,'tooltip':!0x0,'icon':_0x189a01}),_0x3dc077['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x3dc077['bind']('isEnabled')['to'](_0x268097),this['listenTo'](_0x3dc077,'execute',_0x5ea2f3=>{_0x599764['execute'](_0x5ea2f3['source']['commandName'],{'value':_0x5ea2f3['source']['commandParam']}),_0x599764['editing']['view']['focus']();}),_0x3dc077['once']('change:isOpen',()=>{const _0x1bffcb=_0x3dc077['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x3dc077,_0x4cc61f,_0x1bffcb);}),_0x3dc077;});}_registerMenuBarComponent({accessibleLabel:_0x43512e,options:_0x304eaf}){const _0x432081=this['editor'],_0xd5dca5=_0x432081['commands']['get']('lineHeight');_0x432081['ui']['componentFactory']['add']('menuBar:lineHeight',_0x55315b=>{const _0xe5ee2e=new _0x4f8831(_0x55315b);_0xe5ee2e['buttonView']['set']({'label':_0x43512e,'icon':_0x189a01}),_0xe5ee2e['bind']('isEnabled')['to'](_0xd5dca5);const _0x56abc9=new _0x4c4396(_0x55315b);for(const _0x593646 of _0x304eaf){const _0x5578cc=new _0x10ce97(_0x55315b,_0xe5ee2e),_0x121bf5=new _0xc93881(_0x55315b);_0x121bf5['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x121bf5['bind'](...Object['keys'](_0x593646['model']))['to'](_0x593646['model']),_0x121bf5['delegate']('execute')['to'](_0xe5ee2e),_0x121bf5['on']('execute',()=>{_0x432081['execute'](_0x593646['model']['commandName'],{'value':_0x593646['model']['commandParam']}),_0x432081['editing']['view']['focus']();}),_0x5578cc['children']['add'](_0x121bf5),_0x56abc9['items']['add'](_0x5578cc);}return _0xe5ee2e['panelView']['children']['add'](_0x56abc9),this['_attachCustomOptionVisibilityHandler'](_0xe5ee2e,_0x304eaf,_0x56abc9),_0xe5ee2e;});}_attachCustomOptionVisibilityHandler(_0x384170,_0x8c8c4e,_0x2e41c8){if(!this['_shouldRenderCustomValueOption']())return;const _0x31381b=()=>{if(!_0x384170['isOpen'])return;_0x2e41c8['items']['last']['isVisible']=Boolean(_0x8c8c4e['last']['model']['isOn']);};_0x31381b(),_0x384170['on']('change:isOpen',()=>{_0x31381b();});}},_=class extends _0x3289f4{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 _0x530fd8,Plugin as _0x397bd7}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x42294a,Collection as _0x1a32a5,first as _0x29b3db,uid as _0x1842e5}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x324cd8,isPercentageStyleValue as _0x5a2c65}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x38b0e5,MenuBarMenuListItemView as _0xc1888d,MenuBarMenuListView as _0x41d20b,MenuBarMenuView as _0x11d41d,UIModel as _0x1dfdc4,addListToDropdown as _0x23a818,createDropdown as _0x356588}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0xa4349}from'@ckeditor/ckeditor5-icons';var p=class extends _0x530fd8{['refresh'](){const _0x4512ae=this['editor']['model']['document'],_0x187a8a=_0x29b3db(_0x4512ae['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x187a8a)&&this['_canHaveLineHeight'](_0x187a8a),this['value']=this['isEnabled']&&_0x187a8a['getAttribute']('lineHeight');}execute(_0x3a5db4={}){const _0x5c4c40=this['editor']['model'],_0x31a801=_0x5c4c40['document']['selection'],_0x179f88=_0x3a5db4['value'];_0x5c4c40['change'](_0x1ebfe6=>{const _0x3b0364=Array['from'](_0x31a801['getSelectedBlocks']())['filter'](_0x3620f2=>this['_canHaveLineHeight'](_0x3620f2));for(const _0x4d66e3 of _0x3b0364)_0x179f88?_0x1ebfe6['setAttribute']('lineHeight',_0x179f88,_0x4d66e3):_0x1ebfe6['removeAttribute']('lineHeight',_0x4d66e3);});}_canHaveLineHeight(_0x2156e4){return this['editor']['model']['schema']['checkAttribute'](_0x2156e4,'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(_0x27e0c3){return'string'==typeof _0x27e0c3&&'default'===_0x27e0c3['toLowerCase']();}function L(_0x3636c4){return _0x3636c4['options']['map'](_0x5ee533=>{return H(_0x5ee533)?{'title':String(_0x3636c4['defaultValue']),'model':'default'}:('number'==typeof _0x5ee533&&(_0x5ee533=String(_0x5ee533)),'string'!=typeof _0x5ee533?_0x5ee533:parseFloat(_0x5ee533)?{'title':_0x5ee533,'model':_0x5ee533,'view':{'name':'span','styles':{'line-height':_0x5ee533}}}:'string'==typeof(_0x58ecac=_0x5ee533)?y[_0x58ecac]:y[_0x58ecac['model']]);var _0x58ecac;})['filter'](_0x395550=>void 0x0!==_0x395550);}var v=class extends _0x397bd7{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0xed73ee,conversion:_0x1ef431}=this['editor'];_0xed73ee['has']('ListEditing')&&_0xed73ee['has']('TodoListEditing')&&(_0xed73ee['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x4c1f6f,_0x1820d8,_0x259079,_0x5682cf,_0x175eb8){'todo'==_0x175eb8['getAttribute']('listType')&&_0x1820d8&&(_0x4c1f6f['addClass']('ck-list-marker-line-height',_0x259079),_0x4c1f6f['setStyle']('--ck-content-list-marker-line-height',_0x1820d8,_0x259079));}}),_0x1ef431['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x1ef431['for']('upcast')['add'](_0x58ba59=>{_0x58ba59['on']('element:li',function(_0x545d78){const _0x28b0b9=new _0x324cd8(_0x545d78);return(_0x3067e7,_0x5f45aa,_0x5cdc86)=>{const _0xb62545=_0x28b0b9['match'](_0x5f45aa['viewItem']);if(!_0xb62545)return;const _0x46b97a=_0xb62545['match'];_0x46b97a['name']=!0x1,_0x5cdc86['consumable']['consume'](_0x5f45aa['viewItem'],_0x46b97a);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x397bd7{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x43aef1){super(_0x43aef1),_0x43aef1['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x51d45d=this['editor'];this['_validateConfig'](),_0x51d45d['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x51d45d['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x51d45d['commands']['add']('lineHeight',new p(_0x51d45d)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x291573){const _0x21b732='PHQ3YUIBrl0XdnwG9kez8sfpMv1ytWFRNZOV5jJaq7Tc2ogub64xCKDEALSihm',_0x600d5f=0x791a0,_0xcf55b1=window['Date']['now'](),_0x29b936=_0x291573['editor'],_0x59d1f7=new window['Promise'](_0x7b8704=>{_0x29b936['once']('ready',_0x7b8704);}),_0xfe54bb={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x2bdf47=_0x29b936['config']['get']('licenseKey');async function _0x1d22c8(){let _0x3a1881,_0x83a14d=null,_0x1bcaa4=null;try{return'GPL'==_0x2bdf47?'NotAllowed':(_0x3a1881=_0x49685c(),_0x3a1881?(_0x3a1881['usageEndpoint']&&(_0x1bcaa4=_0x16f14(_0x3a1881['usageEndpoint'],_0x3a1881['jti'])),await _0x5c07cb()?_0x14c203()?_0x545004()?'Expired':_0x19bb10()?('evaluation'==_0x3a1881['licenseType']&&(_0x83a14d=_0x3a4127('EvaluationLimit')),await _0x1b9672()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x545004(){const _0x2e3fb3=['evaluation','trial']['includes'](_0x3a1881['licenseType'])?_0xcf55b1/0x3e8:0xe10*_0x600d5f;return _0x3a1881['exp']<_0x2e3fb3;}function _0x14c203(){const _0x43591b=_0x3a1881['features'];return!!_0x43591b&&(!!_0x43591b['includes']('*')||!!_0x43591b['includes']('LH'));}function _0x19bb10(){const _0x159924=_0x3a1881['licensedHosts'];if(!_0x159924||0x0==_0x159924['length'])return!0x0;const {hostname:_0x5105ae}=new URL(window['location']['href']);if(_0x159924['includes'](_0x5105ae))return!0x0;const _0x42e0e2=_0x5105ae['split']('.');return _0x159924['filter'](_0x43aa86=>_0x43aa86['includes']('*'))['map'](_0x2672f5=>_0x2672f5['split']('.'))['filter'](_0x22aa2f=>_0x22aa2f['length']<=_0x42e0e2['length'])['map'](_0x5a051f=>Array(_0x42e0e2['length']-_0x5a051f['length'])['fill']('*'===_0x5a051f[0x0]?'*':'')['concat'](_0x5a051f))['some'](_0x462396=>_0x42e0e2['every']((_0x24168a,_0x5d69d6)=>_0x462396[_0x5d69d6]===_0x24168a||'*'===_0x462396[_0x5d69d6]));}function _0x1b9672(){return _0x83a14d&&_0x1bcaa4?new window['Promise']((_0xe69d19,_0xe25292)=>{_0x83a14d['then'](_0xe69d19,_0xe25292),_0x1bcaa4['then'](_0x4958c0=>{'Valid'!=_0x4958c0&&_0xe69d19(_0x4958c0);},_0xe25292);}):_0x83a14d||_0x1bcaa4||'Valid';}}function _0x16f14(_0x47dca9,_0x4c2090){return new window['Promise'](_0x5ead02=>{if(_0x304080())return _0x5ead02('Valid');_0x30c35e(),_0x29b936['decorate']('_sendUsageRequest');let _0x1b19f7=!0x1;const _0x3516c7=_0x1842e5();function _0x2de2fc(_0x526b22){return!!_0x526b22&&('object'==typeof _0x526b22||'function'==typeof _0x526b22)&&'function'==typeof _0x526b22['then']&&'function'==typeof _0x526b22['catch'];}function _0xbf0013(_0x117e44){_0x36a7ca(_0x117e44)['then'](_0x3d6092=>_0x3d6092&&'ok'==_0x3d6092['status']?_0x319353(_0x2111eb(_0x3516c7+_0x4c2090))!=_0x3d6092['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x505670=>(_0x33527f(),_0x505670),()=>{const _0x89238e=_0x597cb7();return null==_0x89238e?(_0x33527f(),'Valid'):_0xcf55b1-_0x89238e>0x240c8400?'UsageLimit':'Valid';})['then'](_0x5ead02)['catch'](()=>{_0x5ead02('UsageLimit');});const _0x36243e=0x36ee80;function _0x33527f(){const _0x4f3a38='llct-'+_0x319353(_0x2111eb(_0x47dca9)),_0x2d3b61=_0x2cc547(_0x319353(window['Math']['ceil'](_0xcf55b1/_0x36243e)));window['localStorage']['setItem'](_0x4f3a38,_0x2d3b61);}function _0x597cb7(){const _0x3efeb9='llct-'+_0x319353(_0x2111eb(_0x47dca9)),_0x3773d3=window['localStorage']['getItem'](_0x3efeb9);return _0x3773d3?window['parseInt'](_0x2cc547(_0x3773d3),0x10)*_0x36243e:null;}function _0x36a7ca(_0x2c4b14){return new window['Promise']((_0x5a055c,_0x4953d9)=>{_0x2c4b14['then'](_0x5a055c,_0x4953d9),window['setTimeout'](_0x4953d9,0x1d4c0);});}}_0x29b936['on']('_sendUsageRequest',(_0x3918b5,_0xb2d2e5)=>{if(_0xb2d2e5[0x0]!=_0x47dca9)return _0x5ead02('UsageLimit');_0xb2d2e5[0x1]={..._0xb2d2e5[0x1],'requestId':_0x3516c7};},{'priority':'high'}),_0x29b936['on']('_sendUsageRequest',_0x497493=>{_0x2de2fc(_0x497493['return'])&&(_0x1b19f7=!0x0,_0xbf0013(_0x497493['return']));},{'priority':'low'}),_0x59d1f7['then'](()=>{_0x1b19f7||_0x5ead02('UsageLimit');});});function _0x304080(){return'auto'==_0x29b936['editing']['view']['_overlayModeHint'];}function _0x30c35e(){_0x29b936['editing']['view']['_overlayModeHint']='auto';}}function _0x3a4127(_0x244f02){const _0x15ad58=[new window['Promise'](_0x508b5f=>setTimeout(_0x508b5f,0x93ecc)),_0x59d1f7['then'](()=>new window['Promise'](_0x1724a1=>{let _0xd76692=0x0;_0x29b936['model']['on']('applyOperation',(_0xaa62ae,_0x162578)=>{_0x162578[0x0]['isDocumentOperation']&&_0xd76692++,0x5e8==_0xd76692&&(_0x1724a1(),_0xaa62ae['off']());});}))];return window['Promise']['race'](_0x15ad58)['then'](()=>_0x244f02);}async function _0x2cc17b(){await _0x59d1f7,_0x29b936['model']['change']=_0x198908,_0x29b936['model']['enqueueChange']=_0x198908,_0x29b936['enableReadOnlyMode']('model');}function _0xe67b3(_0x3f2e9d){const _0x148a16=_0x5c26c7();_0x29b936[_0x148a16]='lineHeightLicenseKey'+_0x3f2e9d,'Valid'!=_0x3f2e9d&&_0x2cc17b();}function _0x5c26c7(){const _0xec7b35=window['String'](window['performance']['now']())['replace']('.','');let _0x282c58='P';for(let _0x28ea6f=0x0;_0x28ea6f<_0xec7b35['length'];_0x28ea6f+=0x2){let _0xa689a3=window['parseInt'](_0xec7b35['substring'](_0x28ea6f,_0x28ea6f+0x2));_0xa689a3>=0x3e&&(_0xa689a3-=0x3e),_0x282c58+=_0x21b732[_0xa689a3];}return _0x282c58;}function _0x49685c(){const _0x1e401f=_0x2bdf47['split']('.');if(0x3!=_0x1e401f['length'])return null;return _0x524925(_0x1e401f[0x1]);function _0x524925(_0x975ba1){const _0x978a8b=_0x42e403(_0x975ba1);return _0x978a8b&&_0x4a697d()?_0x978a8b:null;function _0x4a697d(){const _0xf7a188=_0x978a8b['jti'],_0x480e6a=window['parseInt'](_0xf7a188['substring'](_0xf7a188['length']-0x8),0x10),_0x51c2f2={..._0x978a8b,'jti':_0xf7a188['substring'](0x0,_0xf7a188['length']-0x8)};return delete _0x51c2f2['vc'],_0x2111eb(_0x51c2f2)==_0x480e6a;}}}async function _0x5c07cb(){let _0x319829=!0x0;try{const [_0x1d2a71,_0x4ca2f0,_0x302639]=_0x2bdf47['split']('.');return _0x4a172d(_0x1d2a71),await _0x46764b(_0x1d2a71,_0x4ca2f0,_0x302639),_0x319829;}catch{return!0x1;}function _0x4a172d(_0xb16bae){const _0x2ff68c=_0x42e403(_0xb16bae);_0x2ff68c&&'ES256'==_0x2ff68c['alg']||(_0x319829=!0x1);}async function _0x46764b(_0x3ceba5,_0x5675a1,_0x60a12e){const _0x531953=window['Uint8Array']['from'](_0x194bfb(_0x60a12e),_0x103054=>_0x103054['charCodeAt'](0x0)),_0x22d5e5=new window['TextEncoder']()['encode'](_0x3ceba5+'.'+_0x5675a1),_0x44dbcd=window['crypto']['subtle'];if(!_0x44dbcd)return;const _0x310e03=await _0x44dbcd['importKey']('jwk',_0xfe54bb,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x44dbcd['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x310e03,_0x531953,_0x22d5e5)||(_0x319829=!0x1);}}function _0x42e403(_0xba168b){return _0xba168b['startsWith']('ey')?JSON['parse'](_0x194bfb(_0xba168b)):null;}function _0x194bfb(_0x2688c7){return window['atob'](_0x2688c7['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2111eb(_0x24c6b6){let _0x12270d=0x1505;function _0x1c7b62(_0x50300d){for(let _0x21291e=0x0;_0x21291e<_0x50300d['length'];_0x21291e++){const _0xb723d7=_0x50300d['charCodeAt'](_0x21291e);_0x12270d=(_0x12270d<<0x5)+_0x12270d+_0xb723d7,_0x12270d&=_0x12270d;}}function _0x30fc1b(_0x1137d5){Array['isArray'](_0x1137d5)?_0x1137d5['forEach'](_0x30fc1b):_0x1137d5&&'object'==typeof _0x1137d5?Object['entries'](_0x1137d5)['sort']()['forEach'](([_0x105063,_0x4a4755])=>{_0x1c7b62(_0x105063),_0x30fc1b(_0x4a4755);}):_0x1c7b62(window['String'](_0x1137d5));}return _0x30fc1b(_0x24c6b6),_0x12270d>>>0x0;}function _0x319353(_0x4c6fec){return _0x4c6fec['toString'](0x10)['padStart'](0x8,'0');}function _0x2cc547(_0x2beccd){return _0x2beccd['split']('')['reverse']()['join']('');}function _0x198908(){}_0xe67b3(await _0x1d22c8());}(this);}_validateConfig(){const _0x325fd4=this['editor'];if(!_0x325fd4['config']['get']('lineHeight.supportAllValues'))return;const _0xf5eb7e=_0x325fd4['config']['get']('lineHeight.options')['filter'](_0xb84f2e=>'string'==typeof _0xb84f2e&&(!H(_0xb84f2e)&&isNaN(Number(_0xb84f2e))));if(_0xf5eb7e['length'])throw new _0x42294a('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0xf5eb7e});}_prepareAnyValueConverters(){const _0x28d495=this['editor'],_0x43f603=this['editor']['config']['get']('lineHeight.defaultValue');_0x28d495['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x39f772=>String(_0x39f772)===String(_0x43f603)?null:{'key':'style','value':{'line-height':_0x39f772}}}),_0x28d495['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x294ae2=>{let _0x58da23=_0x294ae2['getStyle']('line-height');return _0x5a2c65(_0x58da23)&&(_0x58da23=String(Number(_0x58da23['slice'](0x0,-0x1))/0x64)),String(_0x58da23)===String(_0x43f603)?null:_0x58da23;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x49e8ff=this['editor'],_0x4d96c5=this['editor']['config']['get']('lineHeight.defaultValue'),_0x2d109b=function(_0x14eee3,_0x3b4706){const _0x4c4219={'model':{'key':_0x14eee3,'values':[]},'view':{}};for(const _0x52e347 of _0x3b4706)'class'===_0x52e347['view']?.['key']?(_0x4c4219['model']['values']['push'](_0x52e347['model']),_0x4c4219['view'][_0x52e347['model']]={'key':'class','value':_0x52e347['view']['value']}):(_0x4c4219['model']['values']['push'](_0x52e347['model']),_0x4c4219['view'][_0x52e347['model']]={'key':'style','value':'line-height:'+_0x52e347['model']+';'});return _0x4c4219;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x53819f=>_0x53819f['model']));_0x49e8ff['conversion']['attributeToAttribute'](_0x2d109b),_0x49e8ff['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x56237e=>{let _0x20eac6=_0x56237e['getStyle']('line-height');return _0x5a2c65(_0x20eac6)&&(_0x20eac6=String(Number(_0x20eac6['slice'](0x0,-0x1))/0x64)),_0x20eac6===String(_0x4d96c5)?null:_0x2d109b['model']['values']['includes'](_0x20eac6)?_0x20eac6:null;}}});}},k=class extends _0x397bd7{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x4fe2bd={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x4fe2bd),this['_registerMenuBarComponent'](_0x4fe2bd),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4640ce=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1ad6d1;for(const _0x215f33 in _0x4640ce){const _0x4c80bc=_0x215f33,_0x47c74b=_0x4640ce[_0x4c80bc];if('lineHeightLicenseKeyValid'==_0x47c74b||'lineHeightLicenseKeyInvalid'==_0x47c74b||'lineHeightLicenseKeyExpired'==_0x47c74b||'lineHeightLicenseKeyDomainLimit'==_0x47c74b||'lineHeightLicenseKeyNotAllowed'==_0x47c74b||'lineHeightLicenseKeyEvaluationLimit'==_0x47c74b||'lineHeightLicenseKeyUsageLimit'==_0x47c74b){delete _0x4640ce[_0x4c80bc],_0x1ad6d1=_0x47c74b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x1ad6d1&&_0x4640ce['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x1ad6d1&&_0x4640ce['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x1ad6d1&&_0x4640ce['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x1ad6d1&&_0x4640ce['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x1ad6d1&&_0x4640ce['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x1ad6d1&&_0x4640ce['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x30c592=this['editor'],t=_0x30c592['t'],_0x21881d=_0x30c592['config']['get']('lineHeight'),_0x83cd47={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x21881d)['map'](_0x557fa7=>{const _0x588ec3=_0x83cd47[_0x557fa7['title']];return _0x588ec3&&_0x588ec3!=_0x557fa7['title']&&(_0x557fa7=Object['assign']({},_0x557fa7,{'title':_0x588ec3})),_0x557fa7;});}_prepareListOptions(){const _0x132645=this['editor']['commands']['get']('lineHeight'),_0x4a6a19=this['editor']['config']['get']('lineHeight.defaultValue'),_0x14fd78=this['_getLocalizedLineHeightOptions'](),_0x4209da=new _0x1a32a5(),_0x5a54a1=_0x3fcced=>'default'===_0x3fcced||String(_0x4a6a19)===_0x3fcced;for(const _0x5332a4 of _0x14fd78){const _0x53b244={'type':'button','model':new _0x1dfdc4({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x5332a4['title'],'withText':!0x0})};_0x5a54a1(_0x5332a4['model'])?(_0x53b244['model']['bind']('isOn')['to'](_0x132645,'value',_0x4beeab=>!_0x4beeab),_0x53b244['model']['commandParam']=void 0x0):(_0x53b244['model']['bind']('isOn')['to'](_0x132645,'value',_0x4b65a1=>_0x4b65a1===_0x5332a4['model']),_0x53b244['model']['commandParam']=_0x5332a4['model']),_0x4209da['add'](_0x53b244);}if(this['_shouldRenderCustomValueOption']()){const _0x276ac7=this['_getCustomValueOptionDefinition'](_0x14fd78);_0x4209da['add'](_0x276ac7);}return _0x4209da;}_getCustomValueOptionDefinition(_0x129db0){const _0x3b9c23=this['editor'],t=_0x3b9c23['t'],_0x5c251a=_0x3b9c23['commands']['get']('lineHeight'),_0x58895d=_0x129db0['map'](_0x4f9ccd=>_0x4f9ccd['model']),_0x221dad={'type':'button','model':new _0x1dfdc4({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x221dad['model']['bind']('commandParam')['to'](_0x5c251a,'value'),_0x221dad['model']['bind']('isOn')['to'](_0x5c251a,'value',_0x4f57f5=>!!_0x4f57f5&&!_0x58895d['includes'](String(_0x4f57f5))),_0x221dad['model']['bind']('label')['to'](_0x5c251a,'value',_0x17eaa6=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x17eaa6))),_0x221dad;}_registerToolbarComponent({accessibleLabel:_0x1dd581,options:_0x41a95a}){const _0x426848=this['editor'],_0x53bda1=_0x426848['commands']['get']('lineHeight');_0x426848['ui']['componentFactory']['add']('lineHeight',_0x3df10a=>{const _0x44d163=_0x356588(_0x3df10a);return _0x23a818(_0x44d163,_0x41a95a,{'role':'menu','ariaLabel':_0x1dd581}),_0x44d163['buttonView']['set']({'label':_0x1dd581,'tooltip':!0x0,'icon':_0xa4349}),_0x44d163['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x44d163['bind']('isEnabled')['to'](_0x53bda1),this['listenTo'](_0x44d163,'execute',_0x6b312b=>{_0x426848['execute'](_0x6b312b['source']['commandName'],{'value':_0x6b312b['source']['commandParam']}),_0x426848['editing']['view']['focus']();}),_0x44d163['once']('change:isOpen',()=>{const _0xfed95c=_0x44d163['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x44d163,_0x41a95a,_0xfed95c);}),_0x44d163;});}_registerMenuBarComponent({accessibleLabel:_0x21b3a6,options:_0x256184}){const _0x31deeb=this['editor'],_0x1437ff=_0x31deeb['commands']['get']('lineHeight');_0x31deeb['ui']['componentFactory']['add']('menuBar:lineHeight',_0x14c503=>{const _0x8127e2=new _0x11d41d(_0x14c503);_0x8127e2['buttonView']['set']({'label':_0x21b3a6,'icon':_0xa4349}),_0x8127e2['bind']('isEnabled')['to'](_0x1437ff);const _0x3a5940=new _0x41d20b(_0x14c503);for(const _0x35a37d of _0x256184){const _0x4261c8=new _0xc1888d(_0x14c503,_0x8127e2),_0x5e2b56=new _0x38b0e5(_0x14c503);_0x5e2b56['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x5e2b56['bind'](...Object['keys'](_0x35a37d['model']))['to'](_0x35a37d['model']),_0x5e2b56['delegate']('execute')['to'](_0x8127e2),_0x5e2b56['on']('execute',()=>{_0x31deeb['execute'](_0x35a37d['model']['commandName'],{'value':_0x35a37d['model']['commandParam']}),_0x31deeb['editing']['view']['focus']();}),_0x4261c8['children']['add'](_0x5e2b56),_0x3a5940['items']['add'](_0x4261c8);}return _0x8127e2['panelView']['children']['add'](_0x3a5940),this['_attachCustomOptionVisibilityHandler'](_0x8127e2,_0x256184,_0x3a5940),_0x8127e2;});}_attachCustomOptionVisibilityHandler(_0x292d07,_0x45ba75,_0x3fb8aa){if(!this['_shouldRenderCustomValueOption']())return;const _0x3de4eb=()=>{if(!_0x292d07['isOpen'])return;_0x3fb8aa['items']['last']['isVisible']=Boolean(_0x45ba75['last']['model']['isOn']);};_0x3de4eb(),_0x292d07['on']('change:isOpen',()=>{_0x3de4eb();});}},_=class extends _0x397bd7{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.4.0-alpha.
|
|
3
|
+
"version": "48.4.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": "48.4.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-engine": "48.4.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-list": "48.4.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.
|
|
34
|
-
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.
|
|
29
|
+
"@ckeditor/ckeditor5-core": "48.4.0-alpha.5",
|
|
30
|
+
"@ckeditor/ckeditor5-engine": "48.4.0-alpha.5",
|
|
31
|
+
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.5",
|
|
32
|
+
"@ckeditor/ckeditor5-list": "48.4.0-alpha.5",
|
|
33
|
+
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.5",
|
|
34
|
+
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.5"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist",
|