@wordpress/block-library 8.3.6 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/archives/edit.js +3 -0
- package/build/archives/edit.js.map +1 -1
- package/build/archives/index.js +1 -0
- package/build/archives/index.js.map +1 -1
- package/build/audio/edit.js +2 -0
- package/build/audio/edit.js.map +1 -1
- package/build/avatar/edit.js +5 -9
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/index.js +1 -0
- package/build/avatar/index.js.map +1 -1
- package/build/button/edit.js +3 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +17 -6
- package/build/button/index.js.map +1 -1
- package/build/calendar/index.js +1 -0
- package/build/calendar/index.js.map +1 -1
- package/build/categories/edit.js +5 -0
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +1 -0
- package/build/categories/index.js.map +1 -1
- package/build/columns/edit.js +1 -0
- package/build/columns/edit.js.map +1 -1
- package/build/columns/utils.js +2 -2
- package/build/columns/utils.js.map +1 -1
- package/build/comment-author-avatar/index.js +1 -0
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-author-name/edit.js +2 -0
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-author-name/index.js +1 -0
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +1 -0
- package/build/comment-content/index.js.map +1 -1
- package/build/comment-date/edit.js +1 -0
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-date/index.js +1 -0
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/edit.js +1 -0
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/comment-edit-link/index.js +1 -0
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +1 -0
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/index.js +1 -0
- package/build/comment-template/index.js.map +1 -1
- package/build/comments/index.js +2 -1
- package/build/comments/index.js.map +1 -1
- package/build/comments-pagination/index.js +1 -0
- package/build/comments-pagination/index.js.map +1 -1
- package/build/comments-pagination-next/index.js +1 -0
- package/build/comments-pagination-next/index.js.map +1 -1
- package/build/comments-pagination-numbers/index.js +1 -0
- package/build/comments-pagination-numbers/index.js.map +1 -1
- package/build/comments-pagination-previous/index.js +1 -0
- package/build/comments-pagination-previous/index.js.map +1 -1
- package/build/comments-title/edit.js +2 -0
- package/build/comments-title/edit.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -0
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/embed/embed-controls.js +1 -0
- package/build/embed/embed-controls.js.map +1 -1
- package/build/file/index.js +10 -1
- package/build/file/index.js.map +1 -1
- package/build/file/inspector.js +3 -0
- package/build/file/inspector.js.map +1 -1
- package/build/freeform/modal.js +1 -1
- package/build/freeform/modal.js.map +1 -1
- package/build/gallery/edit.js +2 -0
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/shared.js +4 -8
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/use-image-sizes.js +4 -8
- package/build/gallery/use-image-sizes.js.map +1 -1
- package/build/gallery/v1/edit.js +8 -3
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery-image.js +1 -3
- package/build/gallery/v1/gallery-image.js.map +1 -1
- package/build/gallery/v1/shared.js +4 -7
- package/build/gallery/v1/shared.js.map +1 -1
- package/build/home-link/index.js +1 -0
- package/build/home-link/index.js.map +1 -1
- package/build/image/edit.js +6 -4
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +18 -13
- package/build/image/image.js.map +1 -1
- package/build/image/utils.js +3 -1
- package/build/image/utils.js.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/latest-comments/edit.js +9 -2
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-comments/index.js +14 -0
- package/build/latest-comments/index.js.map +1 -1
- package/build/latest-posts/deprecated.js +1 -0
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/edit.js +4 -0
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/index.js +1 -0
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/ordered-list-settings.js +1 -0
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list-item/edit.js +2 -2
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +2 -1
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/loginout/edit.js +2 -0
- package/build/loginout/edit.js.map +1 -1
- package/build/loginout/index.js +1 -0
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/edit.js +2 -0
- package/build/media-text/edit.js.map +1 -1
- package/build/more/edit.js +1 -0
- package/build/more/edit.js.map +1 -1
- package/build/navigation/edit/index.js +80 -54
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +14 -11
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +1 -0
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +1 -1
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build/navigation/edit/use-generate-default-navigation-title.js +1 -1
- package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build/navigation/edit/use-navigation-notice.js +4 -7
- package/build/navigation/edit/use-navigation-notice.js.map +1 -1
- package/build/navigation/index.js +1 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +1 -1
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/edit.js +10 -5
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js +2 -0
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +47 -0
- package/build/page-list/convert-to-links-modal.js.map +1 -0
- package/build/page-list/edit.js +15 -28
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +1 -0
- package/build/page-list/index.js.map +1 -1
- package/build/page-list/use-convert-to-navigation-links.js +61 -5
- package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build/paragraph/edit.js +1 -0
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-author/edit.js +4 -0
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +1 -0
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/index.js +1 -0
- package/build/post-author-biography/index.js.map +1 -1
- package/build/post-author-name/edit.js +2 -0
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-author-name/index.js +1 -0
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comments-count/index.js +1 -0
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/index.js +1 -0
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +1 -0
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/index.js +1 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +2 -0
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +1 -0
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/edit.js +50 -3
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +5 -0
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +52 -1
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +11 -4
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +4 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/edit.js +2 -0
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-navigation-link/index.js +1 -0
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-template/index.js +1 -0
- package/build/post-template/index.js.map +1 -1
- package/build/post-terms/index.js +1 -0
- package/build/post-terms/index.js.map +1 -1
- package/build/post-terms/use-post-terms.js +1 -1
- package/build/post-terms/use-post-terms.js.map +1 -1
- package/build/post-time-to-read/edit.js +104 -0
- package/build/post-time-to-read/edit.js.map +1 -0
- package/build/post-time-to-read/icon.js +25 -0
- package/build/post-time-to-read/icon.js.map +1 -0
- package/build/post-time-to-read/index.js +57 -0
- package/build/post-time-to-read/index.js.map +1 -0
- package/build/post-title/edit.js +2 -0
- package/build/post-title/edit.js.map +1 -1
- package/build/post-title/index.js +1 -0
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -0
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/index.js +1 -0
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +1 -0
- package/build/query/utils.js.map +1 -1
- package/build/query-no-results/index.js +1 -0
- package/build/query-no-results/index.js.map +1 -1
- package/build/query-pagination/index.js +1 -0
- package/build/query-pagination/index.js.map +1 -1
- package/build/query-pagination-next/index.js +1 -0
- package/build/query-pagination-next/index.js.map +1 -1
- package/build/query-pagination-numbers/index.js +1 -0
- package/build/query-pagination-numbers/index.js.map +1 -1
- package/build/query-pagination-previous/index.js +1 -0
- package/build/query-pagination-previous/index.js.map +1 -1
- package/build/query-title/edit.js +2 -0
- package/build/query-title/edit.js.map +1 -1
- package/build/query-title/index.js +1 -0
- package/build/query-title/index.js.map +1 -1
- package/build/read-more/edit.js +1 -0
- package/build/read-more/edit.js.map +1 -1
- package/build/read-more/index.js +1 -0
- package/build/read-more/index.js.map +1 -1
- package/build/rss/edit.js +3 -0
- package/build/rss/edit.js.map +1 -1
- package/build/rss/index.js +1 -0
- package/build/rss/index.js.map +1 -1
- package/build/search/index.js +1 -0
- package/build/search/index.js.map +1 -1
- package/build/site-logo/edit.js +10 -11
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +1 -0
- package/build/site-logo/index.js.map +1 -1
- package/build/site-tagline/index.js +1 -0
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/edit/index.js +2 -0
- package/build/site-title/edit/index.js.map +1 -1
- package/build/site-title/index.js +1 -0
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/index.js +1 -0
- package/build/social-link/index.js.map +1 -1
- package/build/social-links/edit.js +2 -0
- package/build/social-links/edit.js.map +1 -1
- package/build/spacer/controls.native.js +10 -8
- package/build/spacer/controls.native.js.map +1 -1
- package/build/spacer/edit.native.js +43 -5
- package/build/spacer/edit.native.js.map +1 -1
- package/build/spacer/save.native.js +30 -0
- package/build/spacer/save.native.js.map +1 -0
- package/build/table/edit.js +6 -3
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -0
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/utils.js +1 -1
- package/build/table-of-contents/utils.js.map +1 -1
- package/build/tag-cloud/edit.js +1 -0
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/tag-cloud/index.js +1 -0
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/index.js +1 -0
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/index.js +1 -0
- package/build/term-description/index.js.map +1 -1
- package/build/verse/index.js +6 -0
- package/build/verse/index.js.map +1 -1
- package/build/video/edit-common-settings.js +5 -0
- package/build/video/edit-common-settings.js.map +1 -1
- package/build-module/archives/edit.js +3 -0
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/archives/index.js +1 -0
- package/build-module/archives/index.js.map +1 -1
- package/build-module/audio/edit.js +2 -0
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/avatar/edit.js +5 -8
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/index.js +1 -0
- package/build-module/avatar/index.js.map +1 -1
- package/build-module/button/edit.js +2 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +17 -6
- package/build-module/button/index.js.map +1 -1
- package/build-module/calendar/index.js +1 -0
- package/build-module/calendar/index.js.map +1 -1
- package/build-module/categories/edit.js +5 -0
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +1 -0
- package/build-module/categories/index.js.map +1 -1
- package/build-module/columns/edit.js +1 -0
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/utils.js +3 -3
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +1 -0
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-author-name/edit.js +2 -0
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-author-name/index.js +1 -0
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +1 -0
- package/build-module/comment-content/index.js.map +1 -1
- package/build-module/comment-date/edit.js +1 -0
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-date/index.js +1 -0
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/edit.js +1 -0
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/comment-edit-link/index.js +1 -0
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +1 -0
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/index.js +1 -0
- package/build-module/comment-template/index.js.map +1 -1
- package/build-module/comments/index.js +2 -1
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments-pagination/index.js +1 -0
- package/build-module/comments-pagination/index.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +1 -0
- package/build-module/comments-pagination-next/index.js.map +1 -1
- package/build-module/comments-pagination-numbers/index.js +1 -0
- package/build-module/comments-pagination-numbers/index.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +1 -0
- package/build-module/comments-pagination-previous/index.js.map +1 -1
- package/build-module/comments-title/edit.js +2 -0
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +2 -0
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/embed/embed-controls.js +1 -0
- package/build-module/embed/embed-controls.js.map +1 -1
- package/build-module/file/index.js +10 -1
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/inspector.js +3 -0
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/freeform/modal.js +1 -1
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/gallery/edit.js +2 -0
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/shared.js +4 -7
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/use-image-sizes.js +4 -7
- package/build-module/gallery/use-image-sizes.js.map +1 -1
- package/build-module/gallery/v1/edit.js +9 -4
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.js +1 -2
- package/build-module/gallery/v1/gallery-image.js.map +1 -1
- package/build-module/gallery/v1/shared.js +4 -6
- package/build-module/gallery/v1/shared.js.map +1 -1
- package/build-module/home-link/index.js +1 -0
- package/build-module/home-link/index.js.map +1 -1
- package/build-module/image/edit.js +7 -5
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +19 -14
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/utils.js +4 -2
- package/build-module/image/utils.js.map +1 -1
- package/build-module/index.js +2 -1
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/edit.js +9 -2
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-comments/index.js +14 -0
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +1 -0
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/edit.js +4 -0
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/index.js +1 -0
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +1 -0
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list-item/edit.js +2 -2
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +2 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/loginout/edit.js +2 -0
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/loginout/index.js +1 -0
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/edit.js +2 -0
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/more/edit.js +1 -0
- package/build-module/more/edit.js.map +1 -1
- package/build-module/navigation/edit/index.js +82 -56
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +14 -10
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +1 -0
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +1 -1
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build-module/navigation/edit/use-generate-default-navigation-title.js +1 -1
- package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build-module/navigation/edit/use-navigation-notice.js +5 -8
- package/build-module/navigation/edit/use-navigation-notice.js.map +1 -1
- package/build-module/navigation/index.js +1 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +1 -1
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/edit.js +10 -5
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +2 -0
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +35 -0
- package/build-module/page-list/convert-to-links-modal.js.map +1 -0
- package/build-module/page-list/edit.js +15 -29
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +1 -0
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/page-list/use-convert-to-navigation-links.js +61 -5
- package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build-module/paragraph/edit.js +1 -0
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-author/edit.js +4 -0
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +1 -0
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/index.js +1 -0
- package/build-module/post-author-biography/index.js.map +1 -1
- package/build-module/post-author-name/edit.js +2 -0
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +1 -0
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comments-count/index.js +1 -0
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/index.js +1 -0
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +1 -0
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/index.js +1 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +2 -0
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +1 -0
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +53 -5
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +5 -0
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +52 -1
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +11 -4
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +4 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +2 -0
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-navigation-link/index.js +1 -0
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-template/index.js +1 -0
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-terms/index.js +1 -0
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-terms/use-post-terms.js +1 -1
- package/build-module/post-terms/use-post-terms.js.map +1 -1
- package/build-module/post-time-to-read/edit.js +90 -0
- package/build-module/post-time-to-read/edit.js.map +1 -0
- package/build-module/post-time-to-read/icon.js +15 -0
- package/build-module/post-time-to-read/icon.js.map +1 -0
- package/build-module/post-time-to-read/index.js +40 -0
- package/build-module/post-time-to-read/index.js.map +1 -0
- package/build-module/post-title/edit.js +2 -0
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/post-title/index.js +1 -0
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -0
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/index.js +1 -0
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +1 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-no-results/index.js +1 -0
- package/build-module/query-no-results/index.js.map +1 -1
- package/build-module/query-pagination/index.js +1 -0
- package/build-module/query-pagination/index.js.map +1 -1
- package/build-module/query-pagination-next/index.js +1 -0
- package/build-module/query-pagination-next/index.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +1 -0
- package/build-module/query-pagination-numbers/index.js.map +1 -1
- package/build-module/query-pagination-previous/index.js +1 -0
- package/build-module/query-pagination-previous/index.js.map +1 -1
- package/build-module/query-title/edit.js +2 -0
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-title/index.js +1 -0
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/read-more/edit.js +1 -0
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/read-more/index.js +1 -0
- package/build-module/read-more/index.js.map +1 -1
- package/build-module/rss/edit.js +3 -0
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/rss/index.js +1 -0
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/index.js +1 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/site-logo/edit.js +10 -11
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +1 -0
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-tagline/index.js +1 -0
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/edit/index.js +2 -0
- package/build-module/site-title/edit/index.js.map +1 -1
- package/build-module/site-title/index.js +1 -0
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/index.js +1 -0
- package/build-module/social-link/index.js.map +1 -1
- package/build-module/social-links/edit.js +2 -0
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/spacer/controls.native.js +9 -8
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/spacer/edit.native.js +39 -7
- package/build-module/spacer/edit.native.js.map +1 -1
- package/build-module/spacer/save.native.js +22 -0
- package/build-module/spacer/save.native.js.map +1 -0
- package/build-module/table/edit.js +6 -3
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -0
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/utils.js +1 -1
- package/build-module/table-of-contents/utils.js.map +1 -1
- package/build-module/tag-cloud/edit.js +1 -0
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/tag-cloud/index.js +1 -0
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/index.js +1 -0
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/index.js +1 -0
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/verse/index.js +6 -0
- package/build-module/verse/index.js.map +1 -1
- package/build-module/video/edit-common-settings.js +5 -0
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-style/avatar/style-rtl.css +3 -0
- package/build-style/avatar/style.css +3 -0
- package/build-style/button/editor-rtl.css +31 -0
- package/build-style/button/editor.css +31 -0
- package/build-style/button/style-rtl.css +31 -0
- package/build-style/button/style.css +31 -0
- package/build-style/editor-rtl.css +33 -1
- package/build-style/editor.css +33 -1
- package/build-style/file/style-rtl.css +1 -0
- package/build-style/file/style.css +1 -0
- package/build-style/image/editor-rtl.css +1 -0
- package/build-style/image/editor.css +1 -0
- package/build-style/image/style-rtl.css +6 -2
- package/build-style/image/style.css +6 -0
- package/build-style/latest-comments/style-rtl.css +18 -5
- package/build-style/latest-comments/style.css +18 -5
- package/build-style/post-excerpt/editor-rtl.css +1 -1
- package/build-style/post-excerpt/editor.css +1 -1
- package/build-style/style-rtl.css +59 -7
- package/build-style/style.css +59 -5
- package/build-types/table-of-contents/utils.d.ts +1 -1
- package/package.json +31 -30
- package/src/archives/block.json +1 -0
- package/src/archives/edit.js +3 -0
- package/src/audio/edit.js +2 -0
- package/src/audio/test/__snapshots__/edit.native.js.snap +38 -38
- package/src/avatar/block.json +1 -0
- package/src/avatar/edit.js +2 -4
- package/src/avatar/index.php +67 -63
- package/src/avatar/style.scss +3 -0
- package/src/button/block.json +17 -6
- package/src/button/edit.js +2 -1
- package/src/button/editor.scss +36 -0
- package/src/button/style.scss +37 -1
- package/src/buttons/test/__snapshots__/edit.native.js.snap +11 -11
- package/src/calendar/block.json +1 -0
- package/src/categories/block.json +1 -0
- package/src/categories/edit.js +5 -0
- package/src/code/test/__snapshots__/edit.native.js.snap +2 -2
- package/src/columns/edit.js +1 -0
- package/src/columns/test/__snapshots__/edit.native.js.snap +66 -66
- package/src/columns/test/utils.js +54 -0
- package/src/columns/utils.js +8 -8
- package/src/comment-author-avatar/block.json +1 -0
- package/src/comment-author-name/block.json +1 -0
- package/src/comment-author-name/edit.js +2 -0
- package/src/comment-content/block.json +1 -0
- package/src/comment-date/block.json +1 -0
- package/src/comment-date/edit.js +1 -0
- package/src/comment-edit-link/block.json +1 -0
- package/src/comment-edit-link/edit.js +1 -0
- package/src/comment-reply-link/block.json +1 -0
- package/src/comment-template/block.json +1 -0
- package/src/comments/block.json +2 -1
- package/src/comments-pagination/block.json +1 -0
- package/src/comments-pagination-next/block.json +1 -0
- package/src/comments-pagination-numbers/block.json +1 -0
- package/src/comments-pagination-previous/block.json +1 -0
- package/src/comments-title/edit.js +2 -0
- package/src/cover/edit/inspector-controls.js +2 -0
- package/src/cover/index.php +4 -6
- package/src/cover/test/__snapshots__/edit.native.js.snap +36 -36
- package/src/embed/embed-controls.js +1 -0
- package/src/embed/test/__snapshots__/index.native.js.snap +52 -52
- package/src/file/block.json +10 -1
- package/src/file/inspector.js +3 -0
- package/src/file/style.scss +1 -0
- package/src/file/test/__snapshots__/edit.native.js.snap +49 -49
- package/src/freeform/modal.js +1 -1
- package/src/gallery/edit.js +2 -0
- package/src/gallery/shared.js +6 -11
- package/src/gallery/test/__snapshots__/index.native.js.snap +71 -71
- package/src/gallery/use-image-sizes.js +3 -16
- package/src/gallery/v1/edit.js +8 -16
- package/src/gallery/v1/gallery-image.js +1 -2
- package/src/gallery/v1/shared.js +5 -10
- package/src/group/test/__snapshots__/edit.native.js.snap +5 -5
- package/src/heading/test/__snapshots__/index.native.js.snap +1 -1
- package/src/home-link/block.json +1 -0
- package/src/image/edit.js +4 -4
- package/src/image/editor.scss +1 -0
- package/src/image/image.js +9 -20
- package/src/image/index.php +4 -4
- package/src/image/style.scss +13 -0
- package/src/image/utils.js +2 -2
- package/src/index.js +2 -0
- package/src/latest-comments/block.json +14 -0
- package/src/latest-comments/edit.js +12 -2
- package/src/latest-comments/style.scss +25 -7
- package/src/latest-posts/block.json +1 -0
- package/src/latest-posts/edit.js +4 -0
- package/src/list/ordered-list-settings.js +1 -0
- package/src/list/test/__snapshots__/edit.native.js.snap +4 -4
- package/src/list-item/edit.js +10 -3
- package/src/list-item/hooks/use-outdent-list-item.js +2 -1
- package/src/loginout/block.json +1 -0
- package/src/loginout/edit.js +2 -0
- package/src/media-text/edit.js +2 -0
- package/src/missing/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/more/edit.js +1 -0
- package/src/navigation/block.json +1 -0
- package/src/navigation/edit/index.js +130 -82
- package/src/navigation/edit/navigation-menu-selector.js +12 -26
- package/src/navigation/edit/overlay-menu-preview.js +1 -0
- package/src/navigation/edit/placeholder/index.js +1 -1
- package/src/navigation/edit/test/navigation-menu-selector.js +638 -0
- package/src/navigation/edit/unsaved-inner-blocks.js +1 -0
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +51 -48
- package/src/navigation/edit/use-create-navigation-menu.js +1 -1
- package/src/navigation/edit/use-generate-default-navigation-title.js +1 -1
- package/src/navigation/edit/use-navigation-notice.js +16 -13
- package/src/navigation/index.php +50 -25
- package/src/navigation/use-navigation-menu.js +1 -1
- package/src/navigation-link/edit.js +10 -5
- package/src/navigation-link/link-ui.js +2 -0
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +12 -12
- package/src/page-list/block.json +1 -0
- package/src/page-list/convert-to-links-modal.js +38 -0
- package/src/page-list/edit.js +17 -37
- package/src/page-list/index.php +4 -4
- package/src/page-list/test/convert-to-links-modal.js +134 -0
- package/src/page-list/use-convert-to-navigation-links.js +64 -4
- package/src/paragraph/edit.js +1 -0
- package/src/post-author/block.json +1 -0
- package/src/post-author/edit.js +4 -0
- package/src/post-author-biography/block.json +1 -0
- package/src/post-author-name/block.json +1 -0
- package/src/post-author-name/edit.js +2 -0
- package/src/post-comments-count/block.json +1 -0
- package/src/post-comments-form/block.json +1 -0
- package/src/post-comments-link/block.json +1 -0
- package/src/post-content/block.json +1 -0
- package/src/post-date/block.json +1 -0
- package/src/post-date/edit.js +2 -0
- package/src/post-excerpt/block.json +5 -0
- package/src/post-excerpt/edit.js +73 -7
- package/src/post-excerpt/editor.scss +1 -1
- package/src/post-excerpt/index.php +29 -5
- package/src/post-featured-image/block.json +4 -0
- package/src/post-featured-image/dimension-controls.js +64 -2
- package/src/post-featured-image/edit.js +20 -6
- package/src/post-featured-image/index.php +25 -9
- package/src/post-navigation-link/block.json +1 -0
- package/src/post-navigation-link/edit.js +2 -0
- package/src/post-template/block.json +1 -0
- package/src/post-terms/block.json +1 -0
- package/src/post-terms/index.php +1 -0
- package/src/post-terms/use-post-terms.js +1 -1
- package/src/post-time-to-read/block.json +20 -0
- package/src/post-time-to-read/edit.js +101 -0
- package/src/post-time-to-read/icon.js +15 -0
- package/src/post-time-to-read/index.js +17 -0
- package/src/post-time-to-read/index.php +62 -0
- package/src/post-title/block.json +1 -0
- package/src/post-title/edit.js +2 -0
- package/src/post-title/index.php +3 -3
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +10 -10
- package/src/query/block.json +1 -0
- package/src/query/edit/inspector-controls/index.js +1 -0
- package/src/query-no-results/block.json +1 -0
- package/src/query-pagination/block.json +1 -0
- package/src/query-pagination-next/block.json +1 -0
- package/src/query-pagination-numbers/block.json +1 -0
- package/src/query-pagination-previous/block.json +1 -0
- package/src/query-title/block.json +1 -0
- package/src/query-title/edit.js +2 -0
- package/src/read-more/block.json +1 -0
- package/src/read-more/edit.js +1 -0
- package/src/rss/block.json +1 -0
- package/src/rss/edit.js +3 -0
- package/src/search/block.json +1 -0
- package/src/search/test/__snapshots__/edit.native.js.snap +60 -60
- package/src/separator/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/site-logo/block.json +1 -0
- package/src/site-logo/edit.js +6 -6
- package/src/site-logo/index.php +7 -2
- package/src/site-tagline/block.json +1 -0
- package/src/site-title/block.json +1 -0
- package/src/site-title/edit/index.js +2 -0
- package/src/social-link/block.json +1 -0
- package/src/social-link/index.php +6 -6
- package/src/social-links/edit.js +2 -0
- package/src/social-links/test/__snapshots__/edit.native.js.snap +16 -16
- package/src/spacer/controls.native.js +13 -5
- package/src/spacer/edit.native.js +45 -6
- package/src/spacer/save.native.js +18 -0
- package/src/spacer/test/__snapshots__/index.native.js.snap +21 -9
- package/src/spacer/test/index.native.js +81 -0
- package/src/table/edit.js +6 -3
- package/src/table-of-contents/edit.js +1 -0
- package/src/table-of-contents/utils.ts +1 -1
- package/src/tag-cloud/block.json +1 -0
- package/src/tag-cloud/edit.js +1 -0
- package/src/template-part/block.json +1 -0
- package/src/template-part/index.php +7 -6
- package/src/term-description/block.json +1 -0
- package/src/verse/block.json +6 -0
- package/src/verse/test/__snapshots__/edit.native.js.snap +2 -2
- package/src/video/edit-common-settings.js +5 -0
- package/tsconfig.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -49,7 +49,7 @@ const scaleHelp = {
|
|
|
49
49
|
|
|
50
50
|
const DimensionControls = ( {
|
|
51
51
|
clientId,
|
|
52
|
-
attributes: { width, height, scale, sizeSlug },
|
|
52
|
+
attributes: { aspectRatio, width, height, scale, sizeSlug },
|
|
53
53
|
setAttributes,
|
|
54
54
|
imageSizeOptions = [],
|
|
55
55
|
} ) => {
|
|
@@ -72,6 +72,68 @@ const DimensionControls = ( {
|
|
|
72
72
|
const scaleLabel = _x( 'Scale', 'Image scaling options' );
|
|
73
73
|
return (
|
|
74
74
|
<InspectorControls group="dimensions">
|
|
75
|
+
<ToolsPanelItem
|
|
76
|
+
hasValue={ () => !! aspectRatio }
|
|
77
|
+
label={ __( 'Aspect ratio' ) }
|
|
78
|
+
onDeselect={ () => setAttributes( { aspectRatio: undefined } ) }
|
|
79
|
+
resetAllFilter={ () => ( {
|
|
80
|
+
aspectRatio: undefined,
|
|
81
|
+
} ) }
|
|
82
|
+
isShownByDefault={ true }
|
|
83
|
+
panelId={ clientId }
|
|
84
|
+
>
|
|
85
|
+
<SelectControl
|
|
86
|
+
__nextHasNoMarginBottom
|
|
87
|
+
label={ __( 'Aspect ratio' ) }
|
|
88
|
+
value={ aspectRatio }
|
|
89
|
+
options={ [
|
|
90
|
+
// These should use the same values as AspectRatioDropdown in @wordpress/block-editor
|
|
91
|
+
{
|
|
92
|
+
label: __( 'Original' ),
|
|
93
|
+
value: 'auto',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: __( 'Square' ),
|
|
97
|
+
value: '1',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: __( '16:10' ),
|
|
101
|
+
value: '16/10',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: __( '16:9' ),
|
|
105
|
+
value: '16/9',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
label: __( '4:3' ),
|
|
109
|
+
value: '4/3',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label: __( '3:2' ),
|
|
113
|
+
value: '3/2',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: __( '10:16' ),
|
|
117
|
+
value: '10/16',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: __( '9:16' ),
|
|
121
|
+
value: '9/16',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
label: __( '3:4' ),
|
|
125
|
+
value: '3/4',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
label: __( '2:3' ),
|
|
129
|
+
value: '2/3',
|
|
130
|
+
},
|
|
131
|
+
] }
|
|
132
|
+
onChange={ ( nextAspectRatio ) =>
|
|
133
|
+
setAttributes( { aspectRatio: nextAspectRatio } )
|
|
134
|
+
}
|
|
135
|
+
/>
|
|
136
|
+
</ToolsPanelItem>
|
|
75
137
|
<ToolsPanelItem
|
|
76
138
|
className="single-column"
|
|
77
139
|
hasValue={ () => !! height }
|
|
@@ -116,7 +178,7 @@ const DimensionControls = ( {
|
|
|
116
178
|
units={ units }
|
|
117
179
|
/>
|
|
118
180
|
</ToolsPanelItem>
|
|
119
|
-
{
|
|
181
|
+
{ ( height || aspectRatio ) && (
|
|
120
182
|
<ToolsPanelItem
|
|
121
183
|
hasValue={ () => !! scale && scale !== DEFAULT_SCALE }
|
|
122
184
|
label={ scaleLabel }
|
|
@@ -50,8 +50,16 @@ export default function PostFeaturedImageEdit( {
|
|
|
50
50
|
context: { postId, postType: postTypeSlug, queryId },
|
|
51
51
|
} ) {
|
|
52
52
|
const isDescendentOfQueryLoop = Number.isFinite( queryId );
|
|
53
|
-
const {
|
|
54
|
-
|
|
53
|
+
const {
|
|
54
|
+
isLink,
|
|
55
|
+
aspectRatio,
|
|
56
|
+
height,
|
|
57
|
+
width,
|
|
58
|
+
scale,
|
|
59
|
+
sizeSlug,
|
|
60
|
+
rel,
|
|
61
|
+
linkTarget,
|
|
62
|
+
} = attributes;
|
|
55
63
|
const [ featuredImage, setFeaturedImage ] = useEntityProp(
|
|
56
64
|
'postType',
|
|
57
65
|
postTypeSlug,
|
|
@@ -89,7 +97,7 @@ export default function PostFeaturedImageEdit( {
|
|
|
89
97
|
} ) );
|
|
90
98
|
|
|
91
99
|
const blockProps = useBlockProps( {
|
|
92
|
-
style: { width, height },
|
|
100
|
+
style: { width, height, aspectRatio },
|
|
93
101
|
} );
|
|
94
102
|
const borderProps = useBorderProps( attributes );
|
|
95
103
|
|
|
@@ -101,7 +109,10 @@ export default function PostFeaturedImageEdit( {
|
|
|
101
109
|
borderProps.className
|
|
102
110
|
) }
|
|
103
111
|
withIllustration={ true }
|
|
104
|
-
style={
|
|
112
|
+
style={ {
|
|
113
|
+
...blockProps.style,
|
|
114
|
+
...borderProps.style,
|
|
115
|
+
} }
|
|
105
116
|
>
|
|
106
117
|
{ content }
|
|
107
118
|
</Placeholder>
|
|
@@ -130,6 +141,7 @@ export default function PostFeaturedImageEdit( {
|
|
|
130
141
|
<InspectorControls>
|
|
131
142
|
<PanelBody title={ __( 'Link settings' ) }>
|
|
132
143
|
<ToggleControl
|
|
144
|
+
__nextHasNoMarginBottom
|
|
133
145
|
label={
|
|
134
146
|
postType?.labels.singular_name
|
|
135
147
|
? sprintf(
|
|
@@ -145,6 +157,7 @@ export default function PostFeaturedImageEdit( {
|
|
|
145
157
|
{ isLink && (
|
|
146
158
|
<>
|
|
147
159
|
<ToggleControl
|
|
160
|
+
__nextHasNoMarginBottom
|
|
148
161
|
label={ __( 'Open in new tab' ) }
|
|
149
162
|
onChange={ ( value ) =>
|
|
150
163
|
setAttributes( {
|
|
@@ -218,8 +231,9 @@ export default function PostFeaturedImageEdit( {
|
|
|
218
231
|
const label = __( 'Add a featured image' );
|
|
219
232
|
const imageStyles = {
|
|
220
233
|
...borderProps.style,
|
|
221
|
-
height,
|
|
222
|
-
|
|
234
|
+
height: ( !! aspectRatio && '100%' ) || height,
|
|
235
|
+
width: !! aspectRatio && '100%',
|
|
236
|
+
objectFit: !! ( height || aspectRatio ) && scale,
|
|
223
237
|
};
|
|
224
238
|
|
|
225
239
|
/**
|
|
@@ -42,11 +42,20 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
$extra_styles = '';
|
|
46
|
+
|
|
47
|
+
// Aspect ratio with a height set needs to override the default width/height.
|
|
48
|
+
if ( ! empty( $attributes['aspectRatio'] ) ) {
|
|
49
|
+
$extra_styles .= 'width:100%;height:100%;';
|
|
50
|
+
} elseif ( ! empty( $attributes['height'] ) ) {
|
|
51
|
+
$extra_styles .= "height:{$attributes['height']};";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if ( ! empty( $attributes['scale'] ) ) {
|
|
55
|
+
$extra_styles .= "object-fit:{$attributes['scale']};";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if ( ! empty( $extra_styles ) ) {
|
|
50
59
|
$attr['style'] = empty( $attr['style'] ) ? $extra_styles : $attr['style'] . $extra_styles;
|
|
51
60
|
}
|
|
52
61
|
|
|
@@ -71,12 +80,19 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
71
80
|
$featured_image = $featured_image . $overlay_markup;
|
|
72
81
|
}
|
|
73
82
|
|
|
74
|
-
$
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
$aspect_ratio = ! empty( $attributes['aspectRatio'] )
|
|
84
|
+
? esc_attr( safecss_filter_attr( 'aspect-ratio:' . $attributes['aspectRatio'] ) ) . ';'
|
|
85
|
+
: '';
|
|
86
|
+
$width = ! empty( $attributes['width'] )
|
|
87
|
+
? esc_attr( safecss_filter_attr( 'width:' . $attributes['width'] ) ) . ';'
|
|
88
|
+
: '';
|
|
89
|
+
$height = ! empty( $attributes['height'] )
|
|
90
|
+
? esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . ';'
|
|
91
|
+
: '';
|
|
92
|
+
if ( ! $height && ! $width && ! $aspect_ratio ) {
|
|
77
93
|
$wrapper_attributes = get_block_wrapper_attributes();
|
|
78
94
|
} else {
|
|
79
|
-
$wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $width . $height ) );
|
|
95
|
+
$wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $aspect_ratio . $width . $height ) );
|
|
80
96
|
}
|
|
81
97
|
return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
|
|
82
98
|
}
|
|
@@ -52,6 +52,7 @@ export default function PostNavigationLinkEdit( {
|
|
|
52
52
|
<InspectorControls>
|
|
53
53
|
<PanelBody>
|
|
54
54
|
<ToggleControl
|
|
55
|
+
__nextHasNoMarginBottom
|
|
55
56
|
label={ __( 'Display the title as a link' ) }
|
|
56
57
|
help={ __(
|
|
57
58
|
'If you have entered a custom label, it will be prepended before the title.'
|
|
@@ -65,6 +66,7 @@ export default function PostNavigationLinkEdit( {
|
|
|
65
66
|
/>
|
|
66
67
|
{ showTitle && (
|
|
67
68
|
<ToggleControl
|
|
69
|
+
__nextHasNoMarginBottom
|
|
68
70
|
label={ __(
|
|
69
71
|
'Include the label as part of the link'
|
|
70
72
|
) }
|
package/src/post-terms/index.php
CHANGED
|
@@ -87,6 +87,7 @@ function register_block_core_post_terms() {
|
|
|
87
87
|
'term' => $taxonomy->name,
|
|
88
88
|
),
|
|
89
89
|
'isActive' => array( 'term' ),
|
|
90
|
+
'scope' => array( 'inserter', 'transform' ),
|
|
90
91
|
);
|
|
91
92
|
// Set the category variation as the default one.
|
|
92
93
|
if ( 'category' === $taxonomy->name ) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
3
|
+
"apiVersion": 2,
|
|
4
|
+
"__experimental": true,
|
|
5
|
+
"name": "core/post-time-to-read",
|
|
6
|
+
"title": "Time To Read",
|
|
7
|
+
"category": "theme",
|
|
8
|
+
"description": "Show minutes required to finish reading the post.",
|
|
9
|
+
"textdomain": "default",
|
|
10
|
+
"usesContext": [ "postId", "postType" ],
|
|
11
|
+
"attributes": {
|
|
12
|
+
"textAlign": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"supports": {
|
|
17
|
+
"html": false,
|
|
18
|
+
"multiple": false
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { _x, _n, sprintf } from '@wordpress/i18n';
|
|
10
|
+
import { useMemo } from '@wordpress/element';
|
|
11
|
+
import {
|
|
12
|
+
AlignmentControl,
|
|
13
|
+
BlockControls,
|
|
14
|
+
useBlockProps,
|
|
15
|
+
} from '@wordpress/block-editor';
|
|
16
|
+
import { __unstableSerializeAndClean } from '@wordpress/blocks';
|
|
17
|
+
import { useEntityProp, useEntityBlockEditor } from '@wordpress/core-data';
|
|
18
|
+
import { count as wordCount } from '@wordpress/wordcount';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Average reading rate - based on average taken from
|
|
22
|
+
* https://irisreading.com/average-reading-speed-in-various-languages/
|
|
23
|
+
* (Characters/minute used for Chinese rather than words).
|
|
24
|
+
*/
|
|
25
|
+
const AVERAGE_READING_RATE = 189;
|
|
26
|
+
|
|
27
|
+
function PostTimeToReadEdit( { attributes, setAttributes, context } ) {
|
|
28
|
+
const { textAlign } = attributes;
|
|
29
|
+
const { postId, postType } = context;
|
|
30
|
+
|
|
31
|
+
const [ contentStructure ] = useEntityProp(
|
|
32
|
+
'postType',
|
|
33
|
+
postType,
|
|
34
|
+
'content',
|
|
35
|
+
postId
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const [ blocks ] = useEntityBlockEditor( 'postType', postType, {
|
|
39
|
+
id: postId,
|
|
40
|
+
} );
|
|
41
|
+
|
|
42
|
+
const minutesToReadString = useMemo( () => {
|
|
43
|
+
// Replicates the logic found in getEditedPostContent().
|
|
44
|
+
let content;
|
|
45
|
+
if ( contentStructure instanceof Function ) {
|
|
46
|
+
content = contentStructure( { blocks } );
|
|
47
|
+
} else if ( blocks ) {
|
|
48
|
+
// If we have parsed blocks already, they should be our source of truth.
|
|
49
|
+
// Parsing applies block deprecations and legacy block conversions that
|
|
50
|
+
// unparsed content will not have.
|
|
51
|
+
content = __unstableSerializeAndClean( blocks );
|
|
52
|
+
} else {
|
|
53
|
+
content = contentStructure;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* translators: If your word count is based on single characters (e.g. East Asian characters),
|
|
58
|
+
* enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
|
|
59
|
+
* Do not translate into your own language.
|
|
60
|
+
*/
|
|
61
|
+
const wordCountType = _x(
|
|
62
|
+
'words',
|
|
63
|
+
'Word count type. Do not translate!'
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const minutesToRead = Math.max(
|
|
67
|
+
1,
|
|
68
|
+
Math.round(
|
|
69
|
+
wordCount( content, wordCountType ) / AVERAGE_READING_RATE
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
return sprintf(
|
|
74
|
+
/* translators: %d is the number of minutes the post will take to read. */
|
|
75
|
+
_n( '%d minute', '%d minutes', minutesToRead ),
|
|
76
|
+
minutesToRead
|
|
77
|
+
);
|
|
78
|
+
}, [ contentStructure, blocks ] );
|
|
79
|
+
|
|
80
|
+
const blockProps = useBlockProps( {
|
|
81
|
+
className: classnames( {
|
|
82
|
+
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
83
|
+
} ),
|
|
84
|
+
} );
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<>
|
|
88
|
+
<BlockControls group="block">
|
|
89
|
+
<AlignmentControl
|
|
90
|
+
value={ textAlign }
|
|
91
|
+
onChange={ ( nextAlign ) => {
|
|
92
|
+
setAttributes( { textAlign: nextAlign } );
|
|
93
|
+
} }
|
|
94
|
+
/>
|
|
95
|
+
</BlockControls>
|
|
96
|
+
<p { ...blockProps }>{ minutesToReadString }</p>
|
|
97
|
+
</>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export default PostTimeToReadEdit;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { SVG, Path } from '@wordpress/components';
|
|
5
|
+
|
|
6
|
+
export default (
|
|
7
|
+
<SVG
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
width="24"
|
|
10
|
+
height="24"
|
|
11
|
+
viewBox="0 0 24 24"
|
|
12
|
+
>
|
|
13
|
+
<Path d="M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16.5c-4.1 0-7.5-3.4-7.5-7.5S7.9 4.5 12 4.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5zM12 7l-1 5c0 .3.2.6.4.8l4.2 2.8-2.7-4.1L12 7z" />
|
|
14
|
+
</SVG>
|
|
15
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import initBlock from '../utils/init-block';
|
|
5
|
+
import metadata from './block.json';
|
|
6
|
+
import edit from './edit';
|
|
7
|
+
import icon from './icon';
|
|
8
|
+
|
|
9
|
+
const { name } = metadata;
|
|
10
|
+
export { metadata, name };
|
|
11
|
+
|
|
12
|
+
export const settings = {
|
|
13
|
+
icon,
|
|
14
|
+
edit,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const init = () => initBlock( { name, metadata, settings } );
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Server-side rendering of the `core/post-time-to-read` block.
|
|
4
|
+
*
|
|
5
|
+
* @package WordPress
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Renders the `core/post-time-to-read` block on the server.
|
|
10
|
+
*
|
|
11
|
+
* @param array $attributes Block attributes.
|
|
12
|
+
* @param string $content Block default content.
|
|
13
|
+
* @param WP_Block $block Block instance.
|
|
14
|
+
* @return string Returns the rendered post author name block.
|
|
15
|
+
*/
|
|
16
|
+
function render_block_core_post_time_to_read( $attributes, $content, $block ) {
|
|
17
|
+
if ( ! isset( $block->context['postId'] ) ) {
|
|
18
|
+
return '';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
$content = get_the_content();
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* Average reading rate - based on average taken from
|
|
25
|
+
* https://irisreading.com/average-reading-speed-in-various-languages/
|
|
26
|
+
* (Characters/minute used for Chinese rather than words).
|
|
27
|
+
*/
|
|
28
|
+
$average_reading_rate = 189;
|
|
29
|
+
|
|
30
|
+
$word_count_type = wp_get_word_count_type();
|
|
31
|
+
|
|
32
|
+
$minutes_to_read = max( 1, (int) round( wp_word_count( $content, $word_count_type ) / $average_reading_rate ) );
|
|
33
|
+
|
|
34
|
+
$minutes_to_read_string = sprintf(
|
|
35
|
+
/* translators: %d is the number of minutes the post will take to read. */
|
|
36
|
+
_n( '%d minute', '%d minutes', $minutes_to_read ),
|
|
37
|
+
$minutes_to_read
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
|
|
41
|
+
|
|
42
|
+
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
|
|
43
|
+
|
|
44
|
+
return sprintf(
|
|
45
|
+
'<p %1$s>%2$s</p>',
|
|
46
|
+
$wrapper_attributes,
|
|
47
|
+
$minutes_to_read_string
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Registers the `core/post-time-to-read` block on the server.
|
|
53
|
+
*/
|
|
54
|
+
function register_block_core_post_time_to_read() {
|
|
55
|
+
register_block_type_from_metadata(
|
|
56
|
+
__DIR__ . '/post-time-to-read',
|
|
57
|
+
array(
|
|
58
|
+
'render_callback' => 'render_block_core_post_time_to_read',
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
add_action( 'init', 'register_block_core_post_time_to_read' );
|
package/src/post-title/edit.js
CHANGED
|
@@ -118,6 +118,7 @@ export default function PostTitleEdit( {
|
|
|
118
118
|
<InspectorControls>
|
|
119
119
|
<PanelBody title={ __( 'Link settings' ) }>
|
|
120
120
|
<ToggleControl
|
|
121
|
+
__nextHasNoMarginBottom
|
|
121
122
|
label={ __( 'Make title a link' ) }
|
|
122
123
|
onChange={ () => setAttributes( { isLink: ! isLink } ) }
|
|
123
124
|
checked={ isLink }
|
|
@@ -125,6 +126,7 @@ export default function PostTitleEdit( {
|
|
|
125
126
|
{ isLink && (
|
|
126
127
|
<>
|
|
127
128
|
<ToggleControl
|
|
129
|
+
__nextHasNoMarginBottom
|
|
128
130
|
label={ __( 'Open in new tab' ) }
|
|
129
131
|
onChange={ ( value ) =>
|
|
130
132
|
setAttributes( {
|
package/src/post-title/index.php
CHANGED
|
@@ -19,8 +19,8 @@ function render_block_core_post_title( $attributes, $content, $block ) {
|
|
|
19
19
|
return '';
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
$
|
|
23
|
-
$title
|
|
22
|
+
$post = get_post( $block->context['postId'] );
|
|
23
|
+
$title = get_the_title( $post );
|
|
24
24
|
|
|
25
25
|
if ( ! $title ) {
|
|
26
26
|
return '';
|
|
@@ -33,7 +33,7 @@ function render_block_core_post_title( $attributes, $content, $block ) {
|
|
|
33
33
|
|
|
34
34
|
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
|
|
35
35
|
$rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
|
|
36
|
-
$title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $
|
|
36
|
+
$title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $post ), esc_attr( $attributes['linkTarget'] ), $rel, $title );
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
$classes = array();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`core/more/edit/native should match snapshot when content is empty 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
|
-
|
|
6
|
+
[
|
|
7
7
|
undefined,
|
|
8
8
|
undefined,
|
|
9
9
|
undefined,
|
|
@@ -12,7 +12,7 @@ exports[`core/more/edit/native should match snapshot when content is empty 1`] =
|
|
|
12
12
|
>
|
|
13
13
|
<View
|
|
14
14
|
style={
|
|
15
|
-
|
|
15
|
+
[
|
|
16
16
|
undefined,
|
|
17
17
|
undefined,
|
|
18
18
|
]
|
|
@@ -20,9 +20,9 @@ exports[`core/more/edit/native should match snapshot when content is empty 1`] =
|
|
|
20
20
|
>
|
|
21
21
|
<TextInput
|
|
22
22
|
accessibilityLabel="Text input. Empty"
|
|
23
|
-
activeFormats={
|
|
23
|
+
activeFormats={[]}
|
|
24
24
|
blockType={
|
|
25
|
-
|
|
25
|
+
{
|
|
26
26
|
"tag": "pre",
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -39,7 +39,7 @@ exports[`core/more/edit/native should match snapshot when content is empty 1`] =
|
|
|
39
39
|
onSelectionChange={[Function]}
|
|
40
40
|
placeholder="Write preformatted text…"
|
|
41
41
|
placeholderTextColor="gray"
|
|
42
|
-
triggerKeyCodes={
|
|
42
|
+
triggerKeyCodes={[]}
|
|
43
43
|
value=""
|
|
44
44
|
/>
|
|
45
45
|
</View>
|
|
@@ -49,7 +49,7 @@ exports[`core/more/edit/native should match snapshot when content is empty 1`] =
|
|
|
49
49
|
exports[`core/more/edit/native should match snapshot when content is not empty 1`] = `
|
|
50
50
|
<View
|
|
51
51
|
style={
|
|
52
|
-
|
|
52
|
+
[
|
|
53
53
|
undefined,
|
|
54
54
|
undefined,
|
|
55
55
|
undefined,
|
|
@@ -58,7 +58,7 @@ exports[`core/more/edit/native should match snapshot when content is not empty 1
|
|
|
58
58
|
>
|
|
59
59
|
<View
|
|
60
60
|
style={
|
|
61
|
-
|
|
61
|
+
[
|
|
62
62
|
undefined,
|
|
63
63
|
undefined,
|
|
64
64
|
]
|
|
@@ -66,9 +66,9 @@ exports[`core/more/edit/native should match snapshot when content is not empty 1
|
|
|
66
66
|
>
|
|
67
67
|
<TextInput
|
|
68
68
|
accessibilityLabel="Text input. <pre>Hello World!</pre>"
|
|
69
|
-
activeFormats={
|
|
69
|
+
activeFormats={[]}
|
|
70
70
|
blockType={
|
|
71
|
-
|
|
71
|
+
{
|
|
72
72
|
"tag": "pre",
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -85,7 +85,7 @@ exports[`core/more/edit/native should match snapshot when content is not empty 1
|
|
|
85
85
|
onSelectionChange={[Function]}
|
|
86
86
|
placeholder="Write preformatted text…"
|
|
87
87
|
placeholderTextColor="gray"
|
|
88
|
-
triggerKeyCodes={
|
|
88
|
+
triggerKeyCodes={[]}
|
|
89
89
|
value="<pre>Hello World!</pre>"
|
|
90
90
|
/>
|
|
91
91
|
</View>
|
package/src/query/block.json
CHANGED
|
@@ -132,6 +132,7 @@ export default function QueryInspectorControls( {
|
|
|
132
132
|
<PanelBody title={ __( 'Settings' ) }>
|
|
133
133
|
{ showInheritControl && (
|
|
134
134
|
<ToggleControl
|
|
135
|
+
__nextHasNoMarginBottom
|
|
135
136
|
label={ __( 'Inherit query from template' ) }
|
|
136
137
|
help={ __(
|
|
137
138
|
'Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'
|