@wordpress/block-library 7.17.0 → 7.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/audio/edit.js +44 -4
- package/build/audio/edit.js.map +1 -1
- package/build/button/deprecated.js +16 -2
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +14 -8
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +4 -1
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +2 -0
- package/build/button/save.js.map +1 -1
- package/build/buttons/edit.native.js +1 -1
- package/build/buttons/edit.native.js.map +1 -1
- package/build/columns/transforms.js +5 -0
- package/build/columns/transforms.js.map +1 -1
- package/build/comment-template/index.js +6 -2
- package/build/comment-template/index.js.map +1 -1
- package/build/cover/edit/index.js +3 -1
- 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/embed/deprecated.js +43 -4
- package/build/embed/deprecated.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/use-image-sizes.js +2 -1
- package/build/gallery/use-image-sizes.js.map +1 -1
- package/build/gallery/v1/edit.js +6 -3
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/group/edit.js +105 -48
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +3 -0
- package/build/group/index.js.map +1 -1
- package/build/group/placeholder.js +168 -0
- package/build/group/placeholder.js.map +1 -0
- package/build/group/variations.js +3 -3
- package/build/group/variations.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 +6 -9
- package/build/image/image.js.map +1 -1
- package/build/latest-comments/edit.js +2 -1
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-comments/index.js +5 -1
- package/build/latest-comments/index.js.map +1 -1
- package/build/latest-posts/deprecated.js +13 -0
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/edit.js +1 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/index.js +13 -0
- package/build/latest-posts/index.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 +2 -1
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +5 -7
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/navigation/edit/index.js +94 -103
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/manage-menus-button.js +36 -0
- package/build/navigation/edit/manage-menus-button.js.map +1 -0
- package/build/navigation/edit/navigation-menu-selector.js +12 -5
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +2 -6
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +5 -17
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation-link/edit.js +14 -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/post-author/edit.js +35 -20
- package/build/post-author/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/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/post-content/index.js +3 -0
- package/build/post-content/index.js.map +1 -1
- package/build/pullquote/deprecated.js +6 -6
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/search/edit.js +1 -3
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +2 -2
- 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 +1 -1
- package/build/table/state.js.map +1 -1
- package/build/template-part/variations.js +5 -0
- package/build/template-part/variations.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/audio/edit.js +46 -7
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/button/deprecated.js +16 -2
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +16 -10
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +4 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +2 -0
- package/build-module/button/save.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/columns/transforms.js +5 -0
- package/build-module/columns/transforms.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/cover/edit/index.js +3 -1
- 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/embed/deprecated.js +44 -5
- package/build-module/embed/deprecated.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/use-image-sizes.js +3 -2
- package/build-module/gallery/use-image-sizes.js.map +1 -1
- package/build-module/gallery/v1/edit.js +7 -4
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/group/edit.js +101 -48
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +3 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/placeholder.js +154 -0
- package/build-module/group/placeholder.js.map +1 -0
- package/build-module/group/variations.js +3 -3
- package/build-module/group/variations.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 +8 -11
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-comments/edit.js +2 -1
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-comments/index.js +5 -1
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +13 -0
- package/build-module/latest-posts/deprecated.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/latest-posts/index.js +13 -0
- package/build-module/latest-posts/index.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 +2 -1
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +5 -6
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/navigation/edit/index.js +96 -105
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/manage-menus-button.js +26 -0
- package/build-module/navigation/edit/manage-menus-button.js.map +1 -0
- package/build-module/navigation/edit/navigation-menu-selector.js +13 -6
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +2 -6
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +7 -18
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation-link/edit.js +14 -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/post-author/edit.js +35 -21
- package/build-module/post-author/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/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/post-content/index.js +3 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/pullquote/deprecated.js +7 -7
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/search/edit.js +1 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +3 -3
- 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 +1 -1
- package/build-module/table/state.js.map +1 -1
- package/build-module/template-part/variations.js +5 -0
- package/build-module/template-part/variations.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/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/editor-rtl.css +80 -5
- package/build-style/editor.css +80 -5
- package/build-style/group/editor-rtl.css +44 -0
- package/build-style/group/editor.css +44 -0
- package/build-style/latest-comments/style-rtl.css +1 -0
- package/build-style/latest-comments/style.css +1 -0
- package/build-style/latest-posts/style-rtl.css +3 -0
- package/build-style/latest-posts/style.css +3 -0
- package/build-style/navigation/editor-rtl.css +27 -4
- package/build-style/navigation/editor.css +27 -4
- package/build-style/navigation/style-rtl.css +13 -1
- package/build-style/navigation/style.css +13 -1
- package/build-style/navigation-link/editor-rtl.css +8 -1
- package/build-style/navigation-link/editor.css +8 -1
- package/build-style/post-comments-form/style-rtl.css +3 -0
- package/build-style/post-comments-form/style.css +3 -0
- package/build-style/query/editor-rtl.css +1 -1
- package/build-style/query/editor.css +1 -1
- package/build-style/query-pagination/style-rtl.css +1 -1
- package/build-style/query-pagination/style.css +1 -1
- package/build-style/style-rtl.css +28 -2
- package/build-style/style.css +28 -2
- package/build-style/table/editor-rtl.css +1 -0
- package/build-style/table/editor.css +1 -0
- package/build-style/table/style-rtl.css +5 -0
- package/build-style/table/style.css +5 -0
- package/build-style/table/theme-rtl.css +1 -3
- package/build-style/table/theme.css +1 -3
- package/build-style/theme-rtl.css +1 -3
- package/build-style/theme.css +1 -3
- package/package.json +29 -28
- package/src/audio/edit.js +79 -24
- package/src/avatar/index.php +1 -1
- package/src/block/test/edit.native.js +8 -8
- package/src/button/block.json +4 -1
- package/src/button/deprecated.js +18 -2
- package/src/button/edit.js +12 -10
- package/src/button/save.js +12 -2
- package/src/button/style.scss +2 -0
- package/src/buttons/edit.native.js +1 -1
- package/src/buttons/test/edit.native.js +19 -19
- package/src/columns/test/edit.native.js +32 -32
- package/src/columns/transforms.js +8 -0
- package/src/comment-template/block.json +6 -2
- package/src/comment-template/style.scss +2 -0
- package/src/cover/edit/index.js +3 -1
- package/src/cover/edit/inspector-controls.js +11 -13
- package/src/cover/test/edit.native.js +26 -26
- package/src/embed/deprecated.js +53 -26
- package/src/embed/test/index.native.js +43 -43
- 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/test/index.native.js +11 -11
- package/src/gallery/use-image-sizes.js +3 -2
- package/src/gallery/v1/edit.js +21 -25
- package/src/group/block.json +3 -0
- package/src/group/edit.js +105 -46
- package/src/group/editor.scss +48 -0
- package/src/group/placeholder.js +187 -0
- package/src/group/test/edit.native.js +3 -3
- package/src/group/test/placeholder.js +78 -0
- package/src/group/variations.js +3 -3
- package/src/image/edit.native.js +1 -1
- package/src/image/image.js +22 -10
- package/src/image/test/edit.native.js +17 -17
- package/src/latest-comments/block.json +5 -1
- package/src/latest-comments/edit.js +1 -0
- package/src/latest-comments/style.scss +3 -0
- package/src/latest-posts/block.json +13 -0
- package/src/latest-posts/edit.js +2 -2
- package/src/latest-posts/style.scss +3 -0
- package/src/list/test/edit.native.js +36 -36
- package/src/list/utils.js +3 -11
- package/src/list-item/edit.js +1 -0
- package/src/list-item/hooks/use-outdent-list-item.js +3 -6
- package/src/missing/test/edit-integration.native.js +5 -5
- package/src/navigation/edit/index.js +186 -161
- package/src/navigation/edit/manage-menus-button.js +21 -0
- package/src/navigation/edit/navigation-menu-selector.js +20 -5
- package/src/navigation/edit/responsive-wrapper.js +2 -10
- package/src/navigation/edit/unsaved-inner-blocks.js +5 -22
- package/src/navigation/editor.scss +29 -4
- package/src/navigation/style.scss +19 -1
- package/src/navigation-link/edit.js +13 -4
- package/src/navigation-link/editor.scss +8 -0
- package/src/navigation-submenu/edit.js +7 -5
- package/src/page-list/edit.js +36 -22
- package/src/post-author/edit.js +44 -20
- package/src/post-comments-count/block.json +4 -0
- package/src/post-comments-form/block.json +4 -0
- package/src/post-comments-form/style.scss +3 -0
- package/src/post-comments-link/block.json +4 -0
- package/src/post-content/block.json +3 -0
- package/src/post-content/edit.js +8 -4
- package/src/pullquote/deprecated.js +7 -7
- package/src/query/editor.scss +1 -1
- package/src/query-pagination/style.scss +1 -1
- package/src/read-more/index.php +9 -2
- package/src/search/edit.js +1 -1
- package/src/shortcode/test/edit.native.js +5 -5
- package/src/site-logo/edit.js +3 -3
- 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/social-link/test/index.native.js +10 -10
- package/src/social-links/test/edit.native.js +4 -4
- package/src/spacer/controls.js +10 -12
- package/src/spacer/test/index.native.js +17 -17
- package/src/table/deprecated.js +587 -348
- package/src/table/editor.scss +1 -0
- package/src/table/state.js +1 -1
- package/src/table/style.scss +7 -0
- package/src/table/theme.scss +1 -3
- package/src/template-part/index.php +5 -0
- package/src/template-part/variations.js +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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useInnerBlocksProps } from '@wordpress/block-editor';
|
|
5
|
-
import { Disabled
|
|
5
|
+
import { Disabled } from '@wordpress/components';
|
|
6
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
7
7
|
import { useSelect } from '@wordpress/data';
|
|
8
8
|
import { useContext, useEffect, useRef, useMemo } from '@wordpress/element';
|
|
@@ -11,7 +11,6 @@ import { useContext, useEffect, useRef, useMemo } from '@wordpress/element';
|
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
13
|
import useNavigationMenu from '../use-navigation-menu';
|
|
14
|
-
import useCreateNavigationMenu from './use-create-navigation-menu';
|
|
15
14
|
|
|
16
15
|
const EMPTY_OBJECT = {};
|
|
17
16
|
const DRAFT_MENU_PARAMS = [
|
|
@@ -38,9 +37,8 @@ const ALLOWED_BLOCKS = [
|
|
|
38
37
|
|
|
39
38
|
export default function UnsavedInnerBlocks( {
|
|
40
39
|
blocks,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
onSave,
|
|
40
|
+
createNavigationMenu,
|
|
41
|
+
|
|
44
42
|
hasSelection,
|
|
45
43
|
} ) {
|
|
46
44
|
const originalBlocks = useRef();
|
|
@@ -75,7 +73,6 @@ export default function UnsavedInnerBlocks( {
|
|
|
75
73
|
// The block will be disabled in a block preview, use this as a way of
|
|
76
74
|
// avoiding the side-effects of this component for block previews.
|
|
77
75
|
const isDisabled = useContext( Disabled.Context );
|
|
78
|
-
const savingLock = useRef( false );
|
|
79
76
|
|
|
80
77
|
const innerBlocksProps = useInnerBlocksProps(
|
|
81
78
|
{
|
|
@@ -121,9 +118,6 @@ export default function UnsavedInnerBlocks( {
|
|
|
121
118
|
|
|
122
119
|
const { hasResolvedNavigationMenus, navigationMenus } = useNavigationMenu();
|
|
123
120
|
|
|
124
|
-
const { create: createNavigationMenu } =
|
|
125
|
-
useCreateNavigationMenu( clientId );
|
|
126
|
-
|
|
127
121
|
// Automatically save the uncontrolled blocks.
|
|
128
122
|
useEffect( () => {
|
|
129
123
|
// The block will be disabled when used in a BlockPreview.
|
|
@@ -140,9 +134,7 @@ export default function UnsavedInnerBlocks( {
|
|
|
140
134
|
// which is an indication they want to start editing.
|
|
141
135
|
if (
|
|
142
136
|
isDisabled ||
|
|
143
|
-
hasSavedUnsavedInnerBlocks ||
|
|
144
137
|
isSaving ||
|
|
145
|
-
savingLock.current ||
|
|
146
138
|
! hasResolvedDraftNavigationMenus ||
|
|
147
139
|
! hasResolvedNavigationMenus ||
|
|
148
140
|
! hasSelection ||
|
|
@@ -151,11 +143,7 @@ export default function UnsavedInnerBlocks( {
|
|
|
151
143
|
return;
|
|
152
144
|
}
|
|
153
145
|
|
|
154
|
-
|
|
155
|
-
createNavigationMenu( null, blocks ).then( ( menu ) => {
|
|
156
|
-
onSave( menu );
|
|
157
|
-
savingLock.current = false;
|
|
158
|
-
} );
|
|
146
|
+
createNavigationMenu( null, blocks );
|
|
159
147
|
}, [
|
|
160
148
|
isDisabled,
|
|
161
149
|
isSaving,
|
|
@@ -170,10 +158,5 @@ export default function UnsavedInnerBlocks( {
|
|
|
170
158
|
|
|
171
159
|
const Wrapper = isSaving ? Disabled : 'div';
|
|
172
160
|
|
|
173
|
-
return
|
|
174
|
-
<>
|
|
175
|
-
<Wrapper { ...innerBlocksProps } />
|
|
176
|
-
{ isSaving && <Spinner /> }
|
|
177
|
-
</>
|
|
178
|
-
);
|
|
161
|
+
return <Wrapper { ...innerBlocksProps } />;
|
|
179
162
|
}
|
|
@@ -261,10 +261,6 @@ $color-control-label-height: 20px;
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
.wp-block-navigation-placeholder .components-spinner {
|
|
265
|
-
margin-top: 0;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
264
|
// Unselected state.
|
|
269
265
|
.wp-block-navigation-placeholder__preview {
|
|
270
266
|
display: flex;
|
|
@@ -544,6 +540,13 @@ body.editor-styles-wrapper
|
|
|
544
540
|
color: inherit;
|
|
545
541
|
}
|
|
546
542
|
|
|
543
|
+
.components-heading.wp-block-navigation-off-canvas-editor__title {
|
|
544
|
+
margin: 0;
|
|
545
|
+
}
|
|
546
|
+
.wp-block-navigation-off-canvas-editor__header {
|
|
547
|
+
margin-bottom: $grid-unit-10;
|
|
548
|
+
}
|
|
549
|
+
|
|
547
550
|
// Customize the mobile editing.
|
|
548
551
|
// This can be revisited in the future, but for now, inherit design from the parent.
|
|
549
552
|
.is-menu-open .wp-block-navigation__responsive-container-content * {
|
|
@@ -567,6 +570,10 @@ body.editor-styles-wrapper
|
|
|
567
570
|
padding: $grid-unit-10 $grid-unit-15;
|
|
568
571
|
}
|
|
569
572
|
|
|
573
|
+
.wp-block-navigation .wp-block-navigation__uncontrolled-inner-blocks-loading-indicator {
|
|
574
|
+
margin-top: 0;
|
|
575
|
+
}
|
|
576
|
+
|
|
570
577
|
@keyframes fadeouthalf {
|
|
571
578
|
0% {
|
|
572
579
|
opacity: 1;
|
|
@@ -582,6 +589,13 @@ body.editor-styles-wrapper
|
|
|
582
589
|
margin-bottom: $grid-unit-20;
|
|
583
590
|
}
|
|
584
591
|
|
|
592
|
+
// increased specificity to override button variant
|
|
593
|
+
// for the manage menus button in the advanced area
|
|
594
|
+
// of the navigation block
|
|
595
|
+
.components-button.is-link.wp-block-navigation-manage-menus-button {
|
|
596
|
+
margin-bottom: $grid-unit-20;
|
|
597
|
+
}
|
|
598
|
+
|
|
585
599
|
.wp-block-navigation__overlay-menu-preview {
|
|
586
600
|
display: flex;
|
|
587
601
|
align-items: center;
|
|
@@ -625,6 +639,17 @@ body.editor-styles-wrapper
|
|
|
625
639
|
width: 100%;
|
|
626
640
|
}
|
|
627
641
|
|
|
642
|
+
.wp-block-navigation__navigation-selector-button__icon {
|
|
643
|
+
flex: 0 0 auto;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.wp-block-navigation__navigation-selector-button__label {
|
|
647
|
+
flex: 0 1 auto;
|
|
648
|
+
overflow: hidden;
|
|
649
|
+
text-overflow: ellipsis;
|
|
650
|
+
white-space: nowrap;
|
|
651
|
+
}
|
|
652
|
+
|
|
628
653
|
.wp-block-navigation__navigation-selector-button--createnew {
|
|
629
654
|
border: 1px solid;
|
|
630
655
|
margin-bottom: $grid-unit-20;
|
|
@@ -359,7 +359,9 @@ button.wp-block-navigation-item__content {
|
|
|
359
359
|
|
|
360
360
|
// Provide a default padding for submenus who should always have some, regardless of the top level menu items.
|
|
361
361
|
:where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item a:not(.wp-element-button)),
|
|
362
|
-
:where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-submenu a:not(.wp-element-button))
|
|
362
|
+
:where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-submenu a:not(.wp-element-button)),
|
|
363
|
+
:where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-submenu button.wp-block-navigation-item__content),
|
|
364
|
+
:where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-pages-list__item button.wp-block-navigation-item__content) {
|
|
363
365
|
padding: 0.5em 1em;
|
|
364
366
|
}
|
|
365
367
|
|
|
@@ -653,6 +655,14 @@ button.wp-block-navigation-item__content {
|
|
|
653
655
|
.wp-block-navigation__responsive-container-open {
|
|
654
656
|
display: flex;
|
|
655
657
|
|
|
658
|
+
// When set to collapse into a text button, it should inherit the parent font.
|
|
659
|
+
// This needs specificity to override inherited properties by the button element and component.
|
|
660
|
+
&.wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open {
|
|
661
|
+
font-family: inherit;
|
|
662
|
+
font-weight: inherit;
|
|
663
|
+
font-size: inherit;
|
|
664
|
+
}
|
|
665
|
+
|
|
656
666
|
&:not(.always-shown) {
|
|
657
667
|
@include break-small {
|
|
658
668
|
display: none;
|
|
@@ -666,6 +676,14 @@ button.wp-block-navigation-item__content {
|
|
|
666
676
|
top: 0;
|
|
667
677
|
right: 0;
|
|
668
678
|
z-index: 2; // Needs to be above the modal z index itself.
|
|
679
|
+
|
|
680
|
+
// When set to collapse into a text button, it should inherit the parent font.
|
|
681
|
+
// This needs specificity to override inherited properties by the button element and component.
|
|
682
|
+
&.wp-block-navigation__responsive-container-close.wp-block-navigation__responsive-container-close {
|
|
683
|
+
font-family: inherit;
|
|
684
|
+
font-weight: inherit;
|
|
685
|
+
font-size: inherit;
|
|
686
|
+
}
|
|
669
687
|
}
|
|
670
688
|
|
|
671
689
|
// The menu adds wrapping containers.
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import
|
|
5
|
+
import escapeHtml from 'escape-html';
|
|
6
|
+
import { unescape } from 'lodash';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* WordPress dependencies
|
|
@@ -262,8 +263,8 @@ export const updateNavigationLinkBlockAttributes = (
|
|
|
262
263
|
// - https://github.com/WordPress/gutenberg/pull/41063
|
|
263
264
|
// - https://github.com/WordPress/gutenberg/pull/18617.
|
|
264
265
|
const label = useNewLabel
|
|
265
|
-
?
|
|
266
|
-
: originalLabel ||
|
|
266
|
+
? escapeHtml( newLabel )
|
|
267
|
+
: originalLabel || escapeHtml( newUrlWithoutHttp );
|
|
267
268
|
|
|
268
269
|
// In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
|
|
269
270
|
const type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );
|
|
@@ -715,6 +716,14 @@ export default function NavigationLinkEdit( {
|
|
|
715
716
|
</BlockControls>
|
|
716
717
|
<InspectorControls>
|
|
717
718
|
<PanelBody title={ __( 'Link settings' ) }>
|
|
719
|
+
<TextControl
|
|
720
|
+
value={ url || '' }
|
|
721
|
+
onChange={ ( urlValue ) => {
|
|
722
|
+
setAttributes( { url: urlValue } );
|
|
723
|
+
} }
|
|
724
|
+
label={ __( 'URL' ) }
|
|
725
|
+
autoComplete="off"
|
|
726
|
+
/>
|
|
718
727
|
<TextareaControl
|
|
719
728
|
value={ description || '' }
|
|
720
729
|
onChange={ ( descriptionValue ) => {
|
|
@@ -846,7 +855,7 @@ export default function NavigationLinkEdit( {
|
|
|
846
855
|
) }
|
|
847
856
|
{ isLinkOpen && (
|
|
848
857
|
<Popover
|
|
849
|
-
|
|
858
|
+
placement="bottom"
|
|
850
859
|
onClose={ () => setIsLinkOpen( false ) }
|
|
851
860
|
anchor={ popoverAnchor }
|
|
852
861
|
shift
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import
|
|
5
|
+
import escapeHtml from 'escape-html';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -248,8 +248,8 @@ export const updateNavigationLinkBlockAttributes = (
|
|
|
248
248
|
normalizedTitle !== normalizedURL &&
|
|
249
249
|
originalLabel !== title;
|
|
250
250
|
const label = escapeTitle
|
|
251
|
-
?
|
|
252
|
-
: originalLabel ||
|
|
251
|
+
? escapeHtml( title )
|
|
252
|
+
: originalLabel || escapeHtml( normalizedURL );
|
|
253
253
|
|
|
254
254
|
// In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
|
|
255
255
|
const type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );
|
|
@@ -486,7 +486,9 @@ export default function NavigationSubmenuEdit( {
|
|
|
486
486
|
const innerBlocksColors = getColors( context, true );
|
|
487
487
|
|
|
488
488
|
const allowedBlocks = isAtMaxNesting
|
|
489
|
-
?
|
|
489
|
+
? ALLOWED_BLOCKS.filter(
|
|
490
|
+
( blockName ) => blockName !== 'core/navigation-submenu'
|
|
491
|
+
)
|
|
490
492
|
: ALLOWED_BLOCKS;
|
|
491
493
|
|
|
492
494
|
const innerBlocksProps = useInnerBlocksProps(
|
|
@@ -631,7 +633,7 @@ export default function NavigationSubmenuEdit( {
|
|
|
631
633
|
}
|
|
632
634
|
{ ! openSubmenusOnClick && isLinkOpen && (
|
|
633
635
|
<Popover
|
|
634
|
-
|
|
636
|
+
placement="bottom"
|
|
635
637
|
onClose={ () => setIsLinkOpen( false ) }
|
|
636
638
|
anchor={ popoverAnchor }
|
|
637
639
|
shift
|
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/post-author/edit.js
CHANGED
|
@@ -13,11 +13,23 @@ import {
|
|
|
13
13
|
RichText,
|
|
14
14
|
useBlockProps,
|
|
15
15
|
} from '@wordpress/block-editor';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
ComboboxControl,
|
|
18
|
+
PanelBody,
|
|
19
|
+
SelectControl,
|
|
20
|
+
ToggleControl,
|
|
21
|
+
} from '@wordpress/components';
|
|
17
22
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
18
23
|
import { __ } from '@wordpress/i18n';
|
|
19
24
|
import { store as coreStore } from '@wordpress/core-data';
|
|
20
25
|
|
|
26
|
+
const minimumUsersForCombobox = 25;
|
|
27
|
+
|
|
28
|
+
const AUTHORS_QUERY = {
|
|
29
|
+
who: 'authors',
|
|
30
|
+
per_page: 100,
|
|
31
|
+
};
|
|
32
|
+
|
|
21
33
|
function PostAuthorEdit( {
|
|
22
34
|
isSelected,
|
|
23
35
|
context: { postType, postId, queryId },
|
|
@@ -38,7 +50,7 @@ function PostAuthorEdit( {
|
|
|
38
50
|
return {
|
|
39
51
|
authorId: _authorId,
|
|
40
52
|
authorDetails: _authorId ? getUser( _authorId ) : null,
|
|
41
|
-
authors: getUsers(
|
|
53
|
+
authors: getUsers( AUTHORS_QUERY ),
|
|
42
54
|
};
|
|
43
55
|
},
|
|
44
56
|
[ postType, postId ]
|
|
@@ -65,34 +77,46 @@ function PostAuthorEdit( {
|
|
|
65
77
|
} ),
|
|
66
78
|
} );
|
|
67
79
|
|
|
80
|
+
const authorOptions = authors?.length
|
|
81
|
+
? authors.map( ( { id, name } ) => {
|
|
82
|
+
return {
|
|
83
|
+
value: id,
|
|
84
|
+
label: name,
|
|
85
|
+
};
|
|
86
|
+
} )
|
|
87
|
+
: [];
|
|
88
|
+
|
|
89
|
+
const handleSelect = ( nextAuthorId ) => {
|
|
90
|
+
editEntityRecord( 'postType', postType, postId, {
|
|
91
|
+
author: nextAuthorId,
|
|
92
|
+
} );
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const showCombobox = authorOptions.length >= minimumUsersForCombobox;
|
|
96
|
+
|
|
68
97
|
return (
|
|
69
98
|
<>
|
|
70
99
|
<InspectorControls>
|
|
71
100
|
<PanelBody title={ __( 'Settings' ) }>
|
|
72
101
|
{ !! postId &&
|
|
73
102
|
! isDescendentOfQueryLoop &&
|
|
74
|
-
|
|
103
|
+
authorOptions.length &&
|
|
104
|
+
( ( showCombobox && (
|
|
105
|
+
<ComboboxControl
|
|
106
|
+
label={ __( 'Author' ) }
|
|
107
|
+
options={ authorOptions }
|
|
108
|
+
value={ authorId }
|
|
109
|
+
onChange={ handleSelect }
|
|
110
|
+
allowReset={ false }
|
|
111
|
+
/>
|
|
112
|
+
) ) || (
|
|
75
113
|
<SelectControl
|
|
76
114
|
label={ __( 'Author' ) }
|
|
77
115
|
value={ authorId }
|
|
78
|
-
options={
|
|
79
|
-
|
|
80
|
-
value: id,
|
|
81
|
-
label: name,
|
|
82
|
-
};
|
|
83
|
-
} ) }
|
|
84
|
-
onChange={ ( nextAuthorId ) => {
|
|
85
|
-
editEntityRecord(
|
|
86
|
-
'postType',
|
|
87
|
-
postType,
|
|
88
|
-
postId,
|
|
89
|
-
{
|
|
90
|
-
author: nextAuthorId,
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
} }
|
|
116
|
+
options={ authorOptions }
|
|
117
|
+
onChange={ handleSelect }
|
|
94
118
|
/>
|
|
95
|
-
) }
|
|
119
|
+
) ) }
|
|
96
120
|
<ToggleControl
|
|
97
121
|
label={ __( 'Show avatar' ) }
|
|
98
122
|
checked={ showAvatar }
|
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 ) {
|
package/src/query/editor.scss
CHANGED
|
@@ -18,7 +18,7 @@ $pagination-margin: 0.5em;
|
|
|
18
18
|
// which is important when it's the only block displayed
|
|
19
19
|
// and the block has a "space-between" justification.
|
|
20
20
|
&.is-content-justification-space-between {
|
|
21
|
-
> .wp-block-query-pagination-next:last-
|
|
21
|
+
> .wp-block-query-pagination-next:last-of-type {
|
|
22
22
|
margin-inline-start: auto;
|
|
23
23
|
}
|
|
24
24
|
> .wp-block-query-pagination-previous:first-child {
|
package/src/read-more/index.php
CHANGED
|
@@ -19,15 +19,22 @@ function render_block_core_read_more( $attributes, $content, $block ) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
$post_ID = $block->context['postId'];
|
|
22
|
+
$post_title = get_the_title( $post_ID );
|
|
23
|
+
$screen_reader_text = sprintf(
|
|
24
|
+
/* translators: %s is either the post title or post ID to describe the link for screen readers. */
|
|
25
|
+
__( ': %s' ),
|
|
26
|
+
'' !== $post_title ? $post_title : __( 'untitled post ' ) . $post_ID
|
|
27
|
+
);
|
|
22
28
|
$justify_class_name = empty( $attributes['justifyContent'] ) ? '' : "is-justified-{$attributes['justifyContent']}";
|
|
23
29
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $justify_class_name ) );
|
|
24
30
|
$more_text = ! empty( $attributes['content'] ) ? wp_kses_post( $attributes['content'] ) : __( 'Read more' );
|
|
25
31
|
return sprintf(
|
|
26
|
-
'<a %1s href="%2s" target="%3s">%4s</a>',
|
|
32
|
+
'<a %1s href="%2s" target="%3s">%4s<span class="screen-reader-text">%5s</span></a>',
|
|
27
33
|
$wrapper_attributes,
|
|
28
34
|
get_the_permalink( $post_ID ),
|
|
29
35
|
esc_attr( $attributes['linkTarget'] ),
|
|
30
|
-
$more_text
|
|
36
|
+
$more_text,
|
|
37
|
+
$screen_reader_text
|
|
31
38
|
);
|
|
32
39
|
}
|
|
33
40
|
|