@wordpress/editor 14.36.1-next.8b30e05b0.0 → 14.37.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 (100) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +2 -3
  3. package/build/components/autocompleters/user.js.map +2 -2
  4. package/build/components/collab-sidebar/comments.js +4 -12
  5. package/build/components/collab-sidebar/comments.js.map +2 -2
  6. package/build/components/collab-sidebar/hooks.js +7 -19
  7. package/build/components/collab-sidebar/hooks.js.map +2 -2
  8. package/build/components/document-bar/index.js +19 -8
  9. package/build/components/document-bar/index.js.map +3 -3
  10. package/build/components/document-bar/useEditedSectionDetails.js +95 -0
  11. package/build/components/document-bar/useEditedSectionDetails.js.map +7 -0
  12. package/build/components/page-attributes/parent.js +1 -0
  13. package/build/components/page-attributes/parent.js.map +2 -2
  14. package/build/components/post-card-panel/index.js +1 -1
  15. package/build/components/post-card-panel/index.js.map +2 -2
  16. package/build/components/post-publish-panel/maybe-tags-panel.js +1 -1
  17. package/build/components/post-publish-panel/maybe-tags-panel.js.map +2 -2
  18. package/build/components/post-taxonomies/flat-term-selector.js +3 -16
  19. package/build/components/post-taxonomies/flat-term-selector.js.map +3 -3
  20. package/build/components/post-taxonomies/index.js +1 -5
  21. package/build/components/post-taxonomies/index.js.map +2 -2
  22. package/build/components/provider/use-block-editor-settings.js +10 -2
  23. package/build/components/provider/use-block-editor-settings.js.map +2 -2
  24. package/build/components/style-book/index.js +3 -5
  25. package/build/components/style-book/index.js.map +2 -2
  26. package/build/dataviews/store/private-actions.js +9 -1
  27. package/build/dataviews/store/private-actions.js.map +2 -2
  28. package/build/store/utils/notice-builder.js +12 -4
  29. package/build/store/utils/notice-builder.js.map +2 -2
  30. package/build/utils/get-template-part-icon.js +9 -4
  31. package/build/utils/get-template-part-icon.js.map +3 -3
  32. package/build-module/components/autocompleters/user.js.map +2 -2
  33. package/build-module/components/collab-sidebar/comments.js +4 -12
  34. package/build-module/components/collab-sidebar/comments.js.map +2 -2
  35. package/build-module/components/collab-sidebar/hooks.js +7 -20
  36. package/build-module/components/collab-sidebar/hooks.js.map +2 -2
  37. package/build-module/components/document-bar/index.js +20 -9
  38. package/build-module/components/document-bar/index.js.map +2 -2
  39. package/build-module/components/document-bar/useEditedSectionDetails.js +74 -0
  40. package/build-module/components/document-bar/useEditedSectionDetails.js.map +7 -0
  41. package/build-module/components/page-attributes/parent.js +1 -0
  42. package/build-module/components/page-attributes/parent.js.map +2 -2
  43. package/build-module/components/post-card-panel/index.js +1 -1
  44. package/build-module/components/post-card-panel/index.js.map +2 -2
  45. package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -1
  46. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +2 -2
  47. package/build-module/components/post-taxonomies/flat-term-selector.js +4 -17
  48. package/build-module/components/post-taxonomies/flat-term-selector.js.map +2 -2
  49. package/build-module/components/post-taxonomies/index.js +1 -5
  50. package/build-module/components/post-taxonomies/index.js.map +2 -2
  51. package/build-module/components/provider/use-block-editor-settings.js +10 -2
  52. package/build-module/components/provider/use-block-editor-settings.js.map +2 -2
  53. package/build-module/components/style-book/index.js +3 -5
  54. package/build-module/components/style-book/index.js.map +2 -2
  55. package/build-module/dataviews/store/private-actions.js +11 -2
  56. package/build-module/dataviews/store/private-actions.js.map +2 -2
  57. package/build-module/store/utils/notice-builder.js +12 -4
  58. package/build-module/store/utils/notice-builder.js.map +2 -2
  59. package/build-module/utils/get-template-part-icon.js +10 -4
  60. package/build-module/utils/get-template-part-icon.js.map +2 -2
  61. package/build-style/style-rtl.css +76 -161
  62. package/build-style/style.css +76 -161
  63. package/build-types/components/autocompleters/user.d.ts +8 -2
  64. package/build-types/components/autocompleters/user.d.ts.map +1 -1
  65. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  66. package/build-types/components/collab-sidebar/hooks.d.ts +0 -1
  67. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  68. package/build-types/components/document-bar/index.d.ts.map +1 -1
  69. package/build-types/components/document-bar/useEditedSectionDetails.d.ts +8 -0
  70. package/build-types/components/document-bar/useEditedSectionDetails.d.ts.map +1 -0
  71. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  72. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +3 -5
  73. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  74. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  75. package/build-types/components/post-template/hooks.d.ts +1 -1
  76. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  77. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  78. package/build-types/components/style-book/index.d.ts.map +1 -1
  79. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  80. package/build-types/store/utils/notice-builder.d.ts.map +1 -1
  81. package/build-types/utils/get-template-part-icon.d.ts +3 -3
  82. package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
  83. package/package.json +40 -40
  84. package/src/components/autocompleters/user.js +6 -0
  85. package/src/components/collab-sidebar/comments.js +16 -23
  86. package/src/components/collab-sidebar/hooks.js +7 -24
  87. package/src/components/document-bar/index.js +41 -9
  88. package/src/components/document-bar/useEditedSectionDetails.js +103 -0
  89. package/src/components/global-styles-sidebar/style.scss +0 -4
  90. package/src/components/page-attributes/parent.js +2 -1
  91. package/src/components/post-card-panel/index.js +1 -1
  92. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  93. package/src/components/post-taxonomies/flat-term-selector.js +6 -27
  94. package/src/components/post-taxonomies/index.js +1 -7
  95. package/src/components/provider/use-block-editor-settings.js +8 -0
  96. package/src/components/style-book/index.js +3 -5
  97. package/src/dataviews/store/private-actions.ts +16 -0
  98. package/src/store/utils/notice-builder.js +12 -4
  99. package/src/utils/get-template-part-icon.js +19 -6
  100. package/tsconfig.tsbuildinfo +1 -1
@@ -34,6 +34,7 @@ import {
34
34
  templateTitleField,
35
35
  pageTitleField,
36
36
  patternTitleField,
37
+ notesField,
37
38
  } from '@wordpress/fields';
38
39
 
39
40
  /**
@@ -50,6 +51,20 @@ declare global {
50
51
  }
51
52
  }
52
53
 
54
+ /**
55
+ * Check if a post type supports editor notes.
56
+ *
57
+ * @param supports The post type supports object.
58
+ * @return Whether editor notes are supported.
59
+ */
60
+ function hasEditorNotesSupport( supports?: PostType[ 'supports' ] ): boolean {
61
+ const editor = supports?.editor;
62
+ if ( Array.isArray( editor ) ) {
63
+ return !! editor[ 0 ]?.notes;
64
+ }
65
+ return false;
66
+ }
67
+
53
68
  export function registerEntityAction< Item >(
54
69
  kind: string,
55
70
  name: string,
@@ -210,6 +225,7 @@ export const registerPostTypeSchema =
210
225
  postTypeConfig.supports?.editor &&
211
226
  postTypeConfig.viewable &&
212
227
  postPreviewField,
228
+ hasEditorNotesSupport( postTypeConfig.supports ) && notesField,
213
229
  ].filter( Boolean );
214
230
  if ( postTypeConfig.supports?.title ) {
215
231
  let _titleField;
@@ -92,10 +92,18 @@ export function getNotificationArgumentsForSaveFail( data ) {
92
92
 
93
93
  if ( error.code === 'offline_error' ) {
94
94
  const messages = {
95
- publish: __( 'Publishing failed because you were offline.' ),
96
- private: __( 'Publishing failed because you were offline.' ),
97
- future: __( 'Scheduling failed because you were offline.' ),
98
- default: __( 'Updating failed because you were offline.' ),
95
+ publish: __(
96
+ 'Publishing failed because you were offline. Please, verify your connection and try again.'
97
+ ),
98
+ private: __(
99
+ 'Publishing failed because you were offline. Please, verify your connection and try again.'
100
+ ),
101
+ future: __(
102
+ 'Scheduling failed because you were offline. Please, verify your connection and try again.'
103
+ ),
104
+ default: __(
105
+ 'Updating failed because you were offline. Please, verify your connection and try again.'
106
+ ),
99
107
  };
100
108
 
101
109
  const noticeMessage =
@@ -5,22 +5,35 @@ import {
5
5
  header as headerIcon,
6
6
  footer as footerIcon,
7
7
  sidebar as sidebarIcon,
8
+ tableColumnAfter as overlayIcon,
8
9
  symbolFilled as symbolFilledIcon,
9
10
  } from '@wordpress/icons';
11
+
10
12
  /**
11
- * Helper function to retrieve the corresponding icon by name.
13
+ * Helper function to retrieve the corresponding icon by area name or icon name.
12
14
  *
13
- * @param {string} iconName The name of the icon.
15
+ * @param {string} areaOrIconName The area name (e.g., 'header', 'overlay') or icon name (e.g., 'menu').
14
16
  *
15
17
  * @return {Object} The corresponding icon.
16
18
  */
17
- export function getTemplatePartIcon( iconName ) {
18
- if ( 'header' === iconName ) {
19
+ export function getTemplatePartIcon( areaOrIconName ) {
20
+ // Handle area names first
21
+ if ( 'header' === areaOrIconName ) {
19
22
  return headerIcon;
20
- } else if ( 'footer' === iconName ) {
23
+ } else if ( 'footer' === areaOrIconName ) {
21
24
  return footerIcon;
22
- } else if ( 'sidebar' === iconName ) {
25
+ } else if ( 'sidebar' === areaOrIconName ) {
23
26
  return sidebarIcon;
27
+ } else if ( 'overlay' === areaOrIconName ) {
28
+ // TODO: Replace with a proper overlay icon when available.
29
+ // Using tableColumnAfter as a placeholder.
30
+ return overlayIcon;
31
+ }
32
+ // Handle icon names for backwards compatibility
33
+ if ( 'menu' === areaOrIconName ) {
34
+ // TODO: Replace with a proper overlay icon when available.
35
+ // Using tableColumnAfter as a placeholder.
36
+ return overlayIcon;
24
37
  }
25
38
  return symbolFilledIcon;
26
39
  }