@ckeditor/ckeditor5-core 44.1.0 → 44.2.0-alpha.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/LICENSE.md +1 -1
- package/dist/index-content.css +2 -2
- package/dist/index-editor.css +2 -2
- package/dist/index.css +2 -2
- package/dist/index.js +21 -7
- package/dist/index.js.map +1 -1
- package/dist/translations/af.d.ts +2 -2
- package/dist/translations/af.js +3 -3
- package/dist/translations/af.umd.js +3 -3
- package/dist/translations/ar.d.ts +2 -2
- package/dist/translations/ar.js +3 -3
- package/dist/translations/ar.umd.js +3 -3
- package/dist/translations/ast.d.ts +2 -2
- package/dist/translations/ast.js +3 -3
- package/dist/translations/ast.umd.js +3 -3
- package/dist/translations/az.d.ts +2 -2
- package/dist/translations/az.js +3 -3
- package/dist/translations/az.umd.js +3 -3
- package/dist/translations/bg.d.ts +2 -2
- package/dist/translations/bg.js +3 -3
- package/dist/translations/bg.umd.js +3 -3
- package/dist/translations/bn.d.ts +2 -2
- package/dist/translations/bn.js +3 -3
- package/dist/translations/bn.umd.js +3 -3
- package/dist/translations/bs.d.ts +2 -2
- package/dist/translations/bs.js +3 -3
- package/dist/translations/bs.umd.js +3 -3
- package/dist/translations/ca.d.ts +2 -2
- package/dist/translations/ca.js +3 -3
- package/dist/translations/ca.umd.js +3 -3
- package/dist/translations/cs.d.ts +2 -2
- package/dist/translations/cs.js +3 -3
- package/dist/translations/cs.umd.js +3 -3
- package/dist/translations/da.d.ts +2 -2
- package/dist/translations/da.js +3 -3
- package/dist/translations/da.umd.js +3 -3
- package/dist/translations/de-ch.d.ts +2 -2
- package/dist/translations/de-ch.js +3 -3
- package/dist/translations/de-ch.umd.js +3 -3
- package/dist/translations/de.d.ts +2 -2
- package/dist/translations/de.js +3 -3
- package/dist/translations/de.umd.js +3 -3
- package/dist/translations/el.d.ts +2 -2
- package/dist/translations/el.js +3 -3
- package/dist/translations/el.umd.js +3 -3
- package/dist/translations/en-au.d.ts +2 -2
- package/dist/translations/en-au.js +3 -3
- package/dist/translations/en-au.umd.js +3 -3
- package/dist/translations/en-gb.d.ts +2 -2
- package/dist/translations/en-gb.js +3 -3
- package/dist/translations/en-gb.umd.js +3 -3
- package/dist/translations/en.d.ts +2 -2
- package/dist/translations/en.js +3 -3
- package/dist/translations/en.umd.js +3 -3
- package/dist/translations/eo.d.ts +2 -2
- package/dist/translations/eo.js +3 -3
- package/dist/translations/eo.umd.js +3 -3
- package/dist/translations/es-co.d.ts +2 -2
- package/dist/translations/es-co.js +3 -3
- package/dist/translations/es-co.umd.js +3 -3
- package/dist/translations/es.d.ts +2 -2
- package/dist/translations/es.js +3 -3
- package/dist/translations/es.umd.js +3 -3
- package/dist/translations/et.d.ts +2 -2
- package/dist/translations/et.js +3 -3
- package/dist/translations/et.umd.js +3 -3
- package/dist/translations/eu.d.ts +2 -2
- package/dist/translations/eu.js +3 -3
- package/dist/translations/eu.umd.js +3 -3
- package/dist/translations/fa.d.ts +2 -2
- package/dist/translations/fa.js +3 -3
- package/dist/translations/fa.umd.js +3 -3
- package/dist/translations/fi.d.ts +2 -2
- package/dist/translations/fi.js +3 -3
- package/dist/translations/fi.umd.js +3 -3
- package/dist/translations/fr.d.ts +2 -2
- package/dist/translations/fr.js +3 -3
- package/dist/translations/fr.umd.js +3 -3
- package/dist/translations/gl.d.ts +2 -2
- package/dist/translations/gl.js +3 -3
- package/dist/translations/gl.umd.js +3 -3
- package/dist/translations/gu.d.ts +2 -2
- package/dist/translations/gu.js +3 -3
- package/dist/translations/gu.umd.js +3 -3
- package/dist/translations/he.d.ts +2 -2
- package/dist/translations/he.js +3 -3
- package/dist/translations/he.umd.js +3 -3
- package/dist/translations/hi.d.ts +2 -2
- package/dist/translations/hi.js +3 -3
- package/dist/translations/hi.umd.js +3 -3
- package/dist/translations/hr.d.ts +2 -2
- package/dist/translations/hr.js +3 -3
- package/dist/translations/hr.umd.js +3 -3
- package/dist/translations/hu.d.ts +2 -2
- package/dist/translations/hu.js +3 -3
- package/dist/translations/hu.umd.js +3 -3
- package/dist/translations/hy.d.ts +2 -2
- package/dist/translations/hy.js +3 -3
- package/dist/translations/hy.umd.js +3 -3
- package/dist/translations/id.d.ts +2 -2
- package/dist/translations/id.js +3 -3
- package/dist/translations/id.umd.js +3 -3
- package/dist/translations/it.d.ts +2 -2
- package/dist/translations/it.js +3 -3
- package/dist/translations/it.umd.js +3 -3
- package/dist/translations/ja.d.ts +2 -2
- package/dist/translations/ja.js +3 -3
- package/dist/translations/ja.umd.js +3 -3
- package/dist/translations/jv.d.ts +2 -2
- package/dist/translations/jv.js +3 -3
- package/dist/translations/jv.umd.js +3 -3
- package/dist/translations/kk.d.ts +2 -2
- package/dist/translations/kk.js +3 -3
- package/dist/translations/kk.umd.js +3 -3
- package/dist/translations/km.d.ts +2 -2
- package/dist/translations/km.js +3 -3
- package/dist/translations/km.umd.js +3 -3
- package/dist/translations/kn.d.ts +2 -2
- package/dist/translations/kn.js +3 -3
- package/dist/translations/kn.umd.js +3 -3
- package/dist/translations/ko.d.ts +2 -2
- package/dist/translations/ko.js +3 -3
- package/dist/translations/ko.umd.js +3 -3
- package/dist/translations/ku.d.ts +2 -2
- package/dist/translations/ku.js +3 -3
- package/dist/translations/ku.umd.js +3 -3
- package/dist/translations/lt.d.ts +2 -2
- package/dist/translations/lt.js +3 -3
- package/dist/translations/lt.umd.js +3 -3
- package/dist/translations/lv.d.ts +2 -2
- package/dist/translations/lv.js +3 -3
- package/dist/translations/lv.umd.js +3 -3
- package/dist/translations/ms.d.ts +2 -2
- package/dist/translations/ms.js +3 -3
- package/dist/translations/ms.umd.js +3 -3
- package/dist/translations/nb.d.ts +2 -2
- package/dist/translations/nb.js +3 -3
- package/dist/translations/nb.umd.js +3 -3
- package/dist/translations/ne.d.ts +2 -2
- package/dist/translations/ne.js +3 -3
- package/dist/translations/ne.umd.js +3 -3
- package/dist/translations/nl.d.ts +2 -2
- package/dist/translations/nl.js +3 -3
- package/dist/translations/nl.umd.js +3 -3
- package/dist/translations/no.d.ts +2 -2
- package/dist/translations/no.js +3 -3
- package/dist/translations/no.umd.js +3 -3
- package/dist/translations/oc.d.ts +2 -2
- package/dist/translations/oc.js +3 -3
- package/dist/translations/oc.umd.js +3 -3
- package/dist/translations/pl.d.ts +2 -2
- package/dist/translations/pl.js +3 -3
- package/dist/translations/pl.umd.js +3 -3
- package/dist/translations/pt-br.d.ts +2 -2
- package/dist/translations/pt-br.js +3 -3
- package/dist/translations/pt-br.umd.js +3 -3
- package/dist/translations/pt.d.ts +2 -2
- package/dist/translations/pt.js +3 -3
- package/dist/translations/pt.umd.js +3 -3
- package/dist/translations/ro.d.ts +2 -2
- package/dist/translations/ro.js +3 -3
- package/dist/translations/ro.umd.js +3 -3
- package/dist/translations/ru.d.ts +2 -2
- package/dist/translations/ru.js +3 -3
- package/dist/translations/ru.umd.js +3 -3
- package/dist/translations/si.d.ts +2 -2
- package/dist/translations/si.js +3 -3
- package/dist/translations/si.umd.js +3 -3
- package/dist/translations/sk.d.ts +2 -2
- package/dist/translations/sk.js +3 -3
- package/dist/translations/sk.umd.js +3 -3
- package/dist/translations/sl.d.ts +2 -2
- package/dist/translations/sl.js +3 -3
- package/dist/translations/sl.umd.js +3 -3
- package/dist/translations/sq.d.ts +2 -2
- package/dist/translations/sq.js +3 -3
- package/dist/translations/sq.umd.js +3 -3
- package/dist/translations/sr-latn.d.ts +2 -2
- package/dist/translations/sr-latn.js +3 -3
- package/dist/translations/sr-latn.umd.js +3 -3
- package/dist/translations/sr.d.ts +2 -2
- package/dist/translations/sr.js +3 -3
- package/dist/translations/sr.umd.js +3 -3
- package/dist/translations/sv.d.ts +2 -2
- package/dist/translations/sv.js +3 -3
- package/dist/translations/sv.umd.js +3 -3
- package/dist/translations/th.d.ts +2 -2
- package/dist/translations/th.js +3 -3
- package/dist/translations/th.umd.js +3 -3
- package/dist/translations/ti.d.ts +2 -2
- package/dist/translations/ti.js +3 -3
- package/dist/translations/ti.umd.js +3 -3
- package/dist/translations/tk.d.ts +2 -2
- package/dist/translations/tk.js +3 -3
- package/dist/translations/tk.umd.js +3 -3
- package/dist/translations/tr.d.ts +2 -2
- package/dist/translations/tr.js +3 -3
- package/dist/translations/tr.umd.js +3 -3
- package/dist/translations/tt.d.ts +2 -2
- package/dist/translations/tt.js +3 -3
- package/dist/translations/tt.umd.js +3 -3
- package/dist/translations/ug.d.ts +2 -2
- package/dist/translations/ug.js +3 -3
- package/dist/translations/ug.umd.js +3 -3
- package/dist/translations/uk.d.ts +2 -2
- package/dist/translations/uk.js +3 -3
- package/dist/translations/uk.umd.js +3 -3
- package/dist/translations/ur.d.ts +2 -2
- package/dist/translations/ur.js +3 -3
- package/dist/translations/ur.umd.js +3 -3
- package/dist/translations/uz.d.ts +2 -2
- package/dist/translations/uz.js +3 -3
- package/dist/translations/uz.umd.js +3 -3
- package/dist/translations/vi.d.ts +2 -2
- package/dist/translations/vi.js +3 -3
- package/dist/translations/vi.umd.js +3 -3
- package/dist/translations/zh-cn.d.ts +2 -2
- package/dist/translations/zh-cn.js +3 -3
- package/dist/translations/zh-cn.umd.js +3 -3
- package/dist/translations/zh.d.ts +2 -2
- package/dist/translations/zh.js +3 -3
- package/dist/translations/zh.umd.js +3 -3
- package/lang/contexts.json +3 -1
- package/lang/translations/af.po +9 -1
- package/lang/translations/ar.po +9 -1
- package/lang/translations/ast.po +9 -1
- package/lang/translations/az.po +9 -1
- package/lang/translations/bg.po +9 -1
- package/lang/translations/bn.po +9 -1
- package/lang/translations/bs.po +9 -1
- package/lang/translations/ca.po +9 -1
- package/lang/translations/cs.po +9 -1
- package/lang/translations/da.po +9 -1
- package/lang/translations/de-ch.po +9 -1
- package/lang/translations/de.po +9 -1
- package/lang/translations/el.po +9 -1
- package/lang/translations/en-au.po +9 -1
- package/lang/translations/en-gb.po +9 -1
- package/lang/translations/en.po +9 -1
- package/lang/translations/eo.po +9 -1
- package/lang/translations/es-co.po +9 -1
- package/lang/translations/es.po +9 -1
- package/lang/translations/et.po +9 -1
- package/lang/translations/eu.po +9 -1
- package/lang/translations/fa.po +9 -1
- package/lang/translations/fi.po +9 -1
- package/lang/translations/fr.po +9 -1
- package/lang/translations/gl.po +9 -1
- package/lang/translations/gu.po +9 -1
- package/lang/translations/he.po +9 -1
- package/lang/translations/hi.po +9 -1
- package/lang/translations/hr.po +9 -1
- package/lang/translations/hu.po +9 -1
- package/lang/translations/hy.po +9 -1
- package/lang/translations/id.po +9 -1
- package/lang/translations/it.po +9 -1
- package/lang/translations/ja.po +9 -1
- package/lang/translations/jv.po +9 -1
- package/lang/translations/kk.po +9 -1
- package/lang/translations/km.po +9 -1
- package/lang/translations/kn.po +9 -1
- package/lang/translations/ko.po +9 -1
- package/lang/translations/ku.po +9 -1
- package/lang/translations/lt.po +9 -1
- package/lang/translations/lv.po +9 -1
- package/lang/translations/ms.po +9 -1
- package/lang/translations/nb.po +9 -1
- package/lang/translations/ne.po +9 -1
- package/lang/translations/nl.po +9 -1
- package/lang/translations/no.po +9 -1
- package/lang/translations/oc.po +9 -1
- package/lang/translations/pl.po +9 -1
- package/lang/translations/pt-br.po +9 -1
- package/lang/translations/pt.po +9 -1
- package/lang/translations/ro.po +9 -1
- package/lang/translations/ru.po +9 -1
- package/lang/translations/si.po +9 -1
- package/lang/translations/sk.po +9 -1
- package/lang/translations/sl.po +9 -1
- package/lang/translations/sq.po +9 -1
- package/lang/translations/sr-latn.po +9 -1
- package/lang/translations/sr.po +9 -1
- package/lang/translations/sv.po +9 -1
- package/lang/translations/th.po +9 -1
- package/lang/translations/ti.po +9 -1
- package/lang/translations/tk.po +9 -1
- package/lang/translations/tr.po +9 -1
- package/lang/translations/tt.po +9 -1
- package/lang/translations/ug.po +9 -1
- package/lang/translations/uk.po +9 -1
- package/lang/translations/ur.po +9 -1
- package/lang/translations/uz.po +9 -1
- package/lang/translations/vi.po +9 -1
- package/lang/translations/zh-cn.po +9 -1
- package/lang/translations/zh.po +9 -1
- package/package.json +27 -5
- package/src/accessibility.d.ts +1 -1
- package/src/accessibility.js +1 -1
- package/src/augmentation.d.ts +1 -1
- package/src/augmentation.js +1 -1
- package/src/command.d.ts +1 -1
- package/src/command.js +1 -1
- package/src/commandcollection.d.ts +1 -1
- package/src/commandcollection.js +1 -1
- package/src/context.d.ts +1 -1
- package/src/context.js +1 -1
- package/src/contextplugin.d.ts +1 -1
- package/src/contextplugin.js +1 -1
- package/src/editingkeystrokehandler.d.ts +1 -1
- package/src/editingkeystrokehandler.js +1 -1
- package/src/editor/editor.d.ts +1 -1
- package/src/editor/editor.js +10 -4
- package/src/editor/editorconfig.d.ts +1 -1
- package/src/editor/editorconfig.js +1 -1
- package/src/editor/utils/attachtoform.d.ts +1 -1
- package/src/editor/utils/attachtoform.js +1 -1
- package/src/editor/utils/dataapimixin.d.ts +1 -1
- package/src/editor/utils/dataapimixin.js +1 -1
- package/src/editor/utils/editorusagedata.d.ts +1 -1
- package/src/editor/utils/editorusagedata.js +1 -1
- package/src/editor/utils/elementapimixin.d.ts +1 -1
- package/src/editor/utils/elementapimixin.js +1 -1
- package/src/editor/utils/securesourceelement.d.ts +1 -1
- package/src/editor/utils/securesourceelement.js +1 -1
- package/src/index.d.ts +3 -1
- package/src/index.js +6 -2
- package/src/multicommand.d.ts +1 -1
- package/src/multicommand.js +1 -1
- package/src/pendingactions.d.ts +1 -1
- package/src/pendingactions.js +1 -1
- package/src/plugin.d.ts +1 -1
- package/src/plugin.js +1 -1
- package/src/plugincollection.d.ts +1 -1
- package/src/plugincollection.js +1 -1
- package/src/typings.d.ts +1 -1
- package/src/typings.js +1 -1
- package/theme/icons/emoji.svg +1 -0
- package/theme/icons/source.svg +1 -0
- package/dist/accessibility.d.ts +0 -365
- package/dist/augmentation.d.ts +0 -14
- package/dist/command.d.ts +0 -193
- package/dist/commandcollection.d.ts +0 -87
- package/dist/context.d.ts +0 -241
- package/dist/contextplugin.d.ts +0 -73
- package/dist/editingkeystrokehandler.d.ts +0 -60
- package/dist/editor/editor.d.ts +0 -530
- package/dist/editor/editorconfig.d.ts +0 -994
- package/dist/editor/utils/attachtoform.d.ts +0 -19
- package/dist/editor/utils/dataapimixin.d.ts +0 -83
- package/dist/editor/utils/editorusagedata.d.ts +0 -72
- package/dist/editor/utils/elementapimixin.d.ts +0 -39
- package/dist/editor/utils/securesourceelement.d.ts +0 -21
- package/dist/index.d.ts +0 -97
- package/dist/multicommand.d.ts +0 -70
- package/dist/pendingactions.d.ts +0 -126
- package/dist/plugin.d.ts +0 -300
- package/dist/plugincollection.d.ts +0 -121
- package/dist/typings.d.ts +0 -16
package/dist/plugin.d.ts
DELETED
|
@@ -1,300 +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-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
import type Editor from './editor/editor.js';
|
|
10
|
-
declare const Plugin_base: {
|
|
11
|
-
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
|
12
|
-
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* The base class for CKEditor plugin classes.
|
|
16
|
-
*/
|
|
17
|
-
export default class Plugin extends /* #__PURE__ */ Plugin_base implements PluginInterface {
|
|
18
|
-
/**
|
|
19
|
-
* The editor instance.
|
|
20
|
-
*
|
|
21
|
-
* Note that most editors implement the {@link module:core/editor/editor~Editor#ui} property.
|
|
22
|
-
* However, editors with an external UI (i.e. Bootstrap-based) or a headless editor may not have this property or
|
|
23
|
-
* throw an error when accessing it.
|
|
24
|
-
*
|
|
25
|
-
* Because of above, to make plugins more universal, it is recommended to split features into:
|
|
26
|
-
* - The "editing" part that uses the {@link module:core/editor/editor~Editor} class without `ui` property.
|
|
27
|
-
* - The "UI" part that uses the {@link module:core/editor/editor~Editor} class and accesses `ui` property.
|
|
28
|
-
*/
|
|
29
|
-
readonly editor: Editor;
|
|
30
|
-
/**
|
|
31
|
-
* Flag indicating whether a plugin is enabled or disabled.
|
|
32
|
-
* A disabled plugin will not transform text.
|
|
33
|
-
*
|
|
34
|
-
* Plugin can be simply disabled like that:
|
|
35
|
-
*
|
|
36
|
-
* ```ts
|
|
37
|
-
* // Disable the plugin so that no toolbars are visible.
|
|
38
|
-
* editor.plugins.get( 'TextTransformation' ).isEnabled = false;
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* You can also use {@link #forceDisabled} method.
|
|
42
|
-
*
|
|
43
|
-
* @observable
|
|
44
|
-
* @readonly
|
|
45
|
-
*/
|
|
46
|
-
isEnabled: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Holds identifiers for {@link #forceDisabled} mechanism.
|
|
49
|
-
*/
|
|
50
|
-
private _disableStack;
|
|
51
|
-
/**
|
|
52
|
-
* @inheritDoc
|
|
53
|
-
*/
|
|
54
|
-
constructor(editor: Editor);
|
|
55
|
-
/**
|
|
56
|
-
* Disables the plugin.
|
|
57
|
-
*
|
|
58
|
-
* Plugin may be disabled by multiple features or algorithms (at once). When disabling a plugin, unique id should be passed
|
|
59
|
-
* (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the plugin.
|
|
60
|
-
* The plugin becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
|
|
61
|
-
*
|
|
62
|
-
* Disabling and enabling a plugin:
|
|
63
|
-
*
|
|
64
|
-
* ```ts
|
|
65
|
-
* plugin.isEnabled; // -> true
|
|
66
|
-
* plugin.forceDisabled( 'MyFeature' );
|
|
67
|
-
* plugin.isEnabled; // -> false
|
|
68
|
-
* plugin.clearForceDisabled( 'MyFeature' );
|
|
69
|
-
* plugin.isEnabled; // -> true
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* Plugin disabled by multiple features:
|
|
73
|
-
*
|
|
74
|
-
* ```ts
|
|
75
|
-
* plugin.forceDisabled( 'MyFeature' );
|
|
76
|
-
* plugin.forceDisabled( 'OtherFeature' );
|
|
77
|
-
* plugin.clearForceDisabled( 'MyFeature' );
|
|
78
|
-
* plugin.isEnabled; // -> false
|
|
79
|
-
* plugin.clearForceDisabled( 'OtherFeature' );
|
|
80
|
-
* plugin.isEnabled; // -> true
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* Multiple disabling with the same identifier is redundant:
|
|
84
|
-
*
|
|
85
|
-
* ```ts
|
|
86
|
-
* plugin.forceDisabled( 'MyFeature' );
|
|
87
|
-
* plugin.forceDisabled( 'MyFeature' );
|
|
88
|
-
* plugin.clearForceDisabled( 'MyFeature' );
|
|
89
|
-
* plugin.isEnabled; // -> true
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* **Note:** some plugins or algorithms may have more complex logic when it comes to enabling or disabling certain plugins,
|
|
93
|
-
* so the plugin might be still disabled after {@link #clearForceDisabled} was used.
|
|
94
|
-
*
|
|
95
|
-
* @param id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the plugin.
|
|
96
|
-
*/
|
|
97
|
-
forceDisabled(id: string): void;
|
|
98
|
-
/**
|
|
99
|
-
* Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
|
|
100
|
-
*
|
|
101
|
-
* @param id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
|
|
102
|
-
*/
|
|
103
|
-
clearForceDisabled(id: string): void;
|
|
104
|
-
/**
|
|
105
|
-
* @inheritDoc
|
|
106
|
-
*/
|
|
107
|
-
destroy(): void;
|
|
108
|
-
/**
|
|
109
|
-
* @inheritDoc
|
|
110
|
-
*/
|
|
111
|
-
static get isContextPlugin(): false;
|
|
112
|
-
/**
|
|
113
|
-
* @inheritDoc
|
|
114
|
-
* @internal
|
|
115
|
-
*/
|
|
116
|
-
static get isOfficialPlugin(): boolean;
|
|
117
|
-
/**
|
|
118
|
-
* @inheritDoc
|
|
119
|
-
* @internal
|
|
120
|
-
*/
|
|
121
|
-
static get isPremiumPlugin(): boolean;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* The base interface for CKEditor plugins.
|
|
125
|
-
*
|
|
126
|
-
* In its minimal form a plugin can be a simple function that accepts {@link module:core/editor/editor~Editor the editor}
|
|
127
|
-
* as a parameter:
|
|
128
|
-
*
|
|
129
|
-
* ```ts
|
|
130
|
-
* // A simple plugin that enables a data processor.
|
|
131
|
-
* function MyPlugin( editor ) {
|
|
132
|
-
* editor.data.processor = new MyDataProcessor();
|
|
133
|
-
* }
|
|
134
|
-
* ```
|
|
135
|
-
*
|
|
136
|
-
* In most cases however, you will want to inherit from the {@link ~Plugin} class which implements the
|
|
137
|
-
* {@link module:utils/observablemixin~Observable} and is, therefore, more convenient:
|
|
138
|
-
*
|
|
139
|
-
* ```ts
|
|
140
|
-
* class MyPlugin extends Plugin {
|
|
141
|
-
* init() {
|
|
142
|
-
* // `listenTo()` and `editor` are available thanks to `Plugin`.
|
|
143
|
-
* // By using `listenTo()` you will ensure that the listener is removed when
|
|
144
|
-
* // the plugin is destroyed.
|
|
145
|
-
* this.listenTo( this.editor.data, 'ready', () => {
|
|
146
|
-
* // Do something when the data is ready.
|
|
147
|
-
* } );
|
|
148
|
-
* }
|
|
149
|
-
* }
|
|
150
|
-
* ```
|
|
151
|
-
*
|
|
152
|
-
* The plugin class can have `pluginName` and `requires` static members. See {@link ~PluginStaticMembers} for more details.
|
|
153
|
-
*
|
|
154
|
-
* The plugin can also implement methods (e.g. {@link ~PluginInterface#init `init()`} or
|
|
155
|
-
* {@link ~PluginInterface#destroy `destroy()`}) which, when present, will be used to properly
|
|
156
|
-
* initialize and destroy the plugin.
|
|
157
|
-
*
|
|
158
|
-
* **Note:** When defined as a plain function, the plugin acts as a constructor and will be
|
|
159
|
-
* called in parallel with other plugins' {@link ~PluginConstructor constructors}.
|
|
160
|
-
* This means the code of that plugin will be executed **before** {@link ~PluginInterface#init `init()`} and
|
|
161
|
-
* {@link ~PluginInterface#afterInit `afterInit()`} methods of other plugins and, for instance,
|
|
162
|
-
* you cannot use it to extend other plugins' {@glink framework/architecture/editing-engine#schema schema}
|
|
163
|
-
* rules as they are defined later on during the `init()` stage.
|
|
164
|
-
*/
|
|
165
|
-
export interface PluginInterface {
|
|
166
|
-
/**
|
|
167
|
-
* The second stage (after plugin constructor) of the plugin initialization.
|
|
168
|
-
* Unlike the plugin constructor this method can be asynchronous.
|
|
169
|
-
*
|
|
170
|
-
* A plugin's `init()` method is called after its {@link ~PluginStaticMembers#requires dependencies} are initialized,
|
|
171
|
-
* so in the same order as the constructors of these plugins.
|
|
172
|
-
*
|
|
173
|
-
* **Note:** This method is optional. A plugin instance does not need to have it defined.
|
|
174
|
-
*/
|
|
175
|
-
init?(): Promise<unknown> | null | undefined | void;
|
|
176
|
-
/**
|
|
177
|
-
* The third (and last) stage of the plugin initialization. See also {@link ~PluginConstructor} and {@link ~PluginInterface#init}.
|
|
178
|
-
*
|
|
179
|
-
* **Note:** This method is optional. A plugin instance does not need to have it defined.
|
|
180
|
-
*/
|
|
181
|
-
afterInit?(): Promise<unknown> | null | undefined | void;
|
|
182
|
-
/**
|
|
183
|
-
* Destroys the plugin.
|
|
184
|
-
*
|
|
185
|
-
* **Note:** This method is optional. A plugin instance does not need to have it defined.
|
|
186
|
-
*/
|
|
187
|
-
destroy?(): Promise<unknown> | null | undefined | void;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Creates a new plugin instance. This is the first step of the plugin initialization.
|
|
191
|
-
* See also {@link ~PluginInterface#init} and {@link ~PluginInterface#afterInit}.
|
|
192
|
-
*
|
|
193
|
-
* The plugin static properties should conform to {@link ~PluginStaticMembers `PluginStaticMembers` interface}.
|
|
194
|
-
*
|
|
195
|
-
* A plugin is always instantiated after its {@link ~PluginStaticMembers#requires dependencies} and the
|
|
196
|
-
* {@link ~PluginInterface#init} and {@link ~PluginInterface#afterInit} methods are called in the same order.
|
|
197
|
-
*
|
|
198
|
-
* Usually, you will want to put your plugin's initialization code in the {@link ~PluginInterface#init} method.
|
|
199
|
-
* The constructor can be understood as "before init" and used in special cases, just like
|
|
200
|
-
* {@link ~PluginInterface#afterInit} serves the special "after init" scenarios (e.g.the code which depends on other
|
|
201
|
-
* plugins, but which does not {@link ~PluginStaticMembers#requires explicitly require} them).
|
|
202
|
-
*/
|
|
203
|
-
export type PluginConstructor<TContext = Editor> = (PluginClassConstructor<TContext> | PluginFunctionConstructor<TContext>) & PluginStaticMembers<TContext>;
|
|
204
|
-
/**
|
|
205
|
-
* In most cases, you will want to inherit from the {@link ~Plugin} class which implements the
|
|
206
|
-
* {@link module:utils/observablemixin~Observable} and is, therefore, more convenient:
|
|
207
|
-
*
|
|
208
|
-
* ```ts
|
|
209
|
-
* class MyPlugin extends Plugin {
|
|
210
|
-
* init() {
|
|
211
|
-
* // `listenTo()` and `editor` are available thanks to `Plugin`.
|
|
212
|
-
* // By using `listenTo()` you will ensure that the listener is removed when
|
|
213
|
-
* // the plugin is destroyed.
|
|
214
|
-
* this.listenTo( this.editor.data, 'ready', () => {
|
|
215
|
-
* // Do something when the data is ready.
|
|
216
|
-
* } );
|
|
217
|
-
* }
|
|
218
|
-
* }
|
|
219
|
-
* ```
|
|
220
|
-
*/
|
|
221
|
-
export type PluginClassConstructor<TContext = Editor> = new (editor: TContext) => PluginInterface;
|
|
222
|
-
/**
|
|
223
|
-
* In its minimal form a plugin can be a simple function that accepts {@link module:core/editor/editor~Editor the editor}
|
|
224
|
-
* as a parameter:
|
|
225
|
-
*
|
|
226
|
-
* ```ts
|
|
227
|
-
* // A simple plugin that enables a data processor.
|
|
228
|
-
* function MyPlugin( editor ) {
|
|
229
|
-
* editor.data.processor = new MyDataProcessor();
|
|
230
|
-
* }
|
|
231
|
-
* ```
|
|
232
|
-
*/
|
|
233
|
-
export type PluginFunctionConstructor<TContext = Editor> = (editor: TContext) => void;
|
|
234
|
-
/**
|
|
235
|
-
* Static properties of a plugin.
|
|
236
|
-
*/
|
|
237
|
-
export interface PluginStaticMembers<TContext = Editor> {
|
|
238
|
-
/**
|
|
239
|
-
* An array of plugins required by this plugin.
|
|
240
|
-
*
|
|
241
|
-
* To keep the plugin class definition tight it is recommended to define this property as a static getter:
|
|
242
|
-
*
|
|
243
|
-
* ```ts
|
|
244
|
-
* import Image from './image.js';
|
|
245
|
-
*
|
|
246
|
-
* export default class ImageCaption {
|
|
247
|
-
* static get requires() {
|
|
248
|
-
* return [ Image ];
|
|
249
|
-
* }
|
|
250
|
-
* }
|
|
251
|
-
* ```
|
|
252
|
-
*/
|
|
253
|
-
readonly requires?: PluginDependencies<TContext>;
|
|
254
|
-
/**
|
|
255
|
-
* An optional name of the plugin. If set, the plugin will be available in
|
|
256
|
-
* {@link module:core/plugincollection~PluginCollection#get} by its
|
|
257
|
-
* name and its constructor. If not, then only by its constructor.
|
|
258
|
-
*
|
|
259
|
-
* The name should reflect the constructor name.
|
|
260
|
-
*
|
|
261
|
-
* To keep the plugin class definition tight, it is recommended to define this property as a static getter:
|
|
262
|
-
*
|
|
263
|
-
* ```ts
|
|
264
|
-
* export default class ImageCaption {
|
|
265
|
-
* static get pluginName() {
|
|
266
|
-
* return 'ImageCaption';
|
|
267
|
-
* }
|
|
268
|
-
* }
|
|
269
|
-
* ```
|
|
270
|
-
*
|
|
271
|
-
* Note: The native `Function.name` property could not be used to keep the plugin name because
|
|
272
|
-
* it will be mangled during code minification.
|
|
273
|
-
*
|
|
274
|
-
* Naming a plugin is necessary to enable removing it through the
|
|
275
|
-
* {@link module:core/editor/editorconfig~EditorConfig#removePlugins `config.removePlugins`} option.
|
|
276
|
-
*/
|
|
277
|
-
readonly pluginName?: string;
|
|
278
|
-
/**
|
|
279
|
-
* A flag which defines if a plugin is allowed or not allowed to be used directly by a {@link module:core/context~Context}.
|
|
280
|
-
*/
|
|
281
|
-
readonly isContextPlugin?: boolean;
|
|
282
|
-
/**
|
|
283
|
-
* A flag which defines if a plugin is an official CKEditor 5 plugin.
|
|
284
|
-
*
|
|
285
|
-
* @internal
|
|
286
|
-
*/
|
|
287
|
-
readonly isOfficialPlugin?: boolean;
|
|
288
|
-
/**
|
|
289
|
-
* A flag which defines if a plugin is a premium CKEditor 5 plugin.
|
|
290
|
-
*
|
|
291
|
-
* @internal
|
|
292
|
-
*/
|
|
293
|
-
readonly isPremiumPlugin?: boolean;
|
|
294
|
-
}
|
|
295
|
-
export type PluginDependencies<TContext = Editor> = ReadonlyArray<PluginConstructor<TContext> | string>;
|
|
296
|
-
/**
|
|
297
|
-
* An array of loaded plugins.
|
|
298
|
-
*/
|
|
299
|
-
export type LoadedPlugins = Array<PluginInterface>;
|
|
300
|
-
export {};
|
|
@@ -1,121 +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-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
import type { LoadedPlugins, PluginClassConstructor, PluginConstructor, PluginInterface } from './plugin.js';
|
|
10
|
-
declare const PluginCollection_base: {
|
|
11
|
-
new (): import("@ckeditor/ckeditor5-utils").Emitter;
|
|
12
|
-
prototype: import("@ckeditor/ckeditor5-utils").Emitter;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.
|
|
16
|
-
*/
|
|
17
|
-
export default class PluginCollection<TContext extends object> extends /* #__PURE__ */ PluginCollection_base implements Iterable<PluginEntry<TContext>> {
|
|
18
|
-
private _context;
|
|
19
|
-
private _plugins;
|
|
20
|
-
/**
|
|
21
|
-
* A map of plugin constructors that can be retrieved by their names.
|
|
22
|
-
*/
|
|
23
|
-
private _availablePlugins;
|
|
24
|
-
/**
|
|
25
|
-
* Map of {@link module:core/contextplugin~ContextPlugin context plugins} which can be retrieved by their constructors or instances.
|
|
26
|
-
*/
|
|
27
|
-
private _contextPlugins;
|
|
28
|
-
/**
|
|
29
|
-
* Creates an instance of the plugin collection class.
|
|
30
|
-
* Allows loading and initializing plugins and their dependencies.
|
|
31
|
-
* Allows providing a list of already loaded plugins. These plugins will not be destroyed along with this collection.
|
|
32
|
-
*
|
|
33
|
-
* @param availablePlugins Plugins (constructors) which the collection will be able to use
|
|
34
|
-
* when {@link module:core/plugincollection~PluginCollection#init} is used with the plugin names (strings, instead of constructors).
|
|
35
|
-
* Usually, the editor will pass its built-in plugins to the collection so they can later be
|
|
36
|
-
* used in `config.plugins` or `config.removePlugins` by names.
|
|
37
|
-
* @param contextPlugins A list of already initialized plugins represented by a `[ PluginConstructor, pluginInstance ]` pair.
|
|
38
|
-
*/
|
|
39
|
-
constructor(context: TContext, availablePlugins?: Iterable<PluginConstructor<TContext>>, contextPlugins?: Iterable<PluginEntry<TContext>>);
|
|
40
|
-
/**
|
|
41
|
-
* Iterable interface.
|
|
42
|
-
*
|
|
43
|
-
* Returns `[ PluginConstructor, pluginInstance ]` pairs.
|
|
44
|
-
*/
|
|
45
|
-
[Symbol.iterator](): IterableIterator<PluginEntry<TContext>>;
|
|
46
|
-
get<TConstructor extends PluginClassConstructor<TContext>>(key: TConstructor): InstanceType<TConstructor>;
|
|
47
|
-
get<TName extends string>(key: TName): PluginsMap[TName];
|
|
48
|
-
/**
|
|
49
|
-
* Checks if a plugin is loaded.
|
|
50
|
-
*
|
|
51
|
-
* ```ts
|
|
52
|
-
* // Check if the 'Clipboard' plugin was loaded.
|
|
53
|
-
* if ( editor.plugins.has( 'ClipboardPipeline' ) ) {
|
|
54
|
-
* // Now use the clipboard plugin instance:
|
|
55
|
-
* const clipboard = editor.plugins.get( 'ClipboardPipeline' );
|
|
56
|
-
*
|
|
57
|
-
* // ...
|
|
58
|
-
* }
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* @param key The plugin constructor or {@link module:core/plugin~PluginStaticMembers#pluginName name}.
|
|
62
|
-
*/
|
|
63
|
-
has(key: PluginConstructor<TContext> | string): boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Initializes a set of plugins and adds them to the collection.
|
|
66
|
-
*
|
|
67
|
-
* @param plugins An array of {@link module:core/plugin~PluginInterface plugin constructors}
|
|
68
|
-
* or {@link module:core/plugin~PluginStaticMembers#pluginName plugin names}.
|
|
69
|
-
* @param pluginsToRemove Names of the plugins or plugin constructors
|
|
70
|
-
* that should not be loaded (despite being specified in the `plugins` array).
|
|
71
|
-
* @param pluginsSubstitutions An array of {@link module:core/plugin~PluginInterface plugin constructors}
|
|
72
|
-
* that will be used to replace plugins of the same names that were passed in `plugins` or that are in their dependency tree.
|
|
73
|
-
* A useful option for replacing built-in plugins while creating tests (for mocking their APIs). Plugins that will be replaced
|
|
74
|
-
* must follow these rules:
|
|
75
|
-
* * The new plugin must be a class.
|
|
76
|
-
* * The new plugin must be named.
|
|
77
|
-
* * Both plugins must not depend on other plugins.
|
|
78
|
-
* @returns A promise which gets resolved once all plugins are loaded and available in the collection.
|
|
79
|
-
*/
|
|
80
|
-
init(plugins: ReadonlyArray<PluginConstructor<TContext> | string>, pluginsToRemove?: ReadonlyArray<PluginConstructor<TContext> | string>, pluginsSubstitutions?: ReadonlyArray<PluginConstructor<TContext>>): Promise<LoadedPlugins>;
|
|
81
|
-
/**
|
|
82
|
-
* Destroys all loaded plugins.
|
|
83
|
-
*/
|
|
84
|
-
destroy(): Promise<unknown>;
|
|
85
|
-
/**
|
|
86
|
-
* Adds the plugin to the collection. Exposed mainly for testing purposes.
|
|
87
|
-
*
|
|
88
|
-
* @param PluginConstructor The plugin constructor.
|
|
89
|
-
* @param plugin The instance of the plugin.
|
|
90
|
-
*/
|
|
91
|
-
private _add;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* A `[ PluginConstructor, pluginInstance ]` pair.
|
|
95
|
-
*/
|
|
96
|
-
export type PluginEntry<TContext> = [PluginConstructor<TContext>, PluginInterface];
|
|
97
|
-
/**
|
|
98
|
-
* Helper type that maps plugin names to their types.
|
|
99
|
-
* It is meant to be extended with module augmentation.
|
|
100
|
-
*
|
|
101
|
-
* ```ts
|
|
102
|
-
* class MyPlugin extends Plugin {
|
|
103
|
-
* public static pluginName() {
|
|
104
|
-
* return 'MyPlugin' as const;
|
|
105
|
-
* }
|
|
106
|
-
* }
|
|
107
|
-
*
|
|
108
|
-
* declare module '@ckeditor/ckeditor5-core' {
|
|
109
|
-
* interface PluginsMap {
|
|
110
|
-
* [ MyPlugin.pluginName ]: MyPlugin;
|
|
111
|
-
* }
|
|
112
|
-
* }
|
|
113
|
-
*
|
|
114
|
-
* // Returns `MyPlugin`.
|
|
115
|
-
* const myPlugin = editor.plugins.get( 'MyPlugin' );
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
118
|
-
export interface PluginsMap {
|
|
119
|
-
[name: string]: PluginInterface;
|
|
120
|
-
}
|
|
121
|
-
export {};
|
package/dist/typings.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-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module core/typings
|
|
11
|
-
*/
|
|
12
|
-
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
13
|
-
export type NonEmptyArray<A> = Array<A> & {
|
|
14
|
-
0: A;
|
|
15
|
-
};
|
|
16
|
-
export type HexColor<S extends string = string> = `#${S}`;
|