@ckeditor/ckeditor5-list 41.3.0-alpha.4 → 41.3.1

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.
Files changed (209) hide show
  1. package/build/list.js +1 -1
  2. package/package.json +2 -3
  3. package/src/index.d.ts +2 -2
  4. package/src/index.js +1 -0
  5. package/src/legacylist/legacylistcommand.d.ts +3 -2
  6. package/src/legacylistproperties/legacyliststylecommand.js +1 -0
  7. package/src/list/converters.d.ts +9 -1
  8. package/src/list/converters.js +87 -13
  9. package/src/list/listcommand.d.ts +14 -2
  10. package/src/list/listcommand.js +17 -4
  11. package/src/list/listediting.d.ts +7 -1
  12. package/src/list/listediting.js +7 -1
  13. package/src/list/listui.js +3 -3
  14. package/src/list/listutils.d.ts +7 -1
  15. package/src/list/listutils.js +7 -1
  16. package/src/list/utils/listwalker.d.ts +13 -16
  17. package/src/list/utils/model.d.ts +9 -2
  18. package/src/list/utils/model.js +12 -3
  19. package/src/list/utils/view.d.ts +4 -3
  20. package/src/list/utils/view.js +1 -1
  21. package/src/list/utils.d.ts +2 -2
  22. package/src/list/utils.js +25 -15
  23. package/src/listproperties/listpropertiesediting.js +2 -1
  24. package/src/listproperties/listpropertiesui.js +169 -82
  25. package/src/listproperties/liststartcommand.js +6 -3
  26. package/src/todolist/todolistediting.js +4 -12
  27. package/src/todolist/todolistui.js +2 -2
  28. package/dist/content-index.css +0 -102
  29. package/dist/editor-index.css +0 -74
  30. package/dist/index.css +0 -228
  31. package/dist/index.css.map +0 -1
  32. package/dist/translations/ar.d.ts +0 -8
  33. package/dist/translations/ar.js +0 -5
  34. package/dist/translations/ast.d.ts +0 -8
  35. package/dist/translations/ast.js +0 -5
  36. package/dist/translations/az.d.ts +0 -8
  37. package/dist/translations/az.js +0 -5
  38. package/dist/translations/bg.d.ts +0 -8
  39. package/dist/translations/bg.js +0 -5
  40. package/dist/translations/bn.d.ts +0 -8
  41. package/dist/translations/bn.js +0 -5
  42. package/dist/translations/ca.d.ts +0 -8
  43. package/dist/translations/ca.js +0 -5
  44. package/dist/translations/cs.d.ts +0 -8
  45. package/dist/translations/cs.js +0 -5
  46. package/dist/translations/da.d.ts +0 -8
  47. package/dist/translations/da.js +0 -5
  48. package/dist/translations/de-ch.d.ts +0 -8
  49. package/dist/translations/de-ch.js +0 -5
  50. package/dist/translations/de.d.ts +0 -8
  51. package/dist/translations/de.js +0 -5
  52. package/dist/translations/el.d.ts +0 -8
  53. package/dist/translations/el.js +0 -5
  54. package/dist/translations/en-au.d.ts +0 -8
  55. package/dist/translations/en-au.js +0 -5
  56. package/dist/translations/en-gb.d.ts +0 -8
  57. package/dist/translations/en-gb.js +0 -5
  58. package/dist/translations/en.d.ts +0 -8
  59. package/dist/translations/en.js +0 -5
  60. package/dist/translations/eo.d.ts +0 -8
  61. package/dist/translations/eo.js +0 -5
  62. package/dist/translations/es.d.ts +0 -8
  63. package/dist/translations/es.js +0 -5
  64. package/dist/translations/et.d.ts +0 -8
  65. package/dist/translations/et.js +0 -5
  66. package/dist/translations/eu.d.ts +0 -8
  67. package/dist/translations/eu.js +0 -5
  68. package/dist/translations/fa.d.ts +0 -8
  69. package/dist/translations/fa.js +0 -5
  70. package/dist/translations/fi.d.ts +0 -8
  71. package/dist/translations/fi.js +0 -5
  72. package/dist/translations/fr.d.ts +0 -8
  73. package/dist/translations/fr.js +0 -5
  74. package/dist/translations/gl.d.ts +0 -8
  75. package/dist/translations/gl.js +0 -5
  76. package/dist/translations/he.d.ts +0 -8
  77. package/dist/translations/he.js +0 -5
  78. package/dist/translations/hi.d.ts +0 -8
  79. package/dist/translations/hi.js +0 -5
  80. package/dist/translations/hr.d.ts +0 -8
  81. package/dist/translations/hr.js +0 -5
  82. package/dist/translations/hu.d.ts +0 -8
  83. package/dist/translations/hu.js +0 -5
  84. package/dist/translations/id.d.ts +0 -8
  85. package/dist/translations/id.js +0 -5
  86. package/dist/translations/it.d.ts +0 -8
  87. package/dist/translations/it.js +0 -5
  88. package/dist/translations/ja.d.ts +0 -8
  89. package/dist/translations/ja.js +0 -5
  90. package/dist/translations/jv.d.ts +0 -8
  91. package/dist/translations/jv.js +0 -5
  92. package/dist/translations/km.d.ts +0 -8
  93. package/dist/translations/km.js +0 -5
  94. package/dist/translations/kn.d.ts +0 -8
  95. package/dist/translations/kn.js +0 -5
  96. package/dist/translations/ko.d.ts +0 -8
  97. package/dist/translations/ko.js +0 -5
  98. package/dist/translations/ku.d.ts +0 -8
  99. package/dist/translations/ku.js +0 -5
  100. package/dist/translations/lt.d.ts +0 -8
  101. package/dist/translations/lt.js +0 -5
  102. package/dist/translations/lv.d.ts +0 -8
  103. package/dist/translations/lv.js +0 -5
  104. package/dist/translations/ms.d.ts +0 -8
  105. package/dist/translations/ms.js +0 -5
  106. package/dist/translations/nb.d.ts +0 -8
  107. package/dist/translations/nb.js +0 -5
  108. package/dist/translations/ne.d.ts +0 -8
  109. package/dist/translations/ne.js +0 -5
  110. package/dist/translations/nl.d.ts +0 -8
  111. package/dist/translations/nl.js +0 -5
  112. package/dist/translations/no.d.ts +0 -8
  113. package/dist/translations/no.js +0 -5
  114. package/dist/translations/pl.d.ts +0 -8
  115. package/dist/translations/pl.js +0 -5
  116. package/dist/translations/pt-br.d.ts +0 -8
  117. package/dist/translations/pt-br.js +0 -5
  118. package/dist/translations/pt.d.ts +0 -8
  119. package/dist/translations/pt.js +0 -5
  120. package/dist/translations/ro.d.ts +0 -8
  121. package/dist/translations/ro.js +0 -5
  122. package/dist/translations/ru.d.ts +0 -8
  123. package/dist/translations/ru.js +0 -5
  124. package/dist/translations/si.d.ts +0 -8
  125. package/dist/translations/si.js +0 -5
  126. package/dist/translations/sk.d.ts +0 -8
  127. package/dist/translations/sk.js +0 -5
  128. package/dist/translations/sq.d.ts +0 -8
  129. package/dist/translations/sq.js +0 -5
  130. package/dist/translations/sr-latn.d.ts +0 -8
  131. package/dist/translations/sr-latn.js +0 -5
  132. package/dist/translations/sr.d.ts +0 -8
  133. package/dist/translations/sr.js +0 -5
  134. package/dist/translations/sv.d.ts +0 -8
  135. package/dist/translations/sv.js +0 -5
  136. package/dist/translations/th.d.ts +0 -8
  137. package/dist/translations/th.js +0 -5
  138. package/dist/translations/tk.d.ts +0 -8
  139. package/dist/translations/tk.js +0 -5
  140. package/dist/translations/tr.d.ts +0 -8
  141. package/dist/translations/tr.js +0 -5
  142. package/dist/translations/tt.d.ts +0 -8
  143. package/dist/translations/tt.js +0 -5
  144. package/dist/translations/ug.d.ts +0 -8
  145. package/dist/translations/ug.js +0 -5
  146. package/dist/translations/uk.d.ts +0 -8
  147. package/dist/translations/uk.js +0 -5
  148. package/dist/translations/ur.d.ts +0 -8
  149. package/dist/translations/ur.js +0 -5
  150. package/dist/translations/uz.d.ts +0 -8
  151. package/dist/translations/uz.js +0 -5
  152. package/dist/translations/vi.d.ts +0 -8
  153. package/dist/translations/vi.js +0 -5
  154. package/dist/translations/zh-cn.d.ts +0 -8
  155. package/dist/translations/zh-cn.js +0 -5
  156. package/dist/translations/zh.d.ts +0 -8
  157. package/dist/translations/zh.js +0 -5
  158. package/dist/types/augmentation.d.ts +0 -57
  159. package/dist/types/documentlist.d.ts +0 -32
  160. package/dist/types/documentlistproperties.d.ts +0 -32
  161. package/dist/types/index.d.ts +0 -49
  162. package/dist/types/legacylist/legacyconverters.d.ts +0 -200
  163. package/dist/types/legacylist/legacyindentcommand.d.ts +0 -41
  164. package/dist/types/legacylist/legacylistcommand.d.ts +0 -59
  165. package/dist/types/legacylist/legacylistediting.d.ts +0 -36
  166. package/dist/types/legacylist/legacylistutils.d.ts +0 -45
  167. package/dist/types/legacylist/legacyutils.d.ts +0 -105
  168. package/dist/types/legacylist.d.ts +0 -30
  169. package/dist/types/legacylistproperties/legacylistpropertiesediting.d.ts +0 -76
  170. package/dist/types/legacylistproperties/legacylistreversedcommand.d.ts +0 -42
  171. package/dist/types/legacylistproperties/legacyliststartcommand.d.ts +0 -41
  172. package/dist/types/legacylistproperties/legacyliststylecommand.d.ts +0 -71
  173. package/dist/types/legacylistproperties.d.ts +0 -31
  174. package/dist/types/legacytodolist/legacychecktodolistcommand.d.ts +0 -56
  175. package/dist/types/legacytodolist/legacytodolistconverters.d.ts +0 -87
  176. package/dist/types/legacytodolist/legacytodolistediting.d.ts +0 -43
  177. package/dist/types/legacytodolist.d.ts +0 -31
  178. package/dist/types/list/adjacentlistssupport.d.ts +0 -19
  179. package/dist/types/list/converters.d.ts +0 -69
  180. package/dist/types/list/listcommand.d.ts +0 -84
  181. package/dist/types/list/listediting.d.ts +0 -220
  182. package/dist/types/list/listindentcommand.d.ts +0 -66
  183. package/dist/types/list/listmergecommand.d.ts +0 -80
  184. package/dist/types/list/listsplitcommand.d.ts +0 -71
  185. package/dist/types/list/listui.d.ts +0 -23
  186. package/dist/types/list/listutils.d.ts +0 -50
  187. package/dist/types/list/utils/listwalker.d.ts +0 -149
  188. package/dist/types/list/utils/model.d.ts +0 -206
  189. package/dist/types/list/utils/postfixers.d.ts +0 -41
  190. package/dist/types/list/utils/view.d.ts +0 -85
  191. package/dist/types/list/utils.d.ts +0 -22
  192. package/dist/types/list.d.ts +0 -30
  193. package/dist/types/listconfig.d.ts +0 -136
  194. package/dist/types/listproperties/converters.d.ts +0 -23
  195. package/dist/types/listproperties/listpropertiesediting.d.ts +0 -92
  196. package/dist/types/listproperties/listpropertiesui.d.ts +0 -27
  197. package/dist/types/listproperties/listpropertiesutils.d.ts +0 -37
  198. package/dist/types/listproperties/listreversedcommand.d.ts +0 -40
  199. package/dist/types/listproperties/liststartcommand.d.ts +0 -42
  200. package/dist/types/listproperties/liststylecommand.d.ts +0 -76
  201. package/dist/types/listproperties/ui/listpropertiesview.d.ts +0 -160
  202. package/dist/types/listproperties/utils/style.d.ts +0 -24
  203. package/dist/types/listproperties.d.ts +0 -31
  204. package/dist/types/tododocumentlist.d.ts +0 -32
  205. package/dist/types/todolist/checktodolistcommand.d.ts +0 -53
  206. package/dist/types/todolist/todocheckboxchangeobserver.d.ts +0 -45
  207. package/dist/types/todolist/todolistediting.d.ts +0 -42
  208. package/dist/types/todolist/todolistui.d.ts +0 -23
  209. package/dist/types/todolist.d.ts +0 -31
@@ -1,206 +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-oss-license
8
- */
9
- /**
10
- * @module list/list/utils/model
11
- */
12
- import type { DocumentFragment, Element, Model, Node, Writer, Item, Schema } from 'ckeditor5/src/engine.js';
13
- import { type ArrayOrItem } from 'ckeditor5/src/utils.js';
14
- /**
15
- * The list item ID generator.
16
- *
17
- * @internal
18
- */
19
- export declare class ListItemUid {
20
- /**
21
- * Returns the next ID.
22
- *
23
- * @internal
24
- */
25
- static next(): string;
26
- }
27
- /**
28
- * An {@link module:engine/model/element~Element} that is known to be a list element.
29
- *
30
- * @internal
31
- */
32
- export interface ListElement extends Element {
33
- getAttribute(key: 'listItemId'): string;
34
- getAttribute(key: 'listIndent'): number;
35
- getAttribute(key: 'listType'): 'numbered' | 'bulleted' | 'todo';
36
- getAttribute(key: string): unknown;
37
- }
38
- /**
39
- * Returns true if the given model node is a list item block.
40
- *
41
- * @internal
42
- */
43
- export declare function isListItemBlock(node: Item | DocumentFragment | null): node is ListElement;
44
- /**
45
- * Returns an array with all elements that represents the same list item.
46
- *
47
- * It means that values for `listIndent`, and `listItemId` for all items are equal.
48
- *
49
- * @internal
50
- * @param listItem Starting list item element.
51
- * @param options.higherIndent Whether blocks with a higher indent level than the start block should be included
52
- * in the result.
53
- */
54
- export declare function getAllListItemBlocks(listItem: Node, options?: {
55
- higherIndent?: boolean;
56
- }): Array<ListElement>;
57
- /**
58
- * Returns an array with elements that represents the same list item in the specified direction.
59
- *
60
- * It means that values for `listIndent` and `listItemId` for all items are equal.
61
- *
62
- * **Note**: For backward search the provided item is not included, but for forward search it is included in the result.
63
- *
64
- * @internal
65
- * @param listItem Starting list item element.
66
- * @param options.direction Walking direction.
67
- * @param options.higherIndent Whether blocks with a higher indent level than the start block should be included in the result.
68
- */
69
- export declare function getListItemBlocks(listItem: Node, options?: {
70
- direction?: 'forward' | 'backward';
71
- higherIndent?: boolean;
72
- }): Array<ListElement>;
73
- /**
74
- * Returns a list items nested inside the given list item.
75
- *
76
- * @internal
77
- */
78
- export declare function getNestedListBlocks(listItem: Element): Array<ListElement>;
79
- /**
80
- * Returns array of all blocks/items of the same list as given block (same indent, same type and properties).
81
- *
82
- * @internal
83
- * @param listItem Starting list item element.
84
- */
85
- export declare function getListItems(listItem: Element): Array<ListElement>;
86
- /**
87
- * Check if the given block is the first in the list item.
88
- *
89
- * @internal
90
- * @param listBlock The list block element.
91
- */
92
- export declare function isFirstBlockOfListItem(listBlock: Node): boolean;
93
- /**
94
- * Check if the given block is the last in the list item.
95
- *
96
- * @internal
97
- */
98
- export declare function isLastBlockOfListItem(listBlock: Element): boolean;
99
- /**
100
- * Expands the given list of selected blocks to include the leading and tailing blocks of partially selected list items.
101
- *
102
- * @internal
103
- * @param blocks The list of selected blocks.
104
- * @param options.withNested Whether should include nested list items.
105
- */
106
- export declare function expandListBlocksToCompleteItems(blocks: ArrayOrItem<Element>, options?: {
107
- withNested?: boolean;
108
- }): Array<ListElement>;
109
- /**
110
- * Expands the given list of selected blocks to include all the items of the lists they're in.
111
- *
112
- * @internal
113
- * @param blocks The list of selected blocks.
114
- */
115
- export declare function expandListBlocksToCompleteList(blocks: ArrayOrItem<Element>): Array<ListElement>;
116
- /**
117
- * Splits the list item just before the provided list block.
118
- *
119
- * @internal
120
- * @param listBlock The list block element.
121
- * @param writer The model writer.
122
- * @returns The array of updated blocks.
123
- */
124
- export declare function splitListItemBefore(listBlock: Element, writer: Writer): Array<ListElement>;
125
- /**
126
- * Merges the list item with the parent list item.
127
- *
128
- * @internal
129
- * @param listBlock The list block element.
130
- * @param parentBlock The list block element to merge with.
131
- * @param writer The model writer.
132
- * @returns The array of updated blocks.
133
- */
134
- export declare function mergeListItemBefore(listBlock: Node, parentBlock: Element, writer: Writer): Array<ListElement>;
135
- /**
136
- * Increases indentation of given list blocks.
137
- *
138
- * @internal
139
- * @param blocks The block or iterable of blocks.
140
- * @param writer The model writer.
141
- * @param options.expand Whether should expand the list of blocks to include complete list items.
142
- * @param options.indentBy The number of levels the indentation should change (could be negative).
143
- */
144
- export declare function indentBlocks(blocks: ArrayOrItem<ListElement>, writer: Writer, { expand, indentBy }?: {
145
- expand?: boolean;
146
- indentBy?: number;
147
- }): Array<ListElement>;
148
- /**
149
- * Decreases indentation of given list of blocks. If the indentation of some blocks matches the indentation
150
- * of surrounding blocks, they get merged together.
151
- *
152
- * @internal
153
- * @param blocks The block or iterable of blocks.
154
- * @param writer The model writer.
155
- */
156
- export declare function outdentBlocksWithMerge(blocks: ArrayOrItem<ListElement>, writer: Writer): Array<ListElement>;
157
- /**
158
- * Removes all list attributes from the given blocks.
159
- *
160
- * @internal
161
- * @param blocks The block or iterable of blocks.
162
- * @param writer The model writer.
163
- * @returns Array of altered blocks.
164
- */
165
- export declare function removeListAttributes(blocks: ArrayOrItem<Element>, writer: Writer): Array<Element>;
166
- /**
167
- * Checks whether the given blocks are related to a single list item.
168
- *
169
- * @internal
170
- * @param blocks The list block elements.
171
- */
172
- export declare function isSingleListItem(blocks: Array<Node>): boolean;
173
- /**
174
- * Modifies the indents of list blocks following the given list block so the indentation is valid after
175
- * the given block is no longer a list item.
176
- *
177
- * @internal
178
- * @param lastBlock The last list block that has become a non-list element.
179
- * @param writer The model writer.
180
- * @returns Array of altered blocks.
181
- */
182
- export declare function outdentFollowingItems(lastBlock: Element, writer: Writer): Array<ListElement>;
183
- /**
184
- * Returns the array of given blocks sorted by model indexes (document order).
185
- *
186
- * @internal
187
- */
188
- export declare function sortBlocks<T extends Element>(blocks: Iterable<T>): Array<T>;
189
- /**
190
- * Returns a selected block object. If a selected object is inline or when there is no selected
191
- * object, `null` is returned.
192
- *
193
- * @internal
194
- * @param model The instance of editor model.
195
- * @returns Selected block object or `null`.
196
- */
197
- export declare function getSelectedBlockObject(model: Model): Element | null;
198
- /**
199
- * Checks whether the given block can be replaced by a listItem.
200
- *
201
- * Note that this is possible only when multiBlock = false option is set in feature config.
202
- *
203
- * @param block A block to be tested.
204
- * @param schema The schema of the document.
205
- */
206
- export declare function canBecomeSimpleListItem(block: Element, schema: Schema): boolean;
@@ -1,41 +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-oss-license
8
- */
9
- /**
10
- * @module list/list/utils/postfixers
11
- */
12
- import type { Position, Writer } from 'ckeditor5/src/engine.js';
13
- import { type ListIteratorValue } from './listwalker.js';
14
- import { type ListElement } from './model.js';
15
- /**
16
- * Based on the provided positions looks for the list head and stores it in the provided map.
17
- *
18
- * @internal
19
- * @param position The search starting position.
20
- * @param itemToListHead The map from list item element to the list head element.
21
- */
22
- export declare function findAndAddListHeadToMap(position: Position, itemToListHead: Map<ListElement, ListElement>): void;
23
- /**
24
- * Scans the list starting from the given list head element and fixes items' indentation.
25
- *
26
- * @internal
27
- * @param listNodes The iterable of list nodes.
28
- * @param writer The model writer.
29
- * @returns Whether the model was modified.
30
- */
31
- export declare function fixListIndents(listNodes: Iterable<ListIteratorValue>, writer: Writer): boolean;
32
- /**
33
- * Scans the list starting from the given list head element and fixes items' types.
34
- *
35
- * @internal
36
- * @param listNodes The iterable of list nodes.
37
- * @param seenIds The set of already known IDs.
38
- * @param writer The model writer.
39
- * @returns Whether the model was modified.
40
- */
41
- export declare function fixListItemIds(listNodes: Iterable<ListIteratorValue>, seenIds: Set<string>, writer: Writer): boolean;
@@ -1,85 +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-oss-license
8
- */
9
- /**
10
- * @module list/list/utils/view
11
- */
12
- import type { DowncastWriter, ViewAttributeElement, ViewDocumentFragment, ViewElement, ViewNode } from 'ckeditor5/src/engine.js';
13
- /**
14
- * Checks if view element is a list type (ul or ol).
15
- *
16
- * @internal
17
- */
18
- export declare function isListView(viewElement: ViewNode | ViewDocumentFragment): viewElement is ViewElement & {
19
- name: 'ul' | 'ol';
20
- };
21
- /**
22
- * Checks if view element is a list item (li).
23
- *
24
- * @internal
25
- */
26
- export declare function isListItemView(viewElement: ViewNode | ViewDocumentFragment): viewElement is ViewElement & {
27
- name: 'li';
28
- };
29
- /**
30
- * Calculates the indent value for a list item. Handles HTML compliant and non-compliant lists.
31
- *
32
- * Also, fixes non HTML compliant lists indents:
33
- *
34
- * ```
35
- * before: fixed list:
36
- * OL OL
37
- * |-> LI (parent LIs: 0) |-> LI (indent: 0)
38
- * |-> OL |-> OL
39
- * |-> OL |
40
- * | |-> OL |
41
- * | |-> OL |
42
- * | |-> LI (parent LIs: 1) |-> LI (indent: 1)
43
- * |-> LI (parent LIs: 1) |-> LI (indent: 1)
44
- *
45
- * before: fixed list:
46
- * OL OL
47
- * |-> OL |
48
- * |-> OL |
49
- * |-> OL |
50
- * |-> LI (parent LIs: 0) |-> LI (indent: 0)
51
- *
52
- * before: fixed list:
53
- * OL OL
54
- * |-> LI (parent LIs: 0) |-> LI (indent: 0)
55
- * |-> OL |-> OL
56
- * |-> LI (parent LIs: 0) |-> LI (indent: 1)
57
- * ```
58
- *
59
- * @internal
60
- */
61
- export declare function getIndent(listItem: ViewElement): number;
62
- /**
63
- * Creates a list attribute element (ol or ul).
64
- *
65
- * @internal
66
- */
67
- export declare function createListElement(writer: DowncastWriter, indent: number, type: 'bulleted' | 'numbered' | 'todo', id?: string): ViewAttributeElement;
68
- /**
69
- * Creates a list item attribute element (li).
70
- *
71
- * @internal
72
- */
73
- export declare function createListItemElement(writer: DowncastWriter, indent: number, id: string): ViewAttributeElement;
74
- /**
75
- * Returns a view element name for the given list type.
76
- *
77
- * @internal
78
- */
79
- export declare function getViewElementNameForListType(type?: 'bulleted' | 'numbered' | 'todo'): 'ol' | 'ul';
80
- /**
81
- * Returns a view element ID for the given list type and indent.
82
- *
83
- * @internal
84
- */
85
- export declare function getViewElementIdForListType(type?: 'bulleted' | 'numbered' | 'todo', indent?: number): string;
@@ -1,22 +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-oss-license
8
- */
9
- /**
10
- * @module list/list/utils
11
- */
12
- import type { Editor } from 'ckeditor5/src/core.js';
13
- /**
14
- * Helper method for creating a UI button and linking it with an appropriate command.
15
- *
16
- * @internal
17
- * @param editor The editor instance to which the UI component will be added.
18
- * @param commandName The name of the command.
19
- * @param label The button label.
20
- * @param icon The source of the icon.
21
- */
22
- export declare function createUIComponent(editor: Editor, commandName: 'bulletedList' | 'numberedList' | 'todoList', label: string, icon: string): void;
@@ -1,30 +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-oss-license
8
- */
9
- /**
10
- * @module list/list
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- import ListEditing from './list/listediting.js';
14
- import ListUI from './list/listui.js';
15
- /**
16
- * The list feature.
17
- *
18
- * This is a "glue" plugin that loads the {@link module:list/list/listediting~ListEditing list
19
- * editing feature} and {@link module:list/list/listui~ListUI list UI feature}.
20
- */
21
- export default class List extends Plugin {
22
- /**
23
- * @inheritDoc
24
- */
25
- static get requires(): readonly [typeof ListEditing, typeof ListUI];
26
- /**
27
- * @inheritDoc
28
- */
29
- static get pluginName(): "List";
30
- }
@@ -1,136 +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-oss-license
8
- */
9
- /**
10
- * @module list/listconfig
11
- */
12
- /**
13
- * The configuration of the {@link module:list/list~List list} feature
14
- * and the {@link module:list/legacylist~LegacyList legacy list} feature.
15
- *
16
- * ```ts
17
- * ClassicEditor
18
- * .create( editorElement, {
19
- * list: ... // The list feature configuration.
20
- * } )
21
- * .then( ... )
22
- * .catch( ... );
23
- * ```
24
- *
25
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
26
- *
27
- * @interface ListConfig
28
- */
29
- export interface ListConfig {
30
- /**
31
- * The configuration of the {@link module:list/listproperties~ListProperties} feature and the
32
- * {@link module:list/legacylistproperties~LegacyListProperties legacy list properties} feature.
33
- *
34
- * Read more in {@link module:list/listconfig~ListPropertiesConfig}.
35
- */
36
- properties?: ListPropertiesConfig;
37
- /**
38
- * Allows multiple blocks in single list item.
39
- *
40
- * With this option enabled you can have block widgets, for example images or even tables, within a list item.
41
- *
42
- * **Note:** This is enabled by default.
43
- *
44
- * @default true
45
- */
46
- multiBlock?: boolean;
47
- }
48
- /**
49
- * The configuration of the {@link module:list/listproperties~ListProperties list properties} feature and the
50
- * {@link module:list/legacylistproperties~LegacyListProperties legacy list properties} feature.
51
- *
52
- * This configuration controls the individual list properties. For instance, it enables or disables specific editor commands
53
- * operating on lists ({@link module:list/listproperties/liststylecommand~ListStyleCommand `'listStyle'`},
54
- * {@link module:list/listproperties/liststartcommand~ListStartCommand `'listStart'`},
55
- * {@link module:list/listproperties/listreversedcommand~ListReversedCommand `'listReversed'`}, or on the legacy lists
56
- * {@link module:list/legacylistproperties/legacyliststylecommand~LegacyListStyleCommand `'listStyle'`},
57
- * {@link module:list/legacylistproperties/legacyliststartcommand~LegacyListStartCommand `'listStart'`},
58
- * {@link module:list/legacylistproperties/legacylistreversedcommand~LegacyListReversedCommand `'listReversed'`}), the look of the UI
59
- * (`'numberedList'` and `'bulletedList'` dropdowns), and the editor data pipeline (allowed HTML attributes).
60
- *
61
- * ```ts
62
- * ClassicEditor
63
- * .create( editorElement, {
64
- * list: {
65
- * properties: {
66
- * styles: true,
67
- * startIndex: true,
68
- * reversed: true
69
- * }
70
- * }
71
- * } )
72
- * .then( ... )
73
- * .catch( ... );
74
- * ```
75
- */
76
- export interface ListPropertiesConfig {
77
- /**
78
- * When set, the list style feature will be enabled.
79
- * It allows changing the `list-style-type` style or the `type` HTML attribute of a list.
80
- *
81
- * **Note**: Styling using the `type` HTML attribute is only available in
82
- * {@link module:list/listproperties~ListProperties list properties}
83
- * ({@link module:list/listconfig~ListPropertiesStyleConfig learn more}).
84
- *
85
- * @default true
86
- */
87
- styles?: boolean | ListPropertiesStyleConfig;
88
- /**
89
- * When set, the list start index feature will be enabled. It allows changing the `start` HTML attribute of the numbered lists. As a
90
- * result, it will be possible to specify the start value of the first item in an ordered list.
91
- *
92
- * **Note**: This configuration does not affect bulleted and to-do lists.
93
- *
94
- * @default false
95
- */
96
- startIndex?: boolean;
97
- /**
98
- * When set, the reversed list feature will be enabled. It allows changing the `reversed` HTML attribute of the numbered lists. As a
99
- * result, it will be possible to make the list order descending instead of ascending.
100
- *
101
- * **Note**: This configuration does not affect bulleted and to-do lists.
102
- *
103
- * @default false
104
- */
105
- reversed?: boolean;
106
- }
107
- export interface ListPropertiesStyleConfig {
108
- /**
109
- * When set `true`, the list style feature will use the `type` attribute of `<ul>` and `<ol>` elements instead of the `list-style-type`
110
- * style.
111
- *
112
- * ```ts
113
- * {
114
- * list: {
115
- * properties: {
116
- * styles: {
117
- * useAttribute: true
118
- * },
119
- *
120
- * // ...
121
- * }
122
- * },
123
- *
124
- * // ...
125
- * }
126
- * ```
127
- *
128
- * **Note**: Due to limitations of HTML, the "Decimal with leading zero" style is impossible to set using the `type` attribute.
129
- *
130
- * **Note**: This configuration works only with
131
- * {@link module:list/listproperties~ListProperties list properties}.
132
- *
133
- * @default false
134
- */
135
- useAttribute?: boolean;
136
- }
@@ -1,23 +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-oss-license
8
- */
9
- /**
10
- * @module list/listproperties/converters
11
- */
12
- import type { UpcastElementEvent } from 'ckeditor5/src/engine.js';
13
- import type { GetCallback } from 'ckeditor5/src/utils.js';
14
- import type { AttributeStrategy } from './listpropertiesediting.js';
15
- /**
16
- * Returns a converter that consumes the `style`, `reversed`, and `start` attributes.
17
- * In `style`, it searches for the `list-style-type` definition.
18
- * If not found, the `"default"` value will be used.
19
- *
20
- * @internal
21
- * @param strategy
22
- */
23
- export declare function listPropertiesUpcastConverter(strategy: AttributeStrategy): GetCallback<UpcastElementEvent>;
@@ -1,92 +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-oss-license
8
- */
9
- /**
10
- * @module list/listproperties/listpropertiesediting
11
- */
12
- import { Plugin, type Editor } from 'ckeditor5/src/core.js';
13
- import type { Consumables, DowncastWriter, Element, Item, ViewElement } from 'ckeditor5/src/engine.js';
14
- import ListEditing, { type ListItemAttributesMap } from '../list/listediting.js';
15
- import ListPropertiesUtils from './listpropertiesutils.js';
16
- /**
17
- * The document list properties engine feature.
18
- *
19
- * It registers the `'listStyle'`, `'listReversed'` and `'listStart'` commands if they are enabled in the configuration.
20
- * Read more in {@link module:list/listconfig~ListPropertiesConfig}.
21
- */
22
- export default class ListPropertiesEditing extends Plugin {
23
- /**
24
- * @inheritDoc
25
- */
26
- static get requires(): readonly [typeof ListEditing, typeof ListPropertiesUtils];
27
- /**
28
- * @inheritDoc
29
- */
30
- static get pluginName(): "ListPropertiesEditing";
31
- /**
32
- * @inheritDoc
33
- */
34
- constructor(editor: Editor);
35
- /**
36
- * @inheritDoc
37
- */
38
- init(): void;
39
- }
40
- /**
41
- * Strategy for dealing with `listItem` attributes supported by this plugin.
42
- *
43
- * @internal
44
- */
45
- export interface AttributeStrategy {
46
- /**
47
- * The model attribute name.
48
- */
49
- attributeName: keyof ListItemAttributesMap;
50
- /**
51
- * The model attribute default value.
52
- */
53
- defaultValue: unknown;
54
- /**
55
- * The view consumable as expected by {@link module:engine/conversion/viewconsumable~ViewConsumable#consume `ViewConsumable`}.
56
- */
57
- viewConsumables: Consumables;
58
- /**
59
- * Registers an editor command.
60
- */
61
- addCommand(editor: Editor): void;
62
- /**
63
- * Verifies whether the strategy is applicable for the specified model element.
64
- */
65
- appliesToListItem(element: Item): boolean;
66
- /**
67
- * Verifies whether the model attribute value is valid.
68
- */
69
- hasValidAttribute(element: Element): boolean;
70
- /**
71
- * Sets the property on the view element.
72
- */
73
- setAttributeOnDowncast(writer: DowncastWriter, value: unknown, element: ViewElement): void;
74
- /**
75
- * Retrieves the property value from the view element.
76
- */
77
- getAttributeOnUpcast(element: ViewElement): unknown;
78
- }
79
- declare module '../list/listediting' {
80
- interface ListItemAttributesMap {
81
- listStyle?: string;
82
- listStart?: number;
83
- listReversed?: boolean;
84
- }
85
- }
86
- declare module '../list/utils/model' {
87
- interface ListElement {
88
- getAttribute(key: 'listStyle'): string;
89
- getAttribute(key: 'listStart'): number;
90
- getAttribute(key: 'listReversed'): boolean;
91
- }
92
- }
@@ -1,27 +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-oss-license
8
- */
9
- /**
10
- * @module list/listproperties/listpropertiesui
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- import '../../theme/liststyles.css';
14
- /**
15
- * The list properties UI plugin. It introduces the extended `'bulletedList'` and `'numberedList'` toolbar
16
- * buttons that allow users to control such aspects of list as the marker, start index or order.
17
- *
18
- * **Note**: Buttons introduced by this plugin override implementations from the {@link module:list/list/listui~ListUI}
19
- * (because they share the same names).
20
- */
21
- export default class ListPropertiesUI extends Plugin {
22
- /**
23
- * @inheritDoc
24
- */
25
- static get pluginName(): "ListPropertiesUI";
26
- init(): void;
27
- }