@wordpress/block-library 6.0.1 → 6.0.5
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/build/block/edit.js +1 -1
- package/build/block/edit.js.map +1 -1
- package/build/button/deprecated.js +155 -10
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.native.js +257 -330
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +4 -1
- package/build/button/index.js.map +1 -1
- package/build/buttons/deprecated.js +84 -2
- package/build/buttons/deprecated.js.map +1 -1
- package/build/buttons/edit.js +6 -42
- package/build/buttons/edit.js.map +1 -1
- package/build/buttons/index.js +16 -14
- package/build/buttons/index.js.map +1 -1
- package/build/buttons/save.js +4 -20
- package/build/buttons/save.js.map +1 -1
- package/build/buttons/transforms.js +15 -10
- package/build/buttons/transforms.js.map +1 -1
- package/build/categories/edit.js +16 -6
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +4 -0
- package/build/categories/index.js.map +1 -1
- package/build/code/edit.native.js +8 -5
- package/build/code/edit.native.js.map +1 -1
- package/build/code/index.js +24 -1
- package/build/code/index.js.map +1 -1
- package/build/column/edit.js +4 -2
- package/build/column/edit.js.map +1 -1
- package/build/column/index.js +4 -0
- package/build/column/index.js.map +1 -1
- package/build/column/save.js +7 -3
- package/build/column/save.js.map +1 -1
- package/build/columns/edit.js +1 -1
- package/build/columns/edit.js.map +1 -1
- package/build/columns/index.js +1 -0
- package/build/columns/index.js.map +1 -1
- package/build/columns/save.js +7 -2
- package/build/columns/save.js.map +1 -1
- package/build/comment-author-avatar/edit.js +83 -0
- package/build/comment-author-avatar/edit.js.map +1 -0
- package/build/{post-comment-date → comment-author-avatar}/index.js +25 -9
- package/build/comment-author-avatar/index.js.map +1 -0
- package/build/comment-author-name/deprecated.js +69 -0
- package/build/comment-author-name/deprecated.js.map +1 -0
- package/build/comment-author-name/edit.js +112 -0
- package/build/comment-author-name/edit.js.map +1 -0
- package/build/comment-author-name/index.js +77 -0
- package/build/comment-author-name/index.js.map +1 -0
- package/build/comment-content/edit.js +74 -0
- package/build/comment-content/edit.js.map +1 -0
- package/build/comment-content/index.js +68 -0
- package/build/comment-content/index.js.map +1 -0
- package/build/comment-date/deprecated.js +68 -0
- package/build/comment-date/deprecated.js.map +1 -0
- package/build/comment-date/edit.js +95 -0
- package/build/comment-date/edit.js.map +1 -0
- package/build/comment-date/index.js +72 -0
- package/build/comment-date/index.js.map +1 -0
- package/build/comment-edit-link/edit.js +61 -0
- package/build/comment-edit-link/edit.js.map +1 -0
- package/build/comment-edit-link/index.js +67 -0
- package/build/comment-edit-link/index.js.map +1 -0
- package/build/comment-reply-link/edit.js +63 -0
- package/build/comment-reply-link/edit.js.map +1 -0
- package/build/comment-reply-link/index.js +63 -0
- package/build/comment-reply-link/index.js.map +1 -0
- package/build/comment-template/edit.js +82 -0
- package/build/comment-template/edit.js.map +1 -0
- package/build/{post-comment-content → comment-template}/index.js +13 -8
- package/build/comment-template/index.js.map +1 -0
- package/build/comment-template/save.js +18 -0
- package/build/comment-template/save.js.map +1 -0
- package/build/comments-query-loop/edit.js +64 -0
- package/build/comments-query-loop/edit.js.map +1 -0
- package/build/comments-query-loop/index.js +67 -0
- package/build/comments-query-loop/index.js.map +1 -0
- package/build/comments-query-loop/save.js +22 -0
- package/build/comments-query-loop/save.js.map +1 -0
- package/build/comments-query-loop/toolbar.js +54 -0
- package/build/comments-query-loop/toolbar.js.map +1 -0
- package/build/cover/deprecated.js +180 -20
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit.js +62 -28
- package/build/cover/edit.js.map +1 -1
- package/build/cover/edit.native.js +6 -2
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/index.js +12 -1
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +17 -14
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +3 -2
- package/build/cover/shared.js.map +1 -1
- package/build/embed/edit.native.js +4 -8
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/embed-bottom-sheet.native.js +4 -5
- package/build/embed/embed-bottom-sheet.native.js.map +1 -1
- package/build/embed/embed-no-preview.native.js +2 -1
- package/build/embed/embed-no-preview.native.js.map +1 -1
- package/build/embed/icons.js +16 -1
- package/build/embed/icons.js.map +1 -1
- package/build/embed/transforms.native.js +3 -1
- package/build/embed/transforms.native.js.map +1 -1
- package/build/embed/variations.js +20 -0
- package/build/embed/variations.js.map +1 -1
- package/build/freeform/edit.js +16 -4
- package/build/freeform/edit.js.map +1 -1
- package/build/gallery/edit.js +7 -0
- 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/gallery.native.js +1 -1
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/index.js +6 -1
- package/build/gallery/index.js.map +1 -1
- package/build/gallery/save.js +7 -2
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/shared.js +0 -7
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/use-get-media.js +4 -10
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-mobile-warning.js +43 -0
- package/build/gallery/use-mobile-warning.js.map +1 -0
- package/build/group/edit.js +1 -1
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/group/save.js +4 -5
- package/build/group/save.js.map +1 -1
- package/build/group/variations.js +2 -1
- package/build/group/variations.js.map +1 -1
- package/build/heading/autogenerate-anchors.js +90 -0
- package/build/heading/autogenerate-anchors.js.map +1 -0
- package/build/heading/edit.js +42 -5
- package/build/heading/edit.js.map +1 -1
- package/build/heading/index.js +14 -2
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +14 -2
- package/build/heading/transforms.js.map +1 -1
- package/build/image/edit.native.js +126 -60
- package/build/image/edit.native.js.map +1 -1
- package/build/image/index.js +1 -1
- package/build/image/transforms.js +2 -1
- package/build/image/transforms.js.map +1 -1
- package/build/index.js +83 -70
- package/build/index.js.map +1 -1
- package/build/index.native.js +3 -1
- package/build/index.native.js.map +1 -1
- package/build/list/deprecated.js +111 -0
- package/build/list/deprecated.js.map +1 -0
- package/build/list/index.js +15 -3
- package/build/list/index.js.map +1 -1
- package/build/media-text/edit.js +1 -1
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/save.js +3 -3
- package/build/media-text/save.js.map +1 -1
- package/build/navigation/deprecated.js +340 -23
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +372 -0
- package/build/navigation/edit/index.js.map +1 -0
- package/build/navigation/edit/inner-blocks.js +100 -0
- package/build/navigation/edit/inner-blocks.js.map +1 -0
- package/build/navigation/edit/navigation-menu-delete-control.js +60 -0
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -0
- package/build/navigation/edit/navigation-menu-name-control.js +27 -0
- package/build/navigation/edit/navigation-menu-name-control.js.map +1 -0
- package/build/navigation/edit/navigation-menu-name-modal.js +54 -0
- package/build/navigation/edit/navigation-menu-name-modal.js.map +1 -0
- package/build/navigation/edit/navigation-menu-publish-button.js +53 -0
- package/build/navigation/edit/navigation-menu-publish-button.js.map +1 -0
- package/build/navigation/edit/navigation-menu-selector.js +49 -0
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -0
- package/build/navigation/edit/placeholder/index.js +207 -0
- package/build/navigation/edit/placeholder/index.js.map +1 -0
- package/build/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +14 -2
- package/build/navigation/edit/placeholder/placeholder-preview.js.map +1 -0
- package/build/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +9 -5
- package/build/navigation/edit/responsive-wrapper.js.map +1 -0
- package/build/navigation/edit/unsaved-inner-blocks.js +153 -0
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -0
- package/build/navigation/{block-navigation-list.js → edit/use-list-view-modal.js} +34 -3
- package/build/navigation/edit/use-list-view-modal.js.map +1 -0
- package/build/navigation/index.js +25 -13
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/save.js +10 -1
- package/build/navigation/save.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +40 -0
- package/build/navigation/use-navigation-menu.js.map +1 -0
- package/build/navigation/use-template-part-area-label.js +74 -0
- package/build/navigation/use-template-part-area-label.js.map +1 -0
- package/build/navigation/view.js +29 -26
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-area/edit.js +97 -0
- package/build/navigation-area/edit.js.map +1 -0
- package/build/navigation-area/index.js +61 -0
- package/build/navigation-area/index.js.map +1 -0
- package/build/navigation-area/inner-blocks.js +33 -0
- package/build/navigation-area/inner-blocks.js.map +1 -0
- package/build/navigation-area/save.js +18 -0
- package/build/navigation-area/save.js.map +1 -0
- package/build/navigation-link/edit.js +69 -7
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/transforms.js +5 -1
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -2
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +125 -84
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +1 -35
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.native.js +2 -1
- package/build/paragraph/edit.native.js.map +1 -1
- package/build/paragraph/index.js +8 -1
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +8 -1
- package/build/paragraph/transforms.js.map +1 -1
- package/build/pattern/edit.js +43 -0
- package/build/pattern/edit.js.map +1 -0
- package/build/{post-comment-author → pattern}/index.js +11 -10
- package/build/pattern/index.js.map +1 -0
- package/build/post-author/index.js +12 -1
- package/build/post-author/index.js.map +1 -1
- package/build/post-comment/edit.js +7 -8
- package/build/post-comment/edit.js.map +1 -1
- package/build/post-comment/index.js +4 -3
- package/build/post-comment/index.js.map +1 -1
- package/build/post-comment/save.js +5 -1
- package/build/post-comment/save.js.map +1 -1
- package/build/post-comments/index.js +8 -1
- package/build/post-comments/index.js.map +1 -1
- package/build/post-comments-count/index.js +7 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/index.js +9 -2
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +8 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +2 -2
- package/build/post-content/edit.js.map +1 -1
- package/build/post-date/deprecated.js +71 -0
- package/build/post-date/deprecated.js.map +1 -0
- package/build/post-date/edit.js +1 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +12 -2
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +12 -1
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/index.js +5 -1
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/index.js +8 -1
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-template/edit.js +8 -4
- package/build/post-template/edit.js.map +1 -1
- package/build/post-terms/edit.js +2 -6
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/index.js +7 -1
- package/build/post-terms/index.js.map +1 -1
- package/build/post-terms/use-post-terms.js +3 -1
- package/build/post-terms/use-post-terms.js.map +1 -1
- package/build/post-title/deprecated.js +84 -0
- package/build/post-title/deprecated.js.map +1 -0
- package/build/post-title/edit.js +1 -1
- package/build/post-title/edit.js.map +1 -1
- package/build/post-title/index.js +14 -2
- package/build/post-title/index.js.map +1 -1
- package/build/preformatted/edit.js +5 -2
- package/build/preformatted/edit.js.map +1 -1
- package/build/preformatted/edit.native.js +16 -6
- package/build/preformatted/edit.native.js.map +1 -1
- package/build/preformatted/index.js +9 -1
- package/build/preformatted/index.js.map +1 -1
- package/build/pullquote/blockquote.native.js +14 -2
- package/build/pullquote/blockquote.native.js.map +1 -1
- package/build/pullquote/edit.native.js +124 -0
- package/build/pullquote/edit.native.js.map +1 -0
- package/build/pullquote/figure.native.js +20 -8
- package/build/pullquote/figure.native.js.map +1 -1
- package/build/pullquote/index.js +12 -0
- package/build/pullquote/index.js.map +1 -1
- package/build/query/edit/index.js +1 -1
- package/build/query/edit/index.js.map +1 -1
- package/build/query/save.js +5 -1
- package/build/query/save.js.map +1 -1
- package/build/query-pagination/edit.js +1 -1
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination-next/index.js +8 -1
- package/build/query-pagination-next/index.js.map +1 -1
- package/build/query-pagination-previous/index.js +8 -1
- package/build/query-pagination-previous/index.js.map +1 -1
- package/build/query-title/deprecated.js +70 -0
- package/build/query-title/deprecated.js.map +1 -0
- package/build/query-title/index.js +17 -2
- package/build/query-title/index.js.map +1 -1
- package/build/quote/deprecated.js +9 -0
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/index.js +17 -1
- package/build/quote/index.js.map +1 -1
- package/build/search/edit.js +27 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js +38 -7
- package/build/search/edit.native.js.map +1 -1
- package/build/separator/separator-settings.js +1 -0
- package/build/separator/separator-settings.js.map +1 -1
- package/build/site-logo/edit.js +46 -21
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +6 -0
- package/build/site-logo/index.js.map +1 -1
- package/build/site-tagline/deprecated.js +68 -0
- package/build/site-tagline/deprecated.js.map +1 -0
- package/build/site-tagline/index.js +11 -3
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/deprecated.js +81 -0
- package/build/site-title/deprecated.js.map +1 -0
- package/build/site-title/index.js +15 -2
- package/build/site-title/index.js.map +1 -1
- package/build/social-links/edit.js +2 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/index.js +1 -0
- package/build/social-links/index.js.map +1 -1
- package/build/social-links/save.js +7 -2
- package/build/social-links/save.js.map +1 -1
- package/build/table/index.js +11 -0
- package/build/table/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +1 -1
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/edit/placeholder/index.js +3 -3
- package/build/template-part/edit/placeholder/index.js.map +1 -1
- package/build/template-part/edit/placeholder/patterns-setup.js +3 -2
- package/build/template-part/edit/placeholder/patterns-setup.js.map +1 -1
- package/build/template-part/edit/selection/template-part-previews.js +1 -1
- package/build/template-part/edit/selection/template-part-previews.js.map +1 -1
- package/build/template-part/variations.js +1 -1
- package/build/template-part/variations.js.map +1 -1
- package/build/term-description/edit.js +1 -1
- package/build/term-description/edit.js.map +1 -1
- package/build/term-description/index.js +4 -1
- package/build/term-description/index.js.map +1 -1
- package/build/utils/clean-empty-object.js +31 -0
- package/build/utils/clean-empty-object.js.map +1 -0
- package/build/utils/migrate-font-family.js +49 -0
- package/build/utils/migrate-font-family.js.map +1 -0
- package/build/verse/deprecated.js +93 -14
- package/build/verse/deprecated.js.map +1 -1
- package/build/verse/index.js +10 -1
- package/build/verse/index.js.map +1 -1
- package/build-module/block/edit.js +1 -1
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/deprecated.js +155 -11
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.native.js +259 -331
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +4 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/buttons/deprecated.js +82 -3
- package/build-module/buttons/deprecated.js.map +1 -1
- package/build-module/buttons/edit.js +6 -39
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/buttons/index.js +16 -13
- package/build-module/buttons/index.js.map +1 -1
- package/build-module/buttons/save.js +4 -18
- package/build-module/buttons/save.js.map +1 -1
- package/build-module/buttons/transforms.js +15 -10
- package/build-module/buttons/transforms.js.map +1 -1
- package/build-module/categories/edit.js +16 -6
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +4 -0
- package/build-module/categories/index.js.map +1 -1
- package/build-module/code/edit.native.js +9 -5
- package/build-module/code/edit.native.js.map +1 -1
- package/build-module/code/index.js +24 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/edit.js +4 -2
- package/build-module/column/edit.js.map +1 -1
- package/build-module/column/index.js +4 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/column/save.js +6 -4
- package/build-module/column/save.js.map +1 -1
- package/build-module/columns/edit.js +1 -1
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/index.js +1 -0
- package/build-module/columns/index.js.map +1 -1
- package/build-module/columns/save.js +5 -3
- package/build-module/columns/save.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +69 -0
- package/build-module/comment-author-avatar/edit.js.map +1 -0
- package/build-module/comment-author-avatar/index.js +52 -0
- package/build-module/comment-author-avatar/index.js.map +1 -0
- package/build-module/comment-author-name/deprecated.js +58 -0
- package/build-module/comment-author-name/deprecated.js.map +1 -0
- package/build-module/comment-author-name/edit.js +97 -0
- package/build-module/comment-author-name/edit.js.map +1 -0
- package/build-module/comment-author-name/index.js +63 -0
- package/build-module/comment-author-name/index.js.map +1 -0
- package/build-module/comment-content/edit.js +61 -0
- package/build-module/comment-content/edit.js.map +1 -0
- package/build-module/comment-content/index.js +55 -0
- package/build-module/comment-content/index.js.map +1 -0
- package/build-module/comment-date/deprecated.js +57 -0
- package/build-module/comment-date/deprecated.js.map +1 -0
- package/build-module/comment-date/edit.js +85 -0
- package/build-module/comment-date/edit.js.map +1 -0
- package/build-module/comment-date/index.js +58 -0
- package/build-module/comment-date/index.js.map +1 -0
- package/build-module/comment-edit-link/edit.js +48 -0
- package/build-module/comment-edit-link/edit.js.map +1 -0
- package/build-module/comment-edit-link/index.js +54 -0
- package/build-module/comment-edit-link/index.js.map +1 -0
- package/build-module/comment-reply-link/edit.js +50 -0
- package/build-module/comment-reply-link/edit.js.map +1 -0
- package/build-module/comment-reply-link/index.js +50 -0
- package/build-module/comment-reply-link/index.js.map +1 -0
- package/build-module/comment-template/edit.js +71 -0
- package/build-module/comment-template/edit.js.map +1 -0
- package/build-module/comment-template/index.js +35 -0
- package/build-module/comment-template/index.js.map +1 -0
- package/build-module/comment-template/save.js +10 -0
- package/build-module/comment-template/save.js.map +1 -0
- package/build-module/comments-query-loop/edit.js +50 -0
- package/build-module/comments-query-loop/edit.js.map +1 -0
- package/build-module/comments-query-loop/index.js +53 -0
- package/build-module/comments-query-loop/index.js.map +1 -0
- package/build-module/comments-query-loop/save.js +14 -0
- package/build-module/comments-query-loop/save.js.map +1 -0
- package/build-module/comments-query-loop/toolbar.js +44 -0
- package/build-module/comments-query-loop/toolbar.js.map +1 -0
- package/build-module/cover/deprecated.js +183 -21
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit.js +62 -28
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/cover/edit.native.js +6 -2
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/index.js +12 -1
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +18 -15
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +3 -2
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/embed/edit.native.js +4 -8
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-bottom-sheet.native.js +4 -5
- package/build-module/embed/embed-bottom-sheet.native.js.map +1 -1
- package/build-module/embed/embed-no-preview.native.js +2 -1
- package/build-module/embed/embed-no-preview.native.js.map +1 -1
- package/build-module/embed/icons.js +13 -0
- package/build-module/embed/icons.js.map +1 -1
- package/build-module/embed/transforms.native.js +2 -1
- package/build-module/embed/transforms.native.js.map +1 -1
- package/build-module/embed/variations.js +21 -1
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/freeform/edit.js +16 -5
- package/build-module/freeform/edit.js.map +1 -1
- package/build-module/gallery/edit.js +6 -0
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +1 -1
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/gallery.native.js +1 -1
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/index.js +6 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/gallery/save.js +5 -3
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/shared.js +0 -6
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/use-get-media.js +4 -10
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-mobile-warning.js +32 -0
- package/build-module/gallery/use-mobile-warning.js.map +1 -0
- package/build-module/group/edit.js +1 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +1 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/save.js +5 -6
- package/build-module/group/save.js.map +1 -1
- package/build-module/group/variations.js +2 -1
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/autogenerate-anchors.js +77 -0
- package/build-module/heading/autogenerate-anchors.js.map +1 -0
- package/build-module/heading/edit.js +43 -7
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/index.js +14 -2
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +14 -2
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/edit.native.js +128 -63
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/index.js +1 -1
- package/build-module/image/transforms.js +2 -1
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/index.js +59 -53
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -2
- package/build-module/index.native.js.map +1 -1
- package/build-module/list/deprecated.js +99 -0
- package/build-module/list/deprecated.js.map +1 -0
- package/build-module/list/index.js +14 -3
- package/build-module/list/index.js.map +1 -1
- package/build-module/media-text/edit.js +1 -1
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/save.js +4 -4
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/navigation/deprecated.js +336 -23
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +346 -0
- package/build-module/navigation/edit/index.js.map +1 -0
- package/build-module/navigation/edit/inner-blocks.js +87 -0
- package/build-module/navigation/edit/inner-blocks.js.map +1 -0
- package/build-module/navigation/edit/navigation-menu-delete-control.js +50 -0
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -0
- package/build-module/navigation/edit/navigation-menu-name-control.js +17 -0
- package/build-module/navigation/edit/navigation-menu-name-control.js.map +1 -0
- package/build-module/navigation/edit/navigation-menu-name-modal.js +46 -0
- package/build-module/navigation/edit/navigation-menu-name-modal.js.map +1 -0
- package/build-module/navigation/edit/navigation-menu-publish-button.js +40 -0
- package/build-module/navigation/edit/navigation-menu-publish-button.js.map +1 -0
- package/build-module/navigation/edit/navigation-menu-selector.js +36 -0
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -0
- package/build-module/navigation/edit/placeholder/index.js +189 -0
- package/build-module/navigation/edit/placeholder/index.js.map +1 -0
- package/build-module/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +11 -2
- package/build-module/navigation/edit/placeholder/placeholder-preview.js.map +1 -0
- package/build-module/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +9 -5
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -0
- package/build-module/navigation/edit/unsaved-inner-blocks.js +136 -0
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -0
- package/build-module/navigation/{block-navigation-list.js → edit/use-list-view-modal.js} +31 -2
- package/build-module/navigation/edit/use-list-view-modal.js.map +1 -0
- package/build-module/navigation/index.js +25 -12
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/save.js +10 -1
- package/build-module/navigation/save.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +31 -0
- package/build-module/navigation/use-navigation-menu.js.map +1 -0
- package/build-module/navigation/use-template-part-area-label.js +63 -0
- package/build-module/navigation/use-template-part-area-label.js.map +1 -0
- package/build-module/navigation/view.js +28 -26
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-area/edit.js +82 -0
- package/build-module/navigation-area/edit.js.map +1 -0
- package/build-module/navigation-area/index.js +47 -0
- package/build-module/navigation-area/index.js.map +1 -0
- package/build-module/navigation-area/inner-blocks.js +25 -0
- package/build-module/navigation-area/inner-blocks.js.map +1 -0
- package/build-module/navigation-area/save.js +10 -0
- package/build-module/navigation-area/save.js.map +1 -0
- package/build-module/navigation-link/edit.js +72 -10
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/transforms.js +5 -1
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +2 -2
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +127 -86
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +1 -35
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.native.js +2 -1
- package/build-module/paragraph/edit.native.js.map +1 -1
- package/build-module/paragraph/index.js +8 -1
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +8 -1
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/pattern/edit.js +35 -0
- package/build-module/pattern/edit.js.map +1 -0
- package/build-module/pattern/index.js +29 -0
- package/build-module/pattern/index.js.map +1 -0
- package/build-module/post-author/index.js +12 -1
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-comment/edit.js +8 -9
- package/build-module/post-comment/edit.js.map +1 -1
- package/build-module/post-comment/index.js +4 -3
- package/build-module/post-comment/index.js.map +1 -1
- package/build-module/post-comment/save.js +4 -2
- package/build-module/post-comment/save.js.map +1 -1
- package/build-module/post-comments/index.js +8 -1
- package/build-module/post-comments/index.js.map +1 -1
- package/build-module/post-comments-count/index.js +7 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/index.js +9 -2
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +8 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js +2 -2
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-date/deprecated.js +60 -0
- package/build-module/post-date/deprecated.js.map +1 -0
- package/build-module/post-date/edit.js +1 -1
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +11 -2
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -1
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +12 -1
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/index.js +5 -1
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/index.js +8 -1
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-template/edit.js +10 -5
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +2 -6
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/index.js +7 -1
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-terms/use-post-terms.js +3 -1
- package/build-module/post-terms/use-post-terms.js.map +1 -1
- package/build-module/post-title/deprecated.js +73 -0
- package/build-module/post-title/deprecated.js.map +1 -0
- package/build-module/post-title/edit.js +1 -1
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/post-title/index.js +13 -2
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/preformatted/edit.js +5 -2
- package/build-module/preformatted/edit.js.map +1 -1
- package/build-module/preformatted/edit.native.js +17 -6
- package/build-module/preformatted/edit.native.js.map +1 -1
- package/build-module/preformatted/index.js +9 -1
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/pullquote/blockquote.native.js +14 -2
- package/build-module/pullquote/blockquote.native.js.map +1 -1
- package/build-module/pullquote/edit.native.js +112 -0
- package/build-module/pullquote/edit.native.js.map +1 -0
- package/build-module/pullquote/figure.native.js +20 -9
- package/build-module/pullquote/figure.native.js.map +1 -1
- package/build-module/pullquote/index.js +12 -0
- package/build-module/pullquote/index.js.map +1 -1
- package/build-module/query/edit/index.js +1 -1
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/save.js +4 -2
- package/build-module/query/save.js.map +1 -1
- package/build-module/query-pagination/edit.js +1 -1
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination-next/index.js +8 -1
- package/build-module/query-pagination-next/index.js.map +1 -1
- package/build-module/query-pagination-previous/index.js +8 -1
- package/build-module/query-pagination-previous/index.js.map +1 -1
- package/build-module/query-title/deprecated.js +59 -0
- package/build-module/query-title/deprecated.js.map +1 -0
- package/build-module/query-title/index.js +16 -2
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/quote/deprecated.js +9 -0
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/index.js +17 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/search/edit.js +28 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js +38 -7
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/separator/separator-settings.js +1 -0
- package/build-module/separator/separator-settings.js.map +1 -1
- package/build-module/site-logo/edit.js +49 -26
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +6 -0
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-tagline/deprecated.js +57 -0
- package/build-module/site-tagline/deprecated.js.map +1 -0
- package/build-module/site-tagline/index.js +10 -3
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/deprecated.js +70 -0
- package/build-module/site-title/deprecated.js.map +1 -0
- package/build-module/site-title/index.js +14 -2
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-links/edit.js +2 -1
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/index.js +1 -0
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/social-links/save.js +5 -3
- package/build-module/social-links/save.js.map +1 -1
- package/build-module/table/index.js +11 -0
- package/build-module/table/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +1 -1
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/template-part/edit/placeholder/index.js +3 -3
- package/build-module/template-part/edit/placeholder/index.js.map +1 -1
- package/build-module/template-part/edit/placeholder/patterns-setup.js +3 -2
- package/build-module/template-part/edit/placeholder/patterns-setup.js.map +1 -1
- package/build-module/template-part/edit/selection/template-part-previews.js +1 -1
- package/build-module/template-part/edit/selection/template-part-previews.js.map +1 -1
- package/build-module/template-part/variations.js +2 -2
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/term-description/edit.js +1 -1
- package/build-module/term-description/edit.js.map +1 -1
- package/build-module/term-description/index.js +4 -1
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/utils/clean-empty-object.js +22 -0
- package/build-module/utils/clean-empty-object.js.map +1 -0
- package/build-module/utils/migrate-font-family.js +38 -0
- package/build-module/utils/migrate-font-family.js.map +1 -0
- package/build-module/verse/deprecated.js +90 -15
- package/build-module/verse/deprecated.js.map +1 -1
- package/build-module/verse/index.js +10 -1
- package/build-module/verse/index.js.map +1 -1
- package/build-style/button/editor-rtl.css +0 -1
- package/build-style/button/editor.css +0 -1
- package/build-style/button/style-rtl.css +15 -27
- package/build-style/button/style.css +15 -27
- package/build-style/buttons/editor-rtl.css +4 -8
- package/build-style/buttons/editor.css +4 -8
- package/build-style/buttons/style-rtl.css +1 -35
- package/build-style/buttons/style.css +1 -48
- package/build-style/columns/style-rtl.css +1 -1
- package/build-style/columns/style.css +1 -1
- package/build-style/common-rtl.css +2 -16
- package/build-style/common.css +2 -16
- package/build-style/cover/editor-rtl.css +14 -32
- package/build-style/cover/editor.css +14 -32
- package/build-style/cover/style-rtl.css +28 -40
- package/build-style/cover/style.css +28 -40
- package/build-style/editor-rtl.css +198 -145
- package/build-style/editor.css +198 -145
- package/build-style/image/editor-rtl.css +1 -0
- package/build-style/image/editor.css +1 -0
- package/build-style/image/style-rtl.css +4 -0
- package/build-style/image/style.css +4 -0
- package/build-style/media-text/style-rtl.css +1 -0
- package/build-style/media-text/style.css +1 -0
- package/build-style/navigation/editor-rtl.css +58 -16
- package/build-style/navigation/editor.css +58 -16
- package/build-style/navigation/style-rtl.css +51 -112
- package/build-style/navigation/style.css +51 -112
- package/build-style/navigation-link/editor-rtl.css +31 -14
- package/build-style/navigation-link/editor.css +31 -14
- package/build-style/navigation-link/style-rtl.css +1 -1
- package/build-style/navigation-link/style.css +1 -1
- package/build-style/navigation-submenu/editor-rtl.css +1 -1
- package/build-style/navigation-submenu/editor.css +1 -1
- package/build-style/navigation-submenu/style-rtl.css +2 -0
- package/build-style/navigation-submenu/style.css +2 -0
- package/build-style/page-list/style-rtl.css +4 -16
- package/build-style/page-list/style.css +4 -16
- package/build-style/post-author/style-rtl.css +0 -1
- package/build-style/post-author/style.css +0 -1
- package/build-style/post-comments/style-rtl.css +21 -1
- package/build-style/post-comments/style.css +21 -1
- package/build-style/post-comments-form/style-rtl.css +29 -0
- package/build-style/post-comments-form/style.css +29 -0
- package/build-style/post-featured-image/editor-rtl.css +1 -1
- package/build-style/post-featured-image/editor.css +1 -1
- package/build-style/post-featured-image/style-rtl.css +1 -1
- package/build-style/post-featured-image/style.css +1 -1
- package/build-style/quote/theme-rtl.css +1 -1
- package/build-style/quote/theme.css +1 -1
- package/build-style/reset-rtl.css +0 -5
- package/build-style/reset.css +0 -5
- package/build-style/search/style-rtl.css +18 -6
- package/build-style/search/style.css +18 -6
- package/build-style/separator/style-rtl.css +0 -1
- package/build-style/separator/style.css +0 -1
- package/build-style/site-logo/editor-rtl.css +82 -14
- package/build-style/site-logo/editor.css +82 -14
- package/build-style/site-logo/style-rtl.css +6 -2
- package/build-style/site-logo/style.css +6 -2
- package/build-style/social-link/editor-rtl.css +4 -0
- package/build-style/social-link/editor.css +4 -0
- package/build-style/social-links/editor-rtl.css +4 -0
- package/build-style/social-links/editor.css +4 -0
- package/build-style/social-links/style-rtl.css +7 -1
- package/build-style/social-links/style.css +7 -1
- package/build-style/style-rtl.css +192 -261
- package/build-style/style.css +192 -274
- package/build-style/template-part/editor-rtl.css +0 -7
- package/build-style/template-part/editor.css +0 -7
- package/build-style/theme-rtl.css +1 -1
- package/build-style/theme.css +1 -1
- package/package.json +20 -19
- package/src/audio/test/edit.native.js +4 -0
- package/src/block/edit.js +1 -1
- package/src/button/block.json +4 -1
- package/src/button/deprecated.js +149 -4
- package/src/button/edit.native.js +319 -366
- package/src/button/editor.scss +0 -1
- package/src/button/style.scss +18 -41
- package/src/buttons/block.json +15 -10
- package/src/buttons/deprecated.js +76 -3
- package/src/buttons/edit.js +4 -49
- package/src/buttons/editor.scss +8 -9
- package/src/buttons/index.js +0 -2
- package/src/buttons/save.js +4 -21
- package/src/buttons/style.scss +1 -51
- package/src/categories/block.json +4 -0
- package/src/categories/edit.js +36 -18
- package/src/categories/index.php +3 -0
- package/src/code/block.json +24 -1
- package/src/code/edit.native.js +12 -14
- package/src/column/block.json +4 -0
- package/src/column/edit.js +8 -2
- package/src/column/save.js +9 -12
- package/src/columns/block.json +1 -0
- package/src/columns/edit.js +1 -1
- package/src/columns/save.js +5 -6
- package/src/columns/style.scss +1 -1
- package/src/comment-author-avatar/block.json +34 -0
- package/src/comment-author-avatar/edit.js +96 -0
- package/src/comment-author-avatar/index.js +18 -0
- package/src/comment-author-avatar/index.php +62 -0
- package/src/comment-author-name/block.json +43 -0
- package/src/comment-author-name/deprecated.js +50 -0
- package/src/comment-author-name/edit.js +124 -0
- package/src/comment-author-name/index.js +20 -0
- package/src/comment-author-name/index.php +57 -0
- package/src/comment-content/block.json +37 -0
- package/src/comment-content/edit.js +80 -0
- package/src/{post-comment-content → comment-content}/index.js +1 -1
- package/src/comment-content/index.php +56 -0
- package/src/comment-date/block.json +38 -0
- package/src/comment-date/deprecated.js +49 -0
- package/src/comment-date/edit.js +106 -0
- package/src/{post-comment-date → comment-date}/index.js +2 -0
- package/src/comment-date/index.php +56 -0
- package/src/comment-edit-link/block.json +36 -0
- package/src/comment-edit-link/edit.js +68 -0
- package/src/{post-comment-author → comment-edit-link}/index.js +5 -5
- package/src/comment-edit-link/index.php +58 -0
- package/src/comment-reply-link/block.json +32 -0
- package/src/comment-reply-link/edit.js +59 -0
- package/src/comment-reply-link/index.js +18 -0
- package/src/comment-reply-link/index.php +80 -0
- package/src/comment-template/block.json +15 -0
- package/src/comment-template/edit.js +100 -0
- package/src/comment-template/index.js +20 -0
- package/src/comment-template/index.php +65 -0
- package/src/comment-template/save.js +8 -0
- package/src/comments-query-loop/block.json +33 -0
- package/src/comments-query-loop/edit.js +53 -0
- package/src/comments-query-loop/index.js +20 -0
- package/src/comments-query-loop/save.js +14 -0
- package/src/comments-query-loop/toolbar.js +57 -0
- package/src/common.scss +3 -17
- package/src/cover/block.json +12 -1
- package/src/cover/deprecated.js +707 -510
- package/src/cover/edit.js +70 -42
- package/src/cover/edit.native.js +5 -1
- package/src/cover/editor.scss +20 -38
- package/src/cover/save.js +30 -26
- package/src/cover/shared.js +3 -2
- package/src/cover/style.scss +9 -7
- package/src/editor.scss +4 -20
- package/src/embed/edit.native.js +6 -9
- package/src/embed/embed-bottom-sheet.native.js +4 -5
- package/src/embed/embed-no-preview.native.js +1 -0
- package/src/embed/icons.js +11 -0
- package/src/embed/test/__snapshots__/index.native.js.snap +181 -0
- package/src/embed/test/index.native.js +991 -0
- package/src/embed/transforms.native.js +2 -0
- package/src/embed/variations.js +21 -0
- package/src/file/test/__snapshots__/edit.native.js.snap +6 -3
- package/src/file/test/edit.native.js +4 -0
- package/src/freeform/edit.js +14 -4
- package/src/gallery/block.json +6 -1
- package/src/gallery/edit.js +7 -0
- package/src/gallery/editor.scss +0 -1
- package/src/gallery/gallery.js +1 -4
- package/src/gallery/gallery.native.js +1 -4
- package/src/gallery/index.php +52 -0
- package/src/gallery/save.js +9 -3
- package/src/gallery/shared.js +0 -7
- package/src/gallery/use-get-media.js +6 -11
- package/src/gallery/use-mobile-warning.js +28 -0
- package/src/group/block.json +1 -0
- package/src/group/edit.js +1 -1
- package/src/group/save.js +3 -8
- package/src/group/variations.js +1 -1
- package/src/heading/autogenerate-anchors.js +81 -0
- package/src/heading/block.json +14 -2
- package/src/heading/edit.js +42 -4
- package/src/home-link/index.php +3 -1
- package/src/image/block.json +1 -1
- package/src/image/edit.native.js +120 -64
- package/src/image/editor.scss +1 -0
- package/src/image/index.php +42 -0
- package/src/image/style.scss +8 -2
- package/src/image/test/edit.native.js +225 -40
- package/src/image/transforms.js +4 -0
- package/src/index.js +96 -88
- package/src/index.native.js +1 -1
- package/src/list/block.json +11 -2
- package/src/list/deprecated.js +79 -0
- package/src/list/index.js +2 -0
- package/src/media-text/edit.js +1 -1
- package/src/media-text/save.js +6 -4
- package/src/media-text/style.scss +1 -0
- package/src/navigation/block.json +41 -13
- package/src/navigation/deprecated.js +336 -27
- package/src/navigation/edit/index.js +510 -0
- package/src/navigation/edit/inner-blocks.js +134 -0
- package/src/navigation/edit/navigation-menu-delete-control.js +81 -0
- package/src/navigation/edit/navigation-menu-name-control.js +22 -0
- package/src/navigation/edit/navigation-menu-name-modal.js +69 -0
- package/src/navigation/edit/navigation-menu-publish-button.js +57 -0
- package/src/navigation/edit/navigation-menu-selector.js +42 -0
- package/src/navigation/edit/placeholder/index.js +257 -0
- package/src/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +13 -2
- package/src/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +8 -6
- package/src/navigation/edit/unsaved-inner-blocks.js +197 -0
- package/src/navigation/edit/use-list-view-modal.js +72 -0
- package/src/navigation/editor.scss +86 -31
- package/src/navigation/index.js +0 -2
- package/src/navigation/index.php +54 -107
- package/src/navigation/save.js +7 -1
- package/src/navigation/style.scss +81 -155
- package/src/navigation/use-navigation-menu.js +60 -0
- package/src/navigation/use-template-part-area-label.js +78 -0
- package/src/navigation/view.js +33 -32
- package/src/navigation-area/block.json +27 -0
- package/src/navigation-area/edit.js +105 -0
- package/src/navigation-area/index.js +26 -0
- package/src/navigation-area/index.php +21 -0
- package/src/navigation-area/inner-blocks.js +24 -0
- package/src/navigation-area/save.js +8 -0
- package/src/navigation-link/edit.js +97 -12
- package/src/navigation-link/editor.scss +30 -19
- package/src/navigation-link/index.php +8 -10
- package/src/navigation-link/style.scss +1 -1
- package/src/navigation-link/transforms.js +5 -1
- package/src/navigation-submenu/edit.js +2 -2
- package/src/navigation-submenu/editor.scss +1 -1
- package/src/navigation-submenu/index.php +10 -9
- package/src/navigation-submenu/style.scss +5 -0
- package/src/page-list/block.json +0 -33
- package/src/page-list/edit.js +168 -110
- package/src/page-list/index.php +27 -26
- package/src/page-list/style.scss +4 -23
- package/src/paragraph/block.json +8 -1
- package/src/paragraph/edit.native.js +1 -0
- package/src/pattern/block.json +17 -0
- package/src/pattern/edit.js +41 -0
- package/src/pattern/index.js +12 -0
- package/src/pattern/index.php +44 -0
- package/src/post-author/block.json +12 -1
- package/src/post-author/style.scss +0 -1
- package/src/post-comment/block.json +4 -3
- package/src/post-comment/edit.js +16 -13
- package/src/post-comment/save.js +4 -6
- package/src/post-comments/block.json +8 -1
- package/src/post-comments/index.php +12 -3
- package/src/post-comments/style.scss +27 -1
- package/src/post-comments-count/block.json +7 -1
- package/src/post-comments-form/block.json +9 -2
- package/src/post-comments-form/index.php +0 -14
- package/src/post-comments-form/style.scss +47 -7
- package/src/post-comments-link/block.json +8 -1
- package/src/post-content/edit.js +2 -2
- package/src/post-date/block.json +8 -1
- package/src/post-date/deprecated.js +52 -0
- package/src/post-date/edit.js +1 -1
- package/src/post-date/index.js +2 -0
- package/src/post-excerpt/block.json +12 -1
- package/src/post-excerpt/edit.js +1 -7
- package/src/post-excerpt/index.php +7 -1
- package/src/post-featured-image/block.json +5 -1
- package/src/post-featured-image/editor.scss +1 -1
- package/src/post-featured-image/style.scss +1 -1
- package/src/post-navigation-link/block.json +8 -1
- package/src/post-navigation-link/index.php +1 -2
- package/src/post-template/edit.js +8 -3
- package/src/post-template/index.php +0 -11
- package/src/post-terms/block.json +7 -1
- package/src/post-terms/edit.js +2 -14
- package/src/post-terms/use-post-terms.js +1 -1
- package/src/post-title/block.json +10 -1
- package/src/post-title/deprecated.js +65 -0
- package/src/post-title/edit.js +1 -1
- package/src/post-title/index.js +2 -0
- package/src/post-title/index.php +7 -2
- package/src/preformatted/block.json +9 -1
- package/src/preformatted/edit.js +2 -1
- package/src/preformatted/edit.native.js +20 -6
- package/src/preformatted/styles.native.scss +5 -0
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +20 -2
- package/src/pullquote/block.json +12 -0
- package/src/pullquote/blockquote.native.js +12 -2
- package/src/pullquote/edit.native.js +129 -0
- package/src/pullquote/figure.native.js +17 -7
- package/src/query/edit/index.js +1 -1
- package/src/query/save.js +4 -6
- package/src/query-pagination/edit.js +1 -1
- package/src/query-pagination-next/block.json +8 -1
- package/src/query-pagination-previous/block.json +8 -1
- package/src/query-title/block.json +13 -1
- package/src/query-title/deprecated.js +51 -0
- package/src/query-title/index.js +2 -0
- package/src/quote/block.json +15 -1
- package/src/quote/deprecated.js +10 -0
- package/src/quote/theme.scss +1 -0
- package/src/reset.scss +0 -9
- package/src/search/edit.js +29 -0
- package/src/search/edit.native.js +46 -12
- package/src/search/style.scss +54 -52
- package/src/search/test/__snapshots__/edit.native.js.snap +33 -5
- package/src/search/test/edit.native.js +4 -0
- package/src/separator/separator-settings.js +1 -0
- package/src/separator/style.scss +0 -1
- package/src/site-logo/block.json +6 -0
- package/src/site-logo/edit.js +59 -34
- package/src/site-logo/editor.scss +101 -16
- package/src/site-logo/index.php +20 -19
- package/src/site-logo/style.scss +8 -2
- package/src/site-tagline/block.json +7 -2
- package/src/site-tagline/deprecated.js +49 -0
- package/src/site-tagline/index.js +2 -0
- package/src/site-title/block.json +11 -1
- package/src/site-title/deprecated.js +62 -0
- package/src/site-title/index.js +2 -0
- package/src/site-title/index.php +3 -0
- package/src/social-link/editor.scss +4 -0
- package/src/social-links/block.json +1 -0
- package/src/social-links/edit.js +2 -1
- package/src/social-links/editor.scss +4 -0
- package/src/social-links/save.js +4 -6
- package/src/social-links/style.scss +8 -1
- package/src/table/block.json +11 -0
- package/src/template-part/edit/inner-blocks.js +1 -1
- package/src/template-part/edit/placeholder/index.js +5 -3
- package/src/template-part/edit/placeholder/patterns-setup.js +3 -2
- package/src/template-part/edit/selection/template-part-previews.js +3 -1
- package/src/template-part/editor.scss +0 -16
- package/src/template-part/index.php +6 -3
- package/src/template-part/variations.js +2 -2
- package/src/term-description/block.json +4 -1
- package/src/term-description/edit.js +1 -1
- package/src/utils/clean-empty-object.js +23 -0
- package/src/utils/migrate-font-family.js +37 -0
- package/src/verse/block.json +10 -1
- package/src/verse/deprecated.js +86 -25
- package/build/buttons/variations.js +0 -33
- package/build/buttons/variations.js.map +0 -1
- package/build/navigation/block-navigation-list.js.map +0 -1
- package/build/navigation/edit.js +0 -304
- package/build/navigation/edit.js.map +0 -1
- package/build/navigation/placeholder-preview.js.map +0 -1
- package/build/navigation/placeholder.js +0 -129
- package/build/navigation/placeholder.js.map +0 -1
- package/build/navigation/responsive-wrapper.js.map +0 -1
- package/build/navigation/use-block-navigator.js +0 -51
- package/build/navigation/use-block-navigator.js.map +0 -1
- package/build/navigation/variations.js +0 -32
- package/build/navigation/variations.js.map +0 -1
- package/build/post-comment-author/edit.js +0 -51
- package/build/post-comment-author/edit.js.map +0 -1
- package/build/post-comment-author/index.js.map +0 -1
- package/build/post-comment-content/edit.js +0 -37
- package/build/post-comment-content/edit.js.map +0 -1
- package/build/post-comment-content/index.js.map +0 -1
- package/build/post-comment-date/edit.js +0 -62
- package/build/post-comment-date/edit.js.map +0 -1
- package/build/post-comment-date/index.js.map +0 -1
- package/build-module/buttons/variations.js +0 -24
- package/build-module/buttons/variations.js.map +0 -1
- package/build-module/navigation/block-navigation-list.js.map +0 -1
- package/build-module/navigation/edit.js +0 -284
- package/build-module/navigation/edit.js.map +0 -1
- package/build-module/navigation/placeholder-preview.js.map +0 -1
- package/build-module/navigation/placeholder.js +0 -113
- package/build-module/navigation/placeholder.js.map +0 -1
- package/build-module/navigation/responsive-wrapper.js.map +0 -1
- package/build-module/navigation/use-block-navigator.js +0 -39
- package/build-module/navigation/use-block-navigator.js.map +0 -1
- package/build-module/navigation/variations.js +0 -23
- package/build-module/navigation/variations.js.map +0 -1
- package/build-module/post-comment-author/edit.js +0 -40
- package/build-module/post-comment-author/edit.js.map +0 -1
- package/build-module/post-comment-author/index.js +0 -31
- package/build-module/post-comment-author/index.js.map +0 -1
- package/build-module/post-comment-content/edit.js +0 -27
- package/build-module/post-comment-content/edit.js.map +0 -1
- package/build-module/post-comment-content/index.js +0 -31
- package/build-module/post-comment-content/index.js.map +0 -1
- package/build-module/post-comment-date/edit.js +0 -52
- package/build-module/post-comment-date/edit.js.map +0 -1
- package/build-module/post-comment-date/index.js +0 -36
- package/build-module/post-comment-date/index.js.map +0 -1
- package/build-style/post-author/editor-rtl.css +0 -104
- package/build-style/post-author/editor.css +0 -104
- package/build-style/query-title/editor-rtl.css +0 -80
- package/build-style/query-title/editor.css +0 -80
- package/build-style/term-description/editor-rtl.css +0 -80
- package/build-style/term-description/editor.css +0 -80
- package/src/buttons/variations.js +0 -24
- package/src/navigation/block-navigation-list.js +0 -38
- package/src/navigation/edit.js +0 -411
- package/src/navigation/placeholder.js +0 -154
- package/src/navigation/use-block-navigator.js +0 -46
- package/src/navigation/variations.js +0 -23
- package/src/post-author/editor.scss +0 -35
- package/src/post-comment-author/block.json +0 -13
- package/src/post-comment-author/edit.js +0 -35
- package/src/post-comment-author/index.php +0 -41
- package/src/post-comment-content/block.json +0 -13
- package/src/post-comment-content/edit.js +0 -32
- package/src/post-comment-content/index.php +0 -42
- package/src/post-comment-date/block.json +0 -18
- package/src/post-comment-date/edit.js +0 -54
- package/src/post-comment-date/index.php +0 -44
- package/src/query-title/editor.scss +0 -4
- package/src/term-description/editor.scss +0 -4
package/src/image/edit.native.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { View, TouchableWithoutFeedback } from 'react-native';
|
|
5
|
+
import { useRoute } from '@react-navigation/native';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
8
9
|
*/
|
|
9
|
-
import { Component } from '@wordpress/element';
|
|
10
|
+
import { Component, useEffect } from '@wordpress/element';
|
|
10
11
|
import {
|
|
11
12
|
requestMediaImport,
|
|
12
13
|
mediaUploadSync,
|
|
@@ -41,6 +42,7 @@ import {
|
|
|
41
42
|
BlockAlignmentToolbar,
|
|
42
43
|
BlockStyles,
|
|
43
44
|
store as blockEditorStore,
|
|
45
|
+
blockSettingsScreens,
|
|
44
46
|
} from '@wordpress/block-editor';
|
|
45
47
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
46
48
|
import { getProtocol, hasQueryArg } from '@wordpress/url';
|
|
@@ -63,6 +65,7 @@ import styles from './styles.scss';
|
|
|
63
65
|
import { getUpdatedLinkTargetSettings } from './utils';
|
|
64
66
|
|
|
65
67
|
import {
|
|
68
|
+
LINK_DESTINATION_NONE,
|
|
66
69
|
LINK_DESTINATION_CUSTOM,
|
|
67
70
|
LINK_DESTINATION_ATTACHMENT,
|
|
68
71
|
LINK_DESTINATION_MEDIA,
|
|
@@ -76,6 +79,101 @@ const getUrlForSlug = ( image, sizeSlug ) => {
|
|
|
76
79
|
return image?.media_details?.sizes?.[ sizeSlug ]?.source_url;
|
|
77
80
|
};
|
|
78
81
|
|
|
82
|
+
function LinkSettings( {
|
|
83
|
+
attributes,
|
|
84
|
+
image,
|
|
85
|
+
isLinkSheetVisible,
|
|
86
|
+
setMappedAttributes,
|
|
87
|
+
} ) {
|
|
88
|
+
const route = useRoute();
|
|
89
|
+
const { href: url, label, linkDestination, linkTarget, rel } = attributes;
|
|
90
|
+
|
|
91
|
+
// Persist attributes passed from child screen
|
|
92
|
+
useEffect( () => {
|
|
93
|
+
const { inputValue: newUrl } = route.params || {};
|
|
94
|
+
|
|
95
|
+
let newLinkDestination;
|
|
96
|
+
switch ( newUrl ) {
|
|
97
|
+
case attributes.url:
|
|
98
|
+
newLinkDestination = LINK_DESTINATION_MEDIA;
|
|
99
|
+
break;
|
|
100
|
+
case image?.link:
|
|
101
|
+
newLinkDestination = LINK_DESTINATION_ATTACHMENT;
|
|
102
|
+
break;
|
|
103
|
+
case '':
|
|
104
|
+
newLinkDestination = LINK_DESTINATION_NONE;
|
|
105
|
+
break;
|
|
106
|
+
default:
|
|
107
|
+
newLinkDestination = LINK_DESTINATION_CUSTOM;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
setMappedAttributes( {
|
|
112
|
+
url: newUrl,
|
|
113
|
+
linkDestination: newLinkDestination,
|
|
114
|
+
} );
|
|
115
|
+
}, [ route.params?.inputValue ] );
|
|
116
|
+
|
|
117
|
+
let valueMask;
|
|
118
|
+
switch ( linkDestination ) {
|
|
119
|
+
case LINK_DESTINATION_MEDIA:
|
|
120
|
+
valueMask = __( 'Media File' );
|
|
121
|
+
break;
|
|
122
|
+
case LINK_DESTINATION_ATTACHMENT:
|
|
123
|
+
valueMask = __( 'Attachment Page' );
|
|
124
|
+
break;
|
|
125
|
+
case LINK_DESTINATION_CUSTOM:
|
|
126
|
+
valueMask = __( 'Custom URL' );
|
|
127
|
+
break;
|
|
128
|
+
default:
|
|
129
|
+
valueMask = __( 'None' );
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const linkSettingsOptions = {
|
|
134
|
+
url: {
|
|
135
|
+
valueMask,
|
|
136
|
+
autoFocus: false,
|
|
137
|
+
autoFill: true,
|
|
138
|
+
},
|
|
139
|
+
openInNewTab: {
|
|
140
|
+
label: __( 'Open in new tab' ),
|
|
141
|
+
},
|
|
142
|
+
linkRel: {
|
|
143
|
+
label: __( 'Link Rel' ),
|
|
144
|
+
placeholder: _x( 'None', 'Link rel attribute value placeholder' ),
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<PanelBody title={ __( 'Link Settings' ) }>
|
|
150
|
+
<LinkSettingsNavigation
|
|
151
|
+
isVisible={ isLinkSheetVisible }
|
|
152
|
+
url={ url }
|
|
153
|
+
rel={ rel }
|
|
154
|
+
label={ label }
|
|
155
|
+
linkTarget={ linkTarget }
|
|
156
|
+
setAttributes={ setMappedAttributes }
|
|
157
|
+
withBottomSheet={ false }
|
|
158
|
+
hasPicker
|
|
159
|
+
options={ linkSettingsOptions }
|
|
160
|
+
showIcon={ false }
|
|
161
|
+
onLinkCellPressed={ ( { navigation } ) => {
|
|
162
|
+
navigation.navigate(
|
|
163
|
+
blockSettingsScreens.imageLinkDestinations,
|
|
164
|
+
{
|
|
165
|
+
inputValue: attributes.href,
|
|
166
|
+
linkDestination: attributes.linkDestination,
|
|
167
|
+
imageUrl: attributes.url,
|
|
168
|
+
attachmentPageUrl: image?.link,
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
} }
|
|
172
|
+
/>
|
|
173
|
+
</PanelBody>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
79
177
|
export class ImageEdit extends Component {
|
|
80
178
|
constructor( props ) {
|
|
81
179
|
super( props );
|
|
@@ -96,7 +194,6 @@ export class ImageEdit extends Component {
|
|
|
96
194
|
);
|
|
97
195
|
this.updateMediaProgress = this.updateMediaProgress.bind( this );
|
|
98
196
|
this.updateImageURL = this.updateImageURL.bind( this );
|
|
99
|
-
this.onSetLinkDestination = this.onSetLinkDestination.bind( this );
|
|
100
197
|
this.onSetNewTab = this.onSetNewTab.bind( this );
|
|
101
198
|
this.onSetSizeSlug = this.onSetSizeSlug.bind( this );
|
|
102
199
|
this.onImagePressed = this.onImagePressed.bind( this );
|
|
@@ -108,25 +205,6 @@ export class ImageEdit extends Component {
|
|
|
108
205
|
);
|
|
109
206
|
this.setMappedAttributes = this.setMappedAttributes.bind( this );
|
|
110
207
|
this.onSizeChangeValue = this.onSizeChangeValue.bind( this );
|
|
111
|
-
|
|
112
|
-
this.linkSettingsOptions = {
|
|
113
|
-
url: {
|
|
114
|
-
label: __( 'Image Link URL' ),
|
|
115
|
-
placeholder: __( 'Add URL' ),
|
|
116
|
-
autoFocus: false,
|
|
117
|
-
autoFill: true,
|
|
118
|
-
},
|
|
119
|
-
openInNewTab: {
|
|
120
|
-
label: __( 'Open in new tab' ),
|
|
121
|
-
},
|
|
122
|
-
linkRel: {
|
|
123
|
-
label: __( 'Link Rel' ),
|
|
124
|
-
placeholder: _x(
|
|
125
|
-
'None',
|
|
126
|
-
'Link rel attribute value placeholder'
|
|
127
|
-
),
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
208
|
}
|
|
131
209
|
|
|
132
210
|
componentDidMount() {
|
|
@@ -282,13 +360,6 @@ export class ImageEdit extends Component {
|
|
|
282
360
|
} );
|
|
283
361
|
}
|
|
284
362
|
|
|
285
|
-
onSetLinkDestination( href ) {
|
|
286
|
-
this.props.setAttributes( {
|
|
287
|
-
linkDestination: LINK_DESTINATION_CUSTOM,
|
|
288
|
-
href,
|
|
289
|
-
} );
|
|
290
|
-
}
|
|
291
|
-
|
|
292
363
|
onSetNewTab( value ) {
|
|
293
364
|
const updatedLinkTarget = getUpdatedLinkTargetSettings(
|
|
294
365
|
value,
|
|
@@ -383,45 +454,23 @@ export class ImageEdit extends Component {
|
|
|
383
454
|
: width;
|
|
384
455
|
}
|
|
385
456
|
|
|
386
|
-
setMappedAttributes( { url: href, ...restAttributes } ) {
|
|
457
|
+
setMappedAttributes( { url: href, linkDestination, ...restAttributes } ) {
|
|
387
458
|
const { setAttributes } = this.props;
|
|
459
|
+
if ( ! href && ! linkDestination ) {
|
|
460
|
+
linkDestination = LINK_DESTINATION_NONE;
|
|
461
|
+
} else if ( ! linkDestination ) {
|
|
462
|
+
linkDestination = LINK_DESTINATION_CUSTOM;
|
|
463
|
+
}
|
|
388
464
|
|
|
389
|
-
return href === undefined
|
|
390
|
-
? setAttributes(
|
|
391
|
-
...restAttributes,
|
|
392
|
-
linkDestination: LINK_DESTINATION_CUSTOM,
|
|
393
|
-
} )
|
|
465
|
+
return href === undefined || href === this.props.attributes.href
|
|
466
|
+
? setAttributes( restAttributes )
|
|
394
467
|
: setAttributes( {
|
|
395
468
|
...restAttributes,
|
|
469
|
+
linkDestination,
|
|
396
470
|
href,
|
|
397
|
-
linkDestination: LINK_DESTINATION_CUSTOM,
|
|
398
471
|
} );
|
|
399
472
|
}
|
|
400
473
|
|
|
401
|
-
getLinkSettings() {
|
|
402
|
-
const { isLinkSheetVisible } = this.state;
|
|
403
|
-
const {
|
|
404
|
-
attributes: { href: url, ...unMappedAttributes },
|
|
405
|
-
} = this.props;
|
|
406
|
-
const mappedAttributes = { ...unMappedAttributes, url };
|
|
407
|
-
|
|
408
|
-
return (
|
|
409
|
-
<LinkSettingsNavigation
|
|
410
|
-
isVisible={ isLinkSheetVisible }
|
|
411
|
-
url={ mappedAttributes.url }
|
|
412
|
-
rel={ mappedAttributes.rel }
|
|
413
|
-
label={ mappedAttributes.label }
|
|
414
|
-
linkTarget={ mappedAttributes.linkTarget }
|
|
415
|
-
onClose={ this.dismissSheet }
|
|
416
|
-
setAttributes={ this.setMappedAttributes }
|
|
417
|
-
withBottomSheet={ false }
|
|
418
|
-
hasPicker
|
|
419
|
-
options={ this.linkSettingsOptions }
|
|
420
|
-
showIcon={ false }
|
|
421
|
-
/>
|
|
422
|
-
);
|
|
423
|
-
}
|
|
424
|
-
|
|
425
474
|
getAltTextSettings() {
|
|
426
475
|
const {
|
|
427
476
|
attributes: { alt },
|
|
@@ -583,9 +632,12 @@ export class ImageEdit extends Component {
|
|
|
583
632
|
) }
|
|
584
633
|
{ this.getAltTextSettings() }
|
|
585
634
|
</PanelBody>
|
|
586
|
-
<
|
|
587
|
-
{ this.
|
|
588
|
-
|
|
635
|
+
<LinkSettings
|
|
636
|
+
attributes={ this.props.attributes }
|
|
637
|
+
image={ this.props.image }
|
|
638
|
+
isLinkSheetVisible={ this.state.isLinkSheetVisible }
|
|
639
|
+
setMappedAttributes={ this.setMappedAttributes }
|
|
640
|
+
/>
|
|
589
641
|
<PanelBody
|
|
590
642
|
title={ __( 'Featured Image' ) }
|
|
591
643
|
titleStyle={ styles.featuredImagePanelTitle }
|
|
@@ -633,7 +685,9 @@ export class ImageEdit extends Component {
|
|
|
633
685
|
resizeMode: context?.imageCrop ? 'cover' : 'contain',
|
|
634
686
|
};
|
|
635
687
|
|
|
636
|
-
const imageContainerStyles = [
|
|
688
|
+
const imageContainerStyles = [
|
|
689
|
+
context?.fixedHeight && styles.fixedHeight,
|
|
690
|
+
];
|
|
637
691
|
|
|
638
692
|
const getImageComponent = ( openMediaOptions, getMediaOptions ) => (
|
|
639
693
|
<Badge label={ __( 'Featured' ) } show={ isFeaturedImage }>
|
|
@@ -689,7 +743,9 @@ export class ImageEdit extends Component {
|
|
|
689
743
|
}
|
|
690
744
|
retryMessage={ retryMessage }
|
|
691
745
|
url={ url }
|
|
692
|
-
shapeStyle={
|
|
746
|
+
shapeStyle={
|
|
747
|
+
styles[ className ] || className
|
|
748
|
+
}
|
|
693
749
|
width={ this.getWidth() }
|
|
694
750
|
{ ...( hasImageContext
|
|
695
751
|
? additionalImageProps
|
package/src/image/editor.scss
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Server-side rendering of the `core/image` block.
|
|
4
|
+
*
|
|
5
|
+
* @package gutenberg
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Renders the `core/image` block on the server,
|
|
10
|
+
* adding a data-id attribute to the element if core/gallery has added on pre-render.
|
|
11
|
+
*
|
|
12
|
+
* @param array $attributes The block attributes.
|
|
13
|
+
* @param array $content The block content.
|
|
14
|
+
* @return string Returns the block content with the data-id attribute added.
|
|
15
|
+
*/
|
|
16
|
+
function render_block_core_image( $attributes, $content ) {
|
|
17
|
+
if ( isset( $attributes['data-id'] ) ) {
|
|
18
|
+
// Add the data-id="$id" attribute to the img element
|
|
19
|
+
// to provide backwards compatibility for the Gallery Block,
|
|
20
|
+
// which now wraps Image Blocks within innerBlocks.
|
|
21
|
+
// The data-id attribute is added in a core/gallery `render_block_data` hook.
|
|
22
|
+
$data_id_attribute = 'data-id="' . esc_attr( $attributes['data-id'] ) . '"';
|
|
23
|
+
if ( ! strpos( $content, $data_id_attribute ) ) {
|
|
24
|
+
$content = str_replace( '<img', '<img ' . $data_id_attribute . ' ', $content );
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return $content;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Registers the `core/image` block on server.
|
|
33
|
+
*/
|
|
34
|
+
function register_block_core_image() {
|
|
35
|
+
register_block_type_from_metadata(
|
|
36
|
+
__DIR__ . '/image',
|
|
37
|
+
array(
|
|
38
|
+
'render_callback' => 'render_block_core_image',
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
add_action( 'init', 'register_block_core_image' );
|
package/src/image/style.scss
CHANGED
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
margin: 0 0 1em 0;
|
|
3
3
|
|
|
4
4
|
img {
|
|
5
|
+
height: auto;
|
|
5
6
|
max-width: 100%;
|
|
7
|
+
vertical-align: bottom;
|
|
6
8
|
}
|
|
7
9
|
|
|
8
|
-
&:not(.is-style-rounded)
|
|
9
|
-
|
|
10
|
+
&:not(.is-style-rounded) {
|
|
11
|
+
> a,
|
|
12
|
+
img {
|
|
13
|
+
border-radius: inherit;
|
|
14
|
+
}
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
&.aligncenter {
|
|
@@ -15,6 +20,7 @@
|
|
|
15
20
|
|
|
16
21
|
&.alignfull img,
|
|
17
22
|
&.alignwide img {
|
|
23
|
+
height: auto;
|
|
18
24
|
width: 100%;
|
|
19
25
|
}
|
|
20
26
|
|
|
@@ -1,65 +1,250 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { act, fireEvent, initializeEditor, getEditorHtml } from 'test/helpers';
|
|
5
|
+
import { Image } from 'react-native';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* WordPress dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
|
|
11
|
+
import { apiFetch } from '@wordpress/data-controls';
|
|
5
12
|
|
|
6
13
|
/**
|
|
7
14
|
* Internal dependencies
|
|
8
15
|
*/
|
|
9
|
-
import {
|
|
10
|
-
|
|
16
|
+
import { registerCoreBlocks } from '../..';
|
|
17
|
+
|
|
18
|
+
jest.mock( '@wordpress/data-controls', () => {
|
|
19
|
+
const dataControls = jest.requireActual( '@wordpress/data-controls' );
|
|
20
|
+
return {
|
|
21
|
+
...dataControls,
|
|
22
|
+
apiFetch: jest.fn(),
|
|
23
|
+
};
|
|
24
|
+
} );
|
|
11
25
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
};
|
|
26
|
+
const apiFetchPromise = Promise.resolve( {} );
|
|
27
|
+
apiFetch.mockImplementation( () => apiFetchPromise );
|
|
15
28
|
|
|
16
|
-
|
|
29
|
+
beforeAll( () => {
|
|
30
|
+
registerCoreBlocks();
|
|
31
|
+
|
|
32
|
+
// Mock Image.getSize to avoid failed attempt to size non-existant image
|
|
33
|
+
const getSizeSpy = jest.spyOn( Image, 'getSize' );
|
|
34
|
+
getSizeSpy.mockImplementation( ( _url, callback ) => callback( 300, 200 ) );
|
|
35
|
+
} );
|
|
36
|
+
|
|
37
|
+
afterAll( () => {
|
|
38
|
+
getBlockTypes().forEach( ( { name } ) => {
|
|
39
|
+
unregisterBlockType( name );
|
|
40
|
+
} );
|
|
17
41
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
attributes={ attributes }
|
|
22
|
-
getStylesFromColorScheme={ getStylesFromColorScheme }
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
42
|
+
// Restore mocks
|
|
43
|
+
Image.getSize.mockRestore();
|
|
44
|
+
} );
|
|
25
45
|
|
|
26
46
|
describe( 'Image Block', () => {
|
|
27
|
-
|
|
28
|
-
|
|
47
|
+
it( 'sets link to None', async () => {
|
|
48
|
+
const initialHtml = `
|
|
49
|
+
<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"media","className":"is-style-default"} -->
|
|
50
|
+
<figure class="wp-block-image size-large is-style-default">
|
|
51
|
+
<a href="https://cldup.com/cXyG__fTLN.jpg">
|
|
52
|
+
<img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
|
|
53
|
+
</a>
|
|
54
|
+
<figcaption>Mountain</figcaption></figure>
|
|
55
|
+
<!-- /wp:image -->`;
|
|
56
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
57
|
+
// We must await the image fetch via `getMedia`
|
|
58
|
+
await act( () => apiFetchPromise );
|
|
59
|
+
|
|
60
|
+
fireEvent.press( screen.getByA11yLabel( /Image Block/ ) );
|
|
61
|
+
// Awaiting navigation event seemingly required due to React Navigation bug
|
|
62
|
+
// https://git.io/Ju35Z
|
|
63
|
+
await act( () =>
|
|
64
|
+
fireEvent.press( screen.getByA11yLabel( 'Open Settings' ) )
|
|
65
|
+
);
|
|
66
|
+
fireEvent.press( screen.getByText( 'Media File' ) );
|
|
67
|
+
fireEvent.press( screen.getByText( 'None' ) );
|
|
68
|
+
|
|
69
|
+
const expectedHtml = `<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"none","className":"is-style-default"} -->
|
|
70
|
+
<figure class="wp-block-image size-large is-style-default"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/><figcaption>Mountain</figcaption></figure>
|
|
71
|
+
<!-- /wp:image -->`;
|
|
72
|
+
expect( getEditorHtml() ).toBe( expectedHtml );
|
|
73
|
+
} );
|
|
74
|
+
|
|
75
|
+
it( 'sets link to Media File', async () => {
|
|
76
|
+
const initialHtml = `
|
|
77
|
+
<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"none","className":"is-style-default"} -->
|
|
78
|
+
<figure class="wp-block-image size-large is-style-default">
|
|
79
|
+
<img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
|
|
80
|
+
<figcaption>Mountain</figcaption></figure>
|
|
81
|
+
<!-- /wp:image -->`;
|
|
82
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
83
|
+
// We must await the image fetch via `getMedia`
|
|
84
|
+
await act( () => apiFetchPromise );
|
|
85
|
+
|
|
86
|
+
fireEvent.press( screen.getByA11yLabel( /Image Block/ ) );
|
|
87
|
+
// Awaiting navigation event seemingly required due to React Navigation bug
|
|
88
|
+
// https://git.io/Ju35Z
|
|
89
|
+
await act( () =>
|
|
90
|
+
fireEvent.press( screen.getByA11yLabel( 'Open Settings' ) )
|
|
91
|
+
);
|
|
92
|
+
fireEvent.press( screen.getByText( 'None' ) );
|
|
93
|
+
fireEvent.press( screen.getByText( 'Media File' ) );
|
|
94
|
+
|
|
95
|
+
const expectedHtml = `<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"media","className":"is-style-default"} -->
|
|
96
|
+
<figure class="wp-block-image size-large is-style-default"><a href="https://cldup.com/cXyG__fTLN.jpg"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></a><figcaption>Mountain</figcaption></figure>
|
|
97
|
+
<!-- /wp:image -->`;
|
|
98
|
+
expect( getEditorHtml() ).toBe( expectedHtml );
|
|
29
99
|
} );
|
|
30
100
|
|
|
31
|
-
it( '
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
101
|
+
it( 'sets link to Custom URL', async () => {
|
|
102
|
+
const initialHtml = `
|
|
103
|
+
<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"none","className":"is-style-default"} -->
|
|
104
|
+
<figure class="wp-block-image size-large is-style-default">
|
|
105
|
+
<img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
|
|
106
|
+
<figcaption>Mountain</figcaption></figure>
|
|
107
|
+
<!-- /wp:image -->`;
|
|
108
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
109
|
+
// We must await the image fetch via `getMedia`
|
|
110
|
+
await act( () => apiFetchPromise );
|
|
111
|
+
|
|
112
|
+
fireEvent.press( screen.getByA11yLabel( /Image Block/ ) );
|
|
113
|
+
// Awaiting navigation event seemingly required due to React Navigation bug
|
|
114
|
+
// https://git.io/Ju35Z
|
|
115
|
+
await act( () =>
|
|
116
|
+
fireEvent.press( screen.getByA11yLabel( 'Open Settings' ) )
|
|
117
|
+
);
|
|
118
|
+
fireEvent.press( screen.getByText( 'None' ) );
|
|
119
|
+
fireEvent.press( screen.getByText( 'Custom URL' ) );
|
|
120
|
+
fireEvent.changeText(
|
|
121
|
+
screen.getByPlaceholderText( 'Search or type URL' ),
|
|
122
|
+
'wordpress.org'
|
|
123
|
+
);
|
|
124
|
+
fireEvent.press( screen.getByA11yLabel( 'Apply' ) );
|
|
125
|
+
|
|
126
|
+
const expectedHtml = `<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"custom","className":"is-style-default"} -->
|
|
127
|
+
<figure class="wp-block-image size-large is-style-default"><a href="http://wordpress.org"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></a><figcaption>Mountain</figcaption></figure>
|
|
128
|
+
<!-- /wp:image -->`;
|
|
129
|
+
expect( getEditorHtml() ).toBe( expectedHtml );
|
|
35
130
|
} );
|
|
36
131
|
|
|
37
|
-
it( '
|
|
38
|
-
const
|
|
39
|
-
|
|
132
|
+
it( 'swaps the link between destinations', async () => {
|
|
133
|
+
const initialHtml = `
|
|
134
|
+
<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"none","className":"is-style-default"} -->
|
|
135
|
+
<figure class="wp-block-image size-large is-style-default">
|
|
136
|
+
<img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
|
|
137
|
+
<figcaption>Mountain</figcaption></figure>
|
|
138
|
+
<!-- /wp:image -->`;
|
|
139
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
140
|
+
// We must await the image fetch via `getMedia`
|
|
141
|
+
await act( () => apiFetchPromise );
|
|
40
142
|
|
|
41
|
-
|
|
143
|
+
fireEvent.press( screen.getByA11yLabel( /Image Block/ ) );
|
|
144
|
+
// Awaiting navigation event seemingly required due to React Navigation bug
|
|
145
|
+
// https://git.io/Ju35Z
|
|
146
|
+
await act( () =>
|
|
147
|
+
fireEvent.press( screen.getByA11yLabel( 'Open Settings' ) )
|
|
148
|
+
);
|
|
149
|
+
fireEvent.press( screen.getByText( 'None' ) );
|
|
150
|
+
fireEvent.press( screen.getByText( 'Media File' ) );
|
|
151
|
+
fireEvent.press( screen.getByText( 'Custom URL' ) );
|
|
152
|
+
fireEvent.changeText(
|
|
153
|
+
screen.getByPlaceholderText( 'Search or type URL' ),
|
|
154
|
+
'wordpress.org'
|
|
155
|
+
);
|
|
156
|
+
fireEvent.press( screen.getByA11yLabel( 'Apply' ) );
|
|
157
|
+
fireEvent.press( screen.getByText( 'Custom URL' ) );
|
|
158
|
+
fireEvent.press( screen.getByText( 'Media File' ) );
|
|
42
159
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
160
|
+
const expectedHtml = `<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"media","className":"is-style-default"} -->
|
|
161
|
+
<figure class="wp-block-image size-large is-style-default"><a href="https://cldup.com/cXyG__fTLN.jpg"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></a><figcaption>Mountain</figcaption></figure>
|
|
162
|
+
<!-- /wp:image -->`;
|
|
163
|
+
expect( getEditorHtml() ).toBe( expectedHtml );
|
|
47
164
|
} );
|
|
48
165
|
|
|
49
|
-
it( '
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
166
|
+
it( 'does not display the Link To URL within the Custom URL input when set to Media File and query parameters are present', async () => {
|
|
167
|
+
const initialHtml = `
|
|
168
|
+
<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"media","className":"is-style-default"} -->
|
|
169
|
+
<figure class="wp-block-image size-large is-style-default">
|
|
170
|
+
<a href="https://cldup.com/cXyG__fTLN.jpg">
|
|
171
|
+
<img src="https://cldup.com/cXyG__fTLN.jpg?w=683" alt="" class="wp-image-1"/>
|
|
172
|
+
</a>
|
|
173
|
+
<figcaption>Mountain</figcaption></figure>
|
|
174
|
+
<!-- /wp:image -->`;
|
|
175
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
176
|
+
// We must await the image fetch via `getMedia`
|
|
177
|
+
await act( () => apiFetchPromise );
|
|
178
|
+
|
|
179
|
+
fireEvent.press( screen.getByA11yLabel( /Image Block/ ) );
|
|
180
|
+
// Awaiting navigation event seemingly required due to React Navigation bug
|
|
181
|
+
// https://git.io/Ju35Z
|
|
182
|
+
await act( () =>
|
|
183
|
+
fireEvent.press( screen.getByA11yLabel( 'Open Settings' ) )
|
|
55
184
|
);
|
|
56
|
-
|
|
185
|
+
fireEvent.press( screen.getByText( 'Media File' ) );
|
|
186
|
+
|
|
187
|
+
expect( screen.queryByA11yLabel( /https:\/\/cldup\.com/ ) ).toBeNull();
|
|
188
|
+
} );
|
|
189
|
+
|
|
190
|
+
it( 'sets link target', async () => {
|
|
191
|
+
const initialHtml = `
|
|
192
|
+
<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"custom","className":"is-style-default"} -->
|
|
193
|
+
<figure class="wp-block-image size-large is-style-default">
|
|
194
|
+
<a href="https://wordpress.org">
|
|
195
|
+
<img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
|
|
196
|
+
</a>
|
|
197
|
+
<figcaption>Mountain</figcaption></figure>
|
|
198
|
+
<!-- /wp:image -->`;
|
|
199
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
200
|
+
// We must await the image fetch via `getMedia`
|
|
201
|
+
await act( () => apiFetchPromise );
|
|
202
|
+
|
|
203
|
+
const imageBlock = screen.getByA11yLabel( /Image Block/ );
|
|
204
|
+
fireEvent.press( imageBlock );
|
|
205
|
+
|
|
206
|
+
const settingsButton = screen.getByA11yLabel( 'Open Settings' );
|
|
207
|
+
// Awaiting navigation event seemingly required due to React Navigation bug
|
|
208
|
+
// https://git.io/Ju35Z
|
|
209
|
+
await act( () => fireEvent.press( settingsButton ) );
|
|
210
|
+
|
|
211
|
+
const linkTargetButton = screen.getByText( 'Open in new tab' );
|
|
212
|
+
fireEvent.press( linkTargetButton );
|
|
213
|
+
|
|
214
|
+
const expectedHtml = `<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"custom","className":"is-style-default"} -->
|
|
215
|
+
<figure class="wp-block-image size-large is-style-default"><a href="https://wordpress.org" target="_blank" rel="noreferrer noopener"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></a><figcaption>Mountain</figcaption></figure>
|
|
216
|
+
<!-- /wp:image -->`;
|
|
217
|
+
expect( getEditorHtml() ).toBe( expectedHtml );
|
|
218
|
+
} );
|
|
219
|
+
|
|
220
|
+
it( 'unset link target', async () => {
|
|
221
|
+
const initialHtml = `
|
|
222
|
+
<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"custom","className":"is-style-default"} -->
|
|
223
|
+
<figure class="wp-block-image size-large is-style-default">
|
|
224
|
+
<a href="https://wordpress.org" target="_blank" rel="noreferrer noopener">
|
|
225
|
+
<img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/>
|
|
226
|
+
</a>
|
|
227
|
+
<figcaption>Mountain</figcaption>
|
|
228
|
+
</figure>
|
|
229
|
+
<!-- /wp:image -->`;
|
|
230
|
+
const screen = await initializeEditor( { initialHtml } );
|
|
231
|
+
// We must await the image fetch via `getMedia`
|
|
232
|
+
await act( () => apiFetchPromise );
|
|
233
|
+
|
|
234
|
+
const imageBlock = screen.getByA11yLabel( /Image Block/ );
|
|
235
|
+
fireEvent.press( imageBlock );
|
|
236
|
+
|
|
237
|
+
const settingsButton = screen.getByA11yLabel( 'Open Settings' );
|
|
238
|
+
// Awaiting navigation event seemingly required due to React Navigation bug
|
|
239
|
+
// https://git.io/Ju35Z
|
|
240
|
+
await act( () => fireEvent.press( settingsButton ) );
|
|
57
241
|
|
|
58
|
-
|
|
242
|
+
const linkTargetButton = screen.getByText( 'Open in new tab' );
|
|
243
|
+
fireEvent.press( linkTargetButton );
|
|
59
244
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
245
|
+
const expectedHtml = `<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"custom","className":"is-style-default"} -->
|
|
246
|
+
<figure class="wp-block-image size-large is-style-default"><a href="https://wordpress.org"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></a><figcaption>Mountain</figcaption></figure>
|
|
247
|
+
<!-- /wp:image -->`;
|
|
248
|
+
expect( getEditorHtml() ).toBe( expectedHtml );
|
|
64
249
|
} );
|
|
65
250
|
} );
|
package/src/image/transforms.js
CHANGED
|
@@ -136,7 +136,11 @@ const transforms = {
|
|
|
136
136
|
// creating a new gallery.
|
|
137
137
|
type: 'files',
|
|
138
138
|
isMatch( files ) {
|
|
139
|
+
// The following check is intended to catch non-image files when dropped together with images.
|
|
139
140
|
if (
|
|
141
|
+
files.some(
|
|
142
|
+
( file ) => file.type.indexOf( 'image/' ) === 0
|
|
143
|
+
) &&
|
|
140
144
|
files.some(
|
|
141
145
|
( file ) => file.type.indexOf( 'image/' ) !== 0
|
|
142
146
|
)
|