@ckeditor/ckeditor5-list 39.0.1 → 40.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/LICENSE.md +1 -1
  3. package/README.md +4 -4
  4. package/build/list.js +1 -1
  5. package/build/list.js.map +1 -0
  6. package/build/translations/fi.js +1 -1
  7. package/build/translations/pt-br.js +1 -1
  8. package/ckeditor5-metadata.json +44 -0
  9. package/lang/translations/ar.po +1 -0
  10. package/lang/translations/ast.po +1 -0
  11. package/lang/translations/az.po +1 -0
  12. package/lang/translations/bg.po +1 -0
  13. package/lang/translations/bn.po +1 -0
  14. package/lang/translations/ca.po +1 -0
  15. package/lang/translations/cs.po +1 -0
  16. package/lang/translations/da.po +1 -0
  17. package/lang/translations/de-ch.po +1 -0
  18. package/lang/translations/de.po +1 -0
  19. package/lang/translations/el.po +1 -0
  20. package/lang/translations/en-au.po +1 -0
  21. package/lang/translations/en-gb.po +1 -0
  22. package/lang/translations/en.po +1 -0
  23. package/lang/translations/eo.po +1 -0
  24. package/lang/translations/es.po +1 -0
  25. package/lang/translations/et.po +1 -0
  26. package/lang/translations/eu.po +1 -0
  27. package/lang/translations/fa.po +1 -0
  28. package/lang/translations/fi.po +2 -1
  29. package/lang/translations/fr.po +1 -0
  30. package/lang/translations/gl.po +1 -0
  31. package/lang/translations/he.po +1 -0
  32. package/lang/translations/hi.po +1 -0
  33. package/lang/translations/hr.po +1 -0
  34. package/lang/translations/hu.po +1 -0
  35. package/lang/translations/id.po +1 -0
  36. package/lang/translations/it.po +1 -0
  37. package/lang/translations/ja.po +1 -0
  38. package/lang/translations/jv.po +1 -0
  39. package/lang/translations/km.po +1 -0
  40. package/lang/translations/kn.po +1 -0
  41. package/lang/translations/ko.po +1 -0
  42. package/lang/translations/ku.po +1 -0
  43. package/lang/translations/lt.po +1 -0
  44. package/lang/translations/lv.po +1 -0
  45. package/lang/translations/ms.po +1 -0
  46. package/lang/translations/nb.po +1 -0
  47. package/lang/translations/ne.po +1 -0
  48. package/lang/translations/nl.po +1 -0
  49. package/lang/translations/no.po +1 -0
  50. package/lang/translations/pl.po +1 -0
  51. package/lang/translations/pt-br.po +11 -10
  52. package/lang/translations/pt.po +1 -0
  53. package/lang/translations/ro.po +1 -0
  54. package/lang/translations/ru.po +1 -0
  55. package/lang/translations/si.po +1 -0
  56. package/lang/translations/sk.po +1 -0
  57. package/lang/translations/sq.po +1 -0
  58. package/lang/translations/sr-latn.po +1 -0
  59. package/lang/translations/sr.po +1 -0
  60. package/lang/translations/sv.po +1 -0
  61. package/lang/translations/th.po +1 -0
  62. package/lang/translations/tk.po +1 -0
  63. package/lang/translations/tr.po +1 -0
  64. package/lang/translations/tt.po +1 -0
  65. package/lang/translations/ug.po +1 -0
  66. package/lang/translations/uk.po +1 -0
  67. package/lang/translations/ur.po +1 -0
  68. package/lang/translations/uz.po +1 -0
  69. package/lang/translations/vi.po +1 -0
  70. package/lang/translations/zh-cn.po +1 -0
  71. package/lang/translations/zh.po +1 -0
  72. package/package.json +3 -7
  73. package/src/augmentation.d.ts +52 -50
  74. package/src/augmentation.js +5 -5
  75. package/src/documentlist/adjacentlistssupport.d.ts +15 -15
  76. package/src/documentlist/adjacentlistssupport.js +81 -81
  77. package/src/documentlist/converters.d.ts +65 -63
  78. package/src/documentlist/converters.js +441 -354
  79. package/src/documentlist/documentlistcommand.d.ts +80 -80
  80. package/src/documentlist/documentlistcommand.js +150 -145
  81. package/src/documentlist/documentlistediting.d.ts +212 -154
  82. package/src/documentlist/documentlistediting.js +645 -565
  83. package/src/documentlist/documentlistindentcommand.d.ts +62 -62
  84. package/src/documentlist/documentlistindentcommand.js +129 -129
  85. package/src/documentlist/documentlistmergecommand.d.ts +76 -76
  86. package/src/documentlist/documentlistmergecommand.js +174 -174
  87. package/src/documentlist/documentlistsplitcommand.d.ts +67 -67
  88. package/src/documentlist/documentlistsplitcommand.js +70 -70
  89. package/src/documentlist/documentlistutils.d.ts +46 -46
  90. package/src/documentlist/documentlistutils.js +50 -50
  91. package/src/documentlist/utils/listwalker.d.ts +145 -141
  92. package/src/documentlist/utils/listwalker.js +182 -162
  93. package/src/documentlist/utils/model.d.ts +202 -193
  94. package/src/documentlist/utils/model.js +455 -435
  95. package/src/documentlist/utils/postfixers.d.ts +37 -37
  96. package/src/documentlist/utils/postfixers.js +126 -118
  97. package/src/documentlist/utils/view.d.ts +81 -81
  98. package/src/documentlist/utils/view.js +117 -117
  99. package/src/documentlist.d.ts +26 -26
  100. package/src/documentlist.js +30 -30
  101. package/src/documentlistproperties/converters.d.ts +19 -19
  102. package/src/documentlistproperties/converters.js +43 -43
  103. package/src/documentlistproperties/documentlistpropertiesediting.d.ts +88 -88
  104. package/src/documentlistproperties/documentlistpropertiesediting.js +266 -289
  105. package/src/documentlistproperties/documentlistpropertiesutils.d.ts +33 -33
  106. package/src/documentlistproperties/documentlistpropertiesutils.js +44 -44
  107. package/src/documentlistproperties/documentlistreversedcommand.d.ts +36 -36
  108. package/src/documentlistproperties/documentlistreversedcommand.js +55 -55
  109. package/src/documentlistproperties/documentliststartcommand.d.ts +38 -38
  110. package/src/documentlistproperties/documentliststartcommand.js +57 -57
  111. package/src/documentlistproperties/documentliststylecommand.d.ts +72 -72
  112. package/src/documentlistproperties/documentliststylecommand.js +113 -113
  113. package/src/documentlistproperties/utils/style.d.ts +20 -20
  114. package/src/documentlistproperties/utils/style.js +54 -54
  115. package/src/documentlistproperties.d.ts +27 -27
  116. package/src/documentlistproperties.js +31 -31
  117. package/src/index.d.ts +43 -40
  118. package/src/index.js +29 -27
  119. package/src/list/converters.d.ts +196 -196
  120. package/src/list/converters.js +905 -905
  121. package/src/list/indentcommand.d.ts +37 -37
  122. package/src/list/indentcommand.js +107 -107
  123. package/src/list/listcommand.d.ts +55 -55
  124. package/src/list/listcommand.js +274 -274
  125. package/src/list/listediting.d.ts +32 -32
  126. package/src/list/listediting.js +161 -161
  127. package/src/list/listui.d.ts +19 -19
  128. package/src/list/listui.js +32 -32
  129. package/src/list/listutils.d.ts +41 -41
  130. package/src/list/listutils.js +46 -46
  131. package/src/list/utils.d.ts +112 -112
  132. package/src/list/utils.js +374 -374
  133. package/src/list.d.ts +26 -26
  134. package/src/list.js +30 -30
  135. package/src/listconfig.d.ts +132 -122
  136. package/src/listconfig.js +5 -5
  137. package/src/listproperties/listpropertiesediting.d.ts +72 -72
  138. package/src/listproperties/listpropertiesediting.js +696 -696
  139. package/src/listproperties/listpropertiesui.d.ts +23 -23
  140. package/src/listproperties/listpropertiesui.js +277 -277
  141. package/src/listproperties/listreversedcommand.d.ts +38 -38
  142. package/src/listproperties/listreversedcommand.js +52 -52
  143. package/src/listproperties/liststartcommand.d.ts +37 -37
  144. package/src/listproperties/liststartcommand.js +51 -51
  145. package/src/listproperties/liststylecommand.d.ts +67 -67
  146. package/src/listproperties/liststylecommand.js +99 -99
  147. package/src/listproperties/ui/collapsibleview.d.ts +63 -63
  148. package/src/listproperties/ui/collapsibleview.js +89 -89
  149. package/src/listproperties/ui/listpropertiesview.d.ts +157 -157
  150. package/src/listproperties/ui/listpropertiesview.js +299 -299
  151. package/src/listproperties.d.ts +26 -26
  152. package/src/listproperties.js +30 -30
  153. package/src/liststyle.d.ts +28 -28
  154. package/src/liststyle.js +36 -36
  155. package/src/tododocumentlist/checktododocumentlistcommand.d.ts +49 -0
  156. package/src/tododocumentlist/checktododocumentlistcommand.js +82 -0
  157. package/src/tododocumentlist/todocheckboxchangeobserver.d.ts +41 -0
  158. package/src/tododocumentlist/todocheckboxchangeobserver.js +37 -0
  159. package/src/tododocumentlist/tododocumentlistediting.d.ts +38 -0
  160. package/src/tododocumentlist/tododocumentlistediting.js +399 -0
  161. package/src/tododocumentlist.d.ts +27 -0
  162. package/src/tododocumentlist.js +31 -0
  163. package/src/todolist/checktodolistcommand.d.ts +52 -52
  164. package/src/todolist/checktodolistcommand.js +76 -76
  165. package/src/todolist/todolistconverters.d.ts +82 -82
  166. package/src/todolist/todolistconverters.js +260 -260
  167. package/src/todolist/todolistediting.d.ts +39 -39
  168. package/src/todolist/todolistediting.js +161 -161
  169. package/src/todolist/todolistui.d.ts +19 -19
  170. package/src/todolist/todolistui.js +29 -29
  171. package/src/todolist.d.ts +27 -27
  172. package/src/todolist.js +31 -31
  173. package/theme/todolist.css +101 -70
@@ -1,38 +1,38 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, 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
- * @module list/listproperties/listreversedcommand
7
- */
8
- import { Command } from 'ckeditor5/src/core';
9
- /**
10
- * The reversed list command. It changes the `listReversed` attribute of the selected list items. As a result, the list order will be
11
- * reversed.
12
- * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.
13
- */
14
- export default class ListReversedCommand extends Command {
15
- /**
16
- * @inheritDoc
17
- */
18
- value: boolean | null;
19
- /**
20
- * @inheritDoc
21
- */
22
- refresh(): void;
23
- /**
24
- * Executes the command.
25
- *
26
- * @fires execute
27
- * @param options.reversed Whether the list should be reversed.
28
- */
29
- execute(options?: {
30
- reversed?: boolean;
31
- }): void;
32
- /**
33
- * Checks the command's {@link #value}.
34
- *
35
- * @returns The current value.
36
- */
37
- private _getValue;
38
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, 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
+ * @module list/listproperties/listreversedcommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core';
9
+ /**
10
+ * The reversed list command. It changes the `listReversed` attribute of the selected list items. As a result, the list order will be
11
+ * reversed.
12
+ * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.
13
+ */
14
+ export default class ListReversedCommand extends Command {
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ value: boolean | null;
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ refresh(): void;
23
+ /**
24
+ * Executes the command.
25
+ *
26
+ * @fires execute
27
+ * @param options.reversed Whether the list should be reversed.
28
+ */
29
+ execute(options?: {
30
+ reversed?: boolean;
31
+ }): void;
32
+ /**
33
+ * Checks the command's {@link #value}.
34
+ *
35
+ * @returns The current value.
36
+ */
37
+ private _getValue;
38
+ }
@@ -1,52 +1,52 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, 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
- * @module list/listproperties/listreversedcommand
7
- */
8
- import { Command } from 'ckeditor5/src/core';
9
- import { getSelectedListItems } from '../list/utils';
10
- /**
11
- * The reversed list command. It changes the `listReversed` attribute of the selected list items. As a result, the list order will be
12
- * reversed.
13
- * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.
14
- */
15
- export default class ListReversedCommand extends Command {
16
- /**
17
- * @inheritDoc
18
- */
19
- refresh() {
20
- const value = this._getValue();
21
- this.value = value;
22
- this.isEnabled = value != null;
23
- }
24
- /**
25
- * Executes the command.
26
- *
27
- * @fires execute
28
- * @param options.reversed Whether the list should be reversed.
29
- */
30
- execute(options = {}) {
31
- const model = this.editor.model;
32
- const listItems = getSelectedListItems(model)
33
- .filter(item => item.getAttribute('listType') == 'numbered');
34
- model.change(writer => {
35
- for (const item of listItems) {
36
- writer.setAttribute('listReversed', !!options.reversed, item);
37
- }
38
- });
39
- }
40
- /**
41
- * Checks the command's {@link #value}.
42
- *
43
- * @returns The current value.
44
- */
45
- _getValue() {
46
- const listItem = this.editor.model.document.selection.getFirstPosition().parent;
47
- if (listItem && listItem.is('element', 'listItem') && listItem.getAttribute('listType') == 'numbered') {
48
- return listItem.getAttribute('listReversed');
49
- }
50
- return null;
51
- }
52
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, 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
+ * @module list/listproperties/listreversedcommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core';
9
+ import { getSelectedListItems } from '../list/utils';
10
+ /**
11
+ * The reversed list command. It changes the `listReversed` attribute of the selected list items. As a result, the list order will be
12
+ * reversed.
13
+ * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.
14
+ */
15
+ export default class ListReversedCommand extends Command {
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ refresh() {
20
+ const value = this._getValue();
21
+ this.value = value;
22
+ this.isEnabled = value != null;
23
+ }
24
+ /**
25
+ * Executes the command.
26
+ *
27
+ * @fires execute
28
+ * @param options.reversed Whether the list should be reversed.
29
+ */
30
+ execute(options = {}) {
31
+ const model = this.editor.model;
32
+ const listItems = getSelectedListItems(model)
33
+ .filter(item => item.getAttribute('listType') == 'numbered');
34
+ model.change(writer => {
35
+ for (const item of listItems) {
36
+ writer.setAttribute('listReversed', !!options.reversed, item);
37
+ }
38
+ });
39
+ }
40
+ /**
41
+ * Checks the command's {@link #value}.
42
+ *
43
+ * @returns The current value.
44
+ */
45
+ _getValue() {
46
+ const listItem = this.editor.model.document.selection.getFirstPosition().parent;
47
+ if (listItem && listItem.is('element', 'listItem') && listItem.getAttribute('listType') == 'numbered') {
48
+ return listItem.getAttribute('listReversed');
49
+ }
50
+ return null;
51
+ }
52
+ }
@@ -1,37 +1,37 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, 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
- * @module list/listproperties/liststartcommand
7
- */
8
- import { Command } from 'ckeditor5/src/core';
9
- /**
10
- * The list start index command. It changes the `listStart` attribute of the selected list items.
11
- * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.
12
- */
13
- export default class ListStartCommand extends Command {
14
- /**
15
- * @inheritDoc
16
- */
17
- value: number | null;
18
- /**
19
- * @inheritDoc
20
- */
21
- refresh(): void;
22
- /**
23
- * Executes the command.
24
- *
25
- * @fires execute
26
- * @param options.startIndex The list start index.
27
- */
28
- execute({ startIndex }?: {
29
- startIndex?: number;
30
- }): void;
31
- /**
32
- * Checks the command's {@link #value}.
33
- *
34
- * @returns The current value.
35
- */
36
- private _getValue;
37
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, 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
+ * @module list/listproperties/liststartcommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core';
9
+ /**
10
+ * The list start index command. It changes the `listStart` attribute of the selected list items.
11
+ * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.
12
+ */
13
+ export default class ListStartCommand extends Command {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ value: number | null;
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ refresh(): void;
22
+ /**
23
+ * Executes the command.
24
+ *
25
+ * @fires execute
26
+ * @param options.startIndex The list start index.
27
+ */
28
+ execute({ startIndex }?: {
29
+ startIndex?: number;
30
+ }): void;
31
+ /**
32
+ * Checks the command's {@link #value}.
33
+ *
34
+ * @returns The current value.
35
+ */
36
+ private _getValue;
37
+ }
@@ -1,51 +1,51 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, 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
- * @module list/listproperties/liststartcommand
7
- */
8
- import { Command } from 'ckeditor5/src/core';
9
- import { getSelectedListItems } from '../list/utils';
10
- /**
11
- * The list start index command. It changes the `listStart` attribute of the selected list items.
12
- * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.
13
- */
14
- export default class ListStartCommand extends Command {
15
- /**
16
- * @inheritDoc
17
- */
18
- refresh() {
19
- const value = this._getValue();
20
- this.value = value;
21
- this.isEnabled = value != null;
22
- }
23
- /**
24
- * Executes the command.
25
- *
26
- * @fires execute
27
- * @param options.startIndex The list start index.
28
- */
29
- execute({ startIndex = 1 } = {}) {
30
- const model = this.editor.model;
31
- const listItems = getSelectedListItems(model)
32
- .filter(item => item.getAttribute('listType') == 'numbered');
33
- model.change(writer => {
34
- for (const item of listItems) {
35
- writer.setAttribute('listStart', startIndex >= 0 ? startIndex : 1, item);
36
- }
37
- });
38
- }
39
- /**
40
- * Checks the command's {@link #value}.
41
- *
42
- * @returns The current value.
43
- */
44
- _getValue() {
45
- const listItem = this.editor.model.document.selection.getFirstPosition().parent;
46
- if (listItem && listItem.is('element', 'listItem') && listItem.getAttribute('listType') == 'numbered') {
47
- return listItem.getAttribute('listStart');
48
- }
49
- return null;
50
- }
51
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, 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
+ * @module list/listproperties/liststartcommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core';
9
+ import { getSelectedListItems } from '../list/utils';
10
+ /**
11
+ * The list start index command. It changes the `listStart` attribute of the selected list items.
12
+ * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.
13
+ */
14
+ export default class ListStartCommand extends Command {
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ refresh() {
19
+ const value = this._getValue();
20
+ this.value = value;
21
+ this.isEnabled = value != null;
22
+ }
23
+ /**
24
+ * Executes the command.
25
+ *
26
+ * @fires execute
27
+ * @param options.startIndex The list start index.
28
+ */
29
+ execute({ startIndex = 1 } = {}) {
30
+ const model = this.editor.model;
31
+ const listItems = getSelectedListItems(model)
32
+ .filter(item => item.getAttribute('listType') == 'numbered');
33
+ model.change(writer => {
34
+ for (const item of listItems) {
35
+ writer.setAttribute('listStart', startIndex >= 0 ? startIndex : 1, item);
36
+ }
37
+ });
38
+ }
39
+ /**
40
+ * Checks the command's {@link #value}.
41
+ *
42
+ * @returns The current value.
43
+ */
44
+ _getValue() {
45
+ const listItem = this.editor.model.document.selection.getFirstPosition().parent;
46
+ if (listItem && listItem.is('element', 'listItem') && listItem.getAttribute('listType') == 'numbered') {
47
+ return listItem.getAttribute('listStart');
48
+ }
49
+ return null;
50
+ }
51
+ }
@@ -1,67 +1,67 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, 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
- * @module list/listproperties/liststylecommand
7
- */
8
- import { Command, type Editor } from 'ckeditor5/src/core';
9
- /**
10
- * The list style command. It changes the `listStyle` attribute of the selected list items.
11
- *
12
- * If the list type (numbered or bulleted) can be inferred from the passed style type,
13
- * the command tries to convert selected items to a list of that type.
14
- * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.
15
- */
16
- export default class ListStyleCommand extends Command {
17
- isStyleTypeSupported: undefined;
18
- /**
19
- * @inheritDoc
20
- * @readonly
21
- */
22
- value: string | null;
23
- /**
24
- * The default type of the list style.
25
- */
26
- readonly defaultType: string;
27
- /**
28
- * Creates an instance of the command.
29
- *
30
- * @param editor The editor instance.
31
- * @param defaultType The list type that will be used by default if the value was not specified during
32
- * the command execution.
33
- */
34
- constructor(editor: Editor, defaultType: string);
35
- /**
36
- * @inheritDoc
37
- */
38
- refresh(): void;
39
- /**
40
- * Executes the command.
41
- *
42
- * @fires execute
43
- * @param options.type The type of the list style, e.g. `'disc'` or `'square'`. If `null` is specified, the default
44
- * style will be applied.
45
- */
46
- execute(options?: {
47
- type?: string | null;
48
- }): void;
49
- /**
50
- * Checks the command's {@link #value}.
51
- *
52
- * @returns The current value.
53
- */
54
- private _getValue;
55
- /**
56
- * Checks whether the command can be enabled in the current context.
57
- *
58
- * @returns Whether the command should be enabled.
59
- */
60
- private _checkEnabled;
61
- /**
62
- * Checks if the provided list style is valid. Also changes the selection to a list if it's not set yet.
63
- *
64
- * @param The type of the list style. If `null` is specified, the function does nothing.
65
- */
66
- private _tryToConvertItemsToList;
67
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, 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
+ * @module list/listproperties/liststylecommand
7
+ */
8
+ import { Command, type Editor } from 'ckeditor5/src/core';
9
+ /**
10
+ * The list style command. It changes the `listStyle` attribute of the selected list items.
11
+ *
12
+ * If the list type (numbered or bulleted) can be inferred from the passed style type,
13
+ * the command tries to convert selected items to a list of that type.
14
+ * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.
15
+ */
16
+ export default class ListStyleCommand extends Command {
17
+ isStyleTypeSupported: undefined;
18
+ /**
19
+ * @inheritDoc
20
+ * @readonly
21
+ */
22
+ value: string | null;
23
+ /**
24
+ * The default type of the list style.
25
+ */
26
+ readonly defaultType: string;
27
+ /**
28
+ * Creates an instance of the command.
29
+ *
30
+ * @param editor The editor instance.
31
+ * @param defaultType The list type that will be used by default if the value was not specified during
32
+ * the command execution.
33
+ */
34
+ constructor(editor: Editor, defaultType: string);
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ refresh(): void;
39
+ /**
40
+ * Executes the command.
41
+ *
42
+ * @fires execute
43
+ * @param options.type The type of the list style, e.g. `'disc'` or `'square'`. If `null` is specified, the default
44
+ * style will be applied.
45
+ */
46
+ execute(options?: {
47
+ type?: string | null;
48
+ }): void;
49
+ /**
50
+ * Checks the command's {@link #value}.
51
+ *
52
+ * @returns The current value.
53
+ */
54
+ private _getValue;
55
+ /**
56
+ * Checks whether the command can be enabled in the current context.
57
+ *
58
+ * @returns Whether the command should be enabled.
59
+ */
60
+ private _checkEnabled;
61
+ /**
62
+ * Checks if the provided list style is valid. Also changes the selection to a list if it's not set yet.
63
+ *
64
+ * @param The type of the list style. If `null` is specified, the function does nothing.
65
+ */
66
+ private _tryToConvertItemsToList;
67
+ }