@ckeditor/ckeditor5-export-pdf 41.4.2 → 42.0.0-alpha.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.
Files changed (106) hide show
  1. package/README.md +6 -0
  2. package/build/export-pdf.js +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/translations/af.js +1 -1
  5. package/dist/translations/af.umd.js +1 -1
  6. package/dist/translations/ar.js +1 -1
  7. package/dist/translations/ar.umd.js +1 -1
  8. package/dist/translations/bg.js +1 -1
  9. package/dist/translations/bg.umd.js +1 -1
  10. package/dist/translations/bn.js +1 -1
  11. package/dist/translations/bn.umd.js +1 -1
  12. package/dist/translations/ca.js +1 -1
  13. package/dist/translations/ca.umd.js +1 -1
  14. package/dist/translations/cs.js +1 -1
  15. package/dist/translations/cs.umd.js +1 -1
  16. package/dist/translations/da.js +1 -1
  17. package/dist/translations/da.umd.js +1 -1
  18. package/dist/translations/de.js +1 -1
  19. package/dist/translations/de.umd.js +1 -1
  20. package/dist/translations/el.js +1 -1
  21. package/dist/translations/el.umd.js +1 -1
  22. package/dist/translations/en-au.js +1 -1
  23. package/dist/translations/en-au.umd.js +1 -1
  24. package/dist/translations/en.umd.js +1 -1
  25. package/dist/translations/es-co.js +1 -1
  26. package/dist/translations/es-co.umd.js +1 -1
  27. package/dist/translations/es.js +1 -1
  28. package/dist/translations/es.umd.js +1 -1
  29. package/dist/translations/et.js +1 -1
  30. package/dist/translations/et.umd.js +1 -1
  31. package/dist/translations/fi.js +1 -1
  32. package/dist/translations/fi.umd.js +1 -1
  33. package/dist/translations/fr.js +1 -1
  34. package/dist/translations/fr.umd.js +1 -1
  35. package/dist/translations/gl.js +1 -1
  36. package/dist/translations/gl.umd.js +1 -1
  37. package/dist/translations/he.js +1 -1
  38. package/dist/translations/he.umd.js +1 -1
  39. package/dist/translations/hi.js +1 -1
  40. package/dist/translations/hi.umd.js +1 -1
  41. package/dist/translations/hr.js +1 -1
  42. package/dist/translations/hr.umd.js +1 -1
  43. package/dist/translations/hu.js +1 -1
  44. package/dist/translations/hu.umd.js +1 -1
  45. package/dist/translations/id.js +1 -1
  46. package/dist/translations/id.umd.js +1 -1
  47. package/dist/translations/it.js +1 -1
  48. package/dist/translations/it.umd.js +1 -1
  49. package/dist/translations/ja.js +1 -1
  50. package/dist/translations/ja.umd.js +1 -1
  51. package/dist/translations/jv.js +1 -1
  52. package/dist/translations/jv.umd.js +1 -1
  53. package/dist/translations/ko.js +1 -1
  54. package/dist/translations/ko.umd.js +1 -1
  55. package/dist/translations/lt.js +1 -1
  56. package/dist/translations/lt.umd.js +1 -1
  57. package/dist/translations/lv.js +1 -1
  58. package/dist/translations/lv.umd.js +1 -1
  59. package/dist/translations/ms.js +1 -1
  60. package/dist/translations/ms.umd.js +1 -1
  61. package/dist/translations/nl.js +1 -1
  62. package/dist/translations/nl.umd.js +1 -1
  63. package/dist/translations/no.js +1 -1
  64. package/dist/translations/no.umd.js +1 -1
  65. package/dist/translations/pl.js +1 -1
  66. package/dist/translations/pl.umd.js +1 -1
  67. package/dist/translations/pt-br.js +1 -1
  68. package/dist/translations/pt-br.umd.js +1 -1
  69. package/dist/translations/pt.js +1 -1
  70. package/dist/translations/pt.umd.js +1 -1
  71. package/dist/translations/ro.js +1 -1
  72. package/dist/translations/ro.umd.js +1 -1
  73. package/dist/translations/ru.js +1 -1
  74. package/dist/translations/ru.umd.js +1 -1
  75. package/dist/translations/sk.js +1 -1
  76. package/dist/translations/sk.umd.js +1 -1
  77. package/dist/translations/sr-latn.js +1 -1
  78. package/dist/translations/sr-latn.umd.js +1 -1
  79. package/dist/translations/sr.js +1 -1
  80. package/dist/translations/sr.umd.js +1 -1
  81. package/dist/translations/sv.js +1 -1
  82. package/dist/translations/sv.umd.js +1 -1
  83. package/dist/translations/th.js +1 -1
  84. package/dist/translations/th.umd.js +1 -1
  85. package/dist/translations/tr.js +1 -1
  86. package/dist/translations/tr.umd.js +1 -1
  87. package/dist/translations/ug.js +1 -1
  88. package/dist/translations/ug.umd.js +1 -1
  89. package/dist/translations/uk.js +1 -1
  90. package/dist/translations/uk.umd.js +1 -1
  91. package/dist/translations/ur.js +1 -1
  92. package/dist/translations/ur.umd.js +1 -1
  93. package/dist/translations/vi.js +1 -1
  94. package/dist/translations/vi.umd.js +1 -1
  95. package/dist/translations/zh-cn.js +1 -1
  96. package/dist/translations/zh-cn.umd.js +1 -1
  97. package/dist/translations/zh.js +1 -1
  98. package/dist/translations/zh.umd.js +1 -1
  99. package/dist/types/exportpdf.d.ts +10 -7
  100. package/package.json +2 -2
  101. package/src/exportpdf.d.ts +10 -7
  102. package/src/exportpdf.js +1 -1
  103. package/src/exportpdfcommand.js +1 -1
  104. package/src/exportpdfui.js +1 -1
  105. package/src/index.js +1 -1
  106. package/src/utils.js +1 -1
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x1a9379=>{const {zh:{dictionary:_0x22a684,getPluralForm:_0x1a5574}}={'zh':{'dictionary':{'Export\x20to\x20PDF':'匯出為\x20PDF','An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.':'產生\x20PDF\x20時發生錯誤。','PDF\x20export\x20started':'PDF\x20匯出開始','PDF\x20export\x20failed':'PDF\x20匯出失敗','PDF\x20export\x20successful':'PDF\x20匯出成功','Exporting\x20PDF\x20document':'正在匯出\x20PDF\x20文件'},'getPluralForm':_0x423af9=>0x0}};_0x1a9379['zh']||={'dictionary':{},'getPluralForm':null},_0x1a9379['zh']['dictionary']=Object['assign'](_0x1a9379['zh']['dictionary'],_0x22a684),_0x1a9379['zh']['getPluralForm']=_0x1a5574;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x2ba3ce=>{const {zh:{dictionary:_0x4963c8,getPluralForm:_0x1ff1d4}}={'zh':{'dictionary':{'Export\x20to\x20PDF':'匯出為\x20PDF','An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.':'產生\x20PDF\x20時發生錯誤。','PDF\x20export\x20started':'PDF\x20匯出開始','PDF\x20export\x20failed':'PDF\x20匯出失敗','PDF\x20export\x20successful':'PDF\x20匯出成功','Exporting\x20PDF\x20document':'正在匯出\x20PDF\x20文件'},'getPluralForm':_0x3c4e3b=>0x0}};_0x2ba3ce['zh']||={'dictionary':{},'getPluralForm':null},_0x2ba3ce['zh']['dictionary']=Object['assign'](_0x2ba3ce['zh']['dictionary'],_0x4963c8),_0x2ba3ce['zh']['getPluralForm']=_0x1ff1d4;})(window['CKEDITOR_TRANSLATIONS']||={});
@@ -60,13 +60,16 @@ export interface ExportPdfConfig {
60
60
  * ```
61
61
  *
62
62
  * **NOTE:** If `stylesheets` are not provided, the plugin will sent only
63
- * {@glink installation/advanced/content-styles#the-full-list-of-content-styles the default editor content styles} to the converter.
63
+ * {@glink getting-started/setup/css the default editor content styles}
64
+ * to the converter.
64
65
  *
65
66
  * **Default editor's content styles**:
66
- * {@glink installation/advanced/content-styles#the-full-list-of-content-styles The default editor content styles}
67
+ * {@glink getting-started/setup/css The default editor content styles}
67
68
  * are applied to the generated PDF thanks to the 'EDITOR_STYLES' token, which is provided to the `stylesheets` by default.
68
69
  * If you don't want them to be applied, you have to omit the token:
69
70
  *
71
+ * **NOTE:** The 'EDITOR_STYLES' string is only supported in legacy webpack setup.
72
+ *
70
73
  * ```ts
71
74
  * const exportPdfConfig = {
72
75
  * stylesheets: [ './path/to/custom-editor-styles.css' ]
@@ -79,8 +82,8 @@ export interface ExportPdfConfig {
79
82
  * ```ts
80
83
  * const exportPdfConfig = {
81
84
  * stylesheets: [
82
- * './path/to/fonts.css',
83
- * 'EDITOR_STYLES'
85
+ * 'path/to/editor-styles.css',
86
+ * './path/to/fonts.css'
84
87
  * ]
85
88
  * }
86
89
  * ```
@@ -90,8 +93,8 @@ export interface ExportPdfConfig {
90
93
  * ```ts
91
94
  * const exportPdfConfig = {
92
95
  * stylesheets: [
96
+ * 'path/to/editor-styles.css',
93
97
  * './path/to/fonts.css',
94
- * 'EDITOR_STYLES',
95
98
  * './path/to/custom-styles.css'
96
99
  * ]
97
100
  * }
@@ -211,7 +214,7 @@ export interface ExportPdfConfig {
211
214
  appID?: string;
212
215
  }
213
216
  export type ExportPdfConverterOptions = {
214
- format?: 'Letter' | 'Legal' | 'Tabloid' | 'Ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6';
217
+ format?: 'Letter' | 'Legal' | 'Tabloid' | 'Ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | string & Record<never, never>;
215
218
  margin_top?: string;
216
219
  margin_bottom?: string;
217
220
  margin_right?: string;
@@ -219,7 +222,7 @@ export type ExportPdfConverterOptions = {
219
222
  header_html?: string;
220
223
  footer_html?: string;
221
224
  header_and_footer_css?: string;
222
- page_orientation?: 'portrait' | 'landscape';
225
+ page_orientation?: 'portrait' | 'landscape' | string & Record<never, never>;
223
226
  wait_for_network?: boolean;
224
227
  wait_time?: number;
225
228
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-export-pdf",
3
- "version": "41.4.2",
3
+ "version": "42.0.0-alpha.0",
4
4
  "description": "Export to PDF feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -30,7 +30,7 @@
30
30
  "type": "module",
31
31
  "main": "src/index.js",
32
32
  "dependencies": {
33
- "ckeditor5": "41.4.2"
33
+ "ckeditor5": "42.0.0-alpha.0"
34
34
  },
35
35
  "license": "SEE LICENSE IN LICENSE.md",
36
36
  "author": "CKSource (http://cksource.com/)",
@@ -56,13 +56,16 @@ export interface ExportPdfConfig {
56
56
  * ```
57
57
  *
58
58
  * **NOTE:** If `stylesheets` are not provided, the plugin will sent only
59
- * {@glink installation/advanced/content-styles#the-full-list-of-content-styles the default editor content styles} to the converter.
59
+ * {@glink getting-started/setup/css the default editor content styles}
60
+ * to the converter.
60
61
  *
61
62
  * **Default editor's content styles**:
62
- * {@glink installation/advanced/content-styles#the-full-list-of-content-styles The default editor content styles}
63
+ * {@glink getting-started/setup/css The default editor content styles}
63
64
  * are applied to the generated PDF thanks to the 'EDITOR_STYLES' token, which is provided to the `stylesheets` by default.
64
65
  * If you don't want them to be applied, you have to omit the token:
65
66
  *
67
+ * **NOTE:** The 'EDITOR_STYLES' string is only supported in legacy webpack setup.
68
+ *
66
69
  * ```ts
67
70
  * const exportPdfConfig = {
68
71
  * stylesheets: [ './path/to/custom-editor-styles.css' ]
@@ -75,8 +78,8 @@ export interface ExportPdfConfig {
75
78
  * ```ts
76
79
  * const exportPdfConfig = {
77
80
  * stylesheets: [
78
- * './path/to/fonts.css',
79
- * 'EDITOR_STYLES'
81
+ * 'path/to/editor-styles.css',
82
+ * './path/to/fonts.css'
80
83
  * ]
81
84
  * }
82
85
  * ```
@@ -86,8 +89,8 @@ export interface ExportPdfConfig {
86
89
  * ```ts
87
90
  * const exportPdfConfig = {
88
91
  * stylesheets: [
92
+ * 'path/to/editor-styles.css',
89
93
  * './path/to/fonts.css',
90
- * 'EDITOR_STYLES',
91
94
  * './path/to/custom-styles.css'
92
95
  * ]
93
96
  * }
@@ -207,7 +210,7 @@ export interface ExportPdfConfig {
207
210
  appID?: string;
208
211
  }
209
212
  export type ExportPdfConverterOptions = {
210
- format?: 'Letter' | 'Legal' | 'Tabloid' | 'Ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6';
213
+ format?: 'Letter' | 'Legal' | 'Tabloid' | 'Ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | string & Record<never, never>;
211
214
  margin_top?: string;
212
215
  margin_bottom?: string;
213
216
  margin_right?: string;
@@ -215,7 +218,7 @@ export type ExportPdfConverterOptions = {
215
218
  header_html?: string;
216
219
  footer_html?: string;
217
220
  header_and_footer_css?: string;
218
- page_orientation?: 'portrait' | 'landscape';
221
+ page_orientation?: 'portrait' | 'landscape' | string & Record<never, never>;
219
222
  wait_for_network?: boolean;
220
223
  wait_time?: number;
221
224
  };
package/src/exportpdf.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x40c6a2=_0x2b33;function _0x1735(){const _0x19a2d4=['commands','exportPdf','then','requires','add','tokenUrl','plugins','_token','1288314TpmsPu','ExportPdf','66SvONhy','token','11BtIONB','registerTokenUrl','3113665nOaKVU','config','CloudServices','25052jKdTTs','init','pluginName','get','editor','3238608Ggfbck','9841959YNLSSb','73078suLkaT','7641872NVLOwV'];_0x1735=function(){return _0x19a2d4;};return _0x1735();}(function(_0x2d0a55,_0x1522eb){const _0x2bfd27=_0x2b33,_0x530ade=_0x2d0a55();while(!![]){try{const _0x1fef02=-parseInt(_0x2bfd27(0x1e8))/0x1*(parseInt(_0x2bfd27(0x1f4))/0x2)+parseInt(_0x2bfd27(0x1e6))/0x3*(parseInt(_0x2bfd27(0x1ed))/0x4)+parseInt(_0x2bfd27(0x1ea))/0x5+-parseInt(_0x2bfd27(0x1fe))/0x6+-parseInt(_0x2bfd27(0x1f5))/0x7+parseInt(_0x2bfd27(0x1f2))/0x8+parseInt(_0x2bfd27(0x1f3))/0x9;if(_0x1fef02===_0x1522eb)break;else _0x530ade['push'](_0x530ade['shift']());}catch(_0x197070){_0x530ade['push'](_0x530ade['shift']());}}}(_0x1735,0x86698));import{Plugin as _0x238647}from'ckeditor5/src/core.js';function _0x2b33(_0x5e72e3,_0x1dca3b){const _0x1735fe=_0x1735();return _0x2b33=function(_0x2b33d4,_0x1cb70f){_0x2b33d4=_0x2b33d4-0x1e5;let _0x19a6a3=_0x1735fe[_0x2b33d4];return _0x19a6a3;},_0x2b33(_0x5e72e3,_0x1dca3b);}import{Notification as _0x4aa112}from'ckeditor5/src/ui.js';import _0x29c090 from'./exportpdfcommand.js';import _0x3f18cb from'./exportpdfui.js';export default class s extends _0x238647{static get[_0x40c6a2(0x1ef)](){const _0x23a1ec=_0x40c6a2;return _0x23a1ec(0x1e5);}static get[_0x40c6a2(0x1f9)](){const _0x59facb=_0x40c6a2;return[_0x59facb(0x1ec),_0x4aa112,_0x3f18cb];}[_0x40c6a2(0x1ee)](){const _0x4de759=_0x40c6a2,_0x233efa=this[_0x4de759(0x1f1)],_0x1f21cf=_0x233efa[_0x4de759(0x1eb)][_0x4de759(0x1f0)](_0x4de759(0x1f7))||{};_0x233efa[_0x4de759(0x1f6)][_0x4de759(0x1fa)](_0x4de759(0x1f7),new _0x29c090(_0x233efa));const _0x2231ed=_0x233efa[_0x4de759(0x1fc)][_0x4de759(0x1f0)](_0x4de759(0x1ec));!0x1===_0x1f21cf[_0x4de759(0x1fb)]?this[_0x4de759(0x1fd)]=null:_0x1f21cf[_0x4de759(0x1fb)]?_0x2231ed[_0x4de759(0x1e9)](_0x1f21cf[_0x4de759(0x1fb)])[_0x4de759(0x1f8)](_0x2057c9=>{const _0x2b429f=_0x4de759;this[_0x2b429f(0x1fd)]=_0x2057c9;}):this[_0x4de759(0x1fd)]=_0x2231ed[_0x4de759(0x1e7)];}}
23
+ function _0x227b(){const _0x4ceef0=['get','requires','_token','pluginName','85pLgEko','add','1691937NbfcjH','registerTokenUrl','token','622QzJPeC','6511760FdDKJs','plugins','commands','CloudServices','30TwZNRS','ExportPdf','349279pjpVbe','editor','init','tokenUrl','exportPdf','then','12VEtJMQ','250902DeJcXJ','5768WxTowh','config','2151408OFNvuR'];_0x227b=function(){return _0x4ceef0;};return _0x227b();}const _0x2f4871=_0x10b0;(function(_0x1d2056,_0x2abdfe){const _0x403462=_0x10b0,_0xa4c796=_0x1d2056();while(!![]){try{const _0x5ebd0a=parseInt(_0x403462(0x1d0))/0x1+-parseInt(_0x403462(0x1dd))/0x2*(-parseInt(_0x403462(0x1e2))/0x3)+parseInt(_0x403462(0x1d1))/0x4*(parseInt(_0x403462(0x1d8))/0x5)+-parseInt(_0x403462(0x1cf))/0x6*(-parseInt(_0x403462(0x1e4))/0x7)+parseInt(_0x403462(0x1d3))/0x8+parseInt(_0x403462(0x1da))/0x9+-parseInt(_0x403462(0x1de))/0xa;if(_0x5ebd0a===_0x2abdfe)break;else _0xa4c796['push'](_0xa4c796['shift']());}catch(_0x2b90b4){_0xa4c796['push'](_0xa4c796['shift']());}}}(_0x227b,0x2ceff));import{Plugin as _0x2b6257}from'ckeditor5/src/core.js';import{Notification as _0x1635bf}from'ckeditor5/src/ui.js';import _0x25584a from'./exportpdfcommand.js';import _0x984ffa from'./exportpdfui.js';function _0x10b0(_0x5992f2,_0x459636){const _0x227b48=_0x227b();return _0x10b0=function(_0x10b033,_0x36778a){_0x10b033=_0x10b033-0x1ce;let _0x53536e=_0x227b48[_0x10b033];return _0x53536e;},_0x10b0(_0x5992f2,_0x459636);}export default class s extends _0x2b6257{static get[_0x2f4871(0x1d7)](){const _0x153bad=_0x2f4871;return _0x153bad(0x1e3);}static get[_0x2f4871(0x1d5)](){const _0x4bbdca=_0x2f4871;return[_0x4bbdca(0x1e1),_0x1635bf,_0x984ffa];}[_0x2f4871(0x1e6)](){const _0x11fa22=_0x2f4871,_0x23df49=this[_0x11fa22(0x1e5)],_0x289141=_0x23df49[_0x11fa22(0x1d2)][_0x11fa22(0x1d4)](_0x11fa22(0x1e8))||{};_0x23df49[_0x11fa22(0x1e0)][_0x11fa22(0x1d9)](_0x11fa22(0x1e8),new _0x25584a(_0x23df49));const _0x1f3f01=_0x23df49[_0x11fa22(0x1df)][_0x11fa22(0x1d4)](_0x11fa22(0x1e1));!0x1===_0x289141[_0x11fa22(0x1e7)]?this[_0x11fa22(0x1d6)]=null:_0x289141[_0x11fa22(0x1e7)]?_0x1f3f01[_0x11fa22(0x1db)](_0x289141[_0x11fa22(0x1e7)])[_0x11fa22(0x1ce)](_0x283215=>{const _0x3c5b46=_0x11fa22;this[_0x3c5b46(0x1d6)]=_0x283215;}):this[_0x11fa22(0x1d6)]=_0x1f3f01[_0x11fa22(0x1dc)];}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x15222c}from'ckeditor5/src/core.js';import{getStyles as _0x413d0d}from'./utils.js';export default class o extends _0x15222c{constructor(_0x31ded7){super(_0x31ded7),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0xcbad1c={}){const _0x377352=this['editor'],t=_0x377352['t'],_0x24002a=_0xcbad1c['converterUrl']||'https://pdf-converter.cke-cs.com/v1/convert/',_0x34f8b3=_0xcbad1c['dataCallback']||(_0xb45a90=>_0xb45a90['data']['get']()),_0x42e2e6=_0x377352['plugins']['get']('ExportPdf'),_0x4f8311=_0xcbad1c['token']||_0x42e2e6['_token'];return this['isBusy']=!0x0,this['refresh'](),_0x413d0d(_0xcbad1c['stylesheets']||['EDITOR_STYLES'])['then'](async _0x3cb0b8=>{_0x377352['ui']['ariaLiveAnnouncer']['announce'](t('PDF\x20export\x20started'));const _0x58f7e9={'html':'<html>\x0a\x09\x09\x09\x09\x09\x09<head>\x0a\x09\x09\x09\x09\x09\x09\x09<title>CKEditor\x205\x20PDF\x20document</title>\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'+_0x377352['locale']['contentLanguageDirection']+'\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09'+await _0x34f8b3(_0x377352)+'\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':_0x3cb0b8,'options':_0xcbad1c['converterOptions']},_0x378431={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/pdf',..._0x4f8311?{'Authorization':_0x4f8311['value']}:null,'x-cs-app-id':_0xcbad1c['appID']||'cke5'},'body':JSON['stringify'](_0x58f7e9)};return window['fetch'](_0x24002a,_0x378431)['then'](_0x49e745=>{if(0xc8!==_0x49e745['status'])throw _0x49e745;return _0x49e745['blob']();})['then'](_0x46c5db=>{_0x377352['ui']['ariaLiveAnnouncer']['announce'](t('PDF\x20export\x20successful'));const _0x3512ab='function'==typeof _0xcbad1c['fileName']?_0xcbad1c['fileName']():_0xcbad1c['fileName'];this['_downloadFile'](_0x46c5db,_0x3512ab||'document.pdf');});})['catch'](_0x5724d2=>{const _0x2b7d26=_0x377352['plugins']['get']('Notification');throw _0x377352['ui']['ariaLiveAnnouncer']['announce'](t('PDF\x20export\x20failed'),{'politeness':'assertive'}),_0x2b7d26['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.')),_0x5724d2;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0x3a808d,_0x4fdfe4){const _0x43f6d4=document['createElement']('a');_0x43f6d4['href']=window['URL']['createObjectURL'](_0x3a808d),_0x43f6d4['download']=_0x4fdfe4,_0x43f6d4['click'](),_0x43f6d4['remove']();}}
23
+ import{Command as _0x341163}from'ckeditor5/src/core.js';import{getStyles as _0x1516f7}from'./utils.js';export default class o extends _0x341163{constructor(_0x4a3f06){super(_0x4a3f06),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x19e1e8={}){const _0x4efb3b=this['editor'],t=_0x4efb3b['t'],_0x1a4e5e=_0x19e1e8['converterUrl']||'https://pdf-converter.cke-cs.com/v1/convert/',_0xe0cffd=_0x19e1e8['dataCallback']||(_0x511275=>_0x511275['data']['get']()),_0x819e96=_0x4efb3b['plugins']['get']('ExportPdf'),_0x530081=_0x19e1e8['token']||_0x819e96['_token'];return this['isBusy']=!0x0,this['refresh'](),_0x1516f7(_0x19e1e8['stylesheets']||['EDITOR_STYLES'])['then'](async _0x4916b8=>{_0x4efb3b['ui']['ariaLiveAnnouncer']['announce'](t('PDF\x20export\x20started'));const _0x38614b={'html':'<html>\x0a\x09\x09\x09\x09\x09\x09<head>\x0a\x09\x09\x09\x09\x09\x09\x09<title>CKEditor\x205\x20PDF\x20document</title>\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'+_0x4efb3b['locale']['contentLanguageDirection']+'\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09'+await _0xe0cffd(_0x4efb3b)+'\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':_0x4916b8,'options':_0x19e1e8['converterOptions']},_0x24a80d={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/pdf',..._0x530081?{'Authorization':_0x530081['value']}:null,'x-cs-app-id':_0x19e1e8['appID']||'cke5'},'body':JSON['stringify'](_0x38614b)};return window['fetch'](_0x1a4e5e,_0x24a80d)['then'](_0x155b42=>{if(0xc8!==_0x155b42['status'])throw _0x155b42;return _0x155b42['blob']();})['then'](_0x561036=>{_0x4efb3b['ui']['ariaLiveAnnouncer']['announce'](t('PDF\x20export\x20successful'));const _0x36cc57='function'==typeof _0x19e1e8['fileName']?_0x19e1e8['fileName']():_0x19e1e8['fileName'];this['_downloadFile'](_0x561036,_0x36cc57||'document.pdf');});})['catch'](_0x294f46=>{const _0x21b70d=_0x4efb3b['plugins']['get']('Notification');throw _0x4efb3b['ui']['ariaLiveAnnouncer']['announce'](t('PDF\x20export\x20failed'),{'politeness':'assertive'}),_0x21b70d['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.')),_0x294f46;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0x3a537f,_0x459f99){const _0x44a8a0=document['createElement']('a');_0x44a8a0['href']=window['URL']['createObjectURL'](_0x3a537f),_0x44a8a0['download']=_0x459f99,_0x44a8a0['click'](),_0x44a8a0['remove']();}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x57806b}from'ckeditor5/src/core.js';import{ButtonView as _0x18e135,MenuBarMenuListItemButtonView as _0x2bff08,SpinnerView as _0x953fc5}from'ckeditor5/src/ui.js';import _0x770027 from'../theme/icons/exportpdf.svg';export default class i extends _0x57806b{static get['pluginName'](){return'ExportPdfUI';}['init'](){const _0x538098=this['editor'];_0x538098['ui']['componentFactory']['add']('exportPdf',()=>{const _0x511eab=this['_createButton'](_0x18e135),_0x460347=_0x538098['commands']['get']('exportPdf');return _0x511eab['set']({'tooltip':!0x0}),_0x511eab['bind']('isOn')['to'](_0x460347,'isBusy'),_0x511eab;}),_0x538098['ui']['componentFactory']['add']('menuBar:exportPdf',()=>this['_createButton'](_0x2bff08));}['_createButton'](_0x13e1de){const _0x370c1d=this['editor'],_0x299a94=_0x370c1d['config']['get']('exportPdf')||{},t=_0x370c1d['locale']['t'],_0x1ef7bb=_0x370c1d['commands']['get']('exportPdf'),_0x2da6a2=new _0x13e1de(_0x370c1d['locale']),_0x31fbc2=new _0x953fc5();return _0x2da6a2['children']['add'](_0x31fbc2),_0x31fbc2['bind']('isVisible')['to'](_0x1ef7bb,'isBusy'),_0x2da6a2['iconView']['bind']('isVisible')['to'](_0x1ef7bb,'isBusy',_0x23c2b3=>!_0x23c2b3),_0x2da6a2['set']({'icon':_0x770027}),_0x2da6a2['bind']('isEnabled')['to'](_0x1ef7bb,'isEnabled'),_0x2da6a2['bind']('label')['to'](_0x1ef7bb,'isBusy',_0x1d3435=>t(_0x1d3435?'Exporting\x20PDF\x20document':'Export\x20to\x20PDF')),this['listenTo'](_0x2da6a2,'execute',()=>{_0x370c1d['execute']('exportPdf',_0x299a94),_0x370c1d['editing']['view']['focus']();}),_0x2da6a2;}}
23
+ import{Plugin as _0x316889}from'ckeditor5/src/core.js';import{ButtonView as _0x58b747,MenuBarMenuListItemButtonView as _0xdb08e2,SpinnerView as _0x3452c8}from'ckeditor5/src/ui.js';import _0x5eb50d from'../theme/icons/exportpdf.svg';export default class i extends _0x316889{static get['pluginName'](){return'ExportPdfUI';}['init'](){const _0x21c876=this['editor'];_0x21c876['ui']['componentFactory']['add']('exportPdf',()=>{const _0x362225=this['_createButton'](_0x58b747),_0x330721=_0x21c876['commands']['get']('exportPdf');return _0x362225['set']({'tooltip':!0x0}),_0x362225['bind']('isOn')['to'](_0x330721,'isBusy'),_0x362225;}),_0x21c876['ui']['componentFactory']['add']('menuBar:exportPdf',()=>this['_createButton'](_0xdb08e2));}['_createButton'](_0xf74b13){const _0x1bb4a4=this['editor'],_0xb83515=_0x1bb4a4['config']['get']('exportPdf')||{},t=_0x1bb4a4['locale']['t'],_0xe3094=_0x1bb4a4['commands']['get']('exportPdf'),_0x5688cb=new _0xf74b13(_0x1bb4a4['locale']),_0x4c20b4=new _0x3452c8();return _0x5688cb['children']['add'](_0x4c20b4),_0x4c20b4['bind']('isVisible')['to'](_0xe3094,'isBusy'),_0x5688cb['iconView']['bind']('isVisible')['to'](_0xe3094,'isBusy',_0x3064c0=>!_0x3064c0),_0x5688cb['set']({'icon':_0x5eb50d}),_0x5688cb['bind']('isEnabled')['to'](_0xe3094,'isEnabled'),_0x5688cb['bind']('label')['to'](_0xe3094,'isBusy',_0x16f5dd=>t(_0x16f5dd?'Exporting\x20PDF\x20document':'Export\x20to\x20PDF')),this['listenTo'](_0x5688cb,'execute',()=>{_0x1bb4a4['execute']('exportPdf',_0xb83515),_0x1bb4a4['editing']['view']['focus']();}),_0x5688cb;}}
package/src/index.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (function(_0x23c025,_0x15199b){var _0x549d7a=_0x725b,_0xbaa021=_0x23c025();while(!![]){try{var _0x37c1a9=-parseInt(_0x549d7a(0x1ab))/0x1*(-parseInt(_0x549d7a(0x1af))/0x2)+parseInt(_0x549d7a(0x1ae))/0x3*(-parseInt(_0x549d7a(0x1aa))/0x4)+parseInt(_0x549d7a(0x1b3))/0x5*(-parseInt(_0x549d7a(0x1b0))/0x6)+-parseInt(_0x549d7a(0x1b1))/0x7+parseInt(_0x549d7a(0x1ad))/0x8+-parseInt(_0x549d7a(0x1ac))/0x9+parseInt(_0x549d7a(0x1b2))/0xa;if(_0x37c1a9===_0x15199b)break;else _0xbaa021['push'](_0xbaa021['shift']());}catch(_0x1796ae){_0xbaa021['push'](_0xbaa021['shift']());}}}(_0x6826,0xd5caf));function _0x725b(_0x1d8de3,_0x77e9b1){var _0x6826b=_0x6826();return _0x725b=function(_0x725b2d,_0x57a4f9){_0x725b2d=_0x725b2d-0x1aa;var _0x4a3359=_0x6826b[_0x725b2d];return _0x4a3359;},_0x725b(_0x1d8de3,_0x77e9b1);}export{default as ExportPdf}from'./exportpdf.js';import'./augmentation.js';function _0x6826(){var _0x25f03e=['354zniWUp','5621742MsSstH','35681900AlhYRn','141250tsANRr','56wTOJCH','1PQsoft','10608354pSvhmc','4816096VmuEGj','256638KJADPv','3103398dRDxIr'];_0x6826=function(){return _0x25f03e;};return _0x6826();}
23
+ (function(_0x5b7dee,_0x291f26){var _0x1304bb=_0x7d18,_0x1302ee=_0x5b7dee();while(!![]){try{var _0xb566fe=parseInt(_0x1304bb(0xb0))/0x1*(parseInt(_0x1304bb(0xae))/0x2)+parseInt(_0x1304bb(0xac))/0x3+-parseInt(_0x1304bb(0xad))/0x4*(-parseInt(_0x1304bb(0xaa))/0x5)+-parseInt(_0x1304bb(0xaf))/0x6+-parseInt(_0x1304bb(0xab))/0x7+-parseInt(_0x1304bb(0xb1))/0x8+parseInt(_0x1304bb(0xb2))/0x9;if(_0xb566fe===_0x291f26)break;else _0x1302ee['push'](_0x1302ee['shift']());}catch(_0x1fb317){_0x1302ee['push'](_0x1302ee['shift']());}}}(_0x60cd,0x8672e));function _0x60cd(){var _0x4cb948=['34tOwkeO','5539848mAMqwn','20629BtRowe','5471152BrCoaD','10983186mHpkFp','49935akmkrX','6779374NvAABx','2898318pEplGv','236GMcHTw'];_0x60cd=function(){return _0x4cb948;};return _0x60cd();}function _0x7d18(_0x4ff00d,_0x1ac0c4){var _0x60cd90=_0x60cd();return _0x7d18=function(_0x7d1864,_0x57a8b4){_0x7d1864=_0x7d1864-0xaa;var _0x53f02c=_0x60cd90[_0x7d1864];return _0x53f02c;},_0x7d18(_0x4ff00d,_0x1ac0c4);}export{default as ExportPdf}from'./exportpdf.js';import'./augmentation.js';
package/src/utils.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- function _0x35e2(){const _0x1b198a=['91735anNpjV','10722078ZEfCCg','styleSheets','then','2ytBjjq','.ck-content','195WrcbwS','warn','length','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.','86924lHUIsC','join','indexOf','fetch',':root','push','data-cke','hasAttribute','text','trim','from','cssRules','943869NjSuLV','cssText','816AoYZsa','ownerNode','EDITOR_STYLES','1492497uWjlpQ','1074703oRnjMH','all','39029830XfWSiB'];_0x35e2=function(){return _0x1b198a;};return _0x35e2();}function _0x89f2(_0x252741,_0x40f4f4){const _0x35e2df=_0x35e2();return _0x89f2=function(_0x89f23c,_0x2c465d){_0x89f23c=_0x89f23c-0x14c;let _0x1faf61=_0x35e2df[_0x89f23c];return _0x1faf61;},_0x89f2(_0x252741,_0x40f4f4);}(function(_0x39d6b1,_0x1a1e33){const _0x8a5917=_0x89f2,_0x305984=_0x39d6b1();while(!![]){try{const _0x532a48=parseInt(_0x8a5917(0x14f))/0x1+parseInt(_0x8a5917(0x156))/0x2*(-parseInt(_0x8a5917(0x168))/0x3)+-parseInt(_0x8a5917(0x15c))/0x4*(-parseInt(_0x8a5917(0x158))/0x5)+parseInt(_0x8a5917(0x153))/0x6+-parseInt(_0x8a5917(0x152))/0x7*(-parseInt(_0x8a5917(0x16a))/0x8)+parseInt(_0x8a5917(0x14e))/0x9+-parseInt(_0x8a5917(0x151))/0xa;if(_0x532a48===_0x1a1e33)break;else _0x305984['push'](_0x305984['shift']());}catch(_0x22e263){_0x305984['push'](_0x305984['shift']());}}}(_0x35e2,0xf2b72));export function getStyles(_0x47468a){const _0xe23db4=_0x89f2;if(!_0x47468a)return new Promise(_0x335e10=>_0x335e10(''));const _0x5420ba=[];for(const _0x4834f6 of _0x47468a)_0xe23db4(0x14d)!==_0x4834f6?_0x5420ba[_0xe23db4(0x161)](window[_0xe23db4(0x15f)](_0x4834f6)[_0xe23db4(0x155)](_0xd92149=>_0xd92149[_0xe23db4(0x164)]())):_0x5420ba[_0xe23db4(0x161)](f());return Promise[_0xe23db4(0x150)](_0x5420ba)[_0xe23db4(0x155)](_0x2a2f09=>_0x2a2f09[_0xe23db4(0x15d)]('\x20')[_0xe23db4(0x165)]());}function f(){const _0x1e1541=_0x89f2,_0x6324a8=[],_0x1eb6fc=[];for(const _0x227914 of Array[_0x1e1541(0x166)](document[_0x1e1541(0x154)])){if(_0x227914[_0x1e1541(0x14c)][_0x1e1541(0x163)](_0x1e1541(0x162))){for(const _0x58dae0 of Array[_0x1e1541(0x166)](_0x227914[_0x1e1541(0x167)]))-0x1!==_0x58dae0[_0x1e1541(0x169)][_0x1e1541(0x15e)](_0x1e1541(0x157))?_0x6324a8[_0x1e1541(0x161)](_0x58dae0[_0x1e1541(0x169)]):-0x1!==_0x58dae0[_0x1e1541(0x169)][_0x1e1541(0x15e)](_0x1e1541(0x160))&&_0x1eb6fc[_0x1e1541(0x161)](_0x58dae0[_0x1e1541(0x169)]);}}return _0x6324a8[_0x1e1541(0x15a)]||console[_0x1e1541(0x159)](_0x1e1541(0x15b)),[..._0x1eb6fc,..._0x6324a8][_0x1e1541(0x15d)]('\x20')[_0x1e1541(0x165)]();}
23
+ (function(_0x4e2d7a,_0x57e15f){const _0x2a4f18=_0x99ac,_0x521a3f=_0x4e2d7a();while(!![]){try{const _0x15d8f1=-parseInt(_0x2a4f18(0x143))/0x1*(-parseInt(_0x2a4f18(0x149))/0x2)+parseInt(_0x2a4f18(0x154))/0x3+parseInt(_0x2a4f18(0x153))/0x4*(-parseInt(_0x2a4f18(0x15e))/0x5)+parseInt(_0x2a4f18(0x14c))/0x6*(-parseInt(_0x2a4f18(0x15d))/0x7)+parseInt(_0x2a4f18(0x14e))/0x8*(-parseInt(_0x2a4f18(0x158))/0x9)+-parseInt(_0x2a4f18(0x15a))/0xa+parseInt(_0x2a4f18(0x152))/0xb;if(_0x15d8f1===_0x57e15f)break;else _0x521a3f['push'](_0x521a3f['shift']());}catch(_0x2a95c0){_0x521a3f['push'](_0x521a3f['shift']());}}}(_0x3ca0,0x9aa50));export function getStyles(_0x159e05){const _0x25a223=_0x99ac;if(!_0x159e05)return new Promise(_0x2877cd=>_0x2877cd(''));const _0xe3382c=[];for(const _0x4a3085 of _0x159e05)_0x25a223(0x147)!==_0x4a3085?_0xe3382c[_0x25a223(0x159)](window[_0x25a223(0x156)](_0x4a3085)[_0x25a223(0x148)](_0x9b8111=>_0x9b8111[_0x25a223(0x155)]())):_0xe3382c[_0x25a223(0x159)](f());return Promise[_0x25a223(0x144)](_0xe3382c)[_0x25a223(0x148)](_0x2b16a9=>_0x2b16a9[_0x25a223(0x14d)]('\x20')[_0x25a223(0x157)]());}function f(){const _0x243e03=_0x99ac,_0x7a5d87=[],_0x525951=[];for(const _0x1c706c of Array[_0x243e03(0x15c)](document[_0x243e03(0x161)])){if(_0x1c706c[_0x243e03(0x151)][_0x243e03(0x150)](_0x243e03(0x14a))){for(const _0x2eb779 of Array[_0x243e03(0x15c)](_0x1c706c[_0x243e03(0x146)]))-0x1!==_0x2eb779[_0x243e03(0x14b)][_0x243e03(0x162)](_0x243e03(0x14f))?_0x7a5d87[_0x243e03(0x159)](_0x2eb779[_0x243e03(0x14b)]):-0x1!==_0x2eb779[_0x243e03(0x14b)][_0x243e03(0x162)](_0x243e03(0x145))&&_0x525951[_0x243e03(0x159)](_0x2eb779[_0x243e03(0x14b)]);}}return _0x7a5d87[_0x243e03(0x15f)]||console[_0x243e03(0x15b)](_0x243e03(0x160)),[..._0x525951,..._0x7a5d87][_0x243e03(0x14d)]('\x20')[_0x243e03(0x157)]();}function _0x99ac(_0x3ae2b1,_0x5cd826){const _0x3ca045=_0x3ca0();return _0x99ac=function(_0x99ac71,_0x264d22){_0x99ac71=_0x99ac71-0x143;let _0x59ecce=_0x3ca045[_0x99ac71];return _0x59ecce;},_0x99ac(_0x3ae2b1,_0x5cd826);}function _0x3ca0(){const _0x200eae=['48815HNJWLJ','length','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.','styleSheets','indexOf','1281VdAAir','all',':root','cssRules','EDITOR_STYLES','then','212NIMdSQ','data-cke','cssText','385134siathF','join','33336PplWJH','.ck-content','hasAttribute','ownerNode','17360233wTrAEx','40DymzdI','3699273ZrBtvE','text','fetch','trim','2160pTwetH','push','10875680nLmYhL','warn','from','14AwLehK'];_0x3ca0=function(){return _0x200eae;};return _0x3ca0();}