@wordpress/block-library 9.22.0 → 9.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 +4 -0
- package/build/calendar/index.js +1 -0
- package/build/calendar/index.js.map +1 -1
- package/build/code/index.js +2 -1
- package/build/code/index.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +13 -13
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments/edit/index.js +4 -2
- package/build/comments/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +9 -12
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/details/index.js +2 -1
- package/build/details/index.js.map +1 -1
- package/build/group/edit.js +17 -13
- package/build/group/edit.js.map +1 -1
- package/build/html/index.js +2 -1
- package/build/html/index.js.map +1 -1
- package/build/image/constants.js +2 -1
- package/build/image/constants.js.map +1 -1
- package/build/image/edit.js +1 -7
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +1 -4
- package/build/image/image.js.map +1 -1
- package/build/latest-posts/edit.js +100 -54
- package/build/latest-posts/edit.js.map +1 -1
- package/build/more/index.js +2 -1
- package/build/more/index.js.map +1 -1
- package/build/post-excerpt/edit.js +3 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +2 -1
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-navigation-link/edit.js +3 -1
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-navigation-link/index.js +2 -1
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-navigation-link/variations.js +13 -13
- package/build/post-navigation-link/variations.js.map +1 -1
- package/build/post-template/edit.js +5 -3
- package/build/post-template/edit.js.map +1 -1
- package/build/post-terms/edit.js +3 -1
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/index.js +4 -2
- package/build/post-terms/index.js.map +1 -1
- package/build/preformatted/transforms.js +5 -1
- package/build/preformatted/transforms.js.map +1 -1
- package/build/query/edit/query-content.js +11 -12
- package/build/query/edit/query-content.js.map +1 -1
- package/build/read-more/index.js +2 -1
- package/build/read-more/index.js.map +1 -1
- package/build/rss/index.js +2 -1
- package/build/rss/index.js.map +1 -1
- package/build/search/edit.js +76 -86
- package/build/search/edit.js.map +1 -1
- package/build/separator/edit.js +13 -12
- package/build/separator/edit.js.map +1 -1
- package/build/table/edit.js +3 -2
- package/build/table/edit.js.map +1 -1
- package/build/table/index.js +8 -4
- package/build/table/index.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +14 -12
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +2 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build-module/calendar/index.js +1 -0
- package/build-module/calendar/index.js.map +1 -1
- package/build-module/code/index.js +2 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +14 -14
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments/edit/index.js +4 -2
- package/build-module/comments/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +10 -13
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/details/index.js +2 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/group/edit.js +16 -14
- package/build-module/group/edit.js.map +1 -1
- package/build-module/html/index.js +2 -1
- package/build-module/html/index.js.map +1 -1
- package/build-module/image/constants.js +1 -0
- package/build-module/image/constants.js.map +1 -1
- package/build-module/image/edit.js +2 -8
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +2 -5
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-posts/edit.js +100 -54
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/more/index.js +2 -1
- package/build-module/more/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +4 -2
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +2 -1
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +4 -2
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-navigation-link/index.js +2 -1
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-navigation-link/variations.js +13 -13
- package/build-module/post-navigation-link/variations.js.map +1 -1
- package/build-module/post-template/edit.js +5 -3
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +4 -2
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/index.js +4 -2
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/preformatted/transforms.js +5 -1
- package/build-module/preformatted/transforms.js.map +1 -1
- package/build-module/query/edit/query-content.js +12 -13
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/read-more/index.js +2 -1
- package/build-module/read-more/index.js.map +1 -1
- package/build-module/rss/index.js +2 -1
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/edit.js +78 -88
- package/build-module/search/edit.js.map +1 -1
- package/build-module/separator/edit.js +15 -14
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/table/edit.js +4 -3
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/index.js +8 -4
- package/build-module/table/index.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +14 -12
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +2 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-style/archives/editor-rtl.css +47 -11
- package/build-style/archives/editor.css +47 -11
- package/build-style/archives/style-rtl.css +47 -11
- package/build-style/archives/style.css +47 -11
- package/build-style/audio/editor-rtl.css +47 -11
- package/build-style/audio/editor.css +47 -11
- package/build-style/audio/style-rtl.css +47 -11
- package/build-style/audio/style.css +47 -11
- package/build-style/audio/theme-rtl.css +47 -11
- package/build-style/audio/theme.css +47 -11
- package/build-style/avatar/editor-rtl.css +47 -11
- package/build-style/avatar/editor.css +47 -11
- package/build-style/avatar/style-rtl.css +47 -11
- package/build-style/avatar/style.css +47 -11
- package/build-style/button/editor-rtl.css +47 -11
- package/build-style/button/editor.css +47 -11
- package/build-style/button/style-rtl.css +47 -12
- package/build-style/button/style.css +47 -12
- package/build-style/buttons/editor-rtl.css +47 -11
- package/build-style/buttons/editor.css +47 -11
- package/build-style/buttons/style-rtl.css +50 -11
- package/build-style/buttons/style.css +50 -11
- package/build-style/calendar/style-rtl.css +47 -11
- package/build-style/calendar/style.css +47 -11
- package/build-style/categories/editor-rtl.css +47 -11
- package/build-style/categories/editor.css +47 -11
- package/build-style/categories/style-rtl.css +47 -11
- package/build-style/categories/style.css +47 -11
- package/build-style/classic-rtl.css +47 -11
- package/build-style/classic.css +47 -11
- package/build-style/code/editor-rtl.css +47 -11
- package/build-style/code/editor.css +47 -11
- package/build-style/code/style-rtl.css +47 -11
- package/build-style/code/style.css +47 -11
- package/build-style/code/theme-rtl.css +47 -11
- package/build-style/code/theme.css +47 -11
- package/build-style/columns/editor-rtl.css +47 -11
- package/build-style/columns/editor.css +47 -11
- package/build-style/columns/style-rtl.css +47 -11
- package/build-style/columns/style.css +47 -11
- package/build-style/comment-author-avatar/editor-rtl.css +47 -11
- package/build-style/comment-author-avatar/editor.css +47 -11
- package/build-style/comment-author-name/style-rtl.css +47 -11
- package/build-style/comment-author-name/style.css +47 -11
- package/build-style/comment-content/style-rtl.css +47 -11
- package/build-style/comment-content/style.css +47 -11
- package/build-style/comment-date/style-rtl.css +47 -11
- package/build-style/comment-date/style.css +47 -11
- package/build-style/comment-edit-link/style-rtl.css +47 -11
- package/build-style/comment-edit-link/style.css +47 -11
- package/build-style/comment-reply-link/style-rtl.css +47 -11
- package/build-style/comment-reply-link/style.css +47 -11
- package/build-style/comment-template/style-rtl.css +47 -11
- package/build-style/comment-template/style.css +47 -11
- package/build-style/comments/editor-rtl.css +47 -11
- package/build-style/comments/editor.css +47 -11
- package/build-style/comments/style-rtl.css +47 -11
- package/build-style/comments/style.css +47 -11
- package/build-style/comments-pagination/editor-rtl.css +47 -11
- package/build-style/comments-pagination/editor.css +47 -11
- package/build-style/comments-pagination/style-rtl.css +47 -11
- package/build-style/comments-pagination/style.css +47 -11
- package/build-style/comments-pagination-numbers/editor-rtl.css +47 -11
- package/build-style/comments-pagination-numbers/editor.css +47 -11
- package/build-style/comments-title/editor-rtl.css +47 -11
- package/build-style/comments-title/editor.css +47 -11
- package/build-style/common-rtl.css +130 -9
- package/build-style/common.css +130 -9
- package/build-style/cover/editor-rtl.css +47 -11
- package/build-style/cover/editor.css +47 -11
- package/build-style/cover/style-rtl.css +47 -11
- package/build-style/cover/style.css +47 -11
- package/build-style/details/editor-rtl.css +47 -11
- package/build-style/details/editor.css +47 -11
- package/build-style/details/style-rtl.css +47 -11
- package/build-style/details/style.css +47 -11
- package/build-style/editor-elements-rtl.css +47 -11
- package/build-style/editor-elements.css +47 -11
- package/build-style/editor-rtl.css +48 -11
- package/build-style/editor.css +48 -11
- package/build-style/elements-rtl.css +47 -11
- package/build-style/elements.css +47 -11
- package/build-style/embed/editor-rtl.css +47 -11
- package/build-style/embed/editor.css +47 -11
- package/build-style/embed/style-rtl.css +47 -11
- package/build-style/embed/style.css +47 -11
- package/build-style/embed/theme-rtl.css +47 -11
- package/build-style/embed/theme.css +47 -11
- package/build-style/file/editor-rtl.css +47 -11
- package/build-style/file/editor.css +47 -11
- package/build-style/file/style-rtl.css +47 -11
- package/build-style/file/style.css +47 -11
- package/build-style/footnotes/style-rtl.css +47 -11
- package/build-style/footnotes/style.css +47 -11
- package/build-style/form-input/editor-rtl.css +47 -11
- package/build-style/form-input/editor.css +47 -11
- package/build-style/form-input/style-rtl.css +47 -11
- package/build-style/form-input/style.css +47 -11
- package/build-style/form-submission-notification/editor-rtl.css +47 -11
- package/build-style/form-submission-notification/editor.css +47 -11
- package/build-style/form-submit-button/style-rtl.css +47 -11
- package/build-style/form-submit-button/style.css +47 -11
- package/build-style/freeform/editor-rtl.css +47 -11
- package/build-style/freeform/editor.css +47 -11
- package/build-style/gallery/editor-rtl.css +47 -11
- package/build-style/gallery/editor.css +47 -11
- package/build-style/gallery/style-rtl.css +47 -11
- package/build-style/gallery/style.css +47 -11
- package/build-style/gallery/theme-rtl.css +47 -11
- package/build-style/gallery/theme.css +47 -11
- package/build-style/group/editor-rtl.css +47 -11
- package/build-style/group/editor.css +47 -11
- package/build-style/group/style-rtl.css +47 -11
- package/build-style/group/style.css +47 -11
- package/build-style/group/theme-rtl.css +47 -11
- package/build-style/group/theme.css +47 -11
- package/build-style/heading/style-rtl.css +47 -11
- package/build-style/heading/style.css +47 -11
- package/build-style/html/editor-rtl.css +48 -11
- package/build-style/html/editor.css +48 -11
- package/build-style/image/editor-rtl.css +47 -11
- package/build-style/image/editor.css +47 -11
- package/build-style/image/style-rtl.css +47 -11
- package/build-style/image/style.css +47 -11
- package/build-style/image/theme-rtl.css +47 -11
- package/build-style/image/theme.css +47 -11
- package/build-style/latest-comments/style-rtl.css +47 -11
- package/build-style/latest-comments/style.css +47 -11
- package/build-style/latest-posts/editor-rtl.css +47 -11
- package/build-style/latest-posts/editor.css +47 -11
- package/build-style/latest-posts/style-rtl.css +47 -11
- package/build-style/latest-posts/style.css +47 -11
- package/build-style/list/style-rtl.css +47 -11
- package/build-style/list/style.css +47 -11
- package/build-style/loginout/style-rtl.css +47 -11
- package/build-style/loginout/style.css +47 -11
- package/build-style/media-text/editor-rtl.css +47 -11
- package/build-style/media-text/editor.css +47 -11
- package/build-style/media-text/style-rtl.css +47 -11
- package/build-style/media-text/style.css +47 -11
- package/build-style/more/editor-rtl.css +47 -11
- package/build-style/more/editor.css +47 -11
- package/build-style/navigation/editor-rtl.css +47 -11
- package/build-style/navigation/editor.css +47 -11
- package/build-style/navigation/style-rtl.css +47 -11
- package/build-style/navigation/style.css +47 -11
- package/build-style/navigation-link/editor-rtl.css +47 -11
- package/build-style/navigation-link/editor.css +47 -11
- package/build-style/navigation-link/style-rtl.css +47 -11
- package/build-style/navigation-link/style.css +47 -11
- package/build-style/navigation-submenu/editor-rtl.css +47 -11
- package/build-style/navigation-submenu/editor.css +47 -11
- package/build-style/nextpage/editor-rtl.css +47 -11
- package/build-style/nextpage/editor.css +47 -11
- package/build-style/page-list/editor-rtl.css +47 -11
- package/build-style/page-list/editor.css +47 -11
- package/build-style/page-list/style-rtl.css +47 -11
- package/build-style/page-list/style.css +47 -11
- package/build-style/paragraph/editor-rtl.css +47 -11
- package/build-style/paragraph/editor.css +47 -11
- package/build-style/paragraph/style-rtl.css +47 -11
- package/build-style/paragraph/style.css +47 -11
- package/build-style/post-author/editor-rtl.css +47 -11
- package/build-style/post-author/editor.css +47 -11
- package/build-style/post-author/style-rtl.css +47 -11
- package/build-style/post-author/style.css +47 -11
- package/build-style/post-author-biography/style-rtl.css +47 -11
- package/build-style/post-author-biography/style.css +47 -11
- package/build-style/post-author-name/style-rtl.css +47 -11
- package/build-style/post-author-name/style.css +47 -11
- package/build-style/post-comments-count/style-rtl.css +47 -11
- package/build-style/post-comments-count/style.css +47 -11
- package/build-style/post-comments-form/editor-rtl.css +47 -11
- package/build-style/post-comments-form/editor.css +47 -11
- package/build-style/post-comments-form/style-rtl.css +47 -14
- package/build-style/post-comments-form/style.css +47 -14
- package/build-style/post-comments-link/style-rtl.css +47 -11
- package/build-style/post-comments-link/style.css +47 -11
- package/build-style/post-content/style-rtl.css +47 -11
- package/build-style/post-content/style.css +47 -11
- package/build-style/post-date/style-rtl.css +47 -11
- package/build-style/post-date/style.css +47 -11
- package/build-style/post-excerpt/editor-rtl.css +47 -11
- package/build-style/post-excerpt/editor.css +47 -11
- package/build-style/post-excerpt/style-rtl.css +47 -11
- package/build-style/post-excerpt/style.css +47 -11
- package/build-style/post-featured-image/editor-rtl.css +47 -11
- package/build-style/post-featured-image/editor.css +47 -11
- package/build-style/post-featured-image/style-rtl.css +47 -11
- package/build-style/post-featured-image/style.css +47 -11
- package/build-style/post-navigation-link/style-rtl.css +47 -11
- package/build-style/post-navigation-link/style.css +47 -11
- package/build-style/post-template/style-rtl.css +47 -11
- package/build-style/post-template/style.css +47 -11
- package/build-style/post-terms/style-rtl.css +47 -11
- package/build-style/post-terms/style.css +47 -11
- package/build-style/post-time-to-read/style-rtl.css +47 -11
- package/build-style/post-time-to-read/style.css +47 -11
- package/build-style/post-title/style-rtl.css +47 -11
- package/build-style/post-title/style.css +47 -11
- package/build-style/preformatted/style-rtl.css +47 -11
- package/build-style/preformatted/style.css +47 -11
- package/build-style/pullquote/editor-rtl.css +47 -11
- package/build-style/pullquote/editor.css +47 -11
- package/build-style/pullquote/style-rtl.css +47 -11
- package/build-style/pullquote/style.css +47 -11
- package/build-style/pullquote/theme-rtl.css +47 -11
- package/build-style/pullquote/theme.css +47 -11
- package/build-style/query/editor-rtl.css +47 -11
- package/build-style/query/editor.css +47 -11
- package/build-style/query-pagination/editor-rtl.css +47 -11
- package/build-style/query-pagination/editor.css +47 -11
- package/build-style/query-pagination/style-rtl.css +47 -11
- package/build-style/query-pagination/style.css +47 -11
- package/build-style/query-pagination-numbers/editor-rtl.css +47 -11
- package/build-style/query-pagination-numbers/editor.css +47 -11
- package/build-style/query-title/style-rtl.css +47 -11
- package/build-style/query-title/style.css +47 -11
- package/build-style/query-total/style-rtl.css +47 -11
- package/build-style/query-total/style.css +47 -11
- package/build-style/quote/style-rtl.css +47 -11
- package/build-style/quote/style.css +47 -11
- package/build-style/quote/theme-rtl.css +47 -11
- package/build-style/quote/theme.css +47 -11
- package/build-style/read-more/style-rtl.css +47 -11
- package/build-style/read-more/style.css +47 -11
- package/build-style/reset-rtl.css +47 -11
- package/build-style/reset.css +47 -11
- package/build-style/rss/editor-rtl.css +47 -11
- package/build-style/rss/editor.css +47 -11
- package/build-style/rss/style-rtl.css +47 -11
- package/build-style/rss/style.css +47 -11
- package/build-style/search/editor-rtl.css +47 -11
- package/build-style/search/editor.css +47 -11
- package/build-style/search/style-rtl.css +47 -11
- package/build-style/search/style.css +47 -11
- package/build-style/search/theme-rtl.css +47 -11
- package/build-style/search/theme.css +47 -11
- package/build-style/separator/editor-rtl.css +47 -11
- package/build-style/separator/editor.css +47 -11
- package/build-style/separator/style-rtl.css +47 -11
- package/build-style/separator/style.css +47 -11
- package/build-style/separator/theme-rtl.css +47 -11
- package/build-style/separator/theme.css +47 -11
- package/build-style/shortcode/editor-rtl.css +47 -11
- package/build-style/shortcode/editor.css +47 -11
- package/build-style/site-logo/editor-rtl.css +47 -11
- package/build-style/site-logo/editor.css +47 -11
- package/build-style/site-logo/style-rtl.css +47 -11
- package/build-style/site-logo/style.css +47 -11
- package/build-style/site-tagline/editor-rtl.css +47 -11
- package/build-style/site-tagline/editor.css +47 -11
- package/build-style/site-tagline/style-rtl.css +47 -11
- package/build-style/site-tagline/style.css +47 -11
- package/build-style/site-title/editor-rtl.css +47 -11
- package/build-style/site-title/editor.css +47 -11
- package/build-style/site-title/style-rtl.css +47 -11
- package/build-style/site-title/style.css +47 -11
- package/build-style/social-link/editor-rtl.css +47 -11
- package/build-style/social-link/editor.css +47 -11
- package/build-style/social-links/editor-rtl.css +47 -11
- package/build-style/social-links/editor.css +47 -11
- package/build-style/social-links/style-rtl.css +47 -11
- package/build-style/social-links/style.css +47 -11
- package/build-style/spacer/editor-rtl.css +47 -11
- package/build-style/spacer/editor.css +47 -11
- package/build-style/spacer/style-rtl.css +47 -11
- package/build-style/spacer/style.css +47 -11
- package/build-style/style-rtl.css +50 -15
- package/build-style/style.css +50 -15
- package/build-style/table/editor-rtl.css +47 -11
- package/build-style/table/editor.css +47 -11
- package/build-style/table/style-rtl.css +47 -11
- package/build-style/table/style.css +47 -11
- package/build-style/table/theme-rtl.css +47 -11
- package/build-style/table/theme.css +47 -11
- package/build-style/table-of-contents/style-rtl.css +47 -11
- package/build-style/table-of-contents/style.css +47 -11
- package/build-style/tag-cloud/editor-rtl.css +47 -11
- package/build-style/tag-cloud/editor.css +47 -11
- package/build-style/tag-cloud/style-rtl.css +47 -11
- package/build-style/tag-cloud/style.css +47 -11
- package/build-style/template-part/editor-rtl.css +47 -11
- package/build-style/template-part/editor.css +47 -11
- package/build-style/template-part/theme-rtl.css +47 -11
- package/build-style/template-part/theme.css +47 -11
- package/build-style/term-description/style-rtl.css +47 -11
- package/build-style/term-description/style.css +47 -11
- package/build-style/text-columns/editor-rtl.css +47 -11
- package/build-style/text-columns/editor.css +47 -11
- package/build-style/text-columns/style-rtl.css +47 -11
- package/build-style/text-columns/style.css +47 -11
- package/build-style/theme-rtl.css +47 -11
- package/build-style/theme.css +47 -11
- package/build-style/verse/style-rtl.css +47 -11
- package/build-style/verse/style.css +47 -11
- package/build-style/video/editor-rtl.css +47 -11
- package/build-style/video/editor.css +47 -11
- package/build-style/video/style-rtl.css +47 -11
- package/build-style/video/style.css +47 -11
- package/build-style/video/theme-rtl.css +47 -11
- package/build-style/video/theme.css +47 -11
- package/package.json +35 -35
- package/src/button/style.scss +0 -1
- package/src/buttons/style.scss +5 -0
- package/src/calendar/block.json +1 -0
- package/src/code/block.json +2 -1
- package/src/comments/edit/comments-inspector-controls.js +14 -12
- package/src/comments/edit/index.js +2 -1
- package/src/cover/edit/inspector-controls.js +9 -12
- package/src/details/block.json +2 -1
- package/src/group/edit.js +11 -10
- package/src/html/block.json +2 -1
- package/src/html/editor.scss +1 -0
- package/src/image/constants.js +1 -0
- package/src/image/edit.js +2 -5
- package/src/image/image.js +7 -5
- package/src/latest-posts/edit.js +113 -81
- package/src/loginout/index.php +5 -1
- package/src/more/block.json +2 -1
- package/src/navigation/index.php +0 -1
- package/src/navigation-link/index.php +1 -1
- package/src/navigation-submenu/index.php +1 -1
- package/src/post-author/index.php +1 -1
- package/src/post-author-name/index.php +1 -1
- package/src/post-comments-form/style.scss +0 -5
- package/src/post-excerpt/block.json +2 -1
- package/src/post-excerpt/edit.js +13 -8
- package/src/post-navigation-link/block.json +2 -1
- package/src/post-navigation-link/edit.js +13 -8
- package/src/post-navigation-link/variations.js +13 -13
- package/src/post-template/edit.js +4 -3
- package/src/post-terms/block.json +4 -2
- package/src/post-terms/edit.js +13 -8
- package/src/preformatted/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/preformatted/test/transforms.native.js +6 -1
- package/src/preformatted/transforms.js +7 -1
- package/src/query/edit/query-content.js +10 -11
- package/src/read-more/block.json +2 -1
- package/src/rss/block.json +2 -1
- package/src/search/edit.js +84 -99
- package/src/separator/edit.js +16 -12
- package/src/table/block.json +8 -4
- package/src/table/edit.js +6 -2
- package/src/template-part/edit/advanced-controls.js +9 -8
- package/src/template-part/edit/index.js +1 -0
- package/src/verse/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/verse/test/transforms.native.js +5 -1
- package/build/search/icons.js +0 -121
- package/build/search/icons.js.map +0 -1
- package/build/utils/messages.js +0 -22
- package/build/utils/messages.js.map +0 -1
- package/build-module/search/icons.js +0 -114
- package/build-module/search/icons.js.map +0 -1
- package/build-module/utils/messages.js +0 -15
- package/build-module/utils/messages.js.map +0 -1
- package/src/search/icons.js +0 -89
- package/src/utils/messages.js +0 -31
package/src/calendar/block.json
CHANGED
package/src/code/block.json
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { SelectControl } from '@wordpress/components';
|
|
5
4
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
InspectorControls,
|
|
7
|
+
privateApis as blockEditorPrivateApis,
|
|
8
|
+
} from '@wordpress/block-editor';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Internal dependencies
|
|
10
12
|
*/
|
|
11
|
-
import {
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
14
|
+
|
|
15
|
+
const { HTMLElementControl } = unlock( blockEditorPrivateApis );
|
|
12
16
|
|
|
13
17
|
export default function CommentsInspectorControls( {
|
|
14
18
|
attributes: { tagName },
|
|
15
19
|
setAttributes,
|
|
20
|
+
clientId,
|
|
16
21
|
} ) {
|
|
17
22
|
return (
|
|
18
23
|
<InspectorControls>
|
|
19
24
|
<InspectorControls group="advanced">
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
<HTMLElementControl
|
|
26
|
+
tagName={ tagName }
|
|
27
|
+
onChange={ ( value ) =>
|
|
28
|
+
setAttributes( { tagName: value } )
|
|
29
|
+
}
|
|
30
|
+
clientId={ clientId }
|
|
24
31
|
options={ [
|
|
25
32
|
{ label: __( 'Default (<div>)' ), value: 'div' },
|
|
26
33
|
{ label: '<section>', value: 'section' },
|
|
27
34
|
{ label: '<aside>', value: 'aside' },
|
|
28
35
|
] }
|
|
29
|
-
value={ tagName }
|
|
30
|
-
onChange={ ( value ) =>
|
|
31
|
-
setAttributes( { tagName: value } )
|
|
32
|
-
}
|
|
33
|
-
help={ htmlElementMessages[ tagName ] }
|
|
34
36
|
/>
|
|
35
37
|
</InspectorControls>
|
|
36
38
|
</InspectorControls>
|
|
@@ -11,7 +11,7 @@ import CommentsLegacy from './comments-legacy';
|
|
|
11
11
|
import TEMPLATE from './template';
|
|
12
12
|
|
|
13
13
|
export default function CommentsEdit( props ) {
|
|
14
|
-
const { attributes, setAttributes } = props;
|
|
14
|
+
const { attributes, setAttributes, clientId } = props;
|
|
15
15
|
const { tagName: TagName, legacy } = attributes;
|
|
16
16
|
|
|
17
17
|
const blockProps = useBlockProps();
|
|
@@ -28,6 +28,7 @@ export default function CommentsEdit( props ) {
|
|
|
28
28
|
<CommentsInspectorControls
|
|
29
29
|
attributes={ attributes }
|
|
30
30
|
setAttributes={ setAttributes }
|
|
31
|
+
clientId={ clientId }
|
|
31
32
|
/>
|
|
32
33
|
<TagName { ...innerBlocksProps } />
|
|
33
34
|
</>
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
RangeControl,
|
|
9
9
|
TextareaControl,
|
|
10
10
|
ToggleControl,
|
|
11
|
-
SelectControl,
|
|
12
11
|
__experimentalUseCustomUnits as useCustomUnits,
|
|
13
12
|
__experimentalToolsPanel as ToolsPanel,
|
|
14
13
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
@@ -36,9 +35,10 @@ import { COVER_MIN_HEIGHT, mediaPosition } from '../shared';
|
|
|
36
35
|
import { unlock } from '../../lock-unlock';
|
|
37
36
|
import { useToolsPanelDropdownMenuProps } from '../../utils/hooks';
|
|
38
37
|
import { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';
|
|
39
|
-
import { htmlElementMessages } from '../../utils/messages';
|
|
40
38
|
|
|
41
|
-
const { cleanEmptyObject, ResolutionTool } = unlock(
|
|
39
|
+
const { cleanEmptyObject, ResolutionTool, HTMLElementControl } = unlock(
|
|
40
|
+
blockEditorPrivateApis
|
|
41
|
+
);
|
|
42
42
|
|
|
43
43
|
function CoverHeightInput( {
|
|
44
44
|
onChange,
|
|
@@ -421,10 +421,12 @@ export default function CoverInspectorControls( {
|
|
|
421
421
|
</ToolsPanelItem>
|
|
422
422
|
</InspectorControls>
|
|
423
423
|
<InspectorControls group="advanced">
|
|
424
|
-
<
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
424
|
+
<HTMLElementControl
|
|
425
|
+
tagName={ tagName }
|
|
426
|
+
onChange={ ( value ) =>
|
|
427
|
+
setAttributes( { tagName: value } )
|
|
428
|
+
}
|
|
429
|
+
clientId={ clientId }
|
|
428
430
|
options={ [
|
|
429
431
|
{ label: __( 'Default (<div>)' ), value: 'div' },
|
|
430
432
|
{ label: '<header>', value: 'header' },
|
|
@@ -434,11 +436,6 @@ export default function CoverInspectorControls( {
|
|
|
434
436
|
{ label: '<aside>', value: 'aside' },
|
|
435
437
|
{ label: '<footer>', value: 'footer' },
|
|
436
438
|
] }
|
|
437
|
-
value={ tagName }
|
|
438
|
-
onChange={ ( value ) =>
|
|
439
|
-
setAttributes( { tagName: value } )
|
|
440
|
-
}
|
|
441
|
-
help={ htmlElementMessages[ tagName ] }
|
|
442
439
|
/>
|
|
443
440
|
</InspectorControls>
|
|
444
441
|
</>
|
package/src/details/block.json
CHANGED
package/src/group/edit.js
CHANGED
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
InspectorControls,
|
|
9
9
|
useInnerBlocksProps,
|
|
10
10
|
store as blockEditorStore,
|
|
11
|
+
privateApis as blockEditorPrivateApis,
|
|
11
12
|
} from '@wordpress/block-editor';
|
|
12
|
-
import { SelectControl } from '@wordpress/components';
|
|
13
13
|
import { useRef } from '@wordpress/element';
|
|
14
14
|
import { __ } from '@wordpress/i18n';
|
|
15
15
|
import { View } from '@wordpress/primitives';
|
|
@@ -18,7 +18,9 @@ import { View } from '@wordpress/primitives';
|
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
20
|
import GroupPlaceHolder, { useShouldShowPlaceHolder } from './placeholder';
|
|
21
|
-
import {
|
|
21
|
+
import { unlock } from '../lock-unlock';
|
|
22
|
+
|
|
23
|
+
const { HTMLElementControl } = unlock( blockEditorPrivateApis );
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Render inspector controls for the Group block.
|
|
@@ -26,16 +28,17 @@ import { htmlElementMessages } from '../utils/messages';
|
|
|
26
28
|
* @param {Object} props Component props.
|
|
27
29
|
* @param {string} props.tagName The HTML tag name.
|
|
28
30
|
* @param {Function} props.onSelectTagName onChange function for the SelectControl.
|
|
31
|
+
* @param {string} props.clientId The client ID of the current block.
|
|
29
32
|
*
|
|
30
33
|
* @return {JSX.Element} The control group.
|
|
31
34
|
*/
|
|
32
|
-
function GroupEditControls( { tagName, onSelectTagName } ) {
|
|
35
|
+
function GroupEditControls( { tagName, onSelectTagName, clientId } ) {
|
|
33
36
|
return (
|
|
34
37
|
<InspectorControls group="advanced">
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
<HTMLElementControl
|
|
39
|
+
tagName={ tagName }
|
|
40
|
+
onChange={ onSelectTagName }
|
|
41
|
+
clientId={ clientId }
|
|
39
42
|
options={ [
|
|
40
43
|
{ label: __( 'Default (<div>)' ), value: 'div' },
|
|
41
44
|
{ label: '<header>', value: 'header' },
|
|
@@ -45,9 +48,6 @@ function GroupEditControls( { tagName, onSelectTagName } ) {
|
|
|
45
48
|
{ label: '<aside>', value: 'aside' },
|
|
46
49
|
{ label: '<footer>', value: 'footer' },
|
|
47
50
|
] }
|
|
48
|
-
value={ tagName }
|
|
49
|
-
onChange={ onSelectTagName }
|
|
50
|
-
help={ htmlElementMessages[ tagName ] }
|
|
51
51
|
/>
|
|
52
52
|
</InspectorControls>
|
|
53
53
|
);
|
|
@@ -129,6 +129,7 @@ function GroupEdit( { attributes, name, setAttributes, clientId } ) {
|
|
|
129
129
|
onSelectTagName={ ( value ) =>
|
|
130
130
|
setAttributes( { tagName: value } )
|
|
131
131
|
}
|
|
132
|
+
clientId={ clientId }
|
|
132
133
|
/>
|
|
133
134
|
{ showPlaceholder && (
|
|
134
135
|
<View>
|
package/src/html/block.json
CHANGED
package/src/html/editor.scss
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// The editing view for the HTML block is equivalent to block UI.
|
|
11
11
|
// Therefore we increase specificity to avoid theme styles bleeding in.
|
|
12
12
|
.block-editor-plain-text {
|
|
13
|
+
display: block;
|
|
13
14
|
box-sizing: border-box;
|
|
14
15
|
max-height: 250px;
|
|
15
16
|
@include editor-input-reset();
|
package/src/image/constants.js
CHANGED
package/src/image/edit.js
CHANGED
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
LINK_DESTINATION_MEDIA,
|
|
43
43
|
LINK_DESTINATION_NONE,
|
|
44
44
|
ALLOWED_MEDIA_TYPES,
|
|
45
|
+
DEFAULT_MEDIA_SIZE_SLUG,
|
|
45
46
|
} from './constants';
|
|
46
47
|
|
|
47
48
|
export const pickRelevantMediaFiles = ( image, size ) => {
|
|
@@ -239,7 +240,7 @@ export function ImageEdit( {
|
|
|
239
240
|
|
|
240
241
|
// Try to use the previous selected image size if its available
|
|
241
242
|
// otherwise try the default image size or fallback to "full"
|
|
242
|
-
let newSize =
|
|
243
|
+
let newSize = DEFAULT_MEDIA_SIZE_SLUG;
|
|
243
244
|
if ( sizeSlug && hasSize( media, sizeSlug ) ) {
|
|
244
245
|
newSize = sizeSlug;
|
|
245
246
|
} else if ( hasSize( media, imageDefaultSize ) ) {
|
|
@@ -262,10 +263,6 @@ export function ImageEdit( {
|
|
|
262
263
|
additionalAttributes = {
|
|
263
264
|
sizeSlug: newSize,
|
|
264
265
|
};
|
|
265
|
-
} else {
|
|
266
|
-
// Keep the same url when selecting the same file, so "Resolution"
|
|
267
|
-
// option is not changed.
|
|
268
|
-
additionalAttributes = { url };
|
|
269
266
|
}
|
|
270
267
|
|
|
271
268
|
// Check if default link setting should be used.
|
package/src/image/image.js
CHANGED
|
@@ -53,12 +53,13 @@ import { unlock } from '../lock-unlock';
|
|
|
53
53
|
import { createUpgradedEmbedBlock } from '../embed/util';
|
|
54
54
|
import { isExternalImage } from './edit';
|
|
55
55
|
import { Caption } from '../utils/caption';
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Module constants
|
|
59
|
-
*/
|
|
60
56
|
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
61
|
-
import {
|
|
57
|
+
import {
|
|
58
|
+
MIN_SIZE,
|
|
59
|
+
ALLOWED_MEDIA_TYPES,
|
|
60
|
+
SIZED_LAYOUTS,
|
|
61
|
+
DEFAULT_MEDIA_SIZE_SLUG,
|
|
62
|
+
} from './constants';
|
|
62
63
|
import { evalAspectRatio } from './utils';
|
|
63
64
|
|
|
64
65
|
const { DimensionsTool, ResolutionTool } = unlock( blockEditorPrivateApis );
|
|
@@ -836,6 +837,7 @@ export default function Image( {
|
|
|
836
837
|
{ !! imageSizeOptions.length && (
|
|
837
838
|
<ResolutionTool
|
|
838
839
|
value={ sizeSlug }
|
|
840
|
+
defaultValue={ DEFAULT_MEDIA_SIZE_SLUG }
|
|
839
841
|
onChange={ updateImage }
|
|
840
842
|
options={ imageSizeOptions }
|
|
841
843
|
/>
|
package/src/latest-posts/edit.js
CHANGED
|
@@ -60,6 +60,7 @@ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
|
60
60
|
*/
|
|
61
61
|
const CATEGORIES_LIST_QUERY = {
|
|
62
62
|
per_page: -1,
|
|
63
|
+
_fields: 'id,name',
|
|
63
64
|
context: 'view',
|
|
64
65
|
};
|
|
65
66
|
const USERS_LIST_QUERY = {
|
|
@@ -67,6 +68,28 @@ const USERS_LIST_QUERY = {
|
|
|
67
68
|
has_published_posts: [ 'post' ],
|
|
68
69
|
context: 'view',
|
|
69
70
|
};
|
|
71
|
+
const imageAlignmentOptions = [
|
|
72
|
+
{
|
|
73
|
+
value: 'none',
|
|
74
|
+
icon: alignNone,
|
|
75
|
+
label: __( 'None' ),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
value: 'left',
|
|
79
|
+
icon: positionLeft,
|
|
80
|
+
label: __( 'Left' ),
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: 'center',
|
|
84
|
+
icon: positionCenter,
|
|
85
|
+
label: __( 'Center' ),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
value: 'right',
|
|
89
|
+
icon: positionRight,
|
|
90
|
+
label: __( 'Right' ),
|
|
91
|
+
},
|
|
92
|
+
];
|
|
70
93
|
|
|
71
94
|
function getFeaturedImageDetails( post, size ) {
|
|
72
95
|
const image = post._embedded?.[ 'wp:featuredmedia' ]?.[ '0' ];
|
|
@@ -79,10 +102,11 @@ function getFeaturedImageDetails( post, size ) {
|
|
|
79
102
|
};
|
|
80
103
|
}
|
|
81
104
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
105
|
+
function getCurrentAuthor( post ) {
|
|
106
|
+
return post._embedded?.author?.[ 0 ];
|
|
107
|
+
}
|
|
85
108
|
|
|
109
|
+
function Controls( { attributes, setAttributes, postCount } ) {
|
|
86
110
|
const {
|
|
87
111
|
postsToShow,
|
|
88
112
|
order,
|
|
@@ -105,7 +129,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
105
129
|
} = attributes;
|
|
106
130
|
const {
|
|
107
131
|
imageSizes,
|
|
108
|
-
latestPosts,
|
|
109
132
|
defaultImageWidth,
|
|
110
133
|
defaultImageHeight,
|
|
111
134
|
categoriesList,
|
|
@@ -114,21 +137,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
114
137
|
( select ) => {
|
|
115
138
|
const { getEntityRecords, getUsers } = select( coreStore );
|
|
116
139
|
const settings = select( blockEditorStore ).getSettings();
|
|
117
|
-
const catIds =
|
|
118
|
-
categories && categories.length > 0
|
|
119
|
-
? categories.map( ( cat ) => cat.id )
|
|
120
|
-
: [];
|
|
121
|
-
const latestPostsQuery = Object.fromEntries(
|
|
122
|
-
Object.entries( {
|
|
123
|
-
categories: catIds,
|
|
124
|
-
author: selectedAuthor,
|
|
125
|
-
order,
|
|
126
|
-
orderby: orderBy,
|
|
127
|
-
per_page: postsToShow,
|
|
128
|
-
_embed: 'wp:featuredmedia',
|
|
129
|
-
ignore_sticky: true,
|
|
130
|
-
} ).filter( ( [ , value ] ) => typeof value !== 'undefined' )
|
|
131
|
-
);
|
|
132
140
|
|
|
133
141
|
return {
|
|
134
142
|
defaultImageWidth:
|
|
@@ -138,11 +146,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
138
146
|
settings.imageDimensions?.[ featuredImageSizeSlug ]
|
|
139
147
|
?.height ?? 0,
|
|
140
148
|
imageSizes: settings.imageSizes,
|
|
141
|
-
latestPosts: getEntityRecords(
|
|
142
|
-
'postType',
|
|
143
|
-
'post',
|
|
144
|
-
latestPostsQuery
|
|
145
|
-
),
|
|
146
149
|
categoriesList: getEntityRecords(
|
|
147
150
|
'taxonomy',
|
|
148
151
|
'category',
|
|
@@ -151,25 +154,10 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
151
154
|
authorList: getUsers( USERS_LIST_QUERY ),
|
|
152
155
|
};
|
|
153
156
|
},
|
|
154
|
-
[
|
|
155
|
-
featuredImageSizeSlug,
|
|
156
|
-
postsToShow,
|
|
157
|
-
order,
|
|
158
|
-
orderBy,
|
|
159
|
-
categories,
|
|
160
|
-
selectedAuthor,
|
|
161
|
-
]
|
|
157
|
+
[ featuredImageSizeSlug ]
|
|
162
158
|
);
|
|
163
159
|
|
|
164
|
-
|
|
165
|
-
const { createWarningNotice } = useDispatch( noticeStore );
|
|
166
|
-
const showRedirectionPreventedNotice = ( event ) => {
|
|
167
|
-
event.preventDefault();
|
|
168
|
-
createWarningNotice( __( 'Links are disabled in the editor.' ), {
|
|
169
|
-
id: `block-library/core/latest-posts/redirection-prevented/${ instanceId }`,
|
|
170
|
-
type: 'snackbar',
|
|
171
|
-
} );
|
|
172
|
-
};
|
|
160
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
173
161
|
|
|
174
162
|
const imageSizeOptions = imageSizes
|
|
175
163
|
.filter( ( { slug } ) => slug !== 'full' )
|
|
@@ -208,32 +196,8 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
208
196
|
setAttributes( { categories: allCategories } );
|
|
209
197
|
};
|
|
210
198
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
value: 'none',
|
|
214
|
-
icon: alignNone,
|
|
215
|
-
label: __( 'None' ),
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
value: 'left',
|
|
219
|
-
icon: positionLeft,
|
|
220
|
-
label: __( 'Left' ),
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
value: 'center',
|
|
224
|
-
icon: positionCenter,
|
|
225
|
-
label: __( 'Center' ),
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
value: 'right',
|
|
229
|
-
icon: positionRight,
|
|
230
|
-
label: __( 'Right' ),
|
|
231
|
-
},
|
|
232
|
-
];
|
|
233
|
-
|
|
234
|
-
const hasPosts = !! latestPosts?.length;
|
|
235
|
-
const inspectorControls = (
|
|
236
|
-
<InspectorControls>
|
|
199
|
+
return (
|
|
200
|
+
<>
|
|
237
201
|
<ToolsPanel
|
|
238
202
|
label={ __( 'Post content' ) }
|
|
239
203
|
resetAll={ () =>
|
|
@@ -247,7 +211,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
247
211
|
>
|
|
248
212
|
<ToolsPanelItem
|
|
249
213
|
hasValue={ () => !! displayPostContent }
|
|
250
|
-
label={ __( '
|
|
214
|
+
label={ __( 'Display post content' ) }
|
|
251
215
|
onDeselect={ () =>
|
|
252
216
|
setAttributes( { displayPostContent: false } )
|
|
253
217
|
}
|
|
@@ -255,7 +219,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
255
219
|
>
|
|
256
220
|
<ToggleControl
|
|
257
221
|
__nextHasNoMarginBottom
|
|
258
|
-
label={ __( '
|
|
222
|
+
label={ __( 'Display post content' ) }
|
|
259
223
|
checked={ displayPostContent }
|
|
260
224
|
onChange={ ( value ) =>
|
|
261
225
|
setAttributes( { displayPostContent: value } )
|
|
@@ -265,7 +229,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
265
229
|
{ displayPostContent && (
|
|
266
230
|
<ToolsPanelItem
|
|
267
231
|
hasValue={ () => displayPostContentRadio !== 'excerpt' }
|
|
268
|
-
label={ __( '
|
|
232
|
+
label={ __( 'Content length' ) }
|
|
269
233
|
onDeselect={ () =>
|
|
270
234
|
setAttributes( {
|
|
271
235
|
displayPostContentRadio: 'excerpt',
|
|
@@ -274,7 +238,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
274
238
|
isShownByDefault
|
|
275
239
|
>
|
|
276
240
|
<RadioControl
|
|
277
|
-
label={ __( '
|
|
241
|
+
label={ __( 'Content length' ) }
|
|
278
242
|
selected={ displayPostContentRadio }
|
|
279
243
|
options={ [
|
|
280
244
|
{ label: __( 'Excerpt' ), value: 'excerpt' },
|
|
@@ -319,7 +283,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
319
283
|
</ToolsPanelItem>
|
|
320
284
|
) }
|
|
321
285
|
</ToolsPanel>
|
|
322
|
-
|
|
323
286
|
<ToolsPanel
|
|
324
287
|
label={ __( 'Post meta' ) }
|
|
325
288
|
resetAll={ () =>
|
|
@@ -445,7 +408,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
445
408
|
</>
|
|
446
409
|
) }
|
|
447
410
|
</PanelBody>
|
|
448
|
-
|
|
449
411
|
<PanelBody title={ __( 'Sorting and filtering' ) }>
|
|
450
412
|
<QueryControls
|
|
451
413
|
{ ...{ order, orderBy } }
|
|
@@ -483,17 +445,89 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
483
445
|
}
|
|
484
446
|
min={ 2 }
|
|
485
447
|
max={
|
|
486
|
-
!
|
|
448
|
+
! postCount
|
|
487
449
|
? MAX_POSTS_COLUMNS
|
|
488
|
-
: Math.min(
|
|
489
|
-
MAX_POSTS_COLUMNS,
|
|
490
|
-
latestPosts.length
|
|
491
|
-
)
|
|
450
|
+
: Math.min( MAX_POSTS_COLUMNS, postCount )
|
|
492
451
|
}
|
|
493
452
|
required
|
|
494
453
|
/>
|
|
495
454
|
) }
|
|
496
455
|
</PanelBody>
|
|
456
|
+
</>
|
|
457
|
+
);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
461
|
+
const instanceId = useInstanceId( LatestPostsEdit );
|
|
462
|
+
|
|
463
|
+
const {
|
|
464
|
+
postsToShow,
|
|
465
|
+
order,
|
|
466
|
+
orderBy,
|
|
467
|
+
categories,
|
|
468
|
+
selectedAuthor,
|
|
469
|
+
displayFeaturedImage,
|
|
470
|
+
displayPostContentRadio,
|
|
471
|
+
displayPostContent,
|
|
472
|
+
displayPostDate,
|
|
473
|
+
displayAuthor,
|
|
474
|
+
postLayout,
|
|
475
|
+
columns,
|
|
476
|
+
excerptLength,
|
|
477
|
+
featuredImageAlign,
|
|
478
|
+
featuredImageSizeSlug,
|
|
479
|
+
featuredImageSizeWidth,
|
|
480
|
+
featuredImageSizeHeight,
|
|
481
|
+
addLinkToFeaturedImage,
|
|
482
|
+
} = attributes;
|
|
483
|
+
const { latestPosts } = useSelect(
|
|
484
|
+
( select ) => {
|
|
485
|
+
const { getEntityRecords } = select( coreStore );
|
|
486
|
+
const catIds =
|
|
487
|
+
categories && categories.length > 0
|
|
488
|
+
? categories.map( ( cat ) => cat.id )
|
|
489
|
+
: [];
|
|
490
|
+
const latestPostsQuery = Object.fromEntries(
|
|
491
|
+
Object.entries( {
|
|
492
|
+
categories: catIds,
|
|
493
|
+
author: selectedAuthor,
|
|
494
|
+
order,
|
|
495
|
+
orderby: orderBy,
|
|
496
|
+
per_page: postsToShow,
|
|
497
|
+
_embed: 'author,wp:featuredmedia',
|
|
498
|
+
ignore_sticky: true,
|
|
499
|
+
} ).filter( ( [ , value ] ) => typeof value !== 'undefined' )
|
|
500
|
+
);
|
|
501
|
+
|
|
502
|
+
return {
|
|
503
|
+
latestPosts: getEntityRecords(
|
|
504
|
+
'postType',
|
|
505
|
+
'post',
|
|
506
|
+
latestPostsQuery
|
|
507
|
+
),
|
|
508
|
+
};
|
|
509
|
+
},
|
|
510
|
+
[ postsToShow, order, orderBy, categories, selectedAuthor ]
|
|
511
|
+
);
|
|
512
|
+
|
|
513
|
+
// If a user clicks to a link prevent redirection and show a warning.
|
|
514
|
+
const { createWarningNotice } = useDispatch( noticeStore );
|
|
515
|
+
const showRedirectionPreventedNotice = ( event ) => {
|
|
516
|
+
event.preventDefault();
|
|
517
|
+
createWarningNotice( __( 'Links are disabled in the editor.' ), {
|
|
518
|
+
id: `block-library/core/latest-posts/redirection-prevented/${ instanceId }`,
|
|
519
|
+
type: 'snackbar',
|
|
520
|
+
} );
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
const hasPosts = !! latestPosts?.length;
|
|
524
|
+
const inspectorControls = (
|
|
525
|
+
<InspectorControls>
|
|
526
|
+
<Controls
|
|
527
|
+
attributes={ attributes }
|
|
528
|
+
setAttributes={ setAttributes }
|
|
529
|
+
postCount={ latestPosts?.length ?? 0 }
|
|
530
|
+
/>
|
|
497
531
|
</InspectorControls>
|
|
498
532
|
);
|
|
499
533
|
|
|
@@ -555,9 +589,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
555
589
|
{ displayPosts.map( ( post ) => {
|
|
556
590
|
const titleTrimmed = post.title.rendered.trim();
|
|
557
591
|
let excerpt = post.excerpt.rendered;
|
|
558
|
-
const currentAuthor =
|
|
559
|
-
( author ) => author.id === post.author
|
|
560
|
-
);
|
|
592
|
+
const currentAuthor = getCurrentAuthor( post );
|
|
561
593
|
|
|
562
594
|
const excerptElement = document.createElement( 'div' );
|
|
563
595
|
excerptElement.innerHTML = excerpt;
|
package/src/loginout/index.php
CHANGED
|
@@ -16,7 +16,11 @@
|
|
|
16
16
|
*/
|
|
17
17
|
function render_block_core_loginout( $attributes ) {
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
/*
|
|
20
|
+
* Build the redirect URL. This current url fetching logic matches with the core.
|
|
21
|
+
*
|
|
22
|
+
* @see https://github.com/WordPress/wordpress-develop/blob/6bf62e58d21739938f3bb3f9e16ba702baf9c2cc/src/wp-includes/general-template.php#L528.
|
|
23
|
+
*/
|
|
20
24
|
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
|
21
25
|
|
|
22
26
|
$classes = is_user_logged_in() ? 'logged-in' : 'logged-out';
|
package/src/more/block.json
CHANGED
package/src/navigation/index.php
CHANGED
|
@@ -133,7 +133,6 @@ class WP_Navigation_Block_Renderer {
|
|
|
133
133
|
* @since 6.5.0
|
|
134
134
|
*
|
|
135
135
|
* @param array $needs_list_item_wrapper The list of blocks that need a list item wrapper.
|
|
136
|
-
* @return array The list of blocks that need a list item wrapper.
|
|
137
136
|
*/
|
|
138
137
|
$needs_list_item_wrapper = apply_filters( 'block_core_navigation_listable_blocks', static::$needs_list_item_wrapper );
|
|
139
138
|
|
|
@@ -213,7 +213,7 @@ function render_block_core_navigation_link( $attributes, $content, $block ) {
|
|
|
213
213
|
$kind = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] );
|
|
214
214
|
$is_active = ! empty( $attributes['id'] ) && get_queried_object_id() === (int) $attributes['id'] && ! empty( get_queried_object()->$kind );
|
|
215
215
|
|
|
216
|
-
if ( is_post_type_archive() ) {
|
|
216
|
+
if ( is_post_type_archive() && ! empty( $attributes['url'] ) ) {
|
|
217
217
|
$queried_archive_link = get_post_type_archive_link( get_queried_object()->name );
|
|
218
218
|
if ( $attributes['url'] === $queried_archive_link ) {
|
|
219
219
|
$is_active = true;
|
|
@@ -86,7 +86,7 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|
|
86
86
|
$kind = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] );
|
|
87
87
|
$is_active = ! empty( $attributes['id'] ) && get_queried_object_id() === (int) $attributes['id'] && ! empty( get_queried_object()->$kind );
|
|
88
88
|
|
|
89
|
-
if ( is_post_type_archive() ) {
|
|
89
|
+
if ( is_post_type_archive() && ! empty( $attributes['url'] ) ) {
|
|
90
90
|
$queried_archive_link = get_post_type_archive_link( get_queried_object()->name );
|
|
91
91
|
if ( $attributes['url'] === $queried_archive_link ) {
|
|
92
92
|
$is_active = true;
|
|
@@ -26,7 +26,7 @@ function render_block_core_post_author( $attributes, $content, $block ) {
|
|
|
26
26
|
return '';
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
if ( ! post_type_supports( $block->context['postType'], 'author' ) ) {
|
|
29
|
+
if ( isset( $block->context['postType'] ) && ! post_type_supports( $block->context['postType'], 'author' ) ) {
|
|
30
30
|
return '';
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -26,7 +26,7 @@ function render_block_core_post_author_name( $attributes, $content, $block ) {
|
|
|
26
26
|
return '';
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
if ( ! post_type_supports( $block->context['postType'], 'author' ) ) {
|
|
29
|
+
if ( isset( $block->context['postType'] ) && ! post_type_supports( $block->context['postType'], 'author' ) ) {
|
|
30
30
|
return '';
|
|
31
31
|
}
|
|
32
32
|
|