@wordpress/block-library 8.29.0 → 8.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/audio/edit.js +7 -17
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js.map +1 -1
- package/build/avatar/edit.js.map +1 -1
- package/build/block/deprecated.js +71 -11
- package/build/block/deprecated.js.map +1 -1
- package/build/block/edit.js +65 -31
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +2 -2
- package/build/button/edit.js.map +1 -1
- package/build/buttons/edit.native.js.map +1 -1
- package/build/buttons/transforms.js +16 -2
- package/build/buttons/transforms.js.map +1 -1
- package/build/code/save.js +3 -1
- package/build/code/save.js.map +1 -1
- package/build/code/transforms.js +17 -6
- package/build/code/transforms.js.map +1 -1
- package/build/columns/edit.js +3 -2
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-avatar/edit.js +1 -1
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/cover/edit/block-controls.js +14 -3
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/index.js +2 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit/resizable-cover-popover.js +0 -6
- package/build/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build/cover/edit.native.js.map +1 -1
- package/build/details/edit.js +1 -0
- package/build/details/edit.js.map +1 -1
- package/build/file/deprecated.js.map +1 -1
- package/build/file/edit.js +8 -13
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/save.js.map +1 -1
- package/build/form-input/edit.js +1 -1
- package/build/form-input/edit.js.map +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery.native.js.map +1 -1
- package/build/heading/index.js +4 -3
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +17 -4
- package/build/heading/transforms.js.map +1 -1
- package/build/image/edit.js +8 -4
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +22 -8
- package/build/image/image.js.map +1 -1
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/list/ordered-list-settings.js +1 -1
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list-item/edit.js +1 -3
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/hooks/index.js +0 -7
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-indent-list-item.js +1 -0
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +1 -0
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-space.js +16 -7
- package/build/list-item/hooks/use-space.js.map +1 -1
- package/build/list-item/index.js +4 -1
- package/build/list-item/index.js.map +1 -1
- package/build/media-text/edit.js +33 -9
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/index.js +5 -0
- package/build/media-text/index.js.map +1 -1
- package/build/media-text/media-container.js +30 -11
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +1 -1
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/media-text/save.js +2 -2
- package/build/media-text/save.js.map +1 -1
- package/build/navigation/edit/index.js +23 -29
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +12 -20
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +24 -23
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +4 -4
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +15 -12
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/edit.js +12 -10
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -0
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/paragraph/edit.native.js.map +1 -1
- package/build/pattern/edit.js +11 -0
- package/build/pattern/edit.js.map +1 -1
- package/build/post-author/edit.js +1 -0
- package/build/post-author/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -0
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +12 -12
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +6 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/edit.js +1 -0
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-terms/edit.js +2 -0
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-title/edit.js +2 -2
- package/build/post-title/edit.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/utils.js +7 -5
- package/build/query/utils.js.map +1 -1
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/quote/deprecated.js +111 -12
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +7 -7
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +1 -1
- package/build/quote/index.js.map +1 -1
- package/build/quote/save.js +2 -2
- package/build/quote/save.js.map +1 -1
- package/build/read-more/edit.js +1 -0
- package/build/read-more/edit.js.map +1 -1
- package/build/search/edit.js +3 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js +2 -2
- package/build/search/edit.native.js.map +1 -1
- package/build/site-logo/edit.js +7 -2
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-title/{edit/index.js → edit.js} +1 -1
- package/build/site-title/edit.js.map +1 -0
- package/build/social-link/edit.js +1 -1
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/icons/medium.js +1 -1
- package/build/social-link/icons/medium.js.map +1 -1
- package/build/social-link/icons/reddit.js +1 -1
- package/build/social-link/icons/reddit.js.map +1 -1
- package/build/social-links/edit.native.js.map +1 -1
- package/build/spacer/edit.js.map +1 -1
- package/build/table/deprecated.js +285 -175
- package/build/table/deprecated.js.map +1 -1
- package/build/table/index.js +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/template-part/edit/index.js +53 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +2 -8
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/map-template-part-to-block-pattern.js +30 -0
- package/build/template-part/edit/utils/map-template-part-to-block-pattern.js.map +1 -0
- package/build/utils/caption.js +15 -5
- package/build/utils/caption.js.map +1 -1
- package/build/utils/get-transformed-metadata.js +57 -0
- package/build/utils/get-transformed-metadata.js.map +1 -0
- package/build/utils/hooks.js +55 -4
- package/build/utils/hooks.js.map +1 -1
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +7 -16
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +3 -8
- package/build/video/edit.native.js.map +1 -1
- package/build-module/audio/edit.js +10 -20
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/block/deprecated.js +71 -11
- package/build-module/block/deprecated.js.map +1 -1
- package/build-module/block/edit.js +66 -32
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +3 -3
- package/build-module/button/edit.js.map +1 -1
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/buttons/transforms.js +16 -2
- package/build-module/buttons/transforms.js.map +1 -1
- package/build-module/code/save.js +3 -1
- package/build-module/code/save.js.map +1 -1
- package/build-module/code/transforms.js +17 -6
- package/build-module/code/transforms.js.map +1 -1
- package/build-module/columns/edit.js +3 -2
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -1
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +15 -4
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/index.js +2 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit/resizable-cover-popover.js +1 -7
- package/build-module/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/details/edit.js +1 -0
- package/build-module/details/edit.js.map +1 -1
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/file/edit.js +9 -14
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/save.js.map +1 -1
- package/build-module/form-input/edit.js +1 -1
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery.native.js.map +1 -1
- package/build-module/heading/index.js +4 -3
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +17 -4
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/edit.js +9 -5
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +23 -9
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +1 -1
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list-item/edit.js +2 -4
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/hooks/index.js +0 -1
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-indent-list-item.js +1 -0
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +1 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-space.js +17 -8
- package/build-module/list-item/hooks/use-space.js.map +1 -1
- package/build-module/list-item/index.js +4 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/media-text/edit.js +34 -10
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/index.js +5 -0
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/media-text/media-container.js +31 -12
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +1 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/save.js +2 -2
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/navigation/edit/index.js +24 -30
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +15 -23
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +24 -23
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +4 -4
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +15 -12
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/edit.js +13 -11
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +4 -0
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/paragraph/edit.native.js.map +1 -1
- package/build-module/pattern/edit.js +11 -0
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-author/edit.js +1 -0
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -0
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +13 -13
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +6 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +1 -0
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +2 -0
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-title/edit.js +2 -2
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/utils.js +7 -5
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/quote/deprecated.js +112 -13
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +7 -7
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +1 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/save.js +2 -2
- package/build-module/quote/save.js.map +1 -1
- package/build-module/read-more/edit.js +1 -0
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/search/edit.js +3 -1
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js +2 -2
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/site-logo/edit.js +7 -2
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-title/{edit/index.js → edit.js} +1 -1
- package/build-module/site-title/edit.js.map +1 -0
- package/build-module/social-link/edit.js +1 -1
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/icons/medium.js +1 -1
- package/build-module/social-link/icons/medium.js.map +1 -1
- package/build-module/social-link/icons/reddit.js +1 -1
- package/build-module/social-link/icons/reddit.js.map +1 -1
- package/build-module/social-links/edit.native.js.map +1 -1
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/table/deprecated.js +286 -176
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/index.js +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +57 -5
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +2 -8
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/map-template-part-to-block-pattern.js +24 -0
- package/build-module/template-part/edit/utils/map-template-part-to-block-pattern.js.map +1 -0
- package/build-module/utils/caption.js +13 -3
- package/build-module/utils/caption.js.map +1 -1
- package/build-module/utils/get-transformed-metadata.js +51 -0
- package/build-module/utils/get-transformed-metadata.js.map +1 -0
- package/build-module/utils/hooks.js +54 -3
- package/build-module/utils/hooks.js.map +1 -1
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +10 -19
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +3 -8
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/common-rtl.css +1 -0
- package/build-style/common.css +1 -0
- package/build-style/cover/style-rtl.css +2 -1
- package/build-style/cover/style.css +2 -1
- package/build-style/editor-rtl.css +11 -2
- package/build-style/editor.css +11 -2
- package/build-style/file/editor-rtl.css +3 -0
- package/build-style/file/editor.css +3 -0
- package/build-style/group/editor-rtl.css +1 -1
- package/build-style/group/editor.css +1 -1
- package/build-style/media-text/editor-rtl.css +7 -1
- package/build-style/media-text/editor.css +7 -1
- package/build-style/search/style-rtl.css +2 -0
- package/build-style/search/style.css +2 -0
- package/build-style/social-links/style-rtl.css +2 -2
- package/build-style/social-links/style.css +2 -2
- package/build-style/style-rtl.css +6 -3
- package/build-style/style.css +6 -3
- package/package.json +34 -34
- package/src/archives/index.php +4 -0
- package/src/audio/edit.js +9 -19
- package/src/audio/edit.native.js +3 -3
- package/src/avatar/edit.js +1 -1
- package/src/avatar/index.php +6 -0
- package/src/block/deprecated.js +76 -11
- package/src/block/edit.js +100 -32
- package/src/block/index.php +27 -12
- package/src/block/test/edit.native.js +67 -0
- package/src/button/edit.js +4 -3
- package/src/buttons/edit.native.js +1 -1
- package/src/buttons/transforms.js +14 -4
- package/src/calendar/index.php +17 -0
- package/src/categories/index.php +6 -0
- package/src/code/save.js +7 -1
- package/src/code/transforms.js +20 -5
- package/src/columns/edit.js +3 -2
- package/src/comment-author-avatar/edit.js +1 -1
- package/src/comment-author-name/index.php +4 -0
- package/src/comment-content/index.php +4 -0
- package/src/comment-date/index.php +4 -0
- package/src/comment-edit-link/index.php +4 -0
- package/src/comment-reply-link/index.php +4 -0
- package/src/comment-template/index.php +4 -0
- package/src/comments/index.php +12 -0
- package/src/comments-pagination/index.php +4 -0
- package/src/comments-pagination-next/index.php +4 -0
- package/src/comments-pagination-numbers/index.php +4 -0
- package/src/comments-pagination-previous/index.php +4 -0
- package/src/comments-title/index.php +4 -0
- package/src/cover/edit/block-controls.js +16 -2
- package/src/cover/edit/index.js +6 -3
- package/src/cover/edit/inspector-controls.js +1 -1
- package/src/cover/edit/resizable-cover-popover.js +1 -6
- package/src/cover/edit.native.js +1 -1
- package/src/cover/index.php +4 -0
- package/src/cover/style.scss +3 -2
- package/src/details/edit.js +1 -0
- package/src/file/deprecated.js +3 -3
- package/src/file/edit.js +10 -15
- package/src/file/edit.native.js +4 -4
- package/src/file/editor.scss +3 -0
- package/src/file/index.php +4 -0
- package/src/file/save.js +1 -1
- package/src/footnotes/index.php +1 -1
- package/src/form-input/edit.js +1 -1
- package/src/gallery/edit.js +3 -3
- package/src/gallery/gallery.native.js +1 -1
- package/src/gallery/index.php +6 -0
- package/src/gallery/test/index.native.js +1 -1
- package/src/gallery/v1/edit.js +2 -2
- package/src/gallery/v1/gallery.native.js +1 -1
- package/src/group/editor.scss +1 -1
- package/src/heading/index.js +4 -3
- package/src/heading/index.php +4 -0
- package/src/heading/transforms.js +27 -8
- package/src/home-link/index.php +10 -0
- package/src/image/edit.js +13 -5
- package/src/image/edit.native.js +1 -1
- package/src/image/editor.scss +1 -0
- package/src/image/image.js +34 -22
- package/src/image/index.php +12 -1
- package/src/latest-comments/index.php +4 -0
- package/src/latest-posts/edit.native.js +1 -1
- package/src/latest-posts/index.php +8 -0
- package/src/list/ordered-list-settings.js +1 -1
- package/src/list-item/edit.js +1 -2
- package/src/list-item/edit.native.js +1 -1
- package/src/list-item/hooks/index.js +0 -1
- package/src/list-item/hooks/use-indent-list-item.js +2 -0
- package/src/list-item/hooks/use-outdent-list-item.js +2 -0
- package/src/list-item/hooks/use-space.js +16 -9
- package/src/list-item/index.js +3 -0
- package/src/loginout/index.php +4 -0
- package/src/media-text/block.json +5 -0
- package/src/media-text/edit.js +70 -19
- package/src/media-text/editor.scss +7 -1
- package/src/media-text/index.php +70 -0
- package/src/media-text/media-container.js +49 -9
- package/src/media-text/media-container.native.js +5 -3
- package/src/media-text/save.js +2 -2
- package/src/media-text/test/edit.native.js +58 -0
- package/src/missing/test/edit-integration.native.js +2 -1
- package/src/navigation/edit/index.js +68 -72
- package/src/navigation/edit/navigation-menu-delete-control.js +22 -49
- package/src/navigation/edit/navigation-menu-selector.js +39 -21
- package/src/navigation/edit/placeholder/index.js +4 -4
- package/src/navigation/edit/test/navigation-menu-selector.js +77 -55
- package/src/navigation/index.php +118 -34
- package/src/navigation/test/use-navigation-menu.js +21 -21
- package/src/navigation/use-navigation-menu.js +23 -9
- package/src/navigation-link/edit.js +12 -13
- package/src/navigation-link/index.php +14 -0
- package/src/navigation-link/link-ui.js +2 -2
- package/src/navigation-submenu/edit.js +4 -0
- package/src/navigation-submenu/index.php +8 -0
- package/src/page-list/index.php +12 -0
- package/src/page-list-item/index.php +2 -0
- package/src/paragraph/edit.native.js +1 -1
- package/src/paragraph/test/edit.native.js +36 -0
- package/src/pattern/edit.js +14 -0
- package/src/pattern/index.php +2 -0
- package/src/post-author/edit.js +1 -0
- package/src/post-author/index.php +4 -0
- package/src/post-author-biography/index.php +4 -0
- package/src/post-author-name/index.php +4 -0
- package/src/post-comments-form/index.php +6 -0
- package/src/post-content/index.php +4 -0
- package/src/post-date/index.php +4 -0
- package/src/post-excerpt/edit.js +2 -1
- package/src/post-excerpt/index.php +4 -0
- package/src/post-featured-image/block.json +6 -0
- package/src/post-featured-image/dimension-controls.js +4 -4
- package/src/post-featured-image/edit.js +14 -12
- package/src/post-featured-image/index.php +15 -0
- package/src/post-navigation-link/edit.js +2 -1
- package/src/post-navigation-link/index.php +4 -0
- package/src/post-template/index.php +6 -0
- package/src/post-terms/edit.js +2 -0
- package/src/post-terms/index.php +6 -0
- package/src/post-title/edit.js +49 -43
- package/src/post-title/index.php +2 -0
- package/src/query/edit/pattern-selection-modal.js +1 -1
- package/src/query/index.php +2 -0
- package/src/query/utils.js +6 -4
- package/src/query-no-results/index.php +4 -0
- package/src/query-pagination/index.php +4 -0
- package/src/query-pagination-next/edit.js +1 -1
- package/src/query-pagination-next/index.php +4 -0
- package/src/query-pagination-numbers/index.php +4 -0
- package/src/query-pagination-previous/edit.js +1 -1
- package/src/query-pagination-previous/index.php +4 -0
- package/src/query-title/index.php +4 -0
- package/src/quote/block.json +1 -1
- package/src/quote/deprecated.js +110 -15
- package/src/quote/edit.js +16 -10
- package/src/quote/save.js +2 -2
- package/src/quote/test/__snapshots__/transforms.native.js.snap +2 -2
- package/src/read-more/edit.js +2 -1
- package/src/read-more/index.php +4 -0
- package/src/rss/index.php +4 -0
- package/src/search/edit.js +3 -1
- package/src/search/edit.native.js +6 -6
- package/src/search/index.php +20 -2
- package/src/search/style.scss +2 -0
- package/src/shortcode/index.php +4 -0
- package/src/site-logo/edit.js +11 -6
- package/src/site-logo/index.php +20 -0
- package/src/site-tagline/index.php +4 -0
- package/src/site-title/index.php +4 -0
- package/src/social-link/edit.js +2 -2
- package/src/social-link/icons/medium.js +1 -1
- package/src/social-link/icons/reddit.js +1 -1
- package/src/social-link/index.php +22 -9
- package/src/social-link/socials-with-bg.scss +1 -1
- package/src/social-link/socials-without-bg.scss +1 -1
- package/src/social-links/edit.native.js +1 -1
- package/src/spacer/edit.js +1 -1
- package/src/table/block.json +1 -1
- package/src/table/deprecated.js +308 -175
- package/src/table-of-contents/edit.js +1 -1
- package/src/tag-cloud/index.php +4 -0
- package/src/template-part/edit/index.js +91 -4
- package/src/template-part/edit/selection-modal.js +4 -8
- package/src/template-part/edit/utils/map-template-part-to-block-pattern.js +23 -0
- package/src/template-part/index.php +10 -0
- package/src/term-description/index.php +4 -0
- package/src/utils/caption.js +10 -1
- package/src/utils/get-transformed-metadata.js +65 -0
- package/src/utils/hooks.js +53 -3
- package/src/video/edit-common-settings.js +1 -1
- package/src/video/edit.js +10 -18
- package/src/video/edit.native.js +7 -8
- package/src/video/test/edit.native.js +0 -14
- package/tsconfig.json +1 -0
- package/build/list-item/hooks/use-copy.js +0 -39
- package/build/list-item/hooks/use-copy.js.map +0 -1
- package/build/site-title/edit/index.js.map +0 -1
- package/build-module/list-item/hooks/use-copy.js +0 -32
- package/build-module/list-item/hooks/use-copy.js.map +0 -1
- package/build-module/site-title/edit/index.js.map +0 -1
- package/src/list-item/hooks/use-copy.js +0 -38
- /package/src/site-title/{edit/index.js → edit.js} +0 -0
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/comment-author-name` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
* @param string $content Block default content.
|
|
13
15
|
* @param WP_Block $block Block instance.
|
|
@@ -53,6 +55,8 @@ function render_block_core_comment_author_name( $attributes, $content, $block )
|
|
|
53
55
|
|
|
54
56
|
/**
|
|
55
57
|
* Registers the `core/comment-author-name` block on the server.
|
|
58
|
+
*
|
|
59
|
+
* @since 6.0.0
|
|
56
60
|
*/
|
|
57
61
|
function register_block_core_comment_author_name() {
|
|
58
62
|
register_block_type_from_metadata(
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/comment-content` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
* @param string $content Block default content.
|
|
13
15
|
* @param WP_Block $block Block instance.
|
|
@@ -69,6 +71,8 @@ function render_block_core_comment_content( $attributes, $content, $block ) {
|
|
|
69
71
|
|
|
70
72
|
/**
|
|
71
73
|
* Registers the `core/comment-content` block on the server.
|
|
74
|
+
*
|
|
75
|
+
* @since 6.0.0
|
|
72
76
|
*/
|
|
73
77
|
function register_block_core_comment_content() {
|
|
74
78
|
register_block_type_from_metadata(
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/comment-date` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
* @param string $content Block default content.
|
|
13
15
|
* @param WP_Block $block Block instance.
|
|
@@ -46,6 +48,8 @@ function render_block_core_comment_date( $attributes, $content, $block ) {
|
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
50
|
* Registers the `core/comment-date` block on the server.
|
|
51
|
+
*
|
|
52
|
+
* @since 6.0.0
|
|
49
53
|
*/
|
|
50
54
|
function register_block_core_comment_date() {
|
|
51
55
|
register_block_type_from_metadata(
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/comment-edit-link` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
* @param string $content Block default content.
|
|
13
15
|
* @param WP_Block $block Block instance.
|
|
@@ -48,6 +50,8 @@ function render_block_core_comment_edit_link( $attributes, $content, $block ) {
|
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
52
|
* Registers the `core/comment-edit-link` block on the server.
|
|
53
|
+
*
|
|
54
|
+
* @since 6.0.0
|
|
51
55
|
*/
|
|
52
56
|
function register_block_core_comment_edit_link() {
|
|
53
57
|
register_block_type_from_metadata(
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/comment-reply-link` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
* @param string $content Block default content.
|
|
13
15
|
* @param WP_Block $block Block instance.
|
|
@@ -70,6 +72,8 @@ function render_block_core_comment_reply_link( $attributes, $content, $block ) {
|
|
|
70
72
|
|
|
71
73
|
/**
|
|
72
74
|
* Registers the `core/comment-reply-link` block on the server.
|
|
75
|
+
*
|
|
76
|
+
* @since 6.0.0
|
|
73
77
|
*/
|
|
74
78
|
function register_block_core_comment_reply_link() {
|
|
75
79
|
register_block_type_from_metadata(
|
|
@@ -92,6 +92,8 @@ function block_core_comment_template_render_comments( $comments, $block ) {
|
|
|
92
92
|
/**
|
|
93
93
|
* Renders the `core/comment-template` block on the server.
|
|
94
94
|
*
|
|
95
|
+
* @since 6.0.0
|
|
96
|
+
*
|
|
95
97
|
* @param array $attributes Block attributes.
|
|
96
98
|
* @param string $content Block default content.
|
|
97
99
|
* @param WP_Block $block Block instance.
|
|
@@ -136,6 +138,8 @@ function render_block_core_comment_template( $attributes, $content, $block ) {
|
|
|
136
138
|
|
|
137
139
|
/**
|
|
138
140
|
* Registers the `core/comment-template` block on the server.
|
|
141
|
+
*
|
|
142
|
+
* @since 6.0.0
|
|
139
143
|
*/
|
|
140
144
|
function register_block_core_comment_template() {
|
|
141
145
|
register_block_type_from_metadata(
|
package/src/comments/index.php
CHANGED
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
* the block is in legacy mode. If not, the HTML generated in the editor is
|
|
17
17
|
* returned instead.
|
|
18
18
|
*
|
|
19
|
+
* @since 6.1.0
|
|
20
|
+
*
|
|
21
|
+
* @global WP_Post $post Global post object.
|
|
22
|
+
*
|
|
19
23
|
* @param array $attributes Block attributes.
|
|
20
24
|
* @param string $content Block default content.
|
|
21
25
|
* @param WP_Block $block Block instance.
|
|
@@ -83,6 +87,8 @@ function render_block_core_comments( $attributes, $content, $block ) {
|
|
|
83
87
|
|
|
84
88
|
/**
|
|
85
89
|
* Registers the `core/comments` block on the server.
|
|
90
|
+
*
|
|
91
|
+
* @since 6.1.0
|
|
86
92
|
*/
|
|
87
93
|
function register_block_core_comments() {
|
|
88
94
|
register_block_type_from_metadata(
|
|
@@ -98,6 +104,8 @@ add_action( 'init', 'register_block_core_comments' );
|
|
|
98
104
|
/**
|
|
99
105
|
* Use the button block classes for the form-submit button.
|
|
100
106
|
*
|
|
107
|
+
* @since 6.1.0
|
|
108
|
+
*
|
|
101
109
|
* @param array $fields The default comment form arguments.
|
|
102
110
|
*
|
|
103
111
|
* @return array Returns the modified fields.
|
|
@@ -116,6 +124,8 @@ add_filter( 'comment_form_defaults', 'comments_block_form_defaults' );
|
|
|
116
124
|
* Enqueues styles from the legacy `core/post-comments` block. These styles are
|
|
117
125
|
* required only by the block's fallback.
|
|
118
126
|
*
|
|
127
|
+
* @since 6.1.0
|
|
128
|
+
*
|
|
119
129
|
* @param string $block_name Name of the new block type.
|
|
120
130
|
*/
|
|
121
131
|
function enqueue_legacy_post_comments_block_styles( $block_name ) {
|
|
@@ -141,6 +151,8 @@ function enqueue_legacy_post_comments_block_styles( $block_name ) {
|
|
|
141
151
|
* The same approach was followed when core/query-loop was renamed to
|
|
142
152
|
* core/post-template.
|
|
143
153
|
*
|
|
154
|
+
* @since 6.1.0
|
|
155
|
+
*
|
|
144
156
|
* @see https://github.com/WordPress/gutenberg/pull/41807
|
|
145
157
|
* @see https://github.com/WordPress/gutenberg/pull/32514
|
|
146
158
|
*/
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/comments-pagination` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
* @param string $content Block default content.
|
|
13
15
|
*
|
|
@@ -34,6 +36,8 @@ function render_block_core_comments_pagination( $attributes, $content ) {
|
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
38
|
* Registers the `core/comments-pagination` block on the server.
|
|
39
|
+
*
|
|
40
|
+
* @since 6.0.0
|
|
37
41
|
*/
|
|
38
42
|
function register_block_core_comments_pagination() {
|
|
39
43
|
register_block_type_from_metadata(
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/comments-pagination-next` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
* @param string $content Block default content.
|
|
13
15
|
* @param WP_Block $block Block instance.
|
|
@@ -48,6 +50,8 @@ function render_block_core_comments_pagination_next( $attributes, $content, $blo
|
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
52
|
* Registers the `core/comments-pagination-next` block on the server.
|
|
53
|
+
*
|
|
54
|
+
* @since 6.0.0
|
|
51
55
|
*/
|
|
52
56
|
function register_block_core_comments_pagination_next() {
|
|
53
57
|
register_block_type_from_metadata(
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/comments-pagination-numbers` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
* @param string $content Block default content.
|
|
13
15
|
* @param WP_Block $block Block instance.
|
|
@@ -50,6 +52,8 @@ function render_block_core_comments_pagination_numbers( $attributes, $content, $
|
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
54
|
* Registers the `core/comments-pagination-numbers` block on the server.
|
|
55
|
+
*
|
|
56
|
+
* @since 6.0.0
|
|
53
57
|
*/
|
|
54
58
|
function register_block_core_comments_pagination_numbers() {
|
|
55
59
|
register_block_type_from_metadata(
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/comments-pagination-previous` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
* @param string $content Block default content.
|
|
13
15
|
* @param WP_Block $block Block instance.
|
|
@@ -40,6 +42,8 @@ function render_block_core_comments_pagination_previous( $attributes, $content,
|
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
44
|
* Registers the `core/comments-pagination-previous` block on the server.
|
|
45
|
+
*
|
|
46
|
+
* @since 6.0.0
|
|
43
47
|
*/
|
|
44
48
|
function register_block_core_comments_pagination_previous() {
|
|
45
49
|
register_block_type_from_metadata(
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/comments-title` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
*
|
|
13
15
|
* @return string Return the post comments title.
|
|
@@ -84,6 +86,8 @@ function render_block_core_comments_title( $attributes ) {
|
|
|
84
86
|
|
|
85
87
|
/**
|
|
86
88
|
* Registers the `core/comments-title` block on the server.
|
|
89
|
+
*
|
|
90
|
+
* @since 6.0.0
|
|
87
91
|
*/
|
|
88
92
|
function register_block_core_comments_title() {
|
|
89
93
|
register_block_type_from_metadata(
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
MediaReplaceFlow,
|
|
9
9
|
__experimentalBlockAlignmentMatrixControl as BlockAlignmentMatrixControl,
|
|
10
10
|
__experimentalBlockFullHeightAligmentControl as FullHeightAlignmentControl,
|
|
11
|
+
privateApis as blockEditorPrivateApis,
|
|
11
12
|
} from '@wordpress/block-editor';
|
|
12
13
|
import { __ } from '@wordpress/i18n';
|
|
13
14
|
|
|
@@ -15,6 +16,9 @@ import { __ } from '@wordpress/i18n';
|
|
|
15
16
|
* Internal dependencies
|
|
16
17
|
*/
|
|
17
18
|
import { ALLOWED_MEDIA_TYPES } from '../shared';
|
|
19
|
+
import { unlock } from '../../lock-unlock';
|
|
20
|
+
|
|
21
|
+
const { cleanEmptyObject } = unlock( blockEditorPrivateApis );
|
|
18
22
|
|
|
19
23
|
export default function CoverBlockControls( {
|
|
20
24
|
attributes,
|
|
@@ -30,7 +34,10 @@ export default function CoverBlockControls( {
|
|
|
30
34
|
const [ prevMinHeightValue, setPrevMinHeightValue ] = useState( minHeight );
|
|
31
35
|
const [ prevMinHeightUnit, setPrevMinHeightUnit ] =
|
|
32
36
|
useState( minHeightUnit );
|
|
33
|
-
const isMinFullHeight =
|
|
37
|
+
const isMinFullHeight =
|
|
38
|
+
minHeightUnit === 'vh' &&
|
|
39
|
+
minHeight === 100 &&
|
|
40
|
+
! attributes?.style?.dimensions?.aspectRatio;
|
|
34
41
|
const toggleMinFullHeight = () => {
|
|
35
42
|
if ( isMinFullHeight ) {
|
|
36
43
|
// If there aren't previous values, take the default ones.
|
|
@@ -51,10 +58,17 @@ export default function CoverBlockControls( {
|
|
|
51
58
|
setPrevMinHeightValue( minHeight );
|
|
52
59
|
setPrevMinHeightUnit( minHeightUnit );
|
|
53
60
|
|
|
54
|
-
// Set full height.
|
|
61
|
+
// Set full height, and clear any aspect ratio value.
|
|
55
62
|
return setAttributes( {
|
|
56
63
|
minHeight: 100,
|
|
57
64
|
minHeightUnit: 'vh',
|
|
65
|
+
style: cleanEmptyObject( {
|
|
66
|
+
...attributes?.style,
|
|
67
|
+
dimensions: {
|
|
68
|
+
...attributes?.style?.dimensions,
|
|
69
|
+
aspectRatio: undefined, // Reset aspect ratio when minHeight is set.
|
|
70
|
+
},
|
|
71
|
+
} ),
|
|
58
72
|
} );
|
|
59
73
|
};
|
|
60
74
|
|
package/src/cover/edit/index.js
CHANGED
|
@@ -464,7 +464,7 @@ function CoverEdit( {
|
|
|
464
464
|
>
|
|
465
465
|
<div className="wp-block-cover__placeholder-background-options">
|
|
466
466
|
<ColorPalette
|
|
467
|
-
disableCustomColors
|
|
467
|
+
disableCustomColors
|
|
468
468
|
value={ overlayColor.color }
|
|
469
469
|
onChange={ onSetOverlayColor }
|
|
470
470
|
clearable={ false }
|
|
@@ -489,6 +489,9 @@ function CoverEdit( {
|
|
|
489
489
|
getPositionClassName( contentPosition )
|
|
490
490
|
);
|
|
491
491
|
|
|
492
|
+
const showOverlay =
|
|
493
|
+
url || ! useFeaturedImage || ( useFeaturedImage && ! url );
|
|
494
|
+
|
|
492
495
|
return (
|
|
493
496
|
<>
|
|
494
497
|
{ blockControls }
|
|
@@ -500,7 +503,7 @@ function CoverEdit( {
|
|
|
500
503
|
data-url={ url }
|
|
501
504
|
>
|
|
502
505
|
{ resizeListener }
|
|
503
|
-
{
|
|
506
|
+
{ showOverlay && (
|
|
504
507
|
<span
|
|
505
508
|
aria-hidden="true"
|
|
506
509
|
className={ classnames(
|
|
@@ -525,7 +528,7 @@ function CoverEdit( {
|
|
|
525
528
|
{ ! url && useFeaturedImage && (
|
|
526
529
|
<Placeholder
|
|
527
530
|
className="wp-block-cover__image--placeholder-image"
|
|
528
|
-
withIllustration
|
|
531
|
+
withIllustration
|
|
529
532
|
/>
|
|
530
533
|
) }
|
|
531
534
|
|
|
@@ -6,7 +6,7 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { useState } from '@wordpress/element';
|
|
10
10
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -40,10 +40,6 @@ export default function ResizableCoverPopover( {
|
|
|
40
40
|
...props
|
|
41
41
|
} ) {
|
|
42
42
|
const [ isResizing, setIsResizing ] = useState( false );
|
|
43
|
-
const dimensions = useMemo(
|
|
44
|
-
() => ( { height, minHeight, width } ),
|
|
45
|
-
[ minHeight, height, width ]
|
|
46
|
-
);
|
|
47
43
|
|
|
48
44
|
const resizableBoxProps = {
|
|
49
45
|
className: classnames( className, { 'is-resizing': isResizing } ),
|
|
@@ -75,7 +71,6 @@ export default function ResizableCoverPopover( {
|
|
|
75
71
|
return (
|
|
76
72
|
<ResizableBoxPopover
|
|
77
73
|
className="block-library-cover__resizable-box-popover"
|
|
78
|
-
__unstableRefreshSize={ dimensions }
|
|
79
74
|
resizableBoxProps={ resizableBoxProps }
|
|
80
75
|
{ ...props }
|
|
81
76
|
/>
|
package/src/cover/edit.native.js
CHANGED
package/src/cover/index.php
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/cover` block on server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes The block attributes.
|
|
12
14
|
* @param string $content The block rendered content.
|
|
13
15
|
*
|
|
@@ -66,6 +68,8 @@ function render_block_core_cover( $attributes, $content ) {
|
|
|
66
68
|
|
|
67
69
|
/**
|
|
68
70
|
* Registers the `core/cover` block renderer on server.
|
|
71
|
+
*
|
|
72
|
+
* @since 6.0.0
|
|
69
73
|
*/
|
|
70
74
|
function register_block_core_cover() {
|
|
71
75
|
register_block_type_from_metadata(
|
package/src/cover/style.scss
CHANGED
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
align-items: center;
|
|
9
9
|
padding: 1em;
|
|
10
10
|
// Prevent the `wp-block-cover__background` span from overflowing the container when border-radius is applied.
|
|
11
|
+
// `overflow: hidden` is provided as a fallback for browsers that don't support `overflow: clip`.
|
|
12
|
+
overflow: hidden;
|
|
11
13
|
// Use clip instead of overflow: hidden so that sticky position works on child elements.
|
|
12
|
-
|
|
13
|
-
overflow-x: clip;
|
|
14
|
+
overflow: clip;
|
|
14
15
|
// This block has customizable padding, border-box makes that more predictable.
|
|
15
16
|
box-sizing: border-box;
|
|
16
17
|
// Keep the flex layout direction to the physical direction (LTR) in RTL languages.
|
package/src/details/edit.js
CHANGED
|
@@ -64,6 +64,7 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) {
|
|
|
64
64
|
>
|
|
65
65
|
<summary onClick={ ( event ) => event.preventDefault() }>
|
|
66
66
|
<RichText
|
|
67
|
+
identifier="summary"
|
|
67
68
|
aria-label={ __( 'Write summary' ) }
|
|
68
69
|
placeholder={ __( 'Write summary…' ) }
|
|
69
70
|
allowedFormats={ [] }
|
package/src/file/deprecated.js
CHANGED
|
@@ -131,7 +131,7 @@ const v3 = {
|
|
|
131
131
|
'wp-block-file__button',
|
|
132
132
|
__experimentalGetElementClassName( 'button' )
|
|
133
133
|
) }
|
|
134
|
-
download
|
|
134
|
+
download
|
|
135
135
|
aria-describedby={ describedById }
|
|
136
136
|
>
|
|
137
137
|
<RichText.Content value={ downloadButtonText } />
|
|
@@ -259,7 +259,7 @@ const v2 = {
|
|
|
259
259
|
<a
|
|
260
260
|
href={ href }
|
|
261
261
|
className="wp-block-file__button"
|
|
262
|
-
download
|
|
262
|
+
download
|
|
263
263
|
aria-describedby={ describedById }
|
|
264
264
|
>
|
|
265
265
|
<RichText.Content value={ downloadButtonText } />
|
|
@@ -372,7 +372,7 @@ const v1 = {
|
|
|
372
372
|
<a
|
|
373
373
|
href={ href }
|
|
374
374
|
className="wp-block-file__button"
|
|
375
|
-
download
|
|
375
|
+
download
|
|
376
376
|
>
|
|
377
377
|
<RichText.Content value={ downloadButtonText } />
|
|
378
378
|
</a>
|
package/src/file/edit.js
CHANGED
|
@@ -6,7 +6,7 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { isBlobURL } from '@wordpress/blob';
|
|
10
10
|
import {
|
|
11
11
|
__unstableGetAnimateClassName as getAnimateClassName,
|
|
12
12
|
ResizableBox,
|
|
@@ -36,6 +36,7 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
36
36
|
import FileBlockInspector from './inspector';
|
|
37
37
|
import { browserSupportsPdfs } from './utils';
|
|
38
38
|
import removeAnchorTag from '../utils/remove-anchor-tag';
|
|
39
|
+
import { useUploadMediaFromBlobURL } from '../utils/hooks';
|
|
39
40
|
|
|
40
41
|
export const MIN_PREVIEW_HEIGHT = 200;
|
|
41
42
|
export const MAX_PREVIEW_HEIGHT = 2000;
|
|
@@ -72,7 +73,6 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
72
73
|
displayPreview,
|
|
73
74
|
previewHeight,
|
|
74
75
|
} = attributes;
|
|
75
|
-
const { getSettings } = useSelect( blockEditorStore );
|
|
76
76
|
const { media } = useSelect(
|
|
77
77
|
( select ) => ( {
|
|
78
78
|
media:
|
|
@@ -86,20 +86,13 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
86
86
|
const { createErrorNotice } = useDispatch( noticesStore );
|
|
87
87
|
const { toggleSelection } = useDispatch( blockEditorStore );
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
getSettings().mediaUpload( {
|
|
95
|
-
filesList: [ file ],
|
|
96
|
-
onFileChange: ( [ newMedia ] ) => onSelectFile( newMedia ),
|
|
97
|
-
onError: onUploadError,
|
|
98
|
-
} );
|
|
99
|
-
|
|
100
|
-
revokeBlobURL( href );
|
|
101
|
-
}
|
|
89
|
+
useUploadMediaFromBlobURL( {
|
|
90
|
+
url: href,
|
|
91
|
+
onChange: onSelectFile,
|
|
92
|
+
onError: onUploadError,
|
|
93
|
+
} );
|
|
102
94
|
|
|
95
|
+
useEffect( () => {
|
|
103
96
|
if ( RichText.isEmpty( downloadButtonText ) ) {
|
|
104
97
|
setAttributes( {
|
|
105
98
|
downloadButtonText: _x( 'Download', 'button label' ),
|
|
@@ -261,6 +254,7 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
261
254
|
) }
|
|
262
255
|
<div className={ 'wp-block-file__content-wrapper' }>
|
|
263
256
|
<RichText
|
|
257
|
+
identifier="fileName"
|
|
264
258
|
tagName="a"
|
|
265
259
|
value={ fileName }
|
|
266
260
|
placeholder={ __( 'Write file name…' ) }
|
|
@@ -280,6 +274,7 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
280
274
|
>
|
|
281
275
|
{ /* Using RichText here instead of PlainText so that it can be styled like a button. */ }
|
|
282
276
|
<RichText
|
|
277
|
+
identifier="downloadButtonText"
|
|
283
278
|
tagName="div" // Must be block-level or else cursor disappears.
|
|
284
279
|
aria-label={ __( 'Download button text' ) }
|
|
285
280
|
className={ classnames(
|
package/src/file/edit.native.js
CHANGED
|
@@ -282,7 +282,7 @@ export class FileEdit extends Component {
|
|
|
282
282
|
value={ textLinkHref }
|
|
283
283
|
onChange={ this.onChangeLinkDestinationOption }
|
|
284
284
|
options={ linkDestinationOptions }
|
|
285
|
-
hideCancelButton
|
|
285
|
+
hideCancelButton
|
|
286
286
|
/>
|
|
287
287
|
<ToggleControl
|
|
288
288
|
icon={ external }
|
|
@@ -469,7 +469,7 @@ export class FileEdit extends Component {
|
|
|
469
469
|
tagName="p"
|
|
470
470
|
underlineColorAndroid="transparent"
|
|
471
471
|
value={ fileName }
|
|
472
|
-
deleteEnter
|
|
472
|
+
deleteEnter
|
|
473
473
|
textAlign={ this.getTextAlignmentForAlignment(
|
|
474
474
|
align
|
|
475
475
|
) }
|
|
@@ -505,7 +505,7 @@ export class FileEdit extends Component {
|
|
|
505
505
|
textAlign="center"
|
|
506
506
|
minWidth={ minWidth }
|
|
507
507
|
maxWidth={ this.state.maxWidth }
|
|
508
|
-
deleteEnter
|
|
508
|
+
deleteEnter
|
|
509
509
|
style={ styles.buttonText }
|
|
510
510
|
value={ downloadButtonText }
|
|
511
511
|
placeholder={ placeholderText }
|
|
@@ -565,7 +565,7 @@ export class FileEdit extends Component {
|
|
|
565
565
|
return (
|
|
566
566
|
<MediaUpload
|
|
567
567
|
allowedTypes={ [ MEDIA_TYPE_ANY ] }
|
|
568
|
-
isReplacingMedia
|
|
568
|
+
isReplacingMedia
|
|
569
569
|
onSelect={ this.onSelectFile }
|
|
570
570
|
render={ ( { open, getMediaOptions } ) => {
|
|
571
571
|
return this.getFileComponent( open, getMediaOptions );
|
package/src/file/editor.scss
CHANGED
package/src/file/index.php
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* When the `core/file` block is rendering, check if we need to enqueue the `wp-block-file-view` script.
|
|
10
10
|
*
|
|
11
|
+
* @since 5.8.0
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes The block attributes.
|
|
12
14
|
* @param string $content The block content.
|
|
13
15
|
* @param WP_Block $block The parsed block.
|
|
@@ -65,6 +67,8 @@ function render_block_core_file( $attributes, $content ) {
|
|
|
65
67
|
|
|
66
68
|
/**
|
|
67
69
|
* Registers the `core/file` block on server.
|
|
70
|
+
*
|
|
71
|
+
* @since 5.8.0
|
|
68
72
|
*/
|
|
69
73
|
function register_block_core_file() {
|
|
70
74
|
register_block_type_from_metadata(
|
package/src/file/save.js
CHANGED
|
@@ -73,7 +73,7 @@ export default function save( { attributes } ) {
|
|
|
73
73
|
'wp-block-file__button',
|
|
74
74
|
__experimentalGetElementClassName( 'button' )
|
|
75
75
|
) }
|
|
76
|
-
download
|
|
76
|
+
download
|
|
77
77
|
aria-describedby={ describedById }
|
|
78
78
|
>
|
|
79
79
|
<RichText.Content value={ downloadButtonText } />
|
package/src/footnotes/index.php
CHANGED
package/src/form-input/edit.js
CHANGED
|
@@ -35,7 +35,7 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
|
|
|
35
35
|
<>
|
|
36
36
|
{ 'hidden' !== type && (
|
|
37
37
|
<InspectorControls>
|
|
38
|
-
<PanelBody title={ __( '
|
|
38
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
39
39
|
{ 'checkbox' !== type && (
|
|
40
40
|
<CheckboxControl
|
|
41
41
|
label={ __( 'Inline label' ) }
|
package/src/gallery/edit.js
CHANGED
|
@@ -546,7 +546,7 @@ function GalleryEdit( props ) {
|
|
|
546
546
|
value={ sizeSlug }
|
|
547
547
|
options={ imageSizeOptions }
|
|
548
548
|
onChange={ updateImagesSize }
|
|
549
|
-
hideCancelButton
|
|
549
|
+
hideCancelButton
|
|
550
550
|
size="__unstable-large"
|
|
551
551
|
/>
|
|
552
552
|
) }
|
|
@@ -556,7 +556,7 @@ function GalleryEdit( props ) {
|
|
|
556
556
|
value={ linkTo }
|
|
557
557
|
onChange={ setLinkTo }
|
|
558
558
|
options={ linkOptions }
|
|
559
|
-
hideCancelButton
|
|
559
|
+
hideCancelButton
|
|
560
560
|
size="__unstable-large"
|
|
561
561
|
/>
|
|
562
562
|
<ToggleControl
|
|
@@ -602,7 +602,7 @@ function GalleryEdit( props ) {
|
|
|
602
602
|
handleUpload={ false }
|
|
603
603
|
onSelect={ updateImages }
|
|
604
604
|
name={ __( 'Add' ) }
|
|
605
|
-
multiple
|
|
605
|
+
multiple
|
|
606
606
|
mediaIds={ images
|
|
607
607
|
.filter( ( image ) => image.id )
|
|
608
608
|
.map( ( image ) => image.id ) }
|
|
@@ -100,7 +100,7 @@ export const Gallery = ( props ) => {
|
|
|
100
100
|
<BlockCaption
|
|
101
101
|
clientId={ clientId }
|
|
102
102
|
isSelected={ isCaptionSelected }
|
|
103
|
-
accessible
|
|
103
|
+
accessible
|
|
104
104
|
accessibilityLabelCreator={ ( caption ) =>
|
|
105
105
|
RichText.isEmpty( caption )
|
|
106
106
|
? /* translators: accessibility text. Empty gallery caption. */
|