@ckeditor/ckeditor5-line-height 48.5.0-alpha.4 → 48.5.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 _0x570afd,Plugin as _0x278965}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x3b6cb4,Collection as _0x1e4ea1,first as _0x29c89e,uid as _0x2974af}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x40ee6d,isPercentageStyleValue as _0x5a6826}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x512f12,MenuBarMenuListItemView as _0x6f049e,MenuBarMenuListView as _0x2c51b9,MenuBarMenuView as _0x320db5,UIModel as _0x31d832,addListToDropdown as _0x1dbc38,createDropdown as _0x320d4d}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x4a967c}from'@ckeditor/ckeditor5-icons';var p=class extends _0x570afd{['refresh'](){const _0xc965cf=this['editor']['model']['document'],_0x5df90e=_0x29c89e(_0xc965cf['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x5df90e)&&this['_canHaveLineHeight'](_0x5df90e),this['value']=this['isEnabled']&&_0x5df90e['getAttribute']('lineHeight');}execute(_0x2b1baf={}){const _0x2a7eb7=this['editor']['model'],_0x12c35e=_0x2a7eb7['document']['selection'],_0x3d81b1=_0x2b1baf['value'];_0x2a7eb7['change'](_0xa958ea=>{const _0x3660c5=Array['from'](_0x12c35e['getSelectedBlocks']())['filter'](_0x146697=>this['_canHaveLineHeight'](_0x146697));for(const _0x354315 of _0x3660c5)_0x3d81b1?_0xa958ea['setAttribute']('lineHeight',_0x3d81b1,_0x354315):_0xa958ea['removeAttribute']('lineHeight',_0x354315);});}_canHaveLineHeight(_0x32c7c3){return this['editor']['model']['schema']['checkAttribute'](_0x32c7c3,'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(_0x5357ee){return'string'==typeof _0x5357ee&&'default'===_0x5357ee['toLowerCase']();}function L(_0x5d3026){return _0x5d3026['options']['map'](_0x43855e=>{return H(_0x43855e)?{'title':String(_0x5d3026['defaultValue']),'model':'default'}:('number'==typeof _0x43855e&&(_0x43855e=String(_0x43855e)),'string'!=typeof _0x43855e?_0x43855e:parseFloat(_0x43855e)?{'title':_0x43855e,'model':_0x43855e,'view':{'name':'span','styles':{'line-height':_0x43855e}}}:'string'==typeof(_0x1aba10=_0x43855e)?y[_0x1aba10]:y[_0x1aba10['model']]);var _0x1aba10;})['filter'](_0x4f7eaf=>void 0x0!==_0x4f7eaf);}var v=class extends _0x278965{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x41b541,conversion:_0x8a8c3}=this['editor'];_0x41b541['has']('ListEditing')&&_0x41b541['has']('TodoListEditing')&&(_0x41b541['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x4ef50b,_0x1fce8d,_0x5b6b92,_0x46a467,_0x2b43e7){'todo'==_0x2b43e7['getAttribute']('listType')&&_0x1fce8d&&(_0x4ef50b['addClass']('ck-list-marker-line-height',_0x5b6b92),_0x4ef50b['setStyle']('--ck-content-list-marker-line-height',_0x1fce8d,_0x5b6b92));}}),_0x8a8c3['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x8a8c3['for']('upcast')['add'](_0x9aabbc=>{_0x9aabbc['on']('element:li',function(_0x2aa22d){const _0x4d5ae0=new _0x40ee6d(_0x2aa22d);return(_0x40adc3,_0x3903aa,_0x3db968)=>{const _0x5e5aca=_0x4d5ae0['match'](_0x3903aa['viewItem']);if(!_0x5e5aca)return;const _0xe5a414=_0x5e5aca['match'];_0xe5a414['name']=!0x1,_0x3db968['consumable']['consume'](_0x3903aa['viewItem'],_0xe5a414);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x278965{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x14f6f9){super(_0x14f6f9),_0x14f6f9['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x109863=this['editor'];this['_validateConfig'](),_0x109863['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x109863['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x109863['commands']['add']('lineHeight',new p(_0x109863)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x2d4302){const _0x1735aa='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x32d9bd=0x79428,_0x5ec64e={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x5e8fbb(_0x541be9){const _0x47c1b0=new window['Promise'](_0x89f7b8=>{_0x541be9['once']('ready',_0x89f7b8);}),_0x521d9b=window['Date']['now'](),_0x16552e=_0x541be9['config']['get']('licenseKey');async function _0x4bc239(){let _0x2f94b7,_0x481ec0=null,_0x5425c8=null;try{return'GPL'==_0x16552e?'NotAllowed':(_0x2f94b7=_0x62f5ff(),_0x2f94b7?(_0x2f94b7['usageEndpoint']&&(_0x5425c8=_0x4e903e(_0x2f94b7['usageEndpoint'],_0x2f94b7['jti'])),await _0x37d4b4()?_0x7d5d52()?_0x5443f6()?'Expired':_0x40c00f()?('evaluation'==_0x2f94b7['licenseType']&&(_0x481ec0=_0x44cf60('EvaluationLimit')),await _0x4dece3()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x5443f6(){const _0xb34ba2=['evaluation','trial']['includes'](_0x2f94b7['licenseType'])?_0x521d9b/0x3e8:0xe10*_0x32d9bd;return _0x2f94b7['exp']<_0xb34ba2;}function _0x7d5d52(){const _0x15d74a=_0x2f94b7['features'];return!!_0x15d74a&&(!!_0x15d74a['includes']('*')||!!_0x15d74a['includes']('LH'));}function _0x40c00f(){const _0x47bd55=_0x2f94b7['licensedHosts'];if(!_0x47bd55||0x0==_0x47bd55['length'])return!0x0;const {hostname:_0x5c3ebd}=new URL(window['location']['href']);if(_0x47bd55['includes'](_0x5c3ebd))return!0x0;const _0x3d72f4=_0x5c3ebd['split']('.');return _0x47bd55['filter'](_0x22afbb=>_0x22afbb['includes']('*'))['map'](_0x21ce90=>_0x21ce90['split']('.'))['filter'](_0xaf2ebc=>_0xaf2ebc['length']<=_0x3d72f4['length'])['map'](_0x7aacd5=>Array(_0x3d72f4['length']-_0x7aacd5['length'])['fill']('*'===_0x7aacd5[0x0]?'*':'')['concat'](_0x7aacd5))['some'](_0x959192=>_0x3d72f4['every']((_0x373520,_0x283f0d)=>_0x959192[_0x283f0d]===_0x373520||'*'===_0x959192[_0x283f0d]));}function _0x4dece3(){return _0x481ec0&&_0x5425c8?new window['Promise']((_0x5c0083,_0x4dc2f2)=>{_0x481ec0['then'](_0x5c0083,_0x4dc2f2),_0x5425c8['then'](_0x1ff9de=>{'Valid'!=_0x1ff9de&&_0x5c0083(_0x1ff9de);},_0x4dc2f2);}):_0x481ec0||_0x5425c8||'Valid';}}function _0x4e903e(_0x333cad,_0x586fc2){return new window['Promise'](_0xfc5658=>{if(_0x548c1c())return _0xfc5658('Valid');_0x374650(),_0x541be9['decorate']('_sendUsageRequest');let _0x1e3038=!0x1;const _0x476158=_0x2974af();function _0x178ca2(_0x2f6a8f){return!!_0x2f6a8f&&('object'==typeof _0x2f6a8f||'function'==typeof _0x2f6a8f)&&'function'==typeof _0x2f6a8f['then']&&'function'==typeof _0x2f6a8f['catch'];}function _0x2a2312(_0x3f0d6a){_0x52239c(_0x3f0d6a)['then'](_0x18227e=>_0x18227e&&'ok'==_0x18227e['status']?_0x4d9e82(_0x2985a5(_0x476158+_0x586fc2))!=_0x18227e['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2037e9=>(_0x8956c8(),_0x2037e9),()=>{const _0x3e4cc3=_0x41080b();return null==_0x3e4cc3?(_0x8956c8(),'Valid'):_0x521d9b-_0x3e4cc3>0x240c8400?'UsageLimit':'Valid';})['then'](_0xfc5658)['catch'](()=>{_0xfc5658('UsageLimit');});const _0x1c633b=0x36ee80;function _0x8956c8(){const _0x581ed3='llct-'+_0x4d9e82(_0x2985a5(_0x333cad)),_0x37af0d=_0x4fe449(_0x4d9e82(window['Math']['ceil'](_0x521d9b/_0x1c633b)));window['localStorage']['setItem'](_0x581ed3,_0x37af0d);}function _0x41080b(){const _0x13ffd3='llct-'+_0x4d9e82(_0x2985a5(_0x333cad)),_0x12b591=window['localStorage']['getItem'](_0x13ffd3);return _0x12b591?window['parseInt'](_0x4fe449(_0x12b591),0x10)*_0x1c633b:null;}function _0x52239c(_0x39da78){return new window['Promise']((_0x573b75,_0x139432)=>{_0x39da78['then'](_0x573b75,_0x139432),window['setTimeout'](_0x139432,0x1d4c0);});}}_0x541be9['on']('_sendUsageRequest',(_0xe600c2,_0x4ea1ef)=>{if(_0x4ea1ef[0x0]!=_0x333cad)return _0xfc5658('UsageLimit');_0x4ea1ef[0x1]={..._0x4ea1ef[0x1],'requestId':_0x476158};},{'priority':'high'}),_0x541be9['on']('_sendUsageRequest',_0x350b8=>{_0x178ca2(_0x350b8['return'])&&(_0x1e3038=!0x0,_0x2a2312(_0x350b8['return']));},{'priority':'low'}),_0x47c1b0['then'](()=>{_0x1e3038||_0xfc5658('UsageLimit');});});function _0x548c1c(){return'auto'==_0x541be9['editing']['view']['_overlayModeHint'];}function _0x374650(){_0x541be9['editing']['view']['_overlayModeHint']='auto';}}function _0x44cf60(_0x13053b){const _0x1dffed=[new window['Promise'](_0x18c784=>setTimeout(_0x18c784,0x93ecc)),_0x47c1b0['then'](()=>new window['Promise'](_0x55fea7=>{let _0x57fac0=0x0;_0x541be9['model']['on']('applyOperation',(_0x27c32d,_0x7eec71)=>{_0x7eec71[0x0]['isDocumentOperation']&&_0x57fac0++,0x5e8==_0x57fac0&&(_0x55fea7(),_0x27c32d['off']());});}))];return window['Promise']['race'](_0x1dffed)['then'](()=>_0x13053b);}async function _0x31a92f(){await _0x47c1b0,_0x541be9['model']['change']=_0x2c4d00,_0x541be9['model']['enqueueChange']=_0x2c4d00,_0x541be9['enableReadOnlyMode']('model');}function _0x43585f(_0x363a2d){const _0x326c12=_0x21d811();_0x541be9[_0x326c12]='lineHeightLicenseKey'+_0x363a2d,'Valid'!=_0x363a2d&&_0x31a92f();}function _0x21d811(){const _0x27200d=window['String'](window['performance']['now']())['replace']('.','');let _0x4b0f9b='c';for(let _0x4c48b3=0x0;_0x4c48b3<_0x27200d['length'];_0x4c48b3+=0x2){let _0x346f0a=window['parseInt'](_0x27200d['substring'](_0x4c48b3,_0x4c48b3+0x2));_0x346f0a>=0x3e&&(_0x346f0a-=0x3e),_0x4b0f9b+=_0x1735aa[_0x346f0a];}return _0x4b0f9b;}function _0x62f5ff(){const _0x20cade=_0x16552e['split']('.');if(0x3!=_0x20cade['length'])return null;return _0x16db49(_0x20cade[0x1]);function _0x16db49(_0x5297ac){const _0x45a78a=_0x523374(_0x5297ac);return _0x45a78a&&_0x221d78()?_0x45a78a:null;function _0x221d78(){const _0xdf4780=_0x45a78a['jti'],_0x494220=window['parseInt'](_0xdf4780['substring'](_0xdf4780['length']-0x8),0x10),_0x5d9731={..._0x45a78a,'jti':_0xdf4780['substring'](0x0,_0xdf4780['length']-0x8)};return delete _0x5d9731['vc'],_0x2985a5(_0x5d9731)==_0x494220;}}}async function _0x37d4b4(){let _0x21490d=!0x0;try{const [_0x1af043,_0x3caf95,_0x5172bf]=_0x16552e['split']('.');return _0x59c32f(_0x1af043),await _0x11a22e(_0x1af043,_0x3caf95,_0x5172bf),_0x21490d;}catch{return!0x1;}function _0x59c32f(_0x22044f){const _0x30340f=_0x523374(_0x22044f);_0x30340f&&'ES256'==_0x30340f['alg']||(_0x21490d=!0x1);}async function _0x11a22e(_0x1c4f90,_0x97c329,_0x17b7d0){const _0xf62499=window['Uint8Array']['from'](_0x42d46c(_0x17b7d0),_0x3b77d4=>_0x3b77d4['charCodeAt'](0x0)),_0x562a05=new window['TextEncoder']()['encode'](_0x1c4f90+'.'+_0x97c329),_0x16351d=window['crypto']['subtle'];if(!_0x16351d)return;const _0x3d973f=await _0x16351d['importKey']('jwk',_0x5ec64e,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x16351d['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3d973f,_0xf62499,_0x562a05)||(_0x21490d=!0x1);}}function _0x523374(_0x46595b){return _0x46595b['startsWith']('ey')?JSON['parse'](_0x42d46c(_0x46595b)):null;}function _0x42d46c(_0x503ae5){return window['atob'](_0x503ae5['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2985a5(_0x207fe0){let _0xd3564=0x1505;function _0x91a6d7(_0x5c6b77){for(let _0x15388c=0x0;_0x15388c<_0x5c6b77['length'];_0x15388c++){const _0xaeb17c=_0x5c6b77['charCodeAt'](_0x15388c);_0xd3564=(_0xd3564<<0x5)+_0xd3564+_0xaeb17c,_0xd3564&=_0xd3564;}}function _0x5638bb(_0x2e2493){Array['isArray'](_0x2e2493)?_0x2e2493['forEach'](_0x5638bb):_0x2e2493&&'object'==typeof _0x2e2493?Object['entries'](_0x2e2493)['sort']()['forEach'](([_0x2141de,_0x31dae8])=>{_0x91a6d7(_0x2141de),_0x5638bb(_0x31dae8);}):_0x91a6d7(window['String'](_0x2e2493));}return _0x5638bb(_0x207fe0),_0xd3564>>>0x0;}function _0x4d9e82(_0x107040){return _0x107040['toString'](0x10)['padStart'](0x8,'0');}function _0x4fe449(_0x186836){return _0x186836['split']('')['reverse']()['join']('');}function _0x2c4d00(){}_0x43585f(await _0x4bc239());}_0x5e8fbb(_0x2d4302['editor']);}(this);}_validateConfig(){const _0x13156b=this['editor'];if(!_0x13156b['config']['get']('lineHeight.supportAllValues'))return;const _0x1ff765=_0x13156b['config']['get']('lineHeight.options')['filter'](_0x54ec6f=>'string'==typeof _0x54ec6f&&(!H(_0x54ec6f)&&isNaN(Number(_0x54ec6f))));if(_0x1ff765['length'])throw new _0x3b6cb4('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x1ff765});}_prepareAnyValueConverters(){const _0x50ba0f=this['editor'],_0x4a0dcf=this['editor']['config']['get']('lineHeight.defaultValue');_0x50ba0f['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x104625=>String(_0x104625)===String(_0x4a0dcf)?null:{'key':'style','value':{'line-height':_0x104625}}}),_0x50ba0f['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x27fe55=>{let _0x4cc0d7=_0x27fe55['getStyle']('line-height');return _0x5a6826(_0x4cc0d7)&&(_0x4cc0d7=String(Number(_0x4cc0d7['slice'](0x0,-0x1))/0x64)),String(_0x4cc0d7)===String(_0x4a0dcf)?null:_0x4cc0d7;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x582933=this['editor'],_0x3e9d7c=this['editor']['config']['get']('lineHeight.defaultValue'),_0x247c08=function(_0x588512,_0x29b8e1){const _0x4db354={'model':{'key':_0x588512,'values':[]},'view':{}};for(const _0x3d10e0 of _0x29b8e1)'class'===_0x3d10e0['view']?.['key']?(_0x4db354['model']['values']['push'](_0x3d10e0['model']),_0x4db354['view'][_0x3d10e0['model']]={'key':'class','value':_0x3d10e0['view']['value']}):(_0x4db354['model']['values']['push'](_0x3d10e0['model']),_0x4db354['view'][_0x3d10e0['model']]={'key':'style','value':'line-height:'+_0x3d10e0['model']+';'});return _0x4db354;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x28a793=>_0x28a793['model']));_0x582933['conversion']['attributeToAttribute'](_0x247c08),_0x582933['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x1c4953=>{let _0x5b7213=_0x1c4953['getStyle']('line-height');return _0x5a6826(_0x5b7213)&&(_0x5b7213=String(Number(_0x5b7213['slice'](0x0,-0x1))/0x64)),_0x5b7213===String(_0x3e9d7c)?null:_0x247c08['model']['values']['includes'](_0x5b7213)?_0x5b7213:null;}}});}},k=class extends _0x278965{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x38a795={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x38a795),this['_registerMenuBarComponent'](_0x38a795),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x1a49e1=[this['editor']];for(const _0x37422b of _0x1a49e1){let _0x2db76b;for(const _0xb001f5 in _0x37422b){const _0x5cf858=_0xb001f5,_0x3b2f92=_0x37422b[_0x5cf858];if('lineHeightLicenseKeyValid'==_0x3b2f92||'lineHeightLicenseKeyInvalid'==_0x3b2f92||'lineHeightLicenseKeyExpired'==_0x3b2f92||'lineHeightLicenseKeyDomainLimit'==_0x3b2f92||'lineHeightLicenseKeyNotAllowed'==_0x3b2f92||'lineHeightLicenseKeyEvaluationLimit'==_0x3b2f92||'lineHeightLicenseKeyUsageLimit'==_0x3b2f92){delete _0x37422b[_0x5cf858],_0x2db76b=_0x3b2f92,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x2db76b&&_0x37422b['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x2db76b&&_0x37422b['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x2db76b&&_0x37422b['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x2db76b&&_0x37422b['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x2db76b&&_0x37422b['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x2db76b&&_0x37422b['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x29a7b1=this['editor'],t=_0x29a7b1['t'],_0x4cfa5d=_0x29a7b1['config']['get']('lineHeight'),_0x537a89={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x4cfa5d)['map'](_0x271687=>{const _0x4f2bb2=_0x537a89[_0x271687['title']];return _0x4f2bb2&&_0x4f2bb2!=_0x271687['title']&&(_0x271687=Object['assign']({},_0x271687,{'title':_0x4f2bb2})),_0x271687;});}_prepareListOptions(){const _0x5612b0=this['editor']['commands']['get']('lineHeight'),_0x5a4768=this['editor']['config']['get']('lineHeight.defaultValue'),_0x9e13b1=this['_getLocalizedLineHeightOptions'](),_0x2cb102=new _0x1e4ea1(),_0x38e5d0=_0x14e61f=>'default'===_0x14e61f||String(_0x5a4768)===_0x14e61f;for(const _0x134c8a of _0x9e13b1){const _0x3a1961={'type':'button','model':new _0x31d832({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x134c8a['title'],'withText':!0x0})};_0x38e5d0(_0x134c8a['model'])?(_0x3a1961['model']['bind']('isOn')['to'](_0x5612b0,'value',_0x40de4d=>!_0x40de4d),_0x3a1961['model']['commandParam']=void 0x0):(_0x3a1961['model']['bind']('isOn')['to'](_0x5612b0,'value',_0x3072b7=>_0x3072b7===_0x134c8a['model']),_0x3a1961['model']['commandParam']=_0x134c8a['model']),_0x2cb102['add'](_0x3a1961);}if(this['_shouldRenderCustomValueOption']()){const _0x5e61f6=this['_getCustomValueOptionDefinition'](_0x9e13b1);_0x2cb102['add'](_0x5e61f6);}return _0x2cb102;}_getCustomValueOptionDefinition(_0x19473e){const _0x75ac99=this['editor'],t=_0x75ac99['t'],_0x401d2c=_0x75ac99['commands']['get']('lineHeight'),_0x573aaa=_0x19473e['map'](_0x598861=>_0x598861['model']),_0x41abe8={'type':'button','model':new _0x31d832({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x41abe8['model']['bind']('commandParam')['to'](_0x401d2c,'value'),_0x41abe8['model']['bind']('isOn')['to'](_0x401d2c,'value',_0x14f29a=>!!_0x14f29a&&!_0x573aaa['includes'](String(_0x14f29a))),_0x41abe8['model']['bind']('label')['to'](_0x401d2c,'value',_0x4d7adf=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x4d7adf))),_0x41abe8;}_registerToolbarComponent({accessibleLabel:_0x33272d,options:_0x4fad25}){const _0x2afc3b=this['editor'],_0x25997a=_0x2afc3b['commands']['get']('lineHeight');_0x2afc3b['ui']['componentFactory']['add']('lineHeight',_0x19c54d=>{const _0x5139cc=_0x320d4d(_0x19c54d);return _0x1dbc38(_0x5139cc,_0x4fad25,{'role':'menu','ariaLabel':_0x33272d}),_0x5139cc['buttonView']['set']({'label':_0x33272d,'tooltip':!0x0,'icon':_0x4a967c}),_0x5139cc['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x5139cc['bind']('isEnabled')['to'](_0x25997a),this['listenTo'](_0x5139cc,'execute',_0x15cf17=>{_0x2afc3b['execute'](_0x15cf17['source']['commandName'],{'value':_0x15cf17['source']['commandParam']}),_0x2afc3b['editing']['view']['focus']();}),_0x5139cc['once']('change:isOpen',()=>{const _0x50bfac=_0x5139cc['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x5139cc,_0x4fad25,_0x50bfac);}),_0x5139cc;});}_registerMenuBarComponent({accessibleLabel:_0x794b0d,options:_0x31410a}){const _0x209c72=this['editor'],_0x58f677=_0x209c72['commands']['get']('lineHeight');_0x209c72['ui']['componentFactory']['add']('menuBar:lineHeight',_0x45f0d3=>{const _0x3be2c1=new _0x320db5(_0x45f0d3);_0x3be2c1['buttonView']['set']({'label':_0x794b0d,'icon':_0x4a967c}),_0x3be2c1['bind']('isEnabled')['to'](_0x58f677);const _0x2bc58d=new _0x2c51b9(_0x45f0d3);for(const _0x51ca75 of _0x31410a){const _0x4504de=new _0x6f049e(_0x45f0d3,_0x3be2c1),_0x3e5f91=new _0x512f12(_0x45f0d3);_0x3e5f91['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x3e5f91['bind'](...Object['keys'](_0x51ca75['model']))['to'](_0x51ca75['model']),_0x3e5f91['delegate']('execute')['to'](_0x3be2c1),_0x3e5f91['on']('execute',()=>{_0x209c72['execute'](_0x51ca75['model']['commandName'],{'value':_0x51ca75['model']['commandParam']}),_0x209c72['editing']['view']['focus']();}),_0x4504de['children']['add'](_0x3e5f91),_0x2bc58d['items']['add'](_0x4504de);}return _0x3be2c1['panelView']['children']['add'](_0x2bc58d),this['_attachCustomOptionVisibilityHandler'](_0x3be2c1,_0x31410a,_0x2bc58d),_0x3be2c1;});}_attachCustomOptionVisibilityHandler(_0x53b581,_0x283a17,_0x42342){if(!this['_shouldRenderCustomValueOption']())return;const _0x411aab=()=>{if(!_0x53b581['isOpen'])return;_0x42342['items']['last']['isVisible']=Boolean(_0x283a17['last']['model']['isOn']);};_0x411aab(),_0x53b581['on']('change:isOpen',()=>{_0x411aab();});}},_=class extends _0x278965{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 _0x258e2e,Plugin as _0x104971}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x3dd672,Collection as _0x51b9fa,first as _0x53efcc,uid as _0x15e1f3}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x32b7d7,isPercentageStyleValue as _0x41f31b}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x12a0bc,MenuBarMenuListItemView as _0x2db0f2,MenuBarMenuListView as _0x3aaefa,MenuBarMenuView as _0x345fc2,UIModel as _0x2660d1,addListToDropdown as _0x3002f1,createDropdown as _0x37d9d5}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x329f5d}from'@ckeditor/ckeditor5-icons';var p=class extends _0x258e2e{['refresh'](){const _0x12ed56=this['editor']['model']['document'],_0x572aff=_0x53efcc(_0x12ed56['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x572aff)&&this['_canHaveLineHeight'](_0x572aff),this['value']=this['isEnabled']&&_0x572aff['getAttribute']('lineHeight');}execute(_0x194cba={}){const _0x546430=this['editor']['model'],_0x439f7f=_0x546430['document']['selection'],_0x12daf9=_0x194cba['value'];_0x546430['change'](_0x374341=>{const _0x3eb1d9=Array['from'](_0x439f7f['getSelectedBlocks']())['filter'](_0xee8e26=>this['_canHaveLineHeight'](_0xee8e26));for(const _0x2835fe of _0x3eb1d9)_0x12daf9?_0x374341['setAttribute']('lineHeight',_0x12daf9,_0x2835fe):_0x374341['removeAttribute']('lineHeight',_0x2835fe);});}_canHaveLineHeight(_0x579c4b){return this['editor']['model']['schema']['checkAttribute'](_0x579c4b,'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(_0x1daa46){return'string'==typeof _0x1daa46&&'default'===_0x1daa46['toLowerCase']();}function L(_0x2fc5d6){return _0x2fc5d6['options']['map'](_0x4a298a=>{return H(_0x4a298a)?{'title':String(_0x2fc5d6['defaultValue']),'model':'default'}:('number'==typeof _0x4a298a&&(_0x4a298a=String(_0x4a298a)),'string'!=typeof _0x4a298a?_0x4a298a:parseFloat(_0x4a298a)?{'title':_0x4a298a,'model':_0x4a298a,'view':{'name':'span','styles':{'line-height':_0x4a298a}}}:'string'==typeof(_0x43e73d=_0x4a298a)?y[_0x43e73d]:y[_0x43e73d['model']]);var _0x43e73d;})['filter'](_0x51b2a2=>void 0x0!==_0x51b2a2);}var v=class extends _0x104971{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x5cba69,conversion:_0x1cc21}=this['editor'];_0x5cba69['has']('ListEditing')&&_0x5cba69['has']('TodoListEditing')&&(_0x5cba69['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x14acfd,_0x50ff42,_0x4b73a6,_0x1b39e3,_0x3a73d4){'todo'==_0x3a73d4['getAttribute']('listType')&&_0x50ff42&&(_0x14acfd['addClass']('ck-list-marker-line-height',_0x4b73a6),_0x14acfd['setStyle']('--ck-content-list-marker-line-height',_0x50ff42,_0x4b73a6));}}),_0x1cc21['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x1cc21['for']('upcast')['add'](_0x58eaf4=>{_0x58eaf4['on']('element:li',function(_0x449250){const _0x410f5c=new _0x32b7d7(_0x449250);return(_0x5e99f7,_0x2cc70d,_0x4ba035)=>{const _0x4beea6=_0x410f5c['match'](_0x2cc70d['viewItem']);if(!_0x4beea6)return;const _0x4b03e7=_0x4beea6['match'];_0x4b03e7['name']=!0x1,_0x4ba035['consumable']['consume'](_0x2cc70d['viewItem'],_0x4b03e7);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x104971{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c8f07){super(_0x4c8f07),_0x4c8f07['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x3c938c=this['editor'];this['_validateConfig'](),_0x3c938c['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x3c938c['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x3c938c['commands']['add']('lineHeight',new p(_0x3c938c)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x25dc2b){const _0x396a='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x5b8cc7=0x79440,_0x27decd={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x26a00a(_0x1c37e8){const _0x368185=new window['Promise'](_0x28dd0e=>{_0x1c37e8['once']('ready',_0x28dd0e);}),_0x21b5ff=window['Date']['now'](),_0x4585dc=_0x1c37e8['config']['get']('licenseKey');async function _0x5f1128(){let _0x324850,_0x2949b9=null,_0xbf9edf=null;try{return'GPL'==_0x4585dc?'NotAllowed':(_0x324850=_0x240402(),_0x324850?(_0x324850['usageEndpoint']&&(_0xbf9edf=_0x307b3b(_0x324850['usageEndpoint'],_0x324850['jti'])),await _0x1640cb()?_0xc75b09()?_0x534de6()?'Expired':_0x178e4a()?('evaluation'==_0x324850['licenseType']&&(_0x2949b9=_0x3abbe2('EvaluationLimit')),await _0x56878d()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x534de6(){const _0x112f6f=['evaluation','trial']['includes'](_0x324850['licenseType'])?_0x21b5ff/0x3e8:0xe10*_0x5b8cc7;return _0x324850['exp']<_0x112f6f;}function _0xc75b09(){const _0x445a52=_0x324850['features'];return!!_0x445a52&&(!!_0x445a52['includes']('*')||!!_0x445a52['includes']('LH'));}function _0x178e4a(){const _0x9ec14=_0x324850['licensedHosts'];if(!_0x9ec14||0x0==_0x9ec14['length'])return!0x0;const {hostname:_0xabe96a}=new URL(window['location']['href']);if(_0x9ec14['includes'](_0xabe96a))return!0x0;const _0x5aa03a=_0xabe96a['split']('.');return _0x9ec14['filter'](_0x3de5a5=>_0x3de5a5['includes']('*'))['map'](_0x42b65a=>_0x42b65a['split']('.'))['filter'](_0x38ef97=>_0x38ef97['length']<=_0x5aa03a['length'])['map'](_0x40ef50=>Array(_0x5aa03a['length']-_0x40ef50['length'])['fill']('*'===_0x40ef50[0x0]?'*':'')['concat'](_0x40ef50))['some'](_0x4bc042=>_0x5aa03a['every']((_0x2036ab,_0x5ac015)=>_0x4bc042[_0x5ac015]===_0x2036ab||'*'===_0x4bc042[_0x5ac015]));}function _0x56878d(){return _0x2949b9&&_0xbf9edf?new window['Promise']((_0x5c06d6,_0x1fd886)=>{_0x2949b9['then'](_0x5c06d6,_0x1fd886),_0xbf9edf['then'](_0x3d03cd=>{'Valid'!=_0x3d03cd&&_0x5c06d6(_0x3d03cd);},_0x1fd886);}):_0x2949b9||_0xbf9edf||'Valid';}}function _0x307b3b(_0x249479,_0x4556f9){return new window['Promise'](_0x309245=>{if(_0x524d1b())return _0x309245('Valid');_0x20afd1(),_0x1c37e8['decorate']('_sendUsageRequest');let _0x32162e=!0x1;const _0xb3d2d2=_0x15e1f3();function _0x1a183d(_0x372369){return!!_0x372369&&('object'==typeof _0x372369||'function'==typeof _0x372369)&&'function'==typeof _0x372369['then']&&'function'==typeof _0x372369['catch'];}function _0x240528(_0x26d1c3){_0x1db28a(_0x26d1c3)['then'](_0x7dcc47=>_0x7dcc47&&'ok'==_0x7dcc47['status']?_0x5eb2da(_0x385c03(_0xb3d2d2+_0x4556f9))!=_0x7dcc47['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x4db70b=>(_0x14bb51(),_0x4db70b),()=>{const _0x30ba86=_0x3e4737();return null==_0x30ba86?(_0x14bb51(),'Valid'):_0x21b5ff-_0x30ba86>0x240c8400?'UsageLimit':'Valid';})['then'](_0x309245)['catch'](()=>{_0x309245('UsageLimit');});const _0xf4e346=0x36ee80;function _0x14bb51(){const _0x235a54='llct-'+_0x5eb2da(_0x385c03(_0x249479)),_0x4619dc=_0xcd3d63(_0x5eb2da(window['Math']['ceil'](_0x21b5ff/_0xf4e346)));window['localStorage']['setItem'](_0x235a54,_0x4619dc);}function _0x3e4737(){const _0x276ea7='llct-'+_0x5eb2da(_0x385c03(_0x249479)),_0x24ddb3=window['localStorage']['getItem'](_0x276ea7);return _0x24ddb3?window['parseInt'](_0xcd3d63(_0x24ddb3),0x10)*_0xf4e346:null;}function _0x1db28a(_0xcf38c5){return new window['Promise']((_0x43be61,_0x1506be)=>{_0xcf38c5['then'](_0x43be61,_0x1506be),window['setTimeout'](_0x1506be,0x1d4c0);});}}_0x1c37e8['on']('_sendUsageRequest',(_0x582c8d,_0x2c74d3)=>{if(_0x2c74d3[0x0]!=_0x249479)return _0x309245('UsageLimit');_0x2c74d3[0x1]={..._0x2c74d3[0x1],'requestId':_0xb3d2d2};},{'priority':'high'}),_0x1c37e8['on']('_sendUsageRequest',_0x39dc4a=>{_0x1a183d(_0x39dc4a['return'])&&(_0x32162e=!0x0,_0x240528(_0x39dc4a['return']));},{'priority':'low'}),_0x368185['then'](()=>{_0x32162e||_0x309245('UsageLimit');});});function _0x524d1b(){return'auto'==_0x1c37e8['editing']['view']['_overlayModeHint'];}function _0x20afd1(){_0x1c37e8['editing']['view']['_overlayModeHint']='auto';}}function _0x3abbe2(_0x3e8063){const _0x8a23dc=[new window['Promise'](_0x8ac7da=>setTimeout(_0x8ac7da,0x93ecc)),_0x368185['then'](()=>new window['Promise'](_0x482ab4=>{let _0x2b88d1=0x0;_0x1c37e8['model']['on']('applyOperation',(_0x1c52ca,_0x2324e7)=>{_0x2324e7[0x0]['isDocumentOperation']&&_0x2b88d1++,0x5e8==_0x2b88d1&&(_0x482ab4(),_0x1c52ca['off']());});}))];return window['Promise']['race'](_0x8a23dc)['then'](()=>_0x3e8063);}async function _0x13c7a8(){await _0x368185,_0x1c37e8['model']['change']=_0x16f1e7,_0x1c37e8['model']['enqueueChange']=_0x16f1e7,_0x1c37e8['enableReadOnlyMode']('model');}function _0x39b737(_0x2cf620){const _0x58b2cb=_0x5617e7();_0x1c37e8[_0x58b2cb]='lineHeightLicenseKey'+_0x2cf620,'Valid'!=_0x2cf620&&_0x13c7a8();}function _0x5617e7(){const _0x2a487b=window['String'](window['performance']['now']())['replace']('.','');let _0x3516d4='c';for(let _0x24dcad=0x0;_0x24dcad<_0x2a487b['length'];_0x24dcad+=0x2){let _0xf8ec84=window['parseInt'](_0x2a487b['substring'](_0x24dcad,_0x24dcad+0x2));_0xf8ec84>=0x3e&&(_0xf8ec84-=0x3e),_0x3516d4+=_0x396a[_0xf8ec84];}return _0x3516d4;}function _0x240402(){const _0xa49c78=_0x4585dc['split']('.');if(0x3!=_0xa49c78['length'])return null;return _0x22a588(_0xa49c78[0x1]);function _0x22a588(_0x2b6251){const _0x1def34=_0x2c876c(_0x2b6251);return _0x1def34&&_0x25e210()?_0x1def34:null;function _0x25e210(){const _0x2042f4=_0x1def34['jti'],_0x55cef2=window['parseInt'](_0x2042f4['substring'](_0x2042f4['length']-0x8),0x10),_0x482227={..._0x1def34,'jti':_0x2042f4['substring'](0x0,_0x2042f4['length']-0x8)};return delete _0x482227['vc'],_0x385c03(_0x482227)==_0x55cef2;}}}async function _0x1640cb(){let _0x18b391=!0x0;try{const [_0x2b6a05,_0x1c5780,_0x45e247]=_0x4585dc['split']('.');return _0x47c71c(_0x2b6a05),await _0x1eb664(_0x2b6a05,_0x1c5780,_0x45e247),_0x18b391;}catch{return!0x1;}function _0x47c71c(_0x251853){const _0x10f237=_0x2c876c(_0x251853);_0x10f237&&'ES256'==_0x10f237['alg']||(_0x18b391=!0x1);}async function _0x1eb664(_0x1a3f1f,_0x5ca142,_0x226897){const _0x27d2ba=window['Uint8Array']['from'](_0x2d599d(_0x226897),_0x1c386c=>_0x1c386c['charCodeAt'](0x0)),_0x35524a=new window['TextEncoder']()['encode'](_0x1a3f1f+'.'+_0x5ca142),_0x424130=window['crypto']['subtle'];if(!_0x424130)return;const _0x15e6c0=await _0x424130['importKey']('jwk',_0x27decd,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x424130['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x15e6c0,_0x27d2ba,_0x35524a)||(_0x18b391=!0x1);}}function _0x2c876c(_0x463363){return _0x463363['startsWith']('ey')?JSON['parse'](_0x2d599d(_0x463363)):null;}function _0x2d599d(_0x2a703c){return window['atob'](_0x2a703c['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x385c03(_0x1607f1){let _0x3c3d84=0x1505;function _0x21c043(_0x4d4205){for(let _0x3e0a02=0x0;_0x3e0a02<_0x4d4205['length'];_0x3e0a02++){const _0xc9f1=_0x4d4205['charCodeAt'](_0x3e0a02);_0x3c3d84=(_0x3c3d84<<0x5)+_0x3c3d84+_0xc9f1,_0x3c3d84&=_0x3c3d84;}}function _0x2c8375(_0x2a9a1e){Array['isArray'](_0x2a9a1e)?_0x2a9a1e['forEach'](_0x2c8375):_0x2a9a1e&&'object'==typeof _0x2a9a1e?Object['entries'](_0x2a9a1e)['sort']()['forEach'](([_0x1d214e,_0x2822f6])=>{_0x21c043(_0x1d214e),_0x2c8375(_0x2822f6);}):_0x21c043(window['String'](_0x2a9a1e));}return _0x2c8375(_0x1607f1),_0x3c3d84>>>0x0;}function _0x5eb2da(_0x41eb92){return _0x41eb92['toString'](0x10)['padStart'](0x8,'0');}function _0xcd3d63(_0x3f59b8){return _0x3f59b8['split']('')['reverse']()['join']('');}function _0x16f1e7(){}_0x39b737(await _0x5f1128());}_0x26a00a(_0x25dc2b['editor']);}(this);}_validateConfig(){const _0x82c2ba=this['editor'];if(!_0x82c2ba['config']['get']('lineHeight.supportAllValues'))return;const _0x98bd3e=_0x82c2ba['config']['get']('lineHeight.options')['filter'](_0x5a71a7=>'string'==typeof _0x5a71a7&&(!H(_0x5a71a7)&&isNaN(Number(_0x5a71a7))));if(_0x98bd3e['length'])throw new _0x3dd672('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x98bd3e});}_prepareAnyValueConverters(){const _0x51d674=this['editor'],_0x1d7aff=this['editor']['config']['get']('lineHeight.defaultValue');_0x51d674['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x2b9e07=>String(_0x2b9e07)===String(_0x1d7aff)?null:{'key':'style','value':{'line-height':_0x2b9e07}}}),_0x51d674['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x122bb3=>{let _0x5e6366=_0x122bb3['getStyle']('line-height');return _0x41f31b(_0x5e6366)&&(_0x5e6366=String(Number(_0x5e6366['slice'](0x0,-0x1))/0x64)),String(_0x5e6366)===String(_0x1d7aff)?null:_0x5e6366;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x5da652=this['editor'],_0x1f6315=this['editor']['config']['get']('lineHeight.defaultValue'),_0xaa9dbf=function(_0x4113df,_0x36b65b){const _0x42a04a={'model':{'key':_0x4113df,'values':[]},'view':{}};for(const _0x1b3cc9 of _0x36b65b)'class'===_0x1b3cc9['view']?.['key']?(_0x42a04a['model']['values']['push'](_0x1b3cc9['model']),_0x42a04a['view'][_0x1b3cc9['model']]={'key':'class','value':_0x1b3cc9['view']['value']}):(_0x42a04a['model']['values']['push'](_0x1b3cc9['model']),_0x42a04a['view'][_0x1b3cc9['model']]={'key':'style','value':'line-height:'+_0x1b3cc9['model']+';'});return _0x42a04a;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x2e4245=>_0x2e4245['model']));_0x5da652['conversion']['attributeToAttribute'](_0xaa9dbf),_0x5da652['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x92f581=>{let _0x39eec8=_0x92f581['getStyle']('line-height');return _0x41f31b(_0x39eec8)&&(_0x39eec8=String(Number(_0x39eec8['slice'](0x0,-0x1))/0x64)),_0x39eec8===String(_0x1f6315)?null:_0xaa9dbf['model']['values']['includes'](_0x39eec8)?_0x39eec8:null;}}});}},k=class extends _0x104971{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x4dba54={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x4dba54),this['_registerMenuBarComponent'](_0x4dba54),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0xc4b490=[this['editor']];for(const _0x545b9a of _0xc4b490){let _0x5ba569;for(const _0x597c5c in _0x545b9a){const _0x1aa318=_0x597c5c,_0x31653f=_0x545b9a[_0x1aa318];if('lineHeightLicenseKeyValid'==_0x31653f||'lineHeightLicenseKeyInvalid'==_0x31653f||'lineHeightLicenseKeyExpired'==_0x31653f||'lineHeightLicenseKeyDomainLimit'==_0x31653f||'lineHeightLicenseKeyNotAllowed'==_0x31653f||'lineHeightLicenseKeyEvaluationLimit'==_0x31653f||'lineHeightLicenseKeyUsageLimit'==_0x31653f){delete _0x545b9a[_0x1aa318],_0x5ba569=_0x31653f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x5ba569&&_0x545b9a['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x5ba569&&_0x545b9a['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x5ba569&&_0x545b9a['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x5ba569&&_0x545b9a['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x5ba569&&_0x545b9a['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x5ba569&&_0x545b9a['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x37836d=this['editor'],t=_0x37836d['t'],_0x3feb99=_0x37836d['config']['get']('lineHeight'),_0x935231={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x3feb99)['map'](_0x1146e8=>{const _0x583278=_0x935231[_0x1146e8['title']];return _0x583278&&_0x583278!=_0x1146e8['title']&&(_0x1146e8=Object['assign']({},_0x1146e8,{'title':_0x583278})),_0x1146e8;});}_prepareListOptions(){const _0x305307=this['editor']['commands']['get']('lineHeight'),_0x4b1b1d=this['editor']['config']['get']('lineHeight.defaultValue'),_0x2c606a=this['_getLocalizedLineHeightOptions'](),_0x554745=new _0x51b9fa(),_0x24cf6e=_0x543fab=>'default'===_0x543fab||String(_0x4b1b1d)===_0x543fab;for(const _0x3f9a04 of _0x2c606a){const _0x569190={'type':'button','model':new _0x2660d1({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x3f9a04['title'],'withText':!0x0})};_0x24cf6e(_0x3f9a04['model'])?(_0x569190['model']['bind']('isOn')['to'](_0x305307,'value',_0x489574=>!_0x489574),_0x569190['model']['commandParam']=void 0x0):(_0x569190['model']['bind']('isOn')['to'](_0x305307,'value',_0x585fee=>_0x585fee===_0x3f9a04['model']),_0x569190['model']['commandParam']=_0x3f9a04['model']),_0x554745['add'](_0x569190);}if(this['_shouldRenderCustomValueOption']()){const _0x42fff5=this['_getCustomValueOptionDefinition'](_0x2c606a);_0x554745['add'](_0x42fff5);}return _0x554745;}_getCustomValueOptionDefinition(_0x1417c5){const _0x27917b=this['editor'],t=_0x27917b['t'],_0x26c915=_0x27917b['commands']['get']('lineHeight'),_0x5e3b95=_0x1417c5['map'](_0x54a1f8=>_0x54a1f8['model']),_0x504e50={'type':'button','model':new _0x2660d1({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x504e50['model']['bind']('commandParam')['to'](_0x26c915,'value'),_0x504e50['model']['bind']('isOn')['to'](_0x26c915,'value',_0x4fef96=>!!_0x4fef96&&!_0x5e3b95['includes'](String(_0x4fef96))),_0x504e50['model']['bind']('label')['to'](_0x26c915,'value',_0x45854e=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x45854e))),_0x504e50;}_registerToolbarComponent({accessibleLabel:_0x5d9035,options:_0x3bdba4}){const _0x2aedf5=this['editor'],_0x531324=_0x2aedf5['commands']['get']('lineHeight');_0x2aedf5['ui']['componentFactory']['add']('lineHeight',_0x51921c=>{const _0x5a8657=_0x37d9d5(_0x51921c);return _0x3002f1(_0x5a8657,_0x3bdba4,{'role':'menu','ariaLabel':_0x5d9035}),_0x5a8657['buttonView']['set']({'label':_0x5d9035,'tooltip':!0x0,'icon':_0x329f5d}),_0x5a8657['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x5a8657['bind']('isEnabled')['to'](_0x531324),this['listenTo'](_0x5a8657,'execute',_0x3ee0e3=>{_0x2aedf5['execute'](_0x3ee0e3['source']['commandName'],{'value':_0x3ee0e3['source']['commandParam']}),_0x2aedf5['editing']['view']['focus']();}),_0x5a8657['once']('change:isOpen',()=>{const _0x455b5b=_0x5a8657['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x5a8657,_0x3bdba4,_0x455b5b);}),_0x5a8657;});}_registerMenuBarComponent({accessibleLabel:_0xc7d4a7,options:_0x14bed1}){const _0x551657=this['editor'],_0x21f52f=_0x551657['commands']['get']('lineHeight');_0x551657['ui']['componentFactory']['add']('menuBar:lineHeight',_0xba0672=>{const _0x116ad9=new _0x345fc2(_0xba0672);_0x116ad9['buttonView']['set']({'label':_0xc7d4a7,'icon':_0x329f5d}),_0x116ad9['bind']('isEnabled')['to'](_0x21f52f);const _0x165bec=new _0x3aaefa(_0xba0672);for(const _0x105533 of _0x14bed1){const _0x2a29dd=new _0x2db0f2(_0xba0672,_0x116ad9),_0x5d82ff=new _0x12a0bc(_0xba0672);_0x5d82ff['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x5d82ff['bind'](...Object['keys'](_0x105533['model']))['to'](_0x105533['model']),_0x5d82ff['delegate']('execute')['to'](_0x116ad9),_0x5d82ff['on']('execute',()=>{_0x551657['execute'](_0x105533['model']['commandName'],{'value':_0x105533['model']['commandParam']}),_0x551657['editing']['view']['focus']();}),_0x2a29dd['children']['add'](_0x5d82ff),_0x165bec['items']['add'](_0x2a29dd);}return _0x116ad9['panelView']['children']['add'](_0x165bec),this['_attachCustomOptionVisibilityHandler'](_0x116ad9,_0x14bed1,_0x165bec),_0x116ad9;});}_attachCustomOptionVisibilityHandler(_0x43fa79,_0x44aac3,_0x208a79){if(!this['_shouldRenderCustomValueOption']())return;const _0x266499=()=>{if(!_0x43fa79['isOpen'])return;_0x208a79['items']['last']['isVisible']=Boolean(_0x44aac3['last']['model']['isOn']);};_0x266499(),_0x43fa79['on']('change:isOpen',()=>{_0x266499();});}},_=class extends _0x104971{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.5.0-alpha.
|
|
3
|
+
"version": "48.5.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.5.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-list": "48.5.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.
|
|
34
|
-
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.
|
|
29
|
+
"@ckeditor/ckeditor5-core": "48.5.0-alpha.5",
|
|
30
|
+
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.5",
|
|
31
|
+
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.5",
|
|
32
|
+
"@ckeditor/ckeditor5-list": "48.5.0-alpha.5",
|
|
33
|
+
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.5",
|
|
34
|
+
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.5"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist",
|