@wordpress/editor 14.7.1-next.5368f64a9.0 → 14.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.
Files changed (241) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +1 -1
  3. package/build/bindings/post-meta.js +42 -7
  4. package/build/bindings/post-meta.js.map +1 -1
  5. package/build/components/block-manager/index.js +45 -66
  6. package/build/components/block-manager/index.js.map +1 -1
  7. package/build/components/document-bar/index.js +20 -28
  8. package/build/components/document-bar/index.js.map +1 -1
  9. package/build/components/editor-history/redo.js +2 -4
  10. package/build/components/editor-history/redo.js.map +1 -1
  11. package/build/components/editor-history/undo.js +2 -4
  12. package/build/components/editor-history/undo.js.map +1 -1
  13. package/build/components/editor-interface/index.js +1 -2
  14. package/build/components/editor-interface/index.js.map +1 -1
  15. package/build/components/error-boundary/index.js +2 -4
  16. package/build/components/error-boundary/index.js.map +1 -1
  17. package/build/components/global-styles-provider/index.js +21 -12
  18. package/build/components/global-styles-provider/index.js.map +1 -1
  19. package/build/components/header/index.js +4 -4
  20. package/build/components/header/index.js.map +1 -1
  21. package/build/components/media-categories/index.js +1 -0
  22. package/build/components/media-categories/index.js.map +1 -1
  23. package/build/components/post-excerpt/panel.js +2 -5
  24. package/build/components/post-excerpt/panel.js.map +1 -1
  25. package/build/components/post-featured-image/index.js +6 -12
  26. package/build/components/post-featured-image/index.js.map +1 -1
  27. package/build/components/post-format/index.js +2 -4
  28. package/build/components/post-format/index.js.map +1 -1
  29. package/build/components/post-last-revision/index.js +2 -4
  30. package/build/components/post-last-revision/index.js.map +1 -1
  31. package/build/components/post-locked-modal/index.js +4 -8
  32. package/build/components/post-locked-modal/index.js.map +1 -1
  33. package/build/components/post-publish-panel/index.js +2 -4
  34. package/build/components/post-publish-panel/index.js.map +1 -1
  35. package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -4
  36. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  37. package/build/components/post-publish-panel/maybe-upload-media.js +2 -4
  38. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  39. package/build/components/post-status/index.js +1 -0
  40. package/build/components/post-status/index.js.map +1 -1
  41. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -4
  42. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  43. package/build/components/post-taxonomies/most-used-terms.js +2 -4
  44. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  45. package/build/components/post-url/index.js +8 -7
  46. package/build/components/post-url/index.js.map +1 -1
  47. package/build/components/preview-dropdown/index.js +5 -57
  48. package/build/components/preview-dropdown/index.js.map +1 -1
  49. package/build/components/save-publish-panels/index.js +4 -10
  50. package/build/components/save-publish-panels/index.js.map +1 -1
  51. package/build/components/zoom-out-toggle/index.js +38 -0
  52. package/build/components/zoom-out-toggle/index.js.map +1 -0
  53. package/build/dataviews/store/private-actions.js +4 -10
  54. package/build/dataviews/store/private-actions.js.map +1 -1
  55. package/build-module/bindings/post-meta.js +40 -7
  56. package/build-module/bindings/post-meta.js.map +1 -1
  57. package/build-module/components/block-manager/index.js +46 -67
  58. package/build-module/components/block-manager/index.js.map +1 -1
  59. package/build-module/components/document-bar/index.js +22 -28
  60. package/build-module/components/document-bar/index.js.map +1 -1
  61. package/build-module/components/editor-history/redo.js +2 -4
  62. package/build-module/components/editor-history/redo.js.map +1 -1
  63. package/build-module/components/editor-history/undo.js +2 -4
  64. package/build-module/components/editor-history/undo.js.map +1 -1
  65. package/build-module/components/editor-interface/index.js +1 -2
  66. package/build-module/components/editor-interface/index.js.map +1 -1
  67. package/build-module/components/error-boundary/index.js +2 -4
  68. package/build-module/components/error-boundary/index.js.map +1 -1
  69. package/build-module/components/global-styles-provider/index.js +21 -12
  70. package/build-module/components/global-styles-provider/index.js.map +1 -1
  71. package/build-module/components/header/index.js +4 -4
  72. package/build-module/components/header/index.js.map +1 -1
  73. package/build-module/components/media-categories/index.js +1 -0
  74. package/build-module/components/media-categories/index.js.map +1 -1
  75. package/build-module/components/post-excerpt/panel.js +2 -5
  76. package/build-module/components/post-excerpt/panel.js.map +1 -1
  77. package/build-module/components/post-featured-image/index.js +6 -12
  78. package/build-module/components/post-featured-image/index.js.map +1 -1
  79. package/build-module/components/post-format/index.js +2 -4
  80. package/build-module/components/post-format/index.js.map +1 -1
  81. package/build-module/components/post-last-revision/index.js +2 -4
  82. package/build-module/components/post-last-revision/index.js.map +1 -1
  83. package/build-module/components/post-locked-modal/index.js +4 -8
  84. package/build-module/components/post-locked-modal/index.js.map +1 -1
  85. package/build-module/components/post-publish-panel/index.js +2 -4
  86. package/build-module/components/post-publish-panel/index.js.map +1 -1
  87. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -4
  88. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  89. package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -4
  90. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  91. package/build-module/components/post-status/index.js +1 -0
  92. package/build-module/components/post-status/index.js.map +1 -1
  93. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -4
  94. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  95. package/build-module/components/post-taxonomies/most-used-terms.js +2 -4
  96. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  97. package/build-module/components/post-url/index.js +9 -8
  98. package/build-module/components/post-url/index.js.map +1 -1
  99. package/build-module/components/preview-dropdown/index.js +5 -57
  100. package/build-module/components/preview-dropdown/index.js.map +1 -1
  101. package/build-module/components/save-publish-panels/index.js +4 -10
  102. package/build-module/components/save-publish-panels/index.js.map +1 -1
  103. package/build-module/components/zoom-out-toggle/index.js +31 -0
  104. package/build-module/components/zoom-out-toggle/index.js.map +1 -0
  105. package/build-module/dataviews/store/private-actions.js +2 -8
  106. package/build-module/dataviews/store/private-actions.js.map +1 -1
  107. package/build-style/style-rtl.css +38 -23
  108. package/build-style/style.css +38 -23
  109. package/build-types/bindings/post-meta.d.ts +4 -1
  110. package/build-types/bindings/post-meta.d.ts.map +1 -1
  111. package/build-types/components/block-manager/index.d.ts +1 -2
  112. package/build-types/components/block-manager/index.d.ts.map +1 -1
  113. package/build-types/components/document-bar/index.d.ts +7 -6
  114. package/build-types/components/document-bar/index.d.ts.map +1 -1
  115. package/build-types/components/editor-history/redo.d.ts.map +1 -1
  116. package/build-types/components/editor-history/undo.d.ts.map +1 -1
  117. package/build-types/components/editor-interface/index.d.ts +1 -2
  118. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  119. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  120. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  121. package/build-types/components/header/index.d.ts +2 -2
  122. package/build-types/components/header/index.d.ts.map +1 -1
  123. package/build-types/components/post-format/index.d.ts.map +1 -1
  124. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  125. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  126. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  127. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
  128. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
  129. package/build-types/components/post-status/index.d.ts.map +1 -1
  130. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  131. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
  132. package/build-types/components/post-url/index.d.ts.map +1 -1
  133. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  134. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  135. package/build-types/components/zoom-out-toggle/index.d.ts +3 -0
  136. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -0
  137. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  138. package/package.json +37 -36
  139. package/src/bindings/post-meta.js +56 -20
  140. package/src/components/block-manager/index.js +50 -67
  141. package/src/components/document-bar/index.js +29 -41
  142. package/src/components/document-bar/style.scss +33 -15
  143. package/src/components/editor-history/redo.js +1 -2
  144. package/src/components/editor-history/undo.js +1 -2
  145. package/src/components/editor-interface/index.js +1 -2
  146. package/src/components/error-boundary/index.js +1 -6
  147. package/src/components/global-styles-provider/index.js +50 -36
  148. package/src/components/header/index.js +8 -2
  149. package/src/components/post-excerpt/panel.js +1 -3
  150. package/src/components/post-featured-image/index.js +3 -6
  151. package/src/components/post-featured-image/style.scss +1 -5
  152. package/src/components/post-format/index.js +1 -2
  153. package/src/components/post-last-revision/index.js +1 -2
  154. package/src/components/post-locked-modal/index.js +2 -4
  155. package/src/components/post-panel-row/style.scss +1 -0
  156. package/src/components/post-publish-panel/index.js +1 -2
  157. package/src/components/post-publish-panel/maybe-post-format-panel.js +1 -2
  158. package/src/components/post-publish-panel/maybe-upload-media.js +1 -2
  159. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  160. package/src/components/post-status/index.js +1 -0
  161. package/src/components/post-status/style.scss +5 -0
  162. package/src/components/post-taxonomies/hierarchical-term-selector.js +1 -2
  163. package/src/components/post-taxonomies/most-used-terms.js +1 -2
  164. package/src/components/post-taxonomies/style.scss +0 -4
  165. package/src/components/post-url/index.js +9 -7
  166. package/src/components/preview-dropdown/index.js +26 -84
  167. package/src/components/save-publish-panels/index.js +2 -6
  168. package/src/components/zoom-out-toggle/index.js +34 -0
  169. package/src/dataviews/store/private-actions.ts +10 -8
  170. package/tsconfig.json +1 -0
  171. package/tsconfig.tsbuildinfo +1 -1
  172. package/build/dataviews/actions/duplicate-pattern.js +0 -48
  173. package/build/dataviews/actions/duplicate-pattern.js.map +0 -1
  174. package/build/dataviews/actions/duplicate-post.js +0 -146
  175. package/build/dataviews/actions/duplicate-post.js.map +0 -1
  176. package/build/dataviews/actions/duplicate-post.native.js +0 -9
  177. package/build/dataviews/actions/duplicate-post.native.js.map +0 -1
  178. package/build/dataviews/actions/export-pattern.js +0 -57
  179. package/build/dataviews/actions/export-pattern.js.map +0 -1
  180. package/build/dataviews/actions/export-pattern.native.js +0 -9
  181. package/build/dataviews/actions/export-pattern.native.js.map +0 -1
  182. package/build/dataviews/actions/permanently-delete-post.js +0 -109
  183. package/build/dataviews/actions/permanently-delete-post.js.map +0 -1
  184. package/build/dataviews/actions/reorder-page.js +0 -116
  185. package/build/dataviews/actions/reorder-page.js.map +0 -1
  186. package/build/dataviews/actions/reorder-page.native.js +0 -9
  187. package/build/dataviews/actions/reorder-page.native.js.map +0 -1
  188. package/build/dataviews/actions/view-post-revisions.js +0 -49
  189. package/build/dataviews/actions/view-post-revisions.js.map +0 -1
  190. package/build/dataviews/actions/view-post.js +0 -36
  191. package/build/dataviews/actions/view-post.js.map +0 -1
  192. package/build-module/dataviews/actions/duplicate-pattern.js +0 -39
  193. package/build-module/dataviews/actions/duplicate-pattern.js.map +0 -1
  194. package/build-module/dataviews/actions/duplicate-post.js +0 -139
  195. package/build-module/dataviews/actions/duplicate-post.js.map +0 -1
  196. package/build-module/dataviews/actions/duplicate-post.native.js +0 -3
  197. package/build-module/dataviews/actions/duplicate-post.native.js.map +0 -1
  198. package/build-module/dataviews/actions/export-pattern.js +0 -51
  199. package/build-module/dataviews/actions/export-pattern.js.map +0 -1
  200. package/build-module/dataviews/actions/export-pattern.native.js +0 -3
  201. package/build-module/dataviews/actions/export-pattern.native.js.map +0 -1
  202. package/build-module/dataviews/actions/permanently-delete-post.js +0 -102
  203. package/build-module/dataviews/actions/permanently-delete-post.js.map +0 -1
  204. package/build-module/dataviews/actions/reorder-page.js +0 -111
  205. package/build-module/dataviews/actions/reorder-page.js.map +0 -1
  206. package/build-module/dataviews/actions/reorder-page.native.js +0 -3
  207. package/build-module/dataviews/actions/reorder-page.native.js.map +0 -1
  208. package/build-module/dataviews/actions/view-post-revisions.js +0 -43
  209. package/build-module/dataviews/actions/view-post-revisions.js.map +0 -1
  210. package/build-module/dataviews/actions/view-post.js +0 -30
  211. package/build-module/dataviews/actions/view-post.js.map +0 -1
  212. package/build-types/dataviews/actions/duplicate-pattern.d.ts +0 -5
  213. package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +0 -1
  214. package/build-types/dataviews/actions/duplicate-post.d.ts +0 -5
  215. package/build-types/dataviews/actions/duplicate-post.d.ts.map +0 -1
  216. package/build-types/dataviews/actions/duplicate-post.native.d.ts +0 -3
  217. package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +0 -1
  218. package/build-types/dataviews/actions/export-pattern.d.ts +0 -8
  219. package/build-types/dataviews/actions/export-pattern.d.ts.map +0 -1
  220. package/build-types/dataviews/actions/export-pattern.native.d.ts +0 -3
  221. package/build-types/dataviews/actions/export-pattern.native.d.ts.map +0 -1
  222. package/build-types/dataviews/actions/permanently-delete-post.d.ts +0 -5
  223. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +0 -1
  224. package/build-types/dataviews/actions/reorder-page.d.ts +0 -8
  225. package/build-types/dataviews/actions/reorder-page.d.ts.map +0 -1
  226. package/build-types/dataviews/actions/reorder-page.native.d.ts +0 -3
  227. package/build-types/dataviews/actions/reorder-page.native.d.ts.map +0 -1
  228. package/build-types/dataviews/actions/view-post-revisions.d.ts +0 -8
  229. package/build-types/dataviews/actions/view-post-revisions.d.ts.map +0 -1
  230. package/build-types/dataviews/actions/view-post.d.ts +0 -8
  231. package/build-types/dataviews/actions/view-post.d.ts.map +0 -1
  232. package/src/dataviews/actions/duplicate-pattern.tsx +0 -40
  233. package/src/dataviews/actions/duplicate-post.native.tsx +0 -3
  234. package/src/dataviews/actions/duplicate-post.tsx +0 -174
  235. package/src/dataviews/actions/export-pattern.native.tsx +0 -3
  236. package/src/dataviews/actions/export-pattern.tsx +0 -76
  237. package/src/dataviews/actions/permanently-delete-post.tsx +0 -118
  238. package/src/dataviews/actions/reorder-page.native.tsx +0 -3
  239. package/src/dataviews/actions/reorder-page.tsx +0 -125
  240. package/src/dataviews/actions/view-post-revisions.tsx +0 -47
  241. package/src/dataviews/actions/view-post.tsx +0 -30
@@ -6,7 +6,7 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { __, isRTL, sprintf } from '@wordpress/i18n';
9
+ import { __, isRTL } from '@wordpress/i18n';
10
10
  import { useSelect, useDispatch } from '@wordpress/data';
11
11
  import {
12
12
  Button,
@@ -28,18 +28,8 @@ import { decodeEntities } from '@wordpress/html-entities';
28
28
  */
29
29
  import { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants';
30
30
  import { store as editorStore } from '../../store';
31
- import { unlock } from '../../lock-unlock';
32
31
 
33
- const TYPE_LABELS = {
34
- // translators: 1: Pattern title.
35
- wp_pattern: __( 'Editing pattern: %s' ),
36
- // translators: 1: Navigation menu title.
37
- wp_navigation: __( 'Editing navigation menu: %s' ),
38
- // translators: 1: Template title.
39
- wp_template: __( 'Editing template: %s' ),
40
- // translators: 1: Template part title.
41
- wp_template_part: __( 'Editing template part: %s' ),
42
- };
32
+ /** @typedef {import("@wordpress/components").IconType} IconType */
43
33
 
44
34
  const MotionButton = motion( Button );
45
35
 
@@ -52,21 +42,21 @@ const MotionButton = motion( Button );
52
42
  * ```jsx
53
43
  * <DocumentBar />
54
44
  * ```
55
- * @param {Object} props The component props.
56
- * @param {string} props.title A title for the document, defaulting to the document or
57
- * template title currently being edited.
58
- * @param {import("@wordpress/components").IconType} props.icon An icon for the document, defaulting to an icon for document
59
- * or template currently being edited.
45
+ * @param {Object} props The component props.
46
+ * @param {string} props.title A title for the document, defaulting to the document or
47
+ * template title currently being edited.
48
+ * @param {IconType} props.icon An icon for the document, no default.
49
+ * (A default icon indicating the document post type is no longer used.)
60
50
  *
61
51
  * @return {JSX.Element} The rendered DocumentBar component.
62
52
  */
63
53
  export default function DocumentBar( props ) {
64
54
  const {
65
55
  postType,
56
+ postTypeLabel,
66
57
  documentTitle,
67
58
  isNotFound,
68
59
  isUnsyncedPattern,
69
- templateIcon,
70
60
  templateTitle,
71
61
  onNavigateToPreviousEntityRecord,
72
62
  } = useSelect( ( select ) => {
@@ -76,8 +66,11 @@ export default function DocumentBar( props ) {
76
66
  getEditorSettings,
77
67
  __experimentalGetTemplateInfo: getTemplateInfo,
78
68
  } = select( editorStore );
79
- const { getEditedEntityRecord, isResolving: isResolvingSelector } =
80
- select( coreStore );
69
+ const {
70
+ getEditedEntityRecord,
71
+ getPostType,
72
+ isResolving: isResolvingSelector,
73
+ } = select( coreStore );
81
74
  const _postType = getCurrentPostType();
82
75
  const _postId = getCurrentPostId();
83
76
  const _document = getEditedEntityRecord(
@@ -86,8 +79,11 @@ export default function DocumentBar( props ) {
86
79
  _postId
87
80
  );
88
81
  const _templateInfo = getTemplateInfo( _document );
82
+ const _postTypeLabel = getPostType( _postType )?.labels?.singular_name;
83
+
89
84
  return {
90
85
  postType: _postType,
86
+ postTypeLabel: _postTypeLabel,
91
87
  documentTitle: _document.title,
92
88
  isNotFound:
93
89
  ! _document &&
@@ -98,12 +94,6 @@ export default function DocumentBar( props ) {
98
94
  _postId
99
95
  ),
100
96
  isUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced',
101
- templateIcon: unlock( select( editorStore ) ).getPostIcon(
102
- _postType,
103
- {
104
- area: _document?.area,
105
- }
106
- ),
107
97
  templateTitle: _templateInfo.title,
108
98
  onNavigateToPreviousEntityRecord:
109
99
  getEditorSettings().onNavigateToPreviousEntityRecord,
@@ -118,7 +108,7 @@ export default function DocumentBar( props ) {
118
108
  const hasBackButton = !! onNavigateToPreviousEntityRecord;
119
109
  const entityTitle = isTemplate ? templateTitle : documentTitle;
120
110
  const title = props.title || entityTitle;
121
- const icon = props.icon || templateIcon;
111
+ const icon = props.icon;
122
112
 
123
113
  const mountedRef = useRef( false );
124
114
  useEffect( () => {
@@ -187,20 +177,18 @@ export default function DocumentBar( props ) {
187
177
  isReducedMotion ? { duration: 0 } : undefined
188
178
  }
189
179
  >
190
- <BlockIcon icon={ icon } />
191
- <Text
192
- size="body"
193
- as="h1"
194
- aria-label={
195
- ! props.title && TYPE_LABELS[ postType ]
196
- ? // eslint-disable-next-line @wordpress/valid-sprintf
197
- sprintf( TYPE_LABELS[ postType ], title )
198
- : undefined
199
- }
200
- >
201
- { title
202
- ? decodeEntities( title )
203
- : __( 'No title' ) }
180
+ { icon && <BlockIcon icon={ icon } /> }
181
+ <Text size="body" as="h1">
182
+ <span className="editor-document-bar__post-title">
183
+ { title
184
+ ? decodeEntities( title )
185
+ : __( 'No title' ) }
186
+ </span>
187
+ { postTypeLabel && ! props.title && (
188
+ <span className="editor-document-bar__post-type-label">
189
+ { '· ' + decodeEntities( postTypeLabel ) }
190
+ </span>
191
+ ) }
204
192
  </Text>
205
193
  </motion.div>
206
194
  <span className="editor-document-bar__shortcut">
@@ -25,6 +25,14 @@
25
25
  background: $gray-200;
26
26
  }
27
27
  }
28
+
29
+ &.has-back-button {
30
+ @media screen and (min-width: #{ ($break-medium) }) and (max-width: #{ ($break-large) }) {
31
+ .editor-document-bar__post-type-label {
32
+ display: none;
33
+ }
34
+ }
35
+ }
28
36
  }
29
37
 
30
38
  .editor-document-bar__command {
@@ -34,34 +42,44 @@
34
42
  }
35
43
 
36
44
  .editor-document-bar__title {
37
- flex: 1;
38
45
  overflow: hidden;
39
46
  color: $gray-900;
40
- gap: $grid-unit-05;
41
- display: flex;
42
- justify-content: center;
43
- align-items: center;
47
+ margin: 0 auto;
48
+ max-width: 70%;
44
49
 
45
50
  // Offset the layout based on the width of the ⌘K label. This ensures the title is centrally aligned.
46
51
  @include break-medium() {
47
52
  padding-left: $grid-unit-30;
48
53
  }
49
54
 
55
+ h1 {
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ font-weight: 400;
60
+ white-space: nowrap;
61
+ overflow: hidden;
62
+ }
63
+ }
64
+
65
+ .editor-document-bar__post-title {
66
+ color: currentColor;
67
+ flex: 1;
68
+ overflow: hidden;
69
+ text-overflow: ellipsis;
70
+
50
71
  .editor-document-bar.is-global & {
51
72
  color: var(--wp-block-synced-color);
52
73
  }
74
+ }
53
75
 
54
- .block-editor-block-icon {
55
- min-width: $grid-unit-30;
56
- flex-shrink: 0;
57
- }
76
+ .editor-document-bar__post-type-label {
77
+ flex: 0;
78
+ color: $gray-800;
79
+ padding-left: $grid-unit-05;
58
80
 
59
- h1 {
60
- white-space: nowrap;
61
- overflow: hidden;
62
- text-overflow: ellipsis;
63
- max-width: 70%;
64
- color: currentColor;
81
+ @media screen and (max-width: #{ ($break-small) }) {
82
+ display: none;
65
83
  }
66
84
  }
67
85
 
@@ -25,8 +25,7 @@ function EditorHistoryRedo( props, ref ) {
25
25
  const { redo } = useDispatch( editorStore );
26
26
  return (
27
27
  <Button
28
- // TODO: Switch to `true` (40px size) if possible
29
- __next40pxDefaultSize={ false }
28
+ __next40pxDefaultSize
30
29
  { ...props }
31
30
  ref={ ref }
32
31
  icon={ ! isRTL() ? redoIcon : undoIcon }
@@ -21,8 +21,7 @@ function EditorHistoryUndo( props, ref ) {
21
21
  const { undo } = useDispatch( editorStore );
22
22
  return (
23
23
  <Button
24
- // TODO: Switch to `true` (40px size) if possible
25
- __next40pxDefaultSize={ false }
24
+ __next40pxDefaultSize
26
25
  { ...props }
27
26
  ref={ ref }
28
27
  icon={ ! isRTL() ? undoIcon : redoIcon }
@@ -58,7 +58,6 @@ export default function EditorInterface( {
58
58
  customSavePanel,
59
59
  forceDisableBlockTools,
60
60
  title,
61
- icon,
62
61
  iframeProps,
63
62
  } ) {
64
63
  const {
@@ -140,7 +139,7 @@ export default function EditorInterface( {
140
139
  customSaveButton={ customSaveButton }
141
140
  forceDisableBlockTools={ forceDisableBlockTools }
142
141
  title={ title }
143
- icon={ icon }
142
+ isEditorIframed={ ! disableIframe }
144
143
  />
145
144
  )
146
145
  }
@@ -29,12 +29,7 @@ function getContent() {
29
29
  function CopyButton( { text, children } ) {
30
30
  const ref = useCopyToClipboard( text );
31
31
  return (
32
- <Button
33
- // TODO: Switch to `true` (40px size) if possible
34
- __next40pxDefaultSize={ false }
35
- variant="secondary"
36
- ref={ ref }
37
- >
32
+ <Button __next40pxDefaultSize variant="secondary" ref={ ref }>
38
33
  { children }
39
34
  </Button>
40
35
  );
@@ -46,24 +46,38 @@ export function mergeBaseAndUserConfigs( base, user ) {
46
46
  function useGlobalStylesUserConfig() {
47
47
  const { globalStylesId, isReady, settings, styles, _links } = useSelect(
48
48
  ( select ) => {
49
- const { getEditedEntityRecord, hasFinishedResolution, canUser } =
50
- select( coreStore );
49
+ const {
50
+ getEntityRecord,
51
+ getEditedEntityRecord,
52
+ hasFinishedResolution,
53
+ canUser,
54
+ } = select( coreStore );
51
55
  const _globalStylesId =
52
56
  select( coreStore ).__experimentalGetCurrentGlobalStylesId();
53
57
 
54
- const record =
55
- _globalStylesId &&
56
- canUser( 'read', {
57
- kind: 'root',
58
- name: 'globalStyles',
59
- id: _globalStylesId,
60
- } )
61
- ? getEditedEntityRecord(
62
- 'root',
63
- 'globalStyles',
64
- _globalStylesId
65
- )
66
- : undefined;
58
+ let record;
59
+ const userCanEditGlobalStyles = canUser( 'update', {
60
+ kind: 'root',
61
+ name: 'globalStyles',
62
+ id: _globalStylesId,
63
+ } );
64
+
65
+ if ( _globalStylesId ) {
66
+ if ( userCanEditGlobalStyles ) {
67
+ record = getEditedEntityRecord(
68
+ 'root',
69
+ 'globalStyles',
70
+ _globalStylesId
71
+ );
72
+ } else {
73
+ record = getEntityRecord(
74
+ 'root',
75
+ 'globalStyles',
76
+ _globalStylesId,
77
+ { context: 'view' }
78
+ );
79
+ }
80
+ }
67
81
 
68
82
  let hasResolved = false;
69
83
  if (
@@ -71,13 +85,22 @@ function useGlobalStylesUserConfig() {
71
85
  '__experimentalGetCurrentGlobalStylesId'
72
86
  )
73
87
  ) {
74
- hasResolved = _globalStylesId
75
- ? hasFinishedResolution( 'getEditedEntityRecord', [
76
- 'root',
77
- 'globalStyles',
78
- _globalStylesId,
79
- ] )
80
- : true;
88
+ if ( _globalStylesId ) {
89
+ hasResolved = userCanEditGlobalStyles
90
+ ? hasFinishedResolution( 'getEditedEntityRecord', [
91
+ 'root',
92
+ 'globalStyles',
93
+ _globalStylesId,
94
+ ] )
95
+ : hasFinishedResolution( 'getEntityRecord', [
96
+ 'root',
97
+ 'globalStyles',
98
+ _globalStylesId,
99
+ { context: 'view' },
100
+ ] );
101
+ } else {
102
+ hasResolved = true;
103
+ }
81
104
  }
82
105
 
83
106
  return {
@@ -145,20 +168,11 @@ function useGlobalStylesUserConfig() {
145
168
  }
146
169
 
147
170
  function useGlobalStylesBaseConfig() {
148
- const baseConfig = useSelect( ( select ) => {
149
- const {
150
- __experimentalGetCurrentThemeBaseGlobalStyles,
151
- getCurrentTheme,
152
- canUser,
153
- } = select( coreStore );
154
- const currentTheme = getCurrentTheme();
155
-
156
- return currentTheme &&
157
- canUser( 'read', 'global-styles/themes', currentTheme.stylesheet )
158
- ? __experimentalGetCurrentThemeBaseGlobalStyles()
159
- : undefined;
160
- }, [] );
161
-
171
+ const baseConfig = useSelect(
172
+ ( select ) =>
173
+ select( coreStore ).__experimentalGetCurrentThemeBaseGlobalStyles(),
174
+ []
175
+ );
162
176
  return [ !! baseConfig, baseConfig ];
163
177
  }
164
178
 
@@ -22,6 +22,7 @@ import PostPublishButtonOrToggle from '../post-publish-button/post-publish-butto
22
22
  import PostSavedState from '../post-saved-state';
23
23
  import PostViewLink from '../post-view-link';
24
24
  import PreviewDropdown from '../preview-dropdown';
25
+ import ZoomOutToggle from '../zoom-out-toggle';
25
26
  import { store as editorStore } from '../../store';
26
27
 
27
28
  const toolbarVariations = {
@@ -46,7 +47,7 @@ function Header( {
46
47
  forceDisableBlockTools,
47
48
  setEntitiesSavedStatesCallback,
48
49
  title,
49
- icon,
50
+ isEditorIframed,
50
51
  } ) {
51
52
  const isWideViewport = useViewportMatch( 'large' );
52
53
  const isLargeViewport = useViewportMatch( 'medium' );
@@ -117,7 +118,7 @@ function Header( {
117
118
  variants={ toolbarVariations }
118
119
  transition={ { type: 'tween' } }
119
120
  >
120
- <DocumentBar title={ title } icon={ icon } />
121
+ <DocumentBar title={ title } />
121
122
  </motion.div>
122
123
  ) }
123
124
  <motion.div
@@ -142,9 +143,13 @@ function Header( {
142
143
  forceIsAutosaveable={ forceIsDirty }
143
144
  />
144
145
  <PostViewLink />
146
+
147
+ { isEditorIframed && isWideViewport && <ZoomOutToggle /> }
148
+
145
149
  { ( isWideViewport || ! showIconLabels ) && (
146
150
  <PinnedItems.Slot scope="core" />
147
151
  ) }
152
+
148
153
  { ! customSaveButton && (
149
154
  <PostPublishButtonOrToggle
150
155
  forceIsDirty={ forceIsDirty }
@@ -153,6 +158,7 @@ function Header( {
153
158
  }
154
159
  />
155
160
  ) }
161
+
156
162
  { customSaveButton }
157
163
  <MoreMenu />
158
164
  </motion.div>
@@ -198,9 +198,7 @@ function PrivateExcerpt() {
198
198
  ref={ setPopoverAnchor }
199
199
  renderToggle={ ( { onToggle } ) => (
200
200
  <Button
201
- // TODO: Switch to `true` (40px size) if possible
202
- __next40pxDefaultSize={ false }
203
- className="editor-post-excerpt__dropdown__trigger"
201
+ __next40pxDefaultSize
204
202
  onClick={ onToggle }
205
203
  variant="link"
206
204
  >
@@ -160,8 +160,7 @@ function PostFeaturedImage( {
160
160
  render={ ( { open } ) => (
161
161
  <div className="editor-post-featured-image__container">
162
162
  <Button
163
- // TODO: Switch to `true` (40px size) if possible
164
- __next40pxDefaultSize={ false }
163
+ __next40pxDefaultSize
165
164
  ref={ toggleRef }
166
165
  className={
167
166
  ! featuredImageId
@@ -202,8 +201,7 @@ function PostFeaturedImage( {
202
201
  { !! featuredImageId && (
203
202
  <HStack className="editor-post-featured-image__actions">
204
203
  <Button
205
- // TODO: Switch to `true` (40px size) if possible
206
- __next40pxDefaultSize={ false }
204
+ __next40pxDefaultSize
207
205
  className="editor-post-featured-image__action"
208
206
  onClick={ open }
209
207
  aria-haspopup="dialog"
@@ -211,8 +209,7 @@ function PostFeaturedImage( {
211
209
  { __( 'Replace' ) }
212
210
  </Button>
213
211
  <Button
214
- // TODO: Switch to `true` (40px size) if possible
215
- __next40pxDefaultSize={ false }
212
+ __next40pxDefaultSize
216
213
  className="editor-post-featured-image__action"
217
214
  onClick={ () => {
218
215
  onRemoveImage();
@@ -53,7 +53,7 @@
53
53
  }
54
54
 
55
55
  .editor-post-featured-image__preview {
56
- height: auto;
56
+ height: auto !important;
57
57
  outline: $border-width solid rgba($black, 0.1);
58
58
 
59
59
  .editor-post-featured-image__preview-image {
@@ -65,10 +65,6 @@
65
65
  }
66
66
 
67
67
  .editor-post-featured-image__toggle {
68
- height: 100%;
69
- line-height: 20px;
70
- padding: $grid-unit-10 0;
71
- text-align: center;
72
68
  box-shadow: inset 0 0 0 $border-width $gray-400;
73
69
  }
74
70
 
@@ -100,8 +100,7 @@ export default function PostFormat() {
100
100
  { suggestion && suggestion.id !== postFormat && (
101
101
  <p className="editor-post-format__suggestion">
102
102
  <Button
103
- // TODO: Switch to `true` (40px size) if possible
104
- __next40pxDefaultSize={ false }
103
+ __next40pxDefaultSize
105
104
  variant="link"
106
105
  onClick={ () =>
107
106
  onUpdatePostFormat( suggestion.id )
@@ -36,8 +36,7 @@ function PostLastRevision() {
36
36
  return (
37
37
  <PostLastRevisionCheck>
38
38
  <Button
39
- // TODO: Switch to `true` (40px size) if possible
40
- __next40pxDefaultSize={ false }
39
+ __next40pxDefaultSize
41
40
  href={ addQueryArgs( 'revision.php', {
42
41
  revision: lastRevisionId,
43
42
  } ) }
@@ -257,8 +257,7 @@ export default function PostLockedModal() {
257
257
  >
258
258
  { ! isTakeover && (
259
259
  <Button
260
- // TODO: Switch to `true` (40px size) if possible
261
- __next40pxDefaultSize={ false }
260
+ __next40pxDefaultSize
262
261
  variant="tertiary"
263
262
  href={ unlockUrl }
264
263
  >
@@ -266,8 +265,7 @@ export default function PostLockedModal() {
266
265
  </Button>
267
266
  ) }
268
267
  <Button
269
- // TODO: Switch to `true` (40px size) if possible
270
- __next40pxDefaultSize={ false }
268
+ __next40pxDefaultSize
271
269
  variant="primary"
272
270
  href={ allPostsUrl }
273
271
  >
@@ -28,6 +28,7 @@
28
28
  white-space: normal;
29
29
  text-wrap: balance; // Fallback for Safari.
30
30
  text-wrap: pretty;
31
+ height: auto;
31
32
  min-height: $button-size-compact;
32
33
  }
33
34
 
@@ -78,8 +78,7 @@ export class PostPublishPanel extends Component {
78
78
  <div className="editor-post-publish-panel__header">
79
79
  { isPostPublish ? (
80
80
  <Button
81
- // TODO: Switch to `true` (40px size) if possible
82
- __next40pxDefaultSize={ false }
81
+ size="compact"
83
82
  onClick={ onClose }
84
83
  icon={ closeSmall }
85
84
  label={ __( 'Close panel' ) }
@@ -25,8 +25,7 @@ const PostFormatSuggestion = ( {
25
25
  onUpdatePostFormat,
26
26
  } ) => (
27
27
  <Button
28
- // TODO: Switch to `true` (40px size) if possible
29
- __next40pxDefaultSize={ false }
28
+ __next40pxDefaultSize
30
29
  variant="link"
31
30
  onClick={ () => onUpdatePostFormat( suggestedPostFormat ) }
32
31
  >
@@ -256,8 +256,7 @@ export default function MaybeUploadMediaPanel() {
256
256
  <Spinner />
257
257
  ) : (
258
258
  <Button
259
- // TODO: Switch to `true` (40px size) if possible
260
- __next40pxDefaultSize={ false }
259
+ __next40pxDefaultSize
261
260
  variant="primary"
262
261
  onClick={ uploadImages }
263
262
  >
@@ -60,7 +60,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
60
60
  >
61
61
  <button
62
62
  aria-label="Close panel"
63
- class="components-button has-icon"
63
+ class="components-button is-compact has-icon"
64
64
  type="button"
65
65
  >
66
66
  <svg
@@ -252,7 +252,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
252
252
  >
253
253
  <button
254
254
  aria-label="Close panel"
255
- class="components-button has-icon"
255
+ class="components-button is-compact has-icon"
256
256
  type="button"
257
257
  >
258
258
  <svg
@@ -173,6 +173,7 @@ export default function PostStatus() {
173
173
  focusOnMount
174
174
  renderToggle={ ( { onToggle, isOpen } ) => (
175
175
  <Button
176
+ className="editor-post-status__toggle"
176
177
  variant="tertiary"
177
178
  size="compact"
178
179
  onClick={ onToggle }
@@ -4,6 +4,11 @@
4
4
  &.is-read-only {
5
5
  padding: 6px 12px;
6
6
  }
7
+
8
+ .editor-post-status__toggle.editor-post-status__toggle {
9
+ padding-top: $grid-unit-05;
10
+ padding-bottom: $grid-unit-05;
11
+ }
7
12
  }
8
13
 
9
14
  .editor-change-status__password-fieldset,
@@ -428,8 +428,7 @@ export function HierarchicalTermSelector( { slug } ) {
428
428
  { ! loading && hasCreateAction && (
429
429
  <FlexItem>
430
430
  <Button
431
- // TODO: Switch to `true` (40px size) if possible
432
- __next40pxDefaultSize={ false }
431
+ __next40pxDefaultSize
433
432
  onClick={ onToggleForm }
434
433
  className="editor-post-taxonomies__hierarchical-terms-add"
435
434
  aria-expanded={ showForm }
@@ -62,8 +62,7 @@ export default function MostUsedTerms( { onSelect, taxonomy } ) {
62
62
  { terms.map( ( term ) => (
63
63
  <li key={ term.id }>
64
64
  <Button
65
- // TODO: Switch to `true` (40px size) if possible
66
- __next40pxDefaultSize={ false }
65
+ __next40pxDefaultSize
67
66
  variant="link"
68
67
  onClick={ () => onSelect( term ) }
69
68
  >
@@ -34,8 +34,4 @@
34
34
  display: inline-block;
35
35
  margin-right: $grid-unit-10;
36
36
  }
37
-
38
- .components-button {
39
- font-size: 12px;
40
- }
41
37
  }