@ckeditor/ckeditor5-import-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.
- package/build/import-word.js +1 -1
- package/package.json +2 -3
- package/src/importword.js +1 -1
- package/src/importwordcommand.js +1 -1
- package/src/importwordediting.js +1 -1
- package/src/importwordui.js +1 -1
- package/src/index.js +1 -1
- package/dist/content-index.css +0 -4
- package/dist/editor-index.css +0 -4
- package/dist/index.css +0 -4
- package/dist/translations/ar.d.ts +0 -8
- package/dist/translations/ar.js +0 -23
- package/dist/translations/bg.d.ts +0 -8
- package/dist/translations/bg.js +0 -23
- package/dist/translations/bn.d.ts +0 -8
- package/dist/translations/bn.js +0 -23
- package/dist/translations/ca.d.ts +0 -8
- package/dist/translations/ca.js +0 -23
- package/dist/translations/cs.d.ts +0 -8
- package/dist/translations/cs.js +0 -23
- package/dist/translations/da.d.ts +0 -8
- package/dist/translations/da.js +0 -23
- package/dist/translations/de.d.ts +0 -8
- package/dist/translations/de.js +0 -23
- package/dist/translations/el.d.ts +0 -8
- package/dist/translations/el.js +0 -23
- package/dist/translations/en-au.d.ts +0 -8
- package/dist/translations/en-au.js +0 -23
- package/dist/translations/en.d.ts +0 -8
- package/dist/translations/en.js +0 -23
- package/dist/translations/es.d.ts +0 -8
- package/dist/translations/es.js +0 -23
- package/dist/translations/et.d.ts +0 -8
- package/dist/translations/et.js +0 -23
- package/dist/translations/fi.d.ts +0 -8
- package/dist/translations/fi.js +0 -23
- package/dist/translations/fr.d.ts +0 -8
- package/dist/translations/fr.js +0 -23
- package/dist/translations/gl.d.ts +0 -8
- package/dist/translations/gl.js +0 -23
- package/dist/translations/he.d.ts +0 -8
- package/dist/translations/he.js +0 -23
- package/dist/translations/hi.d.ts +0 -8
- package/dist/translations/hi.js +0 -23
- package/dist/translations/hr.d.ts +0 -8
- package/dist/translations/hr.js +0 -23
- package/dist/translations/hu.d.ts +0 -8
- package/dist/translations/hu.js +0 -23
- package/dist/translations/id.d.ts +0 -8
- package/dist/translations/id.js +0 -23
- package/dist/translations/it.d.ts +0 -8
- package/dist/translations/it.js +0 -23
- package/dist/translations/ja.d.ts +0 -8
- package/dist/translations/ja.js +0 -23
- package/dist/translations/ko.d.ts +0 -8
- package/dist/translations/ko.js +0 -23
- package/dist/translations/lt.d.ts +0 -8
- package/dist/translations/lt.js +0 -23
- package/dist/translations/lv.d.ts +0 -8
- package/dist/translations/lv.js +0 -23
- package/dist/translations/ms.d.ts +0 -8
- package/dist/translations/ms.js +0 -23
- package/dist/translations/nl.d.ts +0 -8
- package/dist/translations/nl.js +0 -23
- package/dist/translations/no.d.ts +0 -8
- package/dist/translations/no.js +0 -23
- package/dist/translations/pl.d.ts +0 -8
- package/dist/translations/pl.js +0 -23
- package/dist/translations/pt-br.d.ts +0 -8
- package/dist/translations/pt-br.js +0 -23
- package/dist/translations/pt.d.ts +0 -8
- package/dist/translations/pt.js +0 -23
- package/dist/translations/ro.d.ts +0 -8
- package/dist/translations/ro.js +0 -23
- package/dist/translations/ru.d.ts +0 -8
- package/dist/translations/ru.js +0 -23
- package/dist/translations/sk.d.ts +0 -8
- package/dist/translations/sk.js +0 -23
- package/dist/translations/sr-latn.d.ts +0 -8
- package/dist/translations/sr-latn.js +0 -23
- package/dist/translations/sr.d.ts +0 -8
- package/dist/translations/sr.js +0 -23
- package/dist/translations/sv.d.ts +0 -8
- package/dist/translations/sv.js +0 -23
- package/dist/translations/th.d.ts +0 -8
- package/dist/translations/th.js +0 -23
- package/dist/translations/tr.d.ts +0 -8
- package/dist/translations/tr.js +0 -23
- package/dist/translations/ug.d.ts +0 -8
- package/dist/translations/ug.js +0 -23
- package/dist/translations/uk.d.ts +0 -8
- package/dist/translations/uk.js +0 -23
- package/dist/translations/vi.d.ts +0 -8
- package/dist/translations/vi.js +0 -23
- package/dist/translations/zh-cn.d.ts +0 -8
- package/dist/translations/zh-cn.js +0 -23
- package/dist/translations/zh.d.ts +0 -8
- package/dist/translations/zh.js +0 -23
- package/dist/types/augmentation.d.ts +0 -27
- package/dist/types/importword.d.ts +0 -128
- package/dist/types/importwordcommand.d.ts +0 -58
- package/dist/types/importwordediting.d.ts +0 -43
- package/dist/types/importwordui.d.ts +0 -26
- package/dist/types/index.d.ts +0 -16
|
@@ -1,128 +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 import-word/importword
|
|
11
|
-
* @publicApi
|
|
12
|
-
*/
|
|
13
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
14
|
-
import type { TokenUrl } from '@ckeditor/ckeditor5-cloud-services';
|
|
15
|
-
import ImportWordUI from './importwordui.js';
|
|
16
|
-
import ImportWordEditing from './importwordediting.js';
|
|
17
|
-
/**
|
|
18
|
-
* The import from Word feature.
|
|
19
|
-
*
|
|
20
|
-
* It allows importing content from a Word file directly into CKEditor 5.
|
|
21
|
-
*
|
|
22
|
-
* This is a "glue" plugin which enables:
|
|
23
|
-
*
|
|
24
|
-
* * {@link module:import-word/importwordediting~ImportWordEditing},
|
|
25
|
-
* * {@link module:import-word/importwordui~ImportWordUI},
|
|
26
|
-
*
|
|
27
|
-
* For a detailed overview, check the {@glink features/converters/import-word/import-word import from Word} feature documentation.
|
|
28
|
-
*/
|
|
29
|
-
export default class ImportWord extends Plugin {
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
static get pluginName(): "ImportWord";
|
|
34
|
-
/**
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
static get requires(): readonly [typeof ImportWordEditing, typeof ImportWordUI];
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* The configuration of the {@link module:import-word/importword~ImportWord import from Word feature}.
|
|
41
|
-
*
|
|
42
|
-
* The configuration for the import from Word feature requires providing the
|
|
43
|
-
* {@link module:import-word/importword~ImportWordConfig#tokenUrl `config.importWord.tokenUrl`}:
|
|
44
|
-
*
|
|
45
|
-
* ```ts
|
|
46
|
-
* ClassicEditor
|
|
47
|
-
* .create( editorElement, {
|
|
48
|
-
* importWord: {
|
|
49
|
-
* tokenUrl: 'https://example.com/cs-token-endpoint'
|
|
50
|
-
* }
|
|
51
|
-
* } )
|
|
52
|
-
* .then( ... )
|
|
53
|
-
* .catch( ... );
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
57
|
-
*/
|
|
58
|
-
export interface ImportWordConfig {
|
|
59
|
-
/**
|
|
60
|
-
* A URL to the Docx converter.
|
|
61
|
-
*
|
|
62
|
-
* ```ts
|
|
63
|
-
* const importWordConfig = {
|
|
64
|
-
* converterUrl: 'https://myconverter.com/v1/'
|
|
65
|
-
* }
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
* **Note:** The plugin uses the default Word to HTML converter delivered by CKEditor Cloud Services.
|
|
69
|
-
* You can provide a URL to an on-premises converter instead.
|
|
70
|
-
*
|
|
71
|
-
* @default 'https://docx-converter.cke-cs.com/v2/convert/docx-html'
|
|
72
|
-
*/
|
|
73
|
-
converterUrl?: string;
|
|
74
|
-
/**
|
|
75
|
-
* A token URL or a token request function. This field is optional and should be used only when a different `tokenUrl`
|
|
76
|
-
* is required for the Import from Word feature.
|
|
77
|
-
*
|
|
78
|
-
* **Note:** The token can be disabled with the `false` value provided.
|
|
79
|
-
*
|
|
80
|
-
* See: {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl}
|
|
81
|
-
*/
|
|
82
|
-
tokenUrl?: TokenUrl;
|
|
83
|
-
formatting: FormattingOptions;
|
|
84
|
-
}
|
|
85
|
-
export interface FormattingOptions {
|
|
86
|
-
/**
|
|
87
|
-
* Controls whether the additional formatting dedicated to minimizing differences between default Word styles
|
|
88
|
-
* and default HTML formatting should be included in the generated document.
|
|
89
|
-
*
|
|
90
|
-
* If `inline`, the converter service preserves the formatting to be consistent with Word ones.
|
|
91
|
-
* For example, in Word headings are not bold by default, whereas in HTML, they are. Enabling this option
|
|
92
|
-
* appends font-weight: normal to all headings.
|
|
93
|
-
*
|
|
94
|
-
* @default false
|
|
95
|
-
*/
|
|
96
|
-
resets?: 'none' | 'inline';
|
|
97
|
-
/**
|
|
98
|
-
* Controls whether formatting set by default (like the default font size or default font family)
|
|
99
|
-
* should be included in the generated document.
|
|
100
|
-
*
|
|
101
|
-
* If `inline`, the converter service preserves the default formatting of the imported Word document.
|
|
102
|
-
*
|
|
103
|
-
* @default 'none'
|
|
104
|
-
*/
|
|
105
|
-
defaults?: 'none' | 'inline';
|
|
106
|
-
/**
|
|
107
|
-
* Controls whether Word styles should be included in the generated document.
|
|
108
|
-
*
|
|
109
|
-
* If `inline`, the converter service preserves the default styles of the imported Word document.
|
|
110
|
-
*
|
|
111
|
-
* @default 'inline'
|
|
112
|
-
*/
|
|
113
|
-
styles?: 'none' | 'inline';
|
|
114
|
-
/**
|
|
115
|
-
* Defines which formatting styles should be kept for the imported comments text.
|
|
116
|
-
*
|
|
117
|
-
* Possible values are:
|
|
118
|
-
*
|
|
119
|
-
* * `'basic'` - basic styles are kept (bold, italic, underline, strikethrough and links),
|
|
120
|
-
* * `'none'` - comment text is imported without any styling,
|
|
121
|
-
* * `'full'` - all styles are kept (not recommended).
|
|
122
|
-
*
|
|
123
|
-
* **Note:** Please remember that importing comments requires installing the {@link module:comments/comments~Comments} feature.
|
|
124
|
-
*
|
|
125
|
-
* @default 'basic'
|
|
126
|
-
*/
|
|
127
|
-
comments?: 'basic' | 'none' | 'full';
|
|
128
|
-
}
|
|
@@ -1,58 +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 import-word/importwordcommand
|
|
11
|
-
* @publicApi
|
|
12
|
-
*/
|
|
13
|
-
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
-
/**
|
|
15
|
-
* The import from Word command.
|
|
16
|
-
*
|
|
17
|
-
* It sends the Word file to the converter endpoint and inserts its content into the editor.
|
|
18
|
-
*/
|
|
19
|
-
export default class ImportWordCommand extends Command {
|
|
20
|
-
/**
|
|
21
|
-
* A command state that indicates if the command is currently executing.
|
|
22
|
-
*
|
|
23
|
-
* @observable
|
|
24
|
-
*/
|
|
25
|
-
isBusy: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* @inheritDoc
|
|
28
|
-
*/
|
|
29
|
-
constructor(editor: Editor);
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
refresh(): void;
|
|
34
|
-
/**
|
|
35
|
-
* Executes the command. Sends the provided file instance to the converter service endpoint and inserts the result into the model.
|
|
36
|
-
*
|
|
37
|
-
* @fires execute
|
|
38
|
-
* @param file The Word file instance to be uploaded for conversion.
|
|
39
|
-
* @param [serviceConfig] Additional options to pass to the converter service.
|
|
40
|
-
*/
|
|
41
|
-
execute(file: File, serviceConfig?: Record<string, unknown>): Promise<unknown>;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Fired when the converter service returned the HTML content that will be inserted into the editor.
|
|
45
|
-
*
|
|
46
|
-
* @eventName ~ImportWordCommand#dataInsert
|
|
47
|
-
*/
|
|
48
|
-
export type DataInsertEvent = {
|
|
49
|
-
name: 'dataInsert';
|
|
50
|
-
args: [data: DataInsertEventData];
|
|
51
|
-
};
|
|
52
|
-
interface DataInsertEventData {
|
|
53
|
-
/**
|
|
54
|
-
* The HTML content to insertion.
|
|
55
|
-
*/
|
|
56
|
-
html: string;
|
|
57
|
-
}
|
|
58
|
-
export {};
|
|
@@ -1,43 +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 import-word/importwordediting
|
|
11
|
-
* @publicApi
|
|
12
|
-
*/
|
|
13
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
-
import { Notification } from 'ckeditor5/src/ui.js';
|
|
15
|
-
import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
|
|
16
|
-
import type { InitializedToken } from '@ckeditor/ckeditor5-cloud-services';
|
|
17
|
-
/**
|
|
18
|
-
* The editing part of the import from Word feature.
|
|
19
|
-
*
|
|
20
|
-
* It registers the {@link module:import-word/importwordcommand~ImportWordCommand `'importWord'` command}.
|
|
21
|
-
*/
|
|
22
|
-
export default class ImportWordEditing extends Plugin {
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
static get pluginName(): "ImportWordEditing";
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
static get requires(): readonly [typeof Notification, typeof ClipboardPipeline, "CloudServices"];
|
|
31
|
-
/**
|
|
32
|
-
* @inheritDoc
|
|
33
|
-
*/
|
|
34
|
-
constructor(editor: Editor);
|
|
35
|
-
/**
|
|
36
|
-
* @inheritDoc
|
|
37
|
-
*/
|
|
38
|
-
init(): Promise<void>;
|
|
39
|
-
/**
|
|
40
|
-
* Returns a token used by the import from Word plugin for communication with the Cloud Services.
|
|
41
|
-
*/
|
|
42
|
-
getToken(): InitializedToken | null;
|
|
43
|
-
}
|
|
@@ -1,26 +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 import-word/importwordui
|
|
11
|
-
* @publicApi
|
|
12
|
-
*/
|
|
13
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
14
|
-
/**
|
|
15
|
-
* The ImportWordUI plugin. It introduces the `'importWord'` toolbar button.
|
|
16
|
-
*/
|
|
17
|
-
export default class ImportWordUI extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get pluginName(): "ImportWordUI";
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
init(): void;
|
|
26
|
-
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,16 +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 import-word
|
|
11
|
-
*/
|
|
12
|
-
export { default as ImportWord, type ImportWordConfig } from './importword.js';
|
|
13
|
-
export { default as ImportWordEditing } from './importwordediting.js';
|
|
14
|
-
export { default as ImportWordUI } from './importwordui.js';
|
|
15
|
-
export type { default as ImportWordCommand } from './importwordcommand.js';
|
|
16
|
-
import './augmentation.js';
|