@ckeditor/ckeditor5-export-pdf 29.1.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": "29.1.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.3.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 _0x56e626}from'ckeditor5/src/core';import{ButtonView as _0x40d602,View as _0x1b4ebe,Notification as _0x506abb}from'ckeditor5/src/ui';import _0x5e01ce from'./exportpdfcommand';import _0x17c5a1 from'../theme/icons/exportpdf.svg';import'../theme/exportpdf.css';export default class p extends _0x56e626{static get['pluginName'](){return'ExportPdf';}static get['requires'](){return['CloudServices',_0x506abb];}['init'](){const _0x5b1a80=this['editor'],t=_0x5b1a80['t'],_0x536240=_0x5b1a80['config']['get']('exportPdf')||{};_0x5b1a80['commands']['add']('exportPdf',new _0x5e01ce(_0x5b1a80)),_0x5b1a80['ui']['componentFactory']['add']('exportPdf',_0x4850fc=>{const _0x3b15e0=_0x5b1a80['commands']['get']('exportPdf'),_0x484f1b=new _0x40d602(_0x4850fc);_0x484f1b['set']({'label':t('Export\x20to\x20PDF'),'icon':_0x17c5a1,'tooltip':!0x0}),_0x484f1b['bind']('isOn','isEnabled')['to'](_0x3b15e0,'isBusy','isEnabled'),_0x484f1b['extendTemplate']({'attributes':{'class':[_0x484f1b['bindTemplate']['if']('isOn','ck-exportpdf_status-pending')]}});const _0x556af7=new _0x1b4ebe();return _0x556af7['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner-container']},'children':[{'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner']}}]}),_0x484f1b['children']['add'](_0x556af7),this['listenTo'](_0x484f1b,'execute',()=>{_0x5b1a80['execute']('exportPdf',_0x536240),_0x5b1a80['editing']['view']['focus']();}),_0x484f1b;});const _0x4f4c07=_0x5b1a80['plugins']['get']('CloudServices');if(!0x1===_0x536240['tokenUrl'])this['_token']=null;else{if(_0x536240['tokenUrl'])return _0x4f4c07['registerTokenUrl'](_0x536240['tokenUrl'])['then'](_0x49c057=>{this['_token']=_0x49c057;});this['_token']=_0x4f4c07['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 _0x30b075}from'ckeditor5/src/core';import{getStyles as _0x4b63ae}from'./utils';export default class o extends _0x30b075{constructor(_0x57fcc9){super(_0x57fcc9),this['set']('isBusy',!0x1),this['listenTo'](_0x57fcc9,'change:isReadOnly',(_0x3bb112,_0x54ad75,_0x4538c7)=>{_0x4538c7&&this['clearForceDisabled']('readOnlyMode');});}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x36ae05={}){const _0x4ac2f6=this['editor'],t=_0x4ac2f6['t'],_0x48c451=_0x36ae05['converterUrl']||'https://pdf-converter.cke-cs.com/v1/convert/',_0x1c3678=_0x36ae05['dataCallback']||(_0x548520=>_0x548520['getData']()),_0x325a60=_0x4ac2f6['plugins']['get']('ExportPdf'),_0x5aae0c=_0x36ae05['token']||_0x325a60['_token'];return this['isBusy']=!0x0,this['refresh'](),_0x4b63ae(_0x36ae05['stylesheets']||['EDITOR_STYLES'])['then'](_0x5c5530=>{const _0x512b25={'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'+_0x4ac2f6['locale']['contentLanguageDirection']+'\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09'+_0x1c3678(_0x4ac2f6)+'\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':_0x5c5530,'options':_0x36ae05['converterOptions']},_0x340984={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/pdf',..._0x5aae0c?{'Authorization':_0x5aae0c['value']}:null,'x-cs-app-id':_0x36ae05['appID']||'cke5'},'body':JSON['stringify'](_0x512b25)};return window['fetch'](_0x48c451,_0x340984)['then'](_0x49a060=>{if(0xc8!==_0x49a060['status'])throw _0x49a060;return _0x49a060['blob']();})['then'](_0x132cd4=>{this['o'](_0x132cd4,_0x36ae05['fileName']||'document.pdf');});})['catch'](_0x428e70=>{throw _0x4ac2f6['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.')),_0x428e70;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['o'](_0x15c6cc,_0x1b6199){const _0x1dba91=document['createElement']('a');_0x1dba91['href']=window['URL']['createObjectURL'](_0x15c6cc),_0x1dba91['download']=_0x1b6199,_0x1dba91['click'](),_0x1dba91['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 _0x2c2b=['EDITOR_STYLES','text','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.','cssText','join',':root','trim','then','all','.ck-content','indexOf','ownerNode','cssRules','fetch','push','styleSheets','length','hasAttribute'];(function(_0x3540d1,_0x2c2bc6){const _0x35ec02=function(_0x7ad93b){while(--_0x7ad93b){_0x3540d1['push'](_0x3540d1['shift']());}};_0x35ec02(++_0x2c2bc6);}(_0x2c2b,0x143));const _0x35ec=function(_0x3540d1,_0x2c2bc6){_0x3540d1=_0x3540d1-0x0;let _0x35ec02=_0x2c2b[_0x3540d1];return _0x35ec02;};export function getStyles(_0x2e5d54){if(!_0x2e5d54)return new Promise(_0x8e4207=>_0x8e4207(''));const _0x46a20f=[];for(const _0x518231 of _0x2e5d54)_0x35ec('0x1')!==_0x518231?_0x46a20f[_0x35ec('0xf')](window[_0x35ec('0xe')](_0x518231)[_0x35ec('0x8')](_0x1684c5=>_0x1684c5[_0x35ec('0x2')]())):_0x46a20f['push'](u());return Promise[_0x35ec('0x9')](_0x46a20f)['then'](_0x4f40b6=>_0x4f40b6[_0x35ec('0x5')]('\x20')[_0x35ec('0x7')]());}function u(){const _0x2d6412=[],_0x1eabc2=[];for(const _0x461f5f of document[_0x35ec('0x10')])if(_0x461f5f[_0x35ec('0xc')][_0x35ec('0x0')]('data-cke'))for(const _0x49a8be of _0x461f5f[_0x35ec('0xd')])-0x1!==_0x49a8be[_0x35ec('0x4')][_0x35ec('0xb')](_0x35ec('0xa'))?_0x2d6412['push'](_0x49a8be['cssText']):-0x1!==_0x49a8be['cssText']['indexOf'](_0x35ec('0x6'))&&_0x1eabc2[_0x35ec('0xf')](_0x49a8be['cssText']);return _0x2d6412[_0x35ec('0x11')]||console['warn'](_0x35ec('0x3')),[..._0x1eabc2,..._0x2d6412][_0x35ec('0x5')]('\x20')[_0x35ec('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')]();}
package/CHANGELOG.md DELETED
@@ -1,4 +0,0 @@
1
- Changelog
2
- =========
3
-
4
- All changes in the package are documented in the CKEditor 5 repository. See: https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.