@wordpress/block-library 8.19.12 → 8.19.14
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/build/image/deprecated.js +8 -0
- package/build/image/deprecated.js.map +1 -1
- package/build/image/image.js +34 -11
- package/build/image/image.js.map +1 -1
- package/build-module/image/deprecated.js +8 -0
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/image.js +34 -11
- package/build-module/image/image.js.map +1 -1
- package/package.json +32 -32
- package/src/image/deprecated.js +8 -0
- package/src/image/image.js +48 -29
- package/src/query/index.php +7 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.19.
|
|
3
|
+
"version": "8.19.14",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,36 +31,36 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.42.
|
|
35
|
-
"@wordpress/api-fetch": "^6.39.
|
|
36
|
-
"@wordpress/autop": "^3.42.
|
|
37
|
-
"@wordpress/blob": "^3.42.
|
|
38
|
-
"@wordpress/block-editor": "^12.10.
|
|
39
|
-
"@wordpress/blocks": "^12.19.
|
|
40
|
-
"@wordpress/components": "^25.8.
|
|
41
|
-
"@wordpress/compose": "^6.19.
|
|
42
|
-
"@wordpress/core-data": "^6.19.
|
|
43
|
-
"@wordpress/data": "^9.12.
|
|
44
|
-
"@wordpress/date": "^4.42.
|
|
45
|
-
"@wordpress/deprecated": "^3.42.
|
|
46
|
-
"@wordpress/dom": "^3.42.
|
|
47
|
-
"@wordpress/element": "^5.19.
|
|
48
|
-
"@wordpress/escape-html": "^2.42.
|
|
49
|
-
"@wordpress/hooks": "^3.42.
|
|
50
|
-
"@wordpress/html-entities": "^3.42.
|
|
51
|
-
"@wordpress/i18n": "^4.42.
|
|
52
|
-
"@wordpress/icons": "^9.33.
|
|
53
|
-
"@wordpress/interactivity": "^2.3.
|
|
54
|
-
"@wordpress/keycodes": "^3.42.
|
|
55
|
-
"@wordpress/notices": "^4.10.
|
|
56
|
-
"@wordpress/primitives": "^3.40.
|
|
57
|
-
"@wordpress/private-apis": "^0.24.
|
|
58
|
-
"@wordpress/reusable-blocks": "^4.19.
|
|
59
|
-
"@wordpress/rich-text": "^6.19.
|
|
60
|
-
"@wordpress/server-side-render": "^4.19.
|
|
61
|
-
"@wordpress/url": "^3.43.
|
|
62
|
-
"@wordpress/viewport": "^5.19.
|
|
63
|
-
"@wordpress/wordcount": "^3.42.
|
|
34
|
+
"@wordpress/a11y": "^3.42.13",
|
|
35
|
+
"@wordpress/api-fetch": "^6.39.13",
|
|
36
|
+
"@wordpress/autop": "^3.42.13",
|
|
37
|
+
"@wordpress/blob": "^3.42.13",
|
|
38
|
+
"@wordpress/block-editor": "^12.10.13",
|
|
39
|
+
"@wordpress/blocks": "^12.19.13",
|
|
40
|
+
"@wordpress/components": "^25.8.13",
|
|
41
|
+
"@wordpress/compose": "^6.19.13",
|
|
42
|
+
"@wordpress/core-data": "^6.19.13",
|
|
43
|
+
"@wordpress/data": "^9.12.13",
|
|
44
|
+
"@wordpress/date": "^4.42.13",
|
|
45
|
+
"@wordpress/deprecated": "^3.42.13",
|
|
46
|
+
"@wordpress/dom": "^3.42.13",
|
|
47
|
+
"@wordpress/element": "^5.19.13",
|
|
48
|
+
"@wordpress/escape-html": "^2.42.13",
|
|
49
|
+
"@wordpress/hooks": "^3.42.13",
|
|
50
|
+
"@wordpress/html-entities": "^3.42.13",
|
|
51
|
+
"@wordpress/i18n": "^4.42.13",
|
|
52
|
+
"@wordpress/icons": "^9.33.13",
|
|
53
|
+
"@wordpress/interactivity": "^2.3.13",
|
|
54
|
+
"@wordpress/keycodes": "^3.42.13",
|
|
55
|
+
"@wordpress/notices": "^4.10.13",
|
|
56
|
+
"@wordpress/primitives": "^3.40.13",
|
|
57
|
+
"@wordpress/private-apis": "^0.24.13",
|
|
58
|
+
"@wordpress/reusable-blocks": "^4.19.13",
|
|
59
|
+
"@wordpress/rich-text": "^6.19.13",
|
|
60
|
+
"@wordpress/server-side-render": "^4.19.13",
|
|
61
|
+
"@wordpress/url": "^3.43.13",
|
|
62
|
+
"@wordpress/viewport": "^5.19.13",
|
|
63
|
+
"@wordpress/wordcount": "^3.42.13",
|
|
64
64
|
"change-case": "^4.1.2",
|
|
65
65
|
"classnames": "^2.3.1",
|
|
66
66
|
"colord": "^2.7.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "4009590d0cb3b4de3e783fd1a76bfd0d290d1a80"
|
|
82
82
|
}
|
package/src/image/deprecated.js
CHANGED
|
@@ -1047,6 +1047,14 @@ const v8 = {
|
|
|
1047
1047
|
},
|
|
1048
1048
|
},
|
|
1049
1049
|
migrate( { width, height, ...attributes } ) {
|
|
1050
|
+
// We need to perform a check here because in cases
|
|
1051
|
+
// where attributes are added dynamically to blocks,
|
|
1052
|
+
// block invalidation overrides the isEligible() method
|
|
1053
|
+
// and forces the migration to run, so it's not guaranteed
|
|
1054
|
+
// that `behaviors` or `behaviors.lightbox` will be defined.
|
|
1055
|
+
if ( ! attributes.behaviors?.lightbox ) {
|
|
1056
|
+
return attributes;
|
|
1057
|
+
}
|
|
1050
1058
|
const {
|
|
1051
1059
|
behaviors: {
|
|
1052
1060
|
lightbox: { enabled },
|
package/src/image/image.js
CHANGED
|
@@ -83,9 +83,29 @@ const scaleOptions = [
|
|
|
83
83
|
},
|
|
84
84
|
];
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
// If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles.
|
|
87
|
+
const ImageWrapper = ( { href, children } ) => {
|
|
88
|
+
if ( ! href ) {
|
|
89
|
+
return children;
|
|
90
|
+
}
|
|
91
|
+
return (
|
|
92
|
+
<a
|
|
93
|
+
href={ href }
|
|
94
|
+
onClick={ ( event ) => event.preventDefault() }
|
|
95
|
+
aria-disabled={ true }
|
|
96
|
+
style={ {
|
|
97
|
+
// When the Image block is linked,
|
|
98
|
+
// it's wrapped with a disabled <a /> tag.
|
|
99
|
+
// Restore cursor style so it doesn't appear 'clickable'
|
|
100
|
+
// and remove pointer events. Safari needs the display property.
|
|
101
|
+
pointerEvents: 'none',
|
|
102
|
+
cursor: 'default',
|
|
103
|
+
display: 'inline',
|
|
104
|
+
} }
|
|
105
|
+
>
|
|
106
|
+
{ children }
|
|
107
|
+
</a>
|
|
108
|
+
);
|
|
89
109
|
};
|
|
90
110
|
|
|
91
111
|
export default function Image( {
|
|
@@ -653,25 +673,31 @@ export default function Image( {
|
|
|
653
673
|
|
|
654
674
|
if ( canEditImage && isEditingImage ) {
|
|
655
675
|
img = (
|
|
656
|
-
<
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
676
|
+
<ImageWrapper href={ href }>
|
|
677
|
+
<ImageEditor
|
|
678
|
+
id={ id }
|
|
679
|
+
url={ url }
|
|
680
|
+
width={ numericWidth }
|
|
681
|
+
height={ numericHeight }
|
|
682
|
+
clientWidth={ fallbackClientWidth }
|
|
683
|
+
naturalHeight={ naturalHeight }
|
|
684
|
+
naturalWidth={ naturalWidth }
|
|
685
|
+
onSaveImage={ ( imageAttributes ) =>
|
|
686
|
+
setAttributes( imageAttributes )
|
|
687
|
+
}
|
|
688
|
+
onFinishEditing={ () => {
|
|
689
|
+
setIsEditingImage( false );
|
|
690
|
+
} }
|
|
691
|
+
borderProps={ isRounded ? undefined : borderProps }
|
|
692
|
+
/>
|
|
693
|
+
</ImageWrapper>
|
|
672
694
|
);
|
|
673
695
|
} else if ( ! isResizable ) {
|
|
674
|
-
img =
|
|
696
|
+
img = (
|
|
697
|
+
<div style={ { width, height, aspectRatio } }>
|
|
698
|
+
<ImageWrapper href={ href }>{ img }</ImageWrapper>
|
|
699
|
+
</div>
|
|
700
|
+
);
|
|
675
701
|
} else {
|
|
676
702
|
const numericRatio = aspectRatio && evalAspectRatio( aspectRatio );
|
|
677
703
|
const customRatio = numericWidth / numericHeight;
|
|
@@ -774,7 +800,7 @@ export default function Image( {
|
|
|
774
800
|
} }
|
|
775
801
|
resizeRatio={ align === 'center' ? 2 : 1 }
|
|
776
802
|
>
|
|
777
|
-
{ img }
|
|
803
|
+
<ImageWrapper href={ href }>{ img }</ImageWrapper>
|
|
778
804
|
</ResizableBox>
|
|
779
805
|
);
|
|
780
806
|
}
|
|
@@ -788,14 +814,7 @@ export default function Image( {
|
|
|
788
814
|
{ /* Hide controls during upload to avoid component remount,
|
|
789
815
|
which causes duplicated image upload. */ }
|
|
790
816
|
{ ! temporaryURL && controls }
|
|
791
|
-
{
|
|
792
|
-
{ !! href ? (
|
|
793
|
-
<a href={ href } { ...disabledClickProps }>
|
|
794
|
-
{ img }
|
|
795
|
-
</a>
|
|
796
|
-
) : (
|
|
797
|
-
img
|
|
798
|
-
) }
|
|
817
|
+
{ img }
|
|
799
818
|
{ showCaption &&
|
|
800
819
|
( ! RichText.isEmpty( caption ) || isSelected ) && (
|
|
801
820
|
<RichText
|
package/src/query/index.php
CHANGED
|
@@ -44,11 +44,15 @@ function render_block_core_query( $attributes, $content, $block ) {
|
|
|
44
44
|
$block->block_type->supports['interactivity'] = true;
|
|
45
45
|
|
|
46
46
|
// Add a div to announce messages using `aria-live`.
|
|
47
|
-
$
|
|
47
|
+
$html_tag = 'div';
|
|
48
|
+
if ( ! empty( $attributes['tagName'] ) ) {
|
|
49
|
+
$html_tag = esc_attr( $attributes['tagName'] );
|
|
50
|
+
}
|
|
51
|
+
$last_tag_position = strripos( $content, '</' . $html_tag . '>' );
|
|
48
52
|
$content = substr_replace(
|
|
49
53
|
$content,
|
|
50
54
|
'<div
|
|
51
|
-
class="
|
|
55
|
+
class="screen-reader-text"
|
|
52
56
|
aria-live="polite"
|
|
53
57
|
data-wp-text="context.core.query.message"
|
|
54
58
|
></div>
|
|
@@ -57,7 +61,7 @@ function render_block_core_query( $attributes, $content, $block ) {
|
|
|
57
61
|
data-wp-class--start-animation="selectors.core.query.startAnimation"
|
|
58
62
|
data-wp-class--finish-animation="selectors.core.query.finishAnimation"
|
|
59
63
|
></div>',
|
|
60
|
-
$
|
|
64
|
+
$last_tag_position,
|
|
61
65
|
0
|
|
62
66
|
);
|
|
63
67
|
}
|