@wordpress/block-library 8.14.0 → 8.16.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/avatar/edit.js +1 -0
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/index.js +3 -0
- package/build/avatar/index.js.map +1 -1
- package/build/block/edit.js +2 -30
- package/build/block/edit.js.map +1 -1
- package/build/block/index.js +2 -1
- package/build/block/index.js.map +1 -1
- package/build/buttons/edit.js +2 -2
- package/build/buttons/edit.js.map +1 -1
- package/build/column/edit.native.js +1 -4
- package/build/column/edit.native.js.map +1 -1
- package/build/columns/edit.js +1 -0
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-avatar/edit.js +1 -0
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/cover/deprecated.js +4 -2
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/index.js +2 -1
- package/build/cover/index.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +37 -13
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/file/index.js +1 -2
- package/build/file/index.js.map +1 -1
- package/build/file/inspector.js +1 -0
- package/build/file/inspector.js.map +1 -1
- package/build/file/view-interactivity.js +23 -0
- package/build/file/view-interactivity.js.map +1 -0
- package/build/file/view.js +1 -15
- package/build/file/view.js.map +1 -1
- package/build/footnotes/edit.js +31 -1
- package/build/footnotes/edit.js.map +1 -1
- package/build/footnotes/format.js +119 -23
- package/build/footnotes/format.js.map +1 -1
- package/build/footnotes/index.js +45 -4
- package/build/footnotes/index.js.map +1 -1
- package/build/gallery/edit.js +8 -6
- package/build/gallery/edit.js.map +1 -1
- package/build/image/deprecated.js +106 -2
- package/build/image/deprecated.js.map +1 -1
- package/build/image/image.js +2 -2
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +2 -1
- package/build/image/index.js.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/latest-comments/edit.js +1 -0
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/edit.js +2 -0
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/edit.js +4 -4
- package/build/list/edit.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +10 -1
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/media-text/media-container.native.js +2 -1
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/missing/edit.native.js +7 -5
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/constants.js +10 -4
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/edit/index.js +16 -2
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +2 -2
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +1 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +4 -4
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +10 -15
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/index.js +2 -3
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +33 -45
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/view-interactivity.js +185 -0
- package/build/navigation/view-interactivity.js.map +1 -0
- package/build/navigation/view-modal.js +125 -0
- package/build/navigation/view-modal.js.map +1 -0
- package/build/navigation/view.js +71 -163
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +12 -7
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -2
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/pattern/edit.js +28 -4
- package/build/pattern/edit.js.map +1 -1
- package/build/preformatted/index.js +4 -0
- package/build/preformatted/index.js.map +1 -1
- package/build/query-pagination/edit.js +1 -1
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-title/edit.js +43 -1
- package/build/query-title/edit.js.map +1 -1
- package/build/quote/transforms.js +8 -0
- package/build/quote/transforms.js.map +1 -1
- package/build/rss/edit.js +3 -0
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.js +4 -3
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +1 -0
- package/build/search/index.js.map +1 -1
- package/build/search/view.js +166 -62
- package/build/search/view.js.map +1 -1
- package/build/site-logo/edit.js +1 -0
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-link/icons/index.js +13 -0
- package/build/social-link/icons/index.js.map +1 -1
- package/build/social-link/icons/threads.js +25 -0
- package/build/social-link/icons/threads.js.map +1 -0
- package/build/social-link/variations.js +7 -0
- package/build/social-link/variations.js.map +1 -1
- package/build/tag-cloud/edit.js +1 -0
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/import-controls.js +1 -1
- package/build/template-part/edit/import-controls.js.map +1 -1
- package/build/template-part/edit/index.js +1 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/text-columns/edit.js +1 -0
- package/build/text-columns/edit.js.map +1 -1
- package/build-module/avatar/edit.js +1 -0
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/index.js +3 -0
- package/build-module/avatar/index.js.map +1 -1
- package/build-module/block/edit.js +4 -29
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/index.js +2 -1
- package/build-module/block/index.js.map +1 -1
- package/build-module/buttons/edit.js +2 -2
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/column/edit.native.js +1 -4
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/columns/edit.js +1 -0
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -0
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/cover/deprecated.js +4 -2
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/index.js +2 -1
- package/build-module/cover/index.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +37 -14
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/file/index.js +1 -2
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/inspector.js +1 -0
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/file/view-interactivity.js +19 -0
- package/build-module/file/view-interactivity.js.map +1 -0
- package/build-module/file/view.js +2 -15
- package/build-module/file/view.js.map +1 -1
- package/build-module/footnotes/edit.js +29 -2
- package/build-module/footnotes/edit.js.map +1 -1
- package/build-module/footnotes/format.js +120 -25
- package/build-module/footnotes/format.js.map +1 -1
- package/build-module/footnotes/index.js +45 -4
- package/build-module/footnotes/index.js.map +1 -1
- package/build-module/gallery/edit.js +8 -6
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/image/deprecated.js +107 -3
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/image.js +2 -2
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +2 -1
- package/build-module/image/index.js.map +1 -1
- package/build-module/index.js +3 -1
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/edit.js +1 -0
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -0
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/edit.js +4 -4
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +10 -1
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/media-text/media-container.native.js +2 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/missing/edit.native.js +8 -6
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/constants.js +8 -3
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/edit/index.js +17 -3
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +2 -2
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +4 -4
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +10 -14
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/index.js +2 -3
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +35 -47
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/view-interactivity.js +182 -0
- package/build-module/navigation/view-interactivity.js.map +1 -0
- package/build-module/navigation/view-modal.js +120 -0
- package/build-module/navigation/view-modal.js.map +1 -0
- package/build-module/navigation/view.js +72 -163
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +12 -7
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +2 -2
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/pattern/edit.js +27 -4
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/preformatted/index.js +4 -0
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/query-pagination/edit.js +1 -1
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-title/edit.js +44 -3
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/quote/transforms.js +8 -0
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/rss/edit.js +3 -0
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +4 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +1 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/search/view.js +166 -62
- package/build-module/search/view.js.map +1 -1
- package/build-module/site-logo/edit.js +1 -0
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-link/icons/index.js +1 -0
- package/build-module/social-link/icons/index.js.map +1 -1
- package/build-module/social-link/icons/threads.js +15 -0
- package/build-module/social-link/icons/threads.js.map +1 -0
- package/build-module/social-link/variations.js +8 -1
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/tag-cloud/edit.js +1 -0
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/import-controls.js +2 -2
- package/build-module/template-part/edit/import-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/text-columns/edit.js +1 -0
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-style/details/style-rtl.css +4 -2
- package/build-style/details/style.css +4 -2
- package/build-style/footnotes/style-rtl.css +4 -3
- package/build-style/footnotes/style.css +4 -3
- package/build-style/navigation/style-rtl.css +14 -2
- package/build-style/navigation/style.css +14 -2
- package/build-style/preformatted/style-rtl.css +2 -1
- package/build-style/preformatted/style.css +2 -1
- package/build-style/query-pagination/style-rtl.css +4 -2
- package/build-style/query-pagination/style.css +4 -2
- package/build-style/social-links/style-rtl.css +7 -0
- package/build-style/social-links/style.css +7 -0
- package/build-style/style-rtl.css +36 -10
- package/build-style/style.css +36 -10
- package/build-style/video/style-rtl.css +1 -0
- package/build-style/video/style.css +1 -0
- package/package.json +33 -32
- package/src/audio/test/__snapshots__/edit.native.js.snap +118 -33
- package/src/avatar/block.json +3 -0
- package/src/avatar/edit.js +1 -0
- package/src/block/block.json +2 -1
- package/src/block/edit.js +1 -39
- package/src/block/editor.native.scss +2 -2
- package/src/buttons/edit.js +2 -2
- package/src/buttons/test/edit.native.js +4 -0
- package/src/column/edit.native.js +4 -10
- package/src/column/editor.native.scss +0 -4
- package/src/columns/edit.js +1 -0
- package/src/columns/test/edit.native.js +5 -0
- package/src/comment-author-avatar/edit.js +1 -0
- package/src/comment-template/index.php +7 -2
- package/src/cover/block.json +2 -1
- package/src/cover/deprecated.js +2 -0
- package/src/cover/test/edit.native.js +8 -0
- package/src/embed/embed-placeholder.native.js +80 -47
- package/src/embed/styles.native.scss +54 -18
- package/src/embed/test/index.native.js +13 -5
- package/src/file/block.json +1 -2
- package/src/file/index.php +20 -2
- package/src/file/inspector.js +1 -0
- package/src/file/test/__snapshots__/edit.native.js.snap +119 -33
- package/src/file/view-interactivity.js +18 -0
- package/src/file/view.js +5 -14
- package/src/footnotes/block.json +44 -2
- package/src/footnotes/edit.js +33 -2
- package/src/footnotes/format.js +90 -25
- package/src/footnotes/index.js +0 -1
- package/src/footnotes/index.php +207 -0
- package/src/footnotes/style.scss +6 -3
- package/src/gallery/edit.js +42 -38
- package/src/gallery/test/index.native.js +31 -18
- package/src/heading/test/index.native.js +4 -0
- package/src/home-link/index.php +15 -2
- package/src/image/block.json +2 -1
- package/src/image/deprecated.js +109 -3
- package/src/image/image.js +2 -2
- package/src/image/index.php +45 -8
- package/src/image/test/edit.native.js +1 -2
- package/src/index.js +5 -1
- package/src/latest-comments/edit.js +1 -0
- package/src/latest-posts/edit.js +2 -0
- package/src/list/edit.js +6 -4
- package/src/list/test/edit.native.js +134 -33
- package/src/list-item/hooks/use-merge.js +12 -5
- package/src/media-text/media-container.native.js +1 -0
- package/src/missing/edit.native.js +12 -10
- package/src/missing/style.native.scss +19 -12
- package/src/missing/test/__snapshots__/edit.native.js.snap +42 -13
- package/src/navigation/block.json +2 -3
- package/src/navigation/constants.js +12 -6
- package/src/navigation/edit/index.js +29 -1
- package/src/navigation/edit/inner-blocks.js +2 -2
- package/src/navigation/edit/menu-inspector-controls.js +1 -1
- package/src/navigation/edit/navigation-menu-selector.js +8 -4
- package/src/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +17 -21
- package/src/navigation/index.php +50 -18
- package/src/navigation/style.scss +27 -8
- package/src/navigation/use-navigation-menu.js +39 -63
- package/src/navigation/view-interactivity.js +196 -0
- package/src/navigation/view-modal.js +127 -0
- package/src/navigation/view.js +96 -185
- package/src/navigation-link/edit.js +61 -47
- package/src/navigation-submenu/edit.js +2 -2
- package/src/paragraph/test/__snapshots__/edit.native.js.snap +1 -0
- package/src/paragraph/test/edit.native.js +81 -35
- package/src/pattern/edit.js +21 -0
- package/src/pattern/index.php +13 -1
- package/src/post-template/index.php +6 -2
- package/src/post-title/index.php +8 -3
- package/src/preformatted/block.json +4 -0
- package/src/preformatted/style.scss +4 -1
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -0
- package/src/pullquote/test/edit.native.js +12 -4
- package/src/query-pagination/edit.js +17 -14
- package/src/query-title/edit.js +48 -6
- package/src/quote/test/__snapshots__/transforms.native.js.snap +10 -0
- package/src/quote/test/edit.native.js +12 -4
- package/src/quote/test/transforms.native.js +5 -1
- package/src/quote/transforms.js +13 -0
- package/src/rss/edit.js +3 -0
- package/src/search/block.json +1 -0
- package/src/search/edit.js +4 -3
- package/src/search/index.php +26 -4
- package/src/search/test/__snapshots__/edit.native.js.snap +70 -0
- package/src/search/view.js +171 -67
- package/src/site-logo/edit.js +1 -0
- package/src/social-link/icons/index.js +1 -0
- package/src/social-link/icons/threads.js +10 -0
- package/src/social-link/index.php +4 -0
- package/src/social-link/socials-with-bg.scss +5 -0
- package/src/social-link/socials-without-bg.scss +4 -0
- package/src/social-link/variations.js +7 -0
- package/src/tag-cloud/edit.js +1 -0
- package/src/template-part/edit/import-controls.js +2 -2
- package/src/template-part/edit/index.js +1 -1
- package/src/template-part/index.php +7 -16
- package/src/text-columns/edit.js +1 -0
- package/src/video/style.scss +1 -0
- package/build/gallery/shared-icon.native.js +0 -38
- package/build/gallery/shared-icon.native.js.map +0 -1
- package/build-module/gallery/shared-icon.native.js +0 -24
- package/build-module/gallery/shared-icon.native.js.map +0 -1
- package/src/gallery/shared-icon.native.js +0 -23
|
@@ -134,7 +134,7 @@ describe( 'Gallery block', () => {
|
|
|
134
134
|
// Tap on Gallery block
|
|
135
135
|
const block = await getBlock( screen, 'Gallery' );
|
|
136
136
|
fireEvent.press( block );
|
|
137
|
-
fireEvent.press( within( block ).getByText( '
|
|
137
|
+
fireEvent.press( within( block ).getByText( 'Add media' ) );
|
|
138
138
|
|
|
139
139
|
// Observe that media options picker is displayed
|
|
140
140
|
/* eslint-disable jest/no-conditional-expect */
|
|
@@ -159,9 +159,7 @@ describe( 'Gallery block', () => {
|
|
|
159
159
|
/* eslint-enable jest/no-conditional-expect */
|
|
160
160
|
} );
|
|
161
161
|
|
|
162
|
-
|
|
163
|
-
// is addressed.
|
|
164
|
-
it.skip( 'block remains selected after dimissing the media options picker', async () => {
|
|
162
|
+
it( 'block remains selected after dismissing the media options picker', async () => {
|
|
165
163
|
// Initialize with an empty gallery
|
|
166
164
|
const { getByLabelText, getByText, getByTestId } =
|
|
167
165
|
await initializeEditor( {
|
|
@@ -169,13 +167,13 @@ describe( 'Gallery block', () => {
|
|
|
169
167
|
} );
|
|
170
168
|
|
|
171
169
|
// Tap on Gallery block
|
|
172
|
-
fireEvent.press( getByText( '
|
|
170
|
+
fireEvent.press( getByText( 'Add media' ) );
|
|
173
171
|
|
|
174
172
|
// Observe that media options picker is displayed
|
|
175
173
|
expect( getByText( 'Choose images' ) ).toBeVisible();
|
|
176
174
|
expect( getByText( 'WordPress Media Library' ) ).toBeVisible();
|
|
177
175
|
|
|
178
|
-
//
|
|
176
|
+
// Dismiss the picker
|
|
179
177
|
if ( Platform.isIOS ) {
|
|
180
178
|
fireEvent.press( getByText( 'Cancel' ) );
|
|
181
179
|
} else {
|
|
@@ -283,7 +281,7 @@ describe( 'Gallery block', () => {
|
|
|
283
281
|
const { selectOption } = setupPicker( screen, MEDIA_OPTIONS );
|
|
284
282
|
|
|
285
283
|
// Upload images from device
|
|
286
|
-
fireEvent.press( getByText( '
|
|
284
|
+
fireEvent.press( getByText( 'Add media' ) );
|
|
287
285
|
selectOption( 'Choose from device' );
|
|
288
286
|
expectMediaPickerCall( 'DEVICE_MEDIA_LIBRARY', [ 'image' ], true );
|
|
289
287
|
|
|
@@ -321,7 +319,7 @@ describe( 'Gallery block', () => {
|
|
|
321
319
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
322
320
|
|
|
323
321
|
// Upload images from device
|
|
324
|
-
fireEvent.press( getByText( '
|
|
322
|
+
fireEvent.press( getByText( 'Add media' ) );
|
|
325
323
|
fireEvent.press( getByText( 'Choose from device' ) );
|
|
326
324
|
expectMediaPickerCall( 'DEVICE_MEDIA_LIBRARY', [ 'image' ], true );
|
|
327
325
|
|
|
@@ -375,7 +373,7 @@ describe( 'Gallery block', () => {
|
|
|
375
373
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
376
374
|
|
|
377
375
|
// Take a photo
|
|
378
|
-
fireEvent.press( getByText( '
|
|
376
|
+
fireEvent.press( getByText( 'Add media' ) );
|
|
379
377
|
fireEvent.press( getByText( 'Take a Photo' ) );
|
|
380
378
|
expectMediaPickerCall( 'DEVICE_CAMERA', [ 'image' ], true );
|
|
381
379
|
|
|
@@ -429,7 +427,7 @@ describe( 'Gallery block', () => {
|
|
|
429
427
|
);
|
|
430
428
|
|
|
431
429
|
// Upload images from free photo library
|
|
432
|
-
fireEvent.press( getByText( '
|
|
430
|
+
fireEvent.press( getByText( 'Add media' ) );
|
|
433
431
|
fireEvent.press( getByText( 'Free Photo Library' ) );
|
|
434
432
|
expectMediaPickerCall( 'stock-photo-library', [ 'image' ], true );
|
|
435
433
|
|
|
@@ -469,7 +467,7 @@ describe( 'Gallery block', () => {
|
|
|
469
467
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
470
468
|
|
|
471
469
|
// Upload images from device
|
|
472
|
-
fireEvent.press( getByText( '
|
|
470
|
+
fireEvent.press( getByText( 'Add media' ) );
|
|
473
471
|
fireEvent.press( getByText( 'Choose from device' ) );
|
|
474
472
|
expectMediaPickerCall( 'DEVICE_MEDIA_LIBRARY', [ 'image' ], true );
|
|
475
473
|
|
|
@@ -511,10 +509,11 @@ describe( 'Gallery block', () => {
|
|
|
511
509
|
// Reference: https://github.com/wordpress-mobile/test-cases/blob/trunk/test-cases/gutenberg/gallery.md#tc010
|
|
512
510
|
it( 'rearranges gallery items', async () => {
|
|
513
511
|
// Initialize with a gallery that contains three items
|
|
514
|
-
const { galleryBlock } =
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
512
|
+
const { getByLabelText, galleryBlock } =
|
|
513
|
+
await initializeWithGalleryBlock( {
|
|
514
|
+
numberOfItems: 3,
|
|
515
|
+
media,
|
|
516
|
+
} );
|
|
518
517
|
|
|
519
518
|
// Rearrange items (final disposition will be: Image 3 - Image 1 - Image 2)
|
|
520
519
|
const galleryItem1 = getGalleryItem( galleryBlock, 1 );
|
|
@@ -523,7 +522,7 @@ describe( 'Gallery block', () => {
|
|
|
523
522
|
fireEvent.press( galleryItem3 );
|
|
524
523
|
await act( () =>
|
|
525
524
|
fireEvent.press(
|
|
526
|
-
|
|
525
|
+
getByLabelText(
|
|
527
526
|
/Move block left from position 3 to position 2/
|
|
528
527
|
)
|
|
529
528
|
)
|
|
@@ -532,7 +531,7 @@ describe( 'Gallery block', () => {
|
|
|
532
531
|
fireEvent.press( galleryItem1 );
|
|
533
532
|
await act( () =>
|
|
534
533
|
fireEvent.press(
|
|
535
|
-
|
|
534
|
+
getByLabelText(
|
|
536
535
|
/Move block right from position 1 to position 2/
|
|
537
536
|
)
|
|
538
537
|
)
|
|
@@ -568,7 +567,7 @@ describe( 'Gallery block', () => {
|
|
|
568
567
|
);
|
|
569
568
|
|
|
570
569
|
// Upload images from other apps
|
|
571
|
-
fireEvent.press( getByText( '
|
|
570
|
+
fireEvent.press( getByText( 'Add media' ) );
|
|
572
571
|
fireEvent.press( getByText( 'Other Apps' ) );
|
|
573
572
|
expectMediaPickerCall( 'other-files', [ 'image' ], true );
|
|
574
573
|
|
|
@@ -621,6 +620,20 @@ describe( 'Gallery block', () => {
|
|
|
621
620
|
expect( getEditorHtml() ).toMatchSnapshot();
|
|
622
621
|
} );
|
|
623
622
|
|
|
623
|
+
it( 'does not display MediaReplaceFlow component within the block toolbar', async () => {
|
|
624
|
+
const screen = await initializeWithGalleryBlock( {
|
|
625
|
+
numberOfItems: 3,
|
|
626
|
+
media,
|
|
627
|
+
} );
|
|
628
|
+
const { queryByTestId } = screen;
|
|
629
|
+
|
|
630
|
+
fireEvent.press( getBlock( screen, 'Gallery' ) );
|
|
631
|
+
|
|
632
|
+
// Expect the native MediaReplaceFlow component to not be present in the block toolbar
|
|
633
|
+
const mediaReplaceFlow = queryByTestId( 'media-replace-flow' );
|
|
634
|
+
expect( mediaReplaceFlow ).toBeNull();
|
|
635
|
+
} );
|
|
636
|
+
|
|
624
637
|
// Test cases related to TC013 - Settings - Columns
|
|
625
638
|
// Reference: https://github.com/wordpress-mobile/test-cases/blob/trunk/test-cases/gutenberg/gallery.md#tc013
|
|
626
639
|
describe( 'Columns setting', () => {
|
|
@@ -71,6 +71,10 @@ describe( 'Heading block', () => {
|
|
|
71
71
|
|
|
72
72
|
// Tap one color
|
|
73
73
|
fireEvent.press( screen.getByLabelText( 'Pale pink' ) );
|
|
74
|
+
// TODO(jest-console): Fix the warning and remove the expect below.
|
|
75
|
+
expect( console ).toHaveWarnedWith(
|
|
76
|
+
`Non-serializable values were found in the navigation state. Check:\n\nColor > params.onColorChange (Function)\n\nThis can break usage such as persisting and restoring state. This might happen if you passed non-serializable values such as function, class instances etc. in params. If you need to use components with callbacks in your options, you can use 'navigation.setOptions' instead. See https://reactnavigation.org/docs/troubleshooting#i-get-the-warning-non-serializable-values-were-found-in-the-navigation-state for more details.`
|
|
77
|
+
);
|
|
74
78
|
|
|
75
79
|
// Dismiss the Block Settings modal.
|
|
76
80
|
fireEvent( blockSettingsModal, 'backdropPress' );
|
package/src/home-link/index.php
CHANGED
|
@@ -98,8 +98,15 @@ function block_core_home_link_build_li_wrapper_attributes( $context ) {
|
|
|
98
98
|
$colors['css_classes'],
|
|
99
99
|
$font_sizes['css_classes']
|
|
100
100
|
);
|
|
101
|
-
$classes[] = 'wp-block-navigation-item';
|
|
102
101
|
$style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] );
|
|
102
|
+
$classes[] = 'wp-block-navigation-item';
|
|
103
|
+
|
|
104
|
+
if ( is_front_page() ) {
|
|
105
|
+
$classes[] = 'current-menu-item';
|
|
106
|
+
} elseif ( is_home() && ( (int) get_option( 'page_for_posts' ) !== get_queried_object_id() ) ) {
|
|
107
|
+
// Edge case where the Reading settings has a posts page set but not a static homepage.
|
|
108
|
+
$classes[] = 'current-menu-item';
|
|
109
|
+
}
|
|
103
110
|
|
|
104
111
|
$wrapper_attributes = get_block_wrapper_attributes(
|
|
105
112
|
array(
|
|
@@ -124,8 +131,14 @@ function render_block_core_home_link( $attributes, $content, $block ) {
|
|
|
124
131
|
if ( empty( $attributes['label'] ) ) {
|
|
125
132
|
return '';
|
|
126
133
|
}
|
|
134
|
+
$aria_current = '';
|
|
127
135
|
|
|
128
|
-
|
|
136
|
+
if ( is_front_page() ) {
|
|
137
|
+
$aria_current = ' aria-current="page"';
|
|
138
|
+
} elseif ( is_home() && ( (int) get_option( 'page_for_posts' ) !== get_queried_object_id() ) ) {
|
|
139
|
+
// Edge case where the Reading settings has a posts page set but not a static homepage.
|
|
140
|
+
$aria_current = ' aria-current="page"';
|
|
141
|
+
}
|
|
129
142
|
|
|
130
143
|
return sprintf(
|
|
131
144
|
'<li %1$s><a class="wp-block-home-link__content wp-block-navigation-item__content" href="%2$s" rel="home"%3$s>%4$s</a></li>',
|
package/src/image/block.json
CHANGED
package/src/image/deprecated.js
CHANGED
|
@@ -9,7 +9,8 @@ import classnames from 'classnames';
|
|
|
9
9
|
import {
|
|
10
10
|
RichText,
|
|
11
11
|
useBlockProps,
|
|
12
|
-
__experimentalGetElementClassName
|
|
12
|
+
__experimentalGetElementClassName,
|
|
13
|
+
__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
|
|
13
14
|
} from '@wordpress/block-editor';
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -545,11 +546,114 @@ const v5 = {
|
|
|
545
546
|
|
|
546
547
|
/**
|
|
547
548
|
* Deprecation for adding width and height as style rules on the inner img.
|
|
548
|
-
* It also updates the widht and height attributes to be strings instead of numbers.
|
|
549
549
|
*
|
|
550
550
|
* @see https://github.com/WordPress/gutenberg/pull/31366
|
|
551
551
|
*/
|
|
552
552
|
const v6 = {
|
|
553
|
+
attributes: {
|
|
554
|
+
align: {
|
|
555
|
+
type: 'string',
|
|
556
|
+
},
|
|
557
|
+
url: {
|
|
558
|
+
type: 'string',
|
|
559
|
+
source: 'attribute',
|
|
560
|
+
selector: 'img',
|
|
561
|
+
attribute: 'src',
|
|
562
|
+
__experimentalRole: 'content',
|
|
563
|
+
},
|
|
564
|
+
alt: {
|
|
565
|
+
type: 'string',
|
|
566
|
+
source: 'attribute',
|
|
567
|
+
selector: 'img',
|
|
568
|
+
attribute: 'alt',
|
|
569
|
+
default: '',
|
|
570
|
+
__experimentalRole: 'content',
|
|
571
|
+
},
|
|
572
|
+
caption: {
|
|
573
|
+
type: 'string',
|
|
574
|
+
source: 'html',
|
|
575
|
+
selector: 'figcaption',
|
|
576
|
+
__experimentalRole: 'content',
|
|
577
|
+
},
|
|
578
|
+
title: {
|
|
579
|
+
type: 'string',
|
|
580
|
+
source: 'attribute',
|
|
581
|
+
selector: 'img',
|
|
582
|
+
attribute: 'title',
|
|
583
|
+
__experimentalRole: 'content',
|
|
584
|
+
},
|
|
585
|
+
href: {
|
|
586
|
+
type: 'string',
|
|
587
|
+
source: 'attribute',
|
|
588
|
+
selector: 'figure > a',
|
|
589
|
+
attribute: 'href',
|
|
590
|
+
__experimentalRole: 'content',
|
|
591
|
+
},
|
|
592
|
+
rel: {
|
|
593
|
+
type: 'string',
|
|
594
|
+
source: 'attribute',
|
|
595
|
+
selector: 'figure > a',
|
|
596
|
+
attribute: 'rel',
|
|
597
|
+
},
|
|
598
|
+
linkClass: {
|
|
599
|
+
type: 'string',
|
|
600
|
+
source: 'attribute',
|
|
601
|
+
selector: 'figure > a',
|
|
602
|
+
attribute: 'class',
|
|
603
|
+
},
|
|
604
|
+
id: {
|
|
605
|
+
type: 'number',
|
|
606
|
+
__experimentalRole: 'content',
|
|
607
|
+
},
|
|
608
|
+
width: {
|
|
609
|
+
type: 'number',
|
|
610
|
+
},
|
|
611
|
+
height: {
|
|
612
|
+
type: 'number',
|
|
613
|
+
},
|
|
614
|
+
aspectRatio: {
|
|
615
|
+
type: 'string',
|
|
616
|
+
},
|
|
617
|
+
scale: {
|
|
618
|
+
type: 'string',
|
|
619
|
+
},
|
|
620
|
+
sizeSlug: {
|
|
621
|
+
type: 'string',
|
|
622
|
+
},
|
|
623
|
+
linkDestination: {
|
|
624
|
+
type: 'string',
|
|
625
|
+
},
|
|
626
|
+
linkTarget: {
|
|
627
|
+
type: 'string',
|
|
628
|
+
source: 'attribute',
|
|
629
|
+
selector: 'figure > a',
|
|
630
|
+
attribute: 'target',
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
supports: {
|
|
634
|
+
anchor: true,
|
|
635
|
+
behaviors: {
|
|
636
|
+
lightbox: true,
|
|
637
|
+
},
|
|
638
|
+
color: {
|
|
639
|
+
text: false,
|
|
640
|
+
background: false,
|
|
641
|
+
},
|
|
642
|
+
filter: {
|
|
643
|
+
duotone: true,
|
|
644
|
+
},
|
|
645
|
+
__experimentalBorder: {
|
|
646
|
+
color: true,
|
|
647
|
+
radius: true,
|
|
648
|
+
width: true,
|
|
649
|
+
__experimentalSkipSerialization: true,
|
|
650
|
+
__experimentalDefaultControls: {
|
|
651
|
+
color: true,
|
|
652
|
+
radius: true,
|
|
653
|
+
width: true,
|
|
654
|
+
},
|
|
655
|
+
},
|
|
656
|
+
},
|
|
553
657
|
save( { attributes } ) {
|
|
554
658
|
const {
|
|
555
659
|
url,
|
|
@@ -618,7 +722,9 @@ const v6 = {
|
|
|
618
722
|
) }
|
|
619
723
|
{ ! RichText.isEmpty( caption ) && (
|
|
620
724
|
<RichText.Content
|
|
621
|
-
className={
|
|
725
|
+
className={ __experimentalGetElementClassName(
|
|
726
|
+
'caption'
|
|
727
|
+
) }
|
|
622
728
|
tagName="figcaption"
|
|
623
729
|
value={ caption }
|
|
624
730
|
/>
|
package/src/image/image.js
CHANGED
|
@@ -566,9 +566,9 @@ export default function Image( {
|
|
|
566
566
|
className={ borderProps.className }
|
|
567
567
|
style={ {
|
|
568
568
|
width:
|
|
569
|
-
( width && height ) || aspectRatio ? '100%' :
|
|
569
|
+
( width && height ) || aspectRatio ? '100%' : undefined,
|
|
570
570
|
height:
|
|
571
|
-
( width && height ) || aspectRatio ? '100%' :
|
|
571
|
+
( width && height ) || aspectRatio ? '100%' : undefined,
|
|
572
572
|
objectFit: scale,
|
|
573
573
|
...borderProps.style,
|
|
574
574
|
} }
|
package/src/image/index.php
CHANGED
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
* Renders the `core/image` block on the server,
|
|
10
10
|
* adding a data-id attribute to the element if core/gallery has added on pre-render.
|
|
11
11
|
*
|
|
12
|
-
* @param array
|
|
13
|
-
* @param string
|
|
12
|
+
* @param array $attributes The block attributes.
|
|
13
|
+
* @param string $content The block content.
|
|
14
|
+
* @param WP_Block $block The block object.
|
|
14
15
|
* @return string Returns the block content with the data-id attribute added.
|
|
15
16
|
*/
|
|
16
|
-
function render_block_core_image( $attributes, $content ) {
|
|
17
|
+
function render_block_core_image( $attributes, $content, $block ) {
|
|
17
18
|
|
|
18
19
|
$processor = new WP_HTML_Tag_Processor( $content );
|
|
19
20
|
$processor->next_tag( 'img' );
|
|
@@ -30,14 +31,50 @@ function render_block_core_image( $attributes, $content ) {
|
|
|
30
31
|
$processor->set_attribute( 'data-id', $attributes['data-id'] );
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
$should_load_view_script = false;
|
|
35
|
+
$link_destination = isset( $attributes['linkDestination'] ) ? $attributes['linkDestination'] : 'none';
|
|
36
|
+
// Get the lightbox setting from the block attributes.
|
|
37
|
+
if ( isset( $attributes['behaviors']['lightbox'] ) ) {
|
|
38
|
+
$lightbox_settings = $attributes['behaviors']['lightbox'];
|
|
39
|
+
// If the lightbox setting is not set in the block attributes, get it from the theme.json file.
|
|
40
|
+
} else {
|
|
41
|
+
$theme_data = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data()->get_data();
|
|
42
|
+
if ( isset( $theme_data['behaviors']['blocks'][ $block->name ]['lightbox'] ) ) {
|
|
43
|
+
$lightbox_settings = $theme_data['behaviors']['blocks'][ $block->name ]['lightbox'];
|
|
44
|
+
} else {
|
|
45
|
+
$lightbox_settings = null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// If the lightbox is enabled, the image is not linked, and the Interactivity API is enabled, load the view script.
|
|
50
|
+
if ( isset( $lightbox_settings['enabled'] ) &&
|
|
51
|
+
true === $lightbox_settings['enabled'] &&
|
|
52
|
+
'none' === $link_destination
|
|
53
|
+
) {
|
|
54
|
+
$should_load_view_script = true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
$view_js_file = 'wp-block-image-view';
|
|
58
|
+
if ( ! wp_script_is( $view_js_file ) ) {
|
|
59
|
+
$script_handles = $block->block_type->view_script_handles;
|
|
60
|
+
|
|
61
|
+
// If the script is not needed, and it is still in the `view_script_handles`, remove it.
|
|
62
|
+
if ( ! $should_load_view_script && in_array( $view_js_file, $script_handles, true ) ) {
|
|
63
|
+
$block->block_type->view_script_handles = array_diff( $script_handles, array( $view_js_file ) );
|
|
64
|
+
}
|
|
65
|
+
// If the script is needed, but it was previously removed, add it again.
|
|
66
|
+
if ( $should_load_view_script && ! in_array( $view_js_file, $script_handles, true ) ) {
|
|
67
|
+
$block->block_type->view_script_handles = array_merge( $script_handles, array( $view_js_file ) );
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
33
71
|
return $processor->get_updated_html();
|
|
34
72
|
}
|
|
35
73
|
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Registers the `core/image` block on server.
|
|
76
|
+
*/
|
|
39
77
|
function register_block_core_image() {
|
|
40
|
-
|
|
41
78
|
register_block_type_from_metadata(
|
|
42
79
|
__DIR__ . '/image',
|
|
43
80
|
array(
|
|
@@ -45,4 +82,4 @@ function register_block_core_image() {
|
|
|
45
82
|
)
|
|
46
83
|
);
|
|
47
84
|
}
|
|
48
|
-
add_action( 'init', 'register_block_core_image' );
|
|
85
|
+
add_action( 'init', 'register_block_core_image' );
|
|
@@ -26,7 +26,6 @@ import { select, dispatch } from '@wordpress/data';
|
|
|
26
26
|
import { store as editorStore } from '@wordpress/editor';
|
|
27
27
|
import { store as coreStore } from '@wordpress/core-data';
|
|
28
28
|
import apiFetch from '@wordpress/api-fetch';
|
|
29
|
-
import '@wordpress/jest-console';
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* Internal dependencies
|
|
@@ -442,7 +441,7 @@ describe( 'Image Block', () => {
|
|
|
442
441
|
<!-- /wp:image -->`;
|
|
443
442
|
const screen = await initializeEditor( { initialHtml } );
|
|
444
443
|
|
|
445
|
-
fireEvent.press( screen.getByText( '
|
|
444
|
+
fireEvent.press( screen.getByText( 'Add image' ) );
|
|
446
445
|
fireEvent.press( screen.getByText( 'WordPress Media Library' ) );
|
|
447
446
|
|
|
448
447
|
const expectedHtml = `<!-- wp:image {"id":${ IMAGE.id },"sizeSlug":"large","linkDestination":"none"} -->
|
package/src/index.js
CHANGED
|
@@ -282,7 +282,11 @@ export const registerCoreBlocks = (
|
|
|
282
282
|
blocks.forEach( ( { init } ) => init() );
|
|
283
283
|
|
|
284
284
|
setDefaultBlockName( paragraph.name );
|
|
285
|
-
if (
|
|
285
|
+
if (
|
|
286
|
+
window.wp &&
|
|
287
|
+
window.wp.oldEditor &&
|
|
288
|
+
blocks.some( ( { name } ) => name === classic.name )
|
|
289
|
+
) {
|
|
286
290
|
setFreeformContentHandlerName( classic.name );
|
|
287
291
|
}
|
|
288
292
|
setUnregisteredTypeHandlerName( missing.name );
|
package/src/latest-posts/edit.js
CHANGED
|
@@ -230,6 +230,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
230
230
|
displayPostContentRadio === 'excerpt' && (
|
|
231
231
|
<RangeControl
|
|
232
232
|
__nextHasNoMarginBottom
|
|
233
|
+
__next40pxDefaultSize
|
|
233
234
|
label={ __( 'Max number of words' ) }
|
|
234
235
|
value={ excerptLength }
|
|
235
236
|
onChange={ ( value ) =>
|
|
@@ -359,6 +360,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
359
360
|
{ postLayout === 'grid' && (
|
|
360
361
|
<RangeControl
|
|
361
362
|
__nextHasNoMarginBottom
|
|
363
|
+
__next40pxDefaultSize
|
|
362
364
|
label={ __( 'Columns' ) }
|
|
363
365
|
value={ columns }
|
|
364
366
|
onChange={ ( value ) =>
|
package/src/list/edit.js
CHANGED
|
@@ -177,10 +177,12 @@ export default function Edit( { attributes, setAttributes, clientId, style } ) {
|
|
|
177
177
|
{ controls }
|
|
178
178
|
{ ordered && (
|
|
179
179
|
<OrderedListSettings
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
180
|
+
{ ...{
|
|
181
|
+
setAttributes,
|
|
182
|
+
reversed,
|
|
183
|
+
start,
|
|
184
|
+
type,
|
|
185
|
+
} }
|
|
184
186
|
/>
|
|
185
187
|
) }
|
|
186
188
|
</>
|