@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,336 @@
|
|
|
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
|
+
* @module export-word/exportword
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
10
|
+
import { Notification } from 'ckeditor5/src/ui.js';
|
|
11
|
+
import type { InitializedToken, TokenUrl } from '@ckeditor/ckeditor5-cloud-services';
|
|
12
|
+
import ExportWordUI from './exportwordui.js';
|
|
13
|
+
/**
|
|
14
|
+
* The export to Word feature.
|
|
15
|
+
*
|
|
16
|
+
* It allows you to generate a Word file directly from the editor content.
|
|
17
|
+
*
|
|
18
|
+
* For a detailed overview, check the {@glink features/converters/export-word export to Word} feature documentation.
|
|
19
|
+
*/
|
|
20
|
+
export default class ExportWord extends Plugin {
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get pluginName(): "ExportWord";
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get isOfficialPlugin(): true;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get isPremiumPlugin(): true;
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
static get requires(): readonly ["CloudServices", typeof Notification, typeof ExportWordUI];
|
|
37
|
+
/**
|
|
38
|
+
* @inheritDoc
|
|
39
|
+
*/
|
|
40
|
+
init(): void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The configuration of the export to Word feature. It is used by the Word export features from
|
|
44
|
+
* the `@ckeditor/ckeditor5-export-word` package.
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* ClassicEditor
|
|
48
|
+
* .create( editorElement, {
|
|
49
|
+
* exportWord: ... // Export to Word feature options.
|
|
50
|
+
* } )
|
|
51
|
+
* .then( ... )
|
|
52
|
+
* .catch( ... );
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
56
|
+
*/
|
|
57
|
+
export interface ExportWordConfig {
|
|
58
|
+
/**
|
|
59
|
+
* Paths to the `.css` files containing additional styling for the editor's content (**the order of provided items matters**).
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* const exportWordConfig = {
|
|
63
|
+
* stylesheets: [ './path/to/custom-style.css' ]
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* **Default editor's content styles**:
|
|
68
|
+
* {@glink getting-started/setup/css The default editor content styles}
|
|
69
|
+
* are applied to the generated Word file thanks to the `'EDITOR_STYLES'` token, which is provided to the `stylesheets` by default.
|
|
70
|
+
* If you don't want them to be applied, you have to omit the token:
|
|
71
|
+
*
|
|
72
|
+
* **NOTE:** The `'EDITOR_STYLES'` string is only supported in legacy custom builds with webpack or DLLs.
|
|
73
|
+
* In other setups you always need to pass the stylesheets.
|
|
74
|
+
*
|
|
75
|
+
* ```ts
|
|
76
|
+
* const exportWordConfig = {
|
|
77
|
+
* stylesheets: [ './path/to/custom-editor-styles.css' ]
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* **Custom styling:** For more advanced styling, your configuration should look like this:
|
|
82
|
+
*
|
|
83
|
+
* ```ts
|
|
84
|
+
* const exportWordConfig = {
|
|
85
|
+
* stylesheets: [
|
|
86
|
+
* './path/to/editor-styles.css',
|
|
87
|
+
* './path/to/custom-styles.css'
|
|
88
|
+
* ]
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @default `[ 'EDITOR_STYLES' ]`
|
|
93
|
+
*/
|
|
94
|
+
stylesheets?: Array<string>;
|
|
95
|
+
/**
|
|
96
|
+
* The name of the generated Word file.
|
|
97
|
+
*
|
|
98
|
+
* ```ts
|
|
99
|
+
* // Static file name.
|
|
100
|
+
* const exportWordConfig = {
|
|
101
|
+
* fileName: 'my-document.docx'
|
|
102
|
+
* }
|
|
103
|
+
*
|
|
104
|
+
*
|
|
105
|
+
* // Dynamic file name.
|
|
106
|
+
* const exportWordConfig = {
|
|
107
|
+
* fileName: () => {
|
|
108
|
+
* const articleTitle = document.querySelector( '#title' );
|
|
109
|
+
*
|
|
110
|
+
* return `${ articleTitle.value }.docx`;
|
|
111
|
+
* }
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* **NOTE:** The file name must contain the `.docx` extension.
|
|
116
|
+
* Otherwise your operating system or device may have trouble identifying the file type.
|
|
117
|
+
*
|
|
118
|
+
* @default 'document.docx'
|
|
119
|
+
*/
|
|
120
|
+
fileName?: string | (() => string);
|
|
121
|
+
/**
|
|
122
|
+
* A URL to the Docx converter.
|
|
123
|
+
*
|
|
124
|
+
* ```ts
|
|
125
|
+
* const exportWordConfig = {
|
|
126
|
+
* converterUrl: 'https://myconverter.com/v2/'
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* **NOTE:** The plugin uses the default HTML to Word converter delivered by CKEditor Cloud Services.
|
|
131
|
+
* You can provide a URL to an on-premises converter instead.
|
|
132
|
+
*
|
|
133
|
+
* @default 'https://docx-converter.cke-cs.com/v2/convert/html-docx'
|
|
134
|
+
*/
|
|
135
|
+
converterUrl?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The CKEditor Cloud Services HTML to DOCX Converter [configuration options](https://docx-converter.cke-cs.com/docs#section/Options).
|
|
138
|
+
*
|
|
139
|
+
* **NOTE:** Configuring the plugin is not mandatory.
|
|
140
|
+
*
|
|
141
|
+
* ```ts
|
|
142
|
+
* const exportWordConfig = {
|
|
143
|
+
* converterOptions: {
|
|
144
|
+
* ...
|
|
145
|
+
* }
|
|
146
|
+
* }
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* @default `{
|
|
150
|
+
* document: {
|
|
151
|
+
* size: 'A4',
|
|
152
|
+
* orientation: 'portrait',
|
|
153
|
+
* language: editor.locale.contentLanguage,
|
|
154
|
+
* margin: {
|
|
155
|
+
* top: '1in',
|
|
156
|
+
* bottom: '1in',
|
|
157
|
+
* right: '1in',
|
|
158
|
+
* left: '1in'
|
|
159
|
+
* }
|
|
160
|
+
* }
|
|
161
|
+
* headers: undefined,
|
|
162
|
+
* footers: undefined,
|
|
163
|
+
* auto_pagination: false,
|
|
164
|
+
* base_url: undefined,
|
|
165
|
+
* extra_http_headers: undefined
|
|
166
|
+
* }`
|
|
167
|
+
*/
|
|
168
|
+
converterOptions?: ExportWordConverterOptions | ExportWordConverterOptionsV2;
|
|
169
|
+
/**
|
|
170
|
+
* A function to gather the HTML to be converted to Word.
|
|
171
|
+
*
|
|
172
|
+
* **NOTE:** This option may be useful when the editor does not have a `getData()` method,
|
|
173
|
+
* or if the HTML to be converted should be different than the edited one.
|
|
174
|
+
*
|
|
175
|
+
* ```ts
|
|
176
|
+
* const exportWordConfig = {
|
|
177
|
+
* dataCallback: ( editor ) => {
|
|
178
|
+
* return `
|
|
179
|
+
* <header id="header">${ editor.data.get( { rootName: 'header' } ) }</header>
|
|
180
|
+
* <div id="content">${ editor.data.get( { rootName: 'content' } ) }</div>
|
|
181
|
+
* `;
|
|
182
|
+
* }
|
|
183
|
+
* }
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
* @default `( editor ) => editor.getData( { pagination: true } )
|
|
187
|
+
*
|
|
188
|
+
* If using the {@glink features/pagination/pagination pagination} feature, the `pagination:true` option inserts additional markers into
|
|
189
|
+
* editor's data. Thanks to that, the Docx converter creates a Word document similar to what is displayed in the editor.
|
|
190
|
+
*/
|
|
191
|
+
dataCallback?: (editor: Editor) => string;
|
|
192
|
+
/**
|
|
193
|
+
* A token URL or a token request function. This field is optional and should be used only when a different `tokenUrl` is required for
|
|
194
|
+
* the export to Word feature.
|
|
195
|
+
*
|
|
196
|
+
* **Note:** The token can be disabled with the `false` value provided.
|
|
197
|
+
*
|
|
198
|
+
* See: {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl}
|
|
199
|
+
*/
|
|
200
|
+
tokenUrl?: TokenUrl | false;
|
|
201
|
+
/**
|
|
202
|
+
* The authentication token.
|
|
203
|
+
*
|
|
204
|
+
* See: {@link module:cloud-services/cloudservices~CloudServices#token}
|
|
205
|
+
*/
|
|
206
|
+
token?: InitializedToken;
|
|
207
|
+
/**
|
|
208
|
+
* The version of `Export to Word` API.
|
|
209
|
+
*
|
|
210
|
+
* @default '2'
|
|
211
|
+
*/
|
|
212
|
+
version?: 1 | 2;
|
|
213
|
+
}
|
|
214
|
+
export type ExportWordConverterOptions = {
|
|
215
|
+
format?: ExportWordConverterFormatOption;
|
|
216
|
+
margin_top?: string;
|
|
217
|
+
margin_bottom?: string;
|
|
218
|
+
margin_right?: string;
|
|
219
|
+
margin_left?: string;
|
|
220
|
+
header?: ExportWordConverterHeaderFooterOption;
|
|
221
|
+
footer?: ExportWordConverterHeaderFooterOption;
|
|
222
|
+
comments?: ExportWordConverterCommentsOption;
|
|
223
|
+
suggestions?: ExportWordConverterSuggestionsOption;
|
|
224
|
+
orientation?: ExportWordConverterOrientationOption;
|
|
225
|
+
auto_pagination?: boolean;
|
|
226
|
+
base_url?: string;
|
|
227
|
+
};
|
|
228
|
+
export type ExportWordConverterFormatOption = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5' | string & Record<never, never>;
|
|
229
|
+
export type ExportWordConverterOrientationOption = 'portrait' | 'landscape' | string & Record<never, never>;
|
|
230
|
+
export type ExportWordConverterHeaderFooterOption = Array<{
|
|
231
|
+
html?: string;
|
|
232
|
+
css?: string;
|
|
233
|
+
type?: 'default' | 'even' | 'odd' | 'first' | string & Record<never, never>;
|
|
234
|
+
}>;
|
|
235
|
+
export type ExportWordConverterCommentsOption = {
|
|
236
|
+
[id: string]: Array<{
|
|
237
|
+
author: string;
|
|
238
|
+
created: Date;
|
|
239
|
+
content?: string;
|
|
240
|
+
is_resolved: boolean;
|
|
241
|
+
}>;
|
|
242
|
+
};
|
|
243
|
+
export type ExportWordConverterSuggestionsOption = {
|
|
244
|
+
[id: string]: {
|
|
245
|
+
author: string;
|
|
246
|
+
created: Date | null;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
export type ExportWordConverterOptionsV2 = {
|
|
250
|
+
document?: ExportWordConverterDocumentOptionsV2;
|
|
251
|
+
headers?: ExportWordConverterHeaderFooterOptionsV2;
|
|
252
|
+
footers?: ExportWordConverterHeaderFooterOptionsV2;
|
|
253
|
+
extra_http_headers?: ExportWordConverterExtraHttpHeaders;
|
|
254
|
+
base_url?: string;
|
|
255
|
+
auto_pagination?: boolean;
|
|
256
|
+
watermark?: ExportWordConverterWatermarkV2;
|
|
257
|
+
};
|
|
258
|
+
export type ExportWordConverterDocumentOptionsV2 = {
|
|
259
|
+
margins?: ExportWordConverterMarginsOptionsV2;
|
|
260
|
+
size?: ExportWordConverterFormatOptionsV2;
|
|
261
|
+
orientation?: ExportWordConverterOrientationOptionsV2;
|
|
262
|
+
language?: string;
|
|
263
|
+
};
|
|
264
|
+
export type ExportWordConverterMarginsOptionsV2 = {
|
|
265
|
+
top?: string;
|
|
266
|
+
right?: string;
|
|
267
|
+
bottom?: string;
|
|
268
|
+
left?: string;
|
|
269
|
+
};
|
|
270
|
+
export type ExportWordConverterHeaderFooterOptionsV2 = {
|
|
271
|
+
first?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
272
|
+
odd?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
273
|
+
even?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
274
|
+
default?: ExportWordConverterHeaderFooterItemOptionsV2;
|
|
275
|
+
};
|
|
276
|
+
export type ExportWordConverterWatermarkV2 = {
|
|
277
|
+
source?: string;
|
|
278
|
+
width?: string;
|
|
279
|
+
height?: string;
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* If fetching some resources (e.g. images) used in a generated Word requires passing an additional
|
|
283
|
+
* authorization factor in the form of additional HTTP headers:
|
|
284
|
+
*
|
|
285
|
+
* ```
|
|
286
|
+
* extra_http_headers: {
|
|
287
|
+
* 'https://ckeditor.com': {
|
|
288
|
+
* authorization: 'Bearer xxx'
|
|
289
|
+
* },
|
|
290
|
+
* 'https://example.com': {
|
|
291
|
+
* authorization: 'Bearer xxx'
|
|
292
|
+
* },
|
|
293
|
+
* }
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
export type ExportWordConverterExtraHttpHeaders = {
|
|
297
|
+
[domain: string]: ExportWordConverterExtraHttpHeadersHeader;
|
|
298
|
+
};
|
|
299
|
+
export type ExportWordConverterExtraHttpHeadersHeader = {
|
|
300
|
+
[header: string]: string;
|
|
301
|
+
};
|
|
302
|
+
export type ExportWordConverterHeaderFooterItemOptionsV2 = {
|
|
303
|
+
html?: string;
|
|
304
|
+
css?: string;
|
|
305
|
+
};
|
|
306
|
+
export type ExportWordConverterOrientationOptionsV2 = 'portrait' | 'landscape' | string & Record<never, never>;
|
|
307
|
+
export type ExportWordConverterFormatOptionsV2 = ExportWordConverterPredifinedFormatOptionsV2 | ExportWordConverterCustomFormatOptionsV2;
|
|
308
|
+
export type ExportWordConverterPredifinedFormatOptionsV2 = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5' | string & Record<never, never>;
|
|
309
|
+
export type ExportWordConverterCustomFormatOptionsV2 = {
|
|
310
|
+
width?: string;
|
|
311
|
+
height?: string;
|
|
312
|
+
};
|
|
313
|
+
export type ExportWordConverterCollaborationFeaturesOptionsV2 = {
|
|
314
|
+
comment_threads?: ExportWordConverterCommentsThreadOptionsV2;
|
|
315
|
+
suggestions?: ExportWordConverterSuggestionsOptionsV2;
|
|
316
|
+
};
|
|
317
|
+
export type ExportWordConverterCommentsThreadOptionsV2 = Array<{
|
|
318
|
+
thread_id: string;
|
|
319
|
+
is_resolved: boolean;
|
|
320
|
+
comments: ExportWordConverterCommentsV2;
|
|
321
|
+
}>;
|
|
322
|
+
export type ExportWordConverterCommentsV2 = Array<{
|
|
323
|
+
author: string;
|
|
324
|
+
created_at: Date;
|
|
325
|
+
content: string;
|
|
326
|
+
}>;
|
|
327
|
+
export type ExportWordConverterSuggestionsOptionsV2 = Array<{
|
|
328
|
+
id: string;
|
|
329
|
+
author: string;
|
|
330
|
+
created_at: Date | null;
|
|
331
|
+
}>;
|
|
332
|
+
export type ExportWordConverterMergeFieldsOptionsV2 = {
|
|
333
|
+
prefix: string;
|
|
334
|
+
suffix: string;
|
|
335
|
+
data?: Record<string, string>;
|
|
336
|
+
};
|
|
@@ -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
|
+
const _0x559ef9=_0x2661;function _0x2661(_0x3a4e77,_0xb8df39){const _0x10378c=_0x1037();return _0x2661=function(_0x2661b0,_0x4898c9){_0x2661b0=_0x2661b0-0xc9;let _0x2e15ef=_0x10378c[_0x2661b0];return _0x2e15ef;},_0x2661(_0x3a4e77,_0xb8df39);}(function(_0x5a5360,_0x18f556){const _0x28d11d=_0x2661,_0xf3285c=_0x5a5360();while(!![]){try{const _0xc1b881=-parseInt(_0x28d11d(0xe1))/0x1+parseInt(_0x28d11d(0xde))/0x2+parseInt(_0x28d11d(0xcb))/0x3*(parseInt(_0x28d11d(0xd4))/0x4)+parseInt(_0x28d11d(0xe3))/0x5+parseInt(_0x28d11d(0xce))/0x6+parseInt(_0x28d11d(0xcc))/0x7*(parseInt(_0x28d11d(0xdf))/0x8)+parseInt(_0x28d11d(0xd7))/0x9*(-parseInt(_0x28d11d(0xe2))/0xa);if(_0xc1b881===_0x18f556)break;else _0xf3285c['push'](_0xf3285c['shift']());}catch(_0xb6177a){_0xf3285c['push'](_0xf3285c['shift']());}}}(_0x1037,0x43401));import{Plugin as _0x40c961}from'ckeditor5/src/core.js';function _0x1037(){const _0x495c26=['ExportWord','1910418ITHEil','then','plugins','pluginName','init','commands','24BieijO','exportWord','registerTokenUrl','9069885TqTIJT','editor','add','token','isOfficialPlugin','_token','get','417552QbfOkD','8MYxkLC','requires','114039EwXXcV','10KlmacF','1277430NkxWDV','tokenUrl','config','CloudServices','isPremiumPlugin','191397CWFiBG','1622614kTJnGw'];_0x1037=function(){return _0x495c26;};return _0x1037();}import{Notification as _0x450119}from'ckeditor5/src/ui.js';import _0x370b82 from'./exportwordcommand.js';import _0xc1d618 from'./exportwordui.js';export default class s extends _0x40c961{static get[_0x559ef9(0xd1)](){const _0x59b2b9=_0x559ef9;return _0x59b2b9(0xcd);}static get[_0x559ef9(0xdb)](){return!0x0;}static get[_0x559ef9(0xca)](){return!0x0;}static get[_0x559ef9(0xe0)](){const _0x13e344=_0x559ef9;return[_0x13e344(0xc9),_0x450119,_0xc1d618];}[_0x559ef9(0xd2)](){const _0x37fee2=_0x559ef9,_0x193401=this[_0x37fee2(0xd8)],_0x21f5ac=_0x193401[_0x37fee2(0xe5)][_0x37fee2(0xdd)](_0x37fee2(0xd5))||{};_0x193401[_0x37fee2(0xd3)][_0x37fee2(0xd9)](_0x37fee2(0xd5),new _0x370b82(_0x193401));const _0x473a2e=_0x193401[_0x37fee2(0xd0)][_0x37fee2(0xdd)](_0x37fee2(0xc9));!0x1===_0x21f5ac[_0x37fee2(0xe4)]?this[_0x37fee2(0xdc)]=null:_0x21f5ac[_0x37fee2(0xe4)]?_0x473a2e[_0x37fee2(0xd6)](_0x21f5ac[_0x37fee2(0xe4)])[_0x37fee2(0xcf)](_0x1c2b09=>{const _0x474d05=_0x37fee2;this[_0x474d05(0xdc)]=_0x1c2b09;}):this[_0x37fee2(0xdc)]=_0x473a2e[_0x37fee2(0xda)];}}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
* @module export-word/exportwordcommand
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
10
|
+
import type { ExportWordConfig } from './exportword.js';
|
|
11
|
+
/**
|
|
12
|
+
* The export to Word command.
|
|
13
|
+
*
|
|
14
|
+
* It takes the editor's HTML and CSS rules from the document and sends them to the HTML to Word converter.
|
|
15
|
+
* After processing, the converter will send back a Word file for download.
|
|
16
|
+
*/
|
|
17
|
+
export default class ExportWordCommand extends Command {
|
|
18
|
+
/**
|
|
19
|
+
* A command state that indicates if the command is currently executing.
|
|
20
|
+
*
|
|
21
|
+
* @observable
|
|
22
|
+
*/
|
|
23
|
+
isBusy: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
constructor(editor: Editor);
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
refresh(): void;
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
execute(options?: ExportWordConfig): Promise<void>;
|
|
36
|
+
}
|
|
@@ -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
|
+
const _0x23bfc1=_0x3f2e;(function(_0xb961e9,_0x5e6de8){const _0x1f8357=_0x3f2e,_0x29812e=_0xb961e9();while(!![]){try{const _0x151c5e=parseInt(_0x1f8357(0x191))/0x1*(parseInt(_0x1f8357(0x1a9))/0x2)+-parseInt(_0x1f8357(0x1ad))/0x3+-parseInt(_0x1f8357(0x1bd))/0x4*(-parseInt(_0x1f8357(0x1b6))/0x5)+-parseInt(_0x1f8357(0x177))/0x6*(-parseInt(_0x1f8357(0x1a6))/0x7)+-parseInt(_0x1f8357(0x1c6))/0x8+-parseInt(_0x1f8357(0x1ab))/0x9*(-parseInt(_0x1f8357(0x185))/0xa)+-parseInt(_0x1f8357(0x1a2))/0xb*(parseInt(_0x1f8357(0x1b0))/0xc);if(_0x151c5e===_0x5e6de8)break;else _0x29812e['push'](_0x29812e['shift']());}catch(_0xad227a){_0x29812e['push'](_0x29812e['shift']());}}}(_0x10da,0xe6bdd));import{Command as _0x4c6de2}from'ckeditor5/src/core.js';import{logWarning as _0x249eb9}from'ckeditor5/src/utils.js';function _0x10da(){const _0x204a07=['2UlEtzr','converterOptions','1102698rPjZUi','fileName','2981961GosRXW','</div>','margin_top','36513012xJPDSr','format','token','application/json','orientation','remove','9218585UFcvUj','URL','ariaLiveAnnouncer','Word\x20document\x20export\x20started','ExportWord','margin_bottom','createObjectURL','4fOZJlP','auto_pagination','footer','version','converterUrl','isEnabled','dataCallback','affectsData','POST','6178768QYkGta','value','suggestions','finally','11319258SHANVR','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.','pending','href','options','plugins','download','get','EDITOR_STYLES','then','editor','export-word-v1-api-is-deprecated','stylesheets','announce','40nsHIQB','comments','margin_right','click','execute','refresh','application/docx','_token','<div\x20class=\x22ck-content\x22\x20dir=\x22','assertive','Word\x20document\x20export\x20successful','data','1533853oqXOEB','catch','function','https://docx-converter.cke-cs.com/v1/convert','showWarning','createElement','blob','Word\x20document\x20export\x20failed','locale','set','Notification','isBusy','_downloadFile','header','contentLanguageDirection','https://docx-converter.cke-cs.com/v2/convert/html-docx','margin_left','11ZDBsaL','document.docx','config','status','7YvXpqm','fetch','stringify'];_0x10da=function(){return _0x204a07;};return _0x10da();}import{getStyles as _0x1ce1ec,getConverterOptions as _0x4a5ef5,getConverterOptionsV2 as _0x2d3b1a}from'./utils.js';import{getTranslation as _0x929a7}from'./utils/common-translations.js';const h=[_0x23bfc1(0x1b4),_0x23bfc1(0x1af),_0x23bfc1(0x187),_0x23bfc1(0x1bb),_0x23bfc1(0x1a1),_0x23bfc1(0x1b1),_0x23bfc1(0x19e),_0x23bfc1(0x1bf),_0x23bfc1(0x186),_0x23bfc1(0x175)];function _0x3f2e(_0x531b9d,_0x4b1ce6){const _0x10dac0=_0x10da();return _0x3f2e=function(_0x3f2e70,_0x3d871a){_0x3f2e70=_0x3f2e70-0x175;let _0x3b5023=_0x10dac0[_0x3f2e70];return _0x3b5023;},_0x3f2e(_0x531b9d,_0x4b1ce6);}export default class e extends _0x4c6de2{constructor(_0x20bd37){const _0x5dd44d=_0x23bfc1;super(_0x20bd37),this[_0x5dd44d(0x19a)](_0x5dd44d(0x19c),!0x1),this[_0x5dd44d(0x1c4)]=!0x1;}[_0x23bfc1(0x18a)](){const _0x537ada=_0x23bfc1;this[_0x537ada(0x1c2)]=!this[_0x537ada(0x19c)],this[_0x537ada(0x1c7)]=this[_0x537ada(0x19c)]?_0x537ada(0x179):void 0x0;}[_0x23bfc1(0x189)](_0x1f8ea={}){const _0x2bf367=_0x23bfc1,_0x47dadb=this[_0x2bf367(0x181)],_0x35ef6d=_0x1f8ea[_0x2bf367(0x1c0)]||0x2,_0xffbca1=0x1===_0x35ef6d,_0x518be2=_0x1f8ea[_0x2bf367(0x1c1)]||(_0xffbca1?_0x2bf367(0x194):_0x2bf367(0x1a0)),_0x41ce27=_0x1f8ea[_0x2bf367(0x1aa)]||{},_0x20572d=_0x47dadb[_0x2bf367(0x17c)][_0x2bf367(0x17e)](_0x2bf367(0x1ba)),_0x4f2f0e=_0x1f8ea[_0x2bf367(0x1b2)]||_0x20572d[_0x2bf367(0x18c)],_0x2a9a17=!0x0===_0x41ce27[_0x2bf367(0x1be)],_0x206c0d=_0x1f8ea[_0x2bf367(0x1c3)]||(_0x5a309a=>_0x5a309a[_0x2bf367(0x190)][_0x2bf367(0x17e)]({'pagination':_0x2a9a17}));return 0x2===_0x35ef6d&&function(_0x36f94d){for(const _0xf303e of h)if(void 0x0!==_0x36f94d[_0xf303e])return!0x0;return!0x1;}(_0x41ce27)&&_0x249eb9(_0x2bf367(0x182)),this[_0x2bf367(0x19c)]=!0x0,this[_0x2bf367(0x18a)](),_0x1ce1ec(_0x1f8ea[_0x2bf367(0x183)]||[_0x2bf367(0x17f)])[_0x2bf367(0x180)](async _0x3b7356=>{const _0x30f5f0=_0x2bf367;_0x47dadb['ui'][_0x30f5f0(0x1b8)][_0x30f5f0(0x184)](_0x929a7(_0x47dadb[_0x30f5f0(0x199)],_0x30f5f0(0x1b9)));const _0x79ef22=await _0x206c0d(_0x47dadb),_0x53b25b={'html':_0x30f5f0(0x18d)+_0x47dadb[_0x30f5f0(0x199)][_0x30f5f0(0x19f)]+'\x22>'+_0x79ef22+_0x30f5f0(0x1ae),'css':_0x3b7356,[_0xffbca1?_0x30f5f0(0x17b):_0x30f5f0(0x1a4)]:{..._0x41ce27,..._0xffbca1?_0x4a5ef5(_0x47dadb,_0x41ce27):_0x2d3b1a(_0x47dadb,_0x41ce27)}},_0x5e9d6c={'method':_0x30f5f0(0x1c5),'headers':{'Content-Type':_0x30f5f0(0x1b3),'Accept':_0x30f5f0(0x18b),..._0x4f2f0e?{'Authorization':_0x4f2f0e[_0x30f5f0(0x1c7)]}:null},'body':JSON[_0x30f5f0(0x1a8)](_0x53b25b)};return window[_0x30f5f0(0x1a7)](_0x518be2,_0x5e9d6c)[_0x30f5f0(0x180)](_0x4ea2ce=>{const _0x39b430=_0x30f5f0;if(0xc8!==_0x4ea2ce[_0x39b430(0x1a5)])throw _0x4ea2ce;return _0x4ea2ce[_0x39b430(0x197)]();})[_0x30f5f0(0x180)](_0x21944d=>{const _0x1d19b0=_0x30f5f0;_0x47dadb['ui'][_0x1d19b0(0x1b8)][_0x1d19b0(0x184)](_0x929a7(_0x47dadb[_0x1d19b0(0x199)],_0x1d19b0(0x18f)));const _0x38e986=_0x1d19b0(0x193)==typeof _0x1f8ea[_0x1d19b0(0x1ac)]?_0x1f8ea[_0x1d19b0(0x1ac)]():_0x1f8ea[_0x1d19b0(0x1ac)];this[_0x1d19b0(0x19d)](_0x21944d,_0x38e986||_0x1d19b0(0x1a3));});})[_0x2bf367(0x192)](_0x2ccb3d=>{const _0x288f00=_0x2bf367,_0x523bf0=_0x47dadb[_0x288f00(0x17c)][_0x288f00(0x17e)](_0x288f00(0x19b));throw _0x47dadb['ui'][_0x288f00(0x1b8)][_0x288f00(0x184)](_0x929a7(_0x47dadb[_0x288f00(0x199)],_0x288f00(0x198)),{'politeness':_0x288f00(0x18e)}),_0x523bf0[_0x288f00(0x195)](_0x929a7(_0x47dadb[_0x288f00(0x199)],_0x288f00(0x178))),_0x2ccb3d;})[_0x2bf367(0x176)](()=>{const _0x317232=_0x2bf367;this[_0x317232(0x19c)]=!0x1,this[_0x317232(0x18a)]();});}[_0x23bfc1(0x19d)](_0x127096,_0x508470){const _0x35bd08=_0x23bfc1,_0x479190=document[_0x35bd08(0x196)]('a');_0x479190[_0x35bd08(0x17a)]=window[_0x35bd08(0x1b7)][_0x35bd08(0x1bc)](_0x127096),_0x479190[_0x35bd08(0x17d)]=_0x508470,_0x479190[_0x35bd08(0x188)](),_0x479190[_0x35bd08(0x1b5)]();}}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
* @module export-word/exportwordui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The export to Word UI feature.
|
|
11
|
+
*
|
|
12
|
+
* It introduces 'Export to Word' button in toolbar and menu bar.
|
|
13
|
+
*/
|
|
14
|
+
export default class ExportWordUI extends Plugin {
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
static get pluginName(): "ExportWordUI";
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get isOfficialPlugin(): true;
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get isPremiumPlugin(): true;
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
init(): void;
|
|
31
|
+
}
|
|
@@ -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
|
+
const _0x5ded98=_0x1763;function _0x1763(_0x3409a6,_0x5062a1){const _0x4f8691=_0x4f86();return _0x1763=function(_0x176301,_0x432a85){_0x176301=_0x176301-0x132;let _0x2707ee=_0x4f8691[_0x176301];return _0x2707ee;},_0x1763(_0x3409a6,_0x5062a1);}function _0x4f86(){const _0x8c4bc4=['isEnabled','editing','1zoaxiY','28578nTpWRx','Exporting\x20Word\x20document','label','8QAcyYY','bind','pluginName','isOn','commands','isPremiumPlugin','4010ZLXTNB','execute','_createButton','1947043kPkjBK','2510012CrBeLx','3654156RUGGoR','editor','Export\x20to\x20Word','iconView','config','listenTo','add','componentFactory','938484kEfSQN','isVisible','children','view','menuBar:exportWord','init','isOfficialPlugin','isBusy','3789iMDBGF','set','get','205630dxVaef','focus','365FYeTZO','locale','exportWord','ExportWordUI'];_0x4f86=function(){return _0x8c4bc4;};return _0x4f86();}(function(_0x1fc0e2,_0x440c64){const _0x325ea8=_0x1763,_0x41d904=_0x1fc0e2();while(!![]){try{const _0x36f7fa=-parseInt(_0x325ea8(0x13c))/0x1*(parseInt(_0x325ea8(0x134))/0x2)+parseInt(_0x325ea8(0x153))/0x3+-parseInt(_0x325ea8(0x14a))/0x4+-parseInt(_0x325ea8(0x136))/0x5*(-parseInt(_0x325ea8(0x13d))/0x6)+parseInt(_0x325ea8(0x149))/0x7*(parseInt(_0x325ea8(0x140))/0x8)+parseInt(_0x325ea8(0x15b))/0x9*(-parseInt(_0x325ea8(0x146))/0xa)+parseInt(_0x325ea8(0x14b))/0xb;if(_0x36f7fa===_0x440c64)break;else _0x41d904['push'](_0x41d904['shift']());}catch(_0x28a2a8){_0x41d904['push'](_0x41d904['shift']());}}}(_0x4f86,0x5ac15));import{Plugin as _0x1ebdb3}from'ckeditor5/src/core.js';import{ButtonView as _0x2365d8,MenuBarMenuListItemButtonView as _0x200da3,SpinnerView as _0x7b49c6}from'ckeditor5/src/ui.js';import _0x4529f0 from'../theme/icons/exportword.svg';import{getTranslation as _0x1b66c6}from'./utils/common-translations.js';export default class o extends _0x1ebdb3{static get[_0x5ded98(0x142)](){const _0xc8a417=_0x5ded98;return _0xc8a417(0x139);}static get[_0x5ded98(0x159)](){return!0x0;}static get[_0x5ded98(0x145)](){return!0x0;}[_0x5ded98(0x158)](){const _0xc00489=_0x5ded98,_0x449771=this[_0xc00489(0x14c)];_0x449771['ui'][_0xc00489(0x152)][_0xc00489(0x151)](_0xc00489(0x138),()=>{const _0x5aa3a5=_0xc00489,_0x573ee8=_0x449771[_0x5aa3a5(0x144)][_0x5aa3a5(0x133)](_0x5aa3a5(0x138)),_0x3cf2f4=this[_0x5aa3a5(0x148)](_0x2365d8);return _0x3cf2f4[_0x5aa3a5(0x132)]({'tooltip':!0x0}),_0x3cf2f4[_0x5aa3a5(0x141)](_0x5aa3a5(0x143))['to'](_0x573ee8,_0x5aa3a5(0x15a)),_0x3cf2f4;}),_0x449771['ui'][_0xc00489(0x152)][_0xc00489(0x151)](_0xc00489(0x157),()=>this[_0xc00489(0x148)](_0x200da3));}[_0x5ded98(0x148)](_0x424bc4){const _0x45da96=_0x5ded98,_0x21c14b=this[_0x45da96(0x14c)],_0x3ca39a=_0x21c14b[_0x45da96(0x14f)][_0x45da96(0x133)](_0x45da96(0x138))||{},_0x42682a=_0x21c14b[_0x45da96(0x144)][_0x45da96(0x133)](_0x45da96(0x138)),_0x53b2cb=new _0x424bc4(_0x21c14b[_0x45da96(0x137)]),_0x51af6e=new _0x7b49c6();return _0x53b2cb[_0x45da96(0x155)][_0x45da96(0x151)](_0x51af6e),_0x51af6e[_0x45da96(0x141)](_0x45da96(0x154))['to'](_0x42682a,_0x45da96(0x15a)),_0x53b2cb[_0x45da96(0x14e)][_0x45da96(0x141)](_0x45da96(0x154))['to'](_0x42682a,_0x45da96(0x15a),_0x3bc252=>!_0x3bc252),_0x53b2cb[_0x45da96(0x132)]({'icon':_0x4529f0}),_0x53b2cb[_0x45da96(0x141)](_0x45da96(0x13a))['to'](_0x42682a,_0x45da96(0x13a)),_0x53b2cb[_0x45da96(0x141)](_0x45da96(0x13f))['to'](_0x42682a,_0x45da96(0x15a),_0x4d54af=>_0x1b66c6(_0x21c14b[_0x45da96(0x137)],_0x4d54af?_0x45da96(0x13e):_0x45da96(0x14d))),this[_0x45da96(0x150)](_0x53b2cb,_0x45da96(0x147),()=>{const _0x2eef31=_0x45da96;_0x21c14b[_0x2eef31(0x147)](_0x2eef31(0x138),_0x3ca39a),_0x21c14b[_0x2eef31(0x13b)][_0x2eef31(0x156)][_0x2eef31(0x135)]();}),_0x53b2cb;}}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
* @module export-word
|
|
7
|
+
*/
|
|
8
|
+
export { default as ExportWord, type ExportWordConfig } from './exportword.js';
|
|
9
|
+
export type { default as ExportWordCommand } from './exportwordcommand.js';
|
|
10
|
+
import './augmentation.js';
|
package/src/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
|
+
(function(_0x1323bc,_0x48689a){var _0x5d7ff4=_0x1840,_0x7c7b92=_0x1323bc();while(!![]){try{var _0x3c52eb=-parseInt(_0x5d7ff4(0xe4))/0x1*(-parseInt(_0x5d7ff4(0xdb))/0x2)+-parseInt(_0x5d7ff4(0xde))/0x3*(parseInt(_0x5d7ff4(0xe3))/0x4)+parseInt(_0x5d7ff4(0xdc))/0x5+parseInt(_0x5d7ff4(0xe2))/0x6+parseInt(_0x5d7ff4(0xdf))/0x7*(-parseInt(_0x5d7ff4(0xe1))/0x8)+parseInt(_0x5d7ff4(0xdd))/0x9+-parseInt(_0x5d7ff4(0xe0))/0xa;if(_0x3c52eb===_0x48689a)break;else _0x7c7b92['push'](_0x7c7b92['shift']());}catch(_0x1c5b87){_0x7c7b92['push'](_0x7c7b92['shift']());}}}(_0x2fa3,0xe617c));export{default as ExportWord}from'./exportword.js';import'./augmentation.js';function _0x1840(_0x50e53b,_0x5038c7){var _0x2fa3f4=_0x2fa3();return _0x1840=function(_0x184058,_0x1cbcca){_0x184058=_0x184058-0xdb;var _0x334163=_0x2fa3f4[_0x184058];return _0x334163;},_0x1840(_0x50e53b,_0x5038c7);}function _0x2fa3(){var _0x287802=['306EbTxsH','420749CIuUlq','22717500DOCwRJ','56Lvegnl','11025594GbOVaU','51548AzNmTB','1DcasIC','2020658gcHnRE','8951640GcaUWm','2800593RBxSqX'];_0x2fa3=function(){return _0x287802;};return _0x2fa3();}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
* @module export-word/utils/common-translations
|
|
7
|
+
*/
|
|
8
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
9
|
+
export declare function getTranslation(locale: Locale, id: string): string;
|
|
@@ -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 function getTranslation(_0x385334,_0x1c2d01){const t=_0x385334['t'];switch(_0x1c2d01){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 _0x1c2d01;}}
|
package/src/utils.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
|
6
|
+
import type { Collection } from 'ckeditor5/src/utils.js';
|
|
7
|
+
import type { ExportWordConverterOptions, ExportWordConverterInternalOptions, ExportWordConverterCommentsOption, ExportWordConverterSuggestionsOption, ExportWordConverterCommentsThreadOptionsV2, ExportWordConverterOptionsV2, ExportWordConverterInternalOptionsV2, ExportWordConverterSuggestionsOptionsV2 } from './exportword.js';
|
|
8
|
+
import type { CommentThread } from '@ckeditor/ckeditor5-comments';
|
|
9
|
+
import type { SuggestionJSON } from '@ckeditor/ckeditor5-track-changes';
|
|
10
|
+
import type { User } from '@ckeditor/ckeditor5-collaboration-core';
|
|
11
|
+
/**
|
|
12
|
+
* A helper function for getting concatenated CSS rules from external stylesheets.
|
|
13
|
+
*
|
|
14
|
+
* @param stylesheets An array of stylesheet paths delivered by the user through the plugin configuration.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getStyles(stylesheets?: Array<string>): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* A helper function for getting a proper options object containing
|
|
19
|
+
* comments, suggestions and the browser's timezone for the "Export to Word" converter.
|
|
20
|
+
*
|
|
21
|
+
* @param editor An editor instance.
|
|
22
|
+
* @param converterOptionsFromConfig Converter options passed through `editor.config.exportWord.converterOptions`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getConverterOptions(editor: Editor, converterOptionsFromConfig?: ExportWordConverterOptions): ExportWordConverterInternalOptions;
|
|
25
|
+
/**
|
|
26
|
+
* A helper function for getting a comments object for the converter options.
|
|
27
|
+
*
|
|
28
|
+
* @param threads The comment threads array.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getComments(threads: Array<CommentThread>): ExportWordConverterCommentsOption;
|
|
31
|
+
/**
|
|
32
|
+
* A helper function for getting a suggestions object for the converter options.
|
|
33
|
+
*
|
|
34
|
+
* @param suggestions The suggestions array.
|
|
35
|
+
* @param users A list of all users in the editor.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getSuggestions(suggestions: Array<SuggestionJSON>, users: Collection<User>): ExportWordConverterSuggestionsOption;
|
|
38
|
+
/**
|
|
39
|
+
* A helper function for getting a proper options object containing
|
|
40
|
+
* comments, suggestions and the browser's timezone for the "Export to Word" converter for V2 API.
|
|
41
|
+
*
|
|
42
|
+
* @param editor An editor instance.
|
|
43
|
+
* @param converterOptionsFromConfig Converter options passed through `editor.config.exportWord.converterOptions`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getConverterOptionsV2(editor: Editor, converterOptionsFromConfig?: ExportWordConverterOptionsV2): ExportWordConverterInternalOptionsV2;
|
|
46
|
+
/**
|
|
47
|
+
* A helper function for getting a comments object for the converter options in V2 API.
|
|
48
|
+
*
|
|
49
|
+
* @param threads The comment threads array.
|
|
50
|
+
*/
|
|
51
|
+
export declare function getCommentsV2(threads: Array<CommentThread>): ExportWordConverterCommentsThreadOptionsV2;
|
|
52
|
+
/**
|
|
53
|
+
* A helper function for getting a suggestions object for the converter options in V2 API.
|
|
54
|
+
*
|
|
55
|
+
* @param suggestions The suggestions array.
|
|
56
|
+
* @param users A list of all users in the editor.
|
|
57
|
+
*/
|
|
58
|
+
export declare function getSuggestionsV2(suggestions: Array<SuggestionJSON>, users: Collection<User>): ExportWordConverterSuggestionsOptionsV2;
|