@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,76 +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/legacylistproperties/legacylistpropertiesediting
11
- */
12
- import { Plugin, type Editor } from 'ckeditor5/src/core.js';
13
- import LegacyListEditing from '../legacylist/legacylistediting.js';
14
- /**
15
- * The engine of the list properties feature.
16
- *
17
- * It sets the value for the `listItem` attribute of the {@link module:list/legacylist~LegacyList `<listItem>`} element that
18
- * allows modifying the list style type.
19
- *
20
- * It registers the `'listStyle'`, `'listReversed'` and `'listStart'` commands if they are enabled in the configuration.
21
- * Read more in {@link module:list/listconfig~ListPropertiesConfig}.
22
- */
23
- export default class LegacyListPropertiesEditing extends Plugin {
24
- /**
25
- * @inheritDoc
26
- */
27
- static get requires(): readonly [typeof LegacyListEditing];
28
- /**
29
- * @inheritDoc
30
- */
31
- static get pluginName(): "LegacyListPropertiesEditing";
32
- /**
33
- * @inheritDoc
34
- */
35
- constructor(editor: Editor);
36
- /**
37
- * @inheritDoc
38
- */
39
- init(): void;
40
- /**
41
- * @inheritDoc
42
- */
43
- afterInit(): void;
44
- /**
45
- * Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether two lists will be merged into a single
46
- * one after deleting the content.
47
- *
48
- * The purpose of this action is to adjust the `listStyle`, `listReversed` and `listStart` values
49
- * for the list that was merged.
50
- *
51
- * Consider the following model's content:
52
- *
53
- * ```xml
54
- * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 1</listItem>
55
- * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 2</listItem>
56
- * <paragraph>[A paragraph.]</paragraph>
57
- * <listItem listIndent="0" listType="bulleted" listStyle="circle">UL List item 1</listItem>
58
- * <listItem listIndent="0" listType="bulleted" listStyle="circle">UL List item 2</listItem>
59
- * ```
60
- *
61
- * After removing the paragraph element, the second list will be merged into the first one.
62
- * We want to inherit the `listStyle` attribute for the second list from the first one.
63
- *
64
- * ```xml
65
- * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 1</listItem>
66
- * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 2</listItem>
67
- * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 1</listItem>
68
- * <listItem listIndent="0" listType="bulleted" listStyle="square">UL List item 2</listItem>
69
- * ```
70
- *
71
- * See https://github.com/ckeditor/ckeditor5/issues/7879.
72
- *
73
- * @param attributeStrategies Strategies for the enabled attributes.
74
- */
75
- private _mergeListAttributesWhileMergingLists;
76
- }
@@ -1,42 +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/legacylistproperties/legacylistreversedcommand
11
- */
12
- import { Command } from 'ckeditor5/src/core.js';
13
- /**
14
- * The reversed list command. It changes the `listReversed` attribute of the selected list items. As a result, the list order will be
15
- * reversed.
16
- * It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
17
- */
18
- export default class LegacyListReversedCommand extends Command {
19
- /**
20
- * @inheritDoc
21
- */
22
- value: boolean | null;
23
- /**
24
- * @inheritDoc
25
- */
26
- refresh(): void;
27
- /**
28
- * Executes the command.
29
- *
30
- * @fires execute
31
- * @param options.reversed Whether the list should be reversed.
32
- */
33
- execute(options?: {
34
- reversed?: boolean;
35
- }): void;
36
- /**
37
- * Checks the command's {@link #value}.
38
- *
39
- * @returns The current value.
40
- */
41
- private _getValue;
42
- }
@@ -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/legacylistproperties/legacyliststartcommand
11
- */
12
- import { Command } from 'ckeditor5/src/core.js';
13
- /**
14
- * The list start index command. It changes the `listStart` attribute of the selected list items.
15
- * It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
16
- */
17
- export default class LegacyListStartCommand extends Command {
18
- /**
19
- * @inheritDoc
20
- */
21
- value: number | null;
22
- /**
23
- * @inheritDoc
24
- */
25
- refresh(): void;
26
- /**
27
- * Executes the command.
28
- *
29
- * @fires execute
30
- * @param options.startIndex The list start index.
31
- */
32
- execute({ startIndex }?: {
33
- startIndex?: number;
34
- }): void;
35
- /**
36
- * Checks the command's {@link #value}.
37
- *
38
- * @returns The current value.
39
- */
40
- private _getValue;
41
- }
@@ -1,71 +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/legacylistproperties/legacyliststylecommand
11
- */
12
- import { Command, type Editor } from 'ckeditor5/src/core.js';
13
- /**
14
- * The list style command. It changes the `listStyle` attribute of the selected list items.
15
- *
16
- * If the list type (numbered or bulleted) can be inferred from the passed style type,
17
- * the command tries to convert selected items to a list of that type.
18
- * It is used by the {@link module:list/legacylistproperties~LegacyListProperties legacy list properties feature}.
19
- */
20
- export default class LegacyListStyleCommand extends Command {
21
- isStyleTypeSupported: undefined;
22
- /**
23
- * @inheritDoc
24
- * @readonly
25
- */
26
- value: string | null;
27
- /**
28
- * The default type of the list style.
29
- */
30
- readonly defaultType: string;
31
- /**
32
- * Creates an instance of the command.
33
- *
34
- * @param editor The editor instance.
35
- * @param defaultType The list type that will be used by default if the value was not specified during
36
- * the command execution.
37
- */
38
- constructor(editor: Editor, defaultType: string);
39
- /**
40
- * @inheritDoc
41
- */
42
- refresh(): void;
43
- /**
44
- * Executes the command.
45
- *
46
- * @fires execute
47
- * @param options.type The type of the list style, e.g. `'disc'` or `'square'`. If `null` is specified, the default
48
- * style will be applied.
49
- */
50
- execute(options?: {
51
- type?: string | null;
52
- }): void;
53
- /**
54
- * Checks the command's {@link #value}.
55
- *
56
- * @returns The current value.
57
- */
58
- private _getValue;
59
- /**
60
- * Checks whether the command can be enabled in the current context.
61
- *
62
- * @returns Whether the command should be enabled.
63
- */
64
- private _checkEnabled;
65
- /**
66
- * Checks if the provided list style is valid. Also changes the selection to a list if it's not set yet.
67
- *
68
- * @param The type of the list style. If `null` is specified, the function does nothing.
69
- */
70
- private _tryToConvertItemsToList;
71
- }
@@ -1,31 +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/legacylistproperties
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- import LegacyListPropertiesEditing from './legacylistproperties/legacylistpropertiesediting.js';
14
- import ListPropertiesUI from './listproperties/listpropertiesui.js';
15
- /**
16
- * The legacy list properties feature.
17
- *
18
- * This is a "glue" plugin that loads the {@link module:list/legacylistproperties/legacylistpropertiesediting~LegacyListPropertiesEditing
19
- * legacy list properties editing feature} and the
20
- * {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
21
- */
22
- export default class LegacyListProperties extends Plugin {
23
- /**
24
- * @inheritDoc
25
- */
26
- static get requires(): readonly [typeof LegacyListPropertiesEditing, typeof ListPropertiesUI];
27
- /**
28
- * @inheritDoc
29
- */
30
- static get pluginName(): "LegacyListProperties";
31
- }
@@ -1,56 +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/legacytodolist/legacychecktodolistcommand
11
- */
12
- import { Command, type Editor } from 'ckeditor5/src/core.js';
13
- import type { Element } from 'ckeditor5/src/engine.js';
14
- /**
15
- * The check to-do command.
16
- *
17
- * The command is registered by the {@link module:list/legacytodolist/legacytodolistediting~LegacyTodoListEditing} as
18
- * the `checkTodoList` editor command and it is also available via aliased `todoListCheck` name.
19
- */
20
- export default class LegacyCheckTodoListCommand extends Command {
21
- /**
22
- * A list of to-do list items selected by the {@link module:engine/model/selection~Selection}.
23
- *
24
- * @observable
25
- * @readonly
26
- */
27
- value: boolean;
28
- /**
29
- * A list of to-do list items selected by the {@link module:engine/model/selection~Selection}.
30
- *
31
- * @internal
32
- */
33
- _selectedElements: Array<Element>;
34
- /**
35
- * @inheritDoc
36
- */
37
- constructor(editor: Editor);
38
- /**
39
- * Updates the command's {@link #value} and {@link #isEnabled} properties based on the current selection.
40
- */
41
- refresh(): void;
42
- /**
43
- * Gets all to-do list items selected by the {@link module:engine/model/selection~Selection}.
44
- */
45
- private _getSelectedItems;
46
- /**
47
- * Executes the command.
48
- *
49
- * @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply
50
- * the attribute. Otherwise, the command will remove the attribute. If not set, the command will look for its current
51
- * value to decide what it should do.
52
- */
53
- execute(options?: {
54
- forceValue?: boolean;
55
- }): void;
56
- }
@@ -1,87 +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/legacytodolist/legacytodolistconverters
11
- */
12
- import type { DowncastAttributeEvent, DowncastInsertEvent, Element, MapperModelToViewPositionEvent, Model, UpcastElementEvent, EditingView } 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 converts the `listItem` model element to an unordered list with a {@link module:engine/view/uielement~UIElement checkbox element}
18
- * at the beginning of each list item. It also merges the list with surrounding lists (if available).
19
- *
20
- * It is used by {@link module:engine/controller/editingcontroller~EditingController}.
21
- *
22
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
23
- * @param model Model instance.
24
- * @param onCheckboxChecked Callback function.
25
- * @returns Returns a conversion callback.
26
- */
27
- export declare function modelViewInsertion(model: Model, onCheckboxChecked: (element: Element) => void): GetCallback<DowncastInsertEvent<Element>>;
28
- /**
29
- * A model-to-view converter for the `listItem` model element insertion.
30
- *
31
- * It is used by {@link module:engine/controller/datacontroller~DataController}.
32
- *
33
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
34
- * @param model Model instance.
35
- * @returns Returns a conversion callback.
36
- */
37
- export declare function dataModelViewInsertion(model: Model): GetCallback<DowncastInsertEvent<Element>>;
38
- /**
39
- * A view-to-model converter for the checkbox element inside a view list item.
40
- *
41
- * It changes the `listType` of the model `listItem` to a `todo` value.
42
- * When a view checkbox element is marked as checked, an additional `todoListChecked="true"` attribute is added to the model item.
43
- *
44
- * It is used by {@link module:engine/controller/datacontroller~DataController}.
45
- *
46
- * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
47
- */
48
- export declare const dataViewModelCheckmarkInsertion: GetCallback<UpcastElementEvent>;
49
- /**
50
- * A model-to-view converter for the `listType` attribute change on the `listItem` model element.
51
- *
52
- * This change means that the `<li>` element parent changes to `<ul class="todo-list">` and a
53
- * {@link module:engine/view/uielement~UIElement checkbox UI element} is added at the beginning
54
- * of the list item element (or vice versa).
55
- *
56
- * This converter is preceded by {@link module:list/legacylist/legacyconverters~modelViewChangeType} and followed by
57
- * {@link module:list/legacylist/legacyconverters~modelViewMergeAfterChangeType} to handle splitting and merging surrounding lists
58
- * of the same type.
59
- *
60
- * It is used by {@link module:engine/controller/editingcontroller~EditingController}.
61
- *
62
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
63
- * @param onCheckedChange Callback fired after clicking the checkbox UI element.
64
- * @param view Editing view controller.
65
- * @returns Returns a conversion callback.
66
- */
67
- export declare function modelViewChangeType(onCheckedChange: (element: Element) => void, view: EditingView): GetCallback<DowncastAttributeEvent<Element>>;
68
- /**
69
- * A model-to-view converter for the `todoListChecked` attribute change on the `listItem` model element.
70
- *
71
- * It marks the {@link module:engine/view/uielement~UIElement checkbox UI element} as checked.
72
- *
73
- * It is used by {@link module:engine/controller/editingcontroller~EditingController}.
74
- *
75
- * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
76
- * @param onCheckedChange Callback fired after clicking the checkbox UI element.
77
- * @returns Returns a conversion callback.
78
- */
79
- export declare function modelViewChangeChecked(onCheckedChange: (element: Element) => void): GetCallback<DowncastAttributeEvent<Element>>;
80
- /**
81
- * A model-to-view position at zero offset mapper.
82
- *
83
- * This helper ensures that position inside todo-list in the view is mapped after the checkbox.
84
- *
85
- * It only handles the position at the beginning of a list item as other positions are properly mapped be the default mapper.
86
- */
87
- export declare function mapModelToViewPosition(view: EditingView): GetCallback<MapperModelToViewPositionEvent>;
@@ -1,43 +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 { Plugin } from 'ckeditor5/src/core.js';
10
- import LegacyListEditing from '../legacylist/legacylistediting.js';
11
- /**
12
- * The engine of the to-do list feature. It handles creating, editing and removing to-do lists and their items.
13
- *
14
- * It registers the entire functionality of the {@link module:list/legacylist/legacylistediting~LegacyListEditing legacy list editing
15
- * plugin} and extends it with the commands:
16
- *
17
- * - `'todoList'`,
18
- * - `'checkTodoList'`,
19
- * - `'todoListCheck'` as an alias for `checkTodoList` command.
20
- */
21
- export default class LegacyTodoListEditing extends Plugin {
22
- /**
23
- * @inheritDoc
24
- */
25
- static get pluginName(): "LegacyTodoListEditing";
26
- /**
27
- * @inheritDoc
28
- */
29
- static get requires(): readonly [typeof LegacyListEditing];
30
- /**
31
- * @inheritDoc
32
- */
33
- init(): void;
34
- /**
35
- * Handles the checkbox element change, moves the selection to the corresponding model item to make it possible
36
- * to toggle the `todoListChecked` attribute using the command, and restores the selection position.
37
- *
38
- * Some say it's a hack :) Moving the selection only for executing the command on a certain node and restoring it after,
39
- * is not a clear solution. We need to design an API for using commands beyond the selection range.
40
- * See https://github.com/ckeditor/ckeditor5/issues/1954.
41
- */
42
- private _handleCheckmarkChange;
43
- }
@@ -1,31 +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/legacytodolist
11
- */
12
- import LegacyTodoListEditing from './legacytodolist/legacytodolistediting.js';
13
- import TodoListUI from './todolist/todolistui.js';
14
- import { Plugin } from 'ckeditor5/src/core.js';
15
- import '../theme/todolist.css';
16
- /**
17
- * The legacy to-do list feature.
18
- *
19
- * This is a "glue" plugin that loads the {@link module:list/legacytodolist/legacytodolistediting~LegacyTodoListEditing legacy to-do list
20
- * editing feature} and the {@link module:list/todolist/todolistui~TodoListUI to-do list UI feature}.
21
- */
22
- export default class LegacyTodoList extends Plugin {
23
- /**
24
- * @inheritDoc
25
- */
26
- static get requires(): readonly [typeof LegacyTodoListEditing, typeof TodoListUI];
27
- /**
28
- * @inheritDoc
29
- */
30
- static get pluginName(): "LegacyTodoList";
31
- }
@@ -1,19 +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 { Plugin } from 'ckeditor5/src/core.js';
10
- export default class AdjacentListsSupport extends Plugin {
11
- /**
12
- * @inheritDoc
13
- */
14
- static get pluginName(): "AdjacentListsSupport";
15
- /**
16
- * @inheritDoc
17
- */
18
- init(): void;
19
- }
@@ -1,69 +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/converters
11
- */
12
- import { type DowncastAttributeEvent, type EditingController, type Element, type ElementCreatorFunction, type Mapper, type Model, type UpcastElementEvent, type ViewElement } from 'ckeditor5/src/engine.js';
13
- import type { GetCallback } from 'ckeditor5/src/utils.js';
14
- import { type ListElement } from './utils/model.js';
15
- import type { default as ListEditing, DowncastStrategy } from './listediting.js';
16
- /**
17
- * Returns the upcast converter for list items. It's supposed to work after the block converters (content inside list items) are converted.
18
- *
19
- * @internal
20
- */
21
- export declare function listItemUpcastConverter(): GetCallback<UpcastElementEvent>;
22
- /**
23
- * Returns the upcast converter for the `<ul>` and `<ol>` view elements that cleans the input view of garbage.
24
- * This is mostly to clean whitespaces from between the `<li>` view elements inside the view list element. However,
25
- * incorrect data can also be cleared if the view was incorrect.
26
- *
27
- * @internal
28
- */
29
- export declare function listUpcastCleanList(): GetCallback<UpcastElementEvent>;
30
- /**
31
- * Returns a model document change:data event listener that triggers conversion of related items if needed.
32
- *
33
- * @internal
34
- * @param model The editor model.
35
- * @param editing The editing controller.
36
- * @param attributeNames The list of all model list attributes (including registered strategies).
37
- * @param listEditing The document list editing plugin.
38
- */
39
- export declare function reconvertItemsOnDataChange(model: Model, editing: EditingController, attributeNames: Array<string>, listEditing: ListEditing): () => void;
40
- /**
41
- * Returns the list item downcast converter.
42
- *
43
- * @internal
44
- * @param attributeNames A list of attribute names that should be converted if they are set.
45
- * @param strategies The strategies.
46
- * @param model The model.
47
- */
48
- export declare function listItemDowncastConverter(attributeNames: Array<string>, strategies: Array<DowncastStrategy>, model: Model, { dataPipeline }?: {
49
- dataPipeline?: boolean;
50
- }): GetCallback<DowncastAttributeEvent<ListElement>>;
51
- /**
52
- * Returns the bogus paragraph view element creator. A bogus paragraph is used if a list item contains only a single block or nested list.
53
- *
54
- * @internal
55
- * @param attributeNames The list of all model list attributes (including registered strategies).
56
- */
57
- export declare function bogusParagraphCreator(attributeNames: Array<string>, { dataPipeline }?: {
58
- dataPipeline?: boolean;
59
- }): ElementCreatorFunction;
60
- /**
61
- * Helper for mapping mode to view elements. It's using positions mapping instead of mapper.toViewElement( element )
62
- * to find outermost view element. This is for cases when mapping is using inner view element like in the code blocks (pre > code).
63
- *
64
- * @internal
65
- * @param element The model element.
66
- * @param mapper The mapper instance.
67
- * @param model The model.
68
- */
69
- export declare function findMappedViewElement(element: Element, mapper: Mapper, model: Model): ViewElement | null;
@@ -1,84 +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/listcommand
11
- */
12
- import type { Element } from 'ckeditor5/src/engine.js';
13
- import { Command, type Editor } from 'ckeditor5/src/core.js';
14
- /**
15
- * The list command. It is used by the {@link module:list/list~List list feature}.
16
- */
17
- export default class ListCommand extends Command {
18
- /**
19
- * The type of the list created by the command.
20
- */
21
- readonly type: 'numbered' | 'bulleted' | 'todo';
22
- /**
23
- * A flag indicating whether the command is active, which means that the selection starts in a list of the same type.
24
- *
25
- * @observable
26
- * @readonly
27
- */
28
- value: boolean;
29
- /**
30
- * Creates an instance of the command.
31
- *
32
- * @param editor The editor instance.
33
- * @param type List type that will be handled by this command.
34
- */
35
- constructor(editor: Editor, type: 'numbered' | 'bulleted' | 'todo');
36
- /**
37
- * @inheritDoc
38
- */
39
- refresh(): void;
40
- /**
41
- * Executes the list command.
42
- *
43
- * @fires execute
44
- * @fires afterExecute
45
- * @param options Command options.
46
- * @param options.forceValue If set, it will force the command behavior. If `true`, the command will try to convert the
47
- * selected items and potentially the neighbor elements to the proper list items. If set to `false` it will convert selected elements
48
- * to paragraphs. If not set, the command will toggle selected elements to list items or paragraphs, depending on the selection.
49
- */
50
- execute(options?: {
51
- forceValue?: boolean;
52
- }): void;
53
- /**
54
- * Fires the `afterExecute` event.
55
- *
56
- * @param changedBlocks The changed list elements.
57
- */
58
- private _fireAfterExecute;
59
- /**
60
- * Checks the command's {@link #value}.
61
- *
62
- * @returns The current value.
63
- */
64
- private _getValue;
65
- /**
66
- * Checks whether the command can be enabled in the current context.
67
- *
68
- * @returns Whether the command should be enabled.
69
- */
70
- private _checkEnabled;
71
- }
72
- /**
73
- * Event fired by the {@link ~ListCommand#execute} method.
74
- *
75
- * It allows to execute an action after executing the {@link ~ListCommand#execute} method,
76
- * for example adjusting attributes of changed list items.
77
- *
78
- * @internal
79
- * @eventName ~ListCommand#afterExecute
80
- */
81
- export type ListCommandAfterExecuteEvent = {
82
- name: 'afterExecute';
83
- args: [changedBlocks: Array<Element>];
84
- };