@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
package/build/site-logo/edit.js
CHANGED
|
@@ -63,7 +63,8 @@ const SiteLogo = _ref => {
|
|
|
63
63
|
width,
|
|
64
64
|
height,
|
|
65
65
|
isLink,
|
|
66
|
-
linkTarget
|
|
66
|
+
linkTarget,
|
|
67
|
+
shouldSyncIcon
|
|
67
68
|
},
|
|
68
69
|
containerRef,
|
|
69
70
|
isSelected,
|
|
@@ -71,7 +72,10 @@ const SiteLogo = _ref => {
|
|
|
71
72
|
setLogo,
|
|
72
73
|
logoUrl,
|
|
73
74
|
siteUrl,
|
|
74
|
-
logoId
|
|
75
|
+
logoId,
|
|
76
|
+
iconId,
|
|
77
|
+
setIcon,
|
|
78
|
+
canUserEdit
|
|
75
79
|
} = _ref;
|
|
76
80
|
const clientWidth = (0, _useClientWidth.default)(containerRef, [align]);
|
|
77
81
|
const isLargeViewport = (0, _compose.useViewportMatch)('medium');
|
|
@@ -102,6 +106,16 @@ const SiteLogo = _ref => {
|
|
|
102
106
|
...(0, _lodash.pick)(getSettings(), ['imageEditing', 'maxWidth'])
|
|
103
107
|
};
|
|
104
108
|
}, []);
|
|
109
|
+
(0, _element.useEffect)(() => {
|
|
110
|
+
// Turn the `Use as site icon` toggle off if it is on but the logo and icon have
|
|
111
|
+
// fallen out of sync. This can happen if the toggle is saved in the `on` position,
|
|
112
|
+
// but changes are later made to the site icon in the Customizer.
|
|
113
|
+
if (shouldSyncIcon && logoId !== iconId) {
|
|
114
|
+
setAttributes({
|
|
115
|
+
shouldSyncIcon: false
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}, []);
|
|
105
119
|
(0, _element.useEffect)(() => {
|
|
106
120
|
if (!isSelected) {
|
|
107
121
|
setIsEditingImage(false);
|
|
@@ -155,13 +169,16 @@ const SiteLogo = _ref => {
|
|
|
155
169
|
height
|
|
156
170
|
}
|
|
157
171
|
}, imgWrapper);
|
|
158
|
-
}
|
|
172
|
+
} // Set the default width to a responsible size.
|
|
173
|
+
// Note that this width is also set in the attached frontend CSS file.
|
|
174
|
+
|
|
159
175
|
|
|
160
|
-
const
|
|
176
|
+
const defaultWidth = 120;
|
|
177
|
+
const currentWidth = width || defaultWidth;
|
|
161
178
|
const ratio = naturalWidth / naturalHeight;
|
|
162
179
|
const currentHeight = currentWidth / ratio;
|
|
163
|
-
const minWidth = naturalWidth < naturalHeight ? _constants.MIN_SIZE : _constants.MIN_SIZE * ratio;
|
|
164
|
-
const minHeight = naturalHeight < naturalWidth ? _constants.MIN_SIZE : _constants.MIN_SIZE / ratio; // With the current implementation of ResizableBox, an image needs an
|
|
180
|
+
const minWidth = naturalWidth < naturalHeight ? _constants.MIN_SIZE : Math.ceil(_constants.MIN_SIZE * ratio);
|
|
181
|
+
const minHeight = naturalHeight < naturalWidth ? _constants.MIN_SIZE : Math.ceil(_constants.MIN_SIZE / ratio); // With the current implementation of ResizableBox, an image needs an
|
|
165
182
|
// explicit pixel value for the max-width. In absence of being able to
|
|
166
183
|
// set the content-width, this max-width is currently dictated by the
|
|
167
184
|
// vanilla editor style. The following variable adds a buffer to this
|
|
@@ -171,10 +188,7 @@ const SiteLogo = _ref => {
|
|
|
171
188
|
// @todo It would be good to revisit this once a content-width variable
|
|
172
189
|
// becomes available.
|
|
173
190
|
|
|
174
|
-
const maxWidthBuffer = maxWidth * 2.5;
|
|
175
|
-
// Note that this width is also set in the attached CSS file.
|
|
176
|
-
|
|
177
|
-
const defaultWidth = 120;
|
|
191
|
+
const maxWidthBuffer = maxWidth * 2.5;
|
|
178
192
|
let showRightHandle = false;
|
|
179
193
|
let showLeftHandle = false;
|
|
180
194
|
/* eslint-disable no-lonely-if */
|
|
@@ -250,6 +264,14 @@ const SiteLogo = _ref => {
|
|
|
250
264
|
});
|
|
251
265
|
}
|
|
252
266
|
}, imgWrapper);
|
|
267
|
+
const syncSiteIconHelpText = (0, _element.createInterpolateElement)((0, _i18n.__)('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>.'), {
|
|
268
|
+
a: // eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
269
|
+
(0, _element.createElement)("a", {
|
|
270
|
+
href: siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline',
|
|
271
|
+
target: "_blank",
|
|
272
|
+
rel: "noopener noreferrer"
|
|
273
|
+
})
|
|
274
|
+
});
|
|
253
275
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.InspectorControls, null, (0, _element.createElement)(_components.PanelBody, {
|
|
254
276
|
title: (0, _i18n.__)('Settings')
|
|
255
277
|
}, (0, _element.createElement)(_components.RangeControl, {
|
|
@@ -274,6 +296,16 @@ const SiteLogo = _ref => {
|
|
|
274
296
|
linkTarget: value ? '_blank' : '_self'
|
|
275
297
|
}),
|
|
276
298
|
checked: linkTarget === '_blank'
|
|
299
|
+
})), canUserEdit && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.ToggleControl, {
|
|
300
|
+
label: (0, _i18n.__)('Use as site icon'),
|
|
301
|
+
onChange: value => {
|
|
302
|
+
setAttributes({
|
|
303
|
+
shouldSyncIcon: value
|
|
304
|
+
});
|
|
305
|
+
setIcon(value ? logoId : undefined);
|
|
306
|
+
},
|
|
307
|
+
checked: !!shouldSyncIcon,
|
|
308
|
+
help: syncSiteIconHelpText
|
|
277
309
|
})))), (0, _element.createElement)(_blockEditor.BlockControls, {
|
|
278
310
|
group: "block"
|
|
279
311
|
}, canEditImage && !isEditingImage && (0, _element.createElement)(_components.ToolbarButton, {
|
|
@@ -291,7 +323,9 @@ function LogoEdit(_ref2) {
|
|
|
291
323
|
isSelected
|
|
292
324
|
} = _ref2;
|
|
293
325
|
const {
|
|
294
|
-
|
|
326
|
+
className: styleClass,
|
|
327
|
+
width,
|
|
328
|
+
shouldSyncIcon
|
|
295
329
|
} = attributes;
|
|
296
330
|
const [logoUrl, setLogoUrl] = (0, _element.useState)();
|
|
297
331
|
const ref = (0, _element.useRef)();
|
|
@@ -299,6 +333,7 @@ function LogoEdit(_ref2) {
|
|
|
299
333
|
siteLogoId,
|
|
300
334
|
canUserEdit,
|
|
301
335
|
url,
|
|
336
|
+
siteIconId,
|
|
302
337
|
mediaItemData,
|
|
303
338
|
isRequestingMediaItem
|
|
304
339
|
} = (0, _data.useSelect)(select => {
|
|
@@ -318,6 +353,8 @@ function LogoEdit(_ref2) {
|
|
|
318
353
|
|
|
319
354
|
const _siteLogoId = _canUserEdit ? _siteLogo : _readOnlyLogo;
|
|
320
355
|
|
|
356
|
+
const _siteIconId = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_icon;
|
|
357
|
+
|
|
321
358
|
const mediaItem = _siteLogoId && select(_coreData.store).getMedia(_siteLogoId, {
|
|
322
359
|
context: 'view'
|
|
323
360
|
});
|
|
@@ -335,15 +372,54 @@ function LogoEdit(_ref2) {
|
|
|
335
372
|
url: mediaItem.source_url,
|
|
336
373
|
alt: mediaItem.alt_text
|
|
337
374
|
},
|
|
338
|
-
isRequestingMediaItem: _isRequestingMediaItem
|
|
375
|
+
isRequestingMediaItem: _isRequestingMediaItem,
|
|
376
|
+
siteIconId: _siteIconId
|
|
339
377
|
};
|
|
340
378
|
}, []);
|
|
379
|
+
const {
|
|
380
|
+
getGlobalBlockCount
|
|
381
|
+
} = (0, _data.useSelect)(_blockEditor.store);
|
|
341
382
|
const {
|
|
342
383
|
editEntityRecord
|
|
343
384
|
} = (0, _data.useDispatch)(_coreData.store);
|
|
385
|
+
(0, _element.useEffect)(() => {
|
|
386
|
+
// Cleanup function to discard unsaved changes to the icon and logo when
|
|
387
|
+
// the block is removed.
|
|
388
|
+
return () => {
|
|
389
|
+
// Do nothing if the block is being rendered in the styles preview or the
|
|
390
|
+
// block inserter.
|
|
391
|
+
if (styleClass !== null && styleClass !== void 0 && styleClass.includes('block-editor-block-types-list__site-logo-example') || styleClass !== null && styleClass !== void 0 && styleClass.includes('block-editor-block-styles__block-preview-container')) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
const logoBlockCount = getGlobalBlockCount('core/site-logo'); // Only discard unsaved changes if we are removing the last Site Logo block
|
|
396
|
+
// on the page.
|
|
344
397
|
|
|
345
|
-
|
|
346
|
-
|
|
398
|
+
if (logoBlockCount === 0) {
|
|
399
|
+
editEntityRecord('root', 'site', undefined, {
|
|
400
|
+
site_logo: undefined,
|
|
401
|
+
site_icon: undefined
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
}, []);
|
|
406
|
+
|
|
407
|
+
const setLogo = function (newValue) {
|
|
408
|
+
let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
409
|
+
|
|
410
|
+
// `shouldForceSync` is used to force syncing when the attribute
|
|
411
|
+
// may not have updated yet.
|
|
412
|
+
if (shouldSyncIcon || shouldForceSync) {
|
|
413
|
+
setIcon(newValue);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
editEntityRecord('root', 'site', undefined, {
|
|
417
|
+
site_logo: newValue
|
|
418
|
+
});
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
const setIcon = newValue => editEntityRecord('root', 'site', undefined, {
|
|
422
|
+
site_icon: newValue
|
|
347
423
|
});
|
|
348
424
|
|
|
349
425
|
let alt = null;
|
|
@@ -356,7 +432,26 @@ function LogoEdit(_ref2) {
|
|
|
356
432
|
}
|
|
357
433
|
}
|
|
358
434
|
|
|
359
|
-
const
|
|
435
|
+
const onInitialSelectLogo = media => {
|
|
436
|
+
// Initialize the syncSiteIcon toggle. If we currently have no Site logo and no
|
|
437
|
+
// site icon, automatically sync the logo to the icon.
|
|
438
|
+
if (shouldSyncIcon === undefined) {
|
|
439
|
+
const shouldForceSync = !siteIconId;
|
|
440
|
+
setAttributes({
|
|
441
|
+
shouldSyncIcon: shouldForceSync
|
|
442
|
+
}); // Because we cannot rely on the `shouldSyncIcon` attribute to have updated by
|
|
443
|
+
// the time `setLogo` is called, pass an argument to force the syncing.
|
|
444
|
+
|
|
445
|
+
onSelectLogo(media, shouldForceSync);
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
onSelectLogo(media);
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
const onSelectLogo = function (media) {
|
|
453
|
+
let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
454
|
+
|
|
360
455
|
if (!media) {
|
|
361
456
|
return;
|
|
362
457
|
}
|
|
@@ -368,12 +463,15 @@ function LogoEdit(_ref2) {
|
|
|
368
463
|
return;
|
|
369
464
|
}
|
|
370
465
|
|
|
371
|
-
setLogo(media.id);
|
|
466
|
+
setLogo(media.id, shouldForceSync);
|
|
372
467
|
};
|
|
373
468
|
|
|
374
469
|
const onRemoveLogo = () => {
|
|
375
470
|
setLogo(null);
|
|
376
471
|
setLogoUrl(undefined);
|
|
472
|
+
setAttributes({
|
|
473
|
+
width: undefined
|
|
474
|
+
});
|
|
377
475
|
};
|
|
378
476
|
|
|
379
477
|
const {
|
|
@@ -415,7 +513,10 @@ function LogoEdit(_ref2) {
|
|
|
415
513
|
logoUrl: logoUrl,
|
|
416
514
|
setLogo: setLogo,
|
|
417
515
|
logoId: (mediaItemData === null || mediaItemData === void 0 ? void 0 : mediaItemData.id) || siteLogoId,
|
|
418
|
-
siteUrl: url
|
|
516
|
+
siteUrl: url,
|
|
517
|
+
setIcon: setIcon,
|
|
518
|
+
iconId: siteIconId,
|
|
519
|
+
canUserEdit: canUserEdit
|
|
419
520
|
});
|
|
420
521
|
}
|
|
421
522
|
|
|
@@ -448,7 +549,7 @@ function LogoEdit(_ref2) {
|
|
|
448
549
|
}, isLoading && (0, _element.createElement)("span", {
|
|
449
550
|
className: "components-placeholder__preview"
|
|
450
551
|
}, (0, _element.createElement)(_components.Spinner, null))), !logoUrl && canUserEdit && (0, _element.createElement)(_blockEditor.MediaPlaceholder, {
|
|
451
|
-
onSelect:
|
|
552
|
+
onSelect: onInitialSelectLogo,
|
|
452
553
|
accept: ACCEPT_MEDIA_STRING,
|
|
453
554
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
454
555
|
onError: onUploadError,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/site-logo/edit.js"],"names":["ALLOWED_MEDIA_TYPES","ACCEPT_MEDIA_STRING","SiteLogo","alt","attributes","align","width","height","isLink","linkTarget","containerRef","isSelected","setAttributes","setLogo","logoUrl","siteUrl","logoId","clientWidth","isLargeViewport","isWideAligned","isResizable","naturalWidth","naturalHeight","setNaturalSize","isEditingImage","setIsEditingImage","toggleSelection","blockEditorStore","classes","imageEditing","maxWidth","title","select","getSettings","siteEntities","coreStore","getEditedEntityRecord","onResizeStart","onResizeStop","img","event","target","imgWrapper","preventDefault","imageWidthWithinContainer","exceedMaxWidth","currentWidth","ratio","currentHeight","minWidth","MIN_SIZE","minHeight","maxWidthBuffer","defaultWidth","showRightHandle","showLeftHandle","canEditImage","imgEdit","imageAttributes","id","top","right","bottom","left","direction","elt","delta","parseInt","newWidth","Math","min","value","crop","LogoEdit","className","setLogoUrl","ref","siteLogoId","canUserEdit","url","mediaItemData","isRequestingMediaItem","canUser","getEntityRecord","siteSettings","siteData","_siteLogo","site_logo","_readOnlyLogo","_canUserEdit","_siteLogoId","mediaItem","getMedia","context","_isRequestingMediaItem","hasFinishedResolution","source_url","alt_text","editEntityRecord","newValue","undefined","onSelectLogo","media","onRemoveLogo","createErrorNotice","noticesStore","onUploadError","message","type","controls","logoImage","isLoading","placeholder","content","placeholderClassName","blockProps","label","open","upload"],"mappings":";;;;;;;;;AAUA;;AAPA;;AACA;;AAKA;;AAEA;;AACA;;AAWA;;AACA;;AAUA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AAhDA;AACA;AACA;;AAIA;AACA;AACA;;AAgCA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG,CAAE,OAAF,CAA5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AAEA,SACC,mCAAUD,UAAV,EACGN,QADH,EAEG,CAAC,CAAE/F,OAAH,IAAcgG,SAFjB,EAGG,CAAEhG,OAAF,IAAa,CAAEgE,WAAf,IACD,4BAAC,uBAAD;AAAa,IAAA,SAAS,EAAC;AAAvB,KACGiC,SAAS,IACV;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,4BAAC,mBAAD,OADD,CAFF,CAJF,EAYG,CAAEjG,OAAF,IAAagE,WAAb,IACD,4BAAC,6BAAD;AACC,IAAA,QAAQ,EAAGuB,YADZ;AAEC,IAAA,MAAM,EAAGpG,mBAFV;AAGC,IAAA,YAAY,EAAGD,mBAHhB;AAIC,IAAA,OAAO,EAAG0G,aAJX;AAKC,IAAA,WAAW,EAAGM,WALf;AAMC,IAAA,kBAAkB,EAAG,SAAgB;AAAA,UAAd;AAAEK,QAAAA;AAAF,OAAc;AACpC,aACC,4BAAC,kBAAD;AACC,QAAA,IAAI,EAAGC,aADR;AAEC,QAAA,OAAO,EAAC,SAFT;AAGC,QAAA,KAAK,EAAGF,KAHT;AAIC,QAAA,WAAW,MAJZ;AAKC,QAAA,eAAe,EAAC,YALjB;AAMC,QAAA,OAAO,EAAG,MAAM;AACfC,UAAAA,IAAI;AACJ;AARF,QADD;AAYA;AAnBF,IAbF,CADD;AAsCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { includes, pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport { useEffect, useState, useRef } from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tMenuItem,\n\tPanelBody,\n\tRangeControl,\n\tResizableBox,\n\tSpinner,\n\tToggleControl,\n\tToolbarButton,\n\tPlaceholder,\n\tButton,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalImageEditor as ImageEditor,\n\t__experimentalImageEditingProvider as ImageEditingProvider,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { crop, upload } from '@wordpress/icons';\nimport { SVG, Path } from '@wordpress/primitives';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport useClientWidth from '../image/use-client-width';\n\n/**\n * Module constants\n */\nimport { MIN_SIZE } from '../image/constants';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\nconst ACCEPT_MEDIA_STRING = 'image/*';\n\nconst SiteLogo = ( {\n\talt,\n\tattributes: { align, width, height, isLink, linkTarget },\n\tcontainerRef,\n\tisSelected,\n\tsetAttributes,\n\tsetLogo,\n\tlogoUrl,\n\tsiteUrl,\n\tlogoId,\n} ) => {\n\tconst clientWidth = useClientWidth( containerRef, [ align ] );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideAligned = includes( [ 'wide', 'full' ], align );\n\tconst isResizable = ! isWideAligned && isLargeViewport;\n\tconst [ { naturalWidth, naturalHeight }, setNaturalSize ] = useState( {} );\n\tconst [ isEditingImage, setIsEditingImage ] = useState( false );\n\tconst { toggleSelection } = useDispatch( blockEditorStore );\n\tconst classes = classnames( 'custom-logo-link', {\n\t\t'is-transient': isBlobURL( logoUrl ),\n\t} );\n\tconst { imageEditing, maxWidth, title } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst siteEntities = select( coreStore ).getEditedEntityRecord(\n\t\t\t'root',\n\t\t\t'site'\n\t\t);\n\t\treturn {\n\t\t\ttitle: siteEntities.title,\n\t\t\t...pick( getSettings(), [ 'imageEditing', 'maxWidth' ] ),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsEditingImage( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\tfunction onResizeStart() {\n\t\ttoggleSelection( false );\n\t}\n\n\tfunction onResizeStop() {\n\t\ttoggleSelection( true );\n\t}\n\n\tconst img = (\n\t\t<img\n\t\t\tclassName=\"custom-logo\"\n\t\t\tsrc={ logoUrl }\n\t\t\talt={ alt }\n\t\t\tonLoad={ ( event ) => {\n\t\t\t\tsetNaturalSize(\n\t\t\t\t\tpick( event.target, [ 'naturalWidth', 'naturalHeight' ] )\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n\n\tlet imgWrapper = img;\n\n\t// Disable reason: Image itself is not meant to be interactive, but\n\t// should direct focus to block.\n\tif ( isLink ) {\n\t\timgWrapper = (\n\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t\t\t<a\n\t\t\t\thref={ siteUrl }\n\t\t\t\tclassName={ classes }\n\t\t\t\trel=\"home\"\n\t\t\t\ttitle={ title }\n\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t{ img }\n\t\t\t</a>\n\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t\t);\n\t}\n\n\tlet imageWidthWithinContainer;\n\n\tif ( clientWidth && naturalWidth && naturalHeight ) {\n\t\tconst exceedMaxWidth = naturalWidth > clientWidth;\n\t\timageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;\n\t}\n\n\tif ( ! isResizable || ! imageWidthWithinContainer ) {\n\t\treturn <div style={ { width, height } }>{ imgWrapper }</div>;\n\t}\n\n\tconst currentWidth = width || imageWidthWithinContainer;\n\tconst ratio = naturalWidth / naturalHeight;\n\tconst currentHeight = currentWidth / ratio;\n\tconst minWidth = naturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\tconst minHeight =\n\t\tnaturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t// With the current implementation of ResizableBox, an image needs an\n\t// explicit pixel value for the max-width. In absence of being able to\n\t// set the content-width, this max-width is currently dictated by the\n\t// vanilla editor style. The following variable adds a buffer to this\n\t// vanilla style, so 3rd party themes have some wiggleroom. This does,\n\t// in most cases, allow you to scale the image beyond the width of the\n\t// main column, though not infinitely.\n\t// @todo It would be good to revisit this once a content-width variable\n\t// becomes available.\n\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\t// Set the default width to a responsible size.\n\t// Note that this width is also set in the attached CSS file.\n\tconst defaultWidth = 120;\n\n\tlet showRightHandle = false;\n\tlet showLeftHandle = false;\n\n\t/* eslint-disable no-lonely-if */\n\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\tif ( align === 'center' ) {\n\t\t// When the image is centered, show both handles.\n\t\tshowRightHandle = true;\n\t\tshowLeftHandle = true;\n\t} else if ( isRTL() ) {\n\t\t// In RTL mode the image is on the right by default.\n\t\t// Show the right handle and hide the left handle only when it is\n\t\t// aligned left. Otherwise always show the left handle.\n\t\tif ( align === 'left' ) {\n\t\t\tshowRightHandle = true;\n\t\t} else {\n\t\t\tshowLeftHandle = true;\n\t\t}\n\t} else {\n\t\t// Show the left handle and hide the right handle only when the\n\t\t// image is aligned right. Otherwise always show the right handle.\n\t\tif ( align === 'right' ) {\n\t\t\tshowLeftHandle = true;\n\t\t} else {\n\t\t\tshowRightHandle = true;\n\t\t}\n\t}\n\t/* eslint-enable no-lonely-if */\n\n\tconst canEditImage =\n\t\tlogoId && naturalWidth && naturalHeight && imageEditing;\n\n\tconst imgEdit =\n\t\tcanEditImage && isEditingImage ? (\n\t\t\t<ImageEditingProvider\n\t\t\t\tid={ logoId }\n\t\t\t\turl={ logoUrl }\n\t\t\t\tnaturalWidth={ naturalWidth }\n\t\t\t\tnaturalHeight={ naturalHeight }\n\t\t\t\tclientWidth={ clientWidth }\n\t\t\t\tonSaveImage={ ( imageAttributes ) => {\n\t\t\t\t\tsetLogo( imageAttributes.id );\n\t\t\t\t} }\n\t\t\t\tisEditing={ isEditingImage }\n\t\t\t\tonFinishEditing={ () => setIsEditingImage( false ) }\n\t\t\t>\n\t\t\t\t<ImageEditor\n\t\t\t\t\turl={ logoUrl }\n\t\t\t\t\twidth={ currentWidth }\n\t\t\t\t\theight={ currentHeight }\n\t\t\t\t\tclientWidth={ clientWidth }\n\t\t\t\t\tnaturalHeight={ naturalHeight }\n\t\t\t\t\tnaturalWidth={ naturalWidth }\n\t\t\t\t/>\n\t\t\t</ImageEditingProvider>\n\t\t) : (\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: currentWidth,\n\t\t\t\t\theight: currentHeight,\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\tlockAspectRatio\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t} }\n\t\t\t\tonResizeStart={ onResizeStart }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tonResizeStop();\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( currentWidth + delta.width, 10 ),\n\t\t\t\t\t\theight: parseInt( currentHeight + delta.height, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ imgWrapper }\n\t\t\t</ResizableBox>\n\t\t);\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tlabel={ __( 'Image width' ) }\n\t\t\t\t\t\tonChange={ ( newWidth ) =>\n\t\t\t\t\t\t\tsetAttributes( { width: newWidth } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin={ minWidth }\n\t\t\t\t\t\tmax={ maxWidthBuffer }\n\t\t\t\t\t\tinitialPosition={ Math.min(\n\t\t\t\t\t\t\tdefaultWidth,\n\t\t\t\t\t\t\tmaxWidthBuffer\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ width || '' }\n\t\t\t\t\t\tdisabled={ ! isResizable }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Link image to home' ) }\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t{ canEditImage && ! isEditingImage && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tonClick={ () => setIsEditingImage( true ) }\n\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t{ imgEdit }\n\t\t</>\n\t);\n};\n\nexport default function LogoEdit( {\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tisSelected,\n} ) {\n\tconst { width } = attributes;\n\tconst [ logoUrl, setLogoUrl ] = useState();\n\tconst ref = useRef();\n\n\tconst {\n\t\tsiteLogoId,\n\t\tcanUserEdit,\n\t\turl,\n\t\tmediaItemData,\n\t\tisRequestingMediaItem,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEditedEntityRecord } = select(\n\t\t\tcoreStore\n\t\t);\n\t\tconst siteSettings = getEditedEntityRecord( 'root', 'site' );\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase' );\n\t\tconst _siteLogo = siteSettings?.site_logo;\n\t\tconst _readOnlyLogo = siteData?.site_logo;\n\t\tconst _canUserEdit = canUser( 'update', 'settings' );\n\t\tconst _siteLogoId = _canUserEdit ? _siteLogo : _readOnlyLogo;\n\t\tconst mediaItem =\n\t\t\t_siteLogoId &&\n\t\t\tselect( coreStore ).getMedia( _siteLogoId, {\n\t\t\t\tcontext: 'view',\n\t\t\t} );\n\t\tconst _isRequestingMediaItem =\n\t\t\t_siteLogoId &&\n\t\t\t! select( coreStore ).hasFinishedResolution( 'getMedia', [\n\t\t\t\t_siteLogoId,\n\t\t\t\t{ context: 'view' },\n\t\t\t] );\n\t\treturn {\n\t\t\tsiteLogoId: _siteLogoId,\n\t\t\tcanUserEdit: _canUserEdit,\n\t\t\turl: siteData?.url,\n\t\t\tmediaItemData: mediaItem && {\n\t\t\t\tid: mediaItem.id,\n\t\t\t\turl: mediaItem.source_url,\n\t\t\t\talt: mediaItem.alt_text,\n\t\t\t},\n\t\t\tisRequestingMediaItem: _isRequestingMediaItem,\n\t\t};\n\t}, [] );\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst setLogo = ( newValue ) =>\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tsite_logo: newValue,\n\t\t} );\n\n\tlet alt = null;\n\tif ( mediaItemData ) {\n\t\talt = mediaItemData.alt;\n\t\tif ( logoUrl !== mediaItemData.url ) {\n\t\t\tsetLogoUrl( mediaItemData.url );\n\t\t}\n\t}\n\tconst onSelectLogo = ( media ) => {\n\t\tif ( ! media ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! media.id && media.url ) {\n\t\t\t// This is a temporary blob image\n\t\t\tsetLogo( undefined );\n\t\t\tsetLogoUrl( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\tsetLogo( media.id );\n\t};\n\n\tconst onRemoveLogo = () => {\n\t\tsetLogo( null );\n\t\tsetLogoUrl( undefined );\n\t};\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message[ 2 ], { type: 'snackbar' } );\n\t};\n\n\tconst controls = canUserEdit && logoUrl && (\n\t\t<BlockControls group=\"other\">\n\t\t\t<MediaReplaceFlow\n\t\t\t\tmediaURL={ logoUrl }\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\taccept={ ACCEPT_MEDIA_STRING }\n\t\t\t\tonSelect={ onSelectLogo }\n\t\t\t\tonError={ onUploadError }\n\t\t\t>\n\t\t\t\t<MenuItem onClick={ onRemoveLogo }>{ __( 'Reset' ) }</MenuItem>\n\t\t\t</MediaReplaceFlow>\n\t\t</BlockControls>\n\t);\n\n\tlet logoImage;\n\tconst isLoading = siteLogoId === undefined || isRequestingMediaItem;\n\tif ( isLoading ) {\n\t\tlogoImage = <Spinner />;\n\t}\n\tif ( !! logoUrl ) {\n\t\tlogoImage = (\n\t\t\t<SiteLogo\n\t\t\t\talt={ alt }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tclassName={ className }\n\t\t\t\tcontainerRef={ ref }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tlogoUrl={ logoUrl }\n\t\t\t\tsetLogo={ setLogo }\n\t\t\t\tlogoId={ mediaItemData?.id || siteLogoId }\n\t\t\t\tsiteUrl={ url }\n\t\t\t/>\n\t\t);\n\t}\n\tconst placeholder = ( content ) => {\n\t\tconst placeholderClassName = classnames(\n\t\t\t'block-editor-media-placeholder',\n\t\t\tclassName\n\t\t);\n\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ placeholderClassName }\n\t\t\t\tpreview={ logoImage }\n\t\t\t>\n\t\t\t\t{\n\t\t\t\t\t<SVG\n\t\t\t\t\t\tclassName=\"components-placeholder__illustration\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\tviewBox=\"0 0 60 60\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Path\n\t\t\t\t\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t\t\t\t\t\td=\"m61 32.622-13.555-9.137-15.888 9.859a5 5 0 0 1-5.386-.073l-9.095-5.989L1 37.5\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SVG>\n\t\t\t\t}\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst classes = classnames( className, {\n\t\t'is-default-size': ! width,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tref,\n\t\tclassName: classes,\n\t} );\n\n\tconst label = __( 'Add a site logo' );\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\t\t\t{ !! logoUrl && logoImage }\n\t\t\t{ ! logoUrl && ! canUserEdit && (\n\t\t\t\t<Placeholder className=\"site-logo_placeholder\">\n\t\t\t\t\t{ isLoading && (\n\t\t\t\t\t\t<span className=\"components-placeholder__preview\">\n\t\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t{ ! logoUrl && canUserEdit && (\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\tonSelect={ onSelectLogo }\n\t\t\t\t\taccept={ ACCEPT_MEDIA_STRING }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\ttooltipPosition=\"top center\"\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topen();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/site-logo/edit.js"],"names":["ALLOWED_MEDIA_TYPES","ACCEPT_MEDIA_STRING","SiteLogo","alt","attributes","align","width","height","isLink","linkTarget","shouldSyncIcon","containerRef","isSelected","setAttributes","setLogo","logoUrl","siteUrl","logoId","iconId","setIcon","canUserEdit","clientWidth","isLargeViewport","isWideAligned","isResizable","naturalWidth","naturalHeight","setNaturalSize","isEditingImage","setIsEditingImage","toggleSelection","blockEditorStore","classes","imageEditing","maxWidth","title","select","getSettings","siteEntities","coreStore","getEditedEntityRecord","onResizeStart","onResizeStop","img","event","target","imgWrapper","preventDefault","imageWidthWithinContainer","exceedMaxWidth","defaultWidth","currentWidth","ratio","currentHeight","minWidth","MIN_SIZE","Math","ceil","minHeight","maxWidthBuffer","showRightHandle","showLeftHandle","canEditImage","imgEdit","imageAttributes","id","top","right","bottom","left","direction","elt","delta","parseInt","syncSiteIconHelpText","a","newWidth","min","value","undefined","crop","LogoEdit","className","styleClass","setLogoUrl","ref","siteLogoId","url","siteIconId","mediaItemData","isRequestingMediaItem","canUser","getEntityRecord","siteSettings","siteData","_siteLogo","site_logo","_readOnlyLogo","_canUserEdit","_siteLogoId","_siteIconId","site_icon","mediaItem","getMedia","context","_isRequestingMediaItem","hasFinishedResolution","source_url","alt_text","getGlobalBlockCount","editEntityRecord","includes","logoBlockCount","newValue","shouldForceSync","onInitialSelectLogo","media","onSelectLogo","onRemoveLogo","createErrorNotice","noticesStore","onUploadError","message","type","controls","logoImage","isLoading","placeholder","content","placeholderClassName","blockProps","label","open","upload"],"mappings":";;;;;;;;;AAUA;;AAPA;;AACA;;AAKA;;AAOA;;AACA;;AAWA;;AACA;;AAUA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AArDA;AACA;AACA;;AAIA;AACA;AACA;;AAqCA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG,CAAE,OAAF,CAA5B;AACA,MAAMC,mBAAmB,GAAG,SAA5B;;AAEA,MAAMC,QAAQ,GAAG,QAaV;AAAA,MAbY;AAClBC,IAAAA,GADkB;AAElBC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA,KAAT;AAAgBC,MAAAA,MAAhB;AAAwBC,MAAAA,MAAxB;AAAgCC,MAAAA,UAAhC;AAA4CC,MAAAA;AAA5C,KAFM;AAGlBC,IAAAA,YAHkB;AAIlBC,IAAAA,UAJkB;AAKlBC,IAAAA,aALkB;AAMlBC,IAAAA,OANkB;AAOlBC,IAAAA,OAPkB;AAQlBC,IAAAA,OARkB;AASlBC,IAAAA,MATkB;AAUlBC,IAAAA,MAVkB;AAWlBC,IAAAA,OAXkB;AAYlBC,IAAAA;AAZkB,GAaZ;AACN,QAAMC,WAAW,GAAG,6BAAgBV,YAAhB,EAA8B,CAAEN,KAAF,CAA9B,CAApB;AACA,QAAMiB,eAAe,GAAG,+BAAkB,QAAlB,CAAxB;AACA,QAAMC,aAAa,GAAG,sBAAU,CAAE,MAAF,EAAU,MAAV,CAAV,EAA8BlB,KAA9B,CAAtB;AACA,QAAMmB,WAAW,GAAG,CAAED,aAAF,IAAmBD,eAAvC;AACA,QAAM,CAAE;AAAEG,IAAAA,YAAF;AAAgBC,IAAAA;AAAhB,GAAF,EAAmCC,cAAnC,IAAsD,uBAAU,EAAV,CAA5D;AACA,QA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A,eAAe,EAAC,YALjB;AAMC,QAAA,OAAO,EAAG,MAAM;AACfC,UAAAA,IAAI;AACJ;AARF,QADD;AAYA;AAnBF,IAbF,CADD;AAsCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { includes, pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tcreateInterpolateElement,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n} from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tMenuItem,\n\tPanelBody,\n\tRangeControl,\n\tResizableBox,\n\tSpinner,\n\tToggleControl,\n\tToolbarButton,\n\tPlaceholder,\n\tButton,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalImageEditor as ImageEditor,\n\t__experimentalImageEditingProvider as ImageEditingProvider,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { crop, upload } from '@wordpress/icons';\nimport { SVG, Path } from '@wordpress/primitives';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport useClientWidth from '../image/use-client-width';\n\n/**\n * Module constants\n */\nimport { MIN_SIZE } from '../image/constants';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\nconst ACCEPT_MEDIA_STRING = 'image/*';\n\nconst SiteLogo = ( {\n\talt,\n\tattributes: { align, width, height, isLink, linkTarget, shouldSyncIcon },\n\tcontainerRef,\n\tisSelected,\n\tsetAttributes,\n\tsetLogo,\n\tlogoUrl,\n\tsiteUrl,\n\tlogoId,\n\ticonId,\n\tsetIcon,\n\tcanUserEdit,\n} ) => {\n\tconst clientWidth = useClientWidth( containerRef, [ align ] );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideAligned = includes( [ 'wide', 'full' ], align );\n\tconst isResizable = ! isWideAligned && isLargeViewport;\n\tconst [ { naturalWidth, naturalHeight }, setNaturalSize ] = useState( {} );\n\tconst [ isEditingImage, setIsEditingImage ] = useState( false );\n\tconst { toggleSelection } = useDispatch( blockEditorStore );\n\tconst classes = classnames( 'custom-logo-link', {\n\t\t'is-transient': isBlobURL( logoUrl ),\n\t} );\n\tconst { imageEditing, maxWidth, title } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst siteEntities = select( coreStore ).getEditedEntityRecord(\n\t\t\t'root',\n\t\t\t'site'\n\t\t);\n\t\treturn {\n\t\t\ttitle: siteEntities.title,\n\t\t\t...pick( getSettings(), [ 'imageEditing', 'maxWidth' ] ),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t// Turn the `Use as site icon` toggle off if it is on but the logo and icon have\n\t\t// fallen out of sync. This can happen if the toggle is saved in the `on` position,\n\t\t// but changes are later made to the site icon in the Customizer.\n\t\tif ( shouldSyncIcon && logoId !== iconId ) {\n\t\t\tsetAttributes( { shouldSyncIcon: false } );\n\t\t}\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsEditingImage( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\tfunction onResizeStart() {\n\t\ttoggleSelection( false );\n\t}\n\n\tfunction onResizeStop() {\n\t\ttoggleSelection( true );\n\t}\n\n\tconst img = (\n\t\t<img\n\t\t\tclassName=\"custom-logo\"\n\t\t\tsrc={ logoUrl }\n\t\t\talt={ alt }\n\t\t\tonLoad={ ( event ) => {\n\t\t\t\tsetNaturalSize(\n\t\t\t\t\tpick( event.target, [ 'naturalWidth', 'naturalHeight' ] )\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n\n\tlet imgWrapper = img;\n\n\t// Disable reason: Image itself is not meant to be interactive, but\n\t// should direct focus to block.\n\tif ( isLink ) {\n\t\timgWrapper = (\n\t\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t\t\t<a\n\t\t\t\thref={ siteUrl }\n\t\t\t\tclassName={ classes }\n\t\t\t\trel=\"home\"\n\t\t\t\ttitle={ title }\n\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t{ img }\n\t\t\t</a>\n\t\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t\t);\n\t}\n\n\tlet imageWidthWithinContainer;\n\n\tif ( clientWidth && naturalWidth && naturalHeight ) {\n\t\tconst exceedMaxWidth = naturalWidth > clientWidth;\n\t\timageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;\n\t}\n\n\tif ( ! isResizable || ! imageWidthWithinContainer ) {\n\t\treturn <div style={ { width, height } }>{ imgWrapper }</div>;\n\t}\n\n\t// Set the default width to a responsible size.\n\t// Note that this width is also set in the attached frontend CSS file.\n\tconst defaultWidth = 120;\n\n\tconst currentWidth = width || defaultWidth;\n\tconst ratio = naturalWidth / naturalHeight;\n\tconst currentHeight = currentWidth / ratio;\n\tconst minWidth =\n\t\tnaturalWidth < naturalHeight ? MIN_SIZE : Math.ceil( MIN_SIZE * ratio );\n\tconst minHeight =\n\t\tnaturalHeight < naturalWidth ? MIN_SIZE : Math.ceil( MIN_SIZE / ratio );\n\n\t// With the current implementation of ResizableBox, an image needs an\n\t// explicit pixel value for the max-width. In absence of being able to\n\t// set the content-width, this max-width is currently dictated by the\n\t// vanilla editor style. The following variable adds a buffer to this\n\t// vanilla style, so 3rd party themes have some wiggleroom. This does,\n\t// in most cases, allow you to scale the image beyond the width of the\n\t// main column, though not infinitely.\n\t// @todo It would be good to revisit this once a content-width variable\n\t// becomes available.\n\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\tlet showRightHandle = false;\n\tlet showLeftHandle = false;\n\n\t/* eslint-disable no-lonely-if */\n\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\tif ( align === 'center' ) {\n\t\t// When the image is centered, show both handles.\n\t\tshowRightHandle = true;\n\t\tshowLeftHandle = true;\n\t} else if ( isRTL() ) {\n\t\t// In RTL mode the image is on the right by default.\n\t\t// Show the right handle and hide the left handle only when it is\n\t\t// aligned left. Otherwise always show the left handle.\n\t\tif ( align === 'left' ) {\n\t\t\tshowRightHandle = true;\n\t\t} else {\n\t\t\tshowLeftHandle = true;\n\t\t}\n\t} else {\n\t\t// Show the left handle and hide the right handle only when the\n\t\t// image is aligned right. Otherwise always show the right handle.\n\t\tif ( align === 'right' ) {\n\t\t\tshowLeftHandle = true;\n\t\t} else {\n\t\t\tshowRightHandle = true;\n\t\t}\n\t}\n\t/* eslint-enable no-lonely-if */\n\n\tconst canEditImage =\n\t\tlogoId && naturalWidth && naturalHeight && imageEditing;\n\n\tconst imgEdit =\n\t\tcanEditImage && isEditingImage ? (\n\t\t\t<ImageEditingProvider\n\t\t\t\tid={ logoId }\n\t\t\t\turl={ logoUrl }\n\t\t\t\tnaturalWidth={ naturalWidth }\n\t\t\t\tnaturalHeight={ naturalHeight }\n\t\t\t\tclientWidth={ clientWidth }\n\t\t\t\tonSaveImage={ ( imageAttributes ) => {\n\t\t\t\t\tsetLogo( imageAttributes.id );\n\t\t\t\t} }\n\t\t\t\tisEditing={ isEditingImage }\n\t\t\t\tonFinishEditing={ () => setIsEditingImage( false ) }\n\t\t\t>\n\t\t\t\t<ImageEditor\n\t\t\t\t\turl={ logoUrl }\n\t\t\t\t\twidth={ currentWidth }\n\t\t\t\t\theight={ currentHeight }\n\t\t\t\t\tclientWidth={ clientWidth }\n\t\t\t\t\tnaturalHeight={ naturalHeight }\n\t\t\t\t\tnaturalWidth={ naturalWidth }\n\t\t\t\t/>\n\t\t\t</ImageEditingProvider>\n\t\t) : (\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: currentWidth,\n\t\t\t\t\theight: currentHeight,\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\tlockAspectRatio\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t} }\n\t\t\t\tonResizeStart={ onResizeStart }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tonResizeStop();\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( currentWidth + delta.width, 10 ),\n\t\t\t\t\t\theight: parseInt( currentHeight + delta.height, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ imgWrapper }\n\t\t\t</ResizableBox>\n\t\t);\n\n\tconst syncSiteIconHelpText = createInterpolateElement(\n\t\t__(\n\t\t\t'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>.'\n\t\t),\n\t\t{\n\t\t\ta: (\n\t\t\t\t// eslint-disable-next-line jsx-a11y/anchor-has-content\n\t\t\t\t<a\n\t\t\t\t\thref={\n\t\t\t\t\t\tsiteUrl +\n\t\t\t\t\t\t'/wp-admin/customize.php?autofocus[section]=title_tagline'\n\t\t\t\t\t}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t/>\n\t\t\t),\n\t\t}\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tlabel={ __( 'Image width' ) }\n\t\t\t\t\t\tonChange={ ( newWidth ) =>\n\t\t\t\t\t\t\tsetAttributes( { width: newWidth } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin={ minWidth }\n\t\t\t\t\t\tmax={ maxWidthBuffer }\n\t\t\t\t\t\tinitialPosition={ Math.min(\n\t\t\t\t\t\t\tdefaultWidth,\n\t\t\t\t\t\t\tmaxWidthBuffer\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ width || '' }\n\t\t\t\t\t\tdisabled={ ! isResizable }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Link image to home' ) }\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ canUserEdit && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Use as site icon' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { shouldSyncIcon: value } );\n\t\t\t\t\t\t\t\t\tsetIcon( value ? logoId : undefined );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tchecked={ !! shouldSyncIcon }\n\t\t\t\t\t\t\t\thelp={ syncSiteIconHelpText }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t{ canEditImage && ! isEditingImage && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tonClick={ () => setIsEditingImage( true ) }\n\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t{ imgEdit }\n\t\t</>\n\t);\n};\n\nexport default function LogoEdit( {\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tisSelected,\n} ) {\n\tconst { className: styleClass, width, shouldSyncIcon } = attributes;\n\tconst [ logoUrl, setLogoUrl ] = useState();\n\tconst ref = useRef();\n\n\tconst {\n\t\tsiteLogoId,\n\t\tcanUserEdit,\n\t\turl,\n\t\tsiteIconId,\n\t\tmediaItemData,\n\t\tisRequestingMediaItem,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEditedEntityRecord } = select(\n\t\t\tcoreStore\n\t\t);\n\t\tconst siteSettings = getEditedEntityRecord( 'root', 'site' );\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase' );\n\t\tconst _siteLogo = siteSettings?.site_logo;\n\t\tconst _readOnlyLogo = siteData?.site_logo;\n\t\tconst _canUserEdit = canUser( 'update', 'settings' );\n\t\tconst _siteLogoId = _canUserEdit ? _siteLogo : _readOnlyLogo;\n\t\tconst _siteIconId = siteSettings?.site_icon;\n\t\tconst mediaItem =\n\t\t\t_siteLogoId &&\n\t\t\tselect( coreStore ).getMedia( _siteLogoId, {\n\t\t\t\tcontext: 'view',\n\t\t\t} );\n\t\tconst _isRequestingMediaItem =\n\t\t\t_siteLogoId &&\n\t\t\t! select( coreStore ).hasFinishedResolution( 'getMedia', [\n\t\t\t\t_siteLogoId,\n\t\t\t\t{ context: 'view' },\n\t\t\t] );\n\n\t\treturn {\n\t\t\tsiteLogoId: _siteLogoId,\n\t\t\tcanUserEdit: _canUserEdit,\n\t\t\turl: siteData?.url,\n\t\t\tmediaItemData: mediaItem && {\n\t\t\t\tid: mediaItem.id,\n\t\t\t\turl: mediaItem.source_url,\n\t\t\t\talt: mediaItem.alt_text,\n\t\t\t},\n\t\t\tisRequestingMediaItem: _isRequestingMediaItem,\n\t\t\tsiteIconId: _siteIconId,\n\t\t};\n\t}, [] );\n\n\tconst { getGlobalBlockCount } = useSelect( blockEditorStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tuseEffect( () => {\n\t\t// Cleanup function to discard unsaved changes to the icon and logo when\n\t\t// the block is removed.\n\t\treturn () => {\n\t\t\t// Do nothing if the block is being rendered in the styles preview or the\n\t\t\t// block inserter.\n\t\t\tif (\n\t\t\t\tstyleClass?.includes(\n\t\t\t\t\t'block-editor-block-types-list__site-logo-example'\n\t\t\t\t) ||\n\t\t\t\tstyleClass?.includes(\n\t\t\t\t\t'block-editor-block-styles__block-preview-container'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst logoBlockCount = getGlobalBlockCount( 'core/site-logo' );\n\n\t\t\t// Only discard unsaved changes if we are removing the last Site Logo block\n\t\t\t// on the page.\n\t\t\tif ( logoBlockCount === 0 ) {\n\t\t\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\t\t\tsite_logo: undefined,\n\t\t\t\t\tsite_icon: undefined,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tconst setLogo = ( newValue, shouldForceSync = false ) => {\n\t\t// `shouldForceSync` is used to force syncing when the attribute\n\t\t// may not have updated yet.\n\t\tif ( shouldSyncIcon || shouldForceSync ) {\n\t\t\tsetIcon( newValue );\n\t\t}\n\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tsite_logo: newValue,\n\t\t} );\n\t};\n\n\tconst setIcon = ( newValue ) =>\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tsite_icon: newValue,\n\t\t} );\n\n\tlet alt = null;\n\tif ( mediaItemData ) {\n\t\talt = mediaItemData.alt;\n\t\tif ( logoUrl !== mediaItemData.url ) {\n\t\t\tsetLogoUrl( mediaItemData.url );\n\t\t}\n\t}\n\n\tconst onInitialSelectLogo = ( media ) => {\n\t\t// Initialize the syncSiteIcon toggle. If we currently have no Site logo and no\n\t\t// site icon, automatically sync the logo to the icon.\n\t\tif ( shouldSyncIcon === undefined ) {\n\t\t\tconst shouldForceSync = ! siteIconId;\n\t\t\tsetAttributes( { shouldSyncIcon: shouldForceSync } );\n\n\t\t\t// Because we cannot rely on the `shouldSyncIcon` attribute to have updated by\n\t\t\t// the time `setLogo` is called, pass an argument to force the syncing.\n\t\t\tonSelectLogo( media, shouldForceSync );\n\t\t\treturn;\n\t\t}\n\n\t\tonSelectLogo( media );\n\t};\n\n\tconst onSelectLogo = ( media, shouldForceSync = false ) => {\n\t\tif ( ! media ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! media.id && media.url ) {\n\t\t\t// This is a temporary blob image\n\t\t\tsetLogo( undefined );\n\t\t\tsetLogoUrl( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\tsetLogo( media.id, shouldForceSync );\n\t};\n\n\tconst onRemoveLogo = () => {\n\t\tsetLogo( null );\n\t\tsetLogoUrl( undefined );\n\t\tsetAttributes( { width: undefined } );\n\t};\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message[ 2 ], { type: 'snackbar' } );\n\t};\n\n\tconst controls = canUserEdit && logoUrl && (\n\t\t<BlockControls group=\"other\">\n\t\t\t<MediaReplaceFlow\n\t\t\t\tmediaURL={ logoUrl }\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\taccept={ ACCEPT_MEDIA_STRING }\n\t\t\t\tonSelect={ onSelectLogo }\n\t\t\t\tonError={ onUploadError }\n\t\t\t>\n\t\t\t\t<MenuItem onClick={ onRemoveLogo }>{ __( 'Reset' ) }</MenuItem>\n\t\t\t</MediaReplaceFlow>\n\t\t</BlockControls>\n\t);\n\n\tlet logoImage;\n\tconst isLoading = siteLogoId === undefined || isRequestingMediaItem;\n\tif ( isLoading ) {\n\t\tlogoImage = <Spinner />;\n\t}\n\tif ( !! logoUrl ) {\n\t\tlogoImage = (\n\t\t\t<SiteLogo\n\t\t\t\talt={ alt }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tclassName={ className }\n\t\t\t\tcontainerRef={ ref }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tlogoUrl={ logoUrl }\n\t\t\t\tsetLogo={ setLogo }\n\t\t\t\tlogoId={ mediaItemData?.id || siteLogoId }\n\t\t\t\tsiteUrl={ url }\n\t\t\t\tsetIcon={ setIcon }\n\t\t\t\ticonId={ siteIconId }\n\t\t\t\tcanUserEdit={ canUserEdit }\n\t\t\t/>\n\t\t);\n\t}\n\tconst placeholder = ( content ) => {\n\t\tconst placeholderClassName = classnames(\n\t\t\t'block-editor-media-placeholder',\n\t\t\tclassName\n\t\t);\n\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ placeholderClassName }\n\t\t\t\tpreview={ logoImage }\n\t\t\t>\n\t\t\t\t{\n\t\t\t\t\t<SVG\n\t\t\t\t\t\tclassName=\"components-placeholder__illustration\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\tviewBox=\"0 0 60 60\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Path\n\t\t\t\t\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t\t\t\t\t\td=\"m61 32.622-13.555-9.137-15.888 9.859a5 5 0 0 1-5.386-.073l-9.095-5.989L1 37.5\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SVG>\n\t\t\t\t}\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst classes = classnames( className, {\n\t\t'is-default-size': ! width,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tref,\n\t\tclassName: classes,\n\t} );\n\n\tconst label = __( 'Add a site logo' );\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\t\t\t{ !! logoUrl && logoImage }\n\t\t\t{ ! logoUrl && ! canUserEdit && (\n\t\t\t\t<Placeholder className=\"site-logo_placeholder\">\n\t\t\t\t\t{ isLoading && (\n\t\t\t\t\t\t<span className=\"components-placeholder__preview\">\n\t\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t{ ! logoUrl && canUserEdit && (\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\tonSelect={ onInitialSelectLogo }\n\t\t\t\t\taccept={ ACCEPT_MEDIA_STRING }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\ttooltipPosition=\"top center\"\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topen();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"]}
|
package/build/site-logo/index.js
CHANGED
|
@@ -19,7 +19,6 @@ var _edit = _interopRequireDefault(require("./edit"));
|
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
21
|
const metadata = {
|
|
22
|
-
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
23
22
|
apiVersion: 2,
|
|
24
23
|
name: "core/site-logo",
|
|
25
24
|
title: "Site Logo",
|
|
@@ -27,9 +26,6 @@ const metadata = {
|
|
|
27
26
|
description: "Display a graphic to represent this site. Update the block, and the changes apply everywhere it\u2019s 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.",
|
|
28
27
|
textdomain: "default",
|
|
29
28
|
attributes: {
|
|
30
|
-
align: {
|
|
31
|
-
type: "string"
|
|
32
|
-
},
|
|
33
29
|
width: {
|
|
34
30
|
type: "number"
|
|
35
31
|
},
|
|
@@ -40,12 +36,16 @@ const metadata = {
|
|
|
40
36
|
linkTarget: {
|
|
41
37
|
type: "string",
|
|
42
38
|
"default": "_self"
|
|
39
|
+
},
|
|
40
|
+
shouldSyncIcon: {
|
|
41
|
+
type: "boolean"
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
44
|
example: {
|
|
46
45
|
viewportWidth: 500,
|
|
47
46
|
attributes: {
|
|
48
|
-
width: 350
|
|
47
|
+
width: 350,
|
|
48
|
+
className: "block-editor-block-types-list__site-logo-example"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
supports: {
|
|
@@ -17,12 +17,11 @@ var _deprecated = _interopRequireDefault(require("./deprecated"));
|
|
|
17
17
|
* Internal dependencies
|
|
18
18
|
*/
|
|
19
19
|
const metadata = {
|
|
20
|
-
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
21
20
|
apiVersion: 2,
|
|
22
21
|
name: "core/site-tagline",
|
|
23
22
|
title: "Site Tagline",
|
|
24
23
|
category: "theme",
|
|
25
|
-
description: "Describe in a few words what the
|
|
24
|
+
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.",
|
|
26
25
|
keywords: ["description"],
|
|
27
26
|
textdomain: "default",
|
|
28
27
|
attributes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/site-tagline/index.js"],"names":["name","metadata","settings","icon","edit","deprecated"],"mappings":";;;;;;;;;AAIA;;AACA;;AACA;;AANA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/site-tagline/index.js"],"names":["name","metadata","settings","icon","edit","deprecated"],"mappings":";;;;;;;;;AAIA;;AACA;;AACA;;AANA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,aADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,UAAU,EAAVA;AAHuB,CAAjB","sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport icon from './icon';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tdeprecated,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/site-title/index.js"],"names":["name","metadata","settings","icon","edit","deprecated"],"mappings":";;;;;;;;;AAGA;;AAMA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/site-title/index.js"],"names":["name","metadata","settings","icon","edit","deprecated"],"mappings":";;;;;;;;;AAGA;;AAMA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,gBADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,UAAU,EAAVA;AAHuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { mapMarker as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tdeprecated,\n};\n"]}
|
|
@@ -21,13 +21,12 @@ var _variations = _interopRequireDefault(require("./variations"));
|
|
|
21
21
|
* Internal dependencies
|
|
22
22
|
*/
|
|
23
23
|
const metadata = {
|
|
24
|
-
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
25
24
|
apiVersion: 2,
|
|
26
25
|
name: "core/social-link",
|
|
27
26
|
title: "Social Icon",
|
|
28
27
|
category: "widgets",
|
|
29
28
|
parent: ["core/social-links"],
|
|
30
|
-
description: "Display an icon linking to a social media profile or
|
|
29
|
+
description: "Display an icon linking to a social media profile or website.",
|
|
31
30
|
textdomain: "default",
|
|
32
31
|
attributes: {
|
|
33
32
|
url: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/social-link/index.js"],"names":["name","metadata","settings","icon","edit","variations"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/social-link/index.js"],"names":["name","metadata","settings","icon","edit","variations"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,UAAU,EAAVA;AAHuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { share as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport metadata from './block.json';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tvariations,\n};\n"]}
|
|
@@ -23,12 +23,11 @@ var _save = _interopRequireDefault(require("./save"));
|
|
|
23
23
|
* Internal dependencies
|
|
24
24
|
*/
|
|
25
25
|
const metadata = {
|
|
26
|
-
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
27
26
|
apiVersion: 2,
|
|
28
27
|
name: "core/social-links",
|
|
29
28
|
title: "Social Icons",
|
|
30
29
|
category: "widgets",
|
|
31
|
-
description: "Display icons linking to your social media profiles or
|
|
30
|
+
description: "Display icons linking to your social media profiles or websites.",
|
|
32
31
|
keywords: ["links"],
|
|
33
32
|
textdomain: "default",
|
|
34
33
|
attributes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/social-links/index.js"],"names":["name","metadata","settings","example","innerBlocks","attributes","service","url","icon","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/social-links/index.js"],"names":["name","metadata","settings","example","innerBlocks","attributes","service","url","icon","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,WAAW,EAAE,CACZ;AACCJ,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,WADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KADY,EAQZ;AACCP,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,UADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KARY,EAeZ;AACCP,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,SADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KAfY;AADL,GADc;AA0BvBC,EAAAA,IAAI,EAAJA,YA1BuB;AA2BvBC,EAAAA,IAAI,EAAJA,aA3BuB;AA4BvBC,EAAAA,IAAI,EAAJA,aA5BuB;AA6BvBC,EAAAA,UAAU,EAAVA;AA7BuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { share as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\texample: {\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'wordpress',\n\t\t\t\t\turl: 'https://wordpress.org',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'facebook',\n\t\t\t\t\turl: 'https://www.facebook.com/WordPress/',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'twitter',\n\t\t\t\t\turl: 'https://twitter.com/WordPress',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
|
package/build/spacer/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/spacer/index.js"],"names":["name","metadata","settings","icon","edit","save"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/spacer/index.js"],"names":["name","metadata","settings","icon","edit","save"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,qBADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { resizeCornerNE as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n"]}
|
package/build/table/index.js
CHANGED
|
@@ -27,7 +27,6 @@ var _transforms = _interopRequireDefault(require("./transforms"));
|
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
29
|
const metadata = {
|
|
30
|
-
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
31
30
|
apiVersion: 2,
|
|
32
31
|
name: "core/table",
|
|
33
32
|
title: "Table",
|
|
@@ -173,12 +172,7 @@ const metadata = {
|
|
|
173
172
|
__experimentalSkipSerialization: true,
|
|
174
173
|
color: true,
|
|
175
174
|
style: true,
|
|
176
|
-
width: true
|
|
177
|
-
__experimentalDefaultControls: {
|
|
178
|
-
color: true,
|
|
179
|
-
style: true,
|
|
180
|
-
width: true
|
|
181
|
-
}
|
|
175
|
+
width: true
|
|
182
176
|
},
|
|
183
177
|
__experimentalSelector: ".wp-block-table > table"
|
|
184
178
|
},
|
package/build/table/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/table/index.js"],"names":["name","metadata","settings","icon","example","attributes","head","cells","content","tag","body","transforms","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/table/index.js"],"names":["name","metadata","settings","icon","example","attributes","head","cells","content","tag","body","transforms","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,iBADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,IAAI,EAAE,CACL;AACCC,QAAAA,KAAK,EAAE,CACN;AACCC,UAAAA,OAAO,EAAE,cAAI,SAAJ,CADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SADM,EAKN;AACCD,UAAAA,OAAO,EAAE,cAAI,eAAJ,CADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SALM,EASN;AACCD,UAAAA,OAAO,EAAE,cAAI,cAAJ,CADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SATM;AADR,OADK,CADK;AAmBXC,MAAAA,IAAI,EAAE,CACL;AACCH,QAAAA,KAAK,EAAE,CACN;AACCC,UAAAA,OAAO,EAAE,KADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SADM,EAKN;AACCD,UAAAA,OAAO,EAAE,gBADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SALM,EASN;AACCD,UAAAA,OAAO,EAAE,cAAI,aAAJ,CADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SATM;AADR,OADK,EAiBL;AACCF,QAAAA,KAAK,EAAE,CACN;AACCC,UAAAA,OAAO,EAAE,KADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SADM,EAKN;AACCD,UAAAA,OAAO,EAAE,cADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SALM,EASN;AACCD,UAAAA,OAAO,EAAE,cAAI,mBAAJ,CADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SATM;AADR,OAjBK,EAiCL;AACCF,QAAAA,KAAK,EAAE,CACN;AACCC,UAAAA,OAAO,EAAE,KADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SADM,EAKN;AACCD,UAAAA,OAAO,EAAE,aADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SALM,EASN;AACCD,UAAAA,OAAO,EAAE,cAAI,kBAAJ,CADV;AAECC,UAAAA,GAAG,EAAE;AAFN,SATM;AADR,OAjCK;AAnBK;AADJ,GAFc;AA0EvBE,EAAAA,UAAU,EAAVA,mBA1EuB;AA2EvBC,EAAAA,IAAI,EAAJA,aA3EuB;AA4EvBC,EAAAA,IAAI,EAAJA,aA5EuB;AA6EvBC,EAAAA,UAAU,EAAVA;AA7EuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { blockTable as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\thead: [\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Version' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Jazz Musician' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Release Date' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t\tbody: [\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.2',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Jaco Pastorius',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'May 7, 2019' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.1',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Betty Carter',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'February 21, 2019' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.0',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Bebo Valdés',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'December 6, 2018' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/table-of-contents/index.js"],"names":["name","metadata","settings","icon","edit"],"mappings":";;;;;;;;;AAIA;;AACA;;AALA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/table-of-contents/index.js"],"names":["name","metadata","settings","icon","edit"],"mappings":";;;;;;;;;AAIA;;AACA;;AALA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,aADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB","sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport icon from './icon';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n"]}
|
package/build/tag-cloud/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/tag-cloud/index.js"],"names":["name","metadata","settings","icon","example","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/tag-cloud/index.js"],"names":["name","metadata","settings","icon","example","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,UADuB;AAEvBC,EAAAA,OAAO,EAAE,EAFc;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { tag as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {},\n\tedit,\n};\n"]}
|