@ckeditor/ckeditor5-line-height 48.3.0-alpha.4 → 48.3.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as _0x14906a,Plugin as _0x23a6b4}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x56a905,Collection as _0x2d2011,first as _0x50a65a,uid as _0x6fe0b8}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x3c118b,isPercentageStyleValue as _0xfee8b2}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x2c65f8,MenuBarMenuListItemView as _0x134ec1,MenuBarMenuListView as _0x4394ce,MenuBarMenuView as _0x4c3c41,UIModel as _0x3ca30d,addListToDropdown as _0x92fc69,createDropdown as _0x42478e}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x510d48}from'@ckeditor/ckeditor5-icons';var p=class extends _0x14906a{['refresh'](){const _0xcf9bf9=this['editor']['model']['document'],_0x2f9ba4=_0x50a65a(_0xcf9bf9['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x2f9ba4)&&this['_canHaveLineHeight'](_0x2f9ba4),this['value']=this['isEnabled']&&_0x2f9ba4['getAttribute']('lineHeight');}['execute'](_0x34621b={}){const _0xa7378f=this['editor']['model'],_0x5392c5=_0xa7378f['document']['selection'],_0x194737=_0x34621b['value'];_0xa7378f['change'](_0x3fa935=>{const _0x1fe913=Array['from'](_0x5392c5['getSelectedBlocks']())['filter'](_0x57248c=>this['_canHaveLineHeight'](_0x57248c));for(const _0x206a21 of _0x1fe913)_0x194737?_0x3fa935['setAttribute']('lineHeight',_0x194737,_0x206a21):_0x3fa935['removeAttribute']('lineHeight',_0x206a21);});}['_canHaveLineHeight'](_0x33c513){return this['editor']['model']['schema']['checkAttribute'](_0x33c513,'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(_0xc81c6c){return'string'==typeof _0xc81c6c&&'default'===_0xc81c6c['toLowerCase']();}function L(_0x6e14cd){return _0x6e14cd['options']['map'](_0x2f02df=>{return H(_0x2f02df)?{'title':String(_0x6e14cd['defaultValue']),'model':'default'}:('number'==typeof _0x2f02df&&(_0x2f02df=String(_0x2f02df)),'string'!=typeof _0x2f02df?_0x2f02df:parseFloat(_0x2f02df)?{'title':_0x2f02df,'model':_0x2f02df,'view':{'name':'span','styles':{'line-height':_0x2f02df}}}:'string'==typeof(_0x453770=_0x2f02df)?y[_0x453770]:y[_0x453770['model']]);var _0x453770;})['filter'](_0x1a92c8=>void 0x0!==_0x1a92c8);}var v=class extends _0x23a6b4{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {plugins:_0x581951,conversion:_0x434df2}=this['editor'];_0x581951['has']('ListEditing')&&_0x581951['has']('TodoListEditing')&&(_0x581951['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x3794a9,_0x417eba,_0x6f5419,_0x585987,_0x7a6ab3){'todo'==_0x7a6ab3['getAttribute']('listType')&&_0x417eba&&(_0x3794a9['addClass']('ck-list-marker-line-height',_0x6f5419),_0x3794a9['setStyle']('--ck-content-list-marker-line-height',_0x417eba,_0x6f5419));}}),_0x434df2['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x434df2['for']('upcast')['add'](_0x3b1681=>{_0x3b1681['on']('element:li',function(_0x4fe1a6){const _0x402e56=new _0x3c118b(_0x4fe1a6);return(_0x349a8d,_0x11d60d,_0x2548d4)=>{const _0x1bde6c=_0x402e56['match'](_0x11d60d['viewItem']);if(!_0x1bde6c)return;const _0x19c21a=_0x1bde6c['match'];_0x19c21a['name']=!0x1,_0x2548d4['consumable']['consume'](_0x11d60d['viewItem'],_0x19c21a);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x23a6b4{static get['pluginName'](){return'LineHeightEditing';}static get['requires'](){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x13d166){super(_0x13d166),_0x13d166['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}['init'](){const _0x25f8a1=this['editor'];this['_validateConfig'](),_0x25f8a1['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x25f8a1['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x25f8a1['commands']['add']('lineHeight',new p(_0x25f8a1)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}['afterInit'](){!async function(_0x224d2a){const _0x52775d='PHQ3YUIBrl0XdnwG9kez8sfpMv1ytWFRNZOV5jJaq7Tc2ogub64xCKDEALSihm',_0x2c4f4b=0x78e28,_0x2f8c20=window['Date']['now'](),_0x5c721f=_0x224d2a['editor'],_0x1a56c4=new window['Promise'](_0x5857f3=>{_0x5c721f['once']('ready',_0x5857f3);}),_0x4f8488={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x210377=_0x5c721f['config']['get']('licenseKey');async function _0x4a4f6d(){let _0x263323,_0x401b34=null,_0x45355a=null;try{return'GPL'==_0x210377?'NotAllowed':(_0x263323=_0x3a97e5(),_0x263323?(_0x263323['usageEndpoint']&&(_0x45355a=_0x280fe3(_0x263323['usageEndpoint'],_0x263323['jti'])),await _0x6c7834()?_0x4326f8()?_0x26f18a()?'Expired':_0x9f39b7()?('evaluation'==_0x263323['licenseType']&&(_0x401b34=_0x55d363('EvaluationLimit')),await _0x1f41a5()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x26f18a(){const _0x4b4a7d=['evaluation','trial']['includes'](_0x263323['licenseType'])?_0x2f8c20/0x3e8:0xe10*_0x2c4f4b;return _0x263323['exp']<_0x4b4a7d;}function _0x4326f8(){const _0x52e6d7=_0x263323['features'];return!!_0x52e6d7&&(!!_0x52e6d7['includes']('*')||!!_0x52e6d7['includes']('LH'));}function _0x9f39b7(){const _0x4343a1=_0x263323['licensedHosts'];if(!_0x4343a1||0x0==_0x4343a1['length'])return!0x0;const {hostname:_0x1e2fe6}=new URL(window['location']['href']);if(_0x4343a1['includes'](_0x1e2fe6))return!0x0;const _0x1e937d=_0x1e2fe6['split']('.');return _0x4343a1['filter'](_0x1f643b=>_0x1f643b['includes']('*'))['map'](_0x208d08=>_0x208d08['split']('.'))['filter'](_0x3540a4=>_0x3540a4['length']<=_0x1e937d['length'])['map'](_0x2e4c78=>Array(_0x1e937d['length']-_0x2e4c78['length'])['fill']('*'===_0x2e4c78[0x0]?'*':'')['concat'](_0x2e4c78))['some'](_0x26bb5a=>_0x1e937d['every']((_0x29f7d5,_0x3c3913)=>_0x26bb5a[_0x3c3913]===_0x29f7d5||'*'===_0x26bb5a[_0x3c3913]));}function _0x1f41a5(){return _0x401b34&&_0x45355a?new window['Promise']((_0x154150,_0x1c331a)=>{_0x401b34['then'](_0x154150,_0x1c331a),_0x45355a['then'](_0x55d672=>{'Valid'!=_0x55d672&&_0x154150(_0x55d672);},_0x1c331a);}):_0x401b34||_0x45355a||'Valid';}}function _0x280fe3(_0x1c47ac,_0x120a32){return new window['Promise'](_0x3919a8=>{if(_0x404ffc())return _0x3919a8('Valid');_0x3278ab(),_0x5c721f['decorate']('_sendUsageRequest');let _0x285192=!0x1;const _0x35e94f=_0x6fe0b8();function _0x446198(_0x1aec9e){return!!_0x1aec9e&&('object'==typeof _0x1aec9e||'function'==typeof _0x1aec9e)&&'function'==typeof _0x1aec9e['then']&&'function'==typeof _0x1aec9e['catch'];}function _0x5c1a8f(_0x27a3df){_0xc88841(_0x27a3df)['then'](_0x3fa908=>_0x3fa908&&'ok'==_0x3fa908['status']?_0x1274ad(_0x5e379c(_0x35e94f+_0x120a32))!=_0x3fa908['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x41b70a=>(_0x5de1c2(),_0x41b70a),()=>{const _0x1e0873=_0x5f43d8();return null==_0x1e0873?(_0x5de1c2(),'Valid'):_0x2f8c20-_0x1e0873>0x240c8400?'UsageLimit':'Valid';})['then'](_0x3919a8)['catch'](()=>{_0x3919a8('UsageLimit');});const _0x2bf789=0x36ee80;function _0x5de1c2(){const _0x1235cb='llct-'+_0x1274ad(_0x5e379c(_0x1c47ac)),_0x3688c1=_0xba88ce(_0x1274ad(window['Math']['ceil'](_0x2f8c20/_0x2bf789)));window['localStorage']['setItem'](_0x1235cb,_0x3688c1);}function _0x5f43d8(){const _0x581bce='llct-'+_0x1274ad(_0x5e379c(_0x1c47ac)),_0x2d406f=window['localStorage']['getItem'](_0x581bce);return _0x2d406f?window['parseInt'](_0xba88ce(_0x2d406f),0x10)*_0x2bf789:null;}function _0xc88841(_0x47aa07){return new window['Promise']((_0x4e0dee,_0x2642c7)=>{_0x47aa07['then'](_0x4e0dee,_0x2642c7),window['setTimeout'](_0x2642c7,0x1d4c0);});}}_0x5c721f['on']('_sendUsageRequest',(_0x325723,_0x207ca7)=>{if(_0x207ca7[0x0]!=_0x1c47ac)return _0x3919a8('UsageLimit');_0x207ca7[0x1]={..._0x207ca7[0x1],'requestId':_0x35e94f};},{'priority':'high'}),_0x5c721f['on']('_sendUsageRequest',_0x32671d=>{_0x446198(_0x32671d['return'])&&(_0x285192=!0x0,_0x5c1a8f(_0x32671d['return']));},{'priority':'low'}),_0x1a56c4['then'](()=>{_0x285192||_0x3919a8('UsageLimit');});});function _0x404ffc(){return'auto'==_0x5c721f['editing']['view']['_overlayModeHint'];}function _0x3278ab(){_0x5c721f['editing']['view']['_overlayModeHint']='auto';}}function _0x55d363(_0x92f35){const _0xd32153=[new window['Promise'](_0x9ed398=>setTimeout(_0x9ed398,0x93ecc)),_0x1a56c4['then'](()=>new window['Promise'](_0x492524=>{let _0x4d5934=0x0;_0x5c721f['model']['on']('applyOperation',(_0x218f66,_0x4726d8)=>{_0x4726d8[0x0]['isDocumentOperation']&&_0x4d5934++,0x5e8==_0x4d5934&&(_0x492524(),_0x218f66['off']());});}))];return window['Promise']['race'](_0xd32153)['then'](()=>_0x92f35);}async function _0x81167(){await _0x1a56c4,_0x5c721f['model']['change']=_0x3d8911,_0x5c721f['model']['enqueueChange']=_0x3d8911,_0x5c721f['enableReadOnlyMode']('model');}function _0x364232(_0x27745a){const _0x3ecd83=_0x33271b();_0x5c721f[_0x3ecd83]='lineHeightLicenseKey'+_0x27745a,'Valid'!=_0x27745a&&_0x81167();}function _0x33271b(){const _0x3d9f96=window['String'](window['performance']['now']())['replace']('.','');let _0x427453='P';for(let _0x327ef2=0x0;_0x327ef2<_0x3d9f96['length'];_0x327ef2+=0x2){let _0x49600f=window['parseInt'](_0x3d9f96['substring'](_0x327ef2,_0x327ef2+0x2));_0x49600f>=0x3e&&(_0x49600f-=0x3e),_0x427453+=_0x52775d[_0x49600f];}return _0x427453;}function _0x3a97e5(){const _0x4c7006=_0x210377['split']('.');if(0x3!=_0x4c7006['length'])return null;return _0x52ab7d(_0x4c7006[0x1]);function _0x52ab7d(_0x5f58d1){const _0x43ecff=_0x51f61d(_0x5f58d1);return _0x43ecff&&_0x564ffc()?_0x43ecff:null;function _0x564ffc(){const _0x470f17=_0x43ecff['jti'],_0x527b7b=window['parseInt'](_0x470f17['substring'](_0x470f17['length']-0x8),0x10),_0x23f6f3={..._0x43ecff,'jti':_0x470f17['substring'](0x0,_0x470f17['length']-0x8)};return delete _0x23f6f3['vc'],_0x5e379c(_0x23f6f3)==_0x527b7b;}}}async function _0x6c7834(){let _0x3a4afb=!0x0;try{const [_0x515983,_0x1dcd5e,_0x4b27d3]=_0x210377['split']('.');return _0x4faafb(_0x515983),await _0x4744aa(_0x515983,_0x1dcd5e,_0x4b27d3),_0x3a4afb;}catch{return!0x1;}function _0x4faafb(_0x55019b){const _0x5e506c=_0x51f61d(_0x55019b);_0x5e506c&&'ES256'==_0x5e506c['alg']||(_0x3a4afb=!0x1);}async function _0x4744aa(_0x11dcac,_0x150eb8,_0x354510){const _0x5cb141=window['Uint8Array']['from'](_0x984201(_0x354510),_0x104816=>_0x104816['charCodeAt'](0x0)),_0x4b01e4=new window['TextEncoder']()['encode'](_0x11dcac+'.'+_0x150eb8),_0x2cedad=window['crypto']['subtle'];if(!_0x2cedad)return;const _0x59782c=await _0x2cedad['importKey']('jwk',_0x4f8488,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2cedad['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x59782c,_0x5cb141,_0x4b01e4)||(_0x3a4afb=!0x1);}}function _0x51f61d(_0xb8559d){return _0xb8559d['startsWith']('ey')?JSON['parse'](_0x984201(_0xb8559d)):null;}function _0x984201(_0x997827){return window['atob'](_0x997827['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5e379c(_0x4b87a0){let _0x5199d6=0x1505;function _0x11a57f(_0x2ed11d){for(let _0x4b9014=0x0;_0x4b9014<_0x2ed11d['length'];_0x4b9014++){const _0x2e329c=_0x2ed11d['charCodeAt'](_0x4b9014);_0x5199d6=(_0x5199d6<<0x5)+_0x5199d6+_0x2e329c,_0x5199d6&=_0x5199d6;}}function _0x33514f(_0x3db0d9){Array['isArray'](_0x3db0d9)?_0x3db0d9['forEach'](_0x33514f):_0x3db0d9&&'object'==typeof _0x3db0d9?Object['entries'](_0x3db0d9)['sort']()['forEach'](([_0xd8fb59,_0x38a432])=>{_0x11a57f(_0xd8fb59),_0x33514f(_0x38a432);}):_0x11a57f(window['String'](_0x3db0d9));}return _0x33514f(_0x4b87a0),_0x5199d6>>>0x0;}function _0x1274ad(_0x4a10d8){return _0x4a10d8['toString'](0x10)['padStart'](0x8,'0');}function _0xba88ce(_0x3e3e87){return _0x3e3e87['split']('')['reverse']()['join']('');}function _0x3d8911(){}_0x364232(await _0x4a4f6d());}(this);}['_validateConfig'](){const _0x27de53=this['editor'];if(!_0x27de53['config']['get']('lineHeight.supportAllValues'))return;const _0x41be96=_0x27de53['config']['get']('lineHeight.options')['filter'](_0xe64fe0=>'string'==typeof _0xe64fe0&&(!H(_0xe64fe0)&&isNaN(Number(_0xe64fe0))));if(_0x41be96['length'])throw new _0x56a905('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x41be96});}['_prepareAnyValueConverters'](){const _0x289d68=this['editor'],_0x246837=this['editor']['config']['get']('lineHeight.defaultValue');_0x289d68['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x17223e=>String(_0x17223e)===String(_0x246837)?null:{'key':'style','value':{'line-height':_0x17223e}}}),_0x289d68['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x5914b0=>{let _0x414a90=_0x5914b0['getStyle']('line-height');return _0xfee8b2(_0x414a90)&&(_0x414a90=String(Number(_0x414a90['slice'](0x0,-0x1))/0x64)),String(_0x414a90)===String(_0x246837)?null:_0x414a90;}},'view':{'styles':{'line-height':/.*/}}});}['_preparePredefinedConverters'](){const _0x5c591a=this['editor'],_0x1b6a9d=this['editor']['config']['get']('lineHeight.defaultValue'),_0x47adc3=function(_0x260d34,_0x431e59){const _0x13ab48={'model':{'key':_0x260d34,'values':[]},'view':{}};for(const _0x29721c of _0x431e59)'class'===_0x29721c['view']?.['key']?(_0x13ab48['model']['values']['push'](_0x29721c['model']),_0x13ab48['view'][_0x29721c['model']]={'key':'class','value':_0x29721c['view']['value']}):(_0x13ab48['model']['values']['push'](_0x29721c['model']),_0x13ab48['view'][_0x29721c['model']]={'key':'style','value':'line-height:'+_0x29721c['model']+';'});return _0x13ab48;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x440992=>_0x440992['model']));_0x5c591a['conversion']['attributeToAttribute'](_0x47adc3),_0x5c591a['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x19c61c=>{let _0x4fb4e7=_0x19c61c['getStyle']('line-height');return _0xfee8b2(_0x4fb4e7)&&(_0x4fb4e7=String(Number(_0x4fb4e7['slice'](0x0,-0x1))/0x64)),_0x4fb4e7===String(_0x1b6a9d)?null:_0x47adc3['model']['values']['includes'](_0x4fb4e7)?_0x4fb4e7:null;}}});}},k=class extends _0x23a6b4{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x301b0d={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x301b0d),this['_registerMenuBarComponent'](_0x301b0d),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xddb612=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xa77895;for(const _0x4e72bc in _0xddb612){const _0x152930=_0x4e72bc,_0x5b66a0=_0xddb612[_0x152930];if('lineHeightLicenseKeyValid'==_0x5b66a0||'lineHeightLicenseKeyInvalid'==_0x5b66a0||'lineHeightLicenseKeyExpired'==_0x5b66a0||'lineHeightLicenseKeyDomainLimit'==_0x5b66a0||'lineHeightLicenseKeyNotAllowed'==_0x5b66a0||'lineHeightLicenseKeyEvaluationLimit'==_0x5b66a0||'lineHeightLicenseKeyUsageLimit'==_0x5b66a0){delete _0xddb612[_0x152930],_0xa77895=_0x5b66a0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0xa77895&&_0xddb612['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0xa77895&&_0xddb612['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0xa77895&&_0xddb612['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0xa77895&&_0xddb612['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0xa77895&&_0xddb612['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0xa77895&&_0xddb612['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_shouldRenderCustomValueOption'](){return this['editor']['config']['get']('lineHeight.supportAllValues');}['_getLocalizedLineHeightOptions'](){const _0x1741b6=this['editor'],t=_0x1741b6['t'],_0x5d6d52=_0x1741b6['config']['get']('lineHeight'),_0xd08cc7={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x5d6d52)['map'](_0x1add54=>{const _0x4a7eaf=_0xd08cc7[_0x1add54['title']];return _0x4a7eaf&&_0x4a7eaf!=_0x1add54['title']&&(_0x1add54=Object['assign']({},_0x1add54,{'title':_0x4a7eaf})),_0x1add54;});}['_prepareListOptions'](){const _0x2b438c=this['editor']['commands']['get']('lineHeight'),_0x25ec04=this['editor']['config']['get']('lineHeight.defaultValue'),_0x422780=this['_getLocalizedLineHeightOptions'](),_0x2f0026=new _0x2d2011(),_0x22be5b=_0x273c25=>'default'===_0x273c25||String(_0x25ec04)===_0x273c25;for(const _0x3a0530 of _0x422780){const _0x52a8b5={'type':'button','model':new _0x3ca30d({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x3a0530['title'],'withText':!0x0})};_0x22be5b(_0x3a0530['model'])?(_0x52a8b5['model']['bind']('isOn')['to'](_0x2b438c,'value',_0xf848be=>!_0xf848be),_0x52a8b5['model']['commandParam']=void 0x0):(_0x52a8b5['model']['bind']('isOn')['to'](_0x2b438c,'value',_0x5b6b3d=>_0x5b6b3d===_0x3a0530['model']),_0x52a8b5['model']['commandParam']=_0x3a0530['model']),_0x2f0026['add'](_0x52a8b5);}if(this['_shouldRenderCustomValueOption']()){const _0x3a4691=this['_getCustomValueOptionDefinition'](_0x422780);_0x2f0026['add'](_0x3a4691);}return _0x2f0026;}['_getCustomValueOptionDefinition'](_0x1ee455){const _0x35eb7f=this['editor'],t=_0x35eb7f['t'],_0x3ec425=_0x35eb7f['commands']['get']('lineHeight'),_0x349cb3=_0x1ee455['map'](_0x4006ff=>_0x4006ff['model']),_0x287e94={'type':'button','model':new _0x3ca30d({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x287e94['model']['bind']('commandParam')['to'](_0x3ec425,'value'),_0x287e94['model']['bind']('isOn')['to'](_0x3ec425,'value',_0x3cbfbe=>!!_0x3cbfbe&&!_0x349cb3['includes'](String(_0x3cbfbe))),_0x287e94['model']['bind']('label')['to'](_0x3ec425,'value',_0x14caa7=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x14caa7))),_0x287e94;}['_registerToolbarComponent']({accessibleLabel:_0x3eb68f,options:_0x46a095}){const _0x4d914d=this['editor'],_0x456f06=_0x4d914d['commands']['get']('lineHeight');_0x4d914d['ui']['componentFactory']['add']('lineHeight',_0x2c10f3=>{const _0x37f095=_0x42478e(_0x2c10f3);return _0x92fc69(_0x37f095,_0x46a095,{'role':'menu','ariaLabel':_0x3eb68f}),_0x37f095['buttonView']['set']({'label':_0x3eb68f,'tooltip':!0x0,'icon':_0x510d48}),_0x37f095['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x37f095['bind']('isEnabled')['to'](_0x456f06),this['listenTo'](_0x37f095,'execute',_0x1875e4=>{_0x4d914d['execute'](_0x1875e4['source']['commandName'],{'value':_0x1875e4['source']['commandParam']}),_0x4d914d['editing']['view']['focus']();}),_0x37f095['once']('change:isOpen',()=>{const _0x2a7a03=_0x37f095['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x37f095,_0x46a095,_0x2a7a03);}),_0x37f095;});}['_registerMenuBarComponent']({accessibleLabel:_0x3acb12,options:_0x40e379}){const _0x3494f0=this['editor'],_0x527a7b=_0x3494f0['commands']['get']('lineHeight');_0x3494f0['ui']['componentFactory']['add']('menuBar:lineHeight',_0x5be42b=>{const _0x4a9bfc=new _0x4c3c41(_0x5be42b);_0x4a9bfc['buttonView']['set']({'label':_0x3acb12,'icon':_0x510d48}),_0x4a9bfc['bind']('isEnabled')['to'](_0x527a7b);const _0x2d6749=new _0x4394ce(_0x5be42b);for(const _0x3a4027 of _0x40e379){const _0x2a8104=new _0x134ec1(_0x5be42b,_0x4a9bfc),_0x569b8e=new _0x2c65f8(_0x5be42b);_0x569b8e['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x569b8e['bind'](...Object['keys'](_0x3a4027['model']))['to'](_0x3a4027['model']),_0x569b8e['delegate']('execute')['to'](_0x4a9bfc),_0x569b8e['on']('execute',()=>{_0x3494f0['execute'](_0x3a4027['model']['commandName'],{'value':_0x3a4027['model']['commandParam']}),_0x3494f0['editing']['view']['focus']();}),_0x2a8104['children']['add'](_0x569b8e),_0x2d6749['items']['add'](_0x2a8104);}return _0x4a9bfc['panelView']['children']['add'](_0x2d6749),this['_attachCustomOptionVisibilityHandler'](_0x4a9bfc,_0x40e379,_0x2d6749),_0x4a9bfc;});}['_attachCustomOptionVisibilityHandler'](_0x83d71d,_0x44fc57,_0x543bc6){if(!this['_shouldRenderCustomValueOption']())return;const _0x411e48=()=>{if(!_0x83d71d['isOpen'])return;_0x543bc6['items']['last']['isVisible']=Boolean(_0x44fc57['last']['model']['isOn']);};_0x411e48(),_0x83d71d['on']('change:isOpen',()=>{_0x411e48();});}},_=class extends _0x23a6b4{static get['requires'](){return[b,k];}static get['pluginName'](){return'LineHeight';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{_ as LineHeight,p as LineHeightCommand,b as LineHeightEditing,v as LineHeightTodoListIntegration,k as LineHeightUI};
|
|
23
|
+
import{Command as _0x44c19b,Plugin as _0x4ef410}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x28b51e,Collection as _0x241c88,first as _0x1c93b5,uid as _0x516a77}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x293e27,isPercentageStyleValue as _0x3e34b2}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x3d9787,MenuBarMenuListItemView as _0x1182ac,MenuBarMenuListView as _0xb30685,MenuBarMenuView as _0x2ee97c,UIModel as _0x50187e,addListToDropdown as _0x43bbdb,createDropdown as _0x5cac11}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x29df28}from'@ckeditor/ckeditor5-icons';var p=class extends _0x44c19b{['refresh'](){const _0x4e548a=this['editor']['model']['document'],_0x55ae2a=_0x1c93b5(_0x4e548a['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x55ae2a)&&this['_canHaveLineHeight'](_0x55ae2a),this['value']=this['isEnabled']&&_0x55ae2a['getAttribute']('lineHeight');}['execute'](_0x48ba35={}){const _0xc1d70e=this['editor']['model'],_0x18f6ae=_0xc1d70e['document']['selection'],_0xc17f19=_0x48ba35['value'];_0xc1d70e['change'](_0x480e53=>{const _0x51da2f=Array['from'](_0x18f6ae['getSelectedBlocks']())['filter'](_0x3f4908=>this['_canHaveLineHeight'](_0x3f4908));for(const _0x1c5f2b of _0x51da2f)_0xc17f19?_0x480e53['setAttribute']('lineHeight',_0xc17f19,_0x1c5f2b):_0x480e53['removeAttribute']('lineHeight',_0x1c5f2b);});}['_canHaveLineHeight'](_0x4c85e3){return this['editor']['model']['schema']['checkAttribute'](_0x4c85e3,'lineHeight');}};const y={get 'single'(){return{'title':'Single','model':'single','view':{'key':'class','value':'line-height-single'}};},get 'double'(){return{'title':'Double','model':'double','view':{'key':'class','value':'line-height-double'}};}};function H(_0x17cb91){return'string'==typeof _0x17cb91&&'default'===_0x17cb91['toLowerCase']();}function L(_0x1bc4da){return _0x1bc4da['options']['map'](_0x4732da=>{return H(_0x4732da)?{'title':String(_0x1bc4da['defaultValue']),'model':'default'}:('number'==typeof _0x4732da&&(_0x4732da=String(_0x4732da)),'string'!=typeof _0x4732da?_0x4732da:parseFloat(_0x4732da)?{'title':_0x4732da,'model':_0x4732da,'view':{'name':'span','styles':{'line-height':_0x4732da}}}:'string'==typeof(_0x287ec8=_0x4732da)?y[_0x287ec8]:y[_0x287ec8['model']]);var _0x287ec8;})['filter'](_0x849a03=>void 0x0!==_0x849a03);}var v=class extends _0x4ef410{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {plugins:_0x5acd42,conversion:_0x1f1612}=this['editor'];_0x5acd42['has']('ListEditing')&&_0x5acd42['has']('TodoListEditing')&&(_0x5acd42['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x1ec70a,_0xd937b6,_0x31ec99,_0x524277,_0x37a51a){'todo'==_0x37a51a['getAttribute']('listType')&&_0xd937b6&&(_0x1ec70a['addClass']('ck-list-marker-line-height',_0x31ec99),_0x1ec70a['setStyle']('--ck-content-list-marker-line-height',_0xd937b6,_0x31ec99));}}),_0x1f1612['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x1f1612['for']('upcast')['add'](_0x3b043a=>{_0x3b043a['on']('element:li',function(_0x28a030){const _0x46da79=new _0x293e27(_0x28a030);return(_0x4ec1c0,_0xc907c2,_0x59e0c3)=>{const _0x42e879=_0x46da79['match'](_0xc907c2['viewItem']);if(!_0x42e879)return;const _0x52b62f=_0x42e879['match'];_0x52b62f['name']=!0x1,_0x59e0c3['consumable']['consume'](_0xc907c2['viewItem'],_0x52b62f);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x4ef410{static get['pluginName'](){return'LineHeightEditing';}static get['requires'](){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x435678){super(_0x435678),_0x435678['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}['init'](){const _0x501a40=this['editor'];this['_validateConfig'](),_0x501a40['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x501a40['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x501a40['commands']['add']('lineHeight',new p(_0x501a40)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}['afterInit'](){!async function(_0xfa8648){const _0x4bac85='PHQ3YUIBrl0XdnwG9kez8sfpMv1ytWFRNZOV5jJaq7Tc2ogub64xCKDEALSihm',_0x336f47=0x78e58,_0x2df0ee=window['Date']['now'](),_0x2d245d=_0xfa8648['editor'],_0x56e1ea=new window['Promise'](_0xb08f2=>{_0x2d245d['once']('ready',_0xb08f2);}),_0x5eb4fb={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x2423f9=_0x2d245d['config']['get']('licenseKey');async function _0x1d4caf(){let _0x3b4e7a,_0x130058=null,_0x20d68c=null;try{return'GPL'==_0x2423f9?'NotAllowed':(_0x3b4e7a=_0x1de784(),_0x3b4e7a?(_0x3b4e7a['usageEndpoint']&&(_0x20d68c=_0x28c4cb(_0x3b4e7a['usageEndpoint'],_0x3b4e7a['jti'])),await _0x1e3f3e()?_0xfda6e8()?_0x325dcf()?'Expired':_0x42e34e()?('evaluation'==_0x3b4e7a['licenseType']&&(_0x130058=_0x12fda5('EvaluationLimit')),await _0x3a5846()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x325dcf(){const _0x11d2d5=['evaluation','trial']['includes'](_0x3b4e7a['licenseType'])?_0x2df0ee/0x3e8:0xe10*_0x336f47;return _0x3b4e7a['exp']<_0x11d2d5;}function _0xfda6e8(){const _0x2b9777=_0x3b4e7a['features'];return!!_0x2b9777&&(!!_0x2b9777['includes']('*')||!!_0x2b9777['includes']('LH'));}function _0x42e34e(){const _0x450339=_0x3b4e7a['licensedHosts'];if(!_0x450339||0x0==_0x450339['length'])return!0x0;const {hostname:_0x1b1279}=new URL(window['location']['href']);if(_0x450339['includes'](_0x1b1279))return!0x0;const _0x49b700=_0x1b1279['split']('.');return _0x450339['filter'](_0x22dba9=>_0x22dba9['includes']('*'))['map'](_0x33a9d2=>_0x33a9d2['split']('.'))['filter'](_0x7a3d0a=>_0x7a3d0a['length']<=_0x49b700['length'])['map'](_0x13f14e=>Array(_0x49b700['length']-_0x13f14e['length'])['fill']('*'===_0x13f14e[0x0]?'*':'')['concat'](_0x13f14e))['some'](_0x36cfdd=>_0x49b700['every']((_0x274658,_0x89cef5)=>_0x36cfdd[_0x89cef5]===_0x274658||'*'===_0x36cfdd[_0x89cef5]));}function _0x3a5846(){return _0x130058&&_0x20d68c?new window['Promise']((_0x598c4a,_0x36aa7a)=>{_0x130058['then'](_0x598c4a,_0x36aa7a),_0x20d68c['then'](_0x36b1b6=>{'Valid'!=_0x36b1b6&&_0x598c4a(_0x36b1b6);},_0x36aa7a);}):_0x130058||_0x20d68c||'Valid';}}function _0x28c4cb(_0x30cb9b,_0x3b5d56){return new window['Promise'](_0x2a326a=>{if(_0x403806())return _0x2a326a('Valid');_0x34af6c(),_0x2d245d['decorate']('_sendUsageRequest');let _0x3b1bea=!0x1;const _0x16af32=_0x516a77();function _0x222c31(_0x3adcc6){return!!_0x3adcc6&&('object'==typeof _0x3adcc6||'function'==typeof _0x3adcc6)&&'function'==typeof _0x3adcc6['then']&&'function'==typeof _0x3adcc6['catch'];}function _0x3f0622(_0x1c4b6d){_0x8b7fc1(_0x1c4b6d)['then'](_0x4285ee=>_0x4285ee&&'ok'==_0x4285ee['status']?_0x4e3ed9(_0x2a01ab(_0x16af32+_0x3b5d56))!=_0x4285ee['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0xb116ad=>(_0x3ac9d7(),_0xb116ad),()=>{const _0x142bf4=_0xcf8856();return null==_0x142bf4?(_0x3ac9d7(),'Valid'):_0x2df0ee-_0x142bf4>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2a326a)['catch'](()=>{_0x2a326a('UsageLimit');});const _0x1faadf=0x36ee80;function _0x3ac9d7(){const _0x566394='llct-'+_0x4e3ed9(_0x2a01ab(_0x30cb9b)),_0x4e04a5=_0x1b6093(_0x4e3ed9(window['Math']['ceil'](_0x2df0ee/_0x1faadf)));window['localStorage']['setItem'](_0x566394,_0x4e04a5);}function _0xcf8856(){const _0x34f7af='llct-'+_0x4e3ed9(_0x2a01ab(_0x30cb9b)),_0xc8c0a8=window['localStorage']['getItem'](_0x34f7af);return _0xc8c0a8?window['parseInt'](_0x1b6093(_0xc8c0a8),0x10)*_0x1faadf:null;}function _0x8b7fc1(_0x5a514e){return new window['Promise']((_0x479145,_0x136a47)=>{_0x5a514e['then'](_0x479145,_0x136a47),window['setTimeout'](_0x136a47,0x1d4c0);});}}_0x2d245d['on']('_sendUsageRequest',(_0x28f1fe,_0x112a7d)=>{if(_0x112a7d[0x0]!=_0x30cb9b)return _0x2a326a('UsageLimit');_0x112a7d[0x1]={..._0x112a7d[0x1],'requestId':_0x16af32};},{'priority':'high'}),_0x2d245d['on']('_sendUsageRequest',_0x17ae40=>{_0x222c31(_0x17ae40['return'])&&(_0x3b1bea=!0x0,_0x3f0622(_0x17ae40['return']));},{'priority':'low'}),_0x56e1ea['then'](()=>{_0x3b1bea||_0x2a326a('UsageLimit');});});function _0x403806(){return'auto'==_0x2d245d['editing']['view']['_overlayModeHint'];}function _0x34af6c(){_0x2d245d['editing']['view']['_overlayModeHint']='auto';}}function _0x12fda5(_0x480ead){const _0x4ec7f8=[new window['Promise'](_0x50cab7=>setTimeout(_0x50cab7,0x93ecc)),_0x56e1ea['then'](()=>new window['Promise'](_0x4fcd47=>{let _0x280c19=0x0;_0x2d245d['model']['on']('applyOperation',(_0x37c9e4,_0x191bfc)=>{_0x191bfc[0x0]['isDocumentOperation']&&_0x280c19++,0x5e8==_0x280c19&&(_0x4fcd47(),_0x37c9e4['off']());});}))];return window['Promise']['race'](_0x4ec7f8)['then'](()=>_0x480ead);}async function _0x1a6db6(){await _0x56e1ea,_0x2d245d['model']['change']=_0x21f4a3,_0x2d245d['model']['enqueueChange']=_0x21f4a3,_0x2d245d['enableReadOnlyMode']('model');}function _0x4eeab2(_0x1ffaff){const _0x17a3a9=_0x41284c();_0x2d245d[_0x17a3a9]='lineHeightLicenseKey'+_0x1ffaff,'Valid'!=_0x1ffaff&&_0x1a6db6();}function _0x41284c(){const _0x382697=window['String'](window['performance']['now']())['replace']('.','');let _0x2d4c88='P';for(let _0x3cdb0f=0x0;_0x3cdb0f<_0x382697['length'];_0x3cdb0f+=0x2){let _0x479bdb=window['parseInt'](_0x382697['substring'](_0x3cdb0f,_0x3cdb0f+0x2));_0x479bdb>=0x3e&&(_0x479bdb-=0x3e),_0x2d4c88+=_0x4bac85[_0x479bdb];}return _0x2d4c88;}function _0x1de784(){const _0x1db5b1=_0x2423f9['split']('.');if(0x3!=_0x1db5b1['length'])return null;return _0x1bc199(_0x1db5b1[0x1]);function _0x1bc199(_0x67e5b6){const _0x5ab8ad=_0x94e2db(_0x67e5b6);return _0x5ab8ad&&_0x16e451()?_0x5ab8ad:null;function _0x16e451(){const _0x4c1e29=_0x5ab8ad['jti'],_0x538c47=window['parseInt'](_0x4c1e29['substring'](_0x4c1e29['length']-0x8),0x10),_0x1b61ed={..._0x5ab8ad,'jti':_0x4c1e29['substring'](0x0,_0x4c1e29['length']-0x8)};return delete _0x1b61ed['vc'],_0x2a01ab(_0x1b61ed)==_0x538c47;}}}async function _0x1e3f3e(){let _0x30d2e2=!0x0;try{const [_0x1c9cb4,_0x56be69,_0x290f1f]=_0x2423f9['split']('.');return _0x5d3f22(_0x1c9cb4),await _0x3fde41(_0x1c9cb4,_0x56be69,_0x290f1f),_0x30d2e2;}catch{return!0x1;}function _0x5d3f22(_0x25c533){const _0x2608cd=_0x94e2db(_0x25c533);_0x2608cd&&'ES256'==_0x2608cd['alg']||(_0x30d2e2=!0x1);}async function _0x3fde41(_0x296241,_0x24966e,_0x3a308a){const _0x2ca358=window['Uint8Array']['from'](_0x3412e3(_0x3a308a),_0x12c371=>_0x12c371['charCodeAt'](0x0)),_0xed4cff=new window['TextEncoder']()['encode'](_0x296241+'.'+_0x24966e),_0x2c1fba=window['crypto']['subtle'];if(!_0x2c1fba)return;const _0x4a5328=await _0x2c1fba['importKey']('jwk',_0x5eb4fb,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2c1fba['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4a5328,_0x2ca358,_0xed4cff)||(_0x30d2e2=!0x1);}}function _0x94e2db(_0x5ef9a2){return _0x5ef9a2['startsWith']('ey')?JSON['parse'](_0x3412e3(_0x5ef9a2)):null;}function _0x3412e3(_0x4e8fe0){return window['atob'](_0x4e8fe0['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2a01ab(_0x3cf684){let _0x285813=0x1505;function _0xc39657(_0x4cb49a){for(let _0xad0de5=0x0;_0xad0de5<_0x4cb49a['length'];_0xad0de5++){const _0x23fa3b=_0x4cb49a['charCodeAt'](_0xad0de5);_0x285813=(_0x285813<<0x5)+_0x285813+_0x23fa3b,_0x285813&=_0x285813;}}function _0x44c9bf(_0x3c268f){Array['isArray'](_0x3c268f)?_0x3c268f['forEach'](_0x44c9bf):_0x3c268f&&'object'==typeof _0x3c268f?Object['entries'](_0x3c268f)['sort']()['forEach'](([_0x274c25,_0x4781e2])=>{_0xc39657(_0x274c25),_0x44c9bf(_0x4781e2);}):_0xc39657(window['String'](_0x3c268f));}return _0x44c9bf(_0x3cf684),_0x285813>>>0x0;}function _0x4e3ed9(_0xf72e9c){return _0xf72e9c['toString'](0x10)['padStart'](0x8,'0');}function _0x1b6093(_0x7a263d){return _0x7a263d['split']('')['reverse']()['join']('');}function _0x21f4a3(){}_0x4eeab2(await _0x1d4caf());}(this);}['_validateConfig'](){const _0x52dd04=this['editor'];if(!_0x52dd04['config']['get']('lineHeight.supportAllValues'))return;const _0x8f8d4b=_0x52dd04['config']['get']('lineHeight.options')['filter'](_0x207ab0=>'string'==typeof _0x207ab0&&(!H(_0x207ab0)&&isNaN(Number(_0x207ab0))));if(_0x8f8d4b['length'])throw new _0x28b51e('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x8f8d4b});}['_prepareAnyValueConverters'](){const _0x33f0a8=this['editor'],_0x57a9fc=this['editor']['config']['get']('lineHeight.defaultValue');_0x33f0a8['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x4bf961=>String(_0x4bf961)===String(_0x57a9fc)?null:{'key':'style','value':{'line-height':_0x4bf961}}}),_0x33f0a8['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x296c3c=>{let _0x48ca50=_0x296c3c['getStyle']('line-height');return _0x3e34b2(_0x48ca50)&&(_0x48ca50=String(Number(_0x48ca50['slice'](0x0,-0x1))/0x64)),String(_0x48ca50)===String(_0x57a9fc)?null:_0x48ca50;}},'view':{'styles':{'line-height':/.*/}}});}['_preparePredefinedConverters'](){const _0x54ca72=this['editor'],_0x20e123=this['editor']['config']['get']('lineHeight.defaultValue'),_0x43930c=function(_0x1755f3,_0x3d4892){const _0x50d258={'model':{'key':_0x1755f3,'values':[]},'view':{}};for(const _0x5a9ec8 of _0x3d4892)'class'===_0x5a9ec8['view']?.['key']?(_0x50d258['model']['values']['push'](_0x5a9ec8['model']),_0x50d258['view'][_0x5a9ec8['model']]={'key':'class','value':_0x5a9ec8['view']['value']}):(_0x50d258['model']['values']['push'](_0x5a9ec8['model']),_0x50d258['view'][_0x5a9ec8['model']]={'key':'style','value':'line-height:'+_0x5a9ec8['model']+';'});return _0x50d258;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x1faf62=>_0x1faf62['model']));_0x54ca72['conversion']['attributeToAttribute'](_0x43930c),_0x54ca72['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x31bd58=>{let _0x2dc5fc=_0x31bd58['getStyle']('line-height');return _0x3e34b2(_0x2dc5fc)&&(_0x2dc5fc=String(Number(_0x2dc5fc['slice'](0x0,-0x1))/0x64)),_0x2dc5fc===String(_0x20e123)?null:_0x43930c['model']['values']['includes'](_0x2dc5fc)?_0x2dc5fc:null;}}});}},k=class extends _0x4ef410{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x13fcfd={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x13fcfd),this['_registerMenuBarComponent'](_0x13fcfd),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x13f84b=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3888a9;for(const _0x5ba907 in _0x13f84b){const _0x30e9ce=_0x5ba907,_0x4e3fcd=_0x13f84b[_0x30e9ce];if('lineHeightLicenseKeyValid'==_0x4e3fcd||'lineHeightLicenseKeyInvalid'==_0x4e3fcd||'lineHeightLicenseKeyExpired'==_0x4e3fcd||'lineHeightLicenseKeyDomainLimit'==_0x4e3fcd||'lineHeightLicenseKeyNotAllowed'==_0x4e3fcd||'lineHeightLicenseKeyEvaluationLimit'==_0x4e3fcd||'lineHeightLicenseKeyUsageLimit'==_0x4e3fcd){delete _0x13f84b[_0x30e9ce],_0x3888a9=_0x4e3fcd,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x3888a9&&_0x13f84b['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x3888a9&&_0x13f84b['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x3888a9&&_0x13f84b['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x3888a9&&_0x13f84b['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x3888a9&&_0x13f84b['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x3888a9&&_0x13f84b['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_shouldRenderCustomValueOption'](){return this['editor']['config']['get']('lineHeight.supportAllValues');}['_getLocalizedLineHeightOptions'](){const _0xefc918=this['editor'],t=_0xefc918['t'],_0x1e16ef=_0xefc918['config']['get']('lineHeight'),_0x3149be={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x1e16ef)['map'](_0x2ec346=>{const _0x4af2e2=_0x3149be[_0x2ec346['title']];return _0x4af2e2&&_0x4af2e2!=_0x2ec346['title']&&(_0x2ec346=Object['assign']({},_0x2ec346,{'title':_0x4af2e2})),_0x2ec346;});}['_prepareListOptions'](){const _0x3b932d=this['editor']['commands']['get']('lineHeight'),_0x28947e=this['editor']['config']['get']('lineHeight.defaultValue'),_0x396580=this['_getLocalizedLineHeightOptions'](),_0x1d1d08=new _0x241c88(),_0x2c6d8d=_0x4da173=>'default'===_0x4da173||String(_0x28947e)===_0x4da173;for(const _0x4bd9d5 of _0x396580){const _0x5d03f9={'type':'button','model':new _0x50187e({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x4bd9d5['title'],'withText':!0x0})};_0x2c6d8d(_0x4bd9d5['model'])?(_0x5d03f9['model']['bind']('isOn')['to'](_0x3b932d,'value',_0x1454ca=>!_0x1454ca),_0x5d03f9['model']['commandParam']=void 0x0):(_0x5d03f9['model']['bind']('isOn')['to'](_0x3b932d,'value',_0xab800b=>_0xab800b===_0x4bd9d5['model']),_0x5d03f9['model']['commandParam']=_0x4bd9d5['model']),_0x1d1d08['add'](_0x5d03f9);}if(this['_shouldRenderCustomValueOption']()){const _0x563f9c=this['_getCustomValueOptionDefinition'](_0x396580);_0x1d1d08['add'](_0x563f9c);}return _0x1d1d08;}['_getCustomValueOptionDefinition'](_0x428bfc){const _0x3d69ca=this['editor'],t=_0x3d69ca['t'],_0x49588b=_0x3d69ca['commands']['get']('lineHeight'),_0xa4aa0f=_0x428bfc['map'](_0x50cfe9=>_0x50cfe9['model']),_0x5cdf15={'type':'button','model':new _0x50187e({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x5cdf15['model']['bind']('commandParam')['to'](_0x49588b,'value'),_0x5cdf15['model']['bind']('isOn')['to'](_0x49588b,'value',_0x3ecb01=>!!_0x3ecb01&&!_0xa4aa0f['includes'](String(_0x3ecb01))),_0x5cdf15['model']['bind']('label')['to'](_0x49588b,'value',_0x160d93=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x160d93))),_0x5cdf15;}['_registerToolbarComponent']({accessibleLabel:_0x208672,options:_0x1f888a}){const _0x2a19dc=this['editor'],_0x4b3048=_0x2a19dc['commands']['get']('lineHeight');_0x2a19dc['ui']['componentFactory']['add']('lineHeight',_0x5330f2=>{const _0x37b82a=_0x5cac11(_0x5330f2);return _0x43bbdb(_0x37b82a,_0x1f888a,{'role':'menu','ariaLabel':_0x208672}),_0x37b82a['buttonView']['set']({'label':_0x208672,'tooltip':!0x0,'icon':_0x29df28}),_0x37b82a['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x37b82a['bind']('isEnabled')['to'](_0x4b3048),this['listenTo'](_0x37b82a,'execute',_0x2b551b=>{_0x2a19dc['execute'](_0x2b551b['source']['commandName'],{'value':_0x2b551b['source']['commandParam']}),_0x2a19dc['editing']['view']['focus']();}),_0x37b82a['once']('change:isOpen',()=>{const _0x1cc877=_0x37b82a['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x37b82a,_0x1f888a,_0x1cc877);}),_0x37b82a;});}['_registerMenuBarComponent']({accessibleLabel:_0x2ce115,options:_0x4bc9ae}){const _0x5937e3=this['editor'],_0x27664b=_0x5937e3['commands']['get']('lineHeight');_0x5937e3['ui']['componentFactory']['add']('menuBar:lineHeight',_0x179dbd=>{const _0x475f9a=new _0x2ee97c(_0x179dbd);_0x475f9a['buttonView']['set']({'label':_0x2ce115,'icon':_0x29df28}),_0x475f9a['bind']('isEnabled')['to'](_0x27664b);const _0x416953=new _0xb30685(_0x179dbd);for(const _0x447d9a of _0x4bc9ae){const _0x56c098=new _0x1182ac(_0x179dbd,_0x475f9a),_0x3f3f5f=new _0x3d9787(_0x179dbd);_0x3f3f5f['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x3f3f5f['bind'](...Object['keys'](_0x447d9a['model']))['to'](_0x447d9a['model']),_0x3f3f5f['delegate']('execute')['to'](_0x475f9a),_0x3f3f5f['on']('execute',()=>{_0x5937e3['execute'](_0x447d9a['model']['commandName'],{'value':_0x447d9a['model']['commandParam']}),_0x5937e3['editing']['view']['focus']();}),_0x56c098['children']['add'](_0x3f3f5f),_0x416953['items']['add'](_0x56c098);}return _0x475f9a['panelView']['children']['add'](_0x416953),this['_attachCustomOptionVisibilityHandler'](_0x475f9a,_0x4bc9ae,_0x416953),_0x475f9a;});}['_attachCustomOptionVisibilityHandler'](_0x5a8021,_0x3f29ca,_0x3ac664){if(!this['_shouldRenderCustomValueOption']())return;const _0x1fd658=()=>{if(!_0x5a8021['isOpen'])return;_0x3ac664['items']['last']['isVisible']=Boolean(_0x3f29ca['last']['model']['isOn']);};_0x1fd658(),_0x5a8021['on']('change:isOpen',()=>{_0x1fd658();});}},_=class extends _0x4ef410{static get['requires'](){return[b,k];}static get['pluginName'](){return'LineHeight';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{_ as LineHeight,p as LineHeightCommand,b as LineHeightEditing,v as LineHeightTodoListIntegration,k as LineHeightUI};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-line-height",
|
|
3
|
-
"version": "48.3.0-alpha.
|
|
3
|
+
"version": "48.3.0-alpha.6",
|
|
4
4
|
"description": "Line height feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (https://cksource.com/)",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"dist/translations/*.umd.js"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ckeditor/ckeditor5-core": "48.3.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-engine": "48.3.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-list": "48.3.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.
|
|
28
|
+
"@ckeditor/ckeditor5-core": "48.3.0-alpha.6",
|
|
29
|
+
"@ckeditor/ckeditor5-engine": "48.3.0-alpha.6",
|
|
30
|
+
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.6",
|
|
31
|
+
"@ckeditor/ckeditor5-list": "48.3.0-alpha.6",
|
|
32
|
+
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.6",
|
|
33
|
+
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.6"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"dist",
|