@ckeditor/ckeditor5-core 40.0.0 → 40.2.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 +28 -28
- package/LICENSE.md +3 -3
- package/README.md +1 -1
- package/lang/contexts.json +5 -1
- package/lang/translations/af.po +16 -0
- package/lang/translations/ar.po +16 -0
- package/lang/translations/ast.po +16 -0
- package/lang/translations/az.po +16 -0
- package/lang/translations/bg.po +16 -0
- package/lang/translations/bn.po +16 -0
- package/lang/translations/bs.po +16 -0
- package/lang/translations/ca.po +16 -0
- package/lang/translations/cs.po +16 -0
- package/lang/translations/da.po +16 -0
- package/lang/translations/de-ch.po +16 -0
- package/lang/translations/de.po +16 -0
- package/lang/translations/el.po +16 -0
- package/lang/translations/en-au.po +16 -0
- package/lang/translations/en-gb.po +16 -0
- package/lang/translations/en.po +16 -0
- package/lang/translations/eo.po +16 -0
- package/lang/translations/es-co.po +16 -0
- package/lang/translations/es.po +16 -0
- package/lang/translations/et.po +16 -0
- package/lang/translations/eu.po +16 -0
- package/lang/translations/fa.po +16 -0
- package/lang/translations/fi.po +16 -0
- package/lang/translations/fr.po +16 -0
- package/lang/translations/gl.po +16 -0
- package/lang/translations/gu.po +16 -0
- package/lang/translations/he.po +16 -0
- package/lang/translations/hi.po +16 -0
- package/lang/translations/hr.po +16 -0
- package/lang/translations/hu.po +16 -0
- package/lang/translations/hy.po +16 -0
- package/lang/translations/id.po +16 -0
- package/lang/translations/it.po +16 -0
- package/lang/translations/ja.po +16 -0
- package/lang/translations/jv.po +16 -0
- package/lang/translations/km.po +16 -0
- package/lang/translations/kn.po +16 -0
- package/lang/translations/ko.po +16 -0
- package/lang/translations/ku.po +16 -0
- package/lang/translations/lt.po +16 -0
- package/lang/translations/lv.po +16 -0
- package/lang/translations/ms.po +16 -0
- package/lang/translations/nb.po +16 -0
- package/lang/translations/ne.po +16 -0
- package/lang/translations/nl.po +16 -0
- package/lang/translations/no.po +16 -0
- package/lang/translations/oc.po +16 -0
- package/lang/translations/pl.po +16 -0
- package/lang/translations/pt-br.po +16 -0
- package/lang/translations/pt.po +16 -0
- package/lang/translations/ro.po +16 -0
- package/lang/translations/ru.po +16 -0
- package/lang/translations/si.po +16 -0
- package/lang/translations/sk.po +16 -0
- package/lang/translations/sl.po +16 -0
- package/lang/translations/sq.po +16 -0
- package/lang/translations/sr-latn.po +17 -1
- package/lang/translations/sr.po +16 -0
- package/lang/translations/sv.po +16 -0
- package/lang/translations/th.po +16 -0
- package/lang/translations/tk.po +16 -0
- package/lang/translations/tr.po +16 -0
- package/lang/translations/tt.po +16 -0
- package/lang/translations/ug.po +17 -1
- package/lang/translations/uk.po +16 -0
- package/lang/translations/ur.po +16 -0
- package/lang/translations/uz.po +16 -0
- package/lang/translations/vi.po +16 -0
- package/lang/translations/zh-cn.po +16 -0
- package/lang/translations/zh.po +16 -0
- package/package.json +3 -3
- package/src/augmentation.d.ts +10 -10
- package/src/augmentation.js +5 -5
- package/src/command.d.ts +189 -189
- package/src/command.js +185 -185
- package/src/commandcollection.d.ts +83 -83
- package/src/commandcollection.js +83 -83
- package/src/context.d.ts +237 -237
- package/src/context.js +225 -225
- package/src/contextplugin.d.ts +61 -61
- package/src/contextplugin.js +43 -43
- package/src/editingkeystrokehandler.d.ts +56 -56
- package/src/editingkeystrokehandler.js +57 -57
- package/src/editor/editor.d.ts +417 -417
- package/src/editor/editor.js +316 -316
- package/src/editor/editorconfig.d.ts +661 -660
- package/src/editor/editorconfig.js +5 -5
- package/src/editor/utils/attachtoform.d.ts +15 -15
- package/src/editor/utils/attachtoform.js +57 -57
- package/src/editor/utils/dataapimixin.d.ts +75 -75
- package/src/editor/utils/dataapimixin.js +24 -24
- package/src/editor/utils/elementapimixin.d.ts +35 -31
- package/src/editor/utils/elementapimixin.js +43 -42
- package/src/editor/utils/securesourceelement.d.ts +17 -17
- package/src/editor/utils/securesourceelement.js +35 -35
- package/src/index.d.ts +66 -62
- package/src/index.js +103 -95
- package/src/multicommand.d.ts +66 -66
- package/src/multicommand.js +82 -82
- package/src/pendingactions.d.ts +117 -117
- package/src/pendingactions.js +116 -116
- package/src/plugin.d.ts +274 -274
- package/src/plugin.js +106 -106
- package/src/plugincollection.d.ts +117 -117
- package/src/plugincollection.js +473 -473
- package/theme/icons/image-asset-manager.svg +1 -0
- package/theme/icons/image-upload.svg +1 -0
- package/theme/icons/image-url.svg +1 -0
- package/theme/icons/image.svg +1 -1
- package/theme/icons/low-vision.svg +1 -1
- package/theme/icons/text-alternative.svg +1 -0
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, 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 core/editingkeystrokehandler
|
|
7
|
-
*/
|
|
8
|
-
import { KeystrokeHandler, type PriorityString } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
import type Editor from './editor/editor';
|
|
10
|
-
/**
|
|
11
|
-
* A keystroke handler for editor editing. Its instance is available
|
|
12
|
-
* in {@link module:core/editor/editor~Editor#keystrokes} so plugins
|
|
13
|
-
* can register their keystrokes.
|
|
14
|
-
*
|
|
15
|
-
* E.g. an undo plugin would do this:
|
|
16
|
-
*
|
|
17
|
-
* ```ts
|
|
18
|
-
* editor.keystrokes.set( 'Ctrl+Z', 'undo' );
|
|
19
|
-
* editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
|
|
20
|
-
* editor.keystrokes.set( 'Ctrl+Y', 'redo' );
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export default class EditingKeystrokeHandler extends KeystrokeHandler {
|
|
24
|
-
/**
|
|
25
|
-
* The editor instance.
|
|
26
|
-
*/
|
|
27
|
-
readonly editor: Editor;
|
|
28
|
-
/**
|
|
29
|
-
* Creates an instance of the keystroke handler.
|
|
30
|
-
*/
|
|
31
|
-
constructor(editor: Editor);
|
|
32
|
-
/**
|
|
33
|
-
* Registers a handler for the specified keystroke.
|
|
34
|
-
*
|
|
35
|
-
* The handler can be specified as a command name or a callback.
|
|
36
|
-
*
|
|
37
|
-
* @param keystroke Keystroke defined in a format accepted by
|
|
38
|
-
* the {@link module:utils/keyboard~parseKeystroke} function.
|
|
39
|
-
* @param callback If a string is passed, then the keystroke will
|
|
40
|
-
* {@link module:core/editor/editor~Editor#execute execute a command}.
|
|
41
|
-
* If a function, then it will be called with the
|
|
42
|
-
* {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
|
|
43
|
-
* a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
|
|
44
|
-
* @param options Additional options.
|
|
45
|
-
* @param options.priority The priority of the keystroke callback. The higher the priority value
|
|
46
|
-
* the sooner the callback will be executed. Keystrokes having the same priority
|
|
47
|
-
* are called in the order they were added.
|
|
48
|
-
*/
|
|
49
|
-
set(keystroke: string | Array<string | number>, callback: EditingKeystrokeCallback, options?: {
|
|
50
|
-
readonly priority?: PriorityString;
|
|
51
|
-
}): void;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Command name or a callback to be executed when a given keystroke is pressed.
|
|
55
|
-
*/
|
|
56
|
-
export type EditingKeystrokeCallback = string | ((ev: KeyboardEvent, cancel: () => void) => void);
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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 core/editingkeystrokehandler
|
|
7
|
+
*/
|
|
8
|
+
import { KeystrokeHandler, type PriorityString } from '@ckeditor/ckeditor5-utils';
|
|
9
|
+
import type Editor from './editor/editor';
|
|
10
|
+
/**
|
|
11
|
+
* A keystroke handler for editor editing. Its instance is available
|
|
12
|
+
* in {@link module:core/editor/editor~Editor#keystrokes} so plugins
|
|
13
|
+
* can register their keystrokes.
|
|
14
|
+
*
|
|
15
|
+
* E.g. an undo plugin would do this:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* editor.keystrokes.set( 'Ctrl+Z', 'undo' );
|
|
19
|
+
* editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
|
|
20
|
+
* editor.keystrokes.set( 'Ctrl+Y', 'redo' );
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export default class EditingKeystrokeHandler extends KeystrokeHandler {
|
|
24
|
+
/**
|
|
25
|
+
* The editor instance.
|
|
26
|
+
*/
|
|
27
|
+
readonly editor: Editor;
|
|
28
|
+
/**
|
|
29
|
+
* Creates an instance of the keystroke handler.
|
|
30
|
+
*/
|
|
31
|
+
constructor(editor: Editor);
|
|
32
|
+
/**
|
|
33
|
+
* Registers a handler for the specified keystroke.
|
|
34
|
+
*
|
|
35
|
+
* The handler can be specified as a command name or a callback.
|
|
36
|
+
*
|
|
37
|
+
* @param keystroke Keystroke defined in a format accepted by
|
|
38
|
+
* the {@link module:utils/keyboard~parseKeystroke} function.
|
|
39
|
+
* @param callback If a string is passed, then the keystroke will
|
|
40
|
+
* {@link module:core/editor/editor~Editor#execute execute a command}.
|
|
41
|
+
* If a function, then it will be called with the
|
|
42
|
+
* {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
|
|
43
|
+
* a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
|
|
44
|
+
* @param options Additional options.
|
|
45
|
+
* @param options.priority The priority of the keystroke callback. The higher the priority value
|
|
46
|
+
* the sooner the callback will be executed. Keystrokes having the same priority
|
|
47
|
+
* are called in the order they were added.
|
|
48
|
+
*/
|
|
49
|
+
set(keystroke: string | Array<string | number>, callback: EditingKeystrokeCallback, options?: {
|
|
50
|
+
readonly priority?: PriorityString;
|
|
51
|
+
}): void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Command name or a callback to be executed when a given keystroke is pressed.
|
|
55
|
+
*/
|
|
56
|
+
export type EditingKeystrokeCallback = string | ((ev: KeyboardEvent, cancel: () => void) => void);
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, 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 core/editingkeystrokehandler
|
|
7
|
-
*/
|
|
8
|
-
import { KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
/**
|
|
10
|
-
* A keystroke handler for editor editing. Its instance is available
|
|
11
|
-
* in {@link module:core/editor/editor~Editor#keystrokes} so plugins
|
|
12
|
-
* can register their keystrokes.
|
|
13
|
-
*
|
|
14
|
-
* E.g. an undo plugin would do this:
|
|
15
|
-
*
|
|
16
|
-
* ```ts
|
|
17
|
-
* editor.keystrokes.set( 'Ctrl+Z', 'undo' );
|
|
18
|
-
* editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
|
|
19
|
-
* editor.keystrokes.set( 'Ctrl+Y', 'redo' );
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export default class EditingKeystrokeHandler extends KeystrokeHandler {
|
|
23
|
-
/**
|
|
24
|
-
* Creates an instance of the keystroke handler.
|
|
25
|
-
*/
|
|
26
|
-
constructor(editor) {
|
|
27
|
-
super();
|
|
28
|
-
this.editor = editor;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Registers a handler for the specified keystroke.
|
|
32
|
-
*
|
|
33
|
-
* The handler can be specified as a command name or a callback.
|
|
34
|
-
*
|
|
35
|
-
* @param keystroke Keystroke defined in a format accepted by
|
|
36
|
-
* the {@link module:utils/keyboard~parseKeystroke} function.
|
|
37
|
-
* @param callback If a string is passed, then the keystroke will
|
|
38
|
-
* {@link module:core/editor/editor~Editor#execute execute a command}.
|
|
39
|
-
* If a function, then it will be called with the
|
|
40
|
-
* {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
|
|
41
|
-
* a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
|
|
42
|
-
* @param options Additional options.
|
|
43
|
-
* @param options.priority The priority of the keystroke callback. The higher the priority value
|
|
44
|
-
* the sooner the callback will be executed. Keystrokes having the same priority
|
|
45
|
-
* are called in the order they were added.
|
|
46
|
-
*/
|
|
47
|
-
set(keystroke, callback, options = {}) {
|
|
48
|
-
if (typeof callback == 'string') {
|
|
49
|
-
const commandName = callback;
|
|
50
|
-
callback = (evtData, cancel) => {
|
|
51
|
-
this.editor.execute(commandName);
|
|
52
|
-
cancel();
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
super.set(keystroke, callback, options);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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 core/editingkeystrokehandler
|
|
7
|
+
*/
|
|
8
|
+
import { KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
9
|
+
/**
|
|
10
|
+
* A keystroke handler for editor editing. Its instance is available
|
|
11
|
+
* in {@link module:core/editor/editor~Editor#keystrokes} so plugins
|
|
12
|
+
* can register their keystrokes.
|
|
13
|
+
*
|
|
14
|
+
* E.g. an undo plugin would do this:
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* editor.keystrokes.set( 'Ctrl+Z', 'undo' );
|
|
18
|
+
* editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
|
|
19
|
+
* editor.keystrokes.set( 'Ctrl+Y', 'redo' );
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export default class EditingKeystrokeHandler extends KeystrokeHandler {
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of the keystroke handler.
|
|
25
|
+
*/
|
|
26
|
+
constructor(editor) {
|
|
27
|
+
super();
|
|
28
|
+
this.editor = editor;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Registers a handler for the specified keystroke.
|
|
32
|
+
*
|
|
33
|
+
* The handler can be specified as a command name or a callback.
|
|
34
|
+
*
|
|
35
|
+
* @param keystroke Keystroke defined in a format accepted by
|
|
36
|
+
* the {@link module:utils/keyboard~parseKeystroke} function.
|
|
37
|
+
* @param callback If a string is passed, then the keystroke will
|
|
38
|
+
* {@link module:core/editor/editor~Editor#execute execute a command}.
|
|
39
|
+
* If a function, then it will be called with the
|
|
40
|
+
* {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
|
|
41
|
+
* a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
|
|
42
|
+
* @param options Additional options.
|
|
43
|
+
* @param options.priority The priority of the keystroke callback. The higher the priority value
|
|
44
|
+
* the sooner the callback will be executed. Keystrokes having the same priority
|
|
45
|
+
* are called in the order they were added.
|
|
46
|
+
*/
|
|
47
|
+
set(keystroke, callback, options = {}) {
|
|
48
|
+
if (typeof callback == 'string') {
|
|
49
|
+
const commandName = callback;
|
|
50
|
+
callback = (evtData, cancel) => {
|
|
51
|
+
this.editor.execute(commandName);
|
|
52
|
+
cancel();
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
super.set(keystroke, callback, options);
|
|
56
|
+
}
|
|
57
|
+
}
|