@wordpress/edit-post 7.7.0 → 7.9.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 +4 -0
- package/README.md +6 -15
- package/build/components/header/header-toolbar/index.js +23 -3
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +1 -1
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/template-title/delete-template.js +1 -1
- package/build/components/header/template-title/delete-template.js.map +1 -1
- package/build/components/header/template-title/edit-template-title.js +2 -7
- package/build/components/header/template-title/edit-template-title.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +1 -2
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/start-page-options/index.js +1 -0
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/visual-editor/index.js +23 -8
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.native.js +1 -38
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/plugins/index.js +1 -1
- package/build/plugins/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +23 -4
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/template-title/delete-template.js +1 -1
- package/build-module/components/header/template-title/delete-template.js.map +1 -1
- package/build-module/components/header/template-title/edit-template-title.js +2 -7
- package/build-module/components/header/template-title/edit-template-title.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -2
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/start-page-options/index.js +1 -0
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +23 -8
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js +1 -37
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/plugins/index.js +1 -1
- package/build-module/plugins/index.js.map +1 -1
- package/build-style/style-rtl.css +74 -19
- package/build-style/style.css +74 -19
- package/package.json +31 -31
- package/src/components/header/header-toolbar/index.js +28 -3
- package/src/components/header/post-publish-button-or-toggle.js +1 -1
- package/src/components/header/template-title/delete-template.js +0 -1
- package/src/components/header/template-title/edit-template-title.js +4 -7
- package/src/components/layout/style.scss +12 -0
- package/src/components/secondary-sidebar/list-view-sidebar.js +1 -2
- package/src/components/secondary-sidebar/style.scss +20 -6
- package/src/components/start-page-options/index.js +1 -0
- package/src/components/start-page-options/style.scss +11 -15
- package/src/components/visual-editor/index.js +30 -13
- package/src/components/visual-editor/index.native.js +1 -36
- package/src/components/visual-editor/style.scss +1 -0
- package/src/plugins/index.js +1 -1
package/build-style/style.css
CHANGED
|
@@ -1238,6 +1238,12 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1238
1238
|
height: 61px;
|
|
1239
1239
|
}
|
|
1240
1240
|
|
|
1241
|
+
@media (min-width: 782px) {
|
|
1242
|
+
.edit-post-layout.has-fixed-toolbar .interface-interface-skeleton__header:not(:focus-within) {
|
|
1243
|
+
z-index: 19;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1241
1247
|
.edit-post-block-manager__no-results {
|
|
1242
1248
|
font-style: italic;
|
|
1243
1249
|
padding: 24px 0;
|
|
@@ -1400,6 +1406,10 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1400
1406
|
clear: both;
|
|
1401
1407
|
}
|
|
1402
1408
|
|
|
1409
|
+
/**
|
|
1410
|
+
* Note that this CSS file should be in sync with its counterpart in the other editor:
|
|
1411
|
+
* packages/edit-site/src/components/secondary-sidebar/style.scss
|
|
1412
|
+
*/
|
|
1403
1413
|
.edit-post-editor__inserter-panel,
|
|
1404
1414
|
.edit-post-editor__document-overview-panel {
|
|
1405
1415
|
height: 100%;
|
|
@@ -1407,8 +1417,10 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1407
1417
|
flex-direction: column;
|
|
1408
1418
|
}
|
|
1409
1419
|
|
|
1410
|
-
|
|
1411
|
-
|
|
1420
|
+
@media (min-width: 782px) {
|
|
1421
|
+
.edit-post-editor__document-overview-panel {
|
|
1422
|
+
width: 350px;
|
|
1423
|
+
}
|
|
1412
1424
|
}
|
|
1413
1425
|
.edit-post-editor__document-overview-panel .edit-post-sidebar__panel-tabs {
|
|
1414
1426
|
flex-direction: row-reverse;
|
|
@@ -1458,11 +1470,59 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1458
1470
|
.edit-post-editor__list-view-panel-content,
|
|
1459
1471
|
.edit-post-editor__list-view-container > .document-outline,
|
|
1460
1472
|
.edit-post-editor__list-view-empty-headings {
|
|
1461
|
-
overflow-x: hidden;
|
|
1462
|
-
overflow-y: auto;
|
|
1463
1473
|
height: 100%;
|
|
1474
|
+
scrollbar-width: thin;
|
|
1475
|
+
scrollbar-gutter: stable both-edges;
|
|
1476
|
+
scrollbar-color: transparent transparent;
|
|
1477
|
+
will-change: transform;
|
|
1478
|
+
overflow: auto;
|
|
1479
|
+
scrollbar-gutter: auto;
|
|
1464
1480
|
padding: 8px 6px;
|
|
1465
1481
|
}
|
|
1482
|
+
.edit-post-editor__list-view-panel-content::-webkit-scrollbar,
|
|
1483
|
+
.edit-post-editor__list-view-container > .document-outline::-webkit-scrollbar,
|
|
1484
|
+
.edit-post-editor__list-view-empty-headings::-webkit-scrollbar {
|
|
1485
|
+
width: 12px;
|
|
1486
|
+
height: 12px;
|
|
1487
|
+
}
|
|
1488
|
+
.edit-post-editor__list-view-panel-content::-webkit-scrollbar-track,
|
|
1489
|
+
.edit-post-editor__list-view-container > .document-outline::-webkit-scrollbar-track,
|
|
1490
|
+
.edit-post-editor__list-view-empty-headings::-webkit-scrollbar-track {
|
|
1491
|
+
background-color: transparent;
|
|
1492
|
+
}
|
|
1493
|
+
.edit-post-editor__list-view-panel-content::-webkit-scrollbar-thumb,
|
|
1494
|
+
.edit-post-editor__list-view-container > .document-outline::-webkit-scrollbar-thumb,
|
|
1495
|
+
.edit-post-editor__list-view-empty-headings::-webkit-scrollbar-thumb {
|
|
1496
|
+
background-color: transparent;
|
|
1497
|
+
border-radius: 8px;
|
|
1498
|
+
border: 3px solid transparent;
|
|
1499
|
+
background-clip: padding-box;
|
|
1500
|
+
}
|
|
1501
|
+
.edit-post-editor__list-view-panel-content:hover::-webkit-scrollbar-thumb, .edit-post-editor__list-view-panel-content:focus::-webkit-scrollbar-thumb, .edit-post-editor__list-view-panel-content:focus-within::-webkit-scrollbar-thumb,
|
|
1502
|
+
.edit-post-editor__list-view-container > .document-outline:hover::-webkit-scrollbar-thumb,
|
|
1503
|
+
.edit-post-editor__list-view-container > .document-outline:focus::-webkit-scrollbar-thumb,
|
|
1504
|
+
.edit-post-editor__list-view-container > .document-outline:focus-within::-webkit-scrollbar-thumb,
|
|
1505
|
+
.edit-post-editor__list-view-empty-headings:hover::-webkit-scrollbar-thumb,
|
|
1506
|
+
.edit-post-editor__list-view-empty-headings:focus::-webkit-scrollbar-thumb,
|
|
1507
|
+
.edit-post-editor__list-view-empty-headings:focus-within::-webkit-scrollbar-thumb {
|
|
1508
|
+
background-color: #949494;
|
|
1509
|
+
}
|
|
1510
|
+
.edit-post-editor__list-view-panel-content:hover, .edit-post-editor__list-view-panel-content:focus, .edit-post-editor__list-view-panel-content:focus-within,
|
|
1511
|
+
.edit-post-editor__list-view-container > .document-outline:hover,
|
|
1512
|
+
.edit-post-editor__list-view-container > .document-outline:focus,
|
|
1513
|
+
.edit-post-editor__list-view-container > .document-outline:focus-within,
|
|
1514
|
+
.edit-post-editor__list-view-empty-headings:hover,
|
|
1515
|
+
.edit-post-editor__list-view-empty-headings:focus,
|
|
1516
|
+
.edit-post-editor__list-view-empty-headings:focus-within {
|
|
1517
|
+
scrollbar-color: #949494 transparent;
|
|
1518
|
+
}
|
|
1519
|
+
@media (hover: none) {
|
|
1520
|
+
.edit-post-editor__list-view-panel-content,
|
|
1521
|
+
.edit-post-editor__list-view-container > .document-outline,
|
|
1522
|
+
.edit-post-editor__list-view-empty-headings {
|
|
1523
|
+
scrollbar-color: #949494 transparent;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1466
1526
|
|
|
1467
1527
|
.edit-post-editor__list-view-empty-headings {
|
|
1468
1528
|
text-align: center;
|
|
@@ -1799,6 +1859,7 @@ h2.edit-post-template-summary__title {
|
|
|
1799
1859
|
position: relative;
|
|
1800
1860
|
display: flex;
|
|
1801
1861
|
flex-flow: column;
|
|
1862
|
+
overflow: hidden;
|
|
1802
1863
|
background-color: #2f2f2f;
|
|
1803
1864
|
flex: 1 0 auto;
|
|
1804
1865
|
}
|
|
@@ -1880,27 +1941,21 @@ h2.edit-post-template-summary__title {
|
|
|
1880
1941
|
fill: #fff;
|
|
1881
1942
|
}
|
|
1882
1943
|
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
}
|
|
1944
|
+
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
|
|
1945
|
+
column-count: 2;
|
|
1946
|
+
column-gap: 24px;
|
|
1947
|
+
padding-top: 2px;
|
|
1888
1948
|
}
|
|
1889
1949
|
@media (min-width: 782px) {
|
|
1890
|
-
.edit-post-start-page-options__modal {
|
|
1891
|
-
|
|
1950
|
+
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
|
|
1951
|
+
column-count: 3;
|
|
1892
1952
|
}
|
|
1893
1953
|
}
|
|
1894
|
-
@media (min-width:
|
|
1895
|
-
.edit-post-start-page-options__modal {
|
|
1896
|
-
|
|
1954
|
+
@media (min-width: 1280px) {
|
|
1955
|
+
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
|
|
1956
|
+
column-count: 4;
|
|
1897
1957
|
}
|
|
1898
1958
|
}
|
|
1899
|
-
|
|
1900
|
-
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
|
|
1901
|
-
column-count: 2;
|
|
1902
|
-
column-gap: 24px;
|
|
1903
|
-
}
|
|
1904
1959
|
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item {
|
|
1905
1960
|
break-inside: avoid-column;
|
|
1906
1961
|
margin-bottom: 24px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.9.0",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,37 +27,37 @@
|
|
|
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": "^
|
|
33
|
-
"@wordpress/block-library": "^8.
|
|
34
|
-
"@wordpress/blocks": "^12.
|
|
35
|
-
"@wordpress/components": "^23.
|
|
36
|
-
"@wordpress/compose": "^6.
|
|
37
|
-
"@wordpress/core-data": "^6.
|
|
38
|
-
"@wordpress/data": "^9.
|
|
39
|
-
"@wordpress/deprecated": "^3.
|
|
40
|
-
"@wordpress/dom": "^3.
|
|
41
|
-
"@wordpress/editor": "^13.
|
|
42
|
-
"@wordpress/element": "^5.
|
|
43
|
-
"@wordpress/hooks": "^3.
|
|
44
|
-
"@wordpress/i18n": "^4.
|
|
45
|
-
"@wordpress/icons": "^9.
|
|
46
|
-
"@wordpress/interface": "^5.
|
|
47
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
48
|
-
"@wordpress/keycodes": "^3.
|
|
49
|
-
"@wordpress/media-utils": "^4.
|
|
50
|
-
"@wordpress/notices": "^
|
|
51
|
-
"@wordpress/plugins": "^
|
|
52
|
-
"@wordpress/preferences": "^3.
|
|
53
|
-
"@wordpress/private-apis": "^0.
|
|
54
|
-
"@wordpress/url": "^3.
|
|
55
|
-
"@wordpress/viewport": "^5.
|
|
56
|
-
"@wordpress/warning": "^2.
|
|
57
|
-
"@wordpress/widgets": "^3.
|
|
30
|
+
"@wordpress/a11y": "^3.32.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.29.0",
|
|
32
|
+
"@wordpress/block-editor": "^12.0.0",
|
|
33
|
+
"@wordpress/block-library": "^8.9.0",
|
|
34
|
+
"@wordpress/blocks": "^12.9.0",
|
|
35
|
+
"@wordpress/components": "^23.9.0",
|
|
36
|
+
"@wordpress/compose": "^6.9.0",
|
|
37
|
+
"@wordpress/core-data": "^6.9.0",
|
|
38
|
+
"@wordpress/data": "^9.2.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.32.0",
|
|
40
|
+
"@wordpress/dom": "^3.32.0",
|
|
41
|
+
"@wordpress/editor": "^13.9.0",
|
|
42
|
+
"@wordpress/element": "^5.9.0",
|
|
43
|
+
"@wordpress/hooks": "^3.32.0",
|
|
44
|
+
"@wordpress/i18n": "^4.32.0",
|
|
45
|
+
"@wordpress/icons": "^9.23.0",
|
|
46
|
+
"@wordpress/interface": "^5.9.0",
|
|
47
|
+
"@wordpress/keyboard-shortcuts": "^4.9.0",
|
|
48
|
+
"@wordpress/keycodes": "^3.32.0",
|
|
49
|
+
"@wordpress/media-utils": "^4.23.0",
|
|
50
|
+
"@wordpress/notices": "^4.0.0",
|
|
51
|
+
"@wordpress/plugins": "^6.0.0",
|
|
52
|
+
"@wordpress/preferences": "^3.9.0",
|
|
53
|
+
"@wordpress/private-apis": "^0.14.0",
|
|
54
|
+
"@wordpress/url": "^3.33.0",
|
|
55
|
+
"@wordpress/viewport": "^5.9.0",
|
|
56
|
+
"@wordpress/warning": "^2.32.0",
|
|
57
|
+
"@wordpress/widgets": "^3.9.0",
|
|
58
58
|
"classnames": "^2.3.1",
|
|
59
59
|
"memize": "^1.1.0",
|
|
60
|
-
"rememo": "^4.0.
|
|
60
|
+
"rememo": "^4.0.2"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"react": "^18.0.0",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "6df0c62d43b8901414ccd22ffbe56eaa99d012a6"
|
|
70
70
|
}
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
NavigableToolbar,
|
|
9
9
|
ToolSelector,
|
|
10
10
|
store as blockEditorStore,
|
|
11
|
+
privateApis as blockEditorPrivateApis,
|
|
11
12
|
} from '@wordpress/block-editor';
|
|
12
13
|
import {
|
|
13
14
|
EditorHistoryRedo,
|
|
@@ -23,6 +24,7 @@ import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
|
23
24
|
* Internal dependencies
|
|
24
25
|
*/
|
|
25
26
|
import { store as editPostStore } from '../../../store';
|
|
27
|
+
import { unlock } from '../../../private-apis';
|
|
26
28
|
|
|
27
29
|
const preventDefault = ( event ) => {
|
|
28
30
|
event.preventDefault();
|
|
@@ -39,15 +41,27 @@ function HeaderToolbar() {
|
|
|
39
41
|
showIconLabels,
|
|
40
42
|
isListViewOpen,
|
|
41
43
|
listViewShortcut,
|
|
44
|
+
selectedBlockId,
|
|
45
|
+
hasFixedToolbar,
|
|
42
46
|
} = useSelect( ( select ) => {
|
|
43
|
-
const {
|
|
44
|
-
|
|
47
|
+
const {
|
|
48
|
+
hasInserterItems,
|
|
49
|
+
getBlockRootClientId,
|
|
50
|
+
getBlockSelectionEnd,
|
|
51
|
+
getSelectedBlockClientId,
|
|
52
|
+
getFirstMultiSelectedBlockClientId,
|
|
53
|
+
getSettings,
|
|
54
|
+
} = select( blockEditorStore );
|
|
45
55
|
const { getEditorSettings } = select( editorStore );
|
|
46
56
|
const { getEditorMode, isFeatureActive, isListViewOpened } =
|
|
47
57
|
select( editPostStore );
|
|
48
58
|
const { getShortcutRepresentation } = select( keyboardShortcutsStore );
|
|
49
59
|
|
|
50
60
|
return {
|
|
61
|
+
hasFixedToolbar: getSettings().hasFixedToolbar,
|
|
62
|
+
selectedBlockId:
|
|
63
|
+
getSelectedBlockClientId() ||
|
|
64
|
+
getFirstMultiSelectedBlockClientId(),
|
|
51
65
|
// This setting (richEditingEnabled) should not live in the block editor's setting.
|
|
52
66
|
isInserterEnabled:
|
|
53
67
|
getEditorMode() === 'visual' &&
|
|
@@ -64,9 +78,19 @@ function HeaderToolbar() {
|
|
|
64
78
|
),
|
|
65
79
|
};
|
|
66
80
|
}, [] );
|
|
81
|
+
|
|
82
|
+
const { useShouldContextualToolbarShow } = unlock( blockEditorPrivateApis );
|
|
83
|
+
|
|
67
84
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
68
85
|
const isWideViewport = useViewportMatch( 'wide' );
|
|
69
|
-
|
|
86
|
+
const { shouldShowContextualToolbar, canFocusHiddenToolbar } =
|
|
87
|
+
useShouldContextualToolbarShow( selectedBlockId );
|
|
88
|
+
// If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.
|
|
89
|
+
// There's a fixed block toolbar when the fixed toolbar option is enabled or when the browser width is less than the large viewport.
|
|
90
|
+
const blockToolbarCanBeFocused =
|
|
91
|
+
shouldShowContextualToolbar ||
|
|
92
|
+
canFocusHiddenToolbar ||
|
|
93
|
+
( ( hasFixedToolbar || ! isLargeViewport ) && selectedBlockId );
|
|
70
94
|
/* translators: accessibility text for the editor toolbar */
|
|
71
95
|
const toolbarAriaLabel = __( 'Document tools' );
|
|
72
96
|
|
|
@@ -114,6 +138,7 @@ function HeaderToolbar() {
|
|
|
114
138
|
<NavigableToolbar
|
|
115
139
|
className="edit-post-header-toolbar"
|
|
116
140
|
aria-label={ toolbarAriaLabel }
|
|
141
|
+
shouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }
|
|
117
142
|
>
|
|
118
143
|
<div className="edit-post-header-toolbar__left">
|
|
119
144
|
<ToolbarItem
|
|
@@ -32,7 +32,7 @@ export function PostPublishButtonOrToggle( {
|
|
|
32
32
|
* Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):
|
|
33
33
|
*
|
|
34
34
|
* 1) We want to show a BUTTON when the post status is at the _final stage_
|
|
35
|
-
* for a particular role (see https://wordpress.org/
|
|
35
|
+
* for a particular role (see https://wordpress.org/documentation/article/post-status/):
|
|
36
36
|
*
|
|
37
37
|
* - is published
|
|
38
38
|
* - is scheduled to be published
|
|
@@ -58,16 +58,13 @@ export default function EditTemplateTitle() {
|
|
|
58
58
|
const settings = getEditorSettings();
|
|
59
59
|
const newAvailableTemplates = Object.fromEntries(
|
|
60
60
|
Object.entries( settings.availableTemplates ?? {} ).map(
|
|
61
|
-
( [ id, existingTitle ] ) =>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return newTitle;
|
|
66
|
-
}
|
|
61
|
+
( [ id, existingTitle ] ) => [
|
|
62
|
+
id,
|
|
63
|
+
id !== template.slug ? existingTitle : newTitle,
|
|
64
|
+
]
|
|
67
65
|
)
|
|
68
66
|
);
|
|
69
67
|
updateEditorSettings( {
|
|
70
|
-
...settings,
|
|
71
68
|
availableTemplates: newAvailableTemplates,
|
|
72
69
|
} );
|
|
73
70
|
editEntityRecord( 'postType', 'wp_template', template.id, {
|
|
@@ -99,3 +99,15 @@
|
|
|
99
99
|
.edit-post-layout .entities-saved-states__panel-header {
|
|
100
100
|
height: $header-height + $border-width;
|
|
101
101
|
}
|
|
102
|
+
|
|
103
|
+
.edit-post-layout.has-fixed-toolbar {
|
|
104
|
+
// making the header be lower than the content
|
|
105
|
+
// so the fixed toolbar can be positioned on top of it
|
|
106
|
+
// but only on desktop
|
|
107
|
+
@include break-medium() {
|
|
108
|
+
.interface-interface-skeleton__header:not(:focus-within) {
|
|
109
|
+
z-index: 19;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
}
|
|
@@ -96,7 +96,6 @@ export default function ListViewSidebar() {
|
|
|
96
96
|
return (
|
|
97
97
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
98
98
|
<div
|
|
99
|
-
aria-label={ __( 'Document Overview' ) }
|
|
100
99
|
className="edit-post-editor__document-overview-panel"
|
|
101
100
|
onKeyDown={ closeOnEscape }
|
|
102
101
|
ref={ sidebarRef }
|
|
@@ -107,7 +106,7 @@ export default function ListViewSidebar() {
|
|
|
107
106
|
>
|
|
108
107
|
<Button
|
|
109
108
|
icon={ closeSmall }
|
|
110
|
-
label={ __( 'Close
|
|
109
|
+
label={ __( 'Close' ) }
|
|
111
110
|
onClick={ () => setIsListViewOpened( false ) }
|
|
112
111
|
/>
|
|
113
112
|
<ul>
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note that this CSS file should be in sync with its counterpart in the other editor:
|
|
3
|
+
* packages/edit-site/src/components/secondary-sidebar/style.scss
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
.edit-post-editor__inserter-panel,
|
|
2
7
|
.edit-post-editor__document-overview-panel {
|
|
3
8
|
height: 100%;
|
|
@@ -6,10 +11,11 @@
|
|
|
6
11
|
}
|
|
7
12
|
|
|
8
13
|
.edit-post-editor__document-overview-panel {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
@include break-medium() {
|
|
15
|
+
// Same width as the Inserter.
|
|
16
|
+
// @see packages/block-editor/src/components/inserter/style.scss
|
|
17
|
+
width: 350px;
|
|
18
|
+
}
|
|
13
19
|
|
|
14
20
|
.edit-post-sidebar__panel-tabs {
|
|
15
21
|
flex-direction: row-reverse;
|
|
@@ -62,9 +68,17 @@
|
|
|
62
68
|
.edit-post-editor__list-view-panel-content,
|
|
63
69
|
.edit-post-editor__list-view-container > .document-outline,
|
|
64
70
|
.edit-post-editor__list-view-empty-headings {
|
|
65
|
-
overflow-x: hidden;
|
|
66
|
-
overflow-y: auto;
|
|
67
71
|
height: 100%;
|
|
72
|
+
|
|
73
|
+
// Include custom scrollbars, invisible until hovered.
|
|
74
|
+
@include custom-scrollbars-on-hover(transparent, $gray-600);
|
|
75
|
+
overflow: auto;
|
|
76
|
+
|
|
77
|
+
// Only reserve space for scrollbars when there is content to scroll.
|
|
78
|
+
// This allows items in the list view to have equidistant padding left and right
|
|
79
|
+
// right up until a scrollbar is present.
|
|
80
|
+
scrollbar-gutter: auto;
|
|
81
|
+
|
|
68
82
|
// The table cells use an extra pixels of space left and right. We compensate for that here.
|
|
69
83
|
padding: $grid-unit-10 ($grid-unit-10 - $border-width - $border-width);
|
|
70
84
|
}
|
|
@@ -113,6 +113,7 @@ export default function StartPageOptions() {
|
|
|
113
113
|
<Modal
|
|
114
114
|
className="edit-post-start-page-options__modal"
|
|
115
115
|
title={ __( 'Choose a pattern' ) }
|
|
116
|
+
isFullScreen={ true }
|
|
116
117
|
onRequestClose={ () => {
|
|
117
118
|
setModalState( START_PAGE_MODAL_STATES.CLOSED );
|
|
118
119
|
} }
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
.edit-post-start-page-options__modal {
|
|
2
|
-
// To keep modal dimensions consistent as subsections are navigated, width
|
|
3
|
-
// and height are used instead of max-(width/height).
|
|
4
|
-
@include break-small() {
|
|
5
|
-
width: calc(100% - #{ $grid-unit-20 * 2 });
|
|
6
|
-
height: calc(100% - #{ $header-height * 2 });
|
|
7
|
-
}
|
|
8
|
-
@include break-medium() {
|
|
9
|
-
width: $break-medium - $grid-unit-20 * 2;
|
|
10
|
-
}
|
|
11
|
-
@include break-large() {
|
|
12
|
-
height: 70%;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
1
|
// 2 column masonry layout.
|
|
17
2
|
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
|
|
18
3
|
column-count: 2;
|
|
19
4
|
column-gap: $grid-unit-30;
|
|
20
5
|
|
|
6
|
+
// Small top padding required to avoid cutting off the visible outline when hovering items
|
|
7
|
+
padding-top: $border-width-focus;
|
|
8
|
+
|
|
9
|
+
@include break-medium() {
|
|
10
|
+
column-count: 3;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@include break-wide() {
|
|
14
|
+
column-count: 4;
|
|
15
|
+
}
|
|
16
|
+
|
|
21
17
|
.block-editor-block-patterns-list__list-item {
|
|
22
18
|
break-inside: avoid-column;
|
|
23
19
|
margin-bottom: $grid-unit-30;
|
|
@@ -160,15 +160,21 @@ export default function VisualEditor( { styles } ) {
|
|
|
160
160
|
( select ) => select( editPostStore ).hasMetaBoxes(),
|
|
161
161
|
[]
|
|
162
162
|
);
|
|
163
|
-
const {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
163
|
+
const {
|
|
164
|
+
hasRootPaddingAwareAlignments,
|
|
165
|
+
isFocusMode,
|
|
166
|
+
themeHasDisabledLayoutStyles,
|
|
167
|
+
themeSupportsLayout,
|
|
168
|
+
} = useSelect( ( select ) => {
|
|
169
|
+
const _settings = select( blockEditorStore ).getSettings();
|
|
170
|
+
return {
|
|
171
|
+
themeHasDisabledLayoutStyles: _settings.disableLayoutStyles,
|
|
172
|
+
themeSupportsLayout: _settings.supportsLayout,
|
|
173
|
+
isFocusMode: _settings.focusMode,
|
|
174
|
+
hasRootPaddingAwareAlignments:
|
|
175
|
+
_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,
|
|
176
|
+
};
|
|
177
|
+
}, [] );
|
|
172
178
|
const { clearSelectedBlock } = useDispatch( blockEditorStore );
|
|
173
179
|
const { setIsEditingTemplate } = useDispatch( editPostStore );
|
|
174
180
|
const desktopCanvasStyles = {
|
|
@@ -255,7 +261,7 @@ export default function VisualEditor( { styles } ) {
|
|
|
255
261
|
postContentAttributes,
|
|
256
262
|
] );
|
|
257
263
|
|
|
258
|
-
const layout = newestPostContentAttributes
|
|
264
|
+
const { layout = {}, align = '' } = newestPostContentAttributes || {};
|
|
259
265
|
|
|
260
266
|
const postContentLayoutClasses = useLayoutClasses(
|
|
261
267
|
newestPostContentAttributes,
|
|
@@ -266,7 +272,8 @@ export default function VisualEditor( { styles } ) {
|
|
|
266
272
|
{
|
|
267
273
|
'is-layout-flow': ! themeSupportsLayout,
|
|
268
274
|
},
|
|
269
|
-
themeSupportsLayout && postContentLayoutClasses
|
|
275
|
+
themeSupportsLayout && postContentLayoutClasses,
|
|
276
|
+
align && `align${ align }`
|
|
270
277
|
);
|
|
271
278
|
|
|
272
279
|
const postContentLayoutStyles = useLayoutStyles(
|
|
@@ -321,6 +328,12 @@ export default function VisualEditor( { styles } ) {
|
|
|
321
328
|
[ styles ]
|
|
322
329
|
);
|
|
323
330
|
|
|
331
|
+
// Add some styles for alignwide/alignfull Post Content and its children.
|
|
332
|
+
const alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}
|
|
333
|
+
.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}
|
|
334
|
+
.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}
|
|
335
|
+
.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;
|
|
336
|
+
|
|
324
337
|
return (
|
|
325
338
|
<BlockTools
|
|
326
339
|
__unstableContentRef={ ref }
|
|
@@ -376,6 +389,9 @@ export default function VisualEditor( { styles } ) {
|
|
|
376
389
|
globalLayoutSettings?.definitions
|
|
377
390
|
}
|
|
378
391
|
/>
|
|
392
|
+
{ align && (
|
|
393
|
+
<LayoutStyle css={ alignCSS } />
|
|
394
|
+
) }
|
|
379
395
|
{ postContentLayoutStyles && (
|
|
380
396
|
<LayoutStyle
|
|
381
397
|
layout={ postContentLayout }
|
|
@@ -393,8 +409,9 @@ export default function VisualEditor( { styles } ) {
|
|
|
393
409
|
'edit-post-visual-editor__post-title-wrapper',
|
|
394
410
|
{
|
|
395
411
|
'is-focus-mode': isFocusMode,
|
|
396
|
-
|
|
397
|
-
|
|
412
|
+
'has-global-padding':
|
|
413
|
+
hasRootPaddingAwareAlignments,
|
|
414
|
+
}
|
|
398
415
|
) }
|
|
399
416
|
contentEditable={ false }
|
|
400
417
|
>
|
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Component } from '@wordpress/element';
|
|
5
5
|
import { BlockList } from '@wordpress/block-editor';
|
|
6
|
-
|
|
7
|
-
* External dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { Keyboard } from 'react-native';
|
|
6
|
+
|
|
10
7
|
/**
|
|
11
8
|
* Internal dependencies
|
|
12
9
|
*/
|
|
@@ -16,36 +13,6 @@ export default class VisualEditor extends Component {
|
|
|
16
13
|
constructor( props ) {
|
|
17
14
|
super( props );
|
|
18
15
|
this.renderHeader = this.renderHeader.bind( this );
|
|
19
|
-
this.keyboardDidShow = this.keyboardDidShow.bind( this );
|
|
20
|
-
this.keyboardDidHide = this.keyboardDidHide.bind( this );
|
|
21
|
-
|
|
22
|
-
this.state = {
|
|
23
|
-
isAutoScrollEnabled: true,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
componentDidMount() {
|
|
28
|
-
this.keyboardDidShow = Keyboard.addListener(
|
|
29
|
-
'keyboardDidShow',
|
|
30
|
-
this.keyboardDidShow
|
|
31
|
-
);
|
|
32
|
-
this.keyboardDidHideListener = Keyboard.addListener(
|
|
33
|
-
'keyboardDidHide',
|
|
34
|
-
this.keyboardDidHide
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
componentWillUnmount() {
|
|
39
|
-
this.keyboardDidShow.remove();
|
|
40
|
-
this.keyboardDidHideListener.remove();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
keyboardDidShow() {
|
|
44
|
-
this.setState( { isAutoScrollEnabled: false } );
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
keyboardDidHide() {
|
|
48
|
-
this.setState( { isAutoScrollEnabled: true } );
|
|
49
16
|
}
|
|
50
17
|
|
|
51
18
|
renderHeader() {
|
|
@@ -55,13 +22,11 @@ export default class VisualEditor extends Component {
|
|
|
55
22
|
|
|
56
23
|
render() {
|
|
57
24
|
const { safeAreaBottomInset } = this.props;
|
|
58
|
-
const { isAutoScrollEnabled } = this.state;
|
|
59
25
|
|
|
60
26
|
return (
|
|
61
27
|
<BlockList
|
|
62
28
|
header={ this.renderHeader }
|
|
63
29
|
safeAreaBottomInset={ safeAreaBottomInset }
|
|
64
|
-
autoScroll={ isAutoScrollEnabled }
|
|
65
30
|
/>
|
|
66
31
|
);
|
|
67
32
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
position: relative;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-flow: column;
|
|
5
|
+
overflow: hidden;
|
|
5
6
|
|
|
6
7
|
// Gray preview overlay (desktop/tablet/mobile) is intentionally not set on an element with scrolling content like
|
|
7
8
|
// interface-interface-skeleton__content. This causes graphical glitches (flashes of the background color)
|
package/src/plugins/index.js
CHANGED
|
@@ -39,7 +39,7 @@ registerPlugin( 'edit-post', {
|
|
|
39
39
|
role="menuitem"
|
|
40
40
|
icon={ external }
|
|
41
41
|
href={ __(
|
|
42
|
-
'https://wordpress.org/
|
|
42
|
+
'https://wordpress.org/documentation/article/wordpress-block-editor/'
|
|
43
43
|
) }
|
|
44
44
|
target="_blank"
|
|
45
45
|
rel="noopener noreferrer"
|