@wordpress/block-library 7.4.0 → 7.7.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 +10 -0
- package/README.md +3 -2
- package/babel-plugin.js +154 -0
- package/build/audio/edit.js +4 -16
- package/build/audio/edit.js.map +1 -1
- package/build/block/edit.js +10 -9
- package/build/block/edit.js.map +1 -1
- package/build/button/deprecated.js +175 -35
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js +7 -3
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +1 -0
- 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/categories/edit.js +1 -1
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +1 -1
- package/build/columns/index.js +3 -1
- package/build/columns/index.js.map +1 -1
- package/build/comment-author-avatar/index.js +1 -0
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-template/edit.js +1 -3
- package/build/comment-template/edit.js.map +1 -1
- package/build/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
- package/{build-module/comments-query-loop → build/comments}/edit/comments-inspector-controls.js.map +1 -1
- package/build/{comments-query-loop → comments}/edit.js +3 -3
- package/build/comments/edit.js.map +1 -0
- package/build/{comments-query-loop → comments}/index.js +1 -1
- package/build/comments/index.js.map +1 -0
- package/build/{comments-query-loop → comments}/save.js +2 -2
- package/build/comments/save.js.map +1 -0
- package/build/comments-title/deprecated.js +110 -0
- package/build/comments-title/deprecated.js.map +1 -0
- package/build/comments-title/edit.js +35 -35
- package/build/comments-title/edit.js.map +1 -1
- package/build/comments-title/index.js +5 -8
- package/build/comments-title/index.js.map +1 -1
- package/build/cover/controls.native.js +2 -3
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/deprecated.js +212 -207
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +115 -0
- package/build/cover/edit/block-controls.js.map +1 -0
- package/build/cover/edit/cover-placeholder.js +49 -0
- package/build/cover/edit/cover-placeholder.js.map +1 -0
- package/build/cover/edit/index.js +343 -0
- package/build/cover/edit/index.js.map +1 -0
- package/build/cover/edit/inspector-controls.js +224 -0
- package/build/cover/edit/inspector-controls.js.map +1 -0
- package/build/cover/edit/resizable-cover.js +67 -0
- package/build/cover/edit/resizable-cover.js.map +1 -0
- package/build/cover/edit/use-cover-is-dark.js +81 -0
- package/build/cover/edit/use-cover-is-dark.js.map +1 -0
- package/build/cover/edit.native.js +36 -16
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/focal-point-settings-button.native.js.map +1 -1
- package/build/cover/save.js +18 -5
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +15 -9
- package/build/cover/shared.js.map +1 -1
- package/build/cover/transforms.js +77 -6
- package/build/cover/transforms.js.map +1 -1
- package/build/cover/use-cover-is-dark.native.js +60 -0
- package/build/cover/use-cover-is-dark.native.js.map +1 -0
- package/build/embed/embed-preview.js +1 -1
- package/build/embed/embed-preview.js.map +1 -1
- package/build/file/edit.js +1 -1
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js +0 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/save.js +9 -1
- package/build/file/save.js.map +1 -1
- package/build/gallery/edit.js +2 -1
- 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/gap-styles.js +14 -4
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/gallery/index.js +1 -1
- package/build/gallery/shared.js +2 -2
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/use-get-media.js +2 -1
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-short-code-transform.js +19 -18
- package/build/gallery/use-short-code-transform.js.map +1 -1
- package/build/gallery/v1/gallery.js +1 -1
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/heading/edit.js +6 -2
- package/build/heading/edit.js.map +1 -1
- package/build/heading/index.js +1 -0
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +9 -4
- package/build/heading/transforms.js.map +1 -1
- package/build/image/edit.js +5 -56
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +56 -4
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +4 -14
- package/build/image/image.js.map +1 -1
- package/build/index.js +48 -14
- package/build/index.js.map +1 -1
- package/build/is-block-metadata-experimental.js +18 -0
- package/build/is-block-metadata-experimental.js.map +1 -0
- package/build/latest-posts/edit.js +30 -4
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/edit.native.js +49 -0
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/list/transforms.js +6 -0
- package/build/list/transforms.js.map +1 -1
- package/build/list/v2/edit.js +2 -1
- package/build/list/v2/edit.js.map +1 -1
- package/build/list/v2/migrate.js +1 -0
- package/build/list/v2/migrate.js.map +1 -1
- package/build/list/v2/transforms.js +46 -9
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +7 -9
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +24 -0
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-backspace.js +59 -0
- package/build/list-item/hooks/use-backspace.js.map +1 -0
- package/build/list-item/hooks/use-enter.js +6 -9
- package/build/list-item/hooks/use-enter.js.map +1 -1
- package/build/list-item/hooks/use-indent-list-item.js +33 -39
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-space.js +54 -0
- package/build/list-item/hooks/use-space.js.map +1 -0
- package/build/list-item/hooks/use-split.js +44 -0
- package/build/list-item/hooks/use-split.js.map +1 -0
- package/build/list-item/index.js +1 -0
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/utils.js +1 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/edit.native.js +2 -1
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/media-container.native.js +2 -4
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/media-text/transforms.js +137 -8
- package/build/media-text/transforms.js.map +1 -1
- package/build/navigation/edit/index.js +91 -109
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +6 -12
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/index.js +0 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/use-navigation-entities.js +3 -3
- package/build/navigation/use-navigation-entities.js.map +1 -1
- package/build/navigation/view-modal.js +25 -0
- package/build/navigation/view-modal.js.map +1 -1
- package/build/navigation-link/edit.js +60 -35
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/fallback-variations.js +1 -1
- package/build/navigation-link/fallback-variations.js.map +1 -1
- package/build/navigation-link/hooks.js +1 -1
- package/build/navigation-link/hooks.js.map +1 -1
- package/build/navigation-submenu/edit.js +14 -14
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +1 -1
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +1 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/edit.js +10 -0
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/use-enter.js +94 -0
- package/build/paragraph/use-enter.js.map +1 -0
- package/build/post-author/edit.js +1 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author-name/index.js +4 -0
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-author-name/transforms.js +41 -0
- package/build/post-author-name/transforms.js.map +1 -0
- package/build/post-comment/index.js +2 -1
- package/build/post-comment/index.js.map +1 -1
- package/build/post-comments/edit.js +138 -35
- package/build/post-comments/edit.js.map +1 -1
- package/build/post-comments/index.js +3 -2
- package/build/post-comments/index.js.map +1 -1
- package/build/post-comments-count/index.js +1 -0
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/edit.js +38 -4
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +58 -0
- package/build/post-comments-form/form.js.map +1 -0
- package/build/post-comments-form/index.js +1 -0
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +1 -0
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +1 -1
- package/build/post-content/edit.js.map +1 -1
- package/build/post-date/edit.js +13 -7
- package/build/post-date/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +1 -1
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-template/edit.js +7 -2
- package/build/post-template/edit.js.map +1 -1
- package/build/post-terms/edit.js +35 -4
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/hooks.js +33 -0
- package/build/post-terms/hooks.js.map +1 -0
- package/build/post-terms/index.js +20 -5
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/index.js +1 -1
- package/build/post-title/index.js.map +1 -1
- package/build/pullquote/edit.js +1 -1
- package/build/pullquote/edit.js.map +1 -1
- package/build/pullquote/edit.native.js +1 -1
- package/build/pullquote/edit.native.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +26 -17
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +148 -0
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -0
- package/build/query/edit/inspector-controls/sticky-control.js +41 -0
- package/build/query/edit/inspector-controls/sticky-control.js.map +1 -0
- package/build/query/index.js +2 -1
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +28 -2
- package/build/query/utils.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-title/index.js +1 -1
- package/build/query-title/index.js.map +1 -1
- package/build/query-title/variations.js +1 -1
- package/build/query-title/variations.js.map +1 -1
- package/build/quote/edit.js +3 -2
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +1 -0
- package/build/quote/index.js.map +1 -1
- package/build/quote/v2/edit.js +1 -1
- package/build/quote/v2/edit.js.map +1 -1
- package/build/search/edit.js +2 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +4 -0
- package/build/search/index.js.map +1 -1
- package/build/separator/index.js +3 -0
- package/build/separator/index.js.map +1 -1
- package/build/shortcode/edit.native.js +16 -13
- package/build/shortcode/edit.native.js.map +1 -1
- package/build/site-logo/edit.js +1 -1
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-links/edit.js +2 -2
- package/build/social-links/edit.js.map +1 -1
- package/build/table/edit.js +15 -2
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +145 -65
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/index.js +13 -3
- package/build/table-of-contents/index.js.map +1 -1
- package/build/table-of-contents/list.js +16 -9
- package/build/table-of-contents/list.js.map +1 -1
- package/build/table-of-contents/save.js +40 -0
- package/build/table-of-contents/save.js.map +1 -0
- package/build/table-of-contents/utils.js +11 -77
- package/build/table-of-contents/utils.js.map +1 -1
- package/build/template-part/edit/index.js +7 -3
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +3 -8
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/video/edit.js +4 -8
- package/build/video/edit.js.map +1 -1
- package/build-module/audio/edit.js +5 -17
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/block/edit.js +11 -10
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/deprecated.js +175 -35
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +2 -2
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js +7 -3
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +1 -0
- 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/categories/edit.js +1 -1
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +1 -1
- package/build-module/columns/index.js +3 -1
- package/build-module/columns/index.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +1 -0
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-template/edit.js +1 -3
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -0
- package/build-module/{comments-query-loop → comments}/edit.js +2 -2
- package/build-module/comments/edit.js.map +1 -0
- package/build-module/{comments-query-loop → comments}/index.js +1 -1
- package/build-module/comments/index.js.map +1 -0
- package/build-module/{comments-query-loop → comments}/save.js +1 -1
- package/build-module/comments/save.js.map +1 -0
- package/build-module/comments-title/deprecated.js +102 -0
- package/build-module/comments-title/deprecated.js.map +1 -0
- package/build-module/comments-title/edit.js +38 -38
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/comments-title/index.js +4 -8
- package/build-module/comments-title/index.js.map +1 -1
- package/build-module/cover/controls.native.js +2 -3
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/deprecated.js +206 -198
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +104 -0
- package/build-module/cover/edit/block-controls.js.map +1 -0
- package/build-module/cover/edit/cover-placeholder.js +38 -0
- package/build-module/cover/edit/cover-placeholder.js.map +1 -0
- package/build-module/cover/edit/index.js +317 -0
- package/build-module/cover/edit/index.js.map +1 -0
- package/build-module/cover/edit/inspector-controls.js +215 -0
- package/build-module/cover/edit/inspector-controls.js.map +1 -0
- package/build-module/cover/edit/resizable-cover.js +55 -0
- package/build-module/cover/edit/resizable-cover.js.map +1 -0
- package/build-module/cover/edit/use-cover-is-dark.js +70 -0
- package/build-module/cover/edit/use-cover-is-dark.js.map +1 -0
- package/build-module/cover/edit.native.js +35 -17
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/focal-point-settings-button.native.js.map +1 -1
- package/build-module/cover/save.js +19 -6
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +11 -5
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/cover/transforms.js +74 -6
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/cover/use-cover-is-dark.native.js +51 -0
- package/build-module/cover/use-cover-is-dark.native.js.map +1 -0
- package/build-module/embed/embed-preview.js +2 -2
- package/build-module/embed/embed-preview.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/edit.native.js +0 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/save.js +7 -2
- package/build-module/file/save.js.map +1 -1
- package/build-module/gallery/edit.js +2 -1
- 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/gap-styles.js +14 -4
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/gallery/index.js +1 -1
- package/build-module/gallery/shared.js +2 -2
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/use-get-media.js +2 -1
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-short-code-transform.js +19 -18
- package/build-module/gallery/use-short-code-transform.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/group/index.js +1 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/heading/edit.js +6 -2
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/index.js +1 -0
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +9 -4
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/edit.js +4 -52
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +57 -6
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +6 -16
- package/build-module/image/image.js.map +1 -1
- package/build-module/index.js +43 -12
- package/build-module/index.js.map +1 -1
- package/build-module/is-block-metadata-experimental.js +16 -0
- package/build-module/is-block-metadata-experimental.js.map +1 -0
- package/build-module/latest-posts/edit.js +29 -5
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/edit.native.js +51 -2
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/list/transforms.js +6 -0
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/v2/edit.js +2 -1
- package/build-module/list/v2/edit.js.map +1 -1
- package/build-module/list/v2/migrate.js +1 -3
- package/build-module/list/v2/migrate.js.map +1 -1
- package/build-module/list/v2/transforms.js +46 -9
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +8 -9
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +3 -0
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-backspace.js +44 -0
- package/build-module/list-item/hooks/use-backspace.js.map +1 -0
- package/build-module/list-item/hooks/use-enter.js +6 -9
- package/build-module/list-item/hooks/use-enter.js.map +1 -1
- package/build-module/list-item/hooks/use-indent-list-item.js +33 -38
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-space.js +40 -0
- package/build-module/list-item/hooks/use-space.js.map +1 -0
- package/build-module/list-item/hooks/use-split.js +33 -0
- package/build-module/list-item/hooks/use-split.js.map +1 -0
- package/build-module/list-item/index.js +1 -0
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/utils.js +1 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/edit.native.js +2 -1
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/media-container.native.js +2 -4
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/transforms.js +137 -8
- package/build-module/media-text/transforms.js.map +1 -1
- package/build-module/navigation/edit/index.js +93 -110
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +7 -13
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/index.js +0 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/use-navigation-entities.js +1 -1
- package/build-module/navigation/use-navigation-entities.js.map +1 -1
- package/build-module/navigation/view-modal.js +24 -0
- package/build-module/navigation/view-modal.js.map +1 -1
- package/build-module/navigation-link/edit.js +60 -36
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/fallback-variations.js +1 -1
- package/build-module/navigation-link/fallback-variations.js.map +1 -1
- package/build-module/navigation-link/hooks.js +2 -2
- package/build-module/navigation-link/hooks.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +14 -14
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +1 -1
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +1 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +9 -0
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/use-enter.js +81 -0
- package/build-module/paragraph/use-enter.js.map +1 -0
- package/build-module/post-author/edit.js +1 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +3 -0
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-author-name/transforms.js +32 -0
- package/build-module/post-author-name/transforms.js.map +1 -0
- package/build-module/post-comment/index.js +2 -1
- package/build-module/post-comment/index.js.map +1 -1
- package/build-module/post-comments/edit.js +139 -37
- package/build-module/post-comments/edit.js.map +1 -1
- package/build-module/post-comments/index.js +3 -2
- package/build-module/post-comments/index.js.map +1 -1
- package/build-module/post-comments-count/index.js +1 -0
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/edit.js +38 -6
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +45 -0
- package/build-module/post-comments-form/form.js.map +1 -0
- package/build-module/post-comments-form/index.js +1 -0
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +1 -0
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js +1 -1
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-date/edit.js +15 -9
- package/build-module/post-date/edit.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-featured-image/edit.js +1 -1
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-template/edit.js +7 -2
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +35 -6
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/hooks.js +25 -0
- package/build-module/post-terms/hooks.js.map +1 -0
- package/build-module/post-terms/index.js +18 -8
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/index.js +1 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/pullquote/edit.js +2 -2
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/pullquote/edit.native.js +2 -2
- package/build-module/pullquote/edit.native.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +24 -17
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +135 -0
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -0
- package/build-module/query/edit/inspector-controls/sticky-control.js +31 -0
- package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -0
- package/build-module/query/index.js +2 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +21 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-no-results/edit.js +1 -1
- package/build-module/query-no-results/edit.js.map +1 -1
- package/build-module/query-title/index.js +1 -1
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/query-title/variations.js +2 -2
- package/build-module/query-title/variations.js.map +1 -1
- package/build-module/quote/edit.js +4 -3
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +1 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/v2/edit.js +2 -2
- package/build-module/quote/v2/edit.js.map +1 -1
- package/build-module/search/edit.js +3 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +4 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/separator/index.js +3 -0
- package/build-module/separator/index.js.map +1 -1
- package/build-module/shortcode/edit.native.js +17 -13
- package/build-module/shortcode/edit.native.js.map +1 -1
- package/build-module/site-logo/edit.js +1 -1
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-links/edit.js +2 -2
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table/edit.js +17 -4
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +144 -68
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +12 -3
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/table-of-contents/list.js +18 -10
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/table-of-contents/save.js +28 -0
- package/build-module/table-of-contents/save.js.map +1 -0
- package/build-module/table-of-contents/utils.js +11 -73
- package/build-module/table-of-contents/utils.js.map +1 -1
- package/build-module/template-part/edit/index.js +8 -4
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +4 -9
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/video/edit.js +5 -9
- package/build-module/video/edit.js.map +1 -1
- package/build-style/comment-content/style-rtl.css +81 -0
- package/build-style/comment-content/style.css +81 -0
- package/build-style/{comments-query-loop → comments}/editor-rtl.css +0 -0
- package/build-style/{comments-query-loop → comments}/editor.css +0 -0
- package/build-style/cover/style-rtl.css +32 -27
- package/build-style/cover/style.css +32 -27
- package/build-style/editor-rtl.css +16 -10
- package/build-style/editor.css +16 -10
- package/build-style/image/editor-rtl.css +1 -1
- package/build-style/image/editor.css +1 -1
- package/build-style/latest-posts/style-rtl.css +2 -0
- package/build-style/latest-posts/style.css +4 -0
- package/build-style/navigation/style-rtl.css +3 -0
- package/build-style/navigation/style.css +3 -0
- package/build-style/post-comments/editor-rtl.css +79 -0
- package/build-style/post-comments/editor.css +79 -0
- package/build-style/post-comments/style-rtl.css +27 -3
- package/build-style/post-comments/style.css +27 -3
- package/build-style/post-comments-form/editor-rtl.css +79 -0
- package/build-style/post-comments-form/editor.css +79 -0
- package/build-style/post-comments-form/style-rtl.css +1 -3
- package/build-style/post-comments-form/style.css +1 -3
- package/build-style/separator/editor-rtl.css +1 -0
- package/build-style/separator/editor.css +1 -0
- package/build-style/site-logo/style-rtl.css +4 -0
- package/build-style/site-logo/style.css +4 -0
- package/build-style/style-rtl.css +69 -33
- package/build-style/style.css +71 -33
- package/build-style/video/editor-rtl.css +2 -5
- package/build-style/video/editor.css +2 -5
- package/build-types/table-of-contents/list.d.ts +12 -0
- package/build-types/table-of-contents/list.d.ts.map +1 -0
- package/build-types/table-of-contents/utils.d.ts +24 -0
- package/build-types/table-of-contents/utils.d.ts.map +1 -0
- package/package.json +30 -29
- package/src/audio/edit.js +6 -9
- package/src/avatar/block.json +0 -1
- package/src/avatar/index.php +2 -2
- package/src/block/edit.js +39 -42
- package/src/block/test/edit.native.js +1 -1
- package/src/button/block.json +1 -0
- package/src/button/deprecated.js +145 -0
- package/src/button/edit.js +3 -1
- package/src/button/edit.native.js +6 -3
- package/src/button/save.js +3 -1
- package/src/buttons/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/buttons/test/edit.native.js +1 -1
- package/src/categories/block.json +1 -1
- package/src/categories/edit.js +1 -1
- package/src/columns/block.json +3 -1
- package/src/comment-author-avatar/block.json +1 -0
- package/src/comment-author-name/index.php +7 -5
- package/src/comment-content/index.php +25 -3
- package/src/comment-content/style.scss +5 -0
- package/src/comment-edit-link/index.php +1 -4
- package/src/comment-reply-link/index.php +1 -4
- package/src/comment-template/edit.js +1 -5
- package/src/comment-template/index.php +4 -0
- package/src/{comments-query-loop → comments}/block.json +1 -1
- package/src/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
- package/src/{comments-query-loop → comments}/edit.js +2 -1
- package/src/{comments-query-loop → comments}/editor.scss +0 -0
- package/src/{comments-query-loop → comments}/index.js +0 -0
- package/src/{comments-query-loop → comments}/save.js +1 -3
- package/src/comments-pagination/index.php +4 -0
- package/src/comments-title/block.json +0 -6
- package/src/comments-title/deprecated.js +34 -0
- package/src/comments-title/edit.js +44 -84
- package/src/comments-title/index.js +3 -1
- package/src/comments-title/index.php +51 -22
- package/src/cover/controls.native.js +1 -2
- package/src/cover/deprecated.js +230 -183
- package/src/cover/edit/block-controls.js +119 -0
- package/src/cover/edit/cover-placeholder.js +39 -0
- package/src/cover/edit/index.js +393 -0
- package/src/cover/edit/inspector-controls.js +286 -0
- package/src/cover/edit/resizable-cover.js +55 -0
- package/src/cover/edit/use-cover-is-dark.js +71 -0
- package/src/cover/edit.native.js +40 -14
- package/src/cover/editor.scss +1 -1
- package/src/cover/focal-point-settings-button.native.js +1 -1
- package/src/cover/index.php +20 -37
- package/src/cover/save.js +26 -13
- package/src/cover/shared.js +5 -3
- package/src/cover/style.native.scss +4 -0
- package/src/cover/style.scss +27 -26
- package/src/cover/test/__snapshots__/edit.native.js.snap +6 -6
- package/src/cover/test/block-controls.js +62 -0
- package/src/cover/test/transforms.js +301 -0
- package/src/cover/transforms.js +112 -7
- package/src/cover/use-cover-is-dark.native.js +51 -0
- package/src/editor.scss +3 -1
- package/src/embed/embed-preview.js +4 -2
- package/src/file/edit.js +5 -1
- package/src/file/edit.native.js +0 -1
- package/src/file/save.js +14 -2
- package/src/gallery/block.json +1 -1
- package/src/gallery/edit.js +2 -1
- package/src/gallery/gallery.js +2 -2
- package/src/gallery/gap-styles.js +21 -6
- package/src/gallery/index.php +23 -12
- package/src/gallery/shared.js +3 -2
- package/src/gallery/use-get-media.js +2 -1
- package/src/gallery/use-short-code-transform.js +19 -16
- package/src/gallery/v1/gallery.js +2 -2
- package/src/group/block.json +1 -0
- package/src/heading/block.json +1 -0
- package/src/heading/edit.js +5 -2
- package/src/heading/transforms.js +4 -3
- package/src/image/edit.js +0 -44
- package/src/image/edit.native.js +65 -4
- package/src/image/editor.scss +1 -1
- package/src/image/image.js +10 -13
- package/src/image/styles.native.scss +11 -0
- package/src/image/test/edit.native.js +7 -7
- package/src/index.js +53 -33
- package/src/is-block-metadata-experimental.js +19 -0
- package/src/latest-posts/edit.js +27 -2
- package/src/latest-posts/edit.native.js +56 -1
- package/src/latest-posts/index.php +12 -6
- package/src/latest-posts/style.scss +4 -0
- package/src/list/transforms.js +7 -0
- package/src/list/v2/edit.js +1 -0
- package/src/list/v2/migrate.js +1 -1
- package/src/list/v2/transforms.js +35 -0
- package/src/list-item/block.json +2 -1
- package/src/list-item/edit.js +17 -10
- package/src/list-item/hooks/index.js +3 -0
- package/src/list-item/hooks/use-backspace.js +52 -0
- package/src/list-item/hooks/use-enter.js +9 -16
- package/src/list-item/hooks/use-indent-list-item.js +50 -63
- package/src/list-item/hooks/use-space.js +48 -0
- package/src/list-item/hooks/use-split.js +33 -0
- package/src/list-item/utils.js +1 -1
- package/src/media-text/edit.native.js +3 -1
- package/src/media-text/media-container.native.js +2 -4
- package/src/media-text/transforms.js +154 -0
- package/src/navigation/block.json +0 -1
- package/src/navigation/edit/index.js +181 -205
- package/src/navigation/edit/inner-blocks.js +6 -15
- package/src/navigation/index.php +40 -0
- package/src/navigation/style.scss +3 -0
- package/src/navigation/use-navigation-entities.js +1 -1
- package/src/navigation/view-modal.js +32 -0
- package/src/navigation-link/edit.js +75 -48
- package/src/navigation-link/fallback-variations.js +1 -1
- package/src/navigation-link/hooks.js +2 -2
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +4 -4
- package/src/navigation-link/test/edit.js +0 -20
- package/src/navigation-submenu/edit.js +13 -17
- package/src/page-list/convert-to-links-modal.js +1 -1
- package/src/page-list/edit.js +1 -4
- package/src/paragraph/edit.js +6 -0
- package/src/paragraph/use-enter.js +103 -0
- package/src/post-author/edit.js +24 -22
- package/src/post-author/index.php +4 -3
- package/src/post-author-name/block.json +1 -0
- package/src/post-author-name/index.js +2 -0
- package/src/post-author-name/index.php +1 -1
- package/src/post-author-name/transforms.js +25 -0
- package/src/post-comment/block.json +2 -1
- package/src/post-comments/block.json +3 -2
- package/src/post-comments/edit.js +206 -44
- package/src/post-comments/editor.scss +3 -0
- package/src/post-comments/index.php +3 -1
- package/src/post-comments/style.scss +30 -5
- package/src/post-comments-count/block.json +1 -0
- package/src/post-comments-form/block.json +1 -0
- package/src/post-comments-form/edit.js +52 -23
- package/src/post-comments-form/editor.scss +3 -0
- package/src/post-comments-form/form.js +50 -0
- package/src/post-comments-form/index.php +10 -3
- package/src/post-comments-form/style.scss +1 -4
- package/src/post-comments-link/block.json +1 -0
- package/src/post-content/edit.js +15 -1
- package/src/post-date/edit.js +4 -3
- package/src/post-excerpt/edit.js +14 -1
- package/src/post-featured-image/edit.js +1 -1
- package/src/post-template/edit.js +5 -0
- package/src/post-template/index.php +30 -0
- package/src/post-terms/block.json +8 -0
- package/src/post-terms/edit.js +47 -1
- package/src/post-terms/hooks.js +27 -0
- package/src/post-terms/index.js +14 -7
- package/src/post-terms/index.php +50 -2
- package/src/post-title/index.js +1 -1
- package/src/pullquote/edit.js +2 -2
- package/src/pullquote/edit.native.js +2 -2
- package/src/query/block.json +2 -1
- package/src/query/edit/inspector-controls/index.js +25 -11
- package/src/query/edit/inspector-controls/parent-control.js +133 -0
- package/src/query/edit/inspector-controls/sticky-control.js +25 -0
- package/src/query/utils.js +22 -0
- package/src/query-no-results/edit.js +1 -1
- package/src/query-pagination/index.php +0 -1
- package/src/query-title/index.js +1 -1
- package/src/query-title/variations.js +2 -2
- package/src/quote/block.json +1 -0
- package/src/quote/edit.js +5 -2
- package/src/quote/v2/edit.js +4 -2
- package/src/search/block.json +4 -0
- package/src/search/edit.js +4 -1
- package/src/search/index.php +29 -16
- package/src/separator/block.json +3 -0
- package/src/separator/editor.scss +1 -0
- package/src/shortcode/edit.native.js +29 -15
- package/src/shortcode/style.native.scss +11 -4
- package/src/shortcode/test/__snapshots__/edit.native.js.snap +9 -0
- package/src/shortcode/test/edit.native.js +58 -40
- package/src/site-logo/edit.js +1 -1
- package/src/site-logo/style.scss +6 -0
- package/src/social-links/edit.js +11 -10
- package/src/table/edit.js +19 -4
- package/src/table-of-contents/block.json +9 -2
- package/src/table-of-contents/edit.js +170 -77
- package/src/table-of-contents/index.js +2 -0
- package/src/table-of-contents/list.tsx +46 -0
- package/src/table-of-contents/save.js +25 -0
- package/src/table-of-contents/utils.ts +71 -0
- package/src/tag-cloud/block.json +1 -1
- package/src/template-part/edit/index.js +25 -15
- package/src/template-part/edit/inner-blocks.js +2 -10
- package/src/video/edit.js +7 -6
- package/src/video/editor.scss +3 -6
- package/test/babel-plugin.js +67 -0
- package/tsconfig.json +11 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/build/comments-query-loop/edit/comments-inspector-controls.js.map +0 -1
- package/build/comments-query-loop/edit.js.map +0 -1
- package/build/comments-query-loop/index.js.map +0 -1
- package/build/comments-query-loop/save.js.map +0 -1
- package/build/cover/edit.js +0 -665
- package/build/cover/edit.js.map +0 -1
- package/build/navigation-area/edit.js +0 -110
- package/build/navigation-area/edit.js.map +0 -1
- package/build/navigation-area/index.js +0 -62
- package/build/navigation-area/index.js.map +0 -1
- package/build/navigation-area/inner-blocks.js +0 -34
- package/build/navigation-area/inner-blocks.js.map +0 -1
- package/build/navigation-area/save.js +0 -18
- package/build/navigation-area/save.js.map +0 -1
- package/build/post-terms/variations.js +0 -37
- package/build/post-terms/variations.js.map +0 -1
- package/build-module/comments-query-loop/edit.js.map +0 -1
- package/build-module/comments-query-loop/index.js.map +0 -1
- package/build-module/comments-query-loop/save.js.map +0 -1
- package/build-module/cover/edit.js +0 -642
- package/build-module/cover/edit.js.map +0 -1
- package/build-module/navigation-area/edit.js +0 -94
- package/build-module/navigation-area/edit.js.map +0 -1
- package/build-module/navigation-area/index.js +0 -48
- package/build-module/navigation-area/index.js.map +0 -1
- package/build-module/navigation-area/inner-blocks.js +0 -26
- package/build-module/navigation-area/inner-blocks.js.map +0 -1
- package/build-module/navigation-area/save.js +0 -10
- package/build-module/navigation-area/save.js.map +0 -1
- package/build-module/post-terms/variations.js +0 -27
- package/build-module/post-terms/variations.js.map +0 -1
- package/src/cover/edit.js +0 -822
- package/src/navigation-area/block.json +0 -23
- package/src/navigation-area/edit.js +0 -111
- package/src/navigation-area/index.js +0 -26
- package/src/navigation-area/index.php +0 -22
- package/src/navigation-area/inner-blocks.js +0 -24
- package/src/navigation-area/save.js +0 -8
- package/src/post-terms/variations.js +0 -28
- package/src/table-of-contents/index.php +0 -346
- package/src/table-of-contents/list.js +0 -28
- package/src/table-of-contents/utils.js +0 -126
package/src/cover/deprecated.js
CHANGED
|
@@ -24,12 +24,15 @@ import { __ } from '@wordpress/i18n';
|
|
|
24
24
|
import {
|
|
25
25
|
IMAGE_BACKGROUND_TYPE,
|
|
26
26
|
VIDEO_BACKGROUND_TYPE,
|
|
27
|
-
backgroundImageStyles,
|
|
28
27
|
getPositionClassName,
|
|
29
28
|
isContentPositionCenter,
|
|
30
29
|
dimRatioToClass,
|
|
31
30
|
} from './shared';
|
|
32
31
|
|
|
32
|
+
function backgroundImageStyles( url ) {
|
|
33
|
+
return url ? { backgroundImage: `url(${ url })` } : {};
|
|
34
|
+
}
|
|
35
|
+
|
|
33
36
|
/**
|
|
34
37
|
* Original function to determine the background opacity classname
|
|
35
38
|
*
|
|
@@ -81,91 +84,232 @@ const blockAttributes = {
|
|
|
81
84
|
},
|
|
82
85
|
};
|
|
83
86
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
url: {
|
|
88
|
-
type: 'string',
|
|
89
|
-
},
|
|
90
|
-
id: {
|
|
91
|
-
type: 'number',
|
|
92
|
-
},
|
|
93
|
-
alt: {
|
|
94
|
-
type: 'string',
|
|
95
|
-
source: 'attribute',
|
|
96
|
-
selector: 'img',
|
|
97
|
-
attribute: 'alt',
|
|
98
|
-
default: '',
|
|
99
|
-
},
|
|
100
|
-
hasParallax: {
|
|
101
|
-
type: 'boolean',
|
|
102
|
-
default: false,
|
|
103
|
-
},
|
|
104
|
-
isRepeated: {
|
|
105
|
-
type: 'boolean',
|
|
106
|
-
default: false,
|
|
107
|
-
},
|
|
108
|
-
dimRatio: {
|
|
109
|
-
type: 'number',
|
|
110
|
-
default: 100,
|
|
111
|
-
},
|
|
112
|
-
overlayColor: {
|
|
113
|
-
type: 'string',
|
|
114
|
-
},
|
|
115
|
-
customOverlayColor: {
|
|
116
|
-
type: 'string',
|
|
117
|
-
},
|
|
118
|
-
backgroundType: {
|
|
119
|
-
type: 'string',
|
|
120
|
-
default: 'image',
|
|
121
|
-
},
|
|
122
|
-
focalPoint: {
|
|
123
|
-
type: 'object',
|
|
124
|
-
},
|
|
125
|
-
minHeight: {
|
|
126
|
-
type: 'number',
|
|
127
|
-
},
|
|
128
|
-
minHeightUnit: {
|
|
129
|
-
type: 'string',
|
|
130
|
-
},
|
|
131
|
-
gradient: {
|
|
132
|
-
type: 'string',
|
|
133
|
-
},
|
|
134
|
-
customGradient: {
|
|
135
|
-
type: 'string',
|
|
136
|
-
},
|
|
137
|
-
contentPosition: {
|
|
138
|
-
type: 'string',
|
|
139
|
-
},
|
|
140
|
-
isDark: {
|
|
141
|
-
type: 'boolean',
|
|
142
|
-
default: true,
|
|
143
|
-
},
|
|
144
|
-
allowedBlocks: {
|
|
145
|
-
type: 'array',
|
|
146
|
-
},
|
|
147
|
-
templateLock: {
|
|
148
|
-
type: [ 'string', 'boolean' ],
|
|
149
|
-
enum: [ 'all', 'insert', false ],
|
|
150
|
-
},
|
|
87
|
+
const v8ToV10BlockAttributes = {
|
|
88
|
+
url: {
|
|
89
|
+
type: 'string',
|
|
151
90
|
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
91
|
+
id: {
|
|
92
|
+
type: 'number',
|
|
93
|
+
},
|
|
94
|
+
alt: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
source: 'attribute',
|
|
97
|
+
selector: 'img',
|
|
98
|
+
attribute: 'alt',
|
|
99
|
+
default: '',
|
|
100
|
+
},
|
|
101
|
+
hasParallax: {
|
|
102
|
+
type: 'boolean',
|
|
103
|
+
default: false,
|
|
104
|
+
},
|
|
105
|
+
isRepeated: {
|
|
106
|
+
type: 'boolean',
|
|
107
|
+
default: false,
|
|
108
|
+
},
|
|
109
|
+
dimRatio: {
|
|
110
|
+
type: 'number',
|
|
111
|
+
default: 100,
|
|
112
|
+
},
|
|
113
|
+
overlayColor: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
},
|
|
116
|
+
customOverlayColor: {
|
|
117
|
+
type: 'string',
|
|
118
|
+
},
|
|
119
|
+
backgroundType: {
|
|
120
|
+
type: 'string',
|
|
121
|
+
default: 'image',
|
|
122
|
+
},
|
|
123
|
+
focalPoint: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
},
|
|
126
|
+
minHeight: {
|
|
127
|
+
type: 'number',
|
|
128
|
+
},
|
|
129
|
+
minHeightUnit: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
},
|
|
132
|
+
gradient: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
},
|
|
135
|
+
customGradient: {
|
|
136
|
+
type: 'string',
|
|
137
|
+
},
|
|
138
|
+
contentPosition: {
|
|
139
|
+
type: 'string',
|
|
140
|
+
},
|
|
141
|
+
isDark: {
|
|
142
|
+
type: 'boolean',
|
|
143
|
+
default: true,
|
|
144
|
+
},
|
|
145
|
+
allowedBlocks: {
|
|
146
|
+
type: 'array',
|
|
147
|
+
},
|
|
148
|
+
templateLock: {
|
|
149
|
+
type: [ 'string', 'boolean' ],
|
|
150
|
+
enum: [ 'all', 'insert', false ],
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const v7toV10BlockSupports = {
|
|
155
|
+
anchor: true,
|
|
156
|
+
align: true,
|
|
157
|
+
html: false,
|
|
158
|
+
spacing: {
|
|
159
|
+
padding: true,
|
|
160
|
+
__experimentalDefaultControls: {
|
|
157
161
|
padding: true,
|
|
158
|
-
__experimentalDefaultControls: {
|
|
159
|
-
padding: true,
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
color: {
|
|
163
|
-
__experimentalDuotone:
|
|
164
|
-
'> .wp-block-cover__image-background, > .wp-block-cover__video-background',
|
|
165
|
-
text: false,
|
|
166
|
-
background: false,
|
|
167
162
|
},
|
|
168
163
|
},
|
|
164
|
+
color: {
|
|
165
|
+
__experimentalDuotone:
|
|
166
|
+
'> .wp-block-cover__image-background, > .wp-block-cover__video-background',
|
|
167
|
+
text: false,
|
|
168
|
+
background: false,
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// Deprecation for blocks that renders fixed background as backgroud from the main block container.
|
|
173
|
+
const v10 = {
|
|
174
|
+
attributes: v8ToV10BlockAttributes,
|
|
175
|
+
supports: v7toV10BlockSupports,
|
|
176
|
+
save( { attributes } ) {
|
|
177
|
+
const {
|
|
178
|
+
backgroundType,
|
|
179
|
+
gradient,
|
|
180
|
+
contentPosition,
|
|
181
|
+
customGradient,
|
|
182
|
+
customOverlayColor,
|
|
183
|
+
dimRatio,
|
|
184
|
+
focalPoint,
|
|
185
|
+
useFeaturedImage,
|
|
186
|
+
hasParallax,
|
|
187
|
+
isDark,
|
|
188
|
+
isRepeated,
|
|
189
|
+
overlayColor,
|
|
190
|
+
url,
|
|
191
|
+
alt,
|
|
192
|
+
id,
|
|
193
|
+
minHeight: minHeightProp,
|
|
194
|
+
minHeightUnit,
|
|
195
|
+
} = attributes;
|
|
196
|
+
const overlayColorClass = getColorClassName(
|
|
197
|
+
'background-color',
|
|
198
|
+
overlayColor
|
|
199
|
+
);
|
|
200
|
+
const gradientClass = __experimentalGetGradientClass( gradient );
|
|
201
|
+
const minHeight =
|
|
202
|
+
minHeightProp && minHeightUnit
|
|
203
|
+
? `${ minHeightProp }${ minHeightUnit }`
|
|
204
|
+
: minHeightProp;
|
|
205
|
+
|
|
206
|
+
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
|
|
207
|
+
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
|
|
208
|
+
|
|
209
|
+
const isImgElement = ! ( hasParallax || isRepeated );
|
|
210
|
+
|
|
211
|
+
const style = {
|
|
212
|
+
...( isImageBackground && ! isImgElement && ! useFeaturedImage
|
|
213
|
+
? backgroundImageStyles( url )
|
|
214
|
+
: {} ),
|
|
215
|
+
minHeight: minHeight || undefined,
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const bgStyle = {
|
|
219
|
+
backgroundColor: ! overlayColorClass
|
|
220
|
+
? customOverlayColor
|
|
221
|
+
: undefined,
|
|
222
|
+
background: customGradient ? customGradient : undefined,
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const objectPosition =
|
|
226
|
+
// prettier-ignore
|
|
227
|
+
focalPoint && isImgElement
|
|
228
|
+
? `${ Math.round( focalPoint.x * 100 ) }% ${ Math.round( focalPoint.y * 100 ) }%`
|
|
229
|
+
: undefined;
|
|
230
|
+
|
|
231
|
+
const classes = classnames(
|
|
232
|
+
{
|
|
233
|
+
'is-light': ! isDark,
|
|
234
|
+
'has-parallax': hasParallax,
|
|
235
|
+
'is-repeated': isRepeated,
|
|
236
|
+
'has-custom-content-position': ! isContentPositionCenter(
|
|
237
|
+
contentPosition
|
|
238
|
+
),
|
|
239
|
+
},
|
|
240
|
+
getPositionClassName( contentPosition )
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
const gradientValue = gradient || customGradient;
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
<div { ...useBlockProps.save( { className: classes, style } ) }>
|
|
247
|
+
<span
|
|
248
|
+
aria-hidden="true"
|
|
249
|
+
className={ classnames(
|
|
250
|
+
'wp-block-cover__background',
|
|
251
|
+
overlayColorClass,
|
|
252
|
+
dimRatioToClass( dimRatio ),
|
|
253
|
+
{
|
|
254
|
+
'has-background-dim': dimRatio !== undefined,
|
|
255
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
256
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
257
|
+
// media, a gradient and a dim.
|
|
258
|
+
'wp-block-cover__gradient-background':
|
|
259
|
+
url && gradientValue && dimRatio !== 0,
|
|
260
|
+
'has-background-gradient': gradientValue,
|
|
261
|
+
[ gradientClass ]: gradientClass,
|
|
262
|
+
}
|
|
263
|
+
) }
|
|
264
|
+
style={ bgStyle }
|
|
265
|
+
/>
|
|
266
|
+
|
|
267
|
+
{ ! useFeaturedImage &&
|
|
268
|
+
isImageBackground &&
|
|
269
|
+
isImgElement &&
|
|
270
|
+
url && (
|
|
271
|
+
<img
|
|
272
|
+
className={ classnames(
|
|
273
|
+
'wp-block-cover__image-background',
|
|
274
|
+
id ? `wp-image-${ id }` : null
|
|
275
|
+
) }
|
|
276
|
+
alt={ alt }
|
|
277
|
+
src={ url }
|
|
278
|
+
style={ { objectPosition } }
|
|
279
|
+
data-object-fit="cover"
|
|
280
|
+
data-object-position={ objectPosition }
|
|
281
|
+
/>
|
|
282
|
+
) }
|
|
283
|
+
{ isVideoBackground && url && (
|
|
284
|
+
<video
|
|
285
|
+
className={ classnames(
|
|
286
|
+
'wp-block-cover__video-background',
|
|
287
|
+
'intrinsic-ignore'
|
|
288
|
+
) }
|
|
289
|
+
autoPlay
|
|
290
|
+
muted
|
|
291
|
+
loop
|
|
292
|
+
playsInline
|
|
293
|
+
src={ url }
|
|
294
|
+
style={ { objectPosition } }
|
|
295
|
+
data-object-fit="cover"
|
|
296
|
+
data-object-position={ objectPosition }
|
|
297
|
+
/>
|
|
298
|
+
) }
|
|
299
|
+
<div
|
|
300
|
+
{ ...useInnerBlocksProps.save( {
|
|
301
|
+
className: 'wp-block-cover__inner-container',
|
|
302
|
+
} ) }
|
|
303
|
+
/>
|
|
304
|
+
</div>
|
|
305
|
+
);
|
|
306
|
+
},
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
// Deprecation for blocks with `minHeightUnit` set but no `minHeight`.
|
|
310
|
+
const v9 = {
|
|
311
|
+
attributes: v8ToV10BlockAttributes,
|
|
312
|
+
supports: v7toV10BlockSupports,
|
|
169
313
|
save( { attributes } ) {
|
|
170
314
|
const {
|
|
171
315
|
backgroundType,
|
|
@@ -296,89 +440,8 @@ const v9 = {
|
|
|
296
440
|
|
|
297
441
|
// v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`.
|
|
298
442
|
const v8 = {
|
|
299
|
-
attributes:
|
|
300
|
-
|
|
301
|
-
type: 'string',
|
|
302
|
-
},
|
|
303
|
-
id: {
|
|
304
|
-
type: 'number',
|
|
305
|
-
},
|
|
306
|
-
alt: {
|
|
307
|
-
type: 'string',
|
|
308
|
-
source: 'attribute',
|
|
309
|
-
selector: 'img',
|
|
310
|
-
attribute: 'alt',
|
|
311
|
-
default: '',
|
|
312
|
-
},
|
|
313
|
-
hasParallax: {
|
|
314
|
-
type: 'boolean',
|
|
315
|
-
default: false,
|
|
316
|
-
},
|
|
317
|
-
isRepeated: {
|
|
318
|
-
type: 'boolean',
|
|
319
|
-
default: false,
|
|
320
|
-
},
|
|
321
|
-
dimRatio: {
|
|
322
|
-
type: 'number',
|
|
323
|
-
default: 100,
|
|
324
|
-
},
|
|
325
|
-
overlayColor: {
|
|
326
|
-
type: 'string',
|
|
327
|
-
},
|
|
328
|
-
customOverlayColor: {
|
|
329
|
-
type: 'string',
|
|
330
|
-
},
|
|
331
|
-
backgroundType: {
|
|
332
|
-
type: 'string',
|
|
333
|
-
default: 'image',
|
|
334
|
-
},
|
|
335
|
-
focalPoint: {
|
|
336
|
-
type: 'object',
|
|
337
|
-
},
|
|
338
|
-
minHeight: {
|
|
339
|
-
type: 'number',
|
|
340
|
-
},
|
|
341
|
-
minHeightUnit: {
|
|
342
|
-
type: 'string',
|
|
343
|
-
},
|
|
344
|
-
gradient: {
|
|
345
|
-
type: 'string',
|
|
346
|
-
},
|
|
347
|
-
customGradient: {
|
|
348
|
-
type: 'string',
|
|
349
|
-
},
|
|
350
|
-
contentPosition: {
|
|
351
|
-
type: 'string',
|
|
352
|
-
},
|
|
353
|
-
isDark: {
|
|
354
|
-
type: 'boolean',
|
|
355
|
-
default: true,
|
|
356
|
-
},
|
|
357
|
-
allowedBlocks: {
|
|
358
|
-
type: 'array',
|
|
359
|
-
},
|
|
360
|
-
templateLock: {
|
|
361
|
-
type: [ 'string', 'boolean' ],
|
|
362
|
-
enum: [ 'all', 'insert', false ],
|
|
363
|
-
},
|
|
364
|
-
},
|
|
365
|
-
supports: {
|
|
366
|
-
anchor: true,
|
|
367
|
-
align: true,
|
|
368
|
-
html: false,
|
|
369
|
-
spacing: {
|
|
370
|
-
padding: true,
|
|
371
|
-
__experimentalDefaultControls: {
|
|
372
|
-
padding: true,
|
|
373
|
-
},
|
|
374
|
-
},
|
|
375
|
-
color: {
|
|
376
|
-
__experimentalDuotone:
|
|
377
|
-
'> .wp-block-cover__image-background, > .wp-block-cover__video-background',
|
|
378
|
-
text: false,
|
|
379
|
-
background: false,
|
|
380
|
-
},
|
|
381
|
-
},
|
|
443
|
+
attributes: v8ToV10BlockAttributes,
|
|
444
|
+
supports: v7toV10BlockSupports,
|
|
382
445
|
save( { attributes } ) {
|
|
383
446
|
const {
|
|
384
447
|
backgroundType,
|
|
@@ -532,23 +595,7 @@ const v7 = {
|
|
|
532
595
|
default: '',
|
|
533
596
|
},
|
|
534
597
|
},
|
|
535
|
-
supports:
|
|
536
|
-
anchor: true,
|
|
537
|
-
align: true,
|
|
538
|
-
html: false,
|
|
539
|
-
spacing: {
|
|
540
|
-
padding: true,
|
|
541
|
-
__experimentalDefaultControls: {
|
|
542
|
-
padding: true,
|
|
543
|
-
},
|
|
544
|
-
},
|
|
545
|
-
color: {
|
|
546
|
-
__experimentalDuotone:
|
|
547
|
-
'> .wp-block-cover__image-background, > .wp-block-cover__video-background',
|
|
548
|
-
text: false,
|
|
549
|
-
background: false,
|
|
550
|
-
},
|
|
551
|
-
},
|
|
598
|
+
supports: v7toV10BlockSupports,
|
|
552
599
|
save( { attributes } ) {
|
|
553
600
|
const {
|
|
554
601
|
backgroundType,
|
|
@@ -1231,4 +1278,4 @@ const v1 = {
|
|
|
1231
1278
|
},
|
|
1232
1279
|
};
|
|
1233
1280
|
|
|
1234
|
-
export default [ v9, v8, v7, v6, v5, v4, v3, v2, v1 ];
|
|
1281
|
+
export default [ v10, v9, v8, v7, v6, v5, v4, v3, v2, v1 ];
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useState } from '@wordpress/element';
|
|
5
|
+
import { ToolbarButton } from '@wordpress/components';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
BlockControls,
|
|
9
|
+
MediaReplaceFlow,
|
|
10
|
+
__experimentalBlockAlignmentMatrixControl as BlockAlignmentMatrixControl,
|
|
11
|
+
__experimentalBlockFullHeightAligmentControl as FullHeightAlignmentControl,
|
|
12
|
+
} from '@wordpress/block-editor';
|
|
13
|
+
import { __ } from '@wordpress/i18n';
|
|
14
|
+
import { postFeaturedImage } from '@wordpress/icons';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies
|
|
18
|
+
*/
|
|
19
|
+
import { ALLOWED_MEDIA_TYPES, IMAGE_BACKGROUND_TYPE } from '../shared';
|
|
20
|
+
|
|
21
|
+
export default function CoverBlockControls( {
|
|
22
|
+
attributes,
|
|
23
|
+
setAttributes,
|
|
24
|
+
onSelectMedia,
|
|
25
|
+
currentSettings,
|
|
26
|
+
} ) {
|
|
27
|
+
const {
|
|
28
|
+
contentPosition,
|
|
29
|
+
id,
|
|
30
|
+
useFeaturedImage,
|
|
31
|
+
dimRatio,
|
|
32
|
+
minHeight,
|
|
33
|
+
minHeightUnit,
|
|
34
|
+
} = attributes;
|
|
35
|
+
const { hasInnerBlocks, url } = currentSettings;
|
|
36
|
+
|
|
37
|
+
const [ prevMinHeightValue, setPrevMinHeightValue ] = useState( minHeight );
|
|
38
|
+
const [ prevMinHeightUnit, setPrevMinHeightUnit ] = useState(
|
|
39
|
+
minHeightUnit
|
|
40
|
+
);
|
|
41
|
+
const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100;
|
|
42
|
+
const toggleMinFullHeight = () => {
|
|
43
|
+
if ( isMinFullHeight ) {
|
|
44
|
+
// If there aren't previous values, take the default ones.
|
|
45
|
+
if ( prevMinHeightUnit === 'vh' && prevMinHeightValue === 100 ) {
|
|
46
|
+
return setAttributes( {
|
|
47
|
+
minHeight: undefined,
|
|
48
|
+
minHeightUnit: undefined,
|
|
49
|
+
} );
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Set the previous values of height.
|
|
53
|
+
return setAttributes( {
|
|
54
|
+
minHeight: prevMinHeightValue,
|
|
55
|
+
minHeightUnit: prevMinHeightUnit,
|
|
56
|
+
} );
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
setPrevMinHeightValue( minHeight );
|
|
60
|
+
setPrevMinHeightUnit( minHeightUnit );
|
|
61
|
+
|
|
62
|
+
// Set full height.
|
|
63
|
+
return setAttributes( {
|
|
64
|
+
minHeight: 100,
|
|
65
|
+
minHeightUnit: 'vh',
|
|
66
|
+
} );
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const toggleUseFeaturedImage = () => {
|
|
70
|
+
setAttributes( {
|
|
71
|
+
id: undefined,
|
|
72
|
+
url: undefined,
|
|
73
|
+
useFeaturedImage: ! useFeaturedImage,
|
|
74
|
+
dimRatio: dimRatio === 100 ? 50 : dimRatio,
|
|
75
|
+
backgroundType: useFeaturedImage
|
|
76
|
+
? IMAGE_BACKGROUND_TYPE
|
|
77
|
+
: undefined,
|
|
78
|
+
} );
|
|
79
|
+
};
|
|
80
|
+
return (
|
|
81
|
+
<>
|
|
82
|
+
<BlockControls group="block">
|
|
83
|
+
<BlockAlignmentMatrixControl
|
|
84
|
+
label={ __( 'Change content position' ) }
|
|
85
|
+
value={ contentPosition }
|
|
86
|
+
onChange={ ( nextPosition ) =>
|
|
87
|
+
setAttributes( {
|
|
88
|
+
contentPosition: nextPosition,
|
|
89
|
+
} )
|
|
90
|
+
}
|
|
91
|
+
isDisabled={ ! hasInnerBlocks }
|
|
92
|
+
/>
|
|
93
|
+
<FullHeightAlignmentControl
|
|
94
|
+
isActive={ isMinFullHeight }
|
|
95
|
+
onToggle={ toggleMinFullHeight }
|
|
96
|
+
isDisabled={ ! hasInnerBlocks }
|
|
97
|
+
/>
|
|
98
|
+
</BlockControls>
|
|
99
|
+
<BlockControls group="other">
|
|
100
|
+
<ToolbarButton
|
|
101
|
+
icon={ postFeaturedImage }
|
|
102
|
+
label={ __( 'Use featured image' ) }
|
|
103
|
+
isPressed={ useFeaturedImage }
|
|
104
|
+
onClick={ toggleUseFeaturedImage }
|
|
105
|
+
/>
|
|
106
|
+
{ ! useFeaturedImage && (
|
|
107
|
+
<MediaReplaceFlow
|
|
108
|
+
mediaId={ id }
|
|
109
|
+
mediaURL={ url }
|
|
110
|
+
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
111
|
+
accept="image/*,video/*"
|
|
112
|
+
onSelect={ onSelectMedia }
|
|
113
|
+
name={ ! url ? __( 'Add Media' ) : __( 'Replace' ) }
|
|
114
|
+
/>
|
|
115
|
+
) }
|
|
116
|
+
</BlockControls>
|
|
117
|
+
</>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { BlockIcon, MediaPlaceholder } from '@wordpress/block-editor';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { cover as icon } from '@wordpress/icons';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { ALLOWED_MEDIA_TYPES } from '../shared';
|
|
12
|
+
|
|
13
|
+
export default function CoverPlaceholder( {
|
|
14
|
+
disableMediaButtons = false,
|
|
15
|
+
children,
|
|
16
|
+
onSelectMedia,
|
|
17
|
+
onError,
|
|
18
|
+
style,
|
|
19
|
+
} ) {
|
|
20
|
+
return (
|
|
21
|
+
<MediaPlaceholder
|
|
22
|
+
icon={ <BlockIcon icon={ icon } /> }
|
|
23
|
+
labels={ {
|
|
24
|
+
title: __( 'Cover' ),
|
|
25
|
+
instructions: __(
|
|
26
|
+
'Drag and drop onto this block, upload, or select existing media from your library.'
|
|
27
|
+
),
|
|
28
|
+
} }
|
|
29
|
+
onSelect={ onSelectMedia }
|
|
30
|
+
accept="image/*,video/*"
|
|
31
|
+
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
32
|
+
disableMediaButtons={ disableMediaButtons }
|
|
33
|
+
onError={ onError }
|
|
34
|
+
style={ style }
|
|
35
|
+
>
|
|
36
|
+
{ children }
|
|
37
|
+
</MediaPlaceholder>
|
|
38
|
+
);
|
|
39
|
+
}
|