@wordpress/block-library 9.2.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/audio/edit.js +20 -8
- package/build/audio/edit.js.map +1 -1
- package/build/audio/index.js +4 -0
- package/build/audio/index.js.map +1 -1
- package/build/audio/transforms.js +1 -1
- package/build/audio/transforms.js.map +1 -1
- package/build/block/edit.js +38 -24
- package/build/block/edit.js.map +1 -1
- package/build/block/index.js +5 -1
- package/build/block/index.js.map +1 -1
- package/build/button/edit.js +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/buttons/index.js +26 -0
- package/build/buttons/index.js.map +1 -1
- package/build/categories/edit.js +20 -3
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +8 -0
- package/build/categories/index.js.map +1 -1
- package/build/columns/index.js +2 -2
- package/build/columns/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/embed/embed-preview.js +4 -4
- package/build/embed/embed-preview.js.map +1 -1
- package/build/embed/variations.js +39 -34
- package/build/embed/variations.js.map +1 -1
- package/build/file/edit.js +14 -6
- package/build/file/edit.js.map +1 -1
- package/build/file/index.js +4 -0
- package/build/file/index.js.map +1 -1
- package/build/file/transforms.js +2 -3
- package/build/file/transforms.js.map +1 -1
- package/build/footnotes/index.js +1 -1
- package/build/footnotes/index.js.map +1 -1
- package/build/form-input/edit.js +2 -0
- package/build/form-input/edit.js.map +1 -1
- package/build/gallery/deprecated.js +6 -54
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +9 -8
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/index.js +12 -2
- package/build/gallery/index.js.map +1 -1
- package/build/gallery/save.js +0 -11
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/shared.js +0 -27
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +29 -80
- package/build/gallery/transforms.js.map +1 -1
- package/build/group/deprecated.js +2 -5
- package/build/group/deprecated.js.map +1 -1
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/group/placeholder.js +5 -0
- package/build/group/placeholder.js.map +1 -1
- package/build/heading/index.js +14 -1
- package/build/heading/index.js.map +1 -1
- package/build/image/edit.js +14 -22
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +54 -28
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -0
- package/build/image/index.js.map +1 -1
- package/build/image/transforms.js +1 -1
- package/build/image/transforms.js.map +1 -1
- package/build/image/view.js +65 -49
- package/build/image/view.js.map +1 -1
- package/build/latest-comments/index.js +9 -0
- package/build/latest-comments/index.js.map +1 -1
- package/build/list/edit.js +3 -3
- package/build/list/edit.js.map +1 -1
- package/build/list-item/edit.js +3 -3
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +0 -7
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +8 -1
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/list-item/index.js +11 -1
- package/build/list-item/index.js.map +1 -1
- package/build/loginout/index.js +3 -0
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/edit.js +3 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/index.js +12 -0
- package/build/media-text/index.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/use-navigation-menu.js +5 -1
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/link-ui.js +13 -17
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -12
- 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 +2 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list-item/edit.js +4 -1
- package/build/page-list-item/edit.js.map +1 -1
- package/build/paragraph/index.js +6 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +6 -0
- package/build/paragraph/transforms.js.map +1 -1
- package/build/post-author/index.js +8 -0
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/index.js +3 -0
- package/build/post-author-biography/index.js.map +1 -1
- package/build/post-author-name/index.js +3 -0
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-content/index.js +3 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +3 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +3 -0
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -0
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +3 -0
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/index.js +3 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-terms/index.js +3 -0
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/edit.js +5 -1
- package/build/post-title/edit.js.map +1 -1
- package/build/post-title/index.js +3 -0
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/inspector-controls/author-control.js +3 -1
- package/build/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +27 -8
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/order-control.js +1 -0
- package/build/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +2 -1
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/sticky-control.js +1 -0
- package/build/query/edit/inspector-controls/sticky-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +5 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/query-content.js +11 -2
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/edit/query-placeholder.js +1 -14
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/edit/query-toolbar.js +54 -61
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query/index.js +34 -0
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +5 -1
- package/build/query/utils.js.map +1 -1
- package/build/query/variations.js +9 -55
- package/build/query/variations.js.map +1 -1
- package/build/query-pagination-numbers/edit.js +1 -0
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-title/edit.js +11 -19
- package/build/query-title/edit.js.map +1 -1
- package/build/query-title/use-archive-label.js +95 -0
- package/build/query-title/use-archive-label.js.map +1 -0
- package/build/quote/index.js +15 -1
- package/build/quote/index.js.map +1 -1
- package/build/search/index.js +3 -0
- package/build/search/index.js.map +1 -1
- package/build/site-logo/edit.js +4 -1
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-tagline/edit.js +5 -2
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-tagline/index.js +6 -1
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/edit.js +4 -1
- package/build/site-title/edit.js.map +1 -1
- package/build/site-title/index.js +6 -1
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +27 -7
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/icons/soundcloud.js +1 -1
- package/build/social-link/icons/soundcloud.js.map +1 -1
- package/build/social-links/index.js +12 -0
- package/build/social-links/index.js.map +1 -1
- package/build/table/edit.js +8 -17
- package/build/table/edit.js.map +1 -1
- package/build/tag-cloud/edit.js +4 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/index.js +5 -3
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +8 -3
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/edit/placeholder.js +23 -3
- package/build/template-part/edit/placeholder.js.map +1 -1
- package/build/template-part/edit/title-modal.js +21 -9
- package/build/template-part/edit/title-modal.js.map +1 -1
- package/build/term-description/index.js +12 -0
- package/build/term-description/index.js.map +1 -1
- package/build/utils/hooks.js +17 -1
- package/build/utils/hooks.js.map +1 -1
- package/build/video/deprecated.js +4 -0
- package/build/video/deprecated.js.map +1 -1
- package/build/video/edit.js +17 -7
- package/build/video/edit.js.map +1 -1
- package/build/video/index.js +4 -0
- package/build/video/index.js.map +1 -1
- package/build/video/transforms.js +1 -1
- package/build/video/transforms.js.map +1 -1
- package/build-module/audio/edit.js +20 -8
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/index.js +4 -0
- package/build-module/audio/index.js.map +1 -1
- package/build-module/audio/transforms.js +1 -1
- package/build-module/audio/transforms.js.map +1 -1
- package/build-module/block/edit.js +38 -24
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/index.js +5 -1
- package/build-module/block/index.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 +26 -0
- package/build-module/buttons/index.js.map +1 -1
- package/build-module/categories/edit.js +21 -4
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +8 -0
- package/build-module/categories/index.js.map +1 -1
- package/build-module/columns/index.js +2 -2
- package/build-module/columns/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +2 -1
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/embed/embed-preview.js +4 -4
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/embed/variations.js +40 -35
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/edit.js +15 -7
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/index.js +4 -0
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/transforms.js +2 -3
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/footnotes/index.js +1 -1
- package/build-module/footnotes/index.js.map +1 -1
- package/build-module/form-input/edit.js +2 -0
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/gallery/deprecated.js +6 -54
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +10 -9
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/index.js +11 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/gallery/save.js +0 -11
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/shared.js +0 -25
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +29 -80
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/group/deprecated.js +2 -5
- package/build-module/group/deprecated.js.map +1 -1
- package/build-module/group/index.js +1 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/placeholder.js +5 -0
- package/build-module/group/placeholder.js.map +1 -1
- package/build-module/heading/index.js +14 -1
- package/build-module/heading/index.js.map +1 -1
- package/build-module/image/edit.js +13 -21
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +50 -24
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -0
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/transforms.js +1 -1
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/image/view.js +65 -49
- package/build-module/image/view.js.map +1 -1
- package/build-module/latest-comments/index.js +9 -0
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/list/edit.js +3 -3
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list-item/edit.js +3 -3
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +0 -1
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +8 -1
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/list-item/index.js +11 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/loginout/index.js +3 -0
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/edit.js +3 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/index.js +12 -0
- package/build-module/media-text/index.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/use-navigation-menu.js +5 -1
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +13 -17
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -12
- 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 +2 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list-item/edit.js +4 -1
- package/build-module/page-list-item/edit.js.map +1 -1
- package/build-module/paragraph/index.js +6 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +6 -0
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/post-author/index.js +8 -0
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/index.js +3 -0
- package/build-module/post-author-biography/index.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-content/index.js +3 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +4 -2
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +3 -0
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -0
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +3 -0
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/index.js +3 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-terms/index.js +3 -0
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/edit.js +5 -1
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/post-title/index.js +3 -0
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +3 -1
- package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +28 -9
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/order-control.js +1 -0
- package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +2 -1
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/sticky-control.js +1 -0
- package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +6 -4
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/query-content.js +11 -2
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +1 -14
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +55 -62
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query/index.js +34 -0
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +5 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query/variations.js +4 -50
- package/build-module/query/variations.js.map +1 -1
- package/build-module/query-pagination-numbers/edit.js +1 -0
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-title/edit.js +12 -20
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-title/use-archive-label.js +88 -0
- package/build-module/query-title/use-archive-label.js.map +1 -0
- package/build-module/quote/index.js +15 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/search/index.js +3 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/site-logo/edit.js +4 -1
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-tagline/edit.js +5 -2
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-tagline/index.js +6 -1
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/edit.js +4 -1
- package/build-module/site-title/edit.js.map +1 -1
- package/build-module/site-title/index.js +6 -1
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +28 -8
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/icons/soundcloud.js +1 -1
- package/build-module/social-link/icons/soundcloud.js.map +1 -1
- package/build-module/social-links/index.js +12 -0
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/table/edit.js +9 -18
- package/build-module/table/edit.js.map +1 -1
- package/build-module/tag-cloud/edit.js +4 -1
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +5 -3
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +8 -3
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/template-part/edit/placeholder.js +23 -3
- package/build-module/template-part/edit/placeholder.js.map +1 -1
- package/build-module/template-part/edit/title-modal.js +21 -9
- package/build-module/template-part/edit/title-modal.js.map +1 -1
- package/build-module/term-description/index.js +12 -0
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/utils/hooks.js +16 -1
- package/build-module/utils/hooks.js.map +1 -1
- package/build-module/video/deprecated.js +4 -0
- package/build-module/video/deprecated.js.map +1 -1
- package/build-module/video/edit.js +18 -8
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/index.js +4 -0
- package/build-module/video/index.js.map +1 -1
- package/build-module/video/transforms.js +1 -1
- package/build-module/video/transforms.js.map +1 -1
- package/build-style/categories/editor-rtl.css +4 -0
- package/build-style/categories/editor.css +4 -0
- package/build-style/categories/style-rtl.css +4 -0
- package/build-style/categories/style.css +4 -0
- package/build-style/editor-rtl.css +16 -12
- package/build-style/editor.css +16 -12
- package/build-style/image/editor-rtl.css +8 -4
- package/build-style/image/editor.css +8 -4
- package/build-style/image/style-rtl.css +19 -0
- package/build-style/image/style.css +19 -0
- package/build-style/list/style-rtl.css +1 -1
- package/build-style/list/style.css +1 -1
- package/build-style/navigation/style-rtl.css +1 -4
- package/build-style/navigation/style.css +1 -4
- package/build-style/post-comments-form/style-rtl.css +12 -11
- package/build-style/post-comments-form/style.css +12 -11
- package/build-style/query/editor-rtl.css +3 -7
- package/build-style/query/editor.css +3 -7
- package/build-style/search/editor-rtl.css +1 -1
- package/build-style/search/editor.css +1 -1
- package/build-style/social-links/style-rtl.css +93 -93
- package/build-style/social-links/style.css +93 -93
- package/build-style/style-rtl.css +131 -109
- package/build-style/style.css +131 -109
- package/build-style/term-description/style-rtl.css +1 -0
- package/build-style/term-description/style.css +1 -0
- package/package.json +35 -35
- package/src/audio/block.json +4 -0
- package/src/audio/edit.js +19 -7
- package/src/audio/transforms.js +1 -1
- package/src/block/block.json +5 -1
- package/src/block/edit.js +58 -28
- package/src/block/test/edit.native.js +6 -2
- package/src/button/edit.js +1 -1
- package/src/button/index.php +14 -1
- package/src/buttons/block.json +20 -0
- package/src/buttons/index.js +6 -0
- package/src/categories/block.json +8 -0
- package/src/categories/edit.js +32 -4
- package/src/categories/editor.scss +4 -0
- package/src/categories/index.php +4 -1
- package/src/categories/style.scss +4 -0
- package/src/columns/index.js +1 -1
- package/src/cover/edit/inspector-controls.js +1 -0
- package/src/embed/embed-preview.js +4 -6
- package/src/embed/test/__snapshots__/index.native.js.snap +8 -8
- package/src/embed/test/index.js +1 -1
- package/src/embed/test/index.native.js +24 -23
- package/src/embed/variations.js +43 -35
- package/src/file/block.json +4 -0
- package/src/file/edit.js +19 -6
- package/src/file/transforms.js +1 -2
- package/src/footnotes/index.js +1 -2
- package/src/form-input/edit.js +2 -0
- package/src/gallery/block.json +10 -0
- package/src/gallery/deprecated.js +6 -55
- package/src/gallery/edit.js +13 -10
- package/src/gallery/gallery-styles.native.scss +0 -2
- package/src/gallery/index.js +1 -1
- package/src/gallery/save.js +0 -10
- package/src/gallery/shared.js +0 -28
- package/src/gallery/transforms.js +56 -99
- package/src/group/block.json +1 -0
- package/src/group/deprecated.js +3 -7
- package/src/group/placeholder.js +7 -0
- package/src/heading/block.json +12 -0
- package/src/heading/index.js +1 -0
- package/src/image/block.json +7 -0
- package/src/image/edit.js +11 -20
- package/src/image/editor.scss +6 -1
- package/src/image/image.js +91 -49
- package/src/image/index.php +58 -20
- package/src/image/style.scss +22 -0
- package/src/image/test/edit.native.js +1 -0
- package/src/image/transforms.js +1 -1
- package/src/image/view.js +69 -49
- package/src/latest-comments/block.json +9 -0
- package/src/list/edit.js +3 -3
- package/src/list/style.scss +1 -1
- package/src/list-item/block.json +11 -1
- package/src/list-item/edit.js +3 -3
- package/src/list-item/hooks/index.js +0 -1
- package/src/list-item/hooks/use-merge.js +19 -5
- package/src/loginout/block.json +3 -0
- package/src/media-text/block.json +12 -0
- package/src/media-text/edit.js +3 -2
- package/src/navigation/edit/navigation-menu-delete-control.js +1 -0
- package/src/navigation/index.php +1 -1
- package/src/navigation/style.scss +4 -9
- package/src/navigation/test/use-navigation-menu.js +54 -15
- package/src/navigation/use-navigation-menu.js +5 -1
- package/src/navigation-link/link-ui.js +8 -14
- package/src/navigation-submenu/edit.js +2 -14
- package/src/page-list/convert-to-links-modal.js +1 -1
- package/src/page-list/edit.js +2 -1
- package/src/page-list-item/edit.js +4 -4
- package/src/paragraph/block.json +6 -0
- package/src/post-author/index.js +8 -0
- package/src/post-author-biography/block.json +3 -0
- package/src/post-author-name/block.json +3 -0
- package/src/post-comments-form/style.scss +16 -13
- package/src/post-content/block.json +3 -0
- package/src/post-date/block.json +3 -0
- package/src/post-date/edit.js +5 -1
- package/src/post-date/index.php +8 -2
- package/src/post-excerpt/block.json +3 -0
- package/src/post-excerpt/edit.js +1 -0
- package/src/post-featured-image/block.json +3 -0
- package/src/post-terms/block.json +3 -0
- package/src/post-title/block.json +3 -0
- package/src/post-title/edit.js +5 -5
- package/src/query/edit/inspector-controls/author-control.js +2 -0
- package/src/query/edit/inspector-controls/index.js +44 -16
- package/src/query/edit/inspector-controls/order-control.js +1 -0
- package/src/query/edit/inspector-controls/parent-control.js +1 -0
- package/src/query/edit/inspector-controls/sticky-control.js +1 -0
- package/src/query/edit/inspector-controls/taxonomy-controls.js +8 -3
- package/src/query/edit/query-content.js +17 -3
- package/src/query/edit/query-placeholder.js +1 -21
- package/src/query/edit/query-toolbar.js +60 -72
- package/src/query/editor.scss +4 -9
- package/src/query/index.js +40 -0
- package/src/query/utils.js +4 -0
- package/src/query/variations.js +4 -46
- package/src/query-pagination-numbers/edit.js +1 -0
- package/src/query-title/edit.js +10 -17
- package/src/query-title/use-archive-label.js +99 -0
- package/src/quote/block.json +15 -1
- package/src/search/block.json +3 -0
- package/src/search/editor.scss +1 -1
- package/src/site-logo/edit.js +4 -1
- package/src/site-tagline/block.json +6 -1
- package/src/site-tagline/edit.js +5 -2
- package/src/site-title/edit.js +4 -1
- package/src/site-title/index.js +6 -1
- package/src/social-link/edit.js +29 -3
- package/src/social-link/icons/soundcloud.js +1 -1
- package/src/social-link/socials-with-bg.scss +1 -1
- package/src/social-link/socials-without-bg.scss +1 -1
- package/src/social-links/block.json +12 -0
- package/src/social-links/style.scss +2 -2
- package/src/table/edit.js +11 -24
- package/src/tag-cloud/edit.js +7 -1
- package/src/template-part/edit/index.js +5 -3
- package/src/template-part/edit/inner-blocks.js +8 -5
- package/src/template-part/edit/placeholder.js +31 -6
- package/src/template-part/edit/title-modal.js +19 -5
- package/src/term-description/block.json +12 -0
- package/src/term-description/style.scss +2 -0
- package/src/utils/hooks.js +19 -2
- package/src/video/block.json +4 -0
- package/src/video/edit.js +23 -8
- package/src/video/transforms.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/gallery/edit-wrapper.js +0 -37
- package/build/gallery/edit-wrapper.js.map +0 -1
- package/build/gallery/v1/constants.js +0 -10
- package/build/gallery/v1/constants.js.map +0 -1
- package/build/gallery/v1/edit.js +0 -399
- package/build/gallery/v1/edit.js.map +0 -1
- package/build/gallery/v1/gallery-button.native.js +0 -55
- package/build/gallery/v1/gallery-button.native.js.map +0 -1
- package/build/gallery/v1/gallery-image.js +0 -285
- package/build/gallery/v1/gallery-image.js.map +0 -1
- package/build/gallery/v1/gallery-image.native.js +0 -297
- package/build/gallery/v1/gallery-image.native.js.map +0 -1
- package/build/gallery/v1/gallery.js +0 -112
- package/build/gallery/v1/gallery.js.map +0 -1
- package/build/gallery/v1/gallery.native.js +0 -139
- package/build/gallery/v1/gallery.native.js.map +0 -1
- package/build/gallery/v1/save.js +0 -81
- package/build/gallery/v1/save.js.map +0 -1
- package/build/gallery/v1/shared.js +0 -17
- package/build/gallery/v1/shared.js.map +0 -1
- package/build/gallery/v1/tiles.native.js +0 -83
- package/build/gallery/v1/tiles.native.js.map +0 -1
- package/build/list-item/hooks/use-split.js +0 -39
- package/build/list-item/hooks/use-split.js.map +0 -1
- package/build/utils/constants.js +0 -15
- package/build/utils/constants.js.map +0 -1
- package/build-module/gallery/edit-wrapper.js +0 -31
- package/build-module/gallery/edit-wrapper.js.map +0 -1
- package/build-module/gallery/v1/constants.js +0 -4
- package/build-module/gallery/v1/constants.js.map +0 -1
- package/build-module/gallery/v1/edit.js +0 -393
- package/build-module/gallery/v1/edit.js.map +0 -1
- package/build-module/gallery/v1/gallery-button.native.js +0 -46
- package/build-module/gallery/v1/gallery-button.native.js.map +0 -1
- package/build-module/gallery/v1/gallery-image.js +0 -279
- package/build-module/gallery/v1/gallery-image.js.map +0 -1
- package/build-module/gallery/v1/gallery-image.native.js +0 -291
- package/build-module/gallery/v1/gallery-image.native.js.map +0 -1
- package/build-module/gallery/v1/gallery.js +0 -104
- package/build-module/gallery/v1/gallery.js.map +0 -1
- package/build-module/gallery/v1/gallery.native.js +0 -131
- package/build-module/gallery/v1/gallery.native.js.map +0 -1
- package/build-module/gallery/v1/save.js +0 -74
- package/build-module/gallery/v1/save.js.map +0 -1
- package/build-module/gallery/v1/shared.js +0 -10
- package/build-module/gallery/v1/shared.js.map +0 -1
- package/build-module/gallery/v1/tiles.native.js +0 -75
- package/build-module/gallery/v1/tiles.native.js.map +0 -1
- package/build-module/list-item/hooks/use-split.js +0 -32
- package/build-module/list-item/hooks/use-split.js.map +0 -1
- package/build-module/utils/constants.js +0 -9
- package/build-module/utils/constants.js.map +0 -1
- package/src/gallery/edit-wrapper.js +0 -27
- package/src/gallery/v1/constants.js +0 -3
- package/src/gallery/v1/edit.js +0 -450
- package/src/gallery/v1/gallery-button.native.js +0 -47
- package/src/gallery/v1/gallery-image-style.native.scss +0 -109
- package/src/gallery/v1/gallery-image.js +0 -293
- package/src/gallery/v1/gallery-image.native.js +0 -348
- package/src/gallery/v1/gallery-styles.native.scss +0 -8
- package/src/gallery/v1/gallery.js +0 -125
- package/src/gallery/v1/gallery.native.js +0 -162
- package/src/gallery/v1/save.js +0 -98
- package/src/gallery/v1/shared.js +0 -19
- package/src/gallery/v1/tiles-styles.native.scss +0 -11
- package/src/gallery/v1/tiles.native.js +0 -79
- package/src/list-item/hooks/use-split.js +0 -33
- package/src/utils/constants.js +0 -8
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
LINK_DESTINATION_MEDIA,
|
|
23
23
|
LINK_DESTINATION_NONE,
|
|
24
24
|
} from './constants';
|
|
25
|
-
import { isGalleryV2Enabled } from './shared';
|
|
26
25
|
|
|
27
26
|
const DEPRECATED_LINK_DESTINATION_MEDIA = 'file';
|
|
28
27
|
const DEPRECATED_LINK_DESTINATION_ATTACHMENT = 'post';
|
|
@@ -408,11 +407,7 @@ const v6 = {
|
|
|
408
407
|
);
|
|
409
408
|
},
|
|
410
409
|
migrate( attributes ) {
|
|
411
|
-
|
|
412
|
-
return runV2Migration( attributes );
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
return attributes;
|
|
410
|
+
return runV2Migration( attributes );
|
|
416
411
|
},
|
|
417
412
|
};
|
|
418
413
|
const v5 = {
|
|
@@ -498,23 +493,7 @@ const v5 = {
|
|
|
498
493
|
return ! linkTo || linkTo === 'attachment' || linkTo === 'media';
|
|
499
494
|
},
|
|
500
495
|
migrate( attributes ) {
|
|
501
|
-
|
|
502
|
-
return runV2Migration( attributes );
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
let linkTo = attributes.linkTo;
|
|
506
|
-
|
|
507
|
-
if ( ! attributes.linkTo ) {
|
|
508
|
-
linkTo = 'none';
|
|
509
|
-
} else if ( attributes.linkTo === 'attachment' ) {
|
|
510
|
-
linkTo = 'post';
|
|
511
|
-
} else if ( attributes.linkTo === 'media' ) {
|
|
512
|
-
linkTo = 'file';
|
|
513
|
-
}
|
|
514
|
-
return {
|
|
515
|
-
...attributes,
|
|
516
|
-
linkTo,
|
|
517
|
-
};
|
|
496
|
+
return runV2Migration( attributes );
|
|
518
497
|
},
|
|
519
498
|
save( { attributes } ) {
|
|
520
499
|
const {
|
|
@@ -661,17 +640,7 @@ const v4 = {
|
|
|
661
640
|
return ids && ids.some( ( id ) => typeof id === 'string' );
|
|
662
641
|
},
|
|
663
642
|
migrate( attributes ) {
|
|
664
|
-
|
|
665
|
-
return runV2Migration( attributes );
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
return {
|
|
669
|
-
...attributes,
|
|
670
|
-
ids: ( attributes.ids ?? [] ).map( ( id ) => {
|
|
671
|
-
const parsedId = parseInt( id, 10 );
|
|
672
|
-
return Number.isInteger( parsedId ) ? parsedId : null;
|
|
673
|
-
} ),
|
|
674
|
-
};
|
|
643
|
+
return runV2Migration( attributes );
|
|
675
644
|
},
|
|
676
645
|
save( { attributes } ) {
|
|
677
646
|
const {
|
|
@@ -867,10 +836,7 @@ const v3 = {
|
|
|
867
836
|
);
|
|
868
837
|
},
|
|
869
838
|
migrate( attributes ) {
|
|
870
|
-
|
|
871
|
-
return runV2Migration( attributes );
|
|
872
|
-
}
|
|
873
|
-
return attributes;
|
|
839
|
+
return runV2Migration( attributes );
|
|
874
840
|
},
|
|
875
841
|
};
|
|
876
842
|
const v2 = {
|
|
@@ -936,18 +902,7 @@ const v2 = {
|
|
|
936
902
|
);
|
|
937
903
|
},
|
|
938
904
|
migrate( attributes ) {
|
|
939
|
-
|
|
940
|
-
return runV2Migration( attributes );
|
|
941
|
-
}
|
|
942
|
-
return {
|
|
943
|
-
...attributes,
|
|
944
|
-
ids: ( attributes.images ?? [] ).map( ( { id } ) => {
|
|
945
|
-
if ( ! id ) {
|
|
946
|
-
return null;
|
|
947
|
-
}
|
|
948
|
-
return parseInt( id, 10 );
|
|
949
|
-
} ),
|
|
950
|
-
};
|
|
905
|
+
return runV2Migration( attributes );
|
|
951
906
|
},
|
|
952
907
|
supports: {
|
|
953
908
|
align: true,
|
|
@@ -1100,11 +1055,7 @@ const v1 = {
|
|
|
1100
1055
|
);
|
|
1101
1056
|
},
|
|
1102
1057
|
migrate( attributes ) {
|
|
1103
|
-
|
|
1104
|
-
return runV2Migration( attributes );
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
return attributes;
|
|
1058
|
+
return runV2Migration( attributes );
|
|
1108
1059
|
},
|
|
1109
1060
|
};
|
|
1110
1061
|
|
package/src/gallery/edit.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
ToggleControl,
|
|
15
15
|
RangeControl,
|
|
16
16
|
Spinner,
|
|
17
|
+
withNotices,
|
|
17
18
|
} from '@wordpress/components';
|
|
18
19
|
import {
|
|
19
20
|
store as blockEditorStore,
|
|
@@ -237,7 +238,7 @@ function GalleryEdit( props ) {
|
|
|
237
238
|
return (
|
|
238
239
|
ALLOWED_MEDIA_TYPES.some(
|
|
239
240
|
( mediaType ) => mediaTypeSelector?.indexOf( mediaType ) === 0
|
|
240
|
-
) || file.
|
|
241
|
+
) || file.blob
|
|
241
242
|
);
|
|
242
243
|
}
|
|
243
244
|
|
|
@@ -249,9 +250,9 @@ function GalleryEdit( props ) {
|
|
|
249
250
|
const imageArray = newFileUploads
|
|
250
251
|
? Array.from( selectedImages ).map( ( file ) => {
|
|
251
252
|
if ( ! file.url ) {
|
|
252
|
-
return
|
|
253
|
-
|
|
254
|
-
}
|
|
253
|
+
return {
|
|
254
|
+
blob: createBlobURL( file ),
|
|
255
|
+
};
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
return file;
|
|
@@ -271,9 +272,9 @@ function GalleryEdit( props ) {
|
|
|
271
272
|
.filter( ( file ) => file.url || isValidFileType( file ) )
|
|
272
273
|
.map( ( file ) => {
|
|
273
274
|
if ( ! file.url ) {
|
|
274
|
-
return
|
|
275
|
-
|
|
276
|
-
}
|
|
275
|
+
return {
|
|
276
|
+
blob: file.blob || createBlobURL( file ),
|
|
277
|
+
};
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
return file;
|
|
@@ -307,6 +308,7 @@ function GalleryEdit( props ) {
|
|
|
307
308
|
const newBlocks = newImageList.map( ( image ) => {
|
|
308
309
|
return createBlock( 'core/image', {
|
|
309
310
|
id: image.id,
|
|
311
|
+
blob: image.blob,
|
|
310
312
|
url: image.url,
|
|
311
313
|
caption: image.caption,
|
|
312
314
|
alt: image.alt,
|
|
@@ -632,6 +634,7 @@ function GalleryEdit( props ) {
|
|
|
632
634
|
</>
|
|
633
635
|
);
|
|
634
636
|
}
|
|
635
|
-
export default compose( [
|
|
636
|
-
|
|
637
|
-
)
|
|
637
|
+
export default compose( [
|
|
638
|
+
withNotices,
|
|
639
|
+
withViewportMatch( { isNarrow: '< small' } ),
|
|
640
|
+
] )( GalleryEdit );
|
package/src/gallery/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { gallery as icon } from '@wordpress/icons';
|
|
|
8
8
|
*/
|
|
9
9
|
import initBlock from '../utils/init-block';
|
|
10
10
|
import deprecated from './deprecated';
|
|
11
|
-
import edit from './edit
|
|
11
|
+
import edit from './edit';
|
|
12
12
|
import metadata from './block.json';
|
|
13
13
|
import save from './save';
|
|
14
14
|
import transforms from './transforms';
|
package/src/gallery/save.js
CHANGED
|
@@ -13,17 +13,7 @@ import {
|
|
|
13
13
|
__experimentalGetElementClassName,
|
|
14
14
|
} from '@wordpress/block-editor';
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
import saveWithoutInnerBlocks from './v1/save';
|
|
20
|
-
import { isGalleryV2Enabled } from './shared';
|
|
21
|
-
|
|
22
16
|
export default function saveWithInnerBlocks( { attributes } ) {
|
|
23
|
-
if ( ! isGalleryV2Enabled() ) {
|
|
24
|
-
return saveWithoutInnerBlocks( { attributes } );
|
|
25
|
-
}
|
|
26
|
-
|
|
27
17
|
const { caption, columns, imageCrop } = attributes;
|
|
28
18
|
|
|
29
19
|
const className = clsx( 'has-nested-images', {
|
package/src/gallery/shared.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Platform } from '@wordpress/element';
|
|
5
|
-
|
|
6
1
|
export function defaultColumnsNumber( imageCount ) {
|
|
7
2
|
return imageCount ? Math.min( 3, imageCount ) : 3;
|
|
8
3
|
}
|
|
@@ -27,26 +22,3 @@ export const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {
|
|
|
27
22
|
}
|
|
28
23
|
return imageProps;
|
|
29
24
|
};
|
|
30
|
-
|
|
31
|
-
function getGalleryBlockV2Enabled() {
|
|
32
|
-
// We want to fail early here, at least during beta testing phase, to ensure
|
|
33
|
-
// there aren't instances where undefined values cause false negatives.
|
|
34
|
-
if ( ! window.wp || typeof window.wp.galleryBlockV2Enabled !== 'boolean' ) {
|
|
35
|
-
throw 'window.wp.galleryBlockV2Enabled is not defined';
|
|
36
|
-
}
|
|
37
|
-
return window.wp.galleryBlockV2Enabled;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* The new gallery block format is not compatible with the use_BalanceTags option
|
|
42
|
-
* in WP versions <= 5.8 https://core.trac.wordpress.org/ticket/54130. The
|
|
43
|
-
* window.wp.galleryBlockV2Enabled flag is set in lib/compat.php. This method
|
|
44
|
-
* can be removed when minimum supported WP version >=5.9.
|
|
45
|
-
*/
|
|
46
|
-
export function isGalleryV2Enabled() {
|
|
47
|
-
if ( Platform.isNative ) {
|
|
48
|
-
return getGalleryBlockV2Enabled();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
LINK_DESTINATION_NONE,
|
|
14
14
|
LINK_DESTINATION_MEDIA,
|
|
15
15
|
} from './constants';
|
|
16
|
-
import { pickRelevantMediaFiles, isGalleryV2Enabled } from './shared';
|
|
17
16
|
|
|
18
17
|
const parseShortcodeIds = ( ids ) => {
|
|
19
18
|
if ( ! ids ) {
|
|
@@ -39,7 +38,6 @@ const parseShortcodeIds = ( ids ) => {
|
|
|
39
38
|
*/
|
|
40
39
|
function updateThirdPartyTransformToGallery( block ) {
|
|
41
40
|
if (
|
|
42
|
-
isGalleryV2Enabled() &&
|
|
43
41
|
block.name === 'core/gallery' &&
|
|
44
42
|
block.attributes?.images.length > 0
|
|
45
43
|
) {
|
|
@@ -137,37 +135,21 @@ const transforms = {
|
|
|
137
135
|
|
|
138
136
|
const validImages = attributes.filter( ( { url } ) => url );
|
|
139
137
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return createBlock( 'core/image', image );
|
|
146
|
-
} );
|
|
147
|
-
|
|
148
|
-
return createBlock(
|
|
149
|
-
'core/gallery',
|
|
150
|
-
{
|
|
151
|
-
align,
|
|
152
|
-
sizeSlug,
|
|
153
|
-
},
|
|
154
|
-
innerBlocks
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return createBlock( 'core/gallery', {
|
|
159
|
-
images: validImages.map(
|
|
160
|
-
( { id, url, alt, caption } ) => ( {
|
|
161
|
-
id: id.toString(),
|
|
162
|
-
url,
|
|
163
|
-
alt,
|
|
164
|
-
caption,
|
|
165
|
-
} )
|
|
166
|
-
),
|
|
167
|
-
ids: validImages.map( ( { id } ) => parseInt( id, 10 ) ),
|
|
168
|
-
align,
|
|
169
|
-
sizeSlug,
|
|
138
|
+
const innerBlocks = validImages.map( ( image ) => {
|
|
139
|
+
// Gallery images can't currently be resized so make sure height and width are undefined.
|
|
140
|
+
image.width = undefined;
|
|
141
|
+
image.height = undefined;
|
|
142
|
+
return createBlock( 'core/image', image );
|
|
170
143
|
} );
|
|
144
|
+
|
|
145
|
+
return createBlock(
|
|
146
|
+
'core/gallery',
|
|
147
|
+
{
|
|
148
|
+
align,
|
|
149
|
+
sizeSlug,
|
|
150
|
+
},
|
|
151
|
+
innerBlocks
|
|
152
|
+
);
|
|
171
153
|
},
|
|
172
154
|
},
|
|
173
155
|
{
|
|
@@ -220,23 +202,13 @@ const transforms = {
|
|
|
220
202
|
);
|
|
221
203
|
},
|
|
222
204
|
transform( files ) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
);
|
|
205
|
+
const innerBlocks = files.map( ( file ) =>
|
|
206
|
+
createBlock( 'core/image', {
|
|
207
|
+
blob: createBlobURL( file ),
|
|
208
|
+
} )
|
|
209
|
+
);
|
|
229
210
|
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
const block = createBlock( 'core/gallery', {
|
|
233
|
-
images: files.map( ( file ) =>
|
|
234
|
-
pickRelevantMediaFiles( {
|
|
235
|
-
url: createBlobURL( file ),
|
|
236
|
-
} )
|
|
237
|
-
),
|
|
238
|
-
} );
|
|
239
|
-
return block;
|
|
211
|
+
return createBlock( 'core/gallery', {}, innerBlocks );
|
|
240
212
|
},
|
|
241
213
|
},
|
|
242
214
|
],
|
|
@@ -244,57 +216,42 @@ const transforms = {
|
|
|
244
216
|
{
|
|
245
217
|
type: 'block',
|
|
246
218
|
blocks: [ 'core/image' ],
|
|
247
|
-
transform: ( { align
|
|
248
|
-
if (
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
} )
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
return createBlock( 'core/image', { align } );
|
|
287
|
-
}
|
|
288
|
-
if ( images.length > 0 ) {
|
|
289
|
-
return images.map( ( { url, alt, caption }, index ) =>
|
|
290
|
-
createBlock( 'core/image', {
|
|
291
|
-
id: ids[ index ],
|
|
292
|
-
url,
|
|
293
|
-
alt,
|
|
294
|
-
caption,
|
|
295
|
-
align,
|
|
296
|
-
sizeSlug,
|
|
297
|
-
} )
|
|
219
|
+
transform: ( { align }, innerBlocks ) => {
|
|
220
|
+
if ( innerBlocks.length > 0 ) {
|
|
221
|
+
return innerBlocks.map(
|
|
222
|
+
( {
|
|
223
|
+
attributes: {
|
|
224
|
+
url,
|
|
225
|
+
alt,
|
|
226
|
+
caption,
|
|
227
|
+
title,
|
|
228
|
+
href,
|
|
229
|
+
rel,
|
|
230
|
+
linkClass,
|
|
231
|
+
id,
|
|
232
|
+
sizeSlug: imageSizeSlug,
|
|
233
|
+
linkDestination,
|
|
234
|
+
linkTarget,
|
|
235
|
+
anchor,
|
|
236
|
+
className,
|
|
237
|
+
},
|
|
238
|
+
} ) =>
|
|
239
|
+
createBlock( 'core/image', {
|
|
240
|
+
align,
|
|
241
|
+
url,
|
|
242
|
+
alt,
|
|
243
|
+
caption,
|
|
244
|
+
title,
|
|
245
|
+
href,
|
|
246
|
+
rel,
|
|
247
|
+
linkClass,
|
|
248
|
+
id,
|
|
249
|
+
sizeSlug: imageSizeSlug,
|
|
250
|
+
linkDestination,
|
|
251
|
+
linkTarget,
|
|
252
|
+
anchor,
|
|
253
|
+
className,
|
|
254
|
+
} )
|
|
298
255
|
);
|
|
299
256
|
}
|
|
300
257
|
return createBlock( 'core/image', { align } );
|
package/src/group/block.json
CHANGED
package/src/group/deprecated.js
CHANGED
|
@@ -109,15 +109,11 @@ const deprecated = [
|
|
|
109
109
|
);
|
|
110
110
|
},
|
|
111
111
|
isEligible: ( { layout } ) =>
|
|
112
|
-
|
|
113
|
-
layout
|
|
114
|
-
( layout.contentSize && layout.type !== 'constrained' ),
|
|
112
|
+
layout?.inherit ||
|
|
113
|
+
( layout?.contentSize && layout?.type !== 'constrained' ),
|
|
115
114
|
migrate: ( attributes ) => {
|
|
116
115
|
const { layout = null } = attributes;
|
|
117
|
-
if (
|
|
118
|
-
return attributes;
|
|
119
|
-
}
|
|
120
|
-
if ( layout.inherit || layout.contentSize ) {
|
|
116
|
+
if ( layout?.inherit || layout?.contentSize ) {
|
|
121
117
|
return {
|
|
122
118
|
...attributes,
|
|
123
119
|
layout: {
|
package/src/group/placeholder.js
CHANGED
|
@@ -139,6 +139,13 @@ function GroupPlaceHolder( { name, onSelect } ) {
|
|
|
139
139
|
const blockProps = useBlockProps( {
|
|
140
140
|
className: 'wp-block-group__placeholder',
|
|
141
141
|
} );
|
|
142
|
+
|
|
143
|
+
useEffect( () => {
|
|
144
|
+
if ( variations && variations.length === 1 ) {
|
|
145
|
+
onSelect( variations[ 0 ] );
|
|
146
|
+
}
|
|
147
|
+
}, [ onSelect, variations ] );
|
|
148
|
+
|
|
142
149
|
return (
|
|
143
150
|
<div { ...blockProps }>
|
|
144
151
|
<Placeholder
|
package/src/heading/block.json
CHANGED
|
@@ -30,6 +30,18 @@
|
|
|
30
30
|
"anchor": true,
|
|
31
31
|
"className": true,
|
|
32
32
|
"splitting": true,
|
|
33
|
+
"__experimentalBorder": {
|
|
34
|
+
"color": true,
|
|
35
|
+
"radius": true,
|
|
36
|
+
"style": true,
|
|
37
|
+
"width": true,
|
|
38
|
+
"__experimentalDefaultControls": {
|
|
39
|
+
"color": true,
|
|
40
|
+
"radius": true,
|
|
41
|
+
"style": true,
|
|
42
|
+
"width": true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
33
45
|
"color": {
|
|
34
46
|
"gradients": true,
|
|
35
47
|
"link": true,
|
package/src/heading/index.js
CHANGED
package/src/image/block.json
CHANGED
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"keywords": [ "img", "photo", "picture" ],
|
|
10
10
|
"textdomain": "default",
|
|
11
11
|
"attributes": {
|
|
12
|
+
"blob": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"__experimentalRole": "local"
|
|
15
|
+
},
|
|
12
16
|
"url": {
|
|
13
17
|
"type": "string",
|
|
14
18
|
"source": "attribute",
|
|
@@ -102,6 +106,9 @@
|
|
|
102
106
|
"filter": {
|
|
103
107
|
"duotone": true
|
|
104
108
|
},
|
|
109
|
+
"spacing": {
|
|
110
|
+
"margin": true
|
|
111
|
+
},
|
|
105
112
|
"__experimentalBorder": {
|
|
106
113
|
"color": true,
|
|
107
114
|
"radius": true,
|
package/src/image/edit.js
CHANGED
|
@@ -56,17 +56,6 @@ export const pickRelevantMediaFiles = ( image, size ) => {
|
|
|
56
56
|
return imageProps;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
/**
|
|
60
|
-
* Is the URL a temporary blob URL? A blob URL is one that is used temporarily
|
|
61
|
-
* while the image is being uploaded and will not have an id yet allocated.
|
|
62
|
-
*
|
|
63
|
-
* @param {number=} id The id of the image.
|
|
64
|
-
* @param {string=} url The url of the image.
|
|
65
|
-
*
|
|
66
|
-
* @return {boolean} Is the URL a Blob URL
|
|
67
|
-
*/
|
|
68
|
-
const isTemporaryImage = ( id, url ) => ! id && isBlobURL( url );
|
|
69
|
-
|
|
70
59
|
/**
|
|
71
60
|
* Is the url for the image hosted externally. An externally hosted image has no
|
|
72
61
|
* id and is not a blob url.
|
|
@@ -118,9 +107,7 @@ export function ImageEdit( {
|
|
|
118
107
|
align,
|
|
119
108
|
metadata,
|
|
120
109
|
} = attributes;
|
|
121
|
-
const [ temporaryURL, setTemporaryURL ] = useState(
|
|
122
|
-
return isTemporaryImage( id, url ) ? url : undefined;
|
|
123
|
-
} );
|
|
110
|
+
const [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );
|
|
124
111
|
|
|
125
112
|
const altRef = useRef();
|
|
126
113
|
useEffect( () => {
|
|
@@ -157,8 +144,8 @@ export function ImageEdit( {
|
|
|
157
144
|
src: undefined,
|
|
158
145
|
id: undefined,
|
|
159
146
|
url: undefined,
|
|
147
|
+
blob: undefined,
|
|
160
148
|
} );
|
|
161
|
-
setTemporaryURL( undefined );
|
|
162
149
|
}
|
|
163
150
|
|
|
164
151
|
function onSelectImage( media ) {
|
|
@@ -169,7 +156,9 @@ export function ImageEdit( {
|
|
|
169
156
|
id: undefined,
|
|
170
157
|
title: undefined,
|
|
171
158
|
caption: undefined,
|
|
159
|
+
blob: undefined,
|
|
172
160
|
} );
|
|
161
|
+
setTemporaryURL();
|
|
173
162
|
|
|
174
163
|
return;
|
|
175
164
|
}
|
|
@@ -179,8 +168,6 @@ export function ImageEdit( {
|
|
|
179
168
|
return;
|
|
180
169
|
}
|
|
181
170
|
|
|
182
|
-
setTemporaryURL();
|
|
183
|
-
|
|
184
171
|
const { imageDefaultSize } = getSettings();
|
|
185
172
|
|
|
186
173
|
// Try to use the previous selected image size if its available
|
|
@@ -254,24 +241,28 @@ export function ImageEdit( {
|
|
|
254
241
|
mediaAttributes.href = href;
|
|
255
242
|
|
|
256
243
|
setAttributes( {
|
|
244
|
+
blob: undefined,
|
|
257
245
|
...mediaAttributes,
|
|
258
246
|
...additionalAttributes,
|
|
259
247
|
linkDestination,
|
|
260
248
|
} );
|
|
249
|
+
setTemporaryURL();
|
|
261
250
|
}
|
|
262
251
|
|
|
263
252
|
function onSelectURL( newURL ) {
|
|
264
253
|
if ( newURL !== url ) {
|
|
265
254
|
setAttributes( {
|
|
255
|
+
blob: undefined,
|
|
266
256
|
url: newURL,
|
|
267
257
|
id: undefined,
|
|
268
258
|
sizeSlug: getSettings().imageDefaultSize,
|
|
269
259
|
} );
|
|
260
|
+
setTemporaryURL();
|
|
270
261
|
}
|
|
271
262
|
}
|
|
272
263
|
|
|
273
264
|
useUploadMediaFromBlobURL( {
|
|
274
|
-
url,
|
|
265
|
+
url: temporaryURL,
|
|
275
266
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
276
267
|
onChange: onSelectImage,
|
|
277
268
|
onError: onUploadError,
|
|
@@ -292,7 +283,7 @@ export function ImageEdit( {
|
|
|
292
283
|
const shadowProps = getShadowClassesAndStyles( attributes );
|
|
293
284
|
|
|
294
285
|
const classes = clsx( className, {
|
|
295
|
-
'is-transient': temporaryURL,
|
|
286
|
+
'is-transient': !! temporaryURL,
|
|
296
287
|
'is-resized': !! width || !! height,
|
|
297
288
|
[ `size-${ sizeSlug }` ]: sizeSlug,
|
|
298
289
|
'has-custom-border':
|
|
@@ -317,7 +308,7 @@ export function ImageEdit( {
|
|
|
317
308
|
return {
|
|
318
309
|
lockUrlControls:
|
|
319
310
|
!! metadata?.bindings?.url &&
|
|
320
|
-
! blockBindingsSource?.canUserEditValue( {
|
|
311
|
+
! blockBindingsSource?.canUserEditValue?.( {
|
|
321
312
|
select,
|
|
322
313
|
context,
|
|
323
314
|
args: metadata?.bindings?.url?.args,
|
package/src/image/editor.scss
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
.wp-block-image.wp-block-image {
|
|
4
4
|
|
|
5
5
|
// Show Placeholder style on-select.
|
|
6
|
-
&.is-selected .
|
|
6
|
+
&.is-selected .block-editor-media-placeholder {
|
|
7
7
|
// Block UI appearance.
|
|
8
8
|
color: $gray-900;
|
|
9
9
|
background-color: $white;
|
|
@@ -70,6 +70,11 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
// Shown while image is being uploded but cannot be previewed.
|
|
74
|
+
.wp-block-image__placeholder {
|
|
75
|
+
aspect-ratio: 4 / 3;
|
|
76
|
+
}
|
|
77
|
+
|
|
73
78
|
// This is necessary for the editor resize handles to accurately work on a non-floated, non-resized, small image.
|
|
74
79
|
.wp-block-image .components-resizable-box__container {
|
|
75
80
|
// Using "display: table" because:
|