@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 +23 -23
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-export-pdf",
|
|
3
|
-
"version": "
|
|
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
|
+
"ckeditor5": "^33.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@ckeditor/ckeditor5-alignment": "^
|
|
36
|
-
"@ckeditor/ckeditor5-basic-styles": "^
|
|
37
|
-
"@ckeditor/ckeditor5-cloud-services": "^
|
|
38
|
-
"@ckeditor/ckeditor5-code-block": "^
|
|
39
|
-
"@ckeditor/ckeditor5-core": "^
|
|
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": "^
|
|
42
|
-
"@ckeditor/ckeditor5-editor-decoupled": "^
|
|
43
|
-
"@ckeditor/ckeditor5-font": "^
|
|
44
|
-
"@ckeditor/ckeditor5-heading": "^
|
|
45
|
-
"@ckeditor/ckeditor5-highlight": "^
|
|
46
|
-
"@ckeditor/ckeditor5-horizontal-line": "^
|
|
47
|
-
"@ckeditor/ckeditor5-image": "^
|
|
48
|
-
"@ckeditor/ckeditor5-indent": "^
|
|
49
|
-
"@ckeditor/ckeditor5-media-embed": "^
|
|
50
|
-
"@ckeditor/ckeditor5-page-break": "^
|
|
51
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
|
52
|
-
"@ckeditor/ckeditor5-paste-from-office": "^
|
|
53
|
-
"@ckeditor/ckeditor5-table": "^
|
|
54
|
-
"@ckeditor/ckeditor5-theme-lark": "^
|
|
55
|
-
"@ckeditor/ckeditor5-ui": "^
|
|
56
|
-
"@ckeditor/ckeditor5-utils": "^
|
|
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
|
|
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'];}}}
|
package/src/exportpdfcommand.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
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
|
-
|
|
23
|
+
export{default as ExportPdf}from'./exportpdf';
|
package/src/utils.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
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')]();}
|