@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.
- package/CHANGELOG.md +2 -0
- package/README.md +2 -3
- package/build/components/autocompleters/user.js.map +2 -2
- package/build/components/collab-sidebar/comments.js +4 -12
- package/build/components/collab-sidebar/comments.js.map +2 -2
- package/build/components/collab-sidebar/hooks.js +7 -19
- package/build/components/collab-sidebar/hooks.js.map +2 -2
- package/build/components/document-bar/index.js +19 -8
- package/build/components/document-bar/index.js.map +3 -3
- package/build/components/document-bar/useEditedSectionDetails.js +95 -0
- package/build/components/document-bar/useEditedSectionDetails.js.map +7 -0
- package/build/components/page-attributes/parent.js +1 -0
- package/build/components/page-attributes/parent.js.map +2 -2
- package/build/components/post-card-panel/index.js +1 -1
- package/build/components/post-card-panel/index.js.map +2 -2
- package/build/components/post-publish-panel/maybe-tags-panel.js +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +2 -2
- package/build/components/post-taxonomies/flat-term-selector.js +3 -16
- package/build/components/post-taxonomies/flat-term-selector.js.map +3 -3
- package/build/components/post-taxonomies/index.js +1 -5
- package/build/components/post-taxonomies/index.js.map +2 -2
- package/build/components/provider/use-block-editor-settings.js +10 -2
- package/build/components/provider/use-block-editor-settings.js.map +2 -2
- package/build/components/style-book/index.js +3 -5
- package/build/components/style-book/index.js.map +2 -2
- package/build/dataviews/store/private-actions.js +9 -1
- package/build/dataviews/store/private-actions.js.map +2 -2
- package/build/store/utils/notice-builder.js +12 -4
- package/build/store/utils/notice-builder.js.map +2 -2
- package/build/utils/get-template-part-icon.js +9 -4
- package/build/utils/get-template-part-icon.js.map +3 -3
- package/build-module/components/autocompleters/user.js.map +2 -2
- package/build-module/components/collab-sidebar/comments.js +4 -12
- package/build-module/components/collab-sidebar/comments.js.map +2 -2
- package/build-module/components/collab-sidebar/hooks.js +7 -20
- package/build-module/components/collab-sidebar/hooks.js.map +2 -2
- package/build-module/components/document-bar/index.js +20 -9
- package/build-module/components/document-bar/index.js.map +2 -2
- package/build-module/components/document-bar/useEditedSectionDetails.js +74 -0
- package/build-module/components/document-bar/useEditedSectionDetails.js.map +7 -0
- package/build-module/components/page-attributes/parent.js +1 -0
- package/build-module/components/page-attributes/parent.js.map +2 -2
- package/build-module/components/post-card-panel/index.js +1 -1
- package/build-module/components/post-card-panel/index.js.map +2 -2
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +2 -2
- package/build-module/components/post-taxonomies/flat-term-selector.js +4 -17
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +2 -2
- package/build-module/components/post-taxonomies/index.js +1 -5
- package/build-module/components/post-taxonomies/index.js.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.js +10 -2
- package/build-module/components/provider/use-block-editor-settings.js.map +2 -2
- package/build-module/components/style-book/index.js +3 -5
- package/build-module/components/style-book/index.js.map +2 -2
- package/build-module/dataviews/store/private-actions.js +11 -2
- package/build-module/dataviews/store/private-actions.js.map +2 -2
- package/build-module/store/utils/notice-builder.js +12 -4
- package/build-module/store/utils/notice-builder.js.map +2 -2
- package/build-module/utils/get-template-part-icon.js +10 -4
- package/build-module/utils/get-template-part-icon.js.map +2 -2
- package/build-style/style-rtl.css +76 -161
- package/build-style/style.css +76 -161
- package/build-types/components/autocompleters/user.d.ts +8 -2
- package/build-types/components/autocompleters/user.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/hooks.d.ts +0 -1
- package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-bar/useEditedSectionDetails.d.ts +8 -0
- package/build-types/components/document-bar/useEditedSectionDetails.d.ts.map +1 -0
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts +3 -5
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
- package/build-types/components/post-template/hooks.d.ts +1 -1
- package/build-types/components/post-template/hooks.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/style-book/index.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/utils/notice-builder.d.ts.map +1 -1
- package/build-types/utils/get-template-part-icon.d.ts +3 -3
- package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
- package/package.json +40 -40
- package/src/components/autocompleters/user.js +6 -0
- package/src/components/collab-sidebar/comments.js +16 -23
- package/src/components/collab-sidebar/hooks.js +7 -24
- package/src/components/document-bar/index.js +41 -9
- package/src/components/document-bar/useEditedSectionDetails.js +103 -0
- package/src/components/global-styles-sidebar/style.scss +0 -4
- package/src/components/page-attributes/parent.js +2 -1
- package/src/components/post-card-panel/index.js +1 -1
- package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
- package/src/components/post-taxonomies/flat-term-selector.js +6 -27
- package/src/components/post-taxonomies/index.js +1 -7
- package/src/components/provider/use-block-editor-settings.js +8 -0
- package/src/components/style-book/index.js +3 -5
- package/src/dataviews/store/private-actions.ts +16 -0
- package/src/store/utils/notice-builder.js +12 -4
- package/src/utils/get-template-part-icon.js +19 -6
- 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: __(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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}
|
|
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(
|
|
18
|
-
|
|
19
|
+
export function getTemplatePartIcon( areaOrIconName ) {
|
|
20
|
+
// Handle area names first
|
|
21
|
+
if ( 'header' === areaOrIconName ) {
|
|
19
22
|
return headerIcon;
|
|
20
|
-
} else if ( 'footer' ===
|
|
23
|
+
} else if ( 'footer' === areaOrIconName ) {
|
|
21
24
|
return footerIcon;
|
|
22
|
-
} else if ( 'sidebar' ===
|
|
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
|
}
|