@wordpress/block-editor 9.2.0 → 9.3.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 (453) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/autocompleters/block.js +3 -1
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/components/block-actions/index.js.map +1 -1
  5. package/build/components/block-alignment-control/ui.js.map +1 -1
  6. package/build/components/block-alignment-matrix-control/index.js +3 -7
  7. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  8. package/build/components/block-breadcrumb/index.js.map +1 -1
  9. package/build/components/block-content-overlay/index.js.map +1 -1
  10. package/build/components/block-context/index.js.map +1 -1
  11. package/build/components/block-controls/hook.js.map +1 -1
  12. package/build/components/block-draggable/index.js.map +1 -1
  13. package/build/components/block-draggable/index.native.js.map +1 -1
  14. package/build/components/block-list/block-list-item.native.js.map +1 -1
  15. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  16. package/build/components/block-list/block.js.map +1 -1
  17. package/build/components/block-list/block.native.js.map +1 -1
  18. package/build/components/block-list/index.js.map +1 -1
  19. package/build/components/block-list/index.native.js.map +1 -1
  20. package/build/components/block-list/use-block-props/index.js.map +1 -1
  21. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  22. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  23. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  24. package/build/components/block-list-appender/index.js.map +1 -1
  25. package/build/components/block-list-appender/index.native.js.map +1 -1
  26. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  27. package/build/components/block-mover/button.js.map +1 -1
  28. package/build/components/block-mover/index.native.js.map +1 -1
  29. package/build/components/block-parent-selector/index.js.map +1 -1
  30. package/build/components/block-pattern-setup/index.js +1 -1
  31. package/build/components/block-pattern-setup/index.js.map +1 -1
  32. package/build/components/block-preview/auto.js.map +1 -1
  33. package/build/components/block-selection-clearer/index.js.map +1 -1
  34. package/build/components/block-settings-menu/block-mode-toggle.js +3 -7
  35. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  36. package/build/components/block-settings-menu/block-settings-dropdown.js +6 -3
  37. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  38. package/build/components/block-styles/index.js +6 -3
  39. package/build/components/block-styles/index.js.map +1 -1
  40. package/build/components/block-styles/menu-items.js +3 -7
  41. package/build/components/block-styles/menu-items.js.map +1 -1
  42. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  43. package/build/components/block-toolbar/index.native.js.map +1 -1
  44. package/build/components/block-toolbar/utils.js +5 -8
  45. package/build/components/block-toolbar/utils.js.map +1 -1
  46. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  47. package/build/components/block-tools/index.js.map +1 -1
  48. package/build/components/block-types-list/index.native.js.map +1 -1
  49. package/build/components/block-variation-transforms/index.js.map +1 -1
  50. package/build/components/color-style-selector/index.js.map +1 -1
  51. package/build/components/colors/with-colors.js.map +1 -1
  52. package/build/components/colors-gradients/dropdown.js.map +1 -1
  53. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  54. package/build/components/copy-handler/index.js +17 -1
  55. package/build/components/copy-handler/index.js.map +1 -1
  56. package/build/components/default-block-appender/index.js.map +1 -1
  57. package/build/components/default-block-appender/index.native.js.map +1 -1
  58. package/build/components/default-style-picker/index.js.map +1 -1
  59. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  60. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  61. package/build/components/image-size-control/index.js +3 -1
  62. package/build/components/image-size-control/index.js.map +1 -1
  63. package/build/components/index.js +18 -0
  64. package/build/components/index.js.map +1 -1
  65. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  66. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  67. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  68. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  69. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  70. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  71. package/build/components/inserter/index.js.map +1 -1
  72. package/build/components/inserter/index.native.js.map +1 -1
  73. package/build/components/inserter/library.js +3 -7
  74. package/build/components/inserter/library.js.map +1 -1
  75. package/build/components/inserter/menu.js.map +1 -1
  76. package/build/components/inserter/menu.native.js.map +1 -1
  77. package/build/components/inserter/no-results.native.js.map +1 -1
  78. package/build/components/inserter/quick-inserter.js.map +1 -1
  79. package/build/components/inserter/search-items.js +1 -1
  80. package/build/components/inserter/search-items.js.map +1 -1
  81. package/build/components/inserter/search-results.native.js.map +1 -1
  82. package/build/components/inspector-popover-header/index.js +56 -0
  83. package/build/components/inspector-popover-header/index.js.map +1 -0
  84. package/build/components/line-height-control/index.js.map +1 -1
  85. package/build/components/link-control/index.js +4 -4
  86. package/build/components/link-control/index.js.map +1 -1
  87. package/build/components/link-control/search-create-button.js +1 -3
  88. package/build/components/link-control/search-create-button.js.map +1 -1
  89. package/build/components/link-control/search-input.js +5 -3
  90. package/build/components/link-control/search-input.js.map +1 -1
  91. package/build/components/link-control/settings-drawer.js +3 -7
  92. package/build/components/link-control/settings-drawer.js.map +1 -1
  93. package/build/components/link-control/use-search-handler.js.map +1 -1
  94. package/build/components/list-view/block-contents.js.map +1 -1
  95. package/build/components/list-view/branch.js.map +1 -1
  96. package/build/components/list-view/index.js.map +1 -1
  97. package/build/components/list-view/use-block-selection.js.map +1 -1
  98. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  99. package/build/components/list-view/utils.js +1 -7
  100. package/build/components/list-view/utils.js.map +1 -1
  101. package/build/components/media-placeholder/index.js +4 -4
  102. package/build/components/media-placeholder/index.js.map +1 -1
  103. package/build/components/media-replace-flow/index.js +20 -5
  104. package/build/components/media-replace-flow/index.js.map +1 -1
  105. package/build/components/media-upload/index.native.js +1 -1
  106. package/build/components/media-upload/index.native.js.map +1 -1
  107. package/build/components/navigable-toolbar/index.js.map +1 -1
  108. package/build/components/plain-text/index.native.js.map +1 -1
  109. package/build/components/preview-options/index.js +4 -0
  110. package/build/components/preview-options/index.js.map +1 -1
  111. package/build/components/provider/use-block-sync.js +5 -3
  112. package/build/components/provider/use-block-sync.js.map +1 -1
  113. package/build/components/publish-date-time-picker/index.js +14 -16
  114. package/build/components/publish-date-time-picker/index.js.map +1 -1
  115. package/build/components/rich-text/embed-handler-picker.native.js +4 -8
  116. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  117. package/build/components/rich-text/index.js.map +1 -1
  118. package/build/components/rich-text/use-format-types.js.map +1 -1
  119. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  120. package/build/components/skip-to-selected-block/index.js.map +1 -1
  121. package/build/components/ungroup-button/index.native.js +3 -7
  122. package/build/components/ungroup-button/index.native.js.map +1 -1
  123. package/build/components/url-input/index.js +14 -3
  124. package/build/components/url-input/index.js.map +1 -1
  125. package/build/components/use-block-display-information/index.js.map +1 -1
  126. package/build/components/use-block-drop-zone/index.js.map +1 -1
  127. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  128. package/build/components/use-display-block-controls/index.native.js.map +1 -1
  129. package/build/components/use-on-block-drop/index.js.map +1 -1
  130. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  131. package/build/components/use-setting/index.js.map +1 -1
  132. package/build/components/writing-flow/use-arrow-nav.js +12 -12
  133. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  134. package/build/components/writing-flow/use-click-selection.js.map +1 -1
  135. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  136. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  137. package/build/components/writing-flow/use-select-all.js.map +1 -1
  138. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  139. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  140. package/build/hooks/color-panel.js.map +1 -1
  141. package/build/hooks/color-panel.native.js.map +1 -1
  142. package/build/hooks/color.js.map +1 -1
  143. package/build/hooks/font-family.js.map +1 -1
  144. package/build/hooks/gap.js.map +1 -1
  145. package/build/hooks/layout.js +38 -1
  146. package/build/hooks/layout.js.map +1 -1
  147. package/build/store/actions.js.map +1 -1
  148. package/build/store/reducer.js.map +1 -1
  149. package/build/store/selectors.js +1 -1
  150. package/build/store/selectors.js.map +1 -1
  151. package/build/utils/pasting.js.map +1 -1
  152. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  153. package/build-module/autocompleters/block.js +4 -1
  154. package/build-module/autocompleters/block.js.map +1 -1
  155. package/build-module/components/block-actions/index.js.map +1 -1
  156. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  157. package/build-module/components/block-alignment-matrix-control/index.js +2 -5
  158. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  159. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  160. package/build-module/components/block-content-overlay/index.js.map +1 -1
  161. package/build-module/components/block-context/index.js.map +1 -1
  162. package/build-module/components/block-controls/hook.js.map +1 -1
  163. package/build-module/components/block-draggable/index.js.map +1 -1
  164. package/build-module/components/block-draggable/index.native.js.map +1 -1
  165. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  166. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  167. package/build-module/components/block-list/block.js.map +1 -1
  168. package/build-module/components/block-list/block.native.js.map +1 -1
  169. package/build-module/components/block-list/index.js.map +1 -1
  170. package/build-module/components/block-list/index.native.js.map +1 -1
  171. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  172. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  173. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  174. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  175. package/build-module/components/block-list-appender/index.js.map +1 -1
  176. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  177. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  178. package/build-module/components/block-mover/button.js.map +1 -1
  179. package/build-module/components/block-mover/index.native.js.map +1 -1
  180. package/build-module/components/block-parent-selector/index.js.map +1 -1
  181. package/build-module/components/block-pattern-setup/index.js +1 -1
  182. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  183. package/build-module/components/block-preview/auto.js.map +1 -1
  184. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  185. package/build-module/components/block-settings-menu/block-mode-toggle.js +3 -5
  186. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  187. package/build-module/components/block-settings-menu/block-settings-dropdown.js +9 -3
  188. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  189. package/build-module/components/block-styles/index.js +5 -2
  190. package/build-module/components/block-styles/index.js.map +1 -1
  191. package/build-module/components/block-styles/menu-items.js +3 -5
  192. package/build-module/components/block-styles/menu-items.js.map +1 -1
  193. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  194. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  195. package/build-module/components/block-toolbar/utils.js +3 -5
  196. package/build-module/components/block-toolbar/utils.js.map +1 -1
  197. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  198. package/build-module/components/block-tools/index.js.map +1 -1
  199. package/build-module/components/block-types-list/index.native.js.map +1 -1
  200. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  201. package/build-module/components/color-style-selector/index.js.map +1 -1
  202. package/build-module/components/colors/with-colors.js.map +1 -1
  203. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  204. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  205. package/build-module/components/copy-handler/index.js +18 -2
  206. package/build-module/components/copy-handler/index.js.map +1 -1
  207. package/build-module/components/default-block-appender/index.js.map +1 -1
  208. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  209. package/build-module/components/default-style-picker/index.js.map +1 -1
  210. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  211. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  212. package/build-module/components/image-size-control/index.js +4 -1
  213. package/build-module/components/image-size-control/index.js.map +1 -1
  214. package/build-module/components/index.js +2 -0
  215. package/build-module/components/index.js.map +1 -1
  216. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  217. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  218. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  219. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  220. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  221. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  222. package/build-module/components/inserter/index.js.map +1 -1
  223. package/build-module/components/inserter/index.native.js.map +1 -1
  224. package/build-module/components/inserter/library.js +2 -5
  225. package/build-module/components/inserter/library.js.map +1 -1
  226. package/build-module/components/inserter/menu.js.map +1 -1
  227. package/build-module/components/inserter/menu.native.js.map +1 -1
  228. package/build-module/components/inserter/no-results.native.js.map +1 -1
  229. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  230. package/build-module/components/inserter/search-items.js +2 -2
  231. package/build-module/components/inserter/search-items.js.map +1 -1
  232. package/build-module/components/inserter/search-results.native.js.map +1 -1
  233. package/build-module/components/inspector-popover-header/index.js +46 -0
  234. package/build-module/components/inspector-popover-header/index.js.map +1 -0
  235. package/build-module/components/line-height-control/index.js.map +1 -1
  236. package/build-module/components/link-control/index.js +2 -1
  237. package/build-module/components/link-control/index.js.map +1 -1
  238. package/build-module/components/link-control/search-create-button.js +1 -2
  239. package/build-module/components/link-control/search-create-button.js.map +1 -1
  240. package/build-module/components/link-control/search-input.js +3 -1
  241. package/build-module/components/link-control/search-input.js.map +1 -1
  242. package/build-module/components/link-control/settings-drawer.js +2 -5
  243. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  244. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  245. package/build-module/components/list-view/block-contents.js.map +1 -1
  246. package/build-module/components/list-view/branch.js.map +1 -1
  247. package/build-module/components/list-view/index.js.map +1 -1
  248. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  249. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  250. package/build-module/components/list-view/utils.js +1 -6
  251. package/build-module/components/list-view/utils.js.map +1 -1
  252. package/build-module/components/media-placeholder/index.js +2 -1
  253. package/build-module/components/media-placeholder/index.js.map +1 -1
  254. package/build-module/components/media-replace-flow/index.js +22 -7
  255. package/build-module/components/media-replace-flow/index.js.map +1 -1
  256. package/build-module/components/media-upload/index.native.js +1 -1
  257. package/build-module/components/media-upload/index.native.js.map +1 -1
  258. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  259. package/build-module/components/plain-text/index.native.js.map +1 -1
  260. package/build-module/components/preview-options/index.js +4 -0
  261. package/build-module/components/preview-options/index.js.map +1 -1
  262. package/build-module/components/provider/use-block-sync.js +4 -1
  263. package/build-module/components/provider/use-block-sync.js.map +1 -1
  264. package/build-module/components/publish-date-time-picker/index.js +14 -16
  265. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  266. package/build-module/components/rich-text/embed-handler-picker.native.js +3 -5
  267. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  268. package/build-module/components/rich-text/index.js.map +1 -1
  269. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  270. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  271. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  272. package/build-module/components/ungroup-button/index.native.js +3 -5
  273. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  274. package/build-module/components/url-input/index.js +11 -1
  275. package/build-module/components/url-input/index.js.map +1 -1
  276. package/build-module/components/use-block-display-information/index.js.map +1 -1
  277. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  278. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  279. package/build-module/components/use-display-block-controls/index.native.js.map +1 -1
  280. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  281. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  282. package/build-module/components/use-setting/index.js.map +1 -1
  283. package/build-module/components/writing-flow/use-arrow-nav.js +12 -11
  284. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  285. package/build-module/components/writing-flow/use-click-selection.js.map +1 -1
  286. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  287. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  288. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  289. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  290. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  291. package/build-module/hooks/color-panel.js.map +1 -1
  292. package/build-module/hooks/color-panel.native.js.map +1 -1
  293. package/build-module/hooks/color.js.map +1 -1
  294. package/build-module/hooks/font-family.js.map +1 -1
  295. package/build-module/hooks/gap.js.map +1 -1
  296. package/build-module/hooks/layout.js +39 -2
  297. package/build-module/hooks/layout.js.map +1 -1
  298. package/build-module/store/actions.js.map +1 -1
  299. package/build-module/store/reducer.js.map +1 -1
  300. package/build-module/store/selectors.js +2 -2
  301. package/build-module/store/selectors.js.map +1 -1
  302. package/build-module/utils/pasting.js.map +1 -1
  303. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  304. package/build-style/style-rtl.css +16 -23
  305. package/build-style/style.css +16 -23
  306. package/package.json +28 -28
  307. package/src/autocompleters/block.js +2 -1
  308. package/src/components/block-actions/index.js +2 -3
  309. package/src/components/block-alignment-control/ui.js +4 -6
  310. package/src/components/block-alignment-matrix-control/index.js +2 -4
  311. package/src/components/block-breadcrumb/index.js +2 -5
  312. package/src/components/block-compare/test/block-view.js +2 -1
  313. package/src/components/block-content-overlay/index.js +2 -5
  314. package/src/components/block-context/index.js +4 -4
  315. package/src/components/block-controls/hook.js +2 -3
  316. package/src/components/block-draggable/index.js +6 -13
  317. package/src/components/block-draggable/index.native.js +6 -14
  318. package/src/components/block-draggable/test/index.native.js +12 -15
  319. package/src/components/block-edit/test/edit.js +2 -1
  320. package/src/components/block-list/block-list-item.native.js +4 -12
  321. package/src/components/block-list/block-selection-button.native.js +2 -3
  322. package/src/components/block-list/block.js +8 -10
  323. package/src/components/block-list/block.native.js +10 -15
  324. package/src/components/block-list/index.js +2 -3
  325. package/src/components/block-list/index.native.js +12 -21
  326. package/src/components/block-list/test/block-list-context.native.js +8 -16
  327. package/src/components/block-list/use-block-props/index.js +6 -3
  328. package/src/components/block-list/use-block-props/use-block-custom-class-name.js +2 -3
  329. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +2 -3
  330. package/src/components/block-list/use-in-between-inserter.js +2 -3
  331. package/src/components/block-list-appender/index.js +2 -5
  332. package/src/components/block-list-appender/index.native.js +2 -3
  333. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +4 -6
  334. package/src/components/block-mover/button.js +2 -3
  335. package/src/components/block-mover/index.native.js +4 -6
  336. package/src/components/block-parent-selector/index.js +2 -3
  337. package/src/components/block-pattern-setup/index.js +3 -5
  338. package/src/components/block-preview/auto.js +4 -8
  339. package/src/components/block-selection-clearer/index.js +2 -3
  340. package/src/components/block-settings-menu/block-mode-toggle.js +4 -8
  341. package/src/components/block-settings-menu/block-settings-dropdown.js +9 -9
  342. package/src/components/block-styles/index.js +3 -1
  343. package/src/components/block-styles/menu-items.js +2 -5
  344. package/src/components/block-switcher/block-transformations-menu.js +2 -4
  345. package/src/components/block-toolbar/index.native.js +2 -5
  346. package/src/components/block-toolbar/utils.js +3 -11
  347. package/src/components/block-tools/block-contextual-toolbar.js +2 -5
  348. package/src/components/block-tools/index.js +2 -3
  349. package/src/components/block-types-list/index.native.js +2 -4
  350. package/src/components/block-variation-transforms/index.js +4 -6
  351. package/src/components/color-palette/test/control.js +2 -1
  352. package/src/components/color-style-selector/index.js +27 -28
  353. package/src/components/colors/test/with-colors.js +14 -14
  354. package/src/components/colors/with-colors.js +8 -12
  355. package/src/components/colors-gradients/dropdown.js +21 -16
  356. package/src/components/colors-gradients/test/control.js +10 -10
  357. package/src/components/convert-to-group-buttons/toolbar.js +2 -6
  358. package/src/components/copy-handler/README.md +7 -2
  359. package/src/components/copy-handler/index.js +26 -6
  360. package/src/components/default-block-appender/index.js +4 -6
  361. package/src/components/default-block-appender/index.native.js +4 -9
  362. package/src/components/default-style-picker/index.js +20 -21
  363. package/src/components/font-sizes/with-font-sizes.js +2 -3
  364. package/src/components/image-editor/aspect-ratio-dropdown.js +2 -6
  365. package/src/components/image-size-control/index.js +4 -7
  366. package/src/components/index.js +2 -0
  367. package/src/components/inner-blocks/use-inner-block-template-sync.js +2 -3
  368. package/src/components/inner-blocks/use-nested-settings-update.js +6 -9
  369. package/src/components/inserter/block-types-tab.native.js +2 -3
  370. package/src/components/inserter/hooks/use-block-type-impressions.native.js +2 -3
  371. package/src/components/inserter/hooks/use-insertion-point.js +3 -2
  372. package/src/components/inserter/hooks/use-patterns-state.js +4 -5
  373. package/src/components/inserter/index.js +4 -6
  374. package/src/components/inserter/index.native.js +6 -11
  375. package/src/components/inserter/library.js +2 -5
  376. package/src/components/inserter/menu.js +14 -19
  377. package/src/components/inserter/menu.native.js +8 -6
  378. package/src/components/inserter/no-results.native.js +2 -1
  379. package/src/components/inserter/quick-inserter.js +2 -3
  380. package/src/components/inserter/search-items.js +6 -6
  381. package/src/components/inserter/search-results.native.js +4 -6
  382. package/src/components/inspector-popover-header/README.md +76 -0
  383. package/src/components/inspector-popover-header/index.js +56 -0
  384. package/src/components/inspector-popover-header/style.scss +16 -0
  385. package/src/components/line-height-control/index.js +1 -2
  386. package/src/components/link-control/index.js +4 -4
  387. package/src/components/link-control/search-create-button.js +4 -2
  388. package/src/components/link-control/search-input.js +3 -1
  389. package/src/components/link-control/settings-drawer.js +2 -5
  390. package/src/components/link-control/test/fixtures/index.js +3 -4
  391. package/src/components/link-control/test/index.js +24 -36
  392. package/src/components/link-control/use-search-handler.js +2 -2
  393. package/src/components/list-view/block-contents.js +2 -4
  394. package/src/components/list-view/branch.js +22 -23
  395. package/src/components/list-view/index.js +4 -8
  396. package/src/components/list-view/use-block-selection.js +5 -5
  397. package/src/components/list-view/use-list-view-drop-zone.js +2 -1
  398. package/src/components/list-view/utils.js +1 -6
  399. package/src/components/media-placeholder/index.js +2 -1
  400. package/src/components/media-replace-flow/index.js +77 -46
  401. package/src/components/media-upload/index.native.js +1 -1
  402. package/src/components/navigable-toolbar/index.js +1 -2
  403. package/src/components/panel-color-settings/test/index.js +2 -1
  404. package/src/components/plain-text/index.native.js +2 -6
  405. package/src/components/preview-options/index.js +4 -0
  406. package/src/components/provider/use-block-sync.js +5 -2
  407. package/src/components/publish-date-time-picker/README.md +1 -1
  408. package/src/components/publish-date-time-picker/index.js +16 -27
  409. package/src/components/responsive-block-control/test/index.js +3 -2
  410. package/src/components/rich-text/embed-handler-picker.native.js +2 -5
  411. package/src/components/rich-text/index.js +7 -4
  412. package/src/components/rich-text/use-format-types.js +16 -16
  413. package/src/components/rich-text/use-mark-persistent.js +2 -3
  414. package/src/components/skip-to-selected-block/index.js +2 -3
  415. package/src/components/ungroup-button/index.native.js +4 -8
  416. package/src/components/url-input/index.js +21 -20
  417. package/src/components/use-block-display-information/index.js +4 -6
  418. package/src/components/use-block-drop-zone/index.js +2 -3
  419. package/src/components/use-block-drop-zone/index.native.js +2 -4
  420. package/src/components/use-block-drop-zone/test/index.js +22 -23
  421. package/src/components/use-display-block-controls/index.native.js +2 -3
  422. package/src/components/use-no-recursive-renders/test/use-no-recursive-renders.js +2 -3
  423. package/src/components/use-on-block-drop/index.js +2 -5
  424. package/src/components/use-on-block-drop/index.native.js +4 -8
  425. package/src/components/use-setting/index.js +8 -6
  426. package/src/components/writing-flow/test/index.js +22 -4
  427. package/src/components/writing-flow/use-arrow-nav.js +22 -10
  428. package/src/components/writing-flow/use-click-selection.js +2 -5
  429. package/src/components/writing-flow/use-drag-selection.js +6 -9
  430. package/src/components/writing-flow/use-multi-selection.js +2 -4
  431. package/src/components/writing-flow/use-select-all.js +2 -5
  432. package/src/components/writing-flow/use-selection-observer.js +4 -6
  433. package/src/components/writing-flow/use-tab-nav.js +2 -5
  434. package/src/hooks/color-panel.js +4 -4
  435. package/src/hooks/color-panel.native.js +2 -2
  436. package/src/hooks/color.js +2 -2
  437. package/src/hooks/font-family.js +4 -2
  438. package/src/hooks/gap.js +2 -3
  439. package/src/hooks/layout.js +54 -4
  440. package/src/hooks/test/align.js +2 -1
  441. package/src/hooks/test/generated-class-name.js +2 -5
  442. package/src/hooks/test/utils.js +2 -5
  443. package/src/store/actions.js +772 -728
  444. package/src/store/reducer.js +188 -177
  445. package/src/store/selectors.js +54 -54
  446. package/src/store/test/actions.js +2 -1
  447. package/src/store/test/reducer.js +3 -1
  448. package/src/store/test/selectors.js +17 -21
  449. package/src/style.scss +1 -1
  450. package/src/utils/pasting.js +3 -3
  451. package/src/utils/transform-styles/transforms/wrap.js +30 -28
  452. package/tsconfig.tsbuildinfo +1 -1
  453. package/src/components/publish-date-time-picker/style.scss +0 -20
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { debounce, isFunction } from 'lodash';
4
+ import { debounce } from 'lodash';
5
5
  import classnames from 'classnames';
6
6
  import scrollIntoView from 'dom-scroll-into-view';
7
7
 
@@ -27,6 +27,16 @@ import { isURL } from '@wordpress/url';
27
27
  */
28
28
  import { store as blockEditorStore } from '../../store';
29
29
 
30
+ /**
31
+ * Whether the argument is a function.
32
+ *
33
+ * @param {*} maybeFunc The argument to check.
34
+ * @return {boolean} True if the argument is a function, false otherwise.
35
+ */
36
+ function isFunction( maybeFunc ) {
37
+ return typeof maybeFunc === 'function';
38
+ }
39
+
30
40
  class URLInput extends Component {
31
41
  constructor( props ) {
32
42
  super( props );
@@ -60,10 +70,8 @@ class URLInput extends Component {
60
70
 
61
71
  componentDidUpdate( prevProps ) {
62
72
  const { showSuggestions, selectedSuggestion } = this.state;
63
- const {
64
- value,
65
- __experimentalShowInitialSuggestions = false,
66
- } = this.props;
73
+ const { value, __experimentalShowInitialSuggestions = false } =
74
+ this.props;
67
75
 
68
76
  // Only have to worry about scrolling selected suggestion into view
69
77
  // when already expanded.
@@ -122,10 +130,8 @@ class URLInput extends Component {
122
130
 
123
131
  shouldShowInitialSuggestions() {
124
132
  const { suggestions } = this.state;
125
- const {
126
- __experimentalShowInitialSuggestions = false,
127
- value,
128
- } = this.props;
133
+ const { __experimentalShowInitialSuggestions = false, value } =
134
+ this.props;
129
135
  return (
130
136
  ! this.isUpdatingSuggestions &&
131
137
  __experimentalShowInitialSuggestions &&
@@ -257,12 +263,8 @@ class URLInput extends Component {
257
263
  }
258
264
 
259
265
  onKeyDown( event ) {
260
- const {
261
- showSuggestions,
262
- selectedSuggestion,
263
- suggestions,
264
- loading,
265
- } = this.state;
266
+ const { showSuggestions, selectedSuggestion, suggestions, loading } =
267
+ this.state;
266
268
 
267
269
  // If the suggestions are not shown or loading, we shouldn't handle the arrow keys
268
270
  // We shouldn't preventDefault to allow block arrow keys navigation.
@@ -315,9 +317,8 @@ class URLInput extends Component {
315
317
  return;
316
318
  }
317
319
 
318
- const suggestion = this.state.suggestions[
319
- this.state.selectedSuggestion
320
- ];
320
+ const suggestion =
321
+ this.state.suggestions[ this.state.selectedSuggestion ];
321
322
 
322
323
  switch ( event.keyCode ) {
323
324
  case UP: {
@@ -590,8 +591,8 @@ export default compose(
590
591
  }
591
592
  const { getSettings } = select( blockEditorStore );
592
593
  return {
593
- __experimentalFetchLinkSuggestions: getSettings()
594
- .__experimentalFetchLinkSuggestions,
594
+ __experimentalFetchLinkSuggestions:
595
+ getSettings().__experimentalFetchLinkSuggestions,
595
596
  };
596
597
  } )
597
598
  )( URLInput );
@@ -41,12 +41,10 @@ export default function useBlockDisplayInformation( clientId ) {
41
41
  return useSelect(
42
42
  ( select ) => {
43
43
  if ( ! clientId ) return null;
44
- const { getBlockName, getBlockAttributes } = select(
45
- blockEditorStore
46
- );
47
- const { getBlockType, getActiveBlockVariation } = select(
48
- blocksStore
49
- );
44
+ const { getBlockName, getBlockAttributes } =
45
+ select( blockEditorStore );
46
+ const { getBlockType, getActiveBlockVariation } =
47
+ select( blocksStore );
50
48
  const blockName = getBlockName( clientId );
51
49
  const blockType = getBlockType( blockName );
52
50
  if ( ! blockType ) return null;
@@ -101,9 +101,8 @@ export default function useBlockDropZone( {
101
101
  );
102
102
 
103
103
  const { getBlockListSettings } = useSelect( blockEditorStore );
104
- const { showInsertionPoint, hideInsertionPoint } = useDispatch(
105
- blockEditorStore
106
- );
104
+ const { showInsertionPoint, hideInsertionPoint } =
105
+ useDispatch( blockEditorStore );
107
106
 
108
107
  const onBlockDrop = useOnBlockDrop( targetRootClientId, targetBlockIndex );
109
108
  const throttled = useThrottle(
@@ -113,10 +113,8 @@ export default function useBlockDropZone( {
113
113
  const targetBlockIndex = useSharedValue( null );
114
114
 
115
115
  const { getBlockListSettings, getSettings } = useSelect( blockEditorStore );
116
- const {
117
- blocksLayouts,
118
- getBlockLayoutsOrderedByYCoord,
119
- } = useBlockListContext();
116
+ const { blocksLayouts, getBlockLayoutsOrderedByYCoord } =
117
+ useBlockListContext();
120
118
 
121
119
  const getSortedBlocksLayouts = useCallback( () => {
122
120
  return getBlockLayoutsOrderedByYCoord( blocksLayouts.current );
@@ -39,30 +39,29 @@ const createMockClassList = ( classes ) => {
39
39
  };
40
40
  };
41
41
 
42
- const mapElements = ( orientation ) => (
43
- { top, right, bottom, left },
44
- index
45
- ) => {
46
- return {
47
- dataset: { block: index + 1 },
48
- getBoundingClientRect() {
49
- return orientation === 'vertical'
50
- ? {
51
- top,
52
- right,
53
- bottom,
54
- left,
55
- }
56
- : {
57
- top: left,
58
- bottom: right,
59
- left: top,
60
- right: bottom,
61
- };
62
- },
63
- classList: createMockClassList( 'wp-block' ),
42
+ const mapElements =
43
+ ( orientation ) =>
44
+ ( { top, right, bottom, left }, index ) => {
45
+ return {
46
+ dataset: { block: index + 1 },
47
+ getBoundingClientRect() {
48
+ return orientation === 'vertical'
49
+ ? {
50
+ top,
51
+ right,
52
+ bottom,
53
+ left,
54
+ }
55
+ : {
56
+ top: left,
57
+ bottom: right,
58
+ left: top,
59
+ right: bottom,
60
+ };
61
+ },
62
+ classList: createMockClassList( 'wp-block' ),
63
+ };
64
64
  };
65
- };
66
65
 
67
66
  const verticalElements = elementData.map( mapElements( 'vertical' ) );
68
67
  // Flip the elementData to make a horizontal block list.
@@ -14,9 +14,8 @@ export default function useDisplayBlockControls() {
14
14
  const { isSelected, clientId, name } = useBlockEditContext();
15
15
  return useSelect(
16
16
  ( select ) => {
17
- const { getBlockName, getBlockRootClientId } = select(
18
- blockEditorStore
19
- );
17
+ const { getBlockName, getBlockRootClientId } =
18
+ select( blockEditorStore );
20
19
 
21
20
  const parentId = getBlockRootClientId( clientId );
22
21
  const parentBlockName = getBlockName( parentId );
@@ -16,9 +16,8 @@ import {
16
16
  // of calling itself depending on its `uniqueId` attribute.
17
17
  function Edit( { attributes: { uniqueId } } ) {
18
18
  const { name } = useBlockEditContext();
19
- const [ hasAlreadyRendered, RecursionProvider ] = useNoRecursiveRenders(
20
- uniqueId
21
- );
19
+ const [ hasAlreadyRendered, RecursionProvider ] =
20
+ useNoRecursiveRenders( uniqueId );
22
21
 
23
22
  if ( hasAlreadyRendered ) {
24
23
  return <div className={ `wp-block__${ name }--halted` }>Halt</div>;
@@ -217,11 +217,8 @@ export default function useOnBlockDrop( targetRootClientId, targetBlockIndex ) {
217
217
  ( select ) => select( blockEditorStore ).getSettings().mediaUpload,
218
218
  []
219
219
  );
220
- const {
221
- canInsertBlockType,
222
- getBlockIndex,
223
- getClientIdsOfDescendants,
224
- } = useSelect( blockEditorStore );
220
+ const { canInsertBlockType, getBlockIndex, getClientIdsOfDescendants } =
221
+ useSelect( blockEditorStore );
225
222
  const {
226
223
  insertBlocks,
227
224
  moveBlocksToPosition,
@@ -100,14 +100,10 @@ export function onBlockDrop(
100
100
  * @return {Function} The event handler for a block drop event.
101
101
  */
102
102
  export default function useOnBlockDrop() {
103
- const { getBlockIndex, getClientIdsOfDescendants } = useSelect(
104
- blockEditorStore
105
- );
106
- const {
107
- insertBlocks,
108
- moveBlocksToPosition,
109
- clearSelectedBlock,
110
- } = useDispatch( blockEditorStore );
103
+ const { getBlockIndex, getClientIdsOfDescendants } =
104
+ useSelect( blockEditorStore );
105
+ const { insertBlocks, moveBlocksToPosition, clearSelectedBlock } =
106
+ useDispatch( blockEditorStore );
111
107
 
112
108
  return onBlockDrop(
113
109
  getBlockIndex,
@@ -128,9 +128,10 @@ export default function useSetting( path ) {
128
128
  clientId, // The current block is added last, so it overwrites any ancestor.
129
129
  ];
130
130
  candidates.forEach( ( candidateClientId ) => {
131
- const candidateBlockName = select(
132
- blockEditorStore
133
- ).getBlockName( candidateClientId );
131
+ const candidateBlockName =
132
+ select( blockEditorStore ).getBlockName(
133
+ candidateClientId
134
+ );
134
135
  if (
135
136
  hasBlockSupport(
136
137
  candidateBlockName,
@@ -138,9 +139,10 @@ export default function useSetting( path ) {
138
139
  false
139
140
  )
140
141
  ) {
141
- const candidateAtts = select(
142
- blockEditorStore
143
- ).getBlockAttributes( candidateClientId );
142
+ const candidateAtts =
143
+ select( blockEditorStore ).getBlockAttributes(
144
+ candidateClientId
145
+ );
144
146
  const candidateResult =
145
147
  get(
146
148
  candidateAtts,
@@ -12,7 +12,13 @@ describe( 'isNavigationCandidate', () => {
12
12
  let elements;
13
13
  beforeAll( () => {
14
14
  elements = {};
15
- elements.input = document.createElement( 'input' );
15
+
16
+ elements.inputText = document.createElement( 'input' );
17
+ elements.inputText.setAttribute( 'type', 'text' );
18
+
19
+ elements.inputCheckbox = document.createElement( 'input' );
20
+ elements.inputCheckbox.setAttribute( 'type', 'checkbox' );
21
+
16
22
  elements.contentEditable = document.createElement( 'p' );
17
23
  elements.contentEditable.contentEditable = true;
18
24
  } );
@@ -20,7 +26,7 @@ describe( 'isNavigationCandidate', () => {
20
26
  it( 'should return true if vertically navigating input without modifier', () => {
21
27
  [ UP, DOWN ].forEach( ( keyCode ) => {
22
28
  const result = isNavigationCandidate(
23
- elements.input,
29
+ elements.inputText,
24
30
  keyCode,
25
31
  false
26
32
  );
@@ -32,7 +38,7 @@ describe( 'isNavigationCandidate', () => {
32
38
  it( 'should return false if vertically navigating input with modifier', () => {
33
39
  [ UP, DOWN ].forEach( ( keyCode ) => {
34
40
  const result = isNavigationCandidate(
35
- elements.input,
41
+ elements.inputText,
36
42
  keyCode,
37
43
  true
38
44
  );
@@ -44,7 +50,7 @@ describe( 'isNavigationCandidate', () => {
44
50
  it( 'should return false if horizontally navigating input', () => {
45
51
  [ LEFT, RIGHT ].forEach( ( keyCode ) => {
46
52
  const result = isNavigationCandidate(
47
- elements.input,
53
+ elements.inputText,
48
54
  keyCode,
49
55
  false
50
56
  );
@@ -53,6 +59,18 @@ describe( 'isNavigationCandidate', () => {
53
59
  } );
54
60
  } );
55
61
 
62
+ it( 'should return true if horizontally navigating simple inputs like checkboxes', () => {
63
+ [ LEFT, RIGHT ].forEach( ( keyCode ) => {
64
+ const result = isNavigationCandidate(
65
+ elements.inputCheckbox,
66
+ keyCode,
67
+ false
68
+ );
69
+
70
+ expect( result ).toBe( true );
71
+ } );
72
+ } );
73
+
56
74
  it( 'should return true if horizontally navigating non-input', () => {
57
75
  [ LEFT, RIGHT ].forEach( ( keyCode ) => {
58
76
  const result = isNavigationCandidate(
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { find, reverse } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -43,9 +38,25 @@ export function isNavigationCandidate( element, keyCode, hasModifier ) {
43
38
  return true;
44
39
  }
45
40
 
46
- // Native inputs should not navigate horizontally.
47
41
  const { tagName } = element;
48
- return tagName !== 'INPUT' && tagName !== 'TEXTAREA';
42
+
43
+ // Native inputs should not navigate horizontally, unless they are simple types that don't need left/right arrow keys.
44
+ if ( tagName === 'INPUT' ) {
45
+ const simpleInputTypes = [
46
+ 'button',
47
+ 'checkbox',
48
+ 'color',
49
+ 'file',
50
+ 'image',
51
+ 'radio',
52
+ 'reset',
53
+ 'submit',
54
+ ];
55
+ return simpleInputTypes.includes( element.getAttribute( 'type' ) );
56
+ }
57
+
58
+ // Native textareas should not navigate horizontally.
59
+ return tagName !== 'TEXTAREA';
49
60
  }
50
61
 
51
62
  /**
@@ -73,7 +84,7 @@ export function getClosestTabbable(
73
84
  let focusableNodes = focus.focusable.find( containerElement );
74
85
 
75
86
  if ( isReverse ) {
76
- focusableNodes = reverse( focusableNodes );
87
+ focusableNodes.reverse();
77
88
  }
78
89
 
79
90
  // Consider as candidates those focusables after the current target. It's
@@ -114,7 +125,7 @@ export function getClosestTabbable(
114
125
  return true;
115
126
  }
116
127
 
117
- return find( focusableNodes, isTabCandidate );
128
+ return focusableNodes.find( isTabCandidate );
118
129
  }
119
130
 
120
131
  export default function useArrowNav() {
@@ -215,7 +226,8 @@ export default function useArrowNav() {
215
226
  const selectedBlockClientId = getSelectedBlockClientId();
216
227
 
217
228
  if ( isShift ) {
218
- const selectionEndClientId = getMultiSelectedBlocksEndClientId();
229
+ const selectionEndClientId =
230
+ getMultiSelectedBlocksEndClientId();
219
231
  const selectionBeforeEndClientId = getPreviousBlockClientId(
220
232
  selectionEndClientId || selectedBlockClientId
221
233
  );
@@ -12,11 +12,8 @@ import { getBlockClientId } from '../../utils/dom';
12
12
 
13
13
  export default function useClickSelection() {
14
14
  const { selectBlock } = useDispatch( blockEditorStore );
15
- const {
16
- isSelectionEnabled,
17
- getBlockSelectionStart,
18
- hasMultiSelection,
19
- } = useSelect( blockEditorStore );
15
+ const { isSelectionEnabled, getBlockSelectionStart, hasMultiSelection } =
16
+ useSelect( blockEditorStore );
20
17
  return useRefEffect(
21
18
  ( node ) => {
22
19
  function onMouseDown( event ) {
@@ -25,12 +25,10 @@ function setContentEditableWrapper( node, value ) {
25
25
  * Sets a multi-selection based on the native selection across blocks.
26
26
  */
27
27
  export default function useDragSelection() {
28
- const { startMultiSelect, stopMultiSelect } = useDispatch(
29
- blockEditorStore
30
- );
31
- const { isSelectionEnabled, hasMultiSelection } = useSelect(
32
- blockEditorStore
33
- );
28
+ const { startMultiSelect, stopMultiSelect } =
29
+ useDispatch( blockEditorStore );
30
+ const { isSelectionEnabled, hasMultiSelection } =
31
+ useSelect( blockEditorStore );
34
32
  return useRefEffect(
35
33
  ( node ) => {
36
34
  const { ownerDocument } = node;
@@ -61,9 +59,8 @@ export default function useDragSelection() {
61
59
  const selection = defaultView.getSelection();
62
60
 
63
61
  if ( selection.rangeCount ) {
64
- const {
65
- commonAncestorContainer,
66
- } = selection.getRangeAt( 0 );
62
+ const { commonAncestorContainer } =
63
+ selection.getRangeAt( 0 );
67
64
 
68
65
  if (
69
66
  anchorElement.contains( commonAncestorContainer )
@@ -74,10 +74,8 @@ export default function useMultiSelection() {
74
74
 
75
75
  if ( selection.rangeCount && ! selection.isCollapsed ) {
76
76
  const blockNode = selectedRef.current;
77
- const {
78
- startContainer,
79
- endContainer,
80
- } = selection.getRangeAt( 0 );
77
+ const { startContainer, endContainer } =
78
+ selection.getRangeAt( 0 );
81
79
 
82
80
  if (
83
81
  !! blockNode &&
@@ -17,11 +17,8 @@ import { useRefEffect } from '@wordpress/compose';
17
17
  import { store as blockEditorStore } from '../../store';
18
18
 
19
19
  export default function useSelectAll() {
20
- const {
21
- getBlockOrder,
22
- getSelectedBlockClientIds,
23
- getBlockRootClientId,
24
- } = useSelect( blockEditorStore );
20
+ const { getBlockOrder, getSelectedBlockClientIds, getBlockRootClientId } =
21
+ useSelect( blockEditorStore );
25
22
  const { multiSelect } = useDispatch( blockEditorStore );
26
23
  const isMatch = useShortcutEventMatch();
27
24
 
@@ -73,12 +73,10 @@ function setContentEditableWrapper( node, value ) {
73
73
  * Sets a multi-selection based on the native selection across blocks.
74
74
  */
75
75
  export default function useSelectionObserver() {
76
- const { multiSelect, selectBlock, selectionChange } = useDispatch(
77
- blockEditorStore
78
- );
79
- const { getBlockParents, getBlockSelectionStart } = useSelect(
80
- blockEditorStore
81
- );
76
+ const { multiSelect, selectBlock, selectionChange } =
77
+ useDispatch( blockEditorStore );
78
+ const { getBlockParents, getBlockSelectionStart } =
79
+ useSelect( blockEditorStore );
82
80
  return useRefEffect(
83
81
  ( node ) => {
84
82
  const { ownerDocument } = node;
@@ -17,11 +17,8 @@ export default function useTabNav() {
17
17
  const focusCaptureBeforeRef = useRef();
18
18
  const focusCaptureAfterRef = useRef();
19
19
  const lastFocus = useRef();
20
- const {
21
- hasMultiSelection,
22
- getSelectedBlockClientId,
23
- getBlockCount,
24
- } = useSelect( blockEditorStore );
20
+ const { hasMultiSelection, getSelectedBlockClientId, getBlockCount } =
21
+ useSelect( blockEditorStore );
25
22
  const { setNavigationMode } = useDispatch( blockEditorStore );
26
23
  const isNavigationMode = useSelect(
27
24
  ( select ) => select( blockEditorStore ).isNavigationMode(),
@@ -43,8 +43,8 @@ export default function ColorPanel( {
43
43
  }
44
44
 
45
45
  let backgroundColorNode = ref.current;
46
- let backgroundColor = getComputedStyle( backgroundColorNode )
47
- .backgroundColor;
46
+ let backgroundColor =
47
+ getComputedStyle( backgroundColorNode ).backgroundColor;
48
48
  while (
49
49
  backgroundColor === 'rgba(0, 0, 0, 0)' &&
50
50
  backgroundColorNode.parentNode &&
@@ -52,8 +52,8 @@ export default function ColorPanel( {
52
52
  backgroundColorNode.parentNode.ELEMENT_NODE
53
53
  ) {
54
54
  backgroundColorNode = backgroundColorNode.parentNode;
55
- backgroundColor = getComputedStyle( backgroundColorNode )
56
- .backgroundColor;
55
+ backgroundColor =
56
+ getComputedStyle( backgroundColorNode ).backgroundColor;
57
57
  }
58
58
 
59
59
  setDetectedBackgroundColor( backgroundColor );
@@ -23,8 +23,8 @@ const ColorPanel = ( { settings } ) => {
23
23
  const { baseGlobalStyles } = useSelect( ( select ) => {
24
24
  const { getSettings } = select( blockEditorStore );
25
25
  return {
26
- baseGlobalStyles: getSettings()
27
- ?.__experimentalGlobalStylesBaseStyles?.color,
26
+ baseGlobalStyles:
27
+ getSettings()?.__experimentalGlobalStylesBaseStyles?.color,
28
28
  };
29
29
  } );
30
30
 
@@ -503,8 +503,8 @@ export function ColorEdit( props ) {
503
503
  allSolids,
504
504
  style?.elements?.link?.color?.text
505
505
  ),
506
- clearable: !! style?.elements?.link?.color
507
- ?.text,
506
+ clearable:
507
+ !! style?.elements?.link?.color?.text,
508
508
  isShownByDefault: defaultColorControls?.link,
509
509
  resetAllFilter: resetAllLinkFilter,
510
510
  },
@@ -111,8 +111,10 @@ export function FontFamilyEdit( {
111
111
  } ) {
112
112
  const fontFamilies = useSetting( 'typography.fontFamilies' );
113
113
 
114
- const value = find( fontFamilies, ( { slug } ) => fontFamily === slug )
115
- ?.fontFamily;
114
+ const value = find(
115
+ fontFamilies,
116
+ ( { slug } ) => fontFamily === slug
117
+ )?.fontFamily;
116
118
 
117
119
  function onChange( newValue ) {
118
120
  const predefinedFontFamily = find(
package/src/hooks/gap.js CHANGED
@@ -67,9 +67,8 @@ export function getGapBoxControlValueFromStyle( blockGapValue ) {
67
67
  * @return {string|null} The concatenated gap value (row and column).
68
68
  */
69
69
  export function getGapCSSValue( blockGapValue, defaultValue = '0' ) {
70
- const blockGapBoxControlValue = getGapBoxControlValueFromStyle(
71
- blockGapValue
72
- );
70
+ const blockGapBoxControlValue =
71
+ getGapBoxControlValueFromStyle( blockGapValue );
73
72
  if ( ! blockGapBoxControlValue ) {
74
73
  return null;
75
74
  }
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { has } from 'lodash';
5
+ import { has, kebabCase } from 'lodash';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -32,6 +32,49 @@ import { getLayoutType, getLayoutTypes } from '../layouts';
32
32
 
33
33
  const layoutBlockSupportKey = '__experimentalLayout';
34
34
 
35
+ /**
36
+ * Generates the utility classnames for the given blocks layout attributes.
37
+ * This method was primarily added to reintroduce classnames that were removed
38
+ * in the 5.9 release (https://github.com/WordPress/gutenberg/issues/38719), rather
39
+ * than providing an extensive list of all possible layout classes. The plan is to
40
+ * have the style engine generate a more extensive list of utility classnames which
41
+ * will then replace this method.
42
+ *
43
+ * @param { Array } attributes Array of block attributes.
44
+ *
45
+ * @return { Array } Array of CSS classname strings.
46
+ */
47
+ function getLayoutClasses( attributes ) {
48
+ const layoutClassnames = [];
49
+
50
+ if ( ! attributes.layout ) {
51
+ return layoutClassnames;
52
+ }
53
+
54
+ if ( attributes?.layout?.orientation ) {
55
+ layoutClassnames.push(
56
+ `is-${ kebabCase( attributes.layout.orientation ) }`
57
+ );
58
+ }
59
+
60
+ if ( attributes?.layout?.justifyContent ) {
61
+ layoutClassnames.push(
62
+ `is-content-justification-${ kebabCase(
63
+ attributes.layout.justifyContent
64
+ ) }`
65
+ );
66
+ }
67
+
68
+ if (
69
+ attributes?.layout?.flexWrap &&
70
+ attributes.layout.flexWrap === 'nowrap'
71
+ ) {
72
+ layoutClassnames.push( 'is-nowrap' );
73
+ }
74
+
75
+ return layoutClassnames;
76
+ }
77
+
35
78
  function LayoutPanel( { setAttributes, attributes, name: blockName } ) {
36
79
  const { layout } = attributes;
37
80
  const defaultThemeLayout = useSetting( 'layout' );
@@ -212,9 +255,16 @@ export const withLayoutStyles = createHigherOrderComponent(
212
255
  const usedLayout = layout?.inherit
213
256
  ? defaultThemeLayout
214
257
  : layout || defaultBlockLayout || {};
215
- const className = classnames( props?.className, {
216
- [ `wp-container-${ id }` ]: shouldRenderLayoutStyles,
217
- } );
258
+ const layoutClasses = shouldRenderLayoutStyles
259
+ ? getLayoutClasses( attributes )
260
+ : null;
261
+ const className = classnames(
262
+ props?.className,
263
+ {
264
+ [ `wp-container-${ id }` ]: shouldRenderLayoutStyles,
265
+ },
266
+ layoutClasses
267
+ );
218
268
 
219
269
  return (
220
270
  <>