@ckeditor/ckeditor5-list 40.0.0 → 40.2.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/CHANGELOG.md +25 -25
- package/LICENSE.md +2 -2
- package/build/list.js +1 -1
- package/build/translations/ug.js +1 -1
- package/lang/translations/ug.po +3 -3
- package/package.json +2 -3
- package/src/augmentation.d.ts +52 -52
- package/src/augmentation.js +5 -5
- package/src/documentlist/adjacentlistssupport.d.ts +15 -15
- package/src/documentlist/adjacentlistssupport.js +81 -81
- package/src/documentlist/converters.d.ts +65 -65
- package/src/documentlist/converters.js +441 -441
- package/src/documentlist/documentlistcommand.d.ts +80 -80
- package/src/documentlist/documentlistcommand.js +150 -150
- package/src/documentlist/documentlistediting.d.ts +212 -212
- package/src/documentlist/documentlistediting.js +646 -645
- package/src/documentlist/documentlistindentcommand.d.ts +62 -62
- package/src/documentlist/documentlistindentcommand.js +129 -129
- package/src/documentlist/documentlistmergecommand.d.ts +76 -76
- package/src/documentlist/documentlistmergecommand.js +174 -174
- package/src/documentlist/documentlistsplitcommand.d.ts +67 -67
- package/src/documentlist/documentlistsplitcommand.js +70 -70
- package/src/documentlist/documentlistutils.d.ts +46 -46
- package/src/documentlist/documentlistutils.js +50 -50
- package/src/documentlist/utils/listwalker.d.ts +145 -145
- package/src/documentlist/utils/listwalker.js +182 -182
- package/src/documentlist/utils/model.d.ts +202 -202
- package/src/documentlist/utils/model.js +455 -455
- package/src/documentlist/utils/postfixers.d.ts +37 -37
- package/src/documentlist/utils/postfixers.js +126 -126
- package/src/documentlist/utils/view.d.ts +81 -81
- package/src/documentlist/utils/view.js +117 -117
- package/src/documentlist.d.ts +26 -26
- package/src/documentlist.js +30 -30
- package/src/documentlistproperties/converters.d.ts +19 -19
- package/src/documentlistproperties/converters.js +43 -43
- package/src/documentlistproperties/documentlistpropertiesediting.d.ts +88 -88
- package/src/documentlistproperties/documentlistpropertiesediting.js +266 -266
- package/src/documentlistproperties/documentlistpropertiesutils.d.ts +33 -33
- package/src/documentlistproperties/documentlistpropertiesutils.js +44 -44
- package/src/documentlistproperties/documentlistreversedcommand.d.ts +36 -36
- package/src/documentlistproperties/documentlistreversedcommand.js +55 -55
- package/src/documentlistproperties/documentliststartcommand.d.ts +38 -38
- package/src/documentlistproperties/documentliststartcommand.js +57 -57
- package/src/documentlistproperties/documentliststylecommand.d.ts +72 -72
- package/src/documentlistproperties/documentliststylecommand.js +113 -113
- package/src/documentlistproperties/utils/style.d.ts +20 -20
- package/src/documentlistproperties/utils/style.js +54 -54
- package/src/documentlistproperties.d.ts +27 -27
- package/src/documentlistproperties.js +31 -31
- package/src/index.d.ts +43 -43
- package/src/index.js +29 -29
- package/src/list/converters.d.ts +196 -196
- package/src/list/converters.js +905 -905
- package/src/list/indentcommand.d.ts +37 -37
- package/src/list/indentcommand.js +107 -107
- package/src/list/listcommand.d.ts +55 -55
- package/src/list/listcommand.js +274 -274
- package/src/list/listediting.d.ts +32 -32
- package/src/list/listediting.js +161 -161
- package/src/list/listui.d.ts +19 -19
- package/src/list/listui.js +32 -32
- package/src/list/listutils.d.ts +41 -41
- package/src/list/listutils.js +46 -46
- package/src/list/utils.d.ts +112 -112
- package/src/list/utils.js +374 -374
- package/src/list.d.ts +26 -26
- package/src/list.js +30 -30
- package/src/listconfig.d.ts +132 -132
- package/src/listconfig.js +5 -5
- package/src/listproperties/listpropertiesediting.d.ts +72 -72
- package/src/listproperties/listpropertiesediting.js +696 -696
- package/src/listproperties/listpropertiesui.d.ts +23 -23
- package/src/listproperties/listpropertiesui.js +277 -277
- package/src/listproperties/listreversedcommand.d.ts +38 -38
- package/src/listproperties/listreversedcommand.js +52 -52
- package/src/listproperties/liststartcommand.d.ts +37 -37
- package/src/listproperties/liststartcommand.js +51 -51
- package/src/listproperties/liststylecommand.d.ts +67 -67
- package/src/listproperties/liststylecommand.js +99 -99
- package/src/listproperties/ui/listpropertiesview.d.ts +156 -157
- package/src/listproperties/ui/listpropertiesview.js +298 -299
- package/src/listproperties.d.ts +26 -26
- package/src/listproperties.js +30 -30
- package/src/liststyle.d.ts +28 -28
- package/src/liststyle.js +36 -36
- package/src/tododocumentlist/checktododocumentlistcommand.d.ts +49 -49
- package/src/tododocumentlist/checktododocumentlistcommand.js +82 -82
- package/src/tododocumentlist/todocheckboxchangeobserver.d.ts +41 -41
- package/src/tododocumentlist/todocheckboxchangeobserver.js +37 -37
- package/src/tododocumentlist/tododocumentlistediting.d.ts +38 -38
- package/src/tododocumentlist/tododocumentlistediting.js +399 -399
- package/src/tododocumentlist.d.ts +27 -27
- package/src/tododocumentlist.js +31 -31
- package/src/todolist/checktodolistcommand.d.ts +52 -52
- package/src/todolist/checktodolistcommand.js +76 -76
- package/src/todolist/todolistconverters.d.ts +82 -82
- package/src/todolist/todolistconverters.js +260 -260
- package/src/todolist/todolistediting.d.ts +39 -39
- package/src/todolist/todolistediting.js +161 -161
- package/src/todolist/todolistui.d.ts +19 -19
- package/src/todolist/todolistui.js +29 -29
- package/src/todolist.d.ts +27 -27
- package/src/todolist.js +31 -31
- package/build/list.js.map +0 -1
- package/src/listproperties/ui/collapsibleview.d.ts +0 -63
- package/src/listproperties/ui/collapsibleview.js +0 -89
- package/theme/collapsible.css +0 -10
|
@@ -1,113 +1,113 @@
|
|
|
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/documentlistproperties/documentliststylecommand
|
|
7
|
-
*/
|
|
8
|
-
import { Command } from 'ckeditor5/src/core';
|
|
9
|
-
import { first } from 'ckeditor5/src/utils';
|
|
10
|
-
import { expandListBlocksToCompleteList, isListItemBlock } from '../documentlist/utils/model';
|
|
11
|
-
import { getListTypeFromListStyleType } from './utils/style';
|
|
12
|
-
/**
|
|
13
|
-
* The list style command. It changes `listStyle` attribute of the selected list items,
|
|
14
|
-
* letting the user choose styles for the list item markers.
|
|
15
|
-
* It is used by the {@link module:list/documentlistproperties~DocumentListProperties list properties feature}.
|
|
16
|
-
*/
|
|
17
|
-
export default class DocumentListStyleCommand extends Command {
|
|
18
|
-
/**
|
|
19
|
-
* Creates an instance of the command.
|
|
20
|
-
*
|
|
21
|
-
* @param editor The editor instance.
|
|
22
|
-
* @param defaultType The list type that will be used by default if the value was not specified during
|
|
23
|
-
* the command execution.
|
|
24
|
-
* @param supportedTypes The list of supported style types by this command.
|
|
25
|
-
*/
|
|
26
|
-
constructor(editor, defaultType, supportedTypes) {
|
|
27
|
-
super(editor);
|
|
28
|
-
this.defaultType = defaultType;
|
|
29
|
-
this._supportedTypes = supportedTypes;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* @inheritDoc
|
|
33
|
-
*/
|
|
34
|
-
refresh() {
|
|
35
|
-
this.value = this._getValue();
|
|
36
|
-
this.isEnabled = this._checkEnabled();
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Executes the command.
|
|
40
|
-
*
|
|
41
|
-
* @fires execute
|
|
42
|
-
* @param options.type The type of the list style, e.g. `'disc'` or `'square'`. If `null` is specified, the default
|
|
43
|
-
* style will be applied.
|
|
44
|
-
*/
|
|
45
|
-
execute(options = {}) {
|
|
46
|
-
const model = this.editor.model;
|
|
47
|
-
const document = model.document;
|
|
48
|
-
model.change(writer => {
|
|
49
|
-
this._tryToConvertItemsToList(options);
|
|
50
|
-
let blocks = Array.from(document.selection.getSelectedBlocks())
|
|
51
|
-
.filter(block => block.hasAttribute('listType'));
|
|
52
|
-
if (!blocks.length) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
blocks = expandListBlocksToCompleteList(blocks);
|
|
56
|
-
for (const block of blocks) {
|
|
57
|
-
writer.setAttribute('listStyle', options.type || this.defaultType, block);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Checks if the given style type is supported by this plugin.
|
|
63
|
-
*/
|
|
64
|
-
isStyleTypeSupported(value) {
|
|
65
|
-
if (!this._supportedTypes) {
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
return this._supportedTypes.includes(value);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Checks the command's {@link #value}.
|
|
72
|
-
*
|
|
73
|
-
* @returns The current value.
|
|
74
|
-
*/
|
|
75
|
-
_getValue() {
|
|
76
|
-
const listItem = first(this.editor.model.document.selection.getSelectedBlocks());
|
|
77
|
-
if (isListItemBlock(listItem)) {
|
|
78
|
-
return listItem.getAttribute('listStyle');
|
|
79
|
-
}
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Checks whether the command can be enabled in the current context.
|
|
84
|
-
*
|
|
85
|
-
* @returns Whether the command should be enabled.
|
|
86
|
-
*/
|
|
87
|
-
_checkEnabled() {
|
|
88
|
-
const editor = this.editor;
|
|
89
|
-
const numberedList = editor.commands.get('numberedList');
|
|
90
|
-
const bulletedList = editor.commands.get('bulletedList');
|
|
91
|
-
return numberedList.isEnabled || bulletedList.isEnabled;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Check if the provided list style is valid. Also change the selection to a list if it's not set yet.
|
|
95
|
-
*
|
|
96
|
-
* @param options.type The type of the list style. If `null` is specified, the function does nothing.
|
|
97
|
-
*/
|
|
98
|
-
_tryToConvertItemsToList(options) {
|
|
99
|
-
if (!options.type) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const listType = getListTypeFromListStyleType(options.type);
|
|
103
|
-
if (!listType) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const editor = this.editor;
|
|
107
|
-
const commandName = `${listType}List`;
|
|
108
|
-
const command = editor.commands.get(commandName);
|
|
109
|
-
if (!command.value) {
|
|
110
|
-
editor.execute(commandName);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
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/documentlistproperties/documentliststylecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core';
|
|
9
|
+
import { first } from 'ckeditor5/src/utils';
|
|
10
|
+
import { expandListBlocksToCompleteList, isListItemBlock } from '../documentlist/utils/model';
|
|
11
|
+
import { getListTypeFromListStyleType } from './utils/style';
|
|
12
|
+
/**
|
|
13
|
+
* The list style command. It changes `listStyle` attribute of the selected list items,
|
|
14
|
+
* letting the user choose styles for the list item markers.
|
|
15
|
+
* It is used by the {@link module:list/documentlistproperties~DocumentListProperties list properties feature}.
|
|
16
|
+
*/
|
|
17
|
+
export default class DocumentListStyleCommand extends Command {
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of the command.
|
|
20
|
+
*
|
|
21
|
+
* @param editor The editor instance.
|
|
22
|
+
* @param defaultType The list type that will be used by default if the value was not specified during
|
|
23
|
+
* the command execution.
|
|
24
|
+
* @param supportedTypes The list of supported style types by this command.
|
|
25
|
+
*/
|
|
26
|
+
constructor(editor, defaultType, supportedTypes) {
|
|
27
|
+
super(editor);
|
|
28
|
+
this.defaultType = defaultType;
|
|
29
|
+
this._supportedTypes = supportedTypes;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
refresh() {
|
|
35
|
+
this.value = this._getValue();
|
|
36
|
+
this.isEnabled = this._checkEnabled();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Executes the command.
|
|
40
|
+
*
|
|
41
|
+
* @fires execute
|
|
42
|
+
* @param options.type The type of the list style, e.g. `'disc'` or `'square'`. If `null` is specified, the default
|
|
43
|
+
* style will be applied.
|
|
44
|
+
*/
|
|
45
|
+
execute(options = {}) {
|
|
46
|
+
const model = this.editor.model;
|
|
47
|
+
const document = model.document;
|
|
48
|
+
model.change(writer => {
|
|
49
|
+
this._tryToConvertItemsToList(options);
|
|
50
|
+
let blocks = Array.from(document.selection.getSelectedBlocks())
|
|
51
|
+
.filter(block => block.hasAttribute('listType'));
|
|
52
|
+
if (!blocks.length) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
blocks = expandListBlocksToCompleteList(blocks);
|
|
56
|
+
for (const block of blocks) {
|
|
57
|
+
writer.setAttribute('listStyle', options.type || this.defaultType, block);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Checks if the given style type is supported by this plugin.
|
|
63
|
+
*/
|
|
64
|
+
isStyleTypeSupported(value) {
|
|
65
|
+
if (!this._supportedTypes) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
return this._supportedTypes.includes(value);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Checks the command's {@link #value}.
|
|
72
|
+
*
|
|
73
|
+
* @returns The current value.
|
|
74
|
+
*/
|
|
75
|
+
_getValue() {
|
|
76
|
+
const listItem = first(this.editor.model.document.selection.getSelectedBlocks());
|
|
77
|
+
if (isListItemBlock(listItem)) {
|
|
78
|
+
return listItem.getAttribute('listStyle');
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Checks whether the command can be enabled in the current context.
|
|
84
|
+
*
|
|
85
|
+
* @returns Whether the command should be enabled.
|
|
86
|
+
*/
|
|
87
|
+
_checkEnabled() {
|
|
88
|
+
const editor = this.editor;
|
|
89
|
+
const numberedList = editor.commands.get('numberedList');
|
|
90
|
+
const bulletedList = editor.commands.get('bulletedList');
|
|
91
|
+
return numberedList.isEnabled || bulletedList.isEnabled;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Check if the provided list style is valid. Also change the selection to a list if it's not set yet.
|
|
95
|
+
*
|
|
96
|
+
* @param options.type The type of the list style. If `null` is specified, the function does nothing.
|
|
97
|
+
*/
|
|
98
|
+
_tryToConvertItemsToList(options) {
|
|
99
|
+
if (!options.type) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const listType = getListTypeFromListStyleType(options.type);
|
|
103
|
+
if (!listType) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const editor = this.editor;
|
|
107
|
+
const commandName = `${listType}List`;
|
|
108
|
+
const command = editor.commands.get(commandName);
|
|
109
|
+
if (!command.value) {
|
|
110
|
+
editor.execute(commandName);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
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
|
-
* Gets all the style types supported by given list type.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getAllSupportedStyleTypes(): Array<string>;
|
|
9
|
-
/**
|
|
10
|
-
* Checks whether the given list-style-type is supported by numbered or bulleted list.
|
|
11
|
-
*/
|
|
12
|
-
export declare function getListTypeFromListStyleType(listStyleType: string): 'bulleted' | 'numbered' | null;
|
|
13
|
-
/**
|
|
14
|
-
* Converts `type` attribute of `<ul>` or `<ol>` elements to `list-style-type` equivalent.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getListStyleTypeFromTypeAttribute(value: string): string | null;
|
|
17
|
-
/**
|
|
18
|
-
* Converts `list-style-type` style to `type` attribute of `<ul>` or `<ol>` elements.
|
|
19
|
-
*/
|
|
20
|
-
export declare function getTypeAttributeFromListStyleType(value: string): string | null;
|
|
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
|
+
* Gets all the style types supported by given list type.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAllSupportedStyleTypes(): Array<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Checks whether the given list-style-type is supported by numbered or bulleted list.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getListTypeFromListStyleType(listStyleType: string): 'bulleted' | 'numbered' | null;
|
|
13
|
+
/**
|
|
14
|
+
* Converts `type` attribute of `<ul>` or `<ol>` elements to `list-style-type` equivalent.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getListStyleTypeFromTypeAttribute(value: string): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Converts `list-style-type` style to `type` attribute of `<ul>` or `<ol>` elements.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getTypeAttributeFromListStyleType(value: string): string | null;
|
|
@@ -1,54 +1,54 @@
|
|
|
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/documentlistproperties/utils/style
|
|
7
|
-
*/
|
|
8
|
-
const LIST_STYLE_TO_LIST_TYPE = {};
|
|
9
|
-
const LIST_STYLE_TO_TYPE_ATTRIBUTE = {};
|
|
10
|
-
const TYPE_ATTRIBUTE_TO_LIST_STYLE = {};
|
|
11
|
-
const LIST_STYLE_TYPES = [
|
|
12
|
-
{ listStyle: 'disc', typeAttribute: 'disc', listType: 'bulleted' },
|
|
13
|
-
{ listStyle: 'circle', typeAttribute: 'circle', listType: 'bulleted' },
|
|
14
|
-
{ listStyle: 'square', typeAttribute: 'square', listType: 'bulleted' },
|
|
15
|
-
{ listStyle: 'decimal', typeAttribute: '1', listType: 'numbered' },
|
|
16
|
-
{ listStyle: 'decimal-leading-zero', typeAttribute: null, listType: 'numbered' },
|
|
17
|
-
{ listStyle: 'lower-roman', typeAttribute: 'i', listType: 'numbered' },
|
|
18
|
-
{ listStyle: 'upper-roman', typeAttribute: 'I', listType: 'numbered' },
|
|
19
|
-
{ listStyle: 'lower-alpha', typeAttribute: 'a', listType: 'numbered' },
|
|
20
|
-
{ listStyle: 'upper-alpha', typeAttribute: 'A', listType: 'numbered' },
|
|
21
|
-
{ listStyle: 'lower-latin', typeAttribute: 'a', listType: 'numbered' },
|
|
22
|
-
{ listStyle: 'upper-latin', typeAttribute: 'A', listType: 'numbered' }
|
|
23
|
-
];
|
|
24
|
-
for (const { listStyle, typeAttribute, listType } of LIST_STYLE_TYPES) {
|
|
25
|
-
LIST_STYLE_TO_LIST_TYPE[listStyle] = listType;
|
|
26
|
-
LIST_STYLE_TO_TYPE_ATTRIBUTE[listStyle] = typeAttribute;
|
|
27
|
-
if (typeAttribute) {
|
|
28
|
-
TYPE_ATTRIBUTE_TO_LIST_STYLE[typeAttribute] = listStyle;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Gets all the style types supported by given list type.
|
|
33
|
-
*/
|
|
34
|
-
export function getAllSupportedStyleTypes() {
|
|
35
|
-
return LIST_STYLE_TYPES.map(x => x.listStyle);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Checks whether the given list-style-type is supported by numbered or bulleted list.
|
|
39
|
-
*/
|
|
40
|
-
export function getListTypeFromListStyleType(listStyleType) {
|
|
41
|
-
return LIST_STYLE_TO_LIST_TYPE[listStyleType] || null;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Converts `type` attribute of `<ul>` or `<ol>` elements to `list-style-type` equivalent.
|
|
45
|
-
*/
|
|
46
|
-
export function getListStyleTypeFromTypeAttribute(value) {
|
|
47
|
-
return TYPE_ATTRIBUTE_TO_LIST_STYLE[value] || null;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Converts `list-style-type` style to `type` attribute of `<ul>` or `<ol>` elements.
|
|
51
|
-
*/
|
|
52
|
-
export function getTypeAttributeFromListStyleType(value) {
|
|
53
|
-
return LIST_STYLE_TO_TYPE_ATTRIBUTE[value] || null;
|
|
54
|
-
}
|
|
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/documentlistproperties/utils/style
|
|
7
|
+
*/
|
|
8
|
+
const LIST_STYLE_TO_LIST_TYPE = {};
|
|
9
|
+
const LIST_STYLE_TO_TYPE_ATTRIBUTE = {};
|
|
10
|
+
const TYPE_ATTRIBUTE_TO_LIST_STYLE = {};
|
|
11
|
+
const LIST_STYLE_TYPES = [
|
|
12
|
+
{ listStyle: 'disc', typeAttribute: 'disc', listType: 'bulleted' },
|
|
13
|
+
{ listStyle: 'circle', typeAttribute: 'circle', listType: 'bulleted' },
|
|
14
|
+
{ listStyle: 'square', typeAttribute: 'square', listType: 'bulleted' },
|
|
15
|
+
{ listStyle: 'decimal', typeAttribute: '1', listType: 'numbered' },
|
|
16
|
+
{ listStyle: 'decimal-leading-zero', typeAttribute: null, listType: 'numbered' },
|
|
17
|
+
{ listStyle: 'lower-roman', typeAttribute: 'i', listType: 'numbered' },
|
|
18
|
+
{ listStyle: 'upper-roman', typeAttribute: 'I', listType: 'numbered' },
|
|
19
|
+
{ listStyle: 'lower-alpha', typeAttribute: 'a', listType: 'numbered' },
|
|
20
|
+
{ listStyle: 'upper-alpha', typeAttribute: 'A', listType: 'numbered' },
|
|
21
|
+
{ listStyle: 'lower-latin', typeAttribute: 'a', listType: 'numbered' },
|
|
22
|
+
{ listStyle: 'upper-latin', typeAttribute: 'A', listType: 'numbered' }
|
|
23
|
+
];
|
|
24
|
+
for (const { listStyle, typeAttribute, listType } of LIST_STYLE_TYPES) {
|
|
25
|
+
LIST_STYLE_TO_LIST_TYPE[listStyle] = listType;
|
|
26
|
+
LIST_STYLE_TO_TYPE_ATTRIBUTE[listStyle] = typeAttribute;
|
|
27
|
+
if (typeAttribute) {
|
|
28
|
+
TYPE_ATTRIBUTE_TO_LIST_STYLE[typeAttribute] = listStyle;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Gets all the style types supported by given list type.
|
|
33
|
+
*/
|
|
34
|
+
export function getAllSupportedStyleTypes() {
|
|
35
|
+
return LIST_STYLE_TYPES.map(x => x.listStyle);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Checks whether the given list-style-type is supported by numbered or bulleted list.
|
|
39
|
+
*/
|
|
40
|
+
export function getListTypeFromListStyleType(listStyleType) {
|
|
41
|
+
return LIST_STYLE_TO_LIST_TYPE[listStyleType] || null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Converts `type` attribute of `<ul>` or `<ol>` elements to `list-style-type` equivalent.
|
|
45
|
+
*/
|
|
46
|
+
export function getListStyleTypeFromTypeAttribute(value) {
|
|
47
|
+
return TYPE_ATTRIBUTE_TO_LIST_STYLE[value] || null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Converts `list-style-type` style to `type` attribute of `<ul>` or `<ol>` elements.
|
|
51
|
+
*/
|
|
52
|
+
export function getTypeAttributeFromListStyleType(value) {
|
|
53
|
+
return LIST_STYLE_TO_TYPE_ATTRIBUTE[value] || null;
|
|
54
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
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/documentlistproperties
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import DocumentListPropertiesEditing from './documentlistproperties/documentlistpropertiesediting';
|
|
10
|
-
import ListPropertiesUI from './listproperties/listpropertiesui';
|
|
11
|
-
/**
|
|
12
|
-
* The document list properties feature.
|
|
13
|
-
*
|
|
14
|
-
* This is a "glue" plugin that loads the
|
|
15
|
-
* {@link module:list/documentlistproperties/documentlistpropertiesediting~DocumentListPropertiesEditing document list properties
|
|
16
|
-
* editing feature} and the {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
|
|
17
|
-
*/
|
|
18
|
-
export default class DocumentListProperties extends Plugin {
|
|
19
|
-
/**
|
|
20
|
-
* @inheritDoc
|
|
21
|
-
*/
|
|
22
|
-
static get requires(): readonly [typeof DocumentListPropertiesEditing, typeof ListPropertiesUI];
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
static get pluginName(): "DocumentListProperties";
|
|
27
|
-
}
|
|
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/documentlistproperties
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import DocumentListPropertiesEditing from './documentlistproperties/documentlistpropertiesediting';
|
|
10
|
+
import ListPropertiesUI from './listproperties/listpropertiesui';
|
|
11
|
+
/**
|
|
12
|
+
* The document list properties feature.
|
|
13
|
+
*
|
|
14
|
+
* This is a "glue" plugin that loads the
|
|
15
|
+
* {@link module:list/documentlistproperties/documentlistpropertiesediting~DocumentListPropertiesEditing document list properties
|
|
16
|
+
* editing feature} and the {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
|
|
17
|
+
*/
|
|
18
|
+
export default class DocumentListProperties extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get requires(): readonly [typeof DocumentListPropertiesEditing, typeof ListPropertiesUI];
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get pluginName(): "DocumentListProperties";
|
|
27
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
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/documentlistproperties
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import DocumentListPropertiesEditing from './documentlistproperties/documentlistpropertiesediting';
|
|
10
|
-
import ListPropertiesUI from './listproperties/listpropertiesui';
|
|
11
|
-
/**
|
|
12
|
-
* The document list properties feature.
|
|
13
|
-
*
|
|
14
|
-
* This is a "glue" plugin that loads the
|
|
15
|
-
* {@link module:list/documentlistproperties/documentlistpropertiesediting~DocumentListPropertiesEditing document list properties
|
|
16
|
-
* editing feature} and the {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
|
|
17
|
-
*/
|
|
18
|
-
export default class DocumentListProperties extends Plugin {
|
|
19
|
-
/**
|
|
20
|
-
* @inheritDoc
|
|
21
|
-
*/
|
|
22
|
-
static get requires() {
|
|
23
|
-
return [DocumentListPropertiesEditing, ListPropertiesUI];
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @inheritDoc
|
|
27
|
-
*/
|
|
28
|
-
static get pluginName() {
|
|
29
|
-
return 'DocumentListProperties';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
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/documentlistproperties
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import DocumentListPropertiesEditing from './documentlistproperties/documentlistpropertiesediting';
|
|
10
|
+
import ListPropertiesUI from './listproperties/listpropertiesui';
|
|
11
|
+
/**
|
|
12
|
+
* The document list properties feature.
|
|
13
|
+
*
|
|
14
|
+
* This is a "glue" plugin that loads the
|
|
15
|
+
* {@link module:list/documentlistproperties/documentlistpropertiesediting~DocumentListPropertiesEditing document list properties
|
|
16
|
+
* editing feature} and the {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.
|
|
17
|
+
*/
|
|
18
|
+
export default class DocumentListProperties extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get requires() {
|
|
23
|
+
return [DocumentListPropertiesEditing, ListPropertiesUI];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName() {
|
|
29
|
+
return 'DocumentListProperties';
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
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
|
|
7
|
-
*/
|
|
8
|
-
export { default as DocumentList } from './documentlist';
|
|
9
|
-
export { default as DocumentListEditing, type DocumentListEditingPostFixerEvent } from './documentlist/documentlistediting';
|
|
10
|
-
export { default as DocumentListIndentCommand } from './documentlist/documentlistindentcommand';
|
|
11
|
-
export { default as AdjacentListsSupport } from './documentlist/adjacentlistssupport';
|
|
12
|
-
export { default as DocumentListProperties } from './documentlistproperties';
|
|
13
|
-
export { default as DocumentListPropertiesEditing } from './documentlistproperties/documentlistpropertiesediting';
|
|
14
|
-
export { default as DocumentListUtils } from './documentlist/documentlistutils';
|
|
15
|
-
export { default as DocumentListPropertiesUtils } from './documentlistproperties/documentlistpropertiesutils';
|
|
16
|
-
export { default as IndentCommand } from './list/indentcommand';
|
|
17
|
-
export { default as List } from './list';
|
|
18
|
-
export { default as ListEditing } from './list/listediting';
|
|
19
|
-
export { default as ListUI } from './list/listui';
|
|
20
|
-
export { default as ListProperties } from './listproperties';
|
|
21
|
-
export { default as ListUtils } from './list/listutils';
|
|
22
|
-
export { default as ListPropertiesEditing } from './listproperties/listpropertiesediting';
|
|
23
|
-
export { default as ListPropertiesUI } from './listproperties/listpropertiesui';
|
|
24
|
-
export { default as TodoList } from './todolist';
|
|
25
|
-
export { default as TodoListEditing } from './todolist/todolistediting';
|
|
26
|
-
export { default as TodoListUI } from './todolist/todolistui';
|
|
27
|
-
export { default as TodoDocumentList } from './tododocumentlist';
|
|
28
|
-
export { default as TodoDocumentListEditing } from './tododocumentlist/tododocumentlistediting';
|
|
29
|
-
export type { ListConfig, ListPropertiesConfig } from './listconfig';
|
|
30
|
-
export type { default as ListStyle } from './liststyle';
|
|
31
|
-
export type { default as DocumentListCommand } from './documentlist/documentlistcommand';
|
|
32
|
-
export type { default as DocumentListMergeCommand } from './documentlist/documentlistmergecommand';
|
|
33
|
-
export type { default as DocumentListSplitCommand } from './documentlist/documentlistsplitcommand';
|
|
34
|
-
export type { default as DocumentListReversedCommand } from './documentlistproperties/documentlistreversedcommand';
|
|
35
|
-
export type { default as DocumentListStartCommand } from './documentlistproperties/documentliststartcommand';
|
|
36
|
-
export type { default as DocumentListStyleCommand } from './documentlistproperties/documentliststylecommand';
|
|
37
|
-
export type { default as ListCommand } from './list/listcommand';
|
|
38
|
-
export type { default as ListReversedCommand } from './listproperties/listreversedcommand';
|
|
39
|
-
export type { default as ListStartCommand } from './listproperties/liststartcommand';
|
|
40
|
-
export type { default as ListStyleCommand } from './listproperties/liststylecommand';
|
|
41
|
-
export type { default as CheckTodoListCommand } from './todolist/checktodolistcommand';
|
|
42
|
-
export type { default as CheckTodoDocumentListCommand } from './tododocumentlist/checktododocumentlistcommand';
|
|
43
|
-
import './augmentation';
|
|
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
|
|
7
|
+
*/
|
|
8
|
+
export { default as DocumentList } from './documentlist';
|
|
9
|
+
export { default as DocumentListEditing, type DocumentListEditingPostFixerEvent } from './documentlist/documentlistediting';
|
|
10
|
+
export { default as DocumentListIndentCommand } from './documentlist/documentlistindentcommand';
|
|
11
|
+
export { default as AdjacentListsSupport } from './documentlist/adjacentlistssupport';
|
|
12
|
+
export { default as DocumentListProperties } from './documentlistproperties';
|
|
13
|
+
export { default as DocumentListPropertiesEditing } from './documentlistproperties/documentlistpropertiesediting';
|
|
14
|
+
export { default as DocumentListUtils } from './documentlist/documentlistutils';
|
|
15
|
+
export { default as DocumentListPropertiesUtils } from './documentlistproperties/documentlistpropertiesutils';
|
|
16
|
+
export { default as IndentCommand } from './list/indentcommand';
|
|
17
|
+
export { default as List } from './list';
|
|
18
|
+
export { default as ListEditing } from './list/listediting';
|
|
19
|
+
export { default as ListUI } from './list/listui';
|
|
20
|
+
export { default as ListProperties } from './listproperties';
|
|
21
|
+
export { default as ListUtils } from './list/listutils';
|
|
22
|
+
export { default as ListPropertiesEditing } from './listproperties/listpropertiesediting';
|
|
23
|
+
export { default as ListPropertiesUI } from './listproperties/listpropertiesui';
|
|
24
|
+
export { default as TodoList } from './todolist';
|
|
25
|
+
export { default as TodoListEditing } from './todolist/todolistediting';
|
|
26
|
+
export { default as TodoListUI } from './todolist/todolistui';
|
|
27
|
+
export { default as TodoDocumentList } from './tododocumentlist';
|
|
28
|
+
export { default as TodoDocumentListEditing } from './tododocumentlist/tododocumentlistediting';
|
|
29
|
+
export type { ListConfig, ListPropertiesConfig } from './listconfig';
|
|
30
|
+
export type { default as ListStyle } from './liststyle';
|
|
31
|
+
export type { default as DocumentListCommand } from './documentlist/documentlistcommand';
|
|
32
|
+
export type { default as DocumentListMergeCommand } from './documentlist/documentlistmergecommand';
|
|
33
|
+
export type { default as DocumentListSplitCommand } from './documentlist/documentlistsplitcommand';
|
|
34
|
+
export type { default as DocumentListReversedCommand } from './documentlistproperties/documentlistreversedcommand';
|
|
35
|
+
export type { default as DocumentListStartCommand } from './documentlistproperties/documentliststartcommand';
|
|
36
|
+
export type { default as DocumentListStyleCommand } from './documentlistproperties/documentliststylecommand';
|
|
37
|
+
export type { default as ListCommand } from './list/listcommand';
|
|
38
|
+
export type { default as ListReversedCommand } from './listproperties/listreversedcommand';
|
|
39
|
+
export type { default as ListStartCommand } from './listproperties/liststartcommand';
|
|
40
|
+
export type { default as ListStyleCommand } from './listproperties/liststylecommand';
|
|
41
|
+
export type { default as CheckTodoListCommand } from './todolist/checktodolistcommand';
|
|
42
|
+
export type { default as CheckTodoDocumentListCommand } from './tododocumentlist/checktododocumentlistcommand';
|
|
43
|
+
import './augmentation';
|
package/src/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
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
|
|
7
|
-
*/
|
|
8
|
-
export { default as DocumentList } from './documentlist';
|
|
9
|
-
export { default as DocumentListEditing } from './documentlist/documentlistediting';
|
|
10
|
-
export { default as DocumentListIndentCommand } from './documentlist/documentlistindentcommand';
|
|
11
|
-
export { default as AdjacentListsSupport } from './documentlist/adjacentlistssupport';
|
|
12
|
-
export { default as DocumentListProperties } from './documentlistproperties';
|
|
13
|
-
export { default as DocumentListPropertiesEditing } from './documentlistproperties/documentlistpropertiesediting';
|
|
14
|
-
export { default as DocumentListUtils } from './documentlist/documentlistutils';
|
|
15
|
-
export { default as DocumentListPropertiesUtils } from './documentlistproperties/documentlistpropertiesutils';
|
|
16
|
-
export { default as IndentCommand } from './list/indentcommand';
|
|
17
|
-
export { default as List } from './list';
|
|
18
|
-
export { default as ListEditing } from './list/listediting';
|
|
19
|
-
export { default as ListUI } from './list/listui';
|
|
20
|
-
export { default as ListProperties } from './listproperties';
|
|
21
|
-
export { default as ListUtils } from './list/listutils';
|
|
22
|
-
export { default as ListPropertiesEditing } from './listproperties/listpropertiesediting';
|
|
23
|
-
export { default as ListPropertiesUI } from './listproperties/listpropertiesui';
|
|
24
|
-
export { default as TodoList } from './todolist';
|
|
25
|
-
export { default as TodoListEditing } from './todolist/todolistediting';
|
|
26
|
-
export { default as TodoListUI } from './todolist/todolistui';
|
|
27
|
-
export { default as TodoDocumentList } from './tododocumentlist';
|
|
28
|
-
export { default as TodoDocumentListEditing } from './tododocumentlist/tododocumentlistediting';
|
|
29
|
-
import './augmentation';
|
|
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
|
|
7
|
+
*/
|
|
8
|
+
export { default as DocumentList } from './documentlist';
|
|
9
|
+
export { default as DocumentListEditing } from './documentlist/documentlistediting';
|
|
10
|
+
export { default as DocumentListIndentCommand } from './documentlist/documentlistindentcommand';
|
|
11
|
+
export { default as AdjacentListsSupport } from './documentlist/adjacentlistssupport';
|
|
12
|
+
export { default as DocumentListProperties } from './documentlistproperties';
|
|
13
|
+
export { default as DocumentListPropertiesEditing } from './documentlistproperties/documentlistpropertiesediting';
|
|
14
|
+
export { default as DocumentListUtils } from './documentlist/documentlistutils';
|
|
15
|
+
export { default as DocumentListPropertiesUtils } from './documentlistproperties/documentlistpropertiesutils';
|
|
16
|
+
export { default as IndentCommand } from './list/indentcommand';
|
|
17
|
+
export { default as List } from './list';
|
|
18
|
+
export { default as ListEditing } from './list/listediting';
|
|
19
|
+
export { default as ListUI } from './list/listui';
|
|
20
|
+
export { default as ListProperties } from './listproperties';
|
|
21
|
+
export { default as ListUtils } from './list/listutils';
|
|
22
|
+
export { default as ListPropertiesEditing } from './listproperties/listpropertiesediting';
|
|
23
|
+
export { default as ListPropertiesUI } from './listproperties/listpropertiesui';
|
|
24
|
+
export { default as TodoList } from './todolist';
|
|
25
|
+
export { default as TodoListEditing } from './todolist/todolistediting';
|
|
26
|
+
export { default as TodoListUI } from './todolist/todolistui';
|
|
27
|
+
export { default as TodoDocumentList } from './tododocumentlist';
|
|
28
|
+
export { default as TodoDocumentListEditing } from './tododocumentlist/tododocumentlistediting';
|
|
29
|
+
import './augmentation';
|