@ckeditor/ckeditor5-line-height 49.0.0-alpha.3 → 49.0.0-alpha.4
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 _0x1822eb,Plugin as _0x2949f1}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x2d8e18,Collection as _0xfb46a4,first as _0x3266aa,uid as _0xdab7a6}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x2ecfdf,isPercentageStyleValue as _0x7ee25a}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x3a7b95,MenuBarMenuListItemView as _0x222373,MenuBarMenuListView as _0x4fa2b3,MenuBarMenuView as _0xc824ef,UIModel as _0x9e0436,addListToDropdown as _0x3a9fbf,createDropdown as _0x5325a7}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x44d807}from'@ckeditor/ckeditor5-icons';var p=class extends _0x1822eb{['refresh'](){const _0x4656e3=this['editor']['model']['document'],_0x183339=_0x3266aa(_0x4656e3['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x183339)&&this['_canHaveLineHeight'](_0x183339),this['value']=this['isEnabled']&&_0x183339['getAttribute']('lineHeight');}execute(_0x33ea02={}){const _0x467311=this['editor']['model'],_0xe0dad8=_0x467311['document']['selection'],_0x535a49=_0x33ea02['value'];_0x467311['change'](_0x1380e4=>{const _0x24435d=Array['from'](_0xe0dad8['getSelectedBlocks']())['filter'](_0x2444ac=>this['_canHaveLineHeight'](_0x2444ac));for(const _0x26a3e0 of _0x24435d)_0x535a49?_0x1380e4['setAttribute']('lineHeight',_0x535a49,_0x26a3e0):_0x1380e4['removeAttribute']('lineHeight',_0x26a3e0);});}_canHaveLineHeight(_0x408c70){return this['editor']['model']['schema']['checkAttribute'](_0x408c70,'lineHeight');}};const y={get 'single'(){return{'title':'Single','model':'single','view':{'key':'class','value':'line-height-single'}};},get 'double'(){return{'title':'Double','model':'double','view':{'key':'class','value':'line-height-double'}};}};function H(_0x29f4e4){return'string'==typeof _0x29f4e4&&'default'===_0x29f4e4['toLowerCase']();}function L(_0x8eb1af){return _0x8eb1af['options']['map'](_0xcf96f5=>{return H(_0xcf96f5)?{'title':String(_0x8eb1af['defaultValue']),'model':'default'}:('number'==typeof _0xcf96f5&&(_0xcf96f5=String(_0xcf96f5)),'string'!=typeof _0xcf96f5?_0xcf96f5:parseFloat(_0xcf96f5)?{'title':_0xcf96f5,'model':_0xcf96f5,'view':{'name':'span','styles':{'line-height':_0xcf96f5}}}:'string'==typeof(_0x15b171=_0xcf96f5)?y[_0x15b171]:y[_0x15b171['model']]);var _0x15b171;})['filter'](_0x4f4c37=>void 0x0!==_0x4f4c37);}var v=class extends _0x2949f1{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x479cbd,conversion:_0x39c259}=this['editor'];_0x479cbd['has']('ListEditing')&&_0x479cbd['has']('TodoListEditing')&&(_0x479cbd['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x27b064,_0x38fd45,_0x6b379f,_0x2b8c8b,_0x377d26){'todo'==_0x377d26['getAttribute']('listType')&&_0x38fd45&&(_0x27b064['addClass']('ck-list-marker-line-height',_0x6b379f),_0x27b064['setStyle']('--ck-content-list-marker-line-height',_0x38fd45,_0x6b379f));}}),_0x39c259['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x39c259['for']('upcast')['add'](_0x419471=>{_0x419471['on']('element:li',function(_0x57ffcc){const _0x483c4c=new _0x2ecfdf(_0x57ffcc);return(_0x15e73c,_0x3387f3,_0x56103d)=>{const _0x45da47=_0x483c4c['match'](_0x3387f3['viewItem']);if(!_0x45da47)return;const _0x5f5d2e=_0x45da47['match'];_0x5f5d2e['name']=!0x1,_0x56103d['consumable']['consume'](_0x3387f3['viewItem'],_0x5f5d2e);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x2949f1{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x36ae03){super(_0x36ae03),_0x36ae03['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x53afb9=this['editor'];this['_validateConfig'](),_0x53afb9['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x53afb9['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x53afb9['commands']['add']('lineHeight',new p(_0x53afb9)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x540a65){const _0x2b72a2='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x4192dc=0x79758,_0x588bfc={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x261366(_0x29037f){const _0x5a0b32=new window['Promise'](_0xd1eaa6=>{_0x29037f['once']('ready',_0xd1eaa6);}),_0x5134b4=window['Date']['now'](),_0x35c830=_0x29037f['config']['get']('licenseKey');async function _0x2f2dff(){let _0x174943,_0x17af58=null,_0x2a8c04=null;try{return'GPL'==_0x35c830?'NotAllowed':(_0x174943=_0x2071fe(),_0x174943?(_0x174943['usageEndpoint']&&(_0x2a8c04=_0x466482(_0x174943['usageEndpoint'],_0x174943['jti'])),await _0x935ece()?_0xf62f3f()?_0x544b20()?'Expired':_0x22257f()?('evaluation'==_0x174943['licenseType']&&(_0x17af58=_0x2ed23b('EvaluationLimit')),await _0x3410ec()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x544b20(){const _0x428ccb=['evaluation','trial']['includes'](_0x174943['licenseType'])?_0x5134b4/0x3e8:0xe10*_0x4192dc;return _0x174943['exp']<_0x428ccb;}function _0xf62f3f(){const _0x14ce16=_0x174943['features'];return!!_0x14ce16&&(!!_0x14ce16['includes']('*')||!!_0x14ce16['includes']('LH'));}function _0x22257f(){const _0x4b8a12=_0x174943['licensedHosts'];if(!_0x4b8a12||0x0==_0x4b8a12['length'])return!0x0;const {hostname:_0x306db7}=new URL(window['location']['href']);if(_0x4b8a12['includes'](_0x306db7))return!0x0;const _0x3d6bf2=_0x306db7['split']('.');return _0x4b8a12['filter'](_0x286abc=>_0x286abc['includes']('*'))['map'](_0x5314b4=>_0x5314b4['split']('.'))['filter'](_0x29ccc0=>_0x29ccc0['length']<=_0x3d6bf2['length'])['map'](_0x47438d=>Array(_0x3d6bf2['length']-_0x47438d['length'])['fill']('*'===_0x47438d[0x0]?'*':'')['concat'](_0x47438d))['some'](_0xfe8b28=>_0x3d6bf2['every']((_0x424310,_0x320857)=>_0xfe8b28[_0x320857]===_0x424310||'*'===_0xfe8b28[_0x320857]));}function _0x3410ec(){return _0x17af58&&_0x2a8c04?new window['Promise']((_0x5e8431,_0x5031a7)=>{_0x17af58['then'](_0x5e8431,_0x5031a7),_0x2a8c04['then'](_0x3da62c=>{'Valid'!=_0x3da62c&&_0x5e8431(_0x3da62c);},_0x5031a7);}):_0x17af58||_0x2a8c04||'Valid';}}function _0x466482(_0x260ae1,_0x3b0d32){return new window['Promise'](_0x32fd9a=>{if(_0x2b5d66())return _0x32fd9a('Valid');_0x33b0c6(),_0x29037f['decorate']('_sendUsageRequest');let _0x548787=!0x1;const _0x5c0b7c=_0xdab7a6();function _0x388397(_0x1ee369){return!!_0x1ee369&&('object'==typeof _0x1ee369||'function'==typeof _0x1ee369)&&'function'==typeof _0x1ee369['then']&&'function'==typeof _0x1ee369['catch'];}function _0x4c017a(_0x9de1c4){_0x51cc68(_0x9de1c4)['then'](_0x1ca5fd=>_0x1ca5fd&&'ok'==_0x1ca5fd['status']?_0x54a497(_0x13fc7f(_0x5c0b7c+_0x3b0d32))!=_0x1ca5fd['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x1ef107=>(_0x4c046f(),_0x1ef107),()=>{const _0x355693=_0x40f0f8();return null==_0x355693?(_0x4c046f(),'Valid'):_0x5134b4-_0x355693>0x240c8400?'UsageLimit':'Valid';})['then'](_0x32fd9a)['catch'](()=>{_0x32fd9a('UsageLimit');});const _0x5b5ee6=0x36ee80;function _0x4c046f(){const _0x45fa35='llct-'+_0x54a497(_0x13fc7f(_0x260ae1)),_0x2f9049=_0x16944d(_0x54a497(window['Math']['ceil'](_0x5134b4/_0x5b5ee6)));window['localStorage']['setItem'](_0x45fa35,_0x2f9049);}function _0x40f0f8(){const _0x4807ef='llct-'+_0x54a497(_0x13fc7f(_0x260ae1)),_0x8e799=window['localStorage']['getItem'](_0x4807ef);return _0x8e799?window['parseInt'](_0x16944d(_0x8e799),0x10)*_0x5b5ee6:null;}function _0x51cc68(_0x3e918d){return new window['Promise']((_0x2eed57,_0x256010)=>{_0x3e918d['then'](_0x2eed57,_0x256010),window['setTimeout'](_0x256010,0x1d4c0);});}}_0x29037f['on']('_sendUsageRequest',(_0x3e863e,_0x566a0d)=>{if(_0x566a0d[0x0]!=_0x260ae1)return _0x32fd9a('UsageLimit');_0x566a0d[0x1]={..._0x566a0d[0x1],'requestId':_0x5c0b7c};},{'priority':'high'}),_0x29037f['on']('_sendUsageRequest',_0x5e342a=>{_0x388397(_0x5e342a['return'])&&(_0x548787=!0x0,_0x4c017a(_0x5e342a['return']));},{'priority':'low'}),_0x5a0b32['then'](()=>{_0x548787||_0x32fd9a('UsageLimit');});});function _0x2b5d66(){return'auto'==_0x29037f['editing']['view']['_overlayModeHint'];}function _0x33b0c6(){_0x29037f['editing']['view']['_overlayModeHint']='auto';}}function _0x2ed23b(_0x3e4f9f){const _0x3d6ac1=[new window['Promise'](_0x55820f=>setTimeout(_0x55820f,0x93ecc)),_0x5a0b32['then'](()=>new window['Promise'](_0x4f73bc=>{let _0x41ae25=0x0;_0x29037f['model']['on']('applyOperation',(_0x3c630d,_0x4fd1d6)=>{_0x4fd1d6[0x0]['isDocumentOperation']&&_0x41ae25++,0x5e8==_0x41ae25&&(_0x4f73bc(),_0x3c630d['off']());});}))];return window['Promise']['race'](_0x3d6ac1)['then'](()=>_0x3e4f9f);}async function _0x322107(){await _0x5a0b32,_0x29037f['model']['change']=_0x3f8d09,_0x29037f['model']['enqueueChange']=_0x3f8d09,_0x29037f['enableReadOnlyMode']('model');}function _0x32f48a(_0x33e27d){const _0x46023a=_0x40dc6c();_0x29037f[_0x46023a]='lineHeightLicenseKey'+_0x33e27d,'Valid'!=_0x33e27d&&_0x322107();}function _0x40dc6c(){const _0x42f428=window['String'](window['performance']['now']())['replace']('.','');let _0x1a0f6d='c';for(let _0x2e5fec=0x0;_0x2e5fec<_0x42f428['length'];_0x2e5fec+=0x2){let _0x5f2f5f=window['parseInt'](_0x42f428['substring'](_0x2e5fec,_0x2e5fec+0x2));_0x5f2f5f>=0x3e&&(_0x5f2f5f-=0x3e),_0x1a0f6d+=_0x2b72a2[_0x5f2f5f];}return _0x1a0f6d;}function _0x2071fe(){const _0x690f43=_0x35c830['split']('.');if(0x3!=_0x690f43['length'])return null;return _0xabe1af(_0x690f43[0x1]);function _0xabe1af(_0x3b567f){const _0x2e8e60=_0x2ce6ad(_0x3b567f);return _0x2e8e60&&_0x4a1958()?_0x2e8e60:null;function _0x4a1958(){const _0x480731=_0x2e8e60['jti'],_0x60ed33=window['parseInt'](_0x480731['substring'](_0x480731['length']-0x8),0x10),_0x20dd42={..._0x2e8e60,'jti':_0x480731['substring'](0x0,_0x480731['length']-0x8)};return delete _0x20dd42['vc'],_0x13fc7f(_0x20dd42)==_0x60ed33;}}}async function _0x935ece(){let _0x55a3bc=!0x0;try{const [_0x5eb87a,_0xfe7019,_0x87625c]=_0x35c830['split']('.');return _0x2cd3ba(_0x5eb87a),await _0x2064cc(_0x5eb87a,_0xfe7019,_0x87625c),_0x55a3bc;}catch{return!0x1;}function _0x2cd3ba(_0x27312c){const _0x161b82=_0x2ce6ad(_0x27312c);_0x161b82&&'ES256'==_0x161b82['alg']||(_0x55a3bc=!0x1);}async function _0x2064cc(_0x444e47,_0x4236d4,_0x1bdfa5){const _0x4aef30=window['Uint8Array']['from'](_0x4ba7c7(_0x1bdfa5),_0x5d1c2c=>_0x5d1c2c['charCodeAt'](0x0)),_0x4a585=new window['TextEncoder']()['encode'](_0x444e47+'.'+_0x4236d4),_0x1df3b8=window['crypto']['subtle'];if(!_0x1df3b8)return;const _0x5a71e4=await _0x1df3b8['importKey']('jwk',_0x588bfc,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x1df3b8['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x5a71e4,_0x4aef30,_0x4a585)||(_0x55a3bc=!0x1);}}function _0x2ce6ad(_0x382489){return _0x382489['startsWith']('ey')?JSON['parse'](_0x4ba7c7(_0x382489)):null;}function _0x4ba7c7(_0x29ca07){return window['atob'](_0x29ca07['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x13fc7f(_0x30dd81){let _0x5b0ebe=0x1505;function _0x3c8a62(_0x4c8b01){for(let _0x13c3c6=0x0;_0x13c3c6<_0x4c8b01['length'];_0x13c3c6++){const _0x2ecb6d=_0x4c8b01['charCodeAt'](_0x13c3c6);_0x5b0ebe=(_0x5b0ebe<<0x5)+_0x5b0ebe+_0x2ecb6d,_0x5b0ebe&=_0x5b0ebe;}}function _0x12132e(_0x146ad2){Array['isArray'](_0x146ad2)?_0x146ad2['forEach'](_0x12132e):_0x146ad2&&'object'==typeof _0x146ad2?Object['entries'](_0x146ad2)['sort']()['forEach'](([_0x3a7410,_0x244d3d])=>{_0x3c8a62(_0x3a7410),_0x12132e(_0x244d3d);}):_0x3c8a62(window['String'](_0x146ad2));}return _0x12132e(_0x30dd81),_0x5b0ebe>>>0x0;}function _0x54a497(_0x144df5){return _0x144df5['toString'](0x10)['padStart'](0x8,'0');}function _0x16944d(_0x4a31ba){return _0x4a31ba['split']('')['reverse']()['join']('');}function _0x3f8d09(){}_0x32f48a(await _0x2f2dff());}_0x261366(_0x540a65['editor']);}(this);}_validateConfig(){const _0x272c00=this['editor'];if(!_0x272c00['config']['get']('lineHeight.supportAllValues'))return;const _0x12fc7f=_0x272c00['config']['get']('lineHeight.options')['filter'](_0x544a10=>'string'==typeof _0x544a10&&(!H(_0x544a10)&&isNaN(Number(_0x544a10))));if(_0x12fc7f['length'])throw new _0x2d8e18('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x12fc7f});}_prepareAnyValueConverters(){const _0x5615c8=this['editor'],_0x9ee1b3=this['editor']['config']['get']('lineHeight.defaultValue');_0x5615c8['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x1bb54d=>String(_0x1bb54d)===String(_0x9ee1b3)?null:{'key':'style','value':{'line-height':_0x1bb54d}}}),_0x5615c8['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x479287=>{let _0x13280f=_0x479287['getStyle']('line-height');return _0x7ee25a(_0x13280f)&&(_0x13280f=String(Number(_0x13280f['slice'](0x0,-0x1))/0x64)),String(_0x13280f)===String(_0x9ee1b3)?null:_0x13280f;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x1dff24=this['editor'],_0x4bba21=this['editor']['config']['get']('lineHeight.defaultValue'),_0x462f45=function(_0x4baff4,_0x435a1e){const _0x19eae7={'model':{'key':_0x4baff4,'values':[]},'view':{}};for(const _0x1409a8 of _0x435a1e)'class'===_0x1409a8['view']?.['key']?(_0x19eae7['model']['values']['push'](_0x1409a8['model']),_0x19eae7['view'][_0x1409a8['model']]={'key':'class','value':_0x1409a8['view']['value']}):(_0x19eae7['model']['values']['push'](_0x1409a8['model']),_0x19eae7['view'][_0x1409a8['model']]={'key':'style','value':'line-height:'+_0x1409a8['model']+';'});return _0x19eae7;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x247eb6=>_0x247eb6['model']));_0x1dff24['conversion']['attributeToAttribute'](_0x462f45),_0x1dff24['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x14f00f=>{let _0xbfe033=_0x14f00f['getStyle']('line-height');return _0x7ee25a(_0xbfe033)&&(_0xbfe033=String(Number(_0xbfe033['slice'](0x0,-0x1))/0x64)),_0xbfe033===String(_0x4bba21)?null:_0x462f45['model']['values']['includes'](_0xbfe033)?_0xbfe033:null;}}});}},k=class extends _0x2949f1{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x10df53={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x10df53),this['_registerMenuBarComponent'](_0x10df53),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x2adc04=[this['editor']];for(const _0x48b0dd of _0x2adc04){let _0x119a21;for(const _0x4da085 in _0x48b0dd){const _0x2b90f7=_0x4da085,_0x2d96eb=_0x48b0dd[_0x2b90f7];if('lineHeightLicenseKeyValid'==_0x2d96eb||'lineHeightLicenseKeyInvalid'==_0x2d96eb||'lineHeightLicenseKeyExpired'==_0x2d96eb||'lineHeightLicenseKeyDomainLimit'==_0x2d96eb||'lineHeightLicenseKeyNotAllowed'==_0x2d96eb||'lineHeightLicenseKeyEvaluationLimit'==_0x2d96eb||'lineHeightLicenseKeyUsageLimit'==_0x2d96eb){delete _0x48b0dd[_0x2b90f7],_0x119a21=_0x2d96eb,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x119a21&&_0x48b0dd['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x119a21&&_0x48b0dd['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x119a21&&_0x48b0dd['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x119a21&&_0x48b0dd['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x119a21&&_0x48b0dd['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x119a21&&_0x48b0dd['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0xafdcef=this['editor'],t=_0xafdcef['t'],_0x3d3373=_0xafdcef['config']['get']('lineHeight'),_0x248c89={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x3d3373)['map'](_0x435719=>{const _0xf14f22=_0x248c89[_0x435719['title']];return _0xf14f22&&_0xf14f22!=_0x435719['title']&&(_0x435719=Object['assign']({},_0x435719,{'title':_0xf14f22})),_0x435719;});}_prepareListOptions(){const _0x41d669=this['editor']['commands']['get']('lineHeight'),_0x57d647=this['editor']['config']['get']('lineHeight.defaultValue'),_0x576182=this['_getLocalizedLineHeightOptions'](),_0x2ff335=new _0xfb46a4(),_0x144f79=_0xe95cdf=>'default'===_0xe95cdf||String(_0x57d647)===_0xe95cdf;for(const _0x10b43a of _0x576182){const _0x2e9e23={'type':'button','model':new _0x9e0436({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x10b43a['title'],'withText':!0x0})};_0x144f79(_0x10b43a['model'])?(_0x2e9e23['model']['bind']('isOn')['to'](_0x41d669,'value',_0xa824e4=>!_0xa824e4),_0x2e9e23['model']['commandParam']=void 0x0):(_0x2e9e23['model']['bind']('isOn')['to'](_0x41d669,'value',_0x45cb08=>_0x45cb08===_0x10b43a['model']),_0x2e9e23['model']['commandParam']=_0x10b43a['model']),_0x2ff335['add'](_0x2e9e23);}if(this['_shouldRenderCustomValueOption']()){const _0x575e90=this['_getCustomValueOptionDefinition'](_0x576182);_0x2ff335['add'](_0x575e90);}return _0x2ff335;}_getCustomValueOptionDefinition(_0x262320){const _0x2984ab=this['editor'],t=_0x2984ab['t'],_0x435b9d=_0x2984ab['commands']['get']('lineHeight'),_0x8f485b=_0x262320['map'](_0x29a57c=>_0x29a57c['model']),_0x4f4587={'type':'button','model':new _0x9e0436({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x4f4587['model']['bind']('commandParam')['to'](_0x435b9d,'value'),_0x4f4587['model']['bind']('isOn')['to'](_0x435b9d,'value',_0x15f01b=>!!_0x15f01b&&!_0x8f485b['includes'](String(_0x15f01b))),_0x4f4587['model']['bind']('label')['to'](_0x435b9d,'value',_0x8d8035=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x8d8035))),_0x4f4587;}_registerToolbarComponent({accessibleLabel:_0x34ce5b,options:_0x43397c}){const _0x3350be=this['editor'],_0x1f0537=_0x3350be['commands']['get']('lineHeight');_0x3350be['ui']['componentFactory']['add']('lineHeight',_0x250af3=>{const _0x43070a=_0x5325a7(_0x250af3);return _0x3a9fbf(_0x43070a,_0x43397c,{'role':'menu','ariaLabel':_0x34ce5b}),_0x43070a['buttonView']['set']({'label':_0x34ce5b,'tooltip':!0x0,'icon':_0x44d807}),_0x43070a['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x43070a['bind']('isEnabled')['to'](_0x1f0537),this['listenTo'](_0x43070a,'execute',_0x16d4cf=>{_0x3350be['execute'](_0x16d4cf['source']['commandName'],{'value':_0x16d4cf['source']['commandParam']}),_0x3350be['editing']['view']['focus']();}),_0x43070a['once']('change:isOpen',()=>{const _0x514d65=_0x43070a['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x43070a,_0x43397c,_0x514d65);}),_0x43070a;});}_registerMenuBarComponent({accessibleLabel:_0x2d03a0,options:_0x1516d7}){const _0x1eed75=this['editor'],_0x375ba5=_0x1eed75['commands']['get']('lineHeight');_0x1eed75['ui']['componentFactory']['add']('menuBar:lineHeight',_0x35bc0b=>{const _0x340a52=new _0xc824ef(_0x35bc0b);_0x340a52['buttonView']['set']({'label':_0x2d03a0,'icon':_0x44d807}),_0x340a52['bind']('isEnabled')['to'](_0x375ba5);const _0x1def52=new _0x4fa2b3(_0x35bc0b);for(const _0x2eb268 of _0x1516d7){const _0xb0299d=new _0x222373(_0x35bc0b,_0x340a52),_0x7ec112=new _0x3a7b95(_0x35bc0b);_0x7ec112['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x7ec112['bind'](...Object['keys'](_0x2eb268['model']))['to'](_0x2eb268['model']),_0x7ec112['delegate']('execute')['to'](_0x340a52),_0x7ec112['on']('execute',()=>{_0x1eed75['execute'](_0x2eb268['model']['commandName'],{'value':_0x2eb268['model']['commandParam']}),_0x1eed75['editing']['view']['focus']();}),_0xb0299d['children']['add'](_0x7ec112),_0x1def52['items']['add'](_0xb0299d);}return _0x340a52['panelView']['children']['add'](_0x1def52),this['_attachCustomOptionVisibilityHandler'](_0x340a52,_0x1516d7,_0x1def52),_0x340a52;});}_attachCustomOptionVisibilityHandler(_0x4d760b,_0x963b59,_0x286bac){if(!this['_shouldRenderCustomValueOption']())return;const _0x41418a=()=>{if(!_0x4d760b['isOpen'])return;_0x286bac['items']['last']['isVisible']=Boolean(_0x963b59['last']['model']['isOn']);};_0x41418a(),_0x4d760b['on']('change:isOpen',()=>{_0x41418a();});}},_=class extends _0x2949f1{static get requires(){return[b,k];}static get['pluginName'](){return'LineHeight';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{_ as LineHeight,p as LineHeightCommand,b as LineHeightEditing,v as LineHeightTodoListIntegration,k as LineHeightUI};
|
|
23
|
+
import{Command as _0x57431b,Plugin as _0x20705f}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x16a1b4,Collection as _0x1691ff,first as _0x60ce6e,uid as _0x5bc650}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x3430cd,isPercentageStyleValue as _0x7d2f85}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x38e9a2,MenuBarMenuListItemView as _0x285286,MenuBarMenuListView as _0x5aa2dc,MenuBarMenuView as _0x254df7,UIModel as _0x5e381e,addListToDropdown as _0x56e9af,createDropdown as _0x177d78}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0xa9599a}from'@ckeditor/ckeditor5-icons';var p=class extends _0x57431b{['refresh'](){const _0x3d6cd7=this['editor']['model']['document'],_0xb3e024=_0x60ce6e(_0x3d6cd7['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0xb3e024)&&this['_canHaveLineHeight'](_0xb3e024),this['value']=this['isEnabled']&&_0xb3e024['getAttribute']('lineHeight');}execute(_0x462190={}){const _0x33623a=this['editor']['model'],_0x257d95=_0x33623a['document']['selection'],_0x86fe09=_0x462190['value'];_0x33623a['change'](_0x409b18=>{const _0x4dfb66=Array['from'](_0x257d95['getSelectedBlocks']())['filter'](_0x6032d7=>this['_canHaveLineHeight'](_0x6032d7));for(const _0x58517a of _0x4dfb66)_0x86fe09?_0x409b18['setAttribute']('lineHeight',_0x86fe09,_0x58517a):_0x409b18['removeAttribute']('lineHeight',_0x58517a);});}_canHaveLineHeight(_0x2146e0){return this['editor']['model']['schema']['checkAttribute'](_0x2146e0,'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(_0x241cb5){return'string'==typeof _0x241cb5&&'default'===_0x241cb5['toLowerCase']();}function L(_0x1f8dfe){return _0x1f8dfe['options']['map'](_0x3df6de=>{return H(_0x3df6de)?{'title':String(_0x1f8dfe['defaultValue']),'model':'default'}:('number'==typeof _0x3df6de&&(_0x3df6de=String(_0x3df6de)),'string'!=typeof _0x3df6de?_0x3df6de:parseFloat(_0x3df6de)?{'title':_0x3df6de,'model':_0x3df6de,'view':{'name':'span','styles':{'line-height':_0x3df6de}}}:'string'==typeof(_0x48218d=_0x3df6de)?y[_0x48218d]:y[_0x48218d['model']]);var _0x48218d;})['filter'](_0x1cf871=>void 0x0!==_0x1cf871);}var v=class extends _0x20705f{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x1e2af1,conversion:_0x5a7a25}=this['editor'];_0x1e2af1['has']('ListEditing')&&_0x1e2af1['has']('TodoListEditing')&&(_0x1e2af1['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x1cc8b1,_0x21f89c,_0x40325f,_0x228cd8,_0x5dd67c){'todo'==_0x5dd67c['getAttribute']('listType')&&_0x21f89c&&(_0x1cc8b1['addClass']('ck-list-marker-line-height',_0x40325f),_0x1cc8b1['setStyle']('--ck-content-list-marker-line-height',_0x21f89c,_0x40325f));}}),_0x5a7a25['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x5a7a25['for']('upcast')['add'](_0x55fabc=>{_0x55fabc['on']('element:li',function(_0x41575f){const _0x419f4e=new _0x3430cd(_0x41575f);return(_0x5ce7e0,_0x7bca58,_0x1bab83)=>{const _0x321c6b=_0x419f4e['match'](_0x7bca58['viewItem']);if(!_0x321c6b)return;const _0x2cec54=_0x321c6b['match'];_0x2cec54['name']=!0x1,_0x1bab83['consumable']['consume'](_0x7bca58['viewItem'],_0x2cec54);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x20705f{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xfb046f){super(_0xfb046f),_0xfb046f['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x575068=this['editor'];this['_validateConfig'](),_0x575068['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x575068['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x575068['commands']['add']('lineHeight',new p(_0x575068)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0xc5eb0){const _0x12aac8='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x2f7366=0x79770,_0x19d7f4={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x5dc874(_0x447366){const _0x1abc4a=new window['Promise'](_0x17f4b0=>{_0x447366['once']('ready',_0x17f4b0);}),_0xb0ca0a=window['Date']['now'](),_0x203471=_0x447366['config']['get']('licenseKey');async function _0x3ce964(){let _0x22947f,_0xd04a44=null,_0x3b5a80=null;try{return'GPL'==_0x203471?'NotAllowed':(_0x22947f=_0x7c8518(),_0x22947f?(_0x22947f['usageEndpoint']&&(_0x3b5a80=_0x43fcc2(_0x22947f['usageEndpoint'],_0x22947f['jti'])),await _0x2d618f()?_0x3765be()?_0x3c7a41()?'Expired':_0x3b1107()?('evaluation'==_0x22947f['licenseType']&&(_0xd04a44=_0x460b3d('EvaluationLimit')),await _0x4835f0()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3c7a41(){const _0x3f09a=['evaluation','trial']['includes'](_0x22947f['licenseType'])?_0xb0ca0a/0x3e8:0xe10*_0x2f7366;return _0x22947f['exp']<_0x3f09a;}function _0x3765be(){const _0x137dc8=_0x22947f['features'];return!!_0x137dc8&&(!!_0x137dc8['includes']('*')||!!_0x137dc8['includes']('LH'));}function _0x3b1107(){const _0x2e8907=_0x22947f['licensedHosts'];if(!_0x2e8907||0x0==_0x2e8907['length'])return!0x0;const {hostname:_0x3bd258}=new URL(window['location']['href']);if(_0x2e8907['includes'](_0x3bd258))return!0x0;const _0x4f980a=_0x3bd258['split']('.');return _0x2e8907['filter'](_0x5a49f0=>_0x5a49f0['includes']('*'))['map'](_0x3f68af=>_0x3f68af['split']('.'))['filter'](_0x56099a=>_0x56099a['length']<=_0x4f980a['length'])['map'](_0x13c27b=>Array(_0x4f980a['length']-_0x13c27b['length'])['fill']('*'===_0x13c27b[0x0]?'*':'')['concat'](_0x13c27b))['some'](_0x3660cb=>_0x4f980a['every']((_0x12f2f1,_0x1da1b2)=>_0x3660cb[_0x1da1b2]===_0x12f2f1||'*'===_0x3660cb[_0x1da1b2]));}function _0x4835f0(){return _0xd04a44&&_0x3b5a80?new window['Promise']((_0xcbeef1,_0x54f3ff)=>{_0xd04a44['then'](_0xcbeef1,_0x54f3ff),_0x3b5a80['then'](_0x1baa82=>{'Valid'!=_0x1baa82&&_0xcbeef1(_0x1baa82);},_0x54f3ff);}):_0xd04a44||_0x3b5a80||'Valid';}}function _0x43fcc2(_0x3d09ff,_0x15af08){return new window['Promise'](_0x268a96=>{if(_0x553a96())return _0x268a96('Valid');_0x11d3b9(),_0x447366['decorate']('_sendUsageRequest');let _0x42c75d=!0x1;const _0x5a0628=_0x5bc650();function _0x9178ca(_0x4a8f0b){return!!_0x4a8f0b&&('object'==typeof _0x4a8f0b||'function'==typeof _0x4a8f0b)&&'function'==typeof _0x4a8f0b['then']&&'function'==typeof _0x4a8f0b['catch'];}function _0x1b10e8(_0x5d3dd3){_0x1c0ea6(_0x5d3dd3)['then'](_0x928f48=>_0x928f48&&'ok'==_0x928f48['status']?_0x287605(_0x59db40(_0x5a0628+_0x15af08))!=_0x928f48['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5e5454=>(_0x4b01e5(),_0x5e5454),()=>{const _0x189324=_0x18930f();return null==_0x189324?(_0x4b01e5(),'Valid'):_0xb0ca0a-_0x189324>0x240c8400?'UsageLimit':'Valid';})['then'](_0x268a96)['catch'](()=>{_0x268a96('UsageLimit');});const _0x7ab554=0x36ee80;function _0x4b01e5(){const _0x3960af='llct-'+_0x287605(_0x59db40(_0x3d09ff)),_0xc5d985=_0x3e4173(_0x287605(window['Math']['ceil'](_0xb0ca0a/_0x7ab554)));window['localStorage']['setItem'](_0x3960af,_0xc5d985);}function _0x18930f(){const _0x49525f='llct-'+_0x287605(_0x59db40(_0x3d09ff)),_0x4849f4=window['localStorage']['getItem'](_0x49525f);return _0x4849f4?window['parseInt'](_0x3e4173(_0x4849f4),0x10)*_0x7ab554:null;}function _0x1c0ea6(_0x26f38f){return new window['Promise']((_0x49dd61,_0xff05ce)=>{_0x26f38f['then'](_0x49dd61,_0xff05ce),window['setTimeout'](_0xff05ce,0x1d4c0);});}}_0x447366['on']('_sendUsageRequest',(_0x5d6801,_0x433011)=>{if(_0x433011[0x0]!=_0x3d09ff)return _0x268a96('UsageLimit');_0x433011[0x1]={..._0x433011[0x1],'requestId':_0x5a0628};},{'priority':'high'}),_0x447366['on']('_sendUsageRequest',_0x52430e=>{_0x9178ca(_0x52430e['return'])&&(_0x42c75d=!0x0,_0x1b10e8(_0x52430e['return']));},{'priority':'low'}),_0x1abc4a['then'](()=>{_0x42c75d||_0x268a96('UsageLimit');});});function _0x553a96(){return'auto'==_0x447366['editing']['view']['_overlayModeHint'];}function _0x11d3b9(){_0x447366['editing']['view']['_overlayModeHint']='auto';}}function _0x460b3d(_0x2dfc0e){const _0x33b561=[new window['Promise'](_0x133749=>setTimeout(_0x133749,0x93ecc)),_0x1abc4a['then'](()=>new window['Promise'](_0x4f6313=>{let _0x4b0c51=0x0;_0x447366['model']['on']('applyOperation',(_0x51bc48,_0x351695)=>{_0x351695[0x0]['isDocumentOperation']&&_0x4b0c51++,0x5e8==_0x4b0c51&&(_0x4f6313(),_0x51bc48['off']());});}))];return window['Promise']['race'](_0x33b561)['then'](()=>_0x2dfc0e);}async function _0x527606(){await _0x1abc4a,_0x447366['model']['change']=_0x502368,_0x447366['model']['enqueueChange']=_0x502368,_0x447366['enableReadOnlyMode']('model');}function _0x2be164(_0x4c45b4){const _0x12e962=_0x34231b();_0x447366[_0x12e962]='lineHeightLicenseKey'+_0x4c45b4,'Valid'!=_0x4c45b4&&_0x527606();}function _0x34231b(){const _0x562701=window['String'](window['performance']['now']())['replace']('.','');let _0xe750a3='c';for(let _0x390f7a=0x0;_0x390f7a<_0x562701['length'];_0x390f7a+=0x2){let _0x9ccf=window['parseInt'](_0x562701['substring'](_0x390f7a,_0x390f7a+0x2));_0x9ccf>=0x3e&&(_0x9ccf-=0x3e),_0xe750a3+=_0x12aac8[_0x9ccf];}return _0xe750a3;}function _0x7c8518(){const _0xdb751f=_0x203471['split']('.');if(0x3!=_0xdb751f['length'])return null;return _0x485514(_0xdb751f[0x1]);function _0x485514(_0x40b78c){const _0x46fec8=_0x2fb32d(_0x40b78c);return _0x46fec8&&_0x1edc37()?_0x46fec8:null;function _0x1edc37(){const _0x556834=_0x46fec8['jti'],_0x39d8c7=window['parseInt'](_0x556834['substring'](_0x556834['length']-0x8),0x10),_0x528d40={..._0x46fec8,'jti':_0x556834['substring'](0x0,_0x556834['length']-0x8)};return delete _0x528d40['vc'],_0x59db40(_0x528d40)==_0x39d8c7;}}}async function _0x2d618f(){let _0x5a88fd=!0x0;try{const [_0x58250b,_0x40533b,_0x46c2ce]=_0x203471['split']('.');return _0x3d354a(_0x58250b),await _0x2a1acc(_0x58250b,_0x40533b,_0x46c2ce),_0x5a88fd;}catch{return!0x1;}function _0x3d354a(_0x11f2f0){const _0x490099=_0x2fb32d(_0x11f2f0);_0x490099&&'ES256'==_0x490099['alg']||(_0x5a88fd=!0x1);}async function _0x2a1acc(_0x84fb2c,_0x27e207,_0x17417e){const _0x328201=window['Uint8Array']['from'](_0x4eee1b(_0x17417e),_0x9d7250=>_0x9d7250['charCodeAt'](0x0)),_0x476d4f=new window['TextEncoder']()['encode'](_0x84fb2c+'.'+_0x27e207),_0x3fce90=window['crypto']['subtle'];if(!_0x3fce90)return;const _0x2e1da3=await _0x3fce90['importKey']('jwk',_0x19d7f4,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3fce90['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x2e1da3,_0x328201,_0x476d4f)||(_0x5a88fd=!0x1);}}function _0x2fb32d(_0x6eeb35){return _0x6eeb35['startsWith']('ey')?JSON['parse'](_0x4eee1b(_0x6eeb35)):null;}function _0x4eee1b(_0x58af66){return window['atob'](_0x58af66['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x59db40(_0x356db5){let _0x1249e2=0x1505;function _0x40b6d9(_0x510686){for(let _0x128166=0x0;_0x128166<_0x510686['length'];_0x128166++){const _0x2bee69=_0x510686['charCodeAt'](_0x128166);_0x1249e2=(_0x1249e2<<0x5)+_0x1249e2+_0x2bee69,_0x1249e2&=_0x1249e2;}}function _0x95c4e8(_0x4b557a){Array['isArray'](_0x4b557a)?_0x4b557a['forEach'](_0x95c4e8):_0x4b557a&&'object'==typeof _0x4b557a?Object['entries'](_0x4b557a)['sort']()['forEach'](([_0x25c7f1,_0x98a70a])=>{_0x40b6d9(_0x25c7f1),_0x95c4e8(_0x98a70a);}):_0x40b6d9(window['String'](_0x4b557a));}return _0x95c4e8(_0x356db5),_0x1249e2>>>0x0;}function _0x287605(_0x5bf0d3){return _0x5bf0d3['toString'](0x10)['padStart'](0x8,'0');}function _0x3e4173(_0x22059c){return _0x22059c['split']('')['reverse']()['join']('');}function _0x502368(){}_0x2be164(await _0x3ce964());}_0x5dc874(_0xc5eb0['editor']);}(this);}_validateConfig(){const _0x38182a=this['editor'];if(!_0x38182a['config']['get']('lineHeight.supportAllValues'))return;const _0x33be1d=_0x38182a['config']['get']('lineHeight.options')['filter'](_0x206438=>'string'==typeof _0x206438&&(!H(_0x206438)&&isNaN(Number(_0x206438))));if(_0x33be1d['length'])throw new _0x16a1b4('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x33be1d});}_prepareAnyValueConverters(){const _0x597318=this['editor'],_0x56446d=this['editor']['config']['get']('lineHeight.defaultValue');_0x597318['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x298efe=>String(_0x298efe)===String(_0x56446d)?null:{'key':'style','value':{'line-height':_0x298efe}}}),_0x597318['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x4563c6=>{let _0x515d5f=_0x4563c6['getStyle']('line-height');return _0x7d2f85(_0x515d5f)&&(_0x515d5f=String(Number(_0x515d5f['slice'](0x0,-0x1))/0x64)),String(_0x515d5f)===String(_0x56446d)?null:_0x515d5f;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x25afe4=this['editor'],_0x5ec5dd=this['editor']['config']['get']('lineHeight.defaultValue'),_0x255734=function(_0x285146,_0x254b26){const _0x5f0450={'model':{'key':_0x285146,'values':[]},'view':{}};for(const _0x17d0a8 of _0x254b26)'class'===_0x17d0a8['view']?.['key']?(_0x5f0450['model']['values']['push'](_0x17d0a8['model']),_0x5f0450['view'][_0x17d0a8['model']]={'key':'class','value':_0x17d0a8['view']['value']}):(_0x5f0450['model']['values']['push'](_0x17d0a8['model']),_0x5f0450['view'][_0x17d0a8['model']]={'key':'style','value':'line-height:'+_0x17d0a8['model']+';'});return _0x5f0450;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x2e0b5b=>_0x2e0b5b['model']));_0x25afe4['conversion']['attributeToAttribute'](_0x255734),_0x25afe4['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x48183a=>{let _0x20542b=_0x48183a['getStyle']('line-height');return _0x7d2f85(_0x20542b)&&(_0x20542b=String(Number(_0x20542b['slice'](0x0,-0x1))/0x64)),_0x20542b===String(_0x5ec5dd)?null:_0x255734['model']['values']['includes'](_0x20542b)?_0x20542b:null;}}});}},k=class extends _0x20705f{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xbfe412={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0xbfe412),this['_registerMenuBarComponent'](_0xbfe412),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x32a688=[this['editor']];for(const _0x324f4a of _0x32a688){let _0x3a4b99;for(const _0x5439c7 in _0x324f4a){const _0x4bd8af=_0x5439c7,_0x53fd54=_0x324f4a[_0x4bd8af];if('lineHeightLicenseKeyValid'==_0x53fd54||'lineHeightLicenseKeyInvalid'==_0x53fd54||'lineHeightLicenseKeyExpired'==_0x53fd54||'lineHeightLicenseKeyDomainLimit'==_0x53fd54||'lineHeightLicenseKeyNotAllowed'==_0x53fd54||'lineHeightLicenseKeyEvaluationLimit'==_0x53fd54||'lineHeightLicenseKeyUsageLimit'==_0x53fd54){delete _0x324f4a[_0x4bd8af],_0x3a4b99=_0x53fd54,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x3a4b99&&_0x324f4a['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x3a4b99&&_0x324f4a['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x3a4b99&&_0x324f4a['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x3a4b99&&_0x324f4a['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x3a4b99&&_0x324f4a['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x3a4b99&&_0x324f4a['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x7c9e18=this['editor'],t=_0x7c9e18['t'],_0x4fca24=_0x7c9e18['config']['get']('lineHeight'),_0x436a85={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x4fca24)['map'](_0x490fa5=>{const _0x213069=_0x436a85[_0x490fa5['title']];return _0x213069&&_0x213069!=_0x490fa5['title']&&(_0x490fa5=Object['assign']({},_0x490fa5,{'title':_0x213069})),_0x490fa5;});}_prepareListOptions(){const _0x59595b=this['editor']['commands']['get']('lineHeight'),_0x2588e0=this['editor']['config']['get']('lineHeight.defaultValue'),_0x8cb484=this['_getLocalizedLineHeightOptions'](),_0x2f36a6=new _0x1691ff(),_0x49d15c=_0xd208f5=>'default'===_0xd208f5||String(_0x2588e0)===_0xd208f5;for(const _0xf6bee of _0x8cb484){const _0x2371c4={'type':'button','model':new _0x5e381e({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0xf6bee['title'],'withText':!0x0})};_0x49d15c(_0xf6bee['model'])?(_0x2371c4['model']['bind']('isOn')['to'](_0x59595b,'value',_0x1e4378=>!_0x1e4378),_0x2371c4['model']['commandParam']=void 0x0):(_0x2371c4['model']['bind']('isOn')['to'](_0x59595b,'value',_0x4c892b=>_0x4c892b===_0xf6bee['model']),_0x2371c4['model']['commandParam']=_0xf6bee['model']),_0x2f36a6['add'](_0x2371c4);}if(this['_shouldRenderCustomValueOption']()){const _0xb9c7ee=this['_getCustomValueOptionDefinition'](_0x8cb484);_0x2f36a6['add'](_0xb9c7ee);}return _0x2f36a6;}_getCustomValueOptionDefinition(_0x1d74f8){const _0x5441c8=this['editor'],t=_0x5441c8['t'],_0x42675a=_0x5441c8['commands']['get']('lineHeight'),_0x52fb93=_0x1d74f8['map'](_0xdc607=>_0xdc607['model']),_0x2f24d0={'type':'button','model':new _0x5e381e({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x2f24d0['model']['bind']('commandParam')['to'](_0x42675a,'value'),_0x2f24d0['model']['bind']('isOn')['to'](_0x42675a,'value',_0x21822c=>!!_0x21822c&&!_0x52fb93['includes'](String(_0x21822c))),_0x2f24d0['model']['bind']('label')['to'](_0x42675a,'value',_0x25c596=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x25c596))),_0x2f24d0;}_registerToolbarComponent({accessibleLabel:_0x4043b3,options:_0x4a78e8}){const _0x279999=this['editor'],_0x4268a7=_0x279999['commands']['get']('lineHeight');_0x279999['ui']['componentFactory']['add']('lineHeight',_0x5366f6=>{const _0x93ec7e=_0x177d78(_0x5366f6);return _0x56e9af(_0x93ec7e,_0x4a78e8,{'role':'menu','ariaLabel':_0x4043b3}),_0x93ec7e['buttonView']['set']({'label':_0x4043b3,'tooltip':!0x0,'icon':_0xa9599a}),_0x93ec7e['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x93ec7e['bind']('isEnabled')['to'](_0x4268a7),this['listenTo'](_0x93ec7e,'execute',_0x348183=>{_0x279999['execute'](_0x348183['source']['commandName'],{'value':_0x348183['source']['commandParam']}),_0x279999['editing']['view']['focus']();}),_0x93ec7e['once']('change:isOpen',()=>{const _0x375a3c=_0x93ec7e['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x93ec7e,_0x4a78e8,_0x375a3c);}),_0x93ec7e;});}_registerMenuBarComponent({accessibleLabel:_0xf72885,options:_0x91539b}){const _0xe14ec9=this['editor'],_0x3c578b=_0xe14ec9['commands']['get']('lineHeight');_0xe14ec9['ui']['componentFactory']['add']('menuBar:lineHeight',_0x4005da=>{const _0x27cf50=new _0x254df7(_0x4005da);_0x27cf50['buttonView']['set']({'label':_0xf72885,'icon':_0xa9599a}),_0x27cf50['bind']('isEnabled')['to'](_0x3c578b);const _0x46fcbe=new _0x5aa2dc(_0x4005da);for(const _0xb35f5f of _0x91539b){const _0x3c205c=new _0x285286(_0x4005da,_0x27cf50),_0x53f530=new _0x38e9a2(_0x4005da);_0x53f530['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x53f530['bind'](...Object['keys'](_0xb35f5f['model']))['to'](_0xb35f5f['model']),_0x53f530['delegate']('execute')['to'](_0x27cf50),_0x53f530['on']('execute',()=>{_0xe14ec9['execute'](_0xb35f5f['model']['commandName'],{'value':_0xb35f5f['model']['commandParam']}),_0xe14ec9['editing']['view']['focus']();}),_0x3c205c['children']['add'](_0x53f530),_0x46fcbe['items']['add'](_0x3c205c);}return _0x27cf50['panelView']['children']['add'](_0x46fcbe),this['_attachCustomOptionVisibilityHandler'](_0x27cf50,_0x91539b,_0x46fcbe),_0x27cf50;});}_attachCustomOptionVisibilityHandler(_0x1b27b8,_0x25ef03,_0x1e0ab7){if(!this['_shouldRenderCustomValueOption']())return;const _0x4f61f0=()=>{if(!_0x1b27b8['isOpen'])return;_0x1e0ab7['items']['last']['isVisible']=Boolean(_0x25ef03['last']['model']['isOn']);};_0x4f61f0(),_0x1b27b8['on']('change:isOpen',()=>{_0x4f61f0();});}},_=class extends _0x20705f{static get requires(){return[b,k];}static get['pluginName'](){return'LineHeight';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{_ as LineHeight,p as LineHeightCommand,b as LineHeightEditing,v as LineHeightTodoListIntegration,k as LineHeightUI};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-line-height",
|
|
3
|
-
"version": "49.0.0-alpha.
|
|
3
|
+
"version": "49.0.0-alpha.4",
|
|
4
4
|
"description": "Line height feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (https://cksource.com/)",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"dist/translations/*.umd.js"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ckeditor/ckeditor5-core": "49.0.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-engine": "49.0.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-icons": "49.0.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-list": "49.0.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-ui": "49.0.0-alpha.
|
|
34
|
-
"@ckeditor/ckeditor5-utils": "49.0.0-alpha.
|
|
29
|
+
"@ckeditor/ckeditor5-core": "49.0.0-alpha.4",
|
|
30
|
+
"@ckeditor/ckeditor5-engine": "49.0.0-alpha.4",
|
|
31
|
+
"@ckeditor/ckeditor5-icons": "49.0.0-alpha.4",
|
|
32
|
+
"@ckeditor/ckeditor5-list": "49.0.0-alpha.4",
|
|
33
|
+
"@ckeditor/ckeditor5-ui": "49.0.0-alpha.4",
|
|
34
|
+
"@ckeditor/ckeditor5-utils": "49.0.0-alpha.4"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist",
|