@wordpress/block-library 8.13.0 → 8.15.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/archives/index.js +5 -1
- package/build/archives/index.js.map +1 -1
- package/build/audio/index.js +5 -1
- package/build/audio/index.js.map +1 -1
- package/build/avatar/edit.js +1 -0
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/index.js +1 -1
- package/build/block/edit.js +1 -1
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +6 -9
- package/build/block/edit.native.js.map +1 -1
- package/build/block/index.js +2 -1
- package/build/block/index.js.map +1 -1
- package/build/buttons/edit.js +7 -3
- package/build/buttons/edit.js.map +1 -1
- package/build/categories/index.js +5 -1
- package/build/categories/index.js.map +1 -1
- package/build/code/index.js +5 -1
- package/build/code/index.js.map +1 -1
- package/build/column/edit.native.js +1 -4
- package/build/column/edit.native.js.map +1 -1
- package/build/column/index.js +1 -0
- package/build/column/index.js.map +1 -1
- package/build/columns/edit.js +1 -0
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-avatar/edit.js +1 -0
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/comments/index.js +1 -0
- package/build/comments/index.js.map +1 -1
- package/build/cover/deprecated.js +4 -2
- package/build/cover/deprecated.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/cover/index.js +1 -0
- package/build/cover/index.js.map +1 -1
- package/build/details/index.js +5 -1
- package/build/details/index.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +37 -13
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/util.js +9 -8
- package/build/embed/util.js.map +1 -1
- package/build/file/inspector.js +1 -0
- package/build/file/inspector.js.map +1 -1
- package/build/file/{interactivity.js → view-interactivity.js} +6 -2
- package/build/file/view-interactivity.js.map +1 -0
- package/build/footnotes/edit.js +20 -1
- package/build/footnotes/edit.js.map +1 -1
- package/build/footnotes/format.js +19 -16
- package/build/footnotes/format.js.map +1 -1
- package/build/footnotes/index.js +0 -1
- package/build/footnotes/index.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/index.js +3 -1
- package/build/gallery/index.js.map +1 -1
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/heading/index.js +5 -1
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +5 -1
- package/build/heading/transforms.js.map +1 -1
- package/build/image/deprecated.js +453 -175
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +0 -4
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +96 -43
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +6 -0
- package/build/image/index.js.map +1 -1
- package/build/image/save.js +8 -1
- package/build/image/save.js.map +1 -1
- package/build/image/utils.js +18 -0
- package/build/image/utils.js.map +1 -1
- package/build/image/{interactivity.js → view-interactivity.js} +86 -44
- package/build/image/view-interactivity.js.map +1 -0
- package/build/index.js +12 -3
- package/build/index.js.map +1 -1
- package/build/latest-comments/edit.js +1 -0
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/edit.js +2 -0
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/edit.js +4 -4
- package/build/list/edit.js.map +1 -1
- package/build/list/index.js +5 -1
- package/build/list/index.js.map +1 -1
- package/build/list-item/utils.js +6 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/index.js +1 -0
- package/build/media-text/index.js.map +1 -1
- package/build/media-text/media-container.native.js +2 -1
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/missing/edit.js +22 -8
- package/build/missing/edit.js.map +1 -1
- package/build/missing/edit.native.js +7 -5
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/constants.js +10 -4
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/edit/index.js +17 -3
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +2 -2
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +0 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +10 -15
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +33 -45
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/view-interactivity.js +185 -0
- package/build/navigation/view-interactivity.js.map +1 -0
- package/build/navigation-link/edit.js +12 -18
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js +12 -2
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -2
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +3 -3
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +34 -39
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/use-convert-to-navigation-links.js +2 -15
- package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build/paragraph/index.js +1 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +1 -0
- package/build/paragraph/transforms.js.map +1 -1
- package/build/post-comments-form/index.js +1 -0
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-navigation-link/index.js +1 -0
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-time-to-read/index.js +5 -1
- package/build/post-time-to-read/index.js.map +1 -1
- package/build/query-pagination/edit.js +1 -1
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination-numbers/index.js +1 -1
- package/build/query-title/edit.js +43 -1
- package/build/query-title/edit.js.map +1 -1
- package/build/quote/index.js +1 -0
- package/build/quote/index.js.map +1 -1
- package/build/quote/transforms.js +8 -0
- package/build/quote/transforms.js.map +1 -1
- package/build/rss/edit.js +3 -0
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.js +4 -3
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +1 -0
- package/build/search/index.js.map +1 -1
- package/build/site-logo/edit.js +1 -0
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +5 -1
- package/build/site-logo/index.js.map +1 -1
- package/build/site-tagline/icon.js +1 -1
- package/build/site-tagline/icon.js.map +1 -1
- package/build/site-tagline/index.js +5 -1
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/index.js +5 -1
- package/build/site-title/index.js.map +1 -1
- package/build/social-links/index.js +3 -1
- package/build/social-links/index.js.map +1 -1
- package/build/table/index.js +5 -1
- package/build/table/index.js.map +1 -1
- package/build/tag-cloud/edit.js +1 -0
- package/build/tag-cloud/edit.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/term-description/index.js +1 -0
- package/build/term-description/index.js.map +1 -1
- package/build/text-columns/edit.js +1 -0
- package/build/text-columns/edit.js.map +1 -1
- package/build/verse/index.js +5 -1
- package/build/verse/index.js.map +1 -1
- package/build/video/deprecated.js +5 -1
- package/build/video/deprecated.js.map +1 -1
- package/build/video/index.js +5 -1
- package/build/video/index.js.map +1 -1
- package/build-module/archives/index.js +5 -1
- package/build-module/archives/index.js.map +1 -1
- package/build-module/audio/index.js +5 -1
- package/build-module/audio/index.js.map +1 -1
- package/build-module/avatar/edit.js +1 -0
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/index.js +1 -1
- package/build-module/block/edit.js +1 -1
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +7 -9
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/block/index.js +2 -1
- package/build-module/block/index.js.map +1 -1
- package/build-module/buttons/edit.js +7 -3
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/categories/index.js +5 -1
- package/build-module/categories/index.js.map +1 -1
- package/build-module/code/index.js +5 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/edit.native.js +1 -4
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/column/index.js +1 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/edit.js +1 -0
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -0
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/comments/index.js +1 -0
- package/build-module/comments/index.js.map +1 -1
- package/build-module/cover/deprecated.js +4 -2
- package/build-module/cover/deprecated.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/cover/index.js +1 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/details/index.js +5 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +37 -14
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/util.js +6 -6
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/inspector.js +1 -0
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/file/{interactivity.js → view-interactivity.js} +6 -2
- package/build-module/file/view-interactivity.js.map +1 -0
- package/build-module/footnotes/edit.js +18 -2
- package/build-module/footnotes/edit.js.map +1 -1
- package/build-module/footnotes/format.js +19 -16
- package/build-module/footnotes/format.js.map +1 -1
- package/build-module/footnotes/index.js +0 -1
- package/build-module/footnotes/index.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/index.js +3 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/group/index.js +1 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/heading/index.js +5 -1
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +5 -1
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +454 -176
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +0 -4
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +96 -46
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +6 -0
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/save.js +8 -1
- package/build-module/image/save.js.map +1 -1
- package/build-module/image/utils.js +16 -0
- package/build-module/image/utils.js.map +1 -1
- package/build-module/image/{interactivity.js → view-interactivity.js} +86 -44
- package/build-module/image/view-interactivity.js.map +1 -0
- package/build-module/index.js +12 -3
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/edit.js +1 -0
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -0
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/edit.js +4 -4
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/index.js +5 -1
- package/build-module/list/index.js.map +1 -1
- package/build-module/list-item/utils.js +6 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/index.js +1 -0
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/media-text/media-container.native.js +2 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/missing/edit.js +22 -8
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/missing/edit.native.js +8 -6
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/constants.js +8 -3
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/edit/index.js +18 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +2 -2
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +0 -1
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +10 -14
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +35 -47
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/view-interactivity.js +182 -0
- package/build-module/navigation/view-interactivity.js.map +1 -0
- package/build-module/navigation-link/edit.js +13 -19
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +13 -3
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +2 -2
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +3 -3
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +34 -39
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/use-convert-to-navigation-links.js +3 -16
- package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build-module/paragraph/index.js +1 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +1 -0
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/post-comments-form/index.js +1 -0
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-navigation-link/index.js +1 -0
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-time-to-read/index.js +5 -1
- package/build-module/post-time-to-read/index.js.map +1 -1
- package/build-module/query-pagination/edit.js +1 -1
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +1 -1
- package/build-module/query-title/edit.js +44 -3
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/quote/index.js +1 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/transforms.js +8 -0
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/rss/edit.js +3 -0
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +4 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +1 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/site-logo/edit.js +1 -0
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +5 -1
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-tagline/icon.js +1 -1
- package/build-module/site-tagline/icon.js.map +1 -1
- package/build-module/site-tagline/index.js +5 -1
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/index.js +5 -1
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-links/index.js +3 -1
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/table/index.js +5 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/tag-cloud/edit.js +1 -0
- package/build-module/tag-cloud/edit.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/term-description/index.js +1 -0
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/text-columns/edit.js +1 -0
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/verse/index.js +5 -1
- package/build-module/verse/index.js.map +1 -1
- package/build-module/video/deprecated.js +5 -1
- package/build-module/video/deprecated.js.map +1 -1
- package/build-module/video/index.js +5 -1
- package/build-module/video/index.js.map +1 -1
- package/build-style/details/style-rtl.css +4 -2
- package/build-style/details/style.css +4 -2
- package/build-style/footnotes/style-rtl.css +4 -3
- package/build-style/footnotes/style.css +4 -3
- package/build-style/image/style-rtl.css +16 -2
- package/build-style/image/style.css +16 -2
- package/build-style/navigation/style-rtl.css +14 -2
- package/build-style/navigation/style.css +14 -2
- package/build-style/query-pagination/style-rtl.css +4 -2
- package/build-style/query-pagination/style.css +4 -2
- package/build-style/style-rtl.css +42 -11
- package/build-style/style.css +42 -11
- package/package.json +33 -37
- package/src/archives/block.json +5 -1
- package/src/audio/block.json +5 -1
- package/src/audio/test/__snapshots__/edit.native.js.snap +58 -33
- package/src/avatar/block.json +1 -1
- package/src/avatar/edit.js +1 -0
- package/src/block/block.json +2 -1
- package/src/block/edit.js +2 -2
- package/src/block/edit.native.js +8 -12
- package/src/block/editor.native.scss +2 -2
- package/src/block/test/edit.native.js +4 -4
- package/src/buttons/edit.js +4 -4
- package/src/categories/block.json +5 -1
- package/src/code/block.json +5 -1
- package/src/column/block.json +1 -0
- package/src/column/edit.native.js +4 -10
- package/src/column/editor.native.scss +0 -4
- package/src/columns/edit.js +1 -0
- package/src/comment-author-avatar/edit.js +1 -0
- package/src/comment-template/index.php +5 -2
- package/src/comments/block.json +1 -0
- package/src/cover/block.json +1 -0
- package/src/cover/deprecated.js +2 -0
- package/src/cover/edit/inspector-controls.js +1 -0
- package/src/details/block.json +5 -1
- package/src/embed/embed-placeholder.native.js +80 -47
- package/src/embed/styles.native.scss +54 -18
- package/src/embed/test/index.native.js +5 -5
- package/src/embed/util.js +4 -6
- package/src/file/index.php +4 -3
- package/src/file/inspector.js +1 -0
- package/src/file/test/__snapshots__/edit.native.js.snap +58 -33
- package/src/file/{interactivity.js → view-interactivity.js} +4 -1
- package/src/footnotes/block.json +0 -1
- package/src/footnotes/edit.js +21 -2
- package/src/footnotes/format.js +22 -20
- package/src/footnotes/index.php +11 -9
- package/src/footnotes/style.scss +6 -3
- package/src/gallery/block.json +3 -1
- package/src/gallery/edit.js +1 -1
- package/src/gallery/test/index.native.js +17 -16
- package/src/group/block.json +1 -0
- package/src/heading/block.json +5 -1
- package/src/heading/test/index.native.js +18 -0
- package/src/home-link/index.php +15 -2
- package/src/image/block.json +6 -0
- package/src/image/deprecated.js +597 -320
- package/src/image/edit.js +0 -4
- package/src/image/image.js +131 -62
- package/src/image/index.php +47 -8
- package/src/image/save.js +9 -1
- package/src/image/style.scss +15 -2
- package/src/image/test/edit.native.js +1 -1
- package/src/image/utils.js +16 -0
- package/src/image/{interactivity.js → view-interactivity.js} +99 -50
- package/src/index.js +18 -1
- package/src/latest-comments/edit.js +1 -0
- package/src/latest-posts/edit.js +2 -0
- package/src/latest-posts/index.php +1 -1
- package/src/list/block.json +5 -1
- package/src/list/edit.js +6 -4
- package/src/list/test/edit.native.js +129 -33
- package/src/media-text/block.json +1 -0
- package/src/media-text/media-container.native.js +1 -0
- package/src/missing/edit.js +31 -11
- package/src/missing/edit.native.js +12 -10
- package/src/missing/style.native.scss +19 -12
- package/src/missing/test/__snapshots__/edit.native.js.snap +21 -13
- package/src/navigation/constants.js +12 -6
- package/src/navigation/edit/index.js +30 -3
- package/src/navigation/edit/inner-blocks.js +2 -2
- package/src/navigation/edit/menu-inspector-controls.js +0 -1
- package/src/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +17 -21
- package/src/navigation/index.php +43 -16
- package/src/navigation/style.scss +27 -8
- package/src/navigation/use-navigation-menu.js +39 -63
- package/src/navigation/view-interactivity.js +196 -0
- package/src/navigation-link/edit.js +61 -61
- package/src/navigation-link/link-ui.js +14 -2
- package/src/navigation-submenu/edit.js +2 -2
- package/src/navigation-submenu/index.php +2 -12
- package/src/page-list/convert-to-links-modal.js +3 -3
- package/src/page-list/edit.js +65 -62
- package/src/page-list/use-convert-to-navigation-links.js +3 -20
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/test/__snapshots__/edit.native.js.snap +1 -0
- package/src/paragraph/test/edit.native.js +26 -0
- package/src/post-comments-form/block.json +1 -0
- package/src/post-navigation-link/block.json +1 -0
- package/src/post-template/index.php +4 -2
- package/src/post-time-to-read/block.json +5 -1
- package/src/post-title/index.php +6 -3
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -0
- package/src/query-pagination/edit.js +17 -14
- package/src/query-pagination-numbers/block.json +1 -1
- package/src/query-title/edit.js +48 -6
- package/src/quote/block.json +1 -0
- package/src/quote/test/__snapshots__/transforms.native.js.snap +10 -0
- package/src/quote/test/transforms.native.js +5 -1
- package/src/quote/transforms.js +13 -0
- package/src/rss/edit.js +3 -0
- package/src/search/block.json +1 -0
- package/src/search/edit.js +4 -3
- package/src/search/index.php +22 -4
- package/src/search/test/__snapshots__/edit.native.js.snap +7 -0
- package/src/site-logo/block.json +5 -1
- package/src/site-logo/edit.js +1 -0
- package/src/site-tagline/block.json +5 -1
- package/src/site-tagline/icon.js +1 -1
- package/src/site-title/block.json +5 -1
- package/src/social-links/block.json +3 -1
- package/src/table/block.json +5 -1
- package/src/tag-cloud/edit.js +1 -0
- package/src/template-part/edit/index.js +1 -1
- package/src/template-part/index.php +9 -15
- package/src/term-description/block.json +1 -0
- package/src/text-columns/edit.js +1 -0
- package/src/verse/block.json +5 -1
- package/src/video/block.json +5 -1
- package/build/file/interactivity.js.map +0 -1
- package/build/gallery/shared-icon.native.js +0 -38
- package/build/gallery/shared-icon.native.js.map +0 -1
- package/build/heading/heading-level-icon.js +0 -61
- package/build/heading/heading-level-icon.js.map +0 -1
- package/build/image/interactivity.js.map +0 -1
- package/build/navigation/interactivity.js +0 -167
- package/build/navigation/interactivity.js.map +0 -1
- package/build/utils/interactivity/constants.js +0 -9
- package/build/utils/interactivity/constants.js.map +0 -1
- package/build/utils/interactivity/directives.js +0 -222
- package/build/utils/interactivity/directives.js.map +0 -1
- package/build/utils/interactivity/hooks.js +0 -159
- package/build/utils/interactivity/hooks.js.map +0 -1
- package/build/utils/interactivity/hydration.js +0 -34
- package/build/utils/interactivity/hydration.js.map +0 -1
- package/build/utils/interactivity/index.js +0 -32
- package/build/utils/interactivity/index.js.map +0 -1
- package/build/utils/interactivity/portals.js +0 -108
- package/build/utils/interactivity/portals.js.map +0 -1
- package/build/utils/interactivity/store.js +0 -66
- package/build/utils/interactivity/store.js.map +0 -1
- package/build/utils/interactivity/utils.js +0 -87
- package/build/utils/interactivity/utils.js.map +0 -1
- package/build/utils/interactivity/vdom.js +0 -119
- package/build/utils/interactivity/vdom.js.map +0 -1
- package/build-module/file/interactivity.js.map +0 -1
- package/build-module/gallery/shared-icon.native.js +0 -24
- package/build-module/gallery/shared-icon.native.js.map +0 -1
- package/build-module/heading/heading-level-icon.js +0 -53
- package/build-module/heading/heading-level-icon.js.map +0 -1
- package/build-module/image/interactivity.js.map +0 -1
- package/build-module/navigation/interactivity.js +0 -164
- package/build-module/navigation/interactivity.js.map +0 -1
- package/build-module/utils/interactivity/constants.js +0 -2
- package/build-module/utils/interactivity/constants.js.map +0 -1
- package/build-module/utils/interactivity/directives.js +0 -209
- package/build-module/utils/interactivity/directives.js.map +0 -1
- package/build-module/utils/interactivity/hooks.js +0 -145
- package/build-module/utils/interactivity/hooks.js.map +0 -1
- package/build-module/utils/interactivity/hydration.js +0 -21
- package/build-module/utils/interactivity/hydration.js.map +0 -1
- package/build-module/utils/interactivity/index.js +0 -15
- package/build-module/utils/interactivity/index.js.map +0 -1
- package/build-module/utils/interactivity/portals.js +0 -100
- package/build-module/utils/interactivity/portals.js.map +0 -1
- package/build-module/utils/interactivity/store.js +0 -55
- package/build-module/utils/interactivity/store.js.map +0 -1
- package/build-module/utils/interactivity/utils.js +0 -75
- package/build-module/utils/interactivity/utils.js.map +0 -1
- package/build-module/utils/interactivity/vdom.js +0 -107
- package/build-module/utils/interactivity/vdom.js.map +0 -1
- package/src/gallery/shared-icon.native.js +0 -23
- package/src/heading/heading-level-icon.js +0 -48
- package/src/navigation/interactivity.js +0 -169
- package/src/utils/interactivity/constants.js +0 -1
- package/src/utils/interactivity/directives.js +0 -200
- package/src/utils/interactivity/hooks.js +0 -145
- package/src/utils/interactivity/hydration.js +0 -22
- package/src/utils/interactivity/index.js +0 -15
- package/src/utils/interactivity/portals.js +0 -98
- package/src/utils/interactivity/store.js +0 -45
- package/src/utils/interactivity/utils.js +0 -66
- package/src/utils/interactivity/vdom.js +0 -111
package/src/page-list/edit.js
CHANGED
|
@@ -169,12 +169,6 @@ export default function PageListEdit( {
|
|
|
169
169
|
}, new Map() );
|
|
170
170
|
}, [ pages ] );
|
|
171
171
|
|
|
172
|
-
const convertToNavigationLinks = useConvertToNavigationLinks( {
|
|
173
|
-
clientId,
|
|
174
|
-
pages,
|
|
175
|
-
parentPageID,
|
|
176
|
-
} );
|
|
177
|
-
|
|
178
172
|
const blockProps = useBlockProps( {
|
|
179
173
|
className: classnames( 'wp-block-page-list', {
|
|
180
174
|
'has-text-color': !! context.textColor,
|
|
@@ -189,68 +183,71 @@ export default function PageListEdit( {
|
|
|
189
183
|
style: { ...context.style?.color },
|
|
190
184
|
} );
|
|
191
185
|
|
|
192
|
-
const
|
|
193
|
-
|
|
186
|
+
const pagesTree = useMemo(
|
|
187
|
+
function makePagesTree( parentId = 0, level = 0 ) {
|
|
188
|
+
const childPages = pagesByParentId.get( parentId );
|
|
194
189
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return childPages.reduce( ( template, page ) => {
|
|
200
|
-
const hasChildren = pagesByParentId.has( page.id );
|
|
201
|
-
const pageProps = {
|
|
202
|
-
id: page.id,
|
|
203
|
-
label:
|
|
204
|
-
// translators: displayed when a page has an empty title.
|
|
205
|
-
page.title?.rendered?.trim() !== ''
|
|
206
|
-
? page.title?.rendered
|
|
207
|
-
: __( '(no title)' ),
|
|
208
|
-
title: page.title?.rendered,
|
|
209
|
-
link: page.url,
|
|
210
|
-
hasChildren,
|
|
211
|
-
};
|
|
212
|
-
let item = null;
|
|
213
|
-
const children = getBlockList( page.id );
|
|
214
|
-
item = createBlock( 'core/page-list-item', pageProps, children );
|
|
215
|
-
template.push( item );
|
|
216
|
-
|
|
217
|
-
return template;
|
|
218
|
-
}, [] );
|
|
219
|
-
};
|
|
190
|
+
if ( ! childPages?.length ) {
|
|
191
|
+
return [];
|
|
192
|
+
}
|
|
220
193
|
|
|
221
|
-
|
|
222
|
-
|
|
194
|
+
return childPages.reduce( ( tree, page ) => {
|
|
195
|
+
const hasChildren = pagesByParentId.has( page.id );
|
|
196
|
+
const item = {
|
|
197
|
+
value: page.id,
|
|
198
|
+
label: '— '.repeat( level ) + page.title.rendered,
|
|
199
|
+
rawName: page.title.rendered,
|
|
200
|
+
};
|
|
201
|
+
tree.push( item );
|
|
202
|
+
if ( hasChildren ) {
|
|
203
|
+
tree.push( ...makePagesTree( page.id, level + 1 ) );
|
|
204
|
+
}
|
|
205
|
+
return tree;
|
|
206
|
+
}, [] );
|
|
207
|
+
},
|
|
208
|
+
[ pagesByParentId ]
|
|
209
|
+
);
|
|
223
210
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
211
|
+
const blockList = useMemo(
|
|
212
|
+
function getBlockList( parentId = parentPageID ) {
|
|
213
|
+
const childPages = pagesByParentId.get( parentId );
|
|
227
214
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
const item = {
|
|
231
|
-
value: page.id,
|
|
232
|
-
label: '— '.repeat( level ) + page.title.rendered,
|
|
233
|
-
rawName: page.title.rendered,
|
|
234
|
-
};
|
|
235
|
-
tree.push( item );
|
|
236
|
-
if ( hasChildren ) {
|
|
237
|
-
tree.push( ...makePagesTree( page.id, level + 1 ) );
|
|
215
|
+
if ( ! childPages?.length ) {
|
|
216
|
+
return [];
|
|
238
217
|
}
|
|
239
|
-
return tree;
|
|
240
|
-
}, [] );
|
|
241
|
-
};
|
|
242
218
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
219
|
+
return childPages.reduce( ( template, page ) => {
|
|
220
|
+
const hasChildren = pagesByParentId.has( page.id );
|
|
221
|
+
const pageProps = {
|
|
222
|
+
id: page.id,
|
|
223
|
+
label:
|
|
224
|
+
// translators: displayed when a page has an empty title.
|
|
225
|
+
page.title?.rendered?.trim() !== ''
|
|
226
|
+
? page.title?.rendered
|
|
227
|
+
: __( '(no title)' ),
|
|
228
|
+
title: page.title?.rendered,
|
|
229
|
+
link: page.url,
|
|
230
|
+
hasChildren,
|
|
231
|
+
};
|
|
232
|
+
let item = null;
|
|
233
|
+
const children = getBlockList( page.id );
|
|
234
|
+
item = createBlock(
|
|
235
|
+
'core/page-list-item',
|
|
236
|
+
pageProps,
|
|
237
|
+
children
|
|
238
|
+
);
|
|
239
|
+
template.push( item );
|
|
240
|
+
|
|
241
|
+
return template;
|
|
242
|
+
}, [] );
|
|
243
|
+
},
|
|
244
|
+
[ pagesByParentId, parentPageID ]
|
|
245
|
+
);
|
|
249
246
|
|
|
250
247
|
const {
|
|
251
248
|
isNested,
|
|
252
249
|
hasSelectedChild,
|
|
253
|
-
|
|
250
|
+
parentClientId,
|
|
254
251
|
hasDraggedChild,
|
|
255
252
|
isChildOfNavigation,
|
|
256
253
|
} = useSelect(
|
|
@@ -258,7 +255,6 @@ export default function PageListEdit( {
|
|
|
258
255
|
const {
|
|
259
256
|
getBlockParentsByBlockName,
|
|
260
257
|
hasSelectedInnerBlock,
|
|
261
|
-
getBlockRootClientId,
|
|
262
258
|
hasDraggedInnerBlock,
|
|
263
259
|
} = select( blockEditorStore );
|
|
264
260
|
const blockParents = getBlockParentsByBlockName(
|
|
@@ -276,12 +272,19 @@ export default function PageListEdit( {
|
|
|
276
272
|
isChildOfNavigation: navigationBlockParents.length > 0,
|
|
277
273
|
hasSelectedChild: hasSelectedInnerBlock( clientId, true ),
|
|
278
274
|
hasDraggedChild: hasDraggedInnerBlock( clientId, true ),
|
|
279
|
-
|
|
275
|
+
parentClientId: navigationBlockParents[ 0 ],
|
|
280
276
|
};
|
|
281
277
|
},
|
|
282
278
|
[ clientId ]
|
|
283
279
|
);
|
|
284
280
|
|
|
281
|
+
const convertToNavigationLinks = useConvertToNavigationLinks( {
|
|
282
|
+
clientId,
|
|
283
|
+
pages,
|
|
284
|
+
parentClientId,
|
|
285
|
+
parentPageID,
|
|
286
|
+
} );
|
|
287
|
+
|
|
285
288
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
286
289
|
allowedBlocks: [ 'core/page-list-item' ],
|
|
287
290
|
renderAppender: false,
|
|
@@ -297,12 +300,12 @@ export default function PageListEdit( {
|
|
|
297
300
|
useEffect( () => {
|
|
298
301
|
if ( hasSelectedChild || hasDraggedChild ) {
|
|
299
302
|
openModal();
|
|
300
|
-
selectBlock(
|
|
303
|
+
selectBlock( parentClientId );
|
|
301
304
|
}
|
|
302
305
|
}, [
|
|
303
306
|
hasSelectedChild,
|
|
304
307
|
hasDraggedChild,
|
|
305
|
-
|
|
308
|
+
parentClientId,
|
|
306
309
|
selectBlock,
|
|
307
310
|
openModal,
|
|
308
311
|
] );
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { createBlock } from '@wordpress/blocks';
|
|
5
|
-
import {
|
|
5
|
+
import { useDispatch } from '@wordpress/data';
|
|
6
6
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -116,28 +116,11 @@ export function convertToNavigationLinks( pages = [], parentPageID = null ) {
|
|
|
116
116
|
export function useConvertToNavigationLinks( {
|
|
117
117
|
clientId,
|
|
118
118
|
pages,
|
|
119
|
+
parentClientId,
|
|
119
120
|
parentPageID,
|
|
120
121
|
} ) {
|
|
121
122
|
const { replaceBlock, selectBlock } = useDispatch( blockEditorStore );
|
|
122
123
|
|
|
123
|
-
const { parentNavBlockClientId } = useSelect(
|
|
124
|
-
( select ) => {
|
|
125
|
-
const { getSelectedBlockClientId, getBlockParentsByBlockName } =
|
|
126
|
-
select( blockEditorStore );
|
|
127
|
-
|
|
128
|
-
const _selectedBlockClientId = getSelectedBlockClientId();
|
|
129
|
-
|
|
130
|
-
return {
|
|
131
|
-
parentNavBlockClientId: getBlockParentsByBlockName(
|
|
132
|
-
_selectedBlockClientId,
|
|
133
|
-
'core/navigation',
|
|
134
|
-
true
|
|
135
|
-
)[ 0 ],
|
|
136
|
-
};
|
|
137
|
-
},
|
|
138
|
-
[ clientId ]
|
|
139
|
-
);
|
|
140
|
-
|
|
141
124
|
return () => {
|
|
142
125
|
const navigationLinks = convertToNavigationLinks( pages, parentPageID );
|
|
143
126
|
|
|
@@ -145,6 +128,6 @@ export function useConvertToNavigationLinks( {
|
|
|
145
128
|
replaceBlock( clientId, navigationLinks );
|
|
146
129
|
|
|
147
130
|
// Select the Navigation block to reveal the changes.
|
|
148
|
-
selectBlock(
|
|
131
|
+
selectBlock( parentClientId );
|
|
149
132
|
};
|
|
150
133
|
}
|
package/src/paragraph/block.json
CHANGED
|
@@ -639,4 +639,30 @@ describe( 'Paragraph block', () => {
|
|
|
639
639
|
);
|
|
640
640
|
expect( contrastCheckElement ).toBeDefined();
|
|
641
641
|
} );
|
|
642
|
+
|
|
643
|
+
it( 'should highlight text with selection', async () => {
|
|
644
|
+
// Arrange
|
|
645
|
+
const screen = await initializeEditor( { withGlobalStyles: true } );
|
|
646
|
+
await addBlock( screen, 'Paragraph' );
|
|
647
|
+
|
|
648
|
+
// Act
|
|
649
|
+
const paragraphBlock = getBlock( screen, 'Paragraph' );
|
|
650
|
+
fireEvent.press( paragraphBlock );
|
|
651
|
+
const paragraphTextInput =
|
|
652
|
+
within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
|
|
653
|
+
typeInRichText(
|
|
654
|
+
paragraphTextInput,
|
|
655
|
+
'A quick brown fox jumps over the lazy dog.',
|
|
656
|
+
{ finalSelectionStart: 2, finalSelectionEnd: 7 }
|
|
657
|
+
);
|
|
658
|
+
fireEvent.press( screen.getByLabelText( 'Text color' ) );
|
|
659
|
+
fireEvent.press( await screen.findByLabelText( 'Tertiary' ) );
|
|
660
|
+
|
|
661
|
+
// Assert
|
|
662
|
+
expect( getEditorHtml() ).toMatchInlineSnapshot( `
|
|
663
|
+
"<!-- wp:paragraph -->
|
|
664
|
+
<p>A <mark style="background-color:rgba(0, 0, 0, 0);color:#2411a4" class="has-inline-color has-tertiary-color">quick</mark> brown fox jumps over the lazy dog.</p>
|
|
665
|
+
<!-- /wp:paragraph -->"
|
|
666
|
+
` );
|
|
667
|
+
} );
|
|
642
668
|
} );
|
|
@@ -97,11 +97,13 @@ function render_block_core_post_template( $attributes, $content, $block ) {
|
|
|
97
97
|
$context['postId'] = $post_id;
|
|
98
98
|
return $context;
|
|
99
99
|
};
|
|
100
|
-
|
|
100
|
+
|
|
101
|
+
// Use an early priority to so that other 'render_block_context' filters have access to the values.
|
|
102
|
+
add_filter( 'render_block_context', $filter_block_context, 1 );
|
|
101
103
|
// Render the inner blocks of the Post Template block with `dynamic` set to `false` to prevent calling
|
|
102
104
|
// `render_callback` and ensure that no wrapper markup is included.
|
|
103
105
|
$block_content = ( new WP_Block( $block_instance ) )->render( array( 'dynamic' => false ) );
|
|
104
|
-
remove_filter( 'render_block_context', $filter_block_context );
|
|
106
|
+
remove_filter( 'render_block_context', $filter_block_context, 1 );
|
|
105
107
|
|
|
106
108
|
// Wrap the render inner blocks in a `li` element with the appropriate post classes.
|
|
107
109
|
$post_classes = implode( ' ', get_post_class( 'wp-block-post' ) );
|
package/src/post-title/index.php
CHANGED
|
@@ -19,8 +19,11 @@ function render_block_core_post_title( $attributes, $content, $block ) {
|
|
|
19
19
|
return '';
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The `$post` argument is intentionally omitted so that changes are reflected when previewing a post.
|
|
24
|
+
* See: https://github.com/WordPress/gutenberg/pull/37622#issuecomment-1000932816.
|
|
25
|
+
*/
|
|
26
|
+
$title = get_the_title();
|
|
24
27
|
|
|
25
28
|
if ( ! $title ) {
|
|
26
29
|
return '';
|
|
@@ -33,7 +36,7 @@ function render_block_core_post_title( $attributes, $content, $block ) {
|
|
|
33
36
|
|
|
34
37
|
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
|
|
35
38
|
$rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
|
|
36
|
-
$title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $
|
|
39
|
+
$title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $block->context['postId'] ), esc_attr( $attributes['linkTarget'] ), $rel, $title );
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
$classes = array();
|
|
@@ -39,6 +39,7 @@ exports[`Preformatted should match snapshot when content is empty 1`] = `
|
|
|
39
39
|
onSelectionChange={[Function]}
|
|
40
40
|
placeholder="Write preformatted text…"
|
|
41
41
|
placeholderTextColor="gray"
|
|
42
|
+
selectionColor="black"
|
|
42
43
|
triggerKeyCodes={[]}
|
|
43
44
|
value=""
|
|
44
45
|
/>
|
|
@@ -85,6 +86,7 @@ exports[`Preformatted should match snapshot when content is not empty 1`] = `
|
|
|
85
86
|
onSelectionChange={[Function]}
|
|
86
87
|
placeholder="Write preformatted text…"
|
|
87
88
|
placeholderTextColor="gray"
|
|
89
|
+
selectionColor="black"
|
|
88
90
|
triggerKeyCodes={[]}
|
|
89
91
|
value="<pre>Hello World!</pre>"
|
|
90
92
|
/>
|
|
@@ -34,20 +34,23 @@ export default function QueryPaginationEdit( {
|
|
|
34
34
|
setAttributes,
|
|
35
35
|
clientId,
|
|
36
36
|
} ) {
|
|
37
|
-
const hasNextPreviousBlocks = useSelect(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
const hasNextPreviousBlocks = useSelect(
|
|
38
|
+
( select ) => {
|
|
39
|
+
const { getBlocks } = select( blockEditorStore );
|
|
40
|
+
const innerBlocks = getBlocks( clientId );
|
|
41
|
+
/**
|
|
42
|
+
* Show the `paginationArrow` and `showLabel` controls only if a
|
|
43
|
+
* `QueryPaginationNext/Previous` block exists.
|
|
44
|
+
*/
|
|
45
|
+
return innerBlocks?.find( ( innerBlock ) => {
|
|
46
|
+
return [
|
|
47
|
+
'core/query-pagination-next',
|
|
48
|
+
'core/query-pagination-previous',
|
|
49
|
+
].includes( innerBlock.name );
|
|
50
|
+
} );
|
|
51
|
+
},
|
|
52
|
+
[ clientId ]
|
|
53
|
+
);
|
|
51
54
|
const blockProps = useBlockProps();
|
|
52
55
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
53
56
|
template: TEMPLATE,
|
package/src/query-title/edit.js
CHANGED
|
@@ -13,9 +13,11 @@ import {
|
|
|
13
13
|
useBlockProps,
|
|
14
14
|
Warning,
|
|
15
15
|
HeadingLevelDropdown,
|
|
16
|
+
store as blockEditorStore,
|
|
16
17
|
} from '@wordpress/block-editor';
|
|
17
18
|
import { ToggleControl, PanelBody } from '@wordpress/components';
|
|
18
|
-
import { __ } from '@wordpress/i18n';
|
|
19
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
20
|
+
import { useSelect } from '@wordpress/data';
|
|
19
21
|
|
|
20
22
|
const SUPPORTED_TYPES = [ 'archive', 'search' ];
|
|
21
23
|
|
|
@@ -23,6 +25,18 @@ export default function QueryTitleEdit( {
|
|
|
23
25
|
attributes: { type, level, textAlign, showPrefix, showSearchTerm },
|
|
24
26
|
setAttributes,
|
|
25
27
|
} ) {
|
|
28
|
+
const { archiveTypeTitle, archiveNameLabel } = useSelect( ( select ) => {
|
|
29
|
+
const { getSettings } = select( blockEditorStore );
|
|
30
|
+
const {
|
|
31
|
+
__experimentalArchiveTitleNameLabel,
|
|
32
|
+
__experimentalArchiveTitleTypeLabel,
|
|
33
|
+
} = getSettings();
|
|
34
|
+
return {
|
|
35
|
+
archiveTypeTitle: __experimentalArchiveTitleTypeLabel,
|
|
36
|
+
archiveNameLabel: __experimentalArchiveTitleNameLabel,
|
|
37
|
+
};
|
|
38
|
+
} );
|
|
39
|
+
|
|
26
40
|
const TagName = `h${ level }`;
|
|
27
41
|
const blockProps = useBlockProps( {
|
|
28
42
|
className: classnames( 'wp-block-query-title__placeholder', {
|
|
@@ -40,6 +54,38 @@ export default function QueryTitleEdit( {
|
|
|
40
54
|
|
|
41
55
|
let titleElement;
|
|
42
56
|
if ( type === 'archive' ) {
|
|
57
|
+
let title;
|
|
58
|
+
if ( archiveTypeTitle ) {
|
|
59
|
+
if ( showPrefix ) {
|
|
60
|
+
if ( archiveNameLabel ) {
|
|
61
|
+
title = sprintf(
|
|
62
|
+
/* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */
|
|
63
|
+
__( '%1$s: %2$s' ),
|
|
64
|
+
archiveTypeTitle,
|
|
65
|
+
archiveNameLabel
|
|
66
|
+
);
|
|
67
|
+
} else {
|
|
68
|
+
title = sprintf(
|
|
69
|
+
/* translators: %s: Archive type title e.g: "Category", "Tag"... */
|
|
70
|
+
__( '%s: Name' ),
|
|
71
|
+
archiveTypeTitle
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
} else if ( archiveNameLabel ) {
|
|
75
|
+
title = archiveNameLabel;
|
|
76
|
+
} else {
|
|
77
|
+
title = sprintf(
|
|
78
|
+
/* translators: %s: Archive type title e.g: "Category", "Tag"... */
|
|
79
|
+
__( '%s name' ),
|
|
80
|
+
archiveTypeTitle
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
title = showPrefix
|
|
85
|
+
? __( 'Archive type: Name' )
|
|
86
|
+
: __( 'Archive title' );
|
|
87
|
+
}
|
|
88
|
+
|
|
43
89
|
titleElement = (
|
|
44
90
|
<>
|
|
45
91
|
<InspectorControls>
|
|
@@ -54,11 +100,7 @@ export default function QueryTitleEdit( {
|
|
|
54
100
|
/>
|
|
55
101
|
</PanelBody>
|
|
56
102
|
</InspectorControls>
|
|
57
|
-
<TagName { ...blockProps }>
|
|
58
|
-
{ showPrefix
|
|
59
|
-
? __( 'Archive type: Name' )
|
|
60
|
-
: __( 'Archive title' ) }
|
|
61
|
-
</TagName>
|
|
103
|
+
<TagName { ...blockProps }>{ title }</TagName>
|
|
62
104
|
</>
|
|
63
105
|
);
|
|
64
106
|
}
|
package/src/quote/block.json
CHANGED
|
@@ -22,6 +22,16 @@ exports[`Quote block transforms to Group block 1`] = `
|
|
|
22
22
|
<!-- /wp:group -->"
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
|
+
exports[`Quote block transforms to Paragraph block 1`] = `
|
|
26
|
+
"<!-- wp:paragraph -->
|
|
27
|
+
<p>"This will make running your own blog a viable alternative again."</p>
|
|
28
|
+
<!-- /wp:paragraph -->
|
|
29
|
+
|
|
30
|
+
<!-- wp:paragraph -->
|
|
31
|
+
<p>— <a href="https://twitter.com/azumbrunnen_/status/1019347243084800005">Adrian Zumbrunnen</a></p>
|
|
32
|
+
<!-- /wp:paragraph -->"
|
|
33
|
+
`;
|
|
34
|
+
|
|
25
35
|
exports[`Quote block transforms to Pullquote block 1`] = `
|
|
26
36
|
"<!-- wp:pullquote -->
|
|
27
37
|
<figure class="wp-block-pullquote"><blockquote><p>"This will make running your own blog a viable alternative again."</p><cite>— <a href="https://twitter.com/azumbrunnen_/status/1019347243084800005">Adrian Zumbrunnen</a></cite></blockquote></figure>
|
|
@@ -21,7 +21,11 @@ const initialHtml = `
|
|
|
21
21
|
<!-- /wp:quote -->`;
|
|
22
22
|
|
|
23
23
|
const transformsWithInnerBlocks = [ 'Columns', 'Group' ];
|
|
24
|
-
const blockTransforms = [
|
|
24
|
+
const blockTransforms = [
|
|
25
|
+
'Pullquote',
|
|
26
|
+
'Paragraph',
|
|
27
|
+
...transformsWithInnerBlocks,
|
|
28
|
+
];
|
|
25
29
|
|
|
26
30
|
setupCoreBlocks();
|
|
27
31
|
|
package/src/quote/transforms.js
CHANGED
|
@@ -109,6 +109,19 @@ const transforms = {
|
|
|
109
109
|
} );
|
|
110
110
|
},
|
|
111
111
|
},
|
|
112
|
+
{
|
|
113
|
+
type: 'block',
|
|
114
|
+
blocks: [ 'core/paragraph' ],
|
|
115
|
+
transform: ( { citation }, innerBlocks ) =>
|
|
116
|
+
citation
|
|
117
|
+
? [
|
|
118
|
+
...innerBlocks,
|
|
119
|
+
createBlock( 'core/paragraph', {
|
|
120
|
+
content: citation,
|
|
121
|
+
} ),
|
|
122
|
+
]
|
|
123
|
+
: innerBlocks,
|
|
124
|
+
},
|
|
112
125
|
{
|
|
113
126
|
type: 'block',
|
|
114
127
|
blocks: [ 'core/group' ],
|
package/src/rss/edit.js
CHANGED
|
@@ -116,6 +116,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
|
|
|
116
116
|
<PanelBody title={ __( 'Settings' ) }>
|
|
117
117
|
<RangeControl
|
|
118
118
|
__nextHasNoMarginBottom
|
|
119
|
+
__next40pxDefaultSize
|
|
119
120
|
label={ __( 'Number of items' ) }
|
|
120
121
|
value={ itemsToShow }
|
|
121
122
|
onChange={ ( value ) =>
|
|
@@ -146,6 +147,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
|
|
|
146
147
|
{ displayExcerpt && (
|
|
147
148
|
<RangeControl
|
|
148
149
|
__nextHasNoMarginBottom
|
|
150
|
+
__next40pxDefaultSize
|
|
149
151
|
label={ __( 'Max number of words in excerpt' ) }
|
|
150
152
|
value={ excerptLength }
|
|
151
153
|
onChange={ ( value ) =>
|
|
@@ -159,6 +161,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
|
|
|
159
161
|
{ blockLayout === 'grid' && (
|
|
160
162
|
<RangeControl
|
|
161
163
|
__nextHasNoMarginBottom
|
|
164
|
+
__next40pxDefaultSize
|
|
162
165
|
label={ __( 'Columns' ) }
|
|
163
166
|
value={ columns }
|
|
164
167
|
onChange={ ( value ) =>
|
package/src/search/block.json
CHANGED
package/src/search/edit.js
CHANGED
|
@@ -97,8 +97,8 @@ export default function SearchEdit( {
|
|
|
97
97
|
);
|
|
98
98
|
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
99
99
|
useDispatch( blockEditorStore );
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
|
|
101
|
+
if ( insertedInNavigationBlock ) {
|
|
102
102
|
// This side-effect should not create an undo level.
|
|
103
103
|
__unstableMarkNextChangeAsNotPersistent();
|
|
104
104
|
setAttributes( {
|
|
@@ -106,7 +106,8 @@ export default function SearchEdit( {
|
|
|
106
106
|
buttonUseIcon: true,
|
|
107
107
|
buttonPosition: 'button-inside',
|
|
108
108
|
} );
|
|
109
|
-
}
|
|
109
|
+
}
|
|
110
|
+
|
|
110
111
|
const borderRadius = style?.border?.radius;
|
|
111
112
|
const borderProps = useBorderProps( attributes );
|
|
112
113
|
|
package/src/search/index.php
CHANGED
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Dynamically renders the `core/search` block.
|
|
10
10
|
*
|
|
11
|
-
* @param array
|
|
11
|
+
* @param array $attributes The block attributes.
|
|
12
|
+
* @param string $content The saved content.
|
|
13
|
+
* @param WP_Block $block The parsed block.
|
|
12
14
|
*
|
|
13
15
|
* @return string The search block markup.
|
|
14
16
|
*/
|
|
15
|
-
function render_block_core_search( $attributes ) {
|
|
17
|
+
function render_block_core_search( $attributes, $content, $block ) {
|
|
16
18
|
// Older versions of the Search block defaulted the label and buttonText
|
|
17
19
|
// attributes to `__( 'Search' )` meaning that many posts contain `<!--
|
|
18
20
|
// wp:search /-->`. Support these by defaulting an undefined label and
|
|
@@ -70,10 +72,26 @@ function render_block_core_search( $attributes ) {
|
|
|
70
72
|
$input->set_attribute( 'id', $input_id );
|
|
71
73
|
$input->set_attribute( 'value', get_search_query() );
|
|
72
74
|
$input->set_attribute( 'placeholder', $attributes['placeholder'] );
|
|
73
|
-
|
|
75
|
+
|
|
76
|
+
$is_expandable_searchfield = 'button-only' === $button_position && 'expand-searchfield' === $button_behavior;
|
|
77
|
+
if ( $is_expandable_searchfield ) {
|
|
74
78
|
$input->set_attribute( 'aria-hidden', 'true' );
|
|
75
79
|
$input->set_attribute( 'tabindex', '-1' );
|
|
76
|
-
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// If the script already exists, there is no point in removing it from viewScript.
|
|
83
|
+
$view_js_file = 'wp-block-search-view';
|
|
84
|
+
if ( ! wp_script_is( $view_js_file ) ) {
|
|
85
|
+
$script_handles = $block->block_type->view_script_handles;
|
|
86
|
+
|
|
87
|
+
// If the script is not needed, and it is still in the `view_script_handles`, remove it.
|
|
88
|
+
if ( ! $is_expandable_searchfield && in_array( $view_js_file, $script_handles, true ) ) {
|
|
89
|
+
$block->block_type->view_script_handles = array_diff( $script_handles, array( $view_js_file ) );
|
|
90
|
+
}
|
|
91
|
+
// If the script is needed, but it was previously removed, add it again.
|
|
92
|
+
if ( $is_expandable_searchfield && ! in_array( $view_js_file, $script_handles, true ) ) {
|
|
93
|
+
$block->block_type->view_script_handles = array_merge( $script_handles, array( $view_js_file ) );
|
|
94
|
+
}
|
|
77
95
|
}
|
|
78
96
|
}
|
|
79
97
|
|