@ckeditor/ckeditor5-list 31.1.0 → 32.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 (143) hide show
  1. package/LICENSE.md +2 -2
  2. package/build/list.js +3 -3
  3. package/build/translations/ar.js +1 -1
  4. package/build/translations/ast.js +1 -1
  5. package/build/translations/az.js +1 -1
  6. package/build/translations/bg.js +1 -1
  7. package/build/translations/cs.js +1 -1
  8. package/build/translations/da.js +1 -1
  9. package/build/translations/de-ch.js +1 -1
  10. package/build/translations/de.js +1 -1
  11. package/build/translations/el.js +1 -1
  12. package/build/translations/en-au.js +1 -1
  13. package/build/translations/en-gb.js +1 -1
  14. package/build/translations/eo.js +1 -1
  15. package/build/translations/es.js +1 -1
  16. package/build/translations/et.js +1 -1
  17. package/build/translations/eu.js +1 -1
  18. package/build/translations/fa.js +1 -1
  19. package/build/translations/fi.js +1 -1
  20. package/build/translations/fr.js +1 -1
  21. package/build/translations/gl.js +1 -1
  22. package/build/translations/he.js +1 -1
  23. package/build/translations/hi.js +1 -1
  24. package/build/translations/hr.js +1 -1
  25. package/build/translations/hu.js +1 -1
  26. package/build/translations/id.js +1 -1
  27. package/build/translations/it.js +1 -1
  28. package/build/translations/ja.js +1 -1
  29. package/build/translations/km.js +1 -1
  30. package/build/translations/kn.js +1 -1
  31. package/build/translations/ko.js +1 -1
  32. package/build/translations/ku.js +1 -1
  33. package/build/translations/lt.js +1 -1
  34. package/build/translations/lv.js +1 -1
  35. package/build/translations/nb.js +1 -1
  36. package/build/translations/ne.js +1 -1
  37. package/build/translations/nl.js +1 -1
  38. package/build/translations/no.js +1 -1
  39. package/build/translations/pl.js +1 -1
  40. package/build/translations/pt-br.js +1 -1
  41. package/build/translations/pt.js +1 -1
  42. package/build/translations/ro.js +1 -1
  43. package/build/translations/ru.js +1 -1
  44. package/build/translations/si.js +1 -1
  45. package/build/translations/sk.js +1 -1
  46. package/build/translations/sq.js +1 -1
  47. package/build/translations/sr-latn.js +1 -1
  48. package/build/translations/sr.js +1 -1
  49. package/build/translations/sv.js +1 -1
  50. package/build/translations/tk.js +1 -1
  51. package/build/translations/tr.js +1 -1
  52. package/build/translations/ug.js +1 -1
  53. package/build/translations/uk.js +1 -1
  54. package/build/translations/uz.js +1 -1
  55. package/build/translations/vi.js +1 -1
  56. package/build/translations/zh-cn.js +1 -1
  57. package/build/translations/zh.js +1 -1
  58. package/ckeditor5-metadata.json +8 -4
  59. package/lang/contexts.json +5 -1
  60. package/lang/translations/ar.po +17 -1
  61. package/lang/translations/ast.po +17 -1
  62. package/lang/translations/az.po +17 -1
  63. package/lang/translations/bg.po +17 -1
  64. package/lang/translations/cs.po +17 -1
  65. package/lang/translations/da.po +17 -1
  66. package/lang/translations/de-ch.po +17 -1
  67. package/lang/translations/de.po +17 -1
  68. package/lang/translations/el.po +17 -1
  69. package/lang/translations/en-au.po +17 -1
  70. package/lang/translations/en-gb.po +17 -1
  71. package/lang/translations/en.po +17 -1
  72. package/lang/translations/eo.po +17 -1
  73. package/lang/translations/es.po +17 -1
  74. package/lang/translations/et.po +17 -1
  75. package/lang/translations/eu.po +17 -1
  76. package/lang/translations/fa.po +17 -1
  77. package/lang/translations/fi.po +17 -1
  78. package/lang/translations/fr.po +17 -1
  79. package/lang/translations/gl.po +17 -1
  80. package/lang/translations/he.po +17 -1
  81. package/lang/translations/hi.po +17 -1
  82. package/lang/translations/hr.po +17 -1
  83. package/lang/translations/hu.po +17 -1
  84. package/lang/translations/id.po +17 -1
  85. package/lang/translations/it.po +17 -1
  86. package/lang/translations/ja.po +17 -1
  87. package/lang/translations/km.po +17 -1
  88. package/lang/translations/kn.po +17 -1
  89. package/lang/translations/ko.po +17 -1
  90. package/lang/translations/ku.po +17 -1
  91. package/lang/translations/lt.po +17 -1
  92. package/lang/translations/lv.po +17 -1
  93. package/lang/translations/nb.po +17 -1
  94. package/lang/translations/ne.po +17 -1
  95. package/lang/translations/nl.po +17 -1
  96. package/lang/translations/no.po +17 -1
  97. package/lang/translations/pl.po +17 -1
  98. package/lang/translations/pt-br.po +17 -1
  99. package/lang/translations/pt.po +17 -1
  100. package/lang/translations/ro.po +17 -1
  101. package/lang/translations/ru.po +17 -1
  102. package/lang/translations/si.po +17 -1
  103. package/lang/translations/sk.po +17 -1
  104. package/lang/translations/sq.po +17 -1
  105. package/lang/translations/sr-latn.po +17 -1
  106. package/lang/translations/sr.po +17 -1
  107. package/lang/translations/sv.po +17 -1
  108. package/lang/translations/tk.po +17 -1
  109. package/lang/translations/tr.po +17 -1
  110. package/lang/translations/ug.po +17 -1
  111. package/lang/translations/uk.po +17 -1
  112. package/lang/translations/uz.po +17 -1
  113. package/lang/translations/vi.po +17 -1
  114. package/lang/translations/zh-cn.po +17 -1
  115. package/lang/translations/zh.po +17 -1
  116. package/package.json +27 -27
  117. package/src/checktodolistcommand.js +1 -1
  118. package/src/converters.js +13 -1
  119. package/src/indentcommand.js +1 -1
  120. package/src/index.js +4 -4
  121. package/src/list.js +24 -1
  122. package/src/listcommand.js +2 -2
  123. package/src/listediting.js +1 -1
  124. package/src/listproperties.js +96 -0
  125. package/src/{liststyleediting.js → listpropertiesediting.js} +299 -122
  126. package/src/listpropertiesui.js +314 -0
  127. package/src/listreversedcommand.js +64 -0
  128. package/src/liststartcommand.js +63 -0
  129. package/src/liststyle.js +12 -6
  130. package/src/liststylecommand.js +5 -22
  131. package/src/listui.js +1 -1
  132. package/src/todolist.js +1 -1
  133. package/src/todolistconverters.js +1 -1
  134. package/src/todolistediting.js +1 -1
  135. package/src/todolistui.js +1 -1
  136. package/src/ui/collapsibleview.js +152 -0
  137. package/src/ui/listpropertiesview.js +405 -0
  138. package/src/utils.js +49 -4
  139. package/theme/collapsible.css +10 -0
  140. package/theme/listproperties.css +10 -0
  141. package/theme/liststyles.css +2 -6
  142. package/theme/todolist.css +1 -1
  143. package/src/liststyleui.js +0 -225
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-list",
3
- "version": "31.1.0",
3
+ "version": "32.0.0",
4
4
  "description": "Ordered and unordered lists feature to CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,36 +12,36 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "^31.1.0"
15
+ "ckeditor5": "^32.0.0",
16
+ "@ckeditor/ckeditor5-ui": "^32.0.0"
16
17
  },
17
18
  "devDependencies": {
18
- "@ckeditor/ckeditor5-basic-styles": "^31.1.0",
19
- "@ckeditor/ckeditor5-block-quote": "^31.1.0",
20
- "@ckeditor/ckeditor5-clipboard": "^31.1.0",
21
- "@ckeditor/ckeditor5-core": "^31.1.0",
22
- "@ckeditor/ckeditor5-dev-utils": "^26.0.0",
23
- "@ckeditor/ckeditor5-editor-classic": "^31.1.0",
24
- "@ckeditor/ckeditor5-engine": "^31.1.0",
25
- "@ckeditor/ckeditor5-enter": "^31.1.0",
26
- "@ckeditor/ckeditor5-essentials": "^31.1.0",
27
- "@ckeditor/ckeditor5-font": "^31.1.0",
28
- "@ckeditor/ckeditor5-heading": "^31.1.0",
29
- "@ckeditor/ckeditor5-highlight": "^31.1.0",
30
- "@ckeditor/ckeditor5-indent": "^31.1.0",
31
- "@ckeditor/ckeditor5-link": "^31.1.0",
32
- "@ckeditor/ckeditor5-paragraph": "^31.1.0",
33
- "@ckeditor/ckeditor5-remove-format": "^31.1.0",
34
- "@ckeditor/ckeditor5-table": "^31.1.0",
35
- "@ckeditor/ckeditor5-theme-lark": "^31.1.0",
36
- "@ckeditor/ckeditor5-typing": "^31.1.0",
37
- "@ckeditor/ckeditor5-ui": "^31.1.0",
38
- "@ckeditor/ckeditor5-undo": "^31.1.0",
39
- "@ckeditor/ckeditor5-utils": "^31.1.0",
40
- "webpack": "^4.43.0",
41
- "webpack-cli": "^3.3.11"
19
+ "@ckeditor/ckeditor5-basic-styles": "^32.0.0",
20
+ "@ckeditor/ckeditor5-block-quote": "^32.0.0",
21
+ "@ckeditor/ckeditor5-clipboard": "^32.0.0",
22
+ "@ckeditor/ckeditor5-core": "^32.0.0",
23
+ "@ckeditor/ckeditor5-dev-utils": "^27.1.0",
24
+ "@ckeditor/ckeditor5-editor-classic": "^32.0.0",
25
+ "@ckeditor/ckeditor5-engine": "^32.0.0",
26
+ "@ckeditor/ckeditor5-enter": "^32.0.0",
27
+ "@ckeditor/ckeditor5-essentials": "^32.0.0",
28
+ "@ckeditor/ckeditor5-font": "^32.0.0",
29
+ "@ckeditor/ckeditor5-heading": "^32.0.0",
30
+ "@ckeditor/ckeditor5-highlight": "^32.0.0",
31
+ "@ckeditor/ckeditor5-indent": "^32.0.0",
32
+ "@ckeditor/ckeditor5-link": "^32.0.0",
33
+ "@ckeditor/ckeditor5-paragraph": "^32.0.0",
34
+ "@ckeditor/ckeditor5-remove-format": "^32.0.0",
35
+ "@ckeditor/ckeditor5-table": "^32.0.0",
36
+ "@ckeditor/ckeditor5-theme-lark": "^32.0.0",
37
+ "@ckeditor/ckeditor5-typing": "^32.0.0",
38
+ "@ckeditor/ckeditor5-undo": "^32.0.0",
39
+ "@ckeditor/ckeditor5-utils": "^32.0.0",
40
+ "webpack": "^5.58.1",
41
+ "webpack-cli": "^4.9.0"
42
42
  },
43
43
  "engines": {
44
- "node": ">=12.0.0",
44
+ "node": ">=14.0.0",
45
45
  "npm": ">=5.7.1"
46
46
  },
47
47
  "author": "CKSource (http://cksource.com/)",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/converters.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -605,6 +605,18 @@ export function modelChangePostFixer( model, writer ) {
605
605
  applied = true;
606
606
  }
607
607
 
608
+ if ( item.hasAttribute( 'listReversed' ) ) {
609
+ writer.removeAttribute( 'listReversed', item );
610
+
611
+ applied = true;
612
+ }
613
+
614
+ if ( item.hasAttribute( 'listStart' ) ) {
615
+ writer.removeAttribute( 'listStart', item );
616
+
617
+ applied = true;
618
+ }
619
+
608
620
  for ( const innerItem of Array.from( model.createRangeIn( item ) ).filter( e => e.item.is( 'element', 'listItem' ) ) ) {
609
621
  _addListToFix( innerItem.previousPosition );
610
622
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -10,9 +10,9 @@
10
10
  export { default as List } from './list';
11
11
  export { default as ListEditing } from './listediting';
12
12
  export { default as ListUI } from './listui';
13
- export { default as ListStyle } from './liststyle';
14
- export { default as ListStyleEditing } from './liststyleediting';
15
- export { default as ListStyleUI } from './liststyleui';
13
+ export { default as ListProperties } from './listproperties';
14
+ export { default as ListPropertiesEditing } from './listpropertiesediting';
15
+ export { default as ListPropertiesUI } from './listpropertiesui';
16
16
  export { default as TodoList } from './todolist';
17
17
  export { default as TodoListEditing } from './todolistediting';
18
18
  export { default as TodoListUI } from './todolistui';
package/src/list.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -35,3 +35,26 @@ export default class List extends Plugin {
35
35
  return 'List';
36
36
  }
37
37
  }
38
+
39
+ /**
40
+ * The configuration of the {@link module:list/list~List list} feature.
41
+ *
42
+ * ClassicEditor
43
+ * .create( editorElement, {
44
+ * list: ... // The list feature configuration.
45
+ * } )
46
+ * .then( ... )
47
+ * .catch( ... );
48
+ *
49
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
50
+ *
51
+ * @interface ListConfig
52
+ */
53
+
54
+ /**
55
+ * The configuration of the {@link module:list/list~List} feature.
56
+ *
57
+ * Read more in {@link module:list/list~ListConfig}.
58
+ *
59
+ * @member {module:module:list/list~ListConfig} module:core/editor/editorconfig~EditorConfig#list
60
+ */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -56,7 +56,7 @@ export default class ListCommand extends Command {
56
56
  * @fires execute
57
57
  * @param {Object} [options] Command options.
58
58
  * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will try to convert the
59
- * selected items and potentially the neighbor elements to the proper list items. If set to `false` it will convert selected elements
59
+ * selected items and potentially the neighbor elements to the proper list items. If set to `false`, it will convert selected elements
60
60
  * to paragraphs. If not set, the command will toggle selected elements to list items or paragraphs, depending on the selection.
61
61
  */
62
62
  execute( options = {} ) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -0,0 +1,96 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2022, 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
+ /**
7
+ * @module list/listproperties
8
+ */
9
+
10
+ import { Plugin } from 'ckeditor5/src/core';
11
+ import ListPropertiesEditing from './listpropertiesediting';
12
+ import ListPropertiesUI from './listpropertiesui';
13
+
14
+ /**
15
+ * The list properties feature.
16
+ *
17
+ * This is a "glue" plugin that loads the {@link module:list/listpropertiesediting~ListPropertiesEditing list properties editing feature}
18
+ * and the {@link module:list/listpropertiesui~ListPropertiesUI list properties UI feature}.
19
+ *
20
+ * @extends module:core/plugin~Plugin
21
+ */
22
+ export default class ListProperties extends Plugin {
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ static get requires() {
27
+ return [ ListPropertiesEditing, ListPropertiesUI ];
28
+ }
29
+
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ static get pluginName() {
34
+ return 'ListProperties';
35
+ }
36
+ }
37
+
38
+ /**
39
+ * The configuration of the {@link module:list/listproperties~ListProperties list properties} feature.
40
+ *
41
+ * This configuration controls the individual list properties. For instance, it enables or disables specific editor commands
42
+ * operating on lists ({@link module:list/liststylecommand~ListStyleCommand `'listStyle'`},
43
+ * {@link module:list/liststartcommand~ListStartCommand `'listStart'`},
44
+ * {@link module:list/listreversedcommand~ListReversedCommand `'listReversed'`}), the look of the UI
45
+ * (`'numberedList'` and `'bulletedList'` dropdowns), and the editor data pipeline (allowed HTML attributes).
46
+ *
47
+ * ClassicEditor
48
+ * .create( editorElement, {
49
+ * list: {
50
+ * properties: {
51
+ * styles: true,
52
+ * startIndex: true,
53
+ * reversed: true
54
+ * }
55
+ * }
56
+ * } )
57
+ * .then( ... )
58
+ * .catch( ... );
59
+ *
60
+ * @interface ListPropertiesConfig
61
+ */
62
+
63
+ /**
64
+ * When set, the list style feature will be enabled. It allows changing the `list-style-type` HTML attribute of the lists.
65
+ *
66
+ * @default true
67
+ * @member {Boolean} module:list/listproperties~ListPropertiesConfig#styles
68
+ */
69
+
70
+ /**
71
+ * When set, the list start index feature will be enabled. It allows changing the `start` HTML attribute of the numbered lists. As a
72
+ * result, it will be possible to specify the start value of the first item in an ordered list.
73
+ *
74
+ * **Note**: This configuration does not affect bulleted and to-do lists.
75
+ *
76
+ * @default false
77
+ * @member {Boolean} module:list/listproperties~ListPropertiesConfig#startIndex
78
+ */
79
+
80
+ /**
81
+ * When set, the reversed list feature will be enabled. It allows changing the `reversed` HTML attribute of the numbered lists. As a
82
+ * result, it will be possible to make the list order descending instead of ascending.
83
+ *
84
+ * **Note**: This configuration does not affect bulleted and to-do lists.
85
+ *
86
+ * @default false
87
+ * @member {Boolean} module:list/listproperties~ListPropertiesConfig#reversed
88
+ */
89
+
90
+ /**
91
+ * The configuration of the {@link module:list/listproperties~ListProperties} feature.
92
+ *
93
+ * Read more in {@link module:list/listproperties~ListPropertiesConfig}.
94
+ *
95
+ * @member {module:list/listproperties~ListPropertiesConfig} module:list/list~ListConfig#properties
96
+ */