6
6
import {
7
7
Undo ,
8
8
Redo ,
9
+ CardTextOutline ,
9
10
CodeTags ,
10
11
Danger ,
11
12
Emoticon ,
@@ -59,7 +60,7 @@ export default [
59
60
keyModifiers : [ MODIFIERS . Mod ] ,
60
61
icon : Undo ,
61
62
action : ( command ) => command . undo ( ) ,
62
- priority : 7 ,
63
+ priority : 8 ,
63
64
} ,
64
65
{
65
66
key : 'redo' ,
@@ -68,7 +69,7 @@ export default [
68
69
keyModifiers : [ MODIFIERS . Mod ] ,
69
70
icon : Redo ,
70
71
action : ( command ) => command . redo ( ) ,
71
- priority : 10 ,
72
+ priority : 11 ,
72
73
} ,
73
74
{
74
75
key : 'bold' ,
@@ -80,7 +81,7 @@ export default [
80
81
action : ( command ) => {
81
82
return command . toggleBold ( )
82
83
} ,
83
- priority : 8 ,
84
+ priority : 9 ,
84
85
} ,
85
86
{
86
87
key : 'italic' ,
@@ -92,7 +93,7 @@ export default [
92
93
action : ( command ) => {
93
94
return command . toggleItalic ( )
94
95
} ,
95
- priority : 9 ,
96
+ priority : 10 ,
96
97
} ,
97
98
{
98
99
key : 'underline' ,
@@ -104,7 +105,7 @@ export default [
104
105
action : ( command ) => {
105
106
return command . toggleUnderline ( )
106
107
} ,
107
- priority : 13 ,
108
+ priority : 12 ,
108
109
} ,
109
110
{
110
111
key : 'strikethrough' ,
@@ -116,7 +117,7 @@ export default [
116
117
action : ( command ) => {
117
118
return command . toggleStrike ( )
118
119
} ,
119
- priority : 14 ,
120
+ priority : 13 ,
120
121
} ,
121
122
{
122
123
key : 'headings' ,
@@ -132,7 +133,7 @@ export default [
132
133
keyChar : '1' ,
133
134
keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
134
135
icon : FormatHeader1 ,
135
- isActive : [ 'heading' , { level : 1 } ] ,
136
+ isActive : { name : 'heading' , attributes : { level : 1 } } ,
136
137
action : ( command ) => {
137
138
return command . toggleHeading ( { level : 1 } )
138
139
} ,
@@ -143,7 +144,7 @@ export default [
143
144
keyChar : '2' ,
144
145
keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
145
146
icon : FormatHeader2 ,
146
- isActive : [ 'heading' , { level : 2 } ] ,
147
+ isActive : { name : 'heading' , attributes : { level : 2 } } ,
147
148
action : ( command ) => {
148
149
return command . toggleHeading ( { level : 2 } )
149
150
} ,
@@ -154,7 +155,7 @@ export default [
154
155
keyChar : '3' ,
155
156
keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
156
157
icon : FormatHeader3 ,
157
- isActive : [ 'heading' , { level : 3 } ] ,
158
+ isActive : { name : 'heading' , attributes : { level : 3 } } ,
158
159
action : ( command ) => {
159
160
return command . toggleHeading ( { level : 3 } )
160
161
} ,
@@ -164,7 +165,7 @@ export default [
164
165
label : t ( 'text' , 'Heading 4' ) ,
165
166
keyChar : '4' ,
166
167
keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
167
- isActive : [ 'heading' , { level : 4 } ] ,
168
+ isActive : { name : 'heading' , attributes : { level : 4 } } ,
168
169
icon : FormatHeader4 ,
169
170
action : ( command ) => {
170
171
return command . toggleHeading ( { level : 4 } )
@@ -175,7 +176,7 @@ export default [
175
176
label : t ( 'text' , 'Heading 5' ) ,
176
177
keyChar : '5' ,
177
178
keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
178
- isActive : [ 'heading' , { level : 5 } ] ,
179
+ isActive : { name : 'heading' , attributes : { level : 5 } } ,
179
180
icon : FormatHeader5 ,
180
181
action : ( command ) => {
181
182
return command . toggleHeading ( { level : 5 } )
@@ -186,7 +187,7 @@ export default [
186
187
label : t ( 'text' , 'Heading 6' ) ,
187
188
keyChar : '6' ,
188
189
keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
189
- isActive : [ 'heading' , { level : 6 } ] ,
190
+ isActive : { name : 'heading' , attributes : { level : 6 } } ,
190
191
icon : FormatHeader6 ,
191
192
action : ( command ) => {
192
193
return command . toggleHeading ( { level : 6 } )
@@ -220,7 +221,7 @@ export default [
220
221
label : t ( 'text' , 'Lists' ) ,
221
222
keyChar : '7…9' ,
222
223
keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
223
- isActive : [ { isList : true } ] ,
224
+ isActive : [ 'bulletList' , 'orderedList' , 'taskList' ] ,
224
225
icon : FormatListBulleted ,
225
226
children : [
226
227
{
@@ -287,82 +288,76 @@ export default [
287
288
priority : 2 ,
288
289
} ,
289
290
{
290
- key : 'insert-link' ,
291
- label : t ( 'text' , 'Insert link' ) ,
292
- isActive : 'link' ,
293
- icon : LinkIcon ,
294
- component : ActionInsertLink ,
295
- priority : 3 ,
296
- } ,
297
- {
298
- key : 'blockquote' ,
299
- label : t ( 'text' , 'Blockquote' ) ,
300
- keyChar : 'b' ,
301
- keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
302
- isActive : 'blockquote' ,
303
- icon : FormatQuote ,
304
- action : ( command ) => {
305
- return command . toggleBlockquote ( )
306
- } ,
307
- priority : 11 ,
308
- } ,
309
- {
310
- key : 'callouts' ,
311
- label : t ( 'text' , 'Callouts' ) ,
291
+ key : 'blocks' ,
292
+ label : t ( 'text' , 'Blocks' ) ,
312
293
visible : false ,
313
- icon : Info ,
314
- isActive : ' callout',
294
+ icon : CardTextOutline ,
295
+ isActive : [ 'blockquote' , 'codeBlock' , ' callout'] ,
315
296
children : [
297
+ {
298
+ key : 'blockquote' ,
299
+ label : t ( 'text' , 'Blockquote' ) ,
300
+ keyChar : 'b' ,
301
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Shift ] ,
302
+ isActive : 'blockquote' ,
303
+ icon : FormatQuote ,
304
+ action : ( command ) => {
305
+ return command . toggleBlockquote ( )
306
+ } ,
307
+ } ,
308
+ {
309
+ key : 'code-block' ,
310
+ label : t ( 'text' , 'Code block' ) ,
311
+ keyChar : 'c' ,
312
+ keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Alt ] ,
313
+ isActive : 'codeBlock' ,
314
+ icon : CodeTags ,
315
+ action : ( command ) => {
316
+ return command . toggleCodeBlock ( )
317
+ } ,
318
+ } ,
319
+ {
320
+ key : 'blocks-separator' ,
321
+ isSeparator : true ,
322
+ } ,
316
323
{
317
324
key : 'callout-info' ,
318
- label : t ( 'text' , 'Info' ) ,
319
- isActive : [ 'callout' , { type : 'info' } ] ,
325
+ label : t ( 'text' , 'Info callout ' ) ,
326
+ isActive : { name : 'callout' , attributes : { type : 'info' } } ,
320
327
icon : Info ,
321
328
action : ( command ) => {
322
329
return command . toggleCallout ( { type : 'info' } )
323
330
} ,
324
331
} ,
325
332
{
326
333
key : 'callout-success' ,
327
- label : t ( 'text' , 'Success' ) ,
328
- isActive : [ 'callout' , { type : 'success' } ] ,
334
+ label : t ( 'text' , 'Success callout ' ) ,
335
+ isActive : { name : 'callout' , attributes : { type : 'success' } } ,
329
336
icon : Positive ,
330
337
action : ( command ) => {
331
338
return command . toggleCallout ( { type : 'success' } )
332
339
} ,
333
340
} ,
334
341
{
335
342
key : 'callout-warn' ,
336
- label : t ( 'text' , 'Warning' ) ,
337
- isActive : [ 'callout' , { type : 'warn' } ] ,
343
+ label : t ( 'text' , 'Warning callout ' ) ,
344
+ isActive : { name : 'callout' , attributes : { type : 'warn' } } ,
338
345
icon : Warn ,
339
346
action : ( command ) => {
340
347
return command . toggleCallout ( { type : 'warn' } )
341
348
} ,
342
349
} ,
343
350
{
344
351
key : 'callout-error' ,
345
- label : t ( 'text' , 'Danger' ) ,
346
- isActive : [ 'callout' , { type : 'error' } ] ,
352
+ label : t ( 'text' , 'Danger callout ' ) ,
353
+ isActive : { name : 'callout' , attributes : { type : 'error' } } ,
347
354
icon : Danger ,
348
355
action : ( command ) => {
349
356
return command . toggleCallout ( { type : 'error' } )
350
357
} ,
351
358
} ,
352
359
] ,
353
- priority : 4 ,
354
- } ,
355
- {
356
- key : 'code-block' ,
357
- label : t ( 'text' , 'Code block' ) ,
358
- keyChar : 'c' ,
359
- keyModifiers : [ MODIFIERS . Mod , MODIFIERS . Alt ] ,
360
- isActive : 'codeBlock' ,
361
- icon : CodeTags ,
362
- action : ( command ) => {
363
- return command . toggleCodeBlock ( )
364
- } ,
365
- priority : 12 ,
360
+ priority : 3 ,
366
361
} ,
367
362
{
368
363
key : 'table' ,
@@ -372,7 +367,15 @@ export default [
372
367
action : ( command ) => {
373
368
return command . insertTable ( )
374
369
} ,
375
- priority : 15 ,
370
+ priority : 4 ,
371
+ } ,
372
+ {
373
+ key : 'insert-link' ,
374
+ label : t ( 'text' , 'Insert link' ) ,
375
+ isActive : 'link' ,
376
+ icon : LinkIcon ,
377
+ component : ActionInsertLink ,
378
+ priority : 5 ,
376
379
} ,
377
380
{
378
381
key : 'details' ,
@@ -382,7 +385,7 @@ export default [
382
385
action : ( command ) => {
383
386
return command . toggleDetails ( )
384
387
} ,
385
- priority : 16 ,
388
+ priority : 14 ,
386
389
} ,
387
390
{
388
391
key : 'emoji-picker' ,
@@ -392,13 +395,13 @@ export default [
392
395
action : ( command , emojiObject = { } ) => {
393
396
return command . emoji ( emojiObject )
394
397
} ,
395
- priority : 5 ,
398
+ priority : 6 ,
396
399
} ,
397
400
{
398
401
key : 'insert-attachment' ,
399
402
label : t ( 'text' , 'Insert attachment' ) ,
400
403
icon : Paperclip ,
401
404
component : ActionAttachmentUpload ,
402
- priority : 6 ,
405
+ priority : 7 ,
403
406
} ,
404
407
]
0 commit comments