@ckeditor/ckeditor5-export-word 41.4.2 → 42.0.0-alpha.1
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
|
+
(_0x251dd3=>{const {'zh-cn':{dictionary:_0x359f7a,getPluralForm:_0x2f1e57}}={'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':_0x57aab7=>0x0}};_0x251dd3['zh-cn']||={'dictionary':{},'getPluralForm':null},_0x251dd3['zh-cn']['dictionary']=Object['assign'](_0x251dd3['zh-cn']['dictionary'],_0x359f7a),_0x251dd3['zh-cn']['getPluralForm']=_0x2f1e57;})(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':_0x581598=>0x0}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x2a7190=>{const {zh:{dictionary:_0x31a686,getPluralForm:_0x1eab29}}={'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':_0x5d1b3c=>0x0}};_0x2a7190['zh']||={'dictionary':{},'getPluralForm':null},_0x2a7190['zh']['dictionary']=Object['assign'](_0x2a7190['zh']['dictionary'],_0x31a686),_0x2a7190['zh']['getPluralForm']=_0x1eab29;})(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.1",
|
|
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.1"
|
|
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 _0x5c83c9=_0x3d0e;(function(_0x537acd,_0x523da7){const _0x1d0e4b=_0x3d0e,_0x3b6b2f=_0x537acd();while(!![]){try{const _0x323fc0=parseInt(_0x1d0e4b(0x1bd))/0x1*(-parseInt(_0x1d0e4b(0x1b3))/0x2)+-parseInt(_0x1d0e4b(0x1ba))/0x3*(parseInt(_0x1d0e4b(0x1b7))/0x4)+-parseInt(_0x1d0e4b(0x1b5))/0x5*(parseInt(_0x1d0e4b(0x1be))/0x6)+parseInt(_0x1d0e4b(0x1a5))/0x7+-parseInt(_0x1d0e4b(0x1b8))/0x8+parseInt(_0x1d0e4b(0x1a6))/0x9+parseInt(_0x1d0e4b(0x1ad))/0xa*(parseInt(_0x1d0e4b(0x1aa))/0xb);if(_0x323fc0===_0x523da7)break;else _0x3b6b2f['push'](_0x3b6b2f['shift']());}catch(_0x3dbed0){_0x3b6b2f['push'](_0x3b6b2f['shift']());}}}(_0x556d,0x3e1ff));import{Plugin as _0x5a10b1}from'ckeditor5/src/core.js';import{Notification as _0x464688}from'ckeditor5/src/ui.js';import _0x4e93b3 from'./exportwordcommand.js';function _0x3d0e(_0x2db605,_0x4b74b8){const _0x556da7=_0x556d();return _0x3d0e=function(_0x3d0eb0,_0x32e435){_0x3d0eb0=_0x3d0eb0-0x1a5;let _0x3dd9fc=_0x556da7[_0x3d0eb0];return _0x3dd9fc;},_0x3d0e(_0x2db605,_0x4b74b8);}import _0x270326 from'./exportwordui.js';function _0x556d(){const _0xb1ed9a=['tokenUrl','CloudServices','920510PUcNwK','exportWord','config','plugins','requires','add','161972dxaSXo','get','1326145rhTxPE','editor','50948EMTQmx','191976RZChjB','init','87EMXJVq','commands','then','4gdTkwf','6rkmFDw','registerTokenUrl','_token','3481177CPWzwL','3343419hqupAj','token','pluginName','ExportWord','44ZoyvYK'];_0x556d=function(){return _0xb1ed9a;};return _0x556d();}export default class s extends _0x5a10b1{static get[_0x5c83c9(0x1a8)](){const _0x34fa63=_0x5c83c9;return _0x34fa63(0x1a9);}static get[_0x5c83c9(0x1b1)](){const _0x4a266e=_0x5c83c9;return[_0x4a266e(0x1ac),_0x464688,_0x270326];}[_0x5c83c9(0x1b9)](){const _0x24b552=_0x5c83c9,_0x2cd80b=this[_0x24b552(0x1b6)],_0x3cb42c=_0x2cd80b[_0x24b552(0x1af)][_0x24b552(0x1b4)](_0x24b552(0x1ae))||{};_0x2cd80b[_0x24b552(0x1bb)][_0x24b552(0x1b2)](_0x24b552(0x1ae),new _0x4e93b3(_0x2cd80b));const _0x404b63=_0x2cd80b[_0x24b552(0x1b0)][_0x24b552(0x1b4)](_0x24b552(0x1ac));!0x1===_0x3cb42c[_0x24b552(0x1ab)]?this[_0x24b552(0x1c0)]=null:_0x3cb42c[_0x24b552(0x1ab)]?_0x404b63[_0x24b552(0x1bf)](_0x3cb42c[_0x24b552(0x1ab)])[_0x24b552(0x1bc)](_0x3b2e9c=>{const _0x2ee11a=_0x24b552;this[_0x2ee11a(0x1c0)]=_0x3b2e9c;}):this[_0x24b552(0x1c0)]=_0x404b63[_0x24b552(0x1a7)];}}
|
package/src/exportwordcommand.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
23
|
+
import{Command as _0x4a37f4}from'ckeditor5/src/core.js';import{getStyles as _0x3b4c5a,getConverterOptions as _0x5cb762}from'./utils.js';export default class e extends _0x4a37f4{constructor(_0x4c1d32){super(_0x4c1d32),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x2f52f5={}){const _0x16e771=this['editor'],t=_0x16e771['t'],_0x1736ee=_0x2f52f5['version']||0x1,_0x9d47f2=_0x2f52f5['converterUrl']||(0x2===_0x1736ee?'https://docx-converter.cke-cs.com/v2/convert/docx-html':'https://docx-converter.cke-cs.com/v1/convert'),_0x500abc=_0x2f52f5['converterOptions']||{},_0x11c332=_0x16e771['plugins']['get']('ExportWord'),_0x22e5a0=_0x2f52f5['token']||_0x11c332['_token'],_0x365662=!0x1!==_0x500abc['auto_pagination'],_0x2a77b4=_0x2f52f5['dataCallback']||(_0x490ca1=>_0x490ca1['data']['get']({'pagination':_0x365662}));return this['isBusy']=!0x0,this['refresh'](),_0x3b4c5a(_0x2f52f5['stylesheets']||['EDITOR_STYLES'])['then'](async _0x42c182=>{_0x16e771['ui']['ariaLiveAnnouncer']['announce'](t('Word\x20document\x20export\x20started'));const _0x581d93=await _0x2a77b4(_0x16e771),_0x20ddda={'html':'<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x16e771['locale']['contentLanguageDirection']+'\x22>'+_0x581d93+'</div>','css':_0x42c182,[0x2===_0x1736ee?'config':'options']:{..._0x500abc,..._0x5cb762(_0x16e771)}},_0x174efe={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/docx',..._0x22e5a0?{'Authorization':_0x22e5a0['value']}:null},'body':JSON['stringify'](_0x20ddda)};return window['fetch'](_0x9d47f2,_0x174efe)['then'](_0x21098f=>{if(0xc8!==_0x21098f['status'])throw _0x21098f;return _0x21098f['blob']();})['then'](_0x3711e5=>{_0x16e771['ui']['ariaLiveAnnouncer']['announce'](t('Word\x20document\x20export\x20successful'));const _0x5608fd='function'==typeof _0x2f52f5['fileName']?_0x2f52f5['fileName']():_0x2f52f5['fileName'];this['_downloadFile'](_0x3711e5,_0x5608fd||'document.docx');});})['catch'](_0x36d2d5=>{const _0x1e0501=_0x16e771['plugins']['get']('Notification');throw _0x16e771['ui']['ariaLiveAnnouncer']['announce'](t('Word\x20document\x20export\x20failed'),{'politeness':'assertive'}),_0x1e0501['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.')),_0x36d2d5;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0x564049,_0x227b23){const _0xaa187f=document['createElement']('a');_0xaa187f['href']=window['URL']['createObjectURL'](_0x564049),_0xaa187f['download']=_0x227b23,_0xaa187f['click'](),_0xaa187f['remove']();}}
|
package/src/exportwordui.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as
|
|
23
|
+
import{Plugin as _0x500d53}from'ckeditor5/src/core.js';import{ButtonView as _0x30a893,MenuBarMenuListItemButtonView as _0x89930f,SpinnerView as _0x1f2678}from'ckeditor5/src/ui.js';import _0x48c68f from'../theme/icons/exportword.svg';export default class i extends _0x500d53{static get['pluginName'](){return'ExportWordUI';}['init'](){const _0x5a5b24=this['editor'];_0x5a5b24['ui']['componentFactory']['add']('exportWord',()=>{const _0x476bc2=_0x5a5b24['commands']['get']('exportWord'),_0x5da6eb=this['_createButton'](_0x30a893);return _0x5da6eb['set']({'tooltip':!0x0}),_0x5da6eb['bind']('isOn')['to'](_0x476bc2,'isBusy'),_0x5da6eb;}),_0x5a5b24['ui']['componentFactory']['add']('menuBar:exportWord',()=>this['_createButton'](_0x89930f));}['_createButton'](_0x18adaa){const _0x222677=this['editor'],_0x3279ab=_0x222677['config']['get']('exportWord')||{},t=_0x222677['locale']['t'],_0x2388f5=_0x222677['commands']['get']('exportWord'),_0x12ff61=new _0x18adaa(_0x222677['locale']),_0x2d69e5=new _0x1f2678();return _0x12ff61['children']['add'](_0x2d69e5),_0x2d69e5['bind']('isVisible')['to'](_0x2388f5,'isBusy'),_0x12ff61['iconView']['bind']('isVisible')['to'](_0x2388f5,'isBusy',_0x21f0f5=>!_0x21f0f5),_0x12ff61['set']({'icon':_0x48c68f}),_0x12ff61['bind']('isEnabled')['to'](_0x2388f5,'isEnabled'),_0x12ff61['bind']('label')['to'](_0x2388f5,'isBusy',_0x3b215b=>t(_0x3b215b?'Exporting\x20Word\x20document':'Export\x20to\x20Word')),this['listenTo'](_0x12ff61,'execute',()=>{_0x222677['execute']('exportWord',_0x3279ab),_0x222677['editing']['view']['focus']();}),_0x12ff61;}}
|
package/src/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
(function(_0x293d83,_0x5d6e95){var _0x2449d3=_0x4126,_0x2cc63a=_0x293d83();while(!![]){try{var _0x54d7e8=parseInt(_0x2449d3(0x19a))/0x1+parseInt(_0x2449d3(0x196))/0x2+-parseInt(_0x2449d3(0x195))/0x3*(parseInt(_0x2449d3(0x198))/0x4)+parseInt(_0x2449d3(0x19d))/0x5*(parseInt(_0x2449d3(0x194))/0x6)+parseInt(_0x2449d3(0x197))/0x7+-parseInt(_0x2449d3(0x19b))/0x8+parseInt(_0x2449d3(0x19c))/0x9*(-parseInt(_0x2449d3(0x199))/0xa);if(_0x54d7e8===_0x5d6e95)break;else _0x2cc63a['push'](_0x2cc63a['shift']());}catch(_0x159c8f){_0x2cc63a['push'](_0x2cc63a['shift']());}}}(_0x2950,0xa5b98));export{default as ExportWord}from'./exportword.js';function _0x4126(_0x4b8dec,_0x13254a){var _0x29501f=_0x2950();return _0x4126=function(_0x412637,_0x99b410){_0x412637=_0x412637-0x194;var _0x193296=_0x29501f[_0x412637];return _0x193296;},_0x4126(_0x4b8dec,_0x13254a);}import'./augmentation.js';function _0x2950(){var _0x21bdf9=['5035233lPWXTC','124mPqcUb','9320sPVqXE','932307JAngYc','4237456mOhGsy','11268Kgoksj','32905qiwabm','318avizYK','80049rVeXnw','2404216heVeua'];_0x2950=function(){return _0x21bdf9;};return _0x2950();}
|
package/src/utils.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(function(
|
|
23
|
+
(function(_0x5eabbd,_0xf083f0){const _0x340f2a=_0x3099,_0x11d82f=_0x5eabbd();while(!![]){try{const _0x545e71=parseInt(_0x340f2a(0x1cd))/0x1*(parseInt(_0x340f2a(0x1b5))/0x2)+parseInt(_0x340f2a(0x1ae))/0x3+-parseInt(_0x340f2a(0x1bc))/0x4*(parseInt(_0x340f2a(0x1d9))/0x5)+-parseInt(_0x340f2a(0x1c3))/0x6*(parseInt(_0x340f2a(0x1a7))/0x7)+parseInt(_0x340f2a(0x1cb))/0x8*(parseInt(_0x340f2a(0x1a8))/0x9)+parseInt(_0x340f2a(0x1a9))/0xa*(parseInt(_0x340f2a(0x1ac))/0xb)+parseInt(_0x340f2a(0x1c2))/0xc*(-parseInt(_0x340f2a(0x1b2))/0xd);if(_0x545e71===_0xf083f0)break;else _0x11d82f['push'](_0x11d82f['shift']());}catch(_0x1b1044){_0x11d82f['push'](_0x11d82f['shift']());}}}(_0x3e8c,0x80b95));export function getStyles(_0x358371){const _0x3e2a48=_0x3099;if(!_0x358371)return new Promise(_0x4ce56c=>_0x4ce56c(''));const _0x464538=[];for(const _0x1c3ffb of _0x358371)_0x3e2a48(0x1a4)!==_0x1c3ffb?_0x464538[_0x3e2a48(0x1c9)](window[_0x3e2a48(0x1bb)](_0x1c3ffb)[_0x3e2a48(0x1c8)](_0x3ec716=>_0x3ec716[_0x3e2a48(0x1b7)]())):_0x464538[_0x3e2a48(0x1c9)](f());return Promise[_0x3e2a48(0x1ba)](_0x464538)[_0x3e2a48(0x1c8)](_0x3ca58e=>_0x3ca58e[_0x3e2a48(0x1b1)]('\x20')[_0x3e2a48(0x1ca)]());}function _0x3e8c(){const _0x36c022=[':root','warn','hasAttribute','get','data-cke','indexOf','timeZone','cssText','length','TrackChanges','content','445vyiJOL','from','author','cssRules','EDITOR_STYLES','getSuggestions','keys','567077bbPZyh','16101KwyOBT','10hDxNcQ','map','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.','5105309Jkoeok','CommentsRepository','488346dzvIHq','suggestions','users','join','13eeSepP','.ck-content','timezone','9092qfKkfW','createdAt','text','plugins','Users','all','fetch','18692gyoxwJ','DateTimeFormat','isResolved','ownerNode','getCommentThreads','comments','8686476cQRUGJ','12TXiXtj','authorId','styleSheets','has','name','then','push','trim','2672qYmPVi','resolvedOptions','133KOpjcm'];_0x3e8c=function(){return _0x36c022;};return _0x3e8c();}function f(){const _0x5f48e8=_0x3099,_0x3d5d15=[],_0x150f80=[];for(const _0x4362ee of Array[_0x5f48e8(0x1da)](document[_0x5f48e8(0x1c5)])){if(_0x4362ee[_0x5f48e8(0x1bf)][_0x5f48e8(0x1d0)](_0x5f48e8(0x1d2))){for(const _0x4b8784 of Array[_0x5f48e8(0x1da)](_0x4362ee[_0x5f48e8(0x1a3)]))-0x1!==_0x4b8784[_0x5f48e8(0x1d5)][_0x5f48e8(0x1d3)](_0x5f48e8(0x1b3))?_0x3d5d15[_0x5f48e8(0x1c9)](_0x4b8784[_0x5f48e8(0x1d5)]):-0x1!==_0x4b8784[_0x5f48e8(0x1d5)][_0x5f48e8(0x1d3)](_0x5f48e8(0x1ce))&&_0x150f80[_0x5f48e8(0x1c9)](_0x4b8784[_0x5f48e8(0x1d5)]);}}return _0x3d5d15[_0x5f48e8(0x1d6)]||console[_0x5f48e8(0x1cf)](_0x5f48e8(0x1ab)),[..._0x150f80,..._0x3d5d15][_0x5f48e8(0x1b1)]('\x20')[_0x5f48e8(0x1ca)]();}export function getConverterOptions(_0x583ab3){const _0x4f90c1=_0x3099,_0x2adc6a=_0x583ab3[_0x4f90c1(0x1b8)][_0x4f90c1(0x1c6)](_0x4f90c1(0x1b9)),_0x11a8d7=_0x583ab3[_0x4f90c1(0x1b8)][_0x4f90c1(0x1c6)](_0x4f90c1(0x1ad)),_0x57c41d=_0x583ab3[_0x4f90c1(0x1b8)][_0x4f90c1(0x1c6)](_0x4f90c1(0x1d7)),_0x3f20fc={};if(_0x2adc6a&&_0x11a8d7){const _0x131ce8=getComments(_0x583ab3[_0x4f90c1(0x1b8)][_0x4f90c1(0x1d1)](_0x4f90c1(0x1ad))[_0x4f90c1(0x1c0)]({'skipNotAttached':!0x0,'skipEmpty':!0x0}));Object[_0x4f90c1(0x1a6)](_0x131ce8)[_0x4f90c1(0x1d6)]&&(_0x3f20fc[_0x4f90c1(0x1c1)]=_0x131ce8);}if(_0x2adc6a&&_0x57c41d){const _0x52fa38=_0x583ab3[_0x4f90c1(0x1b8)][_0x4f90c1(0x1d1)](_0x4f90c1(0x1d7)),_0x48a9d8=_0x583ab3[_0x4f90c1(0x1b8)][_0x4f90c1(0x1d1)](_0x4f90c1(0x1b9)),_0x3d3cba=getSuggestions(_0x52fa38[_0x4f90c1(0x1a5)]({'toJSON':!0x0}),_0x48a9d8[_0x4f90c1(0x1b0)]);Object[_0x4f90c1(0x1a6)](_0x3d3cba)[_0x4f90c1(0x1d6)]&&(_0x3f20fc[_0x4f90c1(0x1af)]=_0x3d3cba);}return(_0x3f20fc[_0x4f90c1(0x1af)]||_0x3f20fc[_0x4f90c1(0x1c1)])&&(_0x3f20fc[_0x4f90c1(0x1b4)]=new Intl[(_0x4f90c1(0x1bd))]()[_0x4f90c1(0x1cc)]()[_0x4f90c1(0x1d4)]),_0x3f20fc;}export function getComments(_0x4e5339){const _0xbbb30f=_0x3099,_0x2f2785={};if(!_0x4e5339[_0xbbb30f(0x1d6)])return _0x2f2785;for(const _0x10132c of _0x4e5339)_0x10132c[_0xbbb30f(0x1c1)][_0xbbb30f(0x1aa)](_0x469443=>{const _0x26ce43=_0xbbb30f;void 0x0===_0x2f2785[_0x10132c['id']]&&(_0x2f2785[_0x10132c['id']]=[]),_0x2f2785[_0x10132c['id']][_0x26ce43(0x1c9)]({'author':_0x469443[_0x26ce43(0x1a2)][_0x26ce43(0x1c7)],'content':_0x469443[_0x26ce43(0x1d8)],'created':_0x469443[_0x26ce43(0x1b6)],'is_resolved':_0x10132c[_0x26ce43(0x1be)]});});return _0x2f2785;}function _0x3099(_0x27a7ca,_0x5759ee){const _0x3e8c6a=_0x3e8c();return _0x3099=function(_0x30995b,_0x42ad40){_0x30995b=_0x30995b-0x1a2;let _0x213ad6=_0x3e8c6a[_0x30995b];return _0x213ad6;},_0x3099(_0x27a7ca,_0x5759ee);}export function getSuggestions(_0x53a3d6,_0x40ac19){const _0x5384d0=_0x3099,_0x268f07={};if(!_0x53a3d6[_0x5384d0(0x1d6)]||!_0x40ac19[_0x5384d0(0x1d6)])return _0x268f07;for(const _0x52e1ce of _0x53a3d6)_0x268f07[_0x52e1ce['id']]={'author':_0x40ac19[_0x5384d0(0x1d1)](_0x52e1ce[_0x5384d0(0x1c4)])[_0x5384d0(0x1c7)],'created':_0x52e1ce[_0x5384d0(0x1b6)]};return _0x268f07;}
|