@wordpress/edit-post 6.8.0 → 6.11.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.
Files changed (142) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/build/components/header/header-toolbar/index.js +7 -6
  4. package/build/components/header/header-toolbar/index.js.map +1 -1
  5. package/build/components/header/template-title/edit-template-title.js +11 -2
  6. package/build/components/header/template-title/edit-template-title.js.map +1 -1
  7. package/build/components/keyboard-shortcut-help-modal/config.js +12 -0
  8. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  9. package/build/components/keyboard-shortcut-help-modal/index.js +1 -3
  10. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  11. package/build/components/preferences-modal/index.js +3 -26
  12. package/build/components/preferences-modal/index.js.map +1 -1
  13. package/build/components/sidebar/plugin-post-status-info/index.js +2 -2
  14. package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  15. package/build/components/sidebar/post-format/index.js +3 -1
  16. package/build/components/sidebar/post-format/index.js.map +1 -1
  17. package/build/components/sidebar/post-schedule/index.js +28 -12
  18. package/build/components/sidebar/post-schedule/index.js.map +1 -1
  19. package/build/components/sidebar/post-slug/index.js +3 -1
  20. package/build/components/sidebar/post-slug/index.js.map +1 -1
  21. package/build/components/sidebar/post-status/index.js +6 -2
  22. package/build/components/sidebar/post-status/index.js.map +1 -1
  23. package/build/components/sidebar/post-template/create-modal.js +116 -0
  24. package/build/components/sidebar/post-template/create-modal.js.map +1 -0
  25. package/build/components/sidebar/post-template/form.js +123 -0
  26. package/build/components/sidebar/post-template/form.js.map +1 -0
  27. package/build/components/sidebar/post-template/index.js +128 -0
  28. package/build/components/sidebar/post-template/index.js.map +1 -0
  29. package/build/components/sidebar/post-url/index.js +68 -0
  30. package/build/components/sidebar/post-url/index.js.map +1 -0
  31. package/build/components/sidebar/post-visibility/index.js +21 -6
  32. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  33. package/build/components/sidebar/settings-sidebar/index.js +2 -6
  34. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  35. package/build/components/start-page-options/index.js +31 -13
  36. package/build/components/start-page-options/index.js.map +1 -1
  37. package/build/components/visual-editor/index.js +4 -2
  38. package/build/components/visual-editor/index.js.map +1 -1
  39. package/build/editor.js +8 -3
  40. package/build/editor.js.map +1 -1
  41. package/build/editor.native.js +1 -1
  42. package/build/editor.native.js.map +1 -1
  43. package/build/store/selectors.js +8 -8
  44. package/build/store/selectors.js.map +1 -1
  45. package/build-module/components/header/header-toolbar/index.js +8 -6
  46. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  47. package/build-module/components/header/template-title/edit-template-title.js +12 -2
  48. package/build-module/components/header/template-title/edit-template-title.js.map +1 -1
  49. package/build-module/components/keyboard-shortcut-help-modal/config.js +12 -0
  50. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  51. package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
  52. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  53. package/build-module/components/preferences-modal/index.js +3 -25
  54. package/build-module/components/preferences-modal/index.js.map +1 -1
  55. package/build-module/components/sidebar/plugin-post-status-info/index.js +2 -2
  56. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  57. package/build-module/components/sidebar/post-format/index.js +3 -1
  58. package/build-module/components/sidebar/post-format/index.js.map +1 -1
  59. package/build-module/components/sidebar/post-schedule/index.js +32 -13
  60. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  61. package/build-module/components/sidebar/post-slug/index.js +3 -1
  62. package/build-module/components/sidebar/post-slug/index.js.map +1 -1
  63. package/build-module/components/sidebar/post-status/index.js +4 -2
  64. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  65. package/build-module/components/sidebar/post-template/create-modal.js +104 -0
  66. package/build-module/components/sidebar/post-template/create-modal.js.map +1 -0
  67. package/build-module/components/sidebar/post-template/form.js +106 -0
  68. package/build-module/components/sidebar/post-template/form.js.map +1 -0
  69. package/build-module/components/sidebar/post-template/index.js +114 -0
  70. package/build-module/components/sidebar/post-template/index.js.map +1 -0
  71. package/build-module/components/sidebar/post-url/index.js +59 -0
  72. package/build-module/components/sidebar/post-url/index.js.map +1 -0
  73. package/build-module/components/sidebar/post-visibility/index.js +24 -8
  74. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  75. package/build-module/components/sidebar/settings-sidebar/index.js +2 -4
  76. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  77. package/build-module/components/start-page-options/index.js +32 -14
  78. package/build-module/components/start-page-options/index.js.map +1 -1
  79. package/build-module/components/visual-editor/index.js +4 -2
  80. package/build-module/components/visual-editor/index.js.map +1 -1
  81. package/build-module/editor.js +9 -4
  82. package/build-module/editor.js.map +1 -1
  83. package/build-module/editor.native.js +2 -2
  84. package/build-module/editor.native.js.map +1 -1
  85. package/build-module/store/selectors.js +8 -7
  86. package/build-module/store/selectors.js.map +1 -1
  87. package/build-style/style-rtl.css +82 -91
  88. package/build-style/style.css +81 -94
  89. package/package.json +27 -27
  90. package/src/components/header/header-toolbar/index.js +10 -10
  91. package/src/components/header/header-toolbar/style.scss +2 -5
  92. package/src/components/header/style.scss +0 -6
  93. package/src/components/header/template-title/edit-template-title.js +11 -1
  94. package/src/components/keyboard-shortcut-help-modal/config.js +8 -0
  95. package/src/components/keyboard-shortcut-help-modal/index.js +1 -2
  96. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -5
  97. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +14 -0
  98. package/src/components/preferences-modal/index.js +5 -23
  99. package/src/components/preferences-modal/test/index.js +3 -3
  100. package/src/components/sidebar/plugin-post-status-info/index.js +2 -2
  101. package/src/components/sidebar/post-author/style.scss +4 -10
  102. package/src/components/sidebar/post-format/index.js +1 -1
  103. package/src/components/sidebar/post-format/style.scss +5 -0
  104. package/src/components/sidebar/post-schedule/index.js +27 -16
  105. package/src/components/sidebar/post-schedule/style.scss +16 -3
  106. package/src/components/sidebar/post-slug/index.js +1 -1
  107. package/src/components/sidebar/post-slug/style.scss +4 -3
  108. package/src/components/sidebar/post-status/index.js +6 -2
  109. package/src/components/sidebar/post-template/create-modal.js +146 -0
  110. package/src/components/sidebar/post-template/form.js +143 -0
  111. package/src/components/sidebar/post-template/index.js +106 -0
  112. package/src/components/sidebar/post-template/style.scss +36 -0
  113. package/src/components/sidebar/post-url/index.js +51 -0
  114. package/src/components/sidebar/post-url/style.scss +23 -0
  115. package/src/components/sidebar/post-visibility/index.js +22 -8
  116. package/src/components/sidebar/post-visibility/style.scss +4 -4
  117. package/src/components/sidebar/settings-sidebar/index.js +1 -5
  118. package/src/components/sidebar/template/style.scss +0 -8
  119. package/src/components/start-page-options/index.js +46 -22
  120. package/src/components/start-page-options/style.scss +0 -9
  121. package/src/components/visual-editor/index.js +2 -1
  122. package/src/editor.js +8 -4
  123. package/src/editor.native.js +2 -2
  124. package/src/store/selectors.js +5 -8
  125. package/src/style.scss +3 -2
  126. package/src/test/editor.native.js +1 -3
  127. package/build/components/sidebar/post-link/index.js +0 -182
  128. package/build/components/sidebar/post-link/index.js.map +0 -1
  129. package/build/components/sidebar/template/actions.js +0 -172
  130. package/build/components/sidebar/template/actions.js.map +0 -1
  131. package/build/components/sidebar/template/index.js +0 -164
  132. package/build/components/sidebar/template/index.js.map +0 -1
  133. package/build-module/components/sidebar/post-link/index.js +0 -165
  134. package/build-module/components/sidebar/post-link/index.js.map +0 -1
  135. package/build-module/components/sidebar/template/actions.js +0 -158
  136. package/build-module/components/sidebar/template/actions.js.map +0 -1
  137. package/build-module/components/sidebar/template/index.js +0 -145
  138. package/build-module/components/sidebar/template/index.js.map +0 -1
  139. package/src/components/sidebar/post-link/index.js +0 -179
  140. package/src/components/sidebar/post-link/style.scss +0 -20
  141. package/src/components/sidebar/template/actions.js +0 -206
  142. package/src/components/sidebar/template/index.js +0 -160
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-post",
3
- "version": "6.8.0",
3
+ "version": "6.11.0",
4
4
  "description": "Edit Post module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,31 +27,31 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.11.0",
31
- "@wordpress/api-fetch": "^6.8.0",
32
- "@wordpress/block-editor": "^9.3.0",
33
- "@wordpress/block-library": "^7.8.0",
34
- "@wordpress/blocks": "^11.10.0",
35
- "@wordpress/components": "^19.13.0",
36
- "@wordpress/compose": "^5.9.0",
37
- "@wordpress/core-data": "^4.9.0",
38
- "@wordpress/data": "^6.11.0",
39
- "@wordpress/deprecated": "^3.11.0",
40
- "@wordpress/editor": "^12.10.0",
41
- "@wordpress/element": "^4.9.0",
42
- "@wordpress/hooks": "^3.11.0",
43
- "@wordpress/i18n": "^4.11.0",
44
- "@wordpress/icons": "^9.2.0",
45
- "@wordpress/interface": "^4.10.0",
46
- "@wordpress/keyboard-shortcuts": "^3.9.0",
47
- "@wordpress/keycodes": "^3.11.0",
48
- "@wordpress/media-utils": "^4.2.0",
49
- "@wordpress/notices": "^3.11.0",
50
- "@wordpress/plugins": "^4.9.0",
51
- "@wordpress/preferences": "^2.3.0",
52
- "@wordpress/url": "^3.12.0",
53
- "@wordpress/viewport": "^4.9.0",
54
- "@wordpress/warning": "^2.11.0",
30
+ "@wordpress/a11y": "^3.14.0",
31
+ "@wordpress/api-fetch": "^6.11.0",
32
+ "@wordpress/block-editor": "^9.6.0",
33
+ "@wordpress/block-library": "^7.11.0",
34
+ "@wordpress/blocks": "^11.13.0",
35
+ "@wordpress/components": "^19.16.0",
36
+ "@wordpress/compose": "^5.12.0",
37
+ "@wordpress/core-data": "^4.12.0",
38
+ "@wordpress/data": "^6.14.0",
39
+ "@wordpress/deprecated": "^3.14.0",
40
+ "@wordpress/editor": "^12.13.0",
41
+ "@wordpress/element": "^4.12.0",
42
+ "@wordpress/hooks": "^3.14.0",
43
+ "@wordpress/i18n": "^4.14.0",
44
+ "@wordpress/icons": "^9.5.0",
45
+ "@wordpress/interface": "^4.13.0",
46
+ "@wordpress/keyboard-shortcuts": "^3.12.0",
47
+ "@wordpress/keycodes": "^3.14.0",
48
+ "@wordpress/media-utils": "^4.5.0",
49
+ "@wordpress/notices": "^3.14.0",
50
+ "@wordpress/plugins": "^4.12.0",
51
+ "@wordpress/preferences": "^2.6.0",
52
+ "@wordpress/url": "^3.15.0",
53
+ "@wordpress/viewport": "^4.12.0",
54
+ "@wordpress/warning": "^2.14.0",
55
55
  "classnames": "^2.3.1",
56
56
  "lodash": "^4.17.21",
57
57
  "memize": "^1.1.0",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "48d5f37dfb52d2e77c8eeb662f9874cf141b8c6b"
67
+ "gitHead": "0315dbc240cb2aa146d7c1bafd251f004b88300e"
68
68
  }
@@ -106,6 +106,14 @@ function HeaderToolbar() {
106
106
  setIsInserterOpened( true );
107
107
  }
108
108
  }, [ isInserterOpened, setIsInserterOpened ] );
109
+
110
+ /* translators: button label text should, if possible, be under 16 characters. */
111
+ const longLabel = _x(
112
+ 'Toggle block inserter',
113
+ 'Generic label for block inserter button'
114
+ );
115
+ const shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );
116
+
109
117
  return (
110
118
  <NavigableToolbar
111
119
  className="edit-post-header-toolbar"
@@ -122,17 +130,9 @@ function HeaderToolbar() {
122
130
  onClick={ openInserter }
123
131
  disabled={ ! isInserterEnabled }
124
132
  icon={ plus }
125
- /* translators: button label text should, if possible, be under 16
126
- characters. */
127
- label={ _x(
128
- 'Toggle block inserter',
129
- 'Generic label for block inserter button'
130
- ) }
133
+ label={ showIconLabels ? shortLabel : longLabel }
131
134
  showTooltip={ ! showIconLabels }
132
- >
133
- { showIconLabels &&
134
- ( ! isInserterOpened ? __( 'Add' ) : __( 'Close' ) ) }
135
- </ToolbarItem>
135
+ />
136
136
  { ( isWideViewport || ! showIconLabels ) && (
137
137
  <>
138
138
  { isLargeViewport && (
@@ -101,15 +101,12 @@
101
101
  padding: 0;
102
102
 
103
103
  .show-icon-labels & {
104
+ width: auto;
104
105
  height: 36px;
106
+ padding: 0 $grid-unit-10;
105
107
  }
106
108
  }
107
109
 
108
- .edit-post-header-toolbar .edit-post-header-toolbar__left > .edit-post-header-toolbar__inserter-toggle.has-text.has-icon {
109
- width: auto;
110
- padding: 0 $grid-unit-10;
111
- }
112
-
113
110
  .show-icon-labels .edit-post-header-toolbar__left > * + * {
114
111
  margin-left: $grid-unit-10;
115
112
  }
@@ -146,12 +146,6 @@
146
146
  }
147
147
  }
148
148
 
149
- // The inserter has a custom label, different from its aria-label, so we don't want to display both.
150
- .edit-post-header-toolbar__inserter-toggle.edit-post-header-toolbar__inserter-toggle {
151
- &::after {
152
- content: none;
153
- }
154
- }
155
149
  // The post saved state button has a custom label only on small breakpoint
156
150
  .editor-post-save-draft.editor-post-save-draft {
157
151
  &::after {
@@ -9,6 +9,7 @@ import { mapValues } from 'lodash';
9
9
  import { __ } from '@wordpress/i18n';
10
10
  import { TextControl } from '@wordpress/components';
11
11
  import { useDispatch, useSelect } from '@wordpress/data';
12
+ import { useState } from '@wordpress/element';
12
13
  import { store as editorStore } from '@wordpress/editor';
13
14
  import { store as coreStore } from '@wordpress/core-data';
14
15
 
@@ -18,6 +19,7 @@ import { store as coreStore } from '@wordpress/core-data';
18
19
  import { store as editPostStore } from '../../../store';
19
20
 
20
21
  export default function EditTemplateTitle() {
22
+ const [ forceEmpty, setForceEmpty ] = useState( false );
21
23
  const { template } = useSelect( ( select ) => {
22
24
  const { getEditedPostTemplate } = select( editPostStore );
23
25
  return {
@@ -45,11 +47,18 @@ export default function EditTemplateTitle() {
45
47
  <div className="edit-site-template-details__group">
46
48
  <TextControl
47
49
  label={ __( 'Title' ) }
48
- value={ templateTitle }
50
+ value={ forceEmpty ? '' : templateTitle }
49
51
  help={ __(
50
52
  'Give the template a title that indicates its purpose, e.g. "Full Width".'
51
53
  ) }
52
54
  onChange={ ( newTitle ) => {
55
+ // Allow having the field temporarily empty while typing.
56
+ if ( ! newTitle && ! forceEmpty ) {
57
+ setForceEmpty( true );
58
+ return;
59
+ }
60
+ setForceEmpty( false );
61
+
53
62
  const settings = getEditorSettings();
54
63
  const newAvailableTemplates = mapValues(
55
64
  settings.availableTemplates,
@@ -68,6 +77,7 @@ export default function EditTemplateTitle() {
68
77
  title: newTitle,
69
78
  } );
70
79
  } }
80
+ onBlur={ () => setForceEmpty( false ) }
71
81
  />
72
82
  </div>
73
83
  );
@@ -28,4 +28,12 @@ export const textFormattingShortcuts = [
28
28
  keyCombination: { modifier: 'primary', character: 'u' },
29
29
  description: __( 'Underline the selected text.' ),
30
30
  },
31
+ {
32
+ keyCombination: { modifier: 'access', character: 'd' },
33
+ description: __( 'Strikethrough the selected text.' ),
34
+ },
35
+ {
36
+ keyCombination: { modifier: 'access', character: 'x' },
37
+ description: __( 'Make the selected text inline code.' ),
38
+ },
31
39
  ];
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { isString } from 'lodash';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -41,7 +40,7 @@ const ShortcutList = ( { shortcuts } ) => (
41
40
  className="edit-post-keyboard-shortcut-help-modal__shortcut"
42
41
  key={ index }
43
42
  >
44
- { isString( shortcut ) ? (
43
+ { typeof shortcut === 'string' ? (
45
44
  <DynamicShortcut name={ shortcut } />
46
45
  ) : (
47
46
  <Shortcut { ...shortcut } />
@@ -3,11 +3,6 @@
3
3
  margin: 0 0 2rem 0;
4
4
  }
5
5
 
6
- &__main-shortcuts .edit-post-keyboard-shortcut-help-modal__shortcut-list {
7
- // Push the shortcut to be flush with top modal header.
8
- margin-top: -$grid-unit-30 -$border-width;
9
- }
10
-
11
6
  &__section-title {
12
7
  font-size: 0.9rem;
13
8
  font-weight: 600;
@@ -82,6 +82,20 @@ exports[`KeyboardShortcutHelpModal should match snapshot when the modal is activ
82
82
  "modifier": "primary",
83
83
  },
84
84
  },
85
+ Object {
86
+ "description": "Strikethrough the selected text.",
87
+ "keyCombination": Object {
88
+ "character": "d",
89
+ "modifier": "access",
90
+ },
91
+ },
92
+ Object {
93
+ "description": "Make the selected text inline code.",
94
+ "keyCombination": Object {
95
+ "character": "x",
96
+ "modifier": "access",
97
+ },
98
+ },
85
99
  ]
86
100
  }
87
101
  title="Text formatting"
@@ -19,7 +19,6 @@ import {
19
19
  PostTypeSupportCheck,
20
20
  store as editorStore,
21
21
  } from '@wordpress/editor';
22
- import { store as coreStore } from '@wordpress/core-data';
23
22
  import {
24
23
  PreferencesModal,
25
24
  PreferencesModalTabs,
@@ -45,15 +44,10 @@ const MODAL_NAME = 'edit-post/preferences';
45
44
  export default function EditPostPreferencesModal() {
46
45
  const isLargeViewport = useViewportMatch( 'medium' );
47
46
  const { closeModal } = useDispatch( editPostStore );
48
- const { isModalActive, isViewable } = useSelect( ( select ) => {
49
- const { getEditedPostAttribute } = select( editorStore );
50
- const { getPostType } = select( coreStore );
51
- const postType = getPostType( getEditedPostAttribute( 'type' ) );
52
- return {
53
- isModalActive: select( editPostStore ).isModalActive( MODAL_NAME ),
54
- isViewable: get( postType, [ 'viewable' ], false ),
55
- };
56
- }, [] );
47
+ const isModalActive = useSelect(
48
+ ( select ) => select( editPostStore ).isModalActive( MODAL_NAME ),
49
+ []
50
+ );
57
51
  const showBlockBreadcrumbsOption = useSelect(
58
52
  ( select ) => {
59
53
  const { getEditorSettings } = select( editorStore );
@@ -200,18 +194,6 @@ export default function EditPostPreferencesModal() {
200
194
  ) }
201
195
  >
202
196
  <EnablePluginDocumentSettingPanelOption.Slot />
203
- { isViewable && (
204
- <EnablePanelOption
205
- label={ __( 'Permalink' ) }
206
- panelName="post-link"
207
- />
208
- ) }
209
- { isViewable && (
210
- <EnablePanelOption
211
- label={ __( 'Template' ) }
212
- panelName="template"
213
- />
214
- ) }
215
197
  <PostTaxonomies
216
198
  taxonomyWrapper={ ( content, taxonomy ) => (
217
199
  <EnablePanelOption
@@ -260,7 +242,7 @@ export default function EditPostPreferencesModal() {
260
242
  ),
261
243
  },
262
244
  ],
263
- [ isViewable, isLargeViewport, showBlockBreadcrumbsOption ]
245
+ [ isLargeViewport, showBlockBreadcrumbsOption ]
264
246
  );
265
247
 
266
248
  if ( ! isModalActive ) {
@@ -21,13 +21,13 @@ jest.mock( '@wordpress/compose/src/hooks/use-viewport-match', () => jest.fn() );
21
21
  describe( 'EditPostPreferencesModal', () => {
22
22
  describe( 'should match snapshot when the modal is active', () => {
23
23
  it( 'large viewports', () => {
24
- useSelect.mockImplementation( () => ( { isModalActive: true } ) );
24
+ useSelect.mockImplementation( () => true );
25
25
  useViewportMatch.mockImplementation( () => true );
26
26
  const wrapper = shallow( <EditPostPreferencesModal /> );
27
27
  expect( wrapper ).toMatchSnapshot();
28
28
  } );
29
29
  it( 'small viewports', () => {
30
- useSelect.mockImplementation( () => ( { isModalActive: true } ) );
30
+ useSelect.mockImplementation( () => true );
31
31
  useViewportMatch.mockImplementation( () => false );
32
32
  const wrapper = shallow( <EditPostPreferencesModal /> );
33
33
  expect( wrapper ).toMatchSnapshot();
@@ -35,7 +35,7 @@ describe( 'EditPostPreferencesModal', () => {
35
35
  } );
36
36
 
37
37
  it( 'should not render when the modal is not active', () => {
38
- useSelect.mockImplementation( () => ( { isModalActive: false } ) );
38
+ useSelect.mockImplementation( () => false );
39
39
  const wrapper = shallow( <EditPostPreferencesModal /> );
40
40
  expect( wrapper.isEmptyRender() ).toBe( true );
41
41
  } );
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Defines as extensibility slot for the Status & visibility panel.
2
+ * Defines as extensibility slot for the Summary panel.
3
3
  */
4
4
 
5
5
  /**
@@ -10,7 +10,7 @@ import { createSlotFill, PanelRow } from '@wordpress/components';
10
10
  export const { Fill, Slot } = createSlotFill( 'PluginPostStatusInfo' );
11
11
 
12
12
  /**
13
- * Renders a row in the Status & visibility panel of the Document sidebar.
13
+ * Renders a row in the Summary panel of the Document sidebar.
14
14
  * It should be noted that this is named and implemented around the function it serves
15
15
  * and not its location, which may change in future iterations.
16
16
  *
@@ -1,11 +1,5 @@
1
- .editor-post-author__select {
2
- margin: -5px 0;
3
-
4
- // Set the width of the author select box in IE11 to prevent it overflowing
5
- // outside of the container because of IE11 flexbox bugs.
6
- // We reset it to `width: auto;` for non-IE11 browsers.
7
- width: 100%;
8
- @supports (position: sticky) {
9
- width: auto;
10
- }
1
+ .edit-post-post-author {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: stretch;
11
5
  }
@@ -10,7 +10,7 @@ import {
10
10
  export function PostFormat() {
11
11
  return (
12
12
  <PostFormatCheck>
13
- <PanelRow>
13
+ <PanelRow className="edit-post-post-format">
14
14
  <PostFormatForm />
15
15
  </PanelRow>
16
16
  </PostFormatCheck>
@@ -0,0 +1,5 @@
1
+ .edit-post-post-format {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: stretch;
5
+ }
@@ -1,18 +1,17 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __ } from '@wordpress/i18n';
4
+ import { __, sprintf } from '@wordpress/i18n';
5
5
  import { PanelRow, Dropdown, Button } from '@wordpress/components';
6
6
  import { useRef } from '@wordpress/element';
7
7
  import {
8
8
  PostSchedule as PostScheduleForm,
9
- PostScheduleLabel,
10
9
  PostScheduleCheck,
10
+ usePostScheduleLabel,
11
11
  } from '@wordpress/editor';
12
12
 
13
- export function PostSchedule() {
13
+ export default function PostSchedule() {
14
14
  const anchorRef = useRef();
15
-
16
15
  return (
17
16
  <PostScheduleCheck>
18
17
  <PanelRow className="edit-post-post-schedule" ref={ anchorRef }>
@@ -21,17 +20,12 @@ export function PostSchedule() {
21
20
  popoverProps={ { anchorRef } }
22
21
  position="bottom left"
23
22
  contentClassName="edit-post-post-schedule__dialog"
24
- renderToggle={ ( { onToggle, isOpen } ) => (
25
- <>
26
- <Button
27
- className="edit-post-post-schedule__toggle"
28
- onClick={ onToggle }
29
- aria-expanded={ isOpen }
30
- variant="tertiary"
31
- >
32
- <PostScheduleLabel />
33
- </Button>
34
- </>
23
+ focusOnMount
24
+ renderToggle={ ( { isOpen, onToggle } ) => (
25
+ <PostScheduleToggle
26
+ isOpen={ isOpen }
27
+ onClick={ onToggle }
28
+ />
35
29
  ) }
36
30
  renderContent={ ( { onClose } ) => (
37
31
  <PostScheduleForm onClose={ onClose } />
@@ -42,4 +36,21 @@ export function PostSchedule() {
42
36
  );
43
37
  }
44
38
 
45
- export default PostSchedule;
39
+ function PostScheduleToggle( { isOpen, onClick } ) {
40
+ const label = usePostScheduleLabel();
41
+ const fullLabel = usePostScheduleLabel( { full: true } );
42
+ return (
43
+ <Button
44
+ className="edit-post-post-schedule__toggle"
45
+ variant="tertiary"
46
+ label={ fullLabel }
47
+ showTooltip
48
+ aria-expanded={ isOpen }
49
+ // translators: %s: Current post date.
50
+ aria-label={ sprintf( __( 'Change date: %s' ), label ) }
51
+ onClick={ onClick }
52
+ >
53
+ { label }
54
+ </Button>
55
+ );
56
+ }
@@ -6,13 +6,26 @@
6
6
  span {
7
7
  display: block;
8
8
  width: 45%;
9
+ flex-shrink: 0;
9
10
  }
10
11
  }
11
12
 
12
13
  .components-button.edit-post-post-schedule__toggle {
13
- text-align: right;
14
+ text-align: left;
15
+ white-space: normal;
16
+ height: auto;
17
+
18
+ // This span is added by the Popover in Tooltip when no anchorRef is
19
+ // provided. We set its width to 0 so that it does not cause the button text
20
+ // to wrap to a new line when displaying the tooltip. A better fix would be
21
+ // to pass anchorRef and avoid the need for a span alltogether, which is
22
+ // what this PR allows us to do:
23
+ // https://github.com/WordPress/gutenberg/pull/41268.
24
+ span {
25
+ width: 0;
26
+ }
14
27
  }
15
28
 
16
- .edit-post-post-schedule__dialog .components-popover__content {
17
- padding: $grid-unit-20;
29
+ .edit-post-post-schedule__dialog .block-editor-publish-date-time-picker {
30
+ margin: $grid-unit-10;
18
31
  }
@@ -7,7 +7,7 @@ import { PostSlug as PostSlugForm, PostSlugCheck } from '@wordpress/editor';
7
7
  export function PostSlug() {
8
8
  return (
9
9
  <PostSlugCheck>
10
- <PanelRow>
10
+ <PanelRow className="edit-post-post-slug">
11
11
  <PostSlugForm />
12
12
  </PanelRow>
13
13
  </PostSlugCheck>
@@ -1,4 +1,5 @@
1
- .editor-post-slug__input {
2
- margin: -5px 0;
3
- padding: 2px;
1
+ .edit-post-post-slug {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: stretch;
4
5
  }
@@ -19,6 +19,8 @@ import PostFormat from '../post-format';
19
19
  import PostPendingStatus from '../post-pending-status';
20
20
  import PluginPostStatusInfo from '../plugin-post-status-info';
21
21
  import { store as editPostStore } from '../../../store';
22
+ import PostTemplate from '../post-template';
23
+ import PostURL from '../post-url';
22
24
 
23
25
  /**
24
26
  * Module Constants
@@ -29,7 +31,7 @@ function PostStatus( { isOpened, onTogglePanel } ) {
29
31
  return (
30
32
  <PanelBody
31
33
  className="edit-post-post-status"
32
- title={ __( 'Status & visibility' ) }
34
+ title={ __( 'Summary' ) }
33
35
  opened={ isOpened }
34
36
  onToggle={ onTogglePanel }
35
37
  >
@@ -38,9 +40,11 @@ function PostStatus( { isOpened, onTogglePanel } ) {
38
40
  <>
39
41
  <PostVisibility />
40
42
  <PostSchedule />
41
- <PostFormat />
43
+ <PostURL />
44
+ <PostTemplate />
42
45
  <PostSticky />
43
46
  <PostPendingStatus />
47
+ <PostFormat />
44
48
  <PostSlug />
45
49
  <PostAuthor />
46
50
  { fills }