@wordpress/edit-post 7.22.0 → 7.24.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/build/components/device-preview/index.js +6 -3
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/header/document-actions/index.js +3 -7
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.js +3 -8
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/index.js +65 -11
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js +1 -1
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +2 -4
- package/build/components/keyboard-shortcuts/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/sidebar/post-pending-status/index.js +9 -2
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +1 -4
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js +9 -2
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-template/index.js +7 -4
- package/build/components/sidebar/post-template/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +12 -4
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/start-page-options/index.js +11 -13
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/text-editor/index.js +21 -1
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/view-link/index.js +11 -3
- package/build/components/view-link/index.js.map +1 -1
- package/build/components/visual-editor/index.js +5 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/store/actions.js +1 -1
- package/build/store/actions.js.map +1 -1
- package/build-module/components/device-preview/index.js +6 -3
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/header/document-actions/index.js +3 -7
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +3 -8
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/index.js +66 -12
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js +1 -1
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +2 -4
- package/build-module/components/keyboard-shortcuts/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/sidebar/post-pending-status/index.js +10 -3
- package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +2 -5
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js +10 -3
- package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
- package/build-module/components/sidebar/post-template/index.js +9 -6
- package/build-module/components/sidebar/post-template/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +14 -6
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +12 -14
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +22 -2
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/view-link/index.js +11 -3
- package/build-module/components/view-link/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +5 -1
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/store/actions.js +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +31 -185
- package/build-style/style.css +31 -185
- package/package.json +32 -32
- package/src/components/device-preview/index.js +21 -15
- package/src/components/header/document-actions/index.js +4 -7
- package/src/components/header/header-toolbar/index.js +1 -5
- package/src/components/header/index.js +104 -17
- package/src/components/header/style.scss +31 -2
- package/src/components/header/writing-menu/index.js +1 -1
- package/src/components/keyboard-shortcuts/index.js +6 -3
- package/src/components/layout/style.scss +0 -11
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/sidebar/post-pending-status/index.js +10 -3
- package/src/components/sidebar/post-status/index.js +11 -8
- package/src/components/sidebar/post-sticky/index.js +10 -3
- package/src/components/sidebar/post-template/index.js +10 -6
- package/src/components/sidebar/post-template/style.scss +0 -16
- package/src/components/sidebar/post-visibility/index.js +12 -5
- package/src/components/sidebar/post-visibility/style.scss +0 -12
- package/src/components/start-page-options/index.js +8 -15
- package/src/components/text-editor/index.js +20 -2
- package/src/components/text-editor/style.scss +3 -1
- package/src/components/view-link/index.js +21 -10
- package/src/components/visual-editor/index.js +7 -0
- package/src/components/visual-editor/style.scss +0 -90
- package/src/store/actions.js +1 -1
- package/src/store/test/actions.js +1 -1
- package/src/style.scss +0 -3
- package/build/components/sidebar/post-author/index.js +0 -22
- package/build/components/sidebar/post-author/index.js.map +0 -1
- package/build/components/sidebar/post-schedule/index.js +0 -66
- package/build/components/sidebar/post-schedule/index.js.map +0 -1
- package/build/components/sidebar/post-url/index.js +0 -62
- package/build/components/sidebar/post-url/index.js.map +0 -1
- package/build-module/components/sidebar/post-author/index.js +0 -13
- package/build-module/components/sidebar/post-author/index.js.map +0 -1
- package/build-module/components/sidebar/post-schedule/index.js +0 -59
- package/build-module/components/sidebar/post-schedule/index.js.map +0 -1
- package/build-module/components/sidebar/post-url/index.js +0 -55
- package/build-module/components/sidebar/post-url/index.js.map +0 -1
- package/src/components/sidebar/post-author/index.js +0 -20
- package/src/components/sidebar/post-author/style.scss +0 -5
- package/src/components/sidebar/post-schedule/index.js +0 -66
- package/src/components/sidebar/post-schedule/style.scss +0 -34
- package/src/components/sidebar/post-url/index.js +0 -58
- package/src/components/sidebar/post-url/style.scss +0 -26
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
align-items: center;
|
|
7
7
|
// The header should never be wider than the viewport, or buttons might be hidden. Especially relevant at high zoom levels. Related to https://core.trac.wordpress.org/ticket/47603#ticket.
|
|
8
8
|
max-width: 100vw;
|
|
9
|
+
justify-content: space-between;
|
|
9
10
|
|
|
10
11
|
// Make toolbar sticky on larger breakpoints
|
|
11
12
|
@include break-zoomed-in {
|
|
@@ -33,7 +34,15 @@
|
|
|
33
34
|
|
|
34
35
|
.edit-post-header__toolbar {
|
|
35
36
|
display: flex;
|
|
36
|
-
|
|
37
|
+
// Allow this area to shrink to fit the toolbar buttons.
|
|
38
|
+
flex-shrink: 8;
|
|
39
|
+
// Take up the space of the toolbar so it can be justified to the left side of the toolbar.
|
|
40
|
+
flex-grow: 3;
|
|
41
|
+
// Hide the overflow so flex will limit its width. Block toolbar will allow scrolling on fixed toolbar.
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
// Leave enough room for the focus ring to show.
|
|
44
|
+
padding: 2px 0;
|
|
45
|
+
align-items: center;
|
|
37
46
|
|
|
38
47
|
.table-of-contents {
|
|
39
48
|
display: none;
|
|
@@ -42,12 +51,32 @@
|
|
|
42
51
|
display: block;
|
|
43
52
|
}
|
|
44
53
|
}
|
|
54
|
+
|
|
55
|
+
.block-editor-block-contextual-toolbar.is-fixed {
|
|
56
|
+
border: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.selected-block-tools-wrapper {
|
|
60
|
+
overflow-x: hidden;
|
|
61
|
+
|
|
62
|
+
&.is-collapsed {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.edit-post-header__block-tools-toggle {
|
|
69
|
+
margin-left: 2px; // Allow focus ring to be fully visible
|
|
45
70
|
}
|
|
46
71
|
|
|
47
72
|
.edit-post-header__center {
|
|
48
73
|
flex-grow: 1;
|
|
49
74
|
display: flex;
|
|
50
75
|
justify-content: center;
|
|
76
|
+
|
|
77
|
+
&.is-collapsed {
|
|
78
|
+
display: none;
|
|
79
|
+
}
|
|
51
80
|
}
|
|
52
81
|
|
|
53
82
|
/**
|
|
@@ -57,7 +86,7 @@
|
|
|
57
86
|
.edit-post-header__settings {
|
|
58
87
|
display: inline-flex;
|
|
59
88
|
align-items: center;
|
|
60
|
-
flex-wrap:
|
|
89
|
+
flex-wrap: nowrap;
|
|
61
90
|
padding-right: $grid-unit-05;
|
|
62
91
|
|
|
63
92
|
@include break-small () {
|
|
@@ -31,7 +31,7 @@ function WritingMenu() {
|
|
|
31
31
|
|
|
32
32
|
const toggleDistractionFree = () => {
|
|
33
33
|
registry.batch( () => {
|
|
34
|
-
setPreference( 'core/edit-post', 'fixedToolbar',
|
|
34
|
+
setPreference( 'core/edit-post', 'fixedToolbar', true );
|
|
35
35
|
setIsInserterOpened( false );
|
|
36
36
|
setIsListViewOpened( false );
|
|
37
37
|
closeGeneralSidebar();
|
|
@@ -18,7 +18,6 @@ import { createBlock } from '@wordpress/blocks';
|
|
|
18
18
|
import { store as editPostStore } from '../../store';
|
|
19
19
|
|
|
20
20
|
function KeyboardShortcuts() {
|
|
21
|
-
const { getBlockSelectionStart } = useSelect( blockEditorStore );
|
|
22
21
|
const { getEditorMode, isEditorSidebarOpened, isListViewOpened } =
|
|
23
22
|
useSelect( editPostStore );
|
|
24
23
|
const isModeToggleDisabled = useSelect( ( select ) => {
|
|
@@ -38,8 +37,12 @@ function KeyboardShortcuts() {
|
|
|
38
37
|
const { registerShortcut } = useDispatch( keyboardShortcutsStore );
|
|
39
38
|
|
|
40
39
|
const { replaceBlocks } = useDispatch( blockEditorStore );
|
|
41
|
-
const {
|
|
42
|
-
|
|
40
|
+
const {
|
|
41
|
+
getBlockName,
|
|
42
|
+
getSelectedBlockClientId,
|
|
43
|
+
getBlockAttributes,
|
|
44
|
+
getBlockSelectionStart,
|
|
45
|
+
} = useSelect( blockEditorStore );
|
|
43
46
|
|
|
44
47
|
const handleTextLevelShortcut = ( event, level ) => {
|
|
45
48
|
event.preventDefault();
|
|
@@ -99,14 +99,3 @@
|
|
|
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
|
-
}
|
|
@@ -70,7 +70,7 @@ export default function EditPostPreferencesModal() {
|
|
|
70
70
|
const { set: setPreference } = useDispatch( preferencesStore );
|
|
71
71
|
|
|
72
72
|
const toggleDistractionFree = () => {
|
|
73
|
-
setPreference( 'core/edit-post', 'fixedToolbar',
|
|
73
|
+
setPreference( 'core/edit-post', 'fixedToolbar', true );
|
|
74
74
|
setIsInserterOpened( false );
|
|
75
75
|
setIsListViewOpened( false );
|
|
76
76
|
closeGeneralSidebar();
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { PanelRow } from '@wordpress/components';
|
|
5
4
|
import {
|
|
6
5
|
PostPendingStatus as PostPendingStatusForm,
|
|
7
6
|
PostPendingStatusCheck,
|
|
7
|
+
privateApis as editorPrivateApis,
|
|
8
8
|
} from '@wordpress/editor';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { unlock } from '../../../lock-unlock';
|
|
14
|
+
|
|
15
|
+
const { PostPanelRow } = unlock( editorPrivateApis );
|
|
16
|
+
|
|
10
17
|
export function PostPendingStatus() {
|
|
11
18
|
return (
|
|
12
19
|
<PostPendingStatusCheck>
|
|
13
|
-
<
|
|
20
|
+
<PostPanelRow>
|
|
14
21
|
<PostPendingStatusForm />
|
|
15
|
-
</
|
|
22
|
+
</PostPanelRow>
|
|
16
23
|
</PostPendingStatusCheck>
|
|
17
24
|
);
|
|
18
25
|
}
|
|
@@ -7,23 +7,26 @@ import {
|
|
|
7
7
|
PanelBody,
|
|
8
8
|
} from '@wordpress/components';
|
|
9
9
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
PostAuthorPanel,
|
|
12
|
+
PostSchedulePanel,
|
|
13
|
+
PostSwitchToDraftButton,
|
|
14
|
+
PostSyncStatus,
|
|
15
|
+
PostURLPanel,
|
|
16
|
+
} from '@wordpress/editor';
|
|
11
17
|
|
|
12
18
|
/**
|
|
13
19
|
* Internal dependencies
|
|
14
20
|
*/
|
|
15
21
|
import PostVisibility from '../post-visibility';
|
|
16
22
|
import PostTrash from '../post-trash';
|
|
17
|
-
import PostSchedule from '../post-schedule';
|
|
18
23
|
import PostSticky from '../post-sticky';
|
|
19
|
-
import PostAuthor from '../post-author';
|
|
20
24
|
import PostSlug from '../post-slug';
|
|
21
25
|
import PostFormat from '../post-format';
|
|
22
26
|
import PostPendingStatus from '../post-pending-status';
|
|
23
27
|
import PluginPostStatusInfo from '../plugin-post-status-info';
|
|
24
28
|
import { store as editPostStore } from '../../../store';
|
|
25
29
|
import PostTemplate from '../post-template';
|
|
26
|
-
import PostURL from '../post-url';
|
|
27
30
|
|
|
28
31
|
/**
|
|
29
32
|
* Module Constants
|
|
@@ -58,15 +61,15 @@ export default function PostStatus() {
|
|
|
58
61
|
{ ( fills ) => (
|
|
59
62
|
<>
|
|
60
63
|
<PostVisibility />
|
|
61
|
-
<
|
|
64
|
+
<PostSchedulePanel />
|
|
62
65
|
<PostTemplate />
|
|
63
|
-
<
|
|
66
|
+
<PostURLPanel />
|
|
67
|
+
<PostSyncStatus />
|
|
64
68
|
<PostSticky />
|
|
65
69
|
<PostPendingStatus />
|
|
66
70
|
<PostFormat />
|
|
67
71
|
<PostSlug />
|
|
68
|
-
<
|
|
69
|
-
<PostSyncStatus />
|
|
72
|
+
<PostAuthorPanel />
|
|
70
73
|
{ fills }
|
|
71
74
|
<HStack
|
|
72
75
|
style={ {
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { PanelRow } from '@wordpress/components';
|
|
5
4
|
import {
|
|
6
5
|
PostSticky as PostStickyForm,
|
|
7
6
|
PostStickyCheck,
|
|
7
|
+
privateApis as editorPrivateApis,
|
|
8
8
|
} from '@wordpress/editor';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { unlock } from '../../../lock-unlock';
|
|
14
|
+
|
|
15
|
+
const { PostPanelRow } = unlock( editorPrivateApis );
|
|
16
|
+
|
|
10
17
|
export function PostSticky() {
|
|
11
18
|
return (
|
|
12
19
|
<PostStickyCheck>
|
|
13
|
-
<
|
|
20
|
+
<PostPanelRow>
|
|
14
21
|
<PostStickyForm />
|
|
15
|
-
</
|
|
22
|
+
</PostPanelRow>
|
|
16
23
|
</PostStickyCheck>
|
|
17
24
|
);
|
|
18
25
|
}
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useState, useMemo } from '@wordpress/element';
|
|
5
|
-
import {
|
|
5
|
+
import { Dropdown, Button } from '@wordpress/components';
|
|
6
6
|
import { __, sprintf } from '@wordpress/i18n';
|
|
7
7
|
import { useSelect } from '@wordpress/data';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
store as editorStore,
|
|
10
|
+
privateApis as editorPrivateApis,
|
|
11
|
+
} from '@wordpress/editor';
|
|
9
12
|
import { store as coreStore } from '@wordpress/core-data';
|
|
10
13
|
|
|
11
14
|
/**
|
|
@@ -13,6 +16,9 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
13
16
|
*/
|
|
14
17
|
import PostTemplateForm from './form';
|
|
15
18
|
import { store as editPostStore } from '../../../store';
|
|
19
|
+
import { unlock } from '../../../lock-unlock';
|
|
20
|
+
|
|
21
|
+
const { PostPanelRow } = unlock( editorPrivateApis );
|
|
16
22
|
|
|
17
23
|
export default function PostTemplate() {
|
|
18
24
|
// Use internal state instead of a ref to make sure that the component
|
|
@@ -53,11 +59,9 @@ export default function PostTemplate() {
|
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
return (
|
|
56
|
-
<
|
|
57
|
-
<span>{ __( 'Template' ) }</span>
|
|
62
|
+
<PostPanelRow label={ __( 'Template' ) } ref={ setPopoverAnchor }>
|
|
58
63
|
<Dropdown
|
|
59
64
|
popoverProps={ popoverProps }
|
|
60
|
-
className="edit-post-post-template__dropdown"
|
|
61
65
|
contentClassName="edit-post-post-template__dialog"
|
|
62
66
|
focusOnMount
|
|
63
67
|
renderToggle={ ( { isOpen, onToggle } ) => (
|
|
@@ -70,7 +74,7 @@ export default function PostTemplate() {
|
|
|
70
74
|
<PostTemplateForm onClose={ onClose } />
|
|
71
75
|
) }
|
|
72
76
|
/>
|
|
73
|
-
</
|
|
77
|
+
</PostPanelRow>
|
|
74
78
|
);
|
|
75
79
|
}
|
|
76
80
|
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
.edit-post-post-template {
|
|
2
|
-
width: 100%;
|
|
3
|
-
justify-content: flex-start;
|
|
4
|
-
|
|
5
|
-
span {
|
|
6
|
-
display: block;
|
|
7
|
-
width: 45%;
|
|
8
|
-
// Match padding on tertiary buttons for alignment.
|
|
9
|
-
padding: $grid-unit-15 * 0.5 0;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.edit-post-post-template__dropdown {
|
|
14
|
-
max-width: 55%;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
1
|
.components-button.edit-post-post-template__toggle {
|
|
18
2
|
display: inline-block;
|
|
19
3
|
width: 100%;
|
|
@@ -2,15 +2,23 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
5
|
+
import { Dropdown, Button } from '@wordpress/components';
|
|
6
6
|
import {
|
|
7
7
|
PostVisibility as PostVisibilityForm,
|
|
8
8
|
PostVisibilityLabel,
|
|
9
9
|
PostVisibilityCheck,
|
|
10
10
|
usePostVisibilityLabel,
|
|
11
|
+
privateApis as editorPrivateApis,
|
|
11
12
|
} from '@wordpress/editor';
|
|
12
13
|
import { useMemo, useState } from '@wordpress/element';
|
|
13
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
import { unlock } from '../../../lock-unlock';
|
|
19
|
+
|
|
20
|
+
const { PostPanelRow } = unlock( editorPrivateApis );
|
|
21
|
+
|
|
14
22
|
export function PostVisibility() {
|
|
15
23
|
// Use internal state instead of a ref to make sure that the component
|
|
16
24
|
// re-renders when the popover's anchor updates.
|
|
@@ -29,11 +37,10 @@ export function PostVisibility() {
|
|
|
29
37
|
return (
|
|
30
38
|
<PostVisibilityCheck
|
|
31
39
|
render={ ( { canEdit } ) => (
|
|
32
|
-
<
|
|
40
|
+
<PostPanelRow
|
|
41
|
+
label={ __( 'Visibility' ) }
|
|
33
42
|
ref={ setPopoverAnchor }
|
|
34
|
-
className="edit-post-post-visibility"
|
|
35
43
|
>
|
|
36
|
-
<span>{ __( 'Visibility' ) }</span>
|
|
37
44
|
{ ! canEdit && (
|
|
38
45
|
<span>
|
|
39
46
|
<PostVisibilityLabel />
|
|
@@ -55,7 +62,7 @@ export function PostVisibility() {
|
|
|
55
62
|
) }
|
|
56
63
|
/>
|
|
57
64
|
) }
|
|
58
|
-
</
|
|
65
|
+
</PostPanelRow>
|
|
59
66
|
) }
|
|
60
67
|
/>
|
|
61
68
|
);
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
.edit-post-post-visibility {
|
|
2
|
-
width: 100%;
|
|
3
|
-
justify-content: flex-start;
|
|
4
|
-
|
|
5
|
-
span {
|
|
6
|
-
display: block;
|
|
7
|
-
width: 45%;
|
|
8
|
-
// Match padding on tertiary buttons for alignment.
|
|
9
|
-
padding: $grid-unit-15 * 0.5 0;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
1
|
.edit-post-post-visibility__dialog .editor-post-visibility {
|
|
14
2
|
// sidebar width - popover padding - form margin
|
|
15
3
|
min-width: $sidebar-width - $grid-unit-20 - $grid-unit-20;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Modal } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { useState,
|
|
6
|
+
import { useState, useMemo } from '@wordpress/element';
|
|
7
7
|
import {
|
|
8
8
|
store as blockEditorStore,
|
|
9
9
|
__experimentalBlockPatternsList as BlockPatternsList,
|
|
@@ -62,19 +62,11 @@ function PatternSelection( { blockPatterns, onChoosePattern } ) {
|
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function StartPageOptionsModal() {
|
|
66
|
-
const [ modalState, setModalState ] = useState( 'initial' );
|
|
65
|
+
function StartPageOptionsModal( { onClose } ) {
|
|
67
66
|
const startPatterns = useStartPatterns();
|
|
68
67
|
const hasStartPattern = startPatterns.length > 0;
|
|
69
|
-
const shouldOpenModal = hasStartPattern && modalState === 'initial';
|
|
70
68
|
|
|
71
|
-
|
|
72
|
-
if ( shouldOpenModal ) {
|
|
73
|
-
setModalState( 'open' );
|
|
74
|
-
}
|
|
75
|
-
}, [ shouldOpenModal ] );
|
|
76
|
-
|
|
77
|
-
if ( modalState !== 'open' ) {
|
|
69
|
+
if ( ! hasStartPattern ) {
|
|
78
70
|
return null;
|
|
79
71
|
}
|
|
80
72
|
|
|
@@ -83,12 +75,12 @@ function StartPageOptionsModal() {
|
|
|
83
75
|
className="edit-post-start-page-options__modal"
|
|
84
76
|
title={ __( 'Choose a pattern' ) }
|
|
85
77
|
isFullScreen
|
|
86
|
-
onRequestClose={
|
|
78
|
+
onRequestClose={ onClose }
|
|
87
79
|
>
|
|
88
80
|
<div className="edit-post-start-page-options__modal-content">
|
|
89
81
|
<PatternSelection
|
|
90
82
|
blockPatterns={ startPatterns }
|
|
91
|
-
onChoosePattern={
|
|
83
|
+
onChoosePattern={ onClose }
|
|
92
84
|
/>
|
|
93
85
|
</div>
|
|
94
86
|
</Modal>
|
|
@@ -96,6 +88,7 @@ function StartPageOptionsModal() {
|
|
|
96
88
|
}
|
|
97
89
|
|
|
98
90
|
export default function StartPageOptions() {
|
|
91
|
+
const [ isClosed, setIsClosed ] = useState( false );
|
|
99
92
|
const shouldEnableModal = useSelect( ( select ) => {
|
|
100
93
|
const { isCleanNewPost } = select( editorStore );
|
|
101
94
|
const { isEditingTemplate, isFeatureActive } = select( editPostStore );
|
|
@@ -107,9 +100,9 @@ export default function StartPageOptions() {
|
|
|
107
100
|
);
|
|
108
101
|
}, [] );
|
|
109
102
|
|
|
110
|
-
if ( ! shouldEnableModal ) {
|
|
103
|
+
if ( ! shouldEnableModal || isClosed ) {
|
|
111
104
|
return null;
|
|
112
105
|
}
|
|
113
106
|
|
|
114
|
-
return <StartPageOptionsModal />;
|
|
107
|
+
return <StartPageOptionsModal onClose={ () => setIsClosed( true ) } />;
|
|
115
108
|
}
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
PostTextEditor,
|
|
6
|
-
|
|
6
|
+
PostTitleRaw,
|
|
7
7
|
store as editorStore,
|
|
8
8
|
} from '@wordpress/editor';
|
|
9
9
|
import { Button } from '@wordpress/components';
|
|
10
10
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
13
|
+
import { useEffect, useRef } from '@wordpress/element';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Internal dependencies
|
|
@@ -22,6 +23,23 @@ export default function TextEditor() {
|
|
|
22
23
|
}, [] );
|
|
23
24
|
const { switchEditorMode } = useDispatch( editPostStore );
|
|
24
25
|
|
|
26
|
+
const { isWelcomeGuideVisible } = useSelect( ( select ) => {
|
|
27
|
+
const { isFeatureActive } = select( editPostStore );
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
isWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),
|
|
31
|
+
};
|
|
32
|
+
}, [] );
|
|
33
|
+
|
|
34
|
+
const titleRef = useRef();
|
|
35
|
+
|
|
36
|
+
useEffect( () => {
|
|
37
|
+
if ( isWelcomeGuideVisible ) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
titleRef?.current?.focus();
|
|
41
|
+
}, [ isWelcomeGuideVisible ] );
|
|
42
|
+
|
|
25
43
|
return (
|
|
26
44
|
<div className="edit-post-text-editor">
|
|
27
45
|
{ isRichEditingEnabled && (
|
|
@@ -37,7 +55,7 @@ export default function TextEditor() {
|
|
|
37
55
|
</div>
|
|
38
56
|
) }
|
|
39
57
|
<div className="edit-post-text-editor__body">
|
|
40
|
-
<
|
|
58
|
+
<PostTitleRaw ref={ titleRef } />
|
|
41
59
|
<PostTextEditor />
|
|
42
60
|
</div>
|
|
43
61
|
</div>
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
flex-grow: 1;
|
|
6
6
|
|
|
7
7
|
// Post title.
|
|
8
|
-
.editor-post-title
|
|
8
|
+
.editor-post-title:not(.is-raw-text),
|
|
9
|
+
.editor-post-title.is-raw-text textarea {
|
|
9
10
|
max-width: none;
|
|
10
11
|
line-height: $default-line-height;
|
|
11
12
|
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
font-weight: normal;
|
|
15
16
|
|
|
16
17
|
border: $border-width solid $gray-600;
|
|
18
|
+
border-radius: 0;
|
|
17
19
|
|
|
18
20
|
// Same padding as body.
|
|
19
21
|
padding: $grid-unit-20;
|
|
@@ -8,18 +8,28 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
8
8
|
import { store as coreStore } from '@wordpress/core-data';
|
|
9
9
|
import { useSelect } from '@wordpress/data';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import { store as editPostStore } from '../../store';
|
|
15
|
+
|
|
11
16
|
export default function ViewLink() {
|
|
12
|
-
const { permalink, isPublished, label } = useSelect(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
const { permalink, isPublished, label, showIconLabels } = useSelect(
|
|
18
|
+
( select ) => {
|
|
19
|
+
// Grab post type to retrieve the view_item label.
|
|
20
|
+
const postTypeSlug = select( editorStore ).getCurrentPostType();
|
|
21
|
+
const postType = select( coreStore ).getPostType( postTypeSlug );
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
return {
|
|
24
|
+
permalink: select( editorStore ).getPermalink(),
|
|
25
|
+
isPublished: select( editorStore ).isCurrentPostPublished(),
|
|
26
|
+
label: postType?.labels.view_item,
|
|
27
|
+
showIconLabels:
|
|
28
|
+
select( editPostStore ).isFeatureActive( 'showIconLabels' ),
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
[]
|
|
32
|
+
);
|
|
23
33
|
|
|
24
34
|
// Only render the view button if the post is published and has a permalink.
|
|
25
35
|
if ( ! isPublished || ! permalink ) {
|
|
@@ -32,6 +42,7 @@ export default function ViewLink() {
|
|
|
32
42
|
label={ label || __( 'View post' ) }
|
|
33
43
|
href={ permalink }
|
|
34
44
|
target="_blank"
|
|
45
|
+
showTooltip={ ! showIconLabels }
|
|
35
46
|
/>
|
|
36
47
|
);
|
|
37
48
|
}
|
|
@@ -411,6 +411,13 @@ export default function VisualEditor( { styles } ) {
|
|
|
411
411
|
: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.
|
|
412
412
|
}
|
|
413
413
|
layout={ blockListLayout }
|
|
414
|
+
dropZoneElement={
|
|
415
|
+
// When iframed, pass in the html element of the iframe to
|
|
416
|
+
// ensure the drop zone extends to the edges of the iframe.
|
|
417
|
+
isToBeIframed
|
|
418
|
+
? ref.current?.parentNode
|
|
419
|
+
: ref.current
|
|
420
|
+
}
|
|
414
421
|
/>
|
|
415
422
|
</RecursionProvider>
|
|
416
423
|
</BlockCanvas>
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
font-size: $default-font-size;
|
|
22
22
|
padding: 6px 12px;
|
|
23
23
|
|
|
24
|
-
&.is-tertiary,
|
|
25
24
|
&.has-icon {
|
|
26
25
|
padding: 6px;
|
|
27
26
|
}
|
|
@@ -67,92 +66,3 @@
|
|
|
67
66
|
// See also https://www.w3.org/TR/CSS22/visudet.html#the-height-property
|
|
68
67
|
flex-grow: 1;
|
|
69
68
|
}
|
|
70
|
-
|
|
71
|
-
// Fixed contextual toolbar
|
|
72
|
-
@include editor-left(".edit-post-visual-editor .block-editor-block-contextual-toolbar.is-fixed");
|
|
73
|
-
|
|
74
|
-
.edit-post-visual-editor .block-editor-block-contextual-toolbar.is-fixed {
|
|
75
|
-
position: sticky;
|
|
76
|
-
top: 0;
|
|
77
|
-
z-index: z-index(".block-editor-block-popover");
|
|
78
|
-
display: block;
|
|
79
|
-
width: 100%;
|
|
80
|
-
|
|
81
|
-
// on desktop and tablet viewports the toolbar is fixed
|
|
82
|
-
// on top of interface header
|
|
83
|
-
$toolbar-margin: $grid-unit-80 * 3 - 2 * $grid-unit + $grid-unit-05;
|
|
84
|
-
|
|
85
|
-
@include break-medium() {
|
|
86
|
-
// leave room for block inserter, undo and redo, list view
|
|
87
|
-
margin-left: $toolbar-margin;
|
|
88
|
-
// position on top of interface header
|
|
89
|
-
position: fixed;
|
|
90
|
-
top: $admin-bar-height;
|
|
91
|
-
// Don't fill up when empty
|
|
92
|
-
min-height: initial;
|
|
93
|
-
// remove the border
|
|
94
|
-
border-bottom: none;
|
|
95
|
-
// has to be flex for collapse button to fit
|
|
96
|
-
display: flex;
|
|
97
|
-
|
|
98
|
-
// Mimic the height of the parent, vertically align center, and provide a max-height.
|
|
99
|
-
height: $header-height;
|
|
100
|
-
align-items: center;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// on tablet viewports the toolbar is fixed
|
|
104
|
-
// on top of interface header and covers the whole header
|
|
105
|
-
// except for the inserter on the left
|
|
106
|
-
width: calc(100% - #{$toolbar-margin});
|
|
107
|
-
|
|
108
|
-
&.is-collapsed {
|
|
109
|
-
width: initial;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
&:empty {
|
|
113
|
-
width: initial;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.is-fullscreen-mode & {
|
|
117
|
-
// leave room for block inserter, undo and redo, list view
|
|
118
|
-
// and some margin left
|
|
119
|
-
margin-left: $grid-unit-80 * 4 - 2 * $grid-unit;
|
|
120
|
-
|
|
121
|
-
top: 0;
|
|
122
|
-
|
|
123
|
-
&.is-collapsed {
|
|
124
|
-
width: initial;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
&:empty {
|
|
128
|
-
width: initial;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.show-icon-labels & {
|
|
133
|
-
width: calc(100% + 40px - #{$toolbar-margin}); //there are no undo, redo and list view buttons
|
|
134
|
-
margin-left: $grid-unit-80 + 2 * $grid-unit; // inserter and margin
|
|
135
|
-
|
|
136
|
-
.is-fullscreen-mode & {
|
|
137
|
-
margin-left: $grid-unit * 18; // site hub, inserter and margin
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// on desktop viewports the toolbar is fixed
|
|
143
|
-
// on top of interface header and leaves room
|
|
144
|
-
// for the block inserter the publish button
|
|
145
|
-
@include break-large() {
|
|
146
|
-
width: auto;
|
|
147
|
-
.show-icon-labels & {
|
|
148
|
-
width: auto; //there are no undo, redo and list view buttons
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.is-fullscreen-mode & {
|
|
152
|
-
// in full screen mode we need to account for
|
|
153
|
-
// the combined with of the tools at the right of the header and the margin left
|
|
154
|
-
// of the toolbar which includes four buttons
|
|
155
|
-
width: calc(100% - 280px - #{4 * $grid-unit-80});
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
package/src/store/actions.js
CHANGED
|
@@ -630,7 +630,7 @@ export const toggleDistractionFree =
|
|
|
630
630
|
registry.batch( () => {
|
|
631
631
|
registry
|
|
632
632
|
.dispatch( preferencesStore )
|
|
633
|
-
.set( 'core/edit-post', 'fixedToolbar',
|
|
633
|
+
.set( 'core/edit-post', 'fixedToolbar', true );
|
|
634
634
|
dispatch.setIsInserterOpened( false );
|
|
635
635
|
dispatch.setIsListViewOpened( false );
|
|
636
636
|
dispatch.closeGeneralSidebar();
|