@ckeditor/ckeditor5-export-word 0.0.0-internal-20241017.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/CHANGELOG.md +4 -0
- package/LICENSE.md +18 -0
- package/README.md +45 -0
- package/build/export-word.js +5 -0
- package/build/translations/ar.js +1 -0
- package/build/translations/bg.js +1 -0
- package/build/translations/bn.js +1 -0
- package/build/translations/ca.js +1 -0
- package/build/translations/cs.js +1 -0
- package/build/translations/da.js +1 -0
- package/build/translations/de.js +1 -0
- package/build/translations/el.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/es.js +1 -0
- package/build/translations/et.js +1 -0
- package/build/translations/fi.js +1 -0
- package/build/translations/fr.js +1 -0
- package/build/translations/gl.js +1 -0
- package/build/translations/he.js +1 -0
- package/build/translations/hi.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/hu.js +1 -0
- package/build/translations/id.js +1 -0
- package/build/translations/it.js +1 -0
- package/build/translations/ja.js +1 -0
- package/build/translations/jv.js +1 -0
- package/build/translations/ko.js +1 -0
- package/build/translations/lt.js +1 -0
- package/build/translations/lv.js +1 -0
- package/build/translations/ms.js +1 -0
- package/build/translations/nl.js +1 -0
- package/build/translations/no.js +1 -0
- package/build/translations/pl.js +1 -0
- package/build/translations/pt-br.js +1 -0
- package/build/translations/pt.js +1 -0
- package/build/translations/ro.js +1 -0
- package/build/translations/ru.js +1 -0
- package/build/translations/sk.js +1 -0
- package/build/translations/sr-latn.js +1 -0
- package/build/translations/sr.js +1 -0
- package/build/translations/sv.js +1 -0
- package/build/translations/th.js +1 -0
- package/build/translations/tr.js +1 -0
- package/build/translations/ug.js +1 -0
- package/build/translations/uk.js +1 -0
- package/build/translations/ur.js +1 -0
- package/build/translations/vi.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +21 -0
- package/dist/augmentation.d.ts +25 -0
- package/dist/exportword.d.ts +340 -0
- package/dist/exportwordcommand.d.ts +40 -0
- package/dist/exportwordui.d.ts +35 -0
- package/dist/index-content.css +4 -0
- package/dist/index-editor.css +4 -0
- package/dist/index.css +4 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +23 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +23 -0
- package/dist/translations/ar.umd.js +23 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +23 -0
- package/dist/translations/bg.umd.js +23 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +23 -0
- package/dist/translations/bn.umd.js +23 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +23 -0
- package/dist/translations/ca.umd.js +23 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +23 -0
- package/dist/translations/cs.umd.js +23 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +23 -0
- package/dist/translations/da.umd.js +23 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +23 -0
- package/dist/translations/de.umd.js +23 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +23 -0
- package/dist/translations/el.umd.js +23 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +23 -0
- package/dist/translations/en-au.umd.js +23 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +23 -0
- package/dist/translations/en.umd.js +23 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +23 -0
- package/dist/translations/es.umd.js +23 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +23 -0
- package/dist/translations/et.umd.js +23 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +23 -0
- package/dist/translations/fi.umd.js +23 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +23 -0
- package/dist/translations/fr.umd.js +23 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +23 -0
- package/dist/translations/gl.umd.js +23 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +23 -0
- package/dist/translations/he.umd.js +23 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +23 -0
- package/dist/translations/hi.umd.js +23 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +23 -0
- package/dist/translations/hr.umd.js +23 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +23 -0
- package/dist/translations/hu.umd.js +23 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +23 -0
- package/dist/translations/id.umd.js +23 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +23 -0
- package/dist/translations/it.umd.js +23 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +23 -0
- package/dist/translations/ja.umd.js +23 -0
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +23 -0
- package/dist/translations/jv.umd.js +23 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +23 -0
- package/dist/translations/ko.umd.js +23 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +23 -0
- package/dist/translations/lt.umd.js +23 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +23 -0
- package/dist/translations/lv.umd.js +23 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +23 -0
- package/dist/translations/ms.umd.js +23 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +23 -0
- package/dist/translations/nl.umd.js +23 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +23 -0
- package/dist/translations/no.umd.js +23 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +23 -0
- package/dist/translations/pl.umd.js +23 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +23 -0
- package/dist/translations/pt-br.umd.js +23 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +23 -0
- package/dist/translations/pt.umd.js +23 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +23 -0
- package/dist/translations/ro.umd.js +23 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +23 -0
- package/dist/translations/ru.umd.js +23 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +23 -0
- package/dist/translations/sk.umd.js +23 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +23 -0
- package/dist/translations/sr-latn.umd.js +23 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +23 -0
- package/dist/translations/sr.umd.js +23 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +23 -0
- package/dist/translations/sv.umd.js +23 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +23 -0
- package/dist/translations/th.umd.js +23 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +23 -0
- package/dist/translations/tr.umd.js +23 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +23 -0
- package/dist/translations/ug.umd.js +23 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +23 -0
- package/dist/translations/uk.umd.js +23 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +23 -0
- package/dist/translations/ur.umd.js +23 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +23 -0
- package/dist/translations/vi.umd.js +23 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +23 -0
- package/dist/translations/zh-cn.umd.js +23 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +23 -0
- package/dist/translations/zh.umd.js +23 -0
- package/dist/utils/common-translations.d.ts +13 -0
- package/dist/utils.d.ts +62 -0
- package/lang/contexts.json +8 -0
- package/lang/translations/ar.po +42 -0
- package/lang/translations/bg.po +42 -0
- package/lang/translations/bn.po +42 -0
- package/lang/translations/ca.po +42 -0
- package/lang/translations/cs.po +42 -0
- package/lang/translations/da.po +42 -0
- package/lang/translations/de.po +42 -0
- package/lang/translations/el.po +42 -0
- package/lang/translations/en-au.po +42 -0
- package/lang/translations/en.po +42 -0
- package/lang/translations/es.po +42 -0
- package/lang/translations/et.po +42 -0
- package/lang/translations/fi.po +42 -0
- package/lang/translations/fr.po +42 -0
- package/lang/translations/gl.po +42 -0
- package/lang/translations/he.po +42 -0
- package/lang/translations/hi.po +42 -0
- package/lang/translations/hr.po +42 -0
- package/lang/translations/hu.po +42 -0
- package/lang/translations/id.po +42 -0
- package/lang/translations/it.po +42 -0
- package/lang/translations/ja.po +42 -0
- package/lang/translations/jv.po +42 -0
- package/lang/translations/ko.po +42 -0
- package/lang/translations/lt.po +42 -0
- package/lang/translations/lv.po +42 -0
- package/lang/translations/ms.po +42 -0
- package/lang/translations/nl.po +42 -0
- package/lang/translations/no.po +42 -0
- package/lang/translations/pl.po +42 -0
- package/lang/translations/pt-br.po +42 -0
- package/lang/translations/pt.po +42 -0
- package/lang/translations/ro.po +42 -0
- package/lang/translations/ru.po +42 -0
- package/lang/translations/sk.po +42 -0
- package/lang/translations/sr-latn.po +42 -0
- package/lang/translations/sr.po +42 -0
- package/lang/translations/sv.po +42 -0
- package/lang/translations/th.po +42 -0
- package/lang/translations/tr.po +42 -0
- package/lang/translations/ug.po +42 -0
- package/lang/translations/uk.po +42 -0
- package/lang/translations/ur.po +42 -0
- package/lang/translations/vi.po +42 -0
- package/lang/translations/zh-cn.po +42 -0
- package/lang/translations/zh.po +42 -0
- package/package.json +54 -0
- package/src/augmentation.d.ts +21 -0
- package/src/augmentation.js +23 -0
- package/src/exportword.d.ts +336 -0
- package/src/exportword.js +23 -0
- package/src/exportwordcommand.d.ts +36 -0
- package/src/exportwordcommand.js +23 -0
- package/src/exportwordui.d.ts +31 -0
- package/src/exportwordui.js +23 -0
- package/src/index.d.ts +10 -0
- package/src/index.js +23 -0
- package/src/utils/common-translations.d.ts +9 -0
- package/src/utils/common-translations.js +23 -0
- package/src/utils.d.ts +58 -0
- package/src/utils.js +23 -0
- package/theme/icons/exportword.svg +1 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module export-word/exportword
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import { Notification } from 'ckeditor5/src/ui.js';
|
|
15
|
+
import type { InitializedToken, TokenUrl } from '@ckeditor/ckeditor5-cloud-services';
|
|
16
|
+
import ExportWordUI from './exportwordui.js';
|
|
17
|
+
/**
|
|
18
|
+
* The export to Word feature.
|
|
19
|
+
*
|
|
20
|
+
* It allows you to generate a Word file directly from the editor content.
|
|
21
|
+
*
|
|
22
|
+
* For a detailed overview, check the {@glink features/converters/export-word export to Word} feature documentation.
|
|
23
|
+
*/
|
|
24
|
+
export default class ExportWord extends Plugin {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName(): "ExportWord";
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get isOfficialPlugin(): true;
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
static get isPremiumPlugin(): true;
|
|
37
|
+
/**
|
|
38
|
+
* @inheritDoc
|
|
39
|
+
*/
|
|
40
|
+
static get requires(): readonly ["CloudServices", typeof Notification, typeof ExportWordUI];
|
|
41
|
+
/**
|
|
42
|
+
* @inheritDoc
|
|
43
|
+
*/
|
|
44
|
+
init(): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The configuration of the export to Word feature. It is used by the Word export features from
|
|
48
|
+
* the `@ckeditor/ckeditor5-export-word` package.
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* ClassicEditor
|
|
52
|
+
* .create( editorElement, {
|
|
53
|
+
* exportWord: ... // Export to Word feature options.
|
|
54
|
+
* } )
|
|
55
|
+
* .then( ... )
|
|
56
|
+
* .catch( ... );
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
60
|
+
*/
|
|
61
|
+
export interface ExportWordConfig {
|
|
62
|
+
/**
|
|
63
|
+
* Paths to the `.css` files containing additional styling for the editor's content (**the order of provided items matters**).
|
|
64
|
+
*
|
|
65
|
+
* ```ts
|
|
66
|
+
* const exportWordConfig = {
|
|
67
|
+
* stylesheets: [ './path/to/custom-style.css' ]
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* **Default editor's content styles**:
|
|
72
|
+
* {@glink getting-started/setup/css The default editor content styles}
|
|
73
|
+
* are applied to the generated Word file thanks to the `'EDITOR_STYLES'` token, which is provided to the `stylesheets` by default.
|
|
74
|
+
* If you don't want them to be applied, you have to omit the token:
|
|
75
|
+
*
|
|
76
|
+
* **NOTE:** The `'EDITOR_STYLES'` string is only supported in legacy custom builds with webpack or DLLs.
|
|
77
|
+
* In other setups you always need to pass the stylesheets.
|
|
78
|
+
*
|
|
79
|
+
* ```ts
|
|
80
|
+
* const exportWordConfig = {
|
|
81
|
+
* stylesheets: [ './path/to/custom-editor-styles.css' ]
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* **Custom styling:** For more advanced styling, your configuration should look like this:
|
|
86
|
+
*
|
|
87
|
+
* ```ts
|
|
88
|
+
* const exportWordConfig = {
|
|
89
|
+
* stylesheets: [
|
|
90
|
+
* './path/to/editor-styles.css',
|
|
91
|
+
* './path/to/custom-styles.css'
|
|
92
|
+
* ]
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @default `[ 'EDITOR_STYLES' ]`
|
|
97
|
+
*/
|
|
98
|
+
stylesheets?: Array<string>;
|
|
99
|
+
/**
|
|
100
|
+
* The name of the generated Word file.
|
|
101
|
+
*
|
|
102
|
+
* ```ts
|
|
103
|
+
* // Static file name.
|
|
104
|
+
* const exportWordConfig = {
|
|
105
|
+
* fileName: 'my-document.docx'
|
|
106
|
+
* }
|
|
107
|
+
*
|
|
108
|
+
*
|
|
109
|
+
* // Dynamic file name.
|
|
110
|
+
* const exportWordConfig = {
|
|
111
|
+
* fileName: () => {
|
|
112
|
+
* const articleTitle = document.querySelector( '#title' );
|
|
113
|
+
*
|
|
114
|
+
* return `${ articleTitle.value }.docx`;
|
|
115
|
+
* }
|
|
116
|
+
* }
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* **NOTE:** The file name must contain the `.docx` extension.
|
|
120
|
+
* Otherwise your operating system or device may have trouble identifying the file type.
|
|
121
|
+
*
|
|
122
|
+
* @default 'document.docx'
|
|
123
|
+
*/
|
|
124
|
+
fileName?: string | (() => string);
|
|
125
|
+
/**
|
|
126
|
+
* A URL to the Docx converter.
|
|
127
|
+
*
|
|
128
|
+
* ```ts
|
|
129
|
+
* const exportWordConfig = {
|
|
130
|
+
* converterUrl: 'https://myconverter.com/v2/'
|
|
131
|
+
* }
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* **NOTE:** The plugin uses the default HTML to Word converter delivered by CKEditor Cloud Services.
|
|
135
|
+
* You can provide a URL to an on-premises converter instead.
|
|
136
|
+
*
|
|
137
|
+
* @default 'https://docx-converter.cke-cs.com/v2/convert/html-docx'
|
|
138
|
+
*/
|
|
139
|
+
converterUrl?: string;
|
|
140
|
+
/**
|
|
141
|
+
* The CKEditor Cloud Services HTML to DOCX Converter [configuration options](https://docx-converter.cke-cs.com/docs#section/Options).
|
|
142
|
+
*
|
|
143
|
+
* **NOTE:** Configuring the plugin is not mandatory.
|
|
144
|
+
*
|
|
145
|
+
* ```ts
|
|
146
|
+
* const exportWordConfig = {
|
|
147
|
+
* converterOptions: {
|
|
148
|
+
* ...
|
|
149
|
+
* }
|
|
150
|
+
* }
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @default `{
|
|
154
|
+
* document: {
|
|
155
|
+
* size: 'A4',
|
|
156
|
+
* orientation: 'portrait',
|
|
157
|
+
* language: editor.locale.contentLanguage,
|
|
158
|
+
* margin: {
|
|
159
|
+
* top: '1in',
|
|
160
|
+
* bottom: '1in',
|
|
161
|
+
* right: '1in',
|
|
162
|
+
* left: '1in'
|
|
163
|
+
* }
|
|
164
|
+
* }
|
|
165
|
+
* headers: undefined,
|
|
166
|
+
* footers: undefined,
|
|
167
|
+
* auto_pagination: false,
|
|
168
|
+
* base_url: undefined,
|
|
169
|
+
* extra_http_headers: undefined
|
|
170
|
+
* }`
|
|
171
|
+
*/
|
|
172
|
+
converterOptions?: ExportWordConverterOptions | ExportWordConverterOptionsV2;
|
|
173
|
+
/**
|
|
174
|
+
* A function to gather the HTML to be converted to Word.
|
|
175
|
+
*
|
|
176
|
+
* **NOTE:** This option may be useful when the editor does not have a `getData()` method,
|
|
177
|
+
* or if the HTML to be converted should be different than the edited one.
|
|
178
|
+
*
|
|
179
|
+
* ```ts
|
|
180
|
+
* const exportWordConfig = {
|
|
181
|
+
* dataCallback: ( editor ) => {
|
|
182
|
+
* return `
|
|
183
|
+
* <header id="header">${ editor.data.get( { rootName: 'header' } ) }</header>
|
|
184
|
+
* <div id="content">${ editor.data.get( { rootName: 'content' } ) }</div>
|
|
185
|
+
* `;
|
|
186
|
+
* }
|
|
187
|
+
* }
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
* @default `( editor ) => editor.getData( { pagination: true } )
|
|
191
|
+
*
|
|
192
|
+
* If using the {@glink features/pagination/pagination pagination} feature, the `pagination:true` option inserts additional markers into
|
|
193
|
+
* editor's data. Thanks to that, the Docx converter creates a Word document similar to what is displayed in the editor.
|
|
194
|
+
*/
|
|
195
|
+
dataCallback?: (editor: Editor) => string;
|
|
196
|
+
/**
|
|
197
|
+
* A token URL or a token request function. This field is optional and should be used only when a different `tokenUrl` is required for
|
|
198
|
+
* the export to Word feature.
|
|
199
|
+
*
|
|
200
|
+
* **Note:** The token can be disabled with the `false` value provided.
|
|
201
|
+
*
|
|
202
|
+
* See: {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl}
|
|
203
|
+
*/
|
|
204
|
+
tokenUrl?: TokenUrl | false;
|
|
205
|
+
/**
|
|
206
|
+
* The authentication token.
|
|
207
|
+
*
|
|
208
|
+
* See: {@link module:cloud-services/cloudservices~CloudServices#token}
|
|
209
|
+
*/
|
|
210
|
+
token?: InitializedToken;
|
|
211
|
+
/**
|
|
212
|
+
* The version of `Export to Word` API.
|
|
213
|
+
*
|
|
214
|
+
* @default '2'
|
|
215
|
+
*/
|
|
216
|
+
version?: 1 | 2;
|
|
217
|
+
}
|
|
218
|
+
export type ExportWordConverterOptions = {
|
|
219
|
+
format?: ExportWordConverterFormatOption;
|
|
220
|
+
margin_top?: string;
|
|
221
|
+
margin_bottom?: string;
|
|
222
|
+
margin_right?: string;
|
|
223
|
+
margin_left?: string;
|
|
224
|
+
header?: ExportWordConverterHeaderFooterOption;
|
|
225
|
+
footer?: ExportWordConverterHeaderFooterOption;
|
|
226
|
+
comments?: ExportWordConverterCommentsOption;
|
|
227
|
+
suggestions?: ExportWordConverterSuggestionsOption;
|
|
228
|
+
orientation?: ExportWordConverterOrientationOption;
|
|
229
|
+
auto_pagination?: boolean;
|
|
230
|
+
base_url?: string;
|
|
231
|
+
};
|
|
232
|
+
export type ExportWordConverterFormatOption = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5' | string & Record<never, never>;
|
|
233
|
+
export type ExportWordConverterOrientationOption = 'portrait' | 'landscape' | string & Record<never, never>;
|
|
234
|
+
export type ExportWordConverterHeaderFooterOption = Array<{
|
|
235
|
+
html?: string;
|
|
236
|
+
css?: string;
|
|
237
|
+
type?: 'default' | 'even' | 'odd' | 'first' | string & Record<never, never>;
|
|
238
|
+
}>;
|
|
239
|
+
export type ExportWordConverterCommentsOption = {
|
|
240
|
+
[id: string]: Array<{
|
|
241
|
+
author: string;
|
|
242
|
+
created: Date;
|
|
243
|
+
content?: string;
|
|
244
|
+
is_resolved: boolean;
|
|
245
|
+
}>;
|
|
246
|
+
};
|
|
247
|
+
export type ExportWordConverterSuggestionsOption = {
|
|
248
|
+
[id: string]: {
|
|
249
|
+
author: string;
|
|
250
|
+
created: Date | null;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
export type ExportWordConverterOptionsV2 = {
|
|
254
|
+
document?: ExportWordConverterDocumentOptionsV2;
|
|
255
|
+
headers?: ExportWordConverterHeaderFooterOptionsV2;
|
|
256
|
+
footers?: ExportWordConverterHeaderFooterOptionsV2;
|
|
257
|
+
extra_http_headers?: ExportWordConverterExtraHttpHeaders;
|
|
258
|
+
base_url?: string;
|
|
259
|
+
auto_pagination?: boolean;
|
|
260
|
+
watermark?: ExportWordConverterWatermarkV2;
|
|
261
|
+
};
|
|
262
|
+
export type ExportWordConverterDocumentOptionsV2 = {
|
|
263
|
+
margins?: ExportWordConverterMarginsOptionsV2;
|
|
264
|
+
size?: ExportWordConverterFormatOptionsV2;
|
|
265
|
+
orientation?: ExportWordConverterOrientationOptionsV2;
|
|
266
|
+
language?: string;
|
|
267
|
+
};
|
|
268
|
+
export type ExportWordConverterMarginsOptionsV2 = {
|
|
269
|
+
top?: string;
|
|
270
|
+
right?: string;
|
|
271
|
+
bottom?: string;
|
|
272
|
+
left?: string;
|
|
273
|
+
};
|
|
274
|
+
export type ExportWordConverterHeaderFooterOptionsV2 = {
|
|
275
|
+
first?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
276
|
+
odd?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
277
|
+
even?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
278
|
+
default?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
279
|
+
};
|
|
280
|
+
export type ExportWordConverterWatermarkV2 = {
|
|
281
|
+
source?: string;
|
|
282
|
+
width?: string;
|
|
283
|
+
height?: string;
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* If fetching some resources (e.g. images) used in a generated Word requires passing an additional
|
|
287
|
+
* authorization factor in the form of additional HTTP headers:
|
|
288
|
+
*
|
|
289
|
+
* ```
|
|
290
|
+
* extra_http_headers: {
|
|
291
|
+
* 'https://ckeditor.com': {
|
|
292
|
+
* authorization: 'Bearer xxx'
|
|
293
|
+
* },
|
|
294
|
+
* 'https://example.com': {
|
|
295
|
+
* authorization: 'Bearer xxx'
|
|
296
|
+
* },
|
|
297
|
+
* }
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
300
|
+
export type ExportWordConverterExtraHttpHeaders = {
|
|
301
|
+
[domain: string]: ExportWordConverterExtraHttpHeadersHeader;
|
|
302
|
+
};
|
|
303
|
+
export type ExportWordConverterExtraHttpHeadersHeader = {
|
|
304
|
+
[header: string]: string;
|
|
305
|
+
};
|
|
306
|
+
export type ExportWordConverterHeaderFooterItemOptionsV2 = {
|
|
307
|
+
html?: string;
|
|
308
|
+
css?: string;
|
|
309
|
+
};
|
|
310
|
+
export type ExportWordConverterOrientationOptionsV2 = 'portrait' | 'landscape' | string & Record<never, never>;
|
|
311
|
+
export type ExportWordConverterFormatOptionsV2 = ExportWordConverterPredifinedFormatOptionsV2 | ExportWordConverterCustomFormatOptionsV2;
|
|
312
|
+
export type ExportWordConverterPredifinedFormatOptionsV2 = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5' | string & Record<never, never>;
|
|
313
|
+
export type ExportWordConverterCustomFormatOptionsV2 = {
|
|
314
|
+
width?: string;
|
|
315
|
+
height?: string;
|
|
316
|
+
};
|
|
317
|
+
export type ExportWordConverterCollaborationFeaturesOptionsV2 = {
|
|
318
|
+
comment_threads?: ExportWordConverterCommentsThreadOptionsV2;
|
|
319
|
+
suggestions?: ExportWordConverterSuggestionsOptionsV2;
|
|
320
|
+
};
|
|
321
|
+
export type ExportWordConverterCommentsThreadOptionsV2 = Array<{
|
|
322
|
+
thread_id: string;
|
|
323
|
+
is_resolved: boolean;
|
|
324
|
+
comments: ExportWordConverterCommentsV2;
|
|
325
|
+
}>;
|
|
326
|
+
export type ExportWordConverterCommentsV2 = Array<{
|
|
327
|
+
author: string;
|
|
328
|
+
created_at: Date;
|
|
329
|
+
content: string;
|
|
330
|
+
}>;
|
|
331
|
+
export type ExportWordConverterSuggestionsOptionsV2 = Array<{
|
|
332
|
+
id: string;
|
|
333
|
+
author: string;
|
|
334
|
+
created_at: Date | null;
|
|
335
|
+
}>;
|
|
336
|
+
export type ExportWordConverterMergeFieldsOptionsV2 = {
|
|
337
|
+
prefix: string;
|
|
338
|
+
suffix: string;
|
|
339
|
+
data?: Record<string, string>;
|
|
340
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module export-word/exportwordcommand
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import type { ExportWordConfig } from './exportword.js';
|
|
15
|
+
/**
|
|
16
|
+
* The export to Word command.
|
|
17
|
+
*
|
|
18
|
+
* It takes the editor's HTML and CSS rules from the document and sends them to the HTML to Word converter.
|
|
19
|
+
* After processing, the converter will send back a Word file for download.
|
|
20
|
+
*/
|
|
21
|
+
export default class ExportWordCommand extends Command {
|
|
22
|
+
/**
|
|
23
|
+
* A command state that indicates if the command is currently executing.
|
|
24
|
+
*
|
|
25
|
+
* @observable
|
|
26
|
+
*/
|
|
27
|
+
isBusy: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
constructor(editor: Editor);
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
refresh(): void;
|
|
36
|
+
/**
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
execute(options?: ExportWordConfig): Promise<void>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module export-word/exportwordui
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The export to Word UI feature.
|
|
15
|
+
*
|
|
16
|
+
* It introduces 'Export to Word' button in toolbar and menu bar.
|
|
17
|
+
*/
|
|
18
|
+
export default class ExportWordUI extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName(): "ExportWordUI";
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get isOfficialPlugin(): true;
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get isPremiumPlugin(): true;
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
init(): void;
|
|
35
|
+
}
|
package/dist/index.css
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module export-word
|
|
11
|
+
*/
|
|
12
|
+
export { default as ExportWord, type ExportWordConfig } from './exportword.js';
|
|
13
|
+
export type { default as ExportWordCommand } from './exportwordcommand.js';
|
|
14
|
+
import './augmentation.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
import{Command as _0x122323,Plugin as _0x1f0540}from'@ckeditor/ckeditor5-core/dist/index.js';import{ButtonView as _0x31ff5c,MenuBarMenuListItemButtonView as _0x27a175,SpinnerView as _0x3d617c,Notification as _0x107932}from'@ckeditor/ckeditor5-ui/dist/index.js';import{logWarning as _0x384a23}from'@ckeditor/ckeditor5-utils/dist/index.js';function f(){const _0x3c537a=[],_0xcaf0d4=[];for(const _0xc44cbe of Array['from'](document['styleSheets'])){if(_0xc44cbe['ownerNode']['hasAttribute']('data-cke')){for(const _0x181858 of Array['from'](_0xc44cbe['cssRules']))-0x1!==_0x181858['cssText']['indexOf']('.ck-content')?_0x3c537a['push'](_0x181858['cssText']):-0x1!==_0x181858['cssText']['indexOf'](':root')&&_0xcaf0d4['push'](_0x181858['cssText']);}}return _0x3c537a['length']||console['warn']('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.'),[..._0xcaf0d4,..._0x3c537a]['join']('\x20')['trim']();}function a(_0xf55380,_0x2aa622={}){const _0x604c20=_0xf55380['plugins']['has']('Users'),_0x3c30aa=_0xf55380['plugins']['has']('CommentsRepository'),_0x33a399=_0xf55380['plugins']['has']('TrackChanges'),_0x44e7d8=_0x2aa622;if(_0x604c20&&_0x3c30aa){const _0x1dbe1e=function(_0x354cff){const _0x363e7b={};if(!_0x354cff['length'])return _0x363e7b;for(const _0x4ece99 of _0x354cff)_0x4ece99['comments']['map'](_0x54b1ce=>{void 0x0===_0x363e7b[_0x4ece99['id']]&&(_0x363e7b[_0x4ece99['id']]=[]),_0x363e7b[_0x4ece99['id']]['push']({'author':_0x54b1ce['author']['name'],'content':_0x54b1ce['content'],'created':_0x54b1ce['createdAt'],'is_resolved':_0x4ece99['isResolved']});});return _0x363e7b;}(_0xf55380['plugins']['get']('CommentsRepository')['getCommentThreads']({'skipNotAttached':!0x0,'skipEmpty':!0x0}));Object['keys'](_0x1dbe1e)['length']&&(_0x44e7d8['comments']=_0x1dbe1e);}if(_0x604c20&&_0x33a399){const _0x407a2b=_0xf55380['plugins']['get']('TrackChanges'),_0x5e4dc8=_0xf55380['plugins']['get']('Users'),_0xc3fce8=function(_0x9920f0,_0x429a42){const _0x59ed99={};if(!_0x9920f0['length']||!_0x429a42['length'])return _0x59ed99;for(const {id:_0x3f3dfe,createdAt:_0xabb842,authorId:_0x1d02da,attributes:_0x4c4df0}of _0x9920f0){const _0x7733ad=_0x4c4df0&&_0x4c4df0['@external'],_0x1f60b8=_0x7733ad?_0x7733ad['authorName']:_0x429a42['get'](_0x1d02da)['name'];_0x59ed99[_0x3f3dfe]={'author':_0x1f60b8,'created':_0xabb842};}return _0x59ed99;}(_0x407a2b['getSuggestions']({'toJSON':!0x0}),_0x5e4dc8['users']);Object['keys'](_0xc3fce8)['length']&&(_0x44e7d8['suggestions']=_0xc3fce8);}return(_0x44e7d8['suggestions']||_0x44e7d8['comments'])&&(_0x44e7d8['timezone']=new Intl['DateTimeFormat']()['resolvedOptions']()['timeZone']),_0x44e7d8;}function m(_0x52ec56,_0x13b54b={}){const _0x4ca791=_0x52ec56['plugins']['has']('Users'),_0x13c012=_0x52ec56['plugins']['has']('CommentsRepository'),_0x237496=_0x52ec56['plugins']['has']('TrackChanges'),_0x424afa=_0x52ec56['plugins']['has']('MergeFields'),_0x4c48be=_0x52ec56['locale']['contentLanguage'],_0x4fb187=_0x13b54b,_0x3fbf33={};if(_0x4fb187['document']=_0x4fb187['document']||{},_0x4fb187['document']['language']=_0x4fb187['document']['language']||_0x4c48be,_0x4ca791&&_0x13c012){const _0x179380=function(_0x487aa4){const _0x48c296=[];if(!_0x487aa4['length'])return _0x48c296;for(const _0x6b93f6 of _0x487aa4){const _0x4334cd=_0x6b93f6['comments']['map'](_0x2eadef=>({'author':_0x2eadef['author']['name'],'content':_0x2eadef['content'],'created_at':_0x2eadef['createdAt']}));_0x48c296['push']({'thread_id':_0x6b93f6['id'],'is_resolved':_0x6b93f6['isResolved'],'comments':_0x4334cd});}return _0x48c296;}(_0x52ec56['plugins']['get']('CommentsRepository')['getCommentThreads']({'skipNotAttached':!0x0,'skipEmpty':!0x0}));_0x179380['length']&&(_0x3fbf33['comment_threads']=_0x179380);}if(_0x4ca791&&_0x237496){const _0x1d7306=_0x52ec56['plugins']['get']('TrackChanges'),_0x1b359b=_0x52ec56['plugins']['get']('Users'),_0x42c619=function(_0x3d9c30,_0x42d3ad){if(!_0x3d9c30['length']||!_0x42d3ad['length'])return[];return _0x3d9c30['map'](({id:_0x2ca21d,createdAt:_0x2f078c,authorId:_0x1e5bd7,attributes:_0x190918})=>{const _0x3b0768=_0x190918&&_0x190918['@external'];return{'id':_0x2ca21d,'author':_0x3b0768?_0x3b0768['authorName']:_0x42d3ad['get'](_0x1e5bd7)['name'],'created_at':_0x2f078c};});}(_0x1d7306['getSuggestions']({'toJSON':!0x0}),_0x1b359b['users']);_0x42c619['length']&&(_0x3fbf33['suggestions']=_0x42c619);}if(_0x424afa){const _0x23cd36=_0x52ec56['plugins']['get']('MergeFieldsEditing'),_0x116c0f=_0x23cd36['previewMode'],{prefix:_0x36dfdc,suffix:_0x437718}=_0x52ec56['config']['get']('mergeFields');if(_0x4fb187['merge_fields']={'prefix':_0x36dfdc,'suffix':_0x437718},'$labels'!==_0x116c0f){_0x4fb187['merge_fields']['data']={};const _0x4eca35='$defaultValues'===_0x116c0f?_0x23cd36['getDefaultValues']():_0x23cd36['getDataSetValues'](_0x116c0f,!0x0);for(const _0x3fc15c of Object['entries'](_0x4eca35)){const [_0x7ffa,_0x26cc13]=_0x3fc15c;_0x4fb187['merge_fields']['data'][_0x7ffa]=null!==_0x26cc13?_0x26cc13:_0x23cd36['getLabel'](_0x7ffa);}}}return(_0x3fbf33['comment_threads']||_0x3fbf33['suggestions'])&&(_0x4fb187['timezone']=new Intl['DateTimeFormat']()['resolvedOptions']()['timeZone'],_0x4fb187['collaboration_features']=_0x3fbf33),_0x4fb187;}function p(_0x2be6ac,_0x5c4f51){const t=_0x2be6ac['t'];switch(_0x5c4f51){case'Export\x20to\x20Word':return t('Export\x20to\x20Word');case'An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.':return t('An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.');case'Word\x20document\x20export\x20started':return t('Word\x20document\x20export\x20started');case'Word\x20document\x20export\x20failed':return t('Word\x20document\x20export\x20failed');case'Word\x20document\x20export\x20successful':return t('Word\x20document\x20export\x20successful');case'Exporting\x20Word\x20document':return t('Exporting\x20Word\x20document');default:return _0x5c4f51;}}const h=['orientation','margin_top','margin_right','margin_bottom','margin_left','format','header','footer','comments','suggestions'];class e extends _0x122323{constructor(_0x14e1d0){super(_0x14e1d0),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x12a1bc={}){const _0x32bb45=this['editor'],_0x5bd3a8=_0x12a1bc['version']||0x2,_0x5d9e3e=0x1===_0x5bd3a8,_0x140c58=_0x12a1bc['converterUrl']||(_0x5d9e3e?'https://docx-converter.cke-cs.com/v1/convert':'https://docx-converter.cke-cs.com/v2/convert/html-docx'),_0x2f81a5=_0x12a1bc['converterOptions']||{},_0x48e2ad=_0x32bb45['plugins']['get']('ExportWord'),_0x1a2611=_0x12a1bc['token']||_0x48e2ad['_token'],_0x3c30bc=!0x0===_0x2f81a5['auto_pagination'],_0x3355a4=_0x12a1bc['dataCallback']||(_0x4b8b15=>_0x4b8b15['data']['get']({'pagination':_0x3c30bc}));return 0x2===_0x5bd3a8&&function(_0x64e3b){for(const _0x420165 of h)if(void 0x0!==_0x64e3b[_0x420165])return!0x0;return!0x1;}(_0x2f81a5)&&_0x384a23('export-word-v1-api-is-deprecated'),this['isBusy']=!0x0,this['refresh'](),function(_0x5a2d6d){if(!_0x5a2d6d)return new Promise(_0x535a9b=>_0x535a9b(''));const _0x5c2549=[];for(const _0x15b485 of _0x5a2d6d)'EDITOR_STYLES'!==_0x15b485?_0x5c2549['push'](window['fetch'](_0x15b485)['then'](_0x848a26=>_0x848a26['text']())):_0x5c2549['push'](f());return Promise['all'](_0x5c2549)['then'](_0x3182d3=>_0x3182d3['join']('\x20')['trim']());}(_0x12a1bc['stylesheets']||['EDITOR_STYLES'])['then'](async _0x465e3c=>{_0x32bb45['ui']['ariaLiveAnnouncer']['announce'](p(_0x32bb45['locale'],'Word\x20document\x20export\x20started'));const _0x51eea4=await _0x3355a4(_0x32bb45),_0x212f20={'html':'<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x32bb45['locale']['contentLanguageDirection']+'\x22>'+_0x51eea4+'</div>','css':_0x465e3c,[_0x5d9e3e?'options':'config']:{..._0x2f81a5,..._0x5d9e3e?a(_0x32bb45,_0x2f81a5):m(_0x32bb45,_0x2f81a5)}},_0x18466e={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/docx',..._0x1a2611?{'Authorization':_0x1a2611['value']}:null},'body':JSON['stringify'](_0x212f20)};return window['fetch'](_0x140c58,_0x18466e)['then'](_0x1804e8=>{if(0xc8!==_0x1804e8['status'])throw _0x1804e8;return _0x1804e8['blob']();})['then'](_0x10239d=>{_0x32bb45['ui']['ariaLiveAnnouncer']['announce'](p(_0x32bb45['locale'],'Word\x20document\x20export\x20successful'));const _0x39a830='function'==typeof _0x12a1bc['fileName']?_0x12a1bc['fileName']():_0x12a1bc['fileName'];this['_downloadFile'](_0x10239d,_0x39a830||'document.docx');});})['catch'](_0x127d0e=>{const _0x2813d8=_0x32bb45['plugins']['get']('Notification');throw _0x32bb45['ui']['ariaLiveAnnouncer']['announce'](p(_0x32bb45['locale'],'Word\x20document\x20export\x20failed'),{'politeness':'assertive'}),_0x2813d8['showWarning'](p(_0x32bb45['locale'],'An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.')),_0x127d0e;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['_downloadFile'](_0xa472fc,_0x43cf3d){const _0x400363=document['createElement']('a');_0x400363['href']=window['URL']['createObjectURL'](_0xa472fc),_0x400363['download']=_0x43cf3d,_0x400363['click'](),_0x400363['remove']();}}class o extends _0x1f0540{static get['pluginName'](){return'ExportWordUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2e0e13=this['editor'];_0x2e0e13['ui']['componentFactory']['add']('exportWord',()=>{const _0x5175be=_0x2e0e13['commands']['get']('exportWord'),_0x5e0b88=this['_createButton'](_0x31ff5c);return _0x5e0b88['set']({'tooltip':!0x0}),_0x5e0b88['bind']('isOn')['to'](_0x5175be,'isBusy'),_0x5e0b88;}),_0x2e0e13['ui']['componentFactory']['add']('menuBar:exportWord',()=>this['_createButton'](_0x27a175));}['_createButton'](_0x5e375e){const _0x1396f2=this['editor'],_0x108264=_0x1396f2['config']['get']('exportWord')||{},_0x5caf12=_0x1396f2['commands']['get']('exportWord'),_0x2e3b6e=new _0x5e375e(_0x1396f2['locale']),_0x469e03=new _0x3d617c();return _0x2e3b6e['children']['add'](_0x469e03),_0x469e03['bind']('isVisible')['to'](_0x5caf12,'isBusy'),_0x2e3b6e['iconView']['bind']('isVisible')['to'](_0x5caf12,'isBusy',_0x1d7e63=>!_0x1d7e63),_0x2e3b6e['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M17.826\x2016.843a.75.75\x200\x200\x200-1.152-.96L15.5\x2017.29V12H14v5.29l-1.174-1.408a.75.75\x200\x200\x200-1.152.96l2.346\x202.816a.95.95\x200\x200\x200\x201.46\x200l2.346-2.815Z\x22/><path\x20d=\x22m14\x200\x205\x204.5v9.741a2.737\x202.737\x200\x200\x200-1.5-.617V6.5h-5v-5h-8v3H3V0h11Zm0\x202v3h3.3L14\x202Z\x22/><path\x20d=\x22M3\x2017.5h6.746c.1.22.23.429.391.623l.731.877H3v-1.5Z\x22/><path\x20d=\x22M8.5\x206a1.5\x201.5\x200\x200\x201\x201.493\x201.356L10\x207.5v7a1.5\x201.5\x200\x200\x201-1.356\x201.493L8.5\x2016h-7a1.5\x201.5\x200\x200\x201-1.493-1.356L0\x2014.5v-7a1.5\x201.5\x200\x200\x201\x201.356-1.493L1.5\x206h7ZM7.483\x208.795l-.042.088-.986\x202.534-.947-2.528-.043-.092a.601.601\x200\x200\x200-1.042.008l-.042.093-.883\x202.465-.937-2.475-.042-.089a.6.6\x200\x200\x200-1.107.42l.027.093\x201.514\x204\x20.044.092a.6.6\x200\x200\x200\x201.041-.01l.041-.092.88-2.458.925\x202.467.046.096a.6.6\x200\x200\x200\x201.032\x200l.043-.09\x201.554-4\x20.028-.093a.6.6\x200\x200\x200-1.104-.43v.001Z\x22/></svg>\x0a'}),_0x2e3b6e['bind']('isEnabled')['to'](_0x5caf12,'isEnabled'),_0x2e3b6e['bind']('label')['to'](_0x5caf12,'isBusy',_0xbe91e=>p(_0x1396f2['locale'],_0xbe91e?'Exporting\x20Word\x20document':'Export\x20to\x20Word')),this['listenTo'](_0x2e3b6e,'execute',()=>{_0x1396f2['execute']('exportWord',_0x108264),_0x1396f2['editing']['view']['focus']();}),_0x2e3b6e;}}class s extends _0x1f0540{['_token'];static get['pluginName'](){return'ExportWord';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return['CloudServices',_0x107932,o];}['init'](){const _0xae0a33=this['editor'],_0x2381d5=_0xae0a33['config']['get']('exportWord')||{};_0xae0a33['commands']['add']('exportWord',new e(_0xae0a33));const _0x3c77bf=_0xae0a33['plugins']['get']('CloudServices');!0x1===_0x2381d5['tokenUrl']?this['_token']=null:_0x2381d5['tokenUrl']?_0x3c77bf['registerTokenUrl'](_0x2381d5['tokenUrl'])['then'](_0x300549=>{this['_token']=_0x300549;}):this['_token']=_0x3c77bf['token'];}}export{s as ExportWord};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Translations } from '@ckeditor/ckeditor5-utils';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export default{'ar':{'dictionary':{'Export\x20to\x20Word':'تصدير\x20إلى\x20Word','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.':'حدث\x20خطأ\x20ما،\x20أثناء\x20استخراج\x20ملف\x20Word.','Word\x20document\x20export\x20started':'بدأ\x20تصدير\x20مستند\x20Word','Word\x20document\x20export\x20failed':'فشل\x20تصدير\x20مستند\x20Word','Word\x20document\x20export\x20successful':'تم\x20تصدير\x20مستند\x20Word\x20بنجاح','Exporting\x20Word\x20document':'تصدير\x20مستند\x20Word'},'getPluralForm':_0x237edc=>0x0==_0x237edc?0x0:0x1==_0x237edc?0x1:0x2==_0x237edc?0x2:_0x237edc%0x64>=0x3&&_0x237edc%0x64<=0xa?0x3:_0x237edc%0x64>=0xb&&_0x237edc%0x64<=0x63?0x4:0x5}};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
(_0x2950c6=>{const {ar:{dictionary:_0x3b892d,getPluralForm:_0x170eaf}}={'ar':{'dictionary':{'Export\x20to\x20Word':'تصدير\x20إلى\x20Word','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.':'حدث\x20خطأ\x20ما،\x20أثناء\x20استخراج\x20ملف\x20Word.','Word\x20document\x20export\x20started':'بدأ\x20تصدير\x20مستند\x20Word','Word\x20document\x20export\x20failed':'فشل\x20تصدير\x20مستند\x20Word','Word\x20document\x20export\x20successful':'تم\x20تصدير\x20مستند\x20Word\x20بنجاح','Exporting\x20Word\x20document':'تصدير\x20مستند\x20Word'},'getPluralForm':_0x274810=>0x0==_0x274810?0x0:0x1==_0x274810?0x1:0x2==_0x274810?0x2:_0x274810%0x64>=0x3&&_0x274810%0x64<=0xa?0x3:_0x274810%0x64>=0xb&&_0x274810%0x64<=0x63?0x4:0x5}};_0x2950c6['ar']||={'dictionary':{},'getPluralForm':null},_0x2950c6['ar']['dictionary']=Object['assign'](_0x2950c6['ar']['dictionary'],_0x3b892d),_0x2950c6['ar']['getPluralForm']=_0x170eaf;})(window['CKEDITOR_TRANSLATIONS']||={});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Translations } from '@ckeditor/ckeditor5-utils';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export default{'bg':{'dictionary':{'Export\x20to\x20Word':'Експорт\x20към\x20Word','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.':'Възникна\x20грешка\x20при\x20генериране\x20на\x20файл\x20в\x20Word.','Word\x20document\x20export\x20started':'Започнато\x20прехвърляне\x20на\x20документ\x20от\x20Word','Word\x20document\x20export\x20failed':'Неуспешно\x20прехвърляне\x20на\x20документ\x20от\x20Word','Word\x20document\x20export\x20successful':'Прехвърлянето\x20на\x20документ\x20от\x20Word\x20е\x20успешно','Exporting\x20Word\x20document':'Прехвърляне\x20на\x20документ\x20в\x20Word'},'getPluralForm':_0x444ab7=>0x1!=_0x444ab7}};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
(_0x22525a=>{const {bg:{dictionary:_0x2ccf54,getPluralForm:_0x219f6c}}={'bg':{'dictionary':{'Export\x20to\x20Word':'Експорт\x20към\x20Word','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.':'Възникна\x20грешка\x20при\x20генериране\x20на\x20файл\x20в\x20Word.','Word\x20document\x20export\x20started':'Започнато\x20прехвърляне\x20на\x20документ\x20от\x20Word','Word\x20document\x20export\x20failed':'Неуспешно\x20прехвърляне\x20на\x20документ\x20от\x20Word','Word\x20document\x20export\x20successful':'Прехвърлянето\x20на\x20документ\x20от\x20Word\x20е\x20успешно','Exporting\x20Word\x20document':'Прехвърляне\x20на\x20документ\x20в\x20Word'},'getPluralForm':_0x335508=>0x1!=_0x335508}};_0x22525a['bg']||={'dictionary':{},'getPluralForm':null},_0x22525a['bg']['dictionary']=Object['assign'](_0x22525a['bg']['dictionary'],_0x2ccf54),_0x22525a['bg']['getPluralForm']=_0x219f6c;})(window['CKEDITOR_TRANSLATIONS']||={});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Translations } from '@ckeditor/ckeditor5-utils';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|