@wordpress/block-library 7.16.0 → 7.18.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 -1
- package/build/archives/edit.js +1 -0
- package/build/archives/edit.js.map +1 -1
- package/build/audio/edit.js +44 -4
- package/build/audio/edit.js.map +1 -1
- package/build/button/edit.js +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/buttons/edit.native.js +1 -1
- package/build/buttons/edit.native.js.map +1 -1
- package/build/comment-template/edit.js +40 -32
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/index.js +6 -2
- package/build/comment-template/index.js.map +1 -1
- package/build/comments/edit/placeholder.js +1 -4
- package/build/comments/edit/placeholder.js.map +1 -1
- package/build/comments/index.js +5 -1
- package/build/comments/index.js.map +1 -1
- package/build/comments-title/edit.js +18 -1
- package/build/comments-title/edit.js.map +1 -1
- package/build/cover/edit/index.js +2 -2
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +3 -7
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit/use-cover-is-dark.js +8 -7
- package/build/cover/edit/use-cover-is-dark.js.map +1 -1
- package/build/embed/deprecated.js +43 -4
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/variations.js +1 -1
- package/build/embed/variations.js.map +1 -1
- package/build/file/deprecated.js +108 -4
- package/build/file/deprecated.js.map +1 -1
- package/build/file/transforms.js +3 -9
- package/build/file/transforms.js.map +1 -1
- package/build/gallery/deprecated.js +148 -23
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/gallery.js +3 -2
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/transforms.js +3 -3
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-image-sizes.js +2 -1
- package/build/gallery/use-image-sizes.js.map +1 -1
- package/build/gallery/v1/edit.js +3 -2
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/group/edit.js +7 -3
- package/build/group/edit.js.map +1 -1
- package/build/image/edit.native.js +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +33 -12
- package/build/image/image.js.map +1 -1
- package/build/image/transforms.js +1 -7
- package/build/image/transforms.js.map +1 -1
- package/build/latest-posts/edit.js +1 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/transforms.js +9 -1
- package/build/list/transforms.js.map +1 -1
- package/build/list/utils.js +4 -8
- package/build/list/utils.js.map +1 -1
- package/build/list-item/edit.js +3 -2
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js +3 -2
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +19 -22
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +24 -10
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/index.js +14 -1
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/utils.js +14 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/navigation/edit/index.js +45 -31
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +3 -5
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +3 -1
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +25 -8
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build/navigation/index.js +4 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigation-link/edit.js +5 -3
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -4
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +29 -10
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +1 -5
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.js +3 -11
- package/build/paragraph/edit.js.map +1 -1
- package/build/pattern/edit.js +11 -4
- package/build/pattern/edit.js.map +1 -1
- package/build/post-comments-count/index.js +4 -0
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/form.js +1 -2
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-comments-form/index.js +4 -0
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +4 -0
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +14 -6
- package/build/post-content/edit.js.map +1 -1
- package/build/pullquote/deprecated.js +6 -6
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +2 -2
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +79 -104
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/search/edit.js +3 -4
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +7 -10
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-tagline/edit.js +21 -9
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-title/edit/index.js +20 -8
- package/build/site-title/edit/index.js.map +1 -1
- package/build/social-link/edit.js +11 -2
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/index.js +3 -0
- package/build/social-link/index.js.map +1 -1
- package/build/spacer/controls.js +3 -7
- package/build/spacer/controls.js.map +1 -1
- package/build/table/deprecated.js +282 -27
- package/build/table/deprecated.js.map +1 -1
- package/build/table/state.js +2 -2
- package/build/table/state.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -4
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/tag-cloud/edit.js +1 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/tag-cloud/index.js +8 -0
- package/build/tag-cloud/index.js.map +1 -1
- package/build/utils/clean-empty-object.js +5 -4
- package/build/utils/clean-empty-object.js.map +1 -1
- package/build/video/deprecated.js +159 -0
- package/build/video/deprecated.js.map +1 -0
- package/build/video/edit.js +41 -5
- package/build/video/edit.js.map +1 -1
- package/build/video/index.js +3 -0
- package/build/video/index.js.map +1 -1
- package/build/video/tracks-editor.js +3 -28
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/archives/edit.js +1 -0
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/audio/edit.js +46 -7
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/button/edit.js +1 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/buttons/edit.native.js +1 -1
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/comment-template/edit.js +38 -30
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/index.js +6 -2
- package/build-module/comment-template/index.js.map +1 -1
- package/build-module/comments/edit/placeholder.js +1 -3
- package/build-module/comments/edit/placeholder.js.map +1 -1
- package/build-module/comments/index.js +5 -1
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments-title/edit.js +18 -2
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/cover/edit/index.js +2 -2
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +4 -8
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit/use-cover-is-dark.js +7 -7
- package/build-module/cover/edit/use-cover-is-dark.js.map +1 -1
- package/build-module/embed/deprecated.js +44 -5
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/variations.js +1 -1
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/deprecated.js +108 -4
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/file/transforms.js +3 -8
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/gallery/deprecated.js +147 -25
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/gallery.js +3 -2
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/transforms.js +4 -4
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-image-sizes.js +3 -2
- package/build-module/gallery/use-image-sizes.js.map +1 -1
- package/build-module/gallery/v1/edit.js +4 -3
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/group/edit.js +7 -3
- package/build-module/group/edit.js.map +1 -1
- package/build-module/image/edit.native.js +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +36 -15
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/transforms.js +1 -6
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -2
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/transforms.js +9 -1
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/utils.js +5 -9
- package/build-module/list/utils.js.map +1 -1
- package/build-module/list-item/edit.js +3 -2
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +3 -2
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +19 -21
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +24 -9
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/index.js +14 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/utils.js +14 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/navigation/edit/index.js +45 -31
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +3 -5
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +3 -1
- 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 +25 -8
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build-module/navigation/index.js +4 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation-link/edit.js +5 -4
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +4 -4
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +29 -10
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +1 -5
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.js +3 -10
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/pattern/edit.js +10 -3
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +4 -0
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/form.js +2 -3
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-comments-form/index.js +4 -0
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +4 -0
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js +14 -6
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/pullquote/deprecated.js +7 -7
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +4 -4
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +81 -102
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/search/edit.js +4 -5
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +8 -11
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-tagline/edit.js +23 -11
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-title/edit/index.js +22 -10
- package/build-module/site-title/edit/index.js.map +1 -1
- package/build-module/social-link/edit.js +11 -2
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/index.js +3 -0
- package/build-module/social-link/index.js.map +1 -1
- package/build-module/spacer/controls.js +4 -8
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/table/deprecated.js +282 -27
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/state.js +3 -3
- package/build-module/table/state.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -3
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/tag-cloud/edit.js +1 -1
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/tag-cloud/index.js +8 -0
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/utils/clean-empty-object.js +5 -5
- package/build-module/utils/clean-empty-object.js.map +1 -1
- package/build-module/video/deprecated.js +147 -0
- package/build-module/video/deprecated.js.map +1 -0
- package/build-module/video/edit.js +45 -9
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/index.js +2 -0
- package/build-module/video/index.js.map +1 -1
- package/build-module/video/tracks-editor.js +4 -29
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/archives/style-rtl.css +4 -0
- package/build-style/archives/style.css +4 -0
- package/build-style/button/style-rtl.css +1 -0
- package/build-style/button/style.css +1 -0
- package/build-style/comment-template/style-rtl.css +1 -0
- package/build-style/comment-template/style.css +1 -0
- package/build-style/comments/editor-rtl.css +1 -0
- package/build-style/comments/editor.css +1 -0
- package/build-style/comments/style-rtl.css +1 -0
- package/build-style/comments/style.css +1 -0
- package/build-style/cover/editor-rtl.css +4 -0
- package/build-style/cover/editor.css +4 -0
- package/build-style/editor-rtl.css +13 -21
- package/build-style/editor.css +13 -21
- package/build-style/group/editor-rtl.css +1 -0
- package/build-style/group/editor.css +1 -0
- package/build-style/image/editor-rtl.css +1 -1
- package/build-style/image/editor.css +1 -1
- package/build-style/navigation/editor-rtl.css +5 -4
- package/build-style/navigation/editor.css +5 -4
- package/build-style/navigation/style-rtl.css +3 -1
- package/build-style/navigation/style.css +3 -1
- package/build-style/paragraph/editor-rtl.css +0 -16
- package/build-style/paragraph/editor.css +0 -16
- package/build-style/post-comments-form/style-rtl.css +3 -0
- package/build-style/post-comments-form/style.css +3 -0
- package/build-style/site-logo/editor-rtl.css +1 -0
- package/build-style/site-logo/editor.css +1 -0
- package/build-style/style-rtl.css +16 -1
- package/build-style/style.css +16 -1
- package/build-style/tag-cloud/style-rtl.css +3 -0
- package/build-style/tag-cloud/style.css +3 -0
- package/package.json +29 -28
- package/src/archives/edit.js +1 -0
- package/src/archives/style.scss +5 -0
- package/src/audio/edit.js +79 -24
- package/src/avatar/index.php +1 -1
- package/src/button/edit.js +1 -1
- package/src/button/style.scss +2 -0
- package/src/buttons/edit.native.js +1 -1
- package/src/code/test/__snapshots__/edit.native.js.snap +13 -0
- package/src/code/test/edit.native.js +46 -32
- package/src/comment-template/block.json +6 -2
- package/src/comment-template/edit.js +47 -34
- package/src/comment-template/style.scss +2 -0
- package/src/comments/block.json +5 -1
- package/src/comments/edit/placeholder.js +1 -7
- package/src/comments/style.scss +2 -0
- package/src/comments-title/edit.js +24 -1
- package/src/cover/edit/index.js +2 -7
- package/src/cover/edit/inspector-controls.js +11 -13
- package/src/cover/edit/use-cover-is-dark.js +11 -11
- package/src/cover/editor.scss +7 -0
- package/src/embed/deprecated.js +53 -26
- package/src/embed/variations.js +1 -1
- package/src/file/deprecated.js +130 -2
- package/src/file/transforms.js +3 -8
- package/src/gallery/deprecated.js +129 -4
- package/src/gallery/gallery.js +2 -0
- package/src/gallery/index.php +19 -10
- package/src/gallery/transforms.js +8 -5
- package/src/gallery/use-image-sizes.js +3 -2
- package/src/gallery/v1/edit.js +4 -3
- package/src/group/edit.js +10 -2
- package/src/group/editor.scss +1 -0
- package/src/image/edit.native.js +1 -1
- package/src/image/editor.scss +4 -1
- package/src/image/image.js +75 -33
- package/src/image/transforms.js +1 -7
- package/src/latest-posts/edit.js +2 -2
- package/src/list/test/edit.native.js +102 -3
- package/src/list/transforms.js +11 -0
- package/src/list/utils.js +3 -11
- package/src/list-item/block.json +14 -1
- package/src/list-item/edit.js +2 -1
- package/src/list-item/edit.native.js +2 -1
- package/src/list-item/hooks/use-merge.js +4 -23
- package/src/list-item/hooks/use-outdent-list-item.js +9 -8
- package/src/navigation/block.json +4 -1
- package/src/navigation/edit/index.js +61 -37
- package/src/navigation/edit/inner-blocks.js +2 -5
- package/src/navigation/edit/unsaved-inner-blocks.js +9 -2
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +32 -5
- package/src/navigation/edit/use-create-navigation-menu.js +2 -5
- package/src/navigation/editor.scss +5 -4
- package/src/navigation/index.php +103 -6
- package/src/navigation/style.scss +3 -1
- package/src/navigation-link/edit.js +6 -5
- package/src/navigation-link/index.php +8 -1
- package/src/navigation-submenu/edit.js +7 -5
- package/src/navigation-submenu/index.php +8 -1
- package/src/page-list/block.json +1 -5
- package/src/page-list/edit.js +36 -22
- package/src/page-list/index.php +8 -6
- package/src/paragraph/edit.js +1 -14
- package/src/paragraph/editor.scss +0 -20
- package/src/pattern/edit.js +10 -3
- package/src/post-comments-count/block.json +4 -0
- package/src/post-comments-form/block.json +4 -0
- package/src/post-comments-form/form.js +2 -3
- package/src/post-comments-form/style.scss +3 -0
- package/src/post-comments-link/block.json +4 -0
- package/src/post-content/edit.js +8 -4
- package/src/pullquote/deprecated.js +7 -7
- package/src/query/edit/inspector-controls/index.js +4 -3
- package/src/query/edit/inspector-controls/taxonomy-controls.js +82 -87
- package/src/rss/index.php +3 -3
- package/src/search/edit.js +7 -2
- package/src/search/index.php +21 -13
- package/src/site-logo/edit.js +12 -10
- package/src/site-logo/editor.scss +1 -0
- package/src/site-tagline/edit.js +25 -18
- package/src/site-title/edit/index.js +26 -12
- package/src/social-link/block.json +3 -0
- package/src/social-link/edit.js +8 -1
- package/src/social-link/index.php +11 -7
- package/src/spacer/controls.js +10 -12
- package/src/table/deprecated.js +587 -348
- package/src/table/state.js +3 -3
- package/src/table-of-contents/edit.js +1 -3
- package/src/tag-cloud/block.json +8 -0
- package/src/tag-cloud/edit.js +1 -1
- package/src/tag-cloud/style.scss +3 -0
- package/src/template-part/index.php +4 -0
- package/src/utils/clean-empty-object.js +5 -6
- package/src/video/deprecated.js +57 -0
- package/src/video/edit.js +71 -23
- package/src/video/index.js +2 -0
- package/src/video/tracks-editor.js +12 -28
- package/build/paragraph/drop-zone.js +0 -99
- package/build/paragraph/drop-zone.js.map +0 -1
- package/build-module/paragraph/drop-zone.js +0 -88
- package/build-module/paragraph/drop-zone.js.map +0 -1
- package/src/paragraph/drop-zone.js +0 -105
package/src/page-list/edit.js
CHANGED
|
@@ -52,50 +52,64 @@ export default function PageListEdit( { context, clientId } ) {
|
|
|
52
52
|
style: { ...context.style?.color },
|
|
53
53
|
} );
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<BlockControls group="other">
|
|
59
|
-
<ToolbarButton title={ __( 'Edit' ) } onClick={ openModal }>
|
|
60
|
-
{ __( 'Edit' ) }
|
|
61
|
-
</ToolbarButton>
|
|
62
|
-
</BlockControls>
|
|
63
|
-
) }
|
|
64
|
-
{ allowConvertToLinks && isOpen && (
|
|
65
|
-
<ConvertToLinksModal
|
|
66
|
-
onClose={ closeModal }
|
|
67
|
-
clientId={ clientId }
|
|
68
|
-
/>
|
|
69
|
-
) }
|
|
70
|
-
{ ! hasResolvedPages && (
|
|
55
|
+
const getBlockContent = () => {
|
|
56
|
+
if ( ! hasResolvedPages ) {
|
|
57
|
+
return (
|
|
71
58
|
<div { ...blockProps }>
|
|
72
59
|
<Spinner />
|
|
73
60
|
</div>
|
|
74
|
-
)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
75
63
|
|
|
76
|
-
|
|
64
|
+
if ( totalPages === null ) {
|
|
65
|
+
return (
|
|
77
66
|
<div { ...blockProps }>
|
|
78
67
|
<Notice status={ 'warning' } isDismissible={ false }>
|
|
79
68
|
{ __( 'Page List: Cannot retrieve Pages.' ) }
|
|
80
69
|
</Notice>
|
|
81
70
|
</div>
|
|
82
|
-
)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
83
73
|
|
|
84
|
-
|
|
74
|
+
if ( totalPages === 0 ) {
|
|
75
|
+
return (
|
|
85
76
|
<div { ...blockProps }>
|
|
86
77
|
<Notice status={ 'info' } isDismissible={ false }>
|
|
87
78
|
{ __( 'Page List: Cannot retrieve Pages.' ) }
|
|
88
79
|
</Notice>
|
|
89
80
|
</div>
|
|
90
|
-
)
|
|
91
|
-
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if ( totalPages > 0 ) {
|
|
85
|
+
return (
|
|
92
86
|
<ul { ...blockProps }>
|
|
93
87
|
<PageItems
|
|
94
88
|
context={ context }
|
|
95
89
|
pagesByParentId={ pagesByParentId }
|
|
96
90
|
/>
|
|
97
91
|
</ul>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<>
|
|
98
|
+
{ allowConvertToLinks && (
|
|
99
|
+
<BlockControls group="other">
|
|
100
|
+
<ToolbarButton title={ __( 'Edit' ) } onClick={ openModal }>
|
|
101
|
+
{ __( 'Edit' ) }
|
|
102
|
+
</ToolbarButton>
|
|
103
|
+
</BlockControls>
|
|
98
104
|
) }
|
|
105
|
+
{ allowConvertToLinks && isOpen && (
|
|
106
|
+
<ConvertToLinksModal
|
|
107
|
+
onClose={ closeModal }
|
|
108
|
+
clientId={ clientId }
|
|
109
|
+
/>
|
|
110
|
+
) }
|
|
111
|
+
|
|
112
|
+
{ getBlockContent() }
|
|
99
113
|
</>
|
|
100
114
|
);
|
|
101
115
|
}
|
package/src/page-list/index.php
CHANGED
|
@@ -119,7 +119,14 @@ function block_core_page_list_build_css_font_sizes( $context ) {
|
|
|
119
119
|
$font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
|
|
120
120
|
} elseif ( $has_custom_font_size ) {
|
|
121
121
|
// Add the custom font size inline style.
|
|
122
|
-
$font_sizes['inline_styles'] = sprintf(
|
|
122
|
+
$font_sizes['inline_styles'] = sprintf(
|
|
123
|
+
'font-size: %s;',
|
|
124
|
+
wp_get_typography_font_size_value(
|
|
125
|
+
array(
|
|
126
|
+
'size' => $context['style']['typography']['fontSize'],
|
|
127
|
+
)
|
|
128
|
+
)
|
|
129
|
+
);
|
|
123
130
|
}
|
|
124
131
|
|
|
125
132
|
return $font_sizes;
|
|
@@ -299,11 +306,6 @@ function render_block_core_page_list( $attributes, $content, $block ) {
|
|
|
299
306
|
|
|
300
307
|
$nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children );
|
|
301
308
|
|
|
302
|
-
// Limit the number of items to be visually displayed.
|
|
303
|
-
if ( ! empty( $attributes['__unstableMaxPages'] ) ) {
|
|
304
|
-
$nested_pages = array_slice( $nested_pages, 0, $attributes['__unstableMaxPages'] );
|
|
305
|
-
}
|
|
306
|
-
|
|
307
309
|
$is_navigation_child = array_key_exists( 'showSubmenuIcon', $block->context );
|
|
308
310
|
|
|
309
311
|
$open_submenus_on_click = array_key_exists( 'openSubmenusOnClick', $block->context ) ? $block->context['openSubmenusOnClick'] : false;
|
package/src/paragraph/edit.js
CHANGED
|
@@ -6,7 +6,6 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useState } from '@wordpress/element';
|
|
10
9
|
import { __, _x, isRTL } from '@wordpress/i18n';
|
|
11
10
|
import {
|
|
12
11
|
ToolbarButton,
|
|
@@ -21,7 +20,6 @@ import {
|
|
|
21
20
|
useBlockProps,
|
|
22
21
|
useSetting,
|
|
23
22
|
} from '@wordpress/block-editor';
|
|
24
|
-
import { useMergeRefs } from '@wordpress/compose';
|
|
25
23
|
import { createBlock } from '@wordpress/blocks';
|
|
26
24
|
import { formatLtr } from '@wordpress/icons';
|
|
27
25
|
|
|
@@ -29,7 +27,6 @@ import { formatLtr } from '@wordpress/icons';
|
|
|
29
27
|
* Internal dependencies
|
|
30
28
|
*/
|
|
31
29
|
import { useOnEnter } from './use-enter';
|
|
32
|
-
import DropZone from './drop-zone';
|
|
33
30
|
|
|
34
31
|
const name = 'core/paragraph';
|
|
35
32
|
|
|
@@ -62,12 +59,8 @@ function ParagraphBlock( {
|
|
|
62
59
|
} ) {
|
|
63
60
|
const { align, content, direction, dropCap, placeholder } = attributes;
|
|
64
61
|
const isDropCapFeatureEnabled = useSetting( 'typography.dropCap' );
|
|
65
|
-
const [ paragraphElement, setParagraphElement ] = useState( null );
|
|
66
62
|
const blockProps = useBlockProps( {
|
|
67
|
-
ref:
|
|
68
|
-
useOnEnter( { clientId, content } ),
|
|
69
|
-
setParagraphElement,
|
|
70
|
-
] ),
|
|
63
|
+
ref: useOnEnter( { clientId, content } ),
|
|
71
64
|
className: classnames( {
|
|
72
65
|
'has-drop-cap': hasDropCapDisabled( align ) ? false : dropCap,
|
|
73
66
|
[ `has-text-align-${ align }` ]: align,
|
|
@@ -130,12 +123,6 @@ function ParagraphBlock( {
|
|
|
130
123
|
</ToolsPanelItem>
|
|
131
124
|
</InspectorControls>
|
|
132
125
|
) }
|
|
133
|
-
{ ! content && (
|
|
134
|
-
<DropZone
|
|
135
|
-
clientId={ clientId }
|
|
136
|
-
paragraphElement={ paragraphElement }
|
|
137
|
-
/>
|
|
138
|
-
) }
|
|
139
126
|
<RichText
|
|
140
127
|
identifier="content"
|
|
141
128
|
tagName="p"
|
|
@@ -17,23 +17,3 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
.components-popover.wp-block-paragraph__drop-zone {
|
|
22
|
-
.components-popover__content {
|
|
23
|
-
border: none;
|
|
24
|
-
outline: none;
|
|
25
|
-
box-shadow: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.wp-block-paragraph__drop-zone-backdrop {
|
|
29
|
-
position: absolute;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.wp-block-paragraph__drop-zone-foreground {
|
|
33
|
-
position: absolute;
|
|
34
|
-
inset: 0;
|
|
35
|
-
pointer-events: none;
|
|
36
|
-
background-color: var(--wp-admin-theme-color);
|
|
37
|
-
border-radius: 2px;
|
|
38
|
-
}
|
|
39
|
-
}
|
package/src/pattern/edit.js
CHANGED
|
@@ -26,10 +26,17 @@ const PatternEdit = ( { attributes, clientId } ) => {
|
|
|
26
26
|
// It will continue to pull from the pattern file unless changes are made to its respective template part.
|
|
27
27
|
useEffect( () => {
|
|
28
28
|
if ( selectedPattern?.blocks ) {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
// We batch updates to block list settings to avoid triggering cascading renders
|
|
30
|
+
// for each container block included in a tree and optimize initial render.
|
|
31
|
+
// Since the above uses microtasks, we need to use a microtask here as well,
|
|
32
|
+
// because nested pattern blocks cannot be inserted if the parent block supports
|
|
33
|
+
// inner blocks but doesn't have blockSettings in the state.
|
|
34
|
+
window.queueMicrotask( () => {
|
|
35
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
36
|
+
replaceBlocks( clientId, selectedPattern.blocks );
|
|
37
|
+
} );
|
|
31
38
|
}
|
|
32
|
-
}, [ selectedPattern?.blocks ] );
|
|
39
|
+
}, [ clientId, selectedPattern?.blocks ] );
|
|
33
40
|
|
|
34
41
|
const props = useBlockProps();
|
|
35
42
|
|
|
@@ -13,18 +13,17 @@ import {
|
|
|
13
13
|
__experimentalGetElementClassName,
|
|
14
14
|
} from '@wordpress/block-editor';
|
|
15
15
|
import { Button } from '@wordpress/components';
|
|
16
|
-
import {
|
|
16
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
17
17
|
import { useEntityProp, store as coreStore } from '@wordpress/core-data';
|
|
18
18
|
import { useSelect } from '@wordpress/data';
|
|
19
19
|
|
|
20
20
|
const CommentsFormPlaceholder = () => {
|
|
21
|
-
const disabledFormRef = useDisabled();
|
|
22
21
|
const instanceId = useInstanceId( CommentsFormPlaceholder );
|
|
23
22
|
|
|
24
23
|
return (
|
|
25
24
|
<div className="comment-respond">
|
|
26
25
|
<h3 className="comment-reply-title">{ __( 'Leave a Reply' ) }</h3>
|
|
27
|
-
<form noValidate className="comment-form"
|
|
26
|
+
<form noValidate className="comment-form" inert="true">
|
|
28
27
|
<p>
|
|
29
28
|
<label htmlFor={ `comment-${ instanceId }` }>
|
|
30
29
|
{ __( 'Comment' ) }
|
package/src/post-content/edit.js
CHANGED
|
@@ -84,8 +84,8 @@ function Content( props ) {
|
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
function Placeholder() {
|
|
88
|
-
const blockProps = useBlockProps();
|
|
87
|
+
function Placeholder( { layoutClassNames } ) {
|
|
88
|
+
const blockProps = useBlockProps( { className: layoutClassNames } );
|
|
89
89
|
return (
|
|
90
90
|
<div { ...blockProps }>
|
|
91
91
|
<p>
|
|
@@ -118,7 +118,11 @@ function RecursionError() {
|
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
export default function PostContentEdit( {
|
|
121
|
+
export default function PostContentEdit( {
|
|
122
|
+
context,
|
|
123
|
+
attributes,
|
|
124
|
+
__unstableLayoutClassNames: layoutClassNames,
|
|
125
|
+
} ) {
|
|
122
126
|
const { postId: contextPostId, postType: contextPostType } = context;
|
|
123
127
|
const { layout = {} } = attributes;
|
|
124
128
|
const hasAlreadyRendered = useHasRecursion( contextPostId );
|
|
@@ -132,7 +136,7 @@ export default function PostContentEdit( { context, attributes } ) {
|
|
|
132
136
|
{ contextPostId && contextPostType ? (
|
|
133
137
|
<Content context={ context } layout={ layout } />
|
|
134
138
|
) : (
|
|
135
|
-
<Placeholder />
|
|
139
|
+
<Placeholder layoutClassNames={ layoutClassNames } />
|
|
136
140
|
) }
|
|
137
141
|
</RecursionProvider>
|
|
138
142
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { get
|
|
5
|
+
import { get } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -140,7 +140,7 @@ const v4 = {
|
|
|
140
140
|
className,
|
|
141
141
|
} = attributes;
|
|
142
142
|
|
|
143
|
-
const isSolidColorStyle = includes(
|
|
143
|
+
const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
|
|
144
144
|
|
|
145
145
|
let figureClasses, figureStyles;
|
|
146
146
|
|
|
@@ -206,7 +206,7 @@ const v4 = {
|
|
|
206
206
|
customTextColor,
|
|
207
207
|
...attributes
|
|
208
208
|
} ) {
|
|
209
|
-
const isSolidColorStyle = includes(
|
|
209
|
+
const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
|
|
210
210
|
let style;
|
|
211
211
|
|
|
212
212
|
if ( customMainColor ) {
|
|
@@ -270,7 +270,7 @@ const v3 = {
|
|
|
270
270
|
figureStyle,
|
|
271
271
|
} = attributes;
|
|
272
272
|
|
|
273
|
-
const isSolidColorStyle = includes(
|
|
273
|
+
const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
|
|
274
274
|
|
|
275
275
|
let figureClasses, figureStyles;
|
|
276
276
|
|
|
@@ -345,7 +345,7 @@ const v3 = {
|
|
|
345
345
|
customTextColor,
|
|
346
346
|
...attributes
|
|
347
347
|
} ) {
|
|
348
|
-
const isSolidColorStyle = includes(
|
|
348
|
+
const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
|
|
349
349
|
let style;
|
|
350
350
|
|
|
351
351
|
if ( customMainColor ) {
|
|
@@ -416,7 +416,7 @@ const v2 = {
|
|
|
416
416
|
citation,
|
|
417
417
|
className,
|
|
418
418
|
} = attributes;
|
|
419
|
-
const isSolidColorStyle = includes(
|
|
419
|
+
const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
|
|
420
420
|
|
|
421
421
|
let figureClass, figureStyles;
|
|
422
422
|
// Is solid color style
|
|
@@ -484,7 +484,7 @@ const v2 = {
|
|
|
484
484
|
customTextColor,
|
|
485
485
|
...attributes
|
|
486
486
|
} ) {
|
|
487
|
-
const isSolidColorStyle = includes(
|
|
487
|
+
const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
|
|
488
488
|
let style = {};
|
|
489
489
|
|
|
490
490
|
if ( customMainColor ) {
|
|
@@ -22,13 +22,14 @@ import { useEffect, useState, useCallback } from '@wordpress/element';
|
|
|
22
22
|
import OrderControl from './order-control';
|
|
23
23
|
import AuthorControl from './author-control';
|
|
24
24
|
import ParentControl from './parent-control';
|
|
25
|
-
import { TaxonomyControls
|
|
25
|
+
import { TaxonomyControls } from './taxonomy-controls';
|
|
26
26
|
import StickyControl from './sticky-control';
|
|
27
27
|
import {
|
|
28
28
|
usePostTypes,
|
|
29
29
|
useIsPostTypeHierarchical,
|
|
30
30
|
useAllowedControls,
|
|
31
31
|
isControlAllowed,
|
|
32
|
+
useTaxonomies,
|
|
32
33
|
} from '../../utils';
|
|
33
34
|
|
|
34
35
|
export default function QueryInspectorControls( {
|
|
@@ -50,7 +51,7 @@ export default function QueryInspectorControls( {
|
|
|
50
51
|
const allowedControls = useAllowedControls( attributes );
|
|
51
52
|
const [ showSticky, setShowSticky ] = useState( postType === 'post' );
|
|
52
53
|
const { postTypesTaxonomiesMap, postTypesSelectOptions } = usePostTypes();
|
|
53
|
-
const
|
|
54
|
+
const taxonomies = useTaxonomies( postType );
|
|
54
55
|
const isPostTypeHierarchical = useIsPostTypeHierarchical( postType );
|
|
55
56
|
useEffect( () => {
|
|
56
57
|
setShowSticky( postType === 'post' );
|
|
@@ -192,7 +193,7 @@ export default function QueryInspectorControls( {
|
|
|
192
193
|
setQuerySearch( '' );
|
|
193
194
|
} }
|
|
194
195
|
>
|
|
195
|
-
{ !!
|
|
196
|
+
{ !! taxonomies?.length &&
|
|
196
197
|
isControlAllowed( allowedControls, 'taxQuery' ) && (
|
|
197
198
|
<ToolsPanelItem
|
|
198
199
|
label={ __( 'Taxonomies' ) }
|
|
@@ -8,14 +8,18 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import { useTaxonomies } from '../../utils';
|
|
12
12
|
import { MAX_FETCHED_TERMS } from '../../constants';
|
|
13
13
|
|
|
14
14
|
// Helper function to get the term id based on user input in terms `FormTokenField`.
|
|
15
|
-
const getTermIdByTermValue = (
|
|
15
|
+
const getTermIdByTermValue = ( terms, termValue ) => {
|
|
16
16
|
// First we check for exact match by `term.id` or case sensitive `term.name` match.
|
|
17
|
-
const termId =
|
|
18
|
-
|
|
17
|
+
const termId =
|
|
18
|
+
termValue?.id || terms.find( ( term ) => term.name === termValue )?.id;
|
|
19
|
+
if ( termId ) {
|
|
20
|
+
return termId;
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
/**
|
|
20
24
|
* Here we make an extra check for entered terms in a non case sensitive way,
|
|
21
25
|
* to match user expectations, due to `FormTokenField` behaviour that shows
|
|
@@ -26,101 +30,92 @@ const getTermIdByTermValue = ( termsMappedByName, termValue ) => {
|
|
|
26
30
|
* In this edge case we always apply the first match from the terms list.
|
|
27
31
|
*/
|
|
28
32
|
const termValueLower = termValue.toLocaleLowerCase();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
}
|
|
33
|
+
return terms.find(
|
|
34
|
+
( term ) => term.name.toLocaleLowerCase() === termValueLower
|
|
35
|
+
)?.id;
|
|
34
36
|
};
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const taxonomiesInfo = useSelect(
|
|
38
|
+
const useTaxonomyTerms = ( slug ) => {
|
|
39
|
+
return useSelect(
|
|
39
40
|
( select ) => {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
name,
|
|
47
|
-
terms: getEntitiesInfo( _terms ),
|
|
48
|
-
};
|
|
49
|
-
} );
|
|
50
|
-
return _taxonomiesInfo;
|
|
41
|
+
const terms = select( coreStore ).getEntityRecords(
|
|
42
|
+
'taxonomy',
|
|
43
|
+
slug,
|
|
44
|
+
{ context: 'view', per_page: MAX_FETCHED_TERMS }
|
|
45
|
+
);
|
|
46
|
+
return { terms };
|
|
51
47
|
},
|
|
52
|
-
[
|
|
48
|
+
[ slug ]
|
|
53
49
|
);
|
|
54
|
-
return taxonomiesInfo;
|
|
55
50
|
};
|
|
56
51
|
|
|
57
52
|
export function TaxonomyControls( { onChange, query } ) {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
53
|
+
const { postType, taxQuery } = query;
|
|
54
|
+
|
|
55
|
+
const taxonomies = useTaxonomies( postType );
|
|
56
|
+
if ( ! taxonomies || taxonomies.length === 0 ) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<>
|
|
62
|
+
{ taxonomies.map( ( taxonomy ) => {
|
|
63
|
+
const value = taxQuery?.[ taxonomy.slug ] || [];
|
|
64
|
+
const handleChange = ( newTermIds ) =>
|
|
65
|
+
onChange( {
|
|
66
|
+
taxQuery: {
|
|
67
|
+
...taxQuery,
|
|
68
|
+
[ taxonomy.slug ]: newTermIds,
|
|
69
|
+
},
|
|
70
|
+
} );
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<TaxonomyItem
|
|
74
|
+
key={ taxonomy.slug }
|
|
75
|
+
taxonomy={ taxonomy }
|
|
76
|
+
value={ value }
|
|
77
|
+
onChange={ handleChange }
|
|
78
|
+
/>
|
|
69
79
|
);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
} ) }
|
|
81
|
+
</>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
function TaxonomyItem( { taxonomy, value, onChange } ) {
|
|
85
|
+
const { terms } = useTaxonomyTerms( taxonomy.slug );
|
|
86
|
+
if ( ! terms?.length ) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const onTermsChange = ( newTermValues ) => {
|
|
91
|
+
const termIds = new Set();
|
|
92
|
+
for ( const termValue of newTermValues ) {
|
|
93
|
+
const termId = getTermIdByTermValue( terms, termValue );
|
|
94
|
+
if ( termId ) {
|
|
95
|
+
termIds.add( termId );
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
onChange( Array.from( termIds ) );
|
|
79
100
|
};
|
|
80
|
-
|
|
101
|
+
|
|
102
|
+
// Selects only the existing term ids in proper format to be
|
|
81
103
|
// used in `FormTokenField`. This prevents the component from
|
|
82
104
|
// crashing in the editor, when non existing term ids were provided.
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
return ( query.taxQuery?.[ taxonomySlug ] || [] ).reduce(
|
|
89
|
-
( accumulator, termId ) => {
|
|
90
|
-
const term = taxonomyInfo.terms.mapById[ termId ];
|
|
91
|
-
if ( term ) {
|
|
92
|
-
accumulator.push( {
|
|
93
|
-
id: termId,
|
|
94
|
-
value: term.name,
|
|
95
|
-
} );
|
|
96
|
-
}
|
|
97
|
-
return accumulator;
|
|
98
|
-
},
|
|
99
|
-
[]
|
|
100
|
-
);
|
|
101
|
-
};
|
|
105
|
+
const taxQueryValue = value
|
|
106
|
+
.map( ( termId ) => terms.find( ( t ) => t.id === termId ) )
|
|
107
|
+
.filter( Boolean )
|
|
108
|
+
.map( ( term ) => ( { id: term.id, value: term.name } ) );
|
|
109
|
+
|
|
102
110
|
return (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
className="block-library-query-inspector__taxonomy-control"
|
|
113
|
-
>
|
|
114
|
-
<FormTokenField
|
|
115
|
-
label={ name }
|
|
116
|
-
value={ getExistingTaxQueryValue( slug ) }
|
|
117
|
-
suggestions={ terms.names }
|
|
118
|
-
onChange={ onTermsChange( slug ) }
|
|
119
|
-
__experimentalShowHowTo={ false }
|
|
120
|
-
/>
|
|
121
|
-
</div>
|
|
122
|
-
);
|
|
123
|
-
} ) }
|
|
124
|
-
</>
|
|
111
|
+
<div className="block-library-query-inspector__taxonomy-control">
|
|
112
|
+
<FormTokenField
|
|
113
|
+
label={ taxonomy.name }
|
|
114
|
+
value={ taxQueryValue }
|
|
115
|
+
suggestions={ terms.map( ( t ) => t.name ) }
|
|
116
|
+
onChange={ onTermsChange }
|
|
117
|
+
__experimentalShowHowTo={ false }
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
125
120
|
);
|
|
126
121
|
}
|
package/src/rss/index.php
CHANGED
|
@@ -20,7 +20,7 @@ function render_block_core_rss( $attributes ) {
|
|
|
20
20
|
$rss = fetch_feed( $attributes['feedURL'] );
|
|
21
21
|
|
|
22
22
|
if ( is_wp_error( $rss ) ) {
|
|
23
|
-
return '<div class="components-placeholder"><div class="notice notice-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . $rss->get_error_message() . '</div></div>';
|
|
23
|
+
return '<div class="components-placeholder"><div class="notice notice-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . esc_html( $rss->get_error_message() ) . '</div></div>';
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
if ( ! $rss->get_item_quantity() ) {
|
|
@@ -48,8 +48,8 @@ function render_block_core_rss( $attributes ) {
|
|
|
48
48
|
if ( $date ) {
|
|
49
49
|
$date = sprintf(
|
|
50
50
|
'<time datetime="%1$s" class="wp-block-rss__item-publish-date">%2$s</time> ',
|
|
51
|
-
date_i18n( get_option( 'c' ), $date ),
|
|
52
|
-
date_i18n( get_option( 'date_format' ), $date )
|
|
51
|
+
esc_attr( date_i18n( get_option( 'c' ), $date ) ),
|
|
52
|
+
esc_attr( date_i18n( get_option( 'date_format' ), $date ) )
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
}
|
package/src/search/edit.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
getTypographyClassesAndStyles as useTypographyProps,
|
|
17
17
|
store as blockEditorStore,
|
|
18
18
|
__experimentalGetElementClassName,
|
|
19
|
+
useSetting,
|
|
19
20
|
} from '@wordpress/block-editor';
|
|
20
21
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
21
22
|
import { useEffect } from '@wordpress/element';
|
|
@@ -113,7 +114,11 @@ export default function SearchEdit( {
|
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
const colorProps = useColorProps( attributes );
|
|
116
|
-
const
|
|
117
|
+
const fluidTypographyEnabled = useSetting( 'typography.fluid' );
|
|
118
|
+
const typographyProps = useTypographyProps(
|
|
119
|
+
attributes,
|
|
120
|
+
fluidTypographyEnabled
|
|
121
|
+
);
|
|
117
122
|
const unitControlInstanceId = useInstanceId( UnitControl );
|
|
118
123
|
const unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;
|
|
119
124
|
const isButtonPositionInside = 'button-inside' === buttonPosition;
|
|
@@ -358,7 +363,7 @@ export default function SearchEdit( {
|
|
|
358
363
|
widthUnit: newUnit,
|
|
359
364
|
} );
|
|
360
365
|
} }
|
|
361
|
-
|
|
366
|
+
__unstableInputWidth={ '80px' }
|
|
362
367
|
value={ `${ width }${ widthUnit }` }
|
|
363
368
|
units={ units }
|
|
364
369
|
/>
|