@wordpress/block-library 9.48.1 → 10.0.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 +12 -0
- package/build/audio/edit.cjs +8 -1
- package/build/audio/edit.cjs.map +2 -2
- package/build/breadcrumbs/edit.cjs +1 -2
- package/build/breadcrumbs/edit.cjs.map +2 -2
- package/build/button/edit.cjs +1 -2
- 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/embed-video-url-input.cjs +0 -1
- package/build/cover/edit/embed-video-url-input.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 -2
- 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/{freeform/convert-to-blocks-button.cjs → file/variations.cjs} +16 -18
- 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/edit.cjs +0 -2
- package/build/form/edit.cjs.map +2 -2
- package/build/form-input/edit.cjs +1 -3
- package/build/form-input/edit.cjs.map +2 -2
- package/build/freeform/edit.cjs +6 -15
- package/build/freeform/edit.cjs.map +3 -3
- package/build/freeform/migration-notice.cjs.map +2 -2
- package/build/gallery/edit.cjs +2 -2
- package/build/gallery/edit.cjs.map +2 -2
- package/build/home-link/edit.cjs +1 -2
- 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 +9 -6
- package/build/html/modal.cjs.map +2 -2
- package/build/icon/block.json +12 -0
- package/build/icon/edit.cjs +90 -41
- 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 -29
- 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/image/use-open-image-media-editor-modal.cjs +5 -25
- package/build/image/use-open-image-media-editor-modal.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/list/ordered-list-settings.cjs +0 -1
- package/build/list/ordered-list-settings.cjs.map +2 -2
- 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 +19 -13
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation/edit/navigation-menu-name-control.cjs +0 -1
- package/build/navigation/edit/navigation-menu-name-control.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/block.json +1 -1
- package/build/navigation-link/edit.cjs +1 -1
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-link/link-ui/page-creator.cjs +0 -1
- package/build/navigation-link/link-ui/page-creator.cjs.map +2 -2
- package/build/navigation-link/shared/controls.cjs +0 -2
- package/build/navigation-link/shared/controls.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/playlist-track/edit.cjs +0 -3
- package/build/playlist-track/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-comment/edit.cjs +0 -1
- package/build/post-comment/edit.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 -18
- 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-terms/edit.cjs +0 -1
- package/build/post-terms/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/post-title/edit.cjs +0 -1
- package/build/post-title/edit.cjs.map +2 -2
- 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/enhanced-pagination-modal.cjs +10 -1
- package/build/query/edit/enhanced-pagination-modal.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/index.cjs +0 -1
- package/build/query/edit/inspector-controls/index.cjs.map +2 -2
- 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 -2
- package/build/rss/edit.cjs.map +2 -2
- package/build/search/block.json +4 -0
- package/build/search/edit.cjs +244 -206
- 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-logo/edit.cjs +2 -1
- package/build/site-logo/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/social-link/edit.cjs +0 -3
- package/build/social-link/edit.cjs.map +2 -2
- package/build/tab-list/block.json +33 -20
- package/build/tab-list/edit.cjs +122 -12
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-list/init.cjs +28 -0
- package/build/tab-list/init.cjs.map +7 -0
- 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/edit.cjs +0 -9
- package/build/tab-panel/edit.cjs.map +2 -2
- 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-panel/save.cjs +2 -1
- package/build/tab-panel/save.cjs.map +2 -2
- package/build/tab-panels/block.json +2 -28
- package/build/tab-panels/init.cjs +28 -0
- package/build/tab-panels/init.cjs.map +7 -0
- package/build/table/edit.cjs +0 -2
- package/build/table/edit.cjs.map +2 -2
- 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 +22 -104
- package/build/tabs/view.cjs.map +2 -2
- package/build/template-part/edit/advanced-controls.cjs +0 -1
- package/build/template-part/edit/advanced-controls.cjs.map +2 -2
- package/build/template-part/edit/title-modal.cjs +1 -2
- package/build/template-part/edit/title-modal.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/video/edit.cjs +3 -2
- package/build/video/edit.cjs.map +2 -2
- package/build/video/tracks-editor.cjs +0 -2
- package/build/video/tracks-editor.cjs.map +2 -2
- package/build-module/audio/edit.mjs +8 -2
- package/build-module/audio/edit.mjs.map +2 -2
- package/build-module/breadcrumbs/edit.mjs +1 -2
- package/build-module/breadcrumbs/edit.mjs.map +2 -2
- package/build-module/button/edit.mjs +1 -2
- 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/embed-video-url-input.mjs +0 -1
- package/build-module/cover/edit/embed-video-url-input.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 -2
- 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/edit.mjs +0 -2
- package/build-module/form/edit.mjs.map +2 -2
- package/build-module/form-input/edit.mjs +1 -3
- package/build-module/form-input/edit.mjs.map +2 -2
- package/build-module/freeform/edit.mjs +6 -15
- package/build-module/freeform/edit.mjs.map +2 -2
- package/build-module/freeform/migration-notice.mjs.map +2 -2
- 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 -2
- 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 +9 -6
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/icon/block.json +12 -0
- package/build-module/icon/edit.mjs +94 -42
- 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 -29
- 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/image/use-open-image-media-editor-modal.mjs +5 -25
- package/build-module/image/use-open-image-media-editor-modal.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/list/ordered-list-settings.mjs +0 -1
- package/build-module/list/ordered-list-settings.mjs.map +2 -2
- 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 +19 -13
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/navigation-menu-name-control.mjs +0 -1
- package/build-module/navigation/edit/navigation-menu-name-control.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/block.json +1 -1
- package/build-module/navigation-link/edit.mjs +1 -1
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-link/link-ui/page-creator.mjs +0 -1
- package/build-module/navigation-link/link-ui/page-creator.mjs.map +2 -2
- package/build-module/navigation-link/shared/controls.mjs +0 -2
- package/build-module/navigation-link/shared/controls.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/playlist-track/edit.mjs +0 -3
- package/build-module/playlist-track/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-comment/edit.mjs +0 -1
- package/build-module/post-comment/edit.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 -18
- 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-terms/edit.mjs +0 -1
- package/build-module/post-terms/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/post-title/edit.mjs +0 -1
- package/build-module/post-title/edit.mjs.map +2 -2
- 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/enhanced-pagination-modal.mjs +10 -1
- package/build-module/query/edit/enhanced-pagination-modal.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/index.mjs +0 -1
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- 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 -2
- package/build-module/rss/edit.mjs.map +2 -2
- package/build-module/search/block.json +4 -0
- package/build-module/search/edit.mjs +244 -206
- 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-logo/edit.mjs +2 -1
- package/build-module/site-logo/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/social-link/edit.mjs +0 -3
- package/build-module/social-link/edit.mjs.map +2 -2
- package/build-module/tab-list/block.json +33 -20
- package/build-module/tab-list/edit.mjs +128 -15
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-list/init.mjs +7 -0
- package/build-module/tab-list/init.mjs.map +7 -0
- 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/edit.mjs +1 -10
- package/build-module/tab-panel/edit.mjs.map +2 -2
- 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-panel/save.mjs +2 -1
- package/build-module/tab-panel/save.mjs.map +2 -2
- package/build-module/tab-panels/block.json +2 -28
- package/build-module/tab-panels/init.mjs +7 -0
- package/build-module/tab-panels/init.mjs.map +7 -0
- package/build-module/table/edit.mjs +0 -2
- package/build-module/table/edit.mjs.map +2 -2
- 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 +22 -104
- package/build-module/tabs/view.mjs.map +2 -2
- package/build-module/template-part/edit/advanced-controls.mjs +0 -1
- package/build-module/template-part/edit/advanced-controls.mjs.map +2 -2
- package/build-module/template-part/edit/title-modal.mjs +1 -2
- package/build-module/template-part/edit/title-modal.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-module/video/edit.mjs +3 -3
- package/build-module/video/edit.mjs.map +2 -2
- package/build-module/video/tracks-editor.mjs +0 -2
- package/build-module/video/tracks-editor.mjs.map +2 -2
- package/build-style/editor-rtl.css +0 -19
- package/build-style/editor.css +0 -19
- 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 → 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/audio/edit.js +5 -9
- package/src/avatar/index.php +2 -2
- package/src/block/index.php +2 -26
- package/src/breadcrumbs/edit.js +0 -1
- package/src/button/edit.js +0 -1
- 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/embed-video-url-input.js +0 -1
- package/src/cover/edit/index.js +86 -0
- package/src/cover/edit/inspector-controls.js +124 -54
- package/src/cover/test/edit.js +51 -2
- package/src/details/edit.js +0 -1
- package/src/editor.scss +0 -2
- 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/form/edit.js +0 -2
- package/src/form-input/edit.js +0 -2
- package/src/freeform/edit.js +6 -29
- package/src/freeform/migration-notice.js +2 -4
- package/src/gallery/edit.js +13 -13
- package/src/home-link/edit.js +0 -1
- package/src/html/modal.js +3 -0
- package/src/icon/README.md +3 -0
- package/src/icon/block.json +12 -0
- package/src/icon/edit.js +85 -37
- 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 -56
- package/src/image/index.php +0 -1
- package/src/image/test/use-open-image-media-editor-modal.js +20 -26
- package/src/image/transforms.js +34 -8
- package/src/image/use-open-image-media-editor-modal.js +24 -42
- package/src/index.js +4 -11
- package/src/list/ordered-list-settings.js +0 -1
- package/src/navigation/edit/index.js +25 -16
- package/src/navigation/edit/navigation-menu-name-control.js +0 -1
- package/src/navigation/index.php +58 -0
- package/src/navigation-link/README.md +1 -1
- package/src/navigation-link/block.json +1 -1
- package/src/navigation-link/link-ui/page-creator.js +0 -1
- package/src/navigation-link/shared/controls.js +0 -2
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +5 -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/playlist-track/edit.js +0 -3
- package/src/post-comment/edit.js +0 -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 -22
- package/src/post-featured-image/index.php +24 -22
- package/src/post-terms/edit.js +0 -1
- package/src/post-title/edit.js +0 -1
- 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/query/edit/enhanced-pagination-modal.js +11 -1
- package/src/query/edit/inspector-controls/index.js +0 -1
- package/src/rss/edit.js +0 -1
- package/src/search/README.md +1 -0
- package/src/search/block.json +4 -0
- package/src/search/edit.js +106 -55
- package/src/search/index.php +25 -1
- package/src/site-logo/edit.js +3 -1
- package/src/social-link/edit.js +0 -3
- package/src/style.scss +1 -2
- package/src/tab-list/README.md +19 -17
- package/src/tab-list/block.json +33 -20
- package/src/tab-list/edit.js +153 -15
- package/src/tab-list/index.php +24 -33
- package/src/tab-list/init.js +6 -0
- package/src/tab-list/save.js +39 -4
- package/src/{tab → tab-list}/style.scss +2 -3
- 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/edit.js +1 -14
- package/src/tab-panel/index.php +2 -25
- package/src/tab-panel/remove-tab-toolbar-control.js +10 -14
- package/src/tab-panel/save.js +1 -0
- package/src/tab-panel/style.scss +0 -17
- package/src/tab-panels/README.md +0 -16
- package/src/tab-panels/block.json +2 -28
- package/src/tab-panels/init.js +6 -0
- package/src/table/edit.js +0 -2
- 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 +12 -32
- package/src/tabs/use-tab-list-items-sync.js +49 -0
- package/src/tabs/view.js +22 -110
- package/src/template-part/edit/advanced-controls.js +0 -1
- package/src/template-part/edit/title-modal.js +0 -1
- package/src/utils/style-state.js +151 -0
- package/src/utils/test/style-state.js +307 -0
- package/src/video/edit.js +9 -16
- package/src/video/tracks-editor.js +0 -2
- package/babel-plugin.cjs +0 -150
- package/build/freeform/convert-to-blocks-button.cjs.map +0 -7
- package/build/list-item/utils.cjs +0 -57
- package/build/list-item/utils.cjs.map +0 -7
- 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/freeform/convert-to-blocks-button.mjs +0 -19
- package/build-module/freeform/convert-to-blocks-button.mjs.map +0 -7
- package/build-module/list-item/utils.mjs +0 -32
- package/build-module/list-item/utils.mjs.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-list/editor-rtl.css +0 -6
- package/build-style/tab-list/editor.css +0 -6
- package/build-style/tab-panels/style-rtl.css +0 -4
- package/build-style/tab-panels/style.css +0 -4
- package/src/freeform/convert-to-blocks-button.js +0 -18
- package/src/list-item/utils.js +0 -34
- 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-list/editor.scss +0 -10
- package/src/tab-panels/style.scss +0 -4
- package/src/tabs/use-tab-list-sync.js +0 -237
package/src/file/transforms.js
CHANGED
|
@@ -5,8 +5,12 @@ import { createBlobURL } from '@wordpress/blob';
|
|
|
5
5
|
import { createBlock } from '@wordpress/blocks';
|
|
6
6
|
import { select } from '@wordpress/data';
|
|
7
7
|
import { store as coreStore } from '@wordpress/core-data';
|
|
8
|
+
import { _x } from '@wordpress/i18n';
|
|
8
9
|
import { getFilename } from '@wordpress/url';
|
|
9
10
|
|
|
11
|
+
// Transforms bypass the default variation, so set the localized default here.
|
|
12
|
+
const downloadButtonText = _x( 'Download', 'button label' );
|
|
13
|
+
|
|
10
14
|
const transforms = {
|
|
11
15
|
from: [
|
|
12
16
|
{
|
|
@@ -47,6 +51,7 @@ const transforms = {
|
|
|
47
51
|
createBlock( 'core/file', {
|
|
48
52
|
blob: blobURL,
|
|
49
53
|
fileName: file.name,
|
|
54
|
+
downloadButtonText,
|
|
50
55
|
} )
|
|
51
56
|
);
|
|
52
57
|
}
|
|
@@ -57,41 +62,17 @@ const transforms = {
|
|
|
57
62
|
},
|
|
58
63
|
{
|
|
59
64
|
type: 'block',
|
|
60
|
-
blocks: [ 'core/audio' ],
|
|
61
|
-
transform: ( attributes ) => {
|
|
62
|
-
return createBlock( 'core/file', {
|
|
63
|
-
href: attributes.src,
|
|
64
|
-
fileName: attributes.caption,
|
|
65
|
-
textLinkHref: attributes.src,
|
|
66
|
-
id: attributes.id,
|
|
67
|
-
anchor: attributes.anchor,
|
|
68
|
-
} );
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
type: 'block',
|
|
73
|
-
blocks: [ 'core/video' ],
|
|
74
|
-
transform: ( attributes ) => {
|
|
75
|
-
return createBlock( 'core/file', {
|
|
76
|
-
href: attributes.src,
|
|
77
|
-
fileName: attributes.caption,
|
|
78
|
-
textLinkHref: attributes.src,
|
|
79
|
-
id: attributes.id,
|
|
80
|
-
anchor: attributes.anchor,
|
|
81
|
-
} );
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
type: 'block',
|
|
86
|
-
blocks: [ 'core/image' ],
|
|
65
|
+
blocks: [ 'core/audio', 'core/video', 'core/image' ],
|
|
87
66
|
transform: ( attributes ) => {
|
|
67
|
+
// Audio/Video use `src`, Image uses `url`.
|
|
68
|
+
const href = attributes.src ?? attributes.url;
|
|
88
69
|
return createBlock( 'core/file', {
|
|
89
|
-
href
|
|
90
|
-
fileName:
|
|
91
|
-
|
|
92
|
-
textLinkHref: attributes.url,
|
|
70
|
+
href,
|
|
71
|
+
fileName: attributes.caption || getFilename( href ),
|
|
72
|
+
textLinkHref: href,
|
|
93
73
|
id: attributes.id,
|
|
94
74
|
anchor: attributes.anchor,
|
|
75
|
+
downloadButtonText,
|
|
95
76
|
} );
|
|
96
77
|
},
|
|
97
78
|
},
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { _x } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
const variations = [
|
|
7
|
+
{
|
|
8
|
+
name: 'default',
|
|
9
|
+
isDefault: true,
|
|
10
|
+
// Translatable defaults can't live in `block.json`, so set it here.
|
|
11
|
+
attributes: {
|
|
12
|
+
downloadButtonText: _x( 'Download', 'button label' ),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export default variations;
|
package/src/form/edit.js
CHANGED
|
@@ -150,7 +150,6 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
|
|
|
150
150
|
isShownByDefault
|
|
151
151
|
>
|
|
152
152
|
<TextControl
|
|
153
|
-
__next40pxDefaultSize
|
|
154
153
|
autoComplete="off"
|
|
155
154
|
label={ __( 'Email for form submissions' ) }
|
|
156
155
|
value={ email || '' }
|
|
@@ -189,7 +188,6 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
|
|
|
189
188
|
) }
|
|
190
189
|
/>
|
|
191
190
|
<TextControl
|
|
192
|
-
__next40pxDefaultSize
|
|
193
191
|
autoComplete="off"
|
|
194
192
|
label={ __( 'Form action' ) }
|
|
195
193
|
value={ action }
|
package/src/form-input/edit.js
CHANGED
|
@@ -102,7 +102,6 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
|
|
|
102
102
|
) }
|
|
103
103
|
<InspectorControls group="advanced">
|
|
104
104
|
<TextControl
|
|
105
|
-
__next40pxDefaultSize
|
|
106
105
|
autoComplete="off"
|
|
107
106
|
label={ __( 'Name' ) }
|
|
108
107
|
value={ name }
|
|
@@ -117,7 +116,6 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
|
|
|
117
116
|
/>
|
|
118
117
|
{ 'hidden' === type && (
|
|
119
118
|
<TextControl
|
|
120
|
-
__next40pxDefaultSize
|
|
121
119
|
autoComplete="off"
|
|
122
120
|
label={ __( 'Value' ) }
|
|
123
121
|
value={ value }
|
package/src/freeform/edit.js
CHANGED
|
@@ -21,7 +21,6 @@ import { classic } from '@wordpress/icons';
|
|
|
21
21
|
/**
|
|
22
22
|
* Internal dependencies
|
|
23
23
|
*/
|
|
24
|
-
import ConvertToBlocksButton from './convert-to-blocks-button';
|
|
25
24
|
import MigrationNotice from './migration-notice';
|
|
26
25
|
import ModalEdit from './modal';
|
|
27
26
|
|
|
@@ -41,22 +40,8 @@ export default function FreeformEdit( {
|
|
|
41
40
|
);
|
|
42
41
|
const { removeBlock } = useDispatch( blockEditorStore );
|
|
43
42
|
|
|
44
|
-
// Gated by an experiment so authors can opt into a stronger nudge to
|
|
45
|
-
// migrate Classic block content ahead of its planned deprecation.
|
|
46
|
-
const isDeprecationMode = window.__experimentalClassicBlockDeprecation;
|
|
47
|
-
|
|
48
43
|
return (
|
|
49
44
|
<>
|
|
50
|
-
{ canRemove && ! isDeprecationMode && (
|
|
51
|
-
<BlockControls>
|
|
52
|
-
<ToolbarGroup>
|
|
53
|
-
<ConvertToBlocksButton
|
|
54
|
-
content={ content }
|
|
55
|
-
onReplace={ onReplace }
|
|
56
|
-
/>
|
|
57
|
-
</ToolbarGroup>
|
|
58
|
-
</BlockControls>
|
|
59
|
-
) }
|
|
60
45
|
<BlockControls>
|
|
61
46
|
<ToolbarGroup>
|
|
62
47
|
<ToolbarButton
|
|
@@ -68,7 +53,7 @@ export default function FreeformEdit( {
|
|
|
68
53
|
</ToolbarGroup>
|
|
69
54
|
</BlockControls>
|
|
70
55
|
<div { ...useBlockProps() }>
|
|
71
|
-
{
|
|
56
|
+
{ canRemove && content && (
|
|
72
57
|
<MigrationNotice
|
|
73
58
|
content={ content }
|
|
74
59
|
onReplace={ onReplace }
|
|
@@ -80,15 +65,11 @@ export default function FreeformEdit( {
|
|
|
80
65
|
<Placeholder
|
|
81
66
|
icon={ <BlockIcon icon={ classic } /> }
|
|
82
67
|
label={ __( 'Classic' ) }
|
|
83
|
-
instructions={
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
'The Classic block is being phased out. It’s recommended to use other blocks for the best editing experience.'
|
|
87
|
-
)
|
|
88
|
-
: __( 'Use the classic editor to add content.' )
|
|
89
|
-
}
|
|
68
|
+
instructions={ __(
|
|
69
|
+
'The Classic block is being phased out. It’s recommended to use other blocks for the best editing experience.'
|
|
70
|
+
) }
|
|
90
71
|
>
|
|
91
|
-
{
|
|
72
|
+
{ canRemove && (
|
|
92
73
|
<Button
|
|
93
74
|
__next40pxDefaultSize
|
|
94
75
|
variant="primary"
|
|
@@ -99,11 +80,7 @@ export default function FreeformEdit( {
|
|
|
99
80
|
) }
|
|
100
81
|
<Button
|
|
101
82
|
__next40pxDefaultSize
|
|
102
|
-
variant={
|
|
103
|
-
isDeprecationMode && canRemove
|
|
104
|
-
? 'secondary'
|
|
105
|
-
: 'primary'
|
|
106
|
-
}
|
|
83
|
+
variant={ canRemove ? 'secondary' : 'primary' }
|
|
107
84
|
onClick={ () => setOpen( true ) }
|
|
108
85
|
>
|
|
109
86
|
{ __( 'Edit contents' ) }
|
|
@@ -7,13 +7,11 @@ import { createBlock, rawHandler } from '@wordpress/blocks';
|
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Block-level deprecation warning
|
|
11
|
-
* `gutenberg-classic-block-deprecation` experiment is enabled.
|
|
12
|
-
*
|
|
10
|
+
* Block-level deprecation warning for the Classic block.
|
|
13
11
|
* Uses the same `Warning` primitive as `core/missing` so the experience is
|
|
14
12
|
* visually consistent with how the editor already surfaces deprecated blocks,
|
|
15
13
|
* and offers two migration actions - a primary "Convert to blocks", and a
|
|
16
|
-
* secondary "Convert to
|
|
14
|
+
* secondary "Convert to HTML".
|
|
17
15
|
*
|
|
18
16
|
* @param {Object} props
|
|
19
17
|
* @param {string} props.content Raw HTML content of the Classic block.
|
package/src/gallery/edit.js
CHANGED
|
@@ -754,17 +754,17 @@ export default function GalleryEdit( props ) {
|
|
|
754
754
|
/>
|
|
755
755
|
</ToolsPanelItem>
|
|
756
756
|
) }
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
757
|
+
{ lightboxSetting?.allowEditing && hasLightboxImages && (
|
|
758
|
+
<ToolsPanelItem
|
|
759
|
+
label={ __( 'Navigation button type' ) }
|
|
760
|
+
isShownByDefault
|
|
761
|
+
hasValue={ () => navigationButtonType !== 'icon' }
|
|
762
|
+
onDeselect={ () =>
|
|
763
|
+
setAttributes( {
|
|
764
|
+
navigationButtonType: 'icon',
|
|
765
|
+
} )
|
|
766
|
+
}
|
|
767
|
+
>
|
|
768
768
|
<ToggleGroupControl
|
|
769
769
|
label={ __( 'Navigation button type' ) }
|
|
770
770
|
value={ navigationButtonType }
|
|
@@ -789,8 +789,8 @@ export default function GalleryEdit( props ) {
|
|
|
789
789
|
)
|
|
790
790
|
) }
|
|
791
791
|
</ToggleGroupControl>
|
|
792
|
-
|
|
793
|
-
|
|
792
|
+
</ToolsPanelItem>
|
|
793
|
+
) }
|
|
794
794
|
</ToolsPanel>
|
|
795
795
|
</InspectorControls>
|
|
796
796
|
<BlockControls group="block">
|
package/src/home-link/edit.js
CHANGED
|
@@ -108,7 +108,6 @@ export default function HomeEdit( { attributes, setAttributes, context } ) {
|
|
|
108
108
|
isShownByDefault
|
|
109
109
|
>
|
|
110
110
|
<TextControl
|
|
111
|
-
__next40pxDefaultSize
|
|
112
111
|
label={ __( 'Text' ) }
|
|
113
112
|
value={ label ? stripHTML( label ) : '' }
|
|
114
113
|
onChange={ ( labelValue ) => {
|
package/src/html/modal.js
CHANGED
|
@@ -148,6 +148,7 @@ export default function HTMLEditModal( {
|
|
|
148
148
|
placeholder={ __( 'Write HTML…' ) }
|
|
149
149
|
aria-label={ __( 'HTML' ) }
|
|
150
150
|
className="block-library-html__modal-editor"
|
|
151
|
+
async
|
|
151
152
|
/>
|
|
152
153
|
</Tabs.TabPanel>
|
|
153
154
|
{ canUserUseUnfilteredHTML && (
|
|
@@ -162,6 +163,7 @@ export default function HTMLEditModal( {
|
|
|
162
163
|
placeholder={ __( 'Write CSS…' ) }
|
|
163
164
|
aria-label={ __( 'CSS' ) }
|
|
164
165
|
className="block-library-html__modal-editor"
|
|
166
|
+
async
|
|
165
167
|
/>
|
|
166
168
|
</Tabs.TabPanel>
|
|
167
169
|
) }
|
|
@@ -179,6 +181,7 @@ export default function HTMLEditModal( {
|
|
|
179
181
|
) }
|
|
180
182
|
aria-label={ __( 'JavaScript' ) }
|
|
181
183
|
className="block-library-html__modal-editor"
|
|
184
|
+
async
|
|
182
185
|
/>
|
|
183
186
|
</Tabs.TabPanel>
|
|
184
187
|
) }
|
package/src/icon/README.md
CHANGED
|
@@ -16,6 +16,9 @@ _Defined via the [`attributes`](https://developer.wordpress.org/block-editor/ref
|
|
|
16
16
|
| Attribute | [Type](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#type-validation) | [Default](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#default-value) | Description |
|
|
17
17
|
|-----------|------|---------|-------------|
|
|
18
18
|
| `icon` | `string` | — | [Role](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#role): `content` |
|
|
19
|
+
| `flipHorizontal` | `boolean` | `false` | — |
|
|
20
|
+
| `flipVertical` | `boolean` | `false` | — |
|
|
21
|
+
| `rotation` | `number` | `0` | — |
|
|
19
22
|
|
|
20
23
|
## Supports
|
|
21
24
|
|
package/src/icon/block.json
CHANGED
|
@@ -11,6 +11,18 @@
|
|
|
11
11
|
"icon": {
|
|
12
12
|
"type": "string",
|
|
13
13
|
"role": "content"
|
|
14
|
+
},
|
|
15
|
+
"flipHorizontal": {
|
|
16
|
+
"type": "boolean",
|
|
17
|
+
"default": false
|
|
18
|
+
},
|
|
19
|
+
"flipVertical": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"default": false
|
|
22
|
+
},
|
|
23
|
+
"rotation": {
|
|
24
|
+
"type": "number",
|
|
25
|
+
"default": 0
|
|
14
26
|
}
|
|
15
27
|
},
|
|
16
28
|
"supports": {
|
package/src/icon/edit.js
CHANGED
|
@@ -11,10 +11,14 @@ import {
|
|
|
11
11
|
DropdownMenu,
|
|
12
12
|
TextControl,
|
|
13
13
|
ToolbarButton,
|
|
14
|
-
ToolbarGroup,
|
|
15
14
|
__experimentalToolsPanel as ToolsPanel,
|
|
16
15
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
17
16
|
} from '@wordpress/components';
|
|
17
|
+
import {
|
|
18
|
+
flipHorizontal as flipHorizontalIcon,
|
|
19
|
+
flipVertical as flipVerticalIcon,
|
|
20
|
+
rotateRight,
|
|
21
|
+
} from '@wordpress/icons';
|
|
18
22
|
import {
|
|
19
23
|
BlockControls,
|
|
20
24
|
InspectorControls,
|
|
@@ -58,7 +62,8 @@ const IconPlaceholder = ( { className, style } ) => (
|
|
|
58
62
|
);
|
|
59
63
|
|
|
60
64
|
export function Edit( { attributes, setAttributes } ) {
|
|
61
|
-
const { icon, ariaLabel } =
|
|
65
|
+
const { icon, ariaLabel, flipHorizontal, flipVertical, rotation } =
|
|
66
|
+
attributes;
|
|
62
67
|
|
|
63
68
|
const [ isInserterOpen, setInserterOpen ] = useState( false );
|
|
64
69
|
|
|
@@ -87,9 +92,49 @@ export function Edit( { attributes, setAttributes } ) {
|
|
|
87
92
|
|
|
88
93
|
const iconToDisplay = selectedIcon?.content || '';
|
|
89
94
|
|
|
95
|
+
const flipClasses = {
|
|
96
|
+
'is-flip-horizontal': flipHorizontal,
|
|
97
|
+
'is-flip-vertical': flipVertical,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const rotationStyle = rotation ? { rotate: `${ rotation }deg` } : {};
|
|
101
|
+
|
|
90
102
|
const blockControls = (
|
|
91
103
|
<>
|
|
92
|
-
|
|
104
|
+
{ icon && (
|
|
105
|
+
<BlockControls group="block">
|
|
106
|
+
<ToolbarButton
|
|
107
|
+
icon={ flipHorizontalIcon }
|
|
108
|
+
label={ __( 'Flip horizontal' ) }
|
|
109
|
+
isPressed={ flipHorizontal }
|
|
110
|
+
onClick={ () =>
|
|
111
|
+
setAttributes( {
|
|
112
|
+
flipHorizontal: ! flipHorizontal,
|
|
113
|
+
} )
|
|
114
|
+
}
|
|
115
|
+
/>
|
|
116
|
+
<ToolbarButton
|
|
117
|
+
icon={ flipVerticalIcon }
|
|
118
|
+
label={ __( 'Flip vertical' ) }
|
|
119
|
+
isPressed={ flipVertical }
|
|
120
|
+
onClick={ () =>
|
|
121
|
+
setAttributes( {
|
|
122
|
+
flipVertical: ! flipVertical,
|
|
123
|
+
} )
|
|
124
|
+
}
|
|
125
|
+
/>
|
|
126
|
+
<ToolbarButton
|
|
127
|
+
icon={ rotateRight }
|
|
128
|
+
label={ __( 'Rotate' ) }
|
|
129
|
+
onClick={ () =>
|
|
130
|
+
setAttributes( {
|
|
131
|
+
rotation: ( ( rotation || 0 ) + 90 ) % 360,
|
|
132
|
+
} )
|
|
133
|
+
}
|
|
134
|
+
/>
|
|
135
|
+
</BlockControls>
|
|
136
|
+
) }
|
|
137
|
+
<BlockControls group="other">
|
|
93
138
|
<ToolbarButton
|
|
94
139
|
onClick={ () => {
|
|
95
140
|
setInserterOpen( true );
|
|
@@ -97,38 +142,38 @@ export function Edit( { attributes, setAttributes } ) {
|
|
|
97
142
|
>
|
|
98
143
|
{ icon ? __( 'Replace' ) : __( 'Choose icon' ) }
|
|
99
144
|
</ToolbarButton>
|
|
145
|
+
{ isContentOnlyMode && icon && (
|
|
146
|
+
// Add some extra controls for content attributes when content only mode is active.
|
|
147
|
+
// With content only mode active, the inspector is hidden, so users need another way
|
|
148
|
+
// to edit these attributes.
|
|
149
|
+
<DropdownMenu
|
|
150
|
+
icon=""
|
|
151
|
+
toggleProps={ {
|
|
152
|
+
as: ToolbarButton,
|
|
153
|
+
} }
|
|
154
|
+
popoverProps={ {
|
|
155
|
+
className: 'is-alternate',
|
|
156
|
+
} }
|
|
157
|
+
text={ __( 'Label' ) }
|
|
158
|
+
>
|
|
159
|
+
{ () => (
|
|
160
|
+
<TextControl
|
|
161
|
+
className="wp-block-icon__toolbar-content"
|
|
162
|
+
label={ __( 'Label' ) }
|
|
163
|
+
value={ ariaLabel || '' }
|
|
164
|
+
onChange={ ( value ) =>
|
|
165
|
+
setAttributes( {
|
|
166
|
+
ariaLabel: value,
|
|
167
|
+
} )
|
|
168
|
+
}
|
|
169
|
+
help={ __(
|
|
170
|
+
'Briefly describe the icon to help screen reader users. Leave blank for decorative icons.'
|
|
171
|
+
) }
|
|
172
|
+
/>
|
|
173
|
+
) }
|
|
174
|
+
</DropdownMenu>
|
|
175
|
+
) }
|
|
100
176
|
</BlockControls>
|
|
101
|
-
{ isContentOnlyMode && icon && (
|
|
102
|
-
// Add some extra controls for content attributes when content only mode is active.
|
|
103
|
-
// With content only mode active, the inspector is hidden, so users need another way
|
|
104
|
-
// to edit these attributes.
|
|
105
|
-
<BlockControls group="other">
|
|
106
|
-
<ToolbarGroup className="components-toolbar-group">
|
|
107
|
-
<DropdownMenu
|
|
108
|
-
icon=""
|
|
109
|
-
popoverProps={ {
|
|
110
|
-
className: 'is-alternate',
|
|
111
|
-
} }
|
|
112
|
-
text={ __( 'Label' ) }
|
|
113
|
-
>
|
|
114
|
-
{ () => (
|
|
115
|
-
<TextControl
|
|
116
|
-
className="wp-block-icon__toolbar-content"
|
|
117
|
-
label={ __( 'Label' ) }
|
|
118
|
-
value={ ariaLabel || '' }
|
|
119
|
-
onChange={ ( value ) =>
|
|
120
|
-
setAttributes( { ariaLabel: value } )
|
|
121
|
-
}
|
|
122
|
-
help={ __(
|
|
123
|
-
'Briefly describe the icon to help screen reader users. Leave blank for decorative icons.'
|
|
124
|
-
) }
|
|
125
|
-
__next40pxDefaultSize
|
|
126
|
-
/>
|
|
127
|
-
) }
|
|
128
|
-
</DropdownMenu>
|
|
129
|
-
</ToolbarGroup>
|
|
130
|
-
</BlockControls>
|
|
131
|
-
) }
|
|
132
177
|
</>
|
|
133
178
|
);
|
|
134
179
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
@@ -161,7 +206,6 @@ export function Edit( { attributes, setAttributes } ) {
|
|
|
161
206
|
onChange={ ( value ) =>
|
|
162
207
|
setAttributes( { ariaLabel: value } )
|
|
163
208
|
}
|
|
164
|
-
__next40pxDefaultSize
|
|
165
209
|
/>
|
|
166
210
|
</ToolsPanelItem>
|
|
167
211
|
</ToolsPanel>
|
|
@@ -182,13 +226,15 @@ export function Edit( { attributes, setAttributes } ) {
|
|
|
182
226
|
colorProps.className,
|
|
183
227
|
borderProps.className,
|
|
184
228
|
spacingProps.className,
|
|
185
|
-
dimensionsProps.className
|
|
229
|
+
dimensionsProps.className,
|
|
230
|
+
flipClasses
|
|
186
231
|
),
|
|
187
232
|
style: {
|
|
188
233
|
...colorProps.style,
|
|
189
234
|
...borderProps.style,
|
|
190
235
|
...spacingProps.style,
|
|
191
236
|
...dimensionsProps.style,
|
|
237
|
+
...rotationStyle,
|
|
192
238
|
},
|
|
193
239
|
} }
|
|
194
240
|
/>
|
|
@@ -197,12 +243,14 @@ export function Edit( { attributes, setAttributes } ) {
|
|
|
197
243
|
className={ clsx(
|
|
198
244
|
borderProps.className,
|
|
199
245
|
spacingProps.className,
|
|
200
|
-
dimensionsProps.className
|
|
246
|
+
dimensionsProps.className,
|
|
247
|
+
flipClasses
|
|
201
248
|
) }
|
|
202
249
|
style={ {
|
|
203
250
|
...borderProps.style,
|
|
204
251
|
...spacingProps.style,
|
|
205
252
|
...dimensionsProps.style,
|
|
253
|
+
...rotationStyle,
|
|
206
254
|
height: 'auto',
|
|
207
255
|
} }
|
|
208
256
|
/>
|
package/src/icon/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import initBlock from '../utils/init-block';
|
|
|
5
5
|
import edit from './edit';
|
|
6
6
|
import metadata from './block.json';
|
|
7
7
|
import icon from './icon';
|
|
8
|
+
import variations from './variations';
|
|
8
9
|
|
|
9
10
|
const { name } = metadata;
|
|
10
11
|
export { metadata, name };
|
|
@@ -12,7 +13,7 @@ export const settings = {
|
|
|
12
13
|
icon,
|
|
13
14
|
example: {
|
|
14
15
|
attributes: {
|
|
15
|
-
icon: 'core/
|
|
16
|
+
icon: 'core/info',
|
|
16
17
|
style: {
|
|
17
18
|
dimensions: {
|
|
18
19
|
width: '48px',
|
|
@@ -20,6 +21,7 @@ export const settings = {
|
|
|
20
21
|
},
|
|
21
22
|
},
|
|
22
23
|
},
|
|
24
|
+
variations,
|
|
23
25
|
edit,
|
|
24
26
|
};
|
|
25
27
|
|
package/src/icon/index.php
CHANGED
|
@@ -96,6 +96,29 @@ function render_block_core_icon( $attributes ) {
|
|
|
96
96
|
$processor->add_class( $styles['classnames'] );
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
// Apply flip classes to the SVG.
|
|
100
|
+
$flip_horizontal = $attributes['flipHorizontal'] ?? false;
|
|
101
|
+
$flip_vertical = $attributes['flipVertical'] ?? false;
|
|
102
|
+
|
|
103
|
+
if ( $flip_horizontal ) {
|
|
104
|
+
$processor->add_class( 'is-flip-horizontal' );
|
|
105
|
+
}
|
|
106
|
+
if ( $flip_vertical ) {
|
|
107
|
+
$processor->add_class( 'is-flip-vertical' );
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
$rotation = isset( $attributes['rotation'] ) ? (int) $attributes['rotation'] : 0;
|
|
111
|
+
|
|
112
|
+
if ( $rotation ) {
|
|
113
|
+
$current_style = $processor->get_attribute( 'style' ) ?? '';
|
|
114
|
+
$rotation_css = 'rotate: ' . $rotation . 'deg;';
|
|
115
|
+
if ( $current_style ) {
|
|
116
|
+
$processor->set_attribute( 'style', $current_style . ' ' . $rotation_css );
|
|
117
|
+
} else {
|
|
118
|
+
$processor->set_attribute( 'style', $rotation_css );
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
99
122
|
$aria_label = ! empty( $attributes['ariaLabel'] ) ? $attributes['ariaLabel'] : '';
|
|
100
123
|
|
|
101
124
|
if ( ! $aria_label ) {
|
package/src/icon/style.scss
CHANGED
|
@@ -14,6 +14,18 @@
|
|
|
14
14
|
svg {
|
|
15
15
|
box-sizing: border-box;
|
|
16
16
|
fill: currentColor;
|
|
17
|
+
|
|
18
|
+
&.is-flip-horizontal {
|
|
19
|
+
transform: scaleX(-1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.is-flip-vertical {
|
|
23
|
+
transform: scaleY(-1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.is-flip-horizontal.is-flip-vertical {
|
|
27
|
+
transform: scaleX(-1) scaleY(-1);
|
|
28
|
+
}
|
|
17
29
|
}
|
|
18
30
|
}
|
|
19
31
|
|
package/src/image/README.md
CHANGED
|
@@ -79,6 +79,7 @@ _Defined via the [`styles`](https://developer.wordpress.org/block-editor/referen
|
|
|
79
79
|
|
|
80
80
|
_Defined via the [`selectors`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-selectors/) property in block.json._
|
|
81
81
|
|
|
82
|
+
- **dimensions**: `.wp-block-image img`
|
|
82
83
|
- **border**: `.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder`
|
|
83
84
|
- **shadow**: `.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder`
|
|
84
85
|
- **filter**:
|
package/src/image/block.json
CHANGED
|
@@ -141,6 +141,7 @@
|
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
143
|
"selectors": {
|
|
144
|
+
"dimensions": ".wp-block-image img",
|
|
144
145
|
"border": ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",
|
|
145
146
|
"shadow": ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",
|
|
146
147
|
"filter": {
|
package/src/image/edit.js
CHANGED
|
@@ -422,6 +422,11 @@ export function ImageEdit( {
|
|
|
422
422
|
},
|
|
423
423
|
[ context, isSingleSelected, metadata?.bindings?.url ]
|
|
424
424
|
);
|
|
425
|
+
// `height: 'auto'` is not a pinned dimension (it lets the height follow the
|
|
426
|
+
// aspect ratio, e.g. for an image pasted with both width and height). Treat
|
|
427
|
+
// it as absent so the placeholder box keeps its aspect ratio and pinned
|
|
428
|
+
// width instead of collapsing to a 100%×100% fill.
|
|
429
|
+
const pinnedHeight = height === 'auto' ? undefined : height;
|
|
425
430
|
const placeholder = ( content ) => {
|
|
426
431
|
return (
|
|
427
432
|
<Placeholder
|
|
@@ -444,11 +449,11 @@ export function ImageEdit( {
|
|
|
444
449
|
}
|
|
445
450
|
style={ {
|
|
446
451
|
aspectRatio:
|
|
447
|
-
! ( width &&
|
|
452
|
+
! ( width && pinnedHeight ) && aspectRatio
|
|
448
453
|
? aspectRatio
|
|
449
454
|
: undefined,
|
|
450
|
-
width:
|
|
451
|
-
height: width && aspectRatio ? '100%' :
|
|
455
|
+
width: pinnedHeight && aspectRatio ? '100%' : width,
|
|
456
|
+
height: width && aspectRatio ? '100%' : pinnedHeight,
|
|
452
457
|
objectFit: scale,
|
|
453
458
|
...borderProps.style,
|
|
454
459
|
...shadowProps.style,
|