@ckeditor/ckeditor5-list 39.0.2 → 40.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/list.js +1 -1
- package/build/list.js.map +1 -0
- package/build/translations/fi.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/ckeditor5-metadata.json +44 -0
- package/lang/translations/fi.po +1 -1
- package/lang/translations/pt-br.po +10 -10
- package/package.json +3 -3
- package/src/augmentation.d.ts +52 -50
- 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 -63
- package/src/documentlist/converters.js +441 -354
- package/src/documentlist/documentlistcommand.d.ts +80 -80
- package/src/documentlist/documentlistcommand.js +150 -145
- package/src/documentlist/documentlistediting.d.ts +212 -154
- package/src/documentlist/documentlistediting.js +645 -565
- 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 -141
- package/src/documentlist/utils/listwalker.js +182 -162
- package/src/documentlist/utils/model.d.ts +202 -193
- package/src/documentlist/utils/model.js +455 -435
- package/src/documentlist/utils/postfixers.d.ts +37 -37
- package/src/documentlist/utils/postfixers.js +126 -118
- 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 -289
- 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 -40
- package/src/index.js +29 -27
- 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 -122
- 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/collapsibleview.d.ts +63 -63
- package/src/listproperties/ui/collapsibleview.js +89 -89
- package/src/listproperties/ui/listpropertiesview.d.ts +157 -157
- package/src/listproperties/ui/listpropertiesview.js +299 -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 -0
- package/src/tododocumentlist/checktododocumentlistcommand.js +82 -0
- package/src/tododocumentlist/todocheckboxchangeobserver.d.ts +41 -0
- package/src/tododocumentlist/todocheckboxchangeobserver.js +37 -0
- package/src/tododocumentlist/tododocumentlistediting.d.ts +38 -0
- package/src/tododocumentlist/tododocumentlistediting.js +399 -0
- package/src/tododocumentlist.d.ts +27 -0
- package/src/tododocumentlist.js +31 -0
- 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/theme/todolist.css +101 -70
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module list/listproperties/ui/listpropertiesview
|
|
7
|
-
*/
|
|
8
|
-
import { View, ViewCollection, FocusCycler, SwitchButtonView, LabeledFieldView, type ButtonView, type InputNumberView } from 'ckeditor5/src/ui';
|
|
9
|
-
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
|
|
10
|
-
import CollapsibleView from './collapsibleview';
|
|
11
|
-
import type { ListPropertiesConfig } from '../../listconfig';
|
|
12
|
-
import '../../../theme/listproperties.css';
|
|
13
|
-
/**
|
|
14
|
-
* The list properties view to be displayed in the list dropdown.
|
|
15
|
-
*
|
|
16
|
-
* Contains a grid of available list styles and, for numbered list, also the list start index and reversed fields.
|
|
17
|
-
*
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export default class ListPropertiesView extends View {
|
|
21
|
-
/**
|
|
22
|
-
* @inheritDoc
|
|
23
|
-
*/
|
|
24
|
-
locale: Locale;
|
|
25
|
-
/**
|
|
26
|
-
* A collection of the child views.
|
|
27
|
-
*/
|
|
28
|
-
readonly children: ViewCollection;
|
|
29
|
-
/**
|
|
30
|
-
* A view that renders the grid of list styles.
|
|
31
|
-
*/
|
|
32
|
-
readonly stylesView: StylesView | null;
|
|
33
|
-
/**
|
|
34
|
-
* A collapsible view that hosts additional list property fields ({@link #startIndexFieldView} and
|
|
35
|
-
* {@link #reversedSwitchButtonView}) to visually separate them from the {@link #stylesView grid of styles}.
|
|
36
|
-
*
|
|
37
|
-
* **Note**: Only present when:
|
|
38
|
-
* * the view represents **numbered** list properties,
|
|
39
|
-
* * and the {@link #stylesView} is rendered,
|
|
40
|
-
* * and either {@link #startIndexFieldView} or {@link #reversedSwitchButtonView} is rendered.
|
|
41
|
-
*
|
|
42
|
-
* @readonly
|
|
43
|
-
*/
|
|
44
|
-
additionalPropertiesCollapsibleView: CollapsibleView | null;
|
|
45
|
-
/**
|
|
46
|
-
* A labeled number field allowing the user to set the start index of the list.
|
|
47
|
-
*
|
|
48
|
-
* **Note**: Only present when the view represents **numbered** list properties.
|
|
49
|
-
*
|
|
50
|
-
* @readonly
|
|
51
|
-
*/
|
|
52
|
-
startIndexFieldView: LabeledFieldView<InputNumberView> | null;
|
|
53
|
-
/**
|
|
54
|
-
* A switch button allowing the user to make the edited list reversed.
|
|
55
|
-
*
|
|
56
|
-
* **Note**: Only present when the view represents **numbered** list properties.
|
|
57
|
-
*
|
|
58
|
-
* @readonly
|
|
59
|
-
*/
|
|
60
|
-
reversedSwitchButtonView: SwitchButtonView | null;
|
|
61
|
-
/**
|
|
62
|
-
* Tracks information about the DOM focus in the view.
|
|
63
|
-
*/
|
|
64
|
-
readonly focusTracker: FocusTracker;
|
|
65
|
-
/**
|
|
66
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
67
|
-
*/
|
|
68
|
-
readonly keystrokes: KeystrokeHandler;
|
|
69
|
-
/**
|
|
70
|
-
* A collection of views that can be focused in the properties view.
|
|
71
|
-
*/
|
|
72
|
-
readonly focusables: ViewCollection;
|
|
73
|
-
/**
|
|
74
|
-
* Helps cycling over {@link #focusables} in the view.
|
|
75
|
-
*/
|
|
76
|
-
readonly focusCycler: FocusCycler;
|
|
77
|
-
/**
|
|
78
|
-
* Creates an instance of the list properties view.
|
|
79
|
-
*
|
|
80
|
-
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
81
|
-
* @param options Options of the view.
|
|
82
|
-
* @param options.enabledProperties An object containing the configuration of enabled list property names.
|
|
83
|
-
* Allows conditional rendering the sub-components of the properties view.
|
|
84
|
-
* @param options.styleButtonViews A list of style buttons to be rendered
|
|
85
|
-
* inside the styles grid. The grid will not be rendered when `enabledProperties` does not include the `'styles'` key.
|
|
86
|
-
* @param options.styleGridAriaLabel An assistive technologies label set on the grid of styles (if the grid is rendered).
|
|
87
|
-
*/
|
|
88
|
-
constructor(locale: Locale, { enabledProperties, styleButtonViews, styleGridAriaLabel }: {
|
|
89
|
-
enabledProperties: ListPropertiesConfig;
|
|
90
|
-
styleButtonViews: Array<ButtonView> | null;
|
|
91
|
-
styleGridAriaLabel: string;
|
|
92
|
-
});
|
|
93
|
-
/**
|
|
94
|
-
* @inheritDoc
|
|
95
|
-
*/
|
|
96
|
-
render(): void;
|
|
97
|
-
/**
|
|
98
|
-
* @inheritDoc
|
|
99
|
-
*/
|
|
100
|
-
focus(): void;
|
|
101
|
-
/**
|
|
102
|
-
* @inheritDoc
|
|
103
|
-
*/
|
|
104
|
-
focusLast(): void;
|
|
105
|
-
/**
|
|
106
|
-
* @inheritDoc
|
|
107
|
-
*/
|
|
108
|
-
destroy(): void;
|
|
109
|
-
/**
|
|
110
|
-
* Creates the list styles grid.
|
|
111
|
-
*
|
|
112
|
-
* @param styleButtons Buttons to be placed in the grid.
|
|
113
|
-
* @param styleGridAriaLabel The assistive technology label of the grid.
|
|
114
|
-
*/
|
|
115
|
-
private _createStylesView;
|
|
116
|
-
/**
|
|
117
|
-
* Renders {@link #startIndexFieldView} and/or {@link #reversedSwitchButtonView} depending on the configuration of the properties view.
|
|
118
|
-
*
|
|
119
|
-
* @param enabledProperties An object containing the configuration of enabled list property names
|
|
120
|
-
* (see {@link #constructor}).
|
|
121
|
-
*/
|
|
122
|
-
private _addNumberedListPropertyViews;
|
|
123
|
-
/**
|
|
124
|
-
* Creates the list start index labeled field.
|
|
125
|
-
*/
|
|
126
|
-
private _createStartIndexField;
|
|
127
|
-
/**
|
|
128
|
-
* Creates the reversed list switch button.
|
|
129
|
-
*/
|
|
130
|
-
private _createReversedSwitchButton;
|
|
131
|
-
}
|
|
132
|
-
export type StylesView = View & {
|
|
133
|
-
children: ViewCollection;
|
|
134
|
-
focusTracker: FocusTracker;
|
|
135
|
-
keystrokes: KeystrokeHandler;
|
|
136
|
-
focus(): void;
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Fired when the list start index value has changed via {@link ~ListPropertiesView#startIndexFieldView}.
|
|
140
|
-
*
|
|
141
|
-
* @eventName ~ListPropertiesView#listStart
|
|
142
|
-
*/
|
|
143
|
-
export type ListPropertiesViewListStartEvent = {
|
|
144
|
-
name: 'listStart';
|
|
145
|
-
args: [data: {
|
|
146
|
-
startIndex: number;
|
|
147
|
-
}];
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Fired when the list order has changed (reversed) via {@link ~ListPropertiesView#reversedSwitchButtonView}.
|
|
151
|
-
*
|
|
152
|
-
* @eventName ~ListPropertiesView#listReversed
|
|
153
|
-
*/
|
|
154
|
-
export type ListPropertiesViewListReversedEvent = {
|
|
155
|
-
name: 'listReversed';
|
|
156
|
-
args: [];
|
|
157
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module list/listproperties/ui/listpropertiesview
|
|
7
|
+
*/
|
|
8
|
+
import { View, ViewCollection, FocusCycler, SwitchButtonView, LabeledFieldView, type ButtonView, type InputNumberView } from 'ckeditor5/src/ui';
|
|
9
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
|
|
10
|
+
import CollapsibleView from './collapsibleview';
|
|
11
|
+
import type { ListPropertiesConfig } from '../../listconfig';
|
|
12
|
+
import '../../../theme/listproperties.css';
|
|
13
|
+
/**
|
|
14
|
+
* The list properties view to be displayed in the list dropdown.
|
|
15
|
+
*
|
|
16
|
+
* Contains a grid of available list styles and, for numbered list, also the list start index and reversed fields.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export default class ListPropertiesView extends View {
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
locale: Locale;
|
|
25
|
+
/**
|
|
26
|
+
* A collection of the child views.
|
|
27
|
+
*/
|
|
28
|
+
readonly children: ViewCollection;
|
|
29
|
+
/**
|
|
30
|
+
* A view that renders the grid of list styles.
|
|
31
|
+
*/
|
|
32
|
+
readonly stylesView: StylesView | null;
|
|
33
|
+
/**
|
|
34
|
+
* A collapsible view that hosts additional list property fields ({@link #startIndexFieldView} and
|
|
35
|
+
* {@link #reversedSwitchButtonView}) to visually separate them from the {@link #stylesView grid of styles}.
|
|
36
|
+
*
|
|
37
|
+
* **Note**: Only present when:
|
|
38
|
+
* * the view represents **numbered** list properties,
|
|
39
|
+
* * and the {@link #stylesView} is rendered,
|
|
40
|
+
* * and either {@link #startIndexFieldView} or {@link #reversedSwitchButtonView} is rendered.
|
|
41
|
+
*
|
|
42
|
+
* @readonly
|
|
43
|
+
*/
|
|
44
|
+
additionalPropertiesCollapsibleView: CollapsibleView | null;
|
|
45
|
+
/**
|
|
46
|
+
* A labeled number field allowing the user to set the start index of the list.
|
|
47
|
+
*
|
|
48
|
+
* **Note**: Only present when the view represents **numbered** list properties.
|
|
49
|
+
*
|
|
50
|
+
* @readonly
|
|
51
|
+
*/
|
|
52
|
+
startIndexFieldView: LabeledFieldView<InputNumberView> | null;
|
|
53
|
+
/**
|
|
54
|
+
* A switch button allowing the user to make the edited list reversed.
|
|
55
|
+
*
|
|
56
|
+
* **Note**: Only present when the view represents **numbered** list properties.
|
|
57
|
+
*
|
|
58
|
+
* @readonly
|
|
59
|
+
*/
|
|
60
|
+
reversedSwitchButtonView: SwitchButtonView | null;
|
|
61
|
+
/**
|
|
62
|
+
* Tracks information about the DOM focus in the view.
|
|
63
|
+
*/
|
|
64
|
+
readonly focusTracker: FocusTracker;
|
|
65
|
+
/**
|
|
66
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
67
|
+
*/
|
|
68
|
+
readonly keystrokes: KeystrokeHandler;
|
|
69
|
+
/**
|
|
70
|
+
* A collection of views that can be focused in the properties view.
|
|
71
|
+
*/
|
|
72
|
+
readonly focusables: ViewCollection;
|
|
73
|
+
/**
|
|
74
|
+
* Helps cycling over {@link #focusables} in the view.
|
|
75
|
+
*/
|
|
76
|
+
readonly focusCycler: FocusCycler;
|
|
77
|
+
/**
|
|
78
|
+
* Creates an instance of the list properties view.
|
|
79
|
+
*
|
|
80
|
+
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
81
|
+
* @param options Options of the view.
|
|
82
|
+
* @param options.enabledProperties An object containing the configuration of enabled list property names.
|
|
83
|
+
* Allows conditional rendering the sub-components of the properties view.
|
|
84
|
+
* @param options.styleButtonViews A list of style buttons to be rendered
|
|
85
|
+
* inside the styles grid. The grid will not be rendered when `enabledProperties` does not include the `'styles'` key.
|
|
86
|
+
* @param options.styleGridAriaLabel An assistive technologies label set on the grid of styles (if the grid is rendered).
|
|
87
|
+
*/
|
|
88
|
+
constructor(locale: Locale, { enabledProperties, styleButtonViews, styleGridAriaLabel }: {
|
|
89
|
+
enabledProperties: ListPropertiesConfig;
|
|
90
|
+
styleButtonViews: Array<ButtonView> | null;
|
|
91
|
+
styleGridAriaLabel: string;
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* @inheritDoc
|
|
95
|
+
*/
|
|
96
|
+
render(): void;
|
|
97
|
+
/**
|
|
98
|
+
* @inheritDoc
|
|
99
|
+
*/
|
|
100
|
+
focus(): void;
|
|
101
|
+
/**
|
|
102
|
+
* @inheritDoc
|
|
103
|
+
*/
|
|
104
|
+
focusLast(): void;
|
|
105
|
+
/**
|
|
106
|
+
* @inheritDoc
|
|
107
|
+
*/
|
|
108
|
+
destroy(): void;
|
|
109
|
+
/**
|
|
110
|
+
* Creates the list styles grid.
|
|
111
|
+
*
|
|
112
|
+
* @param styleButtons Buttons to be placed in the grid.
|
|
113
|
+
* @param styleGridAriaLabel The assistive technology label of the grid.
|
|
114
|
+
*/
|
|
115
|
+
private _createStylesView;
|
|
116
|
+
/**
|
|
117
|
+
* Renders {@link #startIndexFieldView} and/or {@link #reversedSwitchButtonView} depending on the configuration of the properties view.
|
|
118
|
+
*
|
|
119
|
+
* @param enabledProperties An object containing the configuration of enabled list property names
|
|
120
|
+
* (see {@link #constructor}).
|
|
121
|
+
*/
|
|
122
|
+
private _addNumberedListPropertyViews;
|
|
123
|
+
/**
|
|
124
|
+
* Creates the list start index labeled field.
|
|
125
|
+
*/
|
|
126
|
+
private _createStartIndexField;
|
|
127
|
+
/**
|
|
128
|
+
* Creates the reversed list switch button.
|
|
129
|
+
*/
|
|
130
|
+
private _createReversedSwitchButton;
|
|
131
|
+
}
|
|
132
|
+
export type StylesView = View & {
|
|
133
|
+
children: ViewCollection;
|
|
134
|
+
focusTracker: FocusTracker;
|
|
135
|
+
keystrokes: KeystrokeHandler;
|
|
136
|
+
focus(): void;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Fired when the list start index value has changed via {@link ~ListPropertiesView#startIndexFieldView}.
|
|
140
|
+
*
|
|
141
|
+
* @eventName ~ListPropertiesView#listStart
|
|
142
|
+
*/
|
|
143
|
+
export type ListPropertiesViewListStartEvent = {
|
|
144
|
+
name: 'listStart';
|
|
145
|
+
args: [data: {
|
|
146
|
+
startIndex: number;
|
|
147
|
+
}];
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Fired when the list order has changed (reversed) via {@link ~ListPropertiesView#reversedSwitchButtonView}.
|
|
151
|
+
*
|
|
152
|
+
* @eventName ~ListPropertiesView#listReversed
|
|
153
|
+
*/
|
|
154
|
+
export type ListPropertiesViewListReversedEvent = {
|
|
155
|
+
name: 'listReversed';
|
|
156
|
+
args: [];
|
|
157
|
+
};
|