@ckeditor/ckeditor5-export-word 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.
- package/README.md +6 -0
- package/build/export-word.js +1 -1
- package/dist/index.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/dist/types/exportword.d.ts +92 -7
- package/dist/types/exportwordcommand.d.ts +1 -1
- package/package.json +2 -2
- package/src/exportword.d.ts +92 -7
- package/src/exportword.js +1 -1
- package/src/exportwordcommand.d.ts +1 -1
- package/src/exportwordcommand.js +1 -1
- package/src/exportwordui.js +1 -1
- package/src/index.js +1 -1
- package/src/utils.js +1 -1
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x5e70bf=>{const {'zh-cn':{dictionary:_0x5360c1,getPluralForm:_0x581b00}}={'zh-cn':{'dictionary':{'Export\x20to\x20Word':'导出Word文档','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.':'生成Word文档时发生了异常。','Word\x20document\x20export\x20started':'Word\x20文档导出开始','Word\x20document\x20export\x20failed':'Word\x20文档导出失败','Word\x20document\x20export\x20successful':'Word\x20文档导出成功','Exporting\x20Word\x20document':'正在导出\x20Word\x20文档'},'getPluralForm':_0x3378b9=>0x0}};_0x5e70bf['zh-cn']||={'dictionary':{},'getPluralForm':null},_0x5e70bf['zh-cn']['dictionary']=Object['assign'](_0x5e70bf['zh-cn']['dictionary'],_0x5360c1),_0x5e70bf['zh-cn']['getPluralForm']=_0x581b00;})(window['CKEDITOR_TRANSLATIONS']||={});
|
package/dist/translations/zh.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'zh':{'dictionary':{'Export\x20to\x20Word':'匯出到\x20Word','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.':'產生\x20Word\x20檔案時出錯。','Word\x20document\x20export\x20started':'Word\x20文件匯出開始','Word\x20document\x20export\x20failed':'Word\x20文件匯出失敗','Word\x20document\x20export\x20successful':'Word\x20文件匯出成功','Exporting\x20Word\x20document':'正在匯出\x20Word\x20文件'},'getPluralForm':
|
|
23
|
+
export default{'zh':{'dictionary':{'Export\x20to\x20Word':'匯出到\x20Word','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.':'產生\x20Word\x20檔案時出錯。','Word\x20document\x20export\x20started':'Word\x20文件匯出開始','Word\x20document\x20export\x20failed':'Word\x20文件匯出失敗','Word\x20document\x20export\x20successful':'Word\x20文件匯出成功','Exporting\x20Word\x20document':'正在匯出\x20Word\x20文件'},'getPluralForm':_0x3fa033=>0x0}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x19bf3f=>{const {zh:{dictionary:_0x4292d3,getPluralForm:_0x5f0473}}={'zh':{'dictionary':{'Export\x20to\x20Word':'匯出到\x20Word','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.':'產生\x20Word\x20檔案時出錯。','Word\x20document\x20export\x20started':'Word\x20文件匯出開始','Word\x20document\x20export\x20failed':'Word\x20文件匯出失敗','Word\x20document\x20export\x20successful':'Word\x20文件匯出成功','Exporting\x20Word\x20document':'正在匯出\x20Word\x20文件'},'getPluralForm':_0x30dc89=>0x0}};_0x19bf3f['zh']||={'dictionary':{},'getPluralForm':null},_0x19bf3f['zh']['dictionary']=Object['assign'](_0x19bf3f['zh']['dictionary'],_0x4292d3),_0x19bf3f['zh']['getPluralForm']=_0x5f0473;})(window['CKEDITOR_TRANSLATIONS']||={});
|
|
@@ -61,13 +61,16 @@ export interface ExportWordConfig {
|
|
|
61
61
|
* ```
|
|
62
62
|
*
|
|
63
63
|
* **NOTE:** If `stylesheets` are not provided, the plugin will sent only
|
|
64
|
-
* {@glink
|
|
64
|
+
* {@glink getting-started/setup/css the default editor content styles}
|
|
65
|
+
* to the converter.
|
|
65
66
|
*
|
|
66
67
|
* **Default editor's content styles**:
|
|
67
|
-
* {@glink
|
|
68
|
+
* {@glink getting-started/setup/css The default editor content styles}
|
|
68
69
|
* are applied to the generated Word file thanks to the 'EDITOR_STYLES' token, which is provided to the `stylesheets` by default.
|
|
69
70
|
* If you don't want them to be applied, you have to omit the token:
|
|
70
71
|
*
|
|
72
|
+
* **NOTE:** The 'EDITOR_STYLES' string is only supported in legacy webpack setup.
|
|
73
|
+
*
|
|
71
74
|
* ```ts
|
|
72
75
|
* const exportWordConfig = {
|
|
73
76
|
* stylesheets: [ './path/to/custom-editor-styles.css' ]
|
|
@@ -79,7 +82,7 @@ export interface ExportWordConfig {
|
|
|
79
82
|
* ```ts
|
|
80
83
|
* const exportWordConfig = {
|
|
81
84
|
* stylesheets: [
|
|
82
|
-
* '
|
|
85
|
+
* 'path/to/editor-styles.css',
|
|
83
86
|
* './path/to/custom-styles.css'
|
|
84
87
|
* ]
|
|
85
88
|
* }
|
|
@@ -158,7 +161,7 @@ export interface ExportWordConfig {
|
|
|
158
161
|
* timezone: 'UTC'
|
|
159
162
|
* }`
|
|
160
163
|
*/
|
|
161
|
-
converterOptions?: ExportWordConverterOptions;
|
|
164
|
+
converterOptions?: ExportWordConverterOptions | ExportWordConverterOptionsV2;
|
|
162
165
|
/**
|
|
163
166
|
* A function to gather the HTML to be converted to Word.
|
|
164
167
|
*
|
|
@@ -197,6 +200,12 @@ export interface ExportWordConfig {
|
|
|
197
200
|
* See: {@link module:cloud-services/cloudservices~CloudServices#token}
|
|
198
201
|
*/
|
|
199
202
|
token?: InitializedToken;
|
|
203
|
+
/**
|
|
204
|
+
* The version of `Export to Word` API.
|
|
205
|
+
*
|
|
206
|
+
* @default '1'
|
|
207
|
+
*/
|
|
208
|
+
version?: 1 | 2;
|
|
200
209
|
}
|
|
201
210
|
export type ExportWordConverterOptions = {
|
|
202
211
|
format?: ExportWordConverterFormatOption;
|
|
@@ -213,12 +222,12 @@ export type ExportWordConverterOptions = {
|
|
|
213
222
|
base_url?: string;
|
|
214
223
|
timezone?: string;
|
|
215
224
|
};
|
|
216
|
-
export type ExportWordConverterFormatOption = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5'
|
|
217
|
-
export type ExportWordConverterOrientationOption = 'portrait' | 'landscape'
|
|
225
|
+
export type ExportWordConverterFormatOption = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5' | string & Record<never, never>;
|
|
226
|
+
export type ExportWordConverterOrientationOption = 'portrait' | 'landscape' | string & Record<never, never>;
|
|
218
227
|
export type ExportWordConverterHeaderFooterOption = Array<{
|
|
219
228
|
html?: string;
|
|
220
229
|
css?: string;
|
|
221
|
-
type?: 'default' | 'even' | 'odd' | 'first'
|
|
230
|
+
type?: 'default' | 'even' | 'odd' | 'first' | string & Record<never, never>;
|
|
222
231
|
}>;
|
|
223
232
|
export type ExportWordConverterCommentsOption = {
|
|
224
233
|
[id: string]: Array<{
|
|
@@ -234,3 +243,79 @@ export type ExportWordConverterSuggestionsOption = {
|
|
|
234
243
|
created: Date | null;
|
|
235
244
|
};
|
|
236
245
|
};
|
|
246
|
+
export type ExportWordConverterOptionsV2 = {
|
|
247
|
+
document?: ExportWordConverterDocumentOptionsV2;
|
|
248
|
+
header?: ExportWordConverterHeaderFooterOptionsV2;
|
|
249
|
+
footer?: ExportWordConverterHeaderFooterOptionsV2;
|
|
250
|
+
collaboration_features?: ExportWordConverterCollaborationFeaturesOptionsV2;
|
|
251
|
+
extra_http_headers?: ExportWordConverterExtraHttpHeaders;
|
|
252
|
+
timezone?: string;
|
|
253
|
+
base_url?: string;
|
|
254
|
+
};
|
|
255
|
+
export type ExportWordConverterDocumentOptionsV2 = {
|
|
256
|
+
margins?: ExportWordConverterMarginsOptionsV2;
|
|
257
|
+
size?: ExportWordConverterFormatOptionsV2;
|
|
258
|
+
orientation?: ExportWordConverterOrientationOptionsV2;
|
|
259
|
+
};
|
|
260
|
+
export type ExportWordConverterMarginsOptionsV2 = {
|
|
261
|
+
top?: string;
|
|
262
|
+
right?: string;
|
|
263
|
+
bottom?: string;
|
|
264
|
+
left?: string;
|
|
265
|
+
};
|
|
266
|
+
export type ExportWordConverterHeaderFooterOptionsV2 = {
|
|
267
|
+
first?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
268
|
+
odd?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
269
|
+
even?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
270
|
+
default?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* If fetching some resources (e.g. images) used in a generated Word requires passing an additional
|
|
274
|
+
* authorization factor in the form of additional HTTP headers:
|
|
275
|
+
*
|
|
276
|
+
* ```
|
|
277
|
+
* extra_http_headers: {
|
|
278
|
+
* 'https://ckeditor.com': {
|
|
279
|
+
* authorization: 'Bearer xxx'
|
|
280
|
+
* },
|
|
281
|
+
* 'https://example.com': {
|
|
282
|
+
* authorization: 'Bearer xxx'
|
|
283
|
+
* },
|
|
284
|
+
* }
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
export type ExportWordConverterExtraHttpHeaders = {
|
|
288
|
+
[domain: string]: ExportWordConverterExtraHttpHeadersHeader;
|
|
289
|
+
};
|
|
290
|
+
export type ExportWordConverterExtraHttpHeadersHeader = {
|
|
291
|
+
[header: string]: string;
|
|
292
|
+
};
|
|
293
|
+
export type ExportWordConverterHeaderFooterItemOptionsV2 = {
|
|
294
|
+
html?: string;
|
|
295
|
+
css?: string;
|
|
296
|
+
};
|
|
297
|
+
export type ExportWordConverterOrientationOptionsV2 = 'portrait' | 'landscape' | string & Record<never, never>;
|
|
298
|
+
export type ExportWordConverterFormatOptionsV2 = ExportWordConverterPredifinedFormatOptionsV2 | ExportWordConverterCustomFormatOptionsV2;
|
|
299
|
+
export type ExportWordConverterPredifinedFormatOptionsV2 = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5' | string & Record<never, never>;
|
|
300
|
+
export type ExportWordConverterCustomFormatOptionsV2 = {
|
|
301
|
+
width?: string;
|
|
302
|
+
height?: string;
|
|
303
|
+
};
|
|
304
|
+
export type ExportWordConverterCollaborationFeaturesOptionsV2 = {
|
|
305
|
+
comment_threads: ExportWordConverterCommentsThreadOptionsV2;
|
|
306
|
+
suggestions: ExportWordConverterSuggestionsOptionsV2;
|
|
307
|
+
};
|
|
308
|
+
export type ExportWordConverterCommentsThreadOptionsV2 = {
|
|
309
|
+
thread_id: string;
|
|
310
|
+
is_resolved: boolean;
|
|
311
|
+
comments: Array<{
|
|
312
|
+
author: string;
|
|
313
|
+
created_at: string;
|
|
314
|
+
content: string;
|
|
315
|
+
}>;
|
|
316
|
+
};
|
|
317
|
+
export type ExportWordConverterSuggestionsOptionsV2 = Array<{
|
|
318
|
+
id: string;
|
|
319
|
+
author: string;
|
|
320
|
+
created_at: string;
|
|
321
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-export-word",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "42.0.0-alpha.0",
|
|
4
4
|
"description": "Export to Word 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": "
|
|
33
|
+
"ckeditor5": "42.0.0-alpha.0"
|
|
34
34
|
},
|
|
35
35
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
36
36
|
"author": "CKSource (https://cksource.com/)",
|
package/src/exportword.d.ts
CHANGED
|
@@ -57,13 +57,16 @@ export interface ExportWordConfig {
|
|
|
57
57
|
* ```
|
|
58
58
|
*
|
|
59
59
|
* **NOTE:** If `stylesheets` are not provided, the plugin will sent only
|
|
60
|
-
* {@glink
|
|
60
|
+
* {@glink getting-started/setup/css the default editor content styles}
|
|
61
|
+
* to the converter.
|
|
61
62
|
*
|
|
62
63
|
* **Default editor's content styles**:
|
|
63
|
-
* {@glink
|
|
64
|
+
* {@glink getting-started/setup/css The default editor content styles}
|
|
64
65
|
* are applied to the generated Word file thanks to the 'EDITOR_STYLES' token, which is provided to the `stylesheets` by default.
|
|
65
66
|
* If you don't want them to be applied, you have to omit the token:
|
|
66
67
|
*
|
|
68
|
+
* **NOTE:** The 'EDITOR_STYLES' string is only supported in legacy webpack setup.
|
|
69
|
+
*
|
|
67
70
|
* ```ts
|
|
68
71
|
* const exportWordConfig = {
|
|
69
72
|
* stylesheets: [ './path/to/custom-editor-styles.css' ]
|
|
@@ -75,7 +78,7 @@ export interface ExportWordConfig {
|
|
|
75
78
|
* ```ts
|
|
76
79
|
* const exportWordConfig = {
|
|
77
80
|
* stylesheets: [
|
|
78
|
-
* '
|
|
81
|
+
* 'path/to/editor-styles.css',
|
|
79
82
|
* './path/to/custom-styles.css'
|
|
80
83
|
* ]
|
|
81
84
|
* }
|
|
@@ -154,7 +157,7 @@ export interface ExportWordConfig {
|
|
|
154
157
|
* timezone: 'UTC'
|
|
155
158
|
* }`
|
|
156
159
|
*/
|
|
157
|
-
converterOptions?: ExportWordConverterOptions;
|
|
160
|
+
converterOptions?: ExportWordConverterOptions | ExportWordConverterOptionsV2;
|
|
158
161
|
/**
|
|
159
162
|
* A function to gather the HTML to be converted to Word.
|
|
160
163
|
*
|
|
@@ -193,6 +196,12 @@ export interface ExportWordConfig {
|
|
|
193
196
|
* See: {@link module:cloud-services/cloudservices~CloudServices#token}
|
|
194
197
|
*/
|
|
195
198
|
token?: InitializedToken;
|
|
199
|
+
/**
|
|
200
|
+
* The version of `Export to Word` API.
|
|
201
|
+
*
|
|
202
|
+
* @default '1'
|
|
203
|
+
*/
|
|
204
|
+
version?: 1 | 2;
|
|
196
205
|
}
|
|
197
206
|
export type ExportWordConverterOptions = {
|
|
198
207
|
format?: ExportWordConverterFormatOption;
|
|
@@ -209,12 +218,12 @@ export type ExportWordConverterOptions = {
|
|
|
209
218
|
base_url?: string;
|
|
210
219
|
timezone?: string;
|
|
211
220
|
};
|
|
212
|
-
export type ExportWordConverterFormatOption = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5'
|
|
213
|
-
export type ExportWordConverterOrientationOption = 'portrait' | 'landscape'
|
|
221
|
+
export type ExportWordConverterFormatOption = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5' | string & Record<never, never>;
|
|
222
|
+
export type ExportWordConverterOrientationOption = 'portrait' | 'landscape' | string & Record<never, never>;
|
|
214
223
|
export type ExportWordConverterHeaderFooterOption = Array<{
|
|
215
224
|
html?: string;
|
|
216
225
|
css?: string;
|
|
217
|
-
type?: 'default' | 'even' | 'odd' | 'first'
|
|
226
|
+
type?: 'default' | 'even' | 'odd' | 'first' | string & Record<never, never>;
|
|
218
227
|
}>;
|
|
219
228
|
export type ExportWordConverterCommentsOption = {
|
|
220
229
|
[id: string]: Array<{
|
|
@@ -230,3 +239,79 @@ export type ExportWordConverterSuggestionsOption = {
|
|
|
230
239
|
created: Date | null;
|
|
231
240
|
};
|
|
232
241
|
};
|
|
242
|
+
export type ExportWordConverterOptionsV2 = {
|
|
243
|
+
document?: ExportWordConverterDocumentOptionsV2;
|
|
244
|
+
header?: ExportWordConverterHeaderFooterOptionsV2;
|
|
245
|
+
footer?: ExportWordConverterHeaderFooterOptionsV2;
|
|
246
|
+
collaboration_features?: ExportWordConverterCollaborationFeaturesOptionsV2;
|
|
247
|
+
extra_http_headers?: ExportWordConverterExtraHttpHeaders;
|
|
248
|
+
timezone?: string;
|
|
249
|
+
base_url?: string;
|
|
250
|
+
};
|
|
251
|
+
export type ExportWordConverterDocumentOptionsV2 = {
|
|
252
|
+
margins?: ExportWordConverterMarginsOptionsV2;
|
|
253
|
+
size?: ExportWordConverterFormatOptionsV2;
|
|
254
|
+
orientation?: ExportWordConverterOrientationOptionsV2;
|
|
255
|
+
};
|
|
256
|
+
export type ExportWordConverterMarginsOptionsV2 = {
|
|
257
|
+
top?: string;
|
|
258
|
+
right?: string;
|
|
259
|
+
bottom?: string;
|
|
260
|
+
left?: string;
|
|
261
|
+
};
|
|
262
|
+
export type ExportWordConverterHeaderFooterOptionsV2 = {
|
|
263
|
+
first?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
264
|
+
odd?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
265
|
+
even?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
266
|
+
default?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* If fetching some resources (e.g. images) used in a generated Word requires passing an additional
|
|
270
|
+
* authorization factor in the form of additional HTTP headers:
|
|
271
|
+
*
|
|
272
|
+
* ```
|
|
273
|
+
* extra_http_headers: {
|
|
274
|
+
* 'https://ckeditor.com': {
|
|
275
|
+
* authorization: 'Bearer xxx'
|
|
276
|
+
* },
|
|
277
|
+
* 'https://example.com': {
|
|
278
|
+
* authorization: 'Bearer xxx'
|
|
279
|
+
* },
|
|
280
|
+
* }
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
export type ExportWordConverterExtraHttpHeaders = {
|
|
284
|
+
[domain: string]: ExportWordConverterExtraHttpHeadersHeader;
|
|
285
|
+
};
|
|
286
|
+
export type ExportWordConverterExtraHttpHeadersHeader = {
|
|
287
|
+
[header: string]: string;
|
|
288
|
+
};
|
|
289
|
+
export type ExportWordConverterHeaderFooterItemOptionsV2 = {
|
|
290
|
+
html?: string;
|
|
291
|
+
css?: string;
|
|
292
|
+
};
|
|
293
|
+
export type ExportWordConverterOrientationOptionsV2 = 'portrait' | 'landscape' | string & Record<never, never>;
|
|
294
|
+
export type ExportWordConverterFormatOptionsV2 = ExportWordConverterPredifinedFormatOptionsV2 | ExportWordConverterCustomFormatOptionsV2;
|
|
295
|
+
export type ExportWordConverterPredifinedFormatOptionsV2 = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5' | string & Record<never, never>;
|
|
296
|
+
export type ExportWordConverterCustomFormatOptionsV2 = {
|
|
297
|
+
width?: string;
|
|
298
|
+
height?: string;
|
|
299
|
+
};
|
|
300
|
+
export type ExportWordConverterCollaborationFeaturesOptionsV2 = {
|
|
301
|
+
comment_threads: ExportWordConverterCommentsThreadOptionsV2;
|
|
302
|
+
suggestions: ExportWordConverterSuggestionsOptionsV2;
|
|
303
|
+
};
|
|
304
|
+
export type ExportWordConverterCommentsThreadOptionsV2 = {
|
|
305
|
+
thread_id: string;
|
|
306
|
+
is_resolved: boolean;
|
|
307
|
+
comments: Array<{
|
|
308
|
+
author: string;
|
|
309
|
+
created_at: string;
|
|
310
|
+
content: string;
|
|
311
|
+
}>;
|
|
312
|
+
};
|
|
313
|
+
export type ExportWordConverterSuggestionsOptionsV2 = Array<{
|
|
314
|
+
id: string;
|
|
315
|
+
author: string;
|
|
316
|
+
created_at: string;
|
|
317
|
+
}>;
|
package/src/exportword.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x17ce6d=_0x21b2;(function(_0x5c37fe,_0x5d588b){const _0xe8a6ec=_0x21b2,_0x47e70a=_0x5c37fe();while(!![]){try{const _0x49ff9d=-parseInt(_0xe8a6ec(0x1a9))/0x1*(parseInt(_0xe8a6ec(0x1ab))/0x2)+-parseInt(_0xe8a6ec(0x194))/0x3*(parseInt(_0xe8a6ec(0x197))/0x4)+parseInt(_0xe8a6ec(0x193))/0x5+-parseInt(_0xe8a6ec(0x190))/0x6+parseInt(_0xe8a6ec(0x1a2))/0x7*(-parseInt(_0xe8a6ec(0x19a))/0x8)+-parseInt(_0xe8a6ec(0x191))/0x9*(parseInt(_0xe8a6ec(0x19f))/0xa)+parseInt(_0xe8a6ec(0x192))/0xb;if(_0x49ff9d===_0x5d588b)break;else _0x47e70a['push'](_0x47e70a['shift']());}catch(_0x538492){_0x47e70a['push'](_0x47e70a['shift']());}}}(_0x18b8,0xe1d95));function _0x18b8(){const _0x4ad2b5=['ExportWord','tokenUrl','2642570bzMmAD','get','plugins','349433ruziOw','init','_token','registerTokenUrl','then','config','CloudServices','5ZHcNty','editor','171074wuxYGE','3244008cgrxHW','63itzuxK','51529599pxTWNg','8964320LHnoLQ','3859479dMJfJu','add','token','4MxmnOI','commands','requires','232zIXsoG','exportWord','pluginName'];_0x18b8=function(){return _0x4ad2b5;};return _0x18b8();}import{Plugin as _0x2deb63}from'ckeditor5/src/core.js';import{Notification as _0x5f2a49}from'ckeditor5/src/ui.js';import _0xfaf148 from'./exportwordcommand.js';function _0x21b2(_0x35a47c,_0x337151){const _0x18b8e7=_0x18b8();return _0x21b2=function(_0x21b265,_0x3dc6a6){_0x21b265=_0x21b265-0x190;let _0x499e94=_0x18b8e7[_0x21b265];return _0x499e94;},_0x21b2(_0x35a47c,_0x337151);}import _0x460a77 from'./exportwordui.js';export default class s extends _0x2deb63{static get[_0x17ce6d(0x19c)](){const _0x29f645=_0x17ce6d;return _0x29f645(0x19d);}static get[_0x17ce6d(0x199)](){const _0x4c5460=_0x17ce6d;return[_0x4c5460(0x1a8),_0x5f2a49,_0x460a77];}[_0x17ce6d(0x1a3)](){const _0x8d5627=_0x17ce6d,_0x3fb321=this[_0x8d5627(0x1aa)],_0x34be9f=_0x3fb321[_0x8d5627(0x1a7)][_0x8d5627(0x1a0)](_0x8d5627(0x19b))||{};_0x3fb321[_0x8d5627(0x198)][_0x8d5627(0x195)](_0x8d5627(0x19b),new _0xfaf148(_0x3fb321));const _0x107ed7=_0x3fb321[_0x8d5627(0x1a1)][_0x8d5627(0x1a0)](_0x8d5627(0x1a8));!0x1===_0x34be9f[_0x8d5627(0x19e)]?this[_0x8d5627(0x1a4)]=null:_0x34be9f[_0x8d5627(0x19e)]?_0x107ed7[_0x8d5627(0x1a5)](_0x34be9f[_0x8d5627(0x19e)])[_0x8d5627(0x1a6)](_0x13281c=>{const _0x1196c5=_0x8d5627;this[_0x1196c5(0x1a4)]=_0x13281c;}):this[_0x8d5627(0x1a4)]=_0x107ed7[_0x8d5627(0x196)];}}
|
package/src/exportwordcommand.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
23
|
+
import{Command as _0x1b56f0}from'ckeditor5/src/core.js';import{getStyles as _0x16a4c0,getConverterOptions as _0x137b1f}from'./utils.js';export default class e extends _0x1b56f0{constructor(_0x5b1fe6){super(_0x5b1fe6),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x255609={}){const _0x102fbc=this['editor'],t=_0x102fbc['t'],_0x1e00a9=_0x255609['version']||0x1,_0x4c9f5f=_0x255609['converterUrl']||(0x2===_0x1e00a9?'https://docx-converter.cke-cs.com/v2/convert/docx-html':'https://docx-converter.cke-cs.com/v1/convert'),_0x38ec13=_0x255609['converterOptions']||{},_0x16cf98=_0x102fbc['plugins']['get']('ExportWord'),_0x551870=_0x255609['token']||_0x16cf98['_token'],_0x180b4d=!0x1!==_0x38ec13['auto_pagination'],_0x231c36=_0x255609['dataCallback']||(_0x4d28c1=>_0x4d28c1['data']['get']({'pagination':_0x180b4d}));return this['isBusy']=!0x0,this['refresh'](),_0x16a4c0(_0x255609['stylesheets']||['EDITOR_STYLES'])['then'](async _0x211fa5=>{_0x102fbc['ui']['ariaLiveAnnouncer']['announce'](t('Word\x20document\x20export\x20started'));const _0x5cd7c6=await _0x231c36(_0x102fbc),_0x558fd2={'html':'<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x102fbc['locale']['contentLanguageDirection']+'\x22>'+_0x5cd7c6+'</div>','css':_0x211fa5,[0x2===_0x1e00a9?'config':'options']:{..._0x38ec13,..._0x137b1f(_0x102fbc)}},_0x2d567c={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/docx',..._0x551870?{'Authorization':_0x551870['value']}:null},'body':JSON['stringify'](_0x558fd2)};return window['fetch'](_0x4c9f5f,_0x2d567c)['then'](_0x5f3f8f=>{if(0xc8!==_0x5f3f8f['status'])throw _0x5f3f8f;return _0x5f3f8f['blob']();})['then'](_0x49dca0=>{_0x102fbc['ui']['ariaLiveAnnouncer']['announce'](t('Word\x20document\x20export\x20successful'));const _0x303dae='function'==typeof _0x255609['fileName']?_0x255609['fileName']():_0x255609['fileName'];this['_downloadFile'](_0x49dca0,_0x303dae||'document.docx');});})['catch'](_0x12dc34=>{const _0x5333fd=_0x102fbc['plugins']['get']('Notification');throw _0x102fbc['ui']['ariaLiveAnnouncer']['announce'](t('Word\x20document\x20export\x20failed'),{'politeness':'assertive'}),_0x5333fd['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.')),_0x12dc34;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0x3cca18,_0x45edda){const _0x16cb64=document['createElement']('a');_0x16cb64['href']=window['URL']['createObjectURL'](_0x3cca18),_0x16cb64['download']=_0x45edda,_0x16cb64['click'](),_0x16cb64['remove']();}}
|
package/src/exportwordui.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as
|
|
23
|
+
import{Plugin as _0x528a3b}from'ckeditor5/src/core.js';import{ButtonView as _0x4873d2,MenuBarMenuListItemButtonView as _0xd7e14d,SpinnerView as _0x452211}from'ckeditor5/src/ui.js';import _0x124587 from'../theme/icons/exportword.svg';export default class i extends _0x528a3b{static get['pluginName'](){return'ExportWordUI';}['init'](){const _0x185b31=this['editor'];_0x185b31['ui']['componentFactory']['add']('exportWord',()=>{const _0x35d4d5=_0x185b31['commands']['get']('exportWord'),_0x297d51=this['_createButton'](_0x4873d2);return _0x297d51['set']({'tooltip':!0x0}),_0x297d51['bind']('isOn')['to'](_0x35d4d5,'isBusy'),_0x297d51;}),_0x185b31['ui']['componentFactory']['add']('menuBar:exportWord',()=>this['_createButton'](_0xd7e14d));}['_createButton'](_0x5a9f2c){const _0x462c2d=this['editor'],_0x4d41db=_0x462c2d['config']['get']('exportWord')||{},t=_0x462c2d['locale']['t'],_0x397feb=_0x462c2d['commands']['get']('exportWord'),_0x1e3b35=new _0x5a9f2c(_0x462c2d['locale']),_0x56c8fa=new _0x452211();return _0x1e3b35['children']['add'](_0x56c8fa),_0x56c8fa['bind']('isVisible')['to'](_0x397feb,'isBusy'),_0x1e3b35['iconView']['bind']('isVisible')['to'](_0x397feb,'isBusy',_0x911cae=>!_0x911cae),_0x1e3b35['set']({'icon':_0x124587}),_0x1e3b35['bind']('isEnabled')['to'](_0x397feb,'isEnabled'),_0x1e3b35['bind']('label')['to'](_0x397feb,'isBusy',_0x5bde88=>t(_0x5bde88?'Exporting\x20Word\x20document':'Export\x20to\x20Word')),this['listenTo'](_0x1e3b35,'execute',()=>{_0x462c2d['execute']('exportWord',_0x4d41db),_0x462c2d['editing']['view']['focus']();}),_0x1e3b35;}}
|
package/src/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
function
|
|
23
|
+
function _0x15f9(_0x3f8f53,_0x402cc4){var _0x6c1fb5=_0x6c1f();return _0x15f9=function(_0x15f9cb,_0x2f8f84){_0x15f9cb=_0x15f9cb-0x115;var _0x5518bd=_0x6c1fb5[_0x15f9cb];return _0x5518bd;},_0x15f9(_0x3f8f53,_0x402cc4);}(function(_0x9c122d,_0x12db5a){var _0x37bc36=_0x15f9,_0x3f87b5=_0x9c122d();while(!![]){try{var _0x5c088f=-parseInt(_0x37bc36(0x11c))/0x1+parseInt(_0x37bc36(0x115))/0x2+parseInt(_0x37bc36(0x117))/0x3*(parseInt(_0x37bc36(0x11b))/0x4)+-parseInt(_0x37bc36(0x116))/0x5+-parseInt(_0x37bc36(0x119))/0x6+-parseInt(_0x37bc36(0x11d))/0x7+parseInt(_0x37bc36(0x11a))/0x8*(parseInt(_0x37bc36(0x118))/0x9);if(_0x5c088f===_0x12db5a)break;else _0x3f87b5['push'](_0x3f87b5['shift']());}catch(_0x2af1c6){_0x3f87b5['push'](_0x3f87b5['shift']());}}}(_0x6c1f,0xcb332));function _0x6c1f(){var _0x3cbe5f=['4YNbxHV','1110785uVBgHt','6184731CpOXzC','872452dBJrQp','4157890DVbCFt','2584731GCdHUa','1815309XaDQYK','7621314izDezI','144nxhwBF'];_0x6c1f=function(){return _0x3cbe5f;};return _0x6c1f();}export{default as ExportWord}from'./exportword.js';import'./augmentation.js';
|
package/src/utils.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(function(
|
|
23
|
+
(function(_0x247fd2,_0x3da526){const _0xbda155=_0x2a08,_0x29613d=_0x247fd2();while(!![]){try{const _0x29c15c=-parseInt(_0xbda155(0xf1))/0x1*(-parseInt(_0xbda155(0xe6))/0x2)+parseInt(_0xbda155(0x10c))/0x3+parseInt(_0xbda155(0x10d))/0x4*(-parseInt(_0xbda155(0xec))/0x5)+parseInt(_0xbda155(0xf7))/0x6*(-parseInt(_0xbda155(0xfb))/0x7)+-parseInt(_0xbda155(0xe7))/0x8*(-parseInt(_0xbda155(0xfa))/0x9)+-parseInt(_0xbda155(0xf0))/0xa+-parseInt(_0xbda155(0xe9))/0xb;if(_0x29c15c===_0x3da526)break;else _0x29613d['push'](_0x29613d['shift']());}catch(_0x3fa738){_0x29613d['push'](_0x29613d['shift']());}}}(_0x5039,0x413a5));export function getStyles(_0x17ce45){const _0x2bf144=_0x2a08;if(!_0x17ce45)return new Promise(_0x3e285e=>_0x3e285e(''));const _0x194f2c=[];for(const _0x2a21d5 of _0x17ce45)_0x2bf144(0xe4)!==_0x2a21d5?_0x194f2c[_0x2bf144(0x10b)](window[_0x2bf144(0xea)](_0x2a21d5)[_0x2bf144(0xf3)](_0x1c9966=>_0x1c9966[_0x2bf144(0x10a)]())):_0x194f2c[_0x2bf144(0x10b)](f());return Promise[_0x2bf144(0xf4)](_0x194f2c)[_0x2bf144(0xf3)](_0x384ab7=>_0x384ab7[_0x2bf144(0x110)]('\x20')[_0x2bf144(0xe3)]());}function f(){const _0x8821a4=_0x2a08,_0x5832f9=[],_0xa7169d=[];for(const _0x5b7320 of Array[_0x8821a4(0xf5)](document[_0x8821a4(0xed)])){if(_0x5b7320[_0x8821a4(0x102)][_0x8821a4(0x118)](_0x8821a4(0x105))){for(const _0x8ee1db of Array[_0x8821a4(0xf5)](_0x5b7320[_0x8821a4(0x100)]))-0x1!==_0x8ee1db[_0x8821a4(0x115)][_0x8821a4(0xf6)](_0x8821a4(0x10e))?_0x5832f9[_0x8821a4(0x10b)](_0x8ee1db[_0x8821a4(0x115)]):-0x1!==_0x8ee1db[_0x8821a4(0x115)][_0x8821a4(0xf6)](_0x8821a4(0x112))&&_0xa7169d[_0x8821a4(0x10b)](_0x8ee1db[_0x8821a4(0x115)]);}}return _0x5832f9[_0x8821a4(0x109)]||console[_0x8821a4(0x106)](_0x8821a4(0xf2)),[..._0xa7169d,..._0x5832f9][_0x8821a4(0x110)]('\x20')[_0x8821a4(0xe3)]();}function _0x2a08(_0x48ca98,_0x2303ae){const _0x5039d2=_0x5039();return _0x2a08=function(_0x2a087e,_0x316718){_0x2a087e=_0x2a087e-0xe3;let _0x30d0ba=_0x5039d2[_0x2a087e];return _0x30d0ba;},_0x2a08(_0x48ca98,_0x2303ae);}export function getConverterOptions(_0xce987c){const _0x4d49bc=_0x2a08,_0x50260e=_0xce987c[_0x4d49bc(0x101)][_0x4d49bc(0x108)](_0x4d49bc(0x10f)),_0x19efd4=_0xce987c[_0x4d49bc(0x101)][_0x4d49bc(0x108)](_0x4d49bc(0x104)),_0x1bf01e=_0xce987c[_0x4d49bc(0x101)][_0x4d49bc(0x108)](_0x4d49bc(0x116)),_0x40c84e={};if(_0x50260e&&_0x19efd4){const _0x9c8d6e=getComments(_0xce987c[_0x4d49bc(0x101)][_0x4d49bc(0x107)](_0x4d49bc(0x104))[_0x4d49bc(0xfe)]({'skipNotAttached':!0x0,'skipEmpty':!0x0}));Object[_0x4d49bc(0x114)](_0x9c8d6e)[_0x4d49bc(0x109)]&&(_0x40c84e[_0x4d49bc(0x117)]=_0x9c8d6e);}if(_0x50260e&&_0x1bf01e){const _0x36b389=_0xce987c[_0x4d49bc(0x101)][_0x4d49bc(0x107)](_0x4d49bc(0x116)),_0x17db0d=_0xce987c[_0x4d49bc(0x101)][_0x4d49bc(0x107)](_0x4d49bc(0x10f)),_0x300f95=getSuggestions(_0x36b389[_0x4d49bc(0xf9)]({'toJSON':!0x0}),_0x17db0d[_0x4d49bc(0x103)]);Object[_0x4d49bc(0x114)](_0x300f95)[_0x4d49bc(0x109)]&&(_0x40c84e[_0x4d49bc(0x113)]=_0x300f95);}return(_0x40c84e[_0x4d49bc(0x113)]||_0x40c84e[_0x4d49bc(0x117)])&&(_0x40c84e[_0x4d49bc(0xee)]=new Intl[(_0x4d49bc(0x119))]()[_0x4d49bc(0xff)]()[_0x4d49bc(0xef)]),_0x40c84e;}export function getComments(_0xcc0182){const _0x5a1715=_0x2a08,_0x50f0b0={};if(!_0xcc0182[_0x5a1715(0x109)])return _0x50f0b0;for(const _0x21e9ae of _0xcc0182)_0x21e9ae[_0x5a1715(0x117)][_0x5a1715(0xeb)](_0x1435ab=>{const _0x279281=_0x5a1715;void 0x0===_0x50f0b0[_0x21e9ae['id']]&&(_0x50f0b0[_0x21e9ae['id']]=[]),_0x50f0b0[_0x21e9ae['id']][_0x279281(0x10b)]({'author':_0x1435ab[_0x279281(0x111)][_0x279281(0xfc)],'content':_0x1435ab[_0x279281(0xf8)],'created':_0x1435ab[_0x279281(0xfd)],'is_resolved':_0x21e9ae[_0x279281(0xe8)]});});return _0x50f0b0;}function _0x5039(){const _0x49cdd8=['author',':root','suggestions','keys','cssText','TrackChanges','comments','hasAttribute','DateTimeFormat','trim','EDITOR_STYLES','authorId','78HcttBH','8lNEvJm','isResolved','987976jUoDOY','fetch','map','390AkQxKI','styleSheets','timezone','timeZone','2832130FIhpOD','7782QVftQu','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.','then','all','from','indexOf','583326kkvyWi','content','getSuggestions','2556837PvYkdV','7nnEFVC','name','createdAt','getCommentThreads','resolvedOptions','cssRules','plugins','ownerNode','users','CommentsRepository','data-cke','warn','get','has','length','text','push','661266lokliR','3620iGCMSw','.ck-content','Users','join'];_0x5039=function(){return _0x49cdd8;};return _0x5039();}export function getSuggestions(_0x336655,_0xc184ba){const _0x2c2466=_0x2a08,_0x5e5763={};if(!_0x336655[_0x2c2466(0x109)]||!_0xc184ba[_0x2c2466(0x109)])return _0x5e5763;for(const _0x3d1c93 of _0x336655)_0x5e5763[_0x3d1c93['id']]={'author':_0xc184ba[_0x2c2466(0x107)](_0x3d1c93[_0x2c2466(0xe5)])[_0x2c2466(0xfc)],'created':_0x3d1c93[_0x2c2466(0xfd)]};return _0x5e5763;}
|