@ckeditor/ckeditor5-line-height 48.4.0-alpha.3 → 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 _0xa55bf,Plugin as _0x379618}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x45c777,Collection as _0x346707,first as _0xaf045f,uid as _0x6fddc5}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x589718,isPercentageStyleValue as _0x3da07c}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x558bac,MenuBarMenuListItemView as _0x519a60,MenuBarMenuListView as _0x1bb80c,MenuBarMenuView as _0x375d10,UIModel as _0x16f46b,addListToDropdown as _0x263501,createDropdown as _0x4d8efe}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x2ec5f1}from'@ckeditor/ckeditor5-icons';var p=class extends _0xa55bf{['refresh'](){const _0x352054=this['editor']['model']['document'],_0xbbd173=_0xaf045f(_0x352054['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0xbbd173)&&this['_canHaveLineHeight'](_0xbbd173),this['value']=this['isEnabled']&&_0xbbd173['getAttribute']('lineHeight');}execute(_0x251532={}){const _0x30b0e6=this['editor']['model'],_0xdadc39=_0x30b0e6['document']['selection'],_0x22e7e9=_0x251532['value'];_0x30b0e6['change'](_0xd0f887=>{const _0x48daf7=Array['from'](_0xdadc39['getSelectedBlocks']())['filter'](_0x35aba2=>this['_canHaveLineHeight'](_0x35aba2));for(const _0x17a69c of _0x48daf7)_0x22e7e9?_0xd0f887['setAttribute']('lineHeight',_0x22e7e9,_0x17a69c):_0xd0f887['removeAttribute']('lineHeight',_0x17a69c);});}_canHaveLineHeight(_0x35cd16){return this['editor']['model']['schema']['checkAttribute'](_0x35cd16,'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(_0x4f2852){return'string'==typeof _0x4f2852&&'default'===_0x4f2852['toLowerCase']();}function L(_0x3f5d77){return _0x3f5d77['options']['map'](_0x481911=>{return H(_0x481911)?{'title':String(_0x3f5d77['defaultValue']),'model':'default'}:('number'==typeof _0x481911&&(_0x481911=String(_0x481911)),'string'!=typeof _0x481911?_0x481911:parseFloat(_0x481911)?{'title':_0x481911,'model':_0x481911,'view':{'name':'span','styles':{'line-height':_0x481911}}}:'string'==typeof(_0x5c83b9=_0x481911)?y[_0x5c83b9]:y[_0x5c83b9['model']]);var _0x5c83b9;})['filter'](_0xc217f6=>void 0x0!==_0xc217f6);}var v=class extends _0x379618{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x48d060,conversion:_0x8bfe9c}=this['editor'];_0x48d060['has']('ListEditing')&&_0x48d060['has']('TodoListEditing')&&(_0x48d060['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x24cec3,_0x5be213,_0x5d186a,_0x35c809,_0x62553c){'todo'==_0x62553c['getAttribute']('listType')&&_0x5be213&&(_0x24cec3['addClass']('ck-list-marker-line-height',_0x5d186a),_0x24cec3['setStyle']('--ck-content-list-marker-line-height',_0x5be213,_0x5d186a));}}),_0x8bfe9c['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x8bfe9c['for']('upcast')['add'](_0x5ef202=>{_0x5ef202['on']('element:li',function(_0x52eb43){const _0x48ef4d=new _0x589718(_0x52eb43);return(_0x6c7994,_0x36f57c,_0x52c61c)=>{const _0x3ecd53=_0x48ef4d['match'](_0x36f57c['viewItem']);if(!_0x3ecd53)return;const _0x30ba00=_0x3ecd53['match'];_0x30ba00['name']=!0x1,_0x52c61c['consumable']['consume'](_0x36f57c['viewItem'],_0x30ba00);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x379618{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x11b9d2){super(_0x11b9d2),_0x11b9d2['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x6cb9a5=this['editor'];this['_validateConfig'](),_0x6cb9a5['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x6cb9a5['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x6cb9a5['commands']['add']('lineHeight',new p(_0x6cb9a5)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x42f686){const _0x27497a='PHQ3YUIBrl0XdnwG9kez8sfpMv1ytWFRNZOV5jJaq7Tc2ogub64xCKDEALSihm',_0x36989a=0x79170,_0x289639=window['Date']['now'](),_0x3d0e07=_0x42f686['editor'],_0x225ecb=new window['Promise'](_0x2cf373=>{_0x3d0e07['once']('ready',_0x2cf373);}),_0x289b2d={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x2e4193=_0x3d0e07['config']['get']('licenseKey');async function _0x18656c(){let _0x1bafd4,_0x488e2a=null,_0x1bda2c=null;try{return'GPL'==_0x2e4193?'NotAllowed':(_0x1bafd4=_0x1a9c2d(),_0x1bafd4?(_0x1bafd4['usageEndpoint']&&(_0x1bda2c=_0x232b83(_0x1bafd4['usageEndpoint'],_0x1bafd4['jti'])),await _0x10e74a()?_0xf3bdec()?_0x3e3984()?'Expired':_0x188fd4()?('evaluation'==_0x1bafd4['licenseType']&&(_0x488e2a=_0x2796b5('EvaluationLimit')),await _0xa957d()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3e3984(){const _0x24ec76=['evaluation','trial']['includes'](_0x1bafd4['licenseType'])?_0x289639/0x3e8:0xe10*_0x36989a;return _0x1bafd4['exp']<_0x24ec76;}function _0xf3bdec(){const _0x402940=_0x1bafd4['features'];return!!_0x402940&&(!!_0x402940['includes']('*')||!!_0x402940['includes']('LH'));}function _0x188fd4(){const _0x546acf=_0x1bafd4['licensedHosts'];if(!_0x546acf||0x0==_0x546acf['length'])return!0x0;const {hostname:_0x170495}=new URL(window['location']['href']);if(_0x546acf['includes'](_0x170495))return!0x0;const _0x436790=_0x170495['split']('.');return _0x546acf['filter'](_0x29e0e2=>_0x29e0e2['includes']('*'))['map'](_0x149e21=>_0x149e21['split']('.'))['filter'](_0x1c183d=>_0x1c183d['length']<=_0x436790['length'])['map'](_0x43ba61=>Array(_0x436790['length']-_0x43ba61['length'])['fill']('*'===_0x43ba61[0x0]?'*':'')['concat'](_0x43ba61))['some'](_0x45699f=>_0x436790['every']((_0xba5d21,_0x442770)=>_0x45699f[_0x442770]===_0xba5d21||'*'===_0x45699f[_0x442770]));}function _0xa957d(){return _0x488e2a&&_0x1bda2c?new window['Promise']((_0x59fdfb,_0x4090f2)=>{_0x488e2a['then'](_0x59fdfb,_0x4090f2),_0x1bda2c['then'](_0x520c7f=>{'Valid'!=_0x520c7f&&_0x59fdfb(_0x520c7f);},_0x4090f2);}):_0x488e2a||_0x1bda2c||'Valid';}}function _0x232b83(_0x2866c3,_0x1ac503){return new window['Promise'](_0x5fd845=>{if(_0x107dae())return _0x5fd845('Valid');_0x5204ba(),_0x3d0e07['decorate']('_sendUsageRequest');let _0x2fd37c=!0x1;const _0x129e15=_0x6fddc5();function _0xafa136(_0x4b6842){return!!_0x4b6842&&('object'==typeof _0x4b6842||'function'==typeof _0x4b6842)&&'function'==typeof _0x4b6842['then']&&'function'==typeof _0x4b6842['catch'];}function _0x21ab1b(_0x227e24){_0x5bbd6d(_0x227e24)['then'](_0x108c98=>_0x108c98&&'ok'==_0x108c98['status']?_0xe42478(_0x5928d1(_0x129e15+_0x1ac503))!=_0x108c98['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x295745=>(_0x5a65a2(),_0x295745),()=>{const _0x3013e6=_0x236699();return null==_0x3013e6?(_0x5a65a2(),'Valid'):_0x289639-_0x3013e6>0x240c8400?'UsageLimit':'Valid';})['then'](_0x5fd845)['catch'](()=>{_0x5fd845('UsageLimit');});const _0x2886e8=0x36ee80;function _0x5a65a2(){const _0x3cd340='llct-'+_0xe42478(_0x5928d1(_0x2866c3)),_0x2f2303=_0x7034c3(_0xe42478(window['Math']['ceil'](_0x289639/_0x2886e8)));window['localStorage']['setItem'](_0x3cd340,_0x2f2303);}function _0x236699(){const _0x262111='llct-'+_0xe42478(_0x5928d1(_0x2866c3)),_0x1008bd=window['localStorage']['getItem'](_0x262111);return _0x1008bd?window['parseInt'](_0x7034c3(_0x1008bd),0x10)*_0x2886e8:null;}function _0x5bbd6d(_0x17c989){return new window['Promise']((_0x4f7a6c,_0x1b6477)=>{_0x17c989['then'](_0x4f7a6c,_0x1b6477),window['setTimeout'](_0x1b6477,0x1d4c0);});}}_0x3d0e07['on']('_sendUsageRequest',(_0x248089,_0x5121c2)=>{if(_0x5121c2[0x0]!=_0x2866c3)return _0x5fd845('UsageLimit');_0x5121c2[0x1]={..._0x5121c2[0x1],'requestId':_0x129e15};},{'priority':'high'}),_0x3d0e07['on']('_sendUsageRequest',_0x4c6618=>{_0xafa136(_0x4c6618['return'])&&(_0x2fd37c=!0x0,_0x21ab1b(_0x4c6618['return']));},{'priority':'low'}),_0x225ecb['then'](()=>{_0x2fd37c||_0x5fd845('UsageLimit');});});function _0x107dae(){return'auto'==_0x3d0e07['editing']['view']['_overlayModeHint'];}function _0x5204ba(){_0x3d0e07['editing']['view']['_overlayModeHint']='auto';}}function _0x2796b5(_0x50e5ee){const _0x2b9eef=[new window['Promise'](_0x5d1f23=>setTimeout(_0x5d1f23,0x93ecc)),_0x225ecb['then'](()=>new window['Promise'](_0x650b79=>{let _0x25f732=0x0;_0x3d0e07['model']['on']('applyOperation',(_0x2c0150,_0x5593ab)=>{_0x5593ab[0x0]['isDocumentOperation']&&_0x25f732++,0x5e8==_0x25f732&&(_0x650b79(),_0x2c0150['off']());});}))];return window['Promise']['race'](_0x2b9eef)['then'](()=>_0x50e5ee);}async function _0x50335e(){await _0x225ecb,_0x3d0e07['model']['change']=_0x996b34,_0x3d0e07['model']['enqueueChange']=_0x996b34,_0x3d0e07['enableReadOnlyMode']('model');}function _0x41aea6(_0x244e0a){const _0x55decd=_0x34d3d0();_0x3d0e07[_0x55decd]='lineHeightLicenseKey'+_0x244e0a,'Valid'!=_0x244e0a&&_0x50335e();}function _0x34d3d0(){const _0x5c88ff=window['String'](window['performance']['now']())['replace']('.','');let _0x411895='P';for(let _0x53cadd=0x0;_0x53cadd<_0x5c88ff['length'];_0x53cadd+=0x2){let _0x33d1cc=window['parseInt'](_0x5c88ff['substring'](_0x53cadd,_0x53cadd+0x2));_0x33d1cc>=0x3e&&(_0x33d1cc-=0x3e),_0x411895+=_0x27497a[_0x33d1cc];}return _0x411895;}function _0x1a9c2d(){const _0x531b84=_0x2e4193['split']('.');if(0x3!=_0x531b84['length'])return null;return _0x4c545e(_0x531b84[0x1]);function _0x4c545e(_0x3cc260){const _0x540379=_0x2c4c68(_0x3cc260);return _0x540379&&_0x4818d4()?_0x540379:null;function _0x4818d4(){const _0x8ae454=_0x540379['jti'],_0x2e3875=window['parseInt'](_0x8ae454['substring'](_0x8ae454['length']-0x8),0x10),_0x57fbdb={..._0x540379,'jti':_0x8ae454['substring'](0x0,_0x8ae454['length']-0x8)};return delete _0x57fbdb['vc'],_0x5928d1(_0x57fbdb)==_0x2e3875;}}}async function _0x10e74a(){let _0x37ea8d=!0x0;try{const [_0x5800a1,_0x49ee1f,_0x2c5abd]=_0x2e4193['split']('.');return _0x22e41e(_0x5800a1),await _0x1cd3da(_0x5800a1,_0x49ee1f,_0x2c5abd),_0x37ea8d;}catch{return!0x1;}function _0x22e41e(_0x5eff04){const _0x441587=_0x2c4c68(_0x5eff04);_0x441587&&'ES256'==_0x441587['alg']||(_0x37ea8d=!0x1);}async function _0x1cd3da(_0x45dbec,_0x3cc86e,_0x261471){const _0x44060a=window['Uint8Array']['from'](_0x6b085e(_0x261471),_0x6a95b3=>_0x6a95b3['charCodeAt'](0x0)),_0x3a1163=new window['TextEncoder']()['encode'](_0x45dbec+'.'+_0x3cc86e),_0x3b8a65=window['crypto']['subtle'];if(!_0x3b8a65)return;const _0x25533a=await _0x3b8a65['importKey']('jwk',_0x289b2d,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3b8a65['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x25533a,_0x44060a,_0x3a1163)||(_0x37ea8d=!0x1);}}function _0x2c4c68(_0xd9e8e1){return _0xd9e8e1['startsWith']('ey')?JSON['parse'](_0x6b085e(_0xd9e8e1)):null;}function _0x6b085e(_0x500a71){return window['atob'](_0x500a71['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5928d1(_0x253861){let _0x4220b8=0x1505;function _0x2eeca8(_0x248318){for(let _0x4ea6d3=0x0;_0x4ea6d3<_0x248318['length'];_0x4ea6d3++){const _0x1c3b3b=_0x248318['charCodeAt'](_0x4ea6d3);_0x4220b8=(_0x4220b8<<0x5)+_0x4220b8+_0x1c3b3b,_0x4220b8&=_0x4220b8;}}function _0x3e4398(_0x2d140b){Array['isArray'](_0x2d140b)?_0x2d140b['forEach'](_0x3e4398):_0x2d140b&&'object'==typeof _0x2d140b?Object['entries'](_0x2d140b)['sort']()['forEach'](([_0x15750f,_0x5106c7])=>{_0x2eeca8(_0x15750f),_0x3e4398(_0x5106c7);}):_0x2eeca8(window['String'](_0x2d140b));}return _0x3e4398(_0x253861),_0x4220b8>>>0x0;}function _0xe42478(_0xaf4bc0){return _0xaf4bc0['toString'](0x10)['padStart'](0x8,'0');}function _0x7034c3(_0x28e1be){return _0x28e1be['split']('')['reverse']()['join']('');}function _0x996b34(){}_0x41aea6(await _0x18656c());}(this);}_validateConfig(){const _0x5e5554=this['editor'];if(!_0x5e5554['config']['get']('lineHeight.supportAllValues'))return;const _0x1f485e=_0x5e5554['config']['get']('lineHeight.options')['filter'](_0x55782b=>'string'==typeof _0x55782b&&(!H(_0x55782b)&&isNaN(Number(_0x55782b))));if(_0x1f485e['length'])throw new _0x45c777('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x1f485e});}_prepareAnyValueConverters(){const _0x1cc0a2=this['editor'],_0x20e9e8=this['editor']['config']['get']('lineHeight.defaultValue');_0x1cc0a2['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x33d9c3=>String(_0x33d9c3)===String(_0x20e9e8)?null:{'key':'style','value':{'line-height':_0x33d9c3}}}),_0x1cc0a2['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x16caf4=>{let _0x4ed320=_0x16caf4['getStyle']('line-height');return _0x3da07c(_0x4ed320)&&(_0x4ed320=String(Number(_0x4ed320['slice'](0x0,-0x1))/0x64)),String(_0x4ed320)===String(_0x20e9e8)?null:_0x4ed320;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0xb88d58=this['editor'],_0x1724cb=this['editor']['config']['get']('lineHeight.defaultValue'),_0x2e0f9d=function(_0x3235d3,_0x2d6207){const _0x4af39b={'model':{'key':_0x3235d3,'values':[]},'view':{}};for(const _0x146db6 of _0x2d6207)'class'===_0x146db6['view']?.['key']?(_0x4af39b['model']['values']['push'](_0x146db6['model']),_0x4af39b['view'][_0x146db6['model']]={'key':'class','value':_0x146db6['view']['value']}):(_0x4af39b['model']['values']['push'](_0x146db6['model']),_0x4af39b['view'][_0x146db6['model']]={'key':'style','value':'line-height:'+_0x146db6['model']+';'});return _0x4af39b;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x4250ff=>_0x4250ff['model']));_0xb88d58['conversion']['attributeToAttribute'](_0x2e0f9d),_0xb88d58['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x38dda7=>{let _0x1994b2=_0x38dda7['getStyle']('line-height');return _0x3da07c(_0x1994b2)&&(_0x1994b2=String(Number(_0x1994b2['slice'](0x0,-0x1))/0x64)),_0x1994b2===String(_0x1724cb)?null:_0x2e0f9d['model']['values']['includes'](_0x1994b2)?_0x1994b2:null;}}});}},k=class extends _0x379618{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x6985f0={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x6985f0),this['_registerMenuBarComponent'](_0x6985f0),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x24412c=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x40611b;for(const _0x4d1557 in _0x24412c){const _0x3e90e2=_0x4d1557,_0x25815c=_0x24412c[_0x3e90e2];if('lineHeightLicenseKeyValid'==_0x25815c||'lineHeightLicenseKeyInvalid'==_0x25815c||'lineHeightLicenseKeyExpired'==_0x25815c||'lineHeightLicenseKeyDomainLimit'==_0x25815c||'lineHeightLicenseKeyNotAllowed'==_0x25815c||'lineHeightLicenseKeyEvaluationLimit'==_0x25815c||'lineHeightLicenseKeyUsageLimit'==_0x25815c){delete _0x24412c[_0x3e90e2],_0x40611b=_0x25815c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x40611b&&_0x24412c['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x40611b&&_0x24412c['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x40611b&&_0x24412c['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x40611b&&_0x24412c['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x40611b&&_0x24412c['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x40611b&&_0x24412c['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x3292cd=this['editor'],t=_0x3292cd['t'],_0x3ee0bd=_0x3292cd['config']['get']('lineHeight'),_0x826016={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x3ee0bd)['map'](_0x2a8f51=>{const _0x52585e=_0x826016[_0x2a8f51['title']];return _0x52585e&&_0x52585e!=_0x2a8f51['title']&&(_0x2a8f51=Object['assign']({},_0x2a8f51,{'title':_0x52585e})),_0x2a8f51;});}_prepareListOptions(){const _0x20e143=this['editor']['commands']['get']('lineHeight'),_0x6fa6b8=this['editor']['config']['get']('lineHeight.defaultValue'),_0x210ab6=this['_getLocalizedLineHeightOptions'](),_0x3679c7=new _0x346707(),_0x4c37ac=_0x395d18=>'default'===_0x395d18||String(_0x6fa6b8)===_0x395d18;for(const _0x3eb9c2 of _0x210ab6){const _0x464cbb={'type':'button','model':new _0x16f46b({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x3eb9c2['title'],'withText':!0x0})};_0x4c37ac(_0x3eb9c2['model'])?(_0x464cbb['model']['bind']('isOn')['to'](_0x20e143,'value',_0x129e2d=>!_0x129e2d),_0x464cbb['model']['commandParam']=void 0x0):(_0x464cbb['model']['bind']('isOn')['to'](_0x20e143,'value',_0x1564f1=>_0x1564f1===_0x3eb9c2['model']),_0x464cbb['model']['commandParam']=_0x3eb9c2['model']),_0x3679c7['add'](_0x464cbb);}if(this['_shouldRenderCustomValueOption']()){const _0x278980=this['_getCustomValueOptionDefinition'](_0x210ab6);_0x3679c7['add'](_0x278980);}return _0x3679c7;}_getCustomValueOptionDefinition(_0x37671f){const _0x987653=this['editor'],t=_0x987653['t'],_0x3c4f39=_0x987653['commands']['get']('lineHeight'),_0x5be41c=_0x37671f['map'](_0x34e605=>_0x34e605['model']),_0x483328={'type':'button','model':new _0x16f46b({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x483328['model']['bind']('commandParam')['to'](_0x3c4f39,'value'),_0x483328['model']['bind']('isOn')['to'](_0x3c4f39,'value',_0x3ab459=>!!_0x3ab459&&!_0x5be41c['includes'](String(_0x3ab459))),_0x483328['model']['bind']('label')['to'](_0x3c4f39,'value',_0x1b0132=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x1b0132))),_0x483328;}_registerToolbarComponent({accessibleLabel:_0x55118e,options:_0xcdf672}){const _0x58db53=this['editor'],_0x3334ec=_0x58db53['commands']['get']('lineHeight');_0x58db53['ui']['componentFactory']['add']('lineHeight',_0xc281b8=>{const _0x1a1aea=_0x4d8efe(_0xc281b8);return _0x263501(_0x1a1aea,_0xcdf672,{'role':'menu','ariaLabel':_0x55118e}),_0x1a1aea['buttonView']['set']({'label':_0x55118e,'tooltip':!0x0,'icon':_0x2ec5f1}),_0x1a1aea['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x1a1aea['bind']('isEnabled')['to'](_0x3334ec),this['listenTo'](_0x1a1aea,'execute',_0x5454b4=>{_0x58db53['execute'](_0x5454b4['source']['commandName'],{'value':_0x5454b4['source']['commandParam']}),_0x58db53['editing']['view']['focus']();}),_0x1a1aea['once']('change:isOpen',()=>{const _0x593a01=_0x1a1aea['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x1a1aea,_0xcdf672,_0x593a01);}),_0x1a1aea;});}_registerMenuBarComponent({accessibleLabel:_0x5bc73a,options:_0x2d471b}){const _0x301085=this['editor'],_0x4509b9=_0x301085['commands']['get']('lineHeight');_0x301085['ui']['componentFactory']['add']('menuBar:lineHeight',_0xe1779a=>{const _0x40b134=new _0x375d10(_0xe1779a);_0x40b134['buttonView']['set']({'label':_0x5bc73a,'icon':_0x2ec5f1}),_0x40b134['bind']('isEnabled')['to'](_0x4509b9);const _0x10c11e=new _0x1bb80c(_0xe1779a);for(const _0x88c5b of _0x2d471b){const _0x1c12b3=new _0x519a60(_0xe1779a,_0x40b134),_0x3f9394=new _0x558bac(_0xe1779a);_0x3f9394['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x3f9394['bind'](...Object['keys'](_0x88c5b['model']))['to'](_0x88c5b['model']),_0x3f9394['delegate']('execute')['to'](_0x40b134),_0x3f9394['on']('execute',()=>{_0x301085['execute'](_0x88c5b['model']['commandName'],{'value':_0x88c5b['model']['commandParam']}),_0x301085['editing']['view']['focus']();}),_0x1c12b3['children']['add'](_0x3f9394),_0x10c11e['items']['add'](_0x1c12b3);}return _0x40b134['panelView']['children']['add'](_0x10c11e),this['_attachCustomOptionVisibilityHandler'](_0x40b134,_0x2d471b,_0x10c11e),_0x40b134;});}_attachCustomOptionVisibilityHandler(_0x19d4af,_0x303be0,_0x216a73){if(!this['_shouldRenderCustomValueOption']())return;const _0x3916dd=()=>{if(!_0x19d4af['isOpen'])return;_0x216a73['items']['last']['isVisible']=Boolean(_0x303be0['last']['model']['isOn']);};_0x3916dd(),_0x19d4af['on']('change:isOpen',()=>{_0x3916dd();});}},_=class extends _0x379618{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",
|