@wordpress/edit-post 6.18.0 → 6.19.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 +6 -0
- package/build/components/block-manager/category.js +3 -11
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +4 -3
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/header/header-toolbar/index.js +2 -2
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +68 -0
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +1 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +4 -4
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/store/actions.js +1 -7
- package/build/store/actions.js.map +1 -1
- package/build-module/components/block-manager/category.js +3 -11
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +5 -4
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +2 -2
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +67 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +1 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +4 -4
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/store/actions.js +1 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +41 -39
- package/build-style/style.css +41 -39
- package/package.json +27 -27
- package/src/components/block-manager/category.js +3 -10
- package/src/components/block-manager/checklist.js +3 -6
- package/src/components/block-manager/style.scss +4 -15
- package/src/components/header/header-toolbar/index.js +2 -2
- package/src/components/header/style.scss +3 -8
- package/src/components/keyboard-shortcut-help-modal/config.js +10 -0
- package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +70 -0
- package/src/components/keyboard-shortcuts/index.js +71 -0
- package/src/components/layout/index.js +1 -1
- package/src/components/layout/style.scss +12 -1
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +4 -4
- package/src/components/secondary-sidebar/list-view-sidebar.js +4 -4
- package/src/components/secondary-sidebar/style.scss +3 -3
- package/src/components/sidebar/plugin-pre-publish-panel/test/index.js +8 -6
- package/src/components/visual-editor/test/index.native.js +13 -13
- package/src/store/actions.js +6 -15
- package/src/components/sidebar/plugin-pre-publish-panel/test/__snapshots__/index.js.snap +0 -3
package/build-style/style.css
CHANGED
|
@@ -306,10 +306,12 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
306
306
|
overflow: auto;
|
|
307
307
|
z-index: 20;
|
|
308
308
|
}
|
|
309
|
+
.interface-interface-skeleton__content .interface-navigable-region__stacker {
|
|
310
|
+
flex-grow: 1;
|
|
311
|
+
}
|
|
309
312
|
|
|
310
313
|
.interface-interface-skeleton__secondary-sidebar,
|
|
311
314
|
.interface-interface-skeleton__sidebar {
|
|
312
|
-
display: block;
|
|
313
315
|
flex-shrink: 0;
|
|
314
316
|
position: absolute;
|
|
315
317
|
z-index: 100000;
|
|
@@ -324,9 +326,12 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
324
326
|
.interface-interface-skeleton__secondary-sidebar,
|
|
325
327
|
.interface-interface-skeleton__sidebar {
|
|
326
328
|
position: relative !important;
|
|
327
|
-
z-index: 90;
|
|
328
329
|
width: auto;
|
|
329
330
|
}
|
|
331
|
+
.is-sidebar-opened .interface-interface-skeleton__secondary-sidebar,
|
|
332
|
+
.is-sidebar-opened .interface-interface-skeleton__sidebar {
|
|
333
|
+
z-index: 90;
|
|
334
|
+
}
|
|
330
335
|
}
|
|
331
336
|
|
|
332
337
|
.interface-interface-skeleton__sidebar {
|
|
@@ -390,11 +395,17 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
390
395
|
width: 280px;
|
|
391
396
|
color: #1e1e1e;
|
|
392
397
|
}
|
|
393
|
-
.interface-interface-skeleton__actions:focus {
|
|
398
|
+
.interface-interface-skeleton__actions:focus, .interface-interface-skeleton__actions:focus-within {
|
|
394
399
|
top: auto;
|
|
395
400
|
bottom: 0;
|
|
396
401
|
}
|
|
397
402
|
|
|
403
|
+
@media (min-width: 782px) {
|
|
404
|
+
.interface-interface-skeleton.has-footer .interface-interface-skeleton__drawer {
|
|
405
|
+
height: calc(100% - 25px);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
398
409
|
.interface-more-menu-dropdown {
|
|
399
410
|
margin-left: -4px;
|
|
400
411
|
}
|
|
@@ -683,17 +694,13 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
683
694
|
}
|
|
684
695
|
}
|
|
685
696
|
.show-icon-labels.interface-pinned-items .editor-post-save-draft.editor-post-save-draft::after,
|
|
697
|
+
.show-icon-labels.interface-pinned-items .editor-post-saved-state.editor-post-saved-state::after,
|
|
686
698
|
.show-icon-labels .edit-post-header .editor-post-save-draft.editor-post-save-draft::after,
|
|
687
|
-
.edit-post-
|
|
699
|
+
.show-icon-labels .edit-post-header .editor-post-saved-state.editor-post-saved-state::after,
|
|
700
|
+
.edit-post-header__dropdown .editor-post-save-draft.editor-post-save-draft::after,
|
|
701
|
+
.edit-post-header__dropdown .editor-post-saved-state.editor-post-saved-state::after {
|
|
688
702
|
content: none;
|
|
689
703
|
}
|
|
690
|
-
@media (min-width: 600px) {
|
|
691
|
-
.show-icon-labels.interface-pinned-items .editor-post-save-draft.editor-post-save-draft::after,
|
|
692
|
-
.show-icon-labels .edit-post-header .editor-post-save-draft.editor-post-save-draft::after,
|
|
693
|
-
.edit-post-header__dropdown .editor-post-save-draft.editor-post-save-draft::after {
|
|
694
|
-
content: attr(aria-label);
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
704
|
|
|
698
705
|
.edit-post-header__dropdown .components-menu-item__button.components-menu-item__button,
|
|
699
706
|
.edit-post-header__dropdown .components-button.editor-history__undo,
|
|
@@ -747,7 +754,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
747
754
|
.is-distraction-free .edit-post-header > .edit-post-header__settings > .editor-post-preview {
|
|
748
755
|
visibility: hidden;
|
|
749
756
|
}
|
|
750
|
-
.is-distraction-free .edit-post-header > .edit-post-header__toolbar .edit-post-header-toolbar__inserter-toggle, .is-distraction-free .edit-post-header > .edit-post-header__toolbar .edit-post-header-
|
|
757
|
+
.is-distraction-free .edit-post-header > .edit-post-header__toolbar .edit-post-header-toolbar__inserter-toggle, .is-distraction-free .edit-post-header > .edit-post-header__toolbar .edit-post-header-toolbar__document-overview-toggle, .is-distraction-free .edit-post-header > .edit-post-header__settings > .block-editor-post-preview__dropdown, .is-distraction-free .edit-post-header > .edit-post-header__settings > .interface-pinned-items {
|
|
751
758
|
display: none;
|
|
752
759
|
}
|
|
753
760
|
.is-distraction-free .interface-interface-skeleton__header:focus-within {
|
|
@@ -1176,6 +1183,7 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1176
1183
|
bottom: auto;
|
|
1177
1184
|
left: auto;
|
|
1178
1185
|
right: 0;
|
|
1186
|
+
box-sizing: border-box;
|
|
1179
1187
|
width: 280px;
|
|
1180
1188
|
background-color: #fff;
|
|
1181
1189
|
border: 1px dotted #ddd;
|
|
@@ -1184,11 +1192,15 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1184
1192
|
display: flex;
|
|
1185
1193
|
justify-content: center;
|
|
1186
1194
|
}
|
|
1187
|
-
|
|
1188
|
-
.interface-interface-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1195
|
+
|
|
1196
|
+
.interface-interface-skeleton__sidebar:focus .edit-post-layout__toggle-sidebar-panel, .interface-interface-skeleton__sidebar:focus-within .edit-post-layout__toggle-sidebar-panel {
|
|
1197
|
+
top: auto;
|
|
1198
|
+
bottom: 0;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
.interface-interface-skeleton__actions:focus .edit-post-layout__toggle-entities-saved-states-panel, .interface-interface-skeleton__actions:focus-within .edit-post-layout__toggle-entities-saved-states-panel,
|
|
1202
|
+
.interface-interface-skeleton__actions:focus .edit-post-layout__toggle-publish-panel,
|
|
1203
|
+
.interface-interface-skeleton__actions:focus-within .edit-post-layout__toggle-publish-panel {
|
|
1192
1204
|
top: auto;
|
|
1193
1205
|
bottom: 0;
|
|
1194
1206
|
}
|
|
@@ -1242,27 +1254,17 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1242
1254
|
.edit-post-block-manager__checklist-item {
|
|
1243
1255
|
border-bottom: 1px solid #ddd;
|
|
1244
1256
|
}
|
|
1245
|
-
.edit-post-block-manager__category-title .components-base-control__field,
|
|
1246
|
-
.edit-post-block-manager__checklist-item .components-base-control__field {
|
|
1247
|
-
align-items: center;
|
|
1248
|
-
display: flex;
|
|
1249
|
-
margin: 0;
|
|
1250
|
-
}
|
|
1251
1257
|
|
|
1252
1258
|
.edit-post-block-manager__checklist-item {
|
|
1259
|
+
display: flex;
|
|
1260
|
+
justify-content: space-between;
|
|
1261
|
+
align-items: center;
|
|
1253
1262
|
margin-bottom: 0;
|
|
1254
|
-
padding
|
|
1263
|
+
padding: 8px 0 8px 16px;
|
|
1255
1264
|
}
|
|
1256
1265
|
.components-modal__content .edit-post-block-manager__checklist-item.components-checkbox-control__input-container {
|
|
1257
1266
|
margin: 0 8px;
|
|
1258
1267
|
}
|
|
1259
|
-
.edit-post-block-manager__checklist-item .components-checkbox-control__label {
|
|
1260
|
-
display: flex;
|
|
1261
|
-
align-items: center;
|
|
1262
|
-
justify-content: space-between;
|
|
1263
|
-
flex-grow: 1;
|
|
1264
|
-
padding: 8px 0;
|
|
1265
|
-
}
|
|
1266
1268
|
.edit-post-block-manager__checklist-item .block-editor-block-icon {
|
|
1267
1269
|
margin-right: 10px;
|
|
1268
1270
|
fill: #1e1e1e;
|
|
@@ -1366,16 +1368,16 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1366
1368
|
}
|
|
1367
1369
|
|
|
1368
1370
|
.edit-post-editor__inserter-panel,
|
|
1369
|
-
.edit-post-
|
|
1371
|
+
.edit-post-editor__document-overview-panel {
|
|
1370
1372
|
height: 100%;
|
|
1371
1373
|
display: flex;
|
|
1372
1374
|
flex-direction: column;
|
|
1373
1375
|
}
|
|
1374
1376
|
|
|
1375
|
-
.edit-post-
|
|
1377
|
+
.edit-post-editor__document-overview-panel {
|
|
1376
1378
|
width: 350px;
|
|
1377
1379
|
}
|
|
1378
|
-
.edit-post-
|
|
1380
|
+
.edit-post-editor__document-overview-panel .edit-post-sidebar__panel-tabs {
|
|
1379
1381
|
flex-direction: row-reverse;
|
|
1380
1382
|
}
|
|
1381
1383
|
|
|
@@ -1395,7 +1397,7 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1395
1397
|
}
|
|
1396
1398
|
}
|
|
1397
1399
|
|
|
1398
|
-
.edit-post-
|
|
1400
|
+
.edit-post-editor__document-overview-panel-header {
|
|
1399
1401
|
border-bottom: 1px solid #ddd;
|
|
1400
1402
|
display: flex;
|
|
1401
1403
|
justify-content: space-between;
|
|
@@ -1403,17 +1405,17 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1403
1405
|
padding-left: 16px;
|
|
1404
1406
|
padding-right: 4px;
|
|
1405
1407
|
}
|
|
1406
|
-
.edit-post-
|
|
1408
|
+
.edit-post-editor__document-overview-panel-header ul {
|
|
1407
1409
|
width: calc(100% - 40px);
|
|
1408
1410
|
}
|
|
1409
|
-
.edit-post-
|
|
1411
|
+
.edit-post-editor__document-overview-panel-header li {
|
|
1410
1412
|
width: 50%;
|
|
1411
1413
|
}
|
|
1412
|
-
.edit-post-
|
|
1414
|
+
.edit-post-editor__document-overview-panel-header li button {
|
|
1413
1415
|
width: 100%;
|
|
1414
1416
|
text-align: initial;
|
|
1415
1417
|
}
|
|
1416
|
-
.edit-post-
|
|
1418
|
+
.edit-post-editor__document-overview-panel-header li:only-child {
|
|
1417
1419
|
width: 100%;
|
|
1418
1420
|
}
|
|
1419
1421
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.19.0",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,31 +27,31 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/block-editor": "^10.
|
|
33
|
-
"@wordpress/block-library": "^7.
|
|
34
|
-
"@wordpress/blocks": "^11.
|
|
35
|
-
"@wordpress/components": "^22.
|
|
36
|
-
"@wordpress/compose": "^5.
|
|
37
|
-
"@wordpress/core-data": "^5.
|
|
38
|
-
"@wordpress/data": "^7.
|
|
39
|
-
"@wordpress/deprecated": "^3.
|
|
40
|
-
"@wordpress/editor": "^12.
|
|
41
|
-
"@wordpress/element": "^4.
|
|
42
|
-
"@wordpress/hooks": "^3.
|
|
43
|
-
"@wordpress/i18n": "^4.
|
|
44
|
-
"@wordpress/icons": "^9.
|
|
45
|
-
"@wordpress/interface": "^4.
|
|
46
|
-
"@wordpress/keyboard-shortcuts": "^3.
|
|
47
|
-
"@wordpress/keycodes": "^3.
|
|
48
|
-
"@wordpress/media-utils": "^4.
|
|
49
|
-
"@wordpress/notices": "^3.
|
|
50
|
-
"@wordpress/plugins": "^4.
|
|
51
|
-
"@wordpress/preferences": "^2.
|
|
52
|
-
"@wordpress/url": "^3.
|
|
53
|
-
"@wordpress/viewport": "^4.
|
|
54
|
-
"@wordpress/warning": "^2.
|
|
30
|
+
"@wordpress/a11y": "^3.22.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.19.0",
|
|
32
|
+
"@wordpress/block-editor": "^10.5.0",
|
|
33
|
+
"@wordpress/block-library": "^7.19.0",
|
|
34
|
+
"@wordpress/blocks": "^11.21.0",
|
|
35
|
+
"@wordpress/components": "^22.1.0",
|
|
36
|
+
"@wordpress/compose": "^5.20.0",
|
|
37
|
+
"@wordpress/core-data": "^5.5.0",
|
|
38
|
+
"@wordpress/data": "^7.6.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.22.0",
|
|
40
|
+
"@wordpress/editor": "^12.21.0",
|
|
41
|
+
"@wordpress/element": "^4.20.0",
|
|
42
|
+
"@wordpress/hooks": "^3.22.0",
|
|
43
|
+
"@wordpress/i18n": "^4.22.0",
|
|
44
|
+
"@wordpress/icons": "^9.13.0",
|
|
45
|
+
"@wordpress/interface": "^4.21.0",
|
|
46
|
+
"@wordpress/keyboard-shortcuts": "^3.20.0",
|
|
47
|
+
"@wordpress/keycodes": "^3.22.0",
|
|
48
|
+
"@wordpress/media-utils": "^4.13.0",
|
|
49
|
+
"@wordpress/notices": "^3.22.0",
|
|
50
|
+
"@wordpress/plugins": "^4.20.0",
|
|
51
|
+
"@wordpress/preferences": "^2.14.0",
|
|
52
|
+
"@wordpress/url": "^3.23.0",
|
|
53
|
+
"@wordpress/viewport": "^4.20.0",
|
|
54
|
+
"@wordpress/warning": "^2.22.0",
|
|
55
55
|
"classnames": "^2.3.1",
|
|
56
56
|
"lodash": "^4.17.21",
|
|
57
57
|
"memize": "^1.1.0",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "7ac04f446242452d3cb24372f9ca58f0cae97715"
|
|
68
68
|
}
|
|
@@ -71,15 +71,7 @@ function BlockManagerCategory( { title, blockTypes } ) {
|
|
|
71
71
|
const titleId = 'edit-post-block-manager__category-title-' + instanceId;
|
|
72
72
|
|
|
73
73
|
const isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;
|
|
74
|
-
|
|
75
|
-
let ariaChecked;
|
|
76
|
-
if ( isAllChecked ) {
|
|
77
|
-
ariaChecked = 'true';
|
|
78
|
-
} else if ( checkedBlockNames.length > 0 ) {
|
|
79
|
-
ariaChecked = 'mixed';
|
|
80
|
-
} else {
|
|
81
|
-
ariaChecked = 'false';
|
|
82
|
-
}
|
|
74
|
+
const isIndeterminate = ! isAllChecked && checkedBlockNames.length > 0;
|
|
83
75
|
|
|
84
76
|
return (
|
|
85
77
|
<div
|
|
@@ -88,10 +80,11 @@ function BlockManagerCategory( { title, blockTypes } ) {
|
|
|
88
80
|
className="edit-post-block-manager__category"
|
|
89
81
|
>
|
|
90
82
|
<CheckboxControl
|
|
83
|
+
__nextHasNoMarginBottom
|
|
91
84
|
checked={ isAllChecked }
|
|
92
85
|
onChange={ toggleAllVisible }
|
|
93
86
|
className="edit-post-block-manager__category-title"
|
|
94
|
-
|
|
87
|
+
indeterminate={ isIndeterminate }
|
|
95
88
|
label={ <span id={ titleId }>{ title }</span> }
|
|
96
89
|
/>
|
|
97
90
|
<BlockTypesChecklist
|
|
@@ -13,17 +13,14 @@ function BlockTypesChecklist( { blockTypes, value, onItemChange } ) {
|
|
|
13
13
|
className="edit-post-block-manager__checklist-item"
|
|
14
14
|
>
|
|
15
15
|
<CheckboxControl
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{ blockType.title }
|
|
19
|
-
<BlockIcon icon={ blockType.icon } />
|
|
20
|
-
</>
|
|
21
|
-
}
|
|
16
|
+
__nextHasNoMarginBottom
|
|
17
|
+
label={ blockType.title }
|
|
22
18
|
checked={ value.includes( blockType.name ) }
|
|
23
19
|
onChange={ ( ...args ) =>
|
|
24
20
|
onItemChange( blockType.name, ...args )
|
|
25
21
|
}
|
|
26
22
|
/>
|
|
23
|
+
<BlockIcon icon={ blockType.icon } />
|
|
27
24
|
</li>
|
|
28
25
|
) ) }
|
|
29
26
|
</ul>
|
|
@@ -51,30 +51,19 @@
|
|
|
51
51
|
.edit-post-block-manager__category-title,
|
|
52
52
|
.edit-post-block-manager__checklist-item {
|
|
53
53
|
border-bottom: 1px solid $gray-300;
|
|
54
|
-
|
|
55
|
-
.components-base-control__field {
|
|
56
|
-
align-items: center;
|
|
57
|
-
display: flex;
|
|
58
|
-
margin: 0;
|
|
59
|
-
}
|
|
60
54
|
}
|
|
61
55
|
|
|
62
56
|
.edit-post-block-manager__checklist-item {
|
|
57
|
+
display: flex;
|
|
58
|
+
justify-content: space-between;
|
|
59
|
+
align-items: center;
|
|
63
60
|
margin-bottom: 0;
|
|
64
|
-
padding
|
|
61
|
+
padding: $grid-unit-10 0 $grid-unit-10 $grid-unit-20;
|
|
65
62
|
|
|
66
63
|
.components-modal__content &.components-checkbox-control__input-container {
|
|
67
64
|
margin: 0 $grid-unit-10;
|
|
68
65
|
}
|
|
69
66
|
|
|
70
|
-
.components-checkbox-control__label {
|
|
71
|
-
display: flex;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: space-between;
|
|
74
|
-
flex-grow: 1;
|
|
75
|
-
padding: $grid-unit-10 0;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
67
|
.block-editor-block-icon {
|
|
79
68
|
margin-right: 10px;
|
|
80
69
|
fill: $gray-900;
|
|
@@ -78,12 +78,12 @@ function HeaderToolbar() {
|
|
|
78
78
|
<>
|
|
79
79
|
<ToolbarItem
|
|
80
80
|
as={ Button }
|
|
81
|
-
className="edit-post-header-
|
|
81
|
+
className="edit-post-header-toolbar__document-overview-toggle"
|
|
82
82
|
icon={ listView }
|
|
83
83
|
disabled={ isTextModeEnabled }
|
|
84
84
|
isPressed={ isListViewOpen }
|
|
85
85
|
/* translators: button label text should, if possible, be under 16 characters. */
|
|
86
|
-
label={ __( '
|
|
86
|
+
label={ __( 'Document Overview' ) }
|
|
87
87
|
onClick={ toggleListView }
|
|
88
88
|
shortcut={ listViewShortcut }
|
|
89
89
|
showTooltip={ ! showIconLabels }
|
|
@@ -146,16 +146,11 @@
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
.editor-post-
|
|
149
|
+
.editor-post-save-draft.editor-post-save-draft,
|
|
150
|
+
.editor-post-saved-state.editor-post-saved-state {
|
|
151
151
|
&::after {
|
|
152
152
|
content: none;
|
|
153
153
|
}
|
|
154
|
-
@include break-small {
|
|
155
|
-
&::after {
|
|
156
|
-
content: attr(aria-label);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
154
|
}
|
|
160
155
|
}
|
|
161
156
|
|
|
@@ -220,7 +215,7 @@
|
|
|
220
215
|
}
|
|
221
216
|
|
|
222
217
|
& > .edit-post-header__toolbar .edit-post-header-toolbar__inserter-toggle,
|
|
223
|
-
& > .edit-post-header__toolbar .edit-post-header-
|
|
218
|
+
& > .edit-post-header__toolbar .edit-post-header-toolbar__document-overview-toggle,
|
|
224
219
|
& > .edit-post-header__settings > .block-editor-post-preview__dropdown,
|
|
225
220
|
& > .edit-post-header__settings > .interface-pinned-items {
|
|
226
221
|
display: none;
|
|
@@ -36,4 +36,14 @@ export const textFormattingShortcuts = [
|
|
|
36
36
|
keyCombination: { modifier: 'access', character: 'x' },
|
|
37
37
|
description: __( 'Make the selected text inline code.' ),
|
|
38
38
|
},
|
|
39
|
+
{
|
|
40
|
+
keyCombination: { modifier: 'access', character: '0' },
|
|
41
|
+
description: __( 'Convert the current heading to a paragraph.' ),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
keyCombination: { modifier: 'access', character: '1-6' },
|
|
45
|
+
description: __(
|
|
46
|
+
'Convert the current paragraph or heading to a heading of level 1 to 6.'
|
|
47
|
+
),
|
|
48
|
+
},
|
|
39
49
|
];
|
|
@@ -821,6 +821,76 @@ exports[`KeyboardShortcutHelpModal should match snapshot when the modal is activ
|
|
|
821
821
|
</kbd>
|
|
822
822
|
</div>
|
|
823
823
|
</li>
|
|
824
|
+
<li
|
|
825
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut"
|
|
826
|
+
>
|
|
827
|
+
<div
|
|
828
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-description"
|
|
829
|
+
>
|
|
830
|
+
Convert the current heading to a paragraph.
|
|
831
|
+
</div>
|
|
832
|
+
<div
|
|
833
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-term"
|
|
834
|
+
>
|
|
835
|
+
<kbd
|
|
836
|
+
aria-label="Shift + Alt + 0"
|
|
837
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-key-combination"
|
|
838
|
+
>
|
|
839
|
+
<kbd
|
|
840
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-key"
|
|
841
|
+
>
|
|
842
|
+
Shift
|
|
843
|
+
</kbd>
|
|
844
|
+
+
|
|
845
|
+
<kbd
|
|
846
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-key"
|
|
847
|
+
>
|
|
848
|
+
Alt
|
|
849
|
+
</kbd>
|
|
850
|
+
+
|
|
851
|
+
<kbd
|
|
852
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-key"
|
|
853
|
+
>
|
|
854
|
+
0
|
|
855
|
+
</kbd>
|
|
856
|
+
</kbd>
|
|
857
|
+
</div>
|
|
858
|
+
</li>
|
|
859
|
+
<li
|
|
860
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut"
|
|
861
|
+
>
|
|
862
|
+
<div
|
|
863
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-description"
|
|
864
|
+
>
|
|
865
|
+
Convert the current paragraph or heading to a heading of level 1 to 6.
|
|
866
|
+
</div>
|
|
867
|
+
<div
|
|
868
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-term"
|
|
869
|
+
>
|
|
870
|
+
<kbd
|
|
871
|
+
aria-label="Shift + Alt + 1 6"
|
|
872
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-key-combination"
|
|
873
|
+
>
|
|
874
|
+
<kbd
|
|
875
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-key"
|
|
876
|
+
>
|
|
877
|
+
Shift
|
|
878
|
+
</kbd>
|
|
879
|
+
+
|
|
880
|
+
<kbd
|
|
881
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-key"
|
|
882
|
+
>
|
|
883
|
+
Alt
|
|
884
|
+
</kbd>
|
|
885
|
+
+
|
|
886
|
+
<kbd
|
|
887
|
+
class="edit-post-keyboard-shortcut-help-modal__shortcut-key"
|
|
888
|
+
>
|
|
889
|
+
1-6
|
|
890
|
+
</kbd>
|
|
891
|
+
</kbd>
|
|
892
|
+
</div>
|
|
893
|
+
</li>
|
|
824
894
|
</ul>
|
|
825
895
|
</section>
|
|
826
896
|
</div>
|
|
@@ -12,6 +12,7 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
12
12
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
13
13
|
import { store as noticesStore } from '@wordpress/notices';
|
|
14
14
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
15
|
+
import { createBlock } from '@wordpress/blocks';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Internal dependencies
|
|
@@ -53,6 +54,35 @@ function KeyboardShortcuts() {
|
|
|
53
54
|
closeGeneralSidebar();
|
|
54
55
|
};
|
|
55
56
|
|
|
57
|
+
const { replaceBlocks } = useDispatch( blockEditorStore );
|
|
58
|
+
const { getBlockName, getSelectedBlockClientId, getBlockAttributes } =
|
|
59
|
+
useSelect( blockEditorStore );
|
|
60
|
+
|
|
61
|
+
const handleTextLevelShortcut = ( event, level ) => {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
const destinationBlockName =
|
|
64
|
+
level === 0 ? 'core/paragraph' : 'core/heading';
|
|
65
|
+
const currentClientId = getSelectedBlockClientId();
|
|
66
|
+
if ( currentClientId === null ) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const blockName = getBlockName( currentClientId );
|
|
70
|
+
if ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const currentAttributes = getBlockAttributes( currentClientId );
|
|
74
|
+
const { content: currentContent, align: currentAlign } =
|
|
75
|
+
currentAttributes;
|
|
76
|
+
replaceBlocks(
|
|
77
|
+
currentClientId,
|
|
78
|
+
createBlock( destinationBlockName, {
|
|
79
|
+
level,
|
|
80
|
+
content: currentContent,
|
|
81
|
+
align: currentAlign,
|
|
82
|
+
} )
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
56
86
|
useEffect( () => {
|
|
57
87
|
registerShortcut( {
|
|
58
88
|
name: 'core/edit-post/toggle-mode',
|
|
@@ -133,6 +163,10 @@ function KeyboardShortcuts() {
|
|
|
133
163
|
modifier: 'access',
|
|
134
164
|
character: 'p',
|
|
135
165
|
},
|
|
166
|
+
{
|
|
167
|
+
modifier: 'ctrlShift',
|
|
168
|
+
character: '~',
|
|
169
|
+
},
|
|
136
170
|
],
|
|
137
171
|
} );
|
|
138
172
|
|
|
@@ -145,6 +179,28 @@ function KeyboardShortcuts() {
|
|
|
145
179
|
character: 'h',
|
|
146
180
|
},
|
|
147
181
|
} );
|
|
182
|
+
|
|
183
|
+
registerShortcut( {
|
|
184
|
+
name: `core/block-editor/transform-heading-to-paragraph`,
|
|
185
|
+
category: 'block-library',
|
|
186
|
+
description: __( 'Transform heading to paragraph.' ),
|
|
187
|
+
keyCombination: {
|
|
188
|
+
modifier: 'access',
|
|
189
|
+
character: `0`,
|
|
190
|
+
},
|
|
191
|
+
} );
|
|
192
|
+
|
|
193
|
+
[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
|
|
194
|
+
registerShortcut( {
|
|
195
|
+
name: `core/block-editor/transform-paragraph-to-heading-${ level }`,
|
|
196
|
+
category: 'block-library',
|
|
197
|
+
description: __( 'Transform paragraph to heading.' ),
|
|
198
|
+
keyCombination: {
|
|
199
|
+
modifier: 'access',
|
|
200
|
+
character: `${ level }`,
|
|
201
|
+
},
|
|
202
|
+
} );
|
|
203
|
+
} );
|
|
148
204
|
}, [] );
|
|
149
205
|
|
|
150
206
|
useShortcut(
|
|
@@ -198,6 +254,21 @@ function KeyboardShortcuts() {
|
|
|
198
254
|
setIsListViewOpened( ! isListViewOpened() )
|
|
199
255
|
);
|
|
200
256
|
|
|
257
|
+
useShortcut(
|
|
258
|
+
'core/block-editor/transform-heading-to-paragraph',
|
|
259
|
+
( event ) => handleTextLevelShortcut( event, 0 )
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
|
|
263
|
+
//the loop is based off on a constant therefore
|
|
264
|
+
//the hook will execute the same way every time
|
|
265
|
+
//eslint-disable-next-line react-hooks/rules-of-hooks
|
|
266
|
+
useShortcut(
|
|
267
|
+
`core/block-editor/transform-paragraph-to-heading-${ level }`,
|
|
268
|
+
( event ) => handleTextLevelShortcut( event, level )
|
|
269
|
+
);
|
|
270
|
+
} );
|
|
271
|
+
|
|
201
272
|
return null;
|
|
202
273
|
}
|
|
203
274
|
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
justify-content: center;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
64
63
|
.edit-post-layout__toggle-publish-panel,
|
|
65
64
|
.edit-post-layout__toggle-sidebar-panel,
|
|
66
65
|
.edit-post-layout__toggle-entities-saved-states-panel {
|
|
@@ -70,6 +69,7 @@
|
|
|
70
69
|
bottom: auto;
|
|
71
70
|
left: auto;
|
|
72
71
|
right: 0;
|
|
72
|
+
box-sizing: border-box;
|
|
73
73
|
width: $sidebar-width;
|
|
74
74
|
background-color: $white;
|
|
75
75
|
border: 1px dotted $gray-300;
|
|
@@ -77,7 +77,18 @@
|
|
|
77
77
|
padding: $grid-unit-30;
|
|
78
78
|
display: flex;
|
|
79
79
|
justify-content: center;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.edit-post-layout__toggle-sidebar-panel {
|
|
83
|
+
.interface-interface-skeleton__sidebar:focus &,
|
|
84
|
+
.interface-interface-skeleton__sidebar:focus-within & {
|
|
85
|
+
top: auto;
|
|
86
|
+
bottom: 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
80
89
|
|
|
90
|
+
.edit-post-layout__toggle-entities-saved-states-panel,
|
|
91
|
+
.edit-post-layout__toggle-publish-panel {
|
|
81
92
|
.interface-interface-skeleton__actions:focus &,
|
|
82
93
|
.interface-interface-skeleton__actions:focus-within & {
|
|
83
94
|
top: auto;
|
|
@@ -116,7 +116,7 @@ export default function EditPostPreferencesModal() {
|
|
|
116
116
|
help={ __(
|
|
117
117
|
'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'
|
|
118
118
|
) }
|
|
119
|
-
label={ __( 'Distraction
|
|
119
|
+
label={ __( 'Distraction free' ) }
|
|
120
120
|
/>
|
|
121
121
|
<EnableFeature
|
|
122
122
|
featureName="focusMode"
|
|
@@ -253,7 +253,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
253
253
|
class="components-toggle-control__label"
|
|
254
254
|
for="inspector-toggle-control-1"
|
|
255
255
|
>
|
|
256
|
-
Distraction
|
|
256
|
+
Distraction free
|
|
257
257
|
</label>
|
|
258
258
|
</div>
|
|
259
259
|
</div>
|
|
@@ -580,13 +580,13 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
580
580
|
}
|
|
581
581
|
|
|
582
582
|
.emotion-13:hover {
|
|
583
|
-
color: var( --wp-admin-theme-color, #007cba);
|
|
583
|
+
color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
584
584
|
}
|
|
585
585
|
|
|
586
586
|
.emotion-13:focus {
|
|
587
587
|
background-color: transparent;
|
|
588
|
-
color: var( --wp-admin-theme-color, #007cba);
|
|
589
|
-
border-color: var( --wp-admin-theme-color, #007cba);
|
|
588
|
+
color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
589
|
+
border-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
590
590
|
outline: 3px solid transparent;
|
|
591
591
|
}
|
|
592
592
|
|