@wordpress/block-editor 11.4.0 → 11.5.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 (288) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/block-inspector/index.js +11 -10
  3. package/build/components/block-inspector/index.js.map +1 -1
  4. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js +46 -0
  5. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -0
  6. package/build/components/block-lock/modal.js +1 -0
  7. package/build/components/block-lock/modal.js.map +1 -1
  8. package/build/components/block-settings-menu/block-settings-dropdown.js +2 -2
  9. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  10. package/build/components/block-styles/index.js +2 -1
  11. package/build/components/block-styles/index.js.map +1 -1
  12. package/build/components/child-layout-control/index.js +107 -0
  13. package/build/components/child-layout-control/index.js.map +1 -0
  14. package/build/components/date-format-picker/index.js +3 -3
  15. package/build/components/date-format-picker/index.js.map +1 -1
  16. package/build/components/global-styles/dimensions-panel.js +594 -0
  17. package/build/components/global-styles/dimensions-panel.js.map +1 -0
  18. package/build/components/global-styles/hooks.js +72 -36
  19. package/build/components/global-styles/hooks.js.map +1 -1
  20. package/build/components/global-styles/index.js +20 -6
  21. package/build/components/global-styles/index.js.map +1 -1
  22. package/build/components/global-styles/typography-panel.js +25 -12
  23. package/build/components/global-styles/typography-panel.js.map +1 -1
  24. package/build/components/global-styles/use-global-styles-output.js +1 -1
  25. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  26. package/build/components/global-styles/utils.js +2 -0
  27. package/build/components/global-styles/utils.js.map +1 -1
  28. package/build/components/index.native.js +23 -0
  29. package/build/components/index.native.js.map +1 -1
  30. package/build/components/inserter/media-tab/hooks.js +10 -11
  31. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  32. package/build/components/inserter/media-tab/media-list.js +5 -108
  33. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  34. package/build/components/inserter/media-tab/media-preview.js +242 -0
  35. package/build/components/inserter/media-tab/media-preview.js.map +1 -0
  36. package/build/components/inspector-controls/block-support-tools-panel.js +1 -1
  37. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  38. package/build/components/inspector-controls/fill.js +38 -9
  39. package/build/components/inspector-controls/fill.js.map +1 -1
  40. package/build/components/link-control/settings-drawer.js +1 -1
  41. package/build/components/link-control/settings-drawer.js.map +1 -1
  42. package/build/components/link-control/settings.js +1 -0
  43. package/build/components/link-control/settings.js.map +1 -1
  44. package/build/components/list-view/block.js +17 -3
  45. package/build/components/list-view/block.js.map +1 -1
  46. package/build/components/list-view/branch.js +2 -2
  47. package/build/components/list-view/branch.js.map +1 -1
  48. package/build/components/list-view/expander.js +2 -1
  49. package/build/components/list-view/expander.js.map +1 -1
  50. package/build/components/list-view/leaf.js +10 -6
  51. package/build/components/list-view/leaf.js.map +1 -1
  52. package/build/components/list-view/use-list-view-scroll-into-view.js +51 -0
  53. package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -0
  54. package/build/components/off-canvas-editor/appender.js +5 -10
  55. package/build/components/off-canvas-editor/appender.js.map +1 -1
  56. package/build/components/off-canvas-editor/branch.js +1 -0
  57. package/build/components/off-canvas-editor/branch.js.map +1 -1
  58. package/build/components/off-canvas-editor/index.js +7 -3
  59. package/build/components/off-canvas-editor/index.js.map +1 -1
  60. package/build/components/off-canvas-editor/leaf-more-menu.js +34 -4
  61. package/build/components/off-canvas-editor/leaf-more-menu.js.map +1 -1
  62. package/build/components/off-canvas-editor/link-ui.js +1 -0
  63. package/build/components/off-canvas-editor/link-ui.js.map +1 -1
  64. package/build/components/responsive-block-control/index.js +1 -0
  65. package/build/components/responsive-block-control/index.js.map +1 -1
  66. package/build/components/rich-text/index.js +9 -43
  67. package/build/components/rich-text/index.js.map +1 -1
  68. package/build/components/rich-text/use-delete.js +73 -0
  69. package/build/components/rich-text/use-delete.js.map +1 -0
  70. package/build/components/rich-text/use-input-rules.js +14 -6
  71. package/build/components/rich-text/use-input-rules.js.map +1 -1
  72. package/build/components/writing-flow/use-selection-observer.js +4 -1
  73. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  74. package/build/hooks/align.js +3 -1
  75. package/build/hooks/align.js.map +1 -1
  76. package/build/hooks/dimensions.js +72 -190
  77. package/build/hooks/dimensions.js.map +1 -1
  78. package/build/hooks/duotone.js +94 -25
  79. package/build/hooks/duotone.js.map +1 -1
  80. package/build/hooks/gap.js +0 -202
  81. package/build/hooks/gap.js.map +1 -1
  82. package/build/hooks/layout.js +14 -5
  83. package/build/hooks/layout.js.map +1 -1
  84. package/build/hooks/margin.js +7 -163
  85. package/build/hooks/margin.js.map +1 -1
  86. package/build/hooks/padding.js +7 -163
  87. package/build/hooks/padding.js.map +1 -1
  88. package/build/hooks/typography.js +50 -65
  89. package/build/hooks/typography.js.map +1 -1
  90. package/build/hooks/utils.js +75 -0
  91. package/build/hooks/utils.js.map +1 -1
  92. package/build/layouts/flex.js +1 -0
  93. package/build/layouts/flex.js.map +1 -1
  94. package/build/store/actions.js +24 -12
  95. package/build/store/actions.js.map +1 -1
  96. package/build/store/defaults.js +28 -1
  97. package/build/store/defaults.js.map +1 -1
  98. package/build/store/reducer.js +53 -47
  99. package/build/store/reducer.js.map +1 -1
  100. package/build/store/selectors.js +5 -1
  101. package/build/store/selectors.js.map +1 -1
  102. package/build/utils/parse-css-unit-to-px.js +36 -3
  103. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  104. package/build-module/components/block-inspector/index.js +9 -9
  105. package/build-module/components/block-inspector/index.js.map +1 -1
  106. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js +37 -0
  107. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -0
  108. package/build-module/components/block-lock/modal.js +1 -0
  109. package/build-module/components/block-lock/modal.js.map +1 -1
  110. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
  111. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  112. package/build-module/components/block-styles/index.js +2 -1
  113. package/build-module/components/block-styles/index.js.map +1 -1
  114. package/build-module/components/child-layout-control/index.js +98 -0
  115. package/build-module/components/child-layout-control/index.js.map +1 -0
  116. package/build-module/components/date-format-picker/index.js +4 -4
  117. package/build-module/components/date-format-picker/index.js.map +1 -1
  118. package/build-module/components/global-styles/dimensions-panel.js +574 -0
  119. package/build-module/components/global-styles/dimensions-panel.js.map +1 -0
  120. package/build-module/components/global-styles/hooks.js +71 -33
  121. package/build-module/components/global-styles/hooks.js.map +1 -1
  122. package/build-module/components/global-styles/index.js +2 -1
  123. package/build-module/components/global-styles/index.js.map +1 -1
  124. package/build-module/components/global-styles/typography-panel.js +26 -11
  125. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  126. package/build-module/components/global-styles/use-global-styles-output.js +1 -1
  127. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  128. package/build-module/components/global-styles/utils.js +2 -0
  129. package/build-module/components/global-styles/utils.js.map +1 -1
  130. package/build-module/components/index.native.js +2 -1
  131. package/build-module/components/index.native.js.map +1 -1
  132. package/build-module/components/inserter/media-tab/hooks.js +10 -11
  133. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  134. package/build-module/components/inserter/media-tab/media-list.js +6 -105
  135. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  136. package/build-module/components/inserter/media-tab/media-preview.js +222 -0
  137. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -0
  138. package/build-module/components/inspector-controls/block-support-tools-panel.js +1 -1
  139. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  140. package/build-module/components/inspector-controls/fill.js +39 -9
  141. package/build-module/components/inspector-controls/fill.js.map +1 -1
  142. package/build-module/components/link-control/settings-drawer.js +1 -1
  143. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  144. package/build-module/components/link-control/settings.js +1 -0
  145. package/build-module/components/link-control/settings.js.map +1 -1
  146. package/build-module/components/list-view/block.js +16 -3
  147. package/build-module/components/list-view/block.js.map +1 -1
  148. package/build-module/components/list-view/branch.js +2 -2
  149. package/build-module/components/list-view/branch.js.map +1 -1
  150. package/build-module/components/list-view/expander.js +2 -1
  151. package/build-module/components/list-view/expander.js.map +1 -1
  152. package/build-module/components/list-view/leaf.js +8 -4
  153. package/build-module/components/list-view/leaf.js.map +1 -1
  154. package/build-module/components/list-view/use-list-view-scroll-into-view.js +42 -0
  155. package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -0
  156. package/build-module/components/off-canvas-editor/appender.js +5 -10
  157. package/build-module/components/off-canvas-editor/appender.js.map +1 -1
  158. package/build-module/components/off-canvas-editor/branch.js +1 -0
  159. package/build-module/components/off-canvas-editor/branch.js.map +1 -1
  160. package/build-module/components/off-canvas-editor/index.js +7 -3
  161. package/build-module/components/off-canvas-editor/index.js.map +1 -1
  162. package/build-module/components/off-canvas-editor/leaf-more-menu.js +36 -7
  163. package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +1 -1
  164. package/build-module/components/off-canvas-editor/link-ui.js +1 -0
  165. package/build-module/components/off-canvas-editor/link-ui.js.map +1 -1
  166. package/build-module/components/responsive-block-control/index.js +1 -0
  167. package/build-module/components/responsive-block-control/index.js.map +1 -1
  168. package/build-module/components/rich-text/index.js +9 -43
  169. package/build-module/components/rich-text/index.js.map +1 -1
  170. package/build-module/components/rich-text/use-delete.js +62 -0
  171. package/build-module/components/rich-text/use-delete.js.map +1 -0
  172. package/build-module/components/rich-text/use-input-rules.js +14 -6
  173. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  174. package/build-module/components/writing-flow/use-selection-observer.js +4 -1
  175. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  176. package/build-module/hooks/align.js +3 -1
  177. package/build-module/hooks/align.js.map +1 -1
  178. package/build-module/hooks/dimensions.js +75 -187
  179. package/build-module/hooks/dimensions.js.map +1 -1
  180. package/build-module/hooks/duotone.js +86 -24
  181. package/build-module/hooks/duotone.js.map +1 -1
  182. package/build-module/hooks/gap.js +0 -183
  183. package/build-module/hooks/gap.js.map +1 -1
  184. package/build-module/hooks/layout.js +14 -5
  185. package/build-module/hooks/layout.js.map +1 -1
  186. package/build-module/hooks/margin.js +4 -143
  187. package/build-module/hooks/margin.js.map +1 -1
  188. package/build-module/hooks/padding.js +4 -143
  189. package/build-module/hooks/padding.js.map +1 -1
  190. package/build-module/hooks/typography.js +52 -65
  191. package/build-module/hooks/typography.js.map +1 -1
  192. package/build-module/hooks/utils.js +70 -0
  193. package/build-module/hooks/utils.js.map +1 -1
  194. package/build-module/layouts/flex.js +1 -0
  195. package/build-module/layouts/flex.js.map +1 -1
  196. package/build-module/store/actions.js +24 -12
  197. package/build-module/store/actions.js.map +1 -1
  198. package/build-module/store/defaults.js +28 -1
  199. package/build-module/store/defaults.js.map +1 -1
  200. package/build-module/store/reducer.js +53 -45
  201. package/build-module/store/reducer.js.map +1 -1
  202. package/build-module/store/selectors.js +5 -1
  203. package/build-module/store/selectors.js.map +1 -1
  204. package/build-module/utils/parse-css-unit-to-px.js +36 -3
  205. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  206. package/build-style/style-rtl.css +33 -21
  207. package/build-style/style.css +33 -21
  208. package/package.json +31 -31
  209. package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +24 -24
  210. package/src/components/block-inspector/index.js +11 -14
  211. package/src/components/block-inspector/useBlockInspectorAnimationSettings.js +53 -0
  212. package/src/components/block-lock/modal.js +1 -0
  213. package/src/components/block-lock/style.scss +0 -9
  214. package/src/components/block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap +20 -20
  215. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +15 -15
  216. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -1
  217. package/src/components/block-styles/index.js +5 -1
  218. package/src/components/child-layout-control/index.js +106 -0
  219. package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
  220. package/src/components/date-format-picker/index.js +6 -8
  221. package/src/components/date-format-picker/style.scss +0 -5
  222. package/src/components/global-styles/dimensions-panel.js +627 -0
  223. package/src/components/global-styles/hooks.js +88 -45
  224. package/src/components/global-styles/index.js +5 -1
  225. package/src/components/global-styles/typography-panel.js +33 -8
  226. package/src/components/global-styles/use-global-styles-output.js +4 -3
  227. package/src/components/global-styles/utils.js +2 -0
  228. package/src/components/index.native.js +5 -0
  229. package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
  230. package/src/components/inserter/media-tab/hooks.js +9 -8
  231. package/src/components/inserter/media-tab/media-list.js +3 -122
  232. package/src/components/inserter/media-tab/media-preview.js +268 -0
  233. package/src/components/inserter/style.scss +22 -0
  234. package/src/components/inserter/test/__snapshots__/index.native.js.snap +15 -15
  235. package/src/components/inspector-controls/block-support-tools-panel.js +0 -1
  236. package/src/components/inspector-controls/fill.js +32 -8
  237. package/src/components/link-control/settings-drawer.js +2 -1
  238. package/src/components/link-control/settings.js +1 -0
  239. package/src/components/link-control/style.scss +18 -8
  240. package/src/components/link-control/test/index.js +3 -3
  241. package/src/components/list-view/block.js +19 -1
  242. package/src/components/list-view/branch.js +1 -2
  243. package/src/components/list-view/expander.js +1 -0
  244. package/src/components/list-view/leaf.js +43 -29
  245. package/src/components/list-view/use-list-view-scroll-into-view.js +48 -0
  246. package/src/components/media-replace-flow/style.scss +7 -9
  247. package/src/components/off-canvas-editor/appender.js +13 -16
  248. package/src/components/off-canvas-editor/branch.js +1 -0
  249. package/src/components/off-canvas-editor/index.js +8 -2
  250. package/src/components/off-canvas-editor/leaf-more-menu.js +57 -15
  251. package/src/components/off-canvas-editor/link-ui.js +1 -0
  252. package/src/components/responsive-block-control/index.js +1 -0
  253. package/src/components/rich-text/index.js +8 -44
  254. package/src/components/rich-text/use-delete.js +59 -0
  255. package/src/components/rich-text/use-input-rules.js +13 -5
  256. package/src/components/spacing-sizes-control/style.scss +1 -1
  257. package/src/components/url-popover/stories/index.js +1 -0
  258. package/src/components/writing-flow/use-selection-observer.js +5 -1
  259. package/src/hooks/align.js +1 -1
  260. package/src/hooks/dimensions.js +85 -269
  261. package/src/hooks/duotone.js +100 -30
  262. package/src/hooks/gap.js +0 -208
  263. package/src/hooks/layout.js +19 -6
  264. package/src/hooks/margin.js +1 -164
  265. package/src/hooks/padding.js +1 -163
  266. package/src/hooks/test/__snapshots__/align.native.js.snap +24 -24
  267. package/src/hooks/test/duotone.js +102 -0
  268. package/src/hooks/typography.js +66 -88
  269. package/src/hooks/utils.js +90 -0
  270. package/src/layouts/flex.js +1 -0
  271. package/src/store/actions.js +12 -4
  272. package/src/store/defaults.js +14 -1
  273. package/src/store/reducer.js +68 -43
  274. package/src/store/selectors.js +8 -1
  275. package/src/store/test/actions.js +4 -2
  276. package/src/utils/parse-css-unit-to-px.js +35 -5
  277. package/src/utils/test/parse-css-unit-to-px.js +12 -0
  278. package/tsconfig.tsbuildinfo +1 -1
  279. package/build/hooks/child-layout.js +0 -213
  280. package/build/hooks/child-layout.js.map +0 -1
  281. package/build/hooks/min-height.js +0 -139
  282. package/build/hooks/min-height.js.map +0 -1
  283. package/build-module/hooks/child-layout.js +0 -193
  284. package/build-module/hooks/child-layout.js.map +0 -1
  285. package/build-module/hooks/min-height.js +0 -116
  286. package/build-module/hooks/min-height.js.map +0 -1
  287. package/src/hooks/child-layout.js +0 -195
  288. package/src/hooks/min-height.js +0 -104
@@ -0,0 +1,53 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect } from '@wordpress/data';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { store as blockEditorStore } from '../../store';
10
+
11
+ export default function useBlockInspectorAnimationSettings(
12
+ blockType,
13
+ selectedBlockClientId
14
+ ) {
15
+ return useSelect(
16
+ ( select ) => {
17
+ if ( blockType ) {
18
+ const globalBlockInspectorAnimationSettings =
19
+ select( blockEditorStore ).getSettings()
20
+ .blockInspectorAnimation;
21
+
22
+ // Get the name of the block that will allow it's children to be animated.
23
+ const animationParent =
24
+ globalBlockInspectorAnimationSettings?.animationParent;
25
+
26
+ // Determine whether the animationParent block is a parent of the selected block.
27
+ const { getSelectedBlockClientId, getBlockParentsByBlockName } =
28
+ select( blockEditorStore );
29
+ const _selectedBlockClientId = getSelectedBlockClientId();
30
+ const animationParentBlockClientId = getBlockParentsByBlockName(
31
+ _selectedBlockClientId,
32
+ animationParent,
33
+ true
34
+ )[ 0 ];
35
+
36
+ // If the selected block is not a child of the animationParent block,
37
+ // and not an animationParent block itself, don't animate.
38
+ if (
39
+ ! animationParentBlockClientId &&
40
+ blockType.name !== animationParent
41
+ ) {
42
+ return null;
43
+ }
44
+
45
+ return globalBlockInspectorAnimationSettings?.[
46
+ blockType.name
47
+ ];
48
+ }
49
+ return null;
50
+ },
51
+ [ selectedBlockClientId, blockType ]
52
+ );
53
+ }
@@ -187,6 +187,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
187
187
  </ul>
188
188
  { hasTemplateLock && (
189
189
  <ToggleControl
190
+ __nextHasNoMarginBottom
190
191
  className="block-editor-block-lock-modal__template-lock"
191
192
  label={ __( 'Apply to all blocks inside' ) }
192
193
  checked={ applyTemplateLock }
@@ -18,11 +18,6 @@
18
18
  .components-checkbox-control__label {
19
19
  font-weight: 600;
20
20
  }
21
-
22
- .components-base-control__field {
23
- align-items: center;
24
- display: flex;
25
- }
26
21
  }
27
22
  .block-editor-block-lock-modal__checklist-item {
28
23
  display: flex;
@@ -48,10 +43,6 @@
48
43
  border-top: $border-width solid $gray-300;
49
44
  margin-top: $grid-unit-20;
50
45
  padding: $grid-unit-15 0;
51
-
52
- .components-base-control__field {
53
- margin: 0;
54
- }
55
46
  }
56
47
 
57
48
  .block-editor-block-lock-modal__actions {
@@ -6,25 +6,25 @@ exports[`Block Actions Menu block options copies and pastes a block 1`] = `
6
6
  <!-- /wp:paragraph -->
7
7
 
8
8
  <!-- wp:heading -->
9
- <h2 class=\\"wp-block-heading\\"></h2>
9
+ <h2 class="wp-block-heading"></h2>
10
10
  <!-- /wp:heading -->
11
11
 
12
12
  <!-- wp:spacer -->
13
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
13
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
14
14
  <!-- /wp:spacer -->
15
15
 
16
16
  <!-- wp:heading -->
17
- <h2 class=\\"wp-block-heading\\"></h2>
17
+ <h2 class="wp-block-heading"></h2>
18
18
  <!-- /wp:heading -->"
19
19
  `;
20
20
 
21
21
  exports[`Block Actions Menu block options cuts and pastes a block 1`] = `
22
22
  "<!-- wp:spacer -->
23
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
23
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
24
24
  <!-- /wp:spacer -->
25
25
 
26
26
  <!-- wp:heading -->
27
- <h2 class=\\"wp-block-heading\\"></h2>
27
+ <h2 class="wp-block-heading"></h2>
28
28
  <!-- /wp:heading -->
29
29
 
30
30
  <!-- wp:paragraph -->
@@ -38,15 +38,15 @@ exports[`Block Actions Menu block options does not replace a non empty Paragraph
38
38
  <!-- /wp:paragraph -->
39
39
 
40
40
  <!-- wp:heading -->
41
- <h2 class=\\"wp-block-heading\\"></h2>
41
+ <h2 class="wp-block-heading"></h2>
42
42
  <!-- /wp:heading -->
43
43
 
44
44
  <!-- wp:spacer -->
45
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
45
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
46
46
  <!-- /wp:spacer -->
47
47
 
48
48
  <!-- wp:heading -->
49
- <h2 class=\\"wp-block-heading\\"></h2>
49
+ <h2 class="wp-block-heading"></h2>
50
50
  <!-- /wp:heading -->"
51
51
  `;
52
52
 
@@ -56,29 +56,29 @@ exports[`Block Actions Menu block options duplicates a block 1`] = `
56
56
  <!-- /wp:paragraph -->
57
57
 
58
58
  <!-- wp:spacer -->
59
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
59
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
60
60
  <!-- /wp:spacer -->
61
61
 
62
62
  <!-- wp:spacer -->
63
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
63
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
64
64
  <!-- /wp:spacer -->
65
65
 
66
66
  <!-- wp:heading -->
67
- <h2 class=\\"wp-block-heading\\"></h2>
67
+ <h2 class="wp-block-heading"></h2>
68
68
  <!-- /wp:heading -->"
69
69
  `;
70
70
 
71
71
  exports[`Block Actions Menu block options transforms a Paragraph block into a Pullquote block 1`] = `
72
72
  "<!-- wp:pullquote -->
73
- <figure class=\\"wp-block-pullquote\\"><blockquote><p>Hello!</p></blockquote></figure>
73
+ <figure class="wp-block-pullquote"><blockquote><p>Hello!</p></blockquote></figure>
74
74
  <!-- /wp:pullquote -->
75
75
 
76
76
  <!-- wp:spacer -->
77
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
77
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
78
78
  <!-- /wp:spacer -->
79
79
 
80
80
  <!-- wp:heading -->
81
- <h2 class=\\"wp-block-heading\\"></h2>
81
+ <h2 class="wp-block-heading"></h2>
82
82
  <!-- /wp:heading -->"
83
83
  `;
84
84
 
@@ -88,11 +88,11 @@ exports[`Block Actions Menu moving blocks disables the Move Down button for the
88
88
  <!-- /wp:paragraph -->
89
89
 
90
90
  <!-- wp:spacer -->
91
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
91
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
92
92
  <!-- /wp:spacer -->
93
93
 
94
94
  <!-- wp:heading -->
95
- <h2 class=\\"wp-block-heading\\"></h2>
95
+ <h2 class="wp-block-heading"></h2>
96
96
  <!-- /wp:heading -->"
97
97
  `;
98
98
 
@@ -102,17 +102,17 @@ exports[`Block Actions Menu moving blocks disables the Move Up button for the fi
102
102
  <!-- /wp:paragraph -->
103
103
 
104
104
  <!-- wp:spacer -->
105
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
105
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
106
106
  <!-- /wp:spacer -->
107
107
 
108
108
  <!-- wp:heading -->
109
- <h2 class=\\"wp-block-heading\\"></h2>
109
+ <h2 class="wp-block-heading"></h2>
110
110
  <!-- /wp:heading -->"
111
111
  `;
112
112
 
113
113
  exports[`Block Actions Menu moving blocks moves blocks up and down 1`] = `
114
114
  "<!-- wp:heading -->
115
- <h2 class=\\"wp-block-heading\\"></h2>
115
+ <h2 class="wp-block-heading"></h2>
116
116
  <!-- /wp:heading -->
117
117
 
118
118
  <!-- wp:paragraph -->
@@ -120,6 +120,6 @@ exports[`Block Actions Menu moving blocks moves blocks up and down 1`] = `
120
120
  <!-- /wp:paragraph -->
121
121
 
122
122
  <!-- wp:spacer -->
123
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
123
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
124
124
  <!-- /wp:spacer -->"
125
125
  `;
@@ -6,11 +6,11 @@ exports[`Block Mover Picker moving blocks disables the Move Down button for the
6
6
  <!-- /wp:paragraph -->
7
7
 
8
8
  <!-- wp:spacer -->
9
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
9
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
10
10
  <!-- /wp:spacer -->
11
11
 
12
12
  <!-- wp:heading -->
13
- <h2 class=\\"wp-block-heading\\"></h2>
13
+ <h2 class="wp-block-heading"></h2>
14
14
  <!-- /wp:heading -->"
15
15
  `;
16
16
 
@@ -20,17 +20,17 @@ exports[`Block Mover Picker moving blocks disables the Move Up button for the fi
20
20
  <!-- /wp:paragraph -->
21
21
 
22
22
  <!-- wp:spacer -->
23
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
23
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
24
24
  <!-- /wp:spacer -->
25
25
 
26
26
  <!-- wp:heading -->
27
- <h2 class=\\"wp-block-heading\\"></h2>
27
+ <h2 class="wp-block-heading"></h2>
28
28
  <!-- /wp:heading -->"
29
29
  `;
30
30
 
31
31
  exports[`Block Mover Picker moving blocks moves blocks up and down 1`] = `
32
32
  "<!-- wp:heading -->
33
- <h2 class=\\"wp-block-heading\\"></h2>
33
+ <h2 class="wp-block-heading"></h2>
34
34
  <!-- /wp:heading -->
35
35
 
36
36
  <!-- wp:paragraph -->
@@ -38,19 +38,19 @@ exports[`Block Mover Picker moving blocks moves blocks up and down 1`] = `
38
38
  <!-- /wp:paragraph -->
39
39
 
40
40
  <!-- wp:spacer -->
41
- <div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
41
+ <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
42
42
  <!-- /wp:spacer -->"
43
43
  `;
44
44
 
45
45
  exports[`Block Mover Picker should match snapshot 1`] = `
46
- Array [
46
+ [
47
47
  <View>
48
48
  <View
49
49
  accessibilityHint="Double tap to move the block to the left"
50
50
  accessibilityLabel="Move block left from position 2 to position 1"
51
51
  accessibilityRole="button"
52
52
  accessibilityState={
53
- Object {
53
+ {
54
54
  "disabled": false,
55
55
  }
56
56
  }
@@ -65,7 +65,7 @@ Array [
65
65
  onResponderTerminationRequest={[Function]}
66
66
  onStartShouldSetResponder={[Function]}
67
67
  style={
68
- Object {
68
+ {
69
69
  "alignItems": "center",
70
70
  "flex": 1,
71
71
  "justifyContent": "center",
@@ -81,7 +81,7 @@ Array [
81
81
  onGestureHandlerEvent={[Function]}
82
82
  onGestureHandlerStateChange={[Function]}
83
83
  style={
84
- Object {
84
+ {
85
85
  "alignItems": "center",
86
86
  "aspectRatio": 1,
87
87
  "flex": 1,
@@ -93,7 +93,7 @@ Array [
93
93
  >
94
94
  <View
95
95
  style={
96
- Object {
96
+ {
97
97
  "flexDirection": "row",
98
98
  }
99
99
  }
@@ -109,7 +109,7 @@ Array [
109
109
  accessibilityLabel="Move block right"
110
110
  accessibilityRole="button"
111
111
  accessibilityState={
112
- Object {
112
+ {
113
113
  "disabled": true,
114
114
  }
115
115
  }
@@ -124,7 +124,7 @@ Array [
124
124
  onResponderTerminationRequest={[Function]}
125
125
  onStartShouldSetResponder={[Function]}
126
126
  style={
127
- Object {
127
+ {
128
128
  "alignItems": "center",
129
129
  "flex": 1,
130
130
  "justifyContent": "center",
@@ -140,7 +140,7 @@ Array [
140
140
  onGestureHandlerEvent={[Function]}
141
141
  onGestureHandlerStateChange={[Function]}
142
142
  style={
143
- Object {
143
+ {
144
144
  "alignItems": "center",
145
145
  "aspectRatio": 1,
146
146
  "flex": 1,
@@ -152,7 +152,7 @@ Array [
152
152
  >
153
153
  <View
154
154
  style={
155
- Object {
155
+ {
156
156
  "flexDirection": "row",
157
157
  }
158
158
  }
@@ -147,7 +147,9 @@ export function BlockSettingsDropdown( {
147
147
  __experimentalSelectBlock
148
148
  ? () => {
149
149
  const blockToSelect =
150
- previousBlockClientId || nextBlockClientId;
150
+ previousBlockClientId ||
151
+ nextBlockClientId ||
152
+ firstParentClientId;
151
153
 
152
154
  if (
153
155
  blockToSelect &&
@@ -166,6 +168,7 @@ export function BlockSettingsDropdown( {
166
168
  __experimentalSelectBlock,
167
169
  previousBlockClientId,
168
170
  nextBlockClientId,
171
+ firstParentClientId,
169
172
  selectedBlockClientIds,
170
173
  ]
171
174
  );
@@ -99,7 +99,11 @@ function BlockStyles( { clientId, onSwitch = noop, onHoverClassName = noop } ) {
99
99
  } ) }
100
100
  </div>
101
101
  { hoveredStyle && ! isMobileViewport && (
102
- <Popover placement="left-start" offset={ 20 }>
102
+ <Popover
103
+ placement="left-start"
104
+ offset={ 20 }
105
+ focusOnMount={ false }
106
+ >
103
107
  <div
104
108
  className="block-editor-block-styles__preview-panel"
105
109
  onMouseLeave={ () => styleItemHandler( null ) }
@@ -0,0 +1,106 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ __experimentalToggleGroupControl as ToggleGroupControl,
6
+ __experimentalToggleGroupControlOption as ToggleGroupControlOption,
7
+ __experimentalUnitControl as UnitControl,
8
+ } from '@wordpress/components';
9
+ import { __ } from '@wordpress/i18n';
10
+ import { useEffect } from '@wordpress/element';
11
+
12
+ function helpText( selfStretch, parentLayout ) {
13
+ const { orientation = 'horizontal' } = parentLayout;
14
+
15
+ if ( selfStretch === 'fill' ) {
16
+ return __( 'Stretch to fill available space.' );
17
+ }
18
+ if ( selfStretch === 'fixed' && orientation === 'horizontal' ) {
19
+ return __( 'Specify a fixed width.' );
20
+ } else if ( selfStretch === 'fixed' ) {
21
+ return __( 'Specify a fixed height.' );
22
+ }
23
+ return __( 'Fit contents.' );
24
+ }
25
+
26
+ /**
27
+ * Form to edit the child layout value.
28
+ *
29
+ * @param {Object} props Props.
30
+ * @param {Object} props.value The child layout value.
31
+ * @param {Function} props.onChange Function to update the child layout value.
32
+ * @param {Object} props.parentLayout The parent layout value.
33
+ *
34
+ * @return {WPElement} child layout edit element.
35
+ */
36
+ export default function ChildLayoutControl( {
37
+ value: childLayout = {},
38
+ onChange,
39
+ parentLayout,
40
+ } ) {
41
+ const { selfStretch, flexSize } = childLayout;
42
+
43
+ useEffect( () => {
44
+ if ( selfStretch === 'fixed' && ! flexSize ) {
45
+ onChange( {
46
+ ...childLayout,
47
+ selfStretch: 'fit',
48
+ } );
49
+ }
50
+ }, [] );
51
+
52
+ return (
53
+ <>
54
+ <ToggleGroupControl
55
+ __nextHasNoMarginBottom
56
+ size={ '__unstable-large' }
57
+ label={ childLayoutOrientation( parentLayout ) }
58
+ value={ selfStretch || 'fit' }
59
+ help={ helpText( selfStretch, parentLayout ) }
60
+ onChange={ ( value ) => {
61
+ const newFlexSize = value !== 'fixed' ? null : flexSize;
62
+ onChange( {
63
+ ...childLayout,
64
+ selfStretch: value,
65
+ flexSize: newFlexSize,
66
+ } );
67
+ } }
68
+ isBlock={ true }
69
+ >
70
+ <ToggleGroupControlOption
71
+ key={ 'fit' }
72
+ value={ 'fit' }
73
+ label={ __( 'Fit' ) }
74
+ />
75
+ <ToggleGroupControlOption
76
+ key={ 'fill' }
77
+ value={ 'fill' }
78
+ label={ __( 'Fill' ) }
79
+ />
80
+ <ToggleGroupControlOption
81
+ key={ 'fixed' }
82
+ value={ 'fixed' }
83
+ label={ __( 'Fixed' ) }
84
+ />
85
+ </ToggleGroupControl>
86
+ { selfStretch === 'fixed' && (
87
+ <UnitControl
88
+ size={ '__unstable-large' }
89
+ onChange={ ( value ) => {
90
+ onChange( {
91
+ ...childLayout,
92
+ flexSize: value,
93
+ } );
94
+ } }
95
+ value={ flexSize }
96
+ />
97
+ ) }
98
+ </>
99
+ );
100
+ }
101
+
102
+ export function childLayoutOrientation( parentLayout ) {
103
+ const { orientation = 'horizontal' } = parentLayout;
104
+
105
+ return orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );
106
+ }
@@ -158,7 +158,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
158
158
  <button
159
159
  aria-expanded="false"
160
160
  aria-haspopup="true"
161
- aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
161
+ aria-label="Custom color picker. The currently selected color is called "red" and has a value of "f00"."
162
162
  class="components-flex components-color-palette__custom-color emotion-10 emotion-5"
163
163
  data-wp-c16t="true"
164
164
  data-wp-component="Flex"
@@ -50,14 +50,12 @@ export default function DateFormatPicker( {
50
50
  <fieldset className="block-editor-date-format-picker">
51
51
  <VisuallyHidden as="legend">{ __( 'Date format' ) }</VisuallyHidden>
52
52
  <ToggleControl
53
- label={
54
- <>
55
- { __( 'Default format' ) }
56
- <span className="block-editor-date-format-picker__default-format-toggle-control__hint">
57
- { dateI18n( defaultFormat, EXAMPLE_DATE ) }
58
- </span>
59
- </>
60
- }
53
+ __nextHasNoMarginBottom
54
+ label={ __( 'Default format' ) }
55
+ help={ `${ __( 'Example:' ) } ${ dateI18n(
56
+ defaultFormat,
57
+ EXAMPLE_DATE
58
+ ) }` }
61
59
  checked={ ! format }
62
60
  onChange={ ( checked ) =>
63
61
  onChange( checked ? null : defaultFormat )
@@ -2,11 +2,6 @@
2
2
  margin-bottom: $grid-unit-20;
3
3
  }
4
4
 
5
- .block-editor-date-format-picker__default-format-toggle-control__hint {
6
- color: $gray-700;
7
- display: block;
8
- }
9
-
10
5
  .block-editor-date-format-picker__custom-format-select-control__custom-option {
11
6
  border-top: 1px solid $gray-300;
12
7