@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
|
@@ -70,8 +70,9 @@
|
|
|
70
70
|
.wp-block-social-link {
|
|
71
71
|
display: block;
|
|
72
72
|
border-radius: 9999px; // This makes it pill-shaped instead of oval, in cases where the image fed is not perfectly sized.
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
@media not (prefers-reduced-motion) {
|
|
74
|
+
transition: transform 0.1s ease;
|
|
75
|
+
}
|
|
75
76
|
|
|
76
77
|
// Dimensions.
|
|
77
78
|
height: auto;
|
|
@@ -80,7 +81,6 @@
|
|
|
80
81
|
align-items: center;
|
|
81
82
|
display: flex;
|
|
82
83
|
line-height: 0;
|
|
83
|
-
transition: transform 0.1s ease;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
&:hover {
|
package/src/spacer/controls.js
CHANGED
|
@@ -24,6 +24,7 @@ import { View } from '@wordpress/primitives';
|
|
|
24
24
|
*/
|
|
25
25
|
import { unlock } from '../lock-unlock';
|
|
26
26
|
import { MIN_SPACER_SIZE } from './constants';
|
|
27
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
27
28
|
|
|
28
29
|
const { useSpacingSizes } = unlock( blockEditorPrivateApis );
|
|
29
30
|
|
|
@@ -43,10 +44,6 @@ function DimensionInput( { label, onChange, isResizing, value = '' } ) {
|
|
|
43
44
|
defaultValues: { px: 100, em: 10, rem: 10, vw: 10, vh: 25 },
|
|
44
45
|
} );
|
|
45
46
|
|
|
46
|
-
const handleOnChange = ( unprocessedValue ) => {
|
|
47
|
-
onChange( unprocessedValue.all );
|
|
48
|
-
};
|
|
49
|
-
|
|
50
47
|
// Force the unit to update to `px` when the Spacer is being resized.
|
|
51
48
|
const [ parsedQuantity, parsedUnit ] =
|
|
52
49
|
parseQuantityAndUnitFromRawValue( value );
|
|
@@ -56,23 +53,24 @@ function DimensionInput( { label, onChange, isResizing, value = '' } ) {
|
|
|
56
53
|
|
|
57
54
|
return (
|
|
58
55
|
<>
|
|
59
|
-
{
|
|
56
|
+
{ spacingSizes?.length < 2 ? (
|
|
60
57
|
<UnitControl
|
|
61
58
|
id={ inputId }
|
|
62
59
|
isResetValueOnUnitChange
|
|
63
60
|
min={ MIN_SPACER_SIZE }
|
|
64
|
-
onChange={
|
|
61
|
+
onChange={ onChange }
|
|
65
62
|
value={ computedValue }
|
|
66
63
|
units={ units }
|
|
67
64
|
label={ label }
|
|
68
65
|
__next40pxDefaultSize
|
|
69
66
|
/>
|
|
70
|
-
)
|
|
71
|
-
{ spacingSizes?.length > 0 && (
|
|
67
|
+
) : (
|
|
72
68
|
<View className="tools-panel-item-spacing">
|
|
73
69
|
<SpacingSizesControl
|
|
74
70
|
values={ { all: computedValue } }
|
|
75
|
-
onChange={
|
|
71
|
+
onChange={ ( { all } ) => {
|
|
72
|
+
onChange( all );
|
|
73
|
+
} }
|
|
76
74
|
label={ label }
|
|
77
75
|
sides={ [ 'all' ] }
|
|
78
76
|
units={ units }
|
|
@@ -93,6 +91,8 @@ export default function SpacerControls( {
|
|
|
93
91
|
width,
|
|
94
92
|
isResizing,
|
|
95
93
|
} ) {
|
|
94
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
95
|
+
|
|
96
96
|
return (
|
|
97
97
|
<InspectorControls>
|
|
98
98
|
<ToolsPanel
|
|
@@ -103,6 +103,7 @@ export default function SpacerControls( {
|
|
|
103
103
|
height: '100px',
|
|
104
104
|
} );
|
|
105
105
|
} }
|
|
106
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
106
107
|
>
|
|
107
108
|
{ orientation === 'horizontal' && (
|
|
108
109
|
<ToolsPanelItem
|
package/src/spacer/edit.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import { ResizableBox } from '@wordpress/components';
|
|
17
17
|
import { useState, useEffect } from '@wordpress/element';
|
|
18
18
|
import { View } from '@wordpress/primitives';
|
|
19
|
-
import { useSelect } from '@wordpress/data';
|
|
19
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Internal dependencies
|
|
@@ -124,6 +124,9 @@ const SpacerEdit = ( {
|
|
|
124
124
|
const onResizeStart = () => toggleSelection( false );
|
|
125
125
|
const onResizeStop = () => toggleSelection( true );
|
|
126
126
|
|
|
127
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
128
|
+
useDispatch( blockEditorStore );
|
|
129
|
+
|
|
127
130
|
const handleOnVerticalResizeStop = ( newHeight ) => {
|
|
128
131
|
onResizeStop();
|
|
129
132
|
|
|
@@ -256,11 +259,19 @@ const SpacerEdit = ( {
|
|
|
256
259
|
};
|
|
257
260
|
|
|
258
261
|
useEffect( () => {
|
|
262
|
+
// To avoid interfering with undo/redo operations any changes in this
|
|
263
|
+
// effect must not make history and should be preceded by
|
|
264
|
+
// `__unstableMarkNextChangeAsNotPersistent()`.
|
|
265
|
+
const setAttributesCovertly = ( nextAttributes ) => {
|
|
266
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
267
|
+
setAttributes( nextAttributes );
|
|
268
|
+
};
|
|
269
|
+
|
|
259
270
|
if (
|
|
260
271
|
isFlexLayout &&
|
|
261
272
|
selfStretch !== 'fill' &&
|
|
262
273
|
selfStretch !== 'fit' &&
|
|
263
|
-
|
|
274
|
+
flexSize === undefined
|
|
264
275
|
) {
|
|
265
276
|
if ( inheritedOrientation === 'horizontal' ) {
|
|
266
277
|
// If spacer is moving from a vertical container to a horizontal container,
|
|
@@ -269,7 +280,7 @@ const SpacerEdit = ( {
|
|
|
269
280
|
getCustomValueFromPreset( width, spacingSizes ) ||
|
|
270
281
|
getCustomValueFromPreset( height, spacingSizes ) ||
|
|
271
282
|
'100px';
|
|
272
|
-
|
|
283
|
+
setAttributesCovertly( {
|
|
273
284
|
width: '0px',
|
|
274
285
|
style: {
|
|
275
286
|
...blockStyle,
|
|
@@ -285,7 +296,7 @@ const SpacerEdit = ( {
|
|
|
285
296
|
getCustomValueFromPreset( height, spacingSizes ) ||
|
|
286
297
|
getCustomValueFromPreset( width, spacingSizes ) ||
|
|
287
298
|
'100px';
|
|
288
|
-
|
|
299
|
+
setAttributesCovertly( {
|
|
289
300
|
height: '0px',
|
|
290
301
|
style: {
|
|
291
302
|
...blockStyle,
|
|
@@ -301,26 +312,16 @@ const SpacerEdit = ( {
|
|
|
301
312
|
isFlexLayout &&
|
|
302
313
|
( selfStretch === 'fill' || selfStretch === 'fit' )
|
|
303
314
|
) {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
width: undefined
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
setAttributes( {
|
|
310
|
-
height: undefined,
|
|
311
|
-
} );
|
|
312
|
-
}
|
|
315
|
+
setAttributesCovertly(
|
|
316
|
+
inheritedOrientation === 'horizontal'
|
|
317
|
+
? { width: undefined }
|
|
318
|
+
: { height: undefined }
|
|
319
|
+
);
|
|
313
320
|
} else if ( ! isFlexLayout && ( selfStretch || flexSize ) ) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
width: flexSize
|
|
317
|
-
|
|
318
|
-
} else {
|
|
319
|
-
setAttributes( {
|
|
320
|
-
height: flexSize,
|
|
321
|
-
} );
|
|
322
|
-
}
|
|
323
|
-
setAttributes( {
|
|
321
|
+
setAttributesCovertly( {
|
|
322
|
+
...( inheritedOrientation === 'horizontal'
|
|
323
|
+
? { width: flexSize }
|
|
324
|
+
: { height: flexSize } ),
|
|
324
325
|
style: {
|
|
325
326
|
...blockStyle,
|
|
326
327
|
layout: {
|
|
@@ -342,6 +343,7 @@ const SpacerEdit = ( {
|
|
|
342
343
|
setAttributes,
|
|
343
344
|
spacingSizes,
|
|
344
345
|
width,
|
|
346
|
+
__unstableMarkNextChangeAsNotPersistent,
|
|
345
347
|
] );
|
|
346
348
|
|
|
347
349
|
return (
|
|
@@ -10,11 +10,12 @@ import {
|
|
|
10
10
|
} from '@wordpress/block-editor';
|
|
11
11
|
import { createBlock } from '@wordpress/blocks';
|
|
12
12
|
import {
|
|
13
|
-
PanelBody,
|
|
14
13
|
Placeholder,
|
|
15
14
|
ToggleControl,
|
|
16
15
|
ToolbarButton,
|
|
17
16
|
ToolbarGroup,
|
|
17
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
18
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
18
19
|
} from '@wordpress/components';
|
|
19
20
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
20
21
|
import { renderToString } from '@wordpress/element';
|
|
@@ -29,6 +30,7 @@ import { tableOfContents as icon } from '@wordpress/icons';
|
|
|
29
30
|
import TableOfContentsList from './list';
|
|
30
31
|
import { linearToNestedHeadingList } from './utils';
|
|
31
32
|
import { useObserveHeadings } from './hooks';
|
|
33
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
32
34
|
|
|
33
35
|
/** @typedef {import('./utils').HeadingData} HeadingData */
|
|
34
36
|
|
|
@@ -79,7 +81,7 @@ export default function TableOfContentsEdit( {
|
|
|
79
81
|
);
|
|
80
82
|
|
|
81
83
|
const { replaceBlocks } = useDispatch( blockEditorStore );
|
|
82
|
-
|
|
84
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
83
85
|
const headingTree = linearToNestedHeadingList( headings );
|
|
84
86
|
|
|
85
87
|
const toolbarControls = canInsertList && (
|
|
@@ -108,25 +110,42 @@ export default function TableOfContentsEdit( {
|
|
|
108
110
|
|
|
109
111
|
const inspectorControls = (
|
|
110
112
|
<InspectorControls>
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
<ToolsPanel
|
|
114
|
+
label={ __( 'Settings' ) }
|
|
115
|
+
resetAll={ () => {
|
|
116
|
+
setAttributes( {
|
|
117
|
+
onlyIncludeCurrentPage: false,
|
|
118
|
+
} );
|
|
119
|
+
} }
|
|
120
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
121
|
+
>
|
|
122
|
+
<ToolsPanelItem
|
|
123
|
+
hasValue={ () => !! onlyIncludeCurrentPage }
|
|
114
124
|
label={ __( 'Only include current page' ) }
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
setAttributes( { onlyIncludeCurrentPage: value } )
|
|
118
|
-
}
|
|
119
|
-
help={
|
|
120
|
-
onlyIncludeCurrentPage
|
|
121
|
-
? __(
|
|
122
|
-
'Only including headings from the current page (if the post is paginated).'
|
|
123
|
-
)
|
|
124
|
-
: __(
|
|
125
|
-
'Include headings from all pages (if the post is paginated).'
|
|
126
|
-
)
|
|
125
|
+
onDeselect={ () =>
|
|
126
|
+
setAttributes( { onlyIncludeCurrentPage: false } )
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
isShownByDefault
|
|
129
|
+
>
|
|
130
|
+
<ToggleControl
|
|
131
|
+
__nextHasNoMarginBottom
|
|
132
|
+
label={ __( 'Only include current page' ) }
|
|
133
|
+
checked={ onlyIncludeCurrentPage }
|
|
134
|
+
onChange={ ( value ) =>
|
|
135
|
+
setAttributes( { onlyIncludeCurrentPage: value } )
|
|
136
|
+
}
|
|
137
|
+
help={
|
|
138
|
+
onlyIncludeCurrentPage
|
|
139
|
+
? __(
|
|
140
|
+
'Only including headings from the current page (if the post is paginated).'
|
|
141
|
+
)
|
|
142
|
+
: __(
|
|
143
|
+
'Include headings from all pages (if the post is paginated).'
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
/>
|
|
147
|
+
</ToolsPanelItem>
|
|
148
|
+
</ToolsPanel>
|
|
130
149
|
</InspectorControls>
|
|
131
150
|
);
|
|
132
151
|
|
|
@@ -10,27 +10,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { TemplatePartImportControls } from './import-controls';
|
|
13
|
-
|
|
14
|
-
const htmlElementMessages = {
|
|
15
|
-
header: __(
|
|
16
|
-
'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'
|
|
17
|
-
),
|
|
18
|
-
main: __(
|
|
19
|
-
'The <main> element should be used for the primary content of your document only.'
|
|
20
|
-
),
|
|
21
|
-
section: __(
|
|
22
|
-
"The <section> element should represent a standalone portion of the document that can't be better represented by another element."
|
|
23
|
-
),
|
|
24
|
-
article: __(
|
|
25
|
-
'The <article> element should represent a self-contained, syndicatable portion of the document.'
|
|
26
|
-
),
|
|
27
|
-
aside: __(
|
|
28
|
-
"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
|
|
29
|
-
),
|
|
30
|
-
footer: __(
|
|
31
|
-
'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'
|
|
32
|
-
),
|
|
33
|
-
};
|
|
13
|
+
import { htmlElementMessages } from '../../utils/messages';
|
|
34
14
|
|
|
35
15
|
export function TemplatePartAdvancedControls( {
|
|
36
16
|
tagName,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
export const htmlElementMessages = {
|
|
7
|
+
article: __(
|
|
8
|
+
'The <article> element should represent a self-contained, syndicatable portion of the document.'
|
|
9
|
+
),
|
|
10
|
+
aside: __(
|
|
11
|
+
"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
|
|
12
|
+
),
|
|
13
|
+
div: __(
|
|
14
|
+
'The <div> element should only be used if the block is a design element with no semantic meaning.'
|
|
15
|
+
),
|
|
16
|
+
footer: __(
|
|
17
|
+
'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'
|
|
18
|
+
),
|
|
19
|
+
header: __(
|
|
20
|
+
'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'
|
|
21
|
+
),
|
|
22
|
+
main: __(
|
|
23
|
+
'The <main> element should be used for the primary content of your document only.'
|
|
24
|
+
),
|
|
25
|
+
nav: __(
|
|
26
|
+
'The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'
|
|
27
|
+
),
|
|
28
|
+
section: __(
|
|
29
|
+
"The <section> element should represent a standalone portion of the document that can't be better represented by another element."
|
|
30
|
+
),
|
|
31
|
+
};
|
|
@@ -125,7 +125,7 @@ const VideoSettings = ( { setAttributes, attributes } ) => {
|
|
|
125
125
|
/* translators: Setting to play videos within the webpage on mobile browsers rather than opening in a fullscreen player. */
|
|
126
126
|
label={ __( 'Play inline' ) }
|
|
127
127
|
onChange={ toggleFactory.playsInline }
|
|
128
|
-
checked={ playsInline }
|
|
128
|
+
checked={ !! playsInline }
|
|
129
129
|
help={ __(
|
|
130
130
|
'When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.'
|
|
131
131
|
) }
|
package/src/video/edit.native.js
CHANGED
|
@@ -72,7 +72,7 @@ class VideoEdit extends Component {
|
|
|
72
72
|
this.finishMediaUploadWithFailure.bind( this );
|
|
73
73
|
this.updateMediaProgress = this.updateMediaProgress.bind( this );
|
|
74
74
|
this.onVideoPressed = this.onVideoPressed.bind( this );
|
|
75
|
-
this.
|
|
75
|
+
this.onVideoContainerLayout = this.onVideoContainerLayout.bind( this );
|
|
76
76
|
this.onFocusCaption = this.onFocusCaption.bind( this );
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -179,7 +179,7 @@ class VideoEdit extends Component {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
|
|
182
|
+
onVideoContainerLayout( event ) {
|
|
183
183
|
const { width } = event.nativeEvent.layout;
|
|
184
184
|
const height = width / VIDEO_ASPECT_RATIO;
|
|
185
185
|
if ( height !== this.state.videoContainerHeight ) {
|
|
@@ -321,7 +321,7 @@ class VideoEdit extends Component {
|
|
|
321
321
|
|
|
322
322
|
return (
|
|
323
323
|
<View
|
|
324
|
-
onLayout={ this.
|
|
324
|
+
onLayout={ this.onVideoContainerLayout }
|
|
325
325
|
style={ containerStyle }
|
|
326
326
|
>
|
|
327
327
|
{ showVideo && (
|
|
@@ -15,12 +15,12 @@ const initialHtml = `
|
|
|
15
15
|
<figure class="wp-block-video"><video controls src="https://i.cloudup.com/YtZFJbuQCE.mov"></video><figcaption class="wp-element-caption">Cloudup video</figcaption></figure>
|
|
16
16
|
<!-- /wp:video -->`;
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const transformsWithInnerBlocks = [ '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 transforms`, () => {
|
|
|
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();
|