@ckeditor/ckeditor5-list 48.2.0 → 48.3.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/dist/augmentation.d.ts +54 -54
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +67 -67
- package/dist/index.js +7187 -8921
- package/dist/index.js.map +1 -1
- package/dist/legacyerrors.d.ts +0 -4
- package/dist/legacylist/legacyconverters.d.ts +184 -184
- package/dist/legacylist/legacyindentcommand.d.ts +33 -33
- package/dist/legacylist/legacylistcommand.d.ts +52 -52
- package/dist/legacylist/legacylistediting.d.ts +32 -32
- package/dist/legacylist/legacylistutils.d.ts +40 -40
- package/dist/legacylist/legacyutils.d.ts +91 -91
- package/dist/legacylist.d.ts +25 -25
- package/dist/legacylistproperties/legacylistpropertiesediting.d.ts +71 -71
- package/dist/legacylistproperties/legacylistreversedcommand.d.ts +33 -33
- package/dist/legacylistproperties/legacyliststartcommand.d.ts +33 -33
- package/dist/legacylistproperties/legacyliststylecommand.d.ts +63 -63
- package/dist/legacylistproperties.d.ts +26 -26
- package/dist/legacytodolist/legacychecktodolistcommand.d.ts +47 -47
- package/dist/legacytodolist/legacytodolistconverters.d.ts +76 -76
- package/dist/legacytodolist/legacytodolistediting.d.ts +46 -46
- package/dist/legacytodolist.d.ts +26 -26
- package/dist/list/adjacentlistssupport.d.ts +16 -16
- package/dist/list/converters.d.ts +68 -68
- package/dist/list/listcommand.d.ts +84 -84
- package/dist/list/listediting.d.ts +213 -219
- package/dist/list/listindentcommand.d.ts +54 -54
- package/dist/list/listmergecommand.d.ts +68 -68
- package/dist/list/listsplitcommand.d.ts +59 -59
- package/dist/list/listui.d.ts +19 -19
- package/dist/list/listutils.d.ts +55 -55
- package/dist/list/utils/listwalker.d.ts +139 -139
- package/dist/list/utils/model.d.ts +202 -202
- package/dist/list/utils/postfixers.d.ts +30 -30
- package/dist/list/utils/view.d.ts +65 -65
- package/dist/list/utils.d.ts +15 -15
- package/dist/list.d.ts +25 -25
- package/dist/listconfig.d.ts +234 -234
- package/dist/listformatting/listitemboldintegration.d.ts +29 -29
- package/dist/listformatting/listitemfontcolorintegration.d.ts +29 -29
- package/dist/listformatting/listitemfontfamilyintegration.d.ts +29 -29
- package/dist/listformatting/listitemfontsizeintegration.d.ts +29 -29
- package/dist/listformatting/listitemitalicintegration.d.ts +29 -29
- package/dist/listformatting.d.ts +66 -66
- package/dist/listproperties/converters.d.ts +15 -15
- package/dist/listproperties/listpropertiesediting.d.ts +91 -91
- package/dist/listproperties/listpropertiesui.d.ts +22 -22
- package/dist/listproperties/listpropertiesutils.d.ts +32 -32
- package/dist/listproperties/listreversedcommand.d.ts +31 -31
- package/dist/listproperties/liststartcommand.d.ts +34 -34
- package/dist/listproperties/liststylecommand.d.ts +67 -67
- package/dist/listproperties/ui/listpropertiesview.d.ts +147 -147
- package/dist/listproperties/utils/config.d.ts +32 -32
- package/dist/listproperties/utils/style.d.ts +31 -31
- package/dist/listproperties.d.ts +26 -26
- package/dist/todolist/checktodolistcommand.d.ts +44 -44
- package/dist/todolist/todocheckboxchangeobserver.d.ts +36 -36
- package/dist/todolist/todolistediting.d.ts +45 -45
- package/dist/todolist/todolistui.d.ts +19 -19
- package/dist/todolist.d.ts +26 -26
- package/package.json +10 -10
|
@@ -1,244 +1,238 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin, type Editor } from
|
|
9
|
-
import type { ViewDowncastWriter, ModelElement, ViewElement, ViewAttributeElement, ModelWriter } from
|
|
10
|
-
import { Delete } from
|
|
11
|
-
import { Enter } from
|
|
12
|
-
import { ListFormatting } from
|
|
13
|
-
import { ListUtils } from
|
|
14
|
-
import { type ListElement } from
|
|
15
|
-
import { ListBlocksIterable } from
|
|
16
|
-
import { ClipboardPipeline } from
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
export type ListType =
|
|
6
|
+
* @module list/list/listediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { ViewDowncastWriter, ModelElement, ViewElement, ViewAttributeElement, ModelWriter } from "@ckeditor/ckeditor5-engine";
|
|
10
|
+
import { Delete } from "@ckeditor/ckeditor5-typing";
|
|
11
|
+
import { Enter } from "@ckeditor/ckeditor5-enter";
|
|
12
|
+
import { ListFormatting } from "../listformatting.js";
|
|
13
|
+
import { ListUtils } from "./listutils.js";
|
|
14
|
+
import { type ListElement } from "./utils/model.js";
|
|
15
|
+
import { ListBlocksIterable } from "./utils/listwalker.js";
|
|
16
|
+
import { ClipboardPipeline } from "@ckeditor/ckeditor5-clipboard";
|
|
17
|
+
import "../../theme/documentlist.css";
|
|
18
|
+
import "../../theme/list.css";
|
|
19
|
+
export type ListType = "numbered" | "bulleted" | "todo" | "customNumbered" | "customBulleted";
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
* Map of model attributes applicable to list blocks.
|
|
22
|
+
*/
|
|
23
23
|
export interface ListItemAttributesMap {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
listType?: ListType;
|
|
25
|
+
listIndent?: number;
|
|
26
|
+
listItemId?: string;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
* The editing part of the document-list feature. It handles creating, editing and removing lists and list items.
|
|
30
|
+
*/
|
|
31
31
|
export declare class ListEditing extends Plugin {
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The list of registered downcast strategies.
|
|
34
|
+
*/
|
|
35
|
+
private readonly _downcastStrategies;
|
|
36
|
+
/**
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
static get pluginName(): "ListEditing";
|
|
40
|
+
/**
|
|
41
|
+
* @inheritDoc
|
|
42
|
+
*/
|
|
43
|
+
static override get isOfficialPlugin(): true;
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
static get requires(): PluginDependenciesOf<[Enter, Delete, ListUtils, ClipboardPipeline, ListFormatting]>;
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
constructor(editor: Editor);
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
init(): void;
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
afterInit(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Registers a downcast strategy.
|
|
62
|
+
*
|
|
63
|
+
* **Note**: Strategies must be registered in the `Plugin#init()` phase so that it can be applied
|
|
64
|
+
* in the `ListEditing#afterInit()`.
|
|
65
|
+
*
|
|
66
|
+
* @param strategy The downcast strategy to register.
|
|
67
|
+
*/
|
|
68
|
+
registerDowncastStrategy(strategy: ListDowncastStrategy): void;
|
|
69
|
+
/**
|
|
70
|
+
* Returns list of model attribute names that should affect downcast conversion.
|
|
71
|
+
*/
|
|
72
|
+
getListAttributeNames(): Array<string>;
|
|
73
|
+
/**
|
|
74
|
+
* Attaches the listener to the {@link module:engine/view/document~ViewDocument#event:delete} event and handles backspace/delete
|
|
75
|
+
* keys in and around document lists.
|
|
76
|
+
*/
|
|
77
|
+
private _setupDeleteIntegration;
|
|
78
|
+
/**
|
|
79
|
+
* Attaches a listener to the {@link module:engine/view/document~ViewDocument#event:enter} event and handles enter key press
|
|
80
|
+
* in document lists.
|
|
81
|
+
*/
|
|
82
|
+
private _setupEnterIntegration;
|
|
83
|
+
/**
|
|
84
|
+
* Attaches a listener to the {@link module:engine/view/document~ViewDocument#event:tab} event and handles tab key and tab+shift keys
|
|
85
|
+
* presses in document lists.
|
|
86
|
+
*/
|
|
87
|
+
private _setupTabIntegration;
|
|
88
|
+
/**
|
|
89
|
+
* Registers the conversion helpers for the document-list feature.
|
|
90
|
+
*/
|
|
91
|
+
private _setupConversion;
|
|
92
|
+
/**
|
|
93
|
+
* Registers model post-fixers.
|
|
94
|
+
*/
|
|
95
|
+
private _setupModelPostFixing;
|
|
96
|
+
/**
|
|
97
|
+
* Integrates the feature with the clipboard via {@link module:engine/model/model~Model#insertContent} and
|
|
98
|
+
* {@link module:engine/model/model~Model#getSelectedContent}.
|
|
99
|
+
*/
|
|
100
|
+
private _setupClipboardIntegration;
|
|
101
|
+
/**
|
|
102
|
+
* Informs editor accessibility features about keystrokes brought by the plugin.
|
|
103
|
+
*/
|
|
104
|
+
private _setupAccessibilityIntegration;
|
|
105
|
+
/**
|
|
106
|
+
* Convert `listItemId` attribute to `data-list-item-id` attribute on the view element in both downcast pipelines.
|
|
107
|
+
*/
|
|
108
|
+
private _setupListItemIdConversionStrategy;
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
* The attribute to attribute downcast strategy for UL, OL, LI elements.
|
|
112
|
+
*/
|
|
113
113
|
export interface ListAttributeDowncastStrategy {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
114
|
+
/**
|
|
115
|
+
* The scope of the downcast (whether it applies to LI or OL/UL).
|
|
116
|
+
*/
|
|
117
|
+
scope: "list" | "item";
|
|
118
|
+
/**
|
|
119
|
+
* The model attribute name.
|
|
120
|
+
*/
|
|
121
|
+
attributeName: string;
|
|
122
|
+
/**
|
|
123
|
+
* Whether the attribute should be consumed or this strategy is a side effect.
|
|
124
|
+
*
|
|
125
|
+
* @default true
|
|
126
|
+
*/
|
|
127
|
+
consume?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Sets the property on the view element.
|
|
130
|
+
*/
|
|
131
|
+
setAttributeOnDowncast(writer: ViewDowncastWriter, value: unknown, element: ViewElement, options: Record<string, unknown>, modelElement: ModelElement): void;
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
* The custom marker downcast strategy.
|
|
135
|
+
*/
|
|
136
136
|
export interface ListItemMarkerDowncastStrategy {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
137
|
+
/**
|
|
138
|
+
* The scope of the downcast.
|
|
139
|
+
*/
|
|
140
|
+
scope: "itemMarker";
|
|
141
|
+
/**
|
|
142
|
+
* The model attribute name.
|
|
143
|
+
*/
|
|
144
|
+
attributeName: string;
|
|
145
|
+
/**
|
|
146
|
+
* Whether the attribute should be consumed or this strategy is a side effect.
|
|
147
|
+
*
|
|
148
|
+
* @default true
|
|
149
|
+
*/
|
|
150
|
+
consume?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Creates a view element for a custom item marker.
|
|
153
|
+
*/
|
|
154
|
+
createElement(writer: ViewDowncastWriter, modelElement: ModelElement, { dataPipeline }: {
|
|
155
|
+
dataPipeline?: boolean;
|
|
156
|
+
}): ViewElement | null;
|
|
157
|
+
/**
|
|
158
|
+
* Creates an ViewAttributeElement to be used for wrapping a first block of a list item.
|
|
159
|
+
*/
|
|
160
|
+
createWrapperElement?(writer: ViewDowncastWriter, modelElement: ModelElement, { dataPipeline }: {
|
|
161
|
+
dataPipeline?: boolean;
|
|
162
|
+
}): ViewAttributeElement;
|
|
163
|
+
/**
|
|
164
|
+
* Should return true if the given list block can be wrapped with the wrapper created by `createWrapperElement()`
|
|
165
|
+
* or only the marker element should be wrapped.
|
|
166
|
+
*/
|
|
167
|
+
canWrapElement?(modelElement: ModelElement): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Should return true if the custom marker can be injected into a given list block.
|
|
170
|
+
* Otherwise, custom marker view element is always injected before the block element.
|
|
171
|
+
*/
|
|
172
|
+
canInjectMarkerIntoElement?(modelElement: ModelElement): boolean;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
* The downcast strategy.
|
|
176
|
+
*/
|
|
177
177
|
export type ListDowncastStrategy = ListAttributeDowncastStrategy | ListItemMarkerDowncastStrategy;
|
|
178
178
|
/**
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
179
|
+
* Event fired on changes detected on the model list element to verify if the view representation of a list element
|
|
180
|
+
* is representing those attributes.
|
|
181
|
+
*
|
|
182
|
+
* It allows triggering a re-wrapping of a list item.
|
|
183
|
+
*
|
|
184
|
+
* @eventName ~ListEditing#postFixer
|
|
185
|
+
* @param listHead The head element of a list.
|
|
186
|
+
* @param writer The writer to do changes with.
|
|
187
|
+
* @param seenIds The set of already known IDs.
|
|
188
|
+
* @returns If a post-fixer made a change of the model tree, it should return `true`.
|
|
189
|
+
*/
|
|
190
190
|
export type ListEditingPostFixerEvent = {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
];
|
|
200
|
-
return: boolean;
|
|
191
|
+
name: "postFixer";
|
|
192
|
+
args: [{
|
|
193
|
+
listNodes: ListBlocksIterable;
|
|
194
|
+
listHead: ModelElement;
|
|
195
|
+
writer: ModelWriter;
|
|
196
|
+
seenIds: Set<string>;
|
|
197
|
+
}];
|
|
198
|
+
return: boolean;
|
|
201
199
|
};
|
|
202
200
|
/**
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
201
|
+
* Event fired on changes detected on the model list element to verify if the view representation of a list element
|
|
202
|
+
* is representing those attributes.
|
|
203
|
+
*
|
|
204
|
+
* It allows triggering a re-wrapping of a list item.
|
|
205
|
+
*
|
|
206
|
+
* **Note**: For convenience this event is namespaced and could be captured as `checkAttributes:list` or `checkAttributes:item`.
|
|
207
|
+
*
|
|
208
|
+
* @internal
|
|
209
|
+
* @eventName ~ListEditing#checkAttributes
|
|
210
|
+
*/
|
|
213
211
|
export type ListEditingCheckAttributesEvent = {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
];
|
|
224
|
-
return: boolean;
|
|
212
|
+
name: "checkAttributes" | "checkAttributes:list" | "checkAttributes:item";
|
|
213
|
+
args: [{
|
|
214
|
+
viewElement: ViewElement & {
|
|
215
|
+
id?: string;
|
|
216
|
+
};
|
|
217
|
+
modelAttributes: ListItemAttributesMap;
|
|
218
|
+
modelReferenceElement: ListElement;
|
|
219
|
+
}];
|
|
220
|
+
return: boolean;
|
|
225
221
|
};
|
|
226
222
|
/**
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
223
|
+
* Event fired on changes detected on the model list element to verify if the view representation of a list block element
|
|
224
|
+
* is representing those attributes.
|
|
225
|
+
*
|
|
226
|
+
* It allows triggering a reconversion of a list item block.
|
|
227
|
+
*
|
|
228
|
+
* @internal
|
|
229
|
+
* @eventName ~ListEditing#checkElement
|
|
230
|
+
*/
|
|
235
231
|
export type ListEditingCheckElementEvent = {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
];
|
|
243
|
-
return: boolean;
|
|
232
|
+
name: "checkElement";
|
|
233
|
+
args: [{
|
|
234
|
+
viewElement: ViewElement;
|
|
235
|
+
modelElement: ModelElement;
|
|
236
|
+
}];
|
|
237
|
+
return: boolean;
|
|
244
238
|
};
|
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Command, type Editor } from
|
|
9
|
-
import type { ModelElement } from
|
|
6
|
+
* @module list/list/listindentcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { ModelElement } from "@ckeditor/ckeditor5-engine";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
* The document list indent command. It is used by the {@link module:list/list~List list feature}.
|
|
12
|
+
*/
|
|
13
13
|
export declare class ListIndentCommand extends Command {
|
|
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
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Determines by how much the command will change the list item's indent attribute.
|
|
16
|
+
*/
|
|
17
|
+
private readonly _direction;
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of the command.
|
|
20
|
+
*
|
|
21
|
+
* @param editor The editor instance.
|
|
22
|
+
* @param indentDirection The direction of indent. If it is equal to `backward`, the command
|
|
23
|
+
* will outdent a list item.
|
|
24
|
+
*/
|
|
25
|
+
constructor(editor: Editor, indentDirection: "forward" | "backward");
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
override refresh(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.
|
|
32
|
+
*
|
|
33
|
+
* @fires execute
|
|
34
|
+
* @fires afterExecute
|
|
35
|
+
*/
|
|
36
|
+
override execute(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Fires the `afterExecute` event.
|
|
39
|
+
*
|
|
40
|
+
* @param changedBlocks The changed list elements.
|
|
41
|
+
*/
|
|
42
|
+
private _fireAfterExecute;
|
|
43
|
+
/**
|
|
44
|
+
* Checks whether the command can be enabled in the current context.
|
|
45
|
+
*
|
|
46
|
+
* @returns Whether the command should be enabled.
|
|
47
|
+
*/
|
|
48
|
+
private _checkEnabled;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
* Event fired by the {@link ~ListIndentCommand#execute} method.
|
|
52
|
+
*
|
|
53
|
+
* It allows to execute an action after executing the {@link module:list/list/listcommand~ListCommand#execute}
|
|
54
|
+
* method, for example adjusting attributes of changed list items.
|
|
55
|
+
*
|
|
56
|
+
* @internal
|
|
57
|
+
* @eventName ~ListIndentCommand#afterExecute
|
|
58
|
+
*/
|
|
59
59
|
export type ListIndentCommandAfterExecuteEvent = {
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
name: "afterExecute";
|
|
61
|
+
args: [changedBlocks: Array<ModelElement>];
|
|
62
62
|
};
|