@wordpress/block-library 9.6.1 → 9.7.1-next.1f6eadc42.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 +2 -0
- package/build/archives/edit.js +1 -1
- package/build/archives/edit.js.map +1 -1
- package/build/audio/edit.js +2 -1
- package/build/audio/edit.js.map +1 -1
- package/build/block/edit.js +5 -8
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/buttons/index.js +1 -1
- package/build/categories/index.js +1 -0
- package/build/categories/index.js.map +1 -1
- package/build/comment-edit-link/index.js +13 -2
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +13 -2
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comments/edit/comments-legacy.js +1 -0
- package/build/comments/edit/comments-legacy.js.map +1 -1
- package/build/cover/deprecated.js +1 -1
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +4 -2
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/index.js +6 -3
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +4 -12
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/details/index.js +3 -1
- package/build/details/index.js.map +1 -1
- package/build/details/transforms.js +24 -0
- package/build/details/transforms.js.map +1 -0
- package/build/embed/edit.js +5 -11
- package/build/embed/edit.js.map +1 -1
- package/build/embed/embed-placeholder.js +2 -0
- package/build/embed/embed-placeholder.js.map +1 -1
- package/build/embed/embed-preview.js +16 -4
- package/build/embed/embed-preview.js.map +1 -1
- package/build/file/edit.js +12 -1
- package/build/file/edit.js.map +1 -1
- package/build/file/transforms.js +18 -4
- package/build/file/transforms.js.map +1 -1
- package/build/form-input/deprecated.js +113 -1
- package/build/form-input/deprecated.js.map +1 -1
- package/build/form-input/edit.js +16 -12
- package/build/form-input/edit.js.map +1 -1
- package/build/form-input/save.js +9 -1
- package/build/form-input/save.js.map +1 -1
- package/build/freeform/edit.js +4 -4
- package/build/freeform/edit.js.map +1 -1
- package/build/freeform/modal.js +3 -0
- package/build/freeform/modal.js.map +1 -1
- package/build/home-link/edit.js +3 -9
- package/build/home-link/edit.js.map +1 -1
- package/build/image/edit.js +95 -45
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +39 -24
- package/build/image/image.js.map +1 -1
- package/build/image/transforms.js +0 -13
- package/build/image/transforms.js.map +1 -1
- package/build/image/use-max-width-observer.js +35 -0
- package/build/image/use-max-width-observer.js.map +1 -0
- package/build/image/utils.js +11 -0
- package/build/image/utils.js.map +1 -1
- package/build/latest-posts/edit.js +1 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/media-text/deprecated.js +144 -3
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +5 -5
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/image-fill.js +12 -0
- package/build/media-text/image-fill.js.map +1 -0
- package/build/media-text/media-container.js +21 -18
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +0 -7
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/media-text/save.js +5 -6
- package/build/media-text/save.js.map +1 -1
- package/build/missing/edit.js +3 -2
- package/build/missing/edit.js.map +1 -1
- package/build/navigation/edit/deleted-navigation-warning.js +14 -7
- package/build/navigation/edit/deleted-navigation-warning.js.map +1 -1
- package/build/navigation/edit/index.js +1 -0
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +2 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +1 -0
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +1 -0
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +2 -0
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +4 -4
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation-link/link-ui.js +2 -1
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +2 -0
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +4 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/post-comments-form/form.js +1 -0
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +6 -8
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +2 -4
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-title/index.js +4 -1
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +3 -2
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +2 -10
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-content.js +9 -3
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/edit/query-placeholder.js +2 -0
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/site-logo/edit.js +9 -13
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-title/index.js +4 -1
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +4 -1
- package/build/social-link/edit.js.map +1 -1
- package/build/social-links/edit.js +10 -9
- package/build/social-links/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +1 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +10 -1
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/edit/placeholder.js +2 -0
- package/build/template-part/edit/placeholder.js.map +1 -1
- package/build/utils/hooks.js +10 -10
- package/build/utils/hooks.js.map +1 -1
- package/build/video/edit.js +16 -12
- package/build/video/edit.js.map +1 -1
- package/build/video/tracks-editor.js +3 -0
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/archives/edit.js +1 -1
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/audio/edit.js +2 -1
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/block/edit.js +6 -9
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +1 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/buttons/index.js +1 -1
- package/build-module/categories/index.js +1 -0
- package/build-module/categories/index.js.map +1 -1
- package/build-module/comment-edit-link/index.js +13 -2
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +13 -2
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comments/edit/comments-legacy.js +1 -0
- package/build-module/comments/edit/comments-legacy.js.map +1 -1
- package/build-module/cover/deprecated.js +1 -1
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +4 -2
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/index.js +6 -3
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +5 -13
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/details/index.js +3 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/details/transforms.js +18 -0
- package/build-module/details/transforms.js.map +1 -0
- package/build-module/embed/edit.js +6 -12
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/embed-placeholder.js +2 -0
- package/build-module/embed/embed-placeholder.js.map +1 -1
- package/build-module/embed/embed-preview.js +16 -4
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/file/edit.js +12 -1
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/transforms.js +18 -4
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/form-input/deprecated.js +114 -2
- package/build-module/form-input/deprecated.js.map +1 -1
- package/build-module/form-input/edit.js +16 -12
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/form-input/save.js +9 -1
- package/build-module/form-input/save.js.map +1 -1
- package/build-module/freeform/edit.js +4 -4
- package/build-module/freeform/edit.js.map +1 -1
- package/build-module/freeform/modal.js +3 -0
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/home-link/edit.js +3 -9
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/image/edit.js +99 -48
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +40 -25
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/transforms.js +0 -13
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/image/use-max-width-observer.js +29 -0
- package/build-module/image/use-max-width-observer.js.map +1 -0
- package/build-module/image/utils.js +11 -1
- package/build-module/image/utils.js.map +1 -1
- package/build-module/latest-posts/edit.js +1 -1
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/media-text/deprecated.js +144 -3
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +5 -5
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/image-fill.js +6 -0
- package/build-module/media-text/image-fill.js.map +1 -0
- package/build-module/media-text/media-container.js +21 -17
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +0 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/save.js +5 -6
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/missing/edit.js +3 -2
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/navigation/edit/deleted-navigation-warning.js +15 -8
- package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -1
- package/build-module/navigation/edit/index.js +1 -0
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +2 -1
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +1 -0
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +1 -0
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +2 -0
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +4 -4
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +4 -3
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +2 -0
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +4 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +1 -0
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +6 -8
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +3 -5
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-title/index.js +4 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +3 -2
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +3 -3
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +2 -10
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-content.js +10 -4
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +2 -0
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/site-logo/edit.js +10 -14
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-title/index.js +4 -1
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +4 -1
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-links/edit.js +11 -10
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +10 -1
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/template-part/edit/placeholder.js +2 -0
- package/build-module/template-part/edit/placeholder.js.map +1 -1
- package/build-module/utils/hooks.js +10 -10
- package/build-module/utils/hooks.js.map +1 -1
- package/build-module/video/edit.js +16 -13
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +3 -0
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/button/editor-rtl.css +0 -4
- package/build-style/button/editor.css +0 -4
- package/build-style/buttons/editor-rtl.css +2 -5
- package/build-style/buttons/editor.css +2 -5
- package/build-style/buttons/style-rtl.css +2 -2
- package/build-style/buttons/style.css +2 -2
- package/build-style/comment-edit-link/style-rtl.css +94 -0
- package/build-style/comment-edit-link/style.css +94 -0
- package/build-style/comment-reply-link/style-rtl.css +94 -0
- package/build-style/comment-reply-link/style.css +94 -0
- package/build-style/comments-pagination/editor-rtl.css +2 -2
- package/build-style/comments-pagination/editor.css +2 -2
- package/build-style/common-rtl.css +2 -2
- package/build-style/common.css +2 -2
- package/build-style/cover/editor-rtl.css +0 -6
- package/build-style/cover/editor.css +0 -6
- package/build-style/editor-rtl.css +35 -99
- package/build-style/editor.css +35 -101
- package/build-style/form-input/style-rtl.css +7 -8
- package/build-style/form-input/style.css +7 -8
- package/build-style/group/editor-rtl.css +0 -1
- package/build-style/group/editor.css +0 -1
- package/build-style/image/editor-rtl.css +6 -27
- package/build-style/image/editor.css +6 -27
- package/build-style/media-text/editor-rtl.css +3 -1
- package/build-style/media-text/editor.css +3 -1
- package/build-style/media-text/style-rtl.css +20 -0
- package/build-style/media-text/style.css +20 -0
- package/build-style/navigation/editor-rtl.css +1 -2
- package/build-style/navigation/editor.css +1 -2
- package/build-style/post-featured-image/style-rtl.css +1 -1
- package/build-style/post-featured-image/style.css +1 -1
- package/build-style/post-title/style-rtl.css +21 -0
- package/build-style/post-title/style.css +21 -0
- package/build-style/query-pagination/editor-rtl.css +2 -16
- package/build-style/query-pagination/editor.css +2 -18
- package/build-style/query-pagination/style-rtl.css +0 -11
- package/build-style/query-pagination/style.css +0 -13
- package/build-style/site-title/editor-rtl.css +0 -4
- package/build-style/site-title/editor.css +0 -4
- package/build-style/site-title/style-rtl.css +21 -0
- package/build-style/site-title/style.css +21 -0
- package/build-style/social-links/editor-rtl.css +17 -0
- package/build-style/social-links/editor.css +17 -0
- package/build-style/style-rtl.css +82 -24
- package/build-style/style.css +82 -26
- package/build-style/video/editor-rtl.css +0 -29
- package/build-style/video/editor.css +0 -29
- package/package.json +42 -35
- package/src/archives/edit.js +1 -1
- package/src/audio/edit.js +1 -0
- package/src/block/edit.js +9 -11
- package/src/button/edit.js +1 -1
- package/src/button/editor.scss +0 -5
- package/src/buttons/block.json +1 -1
- package/src/buttons/editor.scss +2 -8
- package/src/buttons/style.scss +2 -2
- package/src/categories/block.json +1 -0
- package/src/categories/index.php +13 -2
- package/src/comment-edit-link/block.json +13 -2
- package/src/comment-edit-link/style.scss +4 -0
- package/src/comment-reply-link/block.json +13 -2
- package/src/comment-reply-link/style.scss +4 -0
- package/src/comments/edit/comments-legacy.js +1 -0
- package/src/comments-pagination/editor.scss +1 -1
- package/src/cover/deprecated.js +3 -2
- package/src/cover/edit/block-controls.js +2 -0
- package/src/cover/edit/index.js +6 -1
- package/src/cover/edit/inspector-controls.js +3 -15
- package/src/cover/editor.scss +0 -5
- package/src/cover/test/edit.js +30 -26
- package/src/details/index.js +2 -0
- package/src/details/transforms.js +26 -0
- package/src/embed/edit.js +0 -7
- package/src/embed/embed-placeholder.js +10 -2
- package/src/embed/embed-preview.js +22 -2
- package/src/file/edit.js +11 -0
- package/src/file/index.php +1 -1
- package/src/file/transforms.js +26 -6
- package/src/form-input/deprecated.js +114 -1
- package/src/form-input/edit.js +17 -11
- package/src/form-input/save.js +13 -3
- package/src/form-input/style.scss +9 -8
- package/src/freeform/edit.js +4 -4
- package/src/freeform/editor.scss +1 -1
- package/src/freeform/modal.js +7 -1
- package/src/gallery/editor.scss +1 -1
- package/src/group/editor.scss +0 -1
- package/src/home-link/edit.js +4 -7
- package/src/image/edit.js +130 -47
- package/src/image/editor.scss +7 -41
- package/src/image/image.js +100 -67
- package/src/image/index.php +1 -1
- package/src/image/transforms.js +0 -23
- package/src/image/use-max-width-observer.js +32 -0
- package/src/image/utils.js +13 -1
- package/src/latest-posts/edit.js +1 -1
- package/src/media-text/deprecated.js +159 -3
- package/src/media-text/edit.js +5 -5
- package/src/media-text/editor.scss +3 -1
- package/src/media-text/image-fill.js +11 -0
- package/src/media-text/index.php +53 -43
- package/src/media-text/media-container.js +25 -25
- package/src/media-text/media-container.native.js +0 -2
- package/src/media-text/save.js +9 -13
- package/src/media-text/style.scss +21 -0
- package/src/media-text/test/image-fill.js +19 -0
- package/src/missing/edit.js +8 -3
- package/src/navigation/edit/deleted-navigation-warning.js +23 -13
- package/src/navigation/edit/index.js +1 -0
- package/src/navigation/edit/menu-inspector-controls.js +3 -1
- package/src/navigation/edit/navigation-menu-delete-control.js +1 -0
- package/src/navigation/edit/placeholder/index.js +1 -0
- package/src/navigation/edit/responsive-wrapper.js +2 -0
- package/src/navigation/edit/unsaved-inner-blocks.js +4 -4
- package/src/navigation/editor.scss +11 -4
- package/src/navigation/index.php +1 -1
- package/src/navigation-link/link-ui.js +4 -3
- package/src/page-list/convert-to-links-modal.js +6 -1
- package/src/page-list/edit.js +6 -1
- package/src/page-list/index.php +3 -1
- package/src/post-comments-form/form.js +1 -0
- package/src/post-featured-image/dimension-controls.js +4 -4
- package/src/post-featured-image/edit.js +3 -6
- package/src/post-featured-image/style.scss +1 -1
- package/src/post-title/block.json +4 -1
- package/src/post-title/style.scss +24 -0
- package/src/query/edit/enhanced-pagination-modal.js +7 -3
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -3
- package/src/query/edit/inspector-controls/index.js +2 -9
- package/src/query/edit/query-content.js +7 -0
- package/src/query/edit/query-placeholder.js +2 -0
- package/src/query/index.php +1 -1
- package/src/query-pagination/editor.scss +1 -21
- package/src/query-pagination/style.scss +0 -15
- package/src/search/index.php +1 -1
- package/src/site-logo/edit.js +11 -20
- package/src/site-title/block.json +4 -1
- package/src/site-title/editor.scss +0 -4
- package/src/site-title/style.scss +24 -0
- package/src/social-link/edit.js +2 -0
- package/src/social-links/edit.js +17 -10
- package/src/social-links/editor.scss +24 -5
- package/src/style.scss +2 -0
- package/src/tag-cloud/index.php +7 -2
- package/src/template-part/edit/advanced-controls.js +0 -1
- package/src/template-part/edit/index.js +12 -10
- package/src/template-part/edit/inner-blocks.js +20 -1
- package/src/template-part/edit/placeholder.js +6 -1
- package/src/utils/hooks.js +11 -11
- package/src/video/edit.js +24 -21
- package/src/video/editor.scss +0 -45
- package/src/video/tracks-editor.js +3 -0
- package/src/media-text/test/media-container.js +0 -24
package/src/buttons/editor.scss
CHANGED
|
@@ -33,14 +33,14 @@ $blocks-block__margin: 0.5em;
|
|
|
33
33
|
//
|
|
34
34
|
// This back compat rule is ignored if the user decides to use the
|
|
35
35
|
// newer justification options on the button block, hence the :not.
|
|
36
|
-
/* stylelint-disable indentation -- Disable the stylelint rule, otherwise this selector is ugly! */
|
|
36
|
+
/* stylelint-disable @stylistic/indentation -- Disable the stylelint rule, otherwise this selector is ugly! */
|
|
37
37
|
&:not(
|
|
38
38
|
.is-content-justification-space-between,
|
|
39
39
|
.is-content-justification-right,
|
|
40
40
|
.is-content-justification-left,
|
|
41
41
|
.is-content-justification-center
|
|
42
42
|
) .wp-block[data-align="center"] {
|
|
43
|
-
/* stylelint-enable indentation */
|
|
43
|
+
/* stylelint-enable @stylistic/indentation */
|
|
44
44
|
margin-left: auto;
|
|
45
45
|
margin-right: auto;
|
|
46
46
|
margin-top: 0;
|
|
@@ -52,12 +52,6 @@ $blocks-block__margin: 0.5em;
|
|
|
52
52
|
margin-bottom: 0;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
.editor-styles-wrapper &.has-custom-font-size {
|
|
57
|
-
.wp-block-button__link {
|
|
58
|
-
font-size: inherit;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
55
|
}
|
|
62
56
|
|
|
63
57
|
.wp-block[data-align="center"] > .wp-block-buttons {
|
package/src/buttons/style.scss
CHANGED
|
@@ -55,14 +55,14 @@ $blocks-block__margin: 0.5em;
|
|
|
55
55
|
//
|
|
56
56
|
// This back compat rule is ignored if the user decides to use the
|
|
57
57
|
// newer justification options on the button block, hence the :not.
|
|
58
|
-
/* stylelint-disable indentation -- Disable the stylelint rule, otherwise this selector is ugly! */
|
|
58
|
+
/* stylelint-disable @stylistic/indentation -- Disable the stylelint rule, otherwise this selector is ugly! */
|
|
59
59
|
&:not(
|
|
60
60
|
.is-content-justification-space-between,
|
|
61
61
|
.is-content-justification-right,
|
|
62
62
|
.is-content-justification-left,
|
|
63
63
|
.is-content-justification-center
|
|
64
64
|
) .wp-block-button.aligncenter {
|
|
65
|
-
/* stylelint-enable indentation */
|
|
65
|
+
/* stylelint-enable @stylistic/indentation */
|
|
66
66
|
margin-left: auto;
|
|
67
67
|
margin-right: auto;
|
|
68
68
|
width: 100%;
|
package/src/categories/index.php
CHANGED
|
@@ -9,12 +9,15 @@
|
|
|
9
9
|
* Renders the `core/categories` block on server.
|
|
10
10
|
*
|
|
11
11
|
* @since 5.0.0
|
|
12
|
+
* @since 6.7.0 Enable client-side rendering if enhancedPagination context is true.
|
|
12
13
|
*
|
|
13
|
-
* @param array
|
|
14
|
+
* @param array $attributes The block attributes.
|
|
15
|
+
* @param string $content Block default content.
|
|
16
|
+
* @param WP_Block $block Block instance.
|
|
14
17
|
*
|
|
15
18
|
* @return string Returns the categories list/dropdown markup.
|
|
16
19
|
*/
|
|
17
|
-
function render_block_core_categories( $attributes ) {
|
|
20
|
+
function render_block_core_categories( $attributes, $content, $block ) {
|
|
18
21
|
static $block_id = 0;
|
|
19
22
|
++$block_id;
|
|
20
23
|
|
|
@@ -54,6 +57,14 @@ function render_block_core_categories( $attributes ) {
|
|
|
54
57
|
$wrapper_markup = '<ul %1$s>%2$s</ul>';
|
|
55
58
|
$items_markup = wp_list_categories( $args );
|
|
56
59
|
$type = 'list';
|
|
60
|
+
|
|
61
|
+
if ( ! empty( $block->context['enhancedPagination'] ) ) {
|
|
62
|
+
$p = new WP_HTML_Tag_Processor( $items_markup );
|
|
63
|
+
while ( $p->next_tag( 'a' ) ) {
|
|
64
|
+
$p->set_attribute( 'data-wp-on--click', 'core/query::actions.navigate' );
|
|
65
|
+
}
|
|
66
|
+
$items_markup = $p->get_updated_html();
|
|
67
|
+
}
|
|
57
68
|
}
|
|
58
69
|
|
|
59
70
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => "wp-block-categories-{$type}" ) );
|
|
@@ -30,7 +30,11 @@
|
|
|
30
30
|
},
|
|
31
31
|
"spacing": {
|
|
32
32
|
"margin": true,
|
|
33
|
-
"padding": true
|
|
33
|
+
"padding": true,
|
|
34
|
+
"__experimentalDefaultControls": {
|
|
35
|
+
"margin": false,
|
|
36
|
+
"padding": false
|
|
37
|
+
}
|
|
34
38
|
},
|
|
35
39
|
"typography": {
|
|
36
40
|
"fontSize": true,
|
|
@@ -47,6 +51,13 @@
|
|
|
47
51
|
},
|
|
48
52
|
"interactivity": {
|
|
49
53
|
"clientNavigation": true
|
|
54
|
+
},
|
|
55
|
+
"__experimentalBorder": {
|
|
56
|
+
"radius": true,
|
|
57
|
+
"color": true,
|
|
58
|
+
"width": true,
|
|
59
|
+
"style": true
|
|
50
60
|
}
|
|
51
|
-
}
|
|
61
|
+
},
|
|
62
|
+
"style": "wp-block-comment-edit-link"
|
|
52
63
|
}
|
|
@@ -25,7 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"spacing": {
|
|
27
27
|
"margin": true,
|
|
28
|
-
"padding": true
|
|
28
|
+
"padding": true,
|
|
29
|
+
"__experimentalDefaultControls": {
|
|
30
|
+
"margin": false,
|
|
31
|
+
"padding": false
|
|
32
|
+
}
|
|
29
33
|
},
|
|
30
34
|
"typography": {
|
|
31
35
|
"fontSize": true,
|
|
@@ -40,6 +44,13 @@
|
|
|
40
44
|
"fontSize": true
|
|
41
45
|
}
|
|
42
46
|
},
|
|
47
|
+
"__experimentalBorder": {
|
|
48
|
+
"radius": true,
|
|
49
|
+
"color": true,
|
|
50
|
+
"width": true,
|
|
51
|
+
"style": true
|
|
52
|
+
},
|
|
43
53
|
"html": false
|
|
44
|
-
}
|
|
54
|
+
},
|
|
55
|
+
"style": "wp-block-comment-reply-link"
|
|
45
56
|
}
|
package/src/cover/deprecated.js
CHANGED
|
@@ -400,8 +400,9 @@ const v12 = {
|
|
|
400
400
|
supports: v12BlockSupports,
|
|
401
401
|
isEligible( attributes ) {
|
|
402
402
|
return (
|
|
403
|
-
attributes.customOverlayColor !== undefined ||
|
|
404
|
-
|
|
403
|
+
( attributes.customOverlayColor !== undefined ||
|
|
404
|
+
attributes.overlayColor !== undefined ) &&
|
|
405
|
+
attributes.isUserOverlayColor === undefined
|
|
405
406
|
);
|
|
406
407
|
},
|
|
407
408
|
migrate( attributes ) {
|
|
@@ -26,6 +26,7 @@ export default function CoverBlockControls( {
|
|
|
26
26
|
onSelectMedia,
|
|
27
27
|
currentSettings,
|
|
28
28
|
toggleUseFeaturedImage,
|
|
29
|
+
onClearMedia,
|
|
29
30
|
} ) {
|
|
30
31
|
const { contentPosition, id, useFeaturedImage, minHeight, minHeightUnit } =
|
|
31
32
|
attributes;
|
|
@@ -101,6 +102,7 @@ export default function CoverBlockControls( {
|
|
|
101
102
|
onToggleFeaturedImage={ toggleUseFeaturedImage }
|
|
102
103
|
useFeaturedImage={ useFeaturedImage }
|
|
103
104
|
name={ ! url ? __( 'Add Media' ) : __( 'Replace' ) }
|
|
105
|
+
onReset={ onClearMedia }
|
|
104
106
|
/>
|
|
105
107
|
</BlockControls>
|
|
106
108
|
</>
|
package/src/cover/edit/index.js
CHANGED
|
@@ -143,7 +143,10 @@ function CoverEdit( {
|
|
|
143
143
|
averageBackgroundColor
|
|
144
144
|
);
|
|
145
145
|
__unstableMarkNextChangeAsNotPersistent();
|
|
146
|
-
setAttributes( {
|
|
146
|
+
setAttributes( {
|
|
147
|
+
isDark: newIsDark,
|
|
148
|
+
isUserOverlayColor: isUserOverlayColor || false,
|
|
149
|
+
} );
|
|
147
150
|
} )();
|
|
148
151
|
// Disable reason: Update the block only when the featured image changes.
|
|
149
152
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -201,6 +204,7 @@ function CoverEdit( {
|
|
|
201
204
|
useFeaturedImage: undefined,
|
|
202
205
|
dimRatio: newDimRatio,
|
|
203
206
|
isDark: newIsDark,
|
|
207
|
+
isUserOverlayColor: isUserOverlayColor || false,
|
|
204
208
|
} );
|
|
205
209
|
};
|
|
206
210
|
|
|
@@ -398,6 +402,7 @@ function CoverEdit( {
|
|
|
398
402
|
onSelectMedia={ onSelectMedia }
|
|
399
403
|
currentSettings={ currentSettings }
|
|
400
404
|
toggleUseFeaturedImage={ toggleUseFeaturedImage }
|
|
405
|
+
onClearMedia={ onClearMedia }
|
|
401
406
|
/>
|
|
402
407
|
);
|
|
403
408
|
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useMemo } from '@wordpress/element';
|
|
5
5
|
import {
|
|
6
|
-
Button,
|
|
7
6
|
ExternalLink,
|
|
8
7
|
FocalPointPicker,
|
|
9
8
|
PanelBody,
|
|
10
|
-
PanelRow,
|
|
11
9
|
RangeControl,
|
|
12
10
|
TextareaControl,
|
|
13
11
|
ToggleControl,
|
|
@@ -73,13 +71,13 @@ function CoverHeightInput( {
|
|
|
73
71
|
|
|
74
72
|
return (
|
|
75
73
|
<UnitControl
|
|
76
|
-
|
|
74
|
+
__next40pxDefaultSize
|
|
75
|
+
label={ __( 'Minimum height' ) }
|
|
77
76
|
id={ inputId }
|
|
78
77
|
isResetValueOnUnitChange
|
|
79
78
|
min={ min }
|
|
80
79
|
onChange={ handleOnChange }
|
|
81
80
|
onUnitChange={ onUnitChange }
|
|
82
|
-
__unstableInputWidth="80px"
|
|
83
81
|
units={ units }
|
|
84
82
|
value={ computedValue }
|
|
85
83
|
/>
|
|
@@ -93,7 +91,6 @@ export default function CoverInspectorControls( {
|
|
|
93
91
|
coverRef,
|
|
94
92
|
currentSettings,
|
|
95
93
|
updateDimRatio,
|
|
96
|
-
onClearMedia,
|
|
97
94
|
} ) {
|
|
98
95
|
const {
|
|
99
96
|
useFeaturedImage,
|
|
@@ -228,16 +225,6 @@ export default function CoverInspectorControls( {
|
|
|
228
225
|
}
|
|
229
226
|
/>
|
|
230
227
|
) }
|
|
231
|
-
<PanelRow>
|
|
232
|
-
<Button
|
|
233
|
-
variant="secondary"
|
|
234
|
-
size="small"
|
|
235
|
-
className="block-library-cover__reset-button"
|
|
236
|
-
onClick={ onClearMedia }
|
|
237
|
-
>
|
|
238
|
-
{ __( 'Clear Media' ) }
|
|
239
|
-
</Button>
|
|
240
|
-
</PanelRow>
|
|
241
228
|
</PanelBody>
|
|
242
229
|
) }
|
|
243
230
|
</InspectorControls>
|
|
@@ -299,6 +286,7 @@ export default function CoverInspectorControls( {
|
|
|
299
286
|
) }
|
|
300
287
|
<InspectorControls group="dimensions">
|
|
301
288
|
<ToolsPanelItem
|
|
289
|
+
className="single-column"
|
|
302
290
|
hasValue={ () => !! minHeight }
|
|
303
291
|
label={ __( 'Minimum height' ) }
|
|
304
292
|
onDeselect={ () =>
|
package/src/cover/editor.scss
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
.wp-block-cover {
|
|
2
|
-
/* Extra specificity needed because the reset.css applied in the editor context is overriding this rule. */
|
|
3
|
-
.editor-styles-wrapper & {
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
2
|
// Override default cover styles
|
|
8
3
|
// because we're not ready yet to show the cover block.
|
|
9
4
|
&.is-placeholder {
|
package/src/cover/test/edit.js
CHANGED
|
@@ -155,6 +155,34 @@ describe( 'Cover block', () => {
|
|
|
155
155
|
'is-position-top-left'
|
|
156
156
|
);
|
|
157
157
|
} );
|
|
158
|
+
|
|
159
|
+
test( 'clears media when clear media button clicked', async () => {
|
|
160
|
+
await setup( {
|
|
161
|
+
url: 'http://localhost/my-image.jpg',
|
|
162
|
+
} );
|
|
163
|
+
|
|
164
|
+
await selectBlock( 'Block: Cover' );
|
|
165
|
+
expect(
|
|
166
|
+
within( screen.getByLabelText( 'Block: Cover' ) ).getByRole(
|
|
167
|
+
'img'
|
|
168
|
+
)
|
|
169
|
+
).toBeInTheDocument();
|
|
170
|
+
|
|
171
|
+
await userEvent.click(
|
|
172
|
+
screen.getByRole( 'button', { name: 'Replace' } )
|
|
173
|
+
);
|
|
174
|
+
await userEvent.click(
|
|
175
|
+
screen.getByRole( 'menuitem', {
|
|
176
|
+
name: 'Reset',
|
|
177
|
+
} )
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
expect(
|
|
181
|
+
within( screen.getByLabelText( 'Block: Cover' ) ).queryByRole(
|
|
182
|
+
'img'
|
|
183
|
+
)
|
|
184
|
+
).not.toBeInTheDocument();
|
|
185
|
+
} );
|
|
158
186
|
} );
|
|
159
187
|
|
|
160
188
|
describe( 'Inspector controls', () => {
|
|
@@ -242,30 +270,6 @@ describe( 'Cover block', () => {
|
|
|
242
270
|
expect( screen.getByAltText( 'Me' ) ).toBeInTheDocument();
|
|
243
271
|
} );
|
|
244
272
|
|
|
245
|
-
test( 'clears media when clear media button clicked', async () => {
|
|
246
|
-
await setup( {
|
|
247
|
-
url: 'http://localhost/my-image.jpg',
|
|
248
|
-
} );
|
|
249
|
-
|
|
250
|
-
await selectBlock( 'Block: Cover' );
|
|
251
|
-
expect(
|
|
252
|
-
within( screen.getByLabelText( 'Block: Cover' ) ).getByRole(
|
|
253
|
-
'img'
|
|
254
|
-
)
|
|
255
|
-
).toBeInTheDocument();
|
|
256
|
-
|
|
257
|
-
await userEvent.click(
|
|
258
|
-
screen.getByRole( 'button', {
|
|
259
|
-
name: 'Clear Media',
|
|
260
|
-
} )
|
|
261
|
-
);
|
|
262
|
-
expect(
|
|
263
|
-
within( screen.getByLabelText( 'Block: Cover' ) ).queryByRole(
|
|
264
|
-
'img'
|
|
265
|
-
)
|
|
266
|
-
).not.toBeInTheDocument();
|
|
267
|
-
} );
|
|
268
|
-
|
|
269
273
|
describe( 'Color panel', () => {
|
|
270
274
|
test( 'applies selected opacity to block when number control value changed', async () => {
|
|
271
275
|
const { container } = await setup();
|
|
@@ -372,10 +376,10 @@ describe( 'Cover block', () => {
|
|
|
372
376
|
} )
|
|
373
377
|
);
|
|
374
378
|
await userEvent.clear(
|
|
375
|
-
screen.getByLabelText( 'Minimum height
|
|
379
|
+
screen.getByLabelText( 'Minimum height' )
|
|
376
380
|
);
|
|
377
381
|
await userEvent.type(
|
|
378
|
-
screen.getByLabelText( 'Minimum height
|
|
382
|
+
screen.getByLabelText( 'Minimum height' ),
|
|
379
383
|
'300'
|
|
380
384
|
);
|
|
381
385
|
|
package/src/details/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import initBlock from '../utils/init-block';
|
|
|
11
11
|
import metadata from './block.json';
|
|
12
12
|
import edit from './edit';
|
|
13
13
|
import save from './save';
|
|
14
|
+
import transforms from './transforms';
|
|
14
15
|
|
|
15
16
|
const { name } = metadata;
|
|
16
17
|
export { metadata, name };
|
|
@@ -35,6 +36,7 @@ export const settings = {
|
|
|
35
36
|
},
|
|
36
37
|
save,
|
|
37
38
|
edit,
|
|
39
|
+
transforms,
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
export const init = () => initBlock( { name, metadata, settings } );
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { createBlock, cloneBlock } from '@wordpress/blocks';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
from: [
|
|
8
|
+
{
|
|
9
|
+
type: 'block',
|
|
10
|
+
isMultiBlock: true,
|
|
11
|
+
blocks: [ '*' ],
|
|
12
|
+
isMatch( {}, blocks ) {
|
|
13
|
+
return ! (
|
|
14
|
+
blocks.length === 1 && blocks[ 0 ].name === 'core/details'
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
__experimentalConvert( blocks ) {
|
|
18
|
+
return createBlock(
|
|
19
|
+
'core/details',
|
|
20
|
+
{},
|
|
21
|
+
blocks.map( ( block ) => cloneBlock( block ) )
|
|
22
|
+
);
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
package/src/embed/edit.js
CHANGED
|
@@ -14,7 +14,6 @@ import { embedContentIcon } from './icons';
|
|
|
14
14
|
import EmbedLoading from './embed-loading';
|
|
15
15
|
import EmbedPlaceholder from './embed-placeholder';
|
|
16
16
|
import EmbedPreview from './embed-preview';
|
|
17
|
-
import { Caption } from '../utils/caption';
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* External dependencies
|
|
@@ -277,14 +276,8 @@ const EmbedEdit = ( props ) => {
|
|
|
277
276
|
icon={ icon }
|
|
278
277
|
label={ label }
|
|
279
278
|
insertBlocksAfter={ insertBlocksAfter }
|
|
280
|
-
/>
|
|
281
|
-
<Caption
|
|
282
279
|
attributes={ attributes }
|
|
283
280
|
setAttributes={ setAttributes }
|
|
284
|
-
isSelected={ isSelected }
|
|
285
|
-
insertBlocksAfter={ insertBlocksAfter }
|
|
286
|
-
label={ __( 'Embed caption text' ) }
|
|
287
|
-
showToolbarButton={ isSelected }
|
|
288
281
|
/>
|
|
289
282
|
</View>
|
|
290
283
|
</>
|
|
@@ -65,10 +65,18 @@ const EmbedPlaceholder = ( {
|
|
|
65
65
|
spacing={ 3 }
|
|
66
66
|
justify="flex-start"
|
|
67
67
|
>
|
|
68
|
-
<Button
|
|
68
|
+
<Button
|
|
69
|
+
__next40pxDefaultSize
|
|
70
|
+
variant="secondary"
|
|
71
|
+
onClick={ tryAgain }
|
|
72
|
+
>
|
|
69
73
|
{ _x( 'Try again', 'button label' ) }
|
|
70
74
|
</Button>{ ' ' }
|
|
71
|
-
<Button
|
|
75
|
+
<Button
|
|
76
|
+
__next40pxDefaultSize
|
|
77
|
+
variant="secondary"
|
|
78
|
+
onClick={ fallback }
|
|
79
|
+
>
|
|
72
80
|
{ _x( 'Convert to link', 'button label' ) }
|
|
73
81
|
</Button>
|
|
74
82
|
</HStack>
|
|
@@ -21,6 +21,7 @@ import { getAuthority } from '@wordpress/url';
|
|
|
21
21
|
* Internal dependencies
|
|
22
22
|
*/
|
|
23
23
|
import WpEmbedPreview from './wp-embed-preview';
|
|
24
|
+
import { Caption } from '../utils/caption';
|
|
24
25
|
|
|
25
26
|
class EmbedPreview extends Component {
|
|
26
27
|
constructor() {
|
|
@@ -52,8 +53,19 @@ class EmbedPreview extends Component {
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
render() {
|
|
55
|
-
const {
|
|
56
|
-
|
|
56
|
+
const {
|
|
57
|
+
preview,
|
|
58
|
+
previewable,
|
|
59
|
+
url,
|
|
60
|
+
type,
|
|
61
|
+
className,
|
|
62
|
+
icon,
|
|
63
|
+
label,
|
|
64
|
+
insertBlocksAfter,
|
|
65
|
+
attributes,
|
|
66
|
+
setAttributes,
|
|
67
|
+
isSelected,
|
|
68
|
+
} = this.props;
|
|
57
69
|
const { scripts } = preview;
|
|
58
70
|
const { interactive } = this.state;
|
|
59
71
|
|
|
@@ -123,6 +135,14 @@ class EmbedPreview extends Component {
|
|
|
123
135
|
</p>
|
|
124
136
|
</Placeholder>
|
|
125
137
|
) }
|
|
138
|
+
<Caption
|
|
139
|
+
attributes={ attributes }
|
|
140
|
+
setAttributes={ setAttributes }
|
|
141
|
+
isSelected={ isSelected }
|
|
142
|
+
insertBlocksAfter={ insertBlocksAfter }
|
|
143
|
+
label={ __( 'Embed caption text' ) }
|
|
144
|
+
showToolbarButton={ isSelected }
|
|
145
|
+
/>
|
|
126
146
|
</figure>
|
|
127
147
|
);
|
|
128
148
|
}
|
package/src/file/edit.js
CHANGED
|
@@ -109,6 +109,16 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
109
109
|
|
|
110
110
|
function onSelectFile( newMedia ) {
|
|
111
111
|
if ( ! newMedia || ! newMedia.url ) {
|
|
112
|
+
// Reset attributes.
|
|
113
|
+
setAttributes( {
|
|
114
|
+
href: undefined,
|
|
115
|
+
fileName: undefined,
|
|
116
|
+
textLinkHref: undefined,
|
|
117
|
+
id: undefined,
|
|
118
|
+
fileId: undefined,
|
|
119
|
+
displayPreview: undefined,
|
|
120
|
+
previewHeight: undefined,
|
|
121
|
+
} );
|
|
112
122
|
setTemporaryURL();
|
|
113
123
|
return;
|
|
114
124
|
}
|
|
@@ -230,6 +240,7 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
230
240
|
accept="*"
|
|
231
241
|
onSelect={ onSelectFile }
|
|
232
242
|
onError={ onUploadError }
|
|
243
|
+
onReset={ () => onSelectFile( undefined ) }
|
|
233
244
|
/>
|
|
234
245
|
<ClipboardToolbarButton
|
|
235
246
|
text={ href }
|
package/src/file/index.php
CHANGED
|
@@ -21,7 +21,7 @@ function render_block_core_file( $attributes, $content ) {
|
|
|
21
21
|
if ( ! empty( $attributes['displayPreview'] ) ) {
|
|
22
22
|
$suffix = wp_scripts_get_suffix();
|
|
23
23
|
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
|
24
|
-
$module_url = gutenberg_url( '/build/
|
|
24
|
+
$module_url = gutenberg_url( '/build-module/block-library/file/view.min.js' );
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
wp_register_script_module(
|
package/src/file/transforms.js
CHANGED
|
@@ -24,12 +24,32 @@ const transforms = {
|
|
|
24
24
|
const blobURL = createBlobURL( file );
|
|
25
25
|
|
|
26
26
|
// File will be uploaded in componentDidMount()
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
if ( file.type.startsWith( 'video/' ) ) {
|
|
28
|
+
blocks.push(
|
|
29
|
+
createBlock( 'core/video', {
|
|
30
|
+
blob: createBlobURL( file ),
|
|
31
|
+
} )
|
|
32
|
+
);
|
|
33
|
+
} else if ( file.type.startsWith( 'image/' ) ) {
|
|
34
|
+
blocks.push(
|
|
35
|
+
createBlock( 'core/image', {
|
|
36
|
+
blob: createBlobURL( file ),
|
|
37
|
+
} )
|
|
38
|
+
);
|
|
39
|
+
} else if ( file.type.startsWith( 'audio/' ) ) {
|
|
40
|
+
blocks.push(
|
|
41
|
+
createBlock( 'core/audio', {
|
|
42
|
+
blob: createBlobURL( file ),
|
|
43
|
+
} )
|
|
44
|
+
);
|
|
45
|
+
} else {
|
|
46
|
+
blocks.push(
|
|
47
|
+
createBlock( 'core/file', {
|
|
48
|
+
blob: blobURL,
|
|
49
|
+
fileName: file.name,
|
|
50
|
+
} )
|
|
51
|
+
);
|
|
52
|
+
}
|
|
33
53
|
} );
|
|
34
54
|
|
|
35
55
|
return blocks;
|