@wordpress/block-library 9.26.1-next.719a03cbe.0 → 9.27.1-next.46f643fa0.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 +2 -0
- package/build/categories/edit.js +15 -3
- package/build/categories/edit.js.map +1 -1
- package/build/cover/edit/block-controls.js +4 -2
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/index.js +6 -3
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +13 -4
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/index.js +6 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +3 -1
- package/build/cover/save.js.map +1 -1
- package/build/file/edit.js +2 -1
- package/build/file/edit.js.map +1 -1
- package/build/latest-posts/edit.js +0 -2
- package/build/latest-posts/edit.js.map +1 -1
- package/build/media-text/edit.js +2 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/navigation-link/edit.js +32 -15
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/update-attributes.js +112 -14
- package/build/navigation-link/update-attributes.js.map +1 -1
- package/build/navigation-submenu/edit.js +19 -2
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/paragraph/edit.js +2 -2
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-content/edit.js +78 -16
- package/build/post-content/edit.js.map +1 -1
- package/build/post-content/index.js +6 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/deprecated.js +104 -1
- package/build/post-date/deprecated.js.map +1 -1
- package/build/post-date/edit.js +32 -32
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +4 -4
- package/build/post-date/index.js.map +1 -1
- package/build/post-date/variations.js +32 -3
- package/build/post-date/variations.js.map +1 -1
- package/build/separator/edit.js +5 -30
- package/build/separator/edit.js.map +1 -1
- package/build/site-tagline/index.js +1 -1
- package/build/social-link/variations.js +51 -49
- package/build/social-link/variations.js.map +1 -1
- package/build/utils/poster-image.js +93 -0
- package/build/utils/poster-image.js.map +1 -0
- package/build/video/edit.js +7 -6
- package/build/video/edit.js.map +1 -1
- package/build/video/tracks-editor.js +95 -104
- package/build/video/tracks-editor.js.map +1 -1
- package/build/video/tracks.js +6 -2
- package/build/video/tracks.js.map +1 -1
- package/build-module/categories/edit.js +15 -3
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +4 -2
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/index.js +6 -3
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +12 -4
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/index.js +6 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +3 -1
- package/build-module/cover/save.js.map +1 -1
- package/build-module/file/edit.js +2 -1
- package/build-module/file/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +0 -2
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/media-text/edit.js +2 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/navigation-link/edit.js +32 -15
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +113 -15
- package/build-module/navigation-link/update-attributes.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +20 -3
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +2 -2
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-content/edit.js +80 -18
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-content/index.js +6 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/deprecated.js +104 -1
- package/build-module/post-date/deprecated.js.map +1 -1
- package/build-module/post-date/edit.js +35 -35
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +4 -4
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-date/variations.js +32 -3
- package/build-module/post-date/variations.js.map +1 -1
- package/build-module/separator/edit.js +6 -31
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/site-tagline/index.js +1 -1
- package/build-module/social-link/variations.js +52 -50
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/utils/poster-image.js +85 -0
- package/build-module/utils/poster-image.js.map +1 -0
- package/build-module/video/edit.js +7 -6
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +96 -105
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-module/video/tracks.js +6 -2
- package/build-module/video/tracks.js.map +1 -1
- package/build-style/archives/editor-rtl.css +0 -4
- package/build-style/archives/editor.css +0 -4
- package/build-style/editor-rtl.css +67 -18
- package/build-style/editor.css +67 -18
- package/build-style/file/style-rtl.css +1 -1
- package/build-style/file/style.css +1 -1
- package/build-style/navigation/editor-rtl.css +6 -6
- package/build-style/navigation/editor.css +6 -6
- package/build-style/navigation/style-rtl.css +1 -0
- package/build-style/navigation/style.css +1 -0
- package/build-style/page-list/editor-rtl.css +0 -4
- package/build-style/page-list/editor.css +0 -4
- package/build-style/style-rtl.css +3 -1
- package/build-style/style.css +3 -1
- package/build-style/video/editor-rtl.css +0 -4
- package/build-style/video/editor.css +0 -4
- package/build-style/video/style-rtl.css +1 -0
- package/build-style/video/style.css +1 -0
- package/package.json +35 -35
- package/src/archives/editor.scss +0 -4
- package/src/categories/edit.js +13 -1
- package/src/comments-pagination/index.php +7 -2
- package/src/cover/block.json +6 -0
- package/src/cover/edit/block-controls.js +22 -17
- package/src/cover/edit/index.js +4 -1
- package/src/cover/edit/inspector-controls.js +15 -2
- package/src/cover/save.js +2 -0
- package/src/editor.scss +1 -0
- package/src/file/edit.js +4 -1
- package/src/file/style.scss +1 -1
- package/src/latest-posts/edit.js +0 -2
- package/src/media-text/edit.js +1 -1
- package/src/navigation/style.scss +1 -0
- package/src/navigation-link/edit.js +28 -16
- package/src/navigation-link/test/edit.js +738 -6
- package/src/navigation-link/update-attributes.js +125 -12
- package/src/navigation-submenu/edit.js +21 -1
- package/src/page-list/editor.scss +0 -6
- package/src/paragraph/edit.js +2 -2
- package/src/post-content/block.json +6 -0
- package/src/post-content/edit.js +71 -19
- package/src/post-content/index.php +11 -4
- package/src/post-date/block.json +4 -4
- package/src/post-date/deprecated.js +104 -1
- package/src/post-date/edit.js +74 -86
- package/src/post-date/index.php +55 -28
- package/src/post-date/variations.js +37 -3
- package/src/post-featured-image/index.php +3 -2
- package/src/separator/edit.js +8 -43
- package/src/site-tagline/block.json +1 -1
- package/src/social-link/README.md +21 -0
- package/src/social-link/index.php +49 -49
- package/src/social-link/variations.js +51 -49
- package/src/utils/poster-image.js +131 -0
- package/src/utils/poster-image.scss +75 -0
- package/src/video/edit.js +8 -6
- package/src/video/editor.scss +0 -6
- package/src/video/index.php +91 -0
- package/src/video/style.native.scss +1 -0
- package/src/video/style.scss +1 -0
- package/src/video/tracks-editor.js +93 -103
- package/src/video/tracks.js +2 -1
- package/build/video/poster-image.js +0 -81
- package/build/video/poster-image.js.map +0 -1
- package/build-module/video/poster-image.js +0 -74
- package/build-module/video/poster-image.js.map +0 -1
- package/src/video/poster-image.js +0 -86
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.27.1-next.46f643fa0.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -41,39 +41,39 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@babel/runtime": "7.25.7",
|
|
44
|
-
"@wordpress/a11y": "^4.
|
|
45
|
-
"@wordpress/api-fetch": "^7.
|
|
46
|
-
"@wordpress/autop": "^4.
|
|
47
|
-
"@wordpress/blob": "^4.
|
|
48
|
-
"@wordpress/block-editor": "^
|
|
49
|
-
"@wordpress/blocks": "^
|
|
50
|
-
"@wordpress/components": "^
|
|
51
|
-
"@wordpress/compose": "^7.
|
|
52
|
-
"@wordpress/core-data": "^7.
|
|
53
|
-
"@wordpress/data": "^10.
|
|
54
|
-
"@wordpress/date": "^5.
|
|
55
|
-
"@wordpress/deprecated": "^4.
|
|
56
|
-
"@wordpress/dom": "^4.
|
|
57
|
-
"@wordpress/element": "^6.
|
|
58
|
-
"@wordpress/escape-html": "^3.
|
|
59
|
-
"@wordpress/hooks": "^4.
|
|
60
|
-
"@wordpress/html-entities": "^4.
|
|
61
|
-
"@wordpress/i18n": "^6.0.1-next.
|
|
62
|
-
"@wordpress/icons": "^10.
|
|
63
|
-
"@wordpress/interactivity": "^6.
|
|
64
|
-
"@wordpress/interactivity-router": "^2.
|
|
65
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
66
|
-
"@wordpress/keycodes": "^4.
|
|
67
|
-
"@wordpress/notices": "^5.
|
|
68
|
-
"@wordpress/patterns": "^2.
|
|
69
|
-
"@wordpress/primitives": "^4.
|
|
70
|
-
"@wordpress/private-apis": "^1.
|
|
71
|
-
"@wordpress/reusable-blocks": "^5.
|
|
72
|
-
"@wordpress/rich-text": "^7.
|
|
73
|
-
"@wordpress/server-side-render": "^6.
|
|
74
|
-
"@wordpress/url": "^4.
|
|
75
|
-
"@wordpress/viewport": "^6.
|
|
76
|
-
"@wordpress/wordcount": "^4.
|
|
44
|
+
"@wordpress/a11y": "^4.27.1-next.46f643fa0.0",
|
|
45
|
+
"@wordpress/api-fetch": "^7.27.1-next.46f643fa0.0",
|
|
46
|
+
"@wordpress/autop": "^4.27.1-next.46f643fa0.0",
|
|
47
|
+
"@wordpress/blob": "^4.27.1-next.46f643fa0.0",
|
|
48
|
+
"@wordpress/block-editor": "^15.0.1-next.46f643fa0.0",
|
|
49
|
+
"@wordpress/blocks": "^15.0.1-next.46f643fa0.0",
|
|
50
|
+
"@wordpress/components": "^30.1.1-next.46f643fa0.0",
|
|
51
|
+
"@wordpress/compose": "^7.27.1-next.46f643fa0.0",
|
|
52
|
+
"@wordpress/core-data": "^7.27.1-next.46f643fa0.0",
|
|
53
|
+
"@wordpress/data": "^10.27.1-next.46f643fa0.0",
|
|
54
|
+
"@wordpress/date": "^5.27.1-next.46f643fa0.0",
|
|
55
|
+
"@wordpress/deprecated": "^4.27.1-next.46f643fa0.0",
|
|
56
|
+
"@wordpress/dom": "^4.27.1-next.46f643fa0.0",
|
|
57
|
+
"@wordpress/element": "^6.27.1-next.46f643fa0.0",
|
|
58
|
+
"@wordpress/escape-html": "^3.27.1-next.46f643fa0.0",
|
|
59
|
+
"@wordpress/hooks": "^4.27.1-next.46f643fa0.0",
|
|
60
|
+
"@wordpress/html-entities": "^4.27.1-next.46f643fa0.0",
|
|
61
|
+
"@wordpress/i18n": "^6.0.1-next.46f643fa0.0",
|
|
62
|
+
"@wordpress/icons": "^10.27.2-next.46f643fa0.0",
|
|
63
|
+
"@wordpress/interactivity": "^6.28.1-next.46f643fa0.0",
|
|
64
|
+
"@wordpress/interactivity-router": "^2.27.1-next.46f643fa0.0",
|
|
65
|
+
"@wordpress/keyboard-shortcuts": "^5.27.1-next.46f643fa0.0",
|
|
66
|
+
"@wordpress/keycodes": "^4.27.1-next.46f643fa0.0",
|
|
67
|
+
"@wordpress/notices": "^5.27.1-next.46f643fa0.0",
|
|
68
|
+
"@wordpress/patterns": "^2.27.1-next.46f643fa0.0",
|
|
69
|
+
"@wordpress/primitives": "^4.27.1-next.46f643fa0.0",
|
|
70
|
+
"@wordpress/private-apis": "^1.27.1-next.46f643fa0.0",
|
|
71
|
+
"@wordpress/reusable-blocks": "^5.27.1-next.46f643fa0.0",
|
|
72
|
+
"@wordpress/rich-text": "^7.27.1-next.46f643fa0.0",
|
|
73
|
+
"@wordpress/server-side-render": "^6.4.1-next.46f643fa0.0",
|
|
74
|
+
"@wordpress/url": "^4.27.1-next.46f643fa0.0",
|
|
75
|
+
"@wordpress/viewport": "^6.27.1-next.46f643fa0.0",
|
|
76
|
+
"@wordpress/wordcount": "^4.27.1-next.46f643fa0.0",
|
|
77
77
|
"change-case": "^4.1.2",
|
|
78
78
|
"clsx": "^2.1.1",
|
|
79
79
|
"colord": "^2.7.0",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "17e600e091675c5e3d809adfea23ac456bbeae19"
|
|
95
95
|
}
|
package/src/archives/editor.scss
CHANGED
package/src/categories/edit.js
CHANGED
|
@@ -25,6 +25,8 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
25
25
|
import { __, sprintf } from '@wordpress/i18n';
|
|
26
26
|
import { pin } from '@wordpress/icons';
|
|
27
27
|
import { useEntityRecords } from '@wordpress/core-data';
|
|
28
|
+
import { useDispatch } from '@wordpress/data';
|
|
29
|
+
import { store as noticeStore } from '@wordpress/notices';
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* Internal dependencies
|
|
@@ -44,6 +46,7 @@ export default function CategoriesEdit( {
|
|
|
44
46
|
},
|
|
45
47
|
setAttributes,
|
|
46
48
|
className,
|
|
49
|
+
clientId,
|
|
47
50
|
} ) {
|
|
48
51
|
const selectId = useInstanceId( CategoriesEdit, 'blocks-category-select' );
|
|
49
52
|
|
|
@@ -70,6 +73,15 @@ export default function CategoriesEdit( {
|
|
|
70
73
|
query
|
|
71
74
|
);
|
|
72
75
|
|
|
76
|
+
const { createWarningNotice } = useDispatch( noticeStore );
|
|
77
|
+
const showRedirectionPreventedNotice = ( event ) => {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
createWarningNotice( __( 'Links are disabled in the editor.' ), {
|
|
80
|
+
id: `block-library/core/categories/redirection-prevented/${ clientId }`,
|
|
81
|
+
type: 'snackbar',
|
|
82
|
+
} );
|
|
83
|
+
};
|
|
84
|
+
|
|
73
85
|
const getCategoriesList = ( parentId ) => {
|
|
74
86
|
if ( ! categories?.length ) {
|
|
75
87
|
return [];
|
|
@@ -99,7 +111,7 @@ export default function CategoriesEdit( {
|
|
|
99
111
|
const { id, link, count, name } = category;
|
|
100
112
|
return (
|
|
101
113
|
<li key={ id } className={ `cat-item cat-item-${ id }` }>
|
|
102
|
-
<a href={ link }
|
|
114
|
+
<a href={ link } onClick={ showRedirectionPreventedNotice }>
|
|
103
115
|
{ renderCategoryName( name ) }
|
|
104
116
|
</a>
|
|
105
117
|
{ showPostCounts && ` (${ count })` }
|
|
@@ -25,10 +25,15 @@ function render_block_core_comments_pagination( $attributes, $content ) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
$classes = ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) ? 'has-link-color' : '';
|
|
28
|
-
$wrapper_attributes = get_block_wrapper_attributes(
|
|
28
|
+
$wrapper_attributes = get_block_wrapper_attributes(
|
|
29
|
+
array(
|
|
30
|
+
'aria-label' => __( 'Comments pagination' ),
|
|
31
|
+
'class' => $classes,
|
|
32
|
+
)
|
|
33
|
+
);
|
|
29
34
|
|
|
30
35
|
return sprintf(
|
|
31
|
-
'<
|
|
36
|
+
'<nav %1$s>%2$s</nav>',
|
|
32
37
|
$wrapper_attributes,
|
|
33
38
|
$content
|
|
34
39
|
);
|
package/src/cover/block.json
CHANGED
|
@@ -27,6 +27,7 @@ export default function CoverBlockControls( {
|
|
|
27
27
|
currentSettings,
|
|
28
28
|
toggleUseFeaturedImage,
|
|
29
29
|
onClearMedia,
|
|
30
|
+
blockEditingMode,
|
|
30
31
|
} ) {
|
|
31
32
|
const { contentPosition, id, useFeaturedImage, minHeight, minHeightUnit } =
|
|
32
33
|
attributes;
|
|
@@ -39,6 +40,8 @@ export default function CoverBlockControls( {
|
|
|
39
40
|
minHeightUnit === 'vh' &&
|
|
40
41
|
minHeight === 100 &&
|
|
41
42
|
! attributes?.style?.dimensions?.aspectRatio;
|
|
43
|
+
const isContentOnlyMode = blockEditingMode === 'contentOnly';
|
|
44
|
+
|
|
42
45
|
const toggleMinFullHeight = () => {
|
|
43
46
|
if ( isMinFullHeight ) {
|
|
44
47
|
// If there aren't previous values, take the default ones.
|
|
@@ -75,23 +78,25 @@ export default function CoverBlockControls( {
|
|
|
75
78
|
|
|
76
79
|
return (
|
|
77
80
|
<>
|
|
78
|
-
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
81
|
+
{ ! isContentOnlyMode && (
|
|
82
|
+
<BlockControls group="block">
|
|
83
|
+
<BlockAlignmentMatrixControl
|
|
84
|
+
label={ __( 'Change content position' ) }
|
|
85
|
+
value={ contentPosition }
|
|
86
|
+
onChange={ ( nextPosition ) =>
|
|
87
|
+
setAttributes( {
|
|
88
|
+
contentPosition: nextPosition,
|
|
89
|
+
} )
|
|
90
|
+
}
|
|
91
|
+
isDisabled={ ! hasInnerBlocks }
|
|
92
|
+
/>
|
|
93
|
+
<FullHeightAlignmentControl
|
|
94
|
+
isActive={ isMinFullHeight }
|
|
95
|
+
onToggle={ toggleMinFullHeight }
|
|
96
|
+
isDisabled={ ! hasInnerBlocks }
|
|
97
|
+
/>
|
|
98
|
+
</BlockControls>
|
|
99
|
+
) }
|
|
95
100
|
<BlockControls group="other">
|
|
96
101
|
<MediaReplaceFlow
|
|
97
102
|
mediaId={ id }
|
package/src/cover/edit/index.js
CHANGED
|
@@ -102,6 +102,7 @@ function CoverEdit( {
|
|
|
102
102
|
tagName: TagName = 'div',
|
|
103
103
|
isUserOverlayColor,
|
|
104
104
|
sizeSlug,
|
|
105
|
+
poster,
|
|
105
106
|
} = attributes;
|
|
106
107
|
|
|
107
108
|
const [ featuredImage ] = useEntityProp(
|
|
@@ -324,7 +325,7 @@ function CoverEdit( {
|
|
|
324
325
|
const [ resizeListener, { height, width } ] = useResizeObserver();
|
|
325
326
|
const resizableBoxDimensions = useMemo( () => {
|
|
326
327
|
return {
|
|
327
|
-
height: minHeightUnit === 'px' ? minHeight : 'auto',
|
|
328
|
+
height: minHeightUnit === 'px' && minHeight ? minHeight : 'auto',
|
|
328
329
|
width: 'auto',
|
|
329
330
|
};
|
|
330
331
|
}, [ minHeight, minHeightUnit ] );
|
|
@@ -446,6 +447,7 @@ function CoverEdit( {
|
|
|
446
447
|
currentSettings={ currentSettings }
|
|
447
448
|
toggleUseFeaturedImage={ toggleUseFeaturedImage }
|
|
448
449
|
onClearMedia={ onClearMedia }
|
|
450
|
+
blockEditingMode={ blockEditingMode }
|
|
449
451
|
/>
|
|
450
452
|
);
|
|
451
453
|
|
|
@@ -589,6 +591,7 @@ function CoverEdit( {
|
|
|
589
591
|
muted
|
|
590
592
|
loop
|
|
591
593
|
src={ url }
|
|
594
|
+
poster={ poster }
|
|
592
595
|
style={ mediaStyle }
|
|
593
596
|
/>
|
|
594
597
|
) }
|
|
@@ -35,6 +35,7 @@ import { COVER_MIN_HEIGHT, mediaPosition } from '../shared';
|
|
|
35
35
|
import { unlock } from '../../lock-unlock';
|
|
36
36
|
import { useToolsPanelDropdownMenuProps } from '../../utils/hooks';
|
|
37
37
|
import { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';
|
|
38
|
+
import PosterImage from '../../utils/poster-image';
|
|
38
39
|
|
|
39
40
|
const { cleanEmptyObject, ResolutionTool, HTMLElementControl } = unlock(
|
|
40
41
|
blockEditorPrivateApis
|
|
@@ -110,6 +111,7 @@ export default function CoverInspectorControls( {
|
|
|
110
111
|
minHeightUnit,
|
|
111
112
|
alt,
|
|
112
113
|
tagName,
|
|
114
|
+
poster,
|
|
113
115
|
} = attributes;
|
|
114
116
|
const {
|
|
115
117
|
isVideoBackground,
|
|
@@ -198,6 +200,7 @@ export default function CoverInspectorControls( {
|
|
|
198
200
|
focalPoint: undefined,
|
|
199
201
|
isRepeated: false,
|
|
200
202
|
alt: '',
|
|
203
|
+
poster: undefined,
|
|
201
204
|
} );
|
|
202
205
|
updateImage( DEFAULT_MEDIA_SIZE_SLUG );
|
|
203
206
|
} }
|
|
@@ -208,7 +211,7 @@ export default function CoverInspectorControls( {
|
|
|
208
211
|
<ToolsPanelItem
|
|
209
212
|
label={ __( 'Fixed background' ) }
|
|
210
213
|
isShownByDefault
|
|
211
|
-
hasValue={ () => hasParallax }
|
|
214
|
+
hasValue={ () => !! hasParallax }
|
|
212
215
|
onDeselect={ () =>
|
|
213
216
|
setAttributes( {
|
|
214
217
|
hasParallax: false,
|
|
@@ -219,7 +222,7 @@ export default function CoverInspectorControls( {
|
|
|
219
222
|
<ToggleControl
|
|
220
223
|
__nextHasNoMarginBottom
|
|
221
224
|
label={ __( 'Fixed background' ) }
|
|
222
|
-
checked={ hasParallax }
|
|
225
|
+
checked={ !! hasParallax }
|
|
223
226
|
onChange={ toggleParallax }
|
|
224
227
|
/>
|
|
225
228
|
</ToolsPanelItem>
|
|
@@ -269,6 +272,16 @@ export default function CoverInspectorControls( {
|
|
|
269
272
|
/>
|
|
270
273
|
</ToolsPanelItem>
|
|
271
274
|
) }
|
|
275
|
+
{ isVideoBackground && (
|
|
276
|
+
<PosterImage
|
|
277
|
+
poster={ poster }
|
|
278
|
+
onChange={ ( posterImage ) =>
|
|
279
|
+
setAttributes( {
|
|
280
|
+
poster: posterImage?.url,
|
|
281
|
+
} )
|
|
282
|
+
}
|
|
283
|
+
/>
|
|
284
|
+
) }
|
|
272
285
|
{ ! useFeaturedImage && url && ! isVideoBackground && (
|
|
273
286
|
<ToolsPanelItem
|
|
274
287
|
label={ __( 'Alternative text' ) }
|
package/src/cover/save.js
CHANGED
|
@@ -46,6 +46,7 @@ export default function save( { attributes } ) {
|
|
|
46
46
|
minHeightUnit,
|
|
47
47
|
tagName: Tag,
|
|
48
48
|
sizeSlug,
|
|
49
|
+
poster,
|
|
49
50
|
} = attributes;
|
|
50
51
|
const overlayColorClass = getColorClassName(
|
|
51
52
|
'background-color',
|
|
@@ -137,6 +138,7 @@ export default function save( { attributes } ) {
|
|
|
137
138
|
loop
|
|
138
139
|
playsInline
|
|
139
140
|
src={ url }
|
|
141
|
+
poster={ poster }
|
|
140
142
|
style={ { objectPosition } }
|
|
141
143
|
data-object-fit="cover"
|
|
142
144
|
data-object-position={ objectPosition }
|
package/src/editor.scss
CHANGED
package/src/file/edit.js
CHANGED
|
@@ -29,6 +29,7 @@ import { __, _x } from '@wordpress/i18n';
|
|
|
29
29
|
import { file as icon } from '@wordpress/icons';
|
|
30
30
|
import { store as coreStore } from '@wordpress/core-data';
|
|
31
31
|
import { store as noticesStore } from '@wordpress/notices';
|
|
32
|
+
import { getFilename } from '@wordpress/url';
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Internal dependencies
|
|
@@ -127,7 +128,9 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
127
128
|
return;
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
const isPdf = newMedia.url
|
|
131
|
+
const isPdf = getFilename( newMedia.url )
|
|
132
|
+
.toLowerCase()
|
|
133
|
+
.endsWith( '.pdf' );
|
|
131
134
|
const pdfAttributes = {
|
|
132
135
|
displayPreview: isPdf
|
|
133
136
|
? attributes.displayPreview ?? true
|
package/src/file/style.scss
CHANGED
package/src/latest-posts/edit.js
CHANGED
|
@@ -774,7 +774,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
774
774
|
{ addLinkToFeaturedImage ? (
|
|
775
775
|
<a
|
|
776
776
|
href={ post.link }
|
|
777
|
-
rel="noreferrer noopener"
|
|
778
777
|
onClick={
|
|
779
778
|
showRedirectionPreventedNotice
|
|
780
779
|
}
|
|
@@ -789,7 +788,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
789
788
|
<a
|
|
790
789
|
className="wp-block-latest-posts__post-title"
|
|
791
790
|
href={ post.link }
|
|
792
|
-
rel="noreferrer noopener"
|
|
793
791
|
dangerouslySetInnerHTML={
|
|
794
792
|
!! titleTrimmed
|
|
795
793
|
? {
|
package/src/media-text/edit.js
CHANGED
|
@@ -175,8 +175,9 @@ function getMissingText( type ) {
|
|
|
175
175
|
* packages/block-library/src/navigation-submenu/edit.js
|
|
176
176
|
* Consider reusing this components for both blocks.
|
|
177
177
|
*/
|
|
178
|
-
function Controls( { attributes, setAttributes,
|
|
178
|
+
function Controls( { attributes, setAttributes, setIsEditingControl } ) {
|
|
179
179
|
const { label, url, description, rel, opensInNewTab } = attributes;
|
|
180
|
+
const lastURLRef = useRef( url );
|
|
180
181
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
181
182
|
return (
|
|
182
183
|
<ToolsPanel
|
|
@@ -187,6 +188,7 @@ function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {
|
|
|
187
188
|
url: '',
|
|
188
189
|
description: '',
|
|
189
190
|
rel: '',
|
|
191
|
+
opensInNewTab: false,
|
|
190
192
|
} );
|
|
191
193
|
} }
|
|
192
194
|
dropdownMenuProps={ dropdownMenuProps }
|
|
@@ -206,8 +208,8 @@ function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {
|
|
|
206
208
|
setAttributes( { label: labelValue } );
|
|
207
209
|
} }
|
|
208
210
|
autoComplete="off"
|
|
209
|
-
onFocus={ () =>
|
|
210
|
-
onBlur={ () =>
|
|
211
|
+
onFocus={ () => setIsEditingControl( true ) }
|
|
212
|
+
onBlur={ () => setIsEditingControl( false ) }
|
|
211
213
|
/>
|
|
212
214
|
</ToolsPanelItem>
|
|
213
215
|
|
|
@@ -223,14 +225,25 @@ function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {
|
|
|
223
225
|
label={ __( 'Link' ) }
|
|
224
226
|
value={ url ? safeDecodeURI( url ) : '' }
|
|
225
227
|
onChange={ ( urlValue ) => {
|
|
228
|
+
setAttributes( {
|
|
229
|
+
url: encodeURI( safeDecodeURI( urlValue ) ),
|
|
230
|
+
} );
|
|
231
|
+
} }
|
|
232
|
+
autoComplete="off"
|
|
233
|
+
type="url"
|
|
234
|
+
onFocus={ () => {
|
|
235
|
+
lastURLRef.current = url;
|
|
236
|
+
setIsEditingControl( true );
|
|
237
|
+
} }
|
|
238
|
+
onBlur={ () => {
|
|
239
|
+
// Defer the updateAttributes call to ensure entity connection isn't severed by accident.
|
|
226
240
|
updateAttributes(
|
|
227
|
-
{ url:
|
|
241
|
+
{ url: ! url ? lastURLRef.current : url },
|
|
228
242
|
setAttributes,
|
|
229
|
-
attributes
|
|
243
|
+
{ ...attributes, url: lastURLRef.current }
|
|
230
244
|
);
|
|
245
|
+
setIsEditingControl( false );
|
|
231
246
|
} }
|
|
232
|
-
autoComplete="off"
|
|
233
|
-
type="url"
|
|
234
247
|
/>
|
|
235
248
|
</ToolsPanelItem>
|
|
236
249
|
|
|
@@ -326,9 +339,10 @@ export default function NavigationLinkEdit( {
|
|
|
326
339
|
const linkUIref = useRef();
|
|
327
340
|
const prevUrl = usePrevious( url );
|
|
328
341
|
|
|
329
|
-
// Change the label using inspector causes
|
|
330
|
-
// This is a workaround to keep the focus on the
|
|
331
|
-
|
|
342
|
+
// Change the `label` and `url` using inspector causes RichText to change focus.
|
|
343
|
+
// This is a workaround to keep the focus on the field when it's focused we don't render the RichText.
|
|
344
|
+
// See: https://github.com/WordPress/gutenberg/pull/61374.
|
|
345
|
+
const [ isEditingControl, setIsEditingControl ] = useState( false );
|
|
332
346
|
|
|
333
347
|
const {
|
|
334
348
|
isAtMaxNesting,
|
|
@@ -563,14 +577,14 @@ export default function NavigationLinkEdit( {
|
|
|
563
577
|
<Controls
|
|
564
578
|
attributes={ attributes }
|
|
565
579
|
setAttributes={ setAttributes }
|
|
566
|
-
|
|
580
|
+
setIsEditingControl={ setIsEditingControl }
|
|
567
581
|
/>
|
|
568
582
|
</InspectorControls>
|
|
569
583
|
<div { ...blockProps }>
|
|
570
584
|
{ /* eslint-disable jsx-a11y/anchor-is-valid */ }
|
|
571
585
|
<a className={ classes }>
|
|
572
586
|
{ /* eslint-enable */ }
|
|
573
|
-
{ ! url ? (
|
|
587
|
+
{ ! url && ! isEditingControl ? (
|
|
574
588
|
<div className="wp-block-navigation-link__placeholder-text">
|
|
575
589
|
<span>{ missingText }</span>
|
|
576
590
|
</div>
|
|
@@ -578,7 +592,7 @@ export default function NavigationLinkEdit( {
|
|
|
578
592
|
<>
|
|
579
593
|
{ ! isInvalid &&
|
|
580
594
|
! isDraft &&
|
|
581
|
-
!
|
|
595
|
+
! isEditingControl && (
|
|
582
596
|
<>
|
|
583
597
|
<RichText
|
|
584
598
|
ref={ ref }
|
|
@@ -612,9 +626,7 @@ export default function NavigationLinkEdit( {
|
|
|
612
626
|
) }
|
|
613
627
|
</>
|
|
614
628
|
) }
|
|
615
|
-
{ ( isInvalid ||
|
|
616
|
-
isDraft ||
|
|
617
|
-
isLabelFieldFocused ) && (
|
|
629
|
+
{ ( isInvalid || isDraft || isEditingControl ) && (
|
|
618
630
|
<div
|
|
619
631
|
className={ clsx(
|
|
620
632
|
'wp-block-navigation-link__placeholder-text',
|