@ckeditor/ckeditor5-list 47.6.1-alpha.1 → 48.0.0-alpha.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.
- package/LICENSE.md +1 -1
- package/ckeditor5-metadata.json +21 -18
- package/dist/index-content.css +135 -111
- package/dist/index-editor.css +152 -73
- package/dist/index.css +204 -238
- package/dist/index.css.map +1 -1
- package/dist/index.js.map +1 -1
- package/{src → dist}/legacylist/legacyconverters.d.ts +2 -2
- package/{src → dist}/legacylist/legacyindentcommand.d.ts +1 -1
- package/{src → dist}/legacylist/legacylistcommand.d.ts +1 -1
- package/{src → dist}/legacylist/legacylistediting.d.ts +3 -3
- package/{src → dist}/legacylist/legacylistutils.d.ts +2 -2
- package/{src → dist}/legacylist/legacyutils.d.ts +1 -1
- package/{src → dist}/legacylist.d.ts +1 -1
- package/{src → dist}/legacylistproperties/legacylistpropertiesediting.d.ts +1 -1
- package/{src → dist}/legacylistproperties/legacylistreversedcommand.d.ts +1 -1
- package/{src → dist}/legacylistproperties/legacyliststartcommand.d.ts +1 -1
- package/{src → dist}/legacylistproperties/legacyliststylecommand.d.ts +1 -1
- package/{src → dist}/legacylistproperties.d.ts +1 -1
- package/{src → dist}/legacytodolist/legacychecktodolistcommand.d.ts +2 -2
- package/{src → dist}/legacytodolist/legacytodolistconverters.d.ts +2 -2
- package/{src → dist}/legacytodolist/legacytodolistediting.d.ts +1 -1
- package/{src → dist}/legacytodolist.d.ts +1 -1
- package/{src → dist}/list/adjacentlistssupport.d.ts +1 -1
- package/{src → dist}/list/converters.d.ts +2 -2
- package/{src → dist}/list/listcommand.d.ts +2 -2
- package/{src → dist}/list/listediting.d.ts +5 -5
- package/{src → dist}/list/listindentcommand.d.ts +2 -2
- package/{src → dist}/list/listmergecommand.d.ts +2 -2
- package/{src → dist}/list/listsplitcommand.d.ts +2 -2
- package/{src → dist}/list/listui.d.ts +1 -1
- package/{src → dist}/list/listutils.d.ts +3 -3
- package/{src → dist}/list/utils/listwalker.d.ts +2 -2
- package/{src → dist}/list/utils/model.d.ts +2 -2
- package/{src → dist}/list/utils/postfixers.d.ts +1 -1
- package/{src → dist}/list/utils/view.d.ts +1 -1
- package/{src → dist}/list/utils.d.ts +1 -1
- package/{src → dist}/list.d.ts +1 -1
- package/{src → dist}/listconfig.d.ts +1 -1
- package/{src → dist}/listformatting/listitemboldintegration.d.ts +1 -1
- package/{src → dist}/listformatting/listitemfontcolorintegration.d.ts +1 -1
- package/{src → dist}/listformatting/listitemfontfamilyintegration.d.ts +1 -1
- package/{src → dist}/listformatting/listitemfontsizeintegration.d.ts +1 -1
- package/{src → dist}/listformatting/listitemitalicintegration.d.ts +1 -1
- package/{src → dist}/listformatting.d.ts +1 -1
- package/{src → dist}/listproperties/converters.d.ts +2 -2
- package/{src → dist}/listproperties/listpropertiesediting.d.ts +2 -2
- package/{src → dist}/listproperties/listpropertiesui.d.ts +1 -1
- package/{src → dist}/listproperties/listpropertiesutils.d.ts +1 -1
- package/{src → dist}/listproperties/listreversedcommand.d.ts +1 -1
- package/{src → dist}/listproperties/liststartcommand.d.ts +1 -1
- package/{src → dist}/listproperties/liststylecommand.d.ts +1 -1
- package/{src → dist}/listproperties/ui/listpropertiesview.d.ts +2 -2
- package/{src → dist}/listproperties.d.ts +1 -1
- package/{src → dist}/todolist/checktodolistcommand.d.ts +1 -1
- package/{src → dist}/todolist/todocheckboxchangeobserver.d.ts +1 -1
- package/{src → dist}/todolist/todolistediting.d.ts +1 -1
- package/{src → dist}/todolist/todolistui.d.ts +1 -1
- package/{src → dist}/todolist.d.ts +1 -1
- package/package.json +28 -52
- package/build/list.js +0 -5
- package/build/translations/af.js +0 -1
- package/build/translations/ar.js +0 -1
- package/build/translations/ast.js +0 -1
- package/build/translations/az.js +0 -1
- package/build/translations/be.js +0 -1
- package/build/translations/bg.js +0 -1
- package/build/translations/bn.js +0 -1
- package/build/translations/bs.js +0 -1
- package/build/translations/ca.js +0 -1
- package/build/translations/cs.js +0 -1
- package/build/translations/da.js +0 -1
- package/build/translations/de-ch.js +0 -1
- package/build/translations/de.js +0 -1
- package/build/translations/el.js +0 -1
- package/build/translations/en-au.js +0 -1
- package/build/translations/en-gb.js +0 -1
- package/build/translations/eo.js +0 -1
- package/build/translations/es-co.js +0 -1
- package/build/translations/es.js +0 -1
- package/build/translations/et.js +0 -1
- package/build/translations/eu.js +0 -1
- package/build/translations/fa.js +0 -1
- package/build/translations/fi.js +0 -1
- package/build/translations/fr.js +0 -1
- package/build/translations/gl.js +0 -1
- package/build/translations/gu.js +0 -1
- package/build/translations/he.js +0 -1
- package/build/translations/hi.js +0 -1
- package/build/translations/hr.js +0 -1
- package/build/translations/hu.js +0 -1
- package/build/translations/hy.js +0 -1
- package/build/translations/id.js +0 -1
- package/build/translations/it.js +0 -1
- package/build/translations/ja.js +0 -1
- package/build/translations/jv.js +0 -1
- package/build/translations/kk.js +0 -1
- package/build/translations/km.js +0 -1
- package/build/translations/kn.js +0 -1
- package/build/translations/ko.js +0 -1
- package/build/translations/ku.js +0 -1
- package/build/translations/lt.js +0 -1
- package/build/translations/lv.js +0 -1
- package/build/translations/ms.js +0 -1
- package/build/translations/nb.js +0 -1
- package/build/translations/ne.js +0 -1
- package/build/translations/nl.js +0 -1
- package/build/translations/no.js +0 -1
- package/build/translations/oc.js +0 -1
- package/build/translations/pl.js +0 -1
- package/build/translations/pt-br.js +0 -1
- package/build/translations/pt.js +0 -1
- package/build/translations/ro.js +0 -1
- package/build/translations/ru.js +0 -1
- package/build/translations/si.js +0 -1
- package/build/translations/sk.js +0 -1
- package/build/translations/sl.js +0 -1
- package/build/translations/sq.js +0 -1
- package/build/translations/sr-latn.js +0 -1
- package/build/translations/sr.js +0 -1
- package/build/translations/sv.js +0 -1
- package/build/translations/th.js +0 -1
- package/build/translations/ti.js +0 -1
- package/build/translations/tk.js +0 -1
- package/build/translations/tr.js +0 -1
- package/build/translations/tt.js +0 -1
- package/build/translations/ug.js +0 -1
- package/build/translations/uk.js +0 -1
- package/build/translations/ur.js +0 -1
- package/build/translations/uz.js +0 -1
- package/build/translations/vi.js +0 -1
- package/build/translations/zh-cn.js +0 -1
- package/build/translations/zh.js +0 -1
- package/lang/contexts.json +0 -37
- package/lang/translations/af.po +0 -152
- package/lang/translations/ar.po +0 -152
- package/lang/translations/ast.po +0 -152
- package/lang/translations/az.po +0 -152
- package/lang/translations/be.po +0 -152
- package/lang/translations/bg.po +0 -152
- package/lang/translations/bn.po +0 -152
- package/lang/translations/bs.po +0 -152
- package/lang/translations/ca.po +0 -152
- package/lang/translations/cs.po +0 -152
- package/lang/translations/da.po +0 -152
- package/lang/translations/de-ch.po +0 -152
- package/lang/translations/de.po +0 -152
- package/lang/translations/el.po +0 -152
- package/lang/translations/en-au.po +0 -152
- package/lang/translations/en-gb.po +0 -152
- package/lang/translations/en.po +0 -152
- package/lang/translations/eo.po +0 -152
- package/lang/translations/es-co.po +0 -152
- package/lang/translations/es.po +0 -152
- package/lang/translations/et.po +0 -152
- package/lang/translations/eu.po +0 -152
- package/lang/translations/fa.po +0 -152
- package/lang/translations/fi.po +0 -152
- package/lang/translations/fr.po +0 -152
- package/lang/translations/gl.po +0 -152
- package/lang/translations/gu.po +0 -152
- package/lang/translations/he.po +0 -152
- package/lang/translations/hi.po +0 -152
- package/lang/translations/hr.po +0 -152
- package/lang/translations/hu.po +0 -152
- package/lang/translations/hy.po +0 -152
- package/lang/translations/id.po +0 -152
- package/lang/translations/it.po +0 -152
- package/lang/translations/ja.po +0 -152
- package/lang/translations/jv.po +0 -152
- package/lang/translations/kk.po +0 -152
- package/lang/translations/km.po +0 -152
- package/lang/translations/kn.po +0 -152
- package/lang/translations/ko.po +0 -152
- package/lang/translations/ku.po +0 -152
- package/lang/translations/lt.po +0 -152
- package/lang/translations/lv.po +0 -152
- package/lang/translations/ms.po +0 -152
- package/lang/translations/nb.po +0 -152
- package/lang/translations/ne.po +0 -152
- package/lang/translations/nl.po +0 -152
- package/lang/translations/no.po +0 -152
- package/lang/translations/oc.po +0 -152
- package/lang/translations/pl.po +0 -152
- package/lang/translations/pt-br.po +0 -152
- package/lang/translations/pt.po +0 -152
- package/lang/translations/ro.po +0 -152
- package/lang/translations/ru.po +0 -152
- package/lang/translations/si.po +0 -152
- package/lang/translations/sk.po +0 -152
- package/lang/translations/sl.po +0 -152
- package/lang/translations/sq.po +0 -152
- package/lang/translations/sr-latn.po +0 -152
- package/lang/translations/sr.po +0 -152
- package/lang/translations/sv.po +0 -152
- package/lang/translations/th.po +0 -152
- package/lang/translations/ti.po +0 -152
- package/lang/translations/tk.po +0 -152
- package/lang/translations/tr.po +0 -152
- package/lang/translations/tt.po +0 -152
- package/lang/translations/ug.po +0 -152
- package/lang/translations/uk.po +0 -152
- package/lang/translations/ur.po +0 -152
- package/lang/translations/uz.po +0 -152
- package/lang/translations/vi.po +0 -152
- package/lang/translations/zh-cn.po +0 -152
- package/lang/translations/zh.po +0 -152
- package/src/augmentation.js +0 -5
- package/src/index.js +0 -67
- package/src/legacyerrors.js +0 -28
- package/src/legacylist/legacyconverters.js +0 -921
- package/src/legacylist/legacyindentcommand.js +0 -111
- package/src/legacylist/legacylistcommand.js +0 -278
- package/src/legacylist/legacylistediting.js +0 -167
- package/src/legacylist/legacylistutils.js +0 -52
- package/src/legacylist/legacyutils.js +0 -357
- package/src/legacylist.js +0 -36
- package/src/legacylistproperties/legacylistpropertiesediting.js +0 -703
- package/src/legacylistproperties/legacylistreversedcommand.js +0 -52
- package/src/legacylistproperties/legacyliststartcommand.js +0 -52
- package/src/legacylistproperties/legacyliststylecommand.js +0 -105
- package/src/legacylistproperties.js +0 -37
- package/src/legacytodolist/legacychecktodolistcommand.js +0 -82
- package/src/legacytodolist/legacytodolistconverters.js +0 -268
- package/src/legacytodolist/legacytodolistediting.js +0 -199
- package/src/legacytodolist.js +0 -37
- package/src/list/adjacentlistssupport.js +0 -87
- package/src/list/converters.js +0 -533
- package/src/list/listcommand.js +0 -176
- package/src/list/listediting.js +0 -696
- package/src/list/listindentcommand.js +0 -136
- package/src/list/listmergecommand.js +0 -182
- package/src/list/listsplitcommand.js +0 -74
- package/src/list/listui.js +0 -42
- package/src/list/listutils.js +0 -68
- package/src/list/utils/listwalker.js +0 -236
- package/src/list/utils/model.js +0 -487
- package/src/list/utils/postfixers.js +0 -131
- package/src/list/utils/view.js +0 -117
- package/src/list/utils.js +0 -51
- package/src/list.js +0 -36
- package/src/listconfig.js +0 -5
- package/src/listformatting/listitemboldintegration.js +0 -88
- package/src/listformatting/listitemfontcolorintegration.js +0 -92
- package/src/listformatting/listitemfontfamilyintegration.js +0 -93
- package/src/listformatting/listitemfontsizeintegration.js +0 -124
- package/src/listformatting/listitemitalicintegration.js +0 -88
- package/src/listformatting.js +0 -248
- package/src/listproperties/converters.js +0 -43
- package/src/listproperties/listpropertiesediting.js +0 -291
- package/src/listproperties/listpropertiesui.js +0 -385
- package/src/listproperties/listpropertiesutils.js +0 -50
- package/src/listproperties/listreversedcommand.js +0 -55
- package/src/listproperties/liststartcommand.js +0 -61
- package/src/listproperties/liststylecommand.js +0 -121
- package/src/listproperties/ui/listpropertiesview.js +0 -318
- package/src/listproperties/utils/config.js +0 -84
- package/src/listproperties/utils/style.js +0 -85
- package/src/listproperties.js +0 -37
- package/src/todolist/checktodolistcommand.js +0 -82
- package/src/todolist/todocheckboxchangeobserver.js +0 -36
- package/src/todolist/todolistediting.js +0 -470
- package/src/todolist/todolistui.js +0 -35
- package/src/todolist.js +0 -37
- package/theme/documentlist.css +0 -8
- package/theme/list.css +0 -40
- package/theme/listformatting.css +0 -66
- package/theme/listproperties.css +0 -10
- package/theme/liststyles.css +0 -8
- package/theme/todolist.css +0 -140
- /package/{src → dist}/augmentation.d.ts +0 -0
- /package/{src → dist}/index.d.ts +0 -0
- /package/{src → dist}/legacyerrors.d.ts +0 -0
- /package/{src → dist}/listproperties/utils/config.d.ts +0 -0
- /package/{src → dist}/listproperties/utils/style.d.ts +0 -0
package/src/list/utils/view.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Checks if view element is a list type (ul or ol).
|
|
7
|
-
*
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export function isListView(viewElement) {
|
|
11
|
-
return viewElement.is('element', 'ol') || viewElement.is('element', 'ul');
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Checks if view element is a list item (li).
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export function isListItemView(viewElement) {
|
|
19
|
-
return viewElement.is('element', 'li');
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Calculates the indent value for a list item. Handles HTML compliant and non-compliant lists.
|
|
23
|
-
*
|
|
24
|
-
* Also, fixes non HTML compliant lists indents:
|
|
25
|
-
*
|
|
26
|
-
* ```
|
|
27
|
-
* before: fixed list:
|
|
28
|
-
* OL OL
|
|
29
|
-
* |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
30
|
-
* |-> OL |-> OL
|
|
31
|
-
* |-> OL |
|
|
32
|
-
* | |-> OL |
|
|
33
|
-
* | |-> OL |
|
|
34
|
-
* | |-> LI (parent LIs: 1) |-> LI (indent: 1)
|
|
35
|
-
* |-> LI (parent LIs: 1) |-> LI (indent: 1)
|
|
36
|
-
*
|
|
37
|
-
* before: fixed list:
|
|
38
|
-
* OL OL
|
|
39
|
-
* |-> OL |
|
|
40
|
-
* |-> OL |
|
|
41
|
-
* |-> OL |
|
|
42
|
-
* |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
43
|
-
*
|
|
44
|
-
* before: fixed list:
|
|
45
|
-
* OL OL
|
|
46
|
-
* |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
47
|
-
* |-> OL |-> OL
|
|
48
|
-
* |-> LI (parent LIs: 0) |-> LI (indent: 1)
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* @internal
|
|
52
|
-
*/
|
|
53
|
-
export function getIndent(listItem) {
|
|
54
|
-
let indent = 0;
|
|
55
|
-
let parent = listItem.parent;
|
|
56
|
-
while (parent) {
|
|
57
|
-
// Each LI in the tree will result in an increased indent for HTML compliant lists.
|
|
58
|
-
if (isListItemView(parent)) {
|
|
59
|
-
indent++;
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
// If however the list is nested in other list we should check previous sibling of any of the list elements...
|
|
63
|
-
const previousSibling = parent.previousSibling;
|
|
64
|
-
// ...because the we might need increase its indent:
|
|
65
|
-
// before: fixed list:
|
|
66
|
-
// OL OL
|
|
67
|
-
// |-> LI (parent LIs: 0) |-> LI (indent: 0)
|
|
68
|
-
// |-> OL |-> OL
|
|
69
|
-
// |-> LI (parent LIs: 0) |-> LI (indent: 1)
|
|
70
|
-
if (previousSibling && isListItemView(previousSibling)) {
|
|
71
|
-
indent++;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
parent = parent.parent;
|
|
75
|
-
}
|
|
76
|
-
return indent;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Creates a list attribute element (ol or ul).
|
|
80
|
-
*
|
|
81
|
-
* @internal
|
|
82
|
-
*/
|
|
83
|
-
export function createListElement(writer, indent, type, id = getViewElementIdForListType(type, indent)) {
|
|
84
|
-
// Negative priorities so that restricted editing attribute won't wrap lists.
|
|
85
|
-
return writer.createAttributeElement(getViewElementNameForListType(type), null, {
|
|
86
|
-
priority: 2 * indent / 100 - 100,
|
|
87
|
-
id
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Creates a list item attribute element (li).
|
|
92
|
-
*
|
|
93
|
-
* @internal
|
|
94
|
-
*/
|
|
95
|
-
export function createListItemElement(writer, indent, id) {
|
|
96
|
-
// Negative priorities so that restricted editing attribute won't wrap list items.
|
|
97
|
-
return writer.createAttributeElement('li', null, {
|
|
98
|
-
priority: (2 * indent + 1) / 100 - 100,
|
|
99
|
-
id
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Returns a view element name for the given list type.
|
|
104
|
-
*
|
|
105
|
-
* @internal
|
|
106
|
-
*/
|
|
107
|
-
export function getViewElementNameForListType(type) {
|
|
108
|
-
return type == 'numbered' || type == 'customNumbered' ? 'ol' : 'ul';
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Returns a view element ID for the given list type and indent.
|
|
112
|
-
*
|
|
113
|
-
* @internal
|
|
114
|
-
*/
|
|
115
|
-
export function getViewElementIdForListType(type, indent) {
|
|
116
|
-
return `list-${type}-${indent}`;
|
|
117
|
-
}
|
package/src/list/utils.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
6
|
-
/**
|
|
7
|
-
* Helper method for creating toolbar and menu buttons and linking them with an appropriate command.
|
|
8
|
-
*
|
|
9
|
-
* @internal
|
|
10
|
-
* @param editor The editor instance to which the UI component will be added.
|
|
11
|
-
* @param commandName The name of the command.
|
|
12
|
-
* @param label The button label.
|
|
13
|
-
* @param icon The source of the icon.
|
|
14
|
-
*/
|
|
15
|
-
export function createUIComponents(editor, commandName, label, icon) {
|
|
16
|
-
editor.ui.componentFactory.add(commandName, () => {
|
|
17
|
-
const buttonView = _createButton(ButtonView, editor, commandName, label, icon);
|
|
18
|
-
buttonView.set({
|
|
19
|
-
tooltip: true,
|
|
20
|
-
isToggleable: true
|
|
21
|
-
});
|
|
22
|
-
return buttonView;
|
|
23
|
-
});
|
|
24
|
-
editor.ui.componentFactory.add(`menuBar:${commandName}`, () => {
|
|
25
|
-
const buttonView = _createButton(MenuBarMenuListItemButtonView, editor, commandName, label, icon);
|
|
26
|
-
buttonView.set({
|
|
27
|
-
role: 'menuitemcheckbox',
|
|
28
|
-
isToggleable: true
|
|
29
|
-
});
|
|
30
|
-
return buttonView;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Creates a button to use either in toolbar or in menu bar.
|
|
35
|
-
*/
|
|
36
|
-
function _createButton(ButtonClass, editor, commandName, label, icon) {
|
|
37
|
-
const command = editor.commands.get(commandName);
|
|
38
|
-
const view = new ButtonClass(editor.locale);
|
|
39
|
-
view.set({
|
|
40
|
-
label,
|
|
41
|
-
icon
|
|
42
|
-
});
|
|
43
|
-
// Bind button model to command.
|
|
44
|
-
view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
|
|
45
|
-
// Execute the command.
|
|
46
|
-
view.on('execute', () => {
|
|
47
|
-
editor.execute(commandName);
|
|
48
|
-
editor.editing.view.focus();
|
|
49
|
-
});
|
|
50
|
-
return view;
|
|
51
|
-
}
|
package/src/list.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module list/list
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { ListEditing } from './list/listediting.js';
|
|
10
|
-
import { ListUI } from './list/listui.js';
|
|
11
|
-
/**
|
|
12
|
-
* The list feature.
|
|
13
|
-
*
|
|
14
|
-
* This is a "glue" plugin that loads the {@link module:list/list/listediting~ListEditing list
|
|
15
|
-
* editing feature} and {@link module:list/list/listui~ListUI list UI feature}.
|
|
16
|
-
*/
|
|
17
|
-
export class List extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get requires() {
|
|
22
|
-
return [ListEditing, ListUI];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
static get pluginName() {
|
|
28
|
-
return 'List';
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
static get isOfficialPlugin() {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
}
|
package/src/listconfig.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module list/listformatting/listitemboldintegration
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { env } from 'ckeditor5/src/utils.js';
|
|
10
|
-
import { ListEditing } from '../list/listediting.js';
|
|
11
|
-
/**
|
|
12
|
-
* The list item bold integration plugin.
|
|
13
|
-
*/
|
|
14
|
-
export class ListItemBoldIntegration extends Plugin {
|
|
15
|
-
/**
|
|
16
|
-
* @inheritDoc
|
|
17
|
-
*/
|
|
18
|
-
static get pluginName() {
|
|
19
|
-
return 'ListItemBoldIntegration';
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @inheritDoc
|
|
23
|
-
*/
|
|
24
|
-
static get isOfficialPlugin() {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
static get requires() {
|
|
31
|
-
return [ListEditing];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
init() {
|
|
37
|
-
const editor = this.editor;
|
|
38
|
-
const ListFormatting = editor.plugins.get('ListFormatting');
|
|
39
|
-
const listEditing = editor.plugins.get(ListEditing);
|
|
40
|
-
if (!editor.plugins.has('BoldEditing') || !this.editor.config.get('list.enableListItemMarkerFormatting')) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
ListFormatting.registerFormatAttribute('bold', 'listItemBold');
|
|
44
|
-
// Register the downcast strategy in init() so that the attribute name is registered before the list editing
|
|
45
|
-
// registers its converters.
|
|
46
|
-
// This ensures that the attribute is recognized by downcast strategies and bogus paragraphs are handled correctly.
|
|
47
|
-
listEditing.registerDowncastStrategy({
|
|
48
|
-
scope: 'item',
|
|
49
|
-
attributeName: 'listItemBold',
|
|
50
|
-
setAttributeOnDowncast(writer, value, viewElement, options) {
|
|
51
|
-
if (value) {
|
|
52
|
-
writer.addClass('ck-list-marker-bold', viewElement);
|
|
53
|
-
// See: https://github.com/ckeditor/ckeditor5/issues/18790.
|
|
54
|
-
if (env.isSafari && !(options && options.dataPipeline)) {
|
|
55
|
-
writer.setStyle('--ck-content-list-marker-dummy-bold', '0', viewElement);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* @inheritDoc
|
|
63
|
-
*/
|
|
64
|
-
afterInit() {
|
|
65
|
-
const editor = this.editor;
|
|
66
|
-
const model = editor.model;
|
|
67
|
-
if (!editor.plugins.has('BoldEditing') || !this.editor.config.get('list.enableListItemMarkerFormatting')) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
model.schema.extend('$listItem', { allowAttributes: 'listItemBold' });
|
|
71
|
-
model.schema.setAttributeProperties('listItemBold', {
|
|
72
|
-
isFormatting: true
|
|
73
|
-
});
|
|
74
|
-
model.schema.addAttributeCheck(context => {
|
|
75
|
-
const item = context.last;
|
|
76
|
-
if (!item.getAttribute('listItemId')) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
}, 'listItemBold');
|
|
80
|
-
editor.conversion.for('upcast').attributeToAttribute({
|
|
81
|
-
model: 'listItemBold',
|
|
82
|
-
view: {
|
|
83
|
-
name: 'li',
|
|
84
|
-
classes: 'ck-list-marker-bold'
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module list/listformatting/listitemfontcolorintegration
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { ListEditing } from '../list/listediting.js';
|
|
10
|
-
/**
|
|
11
|
-
* The list item font color integration plugin.
|
|
12
|
-
*/
|
|
13
|
-
export class ListItemFontColorIntegration extends Plugin {
|
|
14
|
-
/**
|
|
15
|
-
* @inheritDoc
|
|
16
|
-
*/
|
|
17
|
-
static get pluginName() {
|
|
18
|
-
return 'ListItemFontColorIntegration';
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
static get isOfficialPlugin() {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @inheritDoc
|
|
28
|
-
*/
|
|
29
|
-
static get requires() {
|
|
30
|
-
return [ListEditing];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
init() {
|
|
36
|
-
const editor = this.editor;
|
|
37
|
-
const ListFormatting = editor.plugins.get('ListFormatting');
|
|
38
|
-
const listEditing = editor.plugins.get(ListEditing);
|
|
39
|
-
if (!editor.plugins.has('FontColorEditing') || !this.editor.config.get('list.enableListItemMarkerFormatting')) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
ListFormatting.registerFormatAttribute('fontColor', 'listItemFontColor');
|
|
43
|
-
// Register the downcast strategy in init() so that the attribute name is registered before the list editing
|
|
44
|
-
// registers its converters.
|
|
45
|
-
// This ensures that the attribute is recognized by downcast strategies and bogus paragraphs are handled correctly.
|
|
46
|
-
listEditing.registerDowncastStrategy({
|
|
47
|
-
scope: 'item',
|
|
48
|
-
attributeName: 'listItemFontColor',
|
|
49
|
-
setAttributeOnDowncast(writer, value, viewElement) {
|
|
50
|
-
if (value) {
|
|
51
|
-
writer.addClass('ck-list-marker-color', viewElement);
|
|
52
|
-
writer.setStyle('--ck-content-list-marker-color', value, viewElement);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* @inheritDoc
|
|
59
|
-
*/
|
|
60
|
-
afterInit() {
|
|
61
|
-
const editor = this.editor;
|
|
62
|
-
const model = editor.model;
|
|
63
|
-
if (!editor.plugins.has('FontColorEditing') || !this.editor.config.get('list.enableListItemMarkerFormatting')) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
model.schema.extend('$listItem', { allowAttributes: 'listItemFontColor' });
|
|
67
|
-
model.schema.setAttributeProperties('listItemFontColor', {
|
|
68
|
-
isFormatting: true
|
|
69
|
-
});
|
|
70
|
-
model.schema.addAttributeCheck(context => {
|
|
71
|
-
const item = context.last;
|
|
72
|
-
if (!item.getAttribute('listItemId')) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
}, 'listItemFontColor');
|
|
76
|
-
editor.conversion.for('upcast').attributeToAttribute({
|
|
77
|
-
model: {
|
|
78
|
-
key: 'listItemFontColor',
|
|
79
|
-
value: (viewElement) => {
|
|
80
|
-
return viewElement.getStyle('--ck-content-list-marker-color');
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
view: {
|
|
84
|
-
name: 'li',
|
|
85
|
-
classes: 'ck-list-marker-color',
|
|
86
|
-
styles: {
|
|
87
|
-
'--ck-content-list-marker-color': /.*/
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module list/listformatting/listitemfontfamilyintegration
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { ListEditing } from '../list/listediting.js';
|
|
10
|
-
/**
|
|
11
|
-
* The list item font family integration plugin.
|
|
12
|
-
*/
|
|
13
|
-
export class ListItemFontFamilyIntegration extends Plugin {
|
|
14
|
-
/**
|
|
15
|
-
* @inheritDoc
|
|
16
|
-
*/
|
|
17
|
-
static get pluginName() {
|
|
18
|
-
return 'ListItemFontFamilyIntegration';
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
static get isOfficialPlugin() {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @inheritDoc
|
|
28
|
-
*/
|
|
29
|
-
static get requires() {
|
|
30
|
-
return [ListEditing];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
init() {
|
|
36
|
-
const editor = this.editor;
|
|
37
|
-
const ListFormatting = editor.plugins.get('ListFormatting');
|
|
38
|
-
const listEditing = editor.plugins.get(ListEditing);
|
|
39
|
-
if (!editor.plugins.has('FontFamilyEditing') || !this.editor.config.get('list.enableListItemMarkerFormatting')) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
ListFormatting.registerFormatAttribute('fontFamily', 'listItemFontFamily');
|
|
43
|
-
// Register the downcast strategy in init() so that the attribute name is registered before the list editing
|
|
44
|
-
// registers its converters.
|
|
45
|
-
// This ensures that the attribute is recognized by downcast strategies and bogus paragraphs are handled correctly.
|
|
46
|
-
listEditing.registerDowncastStrategy({
|
|
47
|
-
scope: 'item',
|
|
48
|
-
attributeName: 'listItemFontFamily',
|
|
49
|
-
setAttributeOnDowncast(writer, value, viewElement) {
|
|
50
|
-
// There is no need of removing the style because downcast strategies handles it automatically.
|
|
51
|
-
if (value) {
|
|
52
|
-
writer.addClass('ck-list-marker-font-family', viewElement);
|
|
53
|
-
writer.setStyle('--ck-content-list-marker-font-family', value, viewElement);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @inheritDoc
|
|
60
|
-
*/
|
|
61
|
-
afterInit() {
|
|
62
|
-
const editor = this.editor;
|
|
63
|
-
const model = editor.model;
|
|
64
|
-
if (!editor.plugins.has('FontFamilyEditing') || !this.editor.config.get('list.enableListItemMarkerFormatting')) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
model.schema.extend('$listItem', { allowAttributes: 'listItemFontFamily' });
|
|
68
|
-
model.schema.setAttributeProperties('listItemFontFamily', {
|
|
69
|
-
isFormatting: true
|
|
70
|
-
});
|
|
71
|
-
model.schema.addAttributeCheck(context => {
|
|
72
|
-
const item = context.last;
|
|
73
|
-
if (!item.getAttribute('listItemId')) {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
}, 'listItemFontFamily');
|
|
77
|
-
editor.conversion.for('upcast').attributeToAttribute({
|
|
78
|
-
model: {
|
|
79
|
-
key: 'listItemFontFamily',
|
|
80
|
-
value: (viewElement) => {
|
|
81
|
-
return viewElement.getStyle('--ck-content-list-marker-font-family');
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
view: {
|
|
85
|
-
name: 'li',
|
|
86
|
-
classes: 'ck-list-marker-font-family',
|
|
87
|
-
styles: {
|
|
88
|
-
'--ck-content-list-marker-font-family': /.*/
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module list/listformatting/listitemfontsizeintegration
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { env } from 'ckeditor5/src/utils.js';
|
|
10
|
-
import { _normalizeFontSizeOptions } from '@ckeditor/ckeditor5-font';
|
|
11
|
-
import { ListEditing } from '../list/listediting.js';
|
|
12
|
-
/**
|
|
13
|
-
* The list item font size integration plugin.
|
|
14
|
-
*/
|
|
15
|
-
export class ListItemFontSizeIntegration extends Plugin {
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
static get pluginName() {
|
|
20
|
-
return 'ListItemFontSizeIntegration';
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
static get isOfficialPlugin() {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @inheritDoc
|
|
30
|
-
*/
|
|
31
|
-
static get requires() {
|
|
32
|
-
return [ListEditing];
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
init() {
|
|
38
|
-
const editor = this.editor;
|
|
39
|
-
const ListFormatting = editor.plugins.get('ListFormatting');
|
|
40
|
-
const listEditing = editor.plugins.get(ListEditing);
|
|
41
|
-
if (!editor.plugins.has('FontSizeEditing') || !this.editor.config.get('list.enableListItemMarkerFormatting')) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const normalizedFontSizeOptions = _normalizeFontSizeOptions(editor.config.get('fontSize.options'));
|
|
45
|
-
ListFormatting.registerFormatAttribute('fontSize', 'listItemFontSize');
|
|
46
|
-
// Register the downcast strategy in init() so that the attribute name is registered before the list editing
|
|
47
|
-
// registers its converters.
|
|
48
|
-
// This ensures that the attribute is recognized by downcast strategies and bogus paragraphs are handled correctly.
|
|
49
|
-
listEditing.registerDowncastStrategy({
|
|
50
|
-
scope: 'item',
|
|
51
|
-
attributeName: 'listItemFontSize',
|
|
52
|
-
setAttributeOnDowncast(writer, value, viewElement, options) {
|
|
53
|
-
if (value) {
|
|
54
|
-
const fontSizeOption = normalizedFontSizeOptions.find(option => option.model == value);
|
|
55
|
-
if (fontSizeOption && fontSizeOption.view && typeof fontSizeOption.view != 'string') {
|
|
56
|
-
if (fontSizeOption.view.styles) {
|
|
57
|
-
writer.addClass('ck-list-marker-font-size', viewElement);
|
|
58
|
-
writer.setStyle('--ck-content-list-marker-font-size', fontSizeOption.view.styles['font-size'], viewElement);
|
|
59
|
-
}
|
|
60
|
-
else if (fontSizeOption.view.classes) {
|
|
61
|
-
writer.addClass(`ck-list-marker-font-size-${value}`, viewElement);
|
|
62
|
-
// See: https://github.com/ckeditor/ckeditor5/issues/18790.
|
|
63
|
-
if (env.isSafari && !(options && options.dataPipeline)) {
|
|
64
|
-
writer.setStyle('--ck-content-list-marker-dummy-font-size', '0', viewElement);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
writer.addClass('ck-list-marker-font-size', viewElement);
|
|
70
|
-
writer.setStyle('--ck-content-list-marker-font-size', value, viewElement);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* @inheritDoc
|
|
78
|
-
*/
|
|
79
|
-
afterInit() {
|
|
80
|
-
const editor = this.editor;
|
|
81
|
-
const model = editor.model;
|
|
82
|
-
if (!editor.plugins.has('FontSizeEditing') || !this.editor.config.get('list.enableListItemMarkerFormatting')) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
model.schema.extend('$listItem', { allowAttributes: 'listItemFontSize' });
|
|
86
|
-
model.schema.setAttributeProperties('listItemFontSize', {
|
|
87
|
-
isFormatting: true
|
|
88
|
-
});
|
|
89
|
-
model.schema.addAttributeCheck(context => {
|
|
90
|
-
const item = context.last;
|
|
91
|
-
if (!item.getAttribute('listItemId')) {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
}, 'listItemFontSize');
|
|
95
|
-
editor.conversion.for('upcast').elementToAttribute({
|
|
96
|
-
model: {
|
|
97
|
-
key: 'listItemFontSize',
|
|
98
|
-
value: (viewElement) => viewElement.getStyle('--ck-content-list-marker-font-size')
|
|
99
|
-
},
|
|
100
|
-
view: {
|
|
101
|
-
name: 'li',
|
|
102
|
-
classes: 'ck-list-marker-font-size',
|
|
103
|
-
styles: {
|
|
104
|
-
'--ck-content-list-marker-font-size': /.*/
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
const fontSizeOptions = _normalizeFontSizeOptions(editor.config.get('fontSize.options'));
|
|
109
|
-
for (const option of fontSizeOptions) {
|
|
110
|
-
if (option.model && option.view) {
|
|
111
|
-
editor.conversion.for('upcast').elementToAttribute({
|
|
112
|
-
model: {
|
|
113
|
-
key: 'listItemFontSize',
|
|
114
|
-
value: option.model
|
|
115
|
-
},
|
|
116
|
-
view: {
|
|
117
|
-
name: 'li',
|
|
118
|
-
classes: `ck-list-marker-font-size-${option.model}`
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|