@wordpress/block-library 8.28.5 → 8.30.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 +7 -17
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js.map +1 -1
- package/build/avatar/edit.js.map +1 -1
- package/build/button/edit.js +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/buttons/edit.js +1 -6
- package/build/buttons/edit.js.map +1 -1
- package/build/buttons/edit.native.js +1 -7
- package/build/buttons/edit.native.js.map +1 -1
- package/build/columns/edit.js +8 -2
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-avatar/edit.js +1 -1
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit/resizable-cover-popover.js +0 -6
- package/build/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build/cover/edit.native.js.map +1 -1
- package/build/details/index.js +1 -0
- package/build/details/index.js.map +1 -1
- package/build/file/deprecated.js.map +1 -1
- package/build/file/edit.js +6 -13
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/save.js.map +1 -1
- package/build/form-input/edit.js +1 -1
- package/build/form-input/edit.js.map +1 -1
- package/build/gallery/edit.js +5 -5
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery.native.js.map +1 -1
- package/build/group/variations.js +12 -15
- package/build/group/variations.js.map +1 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js.map +1 -1
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/list/edit.js +5 -0
- package/build/list/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +1 -1
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/hooks/use-indent-list-item.js +1 -0
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +1 -0
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-space.js +16 -7
- package/build/list-item/hooks/use-space.js.map +1 -1
- package/build/media-text/media-container.native.js +1 -1
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/paragraph/edit.native.js.map +1 -1
- package/build/pattern/edit.js +23 -9
- package/build/pattern/edit.js.map +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/utils.js +7 -5
- package/build/query/utils.js.map +1 -1
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/quote/deprecated.js +111 -12
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +5 -5
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +1 -1
- package/build/quote/index.js.map +1 -1
- package/build/quote/save.js +2 -2
- package/build/quote/save.js.map +1 -1
- package/build/read-more/edit.js.map +1 -1
- package/build/search/edit.js +1 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js.map +1 -1
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-title/{edit/index.js → edit.js} +1 -1
- package/build/site-title/edit.js.map +1 -0
- package/build/social-link/edit.js.map +1 -1
- package/build/social-links/edit.native.js.map +1 -1
- package/build/spacer/edit.js.map +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/template-part/edit/index.js +53 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +2 -8
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/map-template-part-to-block-pattern.js +30 -0
- package/build/template-part/edit/utils/map-template-part-to-block-pattern.js.map +1 -0
- package/build/utils/hooks.js +55 -4
- package/build/utils/hooks.js.map +1 -1
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +7 -16
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +2 -7
- package/build/video/edit.native.js.map +1 -1
- package/build-module/audio/edit.js +10 -20
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/button/edit.js +1 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/buttons/edit.js +2 -7
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/buttons/edit.native.js +1 -7
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/columns/edit.js +8 -2
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -1
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit/resizable-cover-popover.js +1 -7
- package/build-module/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/details/index.js +1 -0
- package/build-module/details/index.js.map +1 -1
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/file/edit.js +7 -14
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/save.js.map +1 -1
- package/build-module/form-input/edit.js +1 -1
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/gallery/edit.js +5 -5
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery.native.js.map +1 -1
- package/build-module/group/variations.js +12 -15
- package/build-module/group/variations.js.map +1 -1
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/list/edit.js +5 -0
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +1 -1
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/hooks/use-indent-list-item.js +1 -0
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +1 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-space.js +17 -8
- package/build-module/list-item/hooks/use-space.js.map +1 -1
- package/build-module/media-text/media-container.native.js +1 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/paragraph/edit.native.js.map +1 -1
- package/build-module/pattern/edit.js +24 -10
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/utils.js +7 -5
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/quote/deprecated.js +112 -13
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +5 -5
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +1 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/save.js +2 -2
- package/build-module/quote/save.js.map +1 -1
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/search/edit.js +1 -1
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-title/{edit/index.js → edit.js} +1 -1
- package/build-module/site-title/edit.js.map +1 -0
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-links/edit.native.js.map +1 -1
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +57 -5
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +2 -8
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/map-template-part-to-block-pattern.js +24 -0
- package/build-module/template-part/edit/utils/map-template-part-to-block-pattern.js.map +1 -0
- package/build-module/utils/hooks.js +54 -3
- package/build-module/utils/hooks.js.map +1 -1
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +10 -19
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +2 -7
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/editor-rtl.css +4 -1
- package/build-style/editor.css +4 -1
- package/build-style/group/editor-rtl.css +1 -1
- package/build-style/group/editor.css +1 -1
- package/build-style/image/editor-rtl.css +3 -0
- package/build-style/image/editor.css +3 -0
- package/package.json +34 -34
- package/src/audio/edit.js +9 -19
- package/src/audio/edit.native.js +3 -3
- package/src/avatar/edit.js +1 -1
- package/src/avatar/index.php +12 -1
- package/src/block/index.php +2 -0
- package/src/button/edit.js +2 -2
- package/src/buttons/edit.js +3 -16
- package/src/buttons/edit.native.js +2 -18
- package/src/calendar/index.php +5 -0
- package/src/columns/edit.js +9 -2
- package/src/comment-author-avatar/edit.js +1 -1
- package/src/comments/index.php +2 -0
- package/src/cover/edit/index.js +2 -2
- package/src/cover/edit/inspector-controls.js +1 -1
- package/src/cover/edit/resizable-cover-popover.js +1 -6
- package/src/cover/edit.native.js +1 -1
- package/src/details/block.json +1 -0
- package/src/file/deprecated.js +3 -3
- package/src/file/edit.js +8 -15
- package/src/file/edit.native.js +4 -4
- package/src/file/save.js +1 -1
- package/src/form-input/edit.js +1 -1
- package/src/gallery/edit.js +6 -12
- package/src/gallery/gallery.native.js +1 -1
- package/src/gallery/test/index.native.js +1 -1
- package/src/gallery/v1/edit.js +2 -2
- package/src/gallery/v1/gallery.native.js +1 -1
- package/src/group/editor.scss +1 -1
- package/src/group/variations.js +3 -6
- package/src/image/edit.js +1 -1
- package/src/image/edit.native.js +1 -1
- package/src/image/editor.scss +6 -0
- package/src/image/image.js +2 -2
- package/src/latest-posts/edit.native.js +1 -1
- package/src/list/edit.js +5 -0
- package/src/list/ordered-list-settings.js +1 -1
- package/src/list-item/edit.native.js +1 -1
- package/src/list-item/hooks/use-indent-list-item.js +2 -0
- package/src/list-item/hooks/use-outdent-list-item.js +2 -0
- package/src/list-item/hooks/use-space.js +16 -9
- package/src/media-text/media-container.native.js +5 -3
- package/src/media-text/test/edit.native.js +58 -0
- package/src/missing/test/edit-integration.native.js +2 -1
- package/src/navigation/edit/index.js +1 -1
- package/src/navigation/edit/test/navigation-menu-selector.js +3 -3
- package/src/navigation/index.php +18 -13
- package/src/navigation-link/link-ui.js +2 -2
- package/src/paragraph/edit.native.js +1 -1
- package/src/paragraph/test/edit.native.js +36 -0
- package/src/pattern/edit.js +27 -10
- package/src/post-author-biography/index.php +4 -3
- package/src/post-author-name/index.php +4 -3
- package/src/post-excerpt/edit.js +1 -1
- package/src/post-featured-image/dimension-controls.js +4 -4
- package/src/post-featured-image/edit.js +1 -1
- package/src/post-navigation-link/edit.js +1 -1
- package/src/post-template/index.php +2 -0
- package/src/query/edit/pattern-selection-modal.js +1 -1
- package/src/query/utils.js +6 -4
- package/src/query-pagination-next/edit.js +1 -1
- package/src/query-pagination-previous/edit.js +1 -1
- package/src/quote/block.json +1 -1
- package/src/quote/deprecated.js +110 -15
- package/src/quote/edit.js +5 -5
- package/src/quote/save.js +2 -2
- package/src/quote/test/__snapshots__/transforms.native.js.snap +2 -2
- package/src/read-more/edit.js +1 -1
- package/src/search/edit.js +1 -1
- package/src/search/edit.native.js +4 -4
- package/src/site-logo/edit.js +1 -1
- package/src/social-link/edit.js +1 -1
- package/src/social-links/edit.native.js +1 -1
- package/src/spacer/edit.js +1 -1
- package/src/table-of-contents/edit.js +1 -1
- package/src/template-part/edit/index.js +91 -4
- package/src/template-part/edit/selection-modal.js +4 -8
- package/src/template-part/edit/utils/map-template-part-to-block-pattern.js +23 -0
- package/src/utils/hooks.js +53 -3
- package/src/video/edit-common-settings.js +1 -1
- package/src/video/edit.js +10 -18
- package/src/video/edit.native.js +5 -8
- package/src/video/test/edit.native.js +0 -14
- package/build/site-title/edit/index.js.map +0 -1
- package/build-module/site-title/edit/index.js.map +0 -1
- /package/src/site-title/{edit/index.js → edit.js} +0 -0
package/src/file/edit.native.js
CHANGED
|
@@ -282,7 +282,7 @@ export class FileEdit extends Component {
|
|
|
282
282
|
value={ textLinkHref }
|
|
283
283
|
onChange={ this.onChangeLinkDestinationOption }
|
|
284
284
|
options={ linkDestinationOptions }
|
|
285
|
-
hideCancelButton
|
|
285
|
+
hideCancelButton
|
|
286
286
|
/>
|
|
287
287
|
<ToggleControl
|
|
288
288
|
icon={ external }
|
|
@@ -469,7 +469,7 @@ export class FileEdit extends Component {
|
|
|
469
469
|
tagName="p"
|
|
470
470
|
underlineColorAndroid="transparent"
|
|
471
471
|
value={ fileName }
|
|
472
|
-
deleteEnter
|
|
472
|
+
deleteEnter
|
|
473
473
|
textAlign={ this.getTextAlignmentForAlignment(
|
|
474
474
|
align
|
|
475
475
|
) }
|
|
@@ -505,7 +505,7 @@ export class FileEdit extends Component {
|
|
|
505
505
|
textAlign="center"
|
|
506
506
|
minWidth={ minWidth }
|
|
507
507
|
maxWidth={ this.state.maxWidth }
|
|
508
|
-
deleteEnter
|
|
508
|
+
deleteEnter
|
|
509
509
|
style={ styles.buttonText }
|
|
510
510
|
value={ downloadButtonText }
|
|
511
511
|
placeholder={ placeholderText }
|
|
@@ -565,7 +565,7 @@ export class FileEdit extends Component {
|
|
|
565
565
|
return (
|
|
566
566
|
<MediaUpload
|
|
567
567
|
allowedTypes={ [ MEDIA_TYPE_ANY ] }
|
|
568
|
-
isReplacingMedia
|
|
568
|
+
isReplacingMedia
|
|
569
569
|
onSelect={ this.onSelectFile }
|
|
570
570
|
render={ ( { open, getMediaOptions } ) => {
|
|
571
571
|
return this.getFileComponent( open, getMediaOptions );
|
package/src/file/save.js
CHANGED
|
@@ -73,7 +73,7 @@ export default function save( { attributes } ) {
|
|
|
73
73
|
'wp-block-file__button',
|
|
74
74
|
__experimentalGetElementClassName( 'button' )
|
|
75
75
|
) }
|
|
76
|
-
download
|
|
76
|
+
download
|
|
77
77
|
aria-describedby={ describedById }
|
|
78
78
|
>
|
|
79
79
|
<RichText.Content value={ downloadButtonText } />
|
package/src/form-input/edit.js
CHANGED
|
@@ -35,7 +35,7 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
|
|
|
35
35
|
<>
|
|
36
36
|
{ 'hidden' !== type && (
|
|
37
37
|
<InspectorControls>
|
|
38
|
-
<PanelBody title={ __( '
|
|
38
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
39
39
|
{ 'checkbox' !== type && (
|
|
40
40
|
<CheckboxControl
|
|
41
41
|
label={ __( 'Inline label' ) }
|
package/src/gallery/edit.js
CHANGED
|
@@ -73,6 +73,7 @@ const MOBILE_CONTROL_PROPS_RANGE_CONTROL = Platform.isNative
|
|
|
73
73
|
? { type: 'stepper' }
|
|
74
74
|
: {};
|
|
75
75
|
|
|
76
|
+
const DEFAULT_BLOCK = { name: 'core/image' };
|
|
76
77
|
const EMPTY_ARRAY = [];
|
|
77
78
|
|
|
78
79
|
function GalleryEdit( props ) {
|
|
@@ -102,7 +103,6 @@ function GalleryEdit( props ) {
|
|
|
102
103
|
const {
|
|
103
104
|
getBlock,
|
|
104
105
|
getSettings,
|
|
105
|
-
preferredStyle,
|
|
106
106
|
innerBlockImages,
|
|
107
107
|
blockWasJustInserted,
|
|
108
108
|
multiGallerySelection,
|
|
@@ -115,15 +115,11 @@ function GalleryEdit( props ) {
|
|
|
115
115
|
getBlock: _getBlock,
|
|
116
116
|
wasBlockJustInserted,
|
|
117
117
|
} = select( blockEditorStore );
|
|
118
|
-
const preferredStyleVariations =
|
|
119
|
-
_getSettings().__experimentalPreferredStyleVariations;
|
|
120
118
|
const multiSelectedClientIds = getMultiSelectedBlockClientIds();
|
|
121
119
|
|
|
122
120
|
return {
|
|
123
121
|
getBlock: _getBlock,
|
|
124
122
|
getSettings: _getSettings,
|
|
125
|
-
preferredStyle:
|
|
126
|
-
preferredStyleVariations?.value?.[ 'core/image' ],
|
|
127
123
|
innerBlockImages:
|
|
128
124
|
_getBlock( clientId )?.innerBlocks ?? EMPTY_ARRAY,
|
|
129
125
|
blockWasJustInserted: wasBlockJustInserted(
|
|
@@ -195,10 +191,6 @@ function GalleryEdit( props ) {
|
|
|
195
191
|
let newClassName;
|
|
196
192
|
if ( imageAttributes.className && imageAttributes.className !== '' ) {
|
|
197
193
|
newClassName = imageAttributes.className;
|
|
198
|
-
} else {
|
|
199
|
-
newClassName = preferredStyle
|
|
200
|
-
? `is-style-${ preferredStyle }`
|
|
201
|
-
: undefined;
|
|
202
194
|
}
|
|
203
195
|
|
|
204
196
|
let newLinkTarget;
|
|
@@ -505,6 +497,8 @@ function GalleryEdit( props ) {
|
|
|
505
497
|
};
|
|
506
498
|
|
|
507
499
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
500
|
+
defaultBlock: DEFAULT_BLOCK,
|
|
501
|
+
directInsert: true,
|
|
508
502
|
orientation: 'horizontal',
|
|
509
503
|
renderAppender: false,
|
|
510
504
|
...nativeInnerBlockProps,
|
|
@@ -552,7 +546,7 @@ function GalleryEdit( props ) {
|
|
|
552
546
|
value={ sizeSlug }
|
|
553
547
|
options={ imageSizeOptions }
|
|
554
548
|
onChange={ updateImagesSize }
|
|
555
|
-
hideCancelButton
|
|
549
|
+
hideCancelButton
|
|
556
550
|
size="__unstable-large"
|
|
557
551
|
/>
|
|
558
552
|
) }
|
|
@@ -562,7 +556,7 @@ function GalleryEdit( props ) {
|
|
|
562
556
|
value={ linkTo }
|
|
563
557
|
onChange={ setLinkTo }
|
|
564
558
|
options={ linkOptions }
|
|
565
|
-
hideCancelButton
|
|
559
|
+
hideCancelButton
|
|
566
560
|
size="__unstable-large"
|
|
567
561
|
/>
|
|
568
562
|
<ToggleControl
|
|
@@ -608,7 +602,7 @@ function GalleryEdit( props ) {
|
|
|
608
602
|
handleUpload={ false }
|
|
609
603
|
onSelect={ updateImages }
|
|
610
604
|
name={ __( 'Add' ) }
|
|
611
|
-
multiple
|
|
605
|
+
multiple
|
|
612
606
|
mediaIds={ images
|
|
613
607
|
.filter( ( image ) => image.id )
|
|
614
608
|
.map( ( image ) => image.id ) }
|
|
@@ -100,7 +100,7 @@ export const Gallery = ( props ) => {
|
|
|
100
100
|
<BlockCaption
|
|
101
101
|
clientId={ clientId }
|
|
102
102
|
isSelected={ isCaptionSelected }
|
|
103
|
-
accessible
|
|
103
|
+
accessible
|
|
104
104
|
accessibilityLabelCreator={ ( caption ) =>
|
|
105
105
|
RichText.isEmpty( caption )
|
|
106
106
|
? /* translators: accessibility text. Empty gallery caption. */
|
package/src/gallery/v1/edit.js
CHANGED
|
@@ -411,7 +411,7 @@ function GalleryEdit( props ) {
|
|
|
411
411
|
value={ linkTo }
|
|
412
412
|
onChange={ setLinkTo }
|
|
413
413
|
options={ linkOptions }
|
|
414
|
-
hideCancelButton
|
|
414
|
+
hideCancelButton
|
|
415
415
|
/>
|
|
416
416
|
{ shouldShowSizeOptions && (
|
|
417
417
|
<SelectControl
|
|
@@ -420,7 +420,7 @@ function GalleryEdit( props ) {
|
|
|
420
420
|
value={ sizeSlug }
|
|
421
421
|
options={ imageSizeOptions }
|
|
422
422
|
onChange={ updateImagesSize }
|
|
423
|
-
hideCancelButton
|
|
423
|
+
hideCancelButton
|
|
424
424
|
/>
|
|
425
425
|
) }
|
|
426
426
|
</PanelBody>
|
|
@@ -140,7 +140,7 @@ export const Gallery = ( props ) => {
|
|
|
140
140
|
<BlockCaption
|
|
141
141
|
clientId={ clientId }
|
|
142
142
|
isSelected={ isCaptionSelected }
|
|
143
|
-
accessible
|
|
143
|
+
accessible
|
|
144
144
|
accessibilityLabelCreator={ ( caption ) =>
|
|
145
145
|
RichText.isEmpty( caption )
|
|
146
146
|
? /* translators: accessibility text. Empty gallery caption. */
|
package/src/group/editor.scss
CHANGED
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
margin: 0;
|
|
66
66
|
}
|
|
67
67
|
.components-placeholder__instructions {
|
|
68
|
-
text-align: center;
|
|
69
68
|
margin-bottom: 18px;
|
|
70
69
|
}
|
|
71
70
|
.wp-block-group-placeholder__variations svg {
|
|
@@ -92,6 +91,7 @@
|
|
|
92
91
|
.components-placeholder {
|
|
93
92
|
min-height: auto;
|
|
94
93
|
padding: $grid-unit-30;
|
|
94
|
+
align-items: center;
|
|
95
95
|
}
|
|
96
96
|
.is-small,
|
|
97
97
|
.is-medium {
|
package/src/group/variations.js
CHANGED
|
@@ -42,10 +42,7 @@ const variations = [
|
|
|
42
42
|
blockAttributes.layout?.orientation === 'vertical',
|
|
43
43
|
icon: stack,
|
|
44
44
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if ( window?.__experimentalEnableGroupGridVariation ) {
|
|
48
|
-
variations.push( {
|
|
45
|
+
{
|
|
49
46
|
name: 'group-grid',
|
|
50
47
|
title: __( 'Grid' ),
|
|
51
48
|
description: __( 'Arrange blocks in a grid.' ),
|
|
@@ -54,7 +51,7 @@ if ( window?.__experimentalEnableGroupGridVariation ) {
|
|
|
54
51
|
isActive: ( blockAttributes ) =>
|
|
55
52
|
blockAttributes.layout?.type === 'grid',
|
|
56
53
|
icon: grid,
|
|
57
|
-
}
|
|
58
|
-
|
|
54
|
+
},
|
|
55
|
+
];
|
|
59
56
|
|
|
60
57
|
export default variations;
|
package/src/image/edit.js
CHANGED
|
@@ -369,7 +369,7 @@ export function ImageEdit( {
|
|
|
369
369
|
[ borderProps.className ]:
|
|
370
370
|
!! borderProps.className && ! isSingleSelected,
|
|
371
371
|
} ) }
|
|
372
|
-
withIllustration
|
|
372
|
+
withIllustration
|
|
373
373
|
icon={ lockUrlControls ? pluginsIcon : icon }
|
|
374
374
|
label={ __( 'Image' ) }
|
|
375
375
|
instructions={
|
package/src/image/edit.native.js
CHANGED
|
@@ -889,7 +889,7 @@ export class ImageEdit extends Component {
|
|
|
889
889
|
return (
|
|
890
890
|
<MediaUpload
|
|
891
891
|
allowedTypes={ [ MEDIA_TYPE_IMAGE ] }
|
|
892
|
-
isReplacingMedia
|
|
892
|
+
isReplacingMedia
|
|
893
893
|
onSelect={ this.onSelectMediaUploadOption }
|
|
894
894
|
onSelectURL={ this.onSelectURL }
|
|
895
895
|
render={ ( { open, getMediaOptions } ) => {
|
package/src/image/editor.scss
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// Provide special styling for the placeholder.
|
|
2
2
|
// @todo: this particular minimal style of placeholder could be componentized further.
|
|
3
3
|
.wp-block-image.wp-block-image {
|
|
4
|
+
|
|
5
|
+
&:not(.is-selected) .components-placeholder__fieldset {
|
|
6
|
+
// Show only is selected.
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
4
10
|
// Show Placeholder style on-select.
|
|
5
11
|
&.is-selected .components-placeholder {
|
|
6
12
|
// Block UI appearance.
|
package/src/image/image.js
CHANGED
|
@@ -78,7 +78,7 @@ const ImageWrapper = ( { href, children } ) => {
|
|
|
78
78
|
<a
|
|
79
79
|
href={ href }
|
|
80
80
|
onClick={ ( event ) => event.preventDefault() }
|
|
81
|
-
aria-disabled
|
|
81
|
+
aria-disabled
|
|
82
82
|
style={ {
|
|
83
83
|
// When the Image block is linked,
|
|
84
84
|
// it's wrapped with a disabled <a /> tag.
|
|
@@ -647,7 +647,7 @@ export default function Image( {
|
|
|
647
647
|
{ isSingleSelected && (
|
|
648
648
|
<ToolsPanelItem
|
|
649
649
|
label={ __( 'Alternative text' ) }
|
|
650
|
-
isShownByDefault
|
|
650
|
+
isShownByDefault
|
|
651
651
|
hasValue={ () => !! alt }
|
|
652
652
|
onDeselect={ () =>
|
|
653
653
|
setAttributes( { alt: undefined } )
|
|
@@ -201,7 +201,7 @@ class LatestPostsEdit extends Component {
|
|
|
201
201
|
value={ featuredImageAlign }
|
|
202
202
|
onChange={ this.onSetFeaturedImageAlign }
|
|
203
203
|
controls={ [ 'left', 'center', 'right' ] }
|
|
204
|
-
isBottomSheetControl
|
|
204
|
+
isBottomSheetControl
|
|
205
205
|
/>
|
|
206
206
|
<ToggleControl
|
|
207
207
|
label={ __( 'Add link to featured image' ) }
|
package/src/list/edit.js
CHANGED
|
@@ -29,6 +29,9 @@ import OrderedListSettings from './ordered-list-settings';
|
|
|
29
29
|
import { migrateToListV2 } from './utils';
|
|
30
30
|
import TagName from './tag-name';
|
|
31
31
|
|
|
32
|
+
const DEFAULT_BLOCK = {
|
|
33
|
+
name: 'core/list-item',
|
|
34
|
+
};
|
|
32
35
|
const TEMPLATE = [ [ 'core/list-item' ] ];
|
|
33
36
|
const NATIVE_MARGIN_SPACING = 8;
|
|
34
37
|
|
|
@@ -125,6 +128,8 @@ export default function Edit( { attributes, setAttributes, clientId, style } ) {
|
|
|
125
128
|
} );
|
|
126
129
|
|
|
127
130
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
131
|
+
defaultBlock: DEFAULT_BLOCK,
|
|
132
|
+
directInsert: true,
|
|
128
133
|
template: TEMPLATE,
|
|
129
134
|
templateLock: false,
|
|
130
135
|
templateInsertUpdatesSelection: true,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
|
|
13
13
|
const OrderedListSettings = ( { setAttributes, reversed, start, type } ) => (
|
|
14
14
|
<InspectorControls>
|
|
15
|
-
<PanelBody title={ __( '
|
|
15
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
16
16
|
<TextControl
|
|
17
17
|
__nextHasNoMarginBottom
|
|
18
18
|
label={ __( 'Start value' ) }
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useRefEffect } from '@wordpress/compose';
|
|
5
|
-
import { SPACE } from '@wordpress/keycodes';
|
|
5
|
+
import { SPACE, TAB } from '@wordpress/keycodes';
|
|
6
6
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
7
7
|
import { useSelect } from '@wordpress/data';
|
|
8
8
|
|
|
@@ -10,11 +10,13 @@ import { useSelect } from '@wordpress/data';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import useIndentListItem from './use-indent-list-item';
|
|
13
|
+
import useOutdentListItem from './use-outdent-list-item';
|
|
13
14
|
|
|
14
15
|
export default function useSpace( clientId ) {
|
|
15
16
|
const { getSelectionStart, getSelectionEnd, getBlockIndex } =
|
|
16
17
|
useSelect( blockEditorStore );
|
|
17
18
|
const indentListItem = useIndentListItem( clientId );
|
|
19
|
+
const outdentListItem = useOutdentListItem();
|
|
18
20
|
|
|
19
21
|
return useRefEffect(
|
|
20
22
|
( element ) => {
|
|
@@ -23,9 +25,8 @@ export default function useSpace( clientId ) {
|
|
|
23
25
|
|
|
24
26
|
if (
|
|
25
27
|
event.defaultPrevented ||
|
|
26
|
-
keyCode !== SPACE ||
|
|
28
|
+
( keyCode !== SPACE && keyCode !== TAB ) ||
|
|
27
29
|
// Only override when no modifiers are pressed.
|
|
28
|
-
shiftKey ||
|
|
29
30
|
altKey ||
|
|
30
31
|
metaKey ||
|
|
31
32
|
ctrlKey
|
|
@@ -33,18 +34,24 @@ export default function useSpace( clientId ) {
|
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
if ( getBlockIndex( clientId ) === 0 ) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
37
|
const selectionStart = getSelectionStart();
|
|
41
38
|
const selectionEnd = getSelectionEnd();
|
|
42
39
|
if (
|
|
43
40
|
selectionStart.offset === 0 &&
|
|
44
41
|
selectionEnd.offset === 0
|
|
45
42
|
) {
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
if ( shiftKey ) {
|
|
44
|
+
// Note that backspace behaviour in defined in onMerge.
|
|
45
|
+
if ( keyCode === TAB ) {
|
|
46
|
+
if ( outdentListItem() ) {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
} else if ( getBlockIndex( clientId ) !== 0 ) {
|
|
51
|
+
if ( indentListItem() ) {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
48
55
|
}
|
|
49
56
|
}
|
|
50
57
|
|
|
@@ -265,7 +265,7 @@ class MediaContainer extends Component {
|
|
|
265
265
|
isSelected={ isSelected }
|
|
266
266
|
style={ styles.video }
|
|
267
267
|
source={ { uri: mediaUrl } }
|
|
268
|
-
paused
|
|
268
|
+
paused
|
|
269
269
|
/>
|
|
270
270
|
</View>
|
|
271
271
|
) }
|
|
@@ -329,7 +329,7 @@ class MediaContainer extends Component {
|
|
|
329
329
|
if ( mediaUrl ) {
|
|
330
330
|
return (
|
|
331
331
|
<MediaUpload
|
|
332
|
-
isReplacingMedia
|
|
332
|
+
isReplacingMedia
|
|
333
333
|
onSelect={ this.onSelectMediaUploadOption }
|
|
334
334
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
335
335
|
value={ mediaId }
|
|
@@ -341,7 +341,9 @@ class MediaContainer extends Component {
|
|
|
341
341
|
{ getMediaOptions() }
|
|
342
342
|
|
|
343
343
|
<MediaUploadProgress
|
|
344
|
-
enablePausedUploads
|
|
344
|
+
enablePausedUploads={
|
|
345
|
+
mediaType === MEDIA_TYPE_IMAGE
|
|
346
|
+
}
|
|
345
347
|
coverUrl={ coverUrl }
|
|
346
348
|
mediaId={ mediaId }
|
|
347
349
|
onUpdateMediaProgress={
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
addBlock,
|
|
6
|
+
fireEvent,
|
|
7
|
+
initializeEditor,
|
|
8
|
+
screen,
|
|
9
|
+
setupCoreBlocks,
|
|
10
|
+
} from 'test/helpers';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
import {
|
|
16
|
+
requestMediaPicker,
|
|
17
|
+
sendMediaUpload,
|
|
18
|
+
subscribeMediaUpload,
|
|
19
|
+
} from '@wordpress/react-native-bridge';
|
|
20
|
+
import { MEDIA_UPLOAD_STATE_PAUSED } from '@wordpress/block-editor';
|
|
21
|
+
|
|
22
|
+
let uploadCallBack;
|
|
23
|
+
subscribeMediaUpload.mockImplementation( ( callback ) => {
|
|
24
|
+
uploadCallBack = callback;
|
|
25
|
+
} );
|
|
26
|
+
sendMediaUpload.mockImplementation( ( payload ) => {
|
|
27
|
+
uploadCallBack( payload );
|
|
28
|
+
} );
|
|
29
|
+
|
|
30
|
+
setupCoreBlocks( [ 'core/media-text' ] );
|
|
31
|
+
|
|
32
|
+
describe( 'Media & Text block edit', () => {
|
|
33
|
+
it( 'should display an error message for failed video uploads', async () => {
|
|
34
|
+
requestMediaPicker.mockImplementation(
|
|
35
|
+
( source, filter, multiple, callback ) => {
|
|
36
|
+
callback( {
|
|
37
|
+
id: 1,
|
|
38
|
+
url: 'file://video.mp4',
|
|
39
|
+
type: 'video',
|
|
40
|
+
} );
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
await initializeEditor();
|
|
44
|
+
await addBlock( screen, 'Media & Text' );
|
|
45
|
+
fireEvent.press( screen.getByText( 'Add image or video' ) );
|
|
46
|
+
fireEvent.press( screen.getByText( 'Choose from device' ) );
|
|
47
|
+
|
|
48
|
+
sendMediaUpload( {
|
|
49
|
+
mediaId: 1,
|
|
50
|
+
state: MEDIA_UPLOAD_STATE_PAUSED,
|
|
51
|
+
progress: 0,
|
|
52
|
+
} );
|
|
53
|
+
|
|
54
|
+
expect(
|
|
55
|
+
screen.getByText( 'Failed to insert media.\nTap for more info.' )
|
|
56
|
+
).toBeVisible();
|
|
57
|
+
} );
|
|
58
|
+
} );
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
+
act,
|
|
5
6
|
fireEvent,
|
|
6
7
|
getBlock,
|
|
7
8
|
initializeEditor,
|
|
@@ -117,7 +118,7 @@ describe( 'Unsupported block', () => {
|
|
|
117
118
|
screen.getByTestId( 'bottom-sheet' ),
|
|
118
119
|
MODAL_DISMISS_EVENT
|
|
119
120
|
);
|
|
120
|
-
jest.runOnlyPendingTimers();
|
|
121
|
+
act( () => jest.runOnlyPendingTimers() );
|
|
121
122
|
} );
|
|
122
123
|
expect( requestUnsupportedBlockFallback ).toHaveBeenCalled();
|
|
123
124
|
} );
|
|
@@ -288,7 +288,7 @@ describe( 'NavigationMenuSelector', () => {
|
|
|
288
288
|
rerender(
|
|
289
289
|
<NavigationMenuSelector
|
|
290
290
|
onCreateNew={ handler }
|
|
291
|
-
createNavigationMenuIsSuccess
|
|
291
|
+
createNavigationMenuIsSuccess
|
|
292
292
|
/>
|
|
293
293
|
);
|
|
294
294
|
|
|
@@ -475,7 +475,7 @@ describe( 'NavigationMenuSelector', () => {
|
|
|
475
475
|
// // Simulate the menu being created and component being re-rendered.
|
|
476
476
|
rerender(
|
|
477
477
|
<NavigationMenuSelector
|
|
478
|
-
createNavigationMenuIsSuccess
|
|
478
|
+
createNavigationMenuIsSuccess // classic menu import creates a Navigation menu.
|
|
479
479
|
/>
|
|
480
480
|
);
|
|
481
481
|
|
|
@@ -616,7 +616,7 @@ describe( 'NavigationMenuSelector', () => {
|
|
|
616
616
|
// Simulate the menu being created and component being re-rendered.
|
|
617
617
|
rerender(
|
|
618
618
|
<NavigationMenuSelector
|
|
619
|
-
createNavigationMenuIsSuccess
|
|
619
|
+
createNavigationMenuIsSuccess // classic menu import creates a Navigation menu.
|
|
620
620
|
/>
|
|
621
621
|
);
|
|
622
622
|
|
package/src/navigation/index.php
CHANGED
|
@@ -544,7 +544,6 @@ class WP_Navigation_Block_Renderer {
|
|
|
544
544
|
* Gets the nav element directives.
|
|
545
545
|
*
|
|
546
546
|
* @param bool $is_interactive Whether the block is interactive.
|
|
547
|
-
* @param array $attributes The block attributes.
|
|
548
547
|
* @return string the directives for the navigation element.
|
|
549
548
|
*/
|
|
550
549
|
private static function get_nav_element_directives( $is_interactive ) {
|
|
@@ -1458,13 +1457,18 @@ function block_core_navigation_set_ignored_hooked_blocks_metadata( $inner_blocks
|
|
|
1458
1457
|
/**
|
|
1459
1458
|
* Updates the post meta with the list of ignored hooked blocks when the navigation is created or updated via the REST API.
|
|
1460
1459
|
*
|
|
1461
|
-
* @param
|
|
1460
|
+
* @param stdClass $post Post object.
|
|
1462
1461
|
*/
|
|
1463
1462
|
function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
|
|
1464
1463
|
// We run the Block Hooks mechanism to inject the `metadata.ignoredHookedBlocks` attribute into
|
|
1465
1464
|
// all anchor blocks. For the root level, we create a mock Navigation and extract them from there.
|
|
1466
1465
|
$blocks = parse_blocks( $post->post_content );
|
|
1467
|
-
|
|
1466
|
+
|
|
1467
|
+
// Block Hooks logic requires a `WP_Post` object (rather than the `stdClass` with the updates that
|
|
1468
|
+
// we're getting from the `rest_pre_insert_wp_navigation` filter) as its second argument (to be
|
|
1469
|
+
// used as context for hooked blocks insertion).
|
|
1470
|
+
// We thus have to look it up from the DB,based on `$post->ID`.
|
|
1471
|
+
$markup = block_core_navigation_set_ignored_hooked_blocks_metadata( $blocks, get_post( $post->ID ) );
|
|
1468
1472
|
|
|
1469
1473
|
$root_nav_block = parse_blocks( $markup )[0];
|
|
1470
1474
|
$ignored_hooked_blocks = isset( $root_nav_block['attrs']['metadata']['ignoredHookedBlocks'] )
|
|
@@ -1480,14 +1484,8 @@ function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
|
|
|
1480
1484
|
update_post_meta( $post->ID, '_wp_ignored_hooked_blocks', json_encode( $ignored_hooked_blocks ) );
|
|
1481
1485
|
}
|
|
1482
1486
|
|
|
1483
|
-
$
|
|
1484
|
-
|
|
1485
|
-
wp_update_post(
|
|
1486
|
-
array(
|
|
1487
|
-
'ID' => $post->ID,
|
|
1488
|
-
'post_content' => $serialized_inner_blocks,
|
|
1489
|
-
)
|
|
1490
|
-
);
|
|
1487
|
+
$post->post_content = block_core_navigation_remove_serialized_parent_block( $markup );
|
|
1488
|
+
return $post;
|
|
1491
1489
|
}
|
|
1492
1490
|
|
|
1493
1491
|
// Before adding our filter, we verify if it's already added in Core.
|
|
@@ -1497,8 +1495,15 @@ $rest_insert_wp_navigation_core_callback = 'block_core_navigation_' . 'update_ig
|
|
|
1497
1495
|
|
|
1498
1496
|
// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.5
|
|
1499
1497
|
// that are not present in Gutenberg's WP 6.5 compatibility layer.
|
|
1500
|
-
if ( function_exists( 'set_ignored_hooked_blocks_metadata' ) && ! has_filter( '
|
|
1501
|
-
|
|
1498
|
+
if ( function_exists( 'set_ignored_hooked_blocks_metadata' ) && ! has_filter( 'rest_pre_insert_wp_navigation', $rest_insert_wp_navigation_core_callback ) ) {
|
|
1499
|
+
add_filter( 'rest_pre_insert_wp_navigation', 'block_core_navigation_update_ignore_hooked_blocks_meta', 10 );
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
// Previous versions of Gutenberg and WordPress 6.5 Betas were attaching the block_core_navigation_update_ignore_hooked_blocks_meta
|
|
1503
|
+
// function to the `rest_insert_wp_navigation` _action_ (rather than the `rest_pre_insert_wp_navigation` _filter_).
|
|
1504
|
+
// To avoid collisions, we need to remove the filter from that action if it's present.
|
|
1505
|
+
if ( has_filter( 'rest_insert_wp_navigation', $rest_insert_wp_navigation_core_callback ) ) {
|
|
1506
|
+
remove_filter( 'rest_insert_wp_navigation', $rest_insert_wp_navigation_core_callback, 10 );
|
|
1502
1507
|
}
|
|
1503
1508
|
|
|
1504
1509
|
/**
|
|
@@ -137,7 +137,7 @@ function LinkUIBlockInserter( { clientId, onBack, onSelectBlock } ) {
|
|
|
137
137
|
clientId={ clientId }
|
|
138
138
|
isAppender={ false }
|
|
139
139
|
prioritizePatterns={ false }
|
|
140
|
-
selectBlockOnInsert
|
|
140
|
+
selectBlockOnInsert
|
|
141
141
|
hasSearch={ false }
|
|
142
142
|
onSelect={ onSelectBlock }
|
|
143
143
|
/>
|
|
@@ -247,7 +247,7 @@ export function LinkUI( props ) {
|
|
|
247
247
|
hasTextControl
|
|
248
248
|
hasRichPreviews
|
|
249
249
|
value={ link }
|
|
250
|
-
showInitialSuggestions
|
|
250
|
+
showInitialSuggestions
|
|
251
251
|
withCreateSuggestion={ userCanCreate }
|
|
252
252
|
createSuggestion={ handleCreate }
|
|
253
253
|
createSuggestionButtonText={ ( searchTerm ) => {
|