@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,32 +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/documentlistproperties
11
- */
12
- import { Plugin, type Editor } from 'ckeditor5/src/core.js';
13
- import ListProperties from './listproperties.js';
14
- /**
15
- * The document list properties feature.
16
- *
17
- * This is an obsolete plugin that exists for backward compatibility only.
18
- * Use the {@link module:list/listproperties~ListProperties `ListProperties`} instead.
19
- *
20
- * @deprecated
21
- */
22
- export default class DocumentListProperties extends Plugin {
23
- /**
24
- * @inheritDoc
25
- */
26
- static get requires(): readonly [typeof ListProperties];
27
- /**
28
- * @inheritDoc
29
- */
30
- static get pluginName(): "DocumentListProperties";
31
- constructor(editor: Editor);
32
- }
@@ -1,49 +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
11
- */
12
- export { default as List } from './list.js';
13
- export { default as ListEditing, type ListEditingPostFixerEvent } from './list/listediting.js';
14
- export { default as ListUtils } from './list/listutils.js';
15
- export { default as ListUI } from './list/listui.js';
16
- export { default as ListIndentCommand } from './list/listindentcommand.js';
17
- export type { default as ListCommand } from './list/listcommand.js';
18
- export type { default as ListMergeCommand } from './list/listmergecommand.js';
19
- export type { default as ListSplitCommand } from './list/listsplitcommand.js';
20
- export { default as ListProperties } from './listproperties.js';
21
- export { default as ListPropertiesEditing } from './listproperties/listpropertiesediting.js';
22
- export { default as ListPropertiesUtils } from './listproperties/listpropertiesutils.js';
23
- export { default as ListPropertiesUI } from './listproperties/listpropertiesui.js';
24
- export type { default as ListReversedCommand } from './listproperties/listreversedcommand.js';
25
- export type { default as ListStartCommand } from './listproperties/liststartcommand.js';
26
- export type { default as ListStyleCommand } from './listproperties/liststylecommand.js';
27
- export { default as TodoList } from './todolist.js';
28
- export { default as TodoListUI } from './todolist/todolistui.js';
29
- export { default as TodoListEditing } from './todolist/todolistediting.js';
30
- export type { default as CheckTodoListCommand } from './todolist/checktodolistcommand.js';
31
- export { default as LegacyList } from './legacylist.js';
32
- export { default as LegacyListEditing } from './legacylist/legacylistediting.js';
33
- export { default as LegacyListUtils } from './legacylist/legacylistutils.js';
34
- export { default as LegacyIndentCommand } from './legacylist/legacyindentcommand.js';
35
- export type { default as LegacyListCommand } from './legacylist/legacylistcommand.js';
36
- export { default as LegacyListProperties } from './legacylistproperties.js';
37
- export { default as LegacyListPropertiesEditing } from './legacylistproperties/legacylistpropertiesediting.js';
38
- export type { default as LegacyListReversedCommand } from './legacylistproperties/legacylistreversedcommand.js';
39
- export type { default as LegacyListStartCommand } from './legacylistproperties/legacyliststartcommand.js';
40
- export type { default as LegacyListStyleCommand } from './legacylistproperties/legacyliststylecommand.js';
41
- export { default as LegacyTodoList } from './legacytodolist.js';
42
- export { default as LegacyTodoListEditing } from './legacytodolist/legacytodolistediting.js';
43
- export type { default as LegacyCheckTodoListCommand } from './legacytodolist/legacychecktodolistcommand.js';
44
- export type { ListConfig, ListPropertiesConfig } from './listconfig.js';
45
- export { default as AdjacentListsSupport } from './list/adjacentlistssupport.js';
46
- export { default as DocumentList } from './documentlist.js';
47
- export { default as DocumentListProperties } from './documentlistproperties.js';
48
- export { default as TodoDocumentList } from './tododocumentlist.js';
49
- import './augmentation.js';
@@ -1,200 +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/legacylist/legacyconverters
11
- */
12
- import { type DowncastAttributeEvent, type DowncastInsertEvent, type DowncastRemoveEvent, type Element, type MapperModelToViewPositionEvent, type MapperViewToModelPositionEvent, type Model, type ModelInsertContentEvent, type UpcastElementEvent, type EditingView, type Writer } from 'ckeditor5/src/engine.js';
13
- import type { GetCallback } from 'ckeditor5/src/utils.js';
14
- /**
15
- * A model-to-view converter for the `listItem` model element insertion.
16
- *
17
- * It creates a `<ul><li></li><ul>` (or `<ol>`) view structure out of a `listItem` model element, inserts it at the correct
18
- * position, and merges the list with surrounding lists (if available).
19
- *
20
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
21
- * @param model Model instance.
22
- */
23
- export declare function modelViewInsertion(model: Model): GetCallback<DowncastInsertEvent<Element>>;
24
- /**
25
- * A model-to-view converter for the `listItem` model element removal.
26
- *
27
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove
28
- * @param model Model instance.
29
- * @returns Returns a conversion callback.
30
- */
31
- export declare function modelViewRemove(model: Model): GetCallback<DowncastRemoveEvent>;
32
- /**
33
- * A model-to-view converter for the `type` attribute change on the `listItem` model element.
34
- *
35
- * This change means that the `<li>` element parent changes from `<ul>` to `<ol>` (or vice versa). This is accomplished
36
- * by breaking view elements and changing their name. The next {@link module:list/legacylist/legacyconverters~modelViewMergeAfterChangeType}
37
- * converter will attempt to merge split nodes.
38
- *
39
- * Splitting this conversion into 2 steps makes it possible to add an additional conversion in the middle.
40
- * Check {@link module:list/legacytodolist/legacytodolistconverters~modelViewChangeType} to see an example of it.
41
- *
42
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
43
- */
44
- export declare const modelViewChangeType: GetCallback<DowncastAttributeEvent<Element>>;
45
- /**
46
- * A model-to-view converter that attempts to merge nodes split by {@link module:list/legacylist/legacyconverters~modelViewChangeType}.
47
- *
48
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
49
- */
50
- export declare const modelViewMergeAfterChangeType: GetCallback<DowncastAttributeEvent<Element>>;
51
- /**
52
- * A model-to-view converter for the `listIndent` attribute change on the `listItem` model element.
53
- *
54
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
55
- * @param model Model instance.
56
- * @returns Returns a conversion callback.
57
- */
58
- export declare function modelViewChangeIndent(model: Model): GetCallback<DowncastAttributeEvent<Element>>;
59
- /**
60
- * A special model-to-view converter introduced by the {@link module:list/legacylist~LegacyList list feature}. This converter is fired for
61
- * insert change of every model item, and should be fired before the actual converter. The converter checks whether the inserted
62
- * model item is a non-`listItem` element. If it is, and it is inserted inside a view list, the converter breaks the
63
- * list so the model element is inserted to the view parent element corresponding to its model parent element.
64
- *
65
- * The converter prevents such situations:
66
- *
67
- * ```xml
68
- * // Model: // View:
69
- * <listItem>foo</listItem> <ul>
70
- * <listItem>bar</listItem> <li>foo</li>
71
- * <li>bar</li>
72
- * </ul>
73
- *
74
- * // After change: // Correct view guaranteed by this converter:
75
- * <listItem>foo</listItem> <ul><li>foo</li></ul><p>xxx</p><ul><li>bar</li></ul>
76
- * <paragraph>xxx</paragraph> // Instead of this wrong view state:
77
- * <listItem>bar</listItem> <ul><li>foo</li><p>xxx</p><li>bar</li></ul>
78
- * ```
79
- *
80
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
81
- */
82
- export declare const modelViewSplitOnInsert: GetCallback<DowncastInsertEvent<Element>>;
83
- /**
84
- * A special model-to-view converter introduced by the {@link module:list/legacylist~LegacyList list feature}. This converter takes care of
85
- * merging view lists after something is removed or moved from near them.
86
- *
87
- * Example:
88
- *
89
- * ```xml
90
- * // Model: // View:
91
- * <listItem>foo</listItem> <ul><li>foo</li></ul>
92
- * <paragraph>xxx</paragraph> <p>xxx</p>
93
- * <listItem>bar</listItem> <ul><li>bar</li></ul>
94
- *
95
- * // After change: // Correct view guaranteed by this converter:
96
- * <listItem>foo</listItem> <ul>
97
- * <listItem>bar</listItem> <li>foo</li>
98
- * <li>bar</li>
99
- * </ul>
100
- * ```
101
- *
102
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove
103
- */
104
- export declare const modelViewMergeAfter: GetCallback<DowncastRemoveEvent>;
105
- /**
106
- * A view-to-model converter that converts the `<li>` view elements into the `listItem` model elements.
107
- *
108
- * To set correct values of the `listType` and `listIndent` attributes the converter:
109
- * * checks `<li>`'s parent,
110
- * * stores and increases the `conversionApi.store.indent` value when `<li>`'s sub-items are converted.
111
- *
112
- * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
113
- */
114
- export declare const viewModelConverter: GetCallback<UpcastElementEvent>;
115
- /**
116
- * A view-to-model converter for the `<ul>` and `<ol>` view elements that cleans the input view of garbage.
117
- * This is mostly to clean whitespaces from between the `<li>` view elements inside the view list element, however, also
118
- * incorrect data can be cleared if the view was incorrect.
119
- *
120
- * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
121
- */
122
- export declare const cleanList: GetCallback<UpcastElementEvent>;
123
- /**
124
- * A view-to-model converter for the `<li>` elements that cleans whitespace formatting from the input view.
125
- *
126
- * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
127
- */
128
- export declare const cleanListItem: GetCallback<UpcastElementEvent>;
129
- /**
130
- * Returns a callback for model position to view position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes
131
- * positions between the `listItem` elements that would be incorrectly mapped because of how list items are represented in the model
132
- * and in the view.
133
- */
134
- export declare function modelToViewPosition(view: EditingView): GetCallback<MapperModelToViewPositionEvent>;
135
- /**
136
- * The callback for view position to model position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes
137
- * positions between the `<li>` elements that would be incorrectly mapped because of how list items are represented in the model
138
- * and in the view.
139
- *
140
- * @see module:engine/conversion/mapper~Mapper#event:viewToModelPosition
141
- * @param model Model instance.
142
- * @returns Returns a conversion callback.
143
- */
144
- export declare function viewToModelPosition(model: Model): GetCallback<MapperViewToModelPositionEvent>;
145
- /**
146
- * Post-fixer that reacts to changes on document and fixes incorrect model states.
147
- *
148
- * In the example below, there is a correct list structure.
149
- * Then the middle element is removed so the list structure will become incorrect:
150
- *
151
- * ```xml
152
- * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
153
- * <listItem listType="bulleted" listIndent=1>Item 2</listItem> <--- this is removed.
154
- * <listItem listType="bulleted" listIndent=2>Item 3</listItem>
155
- * ```
156
- *
157
- * The list structure after the middle element is removed:
158
- *
159
- * ```xml
160
- * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
161
- * <listItem listType="bulleted" listIndent=2>Item 3</listItem>
162
- * ```
163
- *
164
- * Should become:
165
- *
166
- * ```xml
167
- * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
168
- * <listItem listType="bulleted" listIndent=1>Item 3</listItem> <--- note that indent got post-fixed.
169
- * ```
170
- *
171
- * @param model The data model.
172
- * @param writer The writer to do changes with.
173
- * @returns `true` if any change has been applied, `false` otherwise.
174
- */
175
- export declare function modelChangePostFixer(model: Model, writer: Writer): boolean;
176
- /**
177
- * A fixer for pasted content that includes list items.
178
- *
179
- * It fixes indentation of pasted list items so the pasted items match correctly to the context they are pasted into.
180
- *
181
- * Example:
182
- *
183
- * ```xml
184
- * <listItem listType="bulleted" listIndent=0>A</listItem>
185
- * <listItem listType="bulleted" listIndent=1>B^</listItem>
186
- * // At ^ paste: <listItem listType="bulleted" listIndent=4>X</listItem>
187
- * // <listItem listType="bulleted" listIndent=5>Y</listItem>
188
- * <listItem listType="bulleted" listIndent=2>C</listItem>
189
- * ```
190
- *
191
- * Should become:
192
- *
193
- * ```xml
194
- * <listItem listType="bulleted" listIndent=0>A</listItem>
195
- * <listItem listType="bulleted" listIndent=1>BX</listItem>
196
- * <listItem listType="bulleted" listIndent=2>Y/listItem>
197
- * <listItem listType="bulleted" listIndent=2>C</listItem>
198
- * ```
199
- */
200
- export declare const modelIndentPasteFixer: GetCallback<ModelInsertContentEvent>;
@@ -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
- import { Command, type Editor } from 'ckeditor5/src/core.js';
10
- /**
11
- * The list indent command. It is used by the {@link module:list/legacylist~LegacyList legacy list feature}.
12
- */
13
- export default class LegacyIndentCommand extends Command {
14
- /**
15
- * Determines by how much the command will change the list item's indent attribute.
16
- */
17
- private readonly _indentBy;
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 will outdent a list item.
23
- */
24
- constructor(editor: Editor, indentDirection: 'forward' | 'backward');
25
- /**
26
- * @inheritDoc
27
- */
28
- refresh(): void;
29
- /**
30
- * Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.
31
- *
32
- * @fires execute
33
- */
34
- execute(): void;
35
- /**
36
- * Checks whether the command can be enabled in the current context.
37
- *
38
- * @returns Whether the command should be enabled.
39
- */
40
- private _checkEnabled;
41
- }
@@ -1,59 +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
- import { Command, type Editor } from 'ckeditor5/src/core.js';
10
- /**
11
- * The list command. It is used by the {@link module:list/legacylist~LegacyList legacy list feature}.
12
- */
13
- export default class LegacyListCommand extends Command {
14
- /**
15
- * The type of the list created by the command.
16
- */
17
- readonly type: 'numbered' | 'bulleted' | 'todo';
18
- /**
19
- * A flag indicating whether the command is active, which means that the selection starts in a list of the same type.
20
- *
21
- * @readonly
22
- */
23
- value: boolean;
24
- /**
25
- * Creates an instance of the command.
26
- *
27
- * @param editor The editor instance.
28
- * @param type List type that will be handled by this command.
29
- */
30
- constructor(editor: Editor, type: 'numbered' | 'bulleted' | 'todo');
31
- /**
32
- * @inheritDoc
33
- */
34
- refresh(): void;
35
- /**
36
- * Executes the list command.
37
- *
38
- * @fires execute
39
- * @param options Command options.
40
- * @param options.forceValue If set, it will force the command behavior. If `true`, the command will try to convert the
41
- * selected items and potentially the neighbor elements to the proper list items. If set to `false`, it will convert selected elements
42
- * to paragraphs. If not set, the command will toggle selected elements to list items or paragraphs, depending on the selection.
43
- */
44
- execute(options?: {
45
- forceValue?: boolean;
46
- }): void;
47
- /**
48
- * Checks the command's {@link #value}.
49
- *
50
- * @returns The current value.
51
- */
52
- private _getValue;
53
- /**
54
- * Checks whether the command can be enabled in the current context.
55
- *
56
- * @returns Whether the command should be enabled.
57
- */
58
- private _checkEnabled;
59
- }
@@ -1,36 +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
- import LegacyListUtils from './legacylistutils.js';
10
- import { Plugin } from 'ckeditor5/src/core.js';
11
- import { Enter } from 'ckeditor5/src/enter.js';
12
- import { Delete } from 'ckeditor5/src/typing.js';
13
- import '../../theme/list.css';
14
- /**
15
- * The engine of the list feature. It handles creating, editing and removing lists and list items.
16
- *
17
- * It registers the `'numberedList'`, `'bulletedList'`, `'indentList'` and `'outdentList'` commands.
18
- */
19
- export default class LegacyListEditing extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get pluginName(): "LegacyListEditing";
24
- /**
25
- * @inheritDoc
26
- */
27
- static get requires(): readonly [typeof Enter, typeof Delete, typeof LegacyListUtils];
28
- /**
29
- * @inheritDoc
30
- */
31
- init(): void;
32
- /**
33
- * @inheritDoc
34
- */
35
- afterInit(): void;
36
- }
@@ -1,45 +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/legacylist/legacylistutils
11
- */
12
- import type { Element, Model, Position } from 'ckeditor5/src/engine.js';
13
- import { Plugin } from 'ckeditor5/src/core.js';
14
- /**
15
- * A set of helpers related to legacy lists.
16
- */
17
- export default class LegacyListUtils extends Plugin {
18
- /**
19
- * @inheritDoc
20
- */
21
- static get pluginName(): "LegacyListUtils";
22
- /**
23
- * Checks whether the given list-style-type is supported by numbered or bulleted list.
24
- */
25
- getListTypeFromListStyleType(listStyleType: string): 'bulleted' | 'numbered' | null;
26
- /**
27
- * Returns an array with all `listItem` elements in the model selection.
28
- *
29
- * It returns all the items even if only a part of the list is selected, including items that belong to nested lists.
30
- * If no list is selected, it returns an empty array.
31
- * The order of the elements is not specified.
32
- */
33
- getSelectedListItems(model: Model): Array<Element>;
34
- /**
35
- * Returns an array with all `listItem` elements that represent the same list.
36
- *
37
- * It means that values of `listIndent`, `listType`, `listStyle`, `listReversed` and `listStart` for all items are equal.
38
- *
39
- * Additionally, if the `position` is inside a list item, that list item will be returned as well.
40
- *
41
- * @param position Starting position.
42
- * @param direction Walking direction.
43
- */
44
- getSiblingNodes(position: Position, direction: 'forward' | 'backward'): Array<Element>;
45
- }
@@ -1,105 +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/legacylist/legacyutils
11
- */
12
- import { type DowncastConversionApi, type DowncastWriter, type Element, type Item, type Model, type Position, type ViewContainerElement, type ViewElement, type ViewItem, type ViewPosition } from 'ckeditor5/src/engine.js';
13
- /**
14
- * Creates a list item {@link module:engine/view/containerelement~ContainerElement}.
15
- *
16
- * @param writer The writer instance.
17
- */
18
- export declare function createViewListItemElement(writer: DowncastWriter): ViewContainerElement;
19
- /**
20
- * Helper function that creates a `<ul><li></li></ul>` or (`<ol>`) structure out of the given `modelItem` model `listItem` element.
21
- * Then, it binds the created view list item (`<li>`) with the model `listItem` element.
22
- * The function then returns the created view list item (`<li>`).
23
- *
24
- * @param modelItem Model list item.
25
- * @param conversionApi Conversion interface.
26
- * @returns View list element.
27
- */
28
- export declare function generateLiInUl(modelItem: Item, conversionApi: DowncastConversionApi): ViewContainerElement;
29
- /**
30
- * Helper function that inserts a view list at a correct place and merges it with its siblings.
31
- * It takes a model list item element (`modelItem`) and a corresponding view list item element (`injectedItem`). The view list item
32
- * should be in a view list element (`<ul>` or `<ol>`) and should be its only child.
33
- * See comments below to better understand the algorithm.
34
- *
35
- * @param modelItem Model list item.
36
- * @param injectedItem
37
- * @param conversionApi Conversion interface.
38
- * @param model The model instance.
39
- */
40
- export declare function injectViewList(modelItem: Element, injectedItem: ViewContainerElement, conversionApi: DowncastConversionApi, model: Model): void;
41
- /**
42
- * Helper function that takes two parameters that are expected to be view list elements, and merges them.
43
- * The merge happens only if both parameters are list elements of the same type (the same element name and the same class attributes).
44
- *
45
- * @param viewWriter The writer instance.
46
- * @param firstList The first element to compare.
47
- * @param secondList The second element to compare.
48
- * @returns The position after merge or `null` when there was no merge.
49
- */
50
- export declare function mergeViewLists(viewWriter: DowncastWriter, firstList: ViewItem, secondList: ViewItem): ViewPosition | null;
51
- /**
52
- * Helper function that for a given `view.Position`, returns a `view.Position` that is after all `view.UIElement`s that
53
- * are after the given position.
54
- *
55
- * For example:
56
- * `<container:p>foo^<ui:span></ui:span><ui:span></ui:span>bar</container:p>`
57
- * For position ^, the position before "bar" will be returned.
58
- *
59
- */
60
- export declare function positionAfterUiElements(viewPosition: ViewPosition): ViewPosition;
61
- /**
62
- * Helper function that searches for a previous list item sibling of a given model item that meets the given criteria
63
- * passed by the options object.
64
- *
65
- * @param options Search criteria.
66
- * @param options.sameIndent Whether the sought sibling should have the same indentation.
67
- * @param options.smallerIndent Whether the sought sibling should have a smaller indentation.
68
- * @param options.listIndent The reference indentation.
69
- * @param options.direction Walking direction.
70
- */
71
- export declare function getSiblingListItem(modelItem: Item | null, options: {
72
- sameIndent?: boolean;
73
- smallerIndent?: boolean;
74
- listIndent?: number;
75
- direction?: 'forward' | 'backward';
76
- }): Element | null;
77
- /**
78
- * Returns a first list view element that is direct child of the given view element.
79
- */
80
- export declare function findNestedList(viewElement: ViewElement): ViewElement | null;
81
- /**
82
- * Returns an array with all `listItem` elements that represent the same list.
83
- *
84
- * It means that values of `listIndent`, `listType`, `listStyle`, `listReversed` and `listStart` for all items are equal.
85
- *
86
- * Additionally, if the `position` is inside a list item, that list item will be returned as well.
87
- *
88
- * @param position Starting position.
89
- * @param direction Walking direction.
90
- */
91
- export declare function getSiblingNodes(position: Position, direction: 'forward' | 'backward'): Array<Element>;
92
- /**
93
- * Returns an array with all `listItem` elements in the model selection.
94
- *
95
- * It returns all the items even if only a part of the list is selected, including items that belong to nested lists.
96
- * If no list is selected, it returns an empty array.
97
- * The order of the elements is not specified.
98
- *
99
- * @internal
100
- */
101
- export declare function getSelectedListItems(model: Model): Array<Element>;
102
- /**
103
- * Checks whether the given list-style-type is supported by numbered or bulleted list.
104
- */
105
- export declare function getListTypeFromListStyleType(listStyleType: string): 'bulleted' | 'numbered' | null;
@@ -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/legacylist
11
- */
12
- import LegacyListEditing from './legacylist/legacylistediting.js';
13
- import ListUI from './list/listui.js';
14
- import { Plugin } from 'ckeditor5/src/core.js';
15
- /**
16
- * The legacy list feature.
17
- *
18
- * This is a "glue" plugin that loads the {@link module:list/legacylist/legacylistediting~LegacyListEditing legacy list editing feature}
19
- * and {@link module:list/list/listui~ListUI list UI feature}.
20
- */
21
- export default class LegacyList extends Plugin {
22
- /**
23
- * @inheritDoc
24
- */
25
- static get requires(): readonly [typeof LegacyListEditing, typeof ListUI];
26
- /**
27
- * @inheritDoc
28
- */
29
- static get pluginName(): "LegacyList";
30
- }