@wordpress/block-library 7.3.5 → 7.5.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/edit.js +1 -1
- package/build/archives/edit.js.map +1 -1
- package/build/audio/edit.js +4 -16
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js +1 -1
- package/build/audio/edit.native.js.map +1 -1
- package/build/button/edit.native.js +7 -3
- package/build/button/edit.native.js.map +1 -1
- package/build/categories/edit.js +8 -3
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +4 -0
- package/build/categories/index.js.map +1 -1
- package/build/column/index.js +10 -0
- package/build/column/index.js.map +1 -1
- package/build/comment-template/edit.js +1 -3
- package/build/comment-template/edit.js.map +1 -1
- package/build/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
- package/{build-module/comments-query-loop → build/comments}/edit/comments-inspector-controls.js.map +1 -1
- package/build/{comments-query-loop → comments}/edit.js +2 -2
- package/build/comments/edit.js.map +1 -0
- package/build/{comments-query-loop → comments}/index.js +1 -1
- package/build/comments/index.js.map +1 -0
- package/build/{comments-query-loop → comments}/save.js +2 -2
- package/build/comments/save.js.map +1 -0
- package/build/cover/edit.js +4 -71
- package/build/cover/edit.js.map +1 -1
- package/build/cover/edit.native.js +36 -15
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/transforms.js +77 -6
- package/build/cover/transforms.js.map +1 -1
- package/build/cover/use-cover-is-dark.js +81 -0
- package/build/cover/use-cover-is-dark.js.map +1 -0
- package/build/cover/use-cover-is-dark.native.js +60 -0
- package/build/cover/use-cover-is-dark.native.js.map +1 -0
- package/build/embed/edit.js +12 -18
- package/build/embed/edit.js.map +1 -1
- package/build/embed/edit.native.js +1 -7
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/util.js +29 -4
- package/build/embed/util.js.map +1 -1
- package/build/file/inspector.js +2 -4
- package/build/file/inspector.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/v1/edit.js +1 -1
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/heading/transforms.js +8 -4
- package/build/heading/transforms.js.map +1 -1
- package/build/html/edit.js +2 -2
- package/build/html/edit.js.map +1 -1
- package/build/image/edit.js +4 -6
- package/build/image/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 +1 -1
- package/build/image/image.js.map +1 -1
- package/build/index.js +4 -6
- package/build/index.js.map +1 -1
- package/build/index.native.js +14 -3
- package/build/index.native.js.map +1 -1
- package/build/latest-comments/edit.js +1 -1
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/edit.native.js +49 -0
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/loginout/edit.js +1 -1
- package/build/loginout/edit.js.map +1 -1
- package/build/media-text/edit.js +1 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/edit.native.js +1 -1
- package/build/media-text/edit.native.js.map +1 -1
- package/build/navigation/edit/index.js +5 -28
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +5 -4
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/index.js +1 -2
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/view-modal.js +62 -0
- package/build/navigation/view-modal.js.map +1 -0
- package/build/navigation/view.js +1 -34
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +1 -1
- package/build/paragraph/edit.js +10 -0
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/edit.native.js +6 -2
- package/build/paragraph/edit.native.js.map +1 -1
- package/build/paragraph/use-enter.js +94 -0
- package/build/paragraph/use-enter.js.map +1 -0
- package/build/post-author/edit.js +1 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-comment/index.js +1 -1
- package/build/post-comments/edit.js +13 -34
- package/build/post-comments/edit.js.map +1 -1
- package/build/post-comments/index.js +1 -1
- package/build/post-comments-form/edit.js +37 -24
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +48 -0
- package/build/post-comments-form/form.js.map +1 -0
- package/build/post-excerpt/edit.js +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-terms/edit.js +25 -3
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/index.js +8 -0
- package/build/post-terms/index.js.map +1 -1
- package/build/quote/index.js +7 -0
- package/build/quote/index.js.map +1 -1
- package/build/quote/v2/edit.js +11 -3
- package/build/quote/v2/edit.js.map +1 -1
- package/build/rss/edit.js +1 -1
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.js +11 -9
- package/build/search/edit.js.map +1 -1
- package/build/separator/index.js +3 -0
- package/build/separator/index.js.map +1 -1
- package/build/spacer/constants.js +9 -0
- package/build/spacer/constants.js.map +1 -0
- package/build/spacer/controls.js +3 -3
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/controls.native.js +2 -2
- package/build/spacer/controls.native.js.map +1 -1
- package/build/spacer/edit.js +5 -6
- package/build/spacer/edit.js.map +1 -1
- package/build/table/edit.js +8 -2
- package/build/table/edit.js.map +1 -1
- package/build/tag-cloud/edit.js +1 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/video/edit.js +4 -8
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +1 -1
- package/build/video/edit.native.js.map +1 -1
- package/build-module/archives/edit.js +1 -1
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/audio/edit.js +4 -16
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js +1 -1
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/button/edit.native.js +7 -3
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/categories/edit.js +8 -3
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +4 -0
- package/build-module/categories/index.js.map +1 -1
- package/build-module/column/index.js +10 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/comment-template/edit.js +1 -3
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -0
- package/build-module/{comments-query-loop → comments}/edit.js +1 -1
- package/build-module/comments/edit.js.map +1 -0
- package/build-module/{comments-query-loop → comments}/index.js +1 -1
- package/build-module/comments/index.js.map +1 -0
- package/build-module/{comments-query-loop → comments}/save.js +1 -1
- package/build-module/comments/save.js.map +1 -0
- package/build-module/cover/edit.js +4 -71
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/cover/edit.native.js +35 -16
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/transforms.js +74 -6
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/cover/use-cover-is-dark.js +70 -0
- package/build-module/cover/use-cover-is-dark.js.map +1 -0
- package/build-module/cover/use-cover-is-dark.native.js +51 -0
- package/build-module/cover/use-cover-is-dark.native.js.map +1 -0
- package/build-module/embed/edit.js +13 -19
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js +2 -8
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/util.js +25 -3
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/inspector.js +2 -4
- package/build-module/file/inspector.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/v1/edit.js +1 -1
- package/build-module/gallery/v1/edit.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/transforms.js +8 -4
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/html/edit.js +2 -2
- package/build-module/html/edit.js.map +1 -1
- package/build-module/image/edit.js +4 -6
- package/build-module/image/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 +1 -1
- package/build-module/image/image.js.map +1 -1
- package/build-module/index.js +3 -4
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +14 -3
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-comments/edit.js +1 -1
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/edit.native.js +51 -2
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/loginout/edit.js +1 -1
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/media-text/edit.js +1 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/edit.native.js +1 -1
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +6 -28
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +5 -4
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/index.js +1 -2
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/view-modal.js +56 -0
- package/build-module/navigation/view-modal.js.map +1 -0
- package/build-module/navigation/view.js +1 -30
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +1 -1
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +9 -0
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/edit.native.js +6 -2
- package/build-module/paragraph/edit.native.js.map +1 -1
- package/build-module/paragraph/use-enter.js +81 -0
- package/build-module/paragraph/use-enter.js.map +1 -0
- package/build-module/post-author/edit.js +1 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-comment/index.js +1 -1
- package/build-module/post-comments/edit.js +13 -35
- package/build-module/post-comments/edit.js.map +1 -1
- package/build-module/post-comments/index.js +1 -1
- package/build-module/post-comments-form/edit.js +38 -26
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +39 -0
- package/build-module/post-comments-form/form.js.map +1 -0
- package/build-module/post-excerpt/edit.js +1 -1
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +26 -4
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/index.js +8 -0
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/quote/index.js +2 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/v2/edit.js +10 -3
- package/build-module/quote/v2/edit.js.map +1 -1
- package/build-module/rss/edit.js +1 -1
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +11 -9
- package/build-module/search/edit.js.map +1 -1
- package/build-module/separator/index.js +3 -0
- package/build-module/separator/index.js.map +1 -1
- package/build-module/spacer/constants.js +2 -0
- package/build-module/spacer/constants.js.map +1 -0
- package/build-module/spacer/controls.js +2 -2
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/controls.native.js +1 -1
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/spacer/edit.js +1 -1
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/table/edit.js +9 -3
- package/build-module/table/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/video/edit.js +4 -8
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +1 -1
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/{comments-query-loop → comments}/editor-rtl.css +0 -0
- package/build-style/{comments-query-loop → comments}/editor.css +0 -0
- package/build-style/common-rtl.css +32 -0
- package/build-style/common.css +32 -0
- package/build-style/cover/style-rtl.css +0 -4
- package/build-style/cover/style.css +0 -4
- package/build-style/editor-rtl.css +12 -4
- package/build-style/editor.css +12 -4
- package/build-style/navigation/style-rtl.css +3 -0
- package/build-style/navigation/style.css +3 -0
- package/build-style/style-rtl.css +73 -4
- package/build-style/style.css +73 -4
- package/build-style/table/editor-rtl.css +8 -0
- package/build-style/table/editor.css +8 -0
- package/build-style/table/style-rtl.css +38 -0
- package/build-style/table/style.css +38 -0
- package/package.json +28 -28
- package/src/archives/edit.js +1 -1
- package/src/audio/edit.js +3 -8
- package/src/audio/edit.native.js +1 -1
- package/src/button/edit.native.js +6 -3
- package/src/categories/block.json +4 -0
- package/src/categories/edit.js +8 -2
- package/src/categories/index.php +1 -0
- package/src/column/block.json +10 -0
- package/src/comment-template/edit.js +1 -5
- package/src/comment-template/index.php +4 -0
- package/src/{comments-query-loop → comments}/block.json +1 -1
- package/src/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
- package/src/{comments-query-loop → comments}/edit.js +1 -1
- package/src/{comments-query-loop → comments}/editor.scss +0 -0
- package/src/{comments-query-loop → comments}/index.js +0 -0
- package/src/{comments-query-loop → comments}/save.js +1 -3
- package/src/comments-pagination/index.php +4 -0
- package/src/comments-title/index.php +4 -0
- package/src/common.scss +24 -1
- package/src/cover/edit.js +2 -67
- package/src/cover/edit.native.js +40 -13
- package/src/cover/style.native.scss +4 -0
- package/src/cover/style.scss +0 -4
- package/src/cover/test/__snapshots__/edit.native.js.snap +6 -6
- package/src/cover/test/transforms.js +301 -0
- package/src/cover/transforms.js +112 -7
- package/src/cover/use-cover-is-dark.js +71 -0
- package/src/cover/use-cover-is-dark.native.js +51 -0
- package/src/editor.scss +1 -1
- package/src/embed/edit.js +19 -24
- package/src/embed/edit.native.js +9 -14
- package/src/embed/util.js +34 -2
- package/src/file/inspector.js +1 -3
- package/src/gallery/edit.js +1 -1
- package/src/gallery/v1/edit.js +1 -1
- package/src/group/block.json +1 -0
- package/src/heading/transforms.js +4 -3
- package/src/html/edit.js +2 -2
- package/src/image/edit.js +2 -4
- package/src/image/edit.native.js +1 -1
- package/src/image/image.js +1 -1
- package/src/index.js +2 -5
- package/src/index.native.js +12 -2
- package/src/latest-comments/edit.js +1 -1
- package/src/latest-posts/edit.native.js +56 -1
- package/src/loginout/edit.js +1 -1
- package/src/media-text/edit.js +1 -2
- package/src/media-text/edit.native.js +1 -1
- package/src/navigation/block.json +1 -2
- package/src/navigation/edit/index.js +6 -36
- package/src/navigation/edit/unsaved-inner-blocks.js +5 -4
- package/src/navigation/index.php +5 -0
- package/src/navigation/style.scss +3 -0
- package/src/navigation/view-modal.js +68 -0
- package/src/navigation/view.js +0 -35
- package/src/navigation-link/edit.js +1 -1
- package/src/paragraph/edit.js +6 -0
- package/src/paragraph/edit.native.js +13 -1
- package/src/paragraph/use-enter.js +103 -0
- package/src/post-author/edit.js +1 -1
- package/src/post-author/index.php +1 -1
- package/src/post-comment/block.json +1 -1
- package/src/post-comments/block.json +1 -1
- package/src/post-comments/edit.js +13 -43
- package/src/post-comments/index.php +2 -0
- package/src/post-comments-form/edit.js +50 -58
- package/src/post-comments-form/form.js +43 -0
- package/src/post-comments-form/index.php +5 -1
- package/src/post-excerpt/edit.js +1 -1
- package/src/post-terms/block.json +8 -0
- package/src/post-terms/edit.js +28 -1
- package/src/post-terms/index.php +12 -2
- package/src/quote/block.json +1 -0
- package/src/quote/index.js +1 -1
- package/src/quote/v2/edit.js +3 -0
- package/src/rss/edit.js +1 -1
- package/src/search/edit.js +13 -7
- package/src/search/index.php +84 -33
- package/src/separator/block.json +3 -0
- package/src/spacer/constants.js +1 -0
- package/src/spacer/controls.js +2 -2
- package/src/spacer/controls.native.js +1 -1
- package/src/spacer/edit.js +1 -2
- package/src/table/edit.js +11 -2
- package/src/table/editor.scss +13 -0
- package/src/table/style.scss +52 -0
- package/src/tag-cloud/edit.js +1 -1
- package/src/video/edit.js +4 -5
- package/src/video/edit.native.js +1 -1
- package/build/comments-query-loop/edit/comments-inspector-controls.js.map +0 -1
- package/build/comments-query-loop/edit.js.map +0 -1
- package/build/comments-query-loop/index.js.map +0 -1
- package/build/comments-query-loop/save.js.map +0 -1
- package/build/navigation-area/edit.js +0 -110
- package/build/navigation-area/edit.js.map +0 -1
- package/build/navigation-area/index.js +0 -62
- package/build/navigation-area/index.js.map +0 -1
- package/build/navigation-area/inner-blocks.js +0 -34
- package/build/navigation-area/inner-blocks.js.map +0 -1
- package/build/navigation-area/save.js +0 -18
- package/build/navigation-area/save.js.map +0 -1
- package/build-module/comments-query-loop/edit.js.map +0 -1
- package/build-module/comments-query-loop/index.js.map +0 -1
- package/build-module/comments-query-loop/save.js.map +0 -1
- package/build-module/navigation-area/edit.js +0 -94
- package/build-module/navigation-area/edit.js.map +0 -1
- package/build-module/navigation-area/index.js +0 -48
- package/build-module/navigation-area/index.js.map +0 -1
- package/build-module/navigation-area/inner-blocks.js +0 -26
- package/build-module/navigation-area/inner-blocks.js.map +0 -1
- package/build-module/navigation-area/save.js +0 -10
- package/build-module/navigation-area/save.js.map +0 -1
- package/src/navigation-area/block.json +0 -23
- package/src/navigation-area/edit.js +0 -111
- package/src/navigation-area/index.js +0 -26
- package/src/navigation-area/index.php +0 -22
- package/src/navigation-area/inner-blocks.js +0 -24
- package/src/navigation-area/save.js +0 -8
|
@@ -12,7 +12,10 @@ import { compose, withPreferredColorScheme } from '@wordpress/compose';
|
|
|
12
12
|
import { withDispatch, withSelect } from '@wordpress/data';
|
|
13
13
|
import { __ } from '@wordpress/i18n';
|
|
14
14
|
import { postList as icon } from '@wordpress/icons';
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
InspectorControls,
|
|
17
|
+
BlockAlignmentControl,
|
|
18
|
+
} from '@wordpress/block-editor';
|
|
16
19
|
import apiFetch from '@wordpress/api-fetch';
|
|
17
20
|
import {
|
|
18
21
|
Icon,
|
|
@@ -43,6 +46,15 @@ class LatestPostsEdit extends Component {
|
|
|
43
46
|
);
|
|
44
47
|
this.onSetExcerptLength = this.onSetExcerptLength.bind( this );
|
|
45
48
|
this.onSetDisplayPostDate = this.onSetDisplayPostDate.bind( this );
|
|
49
|
+
this.onSetDisplayFeaturedImage = this.onSetDisplayFeaturedImage.bind(
|
|
50
|
+
this
|
|
51
|
+
);
|
|
52
|
+
this.onSetFeaturedImageAlign = this.onSetFeaturedImageAlign.bind(
|
|
53
|
+
this
|
|
54
|
+
);
|
|
55
|
+
this.onSetAddLinkToFeaturedImage = this.onSetAddLinkToFeaturedImage.bind(
|
|
56
|
+
this
|
|
57
|
+
);
|
|
46
58
|
this.onSetOrder = this.onSetOrder.bind( this );
|
|
47
59
|
this.onSetOrderBy = this.onSetOrderBy.bind( this );
|
|
48
60
|
this.onSetPostsToShow = this.onSetPostsToShow.bind( this );
|
|
@@ -95,6 +107,21 @@ class LatestPostsEdit extends Component {
|
|
|
95
107
|
setAttributes( { displayPostDate: value } );
|
|
96
108
|
}
|
|
97
109
|
|
|
110
|
+
onSetDisplayFeaturedImage( value ) {
|
|
111
|
+
const { setAttributes } = this.props;
|
|
112
|
+
setAttributes( { displayFeaturedImage: value } );
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
onSetAddLinkToFeaturedImage( value ) {
|
|
116
|
+
const { setAttributes } = this.props;
|
|
117
|
+
setAttributes( { addLinkToFeaturedImage: value } );
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
onSetFeaturedImageAlign( value ) {
|
|
121
|
+
const { setAttributes } = this.props;
|
|
122
|
+
setAttributes( { featuredImageAlign: value } );
|
|
123
|
+
}
|
|
124
|
+
|
|
98
125
|
onSetOrder( value ) {
|
|
99
126
|
const { setAttributes } = this.props;
|
|
100
127
|
setAttributes( { order: value } );
|
|
@@ -124,6 +151,9 @@ class LatestPostsEdit extends Component {
|
|
|
124
151
|
displayPostContentRadio,
|
|
125
152
|
excerptLength,
|
|
126
153
|
displayPostDate,
|
|
154
|
+
displayFeaturedImage,
|
|
155
|
+
featuredImageAlign,
|
|
156
|
+
addLinkToFeaturedImage,
|
|
127
157
|
order,
|
|
128
158
|
orderBy,
|
|
129
159
|
postsToShow,
|
|
@@ -166,6 +196,31 @@ class LatestPostsEdit extends Component {
|
|
|
166
196
|
onChange={ this.onSetDisplayPostDate }
|
|
167
197
|
/>
|
|
168
198
|
</PanelBody>
|
|
199
|
+
|
|
200
|
+
<PanelBody title={ __( 'Featured image settings' ) }>
|
|
201
|
+
<ToggleControl
|
|
202
|
+
label={ __( 'Display featured image' ) }
|
|
203
|
+
checked={ displayFeaturedImage }
|
|
204
|
+
onChange={ this.onSetDisplayFeaturedImage }
|
|
205
|
+
/>
|
|
206
|
+
{ displayFeaturedImage && (
|
|
207
|
+
<>
|
|
208
|
+
<BlockAlignmentControl
|
|
209
|
+
value={ featuredImageAlign }
|
|
210
|
+
onChange={ this.onSetFeaturedImageAlign }
|
|
211
|
+
controls={ [ 'left', 'center', 'right' ] }
|
|
212
|
+
isBottomSheetControl={ true }
|
|
213
|
+
/>
|
|
214
|
+
<ToggleControl
|
|
215
|
+
label={ __( 'Add link to featured image' ) }
|
|
216
|
+
checked={ addLinkToFeaturedImage }
|
|
217
|
+
onChange={ this.onSetAddLinkToFeaturedImage }
|
|
218
|
+
separatorType={ 'topFullWidth' }
|
|
219
|
+
/>
|
|
220
|
+
</>
|
|
221
|
+
) }
|
|
222
|
+
</PanelBody>
|
|
223
|
+
|
|
169
224
|
<PanelBody title={ __( 'Sorting and filtering' ) }>
|
|
170
225
|
<QueryControls
|
|
171
226
|
{ ...{ order, orderBy } }
|
package/src/loginout/edit.js
CHANGED
|
@@ -11,7 +11,7 @@ export default function LoginOutEdit( { attributes, setAttributes } ) {
|
|
|
11
11
|
return (
|
|
12
12
|
<>
|
|
13
13
|
<InspectorControls>
|
|
14
|
-
<PanelBody title={ __( '
|
|
14
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
15
15
|
<ToggleControl
|
|
16
16
|
label={ __( 'Display login as form' ) }
|
|
17
17
|
checked={ displayLoginAsForm }
|
package/src/media-text/edit.js
CHANGED
|
@@ -46,7 +46,6 @@ const TEMPLATE = [
|
|
|
46
46
|
[
|
|
47
47
|
'core/paragraph',
|
|
48
48
|
{
|
|
49
|
-
fontSize: 'large',
|
|
50
49
|
placeholder: _x( 'Content…', 'content placeholder' ),
|
|
51
50
|
},
|
|
52
51
|
],
|
|
@@ -238,7 +237,7 @@ function MediaTextEdit( { attributes, isSelected, setAttributes } ) {
|
|
|
238
237
|
};
|
|
239
238
|
|
|
240
239
|
const mediaTextGeneralSettings = (
|
|
241
|
-
<PanelBody title={ __( '
|
|
240
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
242
241
|
<ToggleControl
|
|
243
242
|
label={ __( 'Stack on mobile' ) }
|
|
244
243
|
checked={ isStackedOnMobile }
|
|
@@ -186,7 +186,7 @@ class MediaTextEdit extends Component {
|
|
|
186
186
|
|
|
187
187
|
return (
|
|
188
188
|
<InspectorControls>
|
|
189
|
-
<PanelBody title={ __( '
|
|
189
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
190
190
|
<ToggleControl
|
|
191
191
|
label={ __( 'Crop image to fill entire column' ) }
|
|
192
192
|
checked={ imageFill }
|
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
"default": 5
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
"usesContext": [ "navigationArea" ],
|
|
69
68
|
"providesContext": {
|
|
70
69
|
"textColor": "textColor",
|
|
71
70
|
"customTextColor": "customTextColor",
|
|
@@ -117,7 +116,7 @@
|
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
},
|
|
120
|
-
"viewScript": "file:./view.min.js",
|
|
119
|
+
"viewScript": [ "file:./view.min.js", "file:./view-modal.min.js" ],
|
|
121
120
|
"editorStyle": "wp-block-navigation-editor",
|
|
122
121
|
"style": "wp-block-navigation"
|
|
123
122
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { noop } from 'lodash';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -26,7 +25,7 @@ import {
|
|
|
26
25
|
getColorClassName,
|
|
27
26
|
Warning,
|
|
28
27
|
} from '@wordpress/block-editor';
|
|
29
|
-
import { EntityProvider
|
|
28
|
+
import { EntityProvider } from '@wordpress/core-data';
|
|
30
29
|
|
|
31
30
|
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
|
|
32
31
|
import {
|
|
@@ -109,7 +108,6 @@ function Navigation( {
|
|
|
109
108
|
setOverlayBackgroundColor,
|
|
110
109
|
overlayTextColor,
|
|
111
110
|
setOverlayTextColor,
|
|
112
|
-
context: { navigationArea },
|
|
113
111
|
|
|
114
112
|
// These props are used by the navigation editor to override specific
|
|
115
113
|
// navigation block settings.
|
|
@@ -129,34 +127,12 @@ function Navigation( {
|
|
|
129
127
|
hasIcon,
|
|
130
128
|
} = attributes;
|
|
131
129
|
|
|
132
|
-
|
|
133
|
-
setAreaMenu = noop;
|
|
134
|
-
// Navigation areas are deprecated and on their way out. Let's not perform
|
|
135
|
-
// the request unless we're in an environment where the endpoint exists.
|
|
136
|
-
if ( process.env.IS_GUTENBERG_PLUGIN ) {
|
|
137
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
138
|
-
[ areaMenu, setAreaMenu ] = useEntityProp(
|
|
139
|
-
'root',
|
|
140
|
-
'navigationArea',
|
|
141
|
-
'navigation',
|
|
142
|
-
navigationArea
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const navigationAreaMenu = areaMenu === 0 ? undefined : areaMenu;
|
|
147
|
-
|
|
148
|
-
const ref = navigationArea ? navigationAreaMenu : attributes.ref;
|
|
130
|
+
const ref = attributes.ref;
|
|
149
131
|
|
|
150
132
|
const registry = useRegistry();
|
|
151
|
-
const setRef =
|
|
152
|
-
( postId )
|
|
153
|
-
|
|
154
|
-
if ( navigationArea ) {
|
|
155
|
-
setAreaMenu( postId );
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
[ navigationArea ]
|
|
159
|
-
);
|
|
133
|
+
const setRef = ( postId ) => {
|
|
134
|
+
setAttributes( { ref: postId } );
|
|
135
|
+
};
|
|
160
136
|
|
|
161
137
|
const [ hasAlreadyRendered, RecursionProvider ] = useNoRecursiveRenders(
|
|
162
138
|
`navigationMenu/${ ref }`
|
|
@@ -261,8 +237,6 @@ function Navigation( {
|
|
|
261
237
|
setHasSavedUnsavedInnerBlocks,
|
|
262
238
|
] = useState( false );
|
|
263
239
|
|
|
264
|
-
const isWithinUnassignedArea = !! navigationArea && ! ref;
|
|
265
|
-
|
|
266
240
|
const [ isResponsiveMenuOpen, setResponsiveMenuVisibility ] = useState(
|
|
267
241
|
false
|
|
268
242
|
);
|
|
@@ -322,13 +296,12 @@ function Navigation( {
|
|
|
322
296
|
// - there is no classic menu conversion process in progress.
|
|
323
297
|
// - there is no menu creation process in progress.
|
|
324
298
|
// - there are no uncontrolled blocks.
|
|
325
|
-
// - (legacy) there is a Navigation Area without a ref attribute pointing to a Navigation Post.
|
|
326
299
|
const isPlaceholder =
|
|
327
300
|
! ref &&
|
|
328
301
|
! isCreatingNavigationMenu &&
|
|
329
302
|
! isConvertingClassicMenu &&
|
|
330
303
|
hasResolvedNavigationMenus &&
|
|
331
|
-
|
|
304
|
+
! hasUncontrolledInnerBlocks;
|
|
332
305
|
|
|
333
306
|
const isEntityAvailable =
|
|
334
307
|
! isNavigationMenuMissing && isNavigationMenuResolved;
|
|
@@ -567,9 +540,6 @@ function Navigation( {
|
|
|
567
540
|
|
|
568
541
|
const resetToEmptyBlock = useCallback( () => {
|
|
569
542
|
registry.batch( () => {
|
|
570
|
-
if ( navigationArea ) {
|
|
571
|
-
setAreaMenu( 0 );
|
|
572
|
-
}
|
|
573
543
|
setAttributes( {
|
|
574
544
|
ref: undefined,
|
|
575
545
|
} );
|
|
@@ -123,7 +123,7 @@ export default function UnsavedInnerBlocks( {
|
|
|
123
123
|
);
|
|
124
124
|
|
|
125
125
|
// Automatically save the uncontrolled blocks.
|
|
126
|
-
useEffect(
|
|
126
|
+
useEffect( () => {
|
|
127
127
|
// The block will be disabled when used in a BlockPreview.
|
|
128
128
|
// In this case avoid automatic creation of a wp_navigation post.
|
|
129
129
|
// Otherwise the user will be spammed with lots of menus!
|
|
@@ -150,9 +150,10 @@ export default function UnsavedInnerBlocks( {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
savingLock.current = true;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
createNavigationMenu( null, blocks ).then( ( menu ) => {
|
|
154
|
+
onSave( menu );
|
|
155
|
+
savingLock.current = false;
|
|
156
|
+
} );
|
|
156
157
|
}, [
|
|
157
158
|
isDisabled,
|
|
158
159
|
isSaving,
|
package/src/navigation/index.php
CHANGED
|
@@ -396,6 +396,11 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
|
|
396
396
|
wp_enqueue_script( 'wp-block-navigation-view' );
|
|
397
397
|
}
|
|
398
398
|
|
|
399
|
+
$should_load_modal_view_script = isset( $attributes['overlayMenu'] ) && 'never' !== $attributes['overlayMenu'];
|
|
400
|
+
if ( $should_load_modal_view_script ) {
|
|
401
|
+
wp_enqueue_script( 'wp-block-navigation-view-modal' );
|
|
402
|
+
}
|
|
403
|
+
|
|
399
404
|
$inner_blocks = $block->inner_blocks;
|
|
400
405
|
|
|
401
406
|
// Ensure that blocks saved with the legacy ref attribute name (navigationMenuId) continue to render.
|
|
@@ -299,6 +299,9 @@ button.wp-block-navigation-item__content {
|
|
|
299
299
|
font-size: inherit;
|
|
300
300
|
font-family: inherit;
|
|
301
301
|
line-height: inherit;
|
|
302
|
+
font-style: inherit;
|
|
303
|
+
font-weight: inherit;
|
|
304
|
+
text-transform: inherit;
|
|
302
305
|
|
|
303
306
|
// Buttons default to center alignment. This becomes visible
|
|
304
307
|
// when a menu item label is long enough to wrap.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import MicroModal from 'micromodal';
|
|
5
|
+
|
|
6
|
+
// Responsive navigation toggle.
|
|
7
|
+
function navigationToggleModal( modal ) {
|
|
8
|
+
const dialogContainer = modal.querySelector(
|
|
9
|
+
`.wp-block-navigation__responsive-dialog`
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
const isHidden = 'true' === modal.getAttribute( 'aria-hidden' );
|
|
13
|
+
|
|
14
|
+
modal.classList.toggle( 'has-modal-open', ! isHidden );
|
|
15
|
+
dialogContainer.toggleAttribute( 'aria-modal', ! isHidden );
|
|
16
|
+
|
|
17
|
+
if ( isHidden ) {
|
|
18
|
+
dialogContainer.removeAttribute( 'role' );
|
|
19
|
+
dialogContainer.removeAttribute( 'aria-modal' );
|
|
20
|
+
} else {
|
|
21
|
+
dialogContainer.setAttribute( 'role', 'dialog' );
|
|
22
|
+
dialogContainer.setAttribute( 'aria-modal', 'true' );
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Add a class to indicate the modal is open.
|
|
26
|
+
const htmlElement = document.documentElement;
|
|
27
|
+
htmlElement.classList.toggle( 'has-modal-open' );
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
window.addEventListener( 'load', () => {
|
|
31
|
+
MicroModal.init( {
|
|
32
|
+
onShow: navigationToggleModal,
|
|
33
|
+
onClose: navigationToggleModal,
|
|
34
|
+
openClass: 'is-menu-open',
|
|
35
|
+
} );
|
|
36
|
+
|
|
37
|
+
// Close modal automatically on clicking anchor links inside modal.
|
|
38
|
+
const navigationLinks = document.querySelectorAll(
|
|
39
|
+
'.wp-block-navigation-item__content'
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
navigationLinks.forEach( function ( link ) {
|
|
43
|
+
// Ignore non-anchor links and anchor links which open on a new tab.
|
|
44
|
+
if (
|
|
45
|
+
! link.getAttribute( 'href' )?.startsWith( '#' ) ||
|
|
46
|
+
link.attributes?.target === '_blank'
|
|
47
|
+
) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Find the specific parent modal for this link
|
|
52
|
+
// since .close() won't work without an ID if there are
|
|
53
|
+
// multiple navigation menus in a post/page.
|
|
54
|
+
const modal = link.closest(
|
|
55
|
+
'.wp-block-navigation__responsive-container'
|
|
56
|
+
);
|
|
57
|
+
const modalId = modal?.getAttribute( 'id' );
|
|
58
|
+
|
|
59
|
+
link.addEventListener( 'click', () => {
|
|
60
|
+
// check if modal exists and is open before trying to close it
|
|
61
|
+
// otherwise Micromodal will toggle the `has-modal-open` class
|
|
62
|
+
// on the html tag which prevents scrolling
|
|
63
|
+
if ( modalId && modal.classList.contains( 'has-modal-open' ) ) {
|
|
64
|
+
MicroModal.close( modalId );
|
|
65
|
+
}
|
|
66
|
+
} );
|
|
67
|
+
} );
|
|
68
|
+
} );
|
package/src/navigation/view.js
CHANGED
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import MicroModal from 'micromodal';
|
|
5
|
-
|
|
6
|
-
// Responsive navigation toggle.
|
|
7
|
-
function navigationToggleModal( modal ) {
|
|
8
|
-
const dialogContainer = modal.querySelector(
|
|
9
|
-
`.wp-block-navigation__responsive-dialog`
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
const isHidden = 'true' === modal.getAttribute( 'aria-hidden' );
|
|
13
|
-
|
|
14
|
-
modal.classList.toggle( 'has-modal-open', ! isHidden );
|
|
15
|
-
dialogContainer.toggleAttribute( 'aria-modal', ! isHidden );
|
|
16
|
-
|
|
17
|
-
if ( isHidden ) {
|
|
18
|
-
dialogContainer.removeAttribute( 'role' );
|
|
19
|
-
dialogContainer.removeAttribute( 'aria-modal' );
|
|
20
|
-
} else {
|
|
21
|
-
dialogContainer.setAttribute( 'role', 'dialog' );
|
|
22
|
-
dialogContainer.setAttribute( 'aria-modal', 'true' );
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Add a class to indicate the modal is open.
|
|
26
|
-
const htmlElement = document.documentElement;
|
|
27
|
-
htmlElement.classList.toggle( 'has-modal-open' );
|
|
28
|
-
}
|
|
29
|
-
|
|
30
1
|
// Open on click functionality.
|
|
31
2
|
function closeSubmenus( element ) {
|
|
32
3
|
element
|
|
@@ -65,12 +36,6 @@ function toggleSubmenuOnClick( event ) {
|
|
|
65
36
|
// Necessary for some themes such as TT1 Blocks, where
|
|
66
37
|
// scripts could be loaded before the body.
|
|
67
38
|
window.addEventListener( 'load', () => {
|
|
68
|
-
MicroModal.init( {
|
|
69
|
-
onShow: navigationToggleModal,
|
|
70
|
-
onClose: navigationToggleModal,
|
|
71
|
-
openClass: 'is-menu-open',
|
|
72
|
-
} );
|
|
73
|
-
|
|
74
39
|
const submenuButtons = document.querySelectorAll(
|
|
75
40
|
'.wp-block-navigation-submenu__toggle'
|
|
76
41
|
);
|
package/src/paragraph/edit.js
CHANGED
|
@@ -23,6 +23,11 @@ import {
|
|
|
23
23
|
import { createBlock } from '@wordpress/blocks';
|
|
24
24
|
import { formatLtr } from '@wordpress/icons';
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Internal dependencies
|
|
28
|
+
*/
|
|
29
|
+
import { useOnEnter } from './use-enter';
|
|
30
|
+
|
|
26
31
|
const name = 'core/paragraph';
|
|
27
32
|
|
|
28
33
|
function ParagraphRTLControl( { direction, setDirection } ) {
|
|
@@ -57,6 +62,7 @@ function ParagraphBlock( {
|
|
|
57
62
|
const { align, content, direction, dropCap, placeholder } = attributes;
|
|
58
63
|
const isDropCapFeatureEnabled = useSetting( 'typography.dropCap' );
|
|
59
64
|
const blockProps = useBlockProps( {
|
|
65
|
+
ref: useOnEnter( { clientId, content } ),
|
|
60
66
|
className: classnames( {
|
|
61
67
|
'has-drop-cap': dropCap,
|
|
62
68
|
[ `has-text-align-${ align }` ]: align,
|
|
@@ -14,6 +14,8 @@ import { useSelect } from '@wordpress/data';
|
|
|
14
14
|
|
|
15
15
|
const name = 'core/paragraph';
|
|
16
16
|
|
|
17
|
+
const allowedParentBlockAlignments = [ 'left', 'center', 'right' ];
|
|
18
|
+
|
|
17
19
|
function ParagraphBlock( {
|
|
18
20
|
attributes,
|
|
19
21
|
mergeBlocks,
|
|
@@ -21,6 +23,7 @@ function ParagraphBlock( {
|
|
|
21
23
|
setAttributes,
|
|
22
24
|
style,
|
|
23
25
|
clientId,
|
|
26
|
+
parentBlockAlignment,
|
|
24
27
|
} ) {
|
|
25
28
|
const isRTL = useSelect( ( select ) => {
|
|
26
29
|
return !! select( blockEditorStore ).getSettings().isRTL;
|
|
@@ -40,6 +43,15 @@ function ParagraphBlock( {
|
|
|
40
43
|
const onAlignmentChange = useCallback( ( nextAlign ) => {
|
|
41
44
|
setAttributes( { align: nextAlign } );
|
|
42
45
|
}, [] );
|
|
46
|
+
|
|
47
|
+
const parentTextAlignment = allowedParentBlockAlignments.includes(
|
|
48
|
+
parentBlockAlignment
|
|
49
|
+
)
|
|
50
|
+
? parentBlockAlignment
|
|
51
|
+
: undefined;
|
|
52
|
+
|
|
53
|
+
const textAlignment = align || parentTextAlignment;
|
|
54
|
+
|
|
43
55
|
return (
|
|
44
56
|
<>
|
|
45
57
|
<BlockControls group="block">
|
|
@@ -82,7 +94,7 @@ function ParagraphBlock( {
|
|
|
82
94
|
onReplace={ onReplace }
|
|
83
95
|
onRemove={ onReplace ? () => onReplace( [] ) : undefined }
|
|
84
96
|
placeholder={ placeholder || __( 'Start writing…' ) }
|
|
85
|
-
textAlign={
|
|
97
|
+
textAlign={ textAlignment }
|
|
86
98
|
__unstableEmbedURLOnPaste
|
|
87
99
|
/>
|
|
88
100
|
</>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useRef } from '@wordpress/element';
|
|
5
|
+
import { useRefEffect } from '@wordpress/compose';
|
|
6
|
+
import { ENTER } from '@wordpress/keycodes';
|
|
7
|
+
import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
|
|
8
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
9
|
+
import { hasBlockSupport, createBlock } from '@wordpress/blocks';
|
|
10
|
+
|
|
11
|
+
export function useOnEnter( props ) {
|
|
12
|
+
const { batch } = useRegistry();
|
|
13
|
+
const {
|
|
14
|
+
moveBlocksToPosition,
|
|
15
|
+
replaceInnerBlocks,
|
|
16
|
+
duplicateBlocks,
|
|
17
|
+
insertBlock,
|
|
18
|
+
} = useDispatch( blockEditorStore );
|
|
19
|
+
const {
|
|
20
|
+
getBlockRootClientId,
|
|
21
|
+
getBlockIndex,
|
|
22
|
+
getBlockOrder,
|
|
23
|
+
getBlockName,
|
|
24
|
+
getBlock,
|
|
25
|
+
getNextBlockClientId,
|
|
26
|
+
} = useSelect( blockEditorStore );
|
|
27
|
+
const propsRef = useRef( props );
|
|
28
|
+
propsRef.current = props;
|
|
29
|
+
return useRefEffect( ( element ) => {
|
|
30
|
+
function onKeyDown( event ) {
|
|
31
|
+
if ( event.defaultPrevented ) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if ( event.keyCode !== ENTER ) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const { content, clientId } = propsRef.current;
|
|
40
|
+
|
|
41
|
+
// The paragraph should be empty.
|
|
42
|
+
if ( content.length ) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const wrapperClientId = getBlockRootClientId( clientId );
|
|
47
|
+
|
|
48
|
+
if (
|
|
49
|
+
! hasBlockSupport(
|
|
50
|
+
getBlockName( wrapperClientId ),
|
|
51
|
+
'__experimentalOnEnter',
|
|
52
|
+
false
|
|
53
|
+
)
|
|
54
|
+
) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const order = getBlockOrder( wrapperClientId );
|
|
59
|
+
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
|
|
62
|
+
const position = order.indexOf( clientId );
|
|
63
|
+
|
|
64
|
+
// If it is the last block, exit.
|
|
65
|
+
if ( position === order.length - 1 ) {
|
|
66
|
+
moveBlocksToPosition(
|
|
67
|
+
[ clientId ],
|
|
68
|
+
wrapperClientId,
|
|
69
|
+
getBlockRootClientId( wrapperClientId ),
|
|
70
|
+
getBlockIndex( wrapperClientId ) + 1
|
|
71
|
+
);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// If it is in the middle, split the block in two.
|
|
76
|
+
const wrapperBlock = getBlock( wrapperClientId );
|
|
77
|
+
batch( () => {
|
|
78
|
+
duplicateBlocks( [ wrapperClientId ] );
|
|
79
|
+
const blockIndex = getBlockIndex( wrapperClientId );
|
|
80
|
+
|
|
81
|
+
replaceInnerBlocks(
|
|
82
|
+
wrapperClientId,
|
|
83
|
+
wrapperBlock.innerBlocks.slice( 0, position )
|
|
84
|
+
);
|
|
85
|
+
replaceInnerBlocks(
|
|
86
|
+
getNextBlockClientId( wrapperClientId ),
|
|
87
|
+
wrapperBlock.innerBlocks.slice( position + 1 )
|
|
88
|
+
);
|
|
89
|
+
insertBlock(
|
|
90
|
+
createBlock( 'core/paragraph' ),
|
|
91
|
+
blockIndex + 1,
|
|
92
|
+
getBlockRootClientId( wrapperClientId ),
|
|
93
|
+
true
|
|
94
|
+
);
|
|
95
|
+
} );
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
element.addEventListener( 'keydown', onKeyDown );
|
|
99
|
+
return () => {
|
|
100
|
+
element.removeEventListener( 'keydown', onKeyDown );
|
|
101
|
+
};
|
|
102
|
+
}, [] );
|
|
103
|
+
}
|
package/src/post-author/edit.js
CHANGED
|
@@ -69,7 +69,7 @@ function PostAuthorEdit( {
|
|
|
69
69
|
return (
|
|
70
70
|
<>
|
|
71
71
|
<InspectorControls>
|
|
72
|
-
<PanelBody title={ __( '
|
|
72
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
73
73
|
{ ! isDescendentOfQueryLoop && !! authors?.length && (
|
|
74
74
|
<SelectControl
|
|
75
75
|
label={ __( 'Author' ) }
|
|
@@ -39,7 +39,7 @@ function render_block_core_post_author( $attributes, $content, $block ) {
|
|
|
39
39
|
return sprintf( '<div %1$s>', $wrapper_attributes ) .
|
|
40
40
|
( ! empty( $attributes['showAvatar'] ) ? '<div class="wp-block-post-author__avatar">' . $avatar . '</div>' : '' ) .
|
|
41
41
|
'<div class="wp-block-post-author__content">' .
|
|
42
|
-
( ! empty( $byline ) ? '<p class="wp-block-post-author__byline">' .
|
|
42
|
+
( ! empty( $byline ) ? '<p class="wp-block-post-author__byline">' . wp_kses_post( $byline ) . '</p>' : '' ) .
|
|
43
43
|
'<p class="wp-block-post-author__name">' . get_the_author_meta( 'display_name', $author_id ) . '</p>' .
|
|
44
44
|
( ! empty( $attributes['showBio'] ) ? '<p class="wp-block-post-author__bio">' . get_the_author_meta( 'user_description', $author_id ) . '</p>' : '' ) .
|
|
45
45
|
'</div>' .
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/post-comment",
|
|
5
5
|
"title": "Post Comment (deprecated)",
|
|
6
6
|
"category": "theme",
|
|
7
|
-
"description": "This block is deprecated. Please use the Comments
|
|
7
|
+
"description": "This block is deprecated. Please use the Comments block instead.",
|
|
8
8
|
"textdomain": "default",
|
|
9
9
|
"attributes": {
|
|
10
10
|
"commentId": {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/post-comments",
|
|
5
5
|
"title": "Post Comments (deprecated)",
|
|
6
6
|
"category": "theme",
|
|
7
|
-
"description": "This block is deprecated. Please use the Comments
|
|
7
|
+
"description": "This block is deprecated. Please use the Comments block instead.",
|
|
8
8
|
"textdomain": "default",
|
|
9
9
|
"attributes": {
|
|
10
10
|
"textAlign": {
|