@wordpress/block-editor 13.3.0 → 13.4.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 (311) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +0 -4
  3. package/build/components/alignment-control/ui.js +2 -2
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/block-alignment-control/ui.js +1 -1
  6. package/build/components/block-alignment-control/ui.js.map +1 -1
  7. package/build/components/block-alignment-control/ui.native.js +1 -1
  8. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  9. package/build/components/block-inspector/index.js +6 -3
  10. package/build/components/block-inspector/index.js.map +1 -1
  11. package/build/components/block-list/use-block-props/index.js +3 -1
  12. package/build/components/block-list/use-block-props/index.js.map +1 -1
  13. package/build/components/block-list/use-block-props/use-block-refs.js +9 -2
  14. package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  15. package/build/components/block-list/use-block-props/use-is-hovered.js +25 -9
  16. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  17. package/build/components/block-list/use-in-between-inserter.js +3 -2
  18. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  19. package/build/components/block-lock/modal.js +2 -0
  20. package/build/components/block-lock/modal.js.map +1 -1
  21. package/build/components/block-removal-warning-modal/index.js +2 -0
  22. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  23. package/build/components/block-switcher/index.js +1 -1
  24. package/build/components/block-switcher/index.js.map +1 -1
  25. package/build/components/block-switcher/pattern-transformations-menu.js +11 -12
  26. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  27. package/build/components/block-switcher/preview-block-popover.js +20 -17
  28. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  29. package/build/components/block-toolbar/shuffle.js +5 -2
  30. package/build/components/block-toolbar/shuffle.js.map +1 -1
  31. package/build/components/block-tools/use-show-block-tools.js +7 -8
  32. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  33. package/build/components/block-tools/zoom-out-mode-inserter-button.js +45 -0
  34. package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -0
  35. package/build/components/block-tools/zoom-out-mode-inserters.js +27 -27
  36. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  37. package/build/components/block-tools/zoom-out-popover.js +2 -1
  38. package/build/components/block-tools/zoom-out-popover.js.map +1 -1
  39. package/build/components/block-tools/zoom-out-toolbar.js +1 -1
  40. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
  41. package/build/components/date-format-picker/index.js +2 -11
  42. package/build/components/date-format-picker/index.js.map +1 -1
  43. package/build/components/default-block-appender/index.js +7 -4
  44. package/build/components/default-block-appender/index.js.map +1 -1
  45. package/build/components/font-appearance-control/index.js +2 -7
  46. package/build/components/font-appearance-control/index.js.map +1 -1
  47. package/build/components/global-styles/background-panel.js +8 -1
  48. package/build/components/global-styles/background-panel.js.map +1 -1
  49. package/build/components/global-styles/hooks.js +5 -1
  50. package/build/components/global-styles/hooks.js.map +1 -1
  51. package/build/components/global-styles/typography-panel.js +26 -43
  52. package/build/components/global-styles/typography-panel.js.map +1 -1
  53. package/build/components/global-styles/typography-utils.js +78 -7
  54. package/build/components/global-styles/typography-utils.js.map +1 -1
  55. package/build/components/global-styles/use-global-styles-output.js +24 -5
  56. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  57. package/build/components/grid/grid-item-movers.js +89 -44
  58. package/build/components/grid/grid-item-movers.js.map +1 -1
  59. package/build/components/grid/grid-visualizer.js +1 -1
  60. package/build/components/grid/grid-visualizer.js.map +1 -1
  61. package/build/components/grid/use-grid-layout-sync.js +40 -28
  62. package/build/components/grid/use-grid-layout-sync.js.map +1 -1
  63. package/build/components/index.js +1 -9
  64. package/build/components/index.js.map +1 -1
  65. package/build/components/inner-blocks/index.js +1 -1
  66. package/build/components/inner-blocks/index.js.map +1 -1
  67. package/build/components/inserter/block-patterns-tab/patterns-filter.js +20 -23
  68. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  69. package/build/components/inserter/media-tab/media-panel.js +1 -0
  70. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  71. package/build/components/inserter/menu.js +1 -1
  72. package/build/components/inserter/menu.js.map +1 -1
  73. package/build/components/inserter/preview-panel.js +20 -3
  74. package/build/components/inserter/preview-panel.js.map +1 -1
  75. package/build/components/inserter-draggable-blocks/index.js +10 -3
  76. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  77. package/build/components/inspector-controls-tabs/settings-tab.js +1 -2
  78. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  79. package/build/components/list-view/block-select-button.js +2 -6
  80. package/build/components/list-view/block-select-button.js.map +1 -1
  81. package/build/components/list-view/block.js +2 -2
  82. package/build/components/list-view/block.js.map +1 -1
  83. package/build/components/list-view/utils.js +3 -1
  84. package/build/components/list-view/utils.js.map +1 -1
  85. package/build/components/rich-text/format-toolbar/index.js +1 -1
  86. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  87. package/build/components/rich-text/index.js +1 -1
  88. package/build/components/rich-text/index.js.map +1 -1
  89. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -2
  90. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  91. package/build/components/url-popover/image-url-input-ui.js +3 -3
  92. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  93. package/build/hooks/grid-visualizer.js +5 -8
  94. package/build/hooks/grid-visualizer.js.map +1 -1
  95. package/build/hooks/layout-child.js +9 -2
  96. package/build/hooks/layout-child.js.map +1 -1
  97. package/build/hooks/position.js +3 -7
  98. package/build/hooks/position.js.map +1 -1
  99. package/build/hooks/use-bindings-attributes.js +81 -50
  100. package/build/hooks/use-bindings-attributes.js.map +1 -1
  101. package/build/layouts/constrained.js +6 -2
  102. package/build/layouts/constrained.js.map +1 -1
  103. package/build/layouts/grid.js +2 -0
  104. package/build/layouts/grid.js.map +1 -1
  105. package/build/private-apis.js +0 -3
  106. package/build/private-apis.js.map +1 -1
  107. package/build/store/actions.js +18 -1
  108. package/build/store/actions.js.map +1 -1
  109. package/build/store/reducer.js +19 -1
  110. package/build/store/reducer.js.map +1 -1
  111. package/build/store/selectors.js +13 -1
  112. package/build/store/selectors.js.map +1 -1
  113. package/build-module/components/alignment-control/ui.js +2 -2
  114. package/build-module/components/alignment-control/ui.js.map +1 -1
  115. package/build-module/components/block-alignment-control/ui.js +1 -1
  116. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  117. package/build-module/components/block-alignment-control/ui.native.js +1 -1
  118. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  119. package/build-module/components/block-inspector/index.js +6 -3
  120. package/build-module/components/block-inspector/index.js.map +1 -1
  121. package/build-module/components/block-list/use-block-props/index.js +3 -1
  122. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  123. package/build-module/components/block-list/use-block-props/use-block-refs.js +11 -4
  124. package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  125. package/build-module/components/block-list/use-block-props/use-is-hovered.js +26 -9
  126. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  127. package/build-module/components/block-list/use-in-between-inserter.js +3 -2
  128. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  129. package/build-module/components/block-lock/modal.js +2 -0
  130. package/build-module/components/block-lock/modal.js.map +1 -1
  131. package/build-module/components/block-removal-warning-modal/index.js +2 -0
  132. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  133. package/build-module/components/block-switcher/index.js +1 -1
  134. package/build-module/components/block-switcher/index.js.map +1 -1
  135. package/build-module/components/block-switcher/pattern-transformations-menu.js +12 -13
  136. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  137. package/build-module/components/block-switcher/preview-block-popover.js +20 -17
  138. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  139. package/build-module/components/block-toolbar/shuffle.js +5 -2
  140. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  141. package/build-module/components/block-tools/use-show-block-tools.js +7 -8
  142. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  143. package/build-module/components/block-tools/zoom-out-mode-inserter-button.js +37 -0
  144. package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -0
  145. package/build-module/components/block-tools/zoom-out-mode-inserters.js +28 -28
  146. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  147. package/build-module/components/block-tools/zoom-out-popover.js +2 -1
  148. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -1
  149. package/build-module/components/block-tools/zoom-out-toolbar.js +1 -1
  150. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
  151. package/build-module/components/date-format-picker/index.js +4 -12
  152. package/build-module/components/date-format-picker/index.js.map +1 -1
  153. package/build-module/components/default-block-appender/index.js +7 -4
  154. package/build-module/components/default-block-appender/index.js.map +1 -1
  155. package/build-module/components/font-appearance-control/index.js +3 -6
  156. package/build-module/components/font-appearance-control/index.js.map +1 -1
  157. package/build-module/components/global-styles/background-panel.js +8 -1
  158. package/build-module/components/global-styles/background-panel.js.map +1 -1
  159. package/build-module/components/global-styles/hooks.js +5 -1
  160. package/build-module/components/global-styles/hooks.js.map +1 -1
  161. package/build-module/components/global-styles/typography-panel.js +27 -44
  162. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  163. package/build-module/components/global-styles/typography-utils.js +76 -7
  164. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  165. package/build-module/components/global-styles/use-global-styles-output.js +24 -5
  166. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  167. package/build-module/components/grid/grid-item-movers.js +92 -46
  168. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  169. package/build-module/components/grid/grid-visualizer.js +1 -1
  170. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  171. package/build-module/components/grid/use-grid-layout-sync.js +41 -29
  172. package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
  173. package/build-module/components/index.js +0 -5
  174. package/build-module/components/index.js.map +1 -1
  175. package/build-module/components/inner-blocks/index.js +1 -1
  176. package/build-module/components/inner-blocks/index.js.map +1 -1
  177. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +20 -23
  178. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  179. package/build-module/components/inserter/media-tab/media-panel.js +1 -0
  180. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  181. package/build-module/components/inserter/menu.js +1 -1
  182. package/build-module/components/inserter/menu.js.map +1 -1
  183. package/build-module/components/inserter/preview-panel.js +20 -3
  184. package/build-module/components/inserter/preview-panel.js.map +1 -1
  185. package/build-module/components/inserter-draggable-blocks/index.js +10 -3
  186. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  187. package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -2
  188. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  189. package/build-module/components/list-view/block-select-button.js +3 -7
  190. package/build-module/components/list-view/block-select-button.js.map +1 -1
  191. package/build-module/components/list-view/block.js +2 -2
  192. package/build-module/components/list-view/block.js.map +1 -1
  193. package/build-module/components/list-view/utils.js +3 -1
  194. package/build-module/components/list-view/utils.js.map +1 -1
  195. package/build-module/components/rich-text/format-toolbar/index.js +1 -1
  196. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  197. package/build-module/components/rich-text/index.js +1 -1
  198. package/build-module/components/rich-text/index.js.map +1 -1
  199. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -2
  200. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  201. package/build-module/components/url-popover/image-url-input-ui.js +3 -3
  202. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  203. package/build-module/hooks/grid-visualizer.js +5 -8
  204. package/build-module/hooks/grid-visualizer.js.map +1 -1
  205. package/build-module/hooks/layout-child.js +9 -2
  206. package/build-module/hooks/layout-child.js.map +1 -1
  207. package/build-module/hooks/position.js +3 -7
  208. package/build-module/hooks/position.js.map +1 -1
  209. package/build-module/hooks/use-bindings-attributes.js +81 -51
  210. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  211. package/build-module/layouts/constrained.js +6 -2
  212. package/build-module/layouts/constrained.js.map +1 -1
  213. package/build-module/layouts/grid.js +2 -0
  214. package/build-module/layouts/grid.js.map +1 -1
  215. package/build-module/private-apis.js +0 -3
  216. package/build-module/private-apis.js.map +1 -1
  217. package/build-module/store/actions.js +15 -0
  218. package/build-module/store/actions.js.map +1 -1
  219. package/build-module/store/reducer.js +18 -1
  220. package/build-module/store/reducer.js.map +1 -1
  221. package/build-module/store/selectors.js +10 -0
  222. package/build-module/store/selectors.js.map +1 -1
  223. package/build-style/content-rtl.css +6 -6
  224. package/build-style/content.css +6 -6
  225. package/build-style/style-rtl.css +167 -103
  226. package/build-style/style.css +167 -103
  227. package/build-types/components/block-context/index.d.ts +2 -2
  228. package/build-types/components/block-context/index.d.ts.map +1 -1
  229. package/build-types/utils/dom.d.ts.map +1 -1
  230. package/package.json +31 -31
  231. package/src/components/alignment-control/ui.js +2 -2
  232. package/src/components/block-alignment-control/ui.js +1 -1
  233. package/src/components/block-alignment-control/ui.native.js +1 -1
  234. package/src/components/block-context/README.md +4 -4
  235. package/src/components/block-inspector/index.js +8 -4
  236. package/src/components/block-list/content.scss +2 -16
  237. package/src/components/block-list/use-block-props/index.js +1 -1
  238. package/src/components/block-list/use-block-props/use-block-refs.js +19 -3
  239. package/src/components/block-list/use-block-props/use-is-hovered.js +26 -11
  240. package/src/components/block-list/use-in-between-inserter.js +5 -1
  241. package/src/components/block-lock/modal.js +10 -2
  242. package/src/components/block-lock/style.scss +4 -8
  243. package/src/components/block-patterns-paging/style.scss +0 -23
  244. package/src/components/block-removal-warning-modal/index.js +10 -2
  245. package/src/components/block-switcher/index.js +1 -1
  246. package/src/components/block-switcher/pattern-transformations-menu.js +17 -15
  247. package/src/components/block-switcher/preview-block-popover.js +20 -14
  248. package/src/components/block-switcher/style.scss +8 -17
  249. package/src/components/block-toolbar/shuffle.js +8 -1
  250. package/src/components/block-tools/style.scss +8 -0
  251. package/src/components/block-tools/use-show-block-tools.js +12 -9
  252. package/src/components/block-tools/zoom-out-mode-inserter-button.js +47 -0
  253. package/src/components/block-tools/zoom-out-mode-inserters.js +43 -33
  254. package/src/components/block-tools/zoom-out-popover.js +1 -0
  255. package/src/components/block-tools/zoom-out-toolbar.js +1 -1
  256. package/src/components/date-format-picker/index.js +2 -11
  257. package/src/components/default-block-appender/index.js +11 -4
  258. package/src/components/font-appearance-control/index.js +1 -5
  259. package/src/components/global-styles/background-panel.js +21 -1
  260. package/src/components/global-styles/hooks.js +5 -1
  261. package/src/components/global-styles/style.scss +12 -0
  262. package/src/components/global-styles/test/typography-utils.js +325 -0
  263. package/src/components/global-styles/test/use-global-styles-output.js +3 -1
  264. package/src/components/global-styles/typography-panel.js +36 -44
  265. package/src/components/global-styles/typography-utils.js +103 -7
  266. package/src/components/global-styles/use-global-styles-output.js +22 -2
  267. package/src/components/grid/grid-item-movers.js +139 -69
  268. package/src/components/grid/grid-visualizer.js +1 -1
  269. package/src/components/grid/style.scss +114 -0
  270. package/src/components/grid/use-grid-layout-sync.js +66 -27
  271. package/src/components/iframe/content.scss +1 -1
  272. package/src/components/index.js +0 -5
  273. package/src/components/inner-blocks/index.js +4 -1
  274. package/src/components/inserter/block-patterns-tab/patterns-filter.js +40 -44
  275. package/src/components/inserter/media-tab/media-panel.js +1 -0
  276. package/src/components/inserter/menu.js +1 -1
  277. package/src/components/inserter/preview-panel.js +27 -4
  278. package/src/components/inserter/style.scss +57 -43
  279. package/src/components/inserter-draggable-blocks/index.js +11 -3
  280. package/src/components/inspector-controls-tabs/settings-tab.js +0 -2
  281. package/src/components/inspector-controls-tabs/style.scss +0 -21
  282. package/src/components/list-view/block-select-button.js +3 -13
  283. package/src/components/list-view/block.js +10 -3
  284. package/src/components/list-view/style.scss +2 -1
  285. package/src/components/list-view/utils.js +13 -2
  286. package/src/components/rich-text/format-toolbar/index.js +1 -1
  287. package/src/components/rich-text/index.js +1 -1
  288. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -1
  289. package/src/components/url-popover/image-url-input-ui.js +3 -3
  290. package/src/components/url-popover/style.scss +1 -0
  291. package/src/hooks/grid-visualizer.js +5 -7
  292. package/src/hooks/layout-child.js +12 -3
  293. package/src/hooks/position.js +3 -13
  294. package/src/hooks/use-bindings-attributes.js +89 -59
  295. package/src/layouts/constrained.js +10 -2
  296. package/src/layouts/grid.js +2 -0
  297. package/src/private-apis.js +0 -6
  298. package/src/store/actions.js +15 -0
  299. package/src/store/reducer.js +18 -0
  300. package/src/store/selectors.js +10 -0
  301. package/tsconfig.tsbuildinfo +1 -1
  302. package/build/components/inserter/reusable-block-rename-hint.js +0 -71
  303. package/build/components/inserter/reusable-block-rename-hint.js.map +0 -1
  304. package/build/components/inspector-controls-tabs/settings-tab-hint.js +0 -53
  305. package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +0 -1
  306. package/build-module/components/inserter/reusable-block-rename-hint.js +0 -64
  307. package/build-module/components/inserter/reusable-block-rename-hint.js.map +0 -1
  308. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +0 -47
  309. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +0 -1
  310. package/src/components/inserter/reusable-block-rename-hint.js +0 -69
  311. package/src/components/inspector-controls-tabs/settings-tab-hint.js +0 -52
@@ -416,7 +416,8 @@
416
416
  background: rgba($black, 0.3);
417
417
  }
418
418
 
419
- .block-editor-list-view-block-select-button__lock {
419
+ .block-editor-list-view-block-select-button__lock,
420
+ .block-editor-list-view-block-select-button__sticky {
420
421
  line-height: 0;
421
422
  }
422
423
 
@@ -13,8 +13,19 @@ export const getBlockPositionDescription = ( position, siblingCount, level ) =>
13
13
  level
14
14
  );
15
15
 
16
- export const getBlockPropertiesDescription = ( isLocked ) =>
17
- isLocked ? __( 'This block is locked.' ) : '';
16
+ export const getBlockPropertiesDescription = ( blockInformation, isLocked ) =>
17
+ [
18
+ blockInformation?.positionLabel
19
+ ? `${ sprintf(
20
+ // translators: %s: Position of selected block, e.g. "Sticky" or "Fixed".
21
+ __( 'Position: %s' ),
22
+ blockInformation.positionLabel
23
+ ) }.`
24
+ : undefined,
25
+ isLocked ? __( 'This block is locked.' ) : undefined,
26
+ ]
27
+ .filter( Boolean )
28
+ .join( ' ' );
18
29
 
19
30
  /**
20
31
  * Returns true if the client ID occurs within the block selection or multi-selection,
@@ -52,7 +52,7 @@ const FormatToolbar = () => {
52
52
  toggleProps.className,
53
53
  { 'is-pressed': hasActive }
54
54
  ),
55
- describedBy: __(
55
+ description: __(
56
56
  'Displays more block tools'
57
57
  ),
58
58
  } }
@@ -188,7 +188,7 @@ export function RichTextWrapper(
188
188
  binding.source
189
189
  );
190
190
  if (
191
- ! blockBindingsSource?.canUserEditValue( {
191
+ ! blockBindingsSource?.canUserEditValue?.( {
192
192
  select,
193
193
  context: blockContext,
194
194
  args: binding.args,
@@ -303,9 +303,11 @@ export default function SpacingInputControl( {
303
303
  <CustomSelectControl
304
304
  className="spacing-sizes-control__custom-select-control"
305
305
  value={
306
+ // passing empty string as a fallback to continue using the
307
+ // component in controlled mode
306
308
  options.find(
307
309
  ( option ) => option.key === currentValue
308
- ) || '' // passing undefined here causes a downshift controlled/uncontrolled warning
310
+ ) || ''
309
311
  }
310
312
  onChange={ ( selection ) => {
311
313
  onChange(
@@ -272,7 +272,7 @@ const ImageURLInputUI = ( {
272
272
  icon={ linkOff }
273
273
  label={ __( 'Disable expand on click' ) }
274
274
  onClick={ () => {
275
- onSetLightbox( false );
275
+ onSetLightbox?.( false );
276
276
  } }
277
277
  size="compact"
278
278
  />
@@ -302,7 +302,7 @@ const ImageURLInputUI = ( {
302
302
  label={ __( 'Remove link' ) }
303
303
  onClick={ () => {
304
304
  onLinkRemove();
305
- resetLightbox();
305
+ resetLightbox?.();
306
306
  } }
307
307
  size="compact"
308
308
  />
@@ -366,7 +366,7 @@ const ImageURLInputUI = ( {
366
366
  LINK_DESTINATION_NONE,
367
367
  href: '',
368
368
  } );
369
- onSetLightbox( true );
369
+ onSetLightbox?.( true );
370
370
  stopEditLink();
371
371
  } }
372
372
  >
@@ -10,6 +10,7 @@
10
10
  .block-editor-url-popover__row {
11
11
  display: flex;
12
12
  gap: $grid-unit-05;
13
+ align-items: center;
13
14
  }
14
15
 
15
16
  // Any children of the popover-row that are not the settings-toggle
@@ -26,14 +26,12 @@ function GridTools( { clientId, layout } ) {
26
26
  };
27
27
  } );
28
28
 
29
- if ( ! isSelected && ! isDragging ) {
30
- return null;
31
- }
32
-
33
29
  return (
34
30
  <>
35
- <GridVisualizer clientId={ clientId } parentLayout={ layout } />
36
31
  <GridLayoutSync clientId={ clientId } />
32
+ { ( isSelected || isDragging ) && (
33
+ <GridVisualizer clientId={ clientId } parentLayout={ layout } />
34
+ ) }
37
35
  </>
38
36
  );
39
37
  }
@@ -41,7 +39,7 @@ function GridTools( { clientId, layout } ) {
41
39
  const addGridVisualizerToBlockEdit = createHigherOrderComponent(
42
40
  ( BlockEdit ) => ( props ) => {
43
41
  if ( props.attributes.layout?.type !== 'grid' ) {
44
- return <BlockEdit { ...props } />;
42
+ return <BlockEdit key="edit" { ...props } />;
45
43
  }
46
44
 
47
45
  return (
@@ -50,7 +48,7 @@ const addGridVisualizerToBlockEdit = createHigherOrderComponent(
50
48
  clientId={ props.clientId }
51
49
  layout={ props.attributes.layout }
52
50
  />
53
- <BlockEdit { ...props } />
51
+ <BlockEdit key="edit" { ...props } />
54
52
  </>
55
53
  );
56
54
  },
@@ -119,11 +119,20 @@ function useBlockPropsChildLayoutStyles( { style } ) {
119
119
  parentColumnUnit = 'rem';
120
120
  }
121
121
 
122
- const highestNumber = Math.max( columnSpan, columnStart );
122
+ let numColsToBreakAt = 2;
123
+
124
+ if ( columnSpan && columnStart ) {
125
+ numColsToBreakAt = columnSpan + columnStart - 1;
126
+ } else if ( columnSpan ) {
127
+ numColsToBreakAt = columnSpan;
128
+ } else {
129
+ numColsToBreakAt = columnStart;
130
+ }
131
+
123
132
  const defaultGapValue = parentColumnUnit === 'px' ? 24 : 1.5;
124
133
  const containerQueryValue =
125
- highestNumber * parentColumnValue +
126
- ( highestNumber - 1 ) * defaultGapValue;
134
+ numColsToBreakAt * parentColumnValue +
135
+ ( numColsToBreakAt - 1 ) * defaultGapValue;
127
136
  // For blocks that only span one column, we want to remove any rowStart values as
128
137
  // the container reduces in size, so that blocks are still arranged in markup order.
129
138
  const minimumContainerQueryValue =
@@ -8,10 +8,7 @@ import clsx from 'clsx';
8
8
  */
9
9
  import { __, _x, sprintf } from '@wordpress/i18n';
10
10
  import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
11
- import {
12
- BaseControl,
13
- privateApis as componentsPrivateApis,
14
- } from '@wordpress/components';
11
+ import { BaseControl, CustomSelectControl } from '@wordpress/components';
15
12
  import { useInstanceId } from '@wordpress/compose';
16
13
  import { useSelect } from '@wordpress/data';
17
14
  import { useMemo, Platform } from '@wordpress/element';
@@ -23,13 +20,8 @@ import { useSettings } from '../components/use-settings';
23
20
  import InspectorControls from '../components/inspector-controls';
24
21
  import useBlockDisplayInformation from '../components/use-block-display-information';
25
22
  import { cleanEmptyObject, useStyleOverride } from './utils';
26
- import { unlock } from '../lock-unlock';
27
23
  import { store as blockEditorStore } from '../store';
28
24
 
29
- const { CustomSelectControlV2Legacy: CustomSelectControl } = unlock(
30
- componentsPrivateApis
31
- );
32
-
33
25
  const POSITION_SUPPORT_KEY = 'position';
34
26
 
35
27
  const DEFAULT_OPTION = {
@@ -42,7 +34,7 @@ const STICKY_OPTION = {
42
34
  key: 'sticky',
43
35
  value: 'sticky',
44
36
  name: _x( 'Sticky', 'Name for the value of the CSS position property' ),
45
- __experimentalHint: __(
37
+ hint: __(
46
38
  'The block will stick to the top of the window instead of scrolling.'
47
39
  ),
48
40
  };
@@ -51,9 +43,7 @@ const FIXED_OPTION = {
51
43
  key: 'fixed',
52
44
  value: 'fixed',
53
45
  name: _x( 'Fixed', 'Name for the value of the CSS position property' ),
54
- __experimentalHint: __(
55
- 'The block will not move when the page is scrolled.'
56
- ),
46
+ hint: __( 'The block will not move when the page is scrolled.' ),
57
47
  };
58
48
 
59
49
  const POSITION_SIDES = [ 'top', 'right', 'bottom', 'left' ];
@@ -4,13 +4,14 @@
4
4
  import { store as blocksStore } from '@wordpress/blocks';
5
5
  import { createHigherOrderComponent } from '@wordpress/compose';
6
6
  import { useRegistry, useSelect } from '@wordpress/data';
7
- import { useCallback, useMemo } from '@wordpress/element';
7
+ import { useCallback, useMemo, useContext } from '@wordpress/element';
8
8
  import { addFilter } from '@wordpress/hooks';
9
9
 
10
10
  /**
11
11
  * Internal dependencies
12
12
  */
13
13
  import { unlock } from '../lock-unlock';
14
+ import BlockContext from '../components/block-context';
14
15
 
15
16
  /** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */
16
17
  /** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */
@@ -93,15 +94,16 @@ export function canBindAttribute( blockName, attributeName ) {
93
94
  export const withBlockBindingSupport = createHigherOrderComponent(
94
95
  ( BlockEdit ) => ( props ) => {
95
96
  const registry = useRegistry();
97
+ const blockContext = useContext( BlockContext );
96
98
  const sources = useSelect( ( select ) =>
97
99
  unlock( select( blocksStore ) ).getAllBlockBindingsSources()
98
100
  );
99
- const { name, clientId, context } = props;
101
+ const { name, clientId } = props;
100
102
  const hasParentPattern = !! props.context[ 'pattern/overrides' ];
101
103
  const hasPatternOverridesDefaultBinding =
102
104
  props.attributes.metadata?.bindings?.[ DEFAULT_ATTRIBUTE ]
103
105
  ?.source === 'core/pattern-overrides';
104
- const bindings = useMemo(
106
+ const blockBindings = useMemo(
105
107
  () =>
106
108
  replacePatternOverrideDefaultBindings(
107
109
  name,
@@ -115,110 +117,138 @@ export const withBlockBindingSupport = createHigherOrderComponent(
115
117
  // there are attribute updates.
116
118
  // `source.getValues` may also call a selector via `registry.select`.
117
119
  const boundAttributes = useSelect( () => {
118
- if ( ! bindings ) {
120
+ if ( ! blockBindings ) {
119
121
  return;
120
122
  }
121
123
 
122
124
  const attributes = {};
123
125
 
124
- for ( const [ attributeName, boundAttribute ] of Object.entries(
125
- bindings
126
+ const blockBindingsBySource = new Map();
127
+
128
+ for ( const [ attributeName, binding ] of Object.entries(
129
+ blockBindings
126
130
  ) ) {
127
- const source = sources[ boundAttribute.source ];
131
+ const { source: sourceName, args: sourceArgs } = binding;
132
+ const source = sources[ sourceName ];
128
133
  if (
129
- ! source?.getValue ||
134
+ ! source?.getValues ||
130
135
  ! canBindAttribute( name, attributeName )
131
136
  ) {
132
137
  continue;
133
138
  }
134
139
 
135
- const args = {
136
- registry,
137
- context,
138
- clientId,
139
- attributeName,
140
- args: boundAttribute.args,
141
- };
142
-
143
- attributes[ attributeName ] = source.getValue( args );
144
-
145
- if ( attributes[ attributeName ] === undefined ) {
146
- if ( attributeName === 'url' ) {
147
- attributes[ attributeName ] = null;
148
- } else {
149
- attributes[ attributeName ] =
150
- source.getPlaceholder?.( args );
140
+ blockBindingsBySource.set( source, {
141
+ ...blockBindingsBySource.get( source ),
142
+ [ attributeName ]: {
143
+ args: sourceArgs,
144
+ },
145
+ } );
146
+ }
147
+
148
+ if ( blockBindingsBySource.size ) {
149
+ for ( const [ source, bindings ] of blockBindingsBySource ) {
150
+ // Populate context.
151
+ const context = {};
152
+
153
+ if ( source.usesContext?.length ) {
154
+ for ( const key of source.usesContext ) {
155
+ context[ key ] = blockContext[ key ];
156
+ }
157
+ }
158
+
159
+ // Get values in batch if the source supports it.
160
+ const values = source.getValues( {
161
+ registry,
162
+ context,
163
+ clientId,
164
+ bindings,
165
+ } );
166
+ for ( const [ attributeName, value ] of Object.entries(
167
+ values
168
+ ) ) {
169
+ // Use placeholder when value is undefined.
170
+ if ( value === undefined ) {
171
+ if ( attributeName === 'url' ) {
172
+ attributes[ attributeName ] = null;
173
+ } else {
174
+ attributes[ attributeName ] =
175
+ source.getPlaceholder?.( {
176
+ registry,
177
+ context,
178
+ clientId,
179
+ attributeName,
180
+ args: bindings[ attributeName ].args,
181
+ } );
182
+ }
183
+ } else {
184
+ attributes[ attributeName ] = value;
185
+ }
151
186
  }
152
187
  }
153
188
  }
154
189
 
155
190
  return attributes;
156
- }, [ bindings, name, clientId, context, registry, sources ] );
191
+ }, [ blockBindings, name, clientId, blockContext, registry, sources ] );
157
192
 
158
193
  const { setAttributes } = props;
159
194
 
160
195
  const _setAttributes = useCallback(
161
196
  ( nextAttributes ) => {
162
197
  registry.batch( () => {
163
- if ( ! bindings ) {
198
+ if ( ! blockBindings ) {
164
199
  setAttributes( nextAttributes );
165
200
  return;
166
201
  }
167
202
 
168
203
  const keptAttributes = { ...nextAttributes };
169
- const updatesBySource = new Map();
204
+ const blockBindingsBySource = new Map();
170
205
 
171
206
  // Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.
172
207
  for ( const [ attributeName, newValue ] of Object.entries(
173
208
  keptAttributes
174
209
  ) ) {
175
210
  if (
176
- ! bindings[ attributeName ] ||
211
+ ! blockBindings[ attributeName ] ||
177
212
  ! canBindAttribute( name, attributeName )
178
213
  ) {
179
214
  continue;
180
215
  }
181
216
 
182
- const binding = bindings[ attributeName ];
217
+ const binding = blockBindings[ attributeName ];
183
218
  const source = sources[ binding?.source ];
184
- if ( ! source?.setValue && ! source?.setValues ) {
219
+ if ( ! source?.setValues ) {
185
220
  continue;
186
221
  }
187
- updatesBySource.set( source, {
188
- ...updatesBySource.get( source ),
189
- [ attributeName ]: newValue,
222
+ blockBindingsBySource.set( source, {
223
+ ...blockBindingsBySource.get( source ),
224
+ [ attributeName ]: {
225
+ args: binding.args,
226
+ newValue,
227
+ },
190
228
  } );
191
229
  delete keptAttributes[ attributeName ];
192
230
  }
193
231
 
194
- if ( updatesBySource.size ) {
232
+ if ( blockBindingsBySource.size ) {
195
233
  for ( const [
196
234
  source,
197
- attributes,
198
- ] of updatesBySource ) {
199
- if ( source.setValues ) {
200
- source.setValues( {
201
- registry,
202
- context,
203
- clientId,
204
- attributes,
205
- } );
206
- } else {
207
- for ( const [
208
- attributeName,
209
- value,
210
- ] of Object.entries( attributes ) ) {
211
- const binding = bindings[ attributeName ];
212
- source.setValue( {
213
- registry,
214
- context,
215
- clientId,
216
- attributeName,
217
- args: binding.args,
218
- value,
219
- } );
235
+ bindings,
236
+ ] of blockBindingsBySource ) {
237
+ // Populate context.
238
+ const context = {};
239
+
240
+ if ( source.usesContext?.length ) {
241
+ for ( const key of source.usesContext ) {
242
+ context[ key ] = blockContext[ key ];
220
243
  }
221
244
  }
245
+
246
+ source.setValues( {
247
+ registry,
248
+ context,
249
+ clientId,
250
+ bindings,
251
+ } );
222
252
  }
223
253
  }
224
254
 
@@ -242,10 +272,10 @@ export const withBlockBindingSupport = createHigherOrderComponent(
242
272
  },
243
273
  [
244
274
  registry,
245
- bindings,
275
+ blockBindings,
246
276
  name,
247
277
  clientId,
248
- context,
278
+ blockContext,
249
279
  setAttributes,
250
280
  sources,
251
281
  hasPatternOverridesDefaultBinding,
@@ -234,15 +234,23 @@ export default {
234
234
  const paddingValues = getCSSRules( style );
235
235
  paddingValues.forEach( ( rule ) => {
236
236
  if ( rule.key === 'paddingRight' ) {
237
+ // Add unit if 0, to avoid calc(0 * -1) which is invalid.
238
+ const paddingRightValue =
239
+ rule.value === '0' ? '0px' : rule.value;
240
+
237
241
  output += `
238
242
  ${ appendSelectors( selector, '> .alignfull' ) } {
239
- margin-right: calc(${ rule.value } * -1);
243
+ margin-right: calc(${ paddingRightValue } * -1);
240
244
  }
241
245
  `;
242
246
  } else if ( rule.key === 'paddingLeft' ) {
247
+ // Add unit if 0, to avoid calc(0 * -1) which is invalid.
248
+ const paddingLeftValue =
249
+ rule.value === '0' ? '0px' : rule.value;
250
+
243
251
  output += `
244
252
  ${ appendSelectors( selector, '> .alignfull' ) } {
245
- margin-left: calc(${ rule.value } * -1);
253
+ margin-left: calc(${ paddingLeftValue } * -1);
246
254
  }
247
255
  `;
248
256
  }
@@ -264,6 +264,7 @@ function GridLayoutMinimumWidthControl( { layout, onChange } ) {
264
264
  </FlexItem>
265
265
  <FlexItem isBlock>
266
266
  <RangeControl
267
+ __nextHasNoMarginBottom
267
268
  onChange={ handleSliderChange }
268
269
  value={ quantity || 0 }
269
270
  min={ 0 }
@@ -367,6 +368,7 @@ function GridLayoutColumnsAndRowsControl( {
367
368
  />
368
369
  ) : (
369
370
  <RangeControl
371
+ __nextHasNoMarginBottom
370
372
  value={ columnCount ?? 0 }
371
373
  onChange={ ( value ) =>
372
374
  onChange( {
@@ -29,10 +29,6 @@ import {
29
29
  import DimensionsTool from './components/dimensions-tool';
30
30
  import ResolutionTool from './components/resolution-tool';
31
31
  import TextAlignmentControl from './components/text-alignment-control';
32
- import {
33
- default as ReusableBlocksRenameHint,
34
- useReusableBlocksRenameHint,
35
- } from './components/inserter/reusable-block-rename-hint';
36
32
  import { usesContextKey } from './components/rich-text/format-edit';
37
33
  import { ExperimentalBlockCanvas } from './components/block-canvas';
38
34
  import { getDuotoneFilter } from './components/duotone/utils';
@@ -82,8 +78,6 @@ lock( privateApis, {
82
78
  ResolutionTool,
83
79
  TabbedSidebar,
84
80
  TextAlignmentControl,
85
- ReusableBlocksRenameHint,
86
- useReusableBlocksRenameHint,
87
81
  usesContextKey,
88
82
  useFlashEditableBlocks,
89
83
  globalStylesDataKey,
@@ -213,6 +213,21 @@ export function selectBlock( clientId, initialPosition = 0 ) {
213
213
  };
214
214
  }
215
215
 
216
+ /**
217
+ * Returns an action object used in signalling that the block with the
218
+ * specified client ID has been hovered.
219
+ *
220
+ * @param {string} clientId Block client ID.
221
+ *
222
+ * @return {Object} Action object.
223
+ */
224
+ export function hoverBlock( clientId ) {
225
+ return {
226
+ type: 'HOVER_BLOCK',
227
+ clientId,
228
+ };
229
+ }
230
+
216
231
  /**
217
232
  * Yields action objects used in signalling that the block preceding the given
218
233
  * clientId (or optionally, its first parent from bottom to top)
@@ -2068,6 +2068,23 @@ export function lastFocus( state = false, action ) {
2068
2068
  return state;
2069
2069
  }
2070
2070
 
2071
+ /**
2072
+ * Reducer setting currently hovered block.
2073
+ *
2074
+ * @param {boolean} state Current state.
2075
+ * @param {Object} action Dispatched action.
2076
+ *
2077
+ * @return {boolean} Updated state.
2078
+ */
2079
+ export function hoveredBlockClientId( state = false, action ) {
2080
+ switch ( action.type ) {
2081
+ case 'HOVER_BLOCK':
2082
+ return action.clientId;
2083
+ }
2084
+
2085
+ return state;
2086
+ }
2087
+
2071
2088
  const combinedReducers = combineReducers( {
2072
2089
  blocks,
2073
2090
  isDragging,
@@ -2100,6 +2117,7 @@ const combinedReducers = combineReducers( {
2100
2117
  blockRemovalRules,
2101
2118
  openedBlockSettingsMenu,
2102
2119
  registeredInserterMediaCategories,
2120
+ hoveredBlockClientId,
2103
2121
  } );
2104
2122
 
2105
2123
  function withAutomaticChangeReset( reducer ) {
@@ -2809,6 +2809,16 @@ export function isBlockVisible( state, clientId ) {
2809
2809
  return state.blockVisibility?.[ clientId ] ?? true;
2810
2810
  }
2811
2811
 
2812
+ /**
2813
+ * Returns the currently hovered block.
2814
+ *
2815
+ * @param {Object} state Global application state.
2816
+ * @return {Object} Client Id of the hovered block.
2817
+ */
2818
+ export function getHoveredBlockClientId( state ) {
2819
+ return state.hoveredBlockClientId;
2820
+ }
2821
+
2812
2822
  /**
2813
2823
  * Returns the list of all hidden blocks.
2814
2824
  *