@wordpress/editor 12.0.0 → 12.0.4
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/build/components/autosave-monitor/index.js +5 -0
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/editor-help/index.native.js +4 -3
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +22 -13
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/index.js +23 -4
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +154 -211
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-title/index.js +4 -2
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +1 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/store/utils/notice-builder.js +15 -18
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/get-template-part-icon.js +1 -1
- package/build/utils/get-template-part-icon.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +5 -0
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +5 -4
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +24 -13
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +23 -4
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +156 -214
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-title/index.js +4 -2
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +1 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +15 -18
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/get-template-part-icon.js +2 -2
- package/build-module/utils/get-template-part-icon.js.map +1 -1
- package/build-style/style-rtl.css +1 -1
- package/build-style/style.css +1 -1
- package/package.json +19 -19
- package/src/components/autosave-monitor/index.js +5 -0
- package/src/components/autosave-monitor/test/index.js +10 -4
- package/src/components/editor-help/index.native.js +116 -106
- package/src/components/editor-help/style.scss +4 -0
- package/src/components/entities-saved-states/entity-type-list.js +29 -10
- package/src/components/entities-saved-states/index.js +38 -8
- package/src/components/post-saved-state/style.scss +2 -0
- package/src/components/post-taxonomies/flat-term-selector.js +220 -254
- package/src/components/post-title/index.js +4 -2
- package/src/components/provider/use-block-editor-settings.js +0 -2
- package/src/store/test/actions.js +4 -2
- package/src/store/utils/notice-builder.js +17 -19
- package/src/store/utils/test/notice-builder.js +1 -1
- package/src/utils/get-template-part-icon.js +2 -2
|
@@ -188,13 +188,15 @@ describe( 'Post generator actions', () => {
|
|
|
188
188
|
'yields an action for dispatching a success notice',
|
|
189
189
|
() => true,
|
|
190
190
|
() => {
|
|
191
|
-
if ( ! isAutosave
|
|
191
|
+
if ( ! isAutosave ) {
|
|
192
192
|
const { value } = fulfillment.next( postType );
|
|
193
193
|
expect( value ).toEqual(
|
|
194
194
|
controls.dispatch(
|
|
195
195
|
noticesStore,
|
|
196
196
|
'createSuccessNotice',
|
|
197
|
-
|
|
197
|
+
currentPostStatus === 'publish'
|
|
198
|
+
? 'Updated Post'
|
|
199
|
+
: 'Saved',
|
|
198
200
|
{
|
|
199
201
|
actions: [],
|
|
200
202
|
id: 'SAVE_POST_NOTICE_ID',
|
|
@@ -35,9 +35,11 @@ export function getNotificationArgumentsForSaveSuccess( data ) {
|
|
|
35
35
|
let noticeMessage;
|
|
36
36
|
let shouldShowLink = get( postType, [ 'viewable' ], false );
|
|
37
37
|
|
|
38
|
+
// Always should a notice, which will be spoken for accessibility.
|
|
38
39
|
if ( ! isPublished && ! willPublish ) {
|
|
39
40
|
// If saving a non-published post, don't show notice.
|
|
40
|
-
noticeMessage =
|
|
41
|
+
noticeMessage = __( 'Saved' );
|
|
42
|
+
shouldShowLink = false;
|
|
41
43
|
} else if ( isPublished && ! willPublish ) {
|
|
42
44
|
// If undoing publish status, show specific notice
|
|
43
45
|
noticeMessage = postType.labels.item_reverted_to_draft;
|
|
@@ -55,25 +57,21 @@ export function getNotificationArgumentsForSaveSuccess( data ) {
|
|
|
55
57
|
noticeMessage = postType.labels.item_updated;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} );
|
|
65
|
-
}
|
|
66
|
-
return [
|
|
67
|
-
noticeMessage,
|
|
68
|
-
{
|
|
69
|
-
id: SAVE_POST_NOTICE_ID,
|
|
70
|
-
type: 'snackbar',
|
|
71
|
-
actions,
|
|
72
|
-
},
|
|
73
|
-
];
|
|
60
|
+
const actions = [];
|
|
61
|
+
if ( shouldShowLink ) {
|
|
62
|
+
actions.push( {
|
|
63
|
+
label: postType.labels.view_item,
|
|
64
|
+
url: post.link,
|
|
65
|
+
} );
|
|
74
66
|
}
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
return [
|
|
68
|
+
noticeMessage,
|
|
69
|
+
{
|
|
70
|
+
id: SAVE_POST_NOTICE_ID,
|
|
71
|
+
type: 'snackbar',
|
|
72
|
+
actions,
|
|
73
|
+
},
|
|
74
|
+
];
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
/**
|
|
@@ -34,7 +34,7 @@ describe( 'getNotificationArgumentsForSaveSuccess()', () => {
|
|
|
34
34
|
[
|
|
35
35
|
'when previous post is not published and post will not be published',
|
|
36
36
|
[ 'draft', 'draft', false ],
|
|
37
|
-
[],
|
|
37
|
+
[ 'Saved', defaultExpectedAction ],
|
|
38
38
|
],
|
|
39
39
|
[
|
|
40
40
|
'when previous post is published and post will be unpublished',
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
header as headerIcon,
|
|
6
6
|
footer as footerIcon,
|
|
7
7
|
sidebar as sidebarIcon,
|
|
8
|
-
|
|
8
|
+
symbolFilled as symbolFilledIcon,
|
|
9
9
|
} from '@wordpress/icons';
|
|
10
10
|
/**
|
|
11
11
|
* Helper function to retrieve the corresponding icon by name.
|
|
@@ -22,5 +22,5 @@ export function getTemplatePartIcon( iconName ) {
|
|
|
22
22
|
} else if ( 'sidebar' === iconName ) {
|
|
23
23
|
return sidebarIcon;
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return symbolFilledIcon;
|
|
26
26
|
}
|