@@ -19,6 +19,8 @@ import {
19
19
FormatHeader4 ,
20
20
FormatHeader5 ,
21
21
FormatHeader6 ,
22
+ FormatIndentDecrease ,
23
+ FormatIndentIncrease ,
22
24
FormatListNumbered ,
23
25
FormatListBulleted ,
24
26
FormatListCheckbox ,
@@ -127,6 +129,8 @@ export default [
127
129
{
128
130
key : 'headings-h1' ,
129
131
label : t ( 'text' , 'Heading 1' ) ,
132
+ keyChar : '1' ,
133
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
130
134
icon : FormatHeader1 ,
131
135
isActive : [ 'heading' , { level : 1 } ] ,
132
136
action : ( command ) => {
@@ -136,6 +140,8 @@ export default [
136
140
{
137
141
key : 'headings-h2' ,
138
142
label : t ( 'text' , 'Heading 2' ) ,
143
+ keyChar : '2' ,
144
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
139
145
icon : FormatHeader2 ,
140
146
isActive : [ 'heading' , { level : 2 } ] ,
141
147
action : ( command ) => {
@@ -145,6 +151,8 @@ export default [
145
151
{
146
152
key : 'headings-h3' ,
147
153
label : t ( 'text' , 'Heading 3' ) ,
154
+ keyChar : '3' ,
155
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
148
156
icon : FormatHeader3 ,
149
157
isActive : [ 'heading' , { level : 3 } ] ,
150
158
action : ( command ) => {
@@ -154,6 +162,8 @@ export default [
154
162
{
155
163
key : 'headings-h4' ,
156
164
label : t ( 'text' , 'Heading 4' ) ,
165
+ keyChar : '4' ,
166
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
157
167
isActive : [ 'heading' , { level : 4 } ] ,
158
168
icon : FormatHeader4 ,
159
169
action : ( command ) => {
@@ -163,6 +173,8 @@ export default [
163
173
{
164
174
key : 'headings-h5' ,
165
175
label : t ( 'text' , 'Heading 5' ) ,
176
+ keyChar : '5' ,
177
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
166
178
isActive : [ 'heading' , { level : 5 } ] ,
167
179
icon : FormatHeader5 ,
168
180
action : ( command ) => {
@@ -172,6 +184,8 @@ export default [
172
184
{
173
185
key : 'headings-h6' ,
174
186
label : t ( 'text' , 'Heading 6' ) ,
187
+ keyChar : '6' ,
188
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
175
189
isActive : [ 'heading' , { level : 6 } ] ,
176
190
icon : FormatHeader6 ,
177
191
action : ( command ) => {
@@ -202,38 +216,71 @@ export default [
202
216
priority : 1 ,
203
217
} ,
204
218
{
205
- key : 'unordered-list ' ,
206
- label : t ( 'text' , 'Unordered list ' ) ,
207
- keyChar : '8 ' ,
219
+ key : 'lists ' ,
220
+ label : t ( 'text' , 'Lists ' ) ,
221
+ keyChar : '7…9 ' ,
208
222
keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
209
- isActive : 'bulletList' ,
223
+ isActive : [ { isList : true } ] ,
210
224
icon : FormatListBulleted ,
211
- action : ( command ) => {
212
- return command . toggleBulletList ( )
213
- } ,
214
- priority : 9 ,
215
- } ,
216
- {
217
- key : 'ordered-list' ,
218
- label : t ( 'text' , 'Ordered list' ) ,
219
- keyChar : '7' ,
220
- keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
221
- isActive : 'orderedList' ,
222
- icon : FormatListNumbered ,
223
- action : ( command ) => {
224
- return command . toggleOrderedList ( )
225
- } ,
226
- priority : 10 ,
227
- } ,
228
- {
229
- key : 'task-list' ,
230
- label : t ( 'text' , 'To-Do list' ) ,
231
- keyChar : '9' ,
232
- keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
233
- isActive : 'taskList' ,
234
- icon : FormatListCheckbox ,
235
- action : ( command ) => command . toggleTaskList ( ) ,
236
- priority : 11 ,
225
+ children : [
226
+ {
227
+ key : 'unordered-list' ,
228
+ label : t ( 'text' , 'Unordered list' ) ,
229
+ keyChar : '8' ,
230
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
231
+ isActive : 'bulletList' ,
232
+ icon : FormatListBulleted ,
233
+ action : ( command ) => {
234
+ return command . toggleBulletList ( )
235
+ } ,
236
+ } ,
237
+ {
238
+ key : 'ordered-list' ,
239
+ label : t ( 'text' , 'Ordered list' ) ,
240
+ keyChar : '7' ,
241
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
242
+ isActive : 'orderedList' ,
243
+ icon : FormatListNumbered ,
244
+ action : ( command ) => {
245
+ return command . toggleOrderedList ( )
246
+ } ,
247
+ } ,
248
+ {
249
+ key : 'task-list' ,
250
+ label : t ( 'text' , 'To-Do list' ) ,
251
+ keyChar : '9' ,
252
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
253
+ isActive : 'taskList' ,
254
+ icon : FormatListCheckbox ,
255
+ action : ( command ) => command . toggleTaskList ( ) ,
256
+ } ,
257
+ {
258
+ key : 'list-indent-increase' ,
259
+ label : t ( 'text' , 'Increase indention' ) ,
260
+ keyChar : 'Tab' ,
261
+ icon : FormatIndentIncrease ,
262
+ action : ( command , editor = null ) => {
263
+ if ( editor && editor . isActive ( 'taskItem' ) ) {
264
+ return command . sinkListItem ( 'taskItem' )
265
+ }
266
+ return command . sinkListItem ( 'listItem' )
267
+ } ,
268
+ } ,
269
+ {
270
+ key : 'list-indent-decrease' ,
271
+ label : t ( 'text' , 'Decrease indention' ) ,
272
+ keyChar : 'Tab' ,
273
+ keyModifiers : [ MODIFIERS . Shift ] ,
274
+ icon : FormatIndentDecrease ,
275
+ action : ( command , editor = null ) => {
276
+ if ( editor && editor . isActive ( 'taskItem' ) ) {
277
+ return command . liftListItem ( 'taskItem' )
278
+ }
279
+ return command . liftListItem ( 'listItem' )
280
+ } ,
281
+ } ,
282
+ ] ,
283
+ priority : 3 ,
237
284
} ,
238
285
{
239
286
key : 'insert-link' ,
0 commit comments