@ckeditor/ckeditor5-export-word 41.3.0-alpha.3 → 41.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/build/export-word.js +1 -1
  2. package/package.json +2 -3
  3. package/src/exportword.d.ts +2 -1
  4. package/src/exportword.js +1 -1
  5. package/src/exportwordcommand.js +1 -1
  6. package/src/exportwordui.d.ts +23 -0
  7. package/src/exportwordui.js +23 -0
  8. package/src/index.js +1 -1
  9. package/src/utils.js +1 -1
  10. package/dist/content-index.css +0 -4
  11. package/dist/editor-index.css +0 -4
  12. package/dist/index.css +0 -4
  13. package/dist/translations/ar.d.ts +0 -8
  14. package/dist/translations/ar.js +0 -23
  15. package/dist/translations/bg.d.ts +0 -8
  16. package/dist/translations/bg.js +0 -23
  17. package/dist/translations/bn.d.ts +0 -8
  18. package/dist/translations/bn.js +0 -23
  19. package/dist/translations/ca.d.ts +0 -8
  20. package/dist/translations/ca.js +0 -23
  21. package/dist/translations/cs.d.ts +0 -8
  22. package/dist/translations/cs.js +0 -23
  23. package/dist/translations/da.d.ts +0 -8
  24. package/dist/translations/da.js +0 -23
  25. package/dist/translations/de.d.ts +0 -8
  26. package/dist/translations/de.js +0 -23
  27. package/dist/translations/el.d.ts +0 -8
  28. package/dist/translations/el.js +0 -23
  29. package/dist/translations/en-au.d.ts +0 -8
  30. package/dist/translations/en-au.js +0 -23
  31. package/dist/translations/en.d.ts +0 -8
  32. package/dist/translations/en.js +0 -23
  33. package/dist/translations/es.d.ts +0 -8
  34. package/dist/translations/es.js +0 -23
  35. package/dist/translations/et.d.ts +0 -8
  36. package/dist/translations/et.js +0 -23
  37. package/dist/translations/fi.d.ts +0 -8
  38. package/dist/translations/fi.js +0 -23
  39. package/dist/translations/fr.d.ts +0 -8
  40. package/dist/translations/fr.js +0 -23
  41. package/dist/translations/gl.d.ts +0 -8
  42. package/dist/translations/gl.js +0 -23
  43. package/dist/translations/he.d.ts +0 -8
  44. package/dist/translations/he.js +0 -23
  45. package/dist/translations/hi.d.ts +0 -8
  46. package/dist/translations/hi.js +0 -23
  47. package/dist/translations/hr.d.ts +0 -8
  48. package/dist/translations/hr.js +0 -23
  49. package/dist/translations/hu.d.ts +0 -8
  50. package/dist/translations/hu.js +0 -23
  51. package/dist/translations/id.d.ts +0 -8
  52. package/dist/translations/id.js +0 -23
  53. package/dist/translations/it.d.ts +0 -8
  54. package/dist/translations/it.js +0 -23
  55. package/dist/translations/ja.d.ts +0 -8
  56. package/dist/translations/ja.js +0 -23
  57. package/dist/translations/jv.d.ts +0 -8
  58. package/dist/translations/jv.js +0 -23
  59. package/dist/translations/ko.d.ts +0 -8
  60. package/dist/translations/ko.js +0 -23
  61. package/dist/translations/lt.d.ts +0 -8
  62. package/dist/translations/lt.js +0 -23
  63. package/dist/translations/lv.d.ts +0 -8
  64. package/dist/translations/lv.js +0 -23
  65. package/dist/translations/ms.d.ts +0 -8
  66. package/dist/translations/ms.js +0 -23
  67. package/dist/translations/nl.d.ts +0 -8
  68. package/dist/translations/nl.js +0 -23
  69. package/dist/translations/no.d.ts +0 -8
  70. package/dist/translations/no.js +0 -23
  71. package/dist/translations/pl.d.ts +0 -8
  72. package/dist/translations/pl.js +0 -23
  73. package/dist/translations/pt-br.d.ts +0 -8
  74. package/dist/translations/pt-br.js +0 -23
  75. package/dist/translations/pt.d.ts +0 -8
  76. package/dist/translations/pt.js +0 -23
  77. package/dist/translations/ro.d.ts +0 -8
  78. package/dist/translations/ro.js +0 -23
  79. package/dist/translations/ru.d.ts +0 -8
  80. package/dist/translations/ru.js +0 -23
  81. package/dist/translations/sk.d.ts +0 -8
  82. package/dist/translations/sk.js +0 -23
  83. package/dist/translations/sr-latn.d.ts +0 -8
  84. package/dist/translations/sr-latn.js +0 -23
  85. package/dist/translations/sr.d.ts +0 -8
  86. package/dist/translations/sr.js +0 -23
  87. package/dist/translations/sv.d.ts +0 -8
  88. package/dist/translations/sv.js +0 -23
  89. package/dist/translations/th.d.ts +0 -8
  90. package/dist/translations/th.js +0 -23
  91. package/dist/translations/tr.d.ts +0 -8
  92. package/dist/translations/tr.js +0 -23
  93. package/dist/translations/ug.d.ts +0 -8
  94. package/dist/translations/ug.js +0 -23
  95. package/dist/translations/uk.d.ts +0 -8
  96. package/dist/translations/uk.js +0 -23
  97. package/dist/translations/ur.d.ts +0 -8
  98. package/dist/translations/ur.js +0 -23
  99. package/dist/translations/vi.d.ts +0 -8
  100. package/dist/translations/vi.js +0 -23
  101. package/dist/translations/zh-cn.d.ts +0 -8
  102. package/dist/translations/zh-cn.js +0 -23
  103. package/dist/translations/zh.d.ts +0 -8
  104. package/dist/translations/zh.js +0 -23
  105. package/dist/types/augmentation.d.ts +0 -25
  106. package/dist/types/exportword.d.ts +0 -235
  107. package/dist/types/exportwordcommand.d.ts +0 -40
  108. package/dist/types/index.d.ts +0 -14
  109. package/dist/types/utils.d.ts +0 -40
@@ -1,23 +0,0 @@
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{'zh':{'dictionary':{'Export\x20to\x20Word':'匯出到\x20Word','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.':'產生\x20Word\x20檔案時出錯。'},'getPluralForm':_0x582a81=>0x0}};
@@ -1,25 +0,0 @@
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
- import type { ExportWordConfig, ExportWord, ExportWordCommand } from './index.js';
10
- declare module '@ckeditor/ckeditor5-core' {
11
- interface EditorConfig {
12
- /**
13
- * The configuration of the {@link module:export-word/exportword~ExportWord export to Word feature}.
14
- *
15
- * Read more in {@link module:export-word/exportword~ExportWordConfig}.
16
- */
17
- exportWord?: ExportWordConfig;
18
- }
19
- interface PluginsMap {
20
- [ExportWord.pluginName]: ExportWord;
21
- }
22
- interface CommandsMap {
23
- exportWord: ExportWordCommand;
24
- }
25
- }
@@ -1,235 +0,0 @@
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
- /**
17
- * The export to Word feature.
18
- *
19
- * It allows you to generate a Word file directly from the editor content.
20
- *
21
- * For a detailed overview, check the {@glink features/converters/export-word export to Word} feature documentation.
22
- */
23
- export default class ExportWord extends Plugin {
24
- /**
25
- * @inheritDoc
26
- */
27
- static get pluginName(): "ExportWord";
28
- /**
29
- * @inheritDoc
30
- */
31
- static get requires(): readonly ["CloudServices", typeof Notification];
32
- /**
33
- * @inheritDoc
34
- */
35
- init(): void;
36
- }
37
- /**
38
- * The configuration of the export to Word feature. It is used by the Word export features from
39
- * the `@ckeditor/ckeditor5-export-word` package.
40
- *
41
- * ```ts
42
- * ClassicEditor
43
- * .create( editorElement, {
44
- * exportWord: ... // Export to Word feature options.
45
- * } )
46
- * .then( ... )
47
- * .catch( ... );
48
- * ```
49
- *
50
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
51
- */
52
- export interface ExportWordConfig {
53
- /**
54
- * Paths to the `.css` files containing additional styling for the editor's content (**the order of provided items matters**).
55
- *
56
- * ```ts
57
- * const exportWordConfig = {
58
- * stylesheets: [ './path/to/custom-style.css' ]
59
- * }
60
- * ```
61
- *
62
- * **NOTE:** If `stylesheets` are not provided, the plugin will sent only
63
- * {@glink installation/advanced/content-styles#the-full-list-of-content-styles the default editor content styles} to the converter.
64
- *
65
- * **Default editor's content styles**:
66
- * {@glink installation/advanced/content-styles#the-full-list-of-content-styles The default editor content styles}
67
- * are applied to the generated Word file thanks to the 'EDITOR_STYLES' token, which is provided to the `stylesheets` by default.
68
- * If you don't want them to be applied, you have to omit the token:
69
- *
70
- * ```ts
71
- * const exportWordConfig = {
72
- * stylesheets: [ './path/to/custom-editor-styles.css' ]
73
- * }
74
- * ```
75
- *
76
- * **Custom styling:** For more advanced styling, your configuration should look like this:
77
- *
78
- * ```ts
79
- * const exportWordConfig = {
80
- * stylesheets: [
81
- * 'EDITOR_STYLES',
82
- * './path/to/custom-styles.css'
83
- * ]
84
- * }
85
- * ```
86
- *
87
- * @default `[ 'EDITOR_STYLES' ]`
88
- */
89
- stylesheets?: Array<string>;
90
- /**
91
- * The name of the generated Word file.
92
- *
93
- * ```ts
94
- * // Static file name.
95
- * const exportWordConfig = {
96
- * fileName: 'my-document.docx'
97
- * }
98
- *
99
- *
100
- * // Dynamic file name.
101
- * const exportWordConfig = {
102
- * fileName: () => {
103
- * const articleTitle = document.querySelector( '#title' );
104
- *
105
- * return `${ articleTitle.value }.docx`;
106
- * }
107
- * }
108
- * ```
109
- *
110
- * **NOTE:** The file name must contain the `.docx` extension.
111
- * Otherwise your operating system or device may have trouble identifying the file type.
112
- *
113
- * @default 'document.docx'
114
- */
115
- fileName?: string | (() => string);
116
- /**
117
- * A URL to the Docx converter.
118
- *
119
- * ```ts
120
- * const exportWordConfig = {
121
- * converterUrl: 'https://myconverter.com/v1/'
122
- * }
123
- * ```
124
- *
125
- * **NOTE:** The plugin uses the default HTML to Word converter delivered by CKEditor Cloud Services.
126
- * You can provide a URL to an on-premises converter instead.
127
- *
128
- * @default 'https://docx-converter.cke-cs.com/v1/convert'
129
- */
130
- converterUrl?: string;
131
- /**
132
- * The CKEditor Cloud Services HTML to DOCX Converter [configuration options](https://docx-converter.cke-cs.com/docs#section/Options).
133
- *
134
- * **NOTE:** Configuring the plugin is not mandatory.
135
- *
136
- * ```ts
137
- * const exportWordConfig = {
138
- * converterOptions: {
139
- * ...
140
- * }
141
- * }
142
- * ```
143
- *
144
- * @default `{
145
- * format: 'A4',
146
- * margin_top: '1in',
147
- * margin_bottom: '1in',
148
- * margin_right: '1in',
149
- * margin_left: '1in',
150
- * header: undefined,
151
- * footer: undefined,
152
- * comments: undefined,
153
- * suggestions: undefined,
154
- * orientation: 'portrait',
155
- * auto_pagination: true,
156
- * base_url: undefined,
157
- * timezone: 'UTC'
158
- * }`
159
- */
160
- converterOptions?: ExportWordConverterOptions;
161
- /**
162
- * A function to gather the HTML to be converted to Word.
163
- *
164
- * **NOTE:** This option may be useful when the editor does not have a `getData()` method,
165
- * or if the HTML to be converted should be different than the edited one.
166
- *
167
- * ```ts
168
- * const exportWordConfig = {
169
- * dataCallback: ( editor ) => {
170
- * return `
171
- * <header id="header">${ editor.data.get( { rootName: 'header' } ) }</header>
172
- * <div id="content">${ editor.data.get( { rootName: 'content' } ) }</div>
173
- * `;
174
- * }
175
- * }
176
- * ```
177
- *
178
- * @default `( editor ) => editor.getData( { pagination: true } )
179
- *
180
- * If using the {@glink features/pagination/pagination pagination} feature, the `pagination:true` option inserts additional markers into
181
- * editor's data. Thanks to that, the Docx converter creates a Word document similar to what is displayed in the editor.
182
- */
183
- dataCallback?: (editor: Editor) => string;
184
- /**
185
- * A token URL or a token request function. This field is optional and should be used only when a different `tokenUrl` is required for
186
- * the export to Word feature.
187
- *
188
- * **Note:** The token can be disabled with the `false` value provided.
189
- *
190
- * See: {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl}
191
- */
192
- tokenUrl?: TokenUrl | false;
193
- /**
194
- * The authentication token.
195
- *
196
- * See: {@link module:cloud-services/cloudservices~CloudServices#token}
197
- */
198
- token?: InitializedToken;
199
- }
200
- export type ExportWordConverterOptions = {
201
- format?: ExportWordConverterFormatOption;
202
- margin_top?: string;
203
- margin_bottom?: string;
204
- margin_right?: string;
205
- margin_left?: string;
206
- header?: ExportWordConverterHeaderFooterOption;
207
- footer?: ExportWordConverterHeaderFooterOption;
208
- comments?: ExportWordConverterCommentsOption;
209
- suggestions?: ExportWordConverterSuggestionsOption;
210
- orientation?: ExportWordConverterOrientationOption;
211
- auto_pagination?: boolean;
212
- base_url?: string;
213
- timezone?: string;
214
- };
215
- export type ExportWordConverterFormatOption = 'Letter' | 'Legal' | 'Tabloid' | 'Statement' | 'Executive' | 'A3' | 'A4' | 'A5' | 'A6' | 'B4' | 'B5';
216
- export type ExportWordConverterOrientationOption = 'portrait' | 'landscape';
217
- export type ExportWordConverterHeaderFooterOption = Array<{
218
- html?: string;
219
- css?: string;
220
- type?: 'default' | 'even' | 'odd' | 'first';
221
- }>;
222
- export type ExportWordConverterCommentsOption = {
223
- [id: string]: Array<{
224
- author: string;
225
- created: Date;
226
- content?: string;
227
- is_resolved: boolean;
228
- }>;
229
- };
230
- export type ExportWordConverterSuggestionsOption = {
231
- [id: string]: {
232
- author: string;
233
- created: Date | null;
234
- };
235
- };
@@ -1,40 +0,0 @@
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
- }
@@ -1,14 +0,0 @@
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';
@@ -1,40 +0,0 @@
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
- import type { Editor } from 'ckeditor5/src/core.js';
10
- import type { Collection } from 'ckeditor5/src/utils.js';
11
- import type { ExportWordConverterOptions, ExportWordConverterCommentsOption, ExportWordConverterSuggestionsOption } from './exportword.js';
12
- import type { CommentThread } from '@ckeditor/ckeditor5-comments';
13
- import type { SuggestionJSON } from '@ckeditor/ckeditor5-track-changes';
14
- import type { User } from '@ckeditor/ckeditor5-collaboration-core';
15
- /**
16
- * A helper function for getting concatenated CSS rules from external stylesheets.
17
- *
18
- * @param stylesheets An array of stylesheet paths delivered by the user through the plugin configuration.
19
- */
20
- export declare function getStyles(stylesheets?: Array<string>): Promise<string>;
21
- /**
22
- * A helper function for getting a proper options object containing
23
- * comments, suggestions and the browser's timezone for the "Export to Word" converter.
24
- *
25
- * @param editor An editor instance.
26
- */
27
- export declare function getConverterOptions(editor: Editor): ExportWordConverterOptions;
28
- /**
29
- * A helper function for getting a comments object for the converter options.
30
- *
31
- * @param threads The comment threads array.
32
- */
33
- export declare function getComments(threads: Array<CommentThread>): ExportWordConverterCommentsOption;
34
- /**
35
- * A helper function for getting a suggestions object for the converter options.
36
- *
37
- * @param suggestions The suggestions array.
38
- * @param users A list of all users in the editor.
39
- */
40
- export declare function getSuggestions(suggestions: Array<SuggestionJSON>, users: Collection<User>): ExportWordConverterSuggestionsOption;