@ckeditor/ckeditor5-line-height 49.0.0-alpha.4 → 49.0.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 _0x57431b,Plugin as _0x20705f}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x16a1b4,Collection as _0x1691ff,first as _0x60ce6e,uid as _0x5bc650}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x3430cd,isPercentageStyleValue as _0x7d2f85}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x38e9a2,MenuBarMenuListItemView as _0x285286,MenuBarMenuListView as _0x5aa2dc,MenuBarMenuView as _0x254df7,UIModel as _0x5e381e,addListToDropdown as _0x56e9af,createDropdown as _0x177d78}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0xa9599a}from'@ckeditor/ckeditor5-icons';var p=class extends _0x57431b{['refresh'](){const _0x3d6cd7=this['editor']['model']['document'],_0xb3e024=_0x60ce6e(_0x3d6cd7['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0xb3e024)&&this['_canHaveLineHeight'](_0xb3e024),this['value']=this['isEnabled']&&_0xb3e024['getAttribute']('lineHeight');}execute(_0x462190={}){const _0x33623a=this['editor']['model'],_0x257d95=_0x33623a['document']['selection'],_0x86fe09=_0x462190['value'];_0x33623a['change'](_0x409b18=>{const _0x4dfb66=Array['from'](_0x257d95['getSelectedBlocks']())['filter'](_0x6032d7=>this['_canHaveLineHeight'](_0x6032d7));for(const _0x58517a of _0x4dfb66)_0x86fe09?_0x409b18['setAttribute']('lineHeight',_0x86fe09,_0x58517a):_0x409b18['removeAttribute']('lineHeight',_0x58517a);});}_canHaveLineHeight(_0x2146e0){return this['editor']['model']['schema']['checkAttribute'](_0x2146e0,'lineHeight');}};const y={get 'single'(){return{'title':'Single','model':'single','view':{'key':'class','value':'line-height-single'}};},get 'double'(){return{'title':'Double','model':'double','view':{'key':'class','value':'line-height-double'}};}};function H(_0x241cb5){return'string'==typeof _0x241cb5&&'default'===_0x241cb5['toLowerCase']();}function L(_0x1f8dfe){return _0x1f8dfe['options']['map'](_0x3df6de=>{return H(_0x3df6de)?{'title':String(_0x1f8dfe['defaultValue']),'model':'default'}:('number'==typeof _0x3df6de&&(_0x3df6de=String(_0x3df6de)),'string'!=typeof _0x3df6de?_0x3df6de:parseFloat(_0x3df6de)?{'title':_0x3df6de,'model':_0x3df6de,'view':{'name':'span','styles':{'line-height':_0x3df6de}}}:'string'==typeof(_0x48218d=_0x3df6de)?y[_0x48218d]:y[_0x48218d['model']]);var _0x48218d;})['filter'](_0x1cf871=>void 0x0!==_0x1cf871);}var v=class extends _0x20705f{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x1e2af1,conversion:_0x5a7a25}=this['editor'];_0x1e2af1['has']('ListEditing')&&_0x1e2af1['has']('TodoListEditing')&&(_0x1e2af1['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x1cc8b1,_0x21f89c,_0x40325f,_0x228cd8,_0x5dd67c){'todo'==_0x5dd67c['getAttribute']('listType')&&_0x21f89c&&(_0x1cc8b1['addClass']('ck-list-marker-line-height',_0x40325f),_0x1cc8b1['setStyle']('--ck-content-list-marker-line-height',_0x21f89c,_0x40325f));}}),_0x5a7a25['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x5a7a25['for']('upcast')['add'](_0x55fabc=>{_0x55fabc['on']('element:li',function(_0x41575f){const _0x419f4e=new _0x3430cd(_0x41575f);return(_0x5ce7e0,_0x7bca58,_0x1bab83)=>{const _0x321c6b=_0x419f4e['match'](_0x7bca58['viewItem']);if(!_0x321c6b)return;const _0x2cec54=_0x321c6b['match'];_0x2cec54['name']=!0x1,_0x1bab83['consumable']['consume'](_0x7bca58['viewItem'],_0x2cec54);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x20705f{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xfb046f){super(_0xfb046f),_0xfb046f['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x575068=this['editor'];this['_validateConfig'](),_0x575068['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x575068['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x575068['commands']['add']('lineHeight',new p(_0x575068)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0xc5eb0){const _0x12aac8='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x2f7366=0x79770,_0x19d7f4={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x5dc874(_0x447366){const _0x1abc4a=new window['Promise'](_0x17f4b0=>{_0x447366['once']('ready',_0x17f4b0);}),_0xb0ca0a=window['Date']['now'](),_0x203471=_0x447366['config']['get']('licenseKey');async function _0x3ce964(){let _0x22947f,_0xd04a44=null,_0x3b5a80=null;try{return'GPL'==_0x203471?'NotAllowed':(_0x22947f=_0x7c8518(),_0x22947f?(_0x22947f['usageEndpoint']&&(_0x3b5a80=_0x43fcc2(_0x22947f['usageEndpoint'],_0x22947f['jti'])),await _0x2d618f()?_0x3765be()?_0x3c7a41()?'Expired':_0x3b1107()?('evaluation'==_0x22947f['licenseType']&&(_0xd04a44=_0x460b3d('EvaluationLimit')),await _0x4835f0()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3c7a41(){const _0x3f09a=['evaluation','trial']['includes'](_0x22947f['licenseType'])?_0xb0ca0a/0x3e8:0xe10*_0x2f7366;return _0x22947f['exp']<_0x3f09a;}function _0x3765be(){const _0x137dc8=_0x22947f['features'];return!!_0x137dc8&&(!!_0x137dc8['includes']('*')||!!_0x137dc8['includes']('LH'));}function _0x3b1107(){const _0x2e8907=_0x22947f['licensedHosts'];if(!_0x2e8907||0x0==_0x2e8907['length'])return!0x0;const {hostname:_0x3bd258}=new URL(window['location']['href']);if(_0x2e8907['includes'](_0x3bd258))return!0x0;const _0x4f980a=_0x3bd258['split']('.');return _0x2e8907['filter'](_0x5a49f0=>_0x5a49f0['includes']('*'))['map'](_0x3f68af=>_0x3f68af['split']('.'))['filter'](_0x56099a=>_0x56099a['length']<=_0x4f980a['length'])['map'](_0x13c27b=>Array(_0x4f980a['length']-_0x13c27b['length'])['fill']('*'===_0x13c27b[0x0]?'*':'')['concat'](_0x13c27b))['some'](_0x3660cb=>_0x4f980a['every']((_0x12f2f1,_0x1da1b2)=>_0x3660cb[_0x1da1b2]===_0x12f2f1||'*'===_0x3660cb[_0x1da1b2]));}function _0x4835f0(){return _0xd04a44&&_0x3b5a80?new window['Promise']((_0xcbeef1,_0x54f3ff)=>{_0xd04a44['then'](_0xcbeef1,_0x54f3ff),_0x3b5a80['then'](_0x1baa82=>{'Valid'!=_0x1baa82&&_0xcbeef1(_0x1baa82);},_0x54f3ff);}):_0xd04a44||_0x3b5a80||'Valid';}}function _0x43fcc2(_0x3d09ff,_0x15af08){return new window['Promise'](_0x268a96=>{if(_0x553a96())return _0x268a96('Valid');_0x11d3b9(),_0x447366['decorate']('_sendUsageRequest');let _0x42c75d=!0x1;const _0x5a0628=_0x5bc650();function _0x9178ca(_0x4a8f0b){return!!_0x4a8f0b&&('object'==typeof _0x4a8f0b||'function'==typeof _0x4a8f0b)&&'function'==typeof _0x4a8f0b['then']&&'function'==typeof _0x4a8f0b['catch'];}function _0x1b10e8(_0x5d3dd3){_0x1c0ea6(_0x5d3dd3)['then'](_0x928f48=>_0x928f48&&'ok'==_0x928f48['status']?_0x287605(_0x59db40(_0x5a0628+_0x15af08))!=_0x928f48['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5e5454=>(_0x4b01e5(),_0x5e5454),()=>{const _0x189324=_0x18930f();return null==_0x189324?(_0x4b01e5(),'Valid'):_0xb0ca0a-_0x189324>0x240c8400?'UsageLimit':'Valid';})['then'](_0x268a96)['catch'](()=>{_0x268a96('UsageLimit');});const _0x7ab554=0x36ee80;function _0x4b01e5(){const _0x3960af='llct-'+_0x287605(_0x59db40(_0x3d09ff)),_0xc5d985=_0x3e4173(_0x287605(window['Math']['ceil'](_0xb0ca0a/_0x7ab554)));window['localStorage']['setItem'](_0x3960af,_0xc5d985);}function _0x18930f(){const _0x49525f='llct-'+_0x287605(_0x59db40(_0x3d09ff)),_0x4849f4=window['localStorage']['getItem'](_0x49525f);return _0x4849f4?window['parseInt'](_0x3e4173(_0x4849f4),0x10)*_0x7ab554:null;}function _0x1c0ea6(_0x26f38f){return new window['Promise']((_0x49dd61,_0xff05ce)=>{_0x26f38f['then'](_0x49dd61,_0xff05ce),window['setTimeout'](_0xff05ce,0x1d4c0);});}}_0x447366['on']('_sendUsageRequest',(_0x5d6801,_0x433011)=>{if(_0x433011[0x0]!=_0x3d09ff)return _0x268a96('UsageLimit');_0x433011[0x1]={..._0x433011[0x1],'requestId':_0x5a0628};},{'priority':'high'}),_0x447366['on']('_sendUsageRequest',_0x52430e=>{_0x9178ca(_0x52430e['return'])&&(_0x42c75d=!0x0,_0x1b10e8(_0x52430e['return']));},{'priority':'low'}),_0x1abc4a['then'](()=>{_0x42c75d||_0x268a96('UsageLimit');});});function _0x553a96(){return'auto'==_0x447366['editing']['view']['_overlayModeHint'];}function _0x11d3b9(){_0x447366['editing']['view']['_overlayModeHint']='auto';}}function _0x460b3d(_0x2dfc0e){const _0x33b561=[new window['Promise'](_0x133749=>setTimeout(_0x133749,0x93ecc)),_0x1abc4a['then'](()=>new window['Promise'](_0x4f6313=>{let _0x4b0c51=0x0;_0x447366['model']['on']('applyOperation',(_0x51bc48,_0x351695)=>{_0x351695[0x0]['isDocumentOperation']&&_0x4b0c51++,0x5e8==_0x4b0c51&&(_0x4f6313(),_0x51bc48['off']());});}))];return window['Promise']['race'](_0x33b561)['then'](()=>_0x2dfc0e);}async function _0x527606(){await _0x1abc4a,_0x447366['model']['change']=_0x502368,_0x447366['model']['enqueueChange']=_0x502368,_0x447366['enableReadOnlyMode']('model');}function _0x2be164(_0x4c45b4){const _0x12e962=_0x34231b();_0x447366[_0x12e962]='lineHeightLicenseKey'+_0x4c45b4,'Valid'!=_0x4c45b4&&_0x527606();}function _0x34231b(){const _0x562701=window['String'](window['performance']['now']())['replace']('.','');let _0xe750a3='c';for(let _0x390f7a=0x0;_0x390f7a<_0x562701['length'];_0x390f7a+=0x2){let _0x9ccf=window['parseInt'](_0x562701['substring'](_0x390f7a,_0x390f7a+0x2));_0x9ccf>=0x3e&&(_0x9ccf-=0x3e),_0xe750a3+=_0x12aac8[_0x9ccf];}return _0xe750a3;}function _0x7c8518(){const _0xdb751f=_0x203471['split']('.');if(0x3!=_0xdb751f['length'])return null;return _0x485514(_0xdb751f[0x1]);function _0x485514(_0x40b78c){const _0x46fec8=_0x2fb32d(_0x40b78c);return _0x46fec8&&_0x1edc37()?_0x46fec8:null;function _0x1edc37(){const _0x556834=_0x46fec8['jti'],_0x39d8c7=window['parseInt'](_0x556834['substring'](_0x556834['length']-0x8),0x10),_0x528d40={..._0x46fec8,'jti':_0x556834['substring'](0x0,_0x556834['length']-0x8)};return delete _0x528d40['vc'],_0x59db40(_0x528d40)==_0x39d8c7;}}}async function _0x2d618f(){let _0x5a88fd=!0x0;try{const [_0x58250b,_0x40533b,_0x46c2ce]=_0x203471['split']('.');return _0x3d354a(_0x58250b),await _0x2a1acc(_0x58250b,_0x40533b,_0x46c2ce),_0x5a88fd;}catch{return!0x1;}function _0x3d354a(_0x11f2f0){const _0x490099=_0x2fb32d(_0x11f2f0);_0x490099&&'ES256'==_0x490099['alg']||(_0x5a88fd=!0x1);}async function _0x2a1acc(_0x84fb2c,_0x27e207,_0x17417e){const _0x328201=window['Uint8Array']['from'](_0x4eee1b(_0x17417e),_0x9d7250=>_0x9d7250['charCodeAt'](0x0)),_0x476d4f=new window['TextEncoder']()['encode'](_0x84fb2c+'.'+_0x27e207),_0x3fce90=window['crypto']['subtle'];if(!_0x3fce90)return;const _0x2e1da3=await _0x3fce90['importKey']('jwk',_0x19d7f4,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3fce90['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x2e1da3,_0x328201,_0x476d4f)||(_0x5a88fd=!0x1);}}function _0x2fb32d(_0x6eeb35){return _0x6eeb35['startsWith']('ey')?JSON['parse'](_0x4eee1b(_0x6eeb35)):null;}function _0x4eee1b(_0x58af66){return window['atob'](_0x58af66['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x59db40(_0x356db5){let _0x1249e2=0x1505;function _0x40b6d9(_0x510686){for(let _0x128166=0x0;_0x128166<_0x510686['length'];_0x128166++){const _0x2bee69=_0x510686['charCodeAt'](_0x128166);_0x1249e2=(_0x1249e2<<0x5)+_0x1249e2+_0x2bee69,_0x1249e2&=_0x1249e2;}}function _0x95c4e8(_0x4b557a){Array['isArray'](_0x4b557a)?_0x4b557a['forEach'](_0x95c4e8):_0x4b557a&&'object'==typeof _0x4b557a?Object['entries'](_0x4b557a)['sort']()['forEach'](([_0x25c7f1,_0x98a70a])=>{_0x40b6d9(_0x25c7f1),_0x95c4e8(_0x98a70a);}):_0x40b6d9(window['String'](_0x4b557a));}return _0x95c4e8(_0x356db5),_0x1249e2>>>0x0;}function _0x287605(_0x5bf0d3){return _0x5bf0d3['toString'](0x10)['padStart'](0x8,'0');}function _0x3e4173(_0x22059c){return _0x22059c['split']('')['reverse']()['join']('');}function _0x502368(){}_0x2be164(await _0x3ce964());}_0x5dc874(_0xc5eb0['editor']);}(this);}_validateConfig(){const _0x38182a=this['editor'];if(!_0x38182a['config']['get']('lineHeight.supportAllValues'))return;const _0x33be1d=_0x38182a['config']['get']('lineHeight.options')['filter'](_0x206438=>'string'==typeof _0x206438&&(!H(_0x206438)&&isNaN(Number(_0x206438))));if(_0x33be1d['length'])throw new _0x16a1b4('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x33be1d});}_prepareAnyValueConverters(){const _0x597318=this['editor'],_0x56446d=this['editor']['config']['get']('lineHeight.defaultValue');_0x597318['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x298efe=>String(_0x298efe)===String(_0x56446d)?null:{'key':'style','value':{'line-height':_0x298efe}}}),_0x597318['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x4563c6=>{let _0x515d5f=_0x4563c6['getStyle']('line-height');return _0x7d2f85(_0x515d5f)&&(_0x515d5f=String(Number(_0x515d5f['slice'](0x0,-0x1))/0x64)),String(_0x515d5f)===String(_0x56446d)?null:_0x515d5f;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x25afe4=this['editor'],_0x5ec5dd=this['editor']['config']['get']('lineHeight.defaultValue'),_0x255734=function(_0x285146,_0x254b26){const _0x5f0450={'model':{'key':_0x285146,'values':[]},'view':{}};for(const _0x17d0a8 of _0x254b26)'class'===_0x17d0a8['view']?.['key']?(_0x5f0450['model']['values']['push'](_0x17d0a8['model']),_0x5f0450['view'][_0x17d0a8['model']]={'key':'class','value':_0x17d0a8['view']['value']}):(_0x5f0450['model']['values']['push'](_0x17d0a8['model']),_0x5f0450['view'][_0x17d0a8['model']]={'key':'style','value':'line-height:'+_0x17d0a8['model']+';'});return _0x5f0450;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x2e0b5b=>_0x2e0b5b['model']));_0x25afe4['conversion']['attributeToAttribute'](_0x255734),_0x25afe4['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0x48183a=>{let _0x20542b=_0x48183a['getStyle']('line-height');return _0x7d2f85(_0x20542b)&&(_0x20542b=String(Number(_0x20542b['slice'](0x0,-0x1))/0x64)),_0x20542b===String(_0x5ec5dd)?null:_0x255734['model']['values']['includes'](_0x20542b)?_0x20542b:null;}}});}},k=class extends _0x20705f{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xbfe412={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0xbfe412),this['_registerMenuBarComponent'](_0xbfe412),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x32a688=[this['editor']];for(const _0x324f4a of _0x32a688){let _0x3a4b99;for(const _0x5439c7 in _0x324f4a){const _0x4bd8af=_0x5439c7,_0x53fd54=_0x324f4a[_0x4bd8af];if('lineHeightLicenseKeyValid'==_0x53fd54||'lineHeightLicenseKeyInvalid'==_0x53fd54||'lineHeightLicenseKeyExpired'==_0x53fd54||'lineHeightLicenseKeyDomainLimit'==_0x53fd54||'lineHeightLicenseKeyNotAllowed'==_0x53fd54||'lineHeightLicenseKeyEvaluationLimit'==_0x53fd54||'lineHeightLicenseKeyUsageLimit'==_0x53fd54){delete _0x324f4a[_0x4bd8af],_0x3a4b99=_0x53fd54,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x3a4b99&&_0x324f4a['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x3a4b99&&_0x324f4a['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x3a4b99&&_0x324f4a['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x3a4b99&&_0x324f4a['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x3a4b99&&_0x324f4a['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x3a4b99&&_0x324f4a['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x7c9e18=this['editor'],t=_0x7c9e18['t'],_0x4fca24=_0x7c9e18['config']['get']('lineHeight'),_0x436a85={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x4fca24)['map'](_0x490fa5=>{const _0x213069=_0x436a85[_0x490fa5['title']];return _0x213069&&_0x213069!=_0x490fa5['title']&&(_0x490fa5=Object['assign']({},_0x490fa5,{'title':_0x213069})),_0x490fa5;});}_prepareListOptions(){const _0x59595b=this['editor']['commands']['get']('lineHeight'),_0x2588e0=this['editor']['config']['get']('lineHeight.defaultValue'),_0x8cb484=this['_getLocalizedLineHeightOptions'](),_0x2f36a6=new _0x1691ff(),_0x49d15c=_0xd208f5=>'default'===_0xd208f5||String(_0x2588e0)===_0xd208f5;for(const _0xf6bee of _0x8cb484){const _0x2371c4={'type':'button','model':new _0x5e381e({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0xf6bee['title'],'withText':!0x0})};_0x49d15c(_0xf6bee['model'])?(_0x2371c4['model']['bind']('isOn')['to'](_0x59595b,'value',_0x1e4378=>!_0x1e4378),_0x2371c4['model']['commandParam']=void 0x0):(_0x2371c4['model']['bind']('isOn')['to'](_0x59595b,'value',_0x4c892b=>_0x4c892b===_0xf6bee['model']),_0x2371c4['model']['commandParam']=_0xf6bee['model']),_0x2f36a6['add'](_0x2371c4);}if(this['_shouldRenderCustomValueOption']()){const _0xb9c7ee=this['_getCustomValueOptionDefinition'](_0x8cb484);_0x2f36a6['add'](_0xb9c7ee);}return _0x2f36a6;}_getCustomValueOptionDefinition(_0x1d74f8){const _0x5441c8=this['editor'],t=_0x5441c8['t'],_0x42675a=_0x5441c8['commands']['get']('lineHeight'),_0x52fb93=_0x1d74f8['map'](_0xdc607=>_0xdc607['model']),_0x2f24d0={'type':'button','model':new _0x5e381e({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0x2f24d0['model']['bind']('commandParam')['to'](_0x42675a,'value'),_0x2f24d0['model']['bind']('isOn')['to'](_0x42675a,'value',_0x21822c=>!!_0x21822c&&!_0x52fb93['includes'](String(_0x21822c))),_0x2f24d0['model']['bind']('label')['to'](_0x42675a,'value',_0x25c596=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x25c596))),_0x2f24d0;}_registerToolbarComponent({accessibleLabel:_0x4043b3,options:_0x4a78e8}){const _0x279999=this['editor'],_0x4268a7=_0x279999['commands']['get']('lineHeight');_0x279999['ui']['componentFactory']['add']('lineHeight',_0x5366f6=>{const _0x93ec7e=_0x177d78(_0x5366f6);return _0x56e9af(_0x93ec7e,_0x4a78e8,{'role':'menu','ariaLabel':_0x4043b3}),_0x93ec7e['buttonView']['set']({'label':_0x4043b3,'tooltip':!0x0,'icon':_0xa9599a}),_0x93ec7e['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x93ec7e['bind']('isEnabled')['to'](_0x4268a7),this['listenTo'](_0x93ec7e,'execute',_0x348183=>{_0x279999['execute'](_0x348183['source']['commandName'],{'value':_0x348183['source']['commandParam']}),_0x279999['editing']['view']['focus']();}),_0x93ec7e['once']('change:isOpen',()=>{const _0x375a3c=_0x93ec7e['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x93ec7e,_0x4a78e8,_0x375a3c);}),_0x93ec7e;});}_registerMenuBarComponent({accessibleLabel:_0xf72885,options:_0x91539b}){const _0xe14ec9=this['editor'],_0x3c578b=_0xe14ec9['commands']['get']('lineHeight');_0xe14ec9['ui']['componentFactory']['add']('menuBar:lineHeight',_0x4005da=>{const _0x27cf50=new _0x254df7(_0x4005da);_0x27cf50['buttonView']['set']({'label':_0xf72885,'icon':_0xa9599a}),_0x27cf50['bind']('isEnabled')['to'](_0x3c578b);const _0x46fcbe=new _0x5aa2dc(_0x4005da);for(const _0xb35f5f of _0x91539b){const _0x3c205c=new _0x285286(_0x4005da,_0x27cf50),_0x53f530=new _0x38e9a2(_0x4005da);_0x53f530['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x53f530['bind'](...Object['keys'](_0xb35f5f['model']))['to'](_0xb35f5f['model']),_0x53f530['delegate']('execute')['to'](_0x27cf50),_0x53f530['on']('execute',()=>{_0xe14ec9['execute'](_0xb35f5f['model']['commandName'],{'value':_0xb35f5f['model']['commandParam']}),_0xe14ec9['editing']['view']['focus']();}),_0x3c205c['children']['add'](_0x53f530),_0x46fcbe['items']['add'](_0x3c205c);}return _0x27cf50['panelView']['children']['add'](_0x46fcbe),this['_attachCustomOptionVisibilityHandler'](_0x27cf50,_0x91539b,_0x46fcbe),_0x27cf50;});}_attachCustomOptionVisibilityHandler(_0x1b27b8,_0x25ef03,_0x1e0ab7){if(!this['_shouldRenderCustomValueOption']())return;const _0x4f61f0=()=>{if(!_0x1b27b8['isOpen'])return;_0x1e0ab7['items']['last']['isVisible']=Boolean(_0x25ef03['last']['model']['isOn']);};_0x4f61f0(),_0x1b27b8['on']('change:isOpen',()=>{_0x4f61f0();});}},_=class extends _0x20705f{static get requires(){return[b,k];}static get['pluginName'](){return'LineHeight';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{_ as LineHeight,p as LineHeightCommand,b as LineHeightEditing,v as LineHeightTodoListIntegration,k as LineHeightUI};
|
|
23
|
+
import{Command as _0x5a8483,Plugin as _0x2385e5}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x1b75e5,Collection as _0x4eab1e,first as _0x467c19,uid as _0x2a8ddb}from'@ckeditor/ckeditor5-utils';import{Matcher as _0x508143,isPercentageStyleValue as _0x60f645}from'@ckeditor/ckeditor5-engine';import{MenuBarMenuListItemButtonView as _0x49cc12,MenuBarMenuListItemView as _0x4c84d8,MenuBarMenuListView as _0x1431ef,MenuBarMenuView as _0x41159b,UIModel as _0x4cb916,addListToDropdown as _0x22bbc3,createDropdown as _0x1fd993}from'@ckeditor/ckeditor5-ui';import{IconLineHeight as _0xbf6f1}from'@ckeditor/ckeditor5-icons';var p=class extends _0x5a8483{['refresh'](){const _0x5a4df7=this['editor']['model']['document'],_0x1ab1b9=_0x467c19(_0x5a4df7['selection']['getSelectedBlocks']());this['isEnabled']=Boolean(_0x1ab1b9)&&this['_canHaveLineHeight'](_0x1ab1b9),this['value']=this['isEnabled']&&_0x1ab1b9['getAttribute']('lineHeight');}execute(_0x4e2def={}){const _0x191542=this['editor']['model'],_0x2c49e2=_0x191542['document']['selection'],_0x33432e=_0x4e2def['value'];_0x191542['change'](_0x2fb774=>{const _0x57197a=Array['from'](_0x2c49e2['getSelectedBlocks']())['filter'](_0x82e87b=>this['_canHaveLineHeight'](_0x82e87b));for(const _0x3d83bc of _0x57197a)_0x33432e?_0x2fb774['setAttribute']('lineHeight',_0x33432e,_0x3d83bc):_0x2fb774['removeAttribute']('lineHeight',_0x3d83bc);});}_canHaveLineHeight(_0x9eb3f0){return this['editor']['model']['schema']['checkAttribute'](_0x9eb3f0,'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(_0x4d95a5){return'string'==typeof _0x4d95a5&&'default'===_0x4d95a5['toLowerCase']();}function L(_0x3cf9a8){return _0x3cf9a8['options']['map'](_0x5542c7=>{return H(_0x5542c7)?{'title':String(_0x3cf9a8['defaultValue']),'model':'default'}:('number'==typeof _0x5542c7&&(_0x5542c7=String(_0x5542c7)),'string'!=typeof _0x5542c7?_0x5542c7:parseFloat(_0x5542c7)?{'title':_0x5542c7,'model':_0x5542c7,'view':{'name':'span','styles':{'line-height':_0x5542c7}}}:'string'==typeof(_0x1ea6f0=_0x5542c7)?y[_0x1ea6f0]:y[_0x1ea6f0['model']]);var _0x1ea6f0;})['filter'](_0x2eebd6=>void 0x0!==_0x2eebd6);}var v=class extends _0x2385e5{static get['pluginName'](){return'LineHeightTodoListIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {plugins:_0x228fb4,conversion:_0x42193b}=this['editor'];_0x228fb4['has']('ListEditing')&&_0x228fb4['has']('TodoListEditing')&&(_0x228fb4['get']('ListEditing')['registerDowncastStrategy']({'scope':'item','attributeName':'lineHeight','consume':!0x1,'setAttributeOnDowncast'(_0x112a05,_0x42ae40,_0x17adea,_0x4001d2,_0x258d2d){'todo'==_0x258d2d['getAttribute']('listType')&&_0x42ae40&&(_0x112a05['addClass']('ck-list-marker-line-height',_0x17adea),_0x112a05['setStyle']('--ck-content-list-marker-line-height',_0x42ae40,_0x17adea));}}),_0x42193b['for']('upcast')['elementToElement']({'view':{'name':'span','classes':'todo-list__label__description'},'model':'paragraph','converterPriority':'high'}),_0x42193b['for']('upcast')['add'](_0x55bc92=>{_0x55bc92['on']('element:li',function(_0x31923e){const _0x80bc42=new _0x508143(_0x31923e);return(_0x2e465b,_0x359e91,_0x44e848)=>{const _0x31ba07=_0x80bc42['match'](_0x359e91['viewItem']);if(!_0x31ba07)return;const _0x429b14=_0x31ba07['match'];_0x429b14['name']=!0x1,_0x44e848['consumable']['consume'](_0x359e91['viewItem'],_0x429b14);};}({'name':'li','classes':'ck-list-marker-line-height','styles':{'--ck-content-list-marker-line-height':/.*/}}));}));}},b=class extends _0x2385e5{static get['pluginName'](){return'LineHeightEditing';}static get requires(){return[v];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x377285){super(_0x377285),_0x377285['config']['define']('lineHeight',{'defaultValue':1.5,'supportAllValues':!0x1,'options':[0x1,1.15,'default',0x2,2.5,0x3]});}init(){const _0x472e70=this['editor'];this['_validateConfig'](),_0x472e70['model']['schema']['extend']('$block',{'allowAttributes':'lineHeight'}),_0x472e70['model']['schema']['setAttributeProperties']('lineHeight',{'isFormatting':!0x0}),_0x472e70['commands']['add']('lineHeight',new p(_0x472e70)),this['editor']['config']['get']('lineHeight.supportAllValues')?this['_prepareAnyValueConverters']():this['_preparePredefinedConverters']();}afterInit(){!async function(_0x20e2a6){const _0x380695='cvqCYM8ia9TDP6n5dmrzbJtlj03FwLxIpEWSUG7ARu21KfQoXNyg4ZBeOhskHV',_0x201adc=0x79788,_0x5021df={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x5a8305(_0x38bdc4){const _0x5f0e4d=new window['Promise'](_0x570e35=>{_0x38bdc4['once']('ready',_0x570e35);}),_0x59c938=window['Date']['now'](),_0x18a1f=_0x38bdc4['config']['get']('licenseKey');async function _0x36c101(){let _0xd8b73b,_0x12e173=null,_0x94630d=null;try{return'GPL'==_0x18a1f?'NotAllowed':(_0xd8b73b=_0x307fff(),_0xd8b73b?(_0xd8b73b['usageEndpoint']&&(_0x94630d=_0xfbe4bc(_0xd8b73b['usageEndpoint'],_0xd8b73b['jti'])),await _0xa4a174()?_0x448ee0()?_0x353b4d()?'Expired':_0x17b41d()?('evaluation'==_0xd8b73b['licenseType']&&(_0x12e173=_0x58a31f('EvaluationLimit')),await _0x491508()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x353b4d(){const _0x5ef1fc=['evaluation','trial']['includes'](_0xd8b73b['licenseType'])?_0x59c938/0x3e8:0xe10*_0x201adc;return _0xd8b73b['exp']<_0x5ef1fc;}function _0x448ee0(){const _0x43373c=_0xd8b73b['features'];return!!_0x43373c&&(!!_0x43373c['includes']('*')||!!_0x43373c['includes']('LH'));}function _0x17b41d(){const _0x3e3372=_0xd8b73b['licensedHosts'];if(!_0x3e3372||0x0==_0x3e3372['length'])return!0x0;const {hostname:_0xa0e439}=new URL(window['location']['href']);if(_0x3e3372['includes'](_0xa0e439))return!0x0;const _0x1b9608=_0xa0e439['split']('.');return _0x3e3372['filter'](_0x4528c4=>_0x4528c4['includes']('*'))['map'](_0x4a5fae=>_0x4a5fae['split']('.'))['filter'](_0x13dd3c=>_0x13dd3c['length']<=_0x1b9608['length'])['map'](_0xe940c9=>Array(_0x1b9608['length']-_0xe940c9['length'])['fill']('*'===_0xe940c9[0x0]?'*':'')['concat'](_0xe940c9))['some'](_0x3afe4e=>_0x1b9608['every']((_0x5c327f,_0x4088fa)=>_0x3afe4e[_0x4088fa]===_0x5c327f||'*'===_0x3afe4e[_0x4088fa]));}function _0x491508(){return _0x12e173&&_0x94630d?new window['Promise']((_0x512877,_0x42c266)=>{_0x12e173['then'](_0x512877,_0x42c266),_0x94630d['then'](_0x2feae9=>{'Valid'!=_0x2feae9&&_0x512877(_0x2feae9);},_0x42c266);}):_0x12e173||_0x94630d||'Valid';}}function _0xfbe4bc(_0xf3365f,_0x11a366){return new window['Promise'](_0x17af87=>{if(_0x75d330())return _0x17af87('Valid');_0x2779b0(),_0x38bdc4['decorate']('_sendUsageRequest');let _0x536de3=!0x1;const _0x5bcfe3=_0x2a8ddb();function _0x5d4f03(_0x5b2b8b){return!!_0x5b2b8b&&('object'==typeof _0x5b2b8b||'function'==typeof _0x5b2b8b)&&'function'==typeof _0x5b2b8b['then']&&'function'==typeof _0x5b2b8b['catch'];}function _0x23d7be(_0x3ee0bd){_0x7db9d6(_0x3ee0bd)['then'](_0x1ce93f=>_0x1ce93f&&'ok'==_0x1ce93f['status']?_0x3c3470(_0x464678(_0x5bcfe3+_0x11a366))!=_0x1ce93f['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0xb08fae=>(_0x6cb3b7(),_0xb08fae),()=>{const _0x41a037=_0x5cff1f();return null==_0x41a037?(_0x6cb3b7(),'Valid'):_0x59c938-_0x41a037>0x240c8400?'UsageLimit':'Valid';})['then'](_0x17af87)['catch'](()=>{_0x17af87('UsageLimit');});const _0x5d45cd=0x36ee80;function _0x6cb3b7(){const _0x48d4d5='llct-'+_0x3c3470(_0x464678(_0xf3365f)),_0x2105e6=_0x375e88(_0x3c3470(window['Math']['ceil'](_0x59c938/_0x5d45cd)));window['localStorage']['setItem'](_0x48d4d5,_0x2105e6);}function _0x5cff1f(){const _0x464740='llct-'+_0x3c3470(_0x464678(_0xf3365f)),_0x2c261b=window['localStorage']['getItem'](_0x464740);return _0x2c261b?window['parseInt'](_0x375e88(_0x2c261b),0x10)*_0x5d45cd:null;}function _0x7db9d6(_0xc2fad6){return new window['Promise']((_0x175e4e,_0x5b8310)=>{_0xc2fad6['then'](_0x175e4e,_0x5b8310),window['setTimeout'](_0x5b8310,0x1d4c0);});}}_0x38bdc4['on']('_sendUsageRequest',(_0x207ce0,_0x3f549a)=>{if(_0x3f549a[0x0]!=_0xf3365f)return _0x17af87('UsageLimit');_0x3f549a[0x1]={..._0x3f549a[0x1],'requestId':_0x5bcfe3};},{'priority':'high'}),_0x38bdc4['on']('_sendUsageRequest',_0x336d4b=>{_0x5d4f03(_0x336d4b['return'])&&(_0x536de3=!0x0,_0x23d7be(_0x336d4b['return']));},{'priority':'low'}),_0x5f0e4d['then'](()=>{_0x536de3||_0x17af87('UsageLimit');});});function _0x75d330(){return'auto'==_0x38bdc4['editing']['view']['_overlayModeHint'];}function _0x2779b0(){_0x38bdc4['editing']['view']['_overlayModeHint']='auto';}}function _0x58a31f(_0x4333fd){const _0x4aaba4=[new window['Promise'](_0x3a84e9=>setTimeout(_0x3a84e9,0x93ecc)),_0x5f0e4d['then'](()=>new window['Promise'](_0x294124=>{let _0x16499b=0x0;_0x38bdc4['model']['on']('applyOperation',(_0x4b0aa2,_0xd22a14)=>{_0xd22a14[0x0]['isDocumentOperation']&&_0x16499b++,0x5e8==_0x16499b&&(_0x294124(),_0x4b0aa2['off']());});}))];return window['Promise']['race'](_0x4aaba4)['then'](()=>_0x4333fd);}async function _0x5e505b(){await _0x5f0e4d,_0x38bdc4['model']['change']=_0x1fc18b,_0x38bdc4['model']['enqueueChange']=_0x1fc18b,_0x38bdc4['enableReadOnlyMode']('model');}function _0x28292a(_0x2d20d9){const _0x10444c=_0x1b2391();_0x38bdc4[_0x10444c]='lineHeightLicenseKey'+_0x2d20d9,'Valid'!=_0x2d20d9&&_0x5e505b();}function _0x1b2391(){const _0x402bcf=window['String'](window['performance']['now']())['replace']('.','');let _0x1daee8='c';for(let _0x2dd963=0x0;_0x2dd963<_0x402bcf['length'];_0x2dd963+=0x2){let _0xb4bb1c=window['parseInt'](_0x402bcf['substring'](_0x2dd963,_0x2dd963+0x2));_0xb4bb1c>=0x3e&&(_0xb4bb1c-=0x3e),_0x1daee8+=_0x380695[_0xb4bb1c];}return _0x1daee8;}function _0x307fff(){const _0x1d63ef=_0x18a1f['split']('.');if(0x3!=_0x1d63ef['length'])return null;return _0x40399f(_0x1d63ef[0x1]);function _0x40399f(_0x2f2c69){const _0x201862=_0x51f449(_0x2f2c69);return _0x201862&&_0x4361ee()?_0x201862:null;function _0x4361ee(){const _0x49bb36=_0x201862['jti'],_0x16710c=window['parseInt'](_0x49bb36['substring'](_0x49bb36['length']-0x8),0x10),_0x5df406={..._0x201862,'jti':_0x49bb36['substring'](0x0,_0x49bb36['length']-0x8)};return delete _0x5df406['vc'],_0x464678(_0x5df406)==_0x16710c;}}}async function _0xa4a174(){let _0x42d2af=!0x0;try{const [_0x4f15e8,_0x3c225d,_0x5c6362]=_0x18a1f['split']('.');return _0x45b97d(_0x4f15e8),await _0x4c8447(_0x4f15e8,_0x3c225d,_0x5c6362),_0x42d2af;}catch{return!0x1;}function _0x45b97d(_0x23822c){const _0x6ac2a4=_0x51f449(_0x23822c);_0x6ac2a4&&'ES256'==_0x6ac2a4['alg']||(_0x42d2af=!0x1);}async function _0x4c8447(_0x4c3c41,_0x5f42c8,_0x2f1111){const _0x581434=window['Uint8Array']['from'](_0x37de23(_0x2f1111),_0x9d2865=>_0x9d2865['charCodeAt'](0x0)),_0x3014c3=new window['TextEncoder']()['encode'](_0x4c3c41+'.'+_0x5f42c8),_0x512da2=window['crypto']['subtle'];if(!_0x512da2)return;const _0x42984d=await _0x512da2['importKey']('jwk',_0x5021df,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x512da2['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x42984d,_0x581434,_0x3014c3)||(_0x42d2af=!0x1);}}function _0x51f449(_0x5ede4e){return _0x5ede4e['startsWith']('ey')?JSON['parse'](_0x37de23(_0x5ede4e)):null;}function _0x37de23(_0x1c76c1){return window['atob'](_0x1c76c1['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x464678(_0x205fc7){let _0x7c4b35=0x1505;function _0x27a3ad(_0xac2846){for(let _0x480009=0x0;_0x480009<_0xac2846['length'];_0x480009++){const _0x19ed72=_0xac2846['charCodeAt'](_0x480009);_0x7c4b35=(_0x7c4b35<<0x5)+_0x7c4b35+_0x19ed72,_0x7c4b35&=_0x7c4b35;}}function _0x2b3051(_0x1467c3){Array['isArray'](_0x1467c3)?_0x1467c3['forEach'](_0x2b3051):_0x1467c3&&'object'==typeof _0x1467c3?Object['entries'](_0x1467c3)['sort']()['forEach'](([_0xd824f7,_0x17f317])=>{_0x27a3ad(_0xd824f7),_0x2b3051(_0x17f317);}):_0x27a3ad(window['String'](_0x1467c3));}return _0x2b3051(_0x205fc7),_0x7c4b35>>>0x0;}function _0x3c3470(_0x4fbe43){return _0x4fbe43['toString'](0x10)['padStart'](0x8,'0');}function _0x375e88(_0xd3ede2){return _0xd3ede2['split']('')['reverse']()['join']('');}function _0x1fc18b(){}_0x28292a(await _0x36c101());}_0x5a8305(_0x20e2a6['editor']);}(this);}_validateConfig(){const _0x1bc254=this['editor'];if(!_0x1bc254['config']['get']('lineHeight.supportAllValues'))return;const _0x2cd27b=_0x1bc254['config']['get']('lineHeight.options')['filter'](_0x41d2fa=>'string'==typeof _0x41d2fa&&(!H(_0x41d2fa)&&isNaN(Number(_0x41d2fa))));if(_0x2cd27b['length'])throw new _0x1b75e5('line-height-invalid-use-of-named-presets',null,{'namedPresets':_0x2cd27b});}_prepareAnyValueConverters(){const _0x2e20e8=this['editor'],_0x8c0f89=this['editor']['config']['get']('lineHeight.defaultValue');_0x2e20e8['conversion']['for']('downcast')['attributeToAttribute']({'model':{'key':'lineHeight'},'view':_0x4edd5d=>String(_0x4edd5d)===String(_0x8c0f89)?null:{'key':'style','value':{'line-height':_0x4edd5d}}}),_0x2e20e8['conversion']['for']('upcast')['attributeToAttribute']({'model':{'key':'lineHeight','value':_0x36ba18=>{let _0x1f11b6=_0x36ba18['getStyle']('line-height');return _0x60f645(_0x1f11b6)&&(_0x1f11b6=String(Number(_0x1f11b6['slice'](0x0,-0x1))/0x64)),String(_0x1f11b6)===String(_0x8c0f89)?null:_0x1f11b6;}},'view':{'styles':{'line-height':/.*/}}});}_preparePredefinedConverters(){const _0x3d81c1=this['editor'],_0x378690=this['editor']['config']['get']('lineHeight.defaultValue'),_0x39853b=function(_0x485233,_0x399031){const _0x2c9bf3={'model':{'key':_0x485233,'values':[]},'view':{}};for(const _0x2fc4d5 of _0x399031)'class'===_0x2fc4d5['view']?.['key']?(_0x2c9bf3['model']['values']['push'](_0x2fc4d5['model']),_0x2c9bf3['view'][_0x2fc4d5['model']]={'key':'class','value':_0x2fc4d5['view']['value']}):(_0x2c9bf3['model']['values']['push'](_0x2fc4d5['model']),_0x2c9bf3['view'][_0x2fc4d5['model']]={'key':'style','value':'line-height:'+_0x2fc4d5['model']+';'});return _0x2c9bf3;}('lineHeight',L(this['editor']['config']['get']('lineHeight'))['filter'](_0x5a0354=>_0x5a0354['model']));_0x3d81c1['conversion']['attributeToAttribute'](_0x39853b),_0x3d81c1['conversion']['for']('upcast')['attributeToAttribute']({'view':{'styles':{'line-height':/[\s\S]+/}},'model':{'key':'lineHeight','value':_0xe718ff=>{let _0x14d52e=_0xe718ff['getStyle']('line-height');return _0x60f645(_0x14d52e)&&(_0x14d52e=String(Number(_0x14d52e['slice'](0x0,-0x1))/0x64)),_0x14d52e===String(_0x378690)?null:_0x39853b['model']['values']['includes'](_0x14d52e)?_0x14d52e:null;}}});}},k=class extends _0x2385e5{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'LineHeightUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x2d50ce={'accessibleLabel':(0x0,this['editor']['t'])('Line\x20height'),'options':this['_prepareListOptions']()};this['_registerToolbarComponent'](_0x2d50ce),this['_registerMenuBarComponent'](_0x2d50ce),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x2f4e09=[this['editor']];for(const _0x21e05b of _0x2f4e09){let _0x3f50da;for(const _0x212e2c in _0x21e05b){const _0x564728=_0x212e2c,_0x26c8d5=_0x21e05b[_0x564728];if('lineHeightLicenseKeyValid'==_0x26c8d5||'lineHeightLicenseKeyInvalid'==_0x26c8d5||'lineHeightLicenseKeyExpired'==_0x26c8d5||'lineHeightLicenseKeyDomainLimit'==_0x26c8d5||'lineHeightLicenseKeyNotAllowed'==_0x26c8d5||'lineHeightLicenseKeyEvaluationLimit'==_0x26c8d5||'lineHeightLicenseKeyUsageLimit'==_0x26c8d5){delete _0x21e05b[_0x564728],_0x3f50da=_0x26c8d5,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'lineHeightLicenseKeyInvalid'==_0x3f50da&&_0x21e05b['_showLicenseError']('invalid'),'lineHeightLicenseKeyExpired'==_0x3f50da&&_0x21e05b['_showLicenseError']('expired'),'lineHeightLicenseKeyDomainLimit'==_0x3f50da&&_0x21e05b['_showLicenseError']('domainLimit'),'lineHeightLicenseKeyNotAllowed'==_0x3f50da&&_0x21e05b['_showLicenseError']('featureNotAllowed','LineHeight'),'lineHeightLicenseKeyEvaluationLimit'==_0x3f50da&&_0x21e05b['_showLicenseError']('evaluationLimit'),'lineHeightLicenseKeyUsageLimit'==_0x3f50da&&_0x21e05b['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_shouldRenderCustomValueOption(){return this['editor']['config']['get']('lineHeight.supportAllValues');}_getLocalizedLineHeightOptions(){const _0x15291c=this['editor'],t=_0x15291c['t'],_0x2f4f23=_0x15291c['config']['get']('lineHeight'),_0x447244={'Single':t({'string':'Single','id':'LINE_HEIGHT_SINGLE_OPTION_LABEL'}),'Double':t({'string':'Double','id':'LINE_HEIGHT_DOUBLE_OPTION_LABEL'})};return L(_0x2f4f23)['map'](_0x494e60=>{const _0x5da88b=_0x447244[_0x494e60['title']];return _0x5da88b&&_0x5da88b!=_0x494e60['title']&&(_0x494e60=Object['assign']({},_0x494e60,{'title':_0x5da88b})),_0x494e60;});}_prepareListOptions(){const _0x591e6e=this['editor']['commands']['get']('lineHeight'),_0xaf5361=this['editor']['config']['get']('lineHeight.defaultValue'),_0x51877c=this['_getLocalizedLineHeightOptions'](),_0x557726=new _0x4eab1e(),_0xb77692=_0x3e3529=>'default'===_0x3e3529||String(_0xaf5361)===_0x3e3529;for(const _0x28e24d of _0x51877c){const _0x293688={'type':'button','model':new _0x4cb916({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','label':_0x28e24d['title'],'withText':!0x0})};_0xb77692(_0x28e24d['model'])?(_0x293688['model']['bind']('isOn')['to'](_0x591e6e,'value',_0x293557=>!_0x293557),_0x293688['model']['commandParam']=void 0x0):(_0x293688['model']['bind']('isOn')['to'](_0x591e6e,'value',_0x379714=>_0x379714===_0x28e24d['model']),_0x293688['model']['commandParam']=_0x28e24d['model']),_0x557726['add'](_0x293688);}if(this['_shouldRenderCustomValueOption']()){const _0x1e3c02=this['_getCustomValueOptionDefinition'](_0x51877c);_0x557726['add'](_0x1e3c02);}return _0x557726;}_getCustomValueOptionDefinition(_0x37332b){const _0x5e8b5a=this['editor'],t=_0x5e8b5a['t'],_0x550725=_0x5e8b5a['commands']['get']('lineHeight'),_0x559c0d=_0x37332b['map'](_0x43369c=>_0x43369c['model']),_0xc9f5ad={'type':'button','model':new _0x4cb916({'commandName':'lineHeight','class':'ck-line-height-option','role':'menuitemradio','withText':!0x0})};return _0xc9f5ad['model']['bind']('commandParam')['to'](_0x550725,'value'),_0xc9f5ad['model']['bind']('isOn')['to'](_0x550725,'value',_0x4bddd8=>!!_0x4bddd8&&!_0x559c0d['includes'](String(_0x4bddd8))),_0xc9f5ad['model']['bind']('label')['to'](_0x550725,'value',_0x2095fc=>t({'string':'Custom:\x20%0','id':'LINE_HEIGHT_CUSTOM_OPTION_LABEL'},String(_0x2095fc))),_0xc9f5ad;}_registerToolbarComponent({accessibleLabel:_0xc17de1,options:_0x1fbc60}){const _0x1f1ebb=this['editor'],_0x59cd23=_0x1f1ebb['commands']['get']('lineHeight');_0x1f1ebb['ui']['componentFactory']['add']('lineHeight',_0x14836b=>{const _0x16fa4a=_0x1fd993(_0x14836b);return _0x22bbc3(_0x16fa4a,_0x1fbc60,{'role':'menu','ariaLabel':_0xc17de1}),_0x16fa4a['buttonView']['set']({'label':_0xc17de1,'tooltip':!0x0,'icon':_0xbf6f1}),_0x16fa4a['extendTemplate']({'attributes':{'class':['ck-line-height-dropdown']}}),_0x16fa4a['bind']('isEnabled')['to'](_0x59cd23),this['listenTo'](_0x16fa4a,'execute',_0x7ef2aa=>{_0x1f1ebb['execute'](_0x7ef2aa['source']['commandName'],{'value':_0x7ef2aa['source']['commandParam']}),_0x1f1ebb['editing']['view']['focus']();}),_0x16fa4a['once']('change:isOpen',()=>{const _0x16c890=_0x16fa4a['panelView']['children']['first'];this['_attachCustomOptionVisibilityHandler'](_0x16fa4a,_0x1fbc60,_0x16c890);}),_0x16fa4a;});}_registerMenuBarComponent({accessibleLabel:_0x1b3213,options:_0x5c5a95}){const _0x39237a=this['editor'],_0x1259af=_0x39237a['commands']['get']('lineHeight');_0x39237a['ui']['componentFactory']['add']('menuBar:lineHeight',_0x3e09a5=>{const _0x4fe64d=new _0x41159b(_0x3e09a5);_0x4fe64d['buttonView']['set']({'label':_0x1b3213,'icon':_0xbf6f1}),_0x4fe64d['bind']('isEnabled')['to'](_0x1259af);const _0x112ecd=new _0x1431ef(_0x3e09a5);for(const _0x5ade31 of _0x5c5a95){const _0x514392=new _0x4c84d8(_0x3e09a5,_0x4fe64d),_0x4d27cf=new _0x49cc12(_0x3e09a5);_0x4d27cf['set']({'role':'menuitemradio','isToggleable':!0x0}),_0x4d27cf['bind'](...Object['keys'](_0x5ade31['model']))['to'](_0x5ade31['model']),_0x4d27cf['delegate']('execute')['to'](_0x4fe64d),_0x4d27cf['on']('execute',()=>{_0x39237a['execute'](_0x5ade31['model']['commandName'],{'value':_0x5ade31['model']['commandParam']}),_0x39237a['editing']['view']['focus']();}),_0x514392['children']['add'](_0x4d27cf),_0x112ecd['items']['add'](_0x514392);}return _0x4fe64d['panelView']['children']['add'](_0x112ecd),this['_attachCustomOptionVisibilityHandler'](_0x4fe64d,_0x5c5a95,_0x112ecd),_0x4fe64d;});}_attachCustomOptionVisibilityHandler(_0x3bf767,_0x1ce16a,_0x3be9df){if(!this['_shouldRenderCustomValueOption']())return;const _0x2d30a4=()=>{if(!_0x3bf767['isOpen'])return;_0x3be9df['items']['last']['isVisible']=Boolean(_0x1ce16a['last']['model']['isOn']);};_0x2d30a4(),_0x3bf767['on']('change:isOpen',()=>{_0x2d30a4();});}},_=class extends _0x2385e5{static get requires(){return[b,k];}static get['pluginName'](){return'LineHeight';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{_ as LineHeight,p as LineHeightCommand,b as LineHeightEditing,v as LineHeightTodoListIntegration,k as LineHeightUI};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-line-height",
|
|
3
|
-
"version": "49.0.0-alpha.
|
|
3
|
+
"version": "49.0.0-alpha.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": "49.0.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-engine": "49.0.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-icons": "49.0.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-list": "49.0.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-ui": "49.0.0-alpha.
|
|
34
|
-
"@ckeditor/ckeditor5-utils": "49.0.0-alpha.
|
|
29
|
+
"@ckeditor/ckeditor5-core": "49.0.0-alpha.5",
|
|
30
|
+
"@ckeditor/ckeditor5-engine": "49.0.0-alpha.5",
|
|
31
|
+
"@ckeditor/ckeditor5-icons": "49.0.0-alpha.5",
|
|
32
|
+
"@ckeditor/ckeditor5-list": "49.0.0-alpha.5",
|
|
33
|
+
"@ckeditor/ckeditor5-ui": "49.0.0-alpha.5",
|
|
34
|
+
"@ckeditor/ckeditor5-utils": "49.0.0-alpha.5"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist",
|