@wordpress/block-library 6.0.17-next.33ec3857e2.0 → 6.0.20
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 +0 -4
- package/build/archives/index.js +0 -1
- package/build/archives/index.js.map +1 -1
- package/build/audio/index.js +0 -1
- package/build/audio/index.js.map +1 -1
- package/build/block/index.js +0 -1
- package/build/block/index.js.map +1 -1
- package/build/button/edit.native.js +1 -1
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +1 -5
- package/build/button/index.js.map +1 -1
- package/build/buttons/index.js +0 -1
- package/build/buttons/index.js.map +1 -1
- package/build/buttons/transforms.js +0 -1
- package/build/buttons/transforms.js.map +1 -1
- package/build/calendar/index.js +0 -1
- package/build/calendar/index.js.map +1 -1
- package/build/categories/index.js +0 -1
- package/build/categories/index.js.map +1 -1
- package/build/code/index.js +1 -6
- package/build/code/index.js.map +1 -1
- package/build/column/index.js +0 -1
- package/build/column/index.js.map +1 -1
- package/build/columns/index.js +1 -3
- package/build/columns/index.js.map +1 -1
- package/build/comment-author-avatar/edit.js +1 -2
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/comment-author-avatar/index.js +2 -7
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-author-name/index.js +0 -1
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +0 -1
- package/build/comment-content/index.js.map +1 -1
- package/build/comment-date/index.js +0 -1
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/index.js +1 -2
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +0 -1
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/edit.js +23 -98
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/index.js +2 -4
- package/build/comment-template/index.js.map +1 -1
- package/build/comments-query-loop/edit.js +2 -2
- package/build/comments-query-loop/edit.js.map +1 -1
- package/build/comments-query-loop/index.js +7 -4
- package/build/comments-query-loop/index.js.map +1 -1
- package/build/comments-query-loop/toolbar.js +3 -3
- package/build/comments-query-loop/toolbar.js.map +1 -1
- package/build/cover/edit.js +1 -2
- package/build/cover/edit.js.map +1 -1
- package/build/cover/index.js +0 -1
- package/build/cover/index.js.map +1 -1
- package/build/embed/deprecated.js +0 -1
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/edit.native.js +20 -23
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/embed-bottom-sheet.native.js +85 -0
- package/build/embed/embed-bottom-sheet.native.js.map +1 -0
- package/build/embed/embed-placeholder.native.js +2 -9
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/index.js +0 -1
- package/build/embed/index.js.map +1 -1
- package/build/embed/transforms.js +0 -1
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +0 -1
- package/build/embed/util.js.map +1 -1
- package/build/file/index.js +0 -1
- package/build/file/index.js.map +1 -1
- package/build/freeform/index.js +0 -1
- package/build/freeform/index.js.map +1 -1
- package/build/gallery/deprecated.js +1 -5
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +1 -12
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/index.js +0 -1
- package/build/gallery/index.js.map +1 -1
- package/build/group/edit.native.js +1 -1
- package/build/group/edit.native.js.map +1 -1
- package/build/group/index.js +4 -9
- package/build/group/index.js.map +1 -1
- package/build/heading/index.js +0 -1
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +0 -1
- package/build/heading/transforms.js.map +1 -1
- package/build/home-link/index.js +0 -1
- package/build/home-link/index.js.map +1 -1
- package/build/html/index.js +0 -1
- package/build/html/index.js.map +1 -1
- package/build/image/edit.js +5 -56
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +4 -15
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +1 -5
- package/build/image/index.js.map +1 -1
- package/build/index.js +1 -5
- package/build/index.js.map +1 -1
- package/build/latest-comments/index.js +0 -1
- package/build/latest-comments/index.js.map +1 -1
- package/build/latest-posts/deprecated.js +0 -1
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/index.js +0 -1
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/index.js +0 -1
- package/build/list/index.js.map +1 -1
- package/build/loginout/index.js +0 -1
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/index.js +0 -1
- package/build/media-text/index.js.map +1 -1
- package/build/missing/index.js +0 -1
- package/build/missing/index.js.map +1 -1
- package/build/more/index.js +0 -1
- package/build/more/index.js.map +1 -1
- package/build/navigation/deprecated.js +1 -3
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +106 -59
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +3 -2
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +15 -7
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +9 -7
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +3 -11
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-navigation-notice.js +54 -0
- package/build/navigation/edit/use-navigation-notice.js.map +1 -0
- package/build/navigation/index.js +2 -9
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/menu-items-to-blocks.js +1 -4
- package/build/navigation/menu-items-to-blocks.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +9 -2
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/view.js +12 -7
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-area/edit.js +1 -2
- package/build/navigation-area/edit.js.map +1 -1
- package/build/navigation-area/index.js +1 -2
- package/build/navigation-area/index.js.map +1 -1
- package/build/navigation-link/edit.js +0 -7
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +0 -1
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-submenu/edit.js +0 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +0 -1
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/nextpage/index.js +0 -1
- package/build/nextpage/index.js.map +1 -1
- package/build/page-list/index.js +1 -6
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.js +2 -12
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/index.js +0 -1
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +0 -1
- package/build/paragraph/transforms.js.map +1 -1
- package/build/pattern/index.js +0 -1
- package/build/pattern/index.js.map +1 -1
- package/build/post-author/edit.js +1 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +0 -1
- package/build/post-author/index.js.map +1 -1
- package/build/post-comment/index.js +0 -1
- package/build/post-comment/index.js.map +1 -1
- package/build/post-comments/index.js +0 -1
- package/build/post-comments/index.js.map +1 -1
- package/build/post-comments-count/index.js +0 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/index.js +0 -1
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +0 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +1 -1
- package/build/post-content/edit.js.map +1 -1
- package/build/post-content/index.js +0 -1
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +1 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +0 -1
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +0 -1
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +30 -50
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +4 -8
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +0 -1
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/index.js +0 -1
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-template/index.js +0 -1
- package/build/post-template/index.js.map +1 -1
- package/build/post-terms/index.js +0 -1
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/edit.js +1 -1
- package/build/post-title/edit.js.map +1 -1
- package/build/post-title/index.js +0 -1
- package/build/post-title/index.js.map +1 -1
- package/build/preformatted/edit.native.js +1 -2
- package/build/preformatted/edit.native.js.map +1 -1
- package/build/preformatted/index.js +0 -1
- package/build/preformatted/index.js.map +1 -1
- package/build/pullquote/index.js +1 -8
- package/build/pullquote/index.js.map +1 -1
- package/build/query/index.js +0 -1
- package/build/query/index.js.map +1 -1
- package/build/query-pagination/index.js +0 -1
- package/build/query-pagination/index.js.map +1 -1
- package/build/query-pagination-next/index.js +0 -1
- package/build/query-pagination-next/index.js.map +1 -1
- package/build/query-pagination-numbers/index.js +0 -1
- package/build/query-pagination-numbers/index.js.map +1 -1
- package/build/query-pagination-previous/index.js +0 -1
- package/build/query-pagination-previous/index.js.map +1 -1
- package/build/query-title/index.js +0 -1
- package/build/query-title/index.js.map +1 -1
- package/build/quote/index.js +0 -1
- package/build/quote/index.js.map +1 -1
- package/build/rss/index.js +0 -1
- package/build/rss/index.js.map +1 -1
- package/build/search/edit.js +3 -5
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +1 -8
- package/build/search/index.js.map +1 -1
- package/build/separator/index.js +0 -1
- package/build/separator/index.js.map +1 -1
- package/build/shortcode/index.js +0 -1
- package/build/shortcode/index.js.map +1 -1
- package/build/site-logo/edit.js +119 -18
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +5 -5
- package/build/site-tagline/index.js +1 -2
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/index.js +0 -1
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/index.js +1 -2
- package/build/social-link/index.js.map +1 -1
- package/build/social-links/index.js +1 -2
- package/build/social-links/index.js.map +1 -1
- package/build/spacer/index.js +0 -1
- package/build/spacer/index.js.map +1 -1
- package/build/table/index.js +1 -7
- package/build/table/index.js.map +1 -1
- package/build/table-of-contents/index.js +0 -1
- package/build/table-of-contents/index.js.map +1 -1
- package/build/tag-cloud/index.js +0 -1
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/index.js +0 -1
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/index.js +0 -1
- package/build/term-description/index.js.map +1 -1
- package/build/text-columns/index.js +0 -1
- package/build/text-columns/index.js.map +1 -1
- package/build/verse/index.js +0 -1
- package/build/verse/index.js.map +1 -1
- package/build/video/index.js +0 -1
- package/build/video/index.js.map +1 -1
- package/build-module/archives/index.js +0 -1
- package/build-module/archives/index.js.map +1 -1
- package/build-module/audio/index.js +0 -1
- package/build-module/audio/index.js.map +1 -1
- package/build-module/block/index.js +0 -1
- package/build-module/block/index.js.map +1 -1
- package/build-module/button/edit.native.js +1 -1
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +1 -5
- package/build-module/button/index.js.map +1 -1
- package/build-module/buttons/index.js +0 -1
- package/build-module/buttons/index.js.map +1 -1
- package/build-module/buttons/transforms.js +0 -1
- package/build-module/buttons/transforms.js.map +1 -1
- package/build-module/calendar/index.js +0 -1
- package/build-module/calendar/index.js.map +1 -1
- package/build-module/categories/index.js +0 -1
- package/build-module/categories/index.js.map +1 -1
- package/build-module/code/index.js +1 -6
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/index.js +0 -1
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/index.js +1 -3
- package/build-module/columns/index.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +2 -3
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +2 -7
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-author-name/index.js +0 -1
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +0 -1
- package/build-module/comment-content/index.js.map +1 -1
- package/build-module/comment-date/index.js +0 -1
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/index.js +1 -2
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +0 -1
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/edit.js +23 -97
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/index.js +2 -4
- package/build-module/comment-template/index.js.map +1 -1
- package/build-module/comments-query-loop/edit.js +2 -2
- package/build-module/comments-query-loop/edit.js.map +1 -1
- package/build-module/comments-query-loop/index.js +7 -4
- package/build-module/comments-query-loop/index.js.map +1 -1
- package/build-module/comments-query-loop/toolbar.js +3 -3
- package/build-module/comments-query-loop/toolbar.js.map +1 -1
- package/build-module/cover/edit.js +1 -2
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/cover/index.js +0 -1
- package/build-module/cover/index.js.map +1 -1
- package/build-module/embed/deprecated.js +0 -1
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/edit.native.js +21 -24
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-bottom-sheet.native.js +74 -0
- package/build-module/embed/embed-bottom-sheet.native.js.map +1 -0
- package/build-module/embed/embed-placeholder.native.js +2 -9
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/index.js +0 -1
- package/build-module/embed/index.js.map +1 -1
- package/build-module/embed/transforms.js +0 -1
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +0 -1
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/index.js +0 -1
- package/build-module/file/index.js.map +1 -1
- package/build-module/freeform/index.js +0 -1
- package/build-module/freeform/index.js.map +1 -1
- package/build-module/gallery/deprecated.js +2 -6
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +1 -11
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/index.js +0 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/group/edit.native.js +1 -1
- package/build-module/group/edit.native.js.map +1 -1
- package/build-module/group/index.js +4 -9
- package/build-module/group/index.js.map +1 -1
- package/build-module/heading/index.js +0 -1
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +0 -1
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/home-link/index.js +0 -1
- package/build-module/home-link/index.js.map +1 -1
- package/build-module/html/index.js +0 -1
- package/build-module/html/index.js.map +1 -1
- package/build-module/image/edit.js +4 -52
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +5 -16
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +1 -5
- package/build-module/image/index.js.map +1 -1
- package/build-module/index.js +1 -3
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/index.js +0 -1
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +0 -1
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/index.js +0 -1
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/index.js +0 -1
- package/build-module/list/index.js.map +1 -1
- package/build-module/loginout/index.js +0 -1
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/index.js +0 -1
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/missing/index.js +0 -1
- package/build-module/missing/index.js.map +1 -1
- package/build-module/more/index.js +0 -1
- package/build-module/more/index.js.map +1 -1
- package/build-module/navigation/deprecated.js +1 -3
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +104 -59
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +3 -2
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +15 -7
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +9 -7
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +4 -13
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-navigation-notice.js +44 -0
- package/build-module/navigation/edit/use-navigation-notice.js.map +1 -0
- package/build-module/navigation/index.js +2 -9
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/menu-items-to-blocks.js +1 -4
- package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +9 -2
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/view.js +12 -7
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-area/edit.js +1 -2
- package/build-module/navigation-area/edit.js.map +1 -1
- package/build-module/navigation-area/index.js +1 -2
- package/build-module/navigation-area/index.js.map +1 -1
- package/build-module/navigation-link/edit.js +0 -7
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +0 -1
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +0 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +0 -1
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/nextpage/index.js +0 -1
- package/build-module/nextpage/index.js.map +1 -1
- package/build-module/page-list/index.js +1 -6
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.js +3 -13
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/index.js +0 -1
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +0 -1
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/pattern/index.js +0 -1
- package/build-module/pattern/index.js.map +1 -1
- package/build-module/post-author/edit.js +1 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +0 -1
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-comment/index.js +0 -1
- package/build-module/post-comment/index.js.map +1 -1
- package/build-module/post-comments/index.js +0 -1
- package/build-module/post-comments/index.js.map +1 -1
- package/build-module/post-comments-count/index.js +0 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/index.js +0 -1
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +0 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js +1 -1
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-content/index.js +0 -1
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +1 -1
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +0 -1
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -1
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +0 -1
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +29 -52
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +5 -9
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +0 -1
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/index.js +0 -1
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-template/index.js +0 -1
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-terms/index.js +0 -1
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/edit.js +1 -1
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/post-title/index.js +0 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/preformatted/edit.native.js +1 -2
- package/build-module/preformatted/edit.native.js.map +1 -1
- package/build-module/preformatted/index.js +0 -1
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/pullquote/index.js +1 -8
- package/build-module/pullquote/index.js.map +1 -1
- package/build-module/query/index.js +0 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query-pagination/index.js +0 -1
- package/build-module/query-pagination/index.js.map +1 -1
- package/build-module/query-pagination-next/index.js +0 -1
- package/build-module/query-pagination-next/index.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +0 -1
- package/build-module/query-pagination-numbers/index.js.map +1 -1
- package/build-module/query-pagination-previous/index.js +0 -1
- package/build-module/query-pagination-previous/index.js.map +1 -1
- package/build-module/query-title/index.js +0 -1
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/quote/index.js +0 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/rss/index.js +0 -1
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/edit.js +3 -5
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +1 -8
- package/build-module/search/index.js.map +1 -1
- package/build-module/separator/index.js +0 -1
- package/build-module/separator/index.js.map +1 -1
- package/build-module/shortcode/index.js +0 -1
- package/build-module/shortcode/index.js.map +1 -1
- package/build-module/site-logo/edit.js +120 -19
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +5 -5
- package/build-module/site-tagline/index.js +1 -2
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/index.js +0 -1
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/index.js +1 -2
- package/build-module/social-link/index.js.map +1 -1
- package/build-module/social-links/index.js +1 -2
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/spacer/index.js +0 -1
- package/build-module/spacer/index.js.map +1 -1
- package/build-module/table/index.js +1 -7
- package/build-module/table/index.js.map +1 -1
- package/build-module/table-of-contents/index.js +0 -1
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/tag-cloud/index.js +0 -1
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/index.js +0 -1
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/index.js +0 -1
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/text-columns/index.js +0 -1
- package/build-module/text-columns/index.js.map +1 -1
- package/build-module/verse/index.js +0 -1
- package/build-module/verse/index.js.map +1 -1
- package/build-module/video/index.js +0 -1
- package/build-module/video/index.js.map +1 -1
- package/build-style/columns/style-rtl.css +3 -4
- package/build-style/columns/style.css +3 -4
- package/build-style/common-rtl.css +2 -21
- package/build-style/common.css +2 -21
- package/build-style/cover/style-rtl.css +0 -4
- package/build-style/cover/style.css +0 -4
- package/build-style/editor-rtl.css +46 -56
- package/build-style/editor.css +46 -59
- package/build-style/gallery/editor-rtl.css +12 -0
- package/build-style/gallery/editor.css +12 -0
- package/build-style/gallery/style-rtl.css +0 -3
- package/build-style/gallery/style.css +0 -3
- package/build-style/group/theme-rtl.css +1 -1
- package/build-style/group/theme.css +1 -1
- package/build-style/{comments-pagination → home-link}/style-rtl.css +21 -21
- package/build-style/{comments-pagination/editor.css → home-link/style.css} +22 -20
- package/build-style/navigation/editor-rtl.css +15 -6
- package/build-style/navigation/editor.css +15 -6
- package/build-style/navigation/style-rtl.css +45 -18
- package/build-style/navigation/style.css +45 -18
- package/build-style/page-list/style-rtl.css +4 -4
- package/build-style/page-list/style.css +4 -4
- package/build-style/post-comments/style-rtl.css +0 -1
- package/build-style/post-comments/style.css +0 -1
- package/build-style/post-featured-image/editor-rtl.css +7 -0
- package/build-style/post-featured-image/editor.css +7 -0
- package/build-style/post-featured-image/style-rtl.css +1 -1
- package/build-style/post-featured-image/style.css +1 -1
- package/build-style/post-template/style-rtl.css +2 -29
- package/build-style/post-template/style.css +2 -29
- package/build-style/post-title/style-rtl.css +0 -3
- package/build-style/post-title/style.css +0 -3
- package/build-style/pullquote/style-rtl.css +0 -1
- package/build-style/pullquote/style.css +0 -1
- package/build-style/query-pagination/editor-rtl.css +4 -0
- package/build-style/query-pagination/editor.css +4 -0
- package/build-style/query-pagination/style-rtl.css +2 -6
- package/build-style/query-pagination/style.css +2 -6
- package/build-style/site-logo/editor-rtl.css +1 -11
- package/build-style/site-logo/editor.css +1 -11
- package/build-style/site-logo/style-rtl.css +3 -1
- package/build-style/site-logo/style.css +3 -1
- package/build-style/style-rtl.css +107 -158
- package/build-style/style.css +107 -160
- package/build-style/table/style-rtl.css +0 -1
- package/build-style/table/style.css +0 -1
- package/build-style/theme-rtl.css +1 -1
- package/build-style/theme.css +1 -1
- package/package.json +30 -31
- package/src/archives/block.json +0 -1
- package/src/audio/block.json +0 -1
- package/src/block/block.json +0 -1
- package/src/button/block.json +1 -5
- package/src/button/edit.native.js +1 -1
- package/src/buttons/block.json +1 -2
- package/src/calendar/block.json +0 -1
- package/src/calendar/index.php +39 -35
- package/src/categories/block.json +0 -1
- package/src/code/block.json +1 -6
- package/src/column/block.json +0 -1
- package/src/columns/block.json +1 -3
- package/src/columns/style.scss +5 -8
- package/src/comment-author-avatar/block.json +2 -7
- package/src/comment-author-avatar/edit.js +2 -7
- package/src/comment-author-avatar/index.php +6 -25
- package/src/comment-author-name/block.json +0 -1
- package/src/comment-content/block.json +0 -1
- package/src/comment-date/block.json +0 -1
- package/src/comment-edit-link/block.json +0 -1
- package/src/comment-edit-link/index.js +1 -1
- package/src/comment-reply-link/block.json +0 -1
- package/src/comment-template/block.json +2 -4
- package/src/comment-template/edit.js +37 -111
- package/src/comment-template/index.php +19 -46
- package/src/comments-query-loop/block.json +7 -4
- package/src/comments-query-loop/edit.js +5 -2
- package/src/comments-query-loop/toolbar.js +3 -3
- package/src/common.scss +2 -21
- package/src/cover/block.json +0 -1
- package/src/cover/edit.js +0 -1
- package/src/cover/style.scss +0 -4
- package/src/editor.scss +7 -6
- package/src/embed/block.json +0 -1
- package/src/embed/edit.native.js +18 -23
- package/src/embed/embed-bottom-sheet.native.js +78 -0
- package/src/embed/embed-placeholder.native.js +0 -8
- package/src/embed/test/__snapshots__/index.native.js.snap +0 -10
- package/src/embed/test/index.native.js +88 -228
- package/src/file/block.json +0 -1
- package/src/freeform/block.json +0 -1
- package/src/gallery/block.json +0 -1
- package/src/gallery/deprecated.js +2 -5
- package/src/gallery/edit.js +0 -20
- package/src/gallery/editor.scss +14 -0
- package/src/gallery/index.php +1 -1
- package/src/gallery/style.scss +0 -4
- package/src/group/block.json +4 -9
- package/src/group/edit.native.js +1 -1
- package/src/group/theme.scss +5 -4
- package/src/heading/block.json +0 -1
- package/src/home-link/block.json +0 -1
- package/src/home-link/index.php +3 -3
- package/src/home-link/style.scss +51 -0
- package/src/html/block.json +0 -1
- package/src/image/block.json +1 -5
- package/src/image/edit.js +0 -44
- package/src/image/edit.native.js +1 -1
- package/src/image/image.js +3 -14
- package/src/index.js +0 -4
- package/src/latest-comments/block.json +0 -1
- package/src/latest-posts/block.json +0 -1
- package/src/list/block.json +0 -1
- package/src/loginout/block.json +0 -1
- package/src/media-text/block.json +0 -1
- package/src/missing/block.json +0 -1
- package/src/more/block.json +0 -1
- package/src/navigation/block.json +11 -11
- package/src/navigation/deprecated.js +0 -2
- package/src/navigation/edit/index.js +172 -89
- package/src/navigation/edit/navigation-menu-selector.js +19 -13
- package/src/navigation/edit/placeholder/index.js +40 -24
- package/src/navigation/edit/responsive-wrapper.js +10 -7
- package/src/navigation/edit/unsaved-inner-blocks.js +13 -25
- package/src/navigation/edit/use-navigation-notice.js +37 -0
- package/src/navigation/editor.scss +20 -8
- package/src/navigation/index.php +23 -12
- package/src/navigation/menu-items-to-blocks.js +1 -2
- package/src/navigation/style.scss +58 -19
- package/src/navigation/use-navigation-menu.js +20 -0
- package/src/navigation/view.js +13 -7
- package/src/navigation-area/block.json +7 -3
- package/src/navigation-area/edit.js +1 -2
- package/src/navigation-link/block.json +3 -2
- package/src/navigation-link/edit.js +0 -5
- package/src/navigation-link/index.php +3 -3
- package/src/navigation-submenu/block.json +3 -2
- package/src/navigation-submenu/index.php +5 -5
- package/src/nextpage/block.json +0 -1
- package/src/page-list/block.json +0 -4
- package/src/page-list/index.php +4 -4
- package/src/page-list/style.scss +4 -4
- package/src/paragraph/block.json +0 -1
- package/src/paragraph/edit.js +4 -12
- package/src/pattern/block.json +0 -1
- package/src/post-author/block.json +0 -1
- package/src/post-author/edit.js +1 -1
- package/src/post-comment/block.json +0 -1
- package/src/post-comments/block.json +0 -1
- package/src/post-comments/style.scss +0 -1
- package/src/post-comments-count/block.json +0 -1
- package/src/post-comments-form/block.json +1 -6
- package/src/post-comments-link/block.json +0 -1
- package/src/post-content/block.json +0 -1
- package/src/post-content/edit.js +1 -1
- package/src/post-content/index.php +11 -1
- package/src/post-date/block.json +0 -1
- package/src/post-date/edit.js +1 -1
- package/src/post-excerpt/block.json +0 -1
- package/src/post-excerpt/edit.js +1 -1
- package/src/post-excerpt/index.php +1 -1
- package/src/post-featured-image/block.json +0 -1
- package/src/post-featured-image/dimension-controls.js +50 -75
- package/src/post-featured-image/edit.js +6 -13
- package/src/post-featured-image/editor.scss +8 -0
- package/src/post-featured-image/style.scss +1 -1
- package/src/post-navigation-link/block.json +0 -1
- package/src/post-template/block.json +0 -1
- package/src/post-template/style.scss +2 -13
- package/src/post-terms/block.json +0 -1
- package/src/post-title/block.json +0 -1
- package/src/post-title/edit.js +1 -1
- package/src/post-title/index.php +1 -1
- package/src/post-title/style.scss +2 -6
- package/src/preformatted/block.json +0 -1
- package/src/preformatted/edit.native.js +1 -3
- package/src/pullquote/block.json +1 -8
- package/src/pullquote/style.scss +0 -1
- package/src/query/block.json +0 -1
- package/src/query-pagination/block.json +0 -1
- package/src/query-pagination/editor.scss +4 -0
- package/src/query-pagination/style.scss +2 -12
- package/src/query-pagination-next/block.json +0 -1
- package/src/query-pagination-next/index.php +20 -42
- package/src/query-pagination-numbers/block.json +0 -1
- package/src/query-pagination-previous/block.json +0 -1
- package/src/query-pagination-previous/index.php +13 -45
- package/src/query-title/block.json +0 -1
- package/src/quote/block.json +0 -1
- package/src/rss/block.json +0 -1
- package/src/search/block.json +1 -8
- package/src/search/edit.js +1 -2
- package/src/search/index.php +19 -29
- package/src/separator/block.json +0 -1
- package/src/shortcode/block.json +0 -1
- package/src/site-logo/block.json +5 -5
- package/src/site-logo/edit.js +133 -14
- package/src/site-logo/editor.scss +1 -15
- package/src/site-logo/index.php +17 -4
- package/src/site-logo/style.scss +3 -1
- package/src/site-tagline/block.json +1 -2
- package/src/site-title/block.json +0 -1
- package/src/social-link/block.json +1 -2
- package/src/social-links/block.json +8 -3
- package/src/spacer/block.json +0 -1
- package/src/style.scss +2 -3
- package/src/table/block.json +1 -7
- package/src/table/style.scss +0 -1
- package/src/table-of-contents/block.json +0 -1
- package/src/tag-cloud/block.json +0 -1
- package/src/template-part/block.json +0 -1
- package/src/term-description/block.json +0 -1
- package/src/text-columns/block.json +0 -1
- package/src/verse/block.json +0 -1
- package/src/video/block.json +0 -1
- package/build/comment-template/util.js +0 -66
- package/build/comment-template/util.js.map +0 -1
- package/build/comments-pagination/comments-pagination-arrow-controls.js +0 -39
- package/build/comments-pagination/comments-pagination-arrow-controls.js.map +0 -1
- package/build/comments-pagination/edit.js +0 -80
- package/build/comments-pagination/edit.js.map +0 -1
- package/build/comments-pagination/index.js +0 -71
- package/build/comments-pagination/index.js.map +0 -1
- package/build/comments-pagination/save.js +0 -18
- package/build/comments-pagination/save.js.map +0 -1
- package/build/comments-pagination-numbers/edit.js +0 -47
- package/build/comments-pagination-numbers/edit.js.map +0 -1
- package/build/comments-pagination-numbers/index.js +0 -47
- package/build/comments-pagination-numbers/index.js.map +0 -1
- package/build/embed/embed-controls.native.js +0 -69
- package/build/embed/embed-controls.native.js.map +0 -1
- package/build/embed/embed-link-settings.native.js +0 -101
- package/build/embed/embed-link-settings.native.js.map +0 -1
- package/build/gallery/use-mobile-warning.js +0 -43
- package/build/gallery/use-mobile-warning.js.map +0 -1
- package/build-module/comment-template/util.js +0 -57
- package/build-module/comment-template/util.js.map +0 -1
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js +0 -30
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +0 -1
- package/build-module/comments-pagination/edit.js +0 -67
- package/build-module/comments-pagination/edit.js.map +0 -1
- package/build-module/comments-pagination/index.js +0 -57
- package/build-module/comments-pagination/index.js.map +0 -1
- package/build-module/comments-pagination/save.js +0 -10
- package/build-module/comments-pagination/save.js.map +0 -1
- package/build-module/comments-pagination-numbers/edit.js +0 -40
- package/build-module/comments-pagination-numbers/edit.js.map +0 -1
- package/build-module/comments-pagination-numbers/index.js +0 -34
- package/build-module/comments-pagination-numbers/index.js.map +0 -1
- package/build-module/embed/embed-controls.native.js +0 -54
- package/build-module/embed/embed-controls.native.js.map +0 -1
- package/build-module/embed/embed-link-settings.native.js +0 -90
- package/build-module/embed/embed-link-settings.native.js.map +0 -1
- package/build-module/gallery/use-mobile-warning.js +0 -32
- package/build-module/gallery/use-mobile-warning.js.map +0 -1
- package/build-style/comment-template/style-rtl.css +0 -91
- package/build-style/comment-template/style.css +0 -91
- package/build-style/comments-pagination/editor-rtl.css +0 -100
- package/build-style/comments-pagination/style.css +0 -106
- package/build-style/comments-pagination-numbers/editor-rtl.css +0 -85
- package/build-style/comments-pagination-numbers/editor.css +0 -86
- package/src/comment-template/style.scss +0 -17
- package/src/comment-template/test/index.js +0 -45
- package/src/comment-template/util.js +0 -56
- package/src/comments-pagination/block.json +0 -37
- package/src/comments-pagination/comments-pagination-arrow-controls.js +0 -44
- package/src/comments-pagination/edit.js +0 -78
- package/src/comments-pagination/editor.scss +0 -34
- package/src/comments-pagination/index.js +0 -20
- package/src/comments-pagination/index.php +0 -39
- package/src/comments-pagination/save.js +0 -8
- package/src/comments-pagination/style.scss +0 -38
- package/src/comments-pagination-numbers/block.json +0 -16
- package/src/comments-pagination-numbers/edit.js +0 -22
- package/src/comments-pagination-numbers/editor.scss +0 -12
- package/src/comments-pagination-numbers/index.js +0 -18
- package/src/comments-pagination-numbers/index.php +0 -69
- package/src/embed/embed-controls.native.js +0 -65
- package/src/embed/embed-link-settings.native.js +0 -100
- package/src/gallery/test/use-get-new-images.js +0 -93
- package/src/gallery/use-mobile-warning.js +0 -28
- package/src/navigation/README.md +0 -13
|
@@ -17,63 +17,31 @@
|
|
|
17
17
|
function render_block_core_query_pagination_previous( $attributes, $content, $block ) {
|
|
18
18
|
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
|
|
19
19
|
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
|
|
20
|
-
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
|
|
21
|
-
$max_page = isset( $block->context['query']['pages'] ) ? (int) $block->context['query']['pages'] : 0;
|
|
22
|
-
|
|
23
|
-
$wrapper_attributes = get_block_wrapper_attributes();
|
|
24
|
-
$hidden_wrapper_attributes = get_block_wrapper_attributes( array( 'aria-hidden' => 'true' ) );
|
|
25
|
-
$default_label = __( 'Previous Page' );
|
|
26
|
-
$label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label;
|
|
27
|
-
$pagination_arrow = get_query_pagination_arrow( $block, false );
|
|
28
|
-
$content = '';
|
|
29
20
|
|
|
21
|
+
$wrapper_attributes = get_block_wrapper_attributes();
|
|
22
|
+
$default_label = __( 'Previous Page' );
|
|
23
|
+
$label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label;
|
|
24
|
+
$pagination_arrow = get_query_pagination_arrow( $block, false );
|
|
30
25
|
if ( $pagination_arrow ) {
|
|
31
26
|
$label = $pagination_arrow . $label;
|
|
32
27
|
}
|
|
28
|
+
$content = '';
|
|
33
29
|
// Check if the pagination is for Query that inherits the global context
|
|
34
30
|
// and handle appropriately.
|
|
35
31
|
if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) {
|
|
36
|
-
global $wp_query;
|
|
37
|
-
$max_page = ! $max_page || $max_page > $wp_query->max_num_pages ? $wp_query->max_num_pages : $max_page;
|
|
38
32
|
$filter_link_attributes = function() use ( $wrapper_attributes ) {
|
|
39
33
|
return $wrapper_attributes;
|
|
40
34
|
};
|
|
41
|
-
|
|
42
35
|
add_filter( 'previous_posts_link_attributes', $filter_link_attributes );
|
|
43
|
-
|
|
44
|
-
// If there are pages to paginate...
|
|
45
|
-
if ( 1 < $max_page ) {
|
|
46
|
-
if ( 1 !== $paged ) { // ... and we are NOT in the first one.
|
|
47
|
-
$content = get_previous_posts_link( $label );
|
|
48
|
-
} else { // ... and we are in the first one.
|
|
49
|
-
$content = sprintf(
|
|
50
|
-
'<span %1$s>%2$s</span>',
|
|
51
|
-
$hidden_wrapper_attributes,
|
|
52
|
-
$label
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
36
|
+
$content = get_previous_posts_link( $label );
|
|
56
37
|
remove_filter( 'previous_posts_link_attributes', $filter_link_attributes );
|
|
57
|
-
} elseif (
|
|
58
|
-
$
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
'<a href="%1$s" %2$s>%3$s</a>',
|
|
65
|
-
esc_url( add_query_arg( $page_key, $page - 1 ) ),
|
|
66
|
-
$wrapper_attributes,
|
|
67
|
-
$label
|
|
68
|
-
);
|
|
69
|
-
} else { // ... and we are in the first one.
|
|
70
|
-
$content = sprintf(
|
|
71
|
-
'<span %1$s>%2$s</span>',
|
|
72
|
-
$hidden_wrapper_attributes,
|
|
73
|
-
$label
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
38
|
+
} elseif ( 1 !== $page ) {
|
|
39
|
+
$content = sprintf(
|
|
40
|
+
'<a href="%1$s" %2$s>%3$s</a>',
|
|
41
|
+
esc_url( add_query_arg( $page_key, $page - 1 ) ),
|
|
42
|
+
$wrapper_attributes,
|
|
43
|
+
$label
|
|
44
|
+
);
|
|
77
45
|
}
|
|
78
46
|
return $content;
|
|
79
47
|
}
|
package/src/quote/block.json
CHANGED
package/src/rss/block.json
CHANGED
package/src/search/block.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
3
2
|
"apiVersion": 2,
|
|
4
3
|
"name": "core/search",
|
|
5
4
|
"title": "Search",
|
|
@@ -49,13 +48,7 @@
|
|
|
49
48
|
"__experimentalBorder": {
|
|
50
49
|
"color": true,
|
|
51
50
|
"radius": true,
|
|
52
|
-
"
|
|
53
|
-
"__experimentalSkipSerialization": true,
|
|
54
|
-
"__experimentalDefaultControls": {
|
|
55
|
-
"color": true,
|
|
56
|
-
"radius": true,
|
|
57
|
-
"width": true
|
|
58
|
-
}
|
|
51
|
+
"__experimentalSkipSerialization": true
|
|
59
52
|
},
|
|
60
53
|
"html": false
|
|
61
54
|
},
|
package/src/search/edit.js
CHANGED
|
@@ -103,7 +103,6 @@ export default function SearchEdit( {
|
|
|
103
103
|
}, [ insertedInNavigationBlock ] );
|
|
104
104
|
const borderRadius = style?.border?.radius;
|
|
105
105
|
const borderColor = style?.border?.color;
|
|
106
|
-
const borderWidth = style?.border?.width;
|
|
107
106
|
const borderProps = useBorderProps( attributes );
|
|
108
107
|
|
|
109
108
|
// Check for old deprecated numerical border radius. Done as a separate
|
|
@@ -129,6 +128,7 @@ export default function SearchEdit( {
|
|
|
129
128
|
const getBlockClassNames = () => {
|
|
130
129
|
return classnames(
|
|
131
130
|
className,
|
|
131
|
+
! isButtonPositionInside ? borderProps.className : undefined,
|
|
132
132
|
isButtonPositionInside
|
|
133
133
|
? 'wp-block-search__button-inside'
|
|
134
134
|
: undefined,
|
|
@@ -389,7 +389,6 @@ export default function SearchEdit( {
|
|
|
389
389
|
const getWrapperStyles = () => {
|
|
390
390
|
const styles = {
|
|
391
391
|
borderColor,
|
|
392
|
-
borderWidth: isButtonPositionInside ? borderWidth : undefined,
|
|
393
392
|
};
|
|
394
393
|
|
|
395
394
|
const isNonZeroBorderRadius = parseInt( borderRadius, 10 ) !== 0;
|
package/src/search/index.php
CHANGED
|
@@ -33,6 +33,7 @@ function render_block_core_search( $attributes ) {
|
|
|
33
33
|
$use_icon_button = ( ! empty( $attributes['buttonUseIcon'] ) ) ? true : false;
|
|
34
34
|
$show_input = ( ! empty( $attributes['buttonPosition'] ) && 'button-only' === $attributes['buttonPosition'] ) ? false : true;
|
|
35
35
|
$show_button = ( ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition'] ) ? false : true;
|
|
36
|
+
$label_markup = '';
|
|
36
37
|
$input_markup = '';
|
|
37
38
|
$button_markup = '';
|
|
38
39
|
$inline_styles = styles_for_block_core_search( $attributes );
|
|
@@ -45,13 +46,13 @@ function render_block_core_search( $attributes ) {
|
|
|
45
46
|
$label_markup = sprintf(
|
|
46
47
|
'<label for="%1$s" class="wp-block-search__label screen-reader-text">%2$s</label>',
|
|
47
48
|
$input_id,
|
|
48
|
-
empty( $attributes['label'] ) ? __( 'Search' ) : $attributes['label']
|
|
49
|
+
empty( $attributes['label'] ) ? __( 'Search' ) : esc_html( $attributes['label'] )
|
|
49
50
|
);
|
|
50
51
|
if ( $show_label && ! empty( $attributes['label'] ) ) {
|
|
51
52
|
$label_markup = sprintf(
|
|
52
53
|
'<label for="%1$s" class="wp-block-search__label">%2$s</label>',
|
|
53
54
|
$input_id,
|
|
54
|
-
$attributes['label']
|
|
55
|
+
esc_html( $attributes['label'] )
|
|
55
56
|
);
|
|
56
57
|
}
|
|
57
58
|
|
|
@@ -60,7 +61,7 @@ function render_block_core_search( $attributes ) {
|
|
|
60
61
|
$input_markup = sprintf(
|
|
61
62
|
'<input type="search" id="%s" class="wp-block-search__input %s" name="s" value="%s" placeholder="%s" %s required />',
|
|
62
63
|
$input_id,
|
|
63
|
-
$input_classes,
|
|
64
|
+
esc_attr( $input_classes ),
|
|
64
65
|
esc_attr( get_search_query() ),
|
|
65
66
|
esc_attr( $attributes['placeholder'] ),
|
|
66
67
|
$inline_styles['input']
|
|
@@ -76,7 +77,7 @@ function render_block_core_search( $attributes ) {
|
|
|
76
77
|
}
|
|
77
78
|
if ( ! $use_icon_button ) {
|
|
78
79
|
if ( ! empty( $attributes['buttonText'] ) ) {
|
|
79
|
-
$button_internal_markup = $attributes['buttonText'];
|
|
80
|
+
$button_internal_markup = esc_html( $attributes['buttonText'] );
|
|
80
81
|
}
|
|
81
82
|
} else {
|
|
82
83
|
$button_classes .= ' has-icon';
|
|
@@ -88,7 +89,7 @@ function render_block_core_search( $attributes ) {
|
|
|
88
89
|
|
|
89
90
|
$button_markup = sprintf(
|
|
90
91
|
'<button type="submit" class="wp-block-search__button %s" %s>%s</button>',
|
|
91
|
-
$button_classes,
|
|
92
|
+
esc_attr( $button_classes ),
|
|
92
93
|
$inline_styles['button'],
|
|
93
94
|
$button_internal_markup
|
|
94
95
|
);
|
|
@@ -97,7 +98,7 @@ function render_block_core_search( $attributes ) {
|
|
|
97
98
|
$field_markup_classes = $is_button_inside ? $border_color_classes : '';
|
|
98
99
|
$field_markup = sprintf(
|
|
99
100
|
'<div class="wp-block-search__inside-wrapper %s" %s>%s</div>',
|
|
100
|
-
$field_markup_classes,
|
|
101
|
+
esc_attr( $field_markup_classes ),
|
|
101
102
|
$inline_styles['wrapper'],
|
|
102
103
|
$input_markup . $button_markup
|
|
103
104
|
);
|
|
@@ -177,11 +178,9 @@ function classnames_for_block_core_search( $attributes ) {
|
|
|
177
178
|
* @return array Style HTML attribute.
|
|
178
179
|
*/
|
|
179
180
|
function styles_for_block_core_search( $attributes ) {
|
|
180
|
-
$wrapper_styles
|
|
181
|
-
$button_styles
|
|
182
|
-
$input_styles
|
|
183
|
-
$is_button_inside = ! empty( $attributes['buttonPosition'] ) &&
|
|
184
|
-
'button-inside' === $attributes['buttonPosition'];
|
|
181
|
+
$wrapper_styles = array();
|
|
182
|
+
$button_styles = array();
|
|
183
|
+
$input_styles = array();
|
|
185
184
|
|
|
186
185
|
// Add width styles.
|
|
187
186
|
$has_width = ! empty( $attributes['width'] ) && ! empty( $attributes['widthUnit'] );
|
|
@@ -195,26 +194,15 @@ function styles_for_block_core_search( $attributes ) {
|
|
|
195
194
|
);
|
|
196
195
|
}
|
|
197
196
|
|
|
198
|
-
// Add border width styles.
|
|
199
|
-
$has_border_width = ! empty( $attributes['style']['border']['width'] );
|
|
200
|
-
|
|
201
|
-
if ( $has_border_width ) {
|
|
202
|
-
$border_width = $attributes['style']['border']['width'];
|
|
203
|
-
|
|
204
|
-
if ( $is_button_inside ) {
|
|
205
|
-
$wrapper_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
|
|
206
|
-
} else {
|
|
207
|
-
$button_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
|
|
208
|
-
$input_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
197
|
// Add border radius styles.
|
|
213
198
|
$has_border_radius = ! empty( $attributes['style']['border']['radius'] );
|
|
214
199
|
|
|
215
200
|
if ( $has_border_radius ) {
|
|
216
201
|
$default_padding = '4px';
|
|
217
202
|
$border_radius = $attributes['style']['border']['radius'];
|
|
203
|
+
// Apply wrapper border radius if button placed inside.
|
|
204
|
+
$is_button_inside = ! empty( $attributes['buttonPosition'] ) &&
|
|
205
|
+
'button-inside' === $attributes['buttonPosition'];
|
|
218
206
|
|
|
219
207
|
if ( is_array( $border_radius ) ) {
|
|
220
208
|
// Apply styles for individual corner border radii.
|
|
@@ -267,7 +255,9 @@ function styles_for_block_core_search( $attributes ) {
|
|
|
267
255
|
$has_border_color = ! empty( $attributes['style']['border']['color'] );
|
|
268
256
|
|
|
269
257
|
if ( $has_border_color ) {
|
|
270
|
-
$border_color
|
|
258
|
+
$border_color = $attributes['style']['border']['color'];
|
|
259
|
+
$is_button_inside = ! empty( $attributes['buttonPosition'] ) &&
|
|
260
|
+
'button-inside' === $attributes['buttonPosition'];
|
|
271
261
|
|
|
272
262
|
// Apply wrapper border color if button placed inside.
|
|
273
263
|
if ( $is_button_inside ) {
|
|
@@ -295,9 +285,9 @@ function styles_for_block_core_search( $attributes ) {
|
|
|
295
285
|
}
|
|
296
286
|
|
|
297
287
|
return array(
|
|
298
|
-
'input' => ! empty( $input_styles ) ? sprintf( ' style="%s"', implode( ' ', $input_styles ) ) : '',
|
|
299
|
-
'button' => ! empty( $button_styles ) ? sprintf( ' style="%s"', implode( ' ', $button_styles ) ) : '',
|
|
300
|
-
'wrapper' => ! empty( $wrapper_styles ) ? sprintf( ' style="%s"', implode( ' ', $wrapper_styles ) ) : '',
|
|
288
|
+
'input' => ! empty( $input_styles ) ? sprintf( ' style="%s"', safecss_filter_attr( implode( ' ', $input_styles ) ) ) : '',
|
|
289
|
+
'button' => ! empty( $button_styles ) ? sprintf( ' style="%s"', safecss_filter_attr( implode( ' ', $button_styles ) ) ) : '',
|
|
290
|
+
'wrapper' => ! empty( $wrapper_styles ) ? sprintf( ' style="%s"', safecss_filter_attr( implode( ' ', $wrapper_styles ) ) ) : '',
|
|
301
291
|
);
|
|
302
292
|
}
|
|
303
293
|
|
package/src/separator/block.json
CHANGED
package/src/shortcode/block.json
CHANGED
package/src/site-logo/block.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
3
2
|
"apiVersion": 2,
|
|
4
3
|
"name": "core/site-logo",
|
|
5
4
|
"title": "Site Logo",
|
|
@@ -7,9 +6,6 @@
|
|
|
7
6
|
"description": "Display a graphic to represent this site. Update the block, and the changes apply everywhere it’s used. This is different than the site icon, which is the smaller image visible in your dashboard, browser tabs, etc used to help others recognize this site.",
|
|
8
7
|
"textdomain": "default",
|
|
9
8
|
"attributes": {
|
|
10
|
-
"align": {
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
9
|
"width": {
|
|
14
10
|
"type": "number"
|
|
15
11
|
},
|
|
@@ -20,12 +16,16 @@
|
|
|
20
16
|
"linkTarget": {
|
|
21
17
|
"type": "string",
|
|
22
18
|
"default": "_self"
|
|
19
|
+
},
|
|
20
|
+
"shouldSyncIcon": {
|
|
21
|
+
"type": "boolean"
|
|
23
22
|
}
|
|
24
23
|
},
|
|
25
24
|
"example": {
|
|
26
25
|
"viewportWidth": 500,
|
|
27
26
|
"attributes": {
|
|
28
|
-
"width": 350
|
|
27
|
+
"width": 350,
|
|
28
|
+
"className": "block-editor-block-types-list__site-logo-example"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"supports": {
|
package/src/site-logo/edit.js
CHANGED
|
@@ -8,7 +8,12 @@ import { includes, pick } from 'lodash';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { isBlobURL } from '@wordpress/blob';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
createInterpolateElement,
|
|
13
|
+
useEffect,
|
|
14
|
+
useState,
|
|
15
|
+
useRef,
|
|
16
|
+
} from '@wordpress/element';
|
|
12
17
|
import { __, isRTL } from '@wordpress/i18n';
|
|
13
18
|
import {
|
|
14
19
|
MenuItem,
|
|
@@ -53,7 +58,7 @@ const ACCEPT_MEDIA_STRING = 'image/*';
|
|
|
53
58
|
|
|
54
59
|
const SiteLogo = ( {
|
|
55
60
|
alt,
|
|
56
|
-
attributes: { align, width, height, isLink, linkTarget },
|
|
61
|
+
attributes: { align, width, height, isLink, linkTarget, shouldSyncIcon },
|
|
57
62
|
containerRef,
|
|
58
63
|
isSelected,
|
|
59
64
|
setAttributes,
|
|
@@ -61,6 +66,9 @@ const SiteLogo = ( {
|
|
|
61
66
|
logoUrl,
|
|
62
67
|
siteUrl,
|
|
63
68
|
logoId,
|
|
69
|
+
iconId,
|
|
70
|
+
setIcon,
|
|
71
|
+
canUserEdit,
|
|
64
72
|
} ) => {
|
|
65
73
|
const clientWidth = useClientWidth( containerRef, [ align ] );
|
|
66
74
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
@@ -84,6 +92,15 @@ const SiteLogo = ( {
|
|
|
84
92
|
};
|
|
85
93
|
}, [] );
|
|
86
94
|
|
|
95
|
+
useEffect( () => {
|
|
96
|
+
// Turn the `Use as site icon` toggle off if it is on but the logo and icon have
|
|
97
|
+
// fallen out of sync. This can happen if the toggle is saved in the `on` position,
|
|
98
|
+
// but changes are later made to the site icon in the Customizer.
|
|
99
|
+
if ( shouldSyncIcon && logoId !== iconId ) {
|
|
100
|
+
setAttributes( { shouldSyncIcon: false } );
|
|
101
|
+
}
|
|
102
|
+
}, [] );
|
|
103
|
+
|
|
87
104
|
useEffect( () => {
|
|
88
105
|
if ( ! isSelected ) {
|
|
89
106
|
setIsEditingImage( false );
|
|
@@ -142,12 +159,17 @@ const SiteLogo = ( {
|
|
|
142
159
|
return <div style={ { width, height } }>{ imgWrapper }</div>;
|
|
143
160
|
}
|
|
144
161
|
|
|
145
|
-
|
|
162
|
+
// Set the default width to a responsible size.
|
|
163
|
+
// Note that this width is also set in the attached frontend CSS file.
|
|
164
|
+
const defaultWidth = 120;
|
|
165
|
+
|
|
166
|
+
const currentWidth = width || defaultWidth;
|
|
146
167
|
const ratio = naturalWidth / naturalHeight;
|
|
147
168
|
const currentHeight = currentWidth / ratio;
|
|
148
|
-
const minWidth =
|
|
169
|
+
const minWidth =
|
|
170
|
+
naturalWidth < naturalHeight ? MIN_SIZE : Math.ceil( MIN_SIZE * ratio );
|
|
149
171
|
const minHeight =
|
|
150
|
-
naturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio;
|
|
172
|
+
naturalHeight < naturalWidth ? MIN_SIZE : Math.ceil( MIN_SIZE / ratio );
|
|
151
173
|
|
|
152
174
|
// With the current implementation of ResizableBox, an image needs an
|
|
153
175
|
// explicit pixel value for the max-width. In absence of being able to
|
|
@@ -160,10 +182,6 @@ const SiteLogo = ( {
|
|
|
160
182
|
// becomes available.
|
|
161
183
|
const maxWidthBuffer = maxWidth * 2.5;
|
|
162
184
|
|
|
163
|
-
// Set the default width to a responsible size.
|
|
164
|
-
// Note that this width is also set in the attached CSS file.
|
|
165
|
-
const defaultWidth = 120;
|
|
166
|
-
|
|
167
185
|
let showRightHandle = false;
|
|
168
186
|
let showLeftHandle = false;
|
|
169
187
|
|
|
@@ -250,6 +268,25 @@ const SiteLogo = ( {
|
|
|
250
268
|
</ResizableBox>
|
|
251
269
|
);
|
|
252
270
|
|
|
271
|
+
const syncSiteIconHelpText = createInterpolateElement(
|
|
272
|
+
__(
|
|
273
|
+
'Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'
|
|
274
|
+
),
|
|
275
|
+
{
|
|
276
|
+
a: (
|
|
277
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
278
|
+
<a
|
|
279
|
+
href={
|
|
280
|
+
siteUrl +
|
|
281
|
+
'/wp-admin/customize.php?autofocus[section]=title_tagline'
|
|
282
|
+
}
|
|
283
|
+
target="_blank"
|
|
284
|
+
rel="noopener noreferrer"
|
|
285
|
+
/>
|
|
286
|
+
),
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
|
|
253
290
|
return (
|
|
254
291
|
<>
|
|
255
292
|
<InspectorControls>
|
|
@@ -286,6 +323,19 @@ const SiteLogo = ( {
|
|
|
286
323
|
/>
|
|
287
324
|
</>
|
|
288
325
|
) }
|
|
326
|
+
{ canUserEdit && (
|
|
327
|
+
<>
|
|
328
|
+
<ToggleControl
|
|
329
|
+
label={ __( 'Use as site icon' ) }
|
|
330
|
+
onChange={ ( value ) => {
|
|
331
|
+
setAttributes( { shouldSyncIcon: value } );
|
|
332
|
+
setIcon( value ? logoId : undefined );
|
|
333
|
+
} }
|
|
334
|
+
checked={ !! shouldSyncIcon }
|
|
335
|
+
help={ syncSiteIconHelpText }
|
|
336
|
+
/>
|
|
337
|
+
</>
|
|
338
|
+
) }
|
|
289
339
|
</PanelBody>
|
|
290
340
|
</InspectorControls>
|
|
291
341
|
<BlockControls group="block">
|
|
@@ -308,7 +358,7 @@ export default function LogoEdit( {
|
|
|
308
358
|
setAttributes,
|
|
309
359
|
isSelected,
|
|
310
360
|
} ) {
|
|
311
|
-
const { width } = attributes;
|
|
361
|
+
const { className: styleClass, width, shouldSyncIcon } = attributes;
|
|
312
362
|
const [ logoUrl, setLogoUrl ] = useState();
|
|
313
363
|
const ref = useRef();
|
|
314
364
|
|
|
@@ -316,6 +366,7 @@ export default function LogoEdit( {
|
|
|
316
366
|
siteLogoId,
|
|
317
367
|
canUserEdit,
|
|
318
368
|
url,
|
|
369
|
+
siteIconId,
|
|
319
370
|
mediaItemData,
|
|
320
371
|
isRequestingMediaItem,
|
|
321
372
|
} = useSelect( ( select ) => {
|
|
@@ -328,6 +379,7 @@ export default function LogoEdit( {
|
|
|
328
379
|
const _readOnlyLogo = siteData?.site_logo;
|
|
329
380
|
const _canUserEdit = canUser( 'update', 'settings' );
|
|
330
381
|
const _siteLogoId = _canUserEdit ? _siteLogo : _readOnlyLogo;
|
|
382
|
+
const _siteIconId = siteSettings?.site_icon;
|
|
331
383
|
const mediaItem =
|
|
332
384
|
_siteLogoId &&
|
|
333
385
|
select( coreStore ).getMedia( _siteLogoId, {
|
|
@@ -339,6 +391,7 @@ export default function LogoEdit( {
|
|
|
339
391
|
_siteLogoId,
|
|
340
392
|
{ context: 'view' },
|
|
341
393
|
] );
|
|
394
|
+
|
|
342
395
|
return {
|
|
343
396
|
siteLogoId: _siteLogoId,
|
|
344
397
|
canUserEdit: _canUserEdit,
|
|
@@ -349,14 +402,59 @@ export default function LogoEdit( {
|
|
|
349
402
|
alt: mediaItem.alt_text,
|
|
350
403
|
},
|
|
351
404
|
isRequestingMediaItem: _isRequestingMediaItem,
|
|
405
|
+
siteIconId: _siteIconId,
|
|
352
406
|
};
|
|
353
407
|
}, [] );
|
|
354
408
|
|
|
409
|
+
const { getGlobalBlockCount } = useSelect( blockEditorStore );
|
|
355
410
|
const { editEntityRecord } = useDispatch( coreStore );
|
|
356
|
-
|
|
411
|
+
|
|
412
|
+
useEffect( () => {
|
|
413
|
+
// Cleanup function to discard unsaved changes to the icon and logo when
|
|
414
|
+
// the block is removed.
|
|
415
|
+
return () => {
|
|
416
|
+
// Do nothing if the block is being rendered in the styles preview or the
|
|
417
|
+
// block inserter.
|
|
418
|
+
if (
|
|
419
|
+
styleClass?.includes(
|
|
420
|
+
'block-editor-block-types-list__site-logo-example'
|
|
421
|
+
) ||
|
|
422
|
+
styleClass?.includes(
|
|
423
|
+
'block-editor-block-styles__block-preview-container'
|
|
424
|
+
)
|
|
425
|
+
) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const logoBlockCount = getGlobalBlockCount( 'core/site-logo' );
|
|
430
|
+
|
|
431
|
+
// Only discard unsaved changes if we are removing the last Site Logo block
|
|
432
|
+
// on the page.
|
|
433
|
+
if ( logoBlockCount === 0 ) {
|
|
434
|
+
editEntityRecord( 'root', 'site', undefined, {
|
|
435
|
+
site_logo: undefined,
|
|
436
|
+
site_icon: undefined,
|
|
437
|
+
} );
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
}, [] );
|
|
441
|
+
|
|
442
|
+
const setLogo = ( newValue, shouldForceSync = false ) => {
|
|
443
|
+
// `shouldForceSync` is used to force syncing when the attribute
|
|
444
|
+
// may not have updated yet.
|
|
445
|
+
if ( shouldSyncIcon || shouldForceSync ) {
|
|
446
|
+
setIcon( newValue );
|
|
447
|
+
}
|
|
448
|
+
|
|
357
449
|
editEntityRecord( 'root', 'site', undefined, {
|
|
358
450
|
site_logo: newValue,
|
|
359
451
|
} );
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
const setIcon = ( newValue ) =>
|
|
455
|
+
editEntityRecord( 'root', 'site', undefined, {
|
|
456
|
+
site_icon: newValue,
|
|
457
|
+
} );
|
|
360
458
|
|
|
361
459
|
let alt = null;
|
|
362
460
|
if ( mediaItemData ) {
|
|
@@ -365,7 +463,24 @@ export default function LogoEdit( {
|
|
|
365
463
|
setLogoUrl( mediaItemData.url );
|
|
366
464
|
}
|
|
367
465
|
}
|
|
368
|
-
|
|
466
|
+
|
|
467
|
+
const onInitialSelectLogo = ( media ) => {
|
|
468
|
+
// Initialize the syncSiteIcon toggle. If we currently have no Site logo and no
|
|
469
|
+
// site icon, automatically sync the logo to the icon.
|
|
470
|
+
if ( shouldSyncIcon === undefined ) {
|
|
471
|
+
const shouldForceSync = ! siteIconId;
|
|
472
|
+
setAttributes( { shouldSyncIcon: shouldForceSync } );
|
|
473
|
+
|
|
474
|
+
// Because we cannot rely on the `shouldSyncIcon` attribute to have updated by
|
|
475
|
+
// the time `setLogo` is called, pass an argument to force the syncing.
|
|
476
|
+
onSelectLogo( media, shouldForceSync );
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
onSelectLogo( media );
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
const onSelectLogo = ( media, shouldForceSync = false ) => {
|
|
369
484
|
if ( ! media ) {
|
|
370
485
|
return;
|
|
371
486
|
}
|
|
@@ -377,12 +492,13 @@ export default function LogoEdit( {
|
|
|
377
492
|
return;
|
|
378
493
|
}
|
|
379
494
|
|
|
380
|
-
setLogo( media.id );
|
|
495
|
+
setLogo( media.id, shouldForceSync );
|
|
381
496
|
};
|
|
382
497
|
|
|
383
498
|
const onRemoveLogo = () => {
|
|
384
499
|
setLogo( null );
|
|
385
500
|
setLogoUrl( undefined );
|
|
501
|
+
setAttributes( { width: undefined } );
|
|
386
502
|
};
|
|
387
503
|
|
|
388
504
|
const { createErrorNotice } = useDispatch( noticesStore );
|
|
@@ -422,6 +538,9 @@ export default function LogoEdit( {
|
|
|
422
538
|
setLogo={ setLogo }
|
|
423
539
|
logoId={ mediaItemData?.id || siteLogoId }
|
|
424
540
|
siteUrl={ url }
|
|
541
|
+
setIcon={ setIcon }
|
|
542
|
+
iconId={ siteIconId }
|
|
543
|
+
canUserEdit={ canUserEdit }
|
|
425
544
|
/>
|
|
426
545
|
);
|
|
427
546
|
}
|
|
@@ -480,7 +599,7 @@ export default function LogoEdit( {
|
|
|
480
599
|
) }
|
|
481
600
|
{ ! logoUrl && canUserEdit && (
|
|
482
601
|
<MediaPlaceholder
|
|
483
|
-
onSelect={
|
|
602
|
+
onSelect={ onInitialSelectLogo }
|
|
484
603
|
accept={ ACCEPT_MEDIA_STRING }
|
|
485
604
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
486
605
|
onError={ onUploadError }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.wp-block[data-align="center"] > .wp-block-site-logo {
|
|
2
|
+
display: table;
|
|
2
3
|
margin-left: auto;
|
|
3
4
|
margin-right: auto;
|
|
4
|
-
text-align: center;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.wp-block-site-logo {
|
|
@@ -10,20 +10,6 @@
|
|
|
10
10
|
pointer-events: none;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
&:not(.is-default-size) {
|
|
14
|
-
display: table;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Provide a sane starting point for the size.
|
|
18
|
-
&.is-default-size {
|
|
19
|
-
width: 120px;
|
|
20
|
-
|
|
21
|
-
img {
|
|
22
|
-
height: auto;
|
|
23
|
-
width: 100%;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
13
|
.custom-logo-link {
|
|
28
14
|
cursor: inherit;
|
|
29
15
|
|
package/src/site-logo/index.php
CHANGED
|
@@ -48,10 +48,6 @@ function render_block_core_site_logo( $attributes ) {
|
|
|
48
48
|
$classnames[] = $attributes['className'];
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
if ( ! empty( $attributes['align'] ) && in_array( $attributes['align'], array( 'center', 'left', 'right' ), true ) ) {
|
|
52
|
-
$classnames[] = "align{$attributes['align']}";
|
|
53
|
-
}
|
|
54
|
-
|
|
55
51
|
if ( empty( $attributes['width'] ) ) {
|
|
56
52
|
$classnames[] = 'is-default-size';
|
|
57
53
|
}
|
|
@@ -80,6 +76,23 @@ function register_block_core_site_logo_setting() {
|
|
|
80
76
|
|
|
81
77
|
add_action( 'rest_api_init', 'register_block_core_site_logo_setting', 10 );
|
|
82
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Register a core site setting for a site icon
|
|
81
|
+
*/
|
|
82
|
+
function register_block_core_site_icon_setting() {
|
|
83
|
+
register_setting(
|
|
84
|
+
'general',
|
|
85
|
+
'site_icon',
|
|
86
|
+
array(
|
|
87
|
+
'show_in_rest' => true,
|
|
88
|
+
'type' => 'integer',
|
|
89
|
+
'description' => __( 'Site icon.' ),
|
|
90
|
+
)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
add_action( 'rest_api_init', 'register_block_core_site_icon_setting', 10 );
|
|
95
|
+
|
|
83
96
|
/**
|
|
84
97
|
* Registers the `core/site-logo` block on the server.
|
|
85
98
|
*/
|
package/src/site-logo/style.scss
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
3
2
|
"apiVersion": 2,
|
|
4
3
|
"name": "core/site-tagline",
|
|
5
4
|
"title": "Site Tagline",
|
|
6
5
|
"category": "theme",
|
|
7
|
-
"description": "Describe in a few words what the
|
|
6
|
+
"description": "Describe in a few words what the website is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",
|
|
8
7
|
"keywords": [ "description" ],
|
|
9
8
|
"textdomain": "default",
|
|
10
9
|
"attributes": {
|