@wordpress/edit-post 6.5.0 → 6.8.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.map +1 -1
- package/build/components/block-manager/index.js +12 -4
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/device-preview/index.js +26 -7
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/template-title/delete-template.js +6 -5
- package/build/components/header/template-title/delete-template.js.map +1 -1
- package/build/components/header/template-title/edit-template-title.js +6 -4
- package/build/components/header/template-title/edit-template-title.js.map +1 -1
- package/build/components/header/template-title/index.js.map +1 -1
- package/build/components/header/template-title/template-description.js +3 -1
- package/build/components/header/template-title/template-description.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/preferences-modal/index.js +10 -6
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/page-attributes/index.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build/components/sidebar/post-link/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +9 -2
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/template/actions.js +7 -2
- package/build/components/sidebar/template/actions.js.map +1 -1
- package/build/components/sidebar/template/index.js.map +1 -1
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/text-editor/index.js +11 -24
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +3 -7
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +8 -0
- package/build/editor.native.js.map +1 -1
- package/build/index.js +7 -1
- package/build/index.js.map +1 -1
- package/build/plugins/copy-content-menu-item/index.js +1 -1
- package/build/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +4 -4
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/index.js +13 -5
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/device-preview/index.js +24 -7
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js.map +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 +6 -5
- package/build-module/components/header/template-title/delete-template.js.map +1 -1
- package/build-module/components/header/template-title/edit-template-title.js +6 -4
- package/build-module/components/header/template-title/edit-template-title.js.map +1 -1
- package/build-module/components/header/template-title/index.js.map +1 -1
- package/build-module/components/header/template-title/template-description.js +4 -2
- package/build-module/components/header/template-title/template-description.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +10 -6
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build-module/components/sidebar/featured-image/index.js.map +1 -1
- package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build-module/components/sidebar/post-link/index.js.map +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +9 -2
- package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/template/actions.js +8 -3
- package/build-module/components/sidebar/template/actions.js.map +1 -1
- package/build-module/components/sidebar/template/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +11 -22
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +3 -5
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +8 -0
- package/build-module/editor.native.js.map +1 -1
- package/build-module/index.js +7 -1
- package/build-module/index.js.map +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +4 -4
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +32 -18
- package/build-style/style.css +32 -18
- package/package.json +28 -28
- package/src/components/block-manager/category.js +2 -2
- package/src/components/block-manager/index.js +15 -4
- package/src/components/device-preview/index.js +40 -29
- package/src/components/editor-initialization/listener-hooks.js +2 -3
- package/src/components/header/fullscreen-mode-close/index.js +2 -3
- package/src/components/header/header-toolbar/index.js +6 -11
- package/src/components/header/index.js +6 -9
- package/src/components/header/mode-switcher/index.js +4 -4
- package/src/components/header/post-publish-button-or-toggle.js +4 -6
- package/src/components/header/style.scss +2 -4
- package/src/components/header/template-title/delete-template.js +13 -7
- package/src/components/header/template-title/edit-template-title.js +29 -26
- package/src/components/header/template-title/index.js +2 -3
- package/src/components/header/template-title/style.scss +26 -5
- package/src/components/header/template-title/template-description.js +3 -2
- package/src/components/header/tools-more-menu-group/index.js +2 -3
- package/src/components/keyboard-shortcut-help-modal/test/index.js +2 -1
- package/src/components/keyboard-shortcuts/index.js +4 -8
- package/src/components/layout/actions-panel.js +6 -9
- package/src/components/layout/index.js +13 -21
- package/src/components/layout/index.native.js +4 -5
- package/src/components/preferences-modal/index.js +18 -9
- package/src/components/preferences-modal/options/enable-custom-fields.js +2 -2
- package/src/components/preferences-modal/options/enable-panel.js +2 -3
- package/src/components/preferences-modal/options/enable-publish-sidebar.js +2 -3
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +24 -14
- package/src/components/secondary-sidebar/inserter-sidebar.js +2 -3
- package/src/components/sidebar/discussion-panel/index.js +2 -3
- package/src/components/sidebar/featured-image/index.js +2 -3
- package/src/components/sidebar/page-attributes/index.js +2 -3
- package/src/components/sidebar/plugin-document-setting-panel/index.js +2 -3
- package/src/components/sidebar/plugin-sidebar/index.js +2 -3
- package/src/components/sidebar/post-excerpt/index.js +2 -3
- package/src/components/sidebar/post-link/index.js +2 -3
- package/src/components/sidebar/post-schedule/index.js +4 -2
- package/src/components/sidebar/post-schedule/style.scss +3 -5
- package/src/components/sidebar/post-status/index.js +2 -3
- package/src/components/sidebar/post-visibility/style.scss +2 -1
- package/src/components/sidebar/settings-header/style.scss +1 -1
- package/src/components/sidebar/template/actions.js +11 -8
- package/src/components/sidebar/template/index.js +2 -6
- package/src/components/start-page-options/index.js +8 -12
- package/src/components/text-editor/index.js +9 -19
- package/src/components/visual-editor/block-inspector-button.js +4 -8
- package/src/components/visual-editor/test/index.native.js +93 -0
- package/src/editor.js +6 -8
- package/src/editor.native.js +11 -4
- package/src/index.js +7 -0
- package/src/plugins/copy-content-menu-item/index.js +1 -1
- package/src/store/actions.js +322 -295
- package/src/store/selectors.js +20 -20
|
@@ -49,7 +49,18 @@
|
|
|
49
49
|
.edit-post-template-top-area__popover {
|
|
50
50
|
.components-popover__content {
|
|
51
51
|
min-width: 280px;
|
|
52
|
-
|
|
52
|
+
|
|
53
|
+
> div {
|
|
54
|
+
padding: 0;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.edit-site-template-details__group {
|
|
59
|
+
padding: $grid-unit-20;
|
|
60
|
+
|
|
61
|
+
.components-base-control__help {
|
|
62
|
+
margin-bottom: 0;
|
|
63
|
+
}
|
|
53
64
|
}
|
|
54
65
|
|
|
55
66
|
.edit-post-template-details__description {
|
|
@@ -58,19 +69,29 @@
|
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
.edit-post-template-top-area__second-menu-group {
|
|
61
|
-
margin-left: -$grid-unit-20;
|
|
62
|
-
margin-right: -$grid-unit-20;
|
|
63
|
-
padding: $grid-unit-20;
|
|
64
|
-
padding-bottom: 0;
|
|
65
72
|
border-top: $border-width solid $gray-300;
|
|
73
|
+
padding: $grid-unit-20 $grid-unit-10;
|
|
66
74
|
|
|
67
75
|
.edit-post-template-top-area__delete-template-button {
|
|
68
76
|
display: flex;
|
|
69
77
|
justify-content: center;
|
|
78
|
+
padding: $grid-unit-05 $grid-unit;
|
|
79
|
+
|
|
80
|
+
&.is-destructive {
|
|
81
|
+
padding: inherit;
|
|
82
|
+
margin-left: $grid-unit-10;
|
|
83
|
+
margin-right: $grid-unit-10;
|
|
84
|
+
width: calc(100% - #{($grid-unit * 2)});
|
|
85
|
+
|
|
86
|
+
.components-menu-item__item {
|
|
87
|
+
width: auto;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
70
90
|
|
|
71
91
|
.components-menu-item__item {
|
|
72
92
|
margin-right: 0;
|
|
73
93
|
min-width: 0;
|
|
94
|
+
width: 100%;
|
|
74
95
|
}
|
|
75
96
|
}
|
|
76
97
|
}
|
|
@@ -23,8 +23,9 @@ export default function TemplateDescription() {
|
|
|
23
23
|
if ( ! description ) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
+
|
|
26
27
|
return (
|
|
27
|
-
|
|
28
|
+
<div className="edit-site-template-details__group">
|
|
28
29
|
<Heading level={ 4 } weight={ 600 }>
|
|
29
30
|
{ title }
|
|
30
31
|
</Heading>
|
|
@@ -36,6 +37,6 @@ export default function TemplateDescription() {
|
|
|
36
37
|
>
|
|
37
38
|
{ description }
|
|
38
39
|
</Text>
|
|
39
|
-
|
|
40
|
+
</div>
|
|
40
41
|
);
|
|
41
42
|
}
|
|
@@ -9,9 +9,8 @@ import { isEmpty } from 'lodash';
|
|
|
9
9
|
import { createSlotFill, MenuGroup } from '@wordpress/components';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
|
|
12
|
-
const { Fill: ToolsMoreMenuGroup, Slot } =
|
|
13
|
-
'ToolsMoreMenuGroup'
|
|
14
|
-
);
|
|
12
|
+
const { Fill: ToolsMoreMenuGroup, Slot } =
|
|
13
|
+
createSlotFill( 'ToolsMoreMenuGroup' );
|
|
15
14
|
|
|
16
15
|
ToolsMoreMenuGroup.Slot = ( { fillProps } ) => (
|
|
17
16
|
<Slot fillProps={ fillProps }>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { noop } from 'lodash';
|
|
5
4
|
import { shallow } from 'enzyme';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -9,6 +8,8 @@ import { shallow } from 'enzyme';
|
|
|
9
8
|
*/
|
|
10
9
|
import { KeyboardShortcutHelpModal } from '../index';
|
|
11
10
|
|
|
11
|
+
const noop = () => {};
|
|
12
|
+
|
|
12
13
|
describe( 'KeyboardShortcutHelpModal', () => {
|
|
13
14
|
it( 'should match snapshot when the modal is active', () => {
|
|
14
15
|
const wrapper = shallow(
|
|
@@ -18,15 +18,11 @@ import { store as editPostStore } from '../../store';
|
|
|
18
18
|
|
|
19
19
|
function KeyboardShortcuts() {
|
|
20
20
|
const { getBlockSelectionStart } = useSelect( blockEditorStore );
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
isEditorSidebarOpened,
|
|
24
|
-
isListViewOpened,
|
|
25
|
-
} = useSelect( editPostStore );
|
|
21
|
+
const { getEditorMode, isEditorSidebarOpened, isListViewOpened } =
|
|
22
|
+
useSelect( editPostStore );
|
|
26
23
|
const isModeToggleDisabled = useSelect( ( select ) => {
|
|
27
|
-
const { richEditingEnabled, codeEditingEnabled } =
|
|
28
|
-
editorStore
|
|
29
|
-
).getEditorSettings();
|
|
24
|
+
const { richEditingEnabled, codeEditingEnabled } =
|
|
25
|
+
select( editorStore ).getEditorSettings();
|
|
30
26
|
return ! richEditingEnabled || ! codeEditingEnabled;
|
|
31
27
|
}, [] );
|
|
32
28
|
|
|
@@ -26,9 +26,8 @@ export default function ActionsPanel( {
|
|
|
26
26
|
closeEntitiesSavedStates,
|
|
27
27
|
isEntitiesSavedStatesOpen,
|
|
28
28
|
} ) {
|
|
29
|
-
const { closePublishSidebar, togglePublishSidebar } =
|
|
30
|
-
editPostStore
|
|
31
|
-
);
|
|
29
|
+
const { closePublishSidebar, togglePublishSidebar } =
|
|
30
|
+
useDispatch( editPostStore );
|
|
32
31
|
const {
|
|
33
32
|
publishSidebarOpened,
|
|
34
33
|
hasActiveMetaboxes,
|
|
@@ -36,14 +35,12 @@ export default function ActionsPanel( {
|
|
|
36
35
|
hasNonPostEntityChanges,
|
|
37
36
|
} = useSelect( ( select ) => {
|
|
38
37
|
return {
|
|
39
|
-
publishSidebarOpened:
|
|
40
|
-
editPostStore
|
|
41
|
-
).isPublishSidebarOpened(),
|
|
38
|
+
publishSidebarOpened:
|
|
39
|
+
select( editPostStore ).isPublishSidebarOpened(),
|
|
42
40
|
hasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),
|
|
43
41
|
isSavingMetaBoxes: select( editPostStore ).isSavingMetaBoxes(),
|
|
44
|
-
hasNonPostEntityChanges:
|
|
45
|
-
editorStore
|
|
46
|
-
).hasNonPostEntityChanges(),
|
|
42
|
+
hasNonPostEntityChanges:
|
|
43
|
+
select( editorStore ).hasNonPostEntityChanges(),
|
|
47
44
|
};
|
|
48
45
|
}, [] );
|
|
49
46
|
|
|
@@ -66,11 +66,8 @@ const interfaceLabels = {
|
|
|
66
66
|
function Layout( { styles } ) {
|
|
67
67
|
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
68
68
|
const isHugeViewport = useViewportMatch( 'huge', '>=' );
|
|
69
|
-
const {
|
|
70
|
-
|
|
71
|
-
closeGeneralSidebar,
|
|
72
|
-
setIsInserterOpened,
|
|
73
|
-
} = useDispatch( editPostStore );
|
|
69
|
+
const { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =
|
|
70
|
+
useDispatch( editPostStore );
|
|
74
71
|
const { createErrorNotice } = useDispatch( noticesStore );
|
|
75
72
|
const {
|
|
76
73
|
mode,
|
|
@@ -96,17 +93,15 @@ function Layout( { styles } ) {
|
|
|
96
93
|
|
|
97
94
|
return {
|
|
98
95
|
isTemplateMode: select( editPostStore ).isEditingTemplate(),
|
|
99
|
-
hasFixedToolbar:
|
|
100
|
-
'fixedToolbar'
|
|
101
|
-
),
|
|
96
|
+
hasFixedToolbar:
|
|
97
|
+
select( editPostStore ).isFeatureActive( 'fixedToolbar' ),
|
|
102
98
|
sidebarIsOpened: !! (
|
|
103
99
|
select( interfaceStore ).getActiveComplementaryArea(
|
|
104
100
|
editPostStore.name
|
|
105
101
|
) || select( editPostStore ).isPublishSidebarOpened()
|
|
106
102
|
),
|
|
107
|
-
isFullscreenActive:
|
|
108
|
-
'fullscreenMode'
|
|
109
|
-
),
|
|
103
|
+
isFullscreenActive:
|
|
104
|
+
select( editPostStore ).isFeatureActive( 'fullscreenMode' ),
|
|
110
105
|
isInserterOpened: select( editPostStore ).isInserterOpened(),
|
|
111
106
|
isListViewOpened: select( editPostStore ).isListViewOpened(),
|
|
112
107
|
mode: select( editPostStore ).getEditorMode(),
|
|
@@ -118,12 +113,10 @@ function Layout( { styles } ) {
|
|
|
118
113
|
nextShortcut: select(
|
|
119
114
|
keyboardShortcutsStore
|
|
120
115
|
).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),
|
|
121
|
-
showIconLabels:
|
|
122
|
-
'showIconLabels'
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
'reducedUI'
|
|
126
|
-
),
|
|
116
|
+
showIconLabels:
|
|
117
|
+
select( editPostStore ).isFeatureActive( 'showIconLabels' ),
|
|
118
|
+
hasReducedUI:
|
|
119
|
+
select( editPostStore ).isFeatureActive( 'reducedUI' ),
|
|
127
120
|
showBlockBreadcrumbs: select( editPostStore ).isFeatureActive(
|
|
128
121
|
'showBlockBreadcrumbs'
|
|
129
122
|
),
|
|
@@ -156,10 +149,8 @@ function Layout( { styles } ) {
|
|
|
156
149
|
|
|
157
150
|
// Local state for save panel.
|
|
158
151
|
// Note 'truthy' callback implies an open panel.
|
|
159
|
-
const [
|
|
160
|
-
|
|
161
|
-
setEntitiesSavedStatesCallback,
|
|
162
|
-
] = useState( false );
|
|
152
|
+
const [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =
|
|
153
|
+
useState( false );
|
|
163
154
|
const closeEntitiesSavedStates = useCallback(
|
|
164
155
|
( arg ) => {
|
|
165
156
|
if ( typeof entitiesSavedStatesCallback === 'function' ) {
|
|
@@ -181,6 +172,7 @@ function Layout( { styles } ) {
|
|
|
181
172
|
if ( mode === 'visual' && isListViewOpened ) {
|
|
182
173
|
return <ListViewSidebar />;
|
|
183
174
|
}
|
|
175
|
+
|
|
184
176
|
return null;
|
|
185
177
|
};
|
|
186
178
|
|
|
@@ -187,13 +187,12 @@ class Layout extends Component {
|
|
|
187
187
|
|
|
188
188
|
export default compose( [
|
|
189
189
|
withSelect( ( select ) => {
|
|
190
|
-
const { __unstableIsEditorReady: isEditorReady } =
|
|
191
|
-
editorStore
|
|
192
|
-
);
|
|
190
|
+
const { __unstableIsEditorReady: isEditorReady } =
|
|
191
|
+
select( editorStore );
|
|
193
192
|
const { getEditorMode } = select( editPostStore );
|
|
194
193
|
const { getSettings } = select( blockEditorStore );
|
|
195
|
-
const globalStyles =
|
|
196
|
-
?.color;
|
|
194
|
+
const globalStyles =
|
|
195
|
+
getSettings()?.__experimentalGlobalStylesBaseStyles?.color;
|
|
197
196
|
|
|
198
197
|
return {
|
|
199
198
|
isReady: isEditorReady(),
|
|
@@ -101,13 +101,6 @@ export default function EditPostPreferencesModal() {
|
|
|
101
101
|
'Customize options related to the block editor interface and editing flow.'
|
|
102
102
|
) }
|
|
103
103
|
>
|
|
104
|
-
<EnableFeature
|
|
105
|
-
featureName="reducedUI"
|
|
106
|
-
help={ __(
|
|
107
|
-
'Compacts options and outlines in the toolbar.'
|
|
108
|
-
) }
|
|
109
|
-
label={ __( 'Reduce the interface' ) }
|
|
110
|
-
/>
|
|
111
104
|
<EnableFeature
|
|
112
105
|
featureName="focusMode"
|
|
113
106
|
help={ __(
|
|
@@ -117,8 +110,24 @@ export default function EditPostPreferencesModal() {
|
|
|
117
110
|
/>
|
|
118
111
|
<EnableFeature
|
|
119
112
|
featureName="showIconLabels"
|
|
120
|
-
|
|
121
|
-
|
|
113
|
+
label={ __( 'Show button text labels' ) }
|
|
114
|
+
help={ __(
|
|
115
|
+
'Show text instead of icons on buttons.'
|
|
116
|
+
) }
|
|
117
|
+
/>
|
|
118
|
+
<EnableFeature
|
|
119
|
+
featureName="showListViewByDefault"
|
|
120
|
+
help={ __(
|
|
121
|
+
'Opens the block list view sidebar by default.'
|
|
122
|
+
) }
|
|
123
|
+
label={ __( 'Always open list view' ) }
|
|
124
|
+
/>
|
|
125
|
+
<EnableFeature
|
|
126
|
+
featureName="reducedUI"
|
|
127
|
+
help={ __(
|
|
128
|
+
'Compacts options and outlines in the toolbar.'
|
|
129
|
+
) }
|
|
130
|
+
label={ __( 'Reduce the interface' ) }
|
|
122
131
|
/>
|
|
123
132
|
<EnableFeature
|
|
124
133
|
featureName="themeStyles"
|
|
@@ -55,6 +55,6 @@ export function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export default withSelect( ( select ) => ( {
|
|
58
|
-
areCustomFieldsEnabled:
|
|
59
|
-
.enableCustomFields,
|
|
58
|
+
areCustomFieldsEnabled:
|
|
59
|
+
!! select( editorStore ).getEditorSettings().enableCustomFields,
|
|
60
60
|
} ) )( EnableCustomFieldsOption );
|
|
@@ -12,9 +12,8 @@ import { store as editPostStore } from '../../../store';
|
|
|
12
12
|
|
|
13
13
|
export default compose(
|
|
14
14
|
withSelect( ( select, { panelName } ) => {
|
|
15
|
-
const { isEditorPanelEnabled, isEditorPanelRemoved } =
|
|
16
|
-
editPostStore
|
|
17
|
-
);
|
|
15
|
+
const { isEditorPanelEnabled, isEditorPanelRemoved } =
|
|
16
|
+
select( editPostStore );
|
|
18
17
|
return {
|
|
19
18
|
isRemoved: isEditorPanelRemoved( panelName ),
|
|
20
19
|
isChecked: isEditorPanelEnabled( panelName ),
|
|
@@ -12,9 +12,8 @@ export default compose(
|
|
|
12
12
|
isChecked: select( editorStore ).isPublishSidebarEnabled(),
|
|
13
13
|
} ) ),
|
|
14
14
|
withDispatch( ( dispatch ) => {
|
|
15
|
-
const { enablePublishSidebar, disablePublishSidebar } =
|
|
16
|
-
editorStore
|
|
17
|
-
);
|
|
15
|
+
const { enablePublishSidebar, disablePublishSidebar } =
|
|
16
|
+
dispatch( editorStore );
|
|
18
17
|
return {
|
|
19
18
|
onChange: ( isEnabled ) =>
|
|
20
19
|
isEnabled ? enablePublishSidebar() : disablePublishSidebar(),
|
|
@@ -22,11 +22,6 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
22
22
|
description="Customize options related to the block editor interface and editing flow."
|
|
23
23
|
title="Appearance"
|
|
24
24
|
>
|
|
25
|
-
<WithSelect(WithDispatch(BaseOption))
|
|
26
|
-
featureName="reducedUI"
|
|
27
|
-
help="Compacts options and outlines in the toolbar."
|
|
28
|
-
label="Reduce the interface"
|
|
29
|
-
/>
|
|
30
25
|
<WithSelect(WithDispatch(BaseOption))
|
|
31
26
|
featureName="focusMode"
|
|
32
27
|
help="Highlights the current block and fades other content."
|
|
@@ -34,8 +29,18 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
34
29
|
/>
|
|
35
30
|
<WithSelect(WithDispatch(BaseOption))
|
|
36
31
|
featureName="showIconLabels"
|
|
37
|
-
help="
|
|
38
|
-
label="
|
|
32
|
+
help="Show text instead of icons on buttons."
|
|
33
|
+
label="Show button text labels"
|
|
34
|
+
/>
|
|
35
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
36
|
+
featureName="showListViewByDefault"
|
|
37
|
+
help="Opens the block list view sidebar by default."
|
|
38
|
+
label="Always open list view"
|
|
39
|
+
/>
|
|
40
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
41
|
+
featureName="reducedUI"
|
|
42
|
+
help="Compacts options and outlines in the toolbar."
|
|
43
|
+
label="Reduce the interface"
|
|
39
44
|
/>
|
|
40
45
|
<WithSelect(WithDispatch(BaseOption))
|
|
41
46
|
featureName="themeStyles"
|
|
@@ -148,11 +153,6 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
148
153
|
description="Customize options related to the block editor interface and editing flow."
|
|
149
154
|
title="Appearance"
|
|
150
155
|
>
|
|
151
|
-
<WithSelect(WithDispatch(BaseOption))
|
|
152
|
-
featureName="reducedUI"
|
|
153
|
-
help="Compacts options and outlines in the toolbar."
|
|
154
|
-
label="Reduce the interface"
|
|
155
|
-
/>
|
|
156
156
|
<WithSelect(WithDispatch(BaseOption))
|
|
157
157
|
featureName="focusMode"
|
|
158
158
|
help="Highlights the current block and fades other content."
|
|
@@ -160,8 +160,18 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
160
160
|
/>
|
|
161
161
|
<WithSelect(WithDispatch(BaseOption))
|
|
162
162
|
featureName="showIconLabels"
|
|
163
|
-
help="
|
|
164
|
-
label="
|
|
163
|
+
help="Show text instead of icons on buttons."
|
|
164
|
+
label="Show button text labels"
|
|
165
|
+
/>
|
|
166
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
167
|
+
featureName="showListViewByDefault"
|
|
168
|
+
help="Opens the block list view sidebar by default."
|
|
169
|
+
label="Always open list view"
|
|
170
|
+
/>
|
|
171
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
172
|
+
featureName="reducedUI"
|
|
173
|
+
help="Compacts options and outlines in the toolbar."
|
|
174
|
+
label="Reduce the interface"
|
|
165
175
|
/>
|
|
166
176
|
<WithSelect(WithDispatch(BaseOption))
|
|
167
177
|
featureName="themeStyles"
|
|
@@ -19,9 +19,8 @@ import { store as editPostStore } from '../../store';
|
|
|
19
19
|
|
|
20
20
|
export default function InserterSidebar() {
|
|
21
21
|
const { insertionPoint, showMostUsedBlocks } = useSelect( ( select ) => {
|
|
22
|
-
const { isFeatureActive, __experimentalGetInsertionPoint } =
|
|
23
|
-
editPostStore
|
|
24
|
-
);
|
|
22
|
+
const { isFeatureActive, __experimentalGetInsertionPoint } =
|
|
23
|
+
select( editPostStore );
|
|
25
24
|
return {
|
|
26
25
|
insertionPoint: __experimentalGetInsertionPoint(),
|
|
27
26
|
showMostUsedBlocks: isFeatureActive( 'mostUsedBlocks' ),
|
|
@@ -52,9 +52,8 @@ function DiscussionPanel( { isEnabled, isOpened, onTogglePanel } ) {
|
|
|
52
52
|
export default compose( [
|
|
53
53
|
withSelect( ( select ) => {
|
|
54
54
|
return {
|
|
55
|
-
isEnabled:
|
|
56
|
-
PANEL_NAME
|
|
57
|
-
),
|
|
55
|
+
isEnabled:
|
|
56
|
+
select( editPostStore ).isEditorPanelEnabled( PANEL_NAME ),
|
|
58
57
|
isOpened: select( editPostStore ).isEditorPanelOpened( PANEL_NAME ),
|
|
59
58
|
};
|
|
60
59
|
} ),
|
|
@@ -52,9 +52,8 @@ function FeaturedImage( { isEnabled, isOpened, postType, onTogglePanel } ) {
|
|
|
52
52
|
const applyWithSelect = withSelect( ( select ) => {
|
|
53
53
|
const { getEditedPostAttribute } = select( editorStore );
|
|
54
54
|
const { getPostType } = select( coreStore );
|
|
55
|
-
const { isEditorPanelEnabled, isEditorPanelOpened } =
|
|
56
|
-
editPostStore
|
|
57
|
-
);
|
|
55
|
+
const { isEditorPanelEnabled, isEditorPanelOpened } =
|
|
56
|
+
select( editPostStore );
|
|
58
57
|
|
|
59
58
|
return {
|
|
60
59
|
postType: getPostType( getEditedPostAttribute( 'type' ) ),
|
|
@@ -30,9 +30,8 @@ const PANEL_NAME = 'page-attributes';
|
|
|
30
30
|
export function PageAttributes() {
|
|
31
31
|
const { isEnabled, isOpened, postType } = useSelect( ( select ) => {
|
|
32
32
|
const { getEditedPostAttribute } = select( editorStore );
|
|
33
|
-
const { isEditorPanelEnabled, isEditorPanelOpened } =
|
|
34
|
-
editPostStore
|
|
35
|
-
);
|
|
33
|
+
const { isEditorPanelEnabled, isEditorPanelOpened } =
|
|
34
|
+
select( editPostStore );
|
|
36
35
|
const { getPostType } = select( coreStore );
|
|
37
36
|
return {
|
|
38
37
|
isEnabled: isEditorPanelEnabled( PANEL_NAME ),
|
|
@@ -114,9 +114,8 @@ const PluginDocumentSettingPanel = compose(
|
|
|
114
114
|
withSelect( ( select, { panelName } ) => {
|
|
115
115
|
return {
|
|
116
116
|
opened: select( editPostStore ).isEditorPanelOpened( panelName ),
|
|
117
|
-
isEnabled:
|
|
118
|
-
panelName
|
|
119
|
-
),
|
|
117
|
+
isEnabled:
|
|
118
|
+
select( editPostStore ).isEditorPanelEnabled( panelName ),
|
|
120
119
|
};
|
|
121
120
|
} ),
|
|
122
121
|
withDispatch( ( dispatch, { panelName } ) => ( {
|
|
@@ -84,9 +84,8 @@ export default function PluginSidebarEditPost( { className, ...props } ) {
|
|
|
84
84
|
shortcut: select(
|
|
85
85
|
keyboardShortcutsStore
|
|
86
86
|
).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' ),
|
|
87
|
-
showIconLabels:
|
|
88
|
-
'showIconLabels'
|
|
89
|
-
),
|
|
87
|
+
showIconLabels:
|
|
88
|
+
select( editPostStore ).isFeatureActive( 'showIconLabels' ),
|
|
90
89
|
};
|
|
91
90
|
}, [] );
|
|
92
91
|
return (
|
|
@@ -41,9 +41,8 @@ function PostExcerpt( { isEnabled, isOpened, onTogglePanel } ) {
|
|
|
41
41
|
export default compose( [
|
|
42
42
|
withSelect( ( select ) => {
|
|
43
43
|
return {
|
|
44
|
-
isEnabled:
|
|
45
|
-
PANEL_NAME
|
|
46
|
-
),
|
|
44
|
+
isEnabled:
|
|
45
|
+
select( editPostStore ).isEditorPanelEnabled( PANEL_NAME ),
|
|
47
46
|
isOpened: select( editPostStore ).isEditorPanelOpened( PANEL_NAME ),
|
|
48
47
|
};
|
|
49
48
|
} ),
|
|
@@ -139,9 +139,8 @@ export default compose( [
|
|
|
139
139
|
getEditedPostAttribute,
|
|
140
140
|
getEditedPostSlug,
|
|
141
141
|
} = select( editorStore );
|
|
142
|
-
const { isEditorPanelEnabled, isEditorPanelOpened } =
|
|
143
|
-
editPostStore
|
|
144
|
-
);
|
|
142
|
+
const { isEditorPanelEnabled, isEditorPanelOpened } =
|
|
143
|
+
select( editPostStore );
|
|
145
144
|
const { getPostType } = select( coreStore );
|
|
146
145
|
|
|
147
146
|
const { link } = getCurrentPost();
|
|
@@ -18,7 +18,7 @@ export function PostSchedule() {
|
|
|
18
18
|
<PanelRow className="edit-post-post-schedule" ref={ anchorRef }>
|
|
19
19
|
<span>{ __( 'Publish' ) }</span>
|
|
20
20
|
<Dropdown
|
|
21
|
-
popoverProps={ { anchorRef
|
|
21
|
+
popoverProps={ { anchorRef } }
|
|
22
22
|
position="bottom left"
|
|
23
23
|
contentClassName="edit-post-post-schedule__dialog"
|
|
24
24
|
renderToggle={ ( { onToggle, isOpen } ) => (
|
|
@@ -33,7 +33,9 @@ export function PostSchedule() {
|
|
|
33
33
|
</Button>
|
|
34
34
|
</>
|
|
35
35
|
) }
|
|
36
|
-
renderContent={ () =>
|
|
36
|
+
renderContent={ ( { onClose } ) => (
|
|
37
|
+
<PostScheduleForm onClose={ onClose } />
|
|
38
|
+
) }
|
|
37
39
|
/>
|
|
38
40
|
</PanelRow>
|
|
39
41
|
</PostScheduleCheck>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.edit-post-post-schedule {
|
|
2
2
|
width: 100%;
|
|
3
3
|
position: relative;
|
|
4
|
-
justify-content:
|
|
4
|
+
justify-content: flex-start;
|
|
5
5
|
|
|
6
6
|
span {
|
|
7
7
|
display: block;
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
text-align: right;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.edit-post-post-schedule__dialog .components-popover__content > div {
|
|
19
|
-
padding: 0;
|
|
16
|
+
.edit-post-post-schedule__dialog .components-popover__content {
|
|
17
|
+
padding: $grid-unit-20;
|
|
20
18
|
}
|
|
@@ -56,9 +56,8 @@ export default compose( [
|
|
|
56
56
|
withSelect( ( select ) => {
|
|
57
57
|
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
|
|
58
58
|
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
|
|
59
|
-
const { isEditorPanelRemoved, isEditorPanelOpened } =
|
|
60
|
-
editPostStore
|
|
61
|
-
);
|
|
59
|
+
const { isEditorPanelRemoved, isEditorPanelOpened } =
|
|
60
|
+
select( editPostStore );
|
|
62
61
|
return {
|
|
63
62
|
isRemoved: isEditorPanelRemoved( PANEL_NAME ),
|
|
64
63
|
isOpened: isEditorPanelOpened( PANEL_NAME ),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.edit-post-post-visibility {
|
|
2
2
|
width: 100%;
|
|
3
|
-
justify-content:
|
|
3
|
+
justify-content: flex-start;
|
|
4
4
|
|
|
5
5
|
span {
|
|
6
6
|
display: block;
|
|
@@ -11,4 +11,5 @@
|
|
|
11
11
|
.edit-post-post-visibility__dialog .components-popover__content {
|
|
12
12
|
// sidebar width - padding - horizontal borders
|
|
13
13
|
width: $sidebar-width - $grid-unit-20 - $border-width * 2;
|
|
14
|
+
padding: $grid-unit-20;
|
|
14
15
|
}
|
|
@@ -48,6 +48,6 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
&.is-active:focus {
|
|
51
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0
|
|
51
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 -#{$border-width-tab * 2} 0 0 var(--wp-admin-theme-color);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -6,7 +6,7 @@ import { kebabCase } from 'lodash';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { __, _x } from '@wordpress/i18n';
|
|
9
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
10
10
|
import {
|
|
11
11
|
Button,
|
|
12
12
|
Modal,
|
|
@@ -31,9 +31,8 @@ function PostTemplateActions( { isPostsPage } ) {
|
|
|
31
31
|
const [ title, setTitle ] = useState( '' );
|
|
32
32
|
const { template, supportsTemplateMode, defaultTemplate } = useSelect(
|
|
33
33
|
( select ) => {
|
|
34
|
-
const { getCurrentPostType, getEditorSettings } =
|
|
35
|
-
editorStore
|
|
36
|
-
);
|
|
34
|
+
const { getCurrentPostType, getEditorSettings } =
|
|
35
|
+
select( editorStore );
|
|
37
36
|
const { getPostType } = select( coreStore );
|
|
38
37
|
const { getEditedPostTemplate } = select( editPostStore );
|
|
39
38
|
|
|
@@ -50,10 +49,8 @@ function PostTemplateActions( { isPostsPage } ) {
|
|
|
50
49
|
},
|
|
51
50
|
[]
|
|
52
51
|
);
|
|
53
|
-
const {
|
|
54
|
-
|
|
55
|
-
__unstableSwitchToTemplateMode,
|
|
56
|
-
} = useDispatch( editPostStore );
|
|
52
|
+
const { __unstableCreateTemplate, __unstableSwitchToTemplateMode } =
|
|
53
|
+
useDispatch( editPostStore );
|
|
57
54
|
|
|
58
55
|
if ( ! supportsTemplateMode ) {
|
|
59
56
|
return null;
|
|
@@ -124,6 +121,11 @@ function PostTemplateActions( { isPostsPage } ) {
|
|
|
124
121
|
<Button
|
|
125
122
|
variant="link"
|
|
126
123
|
onClick={ () => __unstableSwitchToTemplateMode() }
|
|
124
|
+
label={ sprintf(
|
|
125
|
+
// Translators: 1: The title or the slug of the currently selected template.
|
|
126
|
+
__( 'Edit template: %s' ),
|
|
127
|
+
template?.title.toLowerCase() ?? template.slug
|
|
128
|
+
) }
|
|
127
129
|
>
|
|
128
130
|
{ __( 'Edit' ) }
|
|
129
131
|
</Button>
|
|
@@ -132,6 +134,7 @@ function PostTemplateActions( { isPostsPage } ) {
|
|
|
132
134
|
<Button
|
|
133
135
|
variant="link"
|
|
134
136
|
onClick={ () => setIsModalOpen( true ) }
|
|
137
|
+
label={ _x( 'New template', 'action' ) }
|
|
135
138
|
>
|
|
136
139
|
{
|
|
137
140
|
/* translators: button to create a new template */
|
|
@@ -48,12 +48,8 @@ export function TemplatePanel() {
|
|
|
48
48
|
getCurrentPostId,
|
|
49
49
|
getCurrentPostType,
|
|
50
50
|
} = select( editorStore );
|
|
51
|
-
const {
|
|
52
|
-
|
|
53
|
-
getEntityRecord,
|
|
54
|
-
getEntityRecords,
|
|
55
|
-
canUser,
|
|
56
|
-
} = select( coreStore );
|
|
51
|
+
const { getPostType, getEntityRecord, getEntityRecords, canUser } =
|
|
52
|
+
select( coreStore );
|
|
57
53
|
|
|
58
54
|
const currentPostId = getCurrentPostId();
|
|
59
55
|
const currentPostType = getCurrentPostType();
|