@wordpress/block-library 9.48.1 → 10.0.1-next.v.202606191442.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 +11 -0
- package/build/breadcrumbs/edit.cjs +1 -1
- package/build/breadcrumbs/edit.cjs.map +1 -1
- package/build/button/edit.cjs +1 -1
- package/build/button/edit.cjs.map +2 -2
- package/build/categories/edit.cjs +1 -1
- package/build/categories/edit.cjs.map +1 -1
- package/build/code/edit.cjs +1 -1
- package/build/code/edit.cjs.map +2 -2
- package/build/code/index.cjs +1 -1
- package/build/code/index.cjs.map +1 -1
- package/build/columns/utils.cjs.map +1 -1
- package/build/comments/edit/comments-legacy.cjs +1 -1
- package/build/comments/edit/comments-legacy.cjs.map +1 -1
- package/build/comments/edit/placeholder.cjs +4 -4
- package/build/comments/edit/placeholder.cjs.map +1 -1
- package/build/comments-pagination-next/edit.cjs +2 -2
- package/build/comments-pagination-next/edit.cjs.map +1 -1
- package/build/comments-pagination-previous/edit.cjs +2 -2
- package/build/comments-pagination-previous/edit.cjs.map +1 -1
- package/build/cover/deprecated.cjs +3 -3
- package/build/cover/deprecated.cjs.map +2 -2
- package/build/cover/edit/block-controls.cjs +13 -0
- package/build/cover/edit/block-controls.cjs.map +2 -2
- package/build/cover/edit/index.cjs +61 -2
- package/build/cover/edit/index.cjs.map +3 -3
- package/build/cover/edit/inspector-controls.cjs +93 -35
- package/build/cover/edit/inspector-controls.cjs.map +2 -2
- package/build/details/edit.cjs +1 -1
- package/build/details/edit.cjs.map +2 -2
- package/build/embed/embed-placeholder.cjs +1 -1
- package/build/embed/embed-placeholder.cjs.map +2 -2
- package/build/file/edit.cjs +3 -11
- package/build/file/edit.cjs.map +2 -2
- package/build/file/index.cjs +3 -1
- package/build/file/index.cjs.map +3 -3
- package/build/file/transforms.cjs +11 -32
- package/build/file/transforms.cjs.map +2 -2
- package/build/file/variations.cjs +38 -0
- package/build/file/variations.cjs.map +7 -0
- package/build/footnotes/edit.cjs +1 -1
- package/build/footnotes/edit.cjs.map +2 -2
- package/build/form-input/edit.cjs +1 -1
- package/build/form-input/edit.cjs.map +2 -2
- package/build/freeform/edit.cjs +1 -1
- package/build/freeform/edit.cjs.map +1 -1
- package/build/gallery/edit.cjs +2 -2
- package/build/gallery/edit.cjs.map +2 -2
- package/build/home-link/edit.cjs +1 -1
- package/build/home-link/edit.cjs.map +2 -2
- package/build/html/index.cjs +1 -1
- package/build/html/index.cjs.map +2 -2
- package/build/html/modal.cjs +3 -3
- package/build/html/modal.cjs.map +2 -2
- package/build/icon/block.json +12 -0
- package/build/icon/edit.cjs +90 -39
- package/build/icon/edit.cjs.map +3 -3
- package/build/icon/index.cjs +3 -1
- package/build/icon/index.cjs.map +3 -3
- package/build/{tab/save.cjs → icon/variations.cjs} +14 -15
- package/build/icon/variations.cjs.map +7 -0
- package/build/image/block.json +1 -0
- package/build/image/edit.cjs +4 -3
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs +91 -27
- package/build/image/image.cjs.map +2 -2
- package/build/image/index.cjs +1 -1
- package/build/image/index.cjs.map +2 -2
- package/build/image/transforms.cjs +9 -3
- package/build/image/transforms.cjs.map +2 -2
- package/build/index.cjs +1 -3
- package/build/index.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +1 -1
- package/build/latest-posts/edit.cjs.map +1 -1
- package/build/math/edit.cjs +1 -1
- package/build/math/index.cjs +1 -1
- package/build/math/index.cjs.map +1 -1
- package/build/media-text/constants.cjs +1 -1
- package/build/media-text/constants.cjs.map +2 -2
- package/build/media-text/index.cjs +1 -1
- package/build/media-text/index.cjs.map +2 -2
- package/build/missing/edit.cjs +2 -2
- package/build/missing/edit.cjs.map +1 -1
- package/build/navigation/edit/index.cjs +14 -8
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation/edit/navigation-menu-selector.cjs +1 -1
- package/build/navigation/edit/navigation-menu-selector.cjs.map +2 -2
- package/build/navigation/edit/placeholder/index.cjs +1 -1
- package/build/navigation/edit/placeholder/index.cjs.map +2 -2
- package/build/navigation-link/edit.cjs +1 -1
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-submenu/block.json +7 -0
- package/build/navigation-submenu/edit.cjs +1 -1
- package/build/navigation-submenu/edit.cjs.map +2 -2
- package/build/page-list/block.json +2 -5
- package/build/page-list/edit.cjs +1 -11
- package/build/page-list/edit.cjs.map +2 -2
- package/build/post-author/edit.cjs +1 -1
- package/build/post-author/edit.cjs.map +2 -2
- package/build/post-author/utils.cjs +1 -1
- package/build/post-author/utils.cjs.map +2 -2
- package/build/post-date/edit.cjs +2 -2
- package/build/post-date/edit.cjs.map +2 -2
- package/build/post-excerpt/edit.cjs +2 -2
- package/build/post-excerpt/edit.cjs.map +2 -2
- package/build/post-featured-image/block.json +1 -0
- package/build/post-featured-image/dimension-controls.cjs +90 -178
- package/build/post-featured-image/dimension-controls.cjs.map +3 -3
- package/build/post-featured-image/edit.cjs +47 -17
- package/build/post-featured-image/edit.cjs.map +2 -2
- package/build/post-navigation-link/edit.cjs +2 -2
- package/build/post-navigation-link/edit.cjs.map +2 -2
- package/build/post-time-to-read/edit.cjs +1 -1
- package/build/post-time-to-read/edit.cjs.map +1 -1
- package/build/preformatted/edit.cjs +1 -1
- package/build/preformatted/edit.cjs.map +2 -2
- package/build/pullquote/block.json +1 -3
- package/build/pullquote/deprecated.cjs +114 -9
- package/build/pullquote/deprecated.cjs.map +3 -3
- package/build/pullquote/edit.cjs +43 -61
- package/build/pullquote/edit.cjs.map +3 -3
- package/build/pullquote/save.cjs +5 -26
- package/build/pullquote/save.cjs.map +3 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.cjs +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.cjs.map +1 -1
- package/build/query/edit/inspector-controls/order-control.cjs +2 -2
- package/build/query/edit/inspector-controls/order-control.cjs.map +2 -2
- package/build/query/utils.cjs +2 -2
- package/build/query/utils.cjs.map +2 -2
- package/build/query-pagination-next/edit.cjs +2 -2
- package/build/query-pagination-next/edit.cjs.map +1 -1
- package/build/query-pagination-previous/edit.cjs +2 -2
- package/build/query-pagination-previous/edit.cjs.map +1 -1
- package/build/query-title/edit.cjs +1 -1
- package/build/query-title/edit.cjs.map +2 -2
- package/build/query-total/edit.cjs +1 -1
- package/build/query-total/edit.cjs.map +2 -2
- package/build/quote/index.cjs +1 -1
- package/build/quote/index.cjs.map +2 -2
- package/build/read-more/edit.cjs +1 -1
- package/build/read-more/edit.cjs.map +2 -2
- package/build/rss/edit.cjs +1 -1
- package/build/rss/edit.cjs.map +2 -2
- package/build/search/edit.cjs +3 -3
- package/build/search/edit.cjs.map +2 -2
- package/build/shortcode/edit.cjs +1 -1
- package/build/shortcode/edit.cjs.map +2 -2
- package/build/site-tagline/edit.cjs +1 -1
- package/build/site-tagline/edit.cjs.map +2 -2
- package/build/site-title/edit.cjs +1 -1
- package/build/site-title/edit.cjs.map +2 -2
- package/build/tab-list/block.json +34 -21
- package/build/tab-list/edit.cjs +116 -12
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-list/save.cjs +33 -3
- package/build/tab-list/save.cjs.map +3 -3
- package/build/tab-panel/add-tab-toolbar-control.cjs +19 -8
- package/build/tab-panel/add-tab-toolbar-control.cjs.map +2 -2
- package/build/tab-panel/block.json +2 -6
- package/build/tab-panel/remove-tab-toolbar-control.cjs +9 -14
- package/build/tab-panel/remove-tab-toolbar-control.cjs.map +2 -2
- package/build/tab-panels/block.json +2 -27
- package/build/table/index.cjs +1 -1
- package/build/table/index.cjs.map +2 -2
- package/build/tabs/block.json +3 -17
- package/build/tabs/edit.cjs +7 -21
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/index.cjs +6 -10
- package/build/tabs/index.cjs.map +2 -2
- package/build/tabs/use-tab-list-items-sync.cjs +53 -0
- package/build/tabs/use-tab-list-items-sync.cjs.map +7 -0
- package/build/tabs/view.cjs +2 -10
- package/build/tabs/view.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/order-control.cjs +2 -2
- package/build/terms-query/edit/inspector-controls/order-control.cjs.map +2 -2
- package/build/utils/style-state.cjs +164 -0
- package/build/utils/style-state.cjs.map +7 -0
- package/build/utils/waveform-player.cjs +1 -1
- package/build/verse/edit.cjs +1 -1
- package/build/verse/edit.cjs.map +2 -2
- package/build-module/breadcrumbs/edit.mjs +1 -1
- package/build-module/breadcrumbs/edit.mjs.map +1 -1
- package/build-module/button/edit.mjs +1 -1
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/categories/edit.mjs +1 -1
- package/build-module/categories/edit.mjs.map +1 -1
- package/build-module/code/edit.mjs +1 -1
- package/build-module/code/edit.mjs.map +2 -2
- package/build-module/code/index.mjs +1 -1
- package/build-module/code/index.mjs.map +1 -1
- package/build-module/columns/utils.mjs.map +1 -1
- package/build-module/comments/edit/comments-legacy.mjs +1 -1
- package/build-module/comments/edit/comments-legacy.mjs.map +1 -1
- package/build-module/comments/edit/placeholder.mjs +4 -4
- package/build-module/comments/edit/placeholder.mjs.map +1 -1
- package/build-module/comments-pagination-next/edit.mjs +2 -2
- package/build-module/comments-pagination-next/edit.mjs.map +1 -1
- package/build-module/comments-pagination-previous/edit.mjs +2 -2
- package/build-module/comments-pagination-previous/edit.mjs.map +1 -1
- package/build-module/cover/deprecated.mjs +3 -3
- package/build-module/cover/deprecated.mjs.map +2 -2
- package/build-module/cover/edit/block-controls.mjs +15 -2
- package/build-module/cover/edit/block-controls.mjs.map +2 -2
- package/build-module/cover/edit/index.mjs +64 -3
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs +98 -35
- package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
- package/build-module/details/edit.mjs +1 -1
- package/build-module/details/edit.mjs.map +2 -2
- package/build-module/embed/embed-placeholder.mjs +1 -1
- package/build-module/embed/embed-placeholder.mjs.map +2 -2
- package/build-module/file/edit.mjs +5 -13
- package/build-module/file/edit.mjs.map +2 -2
- package/build-module/file/index.mjs +3 -1
- package/build-module/file/index.mjs.map +2 -2
- package/build-module/file/transforms.mjs +11 -32
- package/build-module/file/transforms.mjs.map +2 -2
- package/build-module/file/variations.mjs +17 -0
- package/build-module/file/variations.mjs.map +7 -0
- package/build-module/footnotes/edit.mjs +1 -1
- package/build-module/footnotes/edit.mjs.map +2 -2
- package/build-module/form-input/edit.mjs +1 -1
- package/build-module/form-input/edit.mjs.map +2 -2
- package/build-module/freeform/edit.mjs +1 -1
- package/build-module/freeform/edit.mjs.map +1 -1
- package/build-module/gallery/edit.mjs +2 -2
- package/build-module/gallery/edit.mjs.map +2 -2
- package/build-module/home-link/edit.mjs +1 -1
- package/build-module/home-link/edit.mjs.map +2 -2
- package/build-module/html/index.mjs +1 -1
- package/build-module/html/index.mjs.map +2 -2
- package/build-module/html/modal.mjs +3 -3
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/icon/block.json +12 -0
- package/build-module/icon/edit.mjs +94 -40
- package/build-module/icon/edit.mjs.map +2 -2
- package/build-module/icon/index.mjs +3 -1
- package/build-module/icon/index.mjs.map +2 -2
- package/build-module/icon/variations.mjs +13 -0
- package/build-module/icon/variations.mjs.map +7 -0
- package/build-module/image/block.json +1 -0
- package/build-module/image/edit.mjs +4 -3
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs +96 -27
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/index.mjs +1 -1
- package/build-module/image/index.mjs.map +2 -2
- package/build-module/image/transforms.mjs +9 -3
- package/build-module/image/transforms.mjs.map +2 -2
- package/build-module/index.mjs +1 -3
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs +1 -1
- package/build-module/latest-posts/edit.mjs.map +1 -1
- package/build-module/math/edit.mjs +1 -1
- package/build-module/math/index.mjs +1 -1
- package/build-module/math/index.mjs.map +1 -1
- package/build-module/media-text/constants.mjs +1 -1
- package/build-module/media-text/constants.mjs.map +2 -2
- package/build-module/media-text/index.mjs +1 -1
- package/build-module/media-text/index.mjs.map +2 -2
- package/build-module/missing/edit.mjs +2 -2
- package/build-module/missing/edit.mjs.map +1 -1
- package/build-module/navigation/edit/index.mjs +14 -8
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/navigation-menu-selector.mjs +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.mjs.map +2 -2
- package/build-module/navigation/edit/placeholder/index.mjs +1 -1
- package/build-module/navigation/edit/placeholder/index.mjs.map +2 -2
- package/build-module/navigation-link/edit.mjs +1 -1
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-submenu/block.json +7 -0
- package/build-module/navigation-submenu/edit.mjs +1 -1
- package/build-module/navigation-submenu/edit.mjs.map +2 -2
- package/build-module/page-list/block.json +2 -5
- package/build-module/page-list/edit.mjs +1 -11
- package/build-module/page-list/edit.mjs.map +2 -2
- package/build-module/post-author/edit.mjs +1 -1
- package/build-module/post-author/edit.mjs.map +2 -2
- package/build-module/post-author/utils.mjs +1 -1
- package/build-module/post-author/utils.mjs.map +2 -2
- package/build-module/post-date/edit.mjs +2 -2
- package/build-module/post-date/edit.mjs.map +2 -2
- package/build-module/post-excerpt/edit.mjs +2 -2
- package/build-module/post-excerpt/edit.mjs.map +2 -2
- package/build-module/post-featured-image/block.json +1 -0
- package/build-module/post-featured-image/dimension-controls.mjs +99 -187
- package/build-module/post-featured-image/dimension-controls.mjs.map +2 -2
- package/build-module/post-featured-image/edit.mjs +47 -17
- package/build-module/post-featured-image/edit.mjs.map +2 -2
- package/build-module/post-navigation-link/edit.mjs +2 -2
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-time-to-read/edit.mjs +1 -1
- package/build-module/post-time-to-read/edit.mjs.map +1 -1
- package/build-module/preformatted/edit.mjs +1 -1
- package/build-module/preformatted/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +1 -3
- package/build-module/pullquote/deprecated.mjs +114 -9
- package/build-module/pullquote/deprecated.mjs.map +2 -2
- package/build-module/pullquote/edit.mjs +44 -67
- package/build-module/pullquote/edit.mjs.map +2 -2
- package/build-module/pullquote/save.mjs +5 -16
- package/build-module/pullquote/save.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.mjs +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.mjs.map +1 -1
- package/build-module/query/edit/inspector-controls/order-control.mjs +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/query/utils.mjs +2 -2
- package/build-module/query/utils.mjs.map +2 -2
- package/build-module/query-pagination-next/edit.mjs +2 -2
- package/build-module/query-pagination-next/edit.mjs.map +1 -1
- package/build-module/query-pagination-previous/edit.mjs +2 -2
- package/build-module/query-pagination-previous/edit.mjs.map +1 -1
- package/build-module/query-title/edit.mjs +1 -1
- package/build-module/query-title/edit.mjs.map +2 -2
- package/build-module/query-total/edit.mjs +1 -1
- package/build-module/query-total/edit.mjs.map +2 -2
- package/build-module/quote/index.mjs +1 -1
- package/build-module/quote/index.mjs.map +2 -2
- package/build-module/read-more/edit.mjs +1 -1
- package/build-module/read-more/edit.mjs.map +2 -2
- package/build-module/rss/edit.mjs +1 -1
- package/build-module/rss/edit.mjs.map +2 -2
- package/build-module/search/edit.mjs +3 -3
- package/build-module/search/edit.mjs.map +2 -2
- package/build-module/shortcode/edit.mjs +1 -1
- package/build-module/shortcode/edit.mjs.map +2 -2
- package/build-module/site-tagline/edit.mjs +1 -1
- package/build-module/site-tagline/edit.mjs.map +2 -2
- package/build-module/site-title/edit.mjs +1 -1
- package/build-module/site-title/edit.mjs.map +2 -2
- package/build-module/tab-list/block.json +34 -21
- package/build-module/tab-list/edit.mjs +122 -15
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-list/save.mjs +29 -4
- package/build-module/tab-list/save.mjs.map +2 -2
- package/build-module/tab-panel/add-tab-toolbar-control.mjs +19 -8
- package/build-module/tab-panel/add-tab-toolbar-control.mjs.map +2 -2
- package/build-module/tab-panel/block.json +2 -6
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs +9 -14
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs.map +2 -2
- package/build-module/tab-panels/block.json +2 -27
- package/build-module/table/index.mjs +1 -1
- package/build-module/table/index.mjs.map +2 -2
- package/build-module/tabs/block.json +3 -17
- package/build-module/tabs/edit.mjs +7 -21
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/index.mjs +6 -10
- package/build-module/tabs/index.mjs.map +2 -2
- package/build-module/tabs/use-tab-list-items-sync.mjs +32 -0
- package/build-module/tabs/use-tab-list-items-sync.mjs.map +7 -0
- package/build-module/tabs/view.mjs +2 -10
- package/build-module/tabs/view.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs +2 -2
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/utils/style-state.mjs +132 -0
- package/build-module/utils/style-state.mjs.map +7 -0
- package/build-module/utils/waveform-player.mjs +1 -1
- package/build-module/verse/edit.mjs +1 -1
- package/build-module/verse/edit.mjs.map +2 -2
- package/build-style/editor-rtl.css +12 -16
- package/build-style/editor.css +12 -16
- package/build-style/icon/style-rtl.css +9 -0
- package/build-style/icon/style.css +9 -0
- package/build-style/style-rtl.css +11 -24
- package/build-style/style.css +11 -24
- package/build-style/tab-list/editor-rtl.css +12 -4
- package/build-style/tab-list/editor.css +12 -4
- package/build-style/{tab → tab-list}/style-rtl.css +2 -2
- package/build-style/{tab → tab-list}/style.css +2 -2
- package/build-style/tab-panel/style-rtl.css +0 -17
- package/build-style/tab-panel/style.css +0 -17
- package/package.json +48 -45
- package/src/avatar/index.php +2 -2
- package/src/block/index.php +2 -26
- package/src/comment-author-avatar/index.php +3 -3
- package/src/comment-author-name/index.php +1 -1
- package/src/comment-date/index.php +1 -1
- package/src/cover/edit/block-controls.js +14 -2
- package/src/cover/edit/index.js +86 -0
- package/src/cover/edit/inspector-controls.js +124 -54
- package/src/editor.scss +0 -1
- package/src/file/edit.js +3 -16
- package/src/file/index.js +2 -0
- package/src/file/transforms.js +12 -31
- package/src/file/variations.js +17 -0
- package/src/gallery/edit.js +13 -13
- package/src/icon/README.md +3 -0
- package/src/icon/block.json +12 -0
- package/src/icon/edit.js +86 -36
- package/src/icon/index.js +3 -1
- package/src/icon/index.php +23 -0
- package/src/icon/style.scss +12 -0
- package/src/icon/variations.js +9 -0
- package/src/image/README.md +1 -0
- package/src/image/block.json +1 -0
- package/src/image/edit.js +8 -3
- package/src/image/image.js +120 -54
- package/src/image/index.php +0 -1
- package/src/image/transforms.js +34 -8
- package/src/index.js +4 -11
- package/src/navigation/edit/index.js +23 -10
- package/src/navigation/index.php +58 -0
- package/src/navigation-submenu/README.md +5 -0
- package/src/navigation-submenu/block.json +7 -0
- package/src/page-list/README.md +1 -1
- package/src/page-list/block.json +2 -5
- package/src/page-list/edit.js +0 -11
- package/src/page-list/index.php +1 -1
- package/src/post-date/edit.js +2 -2
- package/src/post-featured-image/README.md +1 -0
- package/src/post-featured-image/block.json +1 -0
- package/src/post-featured-image/dimension-controls.js +105 -184
- package/src/post-featured-image/edit.js +53 -21
- package/src/post-featured-image/index.php +24 -22
- package/src/pullquote/README.md +1 -1
- package/src/pullquote/block.json +1 -3
- package/src/pullquote/deprecated.js +121 -9
- package/src/pullquote/edit.js +7 -31
- package/src/pullquote/save.js +2 -13
- package/src/search/index.php +1 -1
- package/src/style.scss +1 -2
- package/src/tab-list/README.md +19 -17
- package/src/tab-list/block.json +34 -21
- package/src/tab-list/edit.js +147 -15
- package/src/tab-list/editor.scss +13 -6
- package/src/tab-list/index.php +23 -30
- package/src/tab-list/save.js +39 -4
- package/src/{tab → tab-list}/style.scss +1 -1
- package/src/tab-panel/README.md +0 -3
- package/src/tab-panel/add-tab-toolbar-control.js +24 -11
- package/src/tab-panel/block.json +2 -6
- package/src/tab-panel/remove-tab-toolbar-control.js +10 -14
- package/src/tab-panel/style.scss +0 -17
- package/src/tab-panels/README.md +0 -16
- package/src/tab-panels/block.json +2 -27
- package/src/tabs/README.md +1 -7
- package/src/tabs/block.json +3 -17
- package/src/tabs/edit.js +8 -19
- package/src/tabs/index.js +6 -10
- package/src/tabs/index.php +0 -13
- package/src/tabs/use-tab-list-items-sync.js +49 -0
- package/src/tabs/view.js +2 -10
- package/src/utils/style-state.js +151 -0
- package/src/utils/test/style-state.js +307 -0
- package/babel-plugin.cjs +0 -150
- package/build/tab/block.json +0 -56
- package/build/tab/controls.cjs +0 -46
- package/build/tab/controls.cjs.map +0 -7
- package/build/tab/edit.cjs +0 -135
- package/build/tab/edit.cjs.map +0 -7
- package/build/tab/index.cjs +0 -58
- package/build/tab/index.cjs.map +0 -7
- package/build/tab/save.cjs.map +0 -7
- package/build/tabs/use-tab-list-sync.cjs +0 -190
- package/build/tabs/use-tab-list-sync.cjs.map +0 -7
- package/build-module/tab/block.json +0 -56
- package/build-module/tab/controls.mjs +0 -15
- package/build-module/tab/controls.mjs.map +0 -7
- package/build-module/tab/edit.mjs +0 -108
- package/build-module/tab/edit.mjs.map +0 -7
- package/build-module/tab/index.mjs +0 -20
- package/build-module/tab/index.mjs.map +0 -7
- package/build-module/tab/save.mjs +0 -14
- package/build-module/tab/save.mjs.map +0 -7
- package/build-module/tabs/use-tab-list-sync.mjs +0 -169
- package/build-module/tabs/use-tab-list-sync.mjs.map +0 -7
- package/build-style/tab/editor-rtl.css +0 -11
- package/build-style/tab/editor.css +0 -11
- package/build-style/tab-panels/style-rtl.css +0 -4
- package/build-style/tab-panels/style.css +0 -4
- package/src/tab/README.md +0 -69
- package/src/tab/block.json +0 -56
- package/src/tab/controls.js +0 -19
- package/src/tab/edit.js +0 -141
- package/src/tab/editor.scss +0 -14
- package/src/tab/index.js +0 -24
- package/src/tab/index.php +0 -70
- package/src/tab/save.js +0 -13
- package/src/tab-panels/style.scss +0 -4
- package/src/tabs/use-tab-list-sync.js +0 -237
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.1-next.v.202606191442.0+17fe7db8a",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
"build-module",
|
|
29
29
|
"build-style",
|
|
30
30
|
"build-types",
|
|
31
|
-
"*.md"
|
|
32
|
-
"babel-plugin.cjs"
|
|
31
|
+
"*.md"
|
|
33
32
|
],
|
|
34
33
|
"main": "build/index.cjs",
|
|
35
34
|
"module": "build-module/index.mjs",
|
|
@@ -38,7 +37,6 @@
|
|
|
38
37
|
"import": "./build-module/index.mjs",
|
|
39
38
|
"require": "./build/index.cjs"
|
|
40
39
|
},
|
|
41
|
-
"./babel-plugin": "./babel-plugin.cjs",
|
|
42
40
|
"./build-module/*": "./build-module/*",
|
|
43
41
|
"./build-style/*": "./build-style/*",
|
|
44
42
|
"./package.json": "./package.json"
|
|
@@ -94,45 +92,44 @@
|
|
|
94
92
|
],
|
|
95
93
|
"dependencies": {
|
|
96
94
|
"@arraypress/waveform-player": "^1.2.1",
|
|
97
|
-
"@
|
|
98
|
-
"@wordpress/
|
|
99
|
-
"@wordpress/
|
|
100
|
-
"@wordpress/
|
|
101
|
-
"@wordpress/
|
|
102
|
-
"@wordpress/
|
|
103
|
-
"@wordpress/
|
|
104
|
-
"@wordpress/
|
|
105
|
-
"@wordpress/
|
|
106
|
-
"@wordpress/
|
|
107
|
-
"@wordpress/
|
|
108
|
-
"@wordpress/
|
|
109
|
-
"@wordpress/
|
|
110
|
-
"@wordpress/
|
|
111
|
-
"@wordpress/
|
|
112
|
-
"@wordpress/
|
|
113
|
-
"@wordpress/
|
|
114
|
-
"@wordpress/
|
|
115
|
-
"@wordpress/
|
|
116
|
-
"@wordpress/
|
|
117
|
-
"@wordpress/
|
|
118
|
-
"@wordpress/interactivity": "^
|
|
119
|
-
"@wordpress/
|
|
120
|
-
"@wordpress/
|
|
121
|
-
"@wordpress/
|
|
122
|
-
"@wordpress/
|
|
123
|
-
"@wordpress/
|
|
124
|
-
"@wordpress/
|
|
125
|
-
"@wordpress/
|
|
126
|
-
"@wordpress/
|
|
127
|
-
"@wordpress/
|
|
128
|
-
"@wordpress/
|
|
129
|
-
"@wordpress/
|
|
130
|
-
"@wordpress/
|
|
131
|
-
"@wordpress/
|
|
132
|
-
"@wordpress/
|
|
133
|
-
"@wordpress/
|
|
134
|
-
"@wordpress/
|
|
135
|
-
"@wordpress/wordcount": "^4.48.1",
|
|
95
|
+
"@wordpress/a11y": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
96
|
+
"@wordpress/api-fetch": "^7.48.2-next.v.202606191442.0+17fe7db8a",
|
|
97
|
+
"@wordpress/autop": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
98
|
+
"@wordpress/base-styles": "^10.0.2-next.v.202606191442.0+17fe7db8a",
|
|
99
|
+
"@wordpress/blob": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
100
|
+
"@wordpress/block-editor": "^15.22.1-next.v.202606191442.0+17fe7db8a",
|
|
101
|
+
"@wordpress/blocks": "^15.21.3-next.v.202606191442.0+17fe7db8a",
|
|
102
|
+
"@wordpress/components": "^35.1.1-next.v.202606191442.0+17fe7db8a",
|
|
103
|
+
"@wordpress/compose": "^8.1.2-next.v.202606191442.0+17fe7db8a",
|
|
104
|
+
"@wordpress/core-data": "^7.48.2-next.v.202606191442.0+17fe7db8a",
|
|
105
|
+
"@wordpress/data": "^10.48.2-next.v.202606191442.0+17fe7db8a",
|
|
106
|
+
"@wordpress/date": "^5.48.2-next.v.202606191442.0+17fe7db8a",
|
|
107
|
+
"@wordpress/deprecated": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
108
|
+
"@wordpress/dom": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
109
|
+
"@wordpress/element": "^8.0.2-next.v.202606191442.0+17fe7db8a",
|
|
110
|
+
"@wordpress/escape-html": "^3.48.2-next.v.202606191442.0+17fe7db8a",
|
|
111
|
+
"@wordpress/hooks": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
112
|
+
"@wordpress/html-entities": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
113
|
+
"@wordpress/i18n": "^6.21.2-next.v.202606191442.0+17fe7db8a",
|
|
114
|
+
"@wordpress/icons": "^14.0.2-next.v.202606191442.0+17fe7db8a",
|
|
115
|
+
"@wordpress/interactivity": "^6.48.2-next.v.202606191442.0+17fe7db8a",
|
|
116
|
+
"@wordpress/interactivity-router": "^2.48.2-next.v.202606191442.0+17fe7db8a",
|
|
117
|
+
"@wordpress/keyboard-shortcuts": "^5.48.2-next.v.202606191442.0+17fe7db8a",
|
|
118
|
+
"@wordpress/keycodes": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
119
|
+
"@wordpress/latex-to-mathml": "^1.16.2-next.v.202606191442.0+17fe7db8a",
|
|
120
|
+
"@wordpress/notices": "^5.48.2-next.v.202606191442.0+17fe7db8a",
|
|
121
|
+
"@wordpress/patterns": "^2.48.2-next.v.202606191442.0+17fe7db8a",
|
|
122
|
+
"@wordpress/primitives": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
123
|
+
"@wordpress/private-apis": "^1.48.2-next.v.202606191442.0+17fe7db8a",
|
|
124
|
+
"@wordpress/reusable-blocks": "^5.48.2-next.v.202606191442.0+17fe7db8a",
|
|
125
|
+
"@wordpress/rich-text": "^7.48.2-next.v.202606191442.0+17fe7db8a",
|
|
126
|
+
"@wordpress/server-side-render": "^6.24.2-next.v.202606191442.0+17fe7db8a",
|
|
127
|
+
"@wordpress/shortcode": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
128
|
+
"@wordpress/ui": "^0.16.1-next.v.202606191442.0+17fe7db8a",
|
|
129
|
+
"@wordpress/upload-media": "^0.34.1-next.v.202606191442.0+17fe7db8a",
|
|
130
|
+
"@wordpress/url": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
131
|
+
"@wordpress/viewport": "^6.48.2-next.v.202606191442.0+17fe7db8a",
|
|
132
|
+
"@wordpress/wordcount": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
136
133
|
"change-case": "^4.1.2",
|
|
137
134
|
"clsx": "^2.1.1",
|
|
138
135
|
"colord": "^2.9.3",
|
|
@@ -144,18 +141,24 @@
|
|
|
144
141
|
"uuid": "^14.0.0"
|
|
145
142
|
},
|
|
146
143
|
"devDependencies": {
|
|
147
|
-
"@babel/core": "^7.25.7",
|
|
148
144
|
"@testing-library/dom": "^10.4.1",
|
|
149
145
|
"@testing-library/react": "^16.3.2",
|
|
150
146
|
"@testing-library/user-event": "^14.6.1",
|
|
147
|
+
"@wordpress/stylelint-tools": "file:../../tools/stylelint",
|
|
151
148
|
"deep-freeze": "^0.0.1"
|
|
152
149
|
},
|
|
153
150
|
"peerDependencies": {
|
|
151
|
+
"@types/react": "^18.3.27",
|
|
154
152
|
"react": "^18.0.0",
|
|
155
153
|
"react-dom": "^18.0.0"
|
|
156
154
|
},
|
|
155
|
+
"peerDependenciesMeta": {
|
|
156
|
+
"@types/react": {
|
|
157
|
+
"optional": true
|
|
158
|
+
}
|
|
159
|
+
},
|
|
157
160
|
"publishConfig": {
|
|
158
161
|
"access": "public"
|
|
159
162
|
},
|
|
160
|
-
"gitHead": "
|
|
163
|
+
"gitHead": "1b6a19222df5a88f161880b5789efb3171d8f425"
|
|
161
164
|
}
|
package/src/avatar/index.php
CHANGED
|
@@ -67,7 +67,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
67
67
|
// translators: 1: Author archive link. 2: Link target. %3$s Aria label. %4$s Avatar image.
|
|
68
68
|
$avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', esc_url( get_author_posts_url( $author_id ) ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
|
|
69
69
|
}
|
|
70
|
-
return sprintf( '<div %
|
|
70
|
+
return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $avatar_block );
|
|
71
71
|
}
|
|
72
72
|
$comment = get_comment( $block->context['commentId'] );
|
|
73
73
|
if ( ! $comment ) {
|
|
@@ -93,7 +93,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
93
93
|
}
|
|
94
94
|
$avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', esc_url( $comment->comment_author_url ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
|
|
95
95
|
}
|
|
96
|
-
return sprintf( '<div %
|
|
96
|
+
return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $avatar_block );
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/**
|
package/src/block/index.php
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<?php
|
|
1
|
+
<?php
|
|
2
2
|
/**
|
|
3
3
|
* Server-side rendering of the `core/block` block.
|
|
4
4
|
*
|
|
@@ -83,31 +83,7 @@ function render_block_core_block( $attributes, $content, $block_instance ) {
|
|
|
83
83
|
*/
|
|
84
84
|
$block_instance->parsed_block['innerBlocks'] = parse_blocks( $content );
|
|
85
85
|
$block_instance->parsed_block['innerContent'] = array_fill( 0, count( $block_instance->parsed_block['innerBlocks'] ), null );
|
|
86
|
-
|
|
87
|
-
// WP_Block::refresh_context_dependents() was introduced in WordPress 6.8.
|
|
88
|
-
$block_instance->refresh_context_dependents();
|
|
89
|
-
} else {
|
|
90
|
-
// This branch can be removed once Gutenberg requires WordPress 6.8 or later.
|
|
91
|
-
if ( ! class_exists( 'WP_Block_Cloner' ) ) {
|
|
92
|
-
// phpcs:ignore Gutenberg.Commenting.SinceTag.MissingClassSinceTag
|
|
93
|
-
class WP_Block_Cloner extends WP_Block {
|
|
94
|
-
/**
|
|
95
|
-
* Static methods of subclasses have access to protected properties
|
|
96
|
-
* of instances of the parent class.
|
|
97
|
-
* In this case, this gives us access to `available_context` and `registry`.
|
|
98
|
-
*/
|
|
99
|
-
// phpcs:ignore Gutenberg.Commenting.SinceTag.MissingMethodSinceTag
|
|
100
|
-
public static function clone_instance( $instance ) {
|
|
101
|
-
return new WP_Block(
|
|
102
|
-
$instance->parsed_block,
|
|
103
|
-
$instance->available_context,
|
|
104
|
-
$instance->registry
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
$block_instance = WP_Block_Cloner::clone_instance( $block_instance );
|
|
110
|
-
}
|
|
86
|
+
$block_instance->refresh_context_dependents();
|
|
111
87
|
|
|
112
88
|
$content = $block_instance->render( array( 'dynamic' => false ) );
|
|
113
89
|
unset( $seen_refs[ $attributes['ref'] ] );
|
|
@@ -57,14 +57,14 @@ function render_block_core_comment_author_avatar( $attributes, $content, $block
|
|
|
57
57
|
array(
|
|
58
58
|
'height' => $height,
|
|
59
59
|
'width' => $width,
|
|
60
|
-
'extra_attr' => sprintf( 'style="%
|
|
60
|
+
'extra_attr' => sprintf( 'style="%s"', $styles ),
|
|
61
61
|
'class' => $classes,
|
|
62
62
|
)
|
|
63
63
|
);
|
|
64
64
|
if ( isset( $spacing_attributes ) ) {
|
|
65
|
-
return sprintf( '<div style="%
|
|
65
|
+
return sprintf( '<div style="%1$s">%2$s</div>', esc_attr( $spacing_string ), $avatar_block );
|
|
66
66
|
}
|
|
67
|
-
return sprintf( '<div>%
|
|
67
|
+
return sprintf( '<div>%s</div>', $avatar_block );
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
@@ -40,7 +40,7 @@ function render_block_core_comment_author_name( $attributes, $content, $block )
|
|
|
40
40
|
$link = get_comment_author_url( $comment );
|
|
41
41
|
|
|
42
42
|
if ( ! empty( $link ) && ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
|
|
43
|
-
$comment_author = sprintf( '<a rel="external nofollow ugc" href="%
|
|
43
|
+
$comment_author = sprintf( '<a rel="external nofollow ugc" href="%1$s" target="%2$s" >%3$s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
|
|
44
44
|
}
|
|
45
45
|
if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
|
|
46
46
|
$comment_author = wp_kses( $comment_author, array() );
|
|
@@ -37,7 +37,7 @@ function render_block_core_comment_date( $attributes, $content, $block ) {
|
|
|
37
37
|
$link = get_comment_link( $comment );
|
|
38
38
|
|
|
39
39
|
if ( ! empty( $attributes['isLink'] ) ) {
|
|
40
|
-
$formatted_date = sprintf( '<a href="%
|
|
40
|
+
$formatted_date = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $link ), $formatted_date );
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return sprintf(
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
privateApis as blockEditorPrivateApis,
|
|
12
12
|
} from '@wordpress/block-editor';
|
|
13
13
|
import { __ } from '@wordpress/i18n';
|
|
14
|
-
import { MenuItem } from '@wordpress/components';
|
|
15
|
-
import { link } from '@wordpress/icons';
|
|
14
|
+
import { MenuItem, ToolbarButton } from '@wordpress/components';
|
|
15
|
+
import { crop, link } from '@wordpress/icons';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Internal dependencies
|
|
@@ -31,6 +31,9 @@ export default function CoverBlockControls( {
|
|
|
31
31
|
toggleUseFeaturedImage,
|
|
32
32
|
onClearMedia,
|
|
33
33
|
onSelectEmbedUrl,
|
|
34
|
+
onEditMedia,
|
|
35
|
+
editMediaButtonRef,
|
|
36
|
+
showEditMediaButton,
|
|
34
37
|
blockEditingMode,
|
|
35
38
|
} ) {
|
|
36
39
|
const {
|
|
@@ -106,6 +109,15 @@ export default function CoverBlockControls( {
|
|
|
106
109
|
onToggle={ toggleMinFullHeight }
|
|
107
110
|
isDisabled={ ! hasInnerBlocks }
|
|
108
111
|
/>
|
|
112
|
+
{ showEditMediaButton && (
|
|
113
|
+
<ToolbarButton
|
|
114
|
+
ref={ editMediaButtonRef }
|
|
115
|
+
icon={ crop }
|
|
116
|
+
label={ __( 'Crop background image' ) }
|
|
117
|
+
onClick={ onEditMedia }
|
|
118
|
+
aria-haspopup="dialog"
|
|
119
|
+
/>
|
|
120
|
+
) }
|
|
109
121
|
</BlockControls>
|
|
110
122
|
) }
|
|
111
123
|
<BlockControls group="other">
|
package/src/cover/edit/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import { useEntityProp, store as coreStore } from '@wordpress/core-data';
|
|
10
10
|
import {
|
|
11
|
+
useCallback,
|
|
11
12
|
useEffect,
|
|
12
13
|
useLayoutEffect,
|
|
13
14
|
useMemo,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
__experimentalUseGradient,
|
|
25
26
|
store as blockEditorStore,
|
|
26
27
|
useBlockEditingMode,
|
|
28
|
+
privateApis as blockEditorPrivateApis,
|
|
27
29
|
} from '@wordpress/block-editor';
|
|
28
30
|
import { __ } from '@wordpress/i18n';
|
|
29
31
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
@@ -55,6 +57,9 @@ import {
|
|
|
55
57
|
} from './color-utils';
|
|
56
58
|
import { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';
|
|
57
59
|
import { getBackgroundEmbedHtml } from '../embed-video-utils';
|
|
60
|
+
import { unlock } from '../../lock-unlock';
|
|
61
|
+
|
|
62
|
+
const { openMediaEditorModalKey } = unlock( blockEditorPrivateApis );
|
|
58
63
|
|
|
59
64
|
function getInnerBlocksTemplate( attributes ) {
|
|
60
65
|
return [
|
|
@@ -123,6 +128,11 @@ function CoverEdit( {
|
|
|
123
128
|
postId
|
|
124
129
|
);
|
|
125
130
|
const { getSettings } = useSelect( blockEditorStore );
|
|
131
|
+
const openMediaEditorModal = useSelect(
|
|
132
|
+
( select ) =>
|
|
133
|
+
select( blockEditorStore ).getSettings()[ openMediaEditorModalKey ],
|
|
134
|
+
[]
|
|
135
|
+
);
|
|
126
136
|
|
|
127
137
|
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
128
138
|
useDispatch( blockEditorStore );
|
|
@@ -490,6 +500,7 @@ function CoverEdit( {
|
|
|
490
500
|
);
|
|
491
501
|
|
|
492
502
|
const mediaElement = useRef();
|
|
503
|
+
const editMediaButtonRef = useRef();
|
|
493
504
|
const currentSettings = {
|
|
494
505
|
isVideoBackground,
|
|
495
506
|
isImageBackground,
|
|
@@ -500,6 +511,78 @@ function CoverEdit( {
|
|
|
500
511
|
overlayColor,
|
|
501
512
|
};
|
|
502
513
|
|
|
514
|
+
const openCoverMediaEditorModal = useCallback( () => {
|
|
515
|
+
if ( ! id || ! openMediaEditorModal ) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
openMediaEditorModal( {
|
|
520
|
+
id,
|
|
521
|
+
onClose: () => {
|
|
522
|
+
editMediaButtonRef.current?.focus();
|
|
523
|
+
},
|
|
524
|
+
onUpdate: async ( { id: newId, url: newUrl } ) => {
|
|
525
|
+
if ( typeof newId !== 'number' ) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
const nextAttributes = {
|
|
530
|
+
id: newId,
|
|
531
|
+
backgroundType: IMAGE_BACKGROUND_TYPE,
|
|
532
|
+
...( newUrl ? { url: newUrl } : {} ),
|
|
533
|
+
...( newId !== id
|
|
534
|
+
? { sizeSlug: DEFAULT_MEDIA_SIZE_SLUG }
|
|
535
|
+
: {} ),
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
if ( newUrl ) {
|
|
539
|
+
const averageBackgroundColor =
|
|
540
|
+
await getMediaColor( newUrl );
|
|
541
|
+
|
|
542
|
+
// Read latest values after await to avoid stale closures.
|
|
543
|
+
const {
|
|
544
|
+
attributes: currentAttrs,
|
|
545
|
+
overlayColor: currentOverlay,
|
|
546
|
+
} = propsRef.current;
|
|
547
|
+
|
|
548
|
+
let newOverlayColor = currentOverlay.color;
|
|
549
|
+
if ( ! currentAttrs.isUserOverlayColor ) {
|
|
550
|
+
newOverlayColor = averageBackgroundColor;
|
|
551
|
+
setOverlayColor( newOverlayColor );
|
|
552
|
+
|
|
553
|
+
// Make undo revert the next setAttributes and the previous setOverlayColor.
|
|
554
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
nextAttributes.isDark = compositeIsDark(
|
|
558
|
+
currentAttrs.dimRatio,
|
|
559
|
+
newOverlayColor,
|
|
560
|
+
averageBackgroundColor
|
|
561
|
+
);
|
|
562
|
+
nextAttributes.isUserOverlayColor =
|
|
563
|
+
currentAttrs.isUserOverlayColor || false;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
setAttributes( nextAttributes );
|
|
567
|
+
},
|
|
568
|
+
} );
|
|
569
|
+
}, [
|
|
570
|
+
id,
|
|
571
|
+
openMediaEditorModal,
|
|
572
|
+
setAttributes,
|
|
573
|
+
setOverlayColor,
|
|
574
|
+
__unstableMarkNextChangeAsNotPersistent,
|
|
575
|
+
] );
|
|
576
|
+
|
|
577
|
+
const showEditMediaButton =
|
|
578
|
+
hasNonContentControls &&
|
|
579
|
+
! useFeaturedImage &&
|
|
580
|
+
isImageBackground &&
|
|
581
|
+
!! id &&
|
|
582
|
+
!! url &&
|
|
583
|
+
! isUploadingMedia &&
|
|
584
|
+
!! openMediaEditorModal;
|
|
585
|
+
|
|
503
586
|
const toggleUseFeaturedImage = async () => {
|
|
504
587
|
const newUseFeaturedImage = ! useFeaturedImage;
|
|
505
588
|
|
|
@@ -556,6 +639,9 @@ function CoverEdit( {
|
|
|
556
639
|
toggleUseFeaturedImage={ toggleUseFeaturedImage }
|
|
557
640
|
onClearMedia={ onClearMedia }
|
|
558
641
|
blockEditingMode={ blockEditingMode }
|
|
642
|
+
onEditMedia={ openCoverMediaEditorModal }
|
|
643
|
+
editMediaButtonRef={ editMediaButtonRef }
|
|
644
|
+
showEditMediaButton={ showEditMediaButton }
|
|
559
645
|
/>
|
|
560
646
|
);
|
|
561
647
|
|
|
@@ -34,12 +34,21 @@ import { Link } from '@wordpress/ui';
|
|
|
34
34
|
import { COVER_MIN_HEIGHT, mediaPosition } from '../shared';
|
|
35
35
|
import { unlock } from '../../lock-unlock';
|
|
36
36
|
import { useToolsPanelDropdownMenuProps } from '../../utils/hooks';
|
|
37
|
+
import {
|
|
38
|
+
getActiveDimensionValue,
|
|
39
|
+
getDimensionResetAttributes,
|
|
40
|
+
getDimensionUpdateAttributes,
|
|
41
|
+
getStyleStateKey,
|
|
42
|
+
} from '../../utils/style-state';
|
|
37
43
|
import { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';
|
|
38
44
|
import PosterImage from '../../utils/poster-image';
|
|
39
45
|
|
|
40
|
-
const {
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
const {
|
|
47
|
+
cleanEmptyObject,
|
|
48
|
+
isDefaultBlockStyleState,
|
|
49
|
+
ResolutionTool,
|
|
50
|
+
HTMLElementControl,
|
|
51
|
+
} = unlock( blockEditorPrivateApis );
|
|
43
52
|
|
|
44
53
|
function CoverHeightInput( {
|
|
45
54
|
onChange,
|
|
@@ -124,20 +133,45 @@ export default function CoverInspectorControls( {
|
|
|
124
133
|
const sizeSlug = attributes.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
|
|
125
134
|
|
|
126
135
|
const { gradientValue, setGradient } = __experimentalUseGradient();
|
|
127
|
-
const { imageSizes,
|
|
136
|
+
const { imageSizes, selectedStyleState } = useSelect(
|
|
128
137
|
( select ) => {
|
|
129
|
-
const {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
} = unlock( select( blockEditorStore ) );
|
|
138
|
+
const { getSettings, getSelectedBlockStyleState } = unlock(
|
|
139
|
+
select( blockEditorStore )
|
|
140
|
+
);
|
|
133
141
|
|
|
134
142
|
return {
|
|
135
143
|
imageSizes: getSettings()?.imageSizes,
|
|
136
|
-
|
|
144
|
+
selectedStyleState: getSelectedBlockStyleState( clientId ),
|
|
137
145
|
};
|
|
138
146
|
},
|
|
139
147
|
[ clientId ]
|
|
140
148
|
);
|
|
149
|
+
const hasSelectedStyleState =
|
|
150
|
+
! isDefaultBlockStyleState( selectedStyleState );
|
|
151
|
+
const selectedStyleStateKey = getStyleStateKey( selectedStyleState );
|
|
152
|
+
const stateMinHeight = getActiveDimensionValue( {
|
|
153
|
+
attributes,
|
|
154
|
+
selectedState: selectedStyleState,
|
|
155
|
+
hasSelectedStyleState,
|
|
156
|
+
attributeKey: 'minHeight',
|
|
157
|
+
styleKey: 'minHeight',
|
|
158
|
+
rootValue: undefined,
|
|
159
|
+
} );
|
|
160
|
+
const [ stateMinHeightValue, stateMinHeightUnit ] =
|
|
161
|
+
parseQuantityAndUnitFromRawValue( stateMinHeight || '' );
|
|
162
|
+
const activeMinHeight = hasSelectedStyleState
|
|
163
|
+
? stateMinHeightValue
|
|
164
|
+
: minHeight;
|
|
165
|
+
const activeMinHeightUnit = hasSelectedStyleState
|
|
166
|
+
? stateMinHeightUnit || minHeightUnit
|
|
167
|
+
: minHeightUnit;
|
|
168
|
+
const activeAspectRatio = getActiveDimensionValue( {
|
|
169
|
+
attributes,
|
|
170
|
+
selectedState: selectedStyleState,
|
|
171
|
+
hasSelectedStyleState,
|
|
172
|
+
attributeKey: 'aspectRatio',
|
|
173
|
+
rootValue: attributes?.style?.dimensions?.aspectRatio,
|
|
174
|
+
} );
|
|
141
175
|
|
|
142
176
|
const image = useSelect(
|
|
143
177
|
( select ) =>
|
|
@@ -203,6 +237,52 @@ export default function CoverInspectorControls( {
|
|
|
203
237
|
const showOverlayControls =
|
|
204
238
|
colorGradientSettings.hasColorsOrGradients && ! hasSelectedStyleState;
|
|
205
239
|
|
|
240
|
+
const setMinHeightAttributes = ( nextMinHeight, nextUnit ) => {
|
|
241
|
+
if ( hasSelectedStyleState ) {
|
|
242
|
+
setAttributes(
|
|
243
|
+
getDimensionUpdateAttributes( {
|
|
244
|
+
style: attributes.style,
|
|
245
|
+
selectedState: selectedStyleState,
|
|
246
|
+
hasSelectedStyleState,
|
|
247
|
+
nextDimensions: {
|
|
248
|
+
minHeight:
|
|
249
|
+
nextMinHeight === undefined
|
|
250
|
+
? undefined
|
|
251
|
+
: `${ nextMinHeight }${
|
|
252
|
+
nextUnit || activeMinHeightUnit || 'px'
|
|
253
|
+
}`,
|
|
254
|
+
aspectRatio: undefined,
|
|
255
|
+
},
|
|
256
|
+
} )
|
|
257
|
+
);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
setAttributes( {
|
|
262
|
+
minHeight: nextMinHeight,
|
|
263
|
+
style: cleanEmptyObject( {
|
|
264
|
+
...attributes?.style,
|
|
265
|
+
dimensions: {
|
|
266
|
+
...attributes?.style?.dimensions,
|
|
267
|
+
aspectRatio: undefined, // Reset aspect ratio when minHeight is set.
|
|
268
|
+
},
|
|
269
|
+
} ),
|
|
270
|
+
} );
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const getResetMinHeightAttributes = ( attrs = attributes ) => {
|
|
274
|
+
return getDimensionResetAttributes( {
|
|
275
|
+
style: attrs.style,
|
|
276
|
+
selectedState: selectedStyleState,
|
|
277
|
+
hasSelectedStyleState,
|
|
278
|
+
keys: [ 'minHeight' ],
|
|
279
|
+
defaultAttributes: {
|
|
280
|
+
minHeight: undefined,
|
|
281
|
+
minHeightUnit: undefined,
|
|
282
|
+
},
|
|
283
|
+
} );
|
|
284
|
+
};
|
|
285
|
+
|
|
206
286
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
207
287
|
|
|
208
288
|
return (
|
|
@@ -401,53 +481,43 @@ export default function CoverInspectorControls( {
|
|
|
401
481
|
</ToolsPanelItem>
|
|
402
482
|
</InspectorControls>
|
|
403
483
|
) }
|
|
404
|
-
|
|
405
|
-
<
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
484
|
+
<InspectorControls group="dimensions">
|
|
485
|
+
<ToolsPanelItem
|
|
486
|
+
key={ selectedStyleStateKey }
|
|
487
|
+
className="single-column"
|
|
488
|
+
hasValue={ () => !! activeMinHeight }
|
|
489
|
+
label={ __( 'Minimum height' ) }
|
|
490
|
+
onDeselect={ () =>
|
|
491
|
+
setAttributes( getResetMinHeightAttributes() )
|
|
492
|
+
}
|
|
493
|
+
resetAllFilter={ getResetMinHeightAttributes }
|
|
494
|
+
isShownByDefault
|
|
495
|
+
panelId={ clientId }
|
|
496
|
+
>
|
|
497
|
+
<CoverHeightInput
|
|
498
|
+
value={ activeAspectRatio ? '' : activeMinHeight }
|
|
499
|
+
unit={ activeMinHeightUnit }
|
|
500
|
+
onChange={ ( newMinHeight ) =>
|
|
501
|
+
setMinHeightAttributes( newMinHeight )
|
|
415
502
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
attributes?.style?.dimensions?.aspectRatio
|
|
426
|
-
? ''
|
|
427
|
-
: minHeight
|
|
428
|
-
}
|
|
429
|
-
unit={ minHeightUnit }
|
|
430
|
-
onChange={ ( newMinHeight ) =>
|
|
431
|
-
setAttributes( {
|
|
432
|
-
minHeight: newMinHeight,
|
|
433
|
-
style: cleanEmptyObject( {
|
|
434
|
-
...attributes?.style,
|
|
435
|
-
dimensions: {
|
|
436
|
-
...attributes?.style?.dimensions,
|
|
437
|
-
aspectRatio: undefined, // Reset aspect ratio when minHeight is set.
|
|
438
|
-
},
|
|
439
|
-
} ),
|
|
440
|
-
} )
|
|
441
|
-
}
|
|
442
|
-
onUnitChange={ ( nextUnit ) =>
|
|
443
|
-
setAttributes( {
|
|
444
|
-
minHeightUnit: nextUnit,
|
|
445
|
-
} )
|
|
503
|
+
onUnitChange={ ( nextUnit ) => {
|
|
504
|
+
if ( hasSelectedStyleState ) {
|
|
505
|
+
if ( activeMinHeight !== undefined ) {
|
|
506
|
+
setMinHeightAttributes(
|
|
507
|
+
activeMinHeight,
|
|
508
|
+
nextUnit
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
return;
|
|
446
512
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
513
|
+
|
|
514
|
+
setAttributes( {
|
|
515
|
+
minHeightUnit: nextUnit,
|
|
516
|
+
} );
|
|
517
|
+
} }
|
|
518
|
+
/>
|
|
519
|
+
</ToolsPanelItem>
|
|
520
|
+
</InspectorControls>
|
|
451
521
|
<InspectorControls group="advanced">
|
|
452
522
|
<HTMLElementControl
|
|
453
523
|
tagName={ tagName }
|
package/src/editor.scss
CHANGED
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
@use "./spacer/editor.scss" as *;
|
|
51
51
|
@use "./table/editor.scss" as *;
|
|
52
52
|
@use "./tab-list/editor.scss" as *;
|
|
53
|
-
@use "./tab/editor.scss" as *;
|
|
54
53
|
@use "./template-part/editor.scss" as *;
|
|
55
54
|
@use "./term-template/editor.scss" as *;
|
|
56
55
|
@use "./text-columns/editor.scss" as *;
|