@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 +2 -2
- package/src/exportpdf.js +1 -1
- package/src/exportpdfcommand.js +1 -1
- package/src/index.js +1 -1
- package/src/utils.js +1 -1
- package/CHANGELOG.md +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-export-pdf",
|
|
3
|
-
"version": "
|
|
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": "^
|
|
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
|
|
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'];}}}
|
package/src/exportpdfcommand.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
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}
|
|
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
|
|
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