@wordpress/editor 13.23.0 → 13.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/entities-saved-states/index.js +15 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/index.js +26 -2
- package/build/components/index.js.map +1 -1
- package/build/components/post-author/panel.js +24 -0
- package/build/components/post-author/panel.js.map +1 -0
- package/build/components/post-panel-row/index.js +36 -0
- package/build/components/post-panel-row/index.js.map +1 -0
- package/build/components/post-saved-state/index.js +21 -16
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/panel.js +67 -0
- package/build/components/post-schedule/panel.js.map +1 -0
- package/build/components/post-sync-status/index.js +8 -4
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-title/constants.js +11 -0
- package/build/components/post-title/constants.js.map +1 -0
- package/build/components/post-title/index.js +61 -89
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +92 -0
- package/build/components/post-title/post-title-raw.js.map +1 -0
- package/build/components/post-title/use-post-title-focus.js +64 -0
- package/build/components/post-title/use-post-title-focus.js.map +1 -0
- package/build/components/post-title/use-post-title.js +41 -0
- package/build/components/post-title/use-post-title.js.map +1 -0
- package/build/components/post-url/panel.js +4 -3
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/provider/constants.js +9 -0
- package/build/components/provider/constants.js.map +1 -0
- package/build/components/provider/disable-non-page-content-blocks.js +63 -0
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -0
- package/build/components/provider/index.js +8 -7
- package/build/components/provider/index.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +23 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +10 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +16 -2
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +16 -2
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/index.js +3 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +14 -0
- package/build-module/components/post-author/panel.js.map +1 -0
- package/build-module/components/post-panel-row/index.js +27 -0
- package/build-module/components/post-panel-row/index.js.map +1 -0
- package/build-module/components/post-saved-state/index.js +22 -17
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +59 -0
- package/build-module/components/post-schedule/panel.js.map +1 -0
- package/build-module/components/post-sync-status/index.js +8 -5
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-title/constants.js +3 -0
- package/build-module/components/post-title/constants.js.map +1 -0
- package/build-module/components/post-title/index.js +62 -91
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +83 -0
- package/build-module/components/post-title/post-title-raw.js.map +1 -0
- package/build-module/components/post-title/use-post-title-focus.js +57 -0
- package/build-module/components/post-title/use-post-title-focus.js.map +1 -0
- package/build-module/components/post-title/use-post-title.js +33 -0
- package/build-module/components/post-title/use-post-title.js.map +1 -0
- package/build-module/components/post-url/panel.js +5 -4
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/provider/constants.js +2 -0
- package/build-module/components/provider/constants.js.map +1 -0
- package/build-module/components/provider/disable-non-page-content-blocks.js +56 -0
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -0
- package/build-module/components/provider/index.js +6 -4
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +21 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +9 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +11 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +51 -18
- package/build-style/style.css +51 -18
- package/package.json +31 -31
- package/src/components/entities-saved-states/index.js +16 -1
- package/src/components/index.js +3 -0
- package/src/components/post-author/panel.js +18 -0
- package/src/components/post-author/style.scss +7 -0
- package/src/components/post-panel-row/index.js +26 -0
- package/src/components/post-panel-row/style.scss +21 -0
- package/src/components/post-saved-state/index.js +46 -37
- package/src/components/post-schedule/panel.js +65 -0
- package/src/components/post-schedule/style.scss +23 -0
- package/src/components/post-sync-status/index.js +5 -6
- package/src/components/post-sync-status/style.scss +3 -17
- package/src/components/post-title/constants.js +4 -0
- package/src/components/post-title/index.js +56 -87
- package/src/components/post-title/post-title-raw.js +82 -0
- package/src/components/post-title/style.scss +5 -0
- package/src/components/post-title/use-post-title-focus.js +50 -0
- package/src/components/post-title/use-post-title.js +25 -0
- package/src/components/post-url/panel.js +4 -8
- package/src/components/post-url/style.scss +1 -12
- package/src/components/provider/README.md +0 -13
- package/src/components/provider/constants.js +5 -0
- package/src/components/provider/disable-non-page-content-blocks.js +55 -0
- package/src/components/provider/index.js +19 -9
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +21 -0
- package/src/store/reducer.js +10 -0
- package/src/store/selectors.js +11 -0
- package/src/style.scss +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.24.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,35 +31,35 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/blob": "^3.
|
|
37
|
-
"@wordpress/block-editor": "^12.
|
|
38
|
-
"@wordpress/blocks": "^12.
|
|
39
|
-
"@wordpress/components": "^25.
|
|
40
|
-
"@wordpress/compose": "^6.
|
|
41
|
-
"@wordpress/core-data": "^6.
|
|
42
|
-
"@wordpress/data": "^9.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^5.
|
|
47
|
-
"@wordpress/hooks": "^3.
|
|
48
|
-
"@wordpress/html-entities": "^3.
|
|
49
|
-
"@wordpress/i18n": "^4.
|
|
50
|
-
"@wordpress/icons": "^9.
|
|
51
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
52
|
-
"@wordpress/keycodes": "^3.
|
|
53
|
-
"@wordpress/media-utils": "^4.
|
|
54
|
-
"@wordpress/notices": "^4.
|
|
55
|
-
"@wordpress/patterns": "^1.
|
|
56
|
-
"@wordpress/preferences": "^3.
|
|
57
|
-
"@wordpress/private-apis": "^0.
|
|
58
|
-
"@wordpress/reusable-blocks": "^4.
|
|
59
|
-
"@wordpress/rich-text": "^6.
|
|
60
|
-
"@wordpress/server-side-render": "^4.
|
|
61
|
-
"@wordpress/url": "^3.
|
|
62
|
-
"@wordpress/wordcount": "^3.
|
|
34
|
+
"@wordpress/a11y": "^3.47.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.44.0",
|
|
36
|
+
"@wordpress/blob": "^3.47.0",
|
|
37
|
+
"@wordpress/block-editor": "^12.15.0",
|
|
38
|
+
"@wordpress/blocks": "^12.24.0",
|
|
39
|
+
"@wordpress/components": "^25.13.0",
|
|
40
|
+
"@wordpress/compose": "^6.24.0",
|
|
41
|
+
"@wordpress/core-data": "^6.24.0",
|
|
42
|
+
"@wordpress/data": "^9.17.0",
|
|
43
|
+
"@wordpress/date": "^4.47.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.47.0",
|
|
45
|
+
"@wordpress/dom": "^3.47.0",
|
|
46
|
+
"@wordpress/element": "^5.24.0",
|
|
47
|
+
"@wordpress/hooks": "^3.47.0",
|
|
48
|
+
"@wordpress/html-entities": "^3.47.0",
|
|
49
|
+
"@wordpress/i18n": "^4.47.0",
|
|
50
|
+
"@wordpress/icons": "^9.38.0",
|
|
51
|
+
"@wordpress/keyboard-shortcuts": "^4.24.0",
|
|
52
|
+
"@wordpress/keycodes": "^3.47.0",
|
|
53
|
+
"@wordpress/media-utils": "^4.38.0",
|
|
54
|
+
"@wordpress/notices": "^4.15.0",
|
|
55
|
+
"@wordpress/patterns": "^1.8.0",
|
|
56
|
+
"@wordpress/preferences": "^3.24.0",
|
|
57
|
+
"@wordpress/private-apis": "^0.29.0",
|
|
58
|
+
"@wordpress/reusable-blocks": "^4.24.0",
|
|
59
|
+
"@wordpress/rich-text": "^6.24.0",
|
|
60
|
+
"@wordpress/server-side-render": "^4.24.0",
|
|
61
|
+
"@wordpress/url": "^3.48.0",
|
|
62
|
+
"@wordpress/wordcount": "^3.47.0",
|
|
63
63
|
"classnames": "^2.3.1",
|
|
64
64
|
"date-fns": "^2.28.0",
|
|
65
65
|
"memize": "^2.1.0",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "d98dff8ea96f29cfea045bf964269f46f040d539"
|
|
78
78
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Button, Flex, FlexItem } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { useDispatch } from '@wordpress/data';
|
|
6
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
7
|
import { useCallback, useRef } from '@wordpress/element';
|
|
8
8
|
import { store as coreStore } from '@wordpress/core-data';
|
|
9
9
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
@@ -85,6 +85,15 @@ export function EntitiesSavedStatesExtensible( {
|
|
|
85
85
|
|
|
86
86
|
const saveEnabled = saveEnabledProp ?? isDirty;
|
|
87
87
|
|
|
88
|
+
const { homeUrl } = useSelect( ( select ) => {
|
|
89
|
+
const {
|
|
90
|
+
getUnstableBase, // Site index.
|
|
91
|
+
} = select( coreStore );
|
|
92
|
+
return {
|
|
93
|
+
homeUrl: getUnstableBase()?.home,
|
|
94
|
+
};
|
|
95
|
+
}, [] );
|
|
96
|
+
|
|
88
97
|
const saveCheckedEntities = () => {
|
|
89
98
|
const saveNoticeId = 'site-editor-save-success';
|
|
90
99
|
removeNotice( saveNoticeId );
|
|
@@ -149,6 +158,12 @@ export function EntitiesSavedStatesExtensible( {
|
|
|
149
158
|
createSuccessNotice( __( 'Site updated.' ), {
|
|
150
159
|
type: 'snackbar',
|
|
151
160
|
id: saveNoticeId,
|
|
161
|
+
actions: [
|
|
162
|
+
{
|
|
163
|
+
label: __( 'View site' ),
|
|
164
|
+
url: homeUrl,
|
|
165
|
+
},
|
|
166
|
+
],
|
|
152
167
|
} );
|
|
153
168
|
}
|
|
154
169
|
} )
|
package/src/components/index.js
CHANGED
|
@@ -26,6 +26,7 @@ export { default as PageAttributesParent } from './page-attributes/parent';
|
|
|
26
26
|
export { default as PageTemplate } from './post-template';
|
|
27
27
|
export { default as PostAuthor } from './post-author';
|
|
28
28
|
export { default as PostAuthorCheck } from './post-author/check';
|
|
29
|
+
export { default as PostAuthorPanel } from './post-author/panel';
|
|
29
30
|
export { default as PostComments } from './post-comments';
|
|
30
31
|
export { default as PostExcerpt } from './post-excerpt';
|
|
31
32
|
export { default as PostExcerptCheck } from './post-excerpt/check';
|
|
@@ -50,6 +51,7 @@ export {
|
|
|
50
51
|
default as PostScheduleLabel,
|
|
51
52
|
usePostScheduleLabel,
|
|
52
53
|
} from './post-schedule/label';
|
|
54
|
+
export { default as PostSchedulePanel } from './post-schedule/panel';
|
|
53
55
|
export { default as PostSlug } from './post-slug';
|
|
54
56
|
export { default as PostSlugCheck } from './post-slug/check';
|
|
55
57
|
export { default as PostSticky } from './post-sticky';
|
|
@@ -65,6 +67,7 @@ export { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } fr
|
|
|
65
67
|
export { default as PostTaxonomiesCheck } from './post-taxonomies/check';
|
|
66
68
|
export { default as PostTextEditor } from './post-text-editor';
|
|
67
69
|
export { default as PostTitle } from './post-title';
|
|
70
|
+
export { default as PostTitleRaw } from './post-title/post-title-raw';
|
|
68
71
|
export { default as PostTrash } from './post-trash';
|
|
69
72
|
export { default as PostTrashCheck } from './post-trash/check';
|
|
70
73
|
export { default as PostTypeSupportCheck } from './post-type-support-check';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import PostAuthorCheck from './check';
|
|
5
|
+
import PostAuthorForm from './index';
|
|
6
|
+
import PostPanelRow from '../post-panel-row';
|
|
7
|
+
|
|
8
|
+
export function PostAuthor() {
|
|
9
|
+
return (
|
|
10
|
+
<PostAuthorCheck>
|
|
11
|
+
<PostPanelRow className="editor-post-author__panel">
|
|
12
|
+
<PostAuthorForm />
|
|
13
|
+
</PostPanelRow>
|
|
14
|
+
</PostAuthorCheck>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default PostAuthor;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { __experimentalHStack as HStack } from '@wordpress/components';
|
|
10
|
+
import { forwardRef } from '@wordpress/element';
|
|
11
|
+
|
|
12
|
+
const PostPanelRow = forwardRef( ( { className, label, children }, ref ) => {
|
|
13
|
+
return (
|
|
14
|
+
<HStack
|
|
15
|
+
className={ classnames( 'editor-post-panel__row', className ) }
|
|
16
|
+
ref={ ref }
|
|
17
|
+
>
|
|
18
|
+
{ label && (
|
|
19
|
+
<div className="editor-post-panel__row-label">{ label }</div>
|
|
20
|
+
) }
|
|
21
|
+
<div className="editor-post-panel__row-control">{ children }</div>
|
|
22
|
+
</HStack>
|
|
23
|
+
);
|
|
24
|
+
} );
|
|
25
|
+
|
|
26
|
+
export default PostPanelRow;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.editor-post-panel__row {
|
|
2
|
+
width: 100%;
|
|
3
|
+
min-height: $button-size;
|
|
4
|
+
justify-content: flex-start !important;
|
|
5
|
+
align-items: flex-start !important;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.editor-post-panel__row-label {
|
|
9
|
+
width: 30%;
|
|
10
|
+
flex-shrink: 0;
|
|
11
|
+
min-height: $button-size;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.editor-post-panel__row-control {
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
min-height: $button-size;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
@@ -9,6 +9,7 @@ import classnames from 'classnames';
|
|
|
9
9
|
import {
|
|
10
10
|
__unstableGetAnimateClassName as getAnimateClassName,
|
|
11
11
|
Button,
|
|
12
|
+
Tooltip,
|
|
12
13
|
} from '@wordpress/components';
|
|
13
14
|
import { usePrevious, useViewportMatch } from '@wordpress/compose';
|
|
14
15
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
@@ -128,45 +129,53 @@ export default function PostSavedState( {
|
|
|
128
129
|
text = shortLabel;
|
|
129
130
|
}
|
|
130
131
|
|
|
132
|
+
const buttonAccessibleLabel = text || label;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The tooltip needs to be enabled only if the button is not disabled. When
|
|
136
|
+
* relying on the internal Button tooltip functionality, this causes the
|
|
137
|
+
* resulting `button` element to be always removed and re-added to the DOM,
|
|
138
|
+
* causing focus loss. An alternative approach to circumvent the issue
|
|
139
|
+
* is not to use the `label` and `shortcut` props on `Button` (which would
|
|
140
|
+
* trigger the tooltip), and instead manually wrap the `Button` in a separate
|
|
141
|
+
* `Tooltip` component.
|
|
142
|
+
*/
|
|
143
|
+
const tooltipProps = isDisabled
|
|
144
|
+
? undefined
|
|
145
|
+
: {
|
|
146
|
+
text: buttonAccessibleLabel,
|
|
147
|
+
shortcut: displayShortcut.primary( 's' ),
|
|
148
|
+
};
|
|
149
|
+
|
|
131
150
|
// Use common Button instance for all saved states so that focus is not
|
|
132
151
|
// lost.
|
|
133
152
|
return (
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
showTooltip
|
|
162
|
-
variant="tertiary"
|
|
163
|
-
icon={ isLargeViewport ? undefined : cloudUpload }
|
|
164
|
-
// Make sure the aria-label has always a value, as the default `text` is undefined on small screens.
|
|
165
|
-
label={ text || label }
|
|
166
|
-
aria-disabled={ isDisabled }
|
|
167
|
-
>
|
|
168
|
-
{ isSavedState && <Icon icon={ isSaved ? check : cloud } /> }
|
|
169
|
-
{ text }
|
|
170
|
-
</Button>
|
|
153
|
+
<Tooltip { ...tooltipProps }>
|
|
154
|
+
<Button
|
|
155
|
+
className={
|
|
156
|
+
isSaveable || isSaving
|
|
157
|
+
? classnames( {
|
|
158
|
+
'editor-post-save-draft': ! isSavedState,
|
|
159
|
+
'editor-post-saved-state': isSavedState,
|
|
160
|
+
'is-saving': isSaving,
|
|
161
|
+
'is-autosaving': isAutosaving,
|
|
162
|
+
'is-saved': isSaved,
|
|
163
|
+
[ getAnimateClassName( {
|
|
164
|
+
type: 'loading',
|
|
165
|
+
} ) ]: isSaving,
|
|
166
|
+
} )
|
|
167
|
+
: undefined
|
|
168
|
+
}
|
|
169
|
+
onClick={ isDisabled ? undefined : () => savePost() }
|
|
170
|
+
variant="tertiary"
|
|
171
|
+
icon={ isLargeViewport ? undefined : cloudUpload }
|
|
172
|
+
// Make sure the aria-label has always a value, as the default `text` is undefined on small screens.
|
|
173
|
+
aria-label={ buttonAccessibleLabel }
|
|
174
|
+
aria-disabled={ isDisabled }
|
|
175
|
+
>
|
|
176
|
+
{ isSavedState && <Icon icon={ isSaved ? check : cloud } /> }
|
|
177
|
+
{ text }
|
|
178
|
+
</Button>
|
|
179
|
+
</Tooltip>
|
|
171
180
|
);
|
|
172
181
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Button, Dropdown } from '@wordpress/components';
|
|
5
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
6
|
+
import { useState, useMemo } from '@wordpress/element';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import PostScheduleCheck from './check';
|
|
12
|
+
import PostScheduleForm from './index';
|
|
13
|
+
import { usePostScheduleLabel } from './label';
|
|
14
|
+
import PostPanelRow from '../post-panel-row';
|
|
15
|
+
|
|
16
|
+
export default function PostSchedulePanel() {
|
|
17
|
+
const [ popoverAnchor, setPopoverAnchor ] = useState( null );
|
|
18
|
+
// Memoize popoverProps to avoid returning a new object every time.
|
|
19
|
+
const popoverProps = useMemo(
|
|
20
|
+
() => ( {
|
|
21
|
+
// Anchor the popover to the middle of the entire row so that it doesn't
|
|
22
|
+
// move around when the label changes.
|
|
23
|
+
anchor: popoverAnchor,
|
|
24
|
+
'aria-label': __( 'Change publish date' ),
|
|
25
|
+
placement: 'bottom-end',
|
|
26
|
+
} ),
|
|
27
|
+
[ popoverAnchor ]
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const label = usePostScheduleLabel();
|
|
31
|
+
const fullLabel = usePostScheduleLabel( { full: true } );
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<PostScheduleCheck>
|
|
35
|
+
<PostPanelRow label={ __( 'Publish' ) } ref={ setPopoverAnchor }>
|
|
36
|
+
<Dropdown
|
|
37
|
+
popoverProps={ popoverProps }
|
|
38
|
+
focusOnMount
|
|
39
|
+
className="editor-post-schedule__panel-dropdown"
|
|
40
|
+
contentClassName="editor-post-schedule__dialog"
|
|
41
|
+
renderToggle={ ( { onToggle, isOpen } ) => (
|
|
42
|
+
<Button
|
|
43
|
+
className="editor-post-schedule__dialog-toggle"
|
|
44
|
+
variant="tertiary"
|
|
45
|
+
onClick={ onToggle }
|
|
46
|
+
aria-label={ sprintf(
|
|
47
|
+
// translators: %s: Current post date.
|
|
48
|
+
__( 'Change date: %s' ),
|
|
49
|
+
label
|
|
50
|
+
) }
|
|
51
|
+
label={ fullLabel }
|
|
52
|
+
showTooltip
|
|
53
|
+
aria-expanded={ isOpen }
|
|
54
|
+
>
|
|
55
|
+
{ label }
|
|
56
|
+
</Button>
|
|
57
|
+
) }
|
|
58
|
+
renderContent={ ( { onClose } ) => (
|
|
59
|
+
<PostScheduleForm onClose={ onClose } />
|
|
60
|
+
) }
|
|
61
|
+
/>
|
|
62
|
+
</PostPanelRow>
|
|
63
|
+
</PostScheduleCheck>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.editor-post-schedule__panel-dropdown {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.editor-post-schedule__dialog {
|
|
6
|
+
.components-popover__content {
|
|
7
|
+
min-width: 320px;
|
|
8
|
+
padding: $grid-unit-20;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.editor-post-schedule__dialog-toggle.components-button {
|
|
13
|
+
display: block;
|
|
14
|
+
max-width: 100%;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
text-align: left;
|
|
17
|
+
white-space: unset;
|
|
18
|
+
height: auto;
|
|
19
|
+
|
|
20
|
+
// The line height + the padding should be the same as the button size.
|
|
21
|
+
padding: math.div($button-size - $grid-unit-20, 2) 12px;
|
|
22
|
+
line-height: $grid-unit-20;
|
|
23
|
+
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
5
|
import { __, _x } from '@wordpress/i18n';
|
|
6
6
|
import {
|
|
7
|
-
PanelRow,
|
|
8
7
|
Modal,
|
|
9
8
|
Button,
|
|
10
9
|
__experimentalHStack as HStack,
|
|
@@ -17,6 +16,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
17
16
|
/**
|
|
18
17
|
* Internal dependencies
|
|
19
18
|
*/
|
|
19
|
+
import PostPanelRow from '../post-panel-row';
|
|
20
20
|
import { store as editorStore } from '../../store';
|
|
21
21
|
import { unlock } from '../../lock-unlock';
|
|
22
22
|
|
|
@@ -44,14 +44,13 @@ export default function PostSyncStatus() {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
<div>
|
|
47
|
+
<PostPanelRow label={ __( 'Sync status' ) }>
|
|
48
|
+
<div className="editor-post-sync-status__value">
|
|
50
49
|
{ syncStatus === 'unsynced'
|
|
51
50
|
? __( 'Not synced' )
|
|
52
51
|
: __( 'Fully synced' ) }
|
|
53
52
|
</div>
|
|
54
|
-
</
|
|
53
|
+
</PostPanelRow>
|
|
55
54
|
);
|
|
56
55
|
}
|
|
57
56
|
|
|
@@ -114,7 +113,7 @@ export function PostSyncStatusModal() {
|
|
|
114
113
|
'Option that makes an individual pattern synchronized'
|
|
115
114
|
) }
|
|
116
115
|
help={ __(
|
|
117
|
-
'
|
|
116
|
+
'Sync this pattern across multiple locations.'
|
|
118
117
|
) }
|
|
119
118
|
checked={ ! syncType }
|
|
120
119
|
onChange={ () => {
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
justify-content: flex-start;
|
|
5
|
-
align-items: flex-start;
|
|
6
|
-
|
|
7
|
-
> span {
|
|
8
|
-
display: block;
|
|
9
|
-
width: 30%;
|
|
10
|
-
margin-right: 8px;
|
|
11
|
-
word-break: break-word;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
> div {
|
|
15
|
-
// Match padding on tertiary buttons for alignment.
|
|
16
|
-
padding: $grid-unit-15 * 0.5 0 $grid-unit-15 * 0.5 $grid-unit-15;
|
|
17
|
-
}
|
|
1
|
+
.editor-post-sync-status__value {
|
|
2
|
+
// Match padding on tertiary buttons for alignment.
|
|
3
|
+
padding: $grid-unit-15 * 0.5 0 $grid-unit-15 * 0.5 $grid-unit-15;
|
|
18
4
|
}
|