@wordpress/block-library 9.46.0 → 9.48.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.
Files changed (176) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build/button/edit.cjs +7 -4
  3. package/build/button/edit.cjs.map +3 -3
  4. package/build/columns/edit.cjs +4 -10
  5. package/build/columns/edit.cjs.map +2 -2
  6. package/build/cover/edit/inspector-controls.cjs +20 -6
  7. package/build/cover/edit/inspector-controls.cjs.map +2 -2
  8. package/build/freeform/migration-notice.cjs +1 -1
  9. package/build/freeform/migration-notice.cjs.map +1 -1
  10. package/build/home-link/block.json +7 -0
  11. package/build/home-link/edit.cjs +167 -24
  12. package/build/home-link/edit.cjs.map +3 -3
  13. package/build/html/edit.cjs +2 -4
  14. package/build/html/edit.cjs.map +2 -2
  15. package/build/html/modal.cjs +0 -4
  16. package/build/html/modal.cjs.map +2 -2
  17. package/build/image/block.json +4 -0
  18. package/build/image/deprecated.cjs +202 -4
  19. package/build/image/deprecated.cjs.map +3 -3
  20. package/build/image/image.cjs +94 -30
  21. package/build/image/image.cjs.map +2 -2
  22. package/build/image/index.cjs +23 -4
  23. package/build/image/index.cjs.map +2 -2
  24. package/build/image/save.cjs +25 -10
  25. package/build/image/save.cjs.map +2 -2
  26. package/build/image/transforms.cjs +15 -3
  27. package/build/image/transforms.cjs.map +2 -2
  28. package/build/image/use-open-image-media-editor-modal.cjs +37 -14
  29. package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
  30. package/build/list-item/hooks/use-enter.cjs +8 -4
  31. package/build/list-item/hooks/use-enter.cjs.map +3 -3
  32. package/build/list-item/hooks/use-space.cjs +8 -4
  33. package/build/list-item/hooks/use-space.cjs.map +3 -3
  34. package/build/navigation-link/edit.cjs +2 -1
  35. package/build/navigation-link/edit.cjs.map +2 -2
  36. package/build/navigation-link/shared/use-handle-link-change.cjs +19 -3
  37. package/build/navigation-link/shared/use-handle-link-change.cjs.map +3 -3
  38. package/build/navigation-submenu/edit.cjs +8 -22
  39. package/build/navigation-submenu/edit.cjs.map +2 -2
  40. package/build/paragraph/use-enter.cjs +8 -4
  41. package/build/paragraph/use-enter.cjs.map +3 -3
  42. package/build/post-date/edit.cjs +9 -1
  43. package/build/post-date/edit.cjs.map +2 -2
  44. package/build/post-featured-image/edit.cjs +6 -5
  45. package/build/post-featured-image/edit.cjs.map +2 -2
  46. package/build/site-logo/edit.cjs +5 -2
  47. package/build/site-logo/edit.cjs.map +2 -2
  48. package/build/social-link/edit.cjs.map +3 -3
  49. package/build/tab-list/edit.cjs +2 -0
  50. package/build/tab-list/edit.cjs.map +2 -2
  51. package/build/tab-panels/edit.cjs +5 -1
  52. package/build/tab-panels/edit.cjs.map +2 -2
  53. package/build/table/edit.cjs +1 -0
  54. package/build/table/edit.cjs.map +2 -2
  55. package/build/tabs/edit.cjs +1 -36
  56. package/build/tabs/edit.cjs.map +2 -2
  57. package/build-module/button/edit.mjs +12 -5
  58. package/build-module/button/edit.mjs.map +2 -2
  59. package/build-module/columns/edit.mjs +4 -10
  60. package/build-module/columns/edit.mjs.map +2 -2
  61. package/build-module/cover/edit/inspector-controls.mjs +20 -7
  62. package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
  63. package/build-module/freeform/migration-notice.mjs +1 -1
  64. package/build-module/freeform/migration-notice.mjs.map +1 -1
  65. package/build-module/home-link/block.json +7 -0
  66. package/build-module/home-link/edit.mjs +181 -26
  67. package/build-module/home-link/edit.mjs.map +2 -2
  68. package/build-module/html/edit.mjs +2 -4
  69. package/build-module/html/edit.mjs.map +2 -2
  70. package/build-module/html/modal.mjs +0 -4
  71. package/build-module/html/modal.mjs.map +2 -2
  72. package/build-module/image/block.json +4 -0
  73. package/build-module/image/deprecated.mjs +204 -5
  74. package/build-module/image/deprecated.mjs.map +2 -2
  75. package/build-module/image/image.mjs +96 -30
  76. package/build-module/image/image.mjs.map +2 -2
  77. package/build-module/image/index.mjs +23 -4
  78. package/build-module/image/index.mjs.map +2 -2
  79. package/build-module/image/save.mjs +25 -10
  80. package/build-module/image/save.mjs.map +2 -2
  81. package/build-module/image/transforms.mjs +15 -3
  82. package/build-module/image/transforms.mjs.map +2 -2
  83. package/build-module/image/use-open-image-media-editor-modal.mjs +37 -14
  84. package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
  85. package/build-module/list-item/hooks/use-enter.mjs +12 -5
  86. package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
  87. package/build-module/list-item/hooks/use-space.mjs +12 -5
  88. package/build-module/list-item/hooks/use-space.mjs.map +2 -2
  89. package/build-module/navigation-link/edit.mjs +2 -1
  90. package/build-module/navigation-link/edit.mjs.map +2 -2
  91. package/build-module/navigation-link/shared/use-handle-link-change.mjs +19 -3
  92. package/build-module/navigation-link/shared/use-handle-link-change.mjs.map +2 -2
  93. package/build-module/navigation-submenu/edit.mjs +9 -23
  94. package/build-module/navigation-submenu/edit.mjs.map +2 -2
  95. package/build-module/paragraph/use-enter.mjs +12 -5
  96. package/build-module/paragraph/use-enter.mjs.map +2 -2
  97. package/build-module/post-date/edit.mjs +9 -1
  98. package/build-module/post-date/edit.mjs.map +2 -2
  99. package/build-module/post-featured-image/edit.mjs +6 -5
  100. package/build-module/post-featured-image/edit.mjs.map +2 -2
  101. package/build-module/site-logo/edit.mjs +6 -2
  102. package/build-module/site-logo/edit.mjs.map +2 -2
  103. package/build-module/social-link/edit.mjs +2 -2
  104. package/build-module/social-link/edit.mjs.map +2 -2
  105. package/build-module/tab-list/edit.mjs +2 -0
  106. package/build-module/tab-list/edit.mjs.map +2 -2
  107. package/build-module/tab-panels/edit.mjs +5 -1
  108. package/build-module/tab-panels/edit.mjs.map +2 -2
  109. package/build-module/table/edit.mjs +1 -0
  110. package/build-module/table/edit.mjs.map +2 -2
  111. package/build-module/tabs/edit.mjs +2 -37
  112. package/build-module/tabs/edit.mjs.map +2 -2
  113. package/build-style/breadcrumbs/style-rtl.css +1 -1
  114. package/build-style/breadcrumbs/style.css +1 -1
  115. package/build-style/editor-rtl.css +0 -11
  116. package/build-style/editor.css +0 -11
  117. package/build-style/gallery/editor-rtl.css +0 -11
  118. package/build-style/gallery/editor.css +0 -11
  119. package/build-style/style-rtl.css +1 -1
  120. package/build-style/style.css +1 -1
  121. package/package.json +40 -40
  122. package/src/block/edit-title.native.js +3 -3
  123. package/src/block/edit.native.js +2 -2
  124. package/src/breadcrumbs/style.scss +1 -1
  125. package/src/button/edit.js +14 -5
  126. package/src/columns/edit.js +3 -9
  127. package/src/cover/controls.native.js +2 -2
  128. package/src/cover/edit/inspector-controls.js +69 -52
  129. package/src/cover/edit.native.js +6 -4
  130. package/src/cover/focal-point-settings-button.native.js +2 -2
  131. package/src/cover/test/edit.js +70 -31
  132. package/src/embed/embed-no-preview.native.js +7 -3
  133. package/src/embed/embed-placeholder.native.js +2 -2
  134. package/src/file/edit.native.js +2 -2
  135. package/src/freeform/migration-notice.js +1 -1
  136. package/src/gallery/editor.scss +0 -14
  137. package/src/home-link/block.json +7 -0
  138. package/src/home-link/edit.js +185 -22
  139. package/src/home-link/index.php +14 -2
  140. package/src/html/edit.js +14 -12
  141. package/src/html/modal.js +0 -5
  142. package/src/image/block.json +4 -0
  143. package/src/image/deprecated.js +236 -4
  144. package/src/image/edit.native.js +2 -2
  145. package/src/image/image.js +166 -76
  146. package/src/image/index.js +20 -1
  147. package/src/image/index.php +1 -1
  148. package/src/image/save.js +39 -12
  149. package/src/image/test/use-open-image-media-editor-modal.js +101 -0
  150. package/src/image/transforms.js +21 -5
  151. package/src/image/use-open-image-media-editor-modal.js +41 -17
  152. package/src/latest-posts/edit.native.js +2 -2
  153. package/src/list-item/hooks/use-enter.js +15 -5
  154. package/src/list-item/hooks/use-space.js +15 -5
  155. package/src/list-item/list-style-type.native.js +2 -2
  156. package/src/media-text/media-container.native.js +7 -3
  157. package/src/missing/edit.native.js +4 -4
  158. package/src/missing/test/edit.native.js +3 -3
  159. package/src/navigation/test/use-navigation-menu.js +8 -2
  160. package/src/navigation-link/edit.js +1 -0
  161. package/src/navigation-link/shared/test/use-handle-link-change.test.js +212 -0
  162. package/src/navigation-link/shared/use-handle-link-change.js +36 -9
  163. package/src/navigation-submenu/edit.js +11 -28
  164. package/src/navigation-submenu/index.php +13 -0
  165. package/src/paragraph/use-enter.js +19 -5
  166. package/src/post-date/edit.js +7 -3
  167. package/src/post-featured-image/edit.js +15 -11
  168. package/src/search/edit.native.js +2 -2
  169. package/src/search/test/edit.native.js +2 -2
  170. package/src/site-logo/edit.js +7 -1
  171. package/src/social-link/edit.js +2 -2
  172. package/src/tab-list/edit.js +3 -0
  173. package/src/tab-panels/edit.js +10 -1
  174. package/src/table/edit.js +1 -0
  175. package/src/tabs/edit.js +14 -42
  176. package/src/video/edit.native.js +3 -3
@@ -710,17 +710,6 @@ html :where(.wp-block-column) {
710
710
  :root :where(figure.wp-block-gallery) > .blocks-gallery-media-placeholder-wrapper {
711
711
  flex-basis: 100%;
712
712
  }
713
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice.is-error {
714
- display: block;
715
- }
716
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice__content {
717
- margin: 4px 0;
718
- }
719
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice__dismiss {
720
- position: absolute;
721
- top: 0;
722
- left: 5px;
723
- }
724
713
  :root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .components-placeholder__label {
725
714
  display: none;
726
715
  }
@@ -712,17 +712,6 @@ html :where(.wp-block-column) {
712
712
  :root :where(figure.wp-block-gallery) > .blocks-gallery-media-placeholder-wrapper {
713
713
  flex-basis: 100%;
714
714
  }
715
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice.is-error {
716
- display: block;
717
- }
718
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice__content {
719
- margin: 4px 0;
720
- }
721
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice__dismiss {
722
- position: absolute;
723
- top: 0;
724
- right: 5px;
725
- }
726
715
  :root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .components-placeholder__label {
727
716
  display: none;
728
717
  }
@@ -96,17 +96,6 @@
96
96
  :root :where(figure.wp-block-gallery) > .blocks-gallery-media-placeholder-wrapper {
97
97
  flex-basis: 100%;
98
98
  }
99
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice.is-error {
100
- display: block;
101
- }
102
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice__content {
103
- margin: 4px 0;
104
- }
105
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice__dismiss {
106
- position: absolute;
107
- top: 0;
108
- left: 5px;
109
- }
110
99
  :root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .components-placeholder__label {
111
100
  display: none;
112
101
  }
@@ -96,17 +96,6 @@
96
96
  :root :where(figure.wp-block-gallery) > .blocks-gallery-media-placeholder-wrapper {
97
97
  flex-basis: 100%;
98
98
  }
99
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice.is-error {
100
- display: block;
101
- }
102
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice__content {
103
- margin: 4px 0;
104
- }
105
- :root :where(figure.wp-block-gallery) .wp-block-image .components-notice__dismiss {
106
- position: absolute;
107
- top: 0;
108
- right: 5px;
109
- }
110
99
  :root :where(figure.wp-block-gallery) .block-editor-media-placeholder.is-appender .components-placeholder__label {
111
100
  display: none;
112
101
  }
@@ -201,7 +201,7 @@
201
201
  align-items: center;
202
202
  }
203
203
  .wp-block-breadcrumbs li:not(:last-child)::after {
204
- content: var(--separator, "/");
204
+ content: var(--separator, "/")/"";
205
205
  margin: 0 0.5em;
206
206
  opacity: 0.7;
207
207
  }
@@ -201,7 +201,7 @@
201
201
  align-items: center;
202
202
  }
203
203
  .wp-block-breadcrumbs li:not(:last-child)::after {
204
- content: var(--separator, "/");
204
+ content: var(--separator, "/")/"";
205
205
  margin: 0 0.5em;
206
206
  opacity: 0.7;
207
207
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.46.0",
3
+ "version": "9.48.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -95,44 +95,44 @@
95
95
  ],
96
96
  "dependencies": {
97
97
  "@arraypress/waveform-player": "1.2.1",
98
- "@wordpress/a11y": "^4.46.0",
99
- "@wordpress/api-fetch": "^7.46.0",
100
- "@wordpress/autop": "^4.46.0",
101
- "@wordpress/base-styles": "^8.0.0",
102
- "@wordpress/blob": "^4.46.0",
103
- "@wordpress/block-editor": "^15.19.0",
104
- "@wordpress/blocks": "^15.19.0",
105
- "@wordpress/components": "^33.1.0",
106
- "@wordpress/compose": "^7.46.0",
107
- "@wordpress/core-data": "^7.46.0",
108
- "@wordpress/data": "^10.46.0",
109
- "@wordpress/date": "^5.46.0",
110
- "@wordpress/deprecated": "^4.46.0",
111
- "@wordpress/dom": "^4.46.0",
112
- "@wordpress/element": "^6.46.0",
113
- "@wordpress/escape-html": "^3.46.0",
114
- "@wordpress/hooks": "^4.46.0",
115
- "@wordpress/html-entities": "^4.46.0",
116
- "@wordpress/i18n": "^6.19.0",
117
- "@wordpress/icons": "^13.1.0",
118
- "@wordpress/interactivity": "^6.46.0",
119
- "@wordpress/interactivity-router": "^2.46.0",
120
- "@wordpress/keyboard-shortcuts": "^5.46.0",
121
- "@wordpress/keycodes": "^4.46.0",
122
- "@wordpress/latex-to-mathml": "^1.14.0",
123
- "@wordpress/notices": "^5.46.0",
124
- "@wordpress/patterns": "^2.46.0",
125
- "@wordpress/primitives": "^4.46.0",
126
- "@wordpress/private-apis": "^1.46.0",
127
- "@wordpress/reusable-blocks": "^5.46.0",
128
- "@wordpress/rich-text": "^7.46.0",
129
- "@wordpress/server-side-render": "^6.22.0",
130
- "@wordpress/shortcode": "^4.46.0",
131
- "@wordpress/ui": "^0.13.0",
132
- "@wordpress/upload-media": "^0.31.0",
133
- "@wordpress/url": "^4.46.0",
134
- "@wordpress/viewport": "^6.46.0",
135
- "@wordpress/wordcount": "^4.46.0",
98
+ "@wordpress/a11y": "^4.48.0",
99
+ "@wordpress/api-fetch": "^7.48.0",
100
+ "@wordpress/autop": "^4.48.0",
101
+ "@wordpress/base-styles": "^9.1.0",
102
+ "@wordpress/blob": "^4.48.0",
103
+ "@wordpress/block-editor": "^15.21.0",
104
+ "@wordpress/blocks": "^15.21.0",
105
+ "@wordpress/components": "^35.0.0",
106
+ "@wordpress/compose": "^8.1.0",
107
+ "@wordpress/core-data": "^7.48.0",
108
+ "@wordpress/data": "^10.48.0",
109
+ "@wordpress/date": "^5.48.0",
110
+ "@wordpress/deprecated": "^4.48.0",
111
+ "@wordpress/dom": "^4.48.0",
112
+ "@wordpress/element": "^8.0.0",
113
+ "@wordpress/escape-html": "^3.48.0",
114
+ "@wordpress/hooks": "^4.48.0",
115
+ "@wordpress/html-entities": "^4.48.0",
116
+ "@wordpress/i18n": "^6.21.0",
117
+ "@wordpress/icons": "^13.3.0",
118
+ "@wordpress/interactivity": "^6.48.0",
119
+ "@wordpress/interactivity-router": "^2.48.0",
120
+ "@wordpress/keyboard-shortcuts": "^5.48.0",
121
+ "@wordpress/keycodes": "^4.48.0",
122
+ "@wordpress/latex-to-mathml": "^1.16.0",
123
+ "@wordpress/notices": "^5.48.0",
124
+ "@wordpress/patterns": "^2.48.0",
125
+ "@wordpress/primitives": "^4.48.0",
126
+ "@wordpress/private-apis": "^1.48.0",
127
+ "@wordpress/reusable-blocks": "^5.48.0",
128
+ "@wordpress/rich-text": "^7.48.0",
129
+ "@wordpress/server-side-render": "^6.24.0",
130
+ "@wordpress/shortcode": "^4.48.0",
131
+ "@wordpress/ui": "^0.15.0",
132
+ "@wordpress/upload-media": "^0.33.0",
133
+ "@wordpress/url": "^4.48.0",
134
+ "@wordpress/viewport": "^6.48.0",
135
+ "@wordpress/wordcount": "^4.48.0",
136
136
  "change-case": "^4.1.2",
137
137
  "clsx": "^2.1.1",
138
138
  "colord": "^2.7.0",
@@ -153,5 +153,5 @@
153
153
  "publishConfig": {
154
154
  "access": "public"
155
155
  },
156
- "gitHead": "51264e33b95fadff9a06b68141e674ce9cde9675"
156
+ "gitHead": "e7856693aeb4e2522d13608cd32c994e4a97cb9c"
157
157
  }
@@ -6,7 +6,7 @@ import { Text, View } from 'react-native';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { Icon } from '@wordpress/components';
9
+ import { Icon as WCIcon } from '@wordpress/components';
10
10
  import { useGlobalStyles } from '@wordpress/block-editor';
11
11
  import { __ } from '@wordpress/i18n';
12
12
  import { withPreferredColorScheme } from '@wordpress/compose';
@@ -41,7 +41,7 @@ function EditTitle( { getStylesFromColorScheme, title } ) {
41
41
  return (
42
42
  <View style={ styles.titleContainer }>
43
43
  <View style={ styles.lockIconContainer }>
44
- <Icon
44
+ <WCIcon
45
45
  label={ __( 'Lock icon' ) }
46
46
  icon={ lock }
47
47
  size={ 16 }
@@ -52,7 +52,7 @@ function EditTitle( { getStylesFromColorScheme, title } ) {
52
52
  { title }
53
53
  </Text>
54
54
  <View style={ styles.helpIconContainer }>
55
- <Icon
55
+ <WCIcon
56
56
  label={ __( 'Help icon' ) }
57
57
  icon={ help }
58
58
  size={ 20 }
@@ -20,7 +20,7 @@ import {
20
20
  } from '@wordpress/core-data';
21
21
  import {
22
22
  BottomSheet,
23
- Icon,
23
+ Icon as WCIcon,
24
24
  Disabled,
25
25
  TextControl,
26
26
  } from '@wordpress/components';
@@ -167,7 +167,7 @@ export default function ReusableBlockEdit( {
167
167
  onClose={ closeSheet }
168
168
  >
169
169
  <View style={ styles.infoContainer }>
170
- <Icon
170
+ <WCIcon
171
171
  icon={ help }
172
172
  color={ infoSheetIconStyle.color }
173
173
  size={ styles.infoSheetIcon.size }
@@ -18,7 +18,7 @@
18
18
  align-items: center;
19
19
 
20
20
  &:not(:last-child)::after {
21
- content: var(--separator, "/");
21
+ content: var(--separator, "/") / "";
22
22
  margin: 0 0.5em;
23
23
  opacity: 0.7;
24
24
  }
@@ -39,7 +39,11 @@ import {
39
39
  getDefaultBlockName,
40
40
  getBlockBindingsSource,
41
41
  } from '@wordpress/blocks';
42
- import { useMergeRefs, useRefEffect } from '@wordpress/compose';
42
+ import {
43
+ useMergeRefs,
44
+ useRefEffect,
45
+ privateApis as composePrivateApis,
46
+ } from '@wordpress/compose';
43
47
  import { useSelect, useDispatch } from '@wordpress/data';
44
48
  import { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants';
45
49
  import { getUpdatedLinkAttributes } from './get-updated-link-attributes';
@@ -49,6 +53,7 @@ import useDeprecatedTextAlign from '../utils/deprecated-text-align-attributes';
49
53
  import { getWidthClasses, isPercentageWidth } from './utils';
50
54
 
51
55
  const { HTMLElementControl } = unlock( blockEditorPrivateApis );
56
+ const { subscribeDelegatedListener } = unlock( composePrivateApis );
52
57
 
53
58
  const LINK_SETTINGS = [
54
59
  ...LinkControl.DEFAULT_LINK_SETTINGS,
@@ -107,10 +112,14 @@ function useEnter( props ) {
107
112
  selectionChange( middle.clientId );
108
113
  }
109
114
 
110
- element.addEventListener( 'keydown', onKeyDown );
111
- return () => {
112
- element.removeEventListener( 'keydown', onKeyDown );
113
- };
115
+ // Capture phase so we run before writing-flow's ancestor-bubble
116
+ // keydown handlers that gate on `event.defaultPrevented`.
117
+ return subscribeDelegatedListener(
118
+ element,
119
+ 'keydown',
120
+ onKeyDown,
121
+ true
122
+ );
114
123
  }, [] );
115
124
  }
116
125
 
@@ -267,17 +267,12 @@ function ColumnsEditContainer( { attributes, setAttributes, clientId } ) {
267
267
  }
268
268
 
269
269
  function Placeholder( { clientId, name, setAttributes } ) {
270
- const { blockType, defaultVariation, variations } = useSelect(
270
+ const { blockType, variations } = useSelect(
271
271
  ( select ) => {
272
- const {
273
- getBlockVariations,
274
- getBlockType,
275
- getDefaultBlockVariation,
276
- } = select( blocksStore );
272
+ const { getBlockVariations, getBlockType } = select( blocksStore );
277
273
 
278
274
  return {
279
275
  blockType: getBlockType( name ),
280
- defaultVariation: getDefaultBlockVariation( name, 'block' ),
281
276
  variations: getBlockVariations( name, 'block' ),
282
277
  };
283
278
  },
@@ -293,7 +288,7 @@ function Placeholder( { clientId, name, setAttributes } ) {
293
288
  label={ blockType?.title }
294
289
  variations={ variations }
295
290
  instructions={ __( 'Divide into columns. Select a layout:' ) }
296
- onSelect={ ( nextVariation = defaultVariation ) => {
291
+ onSelect={ ( nextVariation ) => {
297
292
  if ( nextVariation.attributes ) {
298
293
  setAttributes( nextVariation.attributes );
299
294
  }
@@ -307,7 +302,6 @@ function Placeholder( { clientId, name, setAttributes } ) {
307
302
  );
308
303
  }
309
304
  } }
310
- allowSkip
311
305
  />
312
306
  </div>
313
307
  );
@@ -9,7 +9,7 @@ import Video from 'react-native-video';
9
9
  */
10
10
  import {
11
11
  Image,
12
- Icon,
12
+ Icon as WCIcon,
13
13
  IMAGE_DEFAULT_FOCAL_POINT,
14
14
  PanelBody,
15
15
  RangeControl,
@@ -138,7 +138,7 @@ function Controls( {
138
138
  ];
139
139
 
140
140
  const focalPointHint = ! hasParallax && ! displayPlaceholder && (
141
- <Icon
141
+ <WCIcon
142
142
  icon={ plus }
143
143
  size={ styles.focalPointHint?.width }
144
144
  style={ [
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import { useMemo } from '@wordpress/element';
5
5
  import {
6
- ExternalLink,
7
6
  FocalPointPicker,
8
7
  RangeControl,
9
8
  TextareaControl,
@@ -27,6 +26,7 @@ import {
27
26
  import { __ } from '@wordpress/i18n';
28
27
  import { useSelect } from '@wordpress/data';
29
28
  import { store as coreStore } from '@wordpress/core-data';
29
+ import { Link } from '@wordpress/ui';
30
30
 
31
31
  /**
32
32
  * Internal dependencies
@@ -124,9 +124,20 @@ export default function CoverInspectorControls( {
124
124
  const sizeSlug = attributes.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
125
125
 
126
126
  const { gradientValue, setGradient } = __experimentalUseGradient();
127
- const { getSettings } = useSelect( blockEditorStore );
127
+ const { imageSizes, hasSelectedStyleState } = useSelect(
128
+ ( select ) => {
129
+ const {
130
+ getSettings,
131
+ hasSelectedStyleState: hasSelectedBlockStyleState,
132
+ } = unlock( select( blockEditorStore ) );
128
133
 
129
- const imageSizes = getSettings()?.imageSizes;
134
+ return {
135
+ imageSizes: getSettings()?.imageSizes,
136
+ hasSelectedStyleState: hasSelectedBlockStyleState( clientId ),
137
+ };
138
+ },
139
+ [ clientId ]
140
+ );
130
141
 
131
142
  const image = useSelect(
132
143
  ( select ) =>
@@ -189,12 +200,15 @@ export default function CoverInspectorControls( {
189
200
 
190
201
  const colorGradientSettings = useMultipleOriginColorsAndGradients();
191
202
 
203
+ const showOverlayControls =
204
+ colorGradientSettings.hasColorsOrGradients && ! hasSelectedStyleState;
205
+
192
206
  const dropdownMenuProps = useToolsPanelDropdownMenuProps();
193
207
 
194
208
  return (
195
209
  <>
196
- <InspectorControls>
197
- { ( !! url || useFeaturedImage ) && (
210
+ { ( !! url || useFeaturedImage ) && (
211
+ <InspectorControls>
198
212
  <ToolsPanel
199
213
  label={ __( 'Settings' ) }
200
214
  resetAll={ () => {
@@ -299,7 +313,8 @@ export default function CoverInspectorControls( {
299
313
  }
300
314
  help={
301
315
  <>
302
- <ExternalLink
316
+ <Link
317
+ openInNewTab
303
318
  href={
304
319
  // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.
305
320
  __(
@@ -310,7 +325,7 @@ export default function CoverInspectorControls( {
310
325
  { __(
311
326
  'Describe the purpose of the image.'
312
327
  ) }
313
- </ExternalLink>
328
+ </Link>
314
329
  <br />
315
330
  { __(
316
331
  'Leave empty if decorative.'
@@ -329,9 +344,9 @@ export default function CoverInspectorControls( {
329
344
  />
330
345
  ) }
331
346
  </ToolsPanel>
332
- ) }
333
- </InspectorControls>
334
- { colorGradientSettings.hasColorsOrGradients && (
347
+ </InspectorControls>
348
+ ) }
349
+ { showOverlayControls && (
335
350
  <InspectorControls group="color">
336
351
  <ColorGradientSettingsDropdown
337
352
  __experimentalIsRenderedInSidebar
@@ -386,51 +401,53 @@ export default function CoverInspectorControls( {
386
401
  </ToolsPanelItem>
387
402
  </InspectorControls>
388
403
  ) }
389
- <InspectorControls group="dimensions">
390
- <ToolsPanelItem
391
- className="single-column"
392
- hasValue={ () => !! minHeight }
393
- label={ __( 'Minimum height' ) }
394
- onDeselect={ () =>
395
- setAttributes( {
396
- minHeight: undefined,
397
- minHeightUnit: undefined,
398
- } )
399
- }
400
- resetAllFilter={ () => ( {
401
- minHeight: undefined,
402
- minHeightUnit: undefined,
403
- } ) }
404
- isShownByDefault
405
- panelId={ clientId }
406
- >
407
- <CoverHeightInput
408
- value={
409
- attributes?.style?.dimensions?.aspectRatio
410
- ? ''
411
- : minHeight
412
- }
413
- unit={ minHeightUnit }
414
- onChange={ ( newMinHeight ) =>
415
- setAttributes( {
416
- minHeight: newMinHeight,
417
- style: cleanEmptyObject( {
418
- ...attributes?.style,
419
- dimensions: {
420
- ...attributes?.style?.dimensions,
421
- aspectRatio: undefined, // Reset aspect ratio when minHeight is set.
422
- },
423
- } ),
424
- } )
425
- }
426
- onUnitChange={ ( nextUnit ) =>
404
+ { ! hasSelectedStyleState && (
405
+ <InspectorControls group="dimensions">
406
+ <ToolsPanelItem
407
+ className="single-column"
408
+ hasValue={ () => !! minHeight }
409
+ label={ __( 'Minimum height' ) }
410
+ onDeselect={ () =>
427
411
  setAttributes( {
428
- minHeightUnit: nextUnit,
412
+ minHeight: undefined,
413
+ minHeightUnit: undefined,
429
414
  } )
430
415
  }
431
- />
432
- </ToolsPanelItem>
433
- </InspectorControls>
416
+ resetAllFilter={ () => ( {
417
+ minHeight: undefined,
418
+ minHeightUnit: undefined,
419
+ } ) }
420
+ isShownByDefault
421
+ panelId={ clientId }
422
+ >
423
+ <CoverHeightInput
424
+ value={
425
+ attributes?.style?.dimensions?.aspectRatio
426
+ ? ''
427
+ : minHeight
428
+ }
429
+ unit={ minHeightUnit }
430
+ onChange={ ( newMinHeight ) =>
431
+ setAttributes( {
432
+ minHeight: newMinHeight,
433
+ style: cleanEmptyObject( {
434
+ ...attributes?.style,
435
+ dimensions: {
436
+ ...attributes?.style?.dimensions,
437
+ aspectRatio: undefined, // Reset aspect ratio when minHeight is set.
438
+ },
439
+ } ),
440
+ } )
441
+ }
442
+ onUnitChange={ ( nextUnit ) =>
443
+ setAttributes( {
444
+ minHeightUnit: nextUnit,
445
+ } )
446
+ }
447
+ />
448
+ </ToolsPanelItem>
449
+ </InspectorControls>
450
+ ) }
434
451
  <InspectorControls group="advanced">
435
452
  <HTMLElementControl
436
453
  tagName={ tagName }
@@ -23,7 +23,7 @@ import {
23
23
  } from '@wordpress/react-native-bridge';
24
24
  import { __ } from '@wordpress/i18n';
25
25
  import {
26
- Icon,
26
+ Icon as WCIcon,
27
27
  Image,
28
28
  ImageEditingButton,
29
29
  IMAGE_DEFAULT_FOCAL_POINT,
@@ -354,7 +354,9 @@ const Cover = ( {
354
354
  styles.iconDark
355
355
  );
356
356
 
357
- const placeholderIcon = <Icon icon={ icon } { ...placeholderIconStyle } />;
357
+ const placeholderIcon = (
358
+ <WCIcon icon={ icon } { ...placeholderIconStyle } />
359
+ );
358
360
 
359
361
  const toolbarControls = ( open ) => (
360
362
  <BlockControls group="other">
@@ -380,7 +382,7 @@ const Cover = ( {
380
382
  >
381
383
  <View style={ styles.selectImageContainer }>
382
384
  <View style={ styles.selectImage }>
383
- <Icon
385
+ <WCIcon
384
386
  size={ 16 }
385
387
  icon={ image }
386
388
  { ...styles.selectImageIcon }
@@ -665,7 +667,7 @@ const Cover = ( {
665
667
  style={ styles.uploadFailedContainer }
666
668
  >
667
669
  <View style={ styles.uploadFailed }>
668
- <Icon
670
+ <WCIcon
669
671
  icon={ cautionFilled }
670
672
  { ...styles.uploadFailedIcon }
671
673
  />
@@ -8,7 +8,7 @@ import { View } from 'react-native';
8
8
  * WordPress dependencies
9
9
  */
10
10
  import { __ } from '@wordpress/i18n';
11
- import { Icon, BottomSheet } from '@wordpress/components';
11
+ import { Icon as WCIcon, BottomSheet } from '@wordpress/components';
12
12
  import { blockSettingsScreens } from '@wordpress/block-editor';
13
13
  import { chevronRight } from '@wordpress/icons';
14
14
 
@@ -44,7 +44,7 @@ function FocalPointSettingsButton( {
44
44
  * issue: https://github.com/react-native-svg/react-native-svg/issues/1345
45
45
  */ }
46
46
  <View style={ disabled && styles.dimmedActionButton }>
47
- <Icon icon={ chevronRight } />
47
+ <WCIcon icon={ chevronRight } />
48
48
  </View>
49
49
  </BottomSheet.Cell>
50
50
  );