@wordpress/block-editor 14.8.0 → 14.8.1-next.a9f418477.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 (290) hide show
  1. package/build/autocompleters/block.js +2 -4
  2. package/build/autocompleters/block.js.map +1 -1
  3. package/build/autocompleters/link.js +2 -4
  4. package/build/autocompleters/link.js.map +1 -1
  5. package/build/components/block-canvas/index.js +3 -6
  6. package/build/components/block-canvas/index.js.map +1 -1
  7. package/build/components/block-list/block.js +6 -5
  8. package/build/components/block-list/block.js.map +1 -1
  9. package/build/components/block-list/index.js +0 -1
  10. package/build/components/block-list/index.js.map +1 -1
  11. package/build/components/block-list/use-block-props/index.js +6 -2
  12. package/build/components/block-list/use-block-props/index.js.map +1 -1
  13. package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +87 -0
  14. package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -0
  15. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +98 -5
  16. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  17. package/build/components/block-lock/modal.js +4 -4
  18. package/build/components/block-lock/modal.js.map +1 -1
  19. package/build/components/block-parent-selector/index.js +2 -15
  20. package/build/components/block-parent-selector/index.js.map +1 -1
  21. package/build/components/block-patterns-list/index.js +13 -4
  22. package/build/components/block-patterns-list/index.js.map +1 -1
  23. package/build/components/block-popover/inbetween.js +4 -0
  24. package/build/components/block-popover/inbetween.js.map +1 -1
  25. package/build/components/block-settings-menu/block-settings-dropdown.js +7 -4
  26. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  27. package/build/components/block-settings-menu-controls/index.js +1 -1
  28. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  29. package/build/components/block-switcher/index.js +12 -22
  30. package/build/components/block-switcher/index.js.map +1 -1
  31. package/build/components/block-switcher/use-transformed-patterns.js +0 -1
  32. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  33. package/build/components/block-switcher/utils.js +0 -1
  34. package/build/components/block-switcher/utils.js.map +1 -1
  35. package/build/components/block-toolbar/index.js +7 -6
  36. package/build/components/block-toolbar/index.js.map +1 -1
  37. package/build/components/block-variation-transforms/index.js +0 -1
  38. package/build/components/block-variation-transforms/index.js.map +1 -1
  39. package/build/components/date-format-picker/index.js +0 -1
  40. package/build/components/date-format-picker/index.js.map +1 -1
  41. package/build/components/font-appearance-control/index.js +1 -0
  42. package/build/components/font-appearance-control/index.js.map +1 -1
  43. package/build/components/font-family/index.js +10 -0
  44. package/build/components/font-family/index.js.map +1 -1
  45. package/build/components/global-styles/dimensions-panel.js +17 -16
  46. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  47. package/build/components/global-styles/get-global-styles-changes.js +0 -1
  48. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  49. package/build/components/iframe/use-scale-canvas.js +68 -47
  50. package/build/components/iframe/use-scale-canvas.js.map +1 -1
  51. package/build/components/inserter/block-patterns-tab/index.js +0 -10
  52. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  53. package/build/components/inserter/menu.js +2 -1
  54. package/build/components/inserter/menu.js.map +1 -1
  55. package/build/components/inserter-draggable-blocks/index.js +19 -10
  56. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  57. package/build/components/inspector-controls/slot.js +2 -13
  58. package/build/components/inspector-controls/slot.js.map +1 -1
  59. package/build/components/letter-spacing-control/index.js +10 -0
  60. package/build/components/letter-spacing-control/index.js.map +1 -1
  61. package/build/components/line-height-control/index.js +1 -0
  62. package/build/components/line-height-control/index.js.map +1 -1
  63. package/build/components/media-placeholder/index.js +18 -18
  64. package/build/components/media-placeholder/index.js.map +1 -1
  65. package/build/components/multi-selection-inspector/index.js +9 -25
  66. package/build/components/multi-selection-inspector/index.js.map +1 -1
  67. package/build/components/observe-typing/index.js +0 -1
  68. package/build/components/observe-typing/index.js.map +1 -1
  69. package/build/components/recursion-provider/index.js +0 -1
  70. package/build/components/recursion-provider/index.js.map +1 -1
  71. package/build/components/rich-text/index.js +5 -1
  72. package/build/components/rich-text/index.js.map +1 -1
  73. package/build/components/rich-text/native/use-format-types.js +0 -1
  74. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  75. package/build/components/rich-text/use-format-types.js +0 -1
  76. package/build/components/rich-text/use-format-types.js.map +1 -1
  77. package/build/components/spacing-sizes-control/utils.js +0 -1
  78. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  79. package/build/components/typewriter/index.js +0 -1
  80. package/build/components/typewriter/index.js.map +1 -1
  81. package/build/components/use-block-drop-zone/index.js +11 -2
  82. package/build/components/use-block-drop-zone/index.js.map +1 -1
  83. package/build/components/use-moving-animation/index.js +15 -2
  84. package/build/components/use-moving-animation/index.js.map +1 -1
  85. package/build/components/use-resize-canvas/index.js +1 -1
  86. package/build/components/use-resize-canvas/index.js.map +1 -1
  87. package/build/components/warning/index.js +2 -3
  88. package/build/components/warning/index.js.map +1 -1
  89. package/build/components/writing-flow/use-drag-selection.js +11 -0
  90. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  91. package/build/components/writing-flow/use-tab-nav.js +6 -2
  92. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  93. package/build/hooks/block-bindings.js +4 -3
  94. package/build/hooks/block-bindings.js.map +1 -1
  95. package/build/hooks/gap.js +1 -1
  96. package/build/hooks/gap.js.map +1 -1
  97. package/build/hooks/generated-class-name.js +0 -1
  98. package/build/hooks/generated-class-name.js.map +1 -1
  99. package/build/hooks/use-zoom-out.js +47 -14
  100. package/build/hooks/use-zoom-out.js.map +1 -1
  101. package/build/store/private-selectors.js +1 -7
  102. package/build/store/private-selectors.js.map +1 -1
  103. package/build/store/reducer.js +478 -2
  104. package/build/store/reducer.js.map +1 -1
  105. package/build/store/selectors.js +12 -55
  106. package/build/store/selectors.js.map +1 -1
  107. package/build/utils/object.js +0 -1
  108. package/build/utils/object.js.map +1 -1
  109. package/build-module/autocompleters/block.js +2 -4
  110. package/build-module/autocompleters/block.js.map +1 -1
  111. package/build-module/autocompleters/link.js +2 -4
  112. package/build-module/autocompleters/link.js.map +1 -1
  113. package/build-module/components/block-canvas/index.js +3 -6
  114. package/build-module/components/block-canvas/index.js.map +1 -1
  115. package/build-module/components/block-list/block.js +8 -7
  116. package/build-module/components/block-list/block.js.map +1 -1
  117. package/build-module/components/block-list/index.js +0 -1
  118. package/build-module/components/block-list/index.js.map +1 -1
  119. package/build-module/components/block-list/use-block-props/index.js +6 -2
  120. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  121. package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +80 -0
  122. package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -0
  123. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +97 -5
  124. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  125. package/build-module/components/block-lock/modal.js +4 -4
  126. package/build-module/components/block-lock/modal.js.map +1 -1
  127. package/build-module/components/block-parent-selector/index.js +2 -15
  128. package/build-module/components/block-parent-selector/index.js.map +1 -1
  129. package/build-module/components/block-patterns-list/index.js +13 -4
  130. package/build-module/components/block-patterns-list/index.js.map +1 -1
  131. package/build-module/components/block-popover/inbetween.js +4 -0
  132. package/build-module/components/block-popover/inbetween.js.map +1 -1
  133. package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -4
  134. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  135. package/build-module/components/block-settings-menu-controls/index.js +1 -1
  136. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  137. package/build-module/components/block-switcher/index.js +13 -23
  138. package/build-module/components/block-switcher/index.js.map +1 -1
  139. package/build-module/components/block-switcher/use-transformed-patterns.js +0 -1
  140. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  141. package/build-module/components/block-switcher/utils.js +0 -1
  142. package/build-module/components/block-switcher/utils.js.map +1 -1
  143. package/build-module/components/block-toolbar/index.js +7 -6
  144. package/build-module/components/block-toolbar/index.js.map +1 -1
  145. package/build-module/components/block-variation-transforms/index.js +0 -1
  146. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  147. package/build-module/components/date-format-picker/index.js +0 -1
  148. package/build-module/components/date-format-picker/index.js.map +1 -1
  149. package/build-module/components/font-appearance-control/index.js +1 -0
  150. package/build-module/components/font-appearance-control/index.js.map +1 -1
  151. package/build-module/components/font-family/index.js +10 -0
  152. package/build-module/components/font-family/index.js.map +1 -1
  153. package/build-module/components/global-styles/dimensions-panel.js +17 -16
  154. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  155. package/build-module/components/global-styles/get-global-styles-changes.js +0 -1
  156. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  157. package/build-module/components/iframe/use-scale-canvas.js +68 -47
  158. package/build-module/components/iframe/use-scale-canvas.js.map +1 -1
  159. package/build-module/components/inserter/block-patterns-tab/index.js +1 -11
  160. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  161. package/build-module/components/inserter/menu.js +2 -1
  162. package/build-module/components/inserter/menu.js.map +1 -1
  163. package/build-module/components/inserter-draggable-blocks/index.js +20 -11
  164. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  165. package/build-module/components/inspector-controls/slot.js +3 -14
  166. package/build-module/components/inspector-controls/slot.js.map +1 -1
  167. package/build-module/components/letter-spacing-control/index.js +9 -0
  168. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  169. package/build-module/components/line-height-control/index.js +1 -0
  170. package/build-module/components/line-height-control/index.js.map +1 -1
  171. package/build-module/components/media-placeholder/index.js +18 -18
  172. package/build-module/components/media-placeholder/index.js.map +1 -1
  173. package/build-module/components/multi-selection-inspector/index.js +9 -25
  174. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  175. package/build-module/components/observe-typing/index.js +0 -1
  176. package/build-module/components/observe-typing/index.js.map +1 -1
  177. package/build-module/components/recursion-provider/index.js +0 -1
  178. package/build-module/components/recursion-provider/index.js.map +1 -1
  179. package/build-module/components/rich-text/index.js +5 -1
  180. package/build-module/components/rich-text/index.js.map +1 -1
  181. package/build-module/components/rich-text/native/use-format-types.js +0 -1
  182. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  183. package/build-module/components/rich-text/use-format-types.js +0 -1
  184. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  185. package/build-module/components/spacing-sizes-control/utils.js +0 -1
  186. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  187. package/build-module/components/typewriter/index.js +0 -1
  188. package/build-module/components/typewriter/index.js.map +1 -1
  189. package/build-module/components/use-block-drop-zone/index.js +11 -2
  190. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  191. package/build-module/components/use-moving-animation/index.js +15 -2
  192. package/build-module/components/use-moving-animation/index.js.map +1 -1
  193. package/build-module/components/use-resize-canvas/index.js +1 -1
  194. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  195. package/build-module/components/warning/index.js +2 -3
  196. package/build-module/components/warning/index.js.map +1 -1
  197. package/build-module/components/writing-flow/use-drag-selection.js +11 -0
  198. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  199. package/build-module/components/writing-flow/use-tab-nav.js +6 -2
  200. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  201. package/build-module/hooks/block-bindings.js +4 -3
  202. package/build-module/hooks/block-bindings.js.map +1 -1
  203. package/build-module/hooks/gap.js +1 -1
  204. package/build-module/hooks/gap.js.map +1 -1
  205. package/build-module/hooks/generated-class-name.js +0 -1
  206. package/build-module/hooks/generated-class-name.js.map +1 -1
  207. package/build-module/hooks/use-zoom-out.js +48 -15
  208. package/build-module/hooks/use-zoom-out.js.map +1 -1
  209. package/build-module/store/private-selectors.js +1 -6
  210. package/build-module/store/private-selectors.js.map +1 -1
  211. package/build-module/store/reducer.js +479 -3
  212. package/build-module/store/reducer.js.map +1 -1
  213. package/build-module/store/selectors.js +12 -55
  214. package/build-module/store/selectors.js.map +1 -1
  215. package/build-module/utils/object.js +0 -1
  216. package/build-module/utils/object.js.map +1 -1
  217. package/build-style/content-rtl.css +18 -5
  218. package/build-style/content.css +18 -5
  219. package/build-style/style-rtl.css +25 -64
  220. package/build-style/style.css +25 -64
  221. package/package.json +32 -32
  222. package/src/autocompleters/block.js +2 -4
  223. package/src/autocompleters/link.js +2 -4
  224. package/src/components/alignment-control/stories/aliginment-toolbar.story.js +47 -0
  225. package/src/components/alignment-control/stories/index.story.js +51 -0
  226. package/src/components/alignment-control/test/__snapshots__/index.js.snap +5 -5
  227. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +4 -4
  228. package/src/components/block-canvas/index.js +3 -5
  229. package/src/components/block-draggable/content.scss +11 -5
  230. package/src/components/block-list/block.js +7 -13
  231. package/src/components/block-list/content.scss +6 -0
  232. package/src/components/block-list/use-block-props/index.js +5 -0
  233. package/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +83 -0
  234. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +112 -8
  235. package/src/components/block-lock/modal.js +4 -6
  236. package/src/components/block-parent-selector/index.js +1 -19
  237. package/src/components/block-patterns-list/index.js +12 -1
  238. package/src/components/block-patterns-list/stories/fixtures.js +1 -0
  239. package/src/components/block-patterns-list/style.scss +16 -5
  240. package/src/components/block-popover/inbetween.js +4 -0
  241. package/src/components/block-settings-menu/block-settings-dropdown.js +6 -1
  242. package/src/components/block-settings-menu-controls/index.js +2 -1
  243. package/src/components/block-switcher/index.js +19 -21
  244. package/src/components/block-switcher/style.scss +0 -9
  245. package/src/components/block-title/test/index.js +2 -0
  246. package/src/components/block-toolbar/index.js +9 -6
  247. package/src/components/block-tools/style.scss +5 -0
  248. package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
  249. package/src/components/dimensions-tool/stories/aspect-ratio-tool.story.js +1 -1
  250. package/src/components/dimensions-tool/stories/index.story.js +1 -1
  251. package/src/components/dimensions-tool/stories/scale-tool.story.js +1 -1
  252. package/src/components/dimensions-tool/stories/width-height-tool.story.js +1 -1
  253. package/src/components/font-appearance-control/index.js +1 -0
  254. package/src/components/font-family/index.js +10 -0
  255. package/src/components/font-family/style.scss +5 -0
  256. package/src/components/global-styles/dimensions-panel.js +16 -16
  257. package/src/components/iframe/content.scss +6 -1
  258. package/src/components/iframe/use-scale-canvas.js +103 -81
  259. package/src/components/inserter/block-patterns-tab/index.js +1 -17
  260. package/src/components/inserter/menu.js +8 -1
  261. package/src/components/inserter-draggable-blocks/index.js +19 -29
  262. package/src/components/inspector-controls/slot.js +3 -22
  263. package/src/components/letter-spacing-control/README.md +2 -1
  264. package/src/components/letter-spacing-control/index.js +17 -0
  265. package/src/components/line-height-control/index.js +1 -0
  266. package/src/components/media-placeholder/index.js +25 -28
  267. package/src/components/multi-selection-inspector/index.js +17 -27
  268. package/src/components/multi-selection-inspector/style.scss +0 -12
  269. package/src/components/resolution-tool/stories/index.story.js +1 -1
  270. package/src/components/rich-text/index.js +5 -0
  271. package/src/components/spacing-sizes-control/style.scss +0 -29
  272. package/src/components/text-alignment-control/stories/index.story.js +1 -1
  273. package/src/components/use-block-drop-zone/index.js +18 -1
  274. package/src/components/use-moving-animation/index.js +15 -0
  275. package/src/components/use-resize-canvas/index.js +1 -1
  276. package/src/components/warning/index.js +3 -4
  277. package/src/components/warning/test/index.js +3 -1
  278. package/src/components/writing-flow/use-drag-selection.js +11 -0
  279. package/src/components/writing-flow/use-tab-nav.js +9 -6
  280. package/src/hooks/block-bindings.js +8 -4
  281. package/src/hooks/gap.js +1 -1
  282. package/src/hooks/use-zoom-out.js +48 -16
  283. package/src/store/private-selectors.js +2 -17
  284. package/src/store/reducer.js +639 -2
  285. package/src/store/selectors.js +19 -69
  286. package/src/store/test/private-selectors.js +1 -0
  287. package/src/store/test/reducer.js +849 -0
  288. package/src/store/test/selectors.js +4 -110
  289. package/src/style.scss +1 -0
  290. package/tsconfig.tsbuildinfo +1 -1
@@ -41,6 +41,7 @@ function BlockPattern( {
41
41
  onHover,
42
42
  showTitlesAsTooltip,
43
43
  category,
44
+ isSelected,
44
45
  } ) {
45
46
  const [ isDragging, setIsDragging ] = useState( false );
46
47
  const { blocks, viewportWidth } = pattern;
@@ -114,6 +115,7 @@ function BlockPattern( {
114
115
  pattern.type ===
115
116
  INSERTER_PATTERN_TYPES.user &&
116
117
  ! pattern.syncStatus,
118
+ 'is-selected': isSelected,
117
119
  }
118
120
  ) }
119
121
  />
@@ -192,6 +194,7 @@ function BlockPatternsList(
192
194
  ref
193
195
  ) {
194
196
  const [ activeCompositeId, setActiveCompositeId ] = useState( undefined );
197
+ const [ activePattern, setActivePattern ] = useState( null ); // State to track active pattern
195
198
 
196
199
  useEffect( () => {
197
200
  // Reset the active composite item whenever the available patterns change,
@@ -201,6 +204,11 @@ function BlockPatternsList(
201
204
  setActiveCompositeId( firstCompositeItemId );
202
205
  }, [ blockPatterns ] );
203
206
 
207
+ const handleClickPattern = ( pattern, blocks ) => {
208
+ setActivePattern( pattern.name );
209
+ onClickPattern( pattern, blocks );
210
+ };
211
+
204
212
  return (
205
213
  <Composite
206
214
  orientation={ orientation }
@@ -216,11 +224,14 @@ function BlockPatternsList(
216
224
  key={ pattern.name }
217
225
  id={ pattern.name }
218
226
  pattern={ pattern }
219
- onClick={ onClickPattern }
227
+ onClick={ handleClickPattern }
220
228
  onHover={ onHover }
221
229
  isDraggable={ isDraggable }
222
230
  showTitlesAsTooltip={ showTitlesAsTooltip }
223
231
  category={ category }
232
+ isSelected={
233
+ !! activePattern && activePattern === pattern.name
234
+ }
224
235
  />
225
236
  ) ) }
226
237
  { pagingProps && <BlockPatternsPaging { ...pagingProps } /> }
@@ -530,6 +530,7 @@ export default [
530
530
  background: '#000000',
531
531
  },
532
532
  },
533
+ tagName: 'hr',
533
534
  },
534
535
  innerBlocks: [],
535
536
  originalContent:
@@ -44,19 +44,29 @@
44
44
  outline: $border-width solid rgba($black, 0.1);
45
45
  outline-offset: -$border-width;
46
46
  border-radius: $radius-medium;
47
+
48
+ transition: outline 0.1s linear;
49
+ @include reduce-motion("transition");
47
50
  }
48
51
  }
49
52
 
50
- &:hover:not(:focus) .block-editor-block-preview__container::after {
53
+ // Selected
54
+ &.is-selected .block-editor-block-preview__container::after {
55
+ outline-color: $gray-900;
56
+ outline-width: var(--wp-admin-border-width-focus);
57
+ outline-offset: calc(-1 * var(--wp-admin-border-width-focus));
58
+ }
59
+
60
+ // Hover state
61
+ &:hover .block-editor-block-preview__container::after {
51
62
  outline-color: rgba($black, 0.3);
52
63
  }
53
64
 
54
- &:focus .block-editor-block-preview__container::after {
65
+ // Focused state
66
+ &[data-focus-visible] .block-editor-block-preview__container::after {
55
67
  outline-color: var(--wp-admin-theme-color);
56
68
  outline-width: var(--wp-admin-border-width-focus);
57
- outline-offset: calc((-1 * var(--wp-admin-border-width-focus)));
58
- transition: outline 0.1s linear;
59
- @include reduce-motion("transition");
69
+ outline-offset: calc(-1 * var(--wp-admin-border-width-focus));
60
70
  }
61
71
 
62
72
  .block-editor-patterns__pattern-details:not(:empty) {
@@ -68,6 +78,7 @@
68
78
  .block-editor-patterns__pattern-icon-wrapper {
69
79
  min-width: 24px;
70
80
  height: 24px;
81
+
71
82
  .block-editor-patterns__pattern-icon {
72
83
  fill: var(--wp-block-synced-color);
73
84
  }
@@ -148,6 +148,10 @@ function BlockPopoverInbetween( {
148
148
  ? nextRect.left - previousRect.right
149
149
  : 0;
150
150
  }
151
+
152
+ // Avoid a negative width which happens when the next rect
153
+ // is on the next line.
154
+ width = Math.max( width, 0 );
151
155
  }
152
156
 
153
157
  return new window.DOMRect( left, top, width, height );
@@ -57,6 +57,7 @@ export function BlockSettingsDropdown( {
57
57
  const currentClientId = block?.clientId;
58
58
  const count = clientIds.length;
59
59
  const firstBlockClientId = clientIds[ 0 ];
60
+
60
61
  const {
61
62
  firstParentClientId,
62
63
  parentBlockType,
@@ -64,6 +65,7 @@ export function BlockSettingsDropdown( {
64
65
  selectedBlockClientIds,
65
66
  openedBlockSettingsMenu,
66
67
  isContentOnly,
68
+ isZoomOut,
67
69
  } = useSelect(
68
70
  ( select ) => {
69
71
  const {
@@ -74,6 +76,7 @@ export function BlockSettingsDropdown( {
74
76
  getBlockAttributes,
75
77
  getOpenedBlockSettingsMenu,
76
78
  getBlockEditingMode,
79
+ isZoomOut: _isZoomOut,
77
80
  } = unlock( select( blockEditorStore ) );
78
81
 
79
82
  const { getActiveBlockVariation } = select( blocksStore );
@@ -98,10 +101,12 @@ export function BlockSettingsDropdown( {
98
101
  openedBlockSettingsMenu: getOpenedBlockSettingsMenu(),
99
102
  isContentOnly:
100
103
  getBlockEditingMode( firstBlockClientId ) === 'contentOnly',
104
+ isZoomOut: _isZoomOut(),
101
105
  };
102
106
  },
103
107
  [ firstBlockClientId ]
104
108
  );
109
+
105
110
  const { getBlockOrder, getSelectedBlockClientIds } =
106
111
  useSelect( blockEditorStore );
107
112
 
@@ -248,7 +253,7 @@ export function BlockSettingsDropdown( {
248
253
  clientId={ firstBlockClientId }
249
254
  />
250
255
  ) }
251
- { ! isContentOnly && (
256
+ { ( ! isContentOnly || isZoomOut ) && (
252
257
  <CopyMenuItem
253
258
  clientIds={ clientIds }
254
259
  onCopy={ onCopy }
@@ -55,7 +55,8 @@ const BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {
55
55
  const convertToGroupButtonProps =
56
56
  useConvertToGroupButtonProps( selectedClientIds );
57
57
  const { isGroupable, isUngroupable } = convertToGroupButtonProps;
58
- const showConvertToGroupButton = isGroupable || isUngroupable;
58
+ const showConvertToGroupButton =
59
+ ( isGroupable || isUngroupable ) && ! isContentOnly;
59
60
 
60
61
  return (
61
62
  <Slot
@@ -18,6 +18,7 @@ import {
18
18
  } from '@wordpress/blocks';
19
19
  import { useSelect, useDispatch } from '@wordpress/data';
20
20
  import { copy } from '@wordpress/icons';
21
+ import { store as preferencesStore } from '@wordpress/preferences';
21
22
 
22
23
  /**
23
24
  * Internal dependencies
@@ -185,21 +186,6 @@ function BlockSwitcherDropdownMenuContents( {
185
186
  );
186
187
  }
187
188
 
188
- const BlockIndicator = ( { icon, showTitle, blockTitle } ) => (
189
- <>
190
- <BlockIcon
191
- className="block-editor-block-switcher__toggle"
192
- icon={ icon }
193
- showColors
194
- />
195
- { showTitle && blockTitle && (
196
- <span className="block-editor-block-switcher__toggle-text">
197
- { blockTitle }
198
- </span>
199
- ) }
200
- </>
201
- );
202
-
203
189
  export const BlockSwitcher = ( { clientIds } ) => {
204
190
  const {
205
191
  hasContentOnlyLocking,
@@ -272,6 +258,11 @@ export const BlockSwitcher = ( { clientIds } ) => {
272
258
  clientId: clientIds?.[ 0 ],
273
259
  maximumLength: 35,
274
260
  } );
261
+ const showIconLabels = useSelect(
262
+ ( select ) =>
263
+ select( preferencesStore ).get( 'core', 'showIconLabels' ),
264
+ []
265
+ );
275
266
 
276
267
  if ( invalidBlocks ) {
277
268
  return null;
@@ -282,6 +273,11 @@ export const BlockSwitcher = ( { clientIds } ) => {
282
273
  ? blockTitle
283
274
  : __( 'Multiple blocks selected' );
284
275
 
276
+ const blockIndicatorText =
277
+ ( isReusable || isTemplate ) && ! showIconLabels && blockTitle
278
+ ? blockTitle
279
+ : undefined;
280
+
285
281
  const hideDropdown =
286
282
  isDisabled ||
287
283
  ( ! hasBlockStyles && ! canRemove ) ||
@@ -295,12 +291,13 @@ export const BlockSwitcher = ( { clientIds } ) => {
295
291
  className="block-editor-block-switcher__no-switcher-icon"
296
292
  title={ blockSwitcherLabel }
297
293
  icon={
298
- <BlockIndicator
294
+ <BlockIcon
295
+ className="block-editor-block-switcher__toggle"
299
296
  icon={ icon }
300
- showTitle={ isReusable || isTemplate }
301
- blockTitle={ blockTitle }
297
+ showColors
302
298
  />
303
299
  }
300
+ text={ blockIndicatorText }
304
301
  />
305
302
  </ToolbarGroup>
306
303
  );
@@ -329,12 +326,13 @@ export const BlockSwitcher = ( { clientIds } ) => {
329
326
  className: 'block-editor-block-switcher__popover',
330
327
  } }
331
328
  icon={
332
- <BlockIndicator
329
+ <BlockIcon
330
+ className="block-editor-block-switcher__toggle"
333
331
  icon={ icon }
334
- showTitle={ isReusable || isTemplate }
335
- blockTitle={ blockTitle }
332
+ showColors
336
333
  />
337
334
  }
335
+ text={ blockIndicatorText }
338
336
  toggleProps={ {
339
337
  description: blockSwitcherDescription,
340
338
  ...toggleProps,
@@ -26,15 +26,6 @@
26
26
  }
27
27
  }
28
28
 
29
- .block-editor-block-switcher__toggle-text {
30
- margin-left: $grid-unit-10;
31
-
32
- // Account for double label when show-text-buttons is set.
33
- .show-icon-labels & {
34
- display: none;
35
- }
36
- }
37
-
38
29
  .components-button.block-editor-block-switcher__no-switcher-icon {
39
30
  display: flex;
40
31
 
@@ -31,7 +31,9 @@ const blockLabelMap = {
31
31
  };
32
32
 
33
33
  jest.mock( '@wordpress/blocks', () => {
34
+ const actualImplementation = jest.requireActual( '@wordpress/blocks' );
34
35
  return {
36
+ ...actualImplementation,
35
37
  isReusableBlock( { title } ) {
36
38
  return title === 'Reusable Block';
37
39
  },
@@ -124,6 +124,8 @@ export function PrivateBlockToolbar( {
124
124
  ( id ) => getTemplateLock( id ) === 'contentOnly'
125
125
  );
126
126
 
127
+ const _isZoomOut = isZoomOut();
128
+
127
129
  return {
128
130
  blockClientId: selectedBlockClientId,
129
131
  blockClientIds: selectedBlockClientIds,
@@ -132,8 +134,9 @@ export function PrivateBlockToolbar( {
132
134
  shouldShowVisualToolbar: isValid && isVisual,
133
135
  toolbarKey: `${ selectedBlockClientId }${ parentClientId }`,
134
136
  showParentSelector:
135
- ! isZoomOut() &&
137
+ ! _isZoomOut &&
136
138
  parentBlockType &&
139
+ editingMode !== 'contentOnly' &&
137
140
  getBlockEditingMode( parentClientId ) !== 'disabled' &&
138
141
  hasBlockSupport(
139
142
  parentBlockType,
@@ -144,11 +147,11 @@ export function PrivateBlockToolbar( {
144
147
  isUsingBindings: _isUsingBindings,
145
148
  hasParentPattern: _hasParentPattern,
146
149
  hasContentOnlyLocking: _hasTemplateLock,
147
- showShuffleButton: isZoomOut(),
148
- showSlots: ! isZoomOut(),
149
- showGroupButtons: ! isZoomOut(),
150
- showLockButtons: ! isZoomOut(),
151
- showSwitchSectionStyleButton: isZoomOut(),
150
+ showShuffleButton: _isZoomOut,
151
+ showSlots: ! _isZoomOut,
152
+ showGroupButtons: ! _isZoomOut,
153
+ showLockButtons: ! _isZoomOut,
154
+ showSwitchSectionStyleButton: _isZoomOut,
152
155
  hasFixedToolbar: getSettings().hasFixedToolbar,
153
156
  isNavigationMode: _isNavigationMode(),
154
157
  };
@@ -157,6 +157,11 @@
157
157
  &:focus::before {
158
158
  box-shadow: inset 0 0 0 1px $gray-900, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
159
159
  }
160
+
161
+ &:disabled,
162
+ &[aria-disabled="true"] {
163
+ color: $gray-700;
164
+ }
160
165
  }
161
166
 
162
167
  .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
@@ -42,7 +42,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
42
42
  <button
43
43
  aria-label="Align top"
44
44
  aria-pressed="true"
45
- class="components-button components-toolbar__control is-pressed has-icon"
45
+ class="components-button components-toolbar__control is-compact is-pressed has-icon"
46
46
  data-toolbar-item="true"
47
47
  type="button"
48
48
  >
@@ -64,7 +64,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
64
64
  <button
65
65
  aria-label="Align middle"
66
66
  aria-pressed="false"
67
- class="components-button components-toolbar__control has-icon"
67
+ class="components-button components-toolbar__control is-compact has-icon"
68
68
  data-toolbar-item="true"
69
69
  type="button"
70
70
  >
@@ -86,7 +86,7 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
86
86
  <button
87
87
  aria-label="Align bottom"
88
88
  aria-pressed="false"
89
- class="components-button components-toolbar__control has-icon"
89
+ class="components-button components-toolbar__control is-compact has-icon"
90
90
  data-toolbar-item="true"
91
91
  type="button"
92
92
  >
@@ -16,7 +16,7 @@ export default {
16
16
  title: 'BlockEditor (Private APIs)/DimensionsTool/AspectRatioTool',
17
17
  component: AspectRatioTool,
18
18
  argTypes: {
19
- panelId: { control: { type: null } },
19
+ panelId: { control: false },
20
20
  onChange: { action: 'changed' },
21
21
  },
22
22
  };
@@ -16,7 +16,7 @@ export default {
16
16
  title: 'BlockEditor (Private APIs)/DimensionsTool',
17
17
  component: DimensionsTool,
18
18
  argTypes: {
19
- panelId: { control: { type: null } },
19
+ panelId: { control: false },
20
20
  onChange: { action: 'changed' },
21
21
  },
22
22
  };
@@ -16,7 +16,7 @@ export default {
16
16
  title: 'BlockEditor (Private APIs)/DimensionsTool/ScaleTool',
17
17
  component: ScaleTool,
18
18
  argTypes: {
19
- panelId: { control: { type: null } },
19
+ panelId: { control: false },
20
20
  onChange: { action: 'changed' },
21
21
  },
22
22
  };
@@ -16,7 +16,7 @@ export default {
16
16
  title: 'BlockEditor (Private APIs)/DimensionsTool/WidthHeightTool',
17
17
  component: WidthHeightTool,
18
18
  argTypes: {
19
- panelId: { control: { type: null } },
19
+ panelId: { control: false },
20
20
  onChange: { action: 'changed' },
21
21
  },
22
22
  };
@@ -153,6 +153,7 @@ export default function FontAppearanceControl( props ) {
153
153
  { ...otherProps }
154
154
  className="components-font-appearance-control"
155
155
  __next40pxDefaultSize={ __next40pxDefaultSize }
156
+ __shouldNotWarnDeprecated36pxSize
156
157
  label={ label }
157
158
  describedBy={ getDescribedBy() }
158
159
  options={ selectOptions }
@@ -1,3 +1,8 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+
1
6
  /**
2
7
  * WordPress dependencies
3
8
  */
@@ -18,6 +23,7 @@ export default function FontFamilyControl( {
18
23
  value = '',
19
24
  onChange,
20
25
  fontFamilies,
26
+ className,
21
27
  ...props
22
28
  } ) {
23
29
  const [ blockLevelFontFamilies ] = useSettings( 'typography.fontFamilies' );
@@ -55,10 +61,14 @@ export default function FontFamilyControl( {
55
61
  return (
56
62
  <CustomSelectControl
57
63
  __next40pxDefaultSize={ __next40pxDefaultSize }
64
+ __shouldNotWarnDeprecated36pxSize
58
65
  label={ __( 'Font' ) }
59
66
  value={ value }
60
67
  onChange={ ( { selectedItem } ) => onChange( selectedItem.key ) }
61
68
  options={ options }
69
+ className={ clsx( 'block-editor-font-family-control', className, {
70
+ 'is-next-has-no-margin-bottom': __nextHasNoMarginBottom,
71
+ } ) }
62
72
  { ...props }
63
73
  />
64
74
  );
@@ -0,0 +1,5 @@
1
+ .block-editor-font-family-control {
2
+ &:not(.is-next-has-no-margin-bottom) {
3
+ margin-bottom: $grid-unit-10;
4
+ }
5
+ }
@@ -444,17 +444,6 @@ export default function DimensionsPanel( {
444
444
 
445
445
  const onMouseLeaveControls = () => onVisualize( false );
446
446
 
447
- const inputProps = {
448
- min: minMarginValue,
449
- onDragStart: () => {
450
- //Reset to 0 in case the value was negative.
451
- setMinMarginValue( 0 );
452
- },
453
- onDragEnd: () => {
454
- setMinMarginValue( minimumMargin );
455
- },
456
- };
457
-
458
447
  return (
459
448
  <Wrapper
460
449
  resetAllFilter={ resetAllFilter }
@@ -545,8 +534,10 @@ export default function DimensionsPanel( {
545
534
  units={ units }
546
535
  allowReset={ false }
547
536
  splitOnAxis={ isAxialPadding }
548
- onMouseOver={ onMouseOverPadding }
549
- onMouseOut={ onMouseLeaveControls }
537
+ inputProps={ {
538
+ onMouseOver: onMouseOverPadding,
539
+ onMouseOut: onMouseLeaveControls,
540
+ } }
550
541
  />
551
542
  ) }
552
543
  { showSpacingPresetsControl && (
@@ -581,14 +572,23 @@ export default function DimensionsPanel( {
581
572
  __next40pxDefaultSize
582
573
  values={ marginValues }
583
574
  onChange={ setMarginValues }
584
- inputProps={ inputProps }
575
+ inputProps={ {
576
+ min: minMarginValue,
577
+ onDragStart: () => {
578
+ // Reset to 0 in case the value was negative.
579
+ setMinMarginValue( 0 );
580
+ },
581
+ onDragEnd: () => {
582
+ setMinMarginValue( minimumMargin );
583
+ },
584
+ onMouseOver: onMouseOverMargin,
585
+ onMouseOut: onMouseLeaveControls,
586
+ } }
585
587
  label={ __( 'Margin' ) }
586
588
  sides={ marginSides }
587
589
  units={ units }
588
590
  allowReset={ false }
589
591
  splitOnAxis={ isAxialMargin }
590
- onMouseOver={ onMouseOverMargin }
591
- onMouseOut={ onMouseLeaveControls }
592
592
  />
593
593
  ) }
594
594
  { showSpacingPresetsControl && (
@@ -10,6 +10,7 @@
10
10
  &.zoom-out-animation {
11
11
  $scroll-top: var(--wp-block-editor-iframe-zoom-out-scroll-top, 0);
12
12
  $scroll-top-next: var(--wp-block-editor-iframe-zoom-out-scroll-top-next, 0);
13
+ $overflow-behavior: var(--wp-block-editor-iframe-zoom-out-overflow-behavior, scroll);
13
14
 
14
15
  position: fixed;
15
16
  left: 0;
@@ -18,7 +19,7 @@
18
19
  bottom: 0;
19
20
  // Force preserving a scrollbar gutter as scrollbar-gutter isn't supported in all browsers yet,
20
21
  // and removing the scrollbar causes the content to shift.
21
- overflow-y: scroll;
22
+ overflow-y: $overflow-behavior;
22
23
  }
23
24
 
24
25
  &.is-zoomed-out {
@@ -60,5 +61,9 @@
60
61
  }
61
62
  }
62
63
  }
64
+
65
+ .wp-block[draggable] {
66
+ cursor: grab;
67
+ }
63
68
  }
64
69
  }