-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
restrictededitingconfig.ts
64 lines (60 loc) · 1.94 KB
/
restrictededitingconfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/**
* @module restricted-editing/restrictededitingconfig
*/
/**
* The configuration of the restricted editing mode feature.
* The option is used by the {@link module:restricted-editing/restrictededitingmode~RestrictedEditingMode} feature.
*
* ```ts
* ClassicEditor
* .create( {
* restrictedEditing: {
* allowedCommands: [ 'bold', 'link', 'unlink' ],
* allowedAttributes: [ 'bold', 'linkHref' ]
* }
* } )
* .then( ... )
* .catch( ... );
* ```
*
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
*/
export interface RestrictedEditingConfig {
/**
* The command names allowed in non-restricted areas of the content.
*
* Defines which feature commands should be enabled in the restricted editing mode. The commands used for typing and deleting text
* (`'input'`, `'delete'` and `'deleteForward'`) are allowed by the feature inside non-restricted regions and do not need to be defined.
*
* **Note**: The restricted editing mode always allows to use the restricted mode navigation commands as well as `'undo'` and `'redo'`
* commands.
*
* The default value is:
*
* ```ts
* const restrictedEditingConfig = {
* allowedCommands: [ 'bold', 'italic', 'link', 'unlink' ]
* };
* ```
*
* To make a command always enabled (also outside non-restricted areas) use
* {@link module:restricted-editing/restrictededitingmodeediting~RestrictedEditingModeEditing#enableCommand} method.
*/
allowedCommands: Array<string>;
/**
* The text attribute names allowed when pasting content ot non-restricted areas.
*
* The default value is:
*
* ```ts
* const restrictedEditingConfig = {
* allowedAttributes: [ 'bold', 'italic', 'linkHref' ]
* };
* ```
*/
allowedAttributes: Array<string>;
}