@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.
Files changed (53) hide show
  1. package/build/components/autosave-monitor/index.js +5 -0
  2. package/build/components/autosave-monitor/index.js.map +1 -1
  3. package/build/components/editor-help/index.native.js +4 -3
  4. package/build/components/editor-help/index.native.js.map +1 -1
  5. package/build/components/entities-saved-states/entity-type-list.js +22 -13
  6. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  7. package/build/components/entities-saved-states/index.js +23 -4
  8. package/build/components/entities-saved-states/index.js.map +1 -1
  9. package/build/components/post-taxonomies/flat-term-selector.js +154 -211
  10. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  11. package/build/components/post-title/index.js +4 -2
  12. package/build/components/post-title/index.js.map +1 -1
  13. package/build/components/provider/use-block-editor-settings.js +1 -1
  14. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  15. package/build/store/utils/notice-builder.js +15 -18
  16. package/build/store/utils/notice-builder.js.map +1 -1
  17. package/build/utils/get-template-part-icon.js +1 -1
  18. package/build/utils/get-template-part-icon.js.map +1 -1
  19. package/build-module/components/autosave-monitor/index.js +5 -0
  20. package/build-module/components/autosave-monitor/index.js.map +1 -1
  21. package/build-module/components/editor-help/index.native.js +5 -4
  22. package/build-module/components/editor-help/index.native.js.map +1 -1
  23. package/build-module/components/entities-saved-states/entity-type-list.js +24 -13
  24. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  25. package/build-module/components/entities-saved-states/index.js +23 -4
  26. package/build-module/components/entities-saved-states/index.js.map +1 -1
  27. package/build-module/components/post-taxonomies/flat-term-selector.js +156 -214
  28. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  29. package/build-module/components/post-title/index.js +4 -2
  30. package/build-module/components/post-title/index.js.map +1 -1
  31. package/build-module/components/provider/use-block-editor-settings.js +1 -1
  32. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  33. package/build-module/store/utils/notice-builder.js +15 -18
  34. package/build-module/store/utils/notice-builder.js.map +1 -1
  35. package/build-module/utils/get-template-part-icon.js +2 -2
  36. package/build-module/utils/get-template-part-icon.js.map +1 -1
  37. package/build-style/style-rtl.css +1 -1
  38. package/build-style/style.css +1 -1
  39. package/package.json +19 -19
  40. package/src/components/autosave-monitor/index.js +5 -0
  41. package/src/components/autosave-monitor/test/index.js +10 -4
  42. package/src/components/editor-help/index.native.js +116 -106
  43. package/src/components/editor-help/style.scss +4 -0
  44. package/src/components/entities-saved-states/entity-type-list.js +29 -10
  45. package/src/components/entities-saved-states/index.js +38 -8
  46. package/src/components/post-saved-state/style.scss +2 -0
  47. package/src/components/post-taxonomies/flat-term-selector.js +220 -254
  48. package/src/components/post-title/index.js +4 -2
  49. package/src/components/provider/use-block-editor-settings.js +0 -2
  50. package/src/store/test/actions.js +4 -2
  51. package/src/store/utils/notice-builder.js +17 -19
  52. package/src/store/utils/test/notice-builder.js +1 -1
  53. 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 && currentPostStatus === 'publish' ) {
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
- 'Updated Post',
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 = null;
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
- if ( noticeMessage ) {
59
- const actions = [];
60
- if ( shouldShowLink ) {
61
- actions.push( {
62
- label: postType.labels.view_item,
63
- url: post.link,
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
- return [];
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
- layout as layoutIcon,
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 layoutIcon;
25
+ return symbolFilledIcon;
26
26
  }