@wordpress/block-library 9.15.1 → 9.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/archives/edit.js +2 -2
- package/build/archives/edit.js.map +1 -1
- package/build/button/edit.js +2 -1
- package/build/button/edit.js.map +1 -1
- package/build/categories/edit.js +115 -37
- package/build/categories/edit.js.map +1 -1
- package/build/columns/edit.js +1 -1
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +1 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/comment-template/edit.js +2 -2
- package/build/comment-template/edit.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +6 -5
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments-pagination/index.js +5 -0
- package/build/comments-pagination/index.js.map +1 -1
- package/build/comments-pagination-next/index.js +7 -6
- package/build/comments-pagination-next/index.js.map +1 -1
- package/build/comments-pagination-previous/index.js +7 -6
- package/build/comments-pagination-previous/index.js.map +1 -1
- package/build/cover/deprecated.js +1 -1
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -9
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/details/edit.js +27 -18
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +12 -0
- package/build/details/index.js.map +1 -1
- package/build/details/save.js +2 -0
- package/build/details/save.js.map +1 -1
- package/build/embed/transforms.js +5 -2
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +1 -1
- package/build/embed/util.js.map +1 -1
- package/build/file/edit.js +7 -4
- package/build/file/edit.js.map +1 -1
- package/build/file/transforms.js +1 -1
- package/build/file/transforms.js.map +1 -1
- package/build/file/utils/index.js +1 -1
- package/build/file/utils/index.js.map +1 -1
- package/build/form/variations.js +1 -1
- package/build/form/variations.js.map +1 -1
- package/build/form-input/edit.js +1 -1
- package/build/form-input/edit.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/transforms.js +2 -2
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-get-new-images.js +1 -1
- package/build/gallery/use-get-new-images.js.map +1 -1
- package/build/group/edit.js +2 -9
- package/build/group/edit.js.map +1 -1
- package/build/home-link/edit.js +1 -2
- package/build/home-link/edit.js.map +1 -1
- package/build/latest-comments/edit.js +73 -26
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/constants.js +2 -1
- package/build/latest-posts/constants.js.map +1 -1
- package/build/latest-posts/edit.js +91 -38
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list-item/edit.native.js +2 -2
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/index.js +1 -1
- package/build/media-text/edit.native.js +2 -2
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/media-container.native.js +4 -4
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/edit/index.js +8 -4
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/edit/use-generate-default-navigation-title.js +4 -4
- package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build/navigation/index.js +15 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation-link/edit.js +15 -20
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js +9 -18
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +7 -0
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/page-list/edit.js +1 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +11 -0
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.js +4 -14
- package/build/paragraph/edit.js.map +1 -1
- package/build/pattern/index.js +1 -1
- package/build/post-author-name/edit.js +41 -12
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-comments-link/index.js +7 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/index.js +1 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +1 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +0 -6
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/overlay-controls.js +2 -1
- package/build/post-featured-image/overlay-controls.js.map +1 -1
- package/build/post-navigation-link/variations.js +2 -2
- package/build/post-navigation-link/variations.js.map +1 -1
- package/build/post-terms/edit.js +1 -0
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-time-to-read/index.js +1 -1
- package/build/query/edit/inspector-controls/author-control.js +1 -1
- package/build/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +110 -61
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-content.js +2 -6
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/utils.js +1 -1
- package/build/query/utils.js.map +1 -1
- package/build/query-no-results/index.js +1 -1
- package/build/query-pagination-numbers/edit.js +1 -1
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-title/edit.js +40 -14
- package/build/query-title/edit.js.map +1 -1
- package/build/query-total/index.js +7 -1
- package/build/query-total/index.js.map +1 -1
- package/build/quote/transforms.js +1 -1
- package/build/quote/transforms.js.map +1 -1
- package/build/read-more/edit.js +25 -7
- package/build/read-more/edit.js.map +1 -1
- package/build/rss/edit.js +1 -0
- package/build/rss/edit.js.map +1 -1
- package/build/rss/index.js +6 -0
- package/build/rss/index.js.map +1 -1
- package/build/search/edit.js +67 -48
- package/build/search/edit.js.map +1 -1
- package/build/separator/edit.js +2 -4
- package/build/separator/edit.js.map +1 -1
- package/build/site-logo/edit.js +26 -35
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-links/edit.js +2 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/spacer/controls.js +13 -9
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/edit.js +23 -21
- package/build/spacer/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +24 -8
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -9
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/utils/messages.js +22 -0
- package/build/utils/messages.js.map +1 -0
- package/build/video/edit-common-settings.js +1 -1
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.native.js +3 -3
- package/build/video/edit.native.js.map +1 -1
- package/build-module/archives/edit.js +2 -2
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/button/edit.js +3 -2
- package/build-module/button/edit.js.map +1 -1
- package/build-module/categories/edit.js +116 -38
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/columns/edit.js +1 -1
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +1 -1
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/comment-template/edit.js +2 -2
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +5 -4
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments-pagination/index.js +5 -0
- package/build-module/comments-pagination/index.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +7 -6
- package/build-module/comments-pagination-next/index.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +7 -6
- package/build-module/comments-pagination-previous/index.js.map +1 -1
- package/build-module/cover/deprecated.js +1 -1
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +1 -8
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/details/edit.js +29 -20
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +12 -0
- package/build-module/details/index.js.map +1 -1
- package/build-module/details/save.js +2 -0
- package/build-module/details/save.js.map +1 -1
- package/build-module/embed/transforms.js +5 -2
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +1 -1
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/edit.js +7 -4
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/transforms.js +1 -1
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/file/utils/index.js +1 -1
- package/build-module/file/utils/index.js.map +1 -1
- package/build-module/form/variations.js +1 -1
- package/build-module/form/variations.js.map +1 -1
- package/build-module/form-input/edit.js +1 -1
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/transforms.js +2 -2
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-get-new-images.js +1 -1
- package/build-module/gallery/use-get-new-images.js.map +1 -1
- package/build-module/group/edit.js +1 -8
- package/build-module/group/edit.js.map +1 -1
- package/build-module/home-link/edit.js +1 -2
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/latest-comments/edit.js +74 -27
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/constants.js +1 -0
- package/build-module/latest-posts/constants.js.map +1 -1
- package/build-module/latest-posts/edit.js +93 -40
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +2 -2
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/index.js +1 -1
- package/build-module/media-text/edit.native.js +2 -2
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/media-container.native.js +4 -4
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +8 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/edit/use-generate-default-navigation-title.js +4 -4
- package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build-module/navigation/index.js +15 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation-link/edit.js +16 -21
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +9 -18
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +7 -0
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/page-list/edit.js +1 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +11 -0
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.js +5 -15
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/pattern/index.js +1 -1
- package/build-module/post-author-name/edit.js +42 -13
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-comments-link/index.js +7 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/index.js +1 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +1 -1
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +0 -6
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/overlay-controls.js +2 -1
- package/build-module/post-featured-image/overlay-controls.js.map +1 -1
- package/build-module/post-navigation-link/variations.js +2 -2
- package/build-module/post-navigation-link/variations.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-time-to-read/index.js +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +111 -62
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-content.js +1 -5
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/utils.js +1 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-no-results/index.js +1 -1
- package/build-module/query-pagination-numbers/edit.js +1 -1
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-title/edit.js +41 -15
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-total/index.js +7 -1
- package/build-module/query-total/index.js.map +1 -1
- package/build-module/quote/transforms.js +1 -1
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/read-more/edit.js +26 -8
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/rss/edit.js +1 -0
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/rss/index.js +6 -0
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/edit.js +69 -50
- package/build-module/search/edit.js.map +1 -1
- package/build-module/separator/edit.js +1 -3
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +27 -36
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-links/edit.js +2 -1
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/spacer/controls.js +13 -9
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/edit.js +24 -22
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +25 -9
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +1 -8
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/utils/messages.js +15 -0
- package/build-module/utils/messages.js.map +1 -0
- package/build-module/video/edit-common-settings.js +1 -1
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.native.js +3 -3
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/editor-rtl.css +12 -86
- package/build-style/editor.css +12 -86
- package/build-style/freeform/editor-rtl.css +2 -4
- package/build-style/freeform/editor.css +2 -4
- package/build-style/gallery/editor-rtl.css +0 -46
- package/build-style/gallery/editor.css +0 -46
- package/build-style/image/style-rtl.css +24 -10
- package/build-style/image/style.css +24 -10
- package/build-style/navigation/style-rtl.css +8 -6
- package/build-style/navigation/style.css +8 -6
- package/build-style/navigation-link/editor-rtl.css +3 -0
- package/build-style/navigation-link/editor.css +3 -0
- package/build-style/paragraph/editor-rtl.css +4 -0
- package/build-style/paragraph/editor.css +4 -0
- package/build-style/post-featured-image/editor-rtl.css +1 -1
- package/build-style/post-featured-image/editor.css +1 -1
- package/build-style/query/editor-rtl.css +0 -27
- package/build-style/query/editor.css +0 -27
- package/build-style/site-logo/editor-rtl.css +2 -8
- package/build-style/site-logo/editor.css +2 -8
- package/build-style/social-links/style-rtl.css +2 -5
- package/build-style/social-links/style.css +2 -5
- package/build-style/style-rtl.css +34 -21
- package/build-style/style.css +34 -21
- package/package.json +35 -35
- package/src/archives/edit.js +2 -2
- package/src/audio/test/transforms.native.js +4 -3
- package/src/button/edit.js +6 -2
- package/src/categories/edit.js +133 -45
- package/src/columns/edit.js +1 -1
- package/src/columns/edit.native.js +1 -1
- package/src/comment-template/edit.js +2 -2
- package/src/comments/edit/comments-inspector-controls.js +5 -8
- package/src/comments-pagination/block.json +5 -0
- package/src/comments-pagination-next/block.json +0 -5
- package/src/comments-pagination-next/index.js +6 -0
- package/src/comments-pagination-previous/block.json +0 -5
- package/src/comments-pagination-previous/index.js +6 -0
- package/src/cover/deprecated.js +1 -1
- package/src/cover/edit/inspector-controls.js +1 -21
- package/src/cover/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/cover/test/edit.js +7 -7
- package/src/cover/test/edit.native.js +2 -2
- package/src/cover/test/transforms.native.js +9 -5
- package/src/details/block.json +12 -0
- package/src/details/edit.js +29 -24
- package/src/details/save.js +6 -2
- package/src/editor.scss +1 -1
- package/src/embed/test/index.js +1 -1
- package/src/embed/transforms.js +3 -1
- package/src/embed/util.js +1 -1
- package/src/file/edit.js +4 -3
- package/src/file/test/transforms.native.js +4 -3
- package/src/file/transforms.js +1 -1
- package/src/file/utils/index.js +1 -1
- package/src/form/variations.js +1 -1
- package/src/form-input/edit.js +1 -1
- package/src/freeform/editor.scss +4 -3
- package/src/gallery/edit.js +1 -1
- package/src/gallery/editor.scss +0 -54
- package/src/gallery/test/transforms.native.js +4 -3
- package/src/gallery/transforms.js +2 -2
- package/src/gallery/use-get-new-images.js +1 -1
- package/src/group/edit.js +1 -20
- package/src/home-link/edit.js +0 -6
- package/src/image/block.json +8 -1
- package/src/image/editor.scss +1 -1
- package/src/image/index.php +9 -13
- package/src/image/style.scss +17 -7
- package/src/image/test/edit.native.js +1 -1
- package/src/image/test/transforms.native.js +4 -3
- package/src/latest-comments/edit.js +93 -33
- package/src/latest-posts/constants.js +1 -0
- package/src/latest-posts/edit.js +119 -44
- package/src/list/test/edit.native.js +10 -10
- package/src/list-item/block.json +1 -1
- package/src/list-item/edit.native.js +2 -2
- package/src/media-text/edit.native.js +2 -2
- package/src/media-text/media-container.native.js +4 -4
- package/src/media-text/test/transforms.native.js +9 -5
- package/src/navigation/edit/index.js +4 -0
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
- package/src/navigation/edit/use-generate-default-navigation-title.js +4 -4
- package/src/navigation/index.js +20 -0
- package/src/navigation/style.scss +7 -4
- package/src/navigation-link/edit.js +26 -30
- package/src/navigation-link/editor.scss +27 -18
- package/src/navigation-link/link-ui.js +7 -13
- package/src/navigation-submenu/edit.js +1 -1
- package/src/navigation-submenu/index.js +7 -0
- package/src/navigation-submenu/index.php +21 -4
- package/src/page-list/block.json +11 -0
- package/src/page-list/edit.js +52 -50
- package/src/paragraph/edit.js +3 -18
- package/src/paragraph/editor.scss +7 -0
- package/src/paragraph/style.scss +1 -1
- package/src/pattern/block.json +1 -1
- package/src/post-author-name/edit.js +53 -15
- package/src/post-comments-link/block.json +7 -1
- package/src/post-content/block.json +2 -1
- package/src/post-date/edit.js +1 -3
- package/src/post-featured-image/edit.js +2 -15
- package/src/post-featured-image/editor.scss +2 -2
- package/src/post-featured-image/overlay-controls.js +1 -0
- package/src/post-navigation-link/variations.js +2 -2
- package/src/post-terms/edit.js +1 -0
- package/src/post-time-to-read/block.json +1 -1
- package/src/query/edit/inspector-controls/author-control.js +1 -1
- package/src/query/edit/inspector-controls/index.js +148 -88
- package/src/query/edit/query-content.js +1 -11
- package/src/query/editor.scss +0 -31
- package/src/query/utils.js +1 -1
- package/src/query-no-results/block.json +1 -1
- package/src/query-pagination-numbers/edit.js +1 -1
- package/src/query-title/edit.js +61 -19
- package/src/query-total/block.json +7 -1
- package/src/quote/transforms.js +1 -1
- package/src/read-more/edit.js +35 -11
- package/src/rss/block.json +6 -0
- package/src/rss/edit.js +1 -0
- package/src/search/edit.js +100 -71
- package/src/separator/deprecated.scss +1 -1
- package/src/separator/edit.js +1 -6
- package/src/site-logo/edit.js +34 -47
- package/src/site-logo/editor.scss +3 -6
- package/src/social-link/index.php +2 -2
- package/src/social-links/edit.js +1 -0
- package/src/social-links/style.scss +3 -3
- package/src/spacer/controls.js +10 -9
- package/src/spacer/edit.js +25 -23
- package/src/table-of-contents/edit.js +38 -19
- package/src/template-part/edit/advanced-controls.js +1 -21
- package/src/utils/messages.js +31 -0
- package/src/video/edit-common-settings.js +1 -1
- package/src/video/edit.native.js +3 -3
- package/src/video/test/transforms.native.js +4 -3
package/src/image/index.php
CHANGED
|
@@ -149,18 +149,14 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
|
|
149
149
|
return $block_content;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
$alt
|
|
153
|
-
$img_uploaded_src
|
|
154
|
-
$img_class_names
|
|
155
|
-
$img_styles
|
|
156
|
-
$img_width
|
|
157
|
-
$img_height
|
|
158
|
-
$aria_label
|
|
159
|
-
|
|
160
|
-
if ( $alt ) {
|
|
161
|
-
/* translators: %s: Image alt text. */
|
|
162
|
-
$aria_label = sprintf( __( 'Enlarge image: %s' ), $alt );
|
|
163
|
-
}
|
|
152
|
+
$alt = $p->get_attribute( 'alt' );
|
|
153
|
+
$img_uploaded_src = $p->get_attribute( 'src' );
|
|
154
|
+
$img_class_names = $p->get_attribute( 'class' );
|
|
155
|
+
$img_styles = $p->get_attribute( 'style' );
|
|
156
|
+
$img_width = 'none';
|
|
157
|
+
$img_height = 'none';
|
|
158
|
+
$aria_label = __( 'Enlarge' );
|
|
159
|
+
$dialog_aria_label = __( 'Enlarged image' );
|
|
164
160
|
|
|
165
161
|
if ( isset( $block['attrs']['id'] ) ) {
|
|
166
162
|
$img_uploaded_src = wp_get_attachment_url( $block['attrs']['id'] );
|
|
@@ -190,7 +186,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
|
|
190
186
|
'targetWidth' => $img_width,
|
|
191
187
|
'targetHeight' => $img_height,
|
|
192
188
|
'scaleAttr' => $block['attrs']['scale'] ?? false,
|
|
193
|
-
'ariaLabel' => $
|
|
189
|
+
'ariaLabel' => $dialog_aria_label,
|
|
194
190
|
'alt' => $alt,
|
|
195
191
|
),
|
|
196
192
|
),
|
package/src/image/style.scss
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
vertical-align: bottom;
|
|
12
12
|
box-sizing: border-box;
|
|
13
13
|
|
|
14
|
-
@media (prefers-reduced-motion
|
|
14
|
+
@media not (prefers-reduced-motion) {
|
|
15
15
|
&.hide {
|
|
16
16
|
visibility: hidden;
|
|
17
17
|
}
|
|
@@ -167,7 +167,9 @@
|
|
|
167
167
|
text-align: center;
|
|
168
168
|
padding: 0;
|
|
169
169
|
border-radius: 4px;
|
|
170
|
-
|
|
170
|
+
@media not (prefers-reduced-motion) {
|
|
171
|
+
transition: opacity 0.2s ease;
|
|
172
|
+
}
|
|
171
173
|
|
|
172
174
|
&:focus-visible {
|
|
173
175
|
outline: 3px auto rgb(90 90 90 / 25%);
|
|
@@ -280,21 +282,29 @@
|
|
|
280
282
|
// or faster than the scrim to give a sense of depth.
|
|
281
283
|
&.active {
|
|
282
284
|
visibility: visible;
|
|
283
|
-
|
|
285
|
+
@media not (prefers-reduced-motion) {
|
|
286
|
+
animation: both turn-on-visibility 0.25s;
|
|
287
|
+
}
|
|
284
288
|
img {
|
|
285
|
-
|
|
289
|
+
@media not (prefers-reduced-motion) {
|
|
290
|
+
animation: both turn-on-visibility 0.35s;
|
|
291
|
+
}
|
|
286
292
|
}
|
|
287
293
|
}
|
|
288
294
|
&.show-closing-animation {
|
|
289
295
|
&:not(.active) {
|
|
290
|
-
|
|
296
|
+
@media not (prefers-reduced-motion) {
|
|
297
|
+
animation: both turn-off-visibility 0.35s;
|
|
298
|
+
}
|
|
291
299
|
img {
|
|
292
|
-
|
|
300
|
+
@media not (prefers-reduced-motion) {
|
|
301
|
+
animation: both turn-off-visibility 0.25s;
|
|
302
|
+
}
|
|
293
303
|
}
|
|
294
304
|
}
|
|
295
305
|
}
|
|
296
306
|
|
|
297
|
-
@media (prefers-reduced-motion
|
|
307
|
+
@media not (prefers-reduced-motion) {
|
|
298
308
|
&.zoom {
|
|
299
309
|
&.active {
|
|
300
310
|
opacity: 1;
|
|
@@ -62,7 +62,7 @@ Clipboard.getString.mockImplementation( () => clipboardPromise );
|
|
|
62
62
|
beforeAll( () => {
|
|
63
63
|
registerCoreBlocks();
|
|
64
64
|
|
|
65
|
-
// Mock Image.getSize to avoid failed attempt to size non-
|
|
65
|
+
// Mock Image.getSize to avoid failed attempt to size non-existent image
|
|
66
66
|
const getSizeSpy = jest.spyOn( Image, 'getSize' );
|
|
67
67
|
getSizeSpy.mockImplementation( ( _url, callback ) => callback( 300, 200 ) );
|
|
68
68
|
} );
|
|
@@ -15,12 +15,12 @@ const initialHtml = `
|
|
|
15
15
|
<figure class="wp-block-image size-large is-style-default"><a href="https://cldup.com/cXyG__fTLN.jpg"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></a><figcaption class="wp-element-caption">Mountain</figcaption></figure>
|
|
16
16
|
<!-- /wp:image -->`;
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const transformsWithInnerBlocks = [ 'Gallery', 'Columns', 'Group' ];
|
|
19
19
|
const nonMediaTransforms = [ 'File' ];
|
|
20
20
|
const blockTransforms = [
|
|
21
21
|
'Cover',
|
|
22
22
|
'Media & Text',
|
|
23
|
-
...
|
|
23
|
+
...transformsWithInnerBlocks,
|
|
24
24
|
...nonMediaTransforms,
|
|
25
25
|
];
|
|
26
26
|
|
|
@@ -31,7 +31,8 @@ describe( `${ block } block transformations`, () => {
|
|
|
31
31
|
const screen = await initializeEditor( { initialHtml } );
|
|
32
32
|
const newBlock = await transformBlock( screen, block, blockTransform, {
|
|
33
33
|
isMediaBlock: ! nonMediaTransforms.includes( blockTransform ),
|
|
34
|
-
hasInnerBlocks:
|
|
34
|
+
hasInnerBlocks:
|
|
35
|
+
transformsWithInnerBlocks.includes( blockTransform ),
|
|
35
36
|
} );
|
|
36
37
|
expect( newBlock ).toBeVisible();
|
|
37
38
|
expect( getEditorHtml() ).toMatchSnapshot();
|
|
@@ -4,13 +4,19 @@
|
|
|
4
4
|
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
|
5
5
|
import {
|
|
6
6
|
Disabled,
|
|
7
|
-
PanelBody,
|
|
8
7
|
RangeControl,
|
|
9
8
|
ToggleControl,
|
|
9
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
10
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
10
11
|
} from '@wordpress/components';
|
|
11
12
|
import ServerSideRender from '@wordpress/server-side-render';
|
|
12
13
|
import { __ } from '@wordpress/i18n';
|
|
13
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
19
|
+
|
|
14
20
|
/**
|
|
15
21
|
* Minimum number of comments a user can show using this block.
|
|
16
22
|
*
|
|
@@ -36,49 +42,103 @@ export default function LatestComments( { attributes, setAttributes } ) {
|
|
|
36
42
|
},
|
|
37
43
|
};
|
|
38
44
|
|
|
45
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
46
|
+
|
|
39
47
|
return (
|
|
40
48
|
<div { ...useBlockProps() }>
|
|
41
49
|
<InspectorControls>
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
<ToolsPanel
|
|
51
|
+
label={ __( 'Settings' ) }
|
|
52
|
+
resetAll={ () => {
|
|
53
|
+
setAttributes( {
|
|
54
|
+
commentsToShow: 5,
|
|
55
|
+
displayAvatar: true,
|
|
56
|
+
displayDate: true,
|
|
57
|
+
displayExcerpt: true,
|
|
58
|
+
} );
|
|
59
|
+
} }
|
|
60
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
61
|
+
>
|
|
62
|
+
<ToolsPanelItem
|
|
63
|
+
hasValue={ () => ! displayAvatar }
|
|
45
64
|
label={ __( 'Display avatar' ) }
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
setAttributes( { displayAvatar: ! displayAvatar } )
|
|
65
|
+
onDeselect={ () =>
|
|
66
|
+
setAttributes( { displayAvatar: true } )
|
|
49
67
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
68
|
+
isShownByDefault
|
|
69
|
+
>
|
|
70
|
+
<ToggleControl
|
|
71
|
+
__nextHasNoMarginBottom
|
|
72
|
+
label={ __( 'Display avatar' ) }
|
|
73
|
+
checked={ displayAvatar }
|
|
74
|
+
onChange={ () =>
|
|
75
|
+
setAttributes( {
|
|
76
|
+
displayAvatar: ! displayAvatar,
|
|
77
|
+
} )
|
|
78
|
+
}
|
|
79
|
+
/>
|
|
80
|
+
</ToolsPanelItem>
|
|
81
|
+
|
|
82
|
+
<ToolsPanelItem
|
|
83
|
+
hasValue={ () => ! displayDate }
|
|
53
84
|
label={ __( 'Display date' ) }
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
setAttributes( { displayDate: ! displayDate } )
|
|
85
|
+
onDeselect={ () =>
|
|
86
|
+
setAttributes( { displayDate: true } )
|
|
57
87
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
88
|
+
isShownByDefault
|
|
89
|
+
>
|
|
90
|
+
<ToggleControl
|
|
91
|
+
__nextHasNoMarginBottom
|
|
92
|
+
label={ __( 'Display date' ) }
|
|
93
|
+
checked={ displayDate }
|
|
94
|
+
onChange={ () =>
|
|
95
|
+
setAttributes( { displayDate: ! displayDate } )
|
|
96
|
+
}
|
|
97
|
+
/>
|
|
98
|
+
</ToolsPanelItem>
|
|
99
|
+
|
|
100
|
+
<ToolsPanelItem
|
|
101
|
+
hasValue={ () => ! displayExcerpt }
|
|
61
102
|
label={ __( 'Display excerpt' ) }
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
setAttributes( {
|
|
65
|
-
displayExcerpt: ! displayExcerpt,
|
|
66
|
-
} )
|
|
103
|
+
onDeselect={ () =>
|
|
104
|
+
setAttributes( { displayExcerpt: true } )
|
|
67
105
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
106
|
+
isShownByDefault
|
|
107
|
+
>
|
|
108
|
+
<ToggleControl
|
|
109
|
+
__nextHasNoMarginBottom
|
|
110
|
+
label={ __( 'Display excerpt' ) }
|
|
111
|
+
checked={ displayExcerpt }
|
|
112
|
+
onChange={ () =>
|
|
113
|
+
setAttributes( {
|
|
114
|
+
displayExcerpt: ! displayExcerpt,
|
|
115
|
+
} )
|
|
116
|
+
}
|
|
117
|
+
/>
|
|
118
|
+
</ToolsPanelItem>
|
|
119
|
+
|
|
120
|
+
<ToolsPanelItem
|
|
121
|
+
hasValue={ () => commentsToShow !== 5 }
|
|
72
122
|
label={ __( 'Number of comments' ) }
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
setAttributes( { commentsToShow: value } )
|
|
123
|
+
onDeselect={ () =>
|
|
124
|
+
setAttributes( { commentsToShow: 5 } )
|
|
76
125
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
126
|
+
isShownByDefault
|
|
127
|
+
>
|
|
128
|
+
<RangeControl
|
|
129
|
+
__nextHasNoMarginBottom
|
|
130
|
+
__next40pxDefaultSize
|
|
131
|
+
label={ __( 'Number of comments' ) }
|
|
132
|
+
value={ commentsToShow }
|
|
133
|
+
onChange={ ( value ) =>
|
|
134
|
+
setAttributes( { commentsToShow: value } )
|
|
135
|
+
}
|
|
136
|
+
min={ MIN_COMMENTS }
|
|
137
|
+
max={ MAX_COMMENTS }
|
|
138
|
+
required
|
|
139
|
+
/>
|
|
140
|
+
</ToolsPanelItem>
|
|
141
|
+
</ToolsPanel>
|
|
82
142
|
</InspectorControls>
|
|
83
143
|
<Disabled>
|
|
84
144
|
<ServerSideRender
|
package/src/latest-posts/edit.js
CHANGED
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
ToolbarGroup,
|
|
18
18
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
19
19
|
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
|
|
20
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
21
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
20
22
|
} from '@wordpress/components';
|
|
21
23
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
22
24
|
import { dateI18n, format, getSettings } from '@wordpress/date';
|
|
@@ -49,7 +51,9 @@ import {
|
|
|
49
51
|
MIN_EXCERPT_LENGTH,
|
|
50
52
|
MAX_EXCERPT_LENGTH,
|
|
51
53
|
MAX_POSTS_COLUMNS,
|
|
54
|
+
DEFAULT_EXCERPT_LENGTH,
|
|
52
55
|
} from './constants';
|
|
56
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
53
57
|
|
|
54
58
|
/**
|
|
55
59
|
* Module Constants
|
|
@@ -77,6 +81,8 @@ function getFeaturedImageDetails( post, size ) {
|
|
|
77
81
|
|
|
78
82
|
export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
79
83
|
const instanceId = useInstanceId( LatestPostsEdit );
|
|
84
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
85
|
+
|
|
80
86
|
const {
|
|
81
87
|
postsToShow,
|
|
82
88
|
order,
|
|
@@ -227,68 +233,137 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
227
233
|
const hasPosts = !! latestPosts?.length;
|
|
228
234
|
const inspectorControls = (
|
|
229
235
|
<InspectorControls>
|
|
230
|
-
<
|
|
231
|
-
|
|
232
|
-
|
|
236
|
+
<ToolsPanel
|
|
237
|
+
label={ __( 'Post content' ) }
|
|
238
|
+
resetAll={ () =>
|
|
239
|
+
setAttributes( {
|
|
240
|
+
displayPostContent: false,
|
|
241
|
+
displayPostContentRadio: 'excerpt',
|
|
242
|
+
excerptLength: DEFAULT_EXCERPT_LENGTH,
|
|
243
|
+
} )
|
|
244
|
+
}
|
|
245
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
246
|
+
>
|
|
247
|
+
<ToolsPanelItem
|
|
248
|
+
hasValue={ () => !! displayPostContent }
|
|
233
249
|
label={ __( 'Post content' ) }
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
setAttributes( { displayPostContent: value } )
|
|
250
|
+
onDeselect={ () =>
|
|
251
|
+
setAttributes( { displayPostContent: false } )
|
|
237
252
|
}
|
|
238
|
-
|
|
253
|
+
isShownByDefault
|
|
254
|
+
>
|
|
255
|
+
<ToggleControl
|
|
256
|
+
__nextHasNoMarginBottom
|
|
257
|
+
label={ __( 'Post content' ) }
|
|
258
|
+
checked={ displayPostContent }
|
|
259
|
+
onChange={ ( value ) =>
|
|
260
|
+
setAttributes( { displayPostContent: value } )
|
|
261
|
+
}
|
|
262
|
+
/>
|
|
263
|
+
</ToolsPanelItem>
|
|
239
264
|
{ displayPostContent && (
|
|
240
|
-
<
|
|
265
|
+
<ToolsPanelItem
|
|
266
|
+
hasValue={ () => displayPostContentRadio !== 'excerpt' }
|
|
241
267
|
label={ __( 'Show' ) }
|
|
242
|
-
|
|
243
|
-
options={ [
|
|
244
|
-
{ label: __( 'Excerpt' ), value: 'excerpt' },
|
|
245
|
-
{
|
|
246
|
-
label: __( 'Full post' ),
|
|
247
|
-
value: 'full_post',
|
|
248
|
-
},
|
|
249
|
-
] }
|
|
250
|
-
onChange={ ( value ) =>
|
|
268
|
+
onDeselect={ () =>
|
|
251
269
|
setAttributes( {
|
|
252
|
-
displayPostContentRadio:
|
|
270
|
+
displayPostContentRadio: 'excerpt',
|
|
253
271
|
} )
|
|
254
272
|
}
|
|
255
|
-
|
|
273
|
+
isShownByDefault
|
|
274
|
+
>
|
|
275
|
+
<RadioControl
|
|
276
|
+
label={ __( 'Show' ) }
|
|
277
|
+
selected={ displayPostContentRadio }
|
|
278
|
+
options={ [
|
|
279
|
+
{ label: __( 'Excerpt' ), value: 'excerpt' },
|
|
280
|
+
{
|
|
281
|
+
label: __( 'Full post' ),
|
|
282
|
+
value: 'full_post',
|
|
283
|
+
},
|
|
284
|
+
] }
|
|
285
|
+
onChange={ ( value ) =>
|
|
286
|
+
setAttributes( {
|
|
287
|
+
displayPostContentRadio: value,
|
|
288
|
+
} )
|
|
289
|
+
}
|
|
290
|
+
/>
|
|
291
|
+
</ToolsPanelItem>
|
|
256
292
|
) }
|
|
257
293
|
{ displayPostContent &&
|
|
258
294
|
displayPostContentRadio === 'excerpt' && (
|
|
259
|
-
<
|
|
260
|
-
|
|
261
|
-
|
|
295
|
+
<ToolsPanelItem
|
|
296
|
+
hasValue={ () =>
|
|
297
|
+
excerptLength !== DEFAULT_EXCERPT_LENGTH
|
|
298
|
+
}
|
|
262
299
|
label={ __( 'Max number of words' ) }
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
300
|
+
onDeselect={ () =>
|
|
301
|
+
setAttributes( {
|
|
302
|
+
excerptLength: DEFAULT_EXCERPT_LENGTH,
|
|
303
|
+
} )
|
|
266
304
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
305
|
+
isShownByDefault
|
|
306
|
+
>
|
|
307
|
+
<RangeControl
|
|
308
|
+
__nextHasNoMarginBottom
|
|
309
|
+
__next40pxDefaultSize
|
|
310
|
+
label={ __( 'Max number of words' ) }
|
|
311
|
+
value={ excerptLength }
|
|
312
|
+
onChange={ ( value ) =>
|
|
313
|
+
setAttributes( { excerptLength: value } )
|
|
314
|
+
}
|
|
315
|
+
min={ MIN_EXCERPT_LENGTH }
|
|
316
|
+
max={ MAX_EXCERPT_LENGTH }
|
|
317
|
+
/>
|
|
318
|
+
</ToolsPanelItem>
|
|
270
319
|
) }
|
|
271
|
-
</
|
|
320
|
+
</ToolsPanel>
|
|
272
321
|
|
|
273
|
-
<
|
|
274
|
-
|
|
275
|
-
|
|
322
|
+
<ToolsPanel
|
|
323
|
+
label={ __( 'Post meta' ) }
|
|
324
|
+
resetAll={ () =>
|
|
325
|
+
setAttributes( {
|
|
326
|
+
displayAuthor: false,
|
|
327
|
+
displayPostDate: false,
|
|
328
|
+
} )
|
|
329
|
+
}
|
|
330
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
331
|
+
>
|
|
332
|
+
<ToolsPanelItem
|
|
333
|
+
hasValue={ () => !! displayAuthor }
|
|
276
334
|
label={ __( 'Display author name' ) }
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
setAttributes( { displayAuthor: value } )
|
|
335
|
+
onDeselect={ () =>
|
|
336
|
+
setAttributes( { displayAuthor: false } )
|
|
280
337
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
338
|
+
isShownByDefault
|
|
339
|
+
>
|
|
340
|
+
<ToggleControl
|
|
341
|
+
__nextHasNoMarginBottom
|
|
342
|
+
label={ __( 'Display author name' ) }
|
|
343
|
+
checked={ displayAuthor }
|
|
344
|
+
onChange={ ( value ) =>
|
|
345
|
+
setAttributes( { displayAuthor: value } )
|
|
346
|
+
}
|
|
347
|
+
/>
|
|
348
|
+
</ToolsPanelItem>
|
|
349
|
+
<ToolsPanelItem
|
|
350
|
+
hasValue={ () => !! displayPostDate }
|
|
284
351
|
label={ __( 'Display post date' ) }
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
setAttributes( { displayPostDate: value } )
|
|
352
|
+
onDeselect={ () =>
|
|
353
|
+
setAttributes( { displayPostDate: false } )
|
|
288
354
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
355
|
+
isShownByDefault
|
|
356
|
+
>
|
|
357
|
+
<ToggleControl
|
|
358
|
+
__nextHasNoMarginBottom
|
|
359
|
+
label={ __( 'Display post date' ) }
|
|
360
|
+
checked={ displayPostDate }
|
|
361
|
+
onChange={ ( value ) =>
|
|
362
|
+
setAttributes( { displayPostDate: value } )
|
|
363
|
+
}
|
|
364
|
+
/>
|
|
365
|
+
</ToolsPanelItem>
|
|
366
|
+
</ToolsPanel>
|
|
292
367
|
<PanelBody title={ __( 'Featured image' ) }>
|
|
293
368
|
<ToggleControl
|
|
294
369
|
__nextHasNoMarginBottom
|
|
@@ -50,7 +50,7 @@ describe( 'List block', () => {
|
|
|
50
50
|
await triggerBlockListLayout( listBlock );
|
|
51
51
|
|
|
52
52
|
// Get List item
|
|
53
|
-
const listItemBlock = await getBlock( screen, 'List
|
|
53
|
+
const listItemBlock = await getBlock( screen, 'List Item' );
|
|
54
54
|
fireEvent.press( listItemBlock );
|
|
55
55
|
|
|
56
56
|
expect( listItemBlock ).toBeVisible();
|
|
@@ -75,7 +75,7 @@ describe( 'List block', () => {
|
|
|
75
75
|
|
|
76
76
|
// Select List Item block
|
|
77
77
|
const [ listItemBlock ] = screen.getAllByLabelText(
|
|
78
|
-
/List
|
|
78
|
+
/List Item Block\. Row 1/
|
|
79
79
|
);
|
|
80
80
|
fireEvent.press( listItemBlock );
|
|
81
81
|
|
|
@@ -124,7 +124,7 @@ describe( 'List block', () => {
|
|
|
124
124
|
|
|
125
125
|
// Select List Item block
|
|
126
126
|
const [ firstNestedLevelBlock ] = within( listBlock ).getAllByLabelText(
|
|
127
|
-
/List
|
|
127
|
+
/List Item Block\. Row 2/
|
|
128
128
|
);
|
|
129
129
|
fireEvent.press( firstNestedLevelBlock );
|
|
130
130
|
await triggerBlockListLayout( firstNestedLevelBlock );
|
|
@@ -157,9 +157,9 @@ describe( 'List block', () => {
|
|
|
157
157
|
fireEvent.press( listBlock );
|
|
158
158
|
await triggerBlockListLayout( listBlock );
|
|
159
159
|
|
|
160
|
-
// Select
|
|
160
|
+
// Select Second List Item block
|
|
161
161
|
const [ listItemBlock ] = screen.getAllByLabelText(
|
|
162
|
-
/List
|
|
162
|
+
/List Item Block\. Row 2/
|
|
163
163
|
);
|
|
164
164
|
fireEvent.press( listItemBlock );
|
|
165
165
|
|
|
@@ -169,7 +169,7 @@ describe( 'List block', () => {
|
|
|
169
169
|
|
|
170
170
|
// Await recently indented list item layout
|
|
171
171
|
const [ listItemBlock1 ] = screen.getAllByLabelText(
|
|
172
|
-
/List
|
|
172
|
+
/List Item Block\. Row 1/
|
|
173
173
|
);
|
|
174
174
|
await triggerBlockListLayout( listItemBlock1 );
|
|
175
175
|
|
|
@@ -203,7 +203,7 @@ describe( 'List block', () => {
|
|
|
203
203
|
|
|
204
204
|
// Select List Item block
|
|
205
205
|
const [ firstNestedLevelBlock ] = within( listBlock ).getAllByLabelText(
|
|
206
|
-
/List
|
|
206
|
+
/List Item Block\. Row 1/
|
|
207
207
|
);
|
|
208
208
|
fireEvent.press( firstNestedLevelBlock );
|
|
209
209
|
await triggerBlockListLayout( firstNestedLevelBlock );
|
|
@@ -217,7 +217,7 @@ describe( 'List block', () => {
|
|
|
217
217
|
|
|
218
218
|
// Select nested List Item block
|
|
219
219
|
const [ listItemBlock ] = within( innerBlockList ).getAllByLabelText(
|
|
220
|
-
/List
|
|
220
|
+
/List Item Block\. Row 1/
|
|
221
221
|
);
|
|
222
222
|
fireEvent.press( listItemBlock );
|
|
223
223
|
|
|
@@ -500,7 +500,7 @@ describe( 'List block', () => {
|
|
|
500
500
|
|
|
501
501
|
// Select List Item block
|
|
502
502
|
const [ listItemBlock ] = within( listBlock ).getAllByLabelText(
|
|
503
|
-
/List
|
|
503
|
+
/List Item Block\. Row 1/
|
|
504
504
|
);
|
|
505
505
|
fireEvent.press( listItemBlock );
|
|
506
506
|
|
|
@@ -560,7 +560,7 @@ describe( 'List block', () => {
|
|
|
560
560
|
|
|
561
561
|
// Select List Item block
|
|
562
562
|
const [ listItemBlock ] = within( listBlock ).getAllByLabelText(
|
|
563
|
-
/List
|
|
563
|
+
/List Item Block\. Row 1/
|
|
564
564
|
);
|
|
565
565
|
fireEvent.press( listItemBlock );
|
|
566
566
|
|
package/src/list-item/block.json
CHANGED
|
@@ -54,7 +54,7 @@ export default function ListItemEdit( {
|
|
|
54
54
|
getBlockParentsByBlockName,
|
|
55
55
|
getBlockRootClientId,
|
|
56
56
|
} = select( blockEditorStore );
|
|
57
|
-
const
|
|
57
|
+
const currentIndentationLevel = getBlockParentsByBlockName(
|
|
58
58
|
clientId,
|
|
59
59
|
'core/list-item',
|
|
60
60
|
true
|
|
@@ -73,7 +73,7 @@ export default function ListItemEdit( {
|
|
|
73
73
|
return {
|
|
74
74
|
blockIndex: currentBlockIndex,
|
|
75
75
|
hasInnerBlocks: blockWithInnerBlocks,
|
|
76
|
-
indentationLevel:
|
|
76
|
+
indentationLevel: currentIndentationLevel,
|
|
77
77
|
numberOfListItems: totalListItems,
|
|
78
78
|
ordered: isOrdered,
|
|
79
79
|
reversed: isReversed,
|
|
@@ -218,7 +218,7 @@ class MediaTextEdit extends Component {
|
|
|
218
218
|
? ( containerWidth * mediaWidth ) / 100 -
|
|
219
219
|
styles.mediaAreaPadding.width
|
|
220
220
|
: containerWidth;
|
|
221
|
-
const
|
|
221
|
+
const alignmentStyles =
|
|
222
222
|
styles[
|
|
223
223
|
`is-vertically-aligned-${ verticalAlignment || 'center' }`
|
|
224
224
|
];
|
|
@@ -244,7 +244,7 @@ class MediaTextEdit extends Component {
|
|
|
244
244
|
imageFill,
|
|
245
245
|
focalPoint,
|
|
246
246
|
isSelected,
|
|
247
|
-
|
|
247
|
+
alignmentStyles,
|
|
248
248
|
shouldStack,
|
|
249
249
|
} }
|
|
250
250
|
/>
|
|
@@ -171,7 +171,7 @@ class MediaContainer extends Component {
|
|
|
171
171
|
renderImage( params, openMediaOptions ) {
|
|
172
172
|
const { isUploadInProgress } = this.state;
|
|
173
173
|
const {
|
|
174
|
-
|
|
174
|
+
alignmentStyles,
|
|
175
175
|
focalPoint,
|
|
176
176
|
imageFill,
|
|
177
177
|
isMediaSelected,
|
|
@@ -205,7 +205,7 @@ class MediaContainer extends Component {
|
|
|
205
205
|
style={ [
|
|
206
206
|
imageFill && styles.imageCropped,
|
|
207
207
|
styles.mediaImageContainer,
|
|
208
|
-
! isUploadInProgress &&
|
|
208
|
+
! isUploadInProgress && alignmentStyles,
|
|
209
209
|
] }
|
|
210
210
|
>
|
|
211
211
|
<Image
|
|
@@ -232,7 +232,7 @@ class MediaContainer extends Component {
|
|
|
232
232
|
|
|
233
233
|
renderVideo( params ) {
|
|
234
234
|
const {
|
|
235
|
-
|
|
235
|
+
alignmentStyles,
|
|
236
236
|
mediaUrl,
|
|
237
237
|
isSelected,
|
|
238
238
|
getStylesFromColorScheme,
|
|
@@ -261,7 +261,7 @@ class MediaContainer extends Component {
|
|
|
261
261
|
onPress={ this.onMediaPressed }
|
|
262
262
|
disabled={ ! isSelected }
|
|
263
263
|
>
|
|
264
|
-
<View style={ [ styles.videoContainer,
|
|
264
|
+
<View style={ [ styles.videoContainer, alignmentStyles ] }>
|
|
265
265
|
<View
|
|
266
266
|
style={ [
|
|
267
267
|
styles.videoContent,
|