@wordpress/block-library 7.8.0 → 7.11.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 +6 -0
- package/build/audio/edit.js +1 -0
- package/build/audio/edit.js.map +1 -1
- package/build/audio/save.js +2 -1
- package/build/audio/save.js.map +1 -1
- package/build/avatar/hooks.js +2 -2
- package/build/avatar/hooks.js.map +1 -1
- package/build/button/edit.js +3 -2
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +1 -24
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +1 -1
- package/build/button/save.js.map +1 -1
- package/build/buttons/edit.js +1 -1
- package/build/buttons/edit.js.map +1 -1
- package/build/columns/edit.native.js +1 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/variations.js +2 -2
- package/build/columns/variations.js.map +1 -1
- package/build/comment-author-name/edit.js +3 -5
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-author-name/index.js +0 -4
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-date/edit.js +4 -4
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-date/index.js +0 -4
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/index.js +0 -4
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +0 -4
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/index.js +1 -1
- package/build/comments/deprecated.js +65 -0
- package/build/comments/deprecated.js.map +1 -0
- package/build/comments/edit/comments-legacy.js +73 -0
- package/build/comments/edit/comments-legacy.js.map +1 -0
- package/build/comments/{edit.js → edit/index.js} +17 -30
- package/build/comments/edit/index.js.map +1 -0
- package/build/comments/edit/placeholder.js +117 -0
- package/build/comments/edit/placeholder.js.map +1 -0
- package/build/comments/edit/template.js +39 -0
- package/build/comments/edit/template.js.map +1 -0
- package/build/comments/index.js +11 -3
- package/build/comments/index.js.map +1 -1
- package/build/comments/save.js +12 -4
- package/build/comments/save.js.map +1 -1
- package/build/comments-pagination/index.js +1 -1
- package/build/comments-title/deprecated.js +1 -4
- package/build/comments-title/deprecated.js.map +1 -1
- package/build/comments-title/index.js +1 -1
- package/build/cover/edit/block-controls.js +2 -12
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/cover-placeholder.js +3 -1
- package/build/cover/edit/cover-placeholder.js.map +1 -1
- package/build/cover/edit/index.js +19 -4
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/index.js +1 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/transforms.js +3 -2
- package/build/cover/transforms.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +1 -3
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/embed-preview.js +1 -0
- package/build/embed/embed-preview.js.map +1 -1
- package/build/embed/icons.js +21 -1
- package/build/embed/icons.js.map +1 -1
- package/build/embed/save.js +1 -0
- package/build/embed/save.js.map +1 -1
- package/build/embed/variations.js +11 -0
- package/build/embed/variations.js.map +1 -1
- package/build/file/edit.js +1 -1
- package/build/file/edit.js.map +1 -1
- package/build/file/save.js +1 -1
- package/build/file/save.js.map +1 -1
- package/build/gallery/edit.js +11 -19
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +1 -1
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/save.js +1 -1
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/transforms.js +32 -22
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-get-media.js +7 -18
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-get-media.native.js +59 -0
- package/build/gallery/use-get-media.native.js.map +1 -0
- package/build/gallery/v1/edit.js +3 -3
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery-image.js +1 -0
- package/build/gallery/v1/gallery-image.js.map +1 -1
- package/build/gallery/v1/gallery.js +1 -1
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/gallery/v1/save.js +10 -2
- package/build/gallery/v1/save.js.map +1 -1
- package/build/group/edit.js +1 -3
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +2 -0
- package/build/group/index.js.map +1 -1
- package/build/group/variations.js +1 -1
- package/build/group/variations.js.map +1 -1
- package/build/heading/heading-level-dropdown.js +2 -1
- package/build/heading/heading-level-dropdown.js.map +1 -1
- package/build/heading/index.js +9 -4
- package/build/heading/index.js.map +1 -1
- package/build/html/edit.js +11 -20
- package/build/html/edit.js.map +1 -1
- package/build/html/preview.js +48 -0
- package/build/html/preview.js.map +1 -0
- package/build/image/deprecated.js +77 -9
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +3 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +20 -9
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +28 -20
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -1
- package/build/image/index.js.map +1 -1
- package/build/image/save.js +9 -2
- package/build/image/save.js.map +1 -1
- package/build/index.js +1 -3
- package/build/index.js.map +1 -1
- package/build/index.native.js +3 -13
- package/build/index.native.js.map +1 -1
- package/build/latest-posts/edit.js +1 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/transforms.js +4 -63
- package/build/list/transforms.js.map +1 -1
- package/build/list/v2/transforms.js +31 -42
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +14 -9
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +8 -8
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-enter.js +7 -4
- package/build/list-item/hooks/use-enter.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +174 -0
- package/build/list-item/hooks/use-merge.js.map +1 -0
- package/build/list-item/hooks/use-outdent-list-item.js +93 -36
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/utils.js +125 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/deprecated.js +134 -7
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +2 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/save.js +13 -0
- package/build/media-text/save.js.map +1 -1
- package/build/more/edit.js +2 -4
- package/build/more/edit.js.map +1 -1
- package/build/more/save.js +1 -7
- package/build/more/save.js.map +1 -1
- package/build/navigation/edit/index.js +1 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/index.js +9 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +16 -74
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/view.js +6 -1
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +5 -4
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/hooks.js +0 -16
- package/build/navigation-link/hooks.js.map +1 -1
- package/build/navigation-link/index.js +1 -1
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/view.js +6 -1
- package/build/navigation-submenu/view.js.map +1 -1
- package/build/nextpage/edit.js +1 -3
- package/build/nextpage/edit.js.map +1 -1
- package/build/page-list/edit.js +10 -3
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/edit.js +7 -11
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +4 -37
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +47 -3
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-terms/edit.js +3 -2
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/index.js +1 -1
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/index.js +1 -0
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -1
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/index.js +1 -1
- package/build/query/index.js.map +1 -1
- package/build/query-no-results/edit.js +1 -1
- package/build/query-no-results/edit.js.map +1 -1
- package/build/query-pagination-next/edit.js +2 -1
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-previous/edit.js +2 -1
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/quote/deprecated.js +168 -36
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +76 -39
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +9 -45
- package/build/quote/index.js.map +1 -1
- package/build/quote/save.js +1 -5
- package/build/quote/save.js.map +1 -1
- package/build/quote/transforms.js +110 -158
- package/build/quote/transforms.js.map +1 -1
- package/build/search/edit.js +1 -1
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +5 -13
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-title/edit/level-toolbar.js +2 -1
- package/build/site-title/edit/level-toolbar.js.map +1 -1
- package/build/social-link/icons/index.js +13 -0
- package/build/social-link/icons/index.js.map +1 -1
- package/build/social-link/icons/whatsapp.js +25 -0
- package/build/social-link/icons/whatsapp.js.map +1 -0
- package/build/social-link/variations.js +7 -0
- package/build/social-link/variations.js.map +1 -1
- package/build/table/edit.js +1 -0
- package/build/table/edit.js.map +1 -1
- package/build/table/save.js +2 -1
- package/build/table/save.js.map +1 -1
- package/build/template-part/edit/index.js +17 -8
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +33 -13
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/search.js +94 -0
- package/build/template-part/edit/utils/search.js.map +1 -0
- package/build/template-part/index.js +1 -1
- package/build/template-part/index.js.map +1 -1
- package/build/template-part/variations.js +0 -16
- package/build/template-part/variations.js.map +1 -1
- package/build/utils/clean-empty-object.js +5 -3
- package/build/utils/clean-empty-object.js.map +1 -1
- package/build/video/edit.js +1 -0
- package/build/video/edit.js.map +1 -1
- package/build/video/save.js +1 -0
- package/build/video/save.js.map +1 -1
- package/build/video/tracks-editor.js +9 -11
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/audio/edit.js +2 -1
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/save.js +3 -2
- package/build-module/audio/save.js.map +1 -1
- package/build-module/avatar/hooks.js +2 -2
- package/build-module/avatar/hooks.js.map +1 -1
- package/build-module/button/edit.js +4 -3
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +1 -24
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +2 -2
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/edit.js +2 -2
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +2 -2
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/variations.js +2 -2
- package/build-module/columns/variations.js.map +1 -1
- package/build-module/comment-author-name/edit.js +3 -5
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-author-name/index.js +0 -4
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-date/edit.js +4 -4
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-date/index.js +0 -4
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/index.js +0 -4
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +0 -4
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/index.js +1 -1
- package/build-module/comments/deprecated.js +54 -0
- package/build-module/comments/deprecated.js.map +1 -0
- package/build-module/comments/edit/comments-legacy.js +59 -0
- package/build-module/comments/edit/comments-legacy.js.map +1 -0
- package/build-module/comments/edit/index.js +37 -0
- package/build-module/comments/edit/index.js.map +1 -0
- package/build-module/comments/edit/placeholder.js +102 -0
- package/build-module/comments/edit/placeholder.js.map +1 -0
- package/build-module/comments/edit/template.js +32 -0
- package/build-module/comments/edit/template.js.map +1 -0
- package/build-module/comments/index.js +10 -3
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments/save.js +9 -4
- package/build-module/comments/save.js.map +1 -1
- package/build-module/comments-pagination/index.js +1 -1
- package/build-module/comments-title/deprecated.js +1 -4
- package/build-module/comments-title/deprecated.js.map +1 -1
- package/build-module/comments-title/index.js +1 -1
- package/build-module/cover/edit/block-controls.js +3 -13
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/cover-placeholder.js +3 -1
- package/build-module/cover/edit/cover-placeholder.js.map +1 -1
- package/build-module/cover/edit/index.js +19 -4
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/index.js +1 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/transforms.js +3 -2
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +1 -2
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/embed-preview.js +2 -1
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/embed/icons.js +19 -0
- package/build-module/embed/icons.js.map +1 -1
- package/build-module/embed/save.js +2 -1
- package/build-module/embed/save.js.map +1 -1
- package/build-module/embed/variations.js +12 -1
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/edit.js +2 -2
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/save.js +2 -2
- package/build-module/file/save.js.map +1 -1
- package/build-module/gallery/edit.js +11 -18
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +2 -2
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/save.js +2 -2
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/transforms.js +33 -23
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-get-media.js +6 -16
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +50 -0
- package/build-module/gallery/use-get-media.native.js.map +1 -0
- package/build-module/gallery/v1/edit.js +4 -4
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.js +2 -1
- package/build-module/gallery/v1/gallery-image.js.map +1 -1
- package/build-module/gallery/v1/gallery.js +2 -2
- package/build-module/gallery/v1/gallery.js.map +1 -1
- package/build-module/gallery/v1/save.js +8 -3
- package/build-module/gallery/v1/save.js.map +1 -1
- package/build-module/group/edit.js +1 -3
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +2 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/variations.js +2 -2
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/heading-level-dropdown.js +2 -1
- package/build-module/heading/heading-level-dropdown.js.map +1 -1
- package/build-module/heading/index.js +9 -4
- package/build-module/heading/index.js.map +1 -1
- package/build-module/html/edit.js +12 -23
- package/build-module/html/edit.js.map +1 -1
- package/build-module/html/preview.js +38 -0
- package/build-module/html/preview.js.map +1 -0
- package/build-module/image/deprecated.js +77 -9
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +5 -3
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +20 -9
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +30 -22
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -1
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/save.js +10 -3
- package/build-module/image/save.js.map +1 -1
- package/build-module/index.js +1 -2
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +3 -13
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -2
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/transforms.js +4 -63
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/v2/transforms.js +32 -44
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +14 -10
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +1 -1
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-enter.js +7 -4
- package/build-module/list-item/hooks/use-enter.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +160 -0
- package/build-module/list-item/hooks/use-merge.js.map +1 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js +88 -33
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/utils.js +123 -2
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/deprecated.js +134 -8
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +2 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/save.js +13 -0
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/more/edit.js +2 -4
- package/build-module/more/edit.js.map +1 -1
- package/build-module/more/save.js +1 -6
- package/build-module/more/save.js.map +1 -1
- package/build-module/navigation/edit/index.js +1 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/index.js +9 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +17 -75
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/view.js +6 -1
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +5 -4
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/hooks.js +0 -13
- package/build-module/navigation-link/hooks.js.map +1 -1
- package/build-module/navigation-link/index.js +1 -1
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +2 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/view.js +6 -1
- package/build-module/navigation-submenu/view.js.map +1 -1
- package/build-module/nextpage/edit.js +1 -3
- package/build-module/nextpage/edit.js.map +1 -1
- package/build-module/page-list/edit.js +10 -3
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +8 -12
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +5 -35
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +46 -5
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-terms/edit.js +3 -2
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/index.js +1 -1
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/index.js +1 -0
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -1
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/index.js +1 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query-no-results/edit.js +2 -2
- package/build-module/query-no-results/edit.js.map +1 -1
- package/build-module/query-pagination-next/edit.js +2 -1
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-previous/edit.js +2 -1
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/quote/deprecated.js +162 -36
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +77 -43
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +9 -39
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/save.js +4 -8
- package/build-module/quote/save.js.map +1 -1
- package/build-module/quote/transforms.js +111 -158
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/search/edit.js +2 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +5 -13
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-title/edit/level-toolbar.js +2 -1
- package/build-module/site-title/edit/level-toolbar.js.map +1 -1
- package/build-module/social-link/icons/index.js +1 -0
- package/build-module/social-link/icons/index.js.map +1 -1
- package/build-module/social-link/icons/whatsapp.js +15 -0
- package/build-module/social-link/icons/whatsapp.js.map +1 -0
- package/build-module/social-link/variations.js +8 -1
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/table/edit.js +2 -1
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/save.js +3 -2
- package/build-module/table/save.js.map +1 -1
- package/build-module/template-part/edit/index.js +20 -11
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +33 -15
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/search.js +84 -0
- package/build-module/template-part/edit/utils/search.js.map +1 -0
- package/build-module/template-part/index.js +1 -1
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/template-part/variations.js +0 -13
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/utils/clean-empty-object.js +5 -2
- package/build-module/utils/clean-empty-object.js.map +1 -1
- package/build-module/video/edit.js +2 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/save.js +2 -1
- package/build-module/video/save.js.map +1 -1
- package/build-module/video/tracks-editor.js +9 -11
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/button/style-rtl.css +6 -1
- package/build-style/button/style.css +6 -1
- package/build-style/comment-template/style-rtl.css +12 -0
- package/build-style/comment-template/style.css +12 -0
- package/build-style/comments/editor-rtl.css +122 -0
- package/build-style/comments/editor.css +122 -0
- package/build-style/{post-comments → comments}/style-rtl.css +3 -1
- package/build-style/{post-comments → comments}/style.css +3 -1
- package/build-style/common-rtl.css +7 -0
- package/build-style/common.css +7 -0
- package/build-style/cover/style-rtl.css +2 -2
- package/build-style/cover/style.css +2 -2
- package/build-style/editor-elements-rtl.css +85 -0
- package/build-style/editor-elements.css +85 -0
- package/build-style/editor-rtl.css +154 -10
- package/build-style/editor.css +154 -10
- package/build-style/{post-comments/editor-rtl.css → elements-rtl.css} +5 -2
- package/build-style/{post-comments/editor.css → elements.css} +5 -2
- package/build-style/file/style-rtl.css +5 -8
- package/build-style/file/style.css +5 -8
- package/build-style/gallery/style-rtl.css +7 -2
- package/build-style/gallery/style.css +7 -2
- package/build-style/image/editor-rtl.css +4 -3
- package/build-style/image/editor.css +4 -3
- package/build-style/image/style-rtl.css +33 -3
- package/build-style/image/style.css +33 -3
- package/build-style/navigation/style-rtl.css +9 -1
- package/build-style/navigation/style.css +9 -1
- package/build-style/post-comments-form/editor-rtl.css +3 -0
- package/build-style/post-comments-form/editor.css +3 -0
- package/build-style/post-comments-form/style-rtl.css +0 -1
- package/build-style/post-comments-form/style.css +0 -1
- package/build-style/post-template/style-rtl.css +9 -18
- package/build-style/post-template/style.css +9 -18
- package/build-style/query/editor-rtl.css +1 -1
- package/build-style/query/editor.css +1 -1
- package/build-style/search/style-rtl.css +6 -8
- package/build-style/search/style.css +6 -8
- package/build-style/search/theme-rtl.css +5 -0
- package/build-style/search/theme.css +5 -0
- package/build-style/social-link/editor-rtl.css +1 -0
- package/build-style/social-link/editor.css +1 -0
- package/build-style/social-links/style-rtl.css +8 -0
- package/build-style/social-links/style.css +8 -0
- package/build-style/style-rtl.css +216 -154
- package/build-style/style.css +216 -154
- package/build-style/template-part/editor-rtl.css +14 -3
- package/build-style/template-part/editor.css +14 -3
- package/build-style/theme-rtl.css +5 -0
- package/build-style/theme.css +5 -0
- package/package.json +28 -28
- package/src/audio/edit.js +4 -0
- package/src/audio/save.js +12 -2
- package/src/avatar/hooks.js +6 -9
- package/src/button/block.json +1 -24
- package/src/button/edit.js +3 -2
- package/src/button/save.js +2 -2
- package/src/button/style.scss +13 -1
- package/src/buttons/edit.js +1 -5
- package/src/columns/edit.native.js +2 -2
- package/src/columns/variations.js +2 -2
- package/src/comment-author-name/block.json +0 -4
- package/src/comment-author-name/edit.js +3 -12
- package/src/comment-date/block.json +0 -4
- package/src/comment-date/edit.js +10 -14
- package/src/comment-date/index.php +0 -3
- package/src/comment-edit-link/block.json +0 -4
- package/src/comment-reply-link/block.json +0 -4
- package/src/comment-template/block.json +1 -1
- package/src/comment-template/style.scss +14 -0
- package/src/comments/block.json +7 -2
- package/src/comments/deprecated.js +53 -0
- package/src/comments/edit/comments-legacy.js +71 -0
- package/src/comments/edit/index.js +35 -0
- package/src/comments/edit/placeholder.js +124 -0
- package/src/comments/{edit.js → edit/template.js} +25 -32
- package/src/comments/editor.scss +9 -0
- package/src/comments/index.js +2 -0
- package/src/comments/index.php +219 -0
- package/src/comments/save.js +8 -7
- package/src/{post-comments → comments}/style.scss +14 -3
- package/src/comments-pagination/block.json +1 -1
- package/src/comments-title/block.json +1 -1
- package/src/comments-title/deprecated.js +0 -2
- package/src/common.scss +2 -0
- package/src/cover/block.json +1 -0
- package/src/cover/edit/block-controls.js +4 -20
- package/src/cover/edit/cover-placeholder.js +2 -0
- package/src/cover/edit/index.js +16 -0
- package/src/cover/index.php +21 -8
- package/src/cover/style.scss +2 -2
- package/src/cover/transforms.js +2 -2
- package/src/editor-elements.scss +10 -0
- package/src/editor.scss +2 -1
- package/src/elements.scss +6 -0
- package/src/embed/embed-placeholder.native.js +2 -3
- package/src/embed/embed-preview.js +8 -1
- package/src/embed/icons.js +25 -0
- package/src/embed/save.js +10 -2
- package/src/embed/test/__snapshots__/index.native.js.snap +1 -1
- package/src/embed/variations.js +10 -0
- package/src/file/edit.js +4 -2
- package/src/file/save.js +2 -2
- package/src/file/style.scss +5 -5
- package/src/freeform/editor.scss +0 -2
- package/src/gallery/edit.js +12 -23
- package/src/gallery/gallery.js +9 -2
- package/src/gallery/index.php +5 -1
- package/src/gallery/save.js +5 -1
- package/src/gallery/style.scss +10 -1
- package/src/gallery/test/__snapshots__/index.native.js.snap +2 -2
- package/src/gallery/test/helpers.native.js +11 -198
- package/src/gallery/test/index.native.js +19 -29
- package/src/gallery/transforms.js +28 -13
- package/src/gallery/use-get-media.js +11 -28
- package/src/gallery/use-get-media.native.js +44 -0
- package/src/gallery/v1/edit.js +3 -4
- package/src/gallery/v1/gallery-image.js +4 -0
- package/src/gallery/v1/gallery.js +8 -2
- package/src/gallery/v1/save.js +20 -3
- package/src/group/block.json +2 -0
- package/src/group/edit.js +1 -3
- package/src/group/variations.js +2 -2
- package/src/heading/heading-level-dropdown.js +1 -0
- package/src/heading/index.js +8 -2
- package/src/html/edit.js +10 -40
- package/src/html/preview.js +46 -0
- package/src/image/block.json +7 -1
- package/src/image/deprecated.js +86 -0
- package/src/image/edit.js +6 -1
- package/src/image/edit.native.js +19 -7
- package/src/image/editor.scss +9 -4
- package/src/image/image.js +28 -16
- package/src/image/save.js +20 -3
- package/src/image/style.scss +39 -3
- package/src/image/test/edit.native.js +51 -19
- package/src/index.js +0 -2
- package/src/index.native.js +2 -11
- package/src/latest-posts/edit.js +2 -6
- package/src/list/transforms.js +0 -47
- package/src/list/v2/transforms.js +23 -46
- package/src/list-item/edit.js +10 -12
- package/src/list-item/hooks/index.js +1 -1
- package/src/list-item/hooks/use-enter.js +9 -6
- package/src/list-item/hooks/use-merge.js +141 -0
- package/src/list-item/hooks/use-outdent-list-item.js +79 -54
- package/src/list-item/utils.js +27 -3
- package/src/media-text/deprecated.js +148 -1
- package/src/media-text/edit.js +2 -1
- package/src/media-text/save.js +18 -0
- package/src/more/edit.js +9 -11
- package/src/more/save.js +3 -6
- package/src/navigation/block.json +9 -0
- package/src/navigation/edit/index.js +1 -0
- package/src/navigation/style.scss +11 -2
- package/src/navigation/test/use-navigation-menu.js +16 -11
- package/src/navigation/use-navigation-menu.js +26 -83
- package/src/navigation/view.js +6 -1
- package/src/navigation-link/edit.js +4 -3
- package/src/navigation-link/hooks.js +0 -14
- package/src/navigation-link/index.js +1 -1
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +0 -93
- package/src/navigation-link/test/hooks.js +0 -12
- package/src/navigation-submenu/edit.js +1 -0
- package/src/navigation-submenu/view.js +6 -1
- package/src/nextpage/edit.js +1 -3
- package/src/page-list/edit.js +12 -5
- package/src/paragraph/edit.js +8 -14
- package/src/post-comments-form/edit.js +3 -58
- package/src/post-comments-form/editor.scss +4 -0
- package/src/post-comments-form/form.js +81 -6
- package/src/post-comments-form/index.php +1 -1
- package/src/post-comments-form/style.scss +0 -1
- package/src/post-featured-image/index.php +4 -2
- package/src/post-template/index.php +23 -17
- package/src/post-template/style.scss +1 -7
- package/src/post-terms/edit.js +3 -2
- package/src/post-terms/index.js +1 -1
- package/src/post-title/block.json +1 -0
- package/src/query/edit/inspector-controls/index.js +1 -1
- package/src/query/editor.scss +1 -1
- package/src/query/index.js +1 -1
- package/src/query-no-results/edit.js +2 -5
- package/src/query-no-results/index.php +10 -8
- package/src/query-pagination-next/edit.js +1 -0
- package/src/query-pagination-previous/edit.js +1 -0
- package/src/quote/deprecated.js +213 -99
- package/src/quote/edit.js +77 -52
- package/src/quote/index.js +10 -33
- package/src/quote/save.js +5 -5
- package/src/quote/{v2/test → test}/migrate.js +2 -7
- package/src/quote/transforms.js +117 -147
- package/src/search/edit.js +2 -2
- package/src/search/index.php +12 -10
- package/src/search/style.scss +9 -8
- package/src/search/theme.scss +5 -0
- package/src/site-logo/edit.js +2 -11
- package/src/site-title/edit/level-toolbar.js +1 -0
- package/src/social-link/editor.scss +3 -0
- package/src/social-link/icons/index.js +1 -0
- package/src/social-link/icons/whatsapp.js +10 -0
- package/src/social-link/index.php +20 -0
- package/src/social-link/socials-with-bg.scss +5 -0
- package/src/social-link/socials-without-bg.scss +5 -0
- package/src/social-link/variations.js +7 -0
- package/src/style.scss +1 -1
- package/src/table/edit.js +2 -0
- package/src/table/save.js +6 -1
- package/src/template-part/edit/index.js +37 -24
- package/src/template-part/edit/selection-modal.js +68 -40
- package/src/template-part/edit/utils/search.js +76 -0
- package/src/template-part/editor.scss +21 -9
- package/src/template-part/index.js +1 -1
- package/src/template-part/index.php +56 -2
- package/src/template-part/variations.js +0 -11
- package/src/utils/clean-empty-object.js +8 -2
- package/src/video/edit.js +4 -0
- package/src/video/save.js +10 -2
- package/src/video/tracks-editor.js +1 -1
- package/build/comments/edit.js.map +0 -1
- package/build/gallery/use-short-code-transform.js +0 -64
- package/build/gallery/use-short-code-transform.js.map +0 -1
- package/build/list-item/hooks/use-backspace.js +0 -59
- package/build/list-item/hooks/use-backspace.js.map +0 -1
- package/build/navigation-link/fallback-variations.js +0 -75
- package/build/navigation-link/fallback-variations.js.map +0 -1
- package/build/post-comments/edit.js +0 -184
- package/build/post-comments/edit.js.map +0 -1
- package/build/post-comments/index.js +0 -72
- package/build/post-comments/index.js.map +0 -1
- package/build/quote/v2/deprecated.js +0 -133
- package/build/quote/v2/deprecated.js.map +0 -1
- package/build/quote/v2/edit.js +0 -139
- package/build/quote/v2/edit.js.map +0 -1
- package/build/quote/v2/index.js +0 -49
- package/build/quote/v2/index.js.map +0 -1
- package/build/quote/v2/save.js +0 -43
- package/build/quote/v2/save.js.map +0 -1
- package/build/quote/v2/transforms.js +0 -156
- package/build/quote/v2/transforms.js.map +0 -1
- package/build/template-part/fallback-variations.js +0 -59
- package/build/template-part/fallback-variations.js.map +0 -1
- package/build-module/comments/edit.js +0 -51
- package/build-module/comments/edit.js.map +0 -1
- package/build-module/gallery/use-short-code-transform.js +0 -54
- package/build-module/gallery/use-short-code-transform.js.map +0 -1
- package/build-module/list-item/hooks/use-backspace.js +0 -44
- package/build-module/list-item/hooks/use-backspace.js.map +0 -1
- package/build-module/navigation-link/fallback-variations.js +0 -65
- package/build-module/navigation-link/fallback-variations.js.map +0 -1
- package/build-module/post-comments/edit.js +0 -171
- package/build-module/post-comments/edit.js.map +0 -1
- package/build-module/post-comments/index.js +0 -59
- package/build-module/post-comments/index.js.map +0 -1
- package/build-module/quote/v2/deprecated.js +0 -116
- package/build-module/quote/v2/deprecated.js.map +0 -1
- package/build-module/quote/v2/edit.js +0 -122
- package/build-module/quote/v2/edit.js.map +0 -1
- package/build-module/quote/v2/index.js +0 -33
- package/build-module/quote/v2/index.js.map +0 -1
- package/build-module/quote/v2/save.js +0 -30
- package/build-module/quote/v2/save.js.map +0 -1
- package/build-module/quote/v2/transforms.js +0 -147
- package/build-module/quote/v2/transforms.js.map +0 -1
- package/build-module/template-part/fallback-variations.js +0 -47
- package/build-module/template-part/fallback-variations.js.map +0 -1
- package/src/gallery/use-short-code-transform.js +0 -55
- package/src/list-item/hooks/use-backspace.js +0 -51
- package/src/navigation-link/fallback-variations.js +0 -65
- package/src/post-comments/block.json +0 -45
- package/src/post-comments/edit.js +0 -247
- package/src/post-comments/editor.scss +0 -3
- package/src/post-comments/index.js +0 -18
- package/src/post-comments/index.php +0 -87
- package/src/quote/v2/deprecated.js +0 -107
- package/src/quote/v2/edit.js +0 -139
- package/src/quote/v2/index.js +0 -36
- package/src/quote/v2/save.js +0 -26
- package/src/quote/v2/transforms.js +0 -155
- package/src/template-part/fallback-variations.js +0 -51
package/src/group/block.json
CHANGED
package/src/group/edit.js
CHANGED
|
@@ -52,9 +52,7 @@ function GroupEdit( { attributes, setAttributes, clientId } ) {
|
|
|
52
52
|
const { type = 'default' } = usedLayout;
|
|
53
53
|
const layoutSupportEnabled = themeSupportsLayout || type !== 'default';
|
|
54
54
|
|
|
55
|
-
const blockProps = useBlockProps(
|
|
56
|
-
className: `is-layout-${ type }`,
|
|
57
|
-
} );
|
|
55
|
+
const blockProps = useBlockProps();
|
|
58
56
|
|
|
59
57
|
const innerBlocksProps = useInnerBlocksProps(
|
|
60
58
|
layoutSupportEnabled
|
package/src/group/variations.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
4
|
+
import { __, _x } from '@wordpress/i18n';
|
|
5
5
|
import { group, row, stack } from '@wordpress/icons';
|
|
6
6
|
|
|
7
7
|
const variations = [
|
|
@@ -19,7 +19,7 @@ const variations = [
|
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
name: 'group-row',
|
|
22
|
-
title:
|
|
22
|
+
title: _x( 'Row', 'single horizontal line' ),
|
|
23
23
|
description: __( 'Arrange blocks horizontally.' ),
|
|
24
24
|
attributes: { layout: { type: 'flex', flexWrap: 'nowrap' } },
|
|
25
25
|
scope: [ 'inserter', 'transform' ],
|
package/src/heading/index.js
CHANGED
|
@@ -31,9 +31,15 @@ export const settings = {
|
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
__experimentalLabel( attributes, { context } ) {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const { content, level } = attributes;
|
|
35
|
+
|
|
36
|
+
// In the list view, use the block's content as the label.
|
|
37
|
+
// If the content is empty, fall back to the default label.
|
|
38
|
+
if ( context === 'list-view' && content ) {
|
|
39
|
+
return content;
|
|
40
|
+
}
|
|
36
41
|
|
|
42
|
+
if ( context === 'accessibility' ) {
|
|
37
43
|
return isEmpty( content )
|
|
38
44
|
? sprintf(
|
|
39
45
|
/* translators: accessibility text. %s: heading level. */
|
package/src/html/edit.js
CHANGED
|
@@ -6,42 +6,19 @@ import { useContext, useState } from '@wordpress/element';
|
|
|
6
6
|
import {
|
|
7
7
|
BlockControls,
|
|
8
8
|
PlainText,
|
|
9
|
-
transformStyles,
|
|
10
9
|
useBlockProps,
|
|
11
|
-
store as blockEditorStore,
|
|
12
10
|
} from '@wordpress/block-editor';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import { useSelect } from '@wordpress/data';
|
|
11
|
+
import { ToolbarButton, Disabled, ToolbarGroup } from '@wordpress/components';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Internal dependencies
|
|
15
|
+
*/
|
|
16
|
+
import Preview from './preview';
|
|
20
17
|
|
|
21
18
|
export default function HTMLEdit( { attributes, setAttributes, isSelected } ) {
|
|
22
19
|
const [ isPreview, setIsPreview ] = useState();
|
|
23
20
|
const isDisabled = useContext( Disabled.Context );
|
|
24
21
|
|
|
25
|
-
const styles = useSelect( ( select ) => {
|
|
26
|
-
// Default styles used to unset some of the styles
|
|
27
|
-
// that might be inherited from the editor style.
|
|
28
|
-
const defaultStyles = `
|
|
29
|
-
html,body,:root {
|
|
30
|
-
margin: 0 !important;
|
|
31
|
-
padding: 0 !important;
|
|
32
|
-
overflow: visible !important;
|
|
33
|
-
min-height: auto !important;
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
return [
|
|
38
|
-
defaultStyles,
|
|
39
|
-
...transformStyles(
|
|
40
|
-
select( blockEditorStore ).getSettings().styles
|
|
41
|
-
),
|
|
42
|
-
];
|
|
43
|
-
}, [] );
|
|
44
|
-
|
|
45
22
|
function switchToPreview() {
|
|
46
23
|
setIsPreview( true );
|
|
47
24
|
}
|
|
@@ -71,17 +48,10 @@ export default function HTMLEdit( { attributes, setAttributes, isSelected } ) {
|
|
|
71
48
|
</ToolbarGroup>
|
|
72
49
|
</BlockControls>
|
|
73
50
|
{ isPreview || isDisabled ? (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
Some browsers do not bubble up the clicks from the sandboxed iframe, which makes it
|
|
79
|
-
difficult to reselect the block.
|
|
80
|
-
*/ }
|
|
81
|
-
{ ! isSelected && (
|
|
82
|
-
<div className="block-library-html__preview-overlay"></div>
|
|
83
|
-
) }
|
|
84
|
-
</>
|
|
51
|
+
<Preview
|
|
52
|
+
content={ attributes.content }
|
|
53
|
+
isSelected={ isSelected }
|
|
54
|
+
/>
|
|
85
55
|
) : (
|
|
86
56
|
<PlainText
|
|
87
57
|
value={ attributes.content }
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useMemo } from '@wordpress/element';
|
|
5
|
+
import {
|
|
6
|
+
transformStyles,
|
|
7
|
+
store as blockEditorStore,
|
|
8
|
+
} from '@wordpress/block-editor';
|
|
9
|
+
import { SandBox } from '@wordpress/components';
|
|
10
|
+
import { useSelect } from '@wordpress/data';
|
|
11
|
+
|
|
12
|
+
// Default styles used to unset some of the styles
|
|
13
|
+
// that might be inherited from the editor style.
|
|
14
|
+
const DEFAULT_STYLES = `
|
|
15
|
+
html,body,:root {
|
|
16
|
+
margin: 0 !important;
|
|
17
|
+
padding: 0 !important;
|
|
18
|
+
overflow: visible !important;
|
|
19
|
+
min-height: auto !important;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
export default function HTMLEditPreview( { content, isSelected } ) {
|
|
24
|
+
const settingStyles = useSelect( ( select ) => {
|
|
25
|
+
return select( blockEditorStore ).getSettings()?.styles;
|
|
26
|
+
}, [] );
|
|
27
|
+
|
|
28
|
+
const styles = useMemo(
|
|
29
|
+
() => [ DEFAULT_STYLES, ...transformStyles( settingStyles ) ],
|
|
30
|
+
[ settingStyles ]
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<SandBox html={ content } styles={ styles } />
|
|
36
|
+
{ /*
|
|
37
|
+
An overlay is added when the block is not selected in order to register click events.
|
|
38
|
+
Some browsers do not bubble up the clicks from the sandboxed iframe, which makes it
|
|
39
|
+
difficult to reselect the block.
|
|
40
|
+
*/ }
|
|
41
|
+
{ ! isSelected && (
|
|
42
|
+
<div className="block-library-html__preview-overlay"></div>
|
|
43
|
+
) }
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
}
|
package/src/image/block.json
CHANGED
|
@@ -84,9 +84,15 @@
|
|
|
84
84
|
"background": false
|
|
85
85
|
},
|
|
86
86
|
"__experimentalBorder": {
|
|
87
|
+
"color": true,
|
|
87
88
|
"radius": true,
|
|
89
|
+
"width": true,
|
|
90
|
+
"__experimentalSelector": "img, .wp-block-image__crop-area",
|
|
91
|
+
"__experimentalSkipSerialization": true,
|
|
88
92
|
"__experimentalDefaultControls": {
|
|
89
|
-
"
|
|
93
|
+
"color": true,
|
|
94
|
+
"radius": true,
|
|
95
|
+
"width": true
|
|
90
96
|
}
|
|
91
97
|
},
|
|
92
98
|
"__experimentalStyle": {
|
package/src/image/deprecated.js
CHANGED
|
@@ -31,6 +31,12 @@ const blockAttributes = {
|
|
|
31
31
|
source: 'html',
|
|
32
32
|
selector: 'figcaption',
|
|
33
33
|
},
|
|
34
|
+
title: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
source: 'attribute',
|
|
37
|
+
selector: 'img',
|
|
38
|
+
attribute: 'title',
|
|
39
|
+
},
|
|
34
40
|
href: {
|
|
35
41
|
type: 'string',
|
|
36
42
|
source: 'attribute',
|
|
@@ -58,6 +64,9 @@ const blockAttributes = {
|
|
|
58
64
|
height: {
|
|
59
65
|
type: 'number',
|
|
60
66
|
},
|
|
67
|
+
sizeSlug: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
},
|
|
61
70
|
linkDestination: {
|
|
62
71
|
type: 'string',
|
|
63
72
|
},
|
|
@@ -85,6 +94,83 @@ const blockSupports = {
|
|
|
85
94
|
};
|
|
86
95
|
|
|
87
96
|
const deprecated = [
|
|
97
|
+
// The following deprecation moves existing border radius styles onto the
|
|
98
|
+
// inner img element where new border block support styles must be applied.
|
|
99
|
+
// It will also add a new `.has-custom-border` class for existing blocks
|
|
100
|
+
// with border radii set. This class is required to improve caption position
|
|
101
|
+
// and styling when an image within a gallery has a custom border or
|
|
102
|
+
// rounded corners.
|
|
103
|
+
//
|
|
104
|
+
// See: https://github.com/WordPress/gutenberg/pull/31366/
|
|
105
|
+
{
|
|
106
|
+
attributes: blockAttributes,
|
|
107
|
+
supports: blockSupports,
|
|
108
|
+
save( { attributes } ) {
|
|
109
|
+
const {
|
|
110
|
+
url,
|
|
111
|
+
alt,
|
|
112
|
+
caption,
|
|
113
|
+
align,
|
|
114
|
+
href,
|
|
115
|
+
rel,
|
|
116
|
+
linkClass,
|
|
117
|
+
width,
|
|
118
|
+
height,
|
|
119
|
+
id,
|
|
120
|
+
linkTarget,
|
|
121
|
+
sizeSlug,
|
|
122
|
+
title,
|
|
123
|
+
} = attributes;
|
|
124
|
+
|
|
125
|
+
const newRel = isEmpty( rel ) ? undefined : rel;
|
|
126
|
+
|
|
127
|
+
const classes = classnames( {
|
|
128
|
+
[ `align${ align }` ]: align,
|
|
129
|
+
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
130
|
+
'is-resized': width || height,
|
|
131
|
+
} );
|
|
132
|
+
|
|
133
|
+
const image = (
|
|
134
|
+
<img
|
|
135
|
+
src={ url }
|
|
136
|
+
alt={ alt }
|
|
137
|
+
className={ id ? `wp-image-${ id }` : null }
|
|
138
|
+
width={ width }
|
|
139
|
+
height={ height }
|
|
140
|
+
title={ title }
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
const figure = (
|
|
145
|
+
<>
|
|
146
|
+
{ href ? (
|
|
147
|
+
<a
|
|
148
|
+
className={ linkClass }
|
|
149
|
+
href={ href }
|
|
150
|
+
target={ linkTarget }
|
|
151
|
+
rel={ newRel }
|
|
152
|
+
>
|
|
153
|
+
{ image }
|
|
154
|
+
</a>
|
|
155
|
+
) : (
|
|
156
|
+
image
|
|
157
|
+
) }
|
|
158
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
159
|
+
<RichText.Content
|
|
160
|
+
tagName="figcaption"
|
|
161
|
+
value={ caption }
|
|
162
|
+
/>
|
|
163
|
+
) }
|
|
164
|
+
</>
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<figure { ...useBlockProps.save( { className: classes } ) }>
|
|
169
|
+
{ figure }
|
|
170
|
+
</figure>
|
|
171
|
+
);
|
|
172
|
+
},
|
|
173
|
+
},
|
|
88
174
|
{
|
|
89
175
|
attributes: {
|
|
90
176
|
...blockAttributes,
|
package/src/image/edit.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { get, has, omit, pick } from 'lodash';
|
|
5
|
+
import { get, has, isEmpty, omit, pick } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
MediaPlaceholder,
|
|
18
18
|
useBlockProps,
|
|
19
19
|
store as blockEditorStore,
|
|
20
|
+
__experimentalUseBorderProps as useBorderProps,
|
|
20
21
|
} from '@wordpress/block-editor';
|
|
21
22
|
import { useEffect, useRef, useState } from '@wordpress/element';
|
|
22
23
|
import { __ } from '@wordpress/i18n';
|
|
@@ -296,10 +297,14 @@ export function ImageEdit( {
|
|
|
296
297
|
/>
|
|
297
298
|
);
|
|
298
299
|
|
|
300
|
+
const borderProps = useBorderProps( attributes );
|
|
301
|
+
|
|
299
302
|
const classes = classnames( className, {
|
|
300
303
|
'is-transient': temporaryURL,
|
|
301
304
|
'is-resized': !! width || !! height,
|
|
302
305
|
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
306
|
+
'has-custom-border':
|
|
307
|
+
!! borderProps.className || ! isEmpty( borderProps.style ),
|
|
303
308
|
} );
|
|
304
309
|
|
|
305
310
|
const blockProps = useBlockProps( {
|
package/src/image/edit.native.js
CHANGED
|
@@ -268,11 +268,15 @@ export class ImageEdit extends Component {
|
|
|
268
268
|
componentDidUpdate( previousProps ) {
|
|
269
269
|
const { image, attributes, setAttributes, featuredImageId } =
|
|
270
270
|
this.props;
|
|
271
|
+
const { url } = attributes;
|
|
271
272
|
if ( ! previousProps.image && image ) {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
if ( ! hasQueryArg( url, 'w' ) && attributes?.sizeSlug ) {
|
|
274
|
+
const updatedUrl =
|
|
275
|
+
getUrlForSlug( image, attributes.sizeSlug ) ||
|
|
276
|
+
image.source_url;
|
|
277
|
+
|
|
278
|
+
setAttributes( { url: updatedUrl } );
|
|
279
|
+
}
|
|
276
280
|
}
|
|
277
281
|
|
|
278
282
|
const { id } = attributes;
|
|
@@ -428,6 +432,7 @@ export class ImageEdit extends Component {
|
|
|
428
432
|
id: media.id,
|
|
429
433
|
url: media.url,
|
|
430
434
|
caption: media.caption,
|
|
435
|
+
alt: media.alt,
|
|
431
436
|
};
|
|
432
437
|
|
|
433
438
|
let additionalAttributes;
|
|
@@ -573,7 +578,7 @@ export class ImageEdit extends Component {
|
|
|
573
578
|
<>
|
|
574
579
|
{ __(
|
|
575
580
|
'Describe the purpose of the image. Leave empty if the image is purely decorative.'
|
|
576
|
-
) }
|
|
581
|
+
) }{ ' ' }
|
|
577
582
|
<FooterMessageLink
|
|
578
583
|
href={
|
|
579
584
|
'https://www.w3.org/WAI/tutorials/images/decision-tree/'
|
|
@@ -664,6 +669,7 @@ export class ImageEdit extends Component {
|
|
|
664
669
|
context,
|
|
665
670
|
featuredImageId,
|
|
666
671
|
wasBlockJustInserted,
|
|
672
|
+
shouldUseFastImage,
|
|
667
673
|
} = this.props;
|
|
668
674
|
const { align, url, alt, id, sizeSlug, className } = attributes;
|
|
669
675
|
const hasImageContext = context
|
|
@@ -844,6 +850,9 @@ export class ImageEdit extends Component {
|
|
|
844
850
|
isUploadInProgress={
|
|
845
851
|
isUploadInProgress
|
|
846
852
|
}
|
|
853
|
+
shouldUseFastImage={
|
|
854
|
+
shouldUseFastImage
|
|
855
|
+
}
|
|
847
856
|
onSelectMediaUploadOption={
|
|
848
857
|
this.onSelectMediaUploadOption
|
|
849
858
|
}
|
|
@@ -903,7 +912,8 @@ export default compose( [
|
|
|
903
912
|
isSelected,
|
|
904
913
|
clientId,
|
|
905
914
|
} = props;
|
|
906
|
-
const { imageSizes, imageDefaultSize } =
|
|
915
|
+
const { imageSizes, imageDefaultSize, shouldUseFastImage } =
|
|
916
|
+
getSettings();
|
|
907
917
|
const isNotFileUrl = id && getProtocol( url ) !== 'file:';
|
|
908
918
|
const featuredImageId = getEditedPostAttribute( 'featured_media' );
|
|
909
919
|
|
|
@@ -915,11 +925,13 @@ export default compose( [
|
|
|
915
925
|
isNotFileUrl &&
|
|
916
926
|
url &&
|
|
917
927
|
! hasQueryArg( url, 'w' ) );
|
|
928
|
+
const image = shouldGetMedia ? getMedia( id ) : null;
|
|
918
929
|
|
|
919
930
|
return {
|
|
920
|
-
image
|
|
931
|
+
image,
|
|
921
932
|
imageSizes,
|
|
922
933
|
imageDefaultSize,
|
|
934
|
+
shouldUseFastImage,
|
|
923
935
|
featuredImageId,
|
|
924
936
|
wasBlockJustInserted: wasBlockJustInserted(
|
|
925
937
|
clientId,
|
package/src/image/editor.scss
CHANGED
|
@@ -22,10 +22,6 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
22
22
|
margin-top: -9px;
|
|
23
23
|
margin-left: -9px;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
&:not(.is-style-rounded) > div:not(.components-placeholder) {
|
|
27
|
-
border-radius: inherit;
|
|
28
|
-
}
|
|
29
25
|
}
|
|
30
26
|
|
|
31
27
|
// This is necessary for the editor resize handles to accurately work on a non-floated, non-resized, small image.
|
|
@@ -94,6 +90,15 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
94
90
|
position: relative;
|
|
95
91
|
max-width: 100%;
|
|
96
92
|
width: 100%;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
|
|
95
|
+
// This removes the border from the img within the image cropper so it
|
|
96
|
+
// can be applied to the cropper itself. This then allows the image to be
|
|
97
|
+
// cropped within the visual border providing more accurate editing and
|
|
98
|
+
// smoother UX.
|
|
99
|
+
.reactEasyCrop_Container .reactEasyCrop_Image {
|
|
100
|
+
border: none;
|
|
101
|
+
}
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
.wp-block-image__crop-icon {
|
package/src/image/image.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { get, filter, map, pick, includes } from 'lodash';
|
|
4
|
+
import { get, filter, isEmpty, map, pick, includes } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -29,6 +29,8 @@ import {
|
|
|
29
29
|
BlockAlignmentControl,
|
|
30
30
|
__experimentalImageEditor as ImageEditor,
|
|
31
31
|
__experimentalImageEditingProvider as ImageEditingProvider,
|
|
32
|
+
__experimentalGetElementClassName,
|
|
33
|
+
__experimentalUseBorderProps as useBorderProps,
|
|
32
34
|
} from '@wordpress/block-editor';
|
|
33
35
|
import { useEffect, useMemo, useState, useRef } from '@wordpress/element';
|
|
34
36
|
import { __, sprintf, isRTL } from '@wordpress/i18n';
|
|
@@ -56,7 +58,19 @@ import { MIN_SIZE, ALLOWED_MEDIA_TYPES } from './constants';
|
|
|
56
58
|
|
|
57
59
|
export default function Image( {
|
|
58
60
|
temporaryURL,
|
|
59
|
-
attributes
|
|
61
|
+
attributes,
|
|
62
|
+
setAttributes,
|
|
63
|
+
isSelected,
|
|
64
|
+
insertBlocksAfter,
|
|
65
|
+
onReplace,
|
|
66
|
+
onSelectImage,
|
|
67
|
+
onSelectURL,
|
|
68
|
+
onUploadError,
|
|
69
|
+
containerRef,
|
|
70
|
+
context,
|
|
71
|
+
clientId,
|
|
72
|
+
} ) {
|
|
73
|
+
const {
|
|
60
74
|
url = '',
|
|
61
75
|
alt,
|
|
62
76
|
caption,
|
|
@@ -71,18 +85,7 @@ export default function Image( {
|
|
|
71
85
|
height,
|
|
72
86
|
linkTarget,
|
|
73
87
|
sizeSlug,
|
|
74
|
-
}
|
|
75
|
-
setAttributes,
|
|
76
|
-
isSelected,
|
|
77
|
-
insertBlocksAfter,
|
|
78
|
-
onReplace,
|
|
79
|
-
onSelectImage,
|
|
80
|
-
onSelectURL,
|
|
81
|
-
onUploadError,
|
|
82
|
-
containerRef,
|
|
83
|
-
context,
|
|
84
|
-
clientId,
|
|
85
|
-
} ) {
|
|
88
|
+
} = attributes;
|
|
86
89
|
const imageRef = useRef();
|
|
87
90
|
const captionRef = useRef();
|
|
88
91
|
const prevUrl = usePrevious( url );
|
|
@@ -185,7 +188,7 @@ export default function Image( {
|
|
|
185
188
|
|
|
186
189
|
// Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural
|
|
187
190
|
// width and height. This resolves an issue in Safari where the loaded natural
|
|
188
|
-
//
|
|
191
|
+
// width and height is otherwise lost when switching between alignments.
|
|
189
192
|
// See: https://github.com/WordPress/gutenberg/pull/37210.
|
|
190
193
|
const { naturalWidth, naturalHeight } = useMemo( () => {
|
|
191
194
|
return {
|
|
@@ -428,6 +431,11 @@ export default function Image( {
|
|
|
428
431
|
defaultedAlt = __( 'This image has an empty alt attribute' );
|
|
429
432
|
}
|
|
430
433
|
|
|
434
|
+
const borderProps = useBorderProps( attributes );
|
|
435
|
+
const isRounded = attributes.className?.includes( 'is-style-rounded' );
|
|
436
|
+
const hasCustomBorder =
|
|
437
|
+
!! borderProps.className || ! isEmpty( borderProps.style );
|
|
438
|
+
|
|
431
439
|
let img = (
|
|
432
440
|
// Disable reason: Image itself is not meant to be interactive, but
|
|
433
441
|
// should direct focus to block.
|
|
@@ -444,6 +452,8 @@ export default function Image( {
|
|
|
444
452
|
} );
|
|
445
453
|
} }
|
|
446
454
|
ref={ imageRef }
|
|
455
|
+
className={ borderProps.className }
|
|
456
|
+
style={ borderProps.style }
|
|
447
457
|
/>
|
|
448
458
|
{ temporaryURL && <Spinner /> }
|
|
449
459
|
</>
|
|
@@ -465,6 +475,7 @@ export default function Image( {
|
|
|
465
475
|
if ( canEditImage && isEditingImage ) {
|
|
466
476
|
img = (
|
|
467
477
|
<ImageEditor
|
|
478
|
+
borderProps={ isRounded ? undefined : borderProps }
|
|
468
479
|
url={ url }
|
|
469
480
|
width={ width }
|
|
470
481
|
height={ height }
|
|
@@ -529,7 +540,7 @@ export default function Image( {
|
|
|
529
540
|
<ResizableBox
|
|
530
541
|
size={ {
|
|
531
542
|
width: width ?? 'auto',
|
|
532
|
-
height: height
|
|
543
|
+
height: height && ! hasCustomBorder ? height : 'auto',
|
|
533
544
|
} }
|
|
534
545
|
showHandle={ isSelected }
|
|
535
546
|
minWidth={ minWidth }
|
|
@@ -576,6 +587,7 @@ export default function Image( {
|
|
|
576
587
|
{ img }
|
|
577
588
|
{ ( ! RichText.isEmpty( caption ) || isSelected ) && (
|
|
578
589
|
<RichText
|
|
590
|
+
className={ __experimentalGetElementClassName( 'caption' ) }
|
|
579
591
|
ref={ captionRef }
|
|
580
592
|
tagName="figcaption"
|
|
581
593
|
aria-label={ __( 'Image caption text' ) }
|
package/src/image/save.js
CHANGED
|
@@ -7,7 +7,12 @@ import { isEmpty } from 'lodash';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
RichText,
|
|
12
|
+
useBlockProps,
|
|
13
|
+
__experimentalGetElementClassName,
|
|
14
|
+
__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
|
|
15
|
+
} from '@wordpress/block-editor';
|
|
11
16
|
|
|
12
17
|
export default function save( { attributes } ) {
|
|
13
18
|
const {
|
|
@@ -27,18 +32,26 @@ export default function save( { attributes } ) {
|
|
|
27
32
|
} = attributes;
|
|
28
33
|
|
|
29
34
|
const newRel = isEmpty( rel ) ? undefined : rel;
|
|
35
|
+
const borderProps = getBorderClassesAndStyles( attributes );
|
|
30
36
|
|
|
31
37
|
const classes = classnames( {
|
|
32
38
|
[ `align${ align }` ]: align,
|
|
33
39
|
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
34
40
|
'is-resized': width || height,
|
|
41
|
+
'has-custom-border':
|
|
42
|
+
!! borderProps.className || ! isEmpty( borderProps.style ),
|
|
43
|
+
} );
|
|
44
|
+
|
|
45
|
+
const imageClasses = classnames( borderProps.className, {
|
|
46
|
+
[ `wp-image-${ id }` ]: !! id,
|
|
35
47
|
} );
|
|
36
48
|
|
|
37
49
|
const image = (
|
|
38
50
|
<img
|
|
39
51
|
src={ url }
|
|
40
52
|
alt={ alt }
|
|
41
|
-
className={
|
|
53
|
+
className={ imageClasses || undefined }
|
|
54
|
+
style={ borderProps.style }
|
|
42
55
|
width={ width }
|
|
43
56
|
height={ height }
|
|
44
57
|
title={ title }
|
|
@@ -60,7 +73,11 @@ export default function save( { attributes } ) {
|
|
|
60
73
|
image
|
|
61
74
|
) }
|
|
62
75
|
{ ! RichText.isEmpty( caption ) && (
|
|
63
|
-
<RichText.Content
|
|
76
|
+
<RichText.Content
|
|
77
|
+
className={ __experimentalGetElementClassName( 'caption' ) }
|
|
78
|
+
tagName="figcaption"
|
|
79
|
+
value={ caption }
|
|
80
|
+
/>
|
|
64
81
|
) }
|
|
65
82
|
</>
|
|
66
83
|
);
|
package/src/image/style.scss
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
height: auto;
|
|
4
4
|
max-width: 100%;
|
|
5
5
|
vertical-align: bottom;
|
|
6
|
+
box-sizing: border-box;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
> a,
|
|
9
|
+
&.has-custom-border {
|
|
10
10
|
img {
|
|
11
|
-
|
|
11
|
+
box-sizing: border-box;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -97,6 +97,42 @@
|
|
|
97
97
|
border-radius: 0;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
|
|
101
|
+
// The following is required to overcome WP Core applying styles that clear
|
|
102
|
+
// img borders with a higher specificity than those added by the border
|
|
103
|
+
// block support to provide a default border-style of solid when a border
|
|
104
|
+
// color or width has been set.
|
|
105
|
+
:where(.has-border-color) {
|
|
106
|
+
border-style: solid;
|
|
107
|
+
}
|
|
108
|
+
:where([style*="border-top-color"]) {
|
|
109
|
+
border-top-style: solid;
|
|
110
|
+
}
|
|
111
|
+
:where([style*="border-right-color"]) {
|
|
112
|
+
border-right-style: solid;
|
|
113
|
+
}
|
|
114
|
+
:where([style*="border-bottom-color"]) {
|
|
115
|
+
border-bottom-style: solid;
|
|
116
|
+
}
|
|
117
|
+
:where([style*="border-left-color"]) {
|
|
118
|
+
border-left-style: solid;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:where([style*="border-width"]) {
|
|
122
|
+
border-style: solid;
|
|
123
|
+
}
|
|
124
|
+
:where([style*="border-top-width"]) {
|
|
125
|
+
border-top-style: solid;
|
|
126
|
+
}
|
|
127
|
+
:where([style*="border-right-width"]) {
|
|
128
|
+
border-right-style: solid;
|
|
129
|
+
}
|
|
130
|
+
:where([style*="border-bottom-width"]) {
|
|
131
|
+
border-bottom-style: solid;
|
|
132
|
+
}
|
|
133
|
+
:where([style*="border-left-width"]) {
|
|
134
|
+
border-left-style: solid;
|
|
135
|
+
}
|
|
100
136
|
}
|
|
101
137
|
|
|
102
138
|
.wp-block-image figure {
|