@wordpress/editor 14.7.1-next.5368f64a9.0 → 14.8.1
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 +2 -0
- package/README.md +1 -1
- package/build/bindings/post-meta.js +42 -7
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/block-manager/index.js +45 -66
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/document-bar/index.js +20 -28
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/editor-history/redo.js +2 -4
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +2 -4
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-interface/index.js +1 -2
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/error-boundary/index.js +2 -4
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-styles-provider/index.js +21 -12
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +4 -4
- package/build/components/header/index.js.map +1 -1
- package/build/components/media-categories/index.js +1 -0
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +2 -5
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-featured-image/index.js +6 -12
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/index.js +2 -4
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +2 -4
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +4 -8
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js +2 -4
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -4
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +2 -4
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-status/index.js +1 -0
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -4
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +2 -4
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-url/index.js +8 -7
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +5 -57
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/save-publish-panels/index.js +4 -10
- package/build/components/save-publish-panels/index.js.map +1 -1
- package/build/components/zoom-out-toggle/index.js +38 -0
- package/build/components/zoom-out-toggle/index.js.map +1 -0
- package/build/dataviews/store/private-actions.js +4 -10
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build-module/bindings/post-meta.js +40 -7
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/block-manager/index.js +46 -67
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +22 -28
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +2 -4
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +2 -4
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-interface/index.js +1 -2
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +2 -4
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +21 -12
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +4 -4
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/media-categories/index.js +1 -0
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +2 -5
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +6 -12
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/index.js +2 -4
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +2 -4
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +4 -8
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +2 -4
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -4
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -4
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-status/index.js +1 -0
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -4
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +2 -4
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-url/index.js +9 -8
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +5 -57
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +4 -10
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/zoom-out-toggle/index.js +31 -0
- package/build-module/components/zoom-out-toggle/index.js.map +1 -0
- package/build-module/dataviews/store/private-actions.js +2 -8
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-style/style-rtl.css +38 -23
- package/build-style/style.css +38 -23
- package/build-types/bindings/post-meta.d.ts +4 -1
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/components/block-manager/index.d.ts +1 -2
- package/build-types/components/block-manager/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts +7 -6
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/editor-history/redo.d.ts.map +1 -1
- package/build-types/components/editor-history/undo.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts +1 -2
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/error-boundary/index.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts +2 -2
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/post-format/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
- package/build-types/components/post-status/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
- package/build-types/components/zoom-out-toggle/index.d.ts +3 -0
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -0
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/package.json +37 -36
- package/src/bindings/post-meta.js +56 -20
- package/src/components/block-manager/index.js +50 -67
- package/src/components/document-bar/index.js +29 -41
- package/src/components/document-bar/style.scss +33 -15
- package/src/components/editor-history/redo.js +1 -2
- package/src/components/editor-history/undo.js +1 -2
- package/src/components/editor-interface/index.js +1 -2
- package/src/components/error-boundary/index.js +1 -6
- package/src/components/global-styles-provider/index.js +50 -36
- package/src/components/header/index.js +8 -2
- package/src/components/post-excerpt/panel.js +1 -3
- package/src/components/post-featured-image/index.js +3 -6
- package/src/components/post-featured-image/style.scss +1 -5
- package/src/components/post-format/index.js +1 -2
- package/src/components/post-last-revision/index.js +1 -2
- package/src/components/post-locked-modal/index.js +2 -4
- package/src/components/post-panel-row/style.scss +1 -0
- package/src/components/post-publish-panel/index.js +1 -2
- package/src/components/post-publish-panel/maybe-post-format-panel.js +1 -2
- package/src/components/post-publish-panel/maybe-upload-media.js +1 -2
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
- package/src/components/post-status/index.js +1 -0
- package/src/components/post-status/style.scss +5 -0
- package/src/components/post-taxonomies/hierarchical-term-selector.js +1 -2
- package/src/components/post-taxonomies/most-used-terms.js +1 -2
- package/src/components/post-taxonomies/style.scss +0 -4
- package/src/components/post-url/index.js +9 -7
- package/src/components/preview-dropdown/index.js +26 -84
- package/src/components/save-publish-panels/index.js +2 -6
- package/src/components/zoom-out-toggle/index.js +34 -0
- package/src/dataviews/store/private-actions.ts +10 -8
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/dataviews/actions/duplicate-pattern.js +0 -48
- package/build/dataviews/actions/duplicate-pattern.js.map +0 -1
- package/build/dataviews/actions/duplicate-post.js +0 -146
- package/build/dataviews/actions/duplicate-post.js.map +0 -1
- package/build/dataviews/actions/duplicate-post.native.js +0 -9
- package/build/dataviews/actions/duplicate-post.native.js.map +0 -1
- package/build/dataviews/actions/export-pattern.js +0 -57
- package/build/dataviews/actions/export-pattern.js.map +0 -1
- package/build/dataviews/actions/export-pattern.native.js +0 -9
- package/build/dataviews/actions/export-pattern.native.js.map +0 -1
- package/build/dataviews/actions/permanently-delete-post.js +0 -109
- package/build/dataviews/actions/permanently-delete-post.js.map +0 -1
- package/build/dataviews/actions/reorder-page.js +0 -116
- package/build/dataviews/actions/reorder-page.js.map +0 -1
- package/build/dataviews/actions/reorder-page.native.js +0 -9
- package/build/dataviews/actions/reorder-page.native.js.map +0 -1
- package/build/dataviews/actions/view-post-revisions.js +0 -49
- package/build/dataviews/actions/view-post-revisions.js.map +0 -1
- package/build/dataviews/actions/view-post.js +0 -36
- package/build/dataviews/actions/view-post.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-pattern.js +0 -39
- package/build-module/dataviews/actions/duplicate-pattern.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-post.js +0 -139
- package/build-module/dataviews/actions/duplicate-post.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-post.native.js +0 -3
- package/build-module/dataviews/actions/duplicate-post.native.js.map +0 -1
- package/build-module/dataviews/actions/export-pattern.js +0 -51
- package/build-module/dataviews/actions/export-pattern.js.map +0 -1
- package/build-module/dataviews/actions/export-pattern.native.js +0 -3
- package/build-module/dataviews/actions/export-pattern.native.js.map +0 -1
- package/build-module/dataviews/actions/permanently-delete-post.js +0 -102
- package/build-module/dataviews/actions/permanently-delete-post.js.map +0 -1
- package/build-module/dataviews/actions/reorder-page.js +0 -111
- package/build-module/dataviews/actions/reorder-page.js.map +0 -1
- package/build-module/dataviews/actions/reorder-page.native.js +0 -3
- package/build-module/dataviews/actions/reorder-page.native.js.map +0 -1
- package/build-module/dataviews/actions/view-post-revisions.js +0 -43
- package/build-module/dataviews/actions/view-post-revisions.js.map +0 -1
- package/build-module/dataviews/actions/view-post.js +0 -30
- package/build-module/dataviews/actions/view-post.js.map +0 -1
- package/build-types/dataviews/actions/duplicate-pattern.d.ts +0 -5
- package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +0 -1
- package/build-types/dataviews/actions/duplicate-post.d.ts +0 -5
- package/build-types/dataviews/actions/duplicate-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/duplicate-post.native.d.ts +0 -3
- package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/export-pattern.d.ts +0 -8
- package/build-types/dataviews/actions/export-pattern.d.ts.map +0 -1
- package/build-types/dataviews/actions/export-pattern.native.d.ts +0 -3
- package/build-types/dataviews/actions/export-pattern.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/permanently-delete-post.d.ts +0 -5
- package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/reorder-page.d.ts +0 -8
- package/build-types/dataviews/actions/reorder-page.d.ts.map +0 -1
- package/build-types/dataviews/actions/reorder-page.native.d.ts +0 -3
- package/build-types/dataviews/actions/reorder-page.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/view-post-revisions.d.ts +0 -8
- package/build-types/dataviews/actions/view-post-revisions.d.ts.map +0 -1
- package/build-types/dataviews/actions/view-post.d.ts +0 -8
- package/build-types/dataviews/actions/view-post.d.ts.map +0 -1
- package/src/dataviews/actions/duplicate-pattern.tsx +0 -40
- package/src/dataviews/actions/duplicate-post.native.tsx +0 -3
- package/src/dataviews/actions/duplicate-post.tsx +0 -174
- package/src/dataviews/actions/export-pattern.native.tsx +0 -3
- package/src/dataviews/actions/export-pattern.tsx +0 -76
- package/src/dataviews/actions/permanently-delete-post.tsx +0 -118
- package/src/dataviews/actions/reorder-page.native.tsx +0 -3
- package/src/dataviews/actions/reorder-page.tsx +0 -125
- package/src/dataviews/actions/view-post-revisions.tsx +0 -47
- 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
|
|
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
|
-
|
|
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}
|
|
56
|
-
* @param {string}
|
|
57
|
-
*
|
|
58
|
-
* @param {
|
|
59
|
-
*
|
|
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 {
|
|
80
|
-
|
|
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
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
41
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
.editor-document-bar__post-type-label {
|
|
77
|
+
flex: 0;
|
|
78
|
+
color: $gray-800;
|
|
79
|
+
padding-left: $grid-unit-05;
|
|
58
80
|
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
50
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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(
|
|
149
|
-
|
|
150
|
-
__experimentalGetCurrentThemeBaseGlobalStyles,
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
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 }
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
270
|
-
__next40pxDefaultSize={ false }
|
|
268
|
+
__next40pxDefaultSize
|
|
271
269
|
variant="primary"
|
|
272
270
|
href={ allPostsUrl }
|
|
273
271
|
>
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
@@ -428,8 +428,7 @@ export function HierarchicalTermSelector( { slug } ) {
|
|
|
428
428
|
{ ! loading && hasCreateAction && (
|
|
429
429
|
<FlexItem>
|
|
430
430
|
<Button
|
|
431
|
-
|
|
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
|
-
|
|
66
|
-
__next40pxDefaultSize={ false }
|
|
65
|
+
__next40pxDefaultSize
|
|
67
66
|
variant="link"
|
|
68
67
|
onClick={ () => onSelect( term ) }
|
|
69
68
|
>
|