@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-featured-image/edit.js"],"names":["ALLOWED_MEDIA_TYPES","getMediaSourceUrlBySizeSlug","media","slug","media_details","sizes","source_url","PostFeaturedImageEdit","clientId","attributes","setAttributes","context","postId","postType","postTypeSlug","queryId","isDescendentOfQueryLoop","Number","isFinite","isLink","height","width","scale","sizeSlug","rel","linkTarget","featuredImage","setFeaturedImage","select","getMedia","getPostType","coreStore","mediaUrl","imageSizes","blockEditorStore","getSettings","imageSizeOptions","filter","map","name","value","label","blockProps","style","borderProps","placeholder","content","className","onSelectImage","id","createErrorNotice","noticesStore","onUploadError","message","type","controls","labels","singular_name","toLowerCase","newRel","image","imageStyles","objectFit","open","upload","alt_text"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAQA;;AASA;;AACA;;AACA;;AAKA;;AACA;;AAnCA;AACA;AACA;;AAGA;AACA;AACA;;AAwBA;AACA;AACA;AAIA,MAAMA,mBAAmB,GAAG,CAAE,OAAF,CAA5B;;AAEA,SAASC,2BAAT,CAAsCC,KAAtC,EAA6CC,IAA7C,EAAoD;AAAA;;AACnD,SACC,CAAAD,KAAK,SAAL,IAAAA,KAAK,WAAL,oCAAAA,KAAK,CAAEE,aAAP,uGAAsBC,KAAtB,0GAA+BF,IAA/B,mFAAuCG,UAAvC,MAAqDJ,KA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IAFD,CAlBD,CADD;AA6BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tMenuItem,\n\tToggleControl,\n\tPanelBody,\n\tPlaceholder,\n\tButton,\n\tTextControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalUseBorderProps as useBorderProps,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport DimensionControls from './dimension-controls';\nimport Overlay from './overlay';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nfunction getMediaSourceUrlBySizeSlug( media, slug ) {\n\treturn (\n\t\tmedia?.media_details?.sizes?.[ slug ]?.source_url || media?.source_url\n\t);\n}\n\nexport default function PostFeaturedImageEdit( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tcontext: { postId, postType: postTypeSlug, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { isLink, height, width, scale, sizeSlug, rel, linkTarget } =\n\t\tattributes;\n\tconst [ featuredImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\tconst { media, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getMedia, getPostType } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tmedia:\n\t\t\t\t\tfeaturedImage &&\n\t\t\t\t\tgetMedia( featuredImage, {\n\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t} ),\n\t\t\t\tpostType: postTypeSlug && getPostType( postTypeSlug ),\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, postTypeSlug ]\n\t);\n\tconst mediaUrl = getMediaSourceUrlBySizeSlug( media, sizeSlug );\n\n\tconst imageSizes = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().imageSizes,\n\t\t[]\n\t);\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => {\n\t\t\treturn media?.media_details?.sizes?.[ slug ]?.source_url;\n\t\t} )\n\t\t.map( ( { name, slug } ) => ( {\n\t\t\tvalue: slug,\n\t\t\tlabel: name,\n\t\t} ) );\n\n\tconst blockProps = useBlockProps( {\n\t\tstyle: { width, height },\n\t} );\n\tconst borderProps = useBorderProps( attributes );\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-media-placeholder',\n\t\t\t\t\tborderProps.className\n\t\t\t\t) }\n\t\t\t\twithIllustration={ true }\n\t\t\t\tstyle={ borderProps.style }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst onSelectImage = ( value ) => {\n\t\tif ( value?.id ) {\n\t\t\tsetFeaturedImage( value.id );\n\t\t}\n\t};\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst controls = (\n\t\t<>\n\t\t\t<DimensionControls\n\t\t\t\tclientId={ clientId }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t}\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\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\t\t\tvalue={ rel }\n\t\t\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\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</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\tlet image;\n\n\t/**\n\t * A post featured image block placed in a query loop\n\t * does not have image replacement or upload options.\n\t */\n\tif ( ! featuredImage && isDescendentOfQueryLoop ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ controls }\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t{ placeholder() }\n\t\t\t\t\t<Overlay\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\t/**\n\t * A post featured image placed in a block template, outside a query loop,\n\t * does not have a postId and will always be a placeholder image.\n\t * It does not have image replacement, upload, or link options.\n\t */\n\tif ( ! featuredImage && ! postId ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<DimensionControls\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t\t/>\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t{ placeholder() }\n\t\t\t\t\t<Overlay\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst label = __( 'Add a featured image' );\n\tconst imageStyles = {\n\t\t...borderProps.style,\n\t\theight,\n\t\tobjectFit: height && scale,\n\t};\n\n\t/**\n\t * When the post featured image block is placed in a context where:\n\t * - It has a postId (for example in a single post)\n\t * - It is not inside a query loop\n\t * - It has no image assigned yet\n\t * Then display the placeholder with the image upload option.\n\t */\n\tif ( ! featuredImage ) {\n\t\timage = (\n\t\t\t<MediaPlaceholder\n\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\taccept=\"image/*\"\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\tonError={ onUploadError }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\ttooltipPosition=\"top center\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\topen();\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);\n\t} else {\n\t\t// We have a Featured image so show a Placeholder if is loading.\n\t\timage = ! media ? (\n\t\t\tplaceholder()\n\t\t) : (\n\t\t\t<img\n\t\t\t\tclassName={ borderProps.className }\n\t\t\t\tsrc={ mediaUrl }\n\t\t\t\talt={\n\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\tstyle={ imageStyles }\n\t\t\t/>\n\t\t);\n\t}\n\n\t/**\n\t * When the post featured image block:\n\t * - Has an image assigned\n\t * - Is not inside a query loop\n\t * Then display the image and the image replacement option.\n\t */\n\treturn (\n\t\t<>\n\t\t\t{ controls }\n\t\t\t{ !! media && ! isDescendentOfQueryLoop && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ featuredImage }\n\t\t\t\t\t\tmediaURL={ mediaUrl }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t>\n\t\t\t\t\t\t<MenuItem onClick={ () => setFeaturedImage( 0 ) }>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MediaReplaceFlow>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ image }\n\t\t\t\t<Overlay\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-featured-image/edit.js"],"names":["ALLOWED_MEDIA_TYPES","getMediaSourceUrlBySizeSlug","media","slug","media_details","sizes","source_url","PostFeaturedImageEdit","clientId","attributes","setAttributes","context","postId","postType","postTypeSlug","queryId","isDescendentOfQueryLoop","Number","isFinite","isLink","aspectRatio","height","width","scale","sizeSlug","rel","linkTarget","featuredImage","setFeaturedImage","select","getMedia","getPostType","coreStore","mediaUrl","imageSizes","blockEditorStore","getSettings","imageSizeOptions","filter","map","name","value","label","blockProps","style","borderProps","placeholder","content","className","onSelectImage","id","createErrorNotice","noticesStore","onUploadError","message","type","controls","labels","singular_name","toLowerCase","newRel","image","imageStyles","objectFit","open","upload","alt_text"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAQA;;AASA;;AACA;;AACA;;AAKA;;AACA;;AAnCA;AACA;AACA;;AAGA;AACA;AACA;;AAwBA;AACA;AACA;AAIA,MAAMA,mBAAmB,GAAG,CAAE,OAAF,CAA5B;;AAEA,SAASC,2BAAT,CAAsCC,KAAtC,EAA6CC,IAA7C,EAAoD;AAAA;;AACnD,SACC,CAAAD,KAAK,SAAL,IAAAA,KAAK,WAAL,oCAAAA,KAAK,CAAEE,aAAP,uGAAsBC,KAAtB,0GAA+BF,IAA/B,mFAAuCG,UAAvC,MAAqDJ,KAArD,aAAqDA,KAArD,uBAAqDA,KAAK,CAAEI,UAA5D,CADD;AAGA;;AAEc,SAASC,qBAAT,OAKX;AAAA,MAL2C;AAC9CC,IAAAA,QAD8C;AAE9CC,IAAAA,UAF8C;AAG9CC,IAAAA,aAH8C;AAI9CC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,MA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AEC,IAAA,aAAa,EAAGC,aAFjB;AAGC,IAAA,QAAQ,EAAGF;AAHZ,IAFD,CAlBD,CADD;AA6BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tMenuItem,\n\tToggleControl,\n\tPanelBody,\n\tPlaceholder,\n\tButton,\n\tTextControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalUseBorderProps as useBorderProps,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport DimensionControls from './dimension-controls';\nimport Overlay from './overlay';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nfunction getMediaSourceUrlBySizeSlug( media, slug ) {\n\treturn (\n\t\tmedia?.media_details?.sizes?.[ slug ]?.source_url || media?.source_url\n\t);\n}\n\nexport default function PostFeaturedImageEdit( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tcontext: { postId, postType: postTypeSlug, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst {\n\t\tisLink,\n\t\taspectRatio,\n\t\theight,\n\t\twidth,\n\t\tscale,\n\t\tsizeSlug,\n\t\trel,\n\t\tlinkTarget,\n\t} = attributes;\n\tconst [ featuredImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\tconst { media, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getMedia, getPostType } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tmedia:\n\t\t\t\t\tfeaturedImage &&\n\t\t\t\t\tgetMedia( featuredImage, {\n\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t} ),\n\t\t\t\tpostType: postTypeSlug && getPostType( postTypeSlug ),\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, postTypeSlug ]\n\t);\n\tconst mediaUrl = getMediaSourceUrlBySizeSlug( media, sizeSlug );\n\n\tconst imageSizes = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().imageSizes,\n\t\t[]\n\t);\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => {\n\t\t\treturn media?.media_details?.sizes?.[ slug ]?.source_url;\n\t\t} )\n\t\t.map( ( { name, slug } ) => ( {\n\t\t\tvalue: slug,\n\t\t\tlabel: name,\n\t\t} ) );\n\n\tconst blockProps = useBlockProps( {\n\t\tstyle: { width, height, aspectRatio },\n\t} );\n\tconst borderProps = useBorderProps( attributes );\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-media-placeholder',\n\t\t\t\t\tborderProps.className\n\t\t\t\t) }\n\t\t\t\twithIllustration={ true }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst onSelectImage = ( value ) => {\n\t\tif ( value?.id ) {\n\t\t\tsetFeaturedImage( value.id );\n\t\t}\n\t};\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst controls = (\n\t\t<>\n\t\t\t<DimensionControls\n\t\t\t\tclientId={ clientId }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t}\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\t__nextHasNoMarginBottom\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\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\t\t\tvalue={ rel }\n\t\t\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\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</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\tlet image;\n\n\t/**\n\t * A post featured image block placed in a query loop\n\t * does not have image replacement or upload options.\n\t */\n\tif ( ! featuredImage && isDescendentOfQueryLoop ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ controls }\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t{ placeholder() }\n\t\t\t\t\t<Overlay\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\t/**\n\t * A post featured image placed in a block template, outside a query loop,\n\t * does not have a postId and will always be a placeholder image.\n\t * It does not have image replacement, upload, or link options.\n\t */\n\tif ( ! featuredImage && ! postId ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<DimensionControls\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t\t/>\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t{ placeholder() }\n\t\t\t\t\t<Overlay\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst label = __( 'Add a featured image' );\n\tconst imageStyles = {\n\t\t...borderProps.style,\n\t\theight: ( !! aspectRatio && '100%' ) || height,\n\t\twidth: !! aspectRatio && '100%',\n\t\tobjectFit: !! ( height || aspectRatio ) && scale,\n\t};\n\n\t/**\n\t * When the post featured image block is placed in a context where:\n\t * - It has a postId (for example in a single post)\n\t * - It is not inside a query loop\n\t * - It has no image assigned yet\n\t * Then display the placeholder with the image upload option.\n\t */\n\tif ( ! featuredImage ) {\n\t\timage = (\n\t\t\t<MediaPlaceholder\n\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\taccept=\"image/*\"\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\tonError={ onUploadError }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\ttooltipPosition=\"top center\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\topen();\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);\n\t} else {\n\t\t// We have a Featured image so show a Placeholder if is loading.\n\t\timage = ! media ? (\n\t\t\tplaceholder()\n\t\t) : (\n\t\t\t<img\n\t\t\t\tclassName={ borderProps.className }\n\t\t\t\tsrc={ mediaUrl }\n\t\t\t\talt={\n\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\tstyle={ imageStyles }\n\t\t\t/>\n\t\t);\n\t}\n\n\t/**\n\t * When the post featured image block:\n\t * - Has an image assigned\n\t * - Is not inside a query loop\n\t * Then display the image and the image replacement option.\n\t */\n\treturn (\n\t\t<>\n\t\t\t{ controls }\n\t\t\t{ !! media && ! isDescendentOfQueryLoop && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ featuredImage }\n\t\t\t\t\t\tmediaURL={ mediaUrl }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t>\n\t\t\t\t\t\t<MenuItem onClick={ () => setFeaturedImage( 0 ) }>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MediaReplaceFlow>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ image }\n\t\t\t\t<Overlay\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -33,6 +33,9 @@ const metadata = {
|
|
|
33
33
|
type: "boolean",
|
|
34
34
|
"default": false
|
|
35
35
|
},
|
|
36
|
+
aspectRatio: {
|
|
37
|
+
type: "string"
|
|
38
|
+
},
|
|
36
39
|
width: {
|
|
37
40
|
type: "string"
|
|
38
41
|
},
|
|
@@ -75,6 +78,7 @@ const metadata = {
|
|
|
75
78
|
usesContext: ["postId", "postType", "queryId"],
|
|
76
79
|
supports: {
|
|
77
80
|
align: ["left", "right", "center", "wide", "full"],
|
|
81
|
+
anchor: true,
|
|
78
82
|
color: {
|
|
79
83
|
__experimentalDuotone: "img, .wp-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before",
|
|
80
84
|
text: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-featured-image/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-featured-image/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,wBADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postFeaturedImage as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -57,6 +57,7 @@ function PostNavigationLinkEdit(_ref) {
|
|
|
57
57
|
})
|
|
58
58
|
});
|
|
59
59
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.InspectorControls, null, (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_components.ToggleControl, {
|
|
60
|
+
__nextHasNoMarginBottom: true,
|
|
60
61
|
label: (0, _i18n.__)('Display the title as a link'),
|
|
61
62
|
help: (0, _i18n.__)('If you have entered a custom label, it will be prepended before the title.'),
|
|
62
63
|
checked: !!showTitle,
|
|
@@ -64,6 +65,7 @@ function PostNavigationLinkEdit(_ref) {
|
|
|
64
65
|
showTitle: !showTitle
|
|
65
66
|
})
|
|
66
67
|
}), showTitle && (0, _element.createElement)(_components.ToggleControl, {
|
|
68
|
+
__nextHasNoMarginBottom: true,
|
|
67
69
|
label: (0, _i18n.__)('Include the label as part of the link'),
|
|
68
70
|
checked: !!linkLabel,
|
|
69
71
|
onChange: () => setAttributes({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-navigation-link/edit.js"],"names":["PostNavigationLinkEdit","attributes","type","label","showTitle","textAlign","linkLabel","arrow","setAttributes","isNext","placeholder","arrowMap","none","chevron","displayArrow","ariaLabel","blockProps","className","value","nextAlign","newLabel","event","preventDefault"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAMA;;AAOA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;AAgBe,SAASA,sBAAT,OAGX;AAAA,MAH4C;AAC/CC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,IAAF;AAAQC,MAAAA,KAAR;AAAeC,MAAAA,SAAf;AAA0BC,MAAAA,SAA1B;AAAqCC,MAAAA,SAArC;AAAgDC,MAAAA;AAAhD,KADmC;AAE/CC,IAAAA;AAF+C,GAG5C;AACH,QAAMC,MAAM,GAAGP,IAAI,KAAK,MAAxB;AACA,MAAIQ,WAAW,GAAGD,MAAM,GAAG,cAAI,MAAJ,CAAH,GAAkB,cAAI,UAAJ,CAA1C;AAEA,QAAME,QAAQ,GAAG;AAChBC,IAAAA,IAAI,EAAE,EADU;AAEhBL,IAAAA,KAAK,EAAEE,MAAM,GAAG,GAAH,GAAS,GAFN;AAGhBI,IAAAA,OAAO,EAAEJ,MAAM,GAAG,GAAH,GAAS;AAHR,GAAjB;AAMA,QAAMK,YAAY,GAAGH,QAAQ,CAAEJ,KAAF,CAA7B;;AAEA,MAAKH,SAAL,EAAiB;AAChB;AACAM,IAAAA,WAAW,GAAGD,MAAM,GAAG,cAAI,QAAJ,CAAH,GAAoB,cAAI,YAAJ,CAAxC;AACA;;AAED,QAAMM,SAAS,GAAGN,MAAM,GAAG,cAAI,WAAJ,CAAH,GAAuB,cAAI,eAAJ,CAA/C;AACA,QAAMO,UAAU,GAAG,gCAAe;AACjCC,IAAAA,SAAS,EAAE,yBAAY;AACtB,OAAG,kBAAkBZ,SAAW,EAAhC,GAAqCA;AADf,KAAZ;AADsB,GAAf,CAAnB;AAKA,SACC,qDACC,4BAAC,8BAAD,QACC,4BAAC,qBAAD,QACC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,6BAAJ,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-navigation-link/edit.js"],"names":["PostNavigationLinkEdit","attributes","type","label","showTitle","textAlign","linkLabel","arrow","setAttributes","isNext","placeholder","arrowMap","none","chevron","displayArrow","ariaLabel","blockProps","className","value","nextAlign","newLabel","event","preventDefault"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAMA;;AAOA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;AAgBe,SAASA,sBAAT,OAGX;AAAA,MAH4C;AAC/CC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,IAAF;AAAQC,MAAAA,KAAR;AAAeC,MAAAA,SAAf;AAA0BC,MAAAA,SAA1B;AAAqCC,MAAAA,SAArC;AAAgDC,MAAAA;AAAhD,KADmC;AAE/CC,IAAAA;AAF+C,GAG5C;AACH,QAAMC,MAAM,GAAGP,IAAI,KAAK,MAAxB;AACA,MAAIQ,WAAW,GAAGD,MAAM,GAAG,cAAI,MAAJ,CAAH,GAAkB,cAAI,UAAJ,CAA1C;AAEA,QAAME,QAAQ,GAAG;AAChBC,IAAAA,IAAI,EAAE,EADU;AAEhBL,IAAAA,KAAK,EAAEE,MAAM,GAAG,GAAH,GAAS,GAFN;AAGhBI,IAAAA,OAAO,EAAEJ,MAAM,GAAG,GAAH,GAAS;AAHR,GAAjB;AAMA,QAAMK,YAAY,GAAGH,QAAQ,CAAEJ,KAAF,CAA7B;;AAEA,MAAKH,SAAL,EAAiB;AAChB;AACAM,IAAAA,WAAW,GAAGD,MAAM,GAAG,cAAI,QAAJ,CAAH,GAAoB,cAAI,YAAJ,CAAxC;AACA;;AAED,QAAMM,SAAS,GAAGN,MAAM,GAAG,cAAI,WAAJ,CAAH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AFO;AAFT,IAnBD,EA0BC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,SADP;AAEC,IAAA,KAAK,EAAG,cACP,SADO,EAEP,qCAFO;AAFT,IA1BD,CA5BD,CADD,CADD,EAkEC,4BAAC,0BAAD,QACC,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAGb,SADT;AAEC,IAAA,QAAQ,EAAKc,SAAF,IAAiB;AAC3BX,MAAAA,aAAa,CAAE;AAAEH,QAAAA,SAAS,EAAEc;AAAb,OAAF,CAAb;AACA;AAJF,IADD,CAlED,EA0EC,mCAAUH,UAAV,EACG,CAAEP,MAAF,IAAYK,YAAZ,IACD;AACC,IAAA,SAAS,EAAI,0DAA0DP,KAAO;AAD/E,KAGGO,YAHH,CAFF,EAQC,4BAAC,qBAAD;AACC,IAAA,OAAO,EAAC,GADT;AAEC,kBAAaC,SAFd;AAGC,IAAA,WAAW,EAAGL,WAHf;AAIC,IAAA,KAAK,EAAGP,KAJT;AAKC,IAAA,cAAc,EAAG,CAAE,WAAF,EAAe,aAAf,CALlB;AAMC,IAAA,QAAQ,EAAKiB,QAAF,IACVZ,aAAa,CAAE;AAAEL,MAAAA,KAAK,EAAEiB;AAAT,KAAF;AAPf,IARD,EAkBGhB,SAAS,IACV;AACC,IAAA,IAAI,EAAC,8BADN;AAEC,IAAA,OAAO,EAAKiB,KAAF,IAAaA,KAAK,CAACC,cAAN;AAFxB,KAIG,cAAI,kBAAJ,CAJH,CAnBF,EA0BGb,MAAM,IAAIK,YAAV,IACD;AACC,IAAA,SAAS,EAAI,sDAAsDP,KAAO,EAD3E;AAEC,mBAAc;AAFf,KAIGO,YAJH,CA3BF,CA1ED,CADD;AAgHA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tToggleControl,\n\tPanelBody,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tRichText,\n\tBlockControls,\n\tAlignmentToolbar,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __, _x } from '@wordpress/i18n';\n\nexport default function PostNavigationLinkEdit( {\n\tattributes: { type, label, showTitle, textAlign, linkLabel, arrow },\n\tsetAttributes,\n} ) {\n\tconst isNext = type === 'next';\n\tlet placeholder = isNext ? __( 'Next' ) : __( 'Previous' );\n\n\tconst arrowMap = {\n\t\tnone: '',\n\t\tarrow: isNext ? '→' : '←',\n\t\tchevron: isNext ? '»' : '«',\n\t};\n\n\tconst displayArrow = arrowMap[ arrow ];\n\n\tif ( showTitle ) {\n\t\t/* translators: Label before for next and previous post. There is a space after the colon. */\n\t\tplaceholder = isNext ? __( 'Next: ' ) : __( 'Previous: ' );\n\t}\n\n\tconst ariaLabel = isNext ? __( 'Next post' ) : __( 'Previous post' );\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display the title as a link' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'If you have entered a custom label, it will be prepended before the title.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tchecked={ !! showTitle }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowTitle: ! showTitle,\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{ showTitle && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t'Include the label as part of the link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tchecked={ !! linkLabel }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tlinkLabel: ! linkLabel,\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\t<ToggleGroupControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\t\t\t\tvalue={ arrow }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tsetAttributes( { arrow: value } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'A decorative arrow for the next and previous link.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"none\"\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'None',\n\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"arrow\"\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'Arrow',\n\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"chevron\"\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'Chevron',\n\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls>\n\t\t\t\t<AlignmentToolbar\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ ! isNext && displayArrow && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ `wp-block-post-navigation-link__arrow-previous is-arrow-${ arrow }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ displayArrow }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<RichText\n\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tallowedFormats={ [ 'core/bold', 'core/italic' ] }\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ showTitle && (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref=\"#post-navigation-pseudo-link\"\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'An example title' ) }\n\t\t\t\t\t</a>\n\t\t\t\t) }\n\t\t\t\t{ isNext && displayArrow && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ `wp-block-post-navigation-link__arrow-next is-arrow-${ arrow }` }\n\t\t\t\t\t\taria-hidden={ true }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ displayArrow }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-navigation-link/index.js"],"names":["name","metadata","settings","edit","variations","init"],"mappings":";;;;;;;;;AAGA;;AAEA;;AACA;;AANA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-navigation-link/index.js"],"names":["name","metadata","settings","edit","variations","init"],"mappings":";;;;;;;;;AAGA;;AAEA;;AACA;;AANA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,aADuB;AAEvBC,EAAAA,UAAU,EAAVA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\tedit,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-template/index.js"],"names":["name","metadata","settings","icon","layout","edit","save","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-template/index.js"],"names":["name","metadata","settings","icon","layout","edit","save","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAEC,aADiB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB;;;AAMA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEP,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { layout } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: layout,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-terms/index.js"],"names":["name","metadata","settings","icon","edit","init","enhanceVariations"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AAEA;;AACA;;AAZA;AACA;AACA;;AAIA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-terms/index.js"],"names":["name","metadata","settings","icon","edit","init","enhanceVariations"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AAEA;;AACA;;AAZA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,qBADuB;AAEvBC,EAAAA,IAAI,EAAJA;AAFuB,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM;AACzB,wBACC,0BADD,EAEC,oBAFD,EAGCC,eAHD;AAMA,SAAO,wBAAW;AAAEN,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,GAAX,CAAP;AACA,CARM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postCategories as icon } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport enhanceVariations from './hooks';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/template-part',\n\t\tenhanceVariations\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"]}
|
|
@@ -50,6 +50,6 @@ function usePostTerms(_ref) {
|
|
|
50
50
|
isLoading: isResolving('getEntityRecords', taxonomyArgs),
|
|
51
51
|
hasPostTerms: !!(terms !== null && terms !== void 0 && terms.length)
|
|
52
52
|
};
|
|
53
|
-
}, [postId, term === null || term === void 0 ? void 0 : (_term$visibility2 = term.visibility) === null || _term$visibility2 === void 0 ? void 0 : _term$visibility2.publicly_queryable]);
|
|
53
|
+
}, [postId, term === null || term === void 0 ? void 0 : (_term$visibility2 = term.visibility) === null || _term$visibility2 === void 0 ? void 0 : _term$visibility2.publicly_queryable, slug]);
|
|
54
54
|
}
|
|
55
55
|
//# sourceMappingURL=use-post-terms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-terms/use-post-terms.js"],"names":["usePostTerms","postId","term","slug","select","visible","visibility","publicly_queryable","postTerms","_isLoading","hasPostTerms","getEntityRecords","isResolving","coreStore","taxonomyArgs","post","per_page","context","terms","isLoading","length"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIe,SAASA,YAAT,OAA0C;AAAA;;AAAA,MAAnB;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAmB;AACxD,QAAM;AAAEC,IAAAA;AAAF,MAAWD,IAAjB;AAEA,SAAO,qBACJE,MAAF,IAAc;AAAA;;AACb,UAAMC,OAAO,GAAGH,IAAH,aAAGA,IAAH,2CAAGA,IAAI,CAAEI,UAAT,qDAAG,iBAAkBC,kBAAlC;;AACA,QAAK,CAAEF,OAAP,EAAiB;AAChB,aAAO;AACNG,QAAAA,SAAS,EAAE,EADL;AAENC,QAAAA,UAAU,EAAE,KAFN;AAGNC,QAAAA,YAAY,EAAE;AAHR,OAAP;AAKA;;AAED,UAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QAAoCR,MAAM,CAAES,eAAF,CAAhD;AACA,UAAMC,YAAY,GAAG,CACpB,UADoB,EAEpBX,IAFoB,EAGpB;AACCY,MAAAA,IAAI,EAAEd,MADP;AAECe,MAAAA,QAAQ,EAAE,CAAC,CAFZ;AAGCC,MAAAA,OAAO,EAAE;AAHV,KAHoB,CAArB;AASA,UAAMC,KAAK,GAAGP,gBAAgB,CAAE,GAAGG,YAAL,CAA9B;AAEA,WAAO;AACNN,MAAAA,SAAS,EAAEU,KADL;AAENC,MAAAA,SAAS,EAAEP,WAAW,CAAE,kBAAF,EAAsBE,YAAtB,CAFhB;AAGNJ,MAAAA,YAAY,EAAE,CAAC,EAAEQ,KAAF,aAAEA,KAAF,eAAEA,KAAK,CAAEE,MAAT;AAHT,KAAP;AAKA,GA5BK,EA6BN,CAAEnB,MAAF,EAAUC,IAAV,aAAUA,IAAV,4CAAUA,IAAI,CAAEI,UAAhB,sDAAU,kBAAkBC,kBAA5B,CA7BM,CAAP;AA+BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nexport default function usePostTerms( { postId, term } ) {\n\tconst { slug } = term;\n\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst visible = term?.visibility?.publicly_queryable;\n\t\t\tif ( ! visible ) {\n\t\t\t\treturn {\n\t\t\t\t\tpostTerms: [],\n\t\t\t\t\t_isLoading: false,\n\t\t\t\t\thasPostTerms: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getEntityRecords, isResolving } = select( coreStore );\n\t\t\tconst taxonomyArgs = [\n\t\t\t\t'taxonomy',\n\t\t\t\tslug,\n\t\t\t\t{\n\t\t\t\t\tpost: postId,\n\t\t\t\t\tper_page: -1,\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t},\n\t\t\t];\n\t\t\tconst terms = getEntityRecords( ...taxonomyArgs );\n\n\t\t\treturn {\n\t\t\t\tpostTerms: terms,\n\t\t\t\tisLoading: isResolving( 'getEntityRecords', taxonomyArgs ),\n\t\t\t\thasPostTerms: !! terms?.length,\n\t\t\t};\n\t\t},\n\t\t[ postId, term?.visibility?.publicly_queryable ]\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-terms/use-post-terms.js"],"names":["usePostTerms","postId","term","slug","select","visible","visibility","publicly_queryable","postTerms","_isLoading","hasPostTerms","getEntityRecords","isResolving","coreStore","taxonomyArgs","post","per_page","context","terms","isLoading","length"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIe,SAASA,YAAT,OAA0C;AAAA;;AAAA,MAAnB;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAmB;AACxD,QAAM;AAAEC,IAAAA;AAAF,MAAWD,IAAjB;AAEA,SAAO,qBACJE,MAAF,IAAc;AAAA;;AACb,UAAMC,OAAO,GAAGH,IAAH,aAAGA,IAAH,2CAAGA,IAAI,CAAEI,UAAT,qDAAG,iBAAkBC,kBAAlC;;AACA,QAAK,CAAEF,OAAP,EAAiB;AAChB,aAAO;AACNG,QAAAA,SAAS,EAAE,EADL;AAENC,QAAAA,UAAU,EAAE,KAFN;AAGNC,QAAAA,YAAY,EAAE;AAHR,OAAP;AAKA;;AAED,UAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QAAoCR,MAAM,CAAES,eAAF,CAAhD;AACA,UAAMC,YAAY,GAAG,CACpB,UADoB,EAEpBX,IAFoB,EAGpB;AACCY,MAAAA,IAAI,EAAEd,MADP;AAECe,MAAAA,QAAQ,EAAE,CAAC,CAFZ;AAGCC,MAAAA,OAAO,EAAE;AAHV,KAHoB,CAArB;AASA,UAAMC,KAAK,GAAGP,gBAAgB,CAAE,GAAGG,YAAL,CAA9B;AAEA,WAAO;AACNN,MAAAA,SAAS,EAAEU,KADL;AAENC,MAAAA,SAAS,EAAEP,WAAW,CAAE,kBAAF,EAAsBE,YAAtB,CAFhB;AAGNJ,MAAAA,YAAY,EAAE,CAAC,EAAEQ,KAAF,aAAEA,KAAF,eAAEA,KAAK,CAAEE,MAAT;AAHT,KAAP;AAKA,GA5BK,EA6BN,CAAEnB,MAAF,EAAUC,IAAV,aAAUA,IAAV,4CAAUA,IAAI,CAAEI,UAAhB,sDAAU,kBAAkBC,kBAA5B,EAAgDJ,IAAhD,CA7BM,CAAP;AA+BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nexport default function usePostTerms( { postId, term } ) {\n\tconst { slug } = term;\n\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst visible = term?.visibility?.publicly_queryable;\n\t\t\tif ( ! visible ) {\n\t\t\t\treturn {\n\t\t\t\t\tpostTerms: [],\n\t\t\t\t\t_isLoading: false,\n\t\t\t\t\thasPostTerms: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getEntityRecords, isResolving } = select( coreStore );\n\t\t\tconst taxonomyArgs = [\n\t\t\t\t'taxonomy',\n\t\t\t\tslug,\n\t\t\t\t{\n\t\t\t\t\tpost: postId,\n\t\t\t\t\tper_page: -1,\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t},\n\t\t\t];\n\t\t\tconst terms = getEntityRecords( ...taxonomyArgs );\n\n\t\t\treturn {\n\t\t\t\tpostTerms: terms,\n\t\t\t\tisLoading: isResolving( 'getEntityRecords', taxonomyArgs ),\n\t\t\t\thasPostTerms: !! terms?.length,\n\t\t\t};\n\t\t},\n\t\t[ postId, term?.visibility?.publicly_queryable, slug ]\n\t);\n}\n"]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _i18n = require("@wordpress/i18n");
|
|
15
|
+
|
|
16
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
17
|
+
|
|
18
|
+
var _blocks = require("@wordpress/blocks");
|
|
19
|
+
|
|
20
|
+
var _coreData = require("@wordpress/core-data");
|
|
21
|
+
|
|
22
|
+
var _wordcount = require("@wordpress/wordcount");
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* External dependencies
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* WordPress dependencies
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Average reading rate - based on average taken from
|
|
34
|
+
* https://irisreading.com/average-reading-speed-in-various-languages/
|
|
35
|
+
* (Characters/minute used for Chinese rather than words).
|
|
36
|
+
*/
|
|
37
|
+
const AVERAGE_READING_RATE = 189;
|
|
38
|
+
|
|
39
|
+
function PostTimeToReadEdit(_ref) {
|
|
40
|
+
let {
|
|
41
|
+
attributes,
|
|
42
|
+
setAttributes,
|
|
43
|
+
context
|
|
44
|
+
} = _ref;
|
|
45
|
+
const {
|
|
46
|
+
textAlign
|
|
47
|
+
} = attributes;
|
|
48
|
+
const {
|
|
49
|
+
postId,
|
|
50
|
+
postType
|
|
51
|
+
} = context;
|
|
52
|
+
const [contentStructure] = (0, _coreData.useEntityProp)('postType', postType, 'content', postId);
|
|
53
|
+
const [blocks] = (0, _coreData.useEntityBlockEditor)('postType', postType, {
|
|
54
|
+
id: postId
|
|
55
|
+
});
|
|
56
|
+
const minutesToReadString = (0, _element.useMemo)(() => {
|
|
57
|
+
// Replicates the logic found in getEditedPostContent().
|
|
58
|
+
let content;
|
|
59
|
+
|
|
60
|
+
if (contentStructure instanceof Function) {
|
|
61
|
+
content = contentStructure({
|
|
62
|
+
blocks
|
|
63
|
+
});
|
|
64
|
+
} else if (blocks) {
|
|
65
|
+
// If we have parsed blocks already, they should be our source of truth.
|
|
66
|
+
// Parsing applies block deprecations and legacy block conversions that
|
|
67
|
+
// unparsed content will not have.
|
|
68
|
+
content = (0, _blocks.__unstableSerializeAndClean)(blocks);
|
|
69
|
+
} else {
|
|
70
|
+
content = contentStructure;
|
|
71
|
+
}
|
|
72
|
+
/*
|
|
73
|
+
* translators: If your word count is based on single characters (e.g. East Asian characters),
|
|
74
|
+
* enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
|
|
75
|
+
* Do not translate into your own language.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
const wordCountType = (0, _i18n._x)('words', 'Word count type. Do not translate!');
|
|
80
|
+
const minutesToRead = Math.max(1, Math.round((0, _wordcount.count)(content, wordCountType) / AVERAGE_READING_RATE));
|
|
81
|
+
return (0, _i18n.sprintf)(
|
|
82
|
+
/* translators: %d is the number of minutes the post will take to read. */
|
|
83
|
+
(0, _i18n._n)('%d minute', '%d minutes', minutesToRead), minutesToRead);
|
|
84
|
+
}, [contentStructure, blocks]);
|
|
85
|
+
const blockProps = (0, _blockEditor.useBlockProps)({
|
|
86
|
+
className: (0, _classnames.default)({
|
|
87
|
+
[`has-text-align-${textAlign}`]: textAlign
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockControls, {
|
|
91
|
+
group: "block"
|
|
92
|
+
}, (0, _element.createElement)(_blockEditor.AlignmentControl, {
|
|
93
|
+
value: textAlign,
|
|
94
|
+
onChange: nextAlign => {
|
|
95
|
+
setAttributes({
|
|
96
|
+
textAlign: nextAlign
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
})), (0, _element.createElement)("p", blockProps, minutesToReadString));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
var _default = PostTimeToReadEdit;
|
|
103
|
+
exports.default = _default;
|
|
104
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-time-to-read/edit.js"],"names":["AVERAGE_READING_RATE","PostTimeToReadEdit","attributes","setAttributes","context","textAlign","postId","postType","contentStructure","blocks","id","minutesToReadString","content","Function","wordCountType","minutesToRead","Math","max","round","blockProps","className","nextAlign"],"mappings":";;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA,MAAMA,oBAAoB,GAAG,GAA7B;;AAEA,SAASC,kBAAT,OAAsE;AAAA,MAAzC;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,aAAd;AAA6BC,IAAAA;AAA7B,GAAyC;AACrE,QAAM;AAAEC,IAAAA;AAAF,MAAgBH,UAAtB;AACA,QAAM;AAAEI,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAuBH,OAA7B;AAEA,QAAM,CAAEI,gBAAF,IAAuB,6BAC5B,UAD4B,EAE5BD,QAF4B,EAG5B,SAH4B,EAI5BD,MAJ4B,CAA7B;AAOA,QAAM,CAAEG,MAAF,IAAa,oCAAsB,UAAtB,EAAkCF,QAAlC,EAA4C;AAC9DG,IAAAA,EAAE,EAAEJ;AAD0D,GAA5C,CAAnB;AAIA,QAAMK,mBAAmB,GAAG,sBAAS,MAAM;AAC1C;AACA,QAAIC,OAAJ;;AACA,QAAKJ,gBAAgB,YAAYK,QAAjC,EAA4C;AAC3CD,MAAAA,OAAO,GAAGJ,gBAAgB,CAAE;AAAEC,QAAAA;AAAF,OAAF,CAA1B;AACA,KAFD,MAEO,IAAKA,MAAL,EAAc;AACpB;AACA;AACA;AACAG,MAAAA,OAAO,GAAG,yCAA6BH,MAA7B,CAAV;AACA,KALM,MAKA;AACNG,MAAAA,OAAO,GAAGJ,gBAAV;AACA;AAED;AACF;AACA;AACA;AACA;;;AACE,UAAMM,aAAa,GAAG,cACrB,OADqB,EAErB,oCAFqB,CAAtB;AAKA,UAAMC,aAAa,GAAGC,IAAI,CAACC,GAAL,CACrB,CADqB,EAErBD,IAAI,CAACE,KAAL,CACC,sBAAWN,OAAX,EAAoBE,aAApB,IAAsCd,oBADvC,CAFqB,CAAtB;AAOA,WAAO;AACN;AACA,kBAAI,WAAJ,EAAiB,YAAjB,EAA+Be,aAA/B,CAFM,EAGNA,aAHM,CAAP;AAKA,GApC2B,EAoCzB,CAAEP,gBAAF,EAAoBC,MAApB,CApCyB,CAA5B;AAsCA,QAAMU,UAAU,GAAG,gCAAe;AACjCC,IAAAA,SAAS,EAAE,yBAAY;AACtB,OAAG,kBAAkBf,SAAW,EAAhC,GAAqCA;AADf,KAAZ;AADsB,GAAf,CAAnB;AAMA,SACC,qDACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAGA,SADT;AAEC,IAAA,QAAQ,EAAKgB,SAAF,IAAiB;AAC3BlB,MAAAA,aAAa,CAAE;AAAEE,QAAAA,SAAS,EAAEgB;AAAb,OAAF,CAAb;AACA;AAJF,IADD,CADD,EASC,iCAAQF,UAAR,EAAuBR,mBAAvB,CATD,CADD;AAaA;;eAEcV,kB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { _x, _n, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { useEntityProp, useEntityBlockEditor } from '@wordpress/core-data';\nimport { count as wordCount } from '@wordpress/wordcount';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n */\nconst AVERAGE_READING_RATE = 189;\n\nfunction PostTimeToReadEdit( { attributes, setAttributes, context } ) {\n\tconst { textAlign } = attributes;\n\tconst { postId, postType } = context;\n\n\tconst [ contentStructure ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'content',\n\t\tpostId\n\t);\n\n\tconst [ blocks ] = useEntityBlockEditor( 'postType', postType, {\n\t\tid: postId,\n\t} );\n\n\tconst minutesToReadString = useMemo( () => {\n\t\t// Replicates the logic found in getEditedPostContent().\n\t\tlet content;\n\t\tif ( contentStructure instanceof Function ) {\n\t\t\tcontent = contentStructure( { blocks } );\n\t\t} else if ( blocks ) {\n\t\t\t// If we have parsed blocks already, they should be our source of truth.\n\t\t\t// Parsing applies block deprecations and legacy block conversions that\n\t\t\t// unparsed content will not have.\n\t\t\tcontent = __unstableSerializeAndClean( blocks );\n\t\t} else {\n\t\t\tcontent = contentStructure;\n\t\t}\n\n\t\t/*\n\t\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t\t * Do not translate into your own language.\n\t\t */\n\t\tconst wordCountType = _x(\n\t\t\t'words',\n\t\t\t'Word count type. Do not translate!'\n\t\t);\n\n\t\tconst minutesToRead = Math.max(\n\t\t\t1,\n\t\t\tMath.round(\n\t\t\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t\t\t)\n\t\t);\n\n\t\treturn sprintf(\n\t\t\t/* translators: %d is the number of minutes the post will take to read. */\n\t\t\t_n( '%d minute', '%d minutes', minutesToRead ),\n\t\t\tminutesToRead\n\t\t);\n\t}, [ contentStructure, blocks ] );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<p { ...blockProps }>{ minutesToReadString }</p>\n\t\t</>\n\t);\n}\n\nexport default PostTimeToReadEdit;\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _components = require("@wordpress/components");
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
var _default = (0, _element.createElement)(_components.SVG, {
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
width: "24",
|
|
18
|
+
height: "24",
|
|
19
|
+
viewBox: "0 0 24 24"
|
|
20
|
+
}, (0, _element.createElement)(_components.Path, {
|
|
21
|
+
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"
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
exports.default = _default;
|
|
25
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-time-to-read/icon.js"],"names":[],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;eAIC,4BAAC,eAAD;AACC,EAAA,KAAK,EAAC,4BADP;AAEC,EAAA,KAAK,EAAC,IAFP;AAGC,EAAA,MAAM,EAAC,IAHR;AAIC,EAAA,OAAO,EAAC;AAJT,GAMC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EAND,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/components';\n\nexport default (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth=\"24\"\n\t\theight=\"24\"\n\t\tviewBox=\"0 0 24 24\"\n\t>\n\t\t<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\" />\n\t</SVG>\n);\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.settings = exports.name = exports.metadata = exports.init = void 0;
|
|
9
|
+
|
|
10
|
+
var _initBlock = _interopRequireDefault(require("../utils/init-block"));
|
|
11
|
+
|
|
12
|
+
var _edit = _interopRequireDefault(require("./edit"));
|
|
13
|
+
|
|
14
|
+
var _icon = _interopRequireDefault(require("./icon"));
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies
|
|
18
|
+
*/
|
|
19
|
+
const metadata = {
|
|
20
|
+
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
21
|
+
apiVersion: 2,
|
|
22
|
+
__experimental: true,
|
|
23
|
+
name: "core/post-time-to-read",
|
|
24
|
+
title: "Time To Read",
|
|
25
|
+
category: "theme",
|
|
26
|
+
description: "Show minutes required to finish reading the post.",
|
|
27
|
+
textdomain: "default",
|
|
28
|
+
usesContext: ["postId", "postType"],
|
|
29
|
+
attributes: {
|
|
30
|
+
textAlign: {
|
|
31
|
+
type: "string"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
supports: {
|
|
35
|
+
html: false,
|
|
36
|
+
multiple: false
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.metadata = metadata;
|
|
40
|
+
const {
|
|
41
|
+
name
|
|
42
|
+
} = metadata;
|
|
43
|
+
exports.name = name;
|
|
44
|
+
const settings = {
|
|
45
|
+
icon: _icon.default,
|
|
46
|
+
edit: _edit.default
|
|
47
|
+
};
|
|
48
|
+
exports.settings = settings;
|
|
49
|
+
|
|
50
|
+
const init = () => (0, _initBlock.default)({
|
|
51
|
+
name,
|
|
52
|
+
metadata,
|
|
53
|
+
settings
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
exports.init = init;
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-time-to-read/index.js"],"names":["name","metadata","settings","icon","edit","init"],"mappings":";;;;;;;;;AAGA;;AAEA;;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,CAAjB;;;AAKA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEL,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport icon from './icon';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
package/build/post-title/edit.js
CHANGED
|
@@ -116,12 +116,14 @@ function PostTitleEdit(_ref) {
|
|
|
116
116
|
})), (0, _element.createElement)(_blockEditor.InspectorControls, null, (0, _element.createElement)(_components.PanelBody, {
|
|
117
117
|
title: (0, _i18n.__)('Link settings')
|
|
118
118
|
}, (0, _element.createElement)(_components.ToggleControl, {
|
|
119
|
+
__nextHasNoMarginBottom: true,
|
|
119
120
|
label: (0, _i18n.__)('Make title a link'),
|
|
120
121
|
onChange: () => setAttributes({
|
|
121
122
|
isLink: !isLink
|
|
122
123
|
}),
|
|
123
124
|
checked: isLink
|
|
124
125
|
}), isLink && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.ToggleControl, {
|
|
126
|
+
__nextHasNoMarginBottom: true,
|
|
125
127
|
label: (0, _i18n.__)('Open in new tab'),
|
|
126
128
|
onChange: value => setAttributes({
|
|
127
129
|
linkTarget: value ? '_blank' : '_self'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-title/edit.js"],"names":["PostTitleEdit","attributes","level","textAlign","isLink","rel","linkTarget","setAttributes","context","postType","postId","queryId","TagName","isDescendentOfQueryLoop","Number","isFinite","userCanEdit","rawTitle","setTitle","fullTitle","link","blockProps","className","titleElement","__html","rendered","length","event","preventDefault","newLevel","nextAlign","value","newRel"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAOA;;AACA;;AACA;;AAKA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AAIe,SAASA,aAAT,OAIX;AAAA,MAJmC;AACtCC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,KAAF;AA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iB;AAC3BvB,MAAAA,aAAa,CAAE;AAAEJ,QAAAA,SAAS,EAAE2B;AAAb,OAAF,CAAb;AACA;AAJF,IAPD,CADD,EAeC,4BAAC,8BAAD,QACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,eAAJ;AAAnB,KACC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,mBAAJ,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-title/edit.js"],"names":["PostTitleEdit","attributes","level","textAlign","isLink","rel","linkTarget","setAttributes","context","postType","postId","queryId","TagName","isDescendentOfQueryLoop","Number","isFinite","userCanEdit","rawTitle","setTitle","fullTitle","link","blockProps","className","titleElement","__html","rendered","length","event","preventDefault","newLevel","nextAlign","value","newRel"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAOA;;AACA;;AACA;;AAKA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AAIe,SAASA,aAAT,OAIX;AAAA,MAJmC;AACtCC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA,SAAT;AAAoBC,MAAAA,MAApB;AAA4BC,MAAAA,GAA5B;AAAiCC,MAAAA;AAAjC,KAD0B;AAEtCC,IAAAA,aAFsC;AAGtCC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA,MAAZ;AAAoBC,MAAAA;AAApB;AAH6B,GAInC;AACH,QAAMC,OAAO,GAAG,MAAMV,KAAN,GAAc,GAAd,GAAoB,MAAMA,KAA1C;AACA,QAAMW,uBAAuB,GAAGC,MAAM,CAACC,QAAP,CAAiBJ,OAAjB,CAAhC;AACA,QAAMK,WAAW,GAAG,6BAAkB,UAAlB,EAA8BP,QAA9B,EAAwCC,MAAxC,CAApB;AACA,QAAM,CAAEO,QAAQ,GAAG,EAAb,EAAiBC,QAAjB,EAA2BC,SAA3B,IAAyC,6BAC9C,UAD8C,EAE9CV,QAF8C,E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B,KAAF,IACVxB,aAAa,CAAE;AACdD,MAAAA,UAAU,EAAEyB,KAAK,GAAG,QAAH,GAAc;AADjB,KAAF,CAJf;AAQC,IAAA,OAAO,EAAGzB,UAAU,KAAK;AAR1B,IADD,EAWC,4BAAC,uBAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EAAG,cAAI,UAAJ,CAFT;AAGC,IAAA,KAAK,EAAGD,GAHT;AAIC,IAAA,QAAQ,EAAK2B,MAAF,IACVzB,aAAa,CAAE;AAAEF,MAAAA,GAAG,EAAE2B;AAAP,KAAF;AALf,IAXD,CARF,CADD,CAfD,EA+CGT,YA/CH,CADD;AAmDA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tPlainText,\n} from '@wordpress/block-editor';\nimport { ToggleControl, TextControl, PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityProp } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport HeadingLevelDropdown from '../heading/heading-level-dropdown';\nimport { useCanEditEntity } from '../utils/hooks';\n\nexport default function PostTitleEdit( {\n\tattributes: { level, textAlign, isLink, rel, linkTarget },\n\tsetAttributes,\n\tcontext: { postType, postId, queryId },\n} ) {\n\tconst TagName = 0 === level ? 'p' : 'h' + level;\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst userCanEdit = useCanEditEntity( 'postType', postType, postId );\n\tconst [ rawTitle = '', setTitle, fullTitle ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'title',\n\t\tpostId\n\t);\n\tconst [ link ] = useEntityProp( 'postType', postType, 'link', postId );\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tlet titleElement = (\n\t\t<TagName { ...blockProps }>{ __( 'Post Title' ) }</TagName>\n\t);\n\n\tif ( postType && postId ) {\n\t\ttitleElement =\n\t\t\tuserCanEdit && ! isDescendentOfQueryLoop ? (\n\t\t\t\t<PlainText\n\t\t\t\t\ttagName={ TagName }\n\t\t\t\t\tplaceholder={ __( 'No Title' ) }\n\t\t\t\t\tvalue={ rawTitle }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tdangerouslySetInnerHTML={ { __html: fullTitle?.rendered } }\n\t\t\t\t/>\n\t\t\t);\n\t}\n\n\tif ( isLink && postType && postId ) {\n\t\ttitleElement =\n\t\t\tuserCanEdit && ! isDescendentOfQueryLoop ? (\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t<PlainText\n\t\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\t\thref={ link }\n\t\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\t\trel={ rel }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t! rawTitle.length ? __( 'No Title' ) : null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ rawTitle }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\t/>\n\t\t\t\t</TagName>\n\t\t\t) : (\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={ link }\n\t\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\t\trel={ rel }\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: fullTitle?.rendered,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</TagName>\n\t\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<HeadingLevelDropdown\n\t\t\t\t\tselectedLevel={ level }\n\t\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Make title a link' ) }\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\t__nextHasNoMarginBottom\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\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\t\t\tvalue={ rel }\n\t\t\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\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</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ titleElement }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-title/index.js"],"names":["name","metadata","settings","icon","edit","deprecated","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/post-title/index.js"],"names":["name","metadata","settings","icon","edit","deprecated","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,UAAU,EAAVA;AAHuB,CAAjB;;;AAMA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEN,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { title as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\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\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -121,6 +121,7 @@ function QueryInspectorControls(_ref) {
|
|
|
121
121
|
return (0, _element.createElement)(_element.Fragment, null, showSettingsPanel && (0, _element.createElement)(_blockEditor.InspectorControls, null, (0, _element.createElement)(_components.PanelBody, {
|
|
122
122
|
title: (0, _i18n.__)('Settings')
|
|
123
123
|
}, showInheritControl && (0, _element.createElement)(_components.ToggleControl, {
|
|
124
|
+
__nextHasNoMarginBottom: true,
|
|
124
125
|
label: (0, _i18n.__)('Inherit query from template'),
|
|
125
126
|
help: (0, _i18n.__)('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.'),
|
|
126
127
|
checked: !!inherit,
|