@ckeditor/ckeditor5-export-pdf 31.0.0 → 31.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-export-pdf",
3
- "version": "31.0.0",
3
+ "version": "31.1.0",
4
4
  "description": "Export to PDF feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -37,7 +37,7 @@
37
37
  "@ckeditor/ckeditor5-cloud-services": ">=25.0.0",
38
38
  "@ckeditor/ckeditor5-code-block": ">=25.0.0",
39
39
  "@ckeditor/ckeditor5-core": ">=25.0.0",
40
- "@ckeditor/ckeditor5-dev-utils": "^25.4.0",
40
+ "@ckeditor/ckeditor5-dev-utils": "^26.0.0",
41
41
  "@ckeditor/ckeditor5-easy-image": ">=25.0.0",
42
42
  "@ckeditor/ckeditor5-editor-decoupled": ">=25.0.0",
43
43
  "@ckeditor/ckeditor5-font": ">=25.0.0",
package/src/exportpdf.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x22889b}from'ckeditor5/src/core';import{ButtonView as _0x5609dd,View as _0x3de66a,Notification as _0xe7af47}from'ckeditor5/src/ui';import _0x47f9f6 from'./exportpdfcommand';import _0x144b87 from'../theme/icons/exportpdf.svg';import'../theme/exportpdf.css';export default class p extends _0x22889b{static get['pluginName'](){return'ExportPdf';}static get['requires'](){return['CloudServices',_0xe7af47];}['init'](){const _0x16b015=this['editor'],t=_0x16b015['t'],_0x538c10=_0x16b015['config']['get']('exportPdf')||{};_0x16b015['commands']['add']('exportPdf',new _0x47f9f6(_0x16b015)),_0x16b015['ui']['componentFactory']['add']('exportPdf',_0x5e0662=>{const _0x2f9604=_0x16b015['commands']['get']('exportPdf'),_0x251744=new _0x5609dd(_0x5e0662);_0x251744['set']({'label':t('Export\x20to\x20PDF'),'icon':_0x144b87,'tooltip':!0x0}),_0x251744['bind']('isOn','isEnabled')['to'](_0x2f9604,'isBusy','isEnabled'),_0x251744['extendTemplate']({'attributes':{'class':[_0x251744['bindTemplate']['if']('isOn','ck-exportpdf_status-pending')]}});const _0x553f22=new _0x3de66a();return _0x553f22['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner-container']},'children':[{'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner']}}]}),_0x251744['children']['add'](_0x553f22),this['listenTo'](_0x251744,'execute',()=>{_0x16b015['execute']('exportPdf',_0x538c10),_0x16b015['editing']['view']['focus']();}),_0x251744;});const _0x411ff0=_0x16b015['plugins']['get']('CloudServices');if(!0x1===_0x538c10['tokenUrl'])this['_token']=null;else{if(_0x538c10['tokenUrl'])return _0x411ff0['registerTokenUrl'](_0x538c10['tokenUrl'])['then'](_0x60587d=>{this['_token']=_0x60587d;});this['_token']=_0x411ff0['token'];}}}
23
+ import{Plugin as _0x30c7da}from'ckeditor5/src/core';import{ButtonView as _0x400b57,View as _0x4e6731,Notification as _0x4f2b21}from'ckeditor5/src/ui';import _0x3621bf from'./exportpdfcommand';import _0x14415c from'../theme/icons/exportpdf.svg';import'../theme/exportpdf.css';export default class p extends _0x30c7da{static get['pluginName'](){return'ExportPdf';}static get['requires'](){return['CloudServices',_0x4f2b21];}['init'](){const _0x4fb3d2=this['editor'],t=_0x4fb3d2['t'],_0x2400c7=_0x4fb3d2['config']['get']('exportPdf')||{};_0x4fb3d2['commands']['add']('exportPdf',new _0x3621bf(_0x4fb3d2)),_0x4fb3d2['ui']['componentFactory']['add']('exportPdf',_0x2500e7=>{const _0x146c12=_0x4fb3d2['commands']['get']('exportPdf'),_0x148245=new _0x400b57(_0x2500e7);_0x148245['set']({'label':t('Export\x20to\x20PDF'),'icon':_0x14415c,'tooltip':!0x0}),_0x148245['bind']('isOn','isEnabled')['to'](_0x146c12,'isBusy','isEnabled'),_0x148245['extendTemplate']({'attributes':{'class':[_0x148245['bindTemplate']['if']('isOn','ck-exportpdf_status-pending')]}});const _0x2980a7=new _0x4e6731();return _0x2980a7['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner-container']},'children':[{'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner']}}]}),_0x148245['children']['add'](_0x2980a7),this['listenTo'](_0x148245,'execute',()=>{_0x4fb3d2['execute']('exportPdf',_0x2400c7),_0x4fb3d2['editing']['view']['focus']();}),_0x148245;});const _0x40f641=_0x4fb3d2['plugins']['get']('CloudServices');if(!0x1===_0x2400c7['tokenUrl'])this['_token']=null;else{if(_0x2400c7['tokenUrl'])return _0x40f641['registerTokenUrl'](_0x2400c7['tokenUrl'])['then'](_0x219695=>{this['_token']=_0x219695;});this['_token']=_0x40f641['token'];}}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x4c7046}from'ckeditor5/src/core';import{getStyles as _0x1fad26}from'./utils';export default class o extends _0x4c7046{constructor(_0x581fd7){super(_0x581fd7),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x4685c2={}){const _0x446ed6=this['editor'],t=_0x446ed6['t'],_0x22ed3c=_0x4685c2['converterUrl']||'https://pdf-converter.cke-cs.com/v1/convert/',_0x296d2d=_0x4685c2['dataCallback']||(_0x242e36=>_0x242e36['getData']()),_0x52131b=_0x446ed6['plugins']['get']('ExportPdf'),_0x206386=_0x4685c2['token']||_0x52131b['_token'];return this['isBusy']=!0x0,this['refresh'](),_0x1fad26(_0x4685c2['stylesheets']||['EDITOR_STYLES'])['then'](_0x5a55ad=>{const _0xb99d23={'html':'<html>\x0a\x09\x09\x09\x09\x09\x09<head>\x0a\x09\x09\x09\x09\x09\x09\x09<meta\x20charset=\x22utf-8\x22>\x0a\x09\x09\x09\x09\x09\x09</head>\x0a\x09\x09\x09\x09\x09\x09<body>\x0a\x09\x09\x09\x09\x09\x09\x09<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x446ed6['locale']['contentLanguageDirection']+'\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09'+_0x296d2d(_0x446ed6)+'\x0a\x09\x09\x09\x09\x09\x09\x09</div>\x0a\x09\x09\x09\x09\x09\x09<body>\x0a\x09\x09\x09\x09\x09</html>','css':_0x5a55ad,'options':_0x4685c2['converterOptions']},_0x2b9e39={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/pdf',..._0x206386?{'Authorization':_0x206386['value']}:null,'x-cs-app-id':_0x4685c2['appID']||'cke5'},'body':JSON['stringify'](_0xb99d23)};return window['fetch'](_0x22ed3c,_0x2b9e39)['then'](_0x1b8bb2=>{if(0xc8!==_0x1b8bb2['status'])throw _0x1b8bb2;return _0x1b8bb2['blob']();})['then'](_0x42b002=>{this['o'](_0x42b002,_0x4685c2['fileName']||'document.pdf');});})['catch'](_0x2ae9a9=>{throw _0x446ed6['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.')),_0x2ae9a9;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['o'](_0x1e77a3,_0x473c85){const _0x45297c=document['createElement']('a');_0x45297c['href']=window['URL']['createObjectURL'](_0x1e77a3),_0x45297c['download']=_0x473c85,_0x45297c['click'](),_0x45297c['remove']();}}
23
+ import{Command as _0x5ca488}from'ckeditor5/src/core';import{getStyles as _0x1e20ae}from'./utils';export default class o extends _0x5ca488{constructor(_0xa6115b){super(_0xa6115b),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x37c8cf={}){const _0x5cc177=this['editor'],t=_0x5cc177['t'],_0x208d35=_0x37c8cf['converterUrl']||'https://pdf-converter.cke-cs.com/v1/convert/',_0x460e65=_0x37c8cf['dataCallback']||(_0x478cb5=>_0x478cb5['getData']()),_0x53a408=_0x5cc177['plugins']['get']('ExportPdf'),_0x4683ec=_0x37c8cf['token']||_0x53a408['_token'];return this['isBusy']=!0x0,this['refresh'](),_0x1e20ae(_0x37c8cf['stylesheets']||['EDITOR_STYLES'])['then'](_0x53a7fa=>{const _0x393820={'html':'<html>\x0a\x09\x09\x09\x09\x09\x09<head>\x0a\x09\x09\x09\x09\x09\x09\x09<meta\x20charset=\x22utf-8\x22>\x0a\x09\x09\x09\x09\x09\x09</head>\x0a\x09\x09\x09\x09\x09\x09<body>\x0a\x09\x09\x09\x09\x09\x09\x09<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x5cc177['locale']['contentLanguageDirection']+'\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09'+_0x460e65(_0x5cc177)+'\x0a\x09\x09\x09\x09\x09\x09\x09</div>\x0a\x09\x09\x09\x09\x09\x09<body>\x0a\x09\x09\x09\x09\x09</html>','css':_0x53a7fa,'options':_0x37c8cf['converterOptions']},_0x2d2bf0={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/pdf',..._0x4683ec?{'Authorization':_0x4683ec['value']}:null,'x-cs-app-id':_0x37c8cf['appID']||'cke5'},'body':JSON['stringify'](_0x393820)};return window['fetch'](_0x208d35,_0x2d2bf0)['then'](_0x13054f=>{if(0xc8!==_0x13054f['status'])throw _0x13054f;return _0x13054f['blob']();})['then'](_0x52eb8d=>{this['o'](_0x52eb8d,_0x37c8cf['fileName']||'document.pdf');});})['catch'](_0x3d5ebc=>{throw _0x5cc177['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.')),_0x3d5ebc;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['o'](_0x5ec51b,_0x327cdb){const _0x52e00d=document['createElement']('a');_0x52e00d['href']=window['URL']['createObjectURL'](_0x5ec51b),_0x52e00d['download']=_0x327cdb,_0x52e00d['click'](),_0x52e00d['remove']();}}
package/src/index.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export{default as ExportPdf}from'./exportpdf';
23
+ var _0x5b2c=['./exportpdf'];(function(_0x5a1e19,_0x5b2ce8){var _0xb4302b=function(_0x467093){while(--_0x467093){_0x5a1e19['push'](_0x5a1e19['shift']());}};_0xb4302b(++_0x5b2ce8);}(_0x5b2c,0x1de));var _0xb430=function(_0x5a1e19,_0x5b2ce8){_0x5a1e19=_0x5a1e19-0x0;var _0xb4302b=_0x5b2c[_0x5a1e19];return _0xb4302b;};export{default as ExportPdf}from_0xb430('0x0');
package/src/utils.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x3fe3=['hasAttribute','trim','The\x20editor\x20stylesheet\x20could\x20not\x20be\x20found\x20in\x20the\x20document.\x20Check\x20your\x20webpack\x20config\x20–\x20style-loader\x20should\x20use\x20data-cke=true\x20attribute\x20for\x20the\x20editor\x20stylesheet.','.ck-content','warn','EDITOR_STYLES','fetch','push','text','all','cssRules','length','indexOf','cssText',':root','join'];(function(_0x23cb1c,_0x3fe3c3){const _0x2ae4f0=function(_0x1bcf8b){while(--_0x1bcf8b){_0x23cb1c['push'](_0x23cb1c['shift']());}};_0x2ae4f0(++_0x3fe3c3);}(_0x3fe3,0xfa));const _0x2ae4=function(_0x23cb1c,_0x3fe3c3){_0x23cb1c=_0x23cb1c-0x0;let _0x2ae4f0=_0x3fe3[_0x23cb1c];return _0x2ae4f0;};export function getStyles(_0x156592){if(!_0x156592)return new Promise(_0x344361=>_0x344361(''));const _0x4dd317=[];for(const _0x2aad18 of _0x156592)_0x2ae4('0xb')!==_0x2aad18?_0x4dd317[_0x2ae4('0xd')](window[_0x2ae4('0xc')](_0x2aad18)['then'](_0x3443ce=>_0x3443ce[_0x2ae4('0xe')]())):_0x4dd317['push'](u());return Promise[_0x2ae4('0xf')](_0x4dd317)['then'](_0x152d3c=>_0x152d3c['join']('\x20')[_0x2ae4('0x7')]());}function u(){const _0x33157d=[],_0x2d7283=[];for(const _0x7e0841 of document['styleSheets'])if(_0x7e0841['ownerNode'][_0x2ae4('0x6')]('data-cke'))for(const _0x41fa1d of _0x7e0841[_0x2ae4('0x0')])-0x1!==_0x41fa1d[_0x2ae4('0x3')][_0x2ae4('0x2')](_0x2ae4('0x9'))?_0x33157d[_0x2ae4('0xd')](_0x41fa1d[_0x2ae4('0x3')]):-0x1!==_0x41fa1d[_0x2ae4('0x3')][_0x2ae4('0x2')](_0x2ae4('0x4'))&&_0x2d7283[_0x2ae4('0xd')](_0x41fa1d['cssText']);return _0x33157d[_0x2ae4('0x1')]||console[_0x2ae4('0xa')](_0x2ae4('0x8')),[..._0x2d7283,..._0x33157d][_0x2ae4('0x5')]('\x20')[_0x2ae4('0x7')]();}
23
+ const _0x2a49=['styleSheets','EDITOR_STYLES','cssRules','push','length','join','indexOf','ownerNode','text','data-cke','trim','fetch',':root','warn','cssText'];(function(_0x5780e1,_0x2a49fa){const _0x5c4070=function(_0x1c30df){while(--_0x1c30df){_0x5780e1['push'](_0x5780e1['shift']());}};_0x5c4070(++_0x2a49fa);}(_0x2a49,0x1d3));const _0x5c40=function(_0x5780e1,_0x2a49fa){_0x5780e1=_0x5780e1-0x0;let _0x5c4070=_0x2a49[_0x5780e1];return _0x5c4070;};export function getStyles(_0x117cdd){if(!_0x117cdd)return new Promise(_0x1ea7d4=>_0x1ea7d4(''));const _0xa6c992=[];for(const _0x1809ff of _0x117cdd)_0x5c40('0xe')!==_0x1809ff?_0xa6c992[_0x5c40('0x1')](window[_0x5c40('0x9')](_0x1809ff)['then'](_0x4791fe=>_0x4791fe[_0x5c40('0x6')]())):_0xa6c992[_0x5c40('0x1')](u());return Promise['all'](_0xa6c992)['then'](_0x4c43ae=>_0x4c43ae[_0x5c40('0x3')]('\x20')[_0x5c40('0x8')]());}function u(){const _0x722d10=[],_0x3f4b36=[];for(const _0x433376 of document[_0x5c40('0xd')])if(_0x433376[_0x5c40('0x5')]['hasAttribute'](_0x5c40('0x7')))for(const _0x2752a0 of _0x433376[_0x5c40('0x0')])-0x1!==_0x2752a0[_0x5c40('0xc')][_0x5c40('0x4')]('.ck-content')?_0x722d10['push'](_0x2752a0[_0x5c40('0xc')]):-0x1!==_0x2752a0[_0x5c40('0xc')][_0x5c40('0x4')](_0x5c40('0xa'))&&_0x3f4b36[_0x5c40('0x1')](_0x2752a0['cssText']);return _0x722d10[_0x5c40('0x2')]||console[_0x5c40('0xb')]('The\x20editor\x20stylesheet\x20could\x20not\x20be\x20found\x20in\x20the\x20document.\x20Check\x20your\x20webpack\x20config\x20–\x20style-loader\x20should\x20use\x20data-cke=true\x20attribute\x20for\x20the\x20editor\x20stylesheet.'),[..._0x3f4b36,..._0x722d10][_0x5c40('0x3')]('\x20')[_0x5c40('0x8')]();}