@ckeditor/ckeditor5-list 45.2.1 → 46.0.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/build/list.js +1 -1
- package/dist/index-content.css +50 -8
- package/dist/index-editor.css +14 -8
- package/dist/index.css +62 -15
- package/dist/index.css.map +1 -1
- package/dist/index.js +736 -135
- package/dist/index.js.map +1 -1
- package/package.json +11 -10
- package/src/augmentation.d.ts +8 -5
- package/src/index.d.ts +61 -37
- package/src/index.js +53 -25
- package/src/legacyerrors.d.ts +5 -0
- package/src/legacyerrors.js +28 -0
- package/src/legacylist/legacyconverters.d.ts +23 -7
- package/src/legacylist/legacyconverters.js +18 -2
- package/src/legacylist/legacyindentcommand.d.ts +1 -1
- package/src/legacylist/legacyindentcommand.js +1 -1
- package/src/legacylist/legacylistcommand.d.ts +1 -1
- package/src/legacylist/legacylistcommand.js +1 -1
- package/src/legacylist/legacylistediting.d.ts +2 -2
- package/src/legacylist/legacylistediting.js +4 -4
- package/src/legacylist/legacylistutils.d.ts +4 -4
- package/src/legacylist/legacylistutils.js +1 -1
- package/src/legacylist/legacyutils.d.ts +21 -10
- package/src/legacylist/legacyutils.js +14 -4
- package/src/legacylist.d.ts +3 -3
- package/src/legacylist.js +3 -3
- package/src/legacylistproperties/legacylistpropertiesediting.d.ts +2 -2
- package/src/legacylistproperties/legacylistpropertiesediting.js +5 -5
- package/src/legacylistproperties/legacylistreversedcommand.d.ts +1 -1
- package/src/legacylistproperties/legacylistreversedcommand.js +1 -1
- package/src/legacylistproperties/legacyliststartcommand.d.ts +1 -1
- package/src/legacylistproperties/legacyliststartcommand.js +1 -1
- package/src/legacylistproperties/legacyliststylecommand.d.ts +1 -1
- package/src/legacylistproperties/legacyliststylecommand.js +1 -1
- package/src/legacylistproperties.d.ts +3 -3
- package/src/legacylistproperties.js +3 -3
- package/src/legacytodolist/legacychecktodolistcommand.d.ts +6 -6
- package/src/legacytodolist/legacychecktodolistcommand.js +3 -3
- package/src/legacytodolist/legacytodolistconverters.d.ts +15 -8
- package/src/legacytodolist/legacytodolistconverters.js +10 -3
- package/src/legacytodolist/legacytodolistediting.d.ts +2 -2
- package/src/legacytodolist/legacytodolistediting.js +4 -4
- package/src/legacytodolist.d.ts +3 -3
- package/src/legacytodolist.js +3 -3
- package/src/list/adjacentlistssupport.d.ts +1 -1
- package/src/list/adjacentlistssupport.js +1 -1
- package/src/list/converters.d.ts +9 -5
- package/src/list/converters.js +12 -7
- package/src/list/listcommand.d.ts +3 -3
- package/src/list/listcommand.js +1 -1
- package/src/list/listediting.d.ts +21 -17
- package/src/list/listediting.js +28 -11
- package/src/list/listindentcommand.d.ts +3 -3
- package/src/list/listindentcommand.js +2 -2
- package/src/list/listmergecommand.d.ts +3 -3
- package/src/list/listmergecommand.js +2 -2
- package/src/list/listsplitcommand.d.ts +3 -3
- package/src/list/listsplitcommand.js +1 -1
- package/src/list/listui.d.ts +1 -1
- package/src/list/listui.js +1 -1
- package/src/list/listutils.d.ts +7 -7
- package/src/list/listutils.js +1 -1
- package/src/list/utils/listwalker.d.ts +12 -6
- package/src/list/utils/listwalker.js +5 -1
- package/src/list/utils/model.d.ts +25 -22
- package/src/list/utils/model.js +7 -2
- package/src/list/utils/postfixers.d.ts +4 -4
- package/src/list/utils/view.d.ts +3 -3
- package/src/list.d.ts +3 -3
- package/src/list.js +3 -3
- package/src/listconfig.d.ts +13 -0
- package/src/listformatting/listitemboldintegration.d.ts +34 -0
- package/src/listformatting/listitemboldintegration.js +83 -0
- package/src/listformatting/listitemfontcolorintegration.d.ts +34 -0
- package/src/listformatting/listitemfontcolorintegration.js +92 -0
- package/src/listformatting/listitemfontfamilyintegration.d.ts +34 -0
- package/src/listformatting/listitemfontfamilyintegration.js +93 -0
- package/src/listformatting/listitemfontsizeintegration.d.ts +34 -0
- package/src/listformatting/listitemfontsizeintegration.js +119 -0
- package/src/listformatting/listitemitalicintegration.d.ts +34 -0
- package/src/listformatting/listitemitalicintegration.js +83 -0
- package/src/listformatting.d.ts +71 -0
- package/src/listformatting.js +243 -0
- package/src/listproperties/listpropertiesediting.d.ts +7 -7
- package/src/listproperties/listpropertiesediting.js +6 -6
- package/src/listproperties/listpropertiesui.d.ts +1 -1
- package/src/listproperties/listpropertiesui.js +2 -2
- package/src/listproperties/listpropertiesutils.d.ts +1 -1
- package/src/listproperties/listpropertiesutils.js +1 -1
- package/src/listproperties/listreversedcommand.d.ts +1 -1
- package/src/listproperties/listreversedcommand.js +1 -1
- package/src/listproperties/liststartcommand.d.ts +1 -1
- package/src/listproperties/liststartcommand.js +1 -1
- package/src/listproperties/liststylecommand.d.ts +1 -1
- package/src/listproperties/liststylecommand.js +1 -1
- package/src/listproperties/ui/listpropertiesview.d.ts +6 -1
- package/src/listproperties/ui/listpropertiesview.js +1 -1
- package/src/listproperties/utils/config.d.ts +3 -0
- package/src/listproperties/utils/config.js +1 -0
- package/src/listproperties/utils/style.d.ts +9 -0
- package/src/listproperties/utils/style.js +9 -0
- package/src/listproperties.d.ts +3 -3
- package/src/listproperties.js +3 -3
- package/src/todolist/checktodolistcommand.d.ts +3 -3
- package/src/todolist/checktodolistcommand.js +2 -2
- package/src/todolist/todocheckboxchangeobserver.d.ts +8 -6
- package/src/todolist/todocheckboxchangeobserver.js +4 -2
- package/src/todolist/todolistediting.d.ts +2 -2
- package/src/todolist/todolistediting.js +5 -5
- package/src/todolist/todolistui.d.ts +1 -1
- package/src/todolist/todolistui.js +1 -1
- package/src/todolist.d.ts +3 -3
- package/src/todolist.js +3 -3
- package/theme/listformatting.css +48 -0
- package/theme/todolist.css +8 -8
- package/src/documentlist.d.ts +0 -32
- package/src/documentlist.js +0 -47
- package/src/documentlistproperties.d.ts +0 -32
- package/src/documentlistproperties.js +0 -47
- package/src/tododocumentlist.d.ts +0 -32
- package/src/tododocumentlist.js +0 -47
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
import LegacyListUtils from './legacylistutils.js';
|
|
5
|
+
import { LegacyListUtils } from './legacylistutils.js';
|
|
6
6
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
7
7
|
import { Enter } from 'ckeditor5/src/enter.js';
|
|
8
8
|
import { Delete } from 'ckeditor5/src/typing.js';
|
|
@@ -12,7 +12,7 @@ import '../../theme/list.css';
|
|
|
12
12
|
*
|
|
13
13
|
* It registers the `'numberedList'`, `'bulletedList'`, `'indentList'` and `'outdentList'` commands.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export declare class LegacyListEditing extends Plugin {
|
|
16
16
|
/**
|
|
17
17
|
* @inheritDoc
|
|
18
18
|
*/
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module list/legacylist/legacylistediting
|
|
7
7
|
*/
|
|
8
|
-
import LegacyListCommand from './legacylistcommand.js';
|
|
9
|
-
import LegacyIndentCommand from './legacyindentcommand.js';
|
|
10
|
-
import LegacyListUtils from './legacylistutils.js';
|
|
8
|
+
import { LegacyListCommand } from './legacylistcommand.js';
|
|
9
|
+
import { LegacyIndentCommand } from './legacyindentcommand.js';
|
|
10
|
+
import { LegacyListUtils } from './legacylistutils.js';
|
|
11
11
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
12
12
|
import { Enter } from 'ckeditor5/src/enter.js';
|
|
13
13
|
import { Delete } from 'ckeditor5/src/typing.js';
|
|
@@ -18,7 +18,7 @@ import '../../theme/list.css';
|
|
|
18
18
|
*
|
|
19
19
|
* It registers the `'numberedList'`, `'bulletedList'`, `'indentList'` and `'outdentList'` commands.
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export class LegacyListEditing extends Plugin {
|
|
22
22
|
/**
|
|
23
23
|
* @inheritDoc
|
|
24
24
|
*/
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module list/legacylist/legacylistutils
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
8
|
+
import type { ModelElement, Model, ModelPosition } from 'ckeditor5/src/engine.js';
|
|
9
9
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
10
10
|
/**
|
|
11
11
|
* A set of helpers related to legacy lists.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare class LegacyListUtils extends Plugin {
|
|
14
14
|
/**
|
|
15
15
|
* @inheritDoc
|
|
16
16
|
*/
|
|
@@ -30,7 +30,7 @@ export default class LegacyListUtils extends Plugin {
|
|
|
30
30
|
* If no list is selected, it returns an empty array.
|
|
31
31
|
* The order of the elements is not specified.
|
|
32
32
|
*/
|
|
33
|
-
getSelectedListItems(model: Model): Array<
|
|
33
|
+
getSelectedListItems(model: Model): Array<ModelElement>;
|
|
34
34
|
/**
|
|
35
35
|
* Returns an array with all `listItem` elements that represent the same list.
|
|
36
36
|
*
|
|
@@ -41,5 +41,5 @@ export default class LegacyListUtils extends Plugin {
|
|
|
41
41
|
* @param position Starting position.
|
|
42
42
|
* @param direction Walking direction.
|
|
43
43
|
*/
|
|
44
|
-
getSiblingNodes(position:
|
|
44
|
+
getSiblingNodes(position: ModelPosition, direction: 'forward' | 'backward'): Array<ModelElement>;
|
|
45
45
|
}
|
|
@@ -7,7 +7,7 @@ import { getListTypeFromListStyleType, getSelectedListItems, getSiblingNodes } f
|
|
|
7
7
|
/**
|
|
8
8
|
* A set of helpers related to legacy lists.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export class LegacyListUtils extends Plugin {
|
|
11
11
|
/**
|
|
12
12
|
* @inheritDoc
|
|
13
13
|
*/
|
|
@@ -5,45 +5,49 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module list/legacylist/legacyutils
|
|
7
7
|
*/
|
|
8
|
-
import { type DowncastConversionApi, type
|
|
8
|
+
import { type DowncastConversionApi, type ViewDowncastWriter, type ModelElement, type ModelItem, type Model, type ModelPosition, type ViewContainerElement, type ViewElement, type ViewItem, type ViewPosition } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
|
-
* Creates a list item {@link module:engine/view/containerelement~
|
|
10
|
+
* Creates a list item {@link module:engine/view/containerelement~ViewContainerElement}.
|
|
11
11
|
*
|
|
12
|
+
* @internal
|
|
12
13
|
* @param writer The writer instance.
|
|
13
14
|
*/
|
|
14
|
-
export declare function createViewListItemElement(writer:
|
|
15
|
+
export declare function createViewListItemElement(writer: ViewDowncastWriter): ViewContainerElement;
|
|
15
16
|
/**
|
|
16
17
|
* Helper function that creates a `<ul><li></li></ul>` or (`<ol>`) structure out of the given `modelItem` model `listItem` element.
|
|
17
18
|
* Then, it binds the created view list item (`<li>`) with the model `listItem` element.
|
|
18
19
|
* The function then returns the created view list item (`<li>`).
|
|
19
20
|
*
|
|
21
|
+
* @internal
|
|
20
22
|
* @param modelItem Model list item.
|
|
21
23
|
* @param conversionApi Conversion interface.
|
|
22
24
|
* @returns View list element.
|
|
23
25
|
*/
|
|
24
|
-
export declare function generateLiInUl(modelItem:
|
|
26
|
+
export declare function generateLiInUl(modelItem: ModelItem, conversionApi: DowncastConversionApi): ViewContainerElement;
|
|
25
27
|
/**
|
|
26
28
|
* Helper function that inserts a view list at a correct place and merges it with its siblings.
|
|
27
29
|
* It takes a model list item element (`modelItem`) and a corresponding view list item element (`injectedItem`). The view list item
|
|
28
30
|
* should be in a view list element (`<ul>` or `<ol>`) and should be its only child.
|
|
29
31
|
* See comments below to better understand the algorithm.
|
|
30
32
|
*
|
|
33
|
+
* @internal
|
|
31
34
|
* @param modelItem Model list item.
|
|
32
35
|
* @param injectedItem
|
|
33
36
|
* @param conversionApi Conversion interface.
|
|
34
37
|
* @param model The model instance.
|
|
35
38
|
*/
|
|
36
|
-
export declare function injectViewList(modelItem:
|
|
39
|
+
export declare function injectViewList(modelItem: ModelElement, injectedItem: ViewContainerElement, conversionApi: DowncastConversionApi, model: Model): void;
|
|
37
40
|
/**
|
|
38
41
|
* Helper function that takes two parameters that are expected to be view list elements, and merges them.
|
|
39
42
|
* The merge happens only if both parameters are list elements of the same type (the same element name and the same class attributes).
|
|
40
43
|
*
|
|
44
|
+
* @internal
|
|
41
45
|
* @param viewWriter The writer instance.
|
|
42
46
|
* @param firstList The first element to compare.
|
|
43
47
|
* @param secondList The second element to compare.
|
|
44
48
|
* @returns The position after merge or `null` when there was no merge.
|
|
45
49
|
*/
|
|
46
|
-
export declare function mergeViewLists(viewWriter:
|
|
50
|
+
export declare function mergeViewLists(viewWriter: ViewDowncastWriter, firstList: ViewItem, secondList: ViewItem): ViewPosition | null;
|
|
47
51
|
/**
|
|
48
52
|
* Helper function that for a given `view.Position`, returns a `view.Position` that is after all `view.UIElement`s that
|
|
49
53
|
* are after the given position.
|
|
@@ -52,26 +56,30 @@ export declare function mergeViewLists(viewWriter: DowncastWriter, firstList: Vi
|
|
|
52
56
|
* `<container:p>foo^<ui:span></ui:span><ui:span></ui:span>bar</container:p>`
|
|
53
57
|
* For position ^, the position before "bar" will be returned.
|
|
54
58
|
*
|
|
59
|
+
* @internal
|
|
55
60
|
*/
|
|
56
61
|
export declare function positionAfterUiElements(viewPosition: ViewPosition): ViewPosition;
|
|
57
62
|
/**
|
|
58
63
|
* Helper function that searches for a previous list item sibling of a given model item that meets the given criteria
|
|
59
64
|
* passed by the options object.
|
|
60
65
|
*
|
|
66
|
+
* @internal
|
|
61
67
|
* @param options Search criteria.
|
|
62
68
|
* @param options.sameIndent Whether the sought sibling should have the same indentation.
|
|
63
69
|
* @param options.smallerIndent Whether the sought sibling should have a smaller indentation.
|
|
64
70
|
* @param options.listIndent The reference indentation.
|
|
65
71
|
* @param options.direction Walking direction.
|
|
66
72
|
*/
|
|
67
|
-
export declare function getSiblingListItem(modelItem:
|
|
73
|
+
export declare function getSiblingListItem(modelItem: ModelItem | null, options: {
|
|
68
74
|
sameIndent?: boolean;
|
|
69
75
|
smallerIndent?: boolean;
|
|
70
76
|
listIndent?: number;
|
|
71
77
|
direction?: 'forward' | 'backward';
|
|
72
|
-
}):
|
|
78
|
+
}): ModelElement | null;
|
|
73
79
|
/**
|
|
74
80
|
* Returns a first list view element that is direct child of the given view element.
|
|
81
|
+
*
|
|
82
|
+
* @internal
|
|
75
83
|
*/
|
|
76
84
|
export declare function findNestedList(viewElement: ViewElement): ViewElement | null;
|
|
77
85
|
/**
|
|
@@ -81,10 +89,11 @@ export declare function findNestedList(viewElement: ViewElement): ViewElement |
|
|
|
81
89
|
*
|
|
82
90
|
* Additionally, if the `position` is inside a list item, that list item will be returned as well.
|
|
83
91
|
*
|
|
92
|
+
* @internal
|
|
84
93
|
* @param position Starting position.
|
|
85
94
|
* @param direction Walking direction.
|
|
86
95
|
*/
|
|
87
|
-
export declare function getSiblingNodes(position:
|
|
96
|
+
export declare function getSiblingNodes(position: ModelPosition, direction: 'forward' | 'backward'): Array<ModelElement>;
|
|
88
97
|
/**
|
|
89
98
|
* Returns an array with all `listItem` elements in the model selection.
|
|
90
99
|
*
|
|
@@ -94,8 +103,10 @@ export declare function getSiblingNodes(position: Position, direction: 'forward'
|
|
|
94
103
|
*
|
|
95
104
|
* @internal
|
|
96
105
|
*/
|
|
97
|
-
export declare function getSelectedListItems(model: Model): Array<
|
|
106
|
+
export declare function getSelectedListItems(model: Model): Array<ModelElement>;
|
|
98
107
|
/**
|
|
99
108
|
* Checks whether the given list-style-type is supported by numbered or bulleted list.
|
|
109
|
+
*
|
|
110
|
+
* @internal
|
|
100
111
|
*/
|
|
101
112
|
export declare function getListTypeFromListStyleType(listStyleType: string): 'bulleted' | 'numbered' | null;
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module list/legacylist/legacyutils
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { ModelTreeWalker, getViewFillerOffset } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
|
-
* Creates a list item {@link module:engine/view/containerelement~
|
|
10
|
+
* Creates a list item {@link module:engine/view/containerelement~ViewContainerElement}.
|
|
11
11
|
*
|
|
12
|
+
* @internal
|
|
12
13
|
* @param writer The writer instance.
|
|
13
14
|
*/
|
|
14
15
|
export function createViewListItemElement(writer) {
|
|
@@ -21,6 +22,7 @@ export function createViewListItemElement(writer) {
|
|
|
21
22
|
* Then, it binds the created view list item (`<li>`) with the model `listItem` element.
|
|
22
23
|
* The function then returns the created view list item (`<li>`).
|
|
23
24
|
*
|
|
25
|
+
* @internal
|
|
24
26
|
* @param modelItem Model list item.
|
|
25
27
|
* @param conversionApi Conversion interface.
|
|
26
28
|
* @returns View list element.
|
|
@@ -41,6 +43,7 @@ export function generateLiInUl(modelItem, conversionApi) {
|
|
|
41
43
|
* should be in a view list element (`<ul>` or `<ol>`) and should be its only child.
|
|
42
44
|
* See comments below to better understand the algorithm.
|
|
43
45
|
*
|
|
46
|
+
* @internal
|
|
44
47
|
* @param modelItem Model list item.
|
|
45
48
|
* @param injectedItem
|
|
46
49
|
* @param conversionApi Conversion interface.
|
|
@@ -155,6 +158,7 @@ export function mergeViewLists(viewWriter, firstList, secondList) {
|
|
|
155
158
|
* `<container:p>foo^<ui:span></ui:span><ui:span></ui:span>bar</container:p>`
|
|
156
159
|
* For position ^, the position before "bar" will be returned.
|
|
157
160
|
*
|
|
161
|
+
* @internal
|
|
158
162
|
*/
|
|
159
163
|
export function positionAfterUiElements(viewPosition) {
|
|
160
164
|
return viewPosition.getLastMatchingPosition(value => value.item.is('uiElement'));
|
|
@@ -163,6 +167,7 @@ export function positionAfterUiElements(viewPosition) {
|
|
|
163
167
|
* Helper function that searches for a previous list item sibling of a given model item that meets the given criteria
|
|
164
168
|
* passed by the options object.
|
|
165
169
|
*
|
|
170
|
+
* @internal
|
|
166
171
|
* @param options Search criteria.
|
|
167
172
|
* @param options.sameIndent Whether the sought sibling should have the same indentation.
|
|
168
173
|
* @param options.smallerIndent Whether the sought sibling should have a smaller indentation.
|
|
@@ -190,6 +195,8 @@ export function getSiblingListItem(modelItem, options) {
|
|
|
190
195
|
}
|
|
191
196
|
/**
|
|
192
197
|
* Returns a first list view element that is direct child of the given view element.
|
|
198
|
+
*
|
|
199
|
+
* @internal
|
|
193
200
|
*/
|
|
194
201
|
export function findNestedList(viewElement) {
|
|
195
202
|
for (const node of viewElement.getChildren()) {
|
|
@@ -206,6 +213,7 @@ export function findNestedList(viewElement) {
|
|
|
206
213
|
*
|
|
207
214
|
* Additionally, if the `position` is inside a list item, that list item will be returned as well.
|
|
208
215
|
*
|
|
216
|
+
* @internal
|
|
209
217
|
* @param position Starting position.
|
|
210
218
|
* @param direction Walking direction.
|
|
211
219
|
*/
|
|
@@ -219,7 +227,7 @@ export function getSiblingNodes(position, direction) {
|
|
|
219
227
|
direction
|
|
220
228
|
};
|
|
221
229
|
const limitIndent = listItem.getAttribute('listIndent');
|
|
222
|
-
const nodes = [...new
|
|
230
|
+
const nodes = [...new ModelTreeWalker(walkerOptions)]
|
|
223
231
|
.filter(value => value.item.is('element'))
|
|
224
232
|
.map(value => value.item);
|
|
225
233
|
for (const element of nodes) {
|
|
@@ -323,6 +331,8 @@ const NUMBERED_LIST_STYLE_TYPES = [
|
|
|
323
331
|
];
|
|
324
332
|
/**
|
|
325
333
|
* Checks whether the given list-style-type is supported by numbered or bulleted list.
|
|
334
|
+
*
|
|
335
|
+
* @internal
|
|
326
336
|
*/
|
|
327
337
|
export function getListTypeFromListStyleType(listStyleType) {
|
|
328
338
|
if (BULLETED_LIST_STYLE_TYPES.includes(listStyleType)) {
|
|
@@ -343,5 +353,5 @@ function getListItemFillerOffset() {
|
|
|
343
353
|
if (this.isEmpty || hasOnlyLists) {
|
|
344
354
|
return 0;
|
|
345
355
|
}
|
|
346
|
-
return
|
|
356
|
+
return getViewFillerOffset.call(this);
|
|
347
357
|
}
|
package/src/legacylist.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module list/legacylist
|
|
7
7
|
*/
|
|
8
|
-
import LegacyListEditing from './legacylist/legacylistediting.js';
|
|
9
|
-
import ListUI from './list/listui.js';
|
|
8
|
+
import { LegacyListEditing } from './legacylist/legacylistediting.js';
|
|
9
|
+
import { ListUI } from './list/listui.js';
|
|
10
10
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
11
11
|
/**
|
|
12
12
|
* The legacy list feature.
|
|
@@ -14,7 +14,7 @@ import { Plugin } from 'ckeditor5/src/core.js';
|
|
|
14
14
|
* This is a "glue" plugin that loads the {@link module:list/legacylist/legacylistediting~LegacyListEditing legacy list editing feature}
|
|
15
15
|
* and {@link module:list/list/listui~ListUI list UI feature}.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export declare class LegacyList extends Plugin {
|
|
18
18
|
/**
|
|
19
19
|
* @inheritDoc
|
|
20
20
|
*/
|
package/src/legacylist.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module list/legacylist
|
|
7
7
|
*/
|
|
8
|
-
import LegacyListEditing from './legacylist/legacylistediting.js';
|
|
9
|
-
import ListUI from './list/listui.js';
|
|
8
|
+
import { LegacyListEditing } from './legacylist/legacylistediting.js';
|
|
9
|
+
import { ListUI } from './list/listui.js';
|
|
10
10
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
11
11
|
/**
|
|
12
12
|
* The legacy list feature.
|
|
@@ -14,7 +14,7 @@ import { Plugin } from 'ckeditor5/src/core.js';
|
|
|
14
14
|
* This is a "glue" plugin that loads the {@link module:list/legacylist/legacylistediting~LegacyListEditing legacy list editing feature}
|
|
15
15
|
* and {@link module:list/list/listui~ListUI list UI feature}.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export class LegacyList extends Plugin {
|
|
18
18
|
/**
|
|
19
19
|
* @inheritDoc
|
|
20
20
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module list/legacylistproperties/legacylistpropertiesediting
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
-
import LegacyListEditing from '../legacylist/legacylistediting.js';
|
|
9
|
+
import { LegacyListEditing } from '../legacylist/legacylistediting.js';
|
|
10
10
|
/**
|
|
11
11
|
* The engine of the list properties feature.
|
|
12
12
|
*
|
|
@@ -16,7 +16,7 @@ import LegacyListEditing from '../legacylist/legacylistediting.js';
|
|
|
16
16
|
* It registers the `'listStyle'`, `'listReversed'` and `'listStart'` commands if they are enabled in the configuration.
|
|
17
17
|
* Read more in {@link module:list/listconfig~ListPropertiesConfig}.
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export declare class LegacyListPropertiesEditing extends Plugin {
|
|
20
20
|
/**
|
|
21
21
|
* @inheritDoc
|
|
22
22
|
*/
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* @module list/legacylistproperties/legacylistpropertiesediting
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import LegacyListEditing from '../legacylist/legacylistediting.js';
|
|
10
|
-
import LegacyListStyleCommand from './legacyliststylecommand.js';
|
|
11
|
-
import LegacyListReversedCommand from './legacylistreversedcommand.js';
|
|
12
|
-
import LegacyListStartCommand from './legacyliststartcommand.js';
|
|
9
|
+
import { LegacyListEditing } from '../legacylist/legacylistediting.js';
|
|
10
|
+
import { LegacyListStyleCommand } from './legacyliststylecommand.js';
|
|
11
|
+
import { LegacyListReversedCommand } from './legacylistreversedcommand.js';
|
|
12
|
+
import { LegacyListStartCommand } from './legacyliststartcommand.js';
|
|
13
13
|
import { getSiblingListItem, getSiblingNodes } from '../legacylist/legacyutils.js';
|
|
14
14
|
import { normalizeListStyle } from '../listproperties/utils/style.js';
|
|
15
15
|
const DEFAULT_LIST_TYPE = 'default';
|
|
@@ -22,7 +22,7 @@ const DEFAULT_LIST_TYPE = 'default';
|
|
|
22
22
|
* It registers the `'listStyle'`, `'listReversed'` and `'listStart'` commands if they are enabled in the configuration.
|
|
23
23
|
* Read more in {@link module:list/listconfig~ListPropertiesConfig}.
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
25
|
+
export class LegacyListPropertiesEditing extends Plugin {
|
|
26
26
|
/**
|
|
27
27
|
* @inheritDoc
|
|
28
28
|
*/
|
|
@@ -11,7 +11,7 @@ import { Command } from 'ckeditor5/src/core.js';
|
|
|
11
11
|
* reversed.
|
|
12
12
|
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export declare class LegacyListReversedCommand extends Command {
|
|
15
15
|
/**
|
|
16
16
|
* @inheritDoc
|
|
17
17
|
*/
|
|
@@ -12,7 +12,7 @@ import { getSelectedListItems } from '../legacylist/legacyutils.js';
|
|
|
12
12
|
* reversed.
|
|
13
13
|
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export class LegacyListReversedCommand extends Command {
|
|
16
16
|
/**
|
|
17
17
|
* @inheritDoc
|
|
18
18
|
*/
|
|
@@ -10,7 +10,7 @@ import { Command } from 'ckeditor5/src/core.js';
|
|
|
10
10
|
* The list start index command. It changes the `listStart` attribute of the selected list items.
|
|
11
11
|
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare class LegacyListStartCommand extends Command {
|
|
14
14
|
/**
|
|
15
15
|
* @inheritDoc
|
|
16
16
|
*/
|
|
@@ -11,7 +11,7 @@ import { getSelectedListItems } from '../legacylist/legacyutils.js';
|
|
|
11
11
|
* The list start index command. It changes the `listStart` attribute of the selected list items.
|
|
12
12
|
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export class LegacyListStartCommand extends Command {
|
|
15
15
|
/**
|
|
16
16
|
* @inheritDoc
|
|
17
17
|
*/
|
|
@@ -13,7 +13,7 @@ import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
|
13
13
|
* the command tries to convert selected items to a list of that type.
|
|
14
14
|
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export declare class LegacyListStyleCommand extends Command {
|
|
17
17
|
isStyleTypeSupported: undefined;
|
|
18
18
|
/**
|
|
19
19
|
* @inheritDoc
|
|
@@ -14,7 +14,7 @@ import { getListTypeFromListStyleType, getSelectedListItems } from '../legacylis
|
|
|
14
14
|
* the command tries to convert selected items to a list of that type.
|
|
15
15
|
* It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export class LegacyListStyleCommand extends Command {
|
|
18
18
|
/**
|
|
19
19
|
* The default type of the list style.
|
|
20
20
|
*/
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module list/legacylistproperties
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import LegacyListPropertiesEditing from './legacylistproperties/legacylistpropertiesediting.js';
|
|
10
|
-
import ListPropertiesUI from './listproperties/listpropertiesui.js';
|
|
9
|
+
import { LegacyListPropertiesEditing } from './legacylistproperties/legacylistpropertiesediting.js';
|
|
10
|
+
import { ListPropertiesUI } from './listproperties/listpropertiesui.js';
|
|
11
11
|
/**
|
|
12
12
|
* The legacy list properties feature.
|
|
13
13
|
*
|
|
@@ -15,7 +15,7 @@ import ListPropertiesUI from './listproperties/listpropertiesui.js';
|
|
|
15
15
|
* legacy list properties editing feature} and the
|
|
16
16
|
* {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export declare class LegacyListProperties extends Plugin {
|
|
19
19
|
/**
|
|
20
20
|
* @inheritDoc
|
|
21
21
|
*/
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module list/legacylistproperties
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import LegacyListPropertiesEditing from './legacylistproperties/legacylistpropertiesediting.js';
|
|
10
|
-
import ListPropertiesUI from './listproperties/listpropertiesui.js';
|
|
9
|
+
import { LegacyListPropertiesEditing } from './legacylistproperties/legacylistpropertiesediting.js';
|
|
10
|
+
import { ListPropertiesUI } from './listproperties/listpropertiesui.js';
|
|
11
11
|
/**
|
|
12
12
|
* The legacy list properties feature.
|
|
13
13
|
*
|
|
@@ -15,7 +15,7 @@ import ListPropertiesUI from './listproperties/listpropertiesui.js';
|
|
|
15
15
|
* legacy list properties editing feature} and the
|
|
16
16
|
* {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export class LegacyListProperties extends Plugin {
|
|
19
19
|
/**
|
|
20
20
|
* @inheritDoc
|
|
21
21
|
*/
|
|
@@ -6,27 +6,27 @@
|
|
|
6
6
|
* @module list/legacytodolist/legacychecktodolistcommand
|
|
7
7
|
*/
|
|
8
8
|
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
-
import type {
|
|
9
|
+
import type { ModelElement } from 'ckeditor5/src/engine.js';
|
|
10
10
|
/**
|
|
11
11
|
* The check to-do command.
|
|
12
12
|
*
|
|
13
13
|
* The command is registered by the {@link module:list/legacytodolist/legacytodolistediting~LegacyTodoListEditing} as
|
|
14
14
|
* the `checkTodoList` editor command and it is also available via aliased `todoListCheck` name.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export declare class LegacyCheckTodoListCommand extends Command {
|
|
17
17
|
/**
|
|
18
|
-
* A list of to-do list items selected by the {@link module:engine/model/selection~
|
|
18
|
+
* A list of to-do list items selected by the {@link module:engine/model/selection~ModelSelection}.
|
|
19
19
|
*
|
|
20
20
|
* @observable
|
|
21
21
|
* @readonly
|
|
22
22
|
*/
|
|
23
23
|
value: boolean;
|
|
24
24
|
/**
|
|
25
|
-
* A list of to-do list items selected by the {@link module:engine/model/selection~
|
|
25
|
+
* A list of to-do list items selected by the {@link module:engine/model/selection~ModelSelection}.
|
|
26
26
|
*
|
|
27
27
|
* @internal
|
|
28
28
|
*/
|
|
29
|
-
_selectedElements: Array<
|
|
29
|
+
_selectedElements: Array<ModelElement>;
|
|
30
30
|
/**
|
|
31
31
|
* @inheritDoc
|
|
32
32
|
*/
|
|
@@ -36,7 +36,7 @@ export default class LegacyCheckTodoListCommand extends Command {
|
|
|
36
36
|
*/
|
|
37
37
|
refresh(): void;
|
|
38
38
|
/**
|
|
39
|
-
* Gets all to-do list items selected by the {@link module:engine/model/selection~
|
|
39
|
+
* Gets all to-do list items selected by the {@link module:engine/model/selection~ModelSelection}.
|
|
40
40
|
*/
|
|
41
41
|
private _getSelectedItems;
|
|
42
42
|
/**
|
|
@@ -13,9 +13,9 @@ const attributeKey = 'todoListChecked';
|
|
|
13
13
|
* The command is registered by the {@link module:list/legacytodolist/legacytodolistediting~LegacyTodoListEditing} as
|
|
14
14
|
* the `checkTodoList` editor command and it is also available via aliased `todoListCheck` name.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export class LegacyCheckTodoListCommand extends Command {
|
|
17
17
|
/**
|
|
18
|
-
* A list of to-do list items selected by the {@link module:engine/model/selection~
|
|
18
|
+
* A list of to-do list items selected by the {@link module:engine/model/selection~ModelSelection}.
|
|
19
19
|
*
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
@@ -41,7 +41,7 @@ export default class LegacyCheckTodoListCommand extends Command {
|
|
|
41
41
|
this.isEnabled = !!this._selectedElements.length;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Gets all to-do list items selected by the {@link module:engine/model/selection~
|
|
44
|
+
* Gets all to-do list items selected by the {@link module:engine/model/selection~ModelSelection}.
|
|
45
45
|
*/
|
|
46
46
|
_getSelectedItems() {
|
|
47
47
|
const model = this.editor.model;
|
|
@@ -5,32 +5,34 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module list/legacytodolist/legacytodolistconverters
|
|
7
7
|
*/
|
|
8
|
-
import type { DowncastAttributeEvent, DowncastInsertEvent,
|
|
8
|
+
import type { DowncastAttributeEvent, DowncastInsertEvent, ModelElement, MapperModelToViewPositionEvent, Model, UpcastElementEvent, EditingView } from 'ckeditor5/src/engine.js';
|
|
9
9
|
import { type GetCallback } from 'ckeditor5/src/utils.js';
|
|
10
10
|
/**
|
|
11
11
|
* A model-to-view converter for the `listItem` model element insertion.
|
|
12
12
|
*
|
|
13
|
-
* It converts the `listItem` model element to an unordered list with a {@link module:engine/view/uielement~
|
|
13
|
+
* It converts the `listItem` model element to an unordered list with a {@link module:engine/view/uielement~ViewUIElement checkbox element}
|
|
14
14
|
* at the beginning of each list item. It also merges the list with surrounding lists (if available).
|
|
15
15
|
*
|
|
16
16
|
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
17
17
|
*
|
|
18
|
+
* @internal
|
|
18
19
|
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
|
|
19
20
|
* @param model Model instance.
|
|
20
21
|
* @param onCheckboxChecked Callback function.
|
|
21
22
|
* @returns Returns a conversion callback.
|
|
22
23
|
*/
|
|
23
|
-
export declare function modelViewInsertion(model: Model, onCheckboxChecked: (element:
|
|
24
|
+
export declare function modelViewInsertion(model: Model, onCheckboxChecked: (element: ModelElement) => void): GetCallback<DowncastInsertEvent<ModelElement>>;
|
|
24
25
|
/**
|
|
25
26
|
* A model-to-view converter for the `listItem` model element insertion.
|
|
26
27
|
*
|
|
27
28
|
* It is used by {@link module:engine/controller/datacontroller~DataController}.
|
|
28
29
|
*
|
|
30
|
+
* @internal
|
|
29
31
|
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
|
|
30
32
|
* @param model Model instance.
|
|
31
33
|
* @returns Returns a conversion callback.
|
|
32
34
|
*/
|
|
33
|
-
export declare function dataModelViewInsertion(model: Model): GetCallback<DowncastInsertEvent<
|
|
35
|
+
export declare function dataModelViewInsertion(model: Model): GetCallback<DowncastInsertEvent<ModelElement>>;
|
|
34
36
|
/**
|
|
35
37
|
* A view-to-model converter for the checkbox element inside a view list item.
|
|
36
38
|
*
|
|
@@ -39,6 +41,7 @@ export declare function dataModelViewInsertion(model: Model): GetCallback<Downca
|
|
|
39
41
|
*
|
|
40
42
|
* It is used by {@link module:engine/controller/datacontroller~DataController}.
|
|
41
43
|
*
|
|
44
|
+
* @internal
|
|
42
45
|
* @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
|
|
43
46
|
*/
|
|
44
47
|
export declare const dataViewModelCheckmarkInsertion: GetCallback<UpcastElementEvent>;
|
|
@@ -46,7 +49,7 @@ export declare const dataViewModelCheckmarkInsertion: GetCallback<UpcastElementE
|
|
|
46
49
|
* A model-to-view converter for the `listType` attribute change on the `listItem` model element.
|
|
47
50
|
*
|
|
48
51
|
* This change means that the `<li>` element parent changes to `<ul class="todo-list">` and a
|
|
49
|
-
* {@link module:engine/view/uielement~
|
|
52
|
+
* {@link module:engine/view/uielement~ViewUIElement checkbox UI element} is added at the beginning
|
|
50
53
|
* of the list item element (or vice versa).
|
|
51
54
|
*
|
|
52
55
|
* This converter is preceded by {@link module:list/legacylist/legacyconverters~modelViewChangeType} and followed by
|
|
@@ -55,29 +58,33 @@ export declare const dataViewModelCheckmarkInsertion: GetCallback<UpcastElementE
|
|
|
55
58
|
*
|
|
56
59
|
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
57
60
|
*
|
|
61
|
+
* @internal
|
|
58
62
|
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
|
|
59
63
|
* @param onCheckedChange Callback fired after clicking the checkbox UI element.
|
|
60
64
|
* @param view Editing view controller.
|
|
61
65
|
* @returns Returns a conversion callback.
|
|
62
66
|
*/
|
|
63
|
-
export declare function modelViewChangeType(onCheckedChange: (element:
|
|
67
|
+
export declare function modelViewChangeType(onCheckedChange: (element: ModelElement) => void, view: EditingView): GetCallback<DowncastAttributeEvent<ModelElement>>;
|
|
64
68
|
/**
|
|
65
69
|
* A model-to-view converter for the `todoListChecked` attribute change on the `listItem` model element.
|
|
66
70
|
*
|
|
67
|
-
* It marks the {@link module:engine/view/uielement~
|
|
71
|
+
* It marks the {@link module:engine/view/uielement~ViewUIElement checkbox UI element} as checked.
|
|
68
72
|
*
|
|
69
73
|
* It is used by {@link module:engine/controller/editingcontroller~EditingController}.
|
|
70
74
|
*
|
|
75
|
+
* @internal
|
|
71
76
|
* @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
|
|
72
77
|
* @param onCheckedChange Callback fired after clicking the checkbox UI element.
|
|
73
78
|
* @returns Returns a conversion callback.
|
|
74
79
|
*/
|
|
75
|
-
export declare function modelViewChangeChecked(onCheckedChange: (element:
|
|
80
|
+
export declare function modelViewChangeChecked(onCheckedChange: (element: ModelElement) => void): GetCallback<DowncastAttributeEvent<ModelElement>>;
|
|
76
81
|
/**
|
|
77
82
|
* A model-to-view position at zero offset mapper.
|
|
78
83
|
*
|
|
79
84
|
* This helper ensures that position inside todo-list in the view is mapped after the checkbox.
|
|
80
85
|
*
|
|
81
86
|
* It only handles the position at the beginning of a list item as other positions are properly mapped be the default mapper.
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
82
89
|
*/
|
|
83
90
|
export declare function mapModelToViewPosition(view: EditingView): GetCallback<MapperModelToViewPositionEvent>;
|