@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
|
@@ -2,207 +2,128 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __, _x } from '@wordpress/i18n';
|
|
5
|
+
import { __experimentalUseCustomUnits as useCustomUnits } from '@wordpress/components';
|
|
5
6
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
10
|
-
__experimentalUseCustomUnits as useCustomUnits,
|
|
11
|
-
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
12
|
-
} from '@wordpress/components';
|
|
13
|
-
import { useSettings } from '@wordpress/block-editor';
|
|
7
|
+
privateApis as blockEditorPrivateApis,
|
|
8
|
+
useSettings,
|
|
9
|
+
} from '@wordpress/block-editor';
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
) }
|
|
27
|
-
/>
|
|
28
|
-
<ToggleGroupControlOption
|
|
29
|
-
value="fill"
|
|
30
|
-
label={ _x( 'Fill', 'Scale option for Image dimension control' ) }
|
|
31
|
-
/>
|
|
32
|
-
</>
|
|
33
|
-
);
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import {
|
|
15
|
+
getActiveDimensionValue,
|
|
16
|
+
getDimensionUpdateAttributes,
|
|
17
|
+
getStyleStateKey,
|
|
18
|
+
} from '../utils/style-state';
|
|
19
|
+
import { unlock } from '../lock-unlock';
|
|
20
|
+
|
|
21
|
+
const { DimensionsTool } = unlock( blockEditorPrivateApis );
|
|
34
22
|
|
|
35
23
|
const DEFAULT_SCALE = 'cover';
|
|
24
|
+
const DIMENSION_KEYS = [ 'aspectRatio', 'width', 'height', 'scale' ];
|
|
36
25
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
const scaleOptions = [
|
|
27
|
+
{
|
|
28
|
+
value: 'cover',
|
|
29
|
+
label: _x( 'Cover', 'Scale option for Image dimension control' ),
|
|
30
|
+
help: __(
|
|
31
|
+
'Image is scaled and cropped to fill the entire space without being distorted.'
|
|
32
|
+
),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: 'contain',
|
|
36
|
+
label: _x( 'Contain', 'Scale option for Image dimension control' ),
|
|
37
|
+
help: __(
|
|
38
|
+
'Image is scaled to fill the space without clipping nor distorting.'
|
|
39
|
+
),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: 'fill',
|
|
43
|
+
label: _x( 'Fill', 'Scale option for Image dimension control' ),
|
|
44
|
+
help: __(
|
|
45
|
+
'Image will be stretched and distorted to completely fill the space.'
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
];
|
|
48
49
|
|
|
49
50
|
const DimensionControls = ( {
|
|
50
51
|
clientId,
|
|
51
|
-
attributes
|
|
52
|
+
attributes,
|
|
52
53
|
setAttributes,
|
|
54
|
+
selectedStyleState,
|
|
55
|
+
hasSelectedStyleState = false,
|
|
53
56
|
} ) => {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
const { style } = attributes;
|
|
58
|
+
const selectedStyleStateKey = getStyleStateKey( selectedStyleState );
|
|
59
|
+
const activeAspectRatio = getActiveDimensionValue( {
|
|
60
|
+
attributes,
|
|
61
|
+
selectedState: selectedStyleState,
|
|
62
|
+
hasSelectedStyleState,
|
|
63
|
+
attributeKey: 'aspectRatio',
|
|
64
|
+
} );
|
|
65
|
+
const activeWidth = getActiveDimensionValue( {
|
|
66
|
+
attributes,
|
|
67
|
+
selectedState: selectedStyleState,
|
|
68
|
+
hasSelectedStyleState,
|
|
69
|
+
attributeKey: 'width',
|
|
70
|
+
} );
|
|
71
|
+
const activeHeight = getActiveDimensionValue( {
|
|
72
|
+
attributes,
|
|
73
|
+
selectedState: selectedStyleState,
|
|
74
|
+
hasSelectedStyleState,
|
|
75
|
+
attributeKey: 'height',
|
|
76
|
+
} );
|
|
77
|
+
const activeScale = getActiveDimensionValue( {
|
|
78
|
+
attributes,
|
|
79
|
+
selectedState: selectedStyleState,
|
|
80
|
+
hasSelectedStyleState,
|
|
81
|
+
attributeKey: 'scale',
|
|
82
|
+
styleKey: 'objectFit',
|
|
83
|
+
} );
|
|
84
|
+
|
|
85
|
+
const [ availableUnits ] = useSettings( 'spacing.units' );
|
|
61
86
|
const units = useCustomUnits( {
|
|
62
87
|
availableUnits: availableUnits || [ 'px', '%', 'vw', 'em', 'rem' ],
|
|
63
88
|
} );
|
|
64
89
|
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
setAttributes( {
|
|
76
|
-
[ dimension ]: parsedValue < 0 ? '0' : nextValue,
|
|
77
|
-
} );
|
|
78
|
-
};
|
|
79
|
-
const scaleLabel = _x( 'Scale', 'Image scaling options' );
|
|
80
|
-
|
|
81
|
-
const showScaleControl =
|
|
82
|
-
height || ( aspectRatio && aspectRatio !== 'auto' );
|
|
90
|
+
const setDimensionAttributes = ( nextDimensions ) => {
|
|
91
|
+
const nextImageDimensions = {
|
|
92
|
+
...nextDimensions,
|
|
93
|
+
width:
|
|
94
|
+
! nextDimensions.width && nextDimensions.height
|
|
95
|
+
? 'auto'
|
|
96
|
+
: nextDimensions.width,
|
|
97
|
+
};
|
|
83
98
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
label: _x(
|
|
97
|
-
'Original',
|
|
98
|
-
'Aspect ratio option for dimensions control'
|
|
99
|
-
),
|
|
100
|
-
value: 'auto',
|
|
101
|
-
},
|
|
102
|
-
...( showDefaultRatios ? defaultOptions : [] ),
|
|
103
|
-
...( themeOptions ? themeOptions : [] ),
|
|
104
|
-
];
|
|
99
|
+
setAttributes(
|
|
100
|
+
getDimensionUpdateAttributes( {
|
|
101
|
+
style,
|
|
102
|
+
selectedState: selectedStyleState,
|
|
103
|
+
hasSelectedStyleState,
|
|
104
|
+
nextDimensions: nextImageDimensions,
|
|
105
|
+
dimensionKeyMap: { scale: 'objectFit' },
|
|
106
|
+
dimensionKeys: DIMENSION_KEYS,
|
|
107
|
+
} )
|
|
108
|
+
);
|
|
109
|
+
};
|
|
105
110
|
|
|
106
111
|
return (
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
options={ aspectRatioOptions }
|
|
123
|
-
onChange={ ( nextAspectRatio ) =>
|
|
124
|
-
setAttributes( { aspectRatio: nextAspectRatio } )
|
|
125
|
-
}
|
|
126
|
-
/>
|
|
127
|
-
</ToolsPanelItem>
|
|
128
|
-
<ToolsPanelItem
|
|
129
|
-
className="single-column"
|
|
130
|
-
hasValue={ () => !! height }
|
|
131
|
-
label={ __( 'Height' ) }
|
|
132
|
-
onDeselect={ () => setAttributes( { height: undefined } ) }
|
|
133
|
-
resetAllFilter={ () => ( {
|
|
134
|
-
height: undefined,
|
|
135
|
-
} ) }
|
|
136
|
-
isShownByDefault
|
|
137
|
-
panelId={ clientId }
|
|
138
|
-
>
|
|
139
|
-
<UnitControl
|
|
140
|
-
__next40pxDefaultSize
|
|
141
|
-
label={ __( 'Height' ) }
|
|
142
|
-
labelPosition="top"
|
|
143
|
-
value={ height || '' }
|
|
144
|
-
min={ 0 }
|
|
145
|
-
onChange={ ( nextHeight ) =>
|
|
146
|
-
onDimensionChange( 'height', nextHeight )
|
|
147
|
-
}
|
|
148
|
-
units={ units }
|
|
149
|
-
/>
|
|
150
|
-
</ToolsPanelItem>
|
|
151
|
-
<ToolsPanelItem
|
|
152
|
-
className="single-column"
|
|
153
|
-
hasValue={ () => !! width }
|
|
154
|
-
label={ __( 'Width' ) }
|
|
155
|
-
onDeselect={ () => setAttributes( { width: undefined } ) }
|
|
156
|
-
resetAllFilter={ () => ( {
|
|
157
|
-
width: undefined,
|
|
158
|
-
} ) }
|
|
159
|
-
isShownByDefault
|
|
160
|
-
panelId={ clientId }
|
|
161
|
-
>
|
|
162
|
-
<UnitControl
|
|
163
|
-
__next40pxDefaultSize
|
|
164
|
-
label={ __( 'Width' ) }
|
|
165
|
-
labelPosition="top"
|
|
166
|
-
value={ width || '' }
|
|
167
|
-
min={ 0 }
|
|
168
|
-
onChange={ ( nextWidth ) =>
|
|
169
|
-
onDimensionChange( 'width', nextWidth )
|
|
170
|
-
}
|
|
171
|
-
units={ units }
|
|
172
|
-
/>
|
|
173
|
-
</ToolsPanelItem>
|
|
174
|
-
{ showScaleControl && (
|
|
175
|
-
<ToolsPanelItem
|
|
176
|
-
hasValue={ () => !! scale && scale !== DEFAULT_SCALE }
|
|
177
|
-
label={ scaleLabel }
|
|
178
|
-
onDeselect={ () =>
|
|
179
|
-
setAttributes( {
|
|
180
|
-
scale: DEFAULT_SCALE,
|
|
181
|
-
} )
|
|
182
|
-
}
|
|
183
|
-
resetAllFilter={ () => ( {
|
|
184
|
-
scale: DEFAULT_SCALE,
|
|
185
|
-
} ) }
|
|
186
|
-
isShownByDefault
|
|
187
|
-
panelId={ clientId }
|
|
188
|
-
>
|
|
189
|
-
<ToggleGroupControl
|
|
190
|
-
__next40pxDefaultSize
|
|
191
|
-
label={ scaleLabel }
|
|
192
|
-
value={ scale }
|
|
193
|
-
help={ scaleHelp[ scale ] }
|
|
194
|
-
onChange={ ( value ) =>
|
|
195
|
-
setAttributes( {
|
|
196
|
-
scale: value,
|
|
197
|
-
} )
|
|
198
|
-
}
|
|
199
|
-
isBlock
|
|
200
|
-
>
|
|
201
|
-
{ SCALE_OPTIONS }
|
|
202
|
-
</ToggleGroupControl>
|
|
203
|
-
</ToolsPanelItem>
|
|
204
|
-
) }
|
|
205
|
-
</>
|
|
112
|
+
<DimensionsTool
|
|
113
|
+
key={ selectedStyleStateKey }
|
|
114
|
+
panelId={ clientId }
|
|
115
|
+
value={ {
|
|
116
|
+
aspectRatio: activeAspectRatio,
|
|
117
|
+
width: activeWidth,
|
|
118
|
+
height: activeHeight,
|
|
119
|
+
scale: activeScale,
|
|
120
|
+
} }
|
|
121
|
+
onChange={ setDimensionAttributes }
|
|
122
|
+
defaultScale={ DEFAULT_SCALE }
|
|
123
|
+
defaultAspectRatio="auto"
|
|
124
|
+
scaleOptions={ scaleOptions }
|
|
125
|
+
unitsOptions={ units }
|
|
126
|
+
/>
|
|
206
127
|
);
|
|
207
128
|
};
|
|
208
129
|
|
|
@@ -49,9 +49,15 @@ import OverlayControls from './overlay-controls';
|
|
|
49
49
|
import Overlay from './overlay';
|
|
50
50
|
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
51
51
|
import { unlock } from '../lock-unlock';
|
|
52
|
+
import { getDimensionResetAttributes } from '../utils/style-state';
|
|
52
53
|
|
|
53
54
|
const ALLOWED_MEDIA_TYPES = [ 'image' ];
|
|
54
|
-
const { ResolutionTool } = unlock(
|
|
55
|
+
const { isDefaultBlockStyleState, ResolutionTool } = unlock(
|
|
56
|
+
blockEditorPrivateApis
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const hasDimensionValue = ( value ) =>
|
|
60
|
+
value !== undefined && value !== null && value !== '';
|
|
55
61
|
const DEFAULT_MEDIA_SIZE_SLUG = 'full';
|
|
56
62
|
|
|
57
63
|
function FeaturedImageResolutionTool( { image, value, onChange } ) {
|
|
@@ -137,12 +143,13 @@ export default function PostFeaturedImageEdit( {
|
|
|
137
143
|
return imageId;
|
|
138
144
|
}, [ storedFeaturedImage, useFirstImageFromPost, postContent ] );
|
|
139
145
|
|
|
140
|
-
const { media, postType, postPermalink,
|
|
146
|
+
const { media, postType, postPermalink, selectedStyleState } = useSelect(
|
|
141
147
|
( select ) => {
|
|
142
148
|
const { getEntityRecord, getPostType, getEditedEntityRecord } =
|
|
143
149
|
select( coreStore );
|
|
144
|
-
const {
|
|
145
|
-
|
|
150
|
+
const { getSelectedBlockStyleState } = unlock(
|
|
151
|
+
select( blockEditorStore )
|
|
152
|
+
);
|
|
146
153
|
return {
|
|
147
154
|
media:
|
|
148
155
|
featuredImage &&
|
|
@@ -155,18 +162,19 @@ export default function PostFeaturedImageEdit( {
|
|
|
155
162
|
postTypeSlug,
|
|
156
163
|
postId
|
|
157
164
|
)?.link,
|
|
158
|
-
|
|
165
|
+
selectedStyleState: getSelectedBlockStyleState( clientId ),
|
|
159
166
|
};
|
|
160
167
|
},
|
|
161
168
|
[ clientId, featuredImage, postTypeSlug, postId ]
|
|
162
169
|
);
|
|
170
|
+
const hasSelectedStyleState =
|
|
171
|
+
! isDefaultBlockStyleState( selectedStyleState );
|
|
163
172
|
|
|
164
173
|
const mediaUrl =
|
|
165
174
|
media?.media_details?.sizes?.[ sizeSlug ]?.source_url ||
|
|
166
175
|
media?.source_url;
|
|
167
176
|
|
|
168
177
|
const blockProps = useBlockProps( {
|
|
169
|
-
style: { width, height, aspectRatio },
|
|
170
178
|
className: clsx( {
|
|
171
179
|
'is-transient': temporaryURL,
|
|
172
180
|
} ),
|
|
@@ -184,8 +192,13 @@ export default function PostFeaturedImageEdit( {
|
|
|
184
192
|
) }
|
|
185
193
|
withIllustration
|
|
186
194
|
style={ {
|
|
187
|
-
|
|
188
|
-
|
|
195
|
+
aspectRatio,
|
|
196
|
+
height: hasDimensionValue( height )
|
|
197
|
+
? height
|
|
198
|
+
: hasDimensionValue( width ) && 'auto',
|
|
199
|
+
width: hasDimensionValue( width )
|
|
200
|
+
? width
|
|
201
|
+
: !! aspectRatio && '100%',
|
|
189
202
|
...borderProps.style,
|
|
190
203
|
...shadowProps.style,
|
|
191
204
|
} }
|
|
@@ -240,16 +253,32 @@ export default function PostFeaturedImageEdit( {
|
|
|
240
253
|
clientId={ clientId }
|
|
241
254
|
/>
|
|
242
255
|
</InspectorControls>
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
attributes
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
256
|
+
<InspectorControls
|
|
257
|
+
group="dimensions"
|
|
258
|
+
resetAllFilter={ ( attrs ) => {
|
|
259
|
+
return getDimensionResetAttributes( {
|
|
260
|
+
attributes: attrs,
|
|
261
|
+
selectedState: selectedStyleState,
|
|
262
|
+
hasSelectedStyleState,
|
|
263
|
+
keys: [ 'aspectRatio', 'height', 'objectFit', 'width' ],
|
|
264
|
+
defaultAttributes: {
|
|
265
|
+
aspectRatio: undefined,
|
|
266
|
+
height: undefined,
|
|
267
|
+
scale: undefined,
|
|
268
|
+
width: undefined,
|
|
269
|
+
},
|
|
270
|
+
} );
|
|
271
|
+
} }
|
|
272
|
+
>
|
|
273
|
+
<DimensionControls
|
|
274
|
+
clientId={ clientId }
|
|
275
|
+
attributes={ attributes }
|
|
276
|
+
setAttributes={ setAttributes }
|
|
277
|
+
media={ media }
|
|
278
|
+
selectedStyleState={ selectedStyleState }
|
|
279
|
+
hasSelectedStyleState={ hasSelectedStyleState }
|
|
280
|
+
/>
|
|
281
|
+
</InspectorControls>
|
|
253
282
|
{ ( featuredImage || isDescendentOfQueryLoop || ! postId ) && (
|
|
254
283
|
<InspectorControls>
|
|
255
284
|
<ToolsPanel
|
|
@@ -266,7 +295,7 @@ export default function PostFeaturedImageEdit( {
|
|
|
266
295
|
>
|
|
267
296
|
<ToolsPanelItem
|
|
268
297
|
label={
|
|
269
|
-
postType?.labels
|
|
298
|
+
postType?.labels?.singular_name
|
|
270
299
|
? sprintf(
|
|
271
300
|
// translators: %s: Name of the post type e.g: "post".
|
|
272
301
|
__( 'Link to %s' ),
|
|
@@ -398,8 +427,11 @@ export default function PostFeaturedImageEdit( {
|
|
|
398
427
|
const imageStyles = {
|
|
399
428
|
...borderProps.style,
|
|
400
429
|
...shadowProps.style,
|
|
401
|
-
|
|
402
|
-
|
|
430
|
+
aspectRatio,
|
|
431
|
+
height: hasDimensionValue( height )
|
|
432
|
+
? height
|
|
433
|
+
: hasDimensionValue( width ) && 'auto',
|
|
434
|
+
width: hasDimensionValue( width ) ? width : !! aspectRatio && '100%',
|
|
403
435
|
objectFit: !! ( height || aspectRatio ) && scale,
|
|
404
436
|
};
|
|
405
437
|
|
|
@@ -40,16 +40,26 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
$extra_styles = '';
|
|
43
|
+
$has_width = array_key_exists( 'width', $attributes ) && null !== $attributes['width'] && '' !== $attributes['width'];
|
|
44
|
+
$has_height = array_key_exists( 'height', $attributes ) && null !== $attributes['height'] && '' !== $attributes['height'];
|
|
43
45
|
|
|
44
|
-
// Aspect ratio with a height set needs to override the default width/height.
|
|
45
46
|
if ( ! empty( $attributes['aspectRatio'] ) ) {
|
|
46
|
-
$extra_styles .= '
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
$extra_styles .= esc_attr( safecss_filter_attr( 'aspect-ratio:' . $attributes['aspectRatio'] ) ) . ';';
|
|
48
|
+
$extra_styles .= 'width:100%;';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if ( $has_height ) {
|
|
52
|
+
$extra_styles .= esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . ';';
|
|
53
|
+
} elseif ( $has_width ) {
|
|
54
|
+
$extra_styles .= 'height:auto;';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if ( $has_width ) {
|
|
58
|
+
$extra_styles .= esc_attr( safecss_filter_attr( 'width:' . $attributes['width'] ) ) . ';';
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
if ( ! empty( $attributes['scale'] ) ) {
|
|
52
|
-
$extra_styles .=
|
|
62
|
+
$extra_styles .= esc_attr( safecss_filter_attr( 'object-fit:' . $attributes['scale'] ) ) . ';';
|
|
53
63
|
}
|
|
54
64
|
if ( ! empty( $attributes['style']['shadow'] ) ) {
|
|
55
65
|
$shadow_styles = wp_style_engine_get_styles( array( 'shadow' => $attributes['style']['shadow'] ) );
|
|
@@ -90,6 +100,13 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
90
100
|
foreach ( $processor->get_attribute_names_with_prefix( '' ) as $name ) {
|
|
91
101
|
$tag_html->set_attribute( $name, $processor->get_attribute( $name ) );
|
|
92
102
|
}
|
|
103
|
+
if ( ! empty( $attr['style'] ) ) {
|
|
104
|
+
$existing_style = $tag_html->get_attribute( 'style' );
|
|
105
|
+
$style = is_string( $existing_style ) && '' !== $existing_style
|
|
106
|
+
? rtrim( $existing_style, ';' ) . ';' . $attr['style']
|
|
107
|
+
: $attr['style'];
|
|
108
|
+
$tag_html->set_attribute( 'style', $style );
|
|
109
|
+
}
|
|
93
110
|
$featured_image = $tag_html->get_updated_html();
|
|
94
111
|
}
|
|
95
112
|
}
|
|
@@ -101,13 +118,11 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
101
118
|
if ( $is_link ) {
|
|
102
119
|
$link_target = $attributes['linkTarget'];
|
|
103
120
|
$rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
|
|
104
|
-
$height = ! empty( $attributes['height'] ) ? 'style="' . esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . '"' : '';
|
|
105
121
|
$featured_image = sprintf(
|
|
106
|
-
'<a href="%1$s" target="%2$s" %3$s
|
|
122
|
+
'<a href="%1$s" target="%2$s" %3$s>%4$s%5$s</a>',
|
|
107
123
|
esc_url( get_the_permalink( $post_ID ) ),
|
|
108
124
|
esc_attr( $link_target ),
|
|
109
125
|
$rel,
|
|
110
|
-
$height,
|
|
111
126
|
$featured_image,
|
|
112
127
|
$overlay_markup
|
|
113
128
|
);
|
|
@@ -115,20 +130,7 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
115
130
|
$featured_image = $featured_image . $overlay_markup;
|
|
116
131
|
}
|
|
117
132
|
|
|
118
|
-
$
|
|
119
|
-
? esc_attr( safecss_filter_attr( 'aspect-ratio:' . $attributes['aspectRatio'] ) ) . ';'
|
|
120
|
-
: '';
|
|
121
|
-
$width = ! empty( $attributes['width'] )
|
|
122
|
-
? esc_attr( safecss_filter_attr( 'width:' . $attributes['width'] ) ) . ';'
|
|
123
|
-
: '';
|
|
124
|
-
$height = ! empty( $attributes['height'] )
|
|
125
|
-
? esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . ';'
|
|
126
|
-
: '';
|
|
127
|
-
if ( ! $height && ! $width && ! $aspect_ratio ) {
|
|
128
|
-
$wrapper_attributes = get_block_wrapper_attributes();
|
|
129
|
-
} else {
|
|
130
|
-
$wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $aspect_ratio . $width . $height ) );
|
|
131
|
-
}
|
|
133
|
+
$wrapper_attributes = get_block_wrapper_attributes();
|
|
132
134
|
return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
|
|
133
135
|
}
|
|
134
136
|
|
package/src/pullquote/README.md
CHANGED
|
@@ -16,7 +16,6 @@ _Defined via the [`attributes`](https://developer.wordpress.org/block-editor/ref
|
|
|
16
16
|
|-----------|------|---------|-------------|
|
|
17
17
|
| `value` | `rich-text` | — | [Source](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#value-source): `rich-text`. [Selector](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#value-source): `p`. [Role](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#role): `content` |
|
|
18
18
|
| `citation` | `rich-text` | — | [Source](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#value-source): `rich-text`. [Selector](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#value-source): `cite`. [Role](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#role): `content` |
|
|
19
|
-
| `textAlign` | `string` | — | — |
|
|
20
19
|
|
|
21
20
|
## Supports
|
|
22
21
|
|
|
@@ -39,6 +38,7 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
39
38
|
- [`typography`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography):
|
|
40
39
|
- [`fontSize`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-fontsize): `true`
|
|
41
40
|
- [`lineHeight`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-lineheight): `true`
|
|
41
|
+
- [`textAlign`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#typography-textalign): `true`
|
|
42
42
|
- [`interactivity`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#interactivity):
|
|
43
43
|
- `clientNavigation`: `true`
|
|
44
44
|
|
package/src/pullquote/block.json
CHANGED
|
@@ -18,9 +18,6 @@
|
|
|
18
18
|
"source": "rich-text",
|
|
19
19
|
"selector": "cite",
|
|
20
20
|
"role": "content"
|
|
21
|
-
},
|
|
22
|
-
"textAlign": {
|
|
23
|
-
"type": "string"
|
|
24
21
|
}
|
|
25
22
|
},
|
|
26
23
|
"supports": {
|
|
@@ -52,6 +49,7 @@
|
|
|
52
49
|
"typography": {
|
|
53
50
|
"fontSize": true,
|
|
54
51
|
"lineHeight": true,
|
|
52
|
+
"textAlign": true,
|
|
55
53
|
"__experimentalFontFamily": true,
|
|
56
54
|
"__experimentalFontWeight": true,
|
|
57
55
|
"__experimentalFontStyle": true,
|