@ckeditor/ckeditor5-line-height 48.5.0-alpha.3 → 48.5.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 _0x5642c4,Plugin as _0x2df8bc}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x4c12f3,Collection as _0x4e0734,first as _0x468237,uid as _0x3b7e7f}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x4d759e,isPercentageStyleValue as _0x16e951}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x2fb419,MenuBarMenuListItemView as _0x5e521c,MenuBarMenuListView as _0x2bd843,MenuBarMenuView as _0x1cede2,UIModel as _0x343f6f,addListToDropdown as _0x46d838,createDropdown as _0x4b2e88}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0x2bcafb}from'@ckeditor/ckeditor5-icons';var p=class extends _0x5642c4{['refresh'](){const _0x34c5e3=this['editor']['model']['document'],_0x326579=_0x468237(_0x34c5e3['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x326579)&&this['_canHaveLineHeight'](_0x326579),this['value']=this['isEnabled']&&_0x326579['getAttribute']('lineHeight');}execute(_0x3864ec={}){const _0x41a618=this['editor']['model'],_0x38fa1a=_0x41a618['document']['selection'],_0x1c9ad4=_0x3864ec['value'];_0x41a618['change'](_0x481875=>{const _0xc39119=Array['from'](_0x38fa1a['getSelectedBlocks']())['filter'](_0x2ef110=>this['_canHaveLineHeight'](_0x2ef110));for(const _0x5e3af7 of _0xc39119)_0x1c9ad4?_0x481875['setAttribute']('lineHeight',_0x1c9ad4,_0x5e3af7):_0x481875['removeAttribute']('lineHeight',_0x5e3af7);});}_canHaveLineHeight(_0x2c4223){return this['editor']['model']['schema']['checkAttribute'](_0x2c4223,'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(_0x563972){return'string'==typeof _0x563972&&'default'===_0x563972['toLowerCase']();}function L(_0x17da0b){return _0x17da0b['options']['map'](_0x8caa21=>{return H(_0x8caa21)?{'title':String(_0x17da0b['defaultValue']),'model':'default'}:('number'==typeof _0x8caa21&&(_0x8caa21=String(_0x8caa21)),'string'!=typeof _0x8caa21?_0x8caa21:parseFloat(_0x8caa21)?{'title':_0x8caa21,'model':_0x8caa21,'view':{'name':'span','styles':{'line-height':_0x8caa21}}}:'string'==typeof(_0x23b844=_0x8caa21)?y[_0x23b844]:y[_0x23b844['model']]);var _0x23b844;})['filter'](_0x31071a=>void 0x0!==_0x31071a);}var v=class extends _0x2df8bc{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x628ace,conversion:_0x27bb92}=this['editor'];_0x628ace['has']('ListEditing')&&_0x628ace['has']('TodoListEditing')&&(_0x628ace['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x42d9c5,_0x448c2d,_0x35a182,_0x49f7ad,_0x5686b6){'todo'==_0x5686b6['getAttribute']('listType')&&_0x448c2d&&(_0x42d9c5['addClass']('ck-list-marker-line-height',_0x35a182),_0x42d9c5['setStyle']('--ck-content-list-marker-line-height',_0x448c2d,_0x35a182));}}),_0x27bb92['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x27bb92['for']('upcast')['add'](_0x4a0301=>{_0x4a0301['on']('element:li',function(_0x10753e){const _0x12574c=new _0x4d759e(_0x10753e);return(_0x546339,_0x5e5dc0,_0x59272c)=>{const _0x398d2d=_0x12574c['match'](_0x5e5dc0['viewItem']);if(!_0x398d2d)return;const _0x3d1888=_0x398d2d['match'];_0x3d1888['name']=!0x1,_0x59272c['consumable']['consume'](_0x5e5dc0['viewItem'],_0x3d1888);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x2df8bc{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4a7f1c){super(_0x4a7f1c),_0x4a7f1c['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x126a30=this['editor'];this['_validateConfig'](),_0x126a30['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x126a30['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x126a30['commands']['add']('lineHeight',new p(_0x126a30)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x5aa206){const _0x382bec='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x3b3e70=0x79410,_0x3afb2a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x50c981(_0xe9e2b9){const _0x48bb58=new window['Promise'](_0x2a17d3=>{_0xe9e2b9['once']('ready',_0x2a17d3);}),_0x36b3b5=window['Date']['now'](),_0x38ac52=_0xe9e2b9['config']['get']('licenseKey');async function _0x63e780(){let _0x5afd2c,_0x1a5429=null,_0x2e9554=null;try{return'GPL'==_0x38ac52?'NotAllowed':(_0x5afd2c=_0x196f66(),_0x5afd2c?(_0x5afd2c['usageEndpoint']&&(_0x2e9554=_0x578b09(_0x5afd2c['usageEndpoint'],_0x5afd2c['jti'])),await _0xef463()?_0x482720()?_0x1101fd()?'Expired':_0x1e276c()?('evaluation'==_0x5afd2c['licenseType']&&(_0x1a5429=_0x5aa819('EvaluationLimit')),await _0x3d29e6()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x1101fd(){const _0x2c6f5c=['evaluation','trial']['includes'](_0x5afd2c['licenseType'])?_0x36b3b5/0x3e8:0xe10*_0x3b3e70;return _0x5afd2c['exp']<_0x2c6f5c;}function _0x482720(){const _0x1b8d06=_0x5afd2c['features'];return!!_0x1b8d06&&(!!_0x1b8d06['includes']('*')||!!_0x1b8d06['includes']('LH'));}function _0x1e276c(){const _0x2679bb=_0x5afd2c['licensedHosts'];if(!_0x2679bb||0x0==_0x2679bb['length'])return!0x0;const {hostname:_0x3f491b}=new URL(window['location']['href']);if(_0x2679bb['includes'](_0x3f491b))return!0x0;const _0x5a22a3=_0x3f491b['split']('.');return _0x2679bb['filter'](_0x4adc8b=>_0x4adc8b['includes']('*'))['map'](_0x58ca91=>_0x58ca91['split']('.'))['filter'](_0x17ac03=>_0x17ac03['length']<=_0x5a22a3['length'])['map'](_0x392d19=>Array(_0x5a22a3['length']-_0x392d19['length'])['fill']('*'===_0x392d19[0x0]?'*':'')['concat'](_0x392d19))['some'](_0x5c93f5=>_0x5a22a3['every']((_0x387ecb,_0x35cce0)=>_0x5c93f5[_0x35cce0]===_0x387ecb||'*'===_0x5c93f5[_0x35cce0]));}function _0x3d29e6(){return _0x1a5429&&_0x2e9554?new window['Promise']((_0xd09da,_0x4a2119)=>{_0x1a5429['then'](_0xd09da,_0x4a2119),_0x2e9554['then'](_0x4c9a07=>{'Valid'!=_0x4c9a07&&_0xd09da(_0x4c9a07);},_0x4a2119);}):_0x1a5429||_0x2e9554||'Valid';}}function _0x578b09(_0x4d6df3,_0x14efd6){return new window['Promise'](_0x23b683=>{if(_0x4b7eec())return _0x23b683('Valid');_0xcc718d(),_0xe9e2b9['decorate']('_sendUsageRequest');let _0xbaef5c=!0x1;const _0x1b3c10=_0x3b7e7f();function _0x3cbb72(_0x48891d){return!!_0x48891d&&('object'==typeof _0x48891d||'function'==typeof _0x48891d)&&'function'==typeof _0x48891d['then']&&'function'==typeof _0x48891d['catch'];}function _0x2af87b(_0xda17c4){_0x22b384(_0xda17c4)['then'](_0x58fb07=>_0x58fb07&&'ok'==_0x58fb07['status']?_0x5cc887(_0x5211ce(_0x1b3c10+_0x14efd6))!=_0x58fb07['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5b431f=>(_0xf0c4b0(),_0x5b431f),()=>{const _0x297bc7=_0x12b93f();return null==_0x297bc7?(_0xf0c4b0(),'Valid'):_0x36b3b5-_0x297bc7>0x240c8400?'UsageLimit':'Valid';})['then'](_0x23b683)['catch'](()=>{_0x23b683('UsageLimit');});const _0x1750f3=0x36ee80;function _0xf0c4b0(){const _0x54389f='llct-'+_0x5cc887(_0x5211ce(_0x4d6df3)),_0x35a296=_0x221788(_0x5cc887(window['Math']['ceil'](_0x36b3b5/_0x1750f3)));window['localStorage']['setItem'](_0x54389f,_0x35a296);}function _0x12b93f(){const _0x1b9ddb='llct-'+_0x5cc887(_0x5211ce(_0x4d6df3)),_0x5442bd=window['localStorage']['getItem'](_0x1b9ddb);return _0x5442bd?window['parseInt'](_0x221788(_0x5442bd),0x10)*_0x1750f3:null;}function _0x22b384(_0x3cfd74){return new window['Promise']((_0x15d3bd,_0x166be4)=>{_0x3cfd74['then'](_0x15d3bd,_0x166be4),window['setTimeout'](_0x166be4,0x1d4c0);});}}_0xe9e2b9['on']('_sendUsageRequest',(_0x2ab018,_0xc85c40)=>{if(_0xc85c40[0x0]!=_0x4d6df3)return _0x23b683('UsageLimit');_0xc85c40[0x1]={..._0xc85c40[0x1],'requestId':_0x1b3c10};},{'priority':'high'}),_0xe9e2b9['on']('_sendUsageRequest',_0x56ddb9=>{_0x3cbb72(_0x56ddb9['return'])&&(_0xbaef5c=!0x0,_0x2af87b(_0x56ddb9['return']));},{'priority':'low'}),_0x48bb58['then'](()=>{_0xbaef5c||_0x23b683('UsageLimit');});});function _0x4b7eec(){return'auto'==_0xe9e2b9['editing']['view']['_overlayModeHint'];}function _0xcc718d(){_0xe9e2b9['editing']['view']['_overlayModeHint']='auto';}}function _0x5aa819(_0x2e0641){const _0xc6ae79=[new window['Promise'](_0x51de26=>setTimeout(_0x51de26,0x93ecc)),_0x48bb58['then'](()=>new window['Promise'](_0xb41c8a=>{let _0x3be9c5=0x0;_0xe9e2b9['model']['on']('applyOperation',(_0x3e1953,_0x345eb3)=>{_0x345eb3[0x0]['isDocumentOperation']&&_0x3be9c5++,0x5e8==_0x3be9c5&&(_0xb41c8a(),_0x3e1953['off']());});}))];return window['Promise']['race'](_0xc6ae79)['then'](()=>_0x2e0641);}async function _0x29224a(){await _0x48bb58,_0xe9e2b9['model']['change']=_0x55b3fb,_0xe9e2b9['model']['enqueueChange']=_0x55b3fb,_0xe9e2b9['enableReadOnlyMode']('model');}function _0x31a6ba(_0x5d4c01){const _0x3ad532=_0x50bf47();_0xe9e2b9[_0x3ad532]='lineHeightLicenseKey'+_0x5d4c01,'Valid'!=_0x5d4c01&&_0x29224a();}function _0x50bf47(){const _0x23acff=window['String'](window['performance']['now']())['replace']('.','');let _0x2b3ebd='c';for(let _0x36b9bf=0x0;_0x36b9bf<_0x23acff['length'];_0x36b9bf+=0x2){let _0x3ac523=window['parseInt'](_0x23acff['substring'](_0x36b9bf,_0x36b9bf+0x2));_0x3ac523>=0x3e&&(_0x3ac523-=0x3e),_0x2b3ebd+=_0x382bec[_0x3ac523];}return _0x2b3ebd;}function _0x196f66(){const _0x42fcdb=_0x38ac52['split']('.');if(0x3!=_0x42fcdb['length'])return null;return _0x3609a7(_0x42fcdb[0x1]);function _0x3609a7(_0x236b04){const _0x66cbff=_0x53d217(_0x236b04);return _0x66cbff&&_0x383303()?_0x66cbff:null;function _0x383303(){const _0x4fe931=_0x66cbff['jti'],_0x4cd03b=window['parseInt'](_0x4fe931['substring'](_0x4fe931['length']-0x8),0x10),_0x4018e6={..._0x66cbff,'jti':_0x4fe931['substring'](0x0,_0x4fe931['length']-0x8)};return delete _0x4018e6['vc'],_0x5211ce(_0x4018e6)==_0x4cd03b;}}}async function _0xef463(){let _0x35cc69=!0x0;try{const [_0x1b3475,_0x15933e,_0x7e70b]=_0x38ac52['split']('.');return _0x3ea02b(_0x1b3475),await _0x352f75(_0x1b3475,_0x15933e,_0x7e70b),_0x35cc69;}catch{return!0x1;}function _0x3ea02b(_0xc32654){const _0x3c9520=_0x53d217(_0xc32654);_0x3c9520&&'ES256'==_0x3c9520['alg']||(_0x35cc69=!0x1);}async function _0x352f75(_0x43974f,_0x284304,_0xa8a9a7){const _0x218caf=window['Uint8Array']['from'](_0x532ac6(_0xa8a9a7),_0x2d126e=>_0x2d126e['charCodeAt'](0x0)),_0x78a75f=new window['TextEncoder']()['encode'](_0x43974f+'.'+_0x284304),_0x55f11b=window['crypto']['subtle'];if(!_0x55f11b)return;const _0x4286b4=await _0x55f11b['importKey']('jwk',_0x3afb2a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x55f11b['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4286b4,_0x218caf,_0x78a75f)||(_0x35cc69=!0x1);}}function _0x53d217(_0x1927bc){return _0x1927bc['startsWith']('ey')?JSON['parse'](_0x532ac6(_0x1927bc)):null;}function _0x532ac6(_0x436471){return window['atob'](_0x436471['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5211ce(_0x550492){let _0x358948=0x1505;function _0x56d511(_0x140925){for(let _0x11745b=0x0;_0x11745b<_0x140925['length'];_0x11745b++){const _0x5a646d=_0x140925['charCodeAt'](_0x11745b);_0x358948=(_0x358948<<0x5)+_0x358948+_0x5a646d,_0x358948&=_0x358948;}}function _0x1792a6(_0x38252d){Array['isArray'](_0x38252d)?_0x38252d['forEach'](_0x1792a6):_0x38252d&&'object'==typeof _0x38252d?Object['entries'](_0x38252d)['sort']()['forEach'](([_0x4490e4,_0x565146])=>{_0x56d511(_0x4490e4),_0x1792a6(_0x565146);}):_0x56d511(window['String'](_0x38252d));}return _0x1792a6(_0x550492),_0x358948>>>0x0;}function _0x5cc887(_0x3e4c16){return _0x3e4c16['toString'](0x10)['padStart'](0x8,'0');}function _0x221788(_0x5c1be9){return _0x5c1be9['split']('')['reverse']()['join']('');}function _0x55b3fb(){}_0x31a6ba(await _0x63e780());}_0x50c981(_0x5aa206['editor']);}(this);}_validateConfig(){const _0x5b137a=this['editor'];if(!_0x5b137a['config']['get']('lineHeight.supportAllValues'))return;const _0x41ed48=_0x5b137a['config']['get']('lineHeight.options')['filter'](_0x2d6da2=>'string'==typeof _0x2d6da2&&(!H(_0x2d6da2)&&isNaN(Number(_0x2d6da2))));if(_0x41ed48['length'])throw new _0x4c12f3('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x41ed48});}_prepareAnyValueConverters(){const _0x546efb=this['editor'],_0xa550f=this['editor']['config']['get']('lineHeight.defaultValue');_0x546efb['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x12453f=>String(_0x12453f)===String(_0xa550f)?null:{'key':'style','value':{'line-height':_0x12453f}}}),_0x546efb['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x5c721a=>{let _0x120798=_0x5c721a['getStyle']('line-height');return _0x16e951(_0x120798)&&(_0x120798=String(Number(_0x120798['slice'](0x0,-0x1))/0x64)),String(_0x120798)===String(_0xa550f)?null:_0x120798;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x312ab1=this['editor'],_0x11c91f=this['editor']['config']['get']('lineHeight.defaultValue'),_0x11fa3d=function(_0x1b5f51,_0x14e6cd){const _0x1a3231={'model':{'key':_0x1b5f51,'values':[]},'view':{}};for(const _0x6146d1 of _0x14e6cd)'class'===_0x6146d1['view']?.['key']?(_0x1a3231['model']['values']['push'](_0x6146d1['model']),_0x1a3231['view'][_0x6146d1['model']]={'key':'class','value':_0x6146d1['view']['value']}):(_0x1a3231['model']['values']['push'](_0x6146d1['model']),_0x1a3231['view'][_0x6146d1['model']]={'key':'style','value':'line-height:'+_0x6146d1['model']+';'});return _0x1a3231;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x110d7c=>_0x110d7c['model']));_0x312ab1['conversion']['attributeToAttribute'](_0x11fa3d),_0x312ab1['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x1f0d5e=>{let _0x45f2a8=_0x1f0d5e['getStyle']('line-height');return _0x16e951(_0x45f2a8)&&(_0x45f2a8=String(Number(_0x45f2a8['slice'](0x0,-0x1))/0x64)),_0x45f2a8===String(_0x11c91f)?null:_0x11fa3d['model']['values']['includes'](_0x45f2a8)?_0x45f2a8:null;}}});}},k=class extends _0x2df8bc{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xef9770={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0xef9770),this['_registerMenuBarComponent'](_0xef9770),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x2f5f94=[this['editor']];for(const _0x3e832e of _0x2f5f94){let _0x5ac059;for(const _0x222464 in _0x3e832e){const _0x3608ea=_0x222464,_0x2bde15=_0x3e832e[_0x3608ea];if('lineHeightLicenseKeyValid'==_0x2bde15||'lineHeightLicenseKeyInvalid'==_0x2bde15||'lineHeightLicenseKeyExpired'==_0x2bde15||'lineHeightLicenseKeyDomainLimit'==_0x2bde15||'lineHeightLicenseKeyNotAllowed'==_0x2bde15||'lineHeightLicenseKeyEvaluationLimit'==_0x2bde15||'lineHeightLicenseKeyUsageLimit'==_0x2bde15){delete _0x3e832e[_0x3608ea],_0x5ac059=_0x2bde15,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x5ac059&&_0x3e832e['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x5ac059&&_0x3e832e['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x5ac059&&_0x3e832e['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x5ac059&&_0x3e832e['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x5ac059&&_0x3e832e['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x5ac059&&_0x3e832e['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x23d383=this['editor'],t=_0x23d383['t'],_0x13018f=_0x23d383['config']['get']('lineHeight'),_0x2b9055={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x13018f)['map'](_0x5782db=>{const _0x15b6c5=_0x2b9055[_0x5782db['title']];return _0x15b6c5&&_0x15b6c5!=_0x5782db['title']&&(_0x5782db=Object['assign']({},_0x5782db,{'title':_0x15b6c5})),_0x5782db;});}_prepareListOptions(){const _0x33b2f7=this['editor']['commands']['get']('lineHeight'),_0x25989e=this['editor']['config']['get']('lineHeight.defaultValue'),_0x2700be=this['_getLocalizedLineHeightOptions'](),_0x3a49af=new _0x4e0734(),_0x20d529=_0x583c9c=>'default'===_0x583c9c||String(_0x25989e)===_0x583c9c;for(const _0xaa1a31 of _0x2700be){const _0x2ae18c={'type':'button','model':new _0x343f6f({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0xaa1a31['title'],'withText':!0x0})};_0x20d529(_0xaa1a31['model'])?(_0x2ae18c['model']['bind']('isOn')['to'](_0x33b2f7,'value',_0x921737=>!_0x921737),_0x2ae18c['model']['commandParam']=void 0x0):(_0x2ae18c['model']['bind']('isOn')['to'](_0x33b2f7,'value',_0x426f6e=>_0x426f6e===_0xaa1a31['model']),_0x2ae18c['model']['commandParam']=_0xaa1a31['model']),_0x3a49af['add'](_0x2ae18c);}if(this['_shouldRenderCustomValueOption']()){const _0x25ef06=this['_getCustomValueOptionDefinition'](_0x2700be);_0x3a49af['add'](_0x25ef06);}return _0x3a49af;}_getCustomValueOptionDefinition(_0x100ab6){const _0x1f8f71=this['editor'],t=_0x1f8f71['t'],_0x38c829=_0x1f8f71['commands']['get']('lineHeight'),_0x32d2fa=_0x100ab6['map'](_0x408664=>_0x408664['model']),_0x340f07={'type':'button','model':new _0x343f6f({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x340f07['model']['bind']('commandParam')['to'](_0x38c829,'value'),_0x340f07['model']['bind']('isOn')['to'](_0x38c829,'value',_0x1336fb=>!!_0x1336fb&&!_0x32d2fa['includes'](String(_0x1336fb))),_0x340f07['model']['bind']('label')['to'](_0x38c829,'value',_0x45e9fa=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x45e9fa))),_0x340f07;}_registerToolbarComponent({accessibleLabel:_0x1450c2,options:_0x1290b1}){const _0xcc082c=this['editor'],_0x59237a=_0xcc082c['commands']['get']('lineHeight');_0xcc082c['ui']['componentFactory']['add']('lineHeight',_0x4631e2=>{const _0x3f05b4=_0x4b2e88(_0x4631e2);return _0x46d838(_0x3f05b4,_0x1290b1,{'role':'menu','ariaLabel':_0x1450c2}),_0x3f05b4['buttonView']['set']({'label':_0x1450c2,'tooltip':!0x0,'icon':_0x2bcafb}),_0x3f05b4['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x3f05b4['bind']('isEnabled')['to'](_0x59237a),this['listenTo'](_0x3f05b4,'execute',_0x27e35e=>{_0xcc082c['execute'](_0x27e35e['source']['commandName'],{'value':_0x27e35e['source']['commandParam']}),_0xcc082c['editing']['view']['focus']();}),_0x3f05b4['once']('change:isOpen',()=>{const _0x23b8a6=_0x3f05b4['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x3f05b4,_0x1290b1,_0x23b8a6);}),_0x3f05b4;});}_registerMenuBarComponent({accessibleLabel:_0xbeca6,options:_0x557673}){const _0x1d1aea=this['editor'],_0x159f9d=_0x1d1aea['commands']['get']('lineHeight');_0x1d1aea['ui']['componentFactory']['add']('menuBar:lineHeight',_0x255e99=>{const _0x1cd314=new _0x1cede2(_0x255e99);_0x1cd314['buttonView']['set']({'label':_0xbeca6,'icon':_0x2bcafb}),_0x1cd314['bind']('isEnabled')['to'](_0x159f9d);const _0x11e3dd=new _0x2bd843(_0x255e99);for(const _0xb0541c of _0x557673){const _0x29082c=new _0x5e521c(_0x255e99,_0x1cd314),_0x176cf3=new _0x2fb419(_0x255e99);_0x176cf3['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x176cf3['bind'](...Object['keys'](_0xb0541c['model']))['to'](_0xb0541c['model']),_0x176cf3['delegate']('execute')['to'](_0x1cd314),_0x176cf3['on']('execute',()=>{_0x1d1aea['execute'](_0xb0541c['model']['commandName'],{'value':_0xb0541c['model']['commandParam']}),_0x1d1aea['editing']['view']['focus']();}),_0x29082c['children']['add'](_0x176cf3),_0x11e3dd['items']['add'](_0x29082c);}return _0x1cd314['panelView']['children']['add'](_0x11e3dd),this['_attachCustomOptionVisibilityHandler'](_0x1cd314,_0x557673,_0x11e3dd),_0x1cd314;});}_attachCustomOptionVisibilityHandler(_0xeeefbf,_0x578858,_0x237cbd){if(!this['_shouldRenderCustomValueOption']())return;const _0x3d5ac0=()=>{if(!_0xeeefbf['isOpen'])return;_0x237cbd['items']['last']['isVisible']=Boolean(_0x578858['last']['model']['isOn']);};_0x3d5ac0(),_0xeeefbf['on']('change:isOpen',()=>{_0x3d5ac0();});}},_=class extends _0x2df8bc{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 _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};
|
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.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": "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.4",
|
|
30
|
+
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.4",
|
|
31
|
+
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.4",
|
|
32
|
+
"@ckeditor/ckeditor5-list": "48.5.0-alpha.4",
|
|
33
|
+
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.4",
|
|
34
|
+
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.4"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist",
|