@ckeditor/ckeditor5-export-pdf 32.0.0 → 33.0.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": "32.0.0",
3
+ "version": "33.0.0",
4
4
  "description": "Export to PDF feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -29,31 +29,31 @@
29
29
  ],
30
30
  "main": "src/index.js",
31
31
  "dependencies": {
32
- "ckeditor5": "^32.0.0"
32
+ "ckeditor5": "^33.0.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@ckeditor/ckeditor5-alignment": "^32.0.0",
36
- "@ckeditor/ckeditor5-basic-styles": "^32.0.0",
37
- "@ckeditor/ckeditor5-cloud-services": "^32.0.0",
38
- "@ckeditor/ckeditor5-code-block": "^32.0.0",
39
- "@ckeditor/ckeditor5-core": "^32.0.0",
35
+ "@ckeditor/ckeditor5-alignment": "^33.0.0",
36
+ "@ckeditor/ckeditor5-basic-styles": "^33.0.0",
37
+ "@ckeditor/ckeditor5-cloud-services": "^33.0.0",
38
+ "@ckeditor/ckeditor5-code-block": "^33.0.0",
39
+ "@ckeditor/ckeditor5-core": "^33.0.0",
40
40
  "@ckeditor/ckeditor5-dev-utils": "^28.0.1",
41
- "@ckeditor/ckeditor5-easy-image": "^32.0.0",
42
- "@ckeditor/ckeditor5-editor-decoupled": "^32.0.0",
43
- "@ckeditor/ckeditor5-font": "^32.0.0",
44
- "@ckeditor/ckeditor5-heading": "^32.0.0",
45
- "@ckeditor/ckeditor5-highlight": "^32.0.0",
46
- "@ckeditor/ckeditor5-horizontal-line": "^32.0.0",
47
- "@ckeditor/ckeditor5-image": "^32.0.0",
48
- "@ckeditor/ckeditor5-indent": "^32.0.0",
49
- "@ckeditor/ckeditor5-media-embed": "^32.0.0",
50
- "@ckeditor/ckeditor5-page-break": "^32.0.0",
51
- "@ckeditor/ckeditor5-paragraph": "^32.0.0",
52
- "@ckeditor/ckeditor5-paste-from-office": "^32.0.0",
53
- "@ckeditor/ckeditor5-table": "^32.0.0",
54
- "@ckeditor/ckeditor5-theme-lark": "^32.0.0",
55
- "@ckeditor/ckeditor5-ui": "^32.0.0",
56
- "@ckeditor/ckeditor5-utils": "^32.0.0",
41
+ "@ckeditor/ckeditor5-easy-image": "^33.0.0",
42
+ "@ckeditor/ckeditor5-editor-decoupled": "^33.0.0",
43
+ "@ckeditor/ckeditor5-font": "^33.0.0",
44
+ "@ckeditor/ckeditor5-heading": "^33.0.0",
45
+ "@ckeditor/ckeditor5-highlight": "^33.0.0",
46
+ "@ckeditor/ckeditor5-horizontal-line": "^33.0.0",
47
+ "@ckeditor/ckeditor5-image": "^33.0.0",
48
+ "@ckeditor/ckeditor5-indent": "^33.0.0",
49
+ "@ckeditor/ckeditor5-media-embed": "^33.0.0",
50
+ "@ckeditor/ckeditor5-page-break": "^33.0.0",
51
+ "@ckeditor/ckeditor5-paragraph": "^33.0.0",
52
+ "@ckeditor/ckeditor5-paste-from-office": "^33.0.0",
53
+ "@ckeditor/ckeditor5-table": "^33.0.0",
54
+ "@ckeditor/ckeditor5-theme-lark": "^33.0.0",
55
+ "@ckeditor/ckeditor5-ui": "^33.0.0",
56
+ "@ckeditor/ckeditor5-utils": "^33.0.0",
57
57
  "webpack": "^5.58.1",
58
58
  "webpack-cli": "^4.9.0"
59
59
  },
package/src/exportpdf.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x516af7}from'ckeditor5/src/core';import{ButtonView as _0x2d2a2f,View as _0xe0c852,Notification as _0x21864a}from'ckeditor5/src/ui';import _0x168356 from'./exportpdfcommand';import _0x454396 from'../theme/icons/exportpdf.svg';import'../theme/exportpdf.css';export default class p extends _0x516af7{static get['pluginName'](){return'ExportPdf';}static get['requires'](){return['CloudServices',_0x21864a];}['init'](){const _0x57674b=this['editor'],t=_0x57674b['t'],_0x514c10=_0x57674b['config']['get']('exportPdf')||{};_0x57674b['commands']['add']('exportPdf',new _0x168356(_0x57674b)),_0x57674b['ui']['componentFactory']['add']('exportPdf',_0x41af21=>{const _0xea0f44=_0x57674b['commands']['get']('exportPdf'),_0xf73fc6=new _0x2d2a2f(_0x41af21);_0xf73fc6['set']({'label':t('Export\x20to\x20PDF'),'icon':_0x454396,'tooltip':!0x0}),_0xf73fc6['bind']('isOn','isEnabled')['to'](_0xea0f44,'isBusy','isEnabled'),_0xf73fc6['extendTemplate']({'attributes':{'class':[_0xf73fc6['bindTemplate']['if']('isOn','ck-exportpdf_status-pending')]}});const _0x5bdbd6=new _0xe0c852();return _0x5bdbd6['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner-container']},'children':[{'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner']}}]}),_0xf73fc6['children']['add'](_0x5bdbd6),this['listenTo'](_0xf73fc6,'execute',()=>{_0x57674b['execute']('exportPdf',_0x514c10),_0x57674b['editing']['view']['focus']();}),_0xf73fc6;});const _0x5c7e3c=_0x57674b['plugins']['get']('CloudServices');if(!0x1===_0x514c10['tokenUrl'])this['_token']=null;else{if(_0x514c10['tokenUrl'])return _0x5c7e3c['registerTokenUrl'](_0x514c10['tokenUrl'])['then'](_0x36dfac=>{this['_token']=_0x36dfac;});this['_token']=_0x5c7e3c['token'];}}}
23
+ import{Plugin as _0x5bea12}from'ckeditor5/src/core';import{ButtonView as _0xea6cab,View as _0x401d78,Notification as _0x2ef026}from'ckeditor5/src/ui';import _0x2b82f3 from'./exportpdfcommand';import _0x23861c from'../theme/icons/exportpdf.svg';import'../theme/exportpdf.css';export default class p extends _0x5bea12{static get['pluginName'](){return'ExportPdf';}static get['requires'](){return['CloudServices',_0x2ef026];}['init'](){const _0x2a86d1=this['editor'],t=_0x2a86d1['t'],_0x5bddcc=_0x2a86d1['config']['get']('exportPdf')||{};_0x2a86d1['commands']['add']('exportPdf',new _0x2b82f3(_0x2a86d1)),_0x2a86d1['ui']['componentFactory']['add']('exportPdf',_0xb7906f=>{const _0x1e7bb8=_0x2a86d1['commands']['get']('exportPdf'),_0x5864ba=new _0xea6cab(_0xb7906f);_0x5864ba['set']({'label':t('Export\x20to\x20PDF'),'icon':_0x23861c,'tooltip':!0x0}),_0x5864ba['bind']('isOn','isEnabled')['to'](_0x1e7bb8,'isBusy','isEnabled'),_0x5864ba['extendTemplate']({'attributes':{'class':[_0x5864ba['bindTemplate']['if']('isOn','ck-exportpdf_status-pending')]}});const _0x400341=new _0x401d78();return _0x400341['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner-container']},'children':[{'tag':'span','attributes':{'class':['ck','ck-exportpdf__spinner']}}]}),_0x5864ba['children']['add'](_0x400341),this['listenTo'](_0x5864ba,'execute',()=>{_0x2a86d1['execute']('exportPdf',_0x5bddcc),_0x2a86d1['editing']['view']['focus']();}),_0x5864ba;});const _0x44d900=_0x2a86d1['plugins']['get']('CloudServices');if(!0x1===_0x5bddcc['tokenUrl'])this['_token']=null;else{if(_0x5bddcc['tokenUrl'])return _0x44d900['registerTokenUrl'](_0x5bddcc['tokenUrl'])['then'](_0xf34091=>{this['_token']=_0xf34091;});this['_token']=_0x44d900['token'];}}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x178911}from'ckeditor5/src/core';import{getStyles as _0x2ffcf6}from'./utils';export default class o extends _0x178911{constructor(_0x6636d1){super(_0x6636d1),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x49c9b5={}){const _0x2a2b91=this['editor'],t=_0x2a2b91['t'],_0x452eb3=_0x49c9b5['converterUrl']||'https://pdf-converter.cke-cs.com/v1/convert/',_0x466add=_0x49c9b5['dataCallback']||(_0x3b971b=>_0x3b971b['getData']()),_0x416145=_0x2a2b91['plugins']['get']('ExportPdf'),_0x443c26=_0x49c9b5['token']||_0x416145['_token'];return this['isBusy']=!0x0,this['refresh'](),_0x2ffcf6(_0x49c9b5['stylesheets']||['EDITOR_STYLES'])['then'](_0x9bedeb=>{const _0x3d38b3={'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'+_0x2a2b91['locale']['contentLanguageDirection']+'\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09'+_0x466add(_0x2a2b91)+'\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':_0x9bedeb,'options':_0x49c9b5['converterOptions']},_0x492e4e={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/pdf',..._0x443c26?{'Authorization':_0x443c26['value']}:null,'x-cs-app-id':_0x49c9b5['appID']||'cke5'},'body':JSON['stringify'](_0x3d38b3)};return window['fetch'](_0x452eb3,_0x492e4e)['then'](_0x238ecf=>{if(0xc8!==_0x238ecf['status'])throw _0x238ecf;return _0x238ecf['blob']();})['then'](_0x4707cc=>{this['o'](_0x4707cc,_0x49c9b5['fileName']||'document.pdf');});})['catch'](_0xad978a=>{throw _0x2a2b91['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.')),_0xad978a;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['o'](_0x28d32e,_0x51b9f0){const _0x3c7182=document['createElement']('a');_0x3c7182['href']=window['URL']['createObjectURL'](_0x28d32e),_0x3c7182['download']=_0x51b9f0,_0x3c7182['click'](),_0x3c7182['remove']();}}
23
+ import{Command as _0xb7a7de}from'ckeditor5/src/core';import{getStyles as _0x180021}from'./utils';export default class o extends _0xb7a7de{constructor(_0x4ddca2){super(_0x4ddca2),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x179fff={}){const _0x253c9a=this['editor'],t=_0x253c9a['t'],_0x12691c=_0x179fff['converterUrl']||'https://pdf-converter.cke-cs.com/v1/convert/',_0xc41bd4=_0x179fff['dataCallback']||(_0x409fa7=>_0x409fa7['getData']()),_0x4b0dcf=_0x253c9a['plugins']['get']('ExportPdf'),_0x30fa82=_0x179fff['token']||_0x4b0dcf['_token'];return this['isBusy']=!0x0,this['refresh'](),_0x180021(_0x179fff['stylesheets']||['EDITOR_STYLES'])['then'](_0x1e1dda=>{const _0x5da9ff={'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'+_0x253c9a['locale']['contentLanguageDirection']+'\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09'+_0xc41bd4(_0x253c9a)+'\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':_0x1e1dda,'options':_0x179fff['converterOptions']},_0x62eb78={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/pdf',..._0x30fa82?{'Authorization':_0x30fa82['value']}:null,'x-cs-app-id':_0x179fff['appID']||'cke5'},'body':JSON['stringify'](_0x5da9ff)};return window['fetch'](_0x12691c,_0x62eb78)['then'](_0x22fc55=>{if(0xc8!==_0x22fc55['status'])throw _0x22fc55;return _0x22fc55['blob']();})['then'](_0x37ea76=>{this['o'](_0x37ea76,_0x179fff['fileName']||'document.pdf');});})['catch'](_0x586a38=>{throw _0x253c9a['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.')),_0x586a38;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['o'](_0x53d39b,_0xae649){const _0x7c9311=document['createElement']('a');_0x7c9311['href']=window['URL']['createObjectURL'](_0x53d39b),_0x7c9311['download']=_0xae649,_0x7c9311['click'](),_0x7c9311['remove']();}}
package/src/index.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- var _0x4a92=['./exportpdf'];(function(_0x4f4412,_0x4a92ff){var _0x35bf19=function(_0xb92804){while(--_0xb92804){_0x4f4412['push'](_0x4f4412['shift']());}};_0x35bf19(++_0x4a92ff);}(_0x4a92,0x1b1));var _0x35bf=function(_0x4f4412,_0x4a92ff){_0x4f4412=_0x4f4412-0x0;var _0x35bf19=_0x4a92[_0x4f4412];return _0x35bf19;};export{default as ExportPdf}from_0x35bf('0x0');
23
+ export{default as ExportPdf}from'./exportpdf';
package/src/utils.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x1356=['length','hasAttribute','trim','cssText','ownerNode','indexOf','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.','data-cke',':root','warn','then','push','.ck-content','styleSheets','fetch'];(function(_0x222188,_0x13568f){const _0x258da8=function(_0x511c80){while(--_0x511c80){_0x222188['push'](_0x222188['shift']());}};_0x258da8(++_0x13568f);}(_0x1356,0xf3));const _0x258d=function(_0x222188,_0x13568f){_0x222188=_0x222188-0x0;let _0x258da8=_0x1356[_0x222188];return _0x258da8;};export function getStyles(_0x2d6bed){if(!_0x2d6bed)return new Promise(_0x52b1bd=>_0x52b1bd(''));const _0x1a0bcf=[];for(const _0x37747f of _0x2d6bed)'EDITOR_STYLES'!==_0x37747f?_0x1a0bcf['push'](window[_0x258d('0xb')](_0x37747f)[_0x258d('0x7')](_0x325c0e=>_0x325c0e['text']())):_0x1a0bcf[_0x258d('0x8')](u());return Promise['all'](_0x1a0bcf)[_0x258d('0x7')](_0x2a58b6=>_0x2a58b6['join']('\x20')[_0x258d('0xe')]());}function u(){const _0x3581c3=[],_0x5803a5=[];for(const _0xbb1af4 of document[_0x258d('0xa')])if(_0xbb1af4[_0x258d('0x1')][_0x258d('0xd')](_0x258d('0x4')))for(const _0x58435b of _0xbb1af4['cssRules'])-0x1!==_0x58435b[_0x258d('0x0')]['indexOf'](_0x258d('0x9'))?_0x3581c3[_0x258d('0x8')](_0x58435b[_0x258d('0x0')]):-0x1!==_0x58435b[_0x258d('0x0')][_0x258d('0x2')](_0x258d('0x5'))&&_0x5803a5[_0x258d('0x8')](_0x58435b[_0x258d('0x0')]);return _0x3581c3[_0x258d('0xc')]||console[_0x258d('0x6')](_0x258d('0x3')),[..._0x5803a5,..._0x3581c3]['join']('\x20')[_0x258d('0xe')]();}
23
+ const _0x4251=['push','all','join',':root','indexOf','ownerNode','data-cke','trim','EDITOR_STYLES','cssText','then','warn','hasAttribute','fetch','.ck-content','length'];(function(_0x129b48,_0x425140){const _0x71c0d0=function(_0x23b178){while(--_0x23b178){_0x129b48['push'](_0x129b48['shift']());}};_0x71c0d0(++_0x425140);}(_0x4251,0xb2));const _0x71c0=function(_0x129b48,_0x425140){_0x129b48=_0x129b48-0x0;let _0x71c0d0=_0x4251[_0x129b48];return _0x71c0d0;};export function getStyles(_0x4976e4){if(!_0x4976e4)return new Promise(_0x3298bb=>_0x3298bb(''));const _0x2abe18=[];for(const _0x4cab65 of _0x4976e4)_0x71c0('0x6')!==_0x4cab65?_0x2abe18[_0x71c0('0xe')](window[_0x71c0('0xb')](_0x4cab65)[_0x71c0('0x8')](_0x23a5b8=>_0x23a5b8['text']())):_0x2abe18['push'](u());return Promise[_0x71c0('0xf')](_0x2abe18)['then'](_0x4cd60f=>_0x4cd60f[_0x71c0('0x0')]('\x20')[_0x71c0('0x5')]());}function u(){const _0x431b91=[],_0x1c005f=[];for(const _0x2d6295 of document['styleSheets'])if(_0x2d6295[_0x71c0('0x3')][_0x71c0('0xa')](_0x71c0('0x4')))for(const _0x5adb73 of _0x2d6295['cssRules'])-0x1!==_0x5adb73[_0x71c0('0x7')]['indexOf'](_0x71c0('0xc'))?_0x431b91[_0x71c0('0xe')](_0x5adb73[_0x71c0('0x7')]):-0x1!==_0x5adb73['cssText'][_0x71c0('0x2')](_0x71c0('0x1'))&&_0x1c005f['push'](_0x5adb73['cssText']);return _0x431b91[_0x71c0('0xd')]||console[_0x71c0('0x9')]('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.'),[..._0x1c005f,..._0x431b91]['join']('\x20')[_0x71c0('0x5')]();}