@wordpress/block-library 9.5.0 → 9.6.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 +2 -0
- package/build/archives/edit.js +1 -0
- package/build/archives/edit.js.map +1 -1
- package/build/audio/edit.js +1 -0
- package/build/audio/edit.js.map +1 -1
- package/build/avatar/user-control.js +1 -0
- package/build/avatar/user-control.js.map +1 -1
- package/build/button/edit.js +1 -0
- package/build/button/edit.js.map +1 -1
- package/build/comment-author-name/index.js +14 -1
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +14 -1
- package/build/comment-content/index.js.map +1 -1
- package/build/comment-date/index.js +14 -1
- package/build/comment-date/index.js.map +1 -1
- package/build/comments-pagination/comments-pagination-arrow-controls.js +1 -0
- package/build/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +0 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/embed/edit.js +12 -4
- package/build/embed/edit.js.map +1 -1
- package/build/embed/embed-placeholder.js +6 -3
- package/build/embed/embed-placeholder.js.map +1 -1
- package/build/embed/embed-preview.js +4 -18
- package/build/embed/embed-preview.js.map +1 -1
- package/build/file/index.js +12 -0
- package/build/file/index.js.map +1 -1
- package/build/file/inspector.js +1 -0
- package/build/file/inspector.js.map +1 -1
- package/build/form/edit.js +2 -0
- package/build/form/edit.js.map +1 -1
- package/build/form-input/edit.js +1 -0
- package/build/form-input/edit.js.map +1 -1
- package/build/gallery/edit.js +2 -6
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.native.js +4 -1
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/group/edit.js +1 -1
- package/build/group/edit.js.map +1 -1
- package/build/image/image.js +6 -1
- package/build/image/image.js.map +1 -1
- package/build/image/transforms.js +4 -0
- package/build/image/transforms.js.map +1 -1
- package/build/latest-posts/edit.js +37 -11
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/index.js +9 -0
- package/build/list/index.js.map +1 -1
- package/build/list-item/index.js +8 -1
- package/build/list-item/index.js.map +1 -1
- package/build/media-text/edit.js +0 -1
- package/build/media-text/edit.js.map +1 -1
- package/build/missing/edit.js +10 -19
- package/build/missing/edit.js.map +1 -1
- package/build/navigation/edit/index.js +3 -4
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-name-control.js +1 -0
- package/build/navigation/edit/navigation-menu-name-control.js.map +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +2 -0
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/post-author/edit.js +60 -53
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +13 -0
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/index.js +14 -1
- package/build/post-author-biography/index.js.map +1 -1
- package/build/post-author-name/index.js +14 -1
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comment/edit.js +2 -0
- package/build/post-comment/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -0
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +9 -2
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +1 -0
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-navigation-link/edit.js +5 -2
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-terms/edit.js +1 -0
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-title/edit.js +1 -0
- package/build/post-title/edit.js.map +1 -1
- package/build/preformatted/index.js +12 -0
- package/build/preformatted/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +1 -0
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/query-content.js +1 -1
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query-pagination/query-pagination-arrow-controls.js +1 -0
- package/build/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build/query-pagination-numbers/edit.js +1 -0
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-title/index.js +12 -0
- package/build/query-title/index.js.map +1 -1
- package/build/quote/index.js +1 -0
- package/build/quote/index.js.map +1 -1
- package/build/quote/transforms.js +4 -0
- package/build/quote/transforms.js.map +1 -1
- package/build/search/edit.js +9 -5
- package/build/search/edit.js.map +1 -1
- package/build/social-link/edit.js +2 -0
- package/build/social-link/edit.js.map +1 -1
- package/build/table/edit.js +6 -5
- package/build/table/edit.js.map +1 -1
- package/build/tag-cloud/edit.js +44 -33
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/tag-cloud/index.js +12 -0
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -0
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/video/edit-common-settings.js +1 -0
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/tracks-editor.js +3 -0
- package/build/video/tracks-editor.js.map +1 -1
- package/build/video/transforms.js +4 -0
- package/build/video/transforms.js.map +1 -1
- package/build-module/archives/edit.js +1 -0
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/audio/edit.js +1 -0
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/avatar/user-control.js +1 -0
- package/build-module/avatar/user-control.js.map +1 -1
- package/build-module/button/edit.js +1 -0
- package/build-module/button/edit.js.map +1 -1
- package/build-module/comment-author-name/index.js +14 -1
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +14 -1
- package/build-module/comment-content/index.js.map +1 -1
- package/build-module/comment-date/index.js +14 -1
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js +1 -0
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +0 -1
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/embed/edit.js +13 -5
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/embed-placeholder.js +7 -4
- package/build-module/embed/embed-placeholder.js.map +1 -1
- package/build-module/embed/embed-preview.js +5 -19
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/file/index.js +12 -0
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/inspector.js +1 -0
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/form/edit.js +2 -0
- package/build-module/form/edit.js.map +1 -1
- package/build-module/form-input/edit.js +1 -0
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/gallery/edit.js +3 -7
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.native.js +4 -1
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/group/edit.js +1 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/image/image.js +7 -2
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/transforms.js +5 -1
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/latest-posts/edit.js +40 -14
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/index.js +9 -0
- package/build-module/list/index.js.map +1 -1
- package/build-module/list-item/index.js +8 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/media-text/edit.js +0 -1
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/missing/edit.js +10 -19
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/navigation/edit/index.js +3 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-name-control.js +1 -0
- package/build-module/navigation/edit/navigation-menu-name-control.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +2 -0
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/post-author/edit.js +61 -54
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +13 -0
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/index.js +14 -1
- package/build-module/post-author-biography/index.js.map +1 -1
- package/build-module/post-author-name/index.js +14 -1
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comment/edit.js +2 -0
- package/build-module/post-comment/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -0
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +9 -2
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +1 -0
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +5 -2
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +1 -0
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-title/edit.js +1 -0
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/preformatted/index.js +12 -0
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +1 -0
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/query-content.js +1 -1
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query-pagination/query-pagination-arrow-controls.js +1 -0
- package/build-module/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build-module/query-pagination-numbers/edit.js +1 -0
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-title/index.js +12 -0
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/quote/index.js +1 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/transforms.js +4 -0
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/search/edit.js +10 -6
- package/build-module/search/edit.js.map +1 -1
- package/build-module/social-link/edit.js +2 -0
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/table/edit.js +6 -5
- package/build-module/table/edit.js.map +1 -1
- package/build-module/tag-cloud/edit.js +45 -34
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/tag-cloud/index.js +12 -0
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +2 -0
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/video/edit-common-settings.js +1 -0
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +3 -0
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-module/video/transforms.js +5 -1
- package/build-module/video/transforms.js.map +1 -1
- package/build-style/archives/editor-rtl.css +2 -2
- package/build-style/archives/editor.css +2 -2
- package/build-style/archives/style-rtl.css +2 -2
- package/build-style/archives/style.css +2 -2
- package/build-style/audio/editor-rtl.css +2 -2
- package/build-style/audio/editor.css +2 -2
- package/build-style/audio/style-rtl.css +2 -2
- package/build-style/audio/style.css +2 -2
- package/build-style/audio/theme-rtl.css +2 -2
- package/build-style/audio/theme.css +2 -2
- package/build-style/avatar/editor-rtl.css +2 -2
- package/build-style/avatar/editor.css +2 -2
- package/build-style/avatar/style-rtl.css +2 -2
- package/build-style/avatar/style.css +2 -2
- package/build-style/button/editor-rtl.css +2 -2
- package/build-style/button/editor.css +2 -2
- package/build-style/button/style-rtl.css +2 -2
- package/build-style/button/style.css +2 -2
- package/build-style/buttons/editor-rtl.css +2 -2
- package/build-style/buttons/editor.css +2 -2
- package/build-style/buttons/style-rtl.css +2 -2
- package/build-style/buttons/style.css +2 -2
- package/build-style/calendar/style-rtl.css +2 -2
- package/build-style/calendar/style.css +2 -2
- package/build-style/categories/editor-rtl.css +2 -2
- package/build-style/categories/editor.css +2 -2
- package/build-style/categories/style-rtl.css +2 -2
- package/build-style/categories/style.css +2 -2
- package/build-style/classic-rtl.css +2 -2
- package/build-style/classic.css +2 -2
- package/build-style/code/editor-rtl.css +2 -2
- package/build-style/code/editor.css +2 -2
- package/build-style/code/style-rtl.css +2 -2
- package/build-style/code/style.css +2 -2
- package/build-style/code/theme-rtl.css +2 -2
- package/build-style/code/theme.css +2 -2
- package/build-style/columns/editor-rtl.css +2 -2
- package/build-style/columns/editor.css +2 -2
- package/build-style/columns/style-rtl.css +2 -2
- package/build-style/columns/style.css +2 -2
- package/build-style/comment-author-avatar/editor-rtl.css +2 -2
- package/build-style/comment-author-avatar/editor.css +2 -2
- package/build-style/comment-author-name/style-rtl.css +94 -0
- package/build-style/comment-author-name/style.css +94 -0
- package/build-style/comment-content/style-rtl.css +6 -2
- package/build-style/comment-content/style.css +6 -2
- package/build-style/comment-date/style-rtl.css +94 -0
- package/build-style/comment-date/style.css +94 -0
- package/build-style/comment-template/style-rtl.css +2 -2
- package/build-style/comment-template/style.css +2 -2
- package/build-style/comments/editor-rtl.css +2 -2
- package/build-style/comments/editor.css +2 -2
- package/build-style/comments/style-rtl.css +2 -2
- package/build-style/comments/style.css +2 -2
- package/build-style/comments-pagination/editor-rtl.css +2 -2
- package/build-style/comments-pagination/editor.css +2 -2
- package/build-style/comments-pagination/style-rtl.css +2 -2
- package/build-style/comments-pagination/style.css +2 -2
- package/build-style/comments-pagination-numbers/editor-rtl.css +2 -2
- package/build-style/comments-pagination-numbers/editor.css +2 -2
- package/build-style/comments-title/editor-rtl.css +2 -2
- package/build-style/comments-title/editor.css +2 -2
- package/build-style/common-rtl.css +2 -2
- package/build-style/common.css +2 -2
- package/build-style/cover/editor-rtl.css +2 -2
- package/build-style/cover/editor.css +2 -2
- package/build-style/cover/style-rtl.css +2 -2
- package/build-style/cover/style.css +2 -2
- package/build-style/details/editor-rtl.css +2 -2
- package/build-style/details/editor.css +2 -2
- package/build-style/details/style-rtl.css +2 -2
- package/build-style/details/style.css +2 -2
- package/build-style/editor-elements-rtl.css +2 -2
- package/build-style/editor-elements.css +2 -2
- package/build-style/editor-rtl.css +31 -15
- package/build-style/editor.css +31 -15
- package/build-style/elements-rtl.css +2 -2
- package/build-style/elements.css +2 -2
- package/build-style/embed/editor-rtl.css +5 -2
- package/build-style/embed/editor.css +5 -2
- package/build-style/embed/style-rtl.css +2 -2
- package/build-style/embed/style.css +2 -2
- package/build-style/embed/theme-rtl.css +2 -2
- package/build-style/embed/theme.css +2 -2
- package/build-style/file/editor-rtl.css +2 -2
- package/build-style/file/editor.css +2 -2
- package/build-style/file/style-rtl.css +2 -2
- package/build-style/file/style.css +2 -2
- package/build-style/footnotes/style-rtl.css +2 -2
- package/build-style/footnotes/style.css +2 -2
- package/build-style/form-input/editor-rtl.css +2 -2
- package/build-style/form-input/editor.css +2 -2
- package/build-style/form-input/style-rtl.css +2 -2
- package/build-style/form-input/style.css +2 -2
- package/build-style/form-submission-notification/editor-rtl.css +2 -2
- package/build-style/form-submission-notification/editor.css +2 -2
- package/build-style/form-submit-button/style-rtl.css +2 -2
- package/build-style/form-submit-button/style.css +2 -2
- package/build-style/freeform/editor-rtl.css +2 -2
- package/build-style/freeform/editor.css +2 -2
- package/build-style/gallery/editor-rtl.css +2 -2
- package/build-style/gallery/editor.css +2 -2
- package/build-style/gallery/style-rtl.css +26 -9
- package/build-style/gallery/style.css +26 -9
- package/build-style/gallery/theme-rtl.css +2 -2
- package/build-style/gallery/theme.css +2 -2
- package/build-style/group/editor-rtl.css +2 -2
- package/build-style/group/editor.css +2 -2
- package/build-style/group/style-rtl.css +2 -2
- package/build-style/group/style.css +2 -2
- package/build-style/group/theme-rtl.css +2 -2
- package/build-style/group/theme.css +2 -2
- package/build-style/heading/style-rtl.css +2 -2
- package/build-style/heading/style.css +2 -2
- package/build-style/html/editor-rtl.css +2 -2
- package/build-style/html/editor.css +2 -2
- package/build-style/image/editor-rtl.css +2 -2
- package/build-style/image/editor.css +2 -2
- package/build-style/image/style-rtl.css +2 -2
- package/build-style/image/style.css +2 -2
- package/build-style/image/theme-rtl.css +2 -2
- package/build-style/image/theme.css +2 -2
- package/build-style/latest-comments/style-rtl.css +2 -2
- package/build-style/latest-comments/style.css +2 -2
- package/build-style/latest-posts/editor-rtl.css +9 -6
- package/build-style/latest-posts/editor.css +9 -6
- package/build-style/latest-posts/style-rtl.css +2 -2
- package/build-style/latest-posts/style.css +2 -2
- package/build-style/list/style-rtl.css +2 -2
- package/build-style/list/style.css +2 -2
- package/build-style/loginout/style-rtl.css +2 -2
- package/build-style/loginout/style.css +2 -2
- package/build-style/media-text/editor-rtl.css +2 -2
- package/build-style/media-text/editor.css +2 -2
- package/build-style/media-text/style-rtl.css +2 -2
- package/build-style/media-text/style.css +2 -2
- package/build-style/more/editor-rtl.css +2 -2
- package/build-style/more/editor.css +2 -2
- package/build-style/navigation/editor-rtl.css +6 -2
- package/build-style/navigation/editor.css +6 -2
- package/build-style/navigation/style-rtl.css +2 -2
- package/build-style/navigation/style.css +2 -2
- package/build-style/navigation-link/editor-rtl.css +2 -5
- package/build-style/navigation-link/editor.css +2 -5
- package/build-style/navigation-link/style-rtl.css +2 -2
- package/build-style/navigation-link/style.css +2 -2
- package/build-style/navigation-submenu/editor-rtl.css +2 -2
- package/build-style/navigation-submenu/editor.css +2 -2
- package/build-style/nextpage/editor-rtl.css +2 -2
- package/build-style/nextpage/editor.css +2 -2
- package/build-style/page-list/editor-rtl.css +2 -2
- package/build-style/page-list/editor.css +2 -2
- package/build-style/page-list/style-rtl.css +2 -2
- package/build-style/page-list/style.css +2 -2
- package/build-style/paragraph/editor-rtl.css +2 -2
- package/build-style/paragraph/editor.css +2 -2
- package/build-style/paragraph/style-rtl.css +2 -2
- package/build-style/paragraph/style.css +2 -2
- package/build-style/post-author/editor-rtl.css +95 -0
- package/build-style/post-author/editor.css +95 -0
- package/build-style/post-author/style-rtl.css +3 -2
- package/build-style/post-author/style.css +3 -2
- package/build-style/post-author-biography/style-rtl.css +94 -0
- package/build-style/post-author-biography/style.css +94 -0
- package/build-style/post-author-name/style-rtl.css +94 -0
- package/build-style/post-author-name/style.css +94 -0
- package/build-style/post-comments-form/editor-rtl.css +2 -2
- package/build-style/post-comments-form/editor.css +2 -2
- package/build-style/post-comments-form/style-rtl.css +2 -2
- package/build-style/post-comments-form/style.css +2 -2
- package/build-style/post-content/editor-rtl.css +2 -2
- package/build-style/post-content/editor.css +2 -2
- package/build-style/post-content/style-rtl.css +2 -2
- package/build-style/post-content/style.css +2 -2
- package/build-style/post-date/style-rtl.css +2 -2
- package/build-style/post-date/style.css +2 -2
- package/build-style/post-excerpt/editor-rtl.css +2 -2
- package/build-style/post-excerpt/editor.css +2 -2
- package/build-style/post-excerpt/style-rtl.css +2 -2
- package/build-style/post-excerpt/style.css +2 -2
- package/build-style/post-featured-image/editor-rtl.css +2 -2
- package/build-style/post-featured-image/editor.css +2 -2
- package/build-style/post-featured-image/style-rtl.css +2 -2
- package/build-style/post-featured-image/style.css +2 -2
- package/build-style/post-navigation-link/style-rtl.css +2 -2
- package/build-style/post-navigation-link/style.css +2 -2
- package/build-style/post-template/editor-rtl.css +2 -2
- package/build-style/post-template/editor.css +2 -2
- package/build-style/post-template/style-rtl.css +2 -2
- package/build-style/post-template/style.css +2 -2
- package/build-style/post-terms/style-rtl.css +2 -2
- package/build-style/post-terms/style.css +2 -2
- package/build-style/post-time-to-read/style-rtl.css +2 -2
- package/build-style/post-time-to-read/style.css +2 -2
- package/build-style/post-title/style-rtl.css +2 -2
- package/build-style/post-title/style.css +2 -2
- package/build-style/preformatted/style-rtl.css +2 -2
- package/build-style/preformatted/style.css +2 -2
- package/build-style/pullquote/editor-rtl.css +2 -2
- package/build-style/pullquote/editor.css +2 -2
- package/build-style/pullquote/style-rtl.css +2 -2
- package/build-style/pullquote/style.css +2 -2
- package/build-style/pullquote/theme-rtl.css +2 -2
- package/build-style/pullquote/theme.css +2 -2
- package/build-style/query/editor-rtl.css +2 -2
- package/build-style/query/editor.css +2 -2
- package/build-style/query-pagination/editor-rtl.css +2 -2
- package/build-style/query-pagination/editor.css +2 -2
- package/build-style/query-pagination/style-rtl.css +2 -2
- package/build-style/query-pagination/style.css +2 -2
- package/build-style/query-pagination-numbers/editor-rtl.css +2 -2
- package/build-style/query-pagination-numbers/editor.css +2 -2
- package/build-style/query-title/style-rtl.css +2 -2
- package/build-style/query-title/style.css +2 -2
- package/build-style/quote/style-rtl.css +2 -2
- package/build-style/quote/style.css +2 -2
- package/build-style/quote/theme-rtl.css +2 -2
- package/build-style/quote/theme.css +2 -2
- package/build-style/read-more/style-rtl.css +2 -2
- package/build-style/read-more/style.css +2 -2
- package/build-style/reset-rtl.css +2 -2
- package/build-style/reset.css +2 -2
- package/build-style/rss/editor-rtl.css +2 -2
- package/build-style/rss/editor.css +2 -2
- package/build-style/rss/style-rtl.css +2 -2
- package/build-style/rss/style.css +2 -2
- package/build-style/search/editor-rtl.css +5 -4
- package/build-style/search/editor.css +5 -4
- package/build-style/search/style-rtl.css +2 -2
- package/build-style/search/style.css +2 -2
- package/build-style/search/theme-rtl.css +2 -2
- package/build-style/search/theme.css +2 -2
- package/build-style/separator/editor-rtl.css +2 -2
- package/build-style/separator/editor.css +2 -2
- package/build-style/separator/style-rtl.css +2 -2
- package/build-style/separator/style.css +2 -2
- package/build-style/separator/theme-rtl.css +2 -2
- package/build-style/separator/theme.css +2 -2
- package/build-style/shortcode/editor-rtl.css +2 -2
- package/build-style/shortcode/editor.css +2 -2
- package/build-style/site-logo/editor-rtl.css +2 -2
- package/build-style/site-logo/editor.css +2 -2
- package/build-style/site-logo/style-rtl.css +2 -2
- package/build-style/site-logo/style.css +2 -2
- package/build-style/site-tagline/editor-rtl.css +2 -2
- package/build-style/site-tagline/editor.css +2 -2
- package/build-style/site-tagline/style-rtl.css +2 -2
- package/build-style/site-tagline/style.css +2 -2
- package/build-style/site-title/editor-rtl.css +2 -2
- package/build-style/site-title/editor.css +2 -2
- package/build-style/site-title/style-rtl.css +2 -2
- package/build-style/site-title/style.css +2 -2
- package/build-style/social-link/editor-rtl.css +2 -2
- package/build-style/social-link/editor.css +2 -2
- package/build-style/social-links/editor-rtl.css +2 -2
- package/build-style/social-links/editor.css +2 -2
- package/build-style/social-links/style-rtl.css +2 -2
- package/build-style/social-links/style.css +2 -2
- package/build-style/spacer/editor-rtl.css +2 -2
- package/build-style/spacer/editor.css +2 -2
- package/build-style/spacer/style-rtl.css +2 -2
- package/build-style/spacer/style.css +2 -2
- package/build-style/style-rtl.css +53 -9
- package/build-style/style.css +53 -9
- package/build-style/table/editor-rtl.css +2 -2
- package/build-style/table/editor.css +2 -2
- package/build-style/table/style-rtl.css +2 -2
- package/build-style/table/style.css +2 -2
- package/build-style/table/theme-rtl.css +2 -2
- package/build-style/table/theme.css +2 -2
- package/build-style/table-of-contents/style-rtl.css +2 -2
- package/build-style/table-of-contents/style.css +2 -2
- package/build-style/tag-cloud/editor-rtl.css +9 -2
- package/build-style/tag-cloud/editor.css +9 -2
- package/build-style/tag-cloud/style-rtl.css +2 -2
- package/build-style/tag-cloud/style.css +2 -2
- package/build-style/template-part/editor-rtl.css +2 -6
- package/build-style/template-part/editor.css +2 -6
- package/build-style/template-part/theme-rtl.css +2 -2
- package/build-style/template-part/theme.css +2 -2
- package/build-style/term-description/style-rtl.css +2 -2
- package/build-style/term-description/style.css +2 -2
- package/build-style/text-columns/editor-rtl.css +2 -2
- package/build-style/text-columns/editor.css +2 -2
- package/build-style/text-columns/style-rtl.css +2 -2
- package/build-style/text-columns/style.css +2 -2
- package/build-style/theme-rtl.css +2 -2
- package/build-style/theme.css +2 -2
- package/build-style/verse/style-rtl.css +2 -2
- package/build-style/verse/style.css +2 -2
- package/build-style/video/editor-rtl.css +2 -2
- package/build-style/video/editor.css +2 -2
- package/build-style/video/style-rtl.css +2 -2
- package/build-style/video/style.css +2 -2
- package/build-style/video/theme-rtl.css +2 -2
- package/build-style/video/theme.css +2 -2
- package/package.json +35 -35
- package/src/archives/edit.js +1 -0
- package/src/audio/edit.js +4 -3
- package/src/avatar/user-control.js +1 -0
- package/src/button/edit.js +1 -0
- package/src/comment-author-name/block.json +14 -1
- package/src/comment-author-name/style.scss +4 -0
- package/src/comment-content/block.json +14 -1
- package/src/comment-content/style.scss +5 -0
- package/src/comment-date/block.json +14 -1
- package/src/comment-date/style.scss +4 -0
- package/src/comments-pagination/comments-pagination-arrow-controls.js +1 -0
- package/src/cover/edit/inspector-controls.js +0 -1
- package/src/editor.scss +1 -0
- package/src/embed/edit.js +10 -1
- package/src/embed/editor.scss +4 -0
- package/src/embed/embed-placeholder.js +7 -4
- package/src/embed/embed-preview.js +3 -37
- package/src/file/block.json +12 -0
- package/src/file/inspector.js +1 -0
- package/src/form/edit.js +2 -0
- package/src/form-input/edit.js +1 -0
- package/src/gallery/edit.js +5 -9
- package/src/gallery/editor.scss +1 -1
- package/src/gallery/gallery.native.js +2 -1
- package/src/gallery/style.scss +33 -7
- package/src/group/edit.js +1 -1
- package/src/image/image.js +7 -1
- package/src/image/transforms.js +7 -1
- package/src/latest-posts/edit.js +60 -17
- package/src/latest-posts/editor.scss +11 -6
- package/src/list/block.json +9 -0
- package/src/list-item/block.json +8 -1
- package/src/media-text/edit.js +0 -1
- package/src/missing/edit.js +12 -18
- package/src/navigation/edit/index.js +3 -3
- package/src/navigation/edit/navigation-menu-name-control.js +1 -0
- package/src/navigation/edit/overlay-menu-preview.js +2 -0
- package/src/navigation/editor.scss +5 -0
- package/src/navigation/index.php +10 -27
- package/src/navigation-link/editor.scss +0 -3
- package/src/post-author/block.json +13 -0
- package/src/post-author/edit.js +68 -57
- package/src/post-author/editor.scss +7 -0
- package/src/post-author/style.scss +1 -0
- package/src/post-author-biography/block.json +14 -1
- package/src/post-author-biography/style.scss +4 -0
- package/src/post-author-name/block.json +14 -1
- package/src/post-author-name/style.scss +4 -0
- package/src/post-comment/edit.js +2 -0
- package/src/post-excerpt/edit.js +1 -0
- package/src/post-featured-image/dimension-controls.js +5 -0
- package/src/post-featured-image/edit.js +1 -0
- package/src/post-navigation-link/edit.js +6 -2
- package/src/post-terms/edit.js +1 -0
- package/src/post-title/edit.js +1 -0
- package/src/preformatted/block.json +12 -0
- package/src/query/edit/inspector-controls/parent-control.js +1 -0
- package/src/query/edit/query-content.js +1 -1
- package/src/query-pagination/query-pagination-arrow-controls.js +1 -0
- package/src/query-pagination-numbers/edit.js +1 -0
- package/src/query-title/block.json +12 -0
- package/src/quote/block.json +1 -0
- package/src/quote/test/transforms.native.js +1 -1
- package/src/quote/transforms.js +11 -2
- package/src/search/edit.js +9 -9
- package/src/search/editor.scss +5 -2
- package/src/social-link/edit.js +2 -0
- package/src/style.scss +5 -0
- package/src/table/edit.js +5 -4
- package/src/tag-cloud/block.json +12 -0
- package/src/tag-cloud/edit.js +46 -34
- package/src/tag-cloud/editor.scss +11 -1
- package/src/template-part/edit/advanced-controls.js +2 -0
- package/src/template-part/editor.scss +0 -5
- package/src/video/edit-common-settings.js +1 -0
- package/src/video/edit.js +2 -2
- package/src/video/tracks-editor.js +3 -0
- package/src/video/transforms.js +5 -1
|
@@ -59,8 +59,21 @@ const metadata = exports.metadata = {
|
|
|
59
59
|
},
|
|
60
60
|
interactivity: {
|
|
61
61
|
clientNavigation: true
|
|
62
|
+
},
|
|
63
|
+
__experimentalBorder: {
|
|
64
|
+
radius: true,
|
|
65
|
+
color: true,
|
|
66
|
+
width: true,
|
|
67
|
+
style: true,
|
|
68
|
+
__experimentalDefaultControls: {
|
|
69
|
+
radius: true,
|
|
70
|
+
color: true,
|
|
71
|
+
width: true,
|
|
72
|
+
style: true
|
|
73
|
+
}
|
|
62
74
|
}
|
|
63
|
-
}
|
|
75
|
+
},
|
|
76
|
+
style: "wp-block-post-author-biography"
|
|
64
77
|
};
|
|
65
78
|
const {
|
|
66
79
|
name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","usesContext","example","viewportWidth","supports","spacing","margin","padding","color","gradients","link","__experimentalDefaultControls","background","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","settings","icon","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-author-biography/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postAuthor 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"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,OAAA;IAAAC,aAAA;EAAA;EAAAC,QAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAX,6BAAA;QAAAI,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;EAAA;AAAA;AAOA,MAAM;
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","usesContext","example","viewportWidth","supports","spacing","margin","padding","color","gradients","link","__experimentalDefaultControls","background","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","width","style","settings","icon","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-author-biography/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postAuthor 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"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,OAAA;IAAAC,aAAA;EAAA;EAAAC,QAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAX,6BAAA;QAAAI,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;IAAAC,oBAAA;MAAAC,MAAA;MAAAlB,KAAA;MAAAmB,KAAA;MAAAC,KAAA;MAAAjB,6BAAA;QAAAe,MAAA;QAAAlB,KAAA;QAAAmB,KAAA;QAAAC,KAAA;MAAA;IAAA;EAAA;EAAAA,KAAA;AAAA;AAOA,MAAM;EAAEnC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMoC,QAAQ,GAAAvC,OAAA,CAAAuC,QAAA,GAAG;EACvBC,IAAI,EAAJA,iBAAI;EACJC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAExC,IAAI;EAAEJ,QAAQ;EAAEwC;AAAS,CAAE,CAAC;AAACvC,OAAA,CAAA0C,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -70,8 +70,21 @@ const metadata = exports.metadata = {
|
|
|
70
70
|
},
|
|
71
71
|
interactivity: {
|
|
72
72
|
clientNavigation: true
|
|
73
|
+
},
|
|
74
|
+
__experimentalBorder: {
|
|
75
|
+
radius: true,
|
|
76
|
+
color: true,
|
|
77
|
+
width: true,
|
|
78
|
+
style: true,
|
|
79
|
+
__experimentalDefaultControls: {
|
|
80
|
+
radius: true,
|
|
81
|
+
color: true,
|
|
82
|
+
width: true,
|
|
83
|
+
style: true
|
|
84
|
+
}
|
|
73
85
|
}
|
|
74
|
-
}
|
|
86
|
+
},
|
|
87
|
+
style: "wp-block-post-author-name"
|
|
75
88
|
};
|
|
76
89
|
const {
|
|
77
90
|
name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","isLink","linkTarget","usesContext","example","viewportWidth","supports","html","spacing","margin","padding","color","gradients","link","__experimentalDefaultControls","background","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","settings","icon","transforms","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-author-name/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postAuthor 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 transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\ttransforms,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AAXA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAK,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;IAAAC,MAAA;MAAAD,IAAA;MAAA;IAAA;IAAAE,UAAA;MAAAF,IAAA;MAAA;IAAA;EAAA;EAAAG,WAAA;EAAAC,OAAA;IAAAC,aAAA;EAAA;EAAAC,QAAA;IAAAC,IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;QAAAH,IAAA;MAAA;IAAA;IAAAI,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAX,6BAAA;QAAAI,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;EAAA;AAAA;AAQA,MAAM;
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","isLink","linkTarget","usesContext","example","viewportWidth","supports","html","spacing","margin","padding","color","gradients","link","__experimentalDefaultControls","background","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","width","style","settings","icon","transforms","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-author-name/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postAuthor 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 transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\ttransforms,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AAXA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAK,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;IAAAC,MAAA;MAAAD,IAAA;MAAA;IAAA;IAAAE,UAAA;MAAAF,IAAA;MAAA;IAAA;EAAA;EAAAG,WAAA;EAAAC,OAAA;IAAAC,aAAA;EAAA;EAAAC,QAAA;IAAAC,IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;QAAAH,IAAA;MAAA;IAAA;IAAAI,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAX,6BAAA;QAAAI,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;IAAAC,oBAAA;MAAAC,MAAA;MAAAlB,KAAA;MAAAmB,KAAA;MAAAC,KAAA;MAAAjB,6BAAA;QAAAe,MAAA;QAAAlB,KAAA;QAAAmB,KAAA;QAAAC,KAAA;MAAA;IAAA;EAAA;EAAAA,KAAA;AAAA;AAQA,MAAM;EAAEtC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMuC,QAAQ,GAAA1C,OAAA,CAAA0C,QAAA,GAAG;EACvBC,IAAI,EAAJA,iBAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE5C,IAAI;EAAEJ,QAAQ;EAAE2C;AAAS,CAAE,CAAC;AAAC1C,OAAA,CAAA8C,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -34,10 +34,12 @@ function Edit({
|
|
|
34
34
|
label: (0, _i18n._x)('Post Comment', 'block title'),
|
|
35
35
|
instructions: (0, _i18n.__)('To show a comment, input the comment ID.'),
|
|
36
36
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
37
|
+
__next40pxDefaultSize: true,
|
|
37
38
|
__nextHasNoMarginBottom: true,
|
|
38
39
|
value: commentId,
|
|
39
40
|
onChange: val => setCommentIdInput(parseInt(val))
|
|
40
41
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
42
|
+
__next40pxDefaultSize: true,
|
|
41
43
|
variant: "primary",
|
|
42
44
|
onClick: () => {
|
|
43
45
|
setAttributes({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_element","_icons","_blockEditor","_jsxRuntime","TEMPLATE","Edit","attributes","commentId","setAttributes","commentIdInput","setCommentIdInput","useState","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","jsx","children","jsxs","Placeholder","icon","blockDefault","label","_x","instructions","__","TextControl","__nextHasNoMarginBottom","value","onChange","val","parseInt","Button","variant","onClick"],"sources":["@wordpress/block-library/src/post-comment/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { Placeholder, TextControl, Button } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { blockDefault } from '@wordpress/icons';\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\nconst TEMPLATE = [\n\t[ 'core/avatar' ],\n\t[ 'core/comment-author-name' ],\n\t[ 'core/comment-date' ],\n\t[ 'core/comment-content' ],\n\t[ 'core/comment-reply-link' ],\n\t[ 'core/comment-edit-link' ],\n];\n\nexport default function Edit( { attributes: { commentId }, setAttributes } ) {\n\tconst [ commentIdInput, setCommentIdInput ] = useState( commentId );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\tif ( ! commentId ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ blockDefault }\n\t\t\t\t\tlabel={ _x( 'Post Comment', 'block title' ) }\n\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t'To show a comment, input the comment ID.'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ commentId }\n\t\t\t\t\t\tonChange={ ( val ) =>\n\t\t\t\t\t\t\tsetCommentIdInput( parseInt( val ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( { commentId: commentIdInput } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</Placeholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn <div { ...innerBlocksProps } />;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAA6E,IAAAK,WAAA,GAAAL,OAAA;AAP7E;AACA;AACA;;AAOA,MAAMM,QAAQ,GAAG,CAChB,CAAE,aAAa,CAAE,EACjB,CAAE,0BAA0B,CAAE,EAC9B,CAAE,mBAAmB,CAAE,EACvB,CAAE,sBAAsB,CAAE,EAC1B,CAAE,yBAAyB,CAAE,EAC7B,CAAE,wBAAwB,CAAE,CAC5B;AAEc,SAASC,IAAIA,CAAE;EAAEC,UAAU,EAAE;IAAEC;EAAU,CAAC;EAAEC;AAAc,CAAC,EAAG;EAC5E,MAAM,CAAEC,cAAc,EAAEC,iBAAiB,CAAE,GAAG,IAAAC,iBAAQ,EAAEJ,SAAU,CAAC;EACnE,MAAMK,UAAU,GAAG,IAAAC,0BAAa,EAAC,CAAC;EAClC,MAAMC,gBAAgB,GAAG,IAAAC,gCAAmB,EAAEH,UAAU,EAAE;IACzDI,QAAQ,EAAEZ;EACX,CAAE,CAAC;EAEH,IAAK,CAAEG,SAAS,EAAG;IAClB,oBACC,IAAAJ,WAAA,CAAAc,GAAA;MAAA,GAAUL,UAAU;MAAAM,QAAA,eACnB,IAAAf,WAAA,CAAAgB,IAAA,EAACpB,WAAA,CAAAqB,WAAW;QACXC,IAAI,EAAGC,mBAAc;QACrBC,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAc,EAAE,aAAc,CAAG;QAC7CC,YAAY,EAAG,IAAAC,QAAE,EAChB,0CACD,CAAG;QAAAR,QAAA,gBAEH,IAAAf,WAAA,CAAAc,GAAA,EAAClB,WAAA,CAAA4B,WAAW;UACXC,uBAAuB;UACvBC,KAAK,
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_element","_icons","_blockEditor","_jsxRuntime","TEMPLATE","Edit","attributes","commentId","setAttributes","commentIdInput","setCommentIdInput","useState","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","jsx","children","jsxs","Placeholder","icon","blockDefault","label","_x","instructions","__","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","val","parseInt","Button","variant","onClick"],"sources":["@wordpress/block-library/src/post-comment/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { Placeholder, TextControl, Button } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { blockDefault } from '@wordpress/icons';\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\nconst TEMPLATE = [\n\t[ 'core/avatar' ],\n\t[ 'core/comment-author-name' ],\n\t[ 'core/comment-date' ],\n\t[ 'core/comment-content' ],\n\t[ 'core/comment-reply-link' ],\n\t[ 'core/comment-edit-link' ],\n];\n\nexport default function Edit( { attributes: { commentId }, setAttributes } ) {\n\tconst [ commentIdInput, setCommentIdInput ] = useState( commentId );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\tif ( ! commentId ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ blockDefault }\n\t\t\t\t\tlabel={ _x( 'Post Comment', 'block title' ) }\n\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t'To show a comment, input the comment ID.'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ commentId }\n\t\t\t\t\t\tonChange={ ( val ) =>\n\t\t\t\t\t\t\tsetCommentIdInput( parseInt( val ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( { commentId: commentIdInput } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</Placeholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn <div { ...innerBlocksProps } />;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAA6E,IAAAK,WAAA,GAAAL,OAAA;AAP7E;AACA;AACA;;AAOA,MAAMM,QAAQ,GAAG,CAChB,CAAE,aAAa,CAAE,EACjB,CAAE,0BAA0B,CAAE,EAC9B,CAAE,mBAAmB,CAAE,EACvB,CAAE,sBAAsB,CAAE,EAC1B,CAAE,yBAAyB,CAAE,EAC7B,CAAE,wBAAwB,CAAE,CAC5B;AAEc,SAASC,IAAIA,CAAE;EAAEC,UAAU,EAAE;IAAEC;EAAU,CAAC;EAAEC;AAAc,CAAC,EAAG;EAC5E,MAAM,CAAEC,cAAc,EAAEC,iBAAiB,CAAE,GAAG,IAAAC,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sxRuntime.jsx)(_components.RangeControl, {
|
|
194
|
+
__next40pxDefaultSize: true,
|
|
194
195
|
__nextHasNoMarginBottom: true,
|
|
195
196
|
label: (0, _i18n.__)('Max number of words'),
|
|
196
197
|
value: excerptLength,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_element","_blockEditor","_components","_i18n","_data","_hooks","_jsxRuntime","ELLIPSIS","PostExcerptEditor","attributes","textAlign","moreText","showMoreOnNewLine","excerptLength","setAttributes","isSelected","context","postId","postType","queryId","isDescendentOfQueryLoop","Number","isFinite","userCanEdit","useCanEditEntity","rawExcerpt","setExcerpt","rendered","renderedExcerpt","protected","isProtected","useEntityProp","postTypeSupportsExcerpts","useSelect","select","coreStore","getPostType","supports","excerpt","isEditable","blockProps","useBlockProps","className","clsx","wordCountType","_x","strippedRenderedExcerpt","useMemo","document","window","DOMParser","parseFromString","body","textContent","innerText","jsxs","Fragment","children","jsx","BlockControls","AlignmentToolbar","value","onChange","newAlign","__","Warning","readMoreLink","RichText","identifier","tagName","placeholder","newMoreText","withoutInteractiveFormatting","excerptClassName","rawOrRenderedExcerpt","trim","trimmedExcerpt","split","join","excerptWithSpaces","numberOfSpaces","length","replaceAll","isTrimmed","excerptContent","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","checked","newShowMoreOnNewLine","RangeControl","min","max"],"sources":["@wordpress/block-library/src/post-excerpt/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tAlignmentToolbar,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tWarning,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { PanelBody, ToggleControl, RangeControl } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\n\nconst ELLIPSIS = '…';\n\nexport default function PostExcerptEditor( {\n\tattributes: { textAlign, moreText, showMoreOnNewLine, excerptLength },\n\tsetAttributes,\n\tisSelected,\n\tcontext: { postId, postType, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst userCanEdit = useCanEditEntity( 'postType', postType, postId );\n\tconst [\n\t\trawExcerpt,\n\t\tsetExcerpt,\n\t\t{ rendered: renderedExcerpt, protected: isProtected } = {},\n\t] = useEntityProp( 'postType', postType, 'excerpt', postId );\n\n\t/**\n\t * Check if the post type supports excerpts.\n\t * Add an exception and return early for the \"page\" post type,\n\t * which is registered without support for the excerpt UI,\n\t * but supports saving the excerpt to the database.\n\t * See: https://core.trac.wordpress.org/browser/branches/6.1/src/wp-includes/post.php#L65\n\t * Without this exception, users that have excerpts saved to the database will\n\t * not be able to edit the excerpts.\n\t */\n\tconst postTypeSupportsExcerpts = useSelect(\n\t\t( select ) => {\n\t\t\tif ( postType === 'page' ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !! select( coreStore ).getPostType( postType )?.supports\n\t\t\t\t?.excerpt;\n\t\t},\n\t\t[ postType ]\n\t);\n\n\t/**\n\t * The excerpt is editable if:\n\t * - The user can edit the post\n\t * - It is not a descendent of a Query Loop block\n\t * - The post type supports excerpts\n\t */\n\tconst isEditable =\n\t\tuserCanEdit && ! isDescendentOfQueryLoop && postTypeSupportsExcerpts;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\t/**\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\t/**\n\t * When excerpt is editable, strip the html tags from\n\t * rendered excerpt. This will be used if the entity's\n\t * excerpt has been produced from the content.\n\t */\n\tconst strippedRenderedExcerpt = useMemo( () => {\n\t\tif ( ! renderedExcerpt ) {\n\t\t\treturn '';\n\t\t}\n\t\tconst document = new window.DOMParser().parseFromString(\n\t\t\trenderedExcerpt,\n\t\t\t'text/html'\n\t\t);\n\t\treturn document.body.textContent || document.body.innerText || '';\n\t}, [ renderedExcerpt ] );\n\n\tif ( ! postType || ! postId ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<AlignmentToolbar\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<p>{ __( 'This block will display the excerpt.' ) }</p>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\tif ( isProtected && ! userCanEdit ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'The content is currently protected and does not have the available excerpt.'\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\tconst readMoreLink = (\n\t\t<RichText\n\t\t\tidentifier=\"moreText\"\n\t\t\tclassName=\"wp-block-post-excerpt__more-link\"\n\t\t\ttagName=\"a\"\n\t\t\taria-label={ __( '“Read more” link text' ) }\n\t\t\tplaceholder={ __( 'Add \"read more\" link text' ) }\n\t\t\tvalue={ moreText }\n\t\t\tonChange={ ( newMoreText ) =>\n\t\t\t\tsetAttributes( { moreText: newMoreText } )\n\t\t\t}\n\t\t\twithoutInteractiveFormatting\n\t\t/>\n\t);\n\tconst excerptClassName = clsx( 'wp-block-post-excerpt__excerpt', {\n\t\t'is-inline': ! showMoreOnNewLine,\n\t} );\n\n\t/**\n\t * The excerpt length setting needs to be applied to both\n\t * the raw and the rendered excerpt depending on which is being used.\n\t */\n\tconst rawOrRenderedExcerpt = (\n\t\trawExcerpt || strippedRenderedExcerpt\n\t).trim();\n\n\tlet trimmedExcerpt = '';\n\tif ( wordCountType === 'words' ) {\n\t\ttrimmedExcerpt = rawOrRenderedExcerpt\n\t\t\t.split( ' ', excerptLength )\n\t\t\t.join( ' ' );\n\t} else if ( wordCountType === 'characters_excluding_spaces' ) {\n\t\t/*\n\t\t * 1. Split the excerpt at the character limit,\n\t\t * then join the substrings back into one string.\n\t\t * 2. Count the number of spaces in the excerpt\n\t\t * by comparing the lengths of the string with and without spaces.\n\t\t * 3. Add the number to the length of the visible excerpt,\n\t\t * so that the spaces are excluded from the word count.\n\t\t */\n\t\tconst excerptWithSpaces = rawOrRenderedExcerpt\n\t\t\t.split( '', excerptLength )\n\t\t\t.join( '' );\n\n\t\tconst numberOfSpaces =\n\t\t\texcerptWithSpaces.length -\n\t\t\texcerptWithSpaces.replaceAll( ' ', '' ).length;\n\n\t\ttrimmedExcerpt = rawOrRenderedExcerpt\n\t\t\t.split( '', excerptLength + numberOfSpaces )\n\t\t\t.join( '' );\n\t} else if ( wordCountType === 'characters_including_spaces' ) {\n\t\ttrimmedExcerpt = rawOrRenderedExcerpt\n\t\t\t.split( '', excerptLength )\n\t\t\t.join( '' );\n\t}\n\n\tconst isTrimmed = trimmedExcerpt !== rawOrRenderedExcerpt;\n\n\tconst excerptContent = isEditable ? (\n\t\t<RichText\n\t\t\tclassName={ excerptClassName }\n\t\t\taria-label={ __( 'Excerpt text' ) }\n\t\t\tvalue={\n\t\t\t\tisSelected\n\t\t\t\t\t? rawOrRenderedExcerpt\n\t\t\t\t\t: ( ! isTrimmed\n\t\t\t\t\t\t\t? rawOrRenderedExcerpt\n\t\t\t\t\t\t\t: trimmedExcerpt + ELLIPSIS ) ||\n\t\t\t\t\t __( 'No excerpt found' )\n\t\t\t}\n\t\t\tonChange={ setExcerpt }\n\t\t\ttagName=\"p\"\n\t\t/>\n\t) : (\n\t\t<p className={ excerptClassName }>\n\t\t\t{ ! isTrimmed\n\t\t\t\t? rawOrRenderedExcerpt || __( 'No excerpt found' )\n\t\t\t\t: trimmedExcerpt + ELLIPSIS }\n\t\t</p>\n\t);\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<AlignmentToolbar\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\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={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show link on new line' ) }\n\t\t\t\t\t\tchecked={ showMoreOnNewLine }\n\t\t\t\t\t\tonChange={ ( newShowMoreOnNewLine ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowMoreOnNewLine: newShowMoreOnNewLine,\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<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Max number of words' ) }\n\t\t\t\t\t\tvalue={ excerptLength }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tsetAttributes( { excerptLength: value } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmin=\"10\"\n\t\t\t\t\t\tmax=\"100\"\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ excerptContent }\n\t\t\t\t{ ! showMoreOnNewLine && ' ' }\n\t\t\t\t{ showMoreOnNewLine ? (\n\t\t\t\t\t<p className=\"wp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B/C,aAAa,CAAE;cAAED,aAAa,EAAEgD;YAAM,CAAE,CAAC;UAC1C,CAAG;UACHiC,GAAG,EAAC,IAAI;UACRC,GAAG,EAAC;QAAK,CACT,CAAC;MAAA,CACQ;IAAC,CACM,CAAC,eACpB,IAAAzF,WAAA,CAAAiD,IAAA;MAAA,GAAUf,UAAU;MAAAiB,QAAA,GACjB2B,cAAc,EACd,CAAExE,iBAAiB,IAAI,GAAG,EAC1BA,iBAAiB,gBAClB,IAAAN,WAAA,CAAAoD,GAAA;QAAGhB,SAAS,EAAC,kCAAkC;QAAAe,QAAA,EAC5CS;MAAY,CACZ,CAAC,GAEJA,YACA;IAAA,CACG,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_element","_blockEditor","_components","_i18n","_data","_hooks","_jsxRuntime","ELLIPSIS","PostExcerptEditor","attributes","textAlign","moreText","showMoreOnNewLine","excerptLength","setAttributes","isSelected","context","postId","postType","queryId","isDescendentOfQueryLoop","Number","isFinite","userCanEdit","useCanEditEntity","rawExcerpt","setExcerpt","rendered","renderedExcerpt","protected","isProtected","useEntityProp","postTypeSupportsExcerpts","useSelect","select","coreStore","getPostType","supports","excerpt","isEditable","blockProps","useBlockProps","className","clsx","wordCountType","_x","strippedRenderedExcerpt","useMemo","document","window","DOMParser","parseFromString","body","textContent","innerText","jsxs","Fragment","children","jsx","BlockControls","AlignmentToolbar","value","onChange","newAlign","__","Warning","readMoreLink","RichText","identifier","tagName","placeholder","newMoreText","withoutInteractiveFormatting","excerptClassName","rawOrRenderedExcerpt","trim","trimmedExcerpt","split","join","excerptWithSpaces","numberOfSpaces","length","replaceAll","isTrimmed","excerptContent","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","checked","newShowMoreOnNewLine","RangeControl","__next40pxDefaultSize","min","max"],"sources":["@wordpress/block-library/src/post-excerpt/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tAlignmentToolbar,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tWarning,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { PanelBody, ToggleControl, RangeControl } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\n\nconst ELLIPSIS = '…';\n\nexport default function PostExcerptEditor( {\n\tattributes: { textAlign, moreText, showMoreOnNewLine, excerptLength },\n\tsetAttributes,\n\tisSelected,\n\tcontext: { postId, postType, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst userCanEdit = useCanEditEntity( 'postType', postType, postId );\n\tconst [\n\t\trawExcerpt,\n\t\tsetExcerpt,\n\t\t{ rendered: renderedExcerpt, protected: isProtected } = {},\n\t] = useEntityProp( 'postType', postType, 'excerpt', postId );\n\n\t/**\n\t * Check if the post type supports excerpts.\n\t * Add an exception and return early for the \"page\" post type,\n\t * which is registered without support for the excerpt UI,\n\t * but supports saving the excerpt to the database.\n\t * See: https://core.trac.wordpress.org/browser/branches/6.1/src/wp-includes/post.php#L65\n\t * Without this exception, users that have excerpts saved to the database will\n\t * not be able to edit the excerpts.\n\t */\n\tconst postTypeSupportsExcerpts = useSelect(\n\t\t( select ) => {\n\t\t\tif ( postType === 'page' ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !! select( coreStore ).getPostType( postType )?.supports\n\t\t\t\t?.excerpt;\n\t\t},\n\t\t[ postType ]\n\t);\n\n\t/**\n\t * The excerpt is editable if:\n\t * - The user can edit the post\n\t * - It is not a descendent of a Query Loop block\n\t * - The post type supports excerpts\n\t */\n\tconst isEditable =\n\t\tuserCanEdit && ! isDescendentOfQueryLoop && postTypeSupportsExcerpts;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\t/**\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\t/**\n\t * When excerpt is editable, strip the html tags from\n\t * rendered excerpt. This will be used if the entity's\n\t * excerpt has been produced from the content.\n\t */\n\tconst strippedRenderedExcerpt = useMemo( () => {\n\t\tif ( ! renderedExcerpt ) {\n\t\t\treturn '';\n\t\t}\n\t\tconst document = new window.DOMParser().parseFromString(\n\t\t\trenderedExcerpt,\n\t\t\t'text/html'\n\t\t);\n\t\treturn document.body.textContent || document.body.innerText || '';\n\t}, [ renderedExcerpt ] );\n\n\tif ( ! postType || ! postId ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<AlignmentToolbar\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<p>{ __( 'This block will display the excerpt.' ) }</p>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\tif ( isProtected && ! userCanEdit ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'The content is currently protected and does not have the available excerpt.'\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\tconst readMoreLink = (\n\t\t<RichText\n\t\t\tidentifier=\"moreText\"\n\t\t\tclassName=\"wp-block-post-excerpt__more-link\"\n\t\t\ttagName=\"a\"\n\t\t\taria-label={ __( '“Read more” link text' ) }\n\t\t\tplaceholder={ __( 'Add \"read more\" link text' ) }\n\t\t\tvalue={ moreText }\n\t\t\tonChange={ ( newMoreText ) =>\n\t\t\t\tsetAttributes( { moreText: newMoreText } )\n\t\t\t}\n\t\t\twithoutInteractiveFormatting\n\t\t/>\n\t);\n\tconst excerptClassName = clsx( 'wp-block-post-excerpt__excerpt', {\n\t\t'is-inline': ! showMoreOnNewLine,\n\t} );\n\n\t/**\n\t * The excerpt length setting needs to be applied to both\n\t * the raw and the rendered excerpt depending on which is being used.\n\t */\n\tconst rawOrRenderedExcerpt = (\n\t\trawExcerpt || strippedRenderedExcerpt\n\t).trim();\n\n\tlet trimmedExcerpt = '';\n\tif ( wordCountType === 'words' ) {\n\t\ttrimmedExcerpt = rawOrRenderedExcerpt\n\t\t\t.split( ' ', excerptLength )\n\t\t\t.join( ' ' );\n\t} else if ( wordCountType === 'characters_excluding_spaces' ) {\n\t\t/*\n\t\t * 1. Split the excerpt at the character limit,\n\t\t * then join the substrings back into one string.\n\t\t * 2. Count the number of spaces in the excerpt\n\t\t * by comparing the lengths of the string with and without spaces.\n\t\t * 3. Add the number to the length of the visible excerpt,\n\t\t * so that the spaces are excluded from the word count.\n\t\t */\n\t\tconst excerptWithSpaces = rawOrRenderedExcerpt\n\t\t\t.split( '', excerptLength )\n\t\t\t.join( '' );\n\n\t\tconst numberOfSpaces =\n\t\t\texcerptWithSpaces.length -\n\t\t\texcerptWithSpaces.replaceAll( ' ', '' ).length;\n\n\t\ttrimmedExcerpt = rawOrRenderedExcerpt\n\t\t\t.split( '', excerptLength + numberOfSpaces )\n\t\t\t.join( '' );\n\t} else if ( wordCountType === 'characters_including_spaces' ) {\n\t\ttrimmedExcerpt = rawOrRenderedExcerpt\n\t\t\t.split( '', excerptLength )\n\t\t\t.join( '' );\n\t}\n\n\tconst isTrimmed = trimmedExcerpt !== rawOrRenderedExcerpt;\n\n\tconst excerptContent = isEditable ? (\n\t\t<RichText\n\t\t\tclassName={ excerptClassName }\n\t\t\taria-label={ __( 'Excerpt text' ) }\n\t\t\tvalue={\n\t\t\t\tisSelected\n\t\t\t\t\t? rawOrRenderedExcerpt\n\t\t\t\t\t: ( ! isTrimmed\n\t\t\t\t\t\t\t? rawOrRenderedExcerpt\n\t\t\t\t\t\t\t: trimmedExcerpt + ELLIPSIS ) ||\n\t\t\t\t\t __( 'No excerpt found' )\n\t\t\t}\n\t\t\tonChange={ setExcerpt }\n\t\t\ttagName=\"p\"\n\t\t/>\n\t) : (\n\t\t<p className={ excerptClassName }>\n\t\t\t{ ! isTrimmed\n\t\t\t\t? rawOrRenderedExcerpt || __( 'No excerpt found' )\n\t\t\t\t: trimmedExcerpt + ELLIPSIS }\n\t\t</p>\n\t);\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<AlignmentToolbar\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\tsetAttributes( { textAlign: newAlign } )\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={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show link on new line' ) }\n\t\t\t\t\t\tchecked={ showMoreOnNewLine }\n\t\t\t\t\t\tonChange={ ( newShowMoreOnNewLine ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowMoreOnNewLine: newShowMoreOnNewLine,\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<RangeControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Max number of words' ) }\n\t\t\t\t\t\tvalue={ excerptLength }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tsetAttributes( { excerptLength: value } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmin=\"10\"\n\t\t\t\t\t\tmax=\"100\"\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ excerptContent }\n\t\t\t\t{ ! showMoreOnNewLine && ' ' }\n\t\t\t\t{ showMoreOnNewLine ? (\n\t\t\t\t\t<p className=\"wp-block-post-excerpt__more-text\">\n\t\t\t\t\t\t{ readMoreLink }\n\t\t\t\t\t</p>\n\t\t\t\t) : (\n\t\t\t\t\treadMoreLink\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAQA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AAAkD,IAAAQ,WAAA,GAAAR,OAAA;AAzBlD;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAGA,MAAMS,QAAQ,GAAG,GAAG;AAEL,SAASC,iBAAiBA,CAAE;EAC1CC,UAAU,EAAE;IAAEC,SAAS;IAAEC,QAAQ;IAAEC,iBAAiB;IAAEC;EAAc,CAAC;EACrEC,aAAa;EACbC,UAAU;EACVC,OAAO,EAAE;IAAEC,MAAM;IAAEC,QAAQ;IAAEC;EAAQ;AACtC,CAAC,EAAG;EACH,MAAMC,uBAAuB,GAAGC,MAAM,CAACC,QAAQ,CAAEH,OAAQ,CAAC;EAC1D,MAAMI,WAAW,GAAG,IAAAC,uBAAgB,EAAE,UAAU,EAAEN,Q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C2B,OAAO,EAAG/E,iBAAmB;UAC7BkD,QAAQ,EAAK8B,oBAAoB,IAChC9E,aAAa,CAAE;YACdF,iBAAiB,EAAEgF;UACpB,CAAE;QACF,CACD,CAAC,eACF,IAAAtF,WAAA,CAAAoD,GAAA,EAACxD,WAAA,CAAA2F,YAAY;UACZC,qBAAqB;UACrBL,uBAAuB;UACvBC,KAAK,EAAG,IAAA1B,QAAE,EAAE,qBAAsB,CAAG;UACrCH,KAAK,EAAGhD,aAAe;UACvBiD,QAAQ,EAAKD,KAAK,IAAM;YACvB/C,aAAa,CAAE;cAAED,aAAa,EAAEgD;YAAM,CAAE,CAAC;UAC1C,CAAG;UACHkC,GAAG,EAAC,IAAI;UACRC,GAAG,EAAC;QAAK,CACT,CAAC;MAAA,CACQ;IAAC,CACM,CAAC,eACpB,IAAA1F,WAAA,CAAAiD,IAAA;MAAA,GAAUf,UAAU;MAAAiB,QAAA,GACjB2B,cAAc,EACd,CAAExE,iBAAiB,IAAI,GAAG,EAC1BA,iBAAiB,gBAClB,IAAAN,WAAA,CAAAoD,GAAA;QAAGhB,SAAS,EAAC,kCAAkC;QAAAe,QAAA,EAC5CS;MAAY,CACZ,CAAC,GAEJA,YACA;IAAA,CACG,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
|
|
@@ -106,7 +106,10 @@ const DimensionControls = ({
|
|
|
106
106
|
}),
|
|
107
107
|
isShownByDefault: true,
|
|
108
108
|
panelId: clientId,
|
|
109
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl
|
|
109
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl
|
|
110
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
111
|
+
, {
|
|
112
|
+
__next40pxDefaultSize: false,
|
|
110
113
|
__nextHasNoMarginBottom: true,
|
|
111
114
|
label: (0, _i18n.__)('Aspect ratio'),
|
|
112
115
|
value: aspectRatio,
|
|
@@ -167,6 +170,7 @@ const DimensionControls = ({
|
|
|
167
170
|
isShownByDefault: true,
|
|
168
171
|
panelId: clientId,
|
|
169
172
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControl, {
|
|
173
|
+
__next40pxDefaultSize: true,
|
|
170
174
|
__nextHasNoMarginBottom: true,
|
|
171
175
|
label: scaleLabel,
|
|
172
176
|
value: scale,
|
|
@@ -188,7 +192,10 @@ const DimensionControls = ({
|
|
|
188
192
|
}),
|
|
189
193
|
isShownByDefault: false,
|
|
190
194
|
panelId: clientId,
|
|
191
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl
|
|
195
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl
|
|
196
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
197
|
+
, {
|
|
198
|
+
__next40pxDefaultSize: false,
|
|
192
199
|
__nextHasNoMarginBottom: true,
|
|
193
200
|
label: (0, _i18n.__)('Resolution'),
|
|
194
201
|
value: sizeSlug || DEFAULT_SIZE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_blockEditor","_data","_jsxRuntime","SCALE_OPTIONS","jsxs","Fragment","children","jsx","__experimentalToggleGroupControlOption","value","label","_x","DEFAULT_SCALE","DEFAULT_SIZE","scaleHelp","cover","__","contain","fill","DimensionControls","clientId","attributes","aspectRatio","width","height","scale","sizeSlug","setAttributes","media","availableUnits","defaultRatios","themeRatios","showDefaultRatios","useSettings","units","useCustomUnits","imageSizes","useSelect","select","blockEditorStore","getSettings","imageSizeOptions","filter","slug","media_details","sizes","source_url","map","name","onDimensionChange","dimension","nextValue","parsedValue","parseFloat","isNaN","scaleLabel","showScaleControl","themeOptions","ratio","defaultOptions","aspectRatioOptions","__experimentalToolsPanelItem","hasValue","onDeselect","undefined","resetAllFilter","isShownByDefault","panelId","SelectControl","__nextHasNoMarginBottom","options","onChange","nextAspectRatio","className","__experimentalUnitControl","labelPosition","min","nextHeight","nextWidth","__experimentalToggleGroupControl","help","isBlock","length","nextSizeSlug","_default","exports","default"],"sources":["@wordpress/block-library/src/post-featured-image/dimension-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tSelectControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tuseSettings,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nconst SCALE_OPTIONS = (\n\t<>\n\t\t<ToggleGroupControlOption\n\t\t\tvalue=\"cover\"\n\t\t\tlabel={ _x( 'Cover', 'Scale option for Image dimension control' ) }\n\t\t/>\n\t\t<ToggleGroupControlOption\n\t\t\tvalue=\"contain\"\n\t\t\tlabel={ _x(\n\t\t\t\t'Contain',\n\t\t\t\t'Scale option for Image dimension control'\n\t\t\t) }\n\t\t/>\n\t\t<ToggleGroupControlOption\n\t\t\tvalue=\"fill\"\n\t\t\tlabel={ _x( 'Fill', 'Scale option for Image dimension control' ) }\n\t\t/>\n\t</>\n);\n\nconst DEFAULT_SCALE = 'cover';\nconst DEFAULT_SIZE = 'full';\n\nconst scaleHelp = {\n\tcover: __(\n\t\t'Image is scaled and cropped to fill the entire space without being distorted.'\n\t),\n\tcontain: __(\n\t\t'Image is scaled to fill the space without clipping nor distorting.'\n\t),\n\tfill: __(\n\t\t'Image will be stretched and distorted to completely fill the space.'\n\t),\n};\n\nconst DimensionControls = ( {\n\tclientId,\n\tattributes: { aspectRatio, width, height, scale, sizeSlug },\n\tsetAttributes,\n\tmedia,\n} ) => {\n\tconst [ availableUnits, defaultRatios, themeRatios, showDefaultRatios ] =\n\t\tuseSettings(\n\t\t\t'spacing.units',\n\t\t\t'dimensions.aspectRatios.default',\n\t\t\t'dimensions.aspectRatios.theme',\n\t\t\t'dimensions.defaultAspectRatios'\n\t\t);\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', '%', 'vw', 'em', 'rem' ],\n\t} );\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 onDimensionChange = ( dimension, nextValue ) => {\n\t\tconst parsedValue = parseFloat( nextValue );\n\t\t/**\n\t\t * If we have no value set and we change the unit,\n\t\t * we don't want to set the attribute, as it would\n\t\t * end up having the unit as value without any number.\n\t\t */\n\t\tif ( isNaN( parsedValue ) && nextValue ) {\n\t\t\treturn;\n\t\t}\n\t\tsetAttributes( {\n\t\t\t[ dimension ]: parsedValue < 0 ? '0' : nextValue,\n\t\t} );\n\t};\n\tconst scaleLabel = _x( 'Scale', 'Image scaling options' );\n\n\tconst showScaleControl =\n\t\theight || ( aspectRatio && aspectRatio !== 'auto' );\n\n\tconst themeOptions = themeRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\n\tconst defaultOptions = defaultRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\n\tconst aspectRatioOptions = [\n\t\t{\n\t\t\tlabel: _x(\n\t\t\t\t'Original',\n\t\t\t\t'Aspect ratio option for dimensions control'\n\t\t\t),\n\t\t\tvalue: 'auto',\n\t\t},\n\t\t...( showDefaultRatios ? defaultOptions : [] ),\n\t\t...( themeOptions ? themeOptions : [] ),\n\t];\n\n\treturn (\n\t\t<>\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! aspectRatio }\n\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { aspectRatio: undefined } ) }\n\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t} ) }\n\t\t\t\tisShownByDefault\n\t\t\t\tpanelId={ clientId }\n\t\t\t>\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\t\tvalue={ aspectRatio }\n\t\t\t\t\toptions={ aspectRatioOptions }\n\t\t\t\t\tonChange={ ( nextAspectRatio ) =>\n\t\t\t\t\t\tsetAttributes( { aspectRatio: nextAspectRatio } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tclassName=\"single-column\"\n\t\t\t\thasValue={ () => !! height }\n\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { height: undefined } ) }\n\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\theight: undefined,\n\t\t\t\t} ) }\n\t\t\t\tisShownByDefault\n\t\t\t\tpanelId={ clientId }\n\t\t\t>\n\t\t\t\t<UnitControl\n\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\tvalue={ height || '' }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tonChange={ ( nextHeight ) =>\n\t\t\t\t\t\tonDimensionChange( 'height', nextHeight )\n\t\t\t\t\t}\n\t\t\t\t\tunits={ units }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tclassName=\"single-column\"\n\t\t\t\thasValue={ () => !! width }\n\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { width: undefined } ) }\n\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\twidth: undefined,\n\t\t\t\t} ) }\n\t\t\t\tisShownByDefault\n\t\t\t\tpanelId={ clientId }\n\t\t\t>\n\t\t\t\t<UnitControl\n\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\tvalue={ width || '' }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tonChange={ ( nextWidth ) =>\n\t\t\t\t\t\tonDimensionChange( 'width', nextWidth )\n\t\t\t\t\t}\n\t\t\t\t\tunits={ units }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t{ showScaleControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! scale && scale !== DEFAULT_SCALE }\n\t\t\t\t\tlabel={ scaleLabel }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tscale: DEFAULT_SCALE,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\tscale: DEFAULT_SCALE,\n\t\t\t\t\t} ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\tpanelId={ clientId }\n\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={ scaleLabel }\n\t\t\t\t\t\tvalue={ scale }\n\t\t\t\t\t\thelp={ scaleHelp[ scale ] }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tscale: value,\n\t\t\t\t\t\t\t} )\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{ SCALE_OPTIONS }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ !! imageSizeOptions.length && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! sizeSlug }\n\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { sizeSlug: undefined } )\n\t\t\t\t\t}\n\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\tsizeSlug: undefined,\n\t\t\t\t\t} ) }\n\t\t\t\t\tisShownByDefault={ false }\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\t\tvalue={ sizeSlug || DEFAULT_SIZE }\n\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\tonChange={ ( nextSizeSlug ) =>\n\t\t\t\t\t\t\tsetAttributes( { sizeSlug: nextSizeSlug } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelp={ __( 'Select the size of the source image.' ) }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport default DimensionControls;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,YAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AAA4C,IAAAI,WAAA,GAAAJ,OAAA;AAhB5C;AACA;AACA;;AAgBA,MAAMK,aAAa,gBAClB,IAAAD,WAAA,CAAAE,IAAA,EAAAF,WAAA,CAAAG,QAAA;EAAAC,QAAA,gBACC,IAAAJ,WAAA,CAAAK,GAAA,EAACR,WAAA,CAAAS,sCAAwB;IACxBC,KAAK,EAAC,OAAO;IACbC,KAAK,EAAG,IAAAC,QAAE,EAAE,OAAO,EAAE,0CAA2C;EAAG,CACnE,CAAC,eACF,IAAAT,WAAA,CAAAK,GAAA,EAACR,WAAA,CAAAS,sCAAwB;IACxBC,KAAK,EA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,QAAQ,EAAEyD;QAAa,CAAE,CAC1C;QACDH,IAAI,EAAG,IAAAhE,QAAE,EAAE,sCAAuC;MAAG,CACrD;IAAC,CACa,CAChB;EAAA,CACA,CAAC;AAEL,CAAC;AAAC,IAAAoE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEanE,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_blockEditor","_data","_jsxRuntime","SCALE_OPTIONS","jsxs","Fragment","children","jsx","__experimentalToggleGroupControlOption","value","label","_x","DEFAULT_SCALE","DEFAULT_SIZE","scaleHelp","cover","__","contain","fill","DimensionControls","clientId","attributes","aspectRatio","width","height","scale","sizeSlug","setAttributes","media","availableUnits","defaultRatios","themeRatios","showDefaultRatios","useSettings","units","useCustomUnits","imageSizes","useSelect","select","blockEditorStore","getSettings","imageSizeOptions","filter","slug","media_details","sizes","source_url","map","name","onDimensionChange","dimension","nextValue","parsedValue","parseFloat","isNaN","scaleLabel","showScaleControl","themeOptions","ratio","defaultOptions","aspectRatioOptions","__experimentalToolsPanelItem","hasValue","onDeselect","undefined","resetAllFilter","isShownByDefault","panelId","SelectControl","__next40pxDefaultSize","__nextHasNoMarginBottom","options","onChange","nextAspectRatio","className","__experimentalUnitControl","labelPosition","min","nextHeight","nextWidth","__experimentalToggleGroupControl","help","isBlock","length","nextSizeSlug","_default","exports","default"],"sources":["@wordpress/block-library/src/post-featured-image/dimension-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tSelectControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tuseSettings,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nconst SCALE_OPTIONS = (\n\t<>\n\t\t<ToggleGroupControlOption\n\t\t\tvalue=\"cover\"\n\t\t\tlabel={ _x( 'Cover', 'Scale option for Image dimension control' ) }\n\t\t/>\n\t\t<ToggleGroupControlOption\n\t\t\tvalue=\"contain\"\n\t\t\tlabel={ _x(\n\t\t\t\t'Contain',\n\t\t\t\t'Scale option for Image dimension control'\n\t\t\t) }\n\t\t/>\n\t\t<ToggleGroupControlOption\n\t\t\tvalue=\"fill\"\n\t\t\tlabel={ _x( 'Fill', 'Scale option for Image dimension control' ) }\n\t\t/>\n\t</>\n);\n\nconst DEFAULT_SCALE = 'cover';\nconst DEFAULT_SIZE = 'full';\n\nconst scaleHelp = {\n\tcover: __(\n\t\t'Image is scaled and cropped to fill the entire space without being distorted.'\n\t),\n\tcontain: __(\n\t\t'Image is scaled to fill the space without clipping nor distorting.'\n\t),\n\tfill: __(\n\t\t'Image will be stretched and distorted to completely fill the space.'\n\t),\n};\n\nconst DimensionControls = ( {\n\tclientId,\n\tattributes: { aspectRatio, width, height, scale, sizeSlug },\n\tsetAttributes,\n\tmedia,\n} ) => {\n\tconst [ availableUnits, defaultRatios, themeRatios, showDefaultRatios ] =\n\t\tuseSettings(\n\t\t\t'spacing.units',\n\t\t\t'dimensions.aspectRatios.default',\n\t\t\t'dimensions.aspectRatios.theme',\n\t\t\t'dimensions.defaultAspectRatios'\n\t\t);\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', '%', 'vw', 'em', 'rem' ],\n\t} );\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 onDimensionChange = ( dimension, nextValue ) => {\n\t\tconst parsedValue = parseFloat( nextValue );\n\t\t/**\n\t\t * If we have no value set and we change the unit,\n\t\t * we don't want to set the attribute, as it would\n\t\t * end up having the unit as value without any number.\n\t\t */\n\t\tif ( isNaN( parsedValue ) && nextValue ) {\n\t\t\treturn;\n\t\t}\n\t\tsetAttributes( {\n\t\t\t[ dimension ]: parsedValue < 0 ? '0' : nextValue,\n\t\t} );\n\t};\n\tconst scaleLabel = _x( 'Scale', 'Image scaling options' );\n\n\tconst showScaleControl =\n\t\theight || ( aspectRatio && aspectRatio !== 'auto' );\n\n\tconst themeOptions = themeRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\n\tconst defaultOptions = defaultRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\n\tconst aspectRatioOptions = [\n\t\t{\n\t\t\tlabel: _x(\n\t\t\t\t'Original',\n\t\t\t\t'Aspect ratio option for dimensions control'\n\t\t\t),\n\t\t\tvalue: 'auto',\n\t\t},\n\t\t...( showDefaultRatios ? defaultOptions : [] ),\n\t\t...( themeOptions ? themeOptions : [] ),\n\t];\n\n\treturn (\n\t\t<>\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! aspectRatio }\n\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { aspectRatio: undefined } ) }\n\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t} ) }\n\t\t\t\tisShownByDefault\n\t\t\t\tpanelId={ clientId }\n\t\t\t>\n\t\t\t\t<SelectControl\n\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\t\tvalue={ aspectRatio }\n\t\t\t\t\toptions={ aspectRatioOptions }\n\t\t\t\t\tonChange={ ( nextAspectRatio ) =>\n\t\t\t\t\t\tsetAttributes( { aspectRatio: nextAspectRatio } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tclassName=\"single-column\"\n\t\t\t\thasValue={ () => !! height }\n\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { height: undefined } ) }\n\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\theight: undefined,\n\t\t\t\t} ) }\n\t\t\t\tisShownByDefault\n\t\t\t\tpanelId={ clientId }\n\t\t\t>\n\t\t\t\t<UnitControl\n\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\tvalue={ height || '' }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tonChange={ ( nextHeight ) =>\n\t\t\t\t\t\tonDimensionChange( 'height', nextHeight )\n\t\t\t\t\t}\n\t\t\t\t\tunits={ units }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tclassName=\"single-column\"\n\t\t\t\thasValue={ () => !! width }\n\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { width: undefined } ) }\n\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\twidth: undefined,\n\t\t\t\t} ) }\n\t\t\t\tisShownByDefault\n\t\t\t\tpanelId={ clientId }\n\t\t\t>\n\t\t\t\t<UnitControl\n\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\tvalue={ width || '' }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tonChange={ ( nextWidth ) =>\n\t\t\t\t\t\tonDimensionChange( 'width', nextWidth )\n\t\t\t\t\t}\n\t\t\t\t\tunits={ units }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t{ showScaleControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! scale && scale !== DEFAULT_SCALE }\n\t\t\t\t\tlabel={ scaleLabel }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tscale: DEFAULT_SCALE,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\tscale: DEFAULT_SCALE,\n\t\t\t\t\t} ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ scaleLabel }\n\t\t\t\t\t\tvalue={ scale }\n\t\t\t\t\t\thelp={ scaleHelp[ scale ] }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tscale: value,\n\t\t\t\t\t\t\t} )\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{ SCALE_OPTIONS }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ !! imageSizeOptions.length && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! sizeSlug }\n\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { sizeSlug: undefined } )\n\t\t\t\t\t}\n\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\tsizeSlug: undefined,\n\t\t\t\t\t} ) }\n\t\t\t\t\tisShownByDefault={ false }\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\t\tvalue={ sizeSlug || DEFAULT_SIZE }\n\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\tonChange={ ( nextSizeSlug ) =>\n\t\t\t\t\t\t\tsetAttributes( { sizeSlug: nextSizeSlug } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelp={ __( 'Select the size of the source image.' ) }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport default DimensionControls;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,YAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AAA4C,IAAAI,WAAA,GAAAJ,OAAA;AAhB5C;AACA;AACA;;AAgBA,MAAMK,aAAa,gBAClB,IAAAD,WAAA,CAAAE,IAAA,EAAAF,WAAA,CAAAG,QAAA;EAAAC,QAAA,gBACC,IAAAJ,WAAA,CAAAK,GAAA,EAACR,WAAA,CAAAS,sCAAwB;IACxBC,KAAK,EAAC,OAAO;IACbC,KAAK,EAAG,IAAAC,QAAE,EAAE,OAAO,EAAE,0CAA2C;EAAG,CACnE,CAAC,eACF,IAAAT,WAAA,CAAAK,GAAA,EAACR,WAAA,CAAAS,sCAAwB;IACxBC,KAAK,EAAC,SAAS;IACfC,KAAK,EAAG,IAAAC,QAAE,EACT,SAAS,EACT,0CACD;EAAG,CACH,CAAC,eACF,IAAAT,WAAA,CAAAK,GAAA,EAACR,WAAA,CAAAS,sCAAwB;IACxBC,KAAK,EAAC,MAAM;IACZC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAM,EAAE,0CAA2C;EAAG,CAClE,CAAC;AAAA,CACD,CACF;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AA,CAAAC,OAAA,GAEapE,iBAAiB","ignoreList":[]}
|
|
@@ -184,6 +184,7 @@ function PostFeaturedImageEdit({
|
|
|
184
184
|
}),
|
|
185
185
|
checked: linkTarget === '_blank'
|
|
186
186
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
187
|
+
__next40pxDefaultSize: true,
|
|
187
188
|
__nextHasNoMarginBottom: true,
|
|
188
189
|
label: (0, _i18n.__)('Link rel'),
|
|
189
190
|
value: rel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blob","_coreData","_data","_components","_blockEditor","_element","_i18n","_icons","_notices","_dimensionControls","_overlayControls","_overlay","_jsxRuntime","ALLOWED_MEDIA_TYPES","getMediaSourceUrlBySizeSlug","media","slug","media_details","sizes","source_url","disabledClickProps","onClick","event","preventDefault","PostFeaturedImageEdit","clientId","attributes","setAttributes","context","postId","postType","postTypeSlug","queryId","isDescendentOfQueryLoop","Number","isFinite","isLink","aspectRatio","height","width","scale","sizeSlug","rel","linkTarget","useFirstImageFromPost","temporaryURL","setTemporaryURL","useState","storedFeaturedImage","setFeaturedImage","useEntityProp","postContent","featuredImage","useMemo","imageOpener","exec","imageId","groups","attrs","JSON","parse","id","postPermalink","useSelect","select","getMedia","getPostType","getEditedEntityRecord","coreStore","link","mediaUrl","blockProps","useBlockProps","style","className","clsx","borderProps","useBorderProps","shadowProps","getShadowClassesAndStyles","blockEditingMode","useBlockEditingMode","placeholder","content","jsx","Placeholder","withIllustration","children","onSelectImage","value","url","isBlobURL","useEffect","createErrorNotice","useDispatch","noticesStore","onUploadError","message","type","controls","jsxs","Fragment","InspectorControls","group","default","PanelBody","title","__","ToggleControl","__nextHasNoMarginBottom","label","labels","singular_name","sprintf","onChange","checked","TextControl","newRel","image","href","target","imageStyles","objectFit","MediaPlaceholder","onSelect","accept","allowedTypes","onError","mediaLibraryButton","open","Button","icon","upload","variant","showTooltip","tooltipPosition","src","alt","alt_text","Spinner","BlockControls","MediaReplaceFlow","mediaId","mediaURL","MenuItem"],"sources":["@wordpress/block-library/src/post-featured-image/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\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\tSpinner,\n\tTextControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { useMemo, useEffect, useState } from '@wordpress/element';\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 OverlayControls from './overlay-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\nconst disabledClickProps = {\n\tonClick: ( event ) => event.preventDefault(),\n\t'aria-disabled': true,\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\tuseFirstImageFromPost,\n\t} = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState();\n\n\tconst [ storedFeaturedImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\t// Fallback to post content if no featured image is set.\n\t// This is needed for the \"Use first image from post\" option.\n\tconst [ postContent ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'content',\n\t\tpostId\n\t);\n\n\tconst featuredImage = useMemo( () => {\n\t\tif ( storedFeaturedImage ) {\n\t\t\treturn storedFeaturedImage;\n\t\t}\n\n\t\tif ( ! useFirstImageFromPost ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst imageOpener =\n\t\t\t/<!--\\s+wp:(?:core\\/)?image\\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\\s+\\/?-->).)*)?}\\s+)?-->/.exec(\n\t\t\t\tpostContent\n\t\t\t);\n\t\tconst imageId =\n\t\t\timageOpener?.groups?.attrs &&\n\t\t\tJSON.parse( imageOpener.groups.attrs )?.id;\n\t\treturn imageId;\n\t}, [ storedFeaturedImage, useFirstImageFromPost, postContent ] );\n\n\tconst { media, postType, postPermalink } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getMedia, getPostType, getEditedEntityRecord } =\n\t\t\t\tselect( 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\tpostPermalink: getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeSlug,\n\t\t\t\t\tpostId\n\t\t\t\t)?.link,\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, postTypeSlug, postId ]\n\t);\n\n\tconst mediaUrl = getMediaSourceUrlBySizeSlug( media, sizeSlug );\n\n\tconst blockProps = useBlockProps( {\n\t\tstyle: { width, height, aspectRatio },\n\t\tclassName: clsx( {\n\t\t\t'is-transient': temporaryURL,\n\t\t} ),\n\t} );\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ clsx(\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\n\t\t\t\tstyle={ {\n\t\t\t\t\theight: !! aspectRatio && '100%',\n\t\t\t\t\twidth: !! aspectRatio && '100%',\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t...shadowProps.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\n\t\tif ( value?.url && isBlobURL( value.url ) ) {\n\t\t\tsetTemporaryURL( value.url );\n\t\t}\n\t};\n\n\t// Reset temporary url when media is available.\n\tuseEffect( () => {\n\t\tif ( mediaUrl && temporaryURL ) {\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}, [ mediaUrl, temporaryURL ] );\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetTemporaryURL();\n\t};\n\n\tconst controls = blockEditingMode === 'default' && (\n\t\t<>\n\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t<OverlayControls\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</InspectorControls>\n\t\t\t<InspectorControls group=\"dimensions\">\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\tmedia={ media }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( '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: \"Page\".\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\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\n\tlet image;\n\n\t/**\n\t * A Post Featured Image block should not have image replacement\n\t * or upload options in the following cases:\n\t * - Is placed in a Query Loop. This is a conscious decision to\n\t * prevent content editing of different posts in Query Loop, and\n\t * this could change in the future.\n\t * - Is in a context where it does not have a postId (for example\n\t * in a template or template part).\n\t */\n\tif ( ! featuredImage && ( isDescendentOfQueryLoop || ! postId ) ) {\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{ !! isLink ? (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\thref={ postPermalink }\n\t\t\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\t\t\t{ ...disabledClickProps }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ placeholder() }\n\t\t\t\t\t\t</a>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tplaceholder()\n\t\t\t\t\t) }\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\t...shadowProps.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 && ! temporaryURL ) {\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 =\n\t\t\t! media && ! temporaryURL ? (\n\t\t\t\tplaceholder()\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<img\n\t\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\t\tsrc={ temporaryURL || mediaUrl }\n\t\t\t\t\t\talt={\n\t\t\t\t\t\t\tmedia && media?.alt_text\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t/>\n\t\t\t\t\t{ temporaryURL && <Spinner /> }\n\t\t\t\t</>\n\t\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{ ! temporaryURL && 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{ /* If the featured image is linked, wrap in an <a /> tag to trigger any inherited link element styles */ }\n\t\t\t\t{ !! isLink ? (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={ postPermalink }\n\t\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\t\t{ ...disabledClickProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ image }\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\timage\n\t\t\t\t) }\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AASA,IAAAK,YAAA,GAAAL,OAAA;AAUA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,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AAG1F,aAAe;QACzB2F,QAAQ,EAAGzE,QAAU;QACrBwD,YAAY,EAAGjH,mBAAqB;QACpCgH,MAAM,EAAC,SAAS;QAChBD,QAAQ,EAAGpC,aAAe;QAC1BuC,OAAO,EAAG/B,aAAe;QAAAT,QAAA,eAEzB,IAAA3E,WAAA,CAAAwE,GAAA,EAACjF,WAAA,CAAA6I,QAAQ;UAAC3H,OAAO,EAAGA,CAAA,KAAM4B,gBAAgB,CAAE,CAAE,CAAG;UAAAsC,QAAA,EAC9C,IAAAoB,QAAE,EAAE,OAAQ;QAAC,CACN;MAAC,CACM;IAAC,CACL,CACf,eACD,IAAA/F,WAAA,CAAAwF,IAAA;MAAA,GAAa7B,UAAU;MAAAgB,QAAA,GAEpB,CAAC,CAAEnD,MAAM,gBACV,IAAAxB,WAAA,CAAAwE,GAAA;QACCmC,IAAI,EAAGzD,aAAe;QACtB0D,MAAM,EAAG7E,UAAY;QAAA,GAChBvB,kBAAkB;QAAAmE,QAAA,EAErB+B;MAAK,CACL,CAAC,GAEJA,KACA,eACD,IAAA1G,WAAA,CAAAwE,GAAA,EAACzE,QAAA,CAAA6F,OAAO;QACP9E,UAAU,EAAGA,UAAY;QACzBC,aAAa,EAAGA,aAAe;QAC/BF,QAAQ,EAAGA;MAAU,CACrB,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blob","_coreData","_data","_components","_blockEditor","_element","_i18n","_icons","_notices","_dimensionControls","_overlayControls","_overlay","_jsxRuntime","ALLOWED_MEDIA_TYPES","getMediaSourceUrlBySizeSlug","media","slug","media_details","sizes","source_url","disabledClickProps","onClick","event","preventDefault","PostFeaturedImageEdit","clientId","attributes","setAttributes","context","postId","postType","postTypeSlug","queryId","isDescendentOfQueryLoop","Number","isFinite","isLink","aspectRatio","height","width","scale","sizeSlug","rel","linkTarget","useFirstImageFromPost","temporaryURL","setTemporaryURL","useState","storedFeaturedImage","setFeaturedImage","useEntityProp","postContent","featuredImage","useMemo","imageOpener","exec","imageId","groups","attrs","JSON","parse","id","postPermalink","useSelect","select","getMedia","getPostType","getEditedEntityRecord","coreStore","link","mediaUrl","blockProps","useBlockProps","style","className","clsx","borderProps","useBorderProps","shadowProps","getShadowClassesAndStyles","blockEditingMode","useBlockEditingMode","placeholder","content","jsx","Placeholder","withIllustration","children","onSelectImage","value","url","isBlobURL","useEffect","createErrorNotice","useDispatch","noticesStore","onUploadError","message","type","controls","jsxs","Fragment","InspectorControls","group","default","PanelBody","title","__","ToggleControl","__nextHasNoMarginBottom","label","labels","singular_name","sprintf","onChange","checked","TextControl","__next40pxDefaultSize","newRel","image","href","target","imageStyles","objectFit","MediaPlaceholder","onSelect","accept","allowedTypes","onError","mediaLibraryButton","open","Button","icon","upload","variant","showTooltip","tooltipPosition","src","alt","alt_text","Spinner","BlockControls","MediaReplaceFlow","mediaId","mediaURL","MenuItem"],"sources":["@wordpress/block-library/src/post-featured-image/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\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\tSpinner,\n\tTextControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { useMemo, useEffect, useState } from '@wordpress/element';\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 OverlayControls from './overlay-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\nconst disabledClickProps = {\n\tonClick: ( event ) => event.preventDefault(),\n\t'aria-disabled': true,\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\tuseFirstImageFromPost,\n\t} = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState();\n\n\tconst [ storedFeaturedImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\t// Fallback to post content if no featured image is set.\n\t// This is needed for the \"Use first image from post\" option.\n\tconst [ postContent ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'content',\n\t\tpostId\n\t);\n\n\tconst featuredImage = useMemo( () => {\n\t\tif ( storedFeaturedImage ) {\n\t\t\treturn storedFeaturedImage;\n\t\t}\n\n\t\tif ( ! useFirstImageFromPost ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst imageOpener =\n\t\t\t/<!--\\s+wp:(?:core\\/)?image\\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\\s+\\/?-->).)*)?}\\s+)?-->/.exec(\n\t\t\t\tpostContent\n\t\t\t);\n\t\tconst imageId =\n\t\t\timageOpener?.groups?.attrs &&\n\t\t\tJSON.parse( imageOpener.groups.attrs )?.id;\n\t\treturn imageId;\n\t}, [ storedFeaturedImage, useFirstImageFromPost, postContent ] );\n\n\tconst { media, postType, postPermalink } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getMedia, getPostType, getEditedEntityRecord } =\n\t\t\t\tselect( 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\tpostPermalink: getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeSlug,\n\t\t\t\t\tpostId\n\t\t\t\t)?.link,\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, postTypeSlug, postId ]\n\t);\n\n\tconst mediaUrl = getMediaSourceUrlBySizeSlug( media, sizeSlug );\n\n\tconst blockProps = useBlockProps( {\n\t\tstyle: { width, height, aspectRatio },\n\t\tclassName: clsx( {\n\t\t\t'is-transient': temporaryURL,\n\t\t} ),\n\t} );\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ clsx(\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\n\t\t\t\tstyle={ {\n\t\t\t\t\theight: !! aspectRatio && '100%',\n\t\t\t\t\twidth: !! aspectRatio && '100%',\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t...shadowProps.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\n\t\tif ( value?.url && isBlobURL( value.url ) ) {\n\t\t\tsetTemporaryURL( value.url );\n\t\t}\n\t};\n\n\t// Reset temporary url when media is available.\n\tuseEffect( () => {\n\t\tif ( mediaUrl && temporaryURL ) {\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}, [ mediaUrl, temporaryURL ] );\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetTemporaryURL();\n\t};\n\n\tconst controls = blockEditingMode === 'default' && (\n\t\t<>\n\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t<OverlayControls\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</InspectorControls>\n\t\t\t<InspectorControls group=\"dimensions\">\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\tmedia={ media }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( '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: \"Page\".\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\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__next40pxDefaultSize\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\n\tlet image;\n\n\t/**\n\t * A Post Featured Image block should not have image replacement\n\t * or upload options in the following cases:\n\t * - Is placed in a Query Loop. This is a conscious decision to\n\t * prevent content editing of different posts in Query Loop, and\n\t * this could change in the future.\n\t * - Is in a context where it does not have a postId (for example\n\t * in a template or template part).\n\t */\n\tif ( ! featuredImage && ( isDescendentOfQueryLoop || ! postId ) ) {\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{ !! isLink ? (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\thref={ postPermalink }\n\t\t\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\t\t\t{ ...disabledClickProps }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ placeholder() }\n\t\t\t\t\t\t</a>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tplaceholder()\n\t\t\t\t\t) }\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\t...shadowProps.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 && ! temporaryURL ) {\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 =\n\t\t\t! media && ! temporaryURL ? (\n\t\t\t\tplaceholder()\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<img\n\t\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\t\tsrc={ temporaryURL || mediaUrl }\n\t\t\t\t\t\talt={\n\t\t\t\t\t\t\tmedia && media?.alt_text\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t/>\n\t\t\t\t\t{ temporaryURL && <Spinner /> }\n\t\t\t\t</>\n\t\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{ ! temporaryURL && 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{ /* If the featured image is linked, wrap in an <a /> tag to trigger any inherited link element styles */ }\n\t\t\t\t{ !! isLink ? (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={ postPermalink }\n\t\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\t\t{ ...disabledClickProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ image }\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\timage\n\t\t\t\t) }\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AASA,IAAAK,YAAA,GAAAL,OAAA;AAUA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAKA,IAAAU,kBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,gBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,QAAA,GAAAb,sBAAA,CAAAC,OAAA;AAAgC,IAAAa,WAAA,GAAAb,OAAA;AAxChC;AACA;AACA;;AAGA;AACA;AACA;;AA4BA;AACA;AACA;;AAKA,MAAMc,mBAAmB,GAAG,CAAE,OAAO,CAAE;AAEvC,SAASC,2BAA2BA,CAAEC,KAAK,EAAEC,IAAI,EAAG;EACnD,OACCD,KAAK,EAAEE,aAAa,EAAEC,KAAK,GAAIF,IAAI,CAAE,EAAEG,UAAU,IAAIJ,KAAK,EAAEI,UAAU;AAExE;AAEA,MAAMC,kBAAkB,GAAG;EAC1BC,OAAO,EAAIC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAC;EAC5C,eAAe,EAAE;AAClB,CAAC;AAEc,SAASC,qBAAq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,KACA,eACD,IAAA3G,WAAA,CAAAwE,GAAA,EAACzE,QAAA,CAAA6F,OAAO;QACP9E,UAAU,EAAGA,UAAY;QACzBC,aAAa,EAAGA,aAAe;QAC/BF,QAAQ,EAAGA;MAAU,CACrB,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL","ignoreList":[]}
|
|
@@ -44,8 +44,10 @@ function PostNavigationLinkEdit({
|
|
|
44
44
|
};
|
|
45
45
|
const displayArrow = arrowMap[arrow];
|
|
46
46
|
if (showTitle) {
|
|
47
|
-
/* translators: Label before for next and previous post. There is a space after the colon. */
|
|
48
|
-
|
|
47
|
+
placeholder = isNext ? /* translators: Label before for next and previous post. There is a space after the colon. */
|
|
48
|
+
(0, _i18n.__)('Next: ') // eslint-disable-line @wordpress/i18n-no-flanking-whitespace
|
|
49
|
+
: /* translators: Label before for next and previous post. There is a space after the colon. */
|
|
50
|
+
(0, _i18n.__)('Previous: '); // eslint-disable-line @wordpress/i18n-no-flanking-whitespace
|
|
49
51
|
}
|
|
50
52
|
const ariaLabel = isNext ? (0, _i18n.__)('Next post') : (0, _i18n.__)('Previous post');
|
|
51
53
|
const blockProps = (0, _blockEditor.useBlockProps)({
|
|
@@ -97,6 +99,7 @@ function PostNavigationLinkEdit({
|
|
|
97
99
|
linkLabel: !linkLabel
|
|
98
100
|
})
|
|
99
101
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToggleGroupControl, {
|
|
102
|
+
__next40pxDefaultSize: true,
|
|
100
103
|
__nextHasNoMarginBottom: true,
|
|
101
104
|
label: (0, _i18n.__)('Arrow'),
|
|
102
105
|
value: arrow,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_blockEditor","_i18n","_data","_coreData","_jsxRuntime","PostNavigationLinkEdit","context","postType","attributes","type","label","showTitle","textAlign","linkLabel","arrow","taxonomy","setAttributes","isNext","placeholder","__","arrowMap","none","chevron","displayArrow","ariaLabel","blockProps","useBlockProps","className","clsx","taxonomies","useSelect","select","getTaxonomies","coreStore","filteredTaxonomies","per_page","getTaxonomyOptions","selectOption","value","taxonomyOptions","filter","visibility","publicly_queryable","map","item","slug","name","jsxs","Fragment","children","jsx","InspectorControls","PanelBody","ToggleControl","__nextHasNoMarginBottom","help","checked","onChange","__experimentalToggleGroupControl","isBlock","__experimentalToggleGroupControlOption","_x","group","SelectControl","__next40pxDefaultSize","options","BlockControls","AlignmentToolbar","nextAlign","RichText","tagName","identifier","allowedFormats","newLabel","href","onClick","event","preventDefault"],"sources":["@wordpress/block-library/src/post-navigation-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tToggleControl,\n\tSelectControl,\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';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function PostNavigationLinkEdit( {\n\tcontext: { postType },\n\tattributes: {\n\t\ttype,\n\t\tlabel,\n\t\tshowTitle,\n\t\ttextAlign,\n\t\tlinkLabel,\n\t\tarrow,\n\t\ttaxonomy,\n\t},\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: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\tconst getTaxonomyOptions = () => {\n\t\tconst selectOption = {\n\t\t\tlabel: __( 'Unfiltered' ),\n\t\t\tvalue: '',\n\t\t};\n\t\tconst taxonomyOptions = ( taxonomies ?? [] )\n\t\t\t.filter( ( { visibility } ) => !! visibility?.publicly_queryable )\n\t\t\t.map( ( item ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: item.slug,\n\t\t\t\t\tlabel: item.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\treturn [ selectOption, ...taxonomyOptions ];\n\t};\n\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<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Filter by taxonomy' ) }\n\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\toptions={ getTaxonomyOptions() }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttaxonomy: value,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.'\n\t\t\t\t\t) }\n\t\t\t\t/>\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\tidentifier=\"label\"\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\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,YAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAA0D,IAAAM,WAAA,GAAAN,OAAA;AAxB1D;AACA;AACA;;AAGA;AACA;AACA;;AAmBe,SAASO,sBAAsBA,CAAE;EAC/CC,OAAO,EAAE;IAAEC;EAAS,CAAC;EACrBC,UAAU,EAAE;IACXC,IAAI;IACJC,KAAK;IACLC,SAAS;IACTC,SAAS;IACTC,SAAS;IACTC,KAAK;IACLC;EACD,CAAC;EACDC;AACD,CAAC,EAAG;EACH,MAAMC,MAAM,GAAGR,IAAI,KAAK,MAAM;EAC9B,IAAIS,WAAW,GAAGD,MAAM,GAAG,IAAAE,QAAE,EAAE,MAAO,CAAC,GAAG,IAAAA,QAAE,EAAE,UAAW,CAAC;EAE1D,MAAMC,QAAQ,GAAG;IAChBC,IAAI,EAAE,EAAE;IACRP,KAAK,EAAEG,MAAM,GAAG,GAAG,GAAG,GAAG;IACzBK,OAAO,EAAEL,MAAM,GAAG,GAAG,GAAG;EACzB,CAAC;EAED,MAAMM,YAAY,GAAGH,QAAQ,CAAE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AAE,CAAC;QAC1C;MAAG,CACH;IAAC,CACY,CAAC,eAChB,IAAAhE,WAAA,CAAA2C,IAAA;MAAA,GAAUtB,UAAU;MAAAwB,QAAA,GACjB,CAAEhC,MAAM,IAAIM,YAAY,iBACzB,IAAAnB,WAAA,CAAA8C,GAAA;QACCvB,SAAS,EAAI,0DAA0Db,KAAO,EAAG;QAAAmC,QAAA,EAE/E1B;MAAY,CACT,CACN,eACD,IAAAnB,WAAA,CAAA8C,GAAA,EAAClD,YAAA,CAAAqE,QAAQ;QACRC,OAAO,EAAC,GAAG;QACXC,UAAU,EAAC,OAAO;QAClB,cAAa/C,SAAW;QACxBN,WAAW,EAAGA,WAAa;QAC3BoB,KAAK,EAAG5B,KAAO;QACf8D,cAAc,EAAG,CAAE,WAAW,EAAE,aAAa,CAAI;QACjDf,QAAQ,EAAKgB,QAAQ,IACpBzD,aAAa,CAAE;UAAEN,KAAK,EAAE+D;QAAS,CAAE;MACnC,CACD,CAAC,EACA9D,SAAS,iBACV,IAAAP,WAAA,CAAA8C,GAAA;QACCwB,IAAI,EAAC,8BAA8B;QACnCC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;QAAA5B,QAAA,EAE7C,IAAA9B,QAAE,EAAE,kBAAmB;MAAC,CACxB,CACH,EACCF,MAAM,IAAIM,YAAY,iBACvB,IAAAnB,WAAA,CAAA8C,GAAA;QACCvB,SAAS,EAAI,sDAAsDb,KAAO,EAAG;QAC7E,mBAAW;QAAAmC,QAAA,EAET1B;MAAY,CACT,CACN;IAAA,CACG,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_blockEditor","_i18n","_data","_coreData","_jsxRuntime","PostNavigationLinkEdit","context","postType","attributes","type","label","showTitle","textAlign","linkLabel","arrow","taxonomy","setAttributes","isNext","placeholder","__","arrowMap","none","chevron","displayArrow","ariaLabel","blockProps","useBlockProps","className","clsx","taxonomies","useSelect","select","getTaxonomies","coreStore","filteredTaxonomies","per_page","getTaxonomyOptions","selectOption","value","taxonomyOptions","filter","visibility","publicly_queryable","map","item","slug","name","jsxs","Fragment","children","jsx","InspectorControls","PanelBody","ToggleControl","__nextHasNoMarginBottom","help","checked","onChange","__experimentalToggleGroupControl","__next40pxDefaultSize","isBlock","__experimentalToggleGroupControlOption","_x","group","SelectControl","options","BlockControls","AlignmentToolbar","nextAlign","RichText","tagName","identifier","allowedFormats","newLabel","href","onClick","event","preventDefault"],"sources":["@wordpress/block-library/src/post-navigation-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tToggleControl,\n\tSelectControl,\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';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function PostNavigationLinkEdit( {\n\tcontext: { postType },\n\tattributes: {\n\t\ttype,\n\t\tlabel,\n\t\tshowTitle,\n\t\ttextAlign,\n\t\tlinkLabel,\n\t\tarrow,\n\t\ttaxonomy,\n\t},\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\tplaceholder = isNext\n\t\t\t? /* translators: Label before for next and previous post. There is a space after the colon. */\n\t\t\t __( 'Next: ' ) // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t\t\t: /* translators: Label before for next and previous post. There is a space after the colon. */\n\t\t\t __( 'Previous: ' ); // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t}\n\n\tconst ariaLabel = isNext ? __( 'Next post' ) : __( 'Previous post' );\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\tconst getTaxonomyOptions = () => {\n\t\tconst selectOption = {\n\t\t\tlabel: __( 'Unfiltered' ),\n\t\t\tvalue: '',\n\t\t};\n\t\tconst taxonomyOptions = ( taxonomies ?? [] )\n\t\t\t.filter( ( { visibility } ) => !! visibility?.publicly_queryable )\n\t\t\t.map( ( item ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: item.slug,\n\t\t\t\t\tlabel: item.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\treturn [ selectOption, ...taxonomyOptions ];\n\t};\n\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__next40pxDefaultSize\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<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Filter by taxonomy' ) }\n\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\toptions={ getTaxonomyOptions() }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttaxonomy: value,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.'\n\t\t\t\t\t) }\n\t\t\t\t/>\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\tidentifier=\"label\"\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\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,YAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAA0D,IAAAM,WAAA,GAAAN,OAAA;AAxB1D;AACA;AACA;;AAGA;AACA;AACA;;AAmBe,SAASO,sBAAsBA,CAAE;EAC/CC,OAAO,EAAE;IAAEC;EAAS,CAAC;EACrBC,UAAU,EAAE;IACXC,IAAI;IACJC,KAAK;IACLC,SAAS;IACTC,SAAS;IACTC,SAAS;IACTC,KAAK;IACLC;EACD,CAAC;EACDC;AACD,CAAC,EAAG;EACH,MAAMC,MAAM,GAAGR,IAAI,KAAK,MAAM;EAC9B,IAAIS,WAAW,GAAGD,MAAM,GAAG,IAAAE,QAAE,EAAE,MAAO,CAAC,GAAG,IAAAA,QAAE,EAAE,UAAW,CAAC;EAE1D,MAAMC,QAAQ,GAAG;IAChBC,IAAI,EAAE,EAAE;IACRP,KA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,7 @@ function PostTermsEdit({
|
|
|
87
87
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
88
88
|
group: "advanced",
|
|
89
89
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
90
|
+
__next40pxDefaultSize: true,
|
|
90
91
|
__nextHasNoMarginBottom: true,
|
|
91
92
|
autoComplete: "off",
|
|
92
93
|
label: (0, _i18n.__)('Separator'),
|