@ckeditor/ckeditor5-core 35.2.1 → 35.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.
@@ -1,426 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2022, 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
- /**
7
- * @module core/editor/editorconfig
8
- */
9
-
10
- /**
11
- * CKEditor configuration options.
12
- *
13
- * An object defining the editor configuration can be passed when initializing the editor:
14
- *
15
- * EditorClass
16
- * .create( {
17
- * toolbar: [ 'bold', 'italic' ],
18
- * image: {
19
- * styles: [
20
- * ...
21
- * ]
22
- * }
23
- * } )
24
- * .then( ... )
25
- * .catch( ... );
26
- *
27
- * Check the {@glink installation/getting-started/predefined-builds Configuration guide} for more information
28
- * about setting configuration options.
29
- *
30
- * @interface EditorConfig
31
- */
32
-
33
- /**
34
- * The initial editor data to be used instead of the provided element's HTML content.
35
- *
36
- * ClassicEditor
37
- * .create( document.querySelector( '#editor' ), {
38
- * initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
39
- * } )
40
- * .then( ... )
41
- * .catch( ... );
42
- *
43
- * By default, the editor is initialized with the content of the element on which this editor is initialized.
44
- * This configuration option lets you override this behavior and pass different initial data.
45
- * It is especially useful if it is difficult for your integration to put the data inside the HTML element.
46
- *
47
- * See also {@link module:core/editor/editor~Editor.create Editor.create()}.
48
- *
49
- * **Note:** If initial data is passed to `Editor.create()` in the first parameter (instead of a DOM element), and,
50
- * at the same time, `config.initialData` is set, an error will be thrown as those two options exclude themselves.
51
- *
52
- * If `config.initialData` is not set when the editor is initialized, the data received in `Editor.create()` call
53
- * will be used to set `config.initialData`. As a result, `initialData` is always set in the editor's config and
54
- * plugins can read and/or modify it during initialization.
55
- *
56
- * @member {String} module:core/editor/editorconfig~EditorConfig#initialData
57
- */
58
-
59
- /**
60
- * The `config.initialData` option cannot be used together with initial data passed as the first parameter of
61
- * {@link module:core/editor/editor~Editor.create `Editor.create()`}.
62
- *
63
- * @error editor-create-initial-data
64
- */
65
-
66
- /**
67
- * The list of plugins to load.
68
- *
69
- * If you use an {@glink installation/getting-started/predefined-builds editor build} you can define the list of plugins to load
70
- * using the names of plugins that are available:
71
- *
72
- * const config = {
73
- * plugins: [ 'Bold', 'Italic', 'Typing', 'Enter', ... ]
74
- * };
75
- *
76
- * You can check the list of plugins available in a build using this snippet:
77
- *
78
- * ClassicEditor.builtinPlugins.map( plugin => plugin.pluginName );
79
- *
80
- * If you use an editor creator directly (imported from a package like `@ckeditor/ckeditor5-editor-classic`) or you
81
- * want to load additional plugins which were not included in a build you use, then you need to specify
82
- * the plugins using their constructors:
83
- *
84
- * // A preset of plugins is a plugin as well.
85
- * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
86
- * // The bold plugin.
87
- * import Bold from '@ckeditor/ckeditor5-editor-basic-styles/src/bold';
88
- *
89
- * const config = {
90
- * plugins: [ Essentials, Bold ]
91
- * };
92
- *
93
- * **Note:** To load additional plugins, you should use the {@link #extraPlugins `extraPlugins`} configuration.
94
- * To narrow the list of loaded plugins, use the {@link #removePlugins `removePlugins`} configuration.
95
- *
96
- * @member {Array.<String|Function>} module:core/editor/editorconfig~EditorConfig#plugins
97
- */
98
-
99
- /**
100
- * The list of additional plugins to load along those already available in the
101
- * {@glink installation/getting-started/predefined-builds editor build}. It extends the {@link #plugins `plugins`} configuration.
102
- *
103
- * function MyPlugin( editor ) {
104
- * // ...
105
- * }
106
- *
107
- * const config = {
108
- * extraPlugins: [ MyPlugin ]
109
- * };
110
- *
111
- * **Note:** This configuration works only for simple plugins which utilize the
112
- * {@link module:core/plugin~PluginInterface plugin interface} and have no dependencies. To extend a
113
- * build with complex features, create a {@glink installation/getting-started/quick-start-other#creating-custom-builds-with-online-builder
114
- * custom build}.
115
- *
116
- * **Note:** Make sure you include the new features in you toolbar configuration. Learn more
117
- * about the {@glink features/toolbar/toolbar toolbar setup}.
118
- *
119
- * @member {Array.<Function>} module:core/editor/editorconfig~EditorConfig#extraPlugins
120
- */
121
-
122
- /**
123
- * The list of plugins which should not be loaded despite being available in an {@glink installation/getting-started/predefined-builds
124
- * editor build}.
125
- *
126
- * const config = {
127
- * removePlugins: [ 'Bold', 'Italic' ]
128
- * };
129
- *
130
- * **Note:** Be careful when removing plugins using `config.removePlugins` from CKEditor builds.
131
- * If removed plugins were providing toolbar buttons, the default toolbar configuration included in a build
132
- * will become invalid. In such case you need to provide the updated
133
- * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}.
134
- *
135
- * @member {Array.<String|Function>} module:core/editor/editorconfig~EditorConfig#removePlugins
136
- */
137
-
138
- /**
139
- * The editor toolbar configuration.
140
- *
141
- * Simple format (specifies only toolbar items):
142
- *
143
- * const config = {
144
- * toolbar: [ 'bold', 'italic', '|', 'undo', 'redo' ]
145
- * };
146
- *
147
- * Extended format:
148
- *
149
- * const config = {
150
- * toolbar: {
151
- * items: [ 'bold', 'italic', '|', 'undo', 'redo', '-', 'numberedList', 'bulletedList' ],
152
- *
153
- * shouldNotGroupWhenFull: true
154
- * }
155
- * };
156
- *
157
- * Options which can be set using the extended format:
158
- *
159
- * * **`toolbar.items`** &ndash; An array of toolbar item names. The components (buttons, dropdowns, etc.) which can be used
160
- * as toolbar items are defined in `editor.ui.componentFactory` and can be listed using the following snippet:
161
- *
162
- * Array.from( editor.ui.componentFactory.names() );
163
- *
164
- * You can also use `'|'` to create a separator between groups of items:
165
- *
166
- * toolbar: [ 'bold', 'italic', '|', 'undo', 'redo' ]
167
- *
168
- * or `'-'` to make a line break and render items in multiple lines:
169
- *
170
- * toolbar: [ 'bold', 'italic', '-', 'undo', 'redo' ]
171
- *
172
- * Line break will work only in the extended format when `shouldNotGroupWhenFull` option is set to `true`.
173
- *
174
- * **Note**: To save space in your toolbar you can group several items into a dropdown:
175
- *
176
- * toolbar: [
177
- * {
178
- * label: 'Basic styles',
179
- * icon: 'text',
180
- * items: [ 'bold', 'italic', ... ]
181
- * },
182
- * '|',
183
- * 'undo', 'redo'
184
- * ]
185
- *
186
- * The code above will create a "Basic styles" dropdown with a "text" icon containing "bold" and "italic" buttons.
187
- * You can customize the look of the dropdown by setting the `withText`, `icon`, and `tooltip` properties:
188
- *
189
- * * **Displaying a label**
190
- *
191
- * For instance, to hide the icon and to display the label only, you can use the following configuration:
192
- *
193
- * {
194
- * label: 'Basic styles',
195
- * // Show the textual label of the drop-down. Note that the "icon" property is not configured.
196
- * withText: true,
197
- * items: [ 'bold', 'italic', ... ]
198
- * }
199
- *
200
- * * **Selecting an icon**
201
- *
202
- * You can use one of the common icons provided by the editor (`'bold'`, `'plus'`, `'text'`, `'importExport'`, `'alignLeft'`,
203
- * `'paragraph'`, `'threeVerticalDots'`):
204
- *
205
- * {
206
- * label: '...',
207
- * // A "plus" sign icon works best for content insertion tools.
208
- * icon: 'plus',
209
- * items: [ ... ]
210
- * }
211
- *
212
- * If no icon is specified, `'threeVerticalDots'` will be used as a default:
213
- *
214
- * // No icon specified, using a default one.
215
- * {
216
- * label: 'Default icon',
217
- * items: [ ... ]
218
- * }
219
- *
220
- * If `icon: false` is configured, no icon will be displayed at all and the text label will show up instead:
221
- *
222
- * // This drop-down has no icon. The text label will be displayed instead.
223
- * {
224
- * label: 'No icon',
225
- * icon: false,
226
- * items: [ ... ]
227
- * }
228
- *
229
- * You can also set a custom icon for the drop-down by passing an SVG string:
230
- *
231
- * {
232
- * label: '...',
233
- * // If you want your icon to change the color dynamically (e.g. when the dropdown opens), avoid fill="..."
234
- * // and stroke="..." styling attributes. Use solid shapes and avoid paths with strokes.
235
- * icon: '<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">...</svg>',
236
- * items: [ ... ]
237
- * }
238
- *
239
- * * **Customizing the tooltip**
240
- *
241
- * By default, the tooltip of the button shares its text with the label. You can customize it to better describe your dropdown
242
- * using the `tooltip` property ({@link module:ui/button/buttonview~ButtonView#tooltip learn more}):
243
- *
244
- * {
245
- * label: 'Drop-down label',
246
- * tooltip: 'Custom tooltip of the drop-down',
247
- * icon: '...',
248
- * items: [ ... ]
249
- * }
250
- *
251
- * * **`toolbar.viewportTopOffset` (deprecated)** &ndash; The offset (in pixels) from the top of the viewport used when positioning a
252
- * sticky toolbar.
253
- * Useful when a page with which the editor is being integrated has some other sticky or fixed elements
254
- * (e.g. the top menu). Thanks to setting the toolbar offset the toolbar will not be positioned underneath or above the page's UI.
255
- *
256
- * **This property has been deprecated and will be removed in the future versions of CKEditor. Please use
257
- * `{@link module:core/editor/editorconfig~EditorConfig#ui EditorConfig#ui.viewportOffset}` instead.**
258
- *
259
- * * **`toolbar.shouldNotGroupWhenFull`** &ndash; When set to `true`, the toolbar will stop grouping items
260
- * and let them wrap to the next line if there is not enough space to display them in a single row.
261
- *
262
- * @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#toolbar
263
- */
264
-
265
- /**
266
- * The configuration of the editor language.
267
- *
268
- * ClassicEditor
269
- * .create( document.querySelector( '#editor' ), {
270
- * language: ... // Editor language configuration.
271
- * } )
272
- * .then( editor => {
273
- * console.log( editor );
274
- * } )
275
- * .catch( error => {
276
- * console.error( error );
277
- * } );
278
- *
279
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
280
- *
281
- * @interface LanguageConfig
282
- */
283
-
284
- /**
285
- * The language of the editor UI and its content.
286
- *
287
- * Note: You do not have to specify this option if your build is optimized for one UI language or if it is
288
- * the default language (English is the default language for CDN builds), unless you want to change
289
- * the language of your content.
290
- *
291
- * Simple usage (change the language of the UI and the content):
292
- *
293
- * ClassicEditor
294
- * .create( document.querySelector( '#editor' ), {
295
- * // The UI of the editor as well as its content will be in German.
296
- * language: 'de'
297
- * } )
298
- * .then( editor => {
299
- * console.log( editor );
300
- * } )
301
- * .catch( error => {
302
- * console.error( error );
303
- * } );
304
- *
305
- * Use different languages for the UI and the content using the {@link module:core/editor/editorconfig~LanguageConfig configuration} syntax:
306
- *
307
- * ClassicEditor
308
- * .create( document.querySelector( '#editor' ), {
309
- * language: {
310
- * // The UI will be in English.
311
- * ui: 'en',
312
- *
313
- * // But the content will be edited in Arabic.
314
- * content: 'ar'
315
- * }
316
- * } )
317
- * .then( editor => {
318
- * console.log( editor );
319
- * } )
320
- * .catch( error => {
321
- * console.error( error );
322
- * } );
323
- *
324
- * The language of the content has an impact on the editing experience, for instance it affects screen readers
325
- * and spell checkers. It is also particularly useful for typing in certain languages (e.g. right–to–left ones)
326
- * because it changes the default alignment of the text.
327
- *
328
- * The language codes are defined in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) standard.
329
- *
330
- * You need to add the corresponding translation file for the new UI language to work.
331
- * Translation files are available on CDN for predefined builds:
332
- *
333
- * `<script src="https://cdn.ckeditor.com/ckeditor5/[version.number]/[distribution]/lang/[lang].js"></script>`
334
- *
335
- * But you can add them manually by coping from the `node_modules/@ckeditor/ckeditor5-build-[name]/build/lang/[lang].js'`.
336
- *
337
- * Check the {@glink features/ui-language UI language guide} for more information about the localization options and translation process.
338
- *
339
- * @member {String|module:core/editor/editorconfig~LanguageConfig} module:core/editor/editorconfig~EditorConfig#language
340
- */
341
-
342
- /**
343
- * Allows to use different language for the editor UI.
344
- *
345
- * The language codes are defined in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) standard.
346
- *
347
- * @member {String} module:core/editor/editorconfig~LanguageConfig#ui
348
- */
349
-
350
- /**
351
- * Allows to use different language of the editor content.
352
- *
353
- * The language codes are defined in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) standard.
354
- *
355
- * @member {String} module:core/editor/editorconfig~LanguageConfig#content
356
- */
357
-
358
- /**
359
- * Specifies the text displayed in the editor when there is no content (editor is empty). It is intended to
360
- * help users locate the editor in the application (form) and prompt them to input the content. Work similarly
361
- * as to the native DOM
362
- * [`placeholder` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#The_placeholder_attribute)
363
- * used by inputs.
364
- *
365
- * const config = {
366
- * placeholder: 'Type some text...'
367
- * };
368
- *
369
- * The placeholder text is displayed as a pseudo–element of an empty paragraph in the editor content.
370
- * The paragraph has the `.ck-placeholder` CSS class and the `data-placeholder` attribute.
371
- *
372
- * <p data-placeholder="Type some text..." class="ck-placeholder">
373
- * ::before
374
- * </p>
375
- *
376
- * **Note**: Placeholder text can also be set using the `placeholder` attribute if a `<textarea>` is passed to
377
- * the `create()` method, e.g. {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
378
- *
379
- * **Note**: This configuration has precedence over the value of the `placeholder` attribute of a `<textarea>`
380
- * element passed to the `create()` method.
381
- *
382
- * See the {@glink features/editor-placeholder "Editor placeholder" guide} for more information and live examples.
383
- *
384
- * @member {String} module:core/editor/editorconfig~EditorConfig#placeholder
385
- */
386
-
387
- /**
388
- * The editor UI configuration.
389
- *
390
- * ClassicEditor
391
- * .create( document.querySelector( '#editor' ), {
392
- * ui: { ... }
393
- * } )
394
- * .then( ... )
395
- * .catch( ... );
396
- *
397
- * Options which can be set using the UI config:
398
- *
399
- * * **`ui.viewportOffset`** &ndash; The offset (in pixels) of the viewport from every direction used when positioning a sticky toolbar
400
- * or other absolutely positioned UI elements.
401
- * Useful when a page with which the editor is being integrated has some other sticky or fixed elements
402
- * (e.g. the top menu). Thanks to setting the UI viewport offset the toolbar and other contextual balloons will not be positioned
403
- * underneath or above the page's UI.
404
- *
405
- * ui: {
406
- * viewportOffset: { top: 10, right: 10, bottom: 10, left: 10 }
407
- * }
408
- *
409
- * **Note:** If you want to modify the viewport offset in runtime (after editor was created), you can do that by overriding
410
- * {@link module:core/editor/editorui~EditorUI#viewportOffset `editor.ui.viewportOffset`}.
411
- *
412
- * @member {Object} module:core/editor/editorconfig~EditorConfig#ui
413
- */
414
-
415
- /**
416
- * Enables updating the source element after the editor destroy.
417
- *
418
- * Enabling this option might have some security implications, as the editor doesn't have control over all data
419
- * in the output.
420
- *
421
- * Be careful, especially while using
422
- * {@glink features/markdown Markdown}, {@glink features/general-html-support General HTML Support} or
423
- * {@glink features/html-embed HTML embed} features.
424
- *
425
- * @member {Boolean} module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy
426
- */
@@ -1,29 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2022, 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
- /**
7
- * @module core/editor/editorwithui
8
- */
9
-
10
- /**
11
- * Interface defining a type of {@link module:core/editor/editor~Editor editor} which has a UI.
12
- *
13
- * Most editors (like {@link module:editor-classic/classiceditor~ClassicEditor} or
14
- * {@link module:editor-inline/inlineeditor~InlineEditor}) implement this interface, however, it is not required to do so.
15
- *
16
- * Editors with an external UI (i.e. Bootstrap-based) or a headless editor may not implement this interface.
17
- * When developing editor features you can consider this by splitting them into two parts: the "editing" part,
18
- * which bases on {@link module:core/editor/editor~Editor} itself, and the UI part which bases on this interface.
19
- * This will make your features compatible with more types of editors.
20
- *
21
- * @interface EditorWithUI
22
- */
23
-
24
- /**
25
- * The editor UI instance.
26
- *
27
- * @readonly
28
- * @member {module:core/editor/editorui~EditorUI} #ui
29
- */