@wordpress/block-editor 11.7.0 → 12.0.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 (357) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +56 -57
  3. package/build/components/block-info-slot-fill/index.js +47 -0
  4. package/build/components/block-info-slot-fill/index.js.map +1 -0
  5. package/build/components/block-inspector/index.js +4 -2
  6. package/build/components/block-inspector/index.js.map +1 -1
  7. package/build/components/block-list/index.native.js +11 -21
  8. package/build/components/block-list/index.native.js.map +1 -1
  9. package/build/components/block-list/use-in-between-inserter.js +3 -1
  10. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  11. package/build/components/block-popover/inbetween.js +2 -9
  12. package/build/components/block-popover/inbetween.js.map +1 -1
  13. package/build/components/block-settings-menu/block-settings-dropdown.js +1 -10
  14. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  15. package/build/components/block-toolbar/index.js +2 -1
  16. package/build/components/block-toolbar/index.js.map +1 -1
  17. package/build/components/block-tools/block-contextual-toolbar.js +83 -9
  18. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  19. package/build/components/block-tools/selected-block-popover.js +11 -28
  20. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  21. package/build/components/caption/index.native.js +0 -1
  22. package/build/components/caption/index.native.js.map +1 -1
  23. package/build/components/date-format-picker/index.js +1 -1
  24. package/build/components/date-format-picker/index.js.map +1 -1
  25. package/build/components/editor-styles/index.js +4 -3
  26. package/build/components/editor-styles/index.js.map +1 -1
  27. package/build/components/font-sizes/fluid-utils.js +21 -14
  28. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  29. package/build/components/global-styles/border-panel.js +15 -59
  30. package/build/components/global-styles/border-panel.js.map +1 -1
  31. package/build/components/global-styles/color-panel.js +12 -12
  32. package/build/components/global-styles/color-panel.js.map +1 -1
  33. package/build/components/global-styles/color-panel.native.js +174 -0
  34. package/build/components/global-styles/color-panel.native.js.map +1 -0
  35. package/build/components/global-styles/dimensions-panel.js +21 -20
  36. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  37. package/build/components/global-styles/effects-panel.js +244 -0
  38. package/build/components/global-styles/effects-panel.js.map +1 -0
  39. package/build/components/global-styles/filters-panel.js +215 -0
  40. package/build/components/global-styles/filters-panel.js.map +1 -0
  41. package/build/components/global-styles/get-block-css-selector.js +1 -12
  42. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  43. package/build/components/global-styles/hooks.js +7 -0
  44. package/build/components/global-styles/hooks.js.map +1 -1
  45. package/build/components/global-styles/index.js +28 -0
  46. package/build/components/global-styles/index.js.map +1 -1
  47. package/build/components/global-styles/typography-panel.js +9 -9
  48. package/build/components/global-styles/typography-panel.js.map +1 -1
  49. package/build/components/global-styles/use-global-styles-output.js +100 -82
  50. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  51. package/build/components/iframe/index.js +1 -1
  52. package/build/components/iframe/index.js.map +1 -1
  53. package/build/components/image-size-control/use-dimension-handler.js +5 -3
  54. package/build/components/image-size-control/use-dimension-handler.js.map +1 -1
  55. package/build/components/index.js +23 -0
  56. package/build/components/index.js.map +1 -1
  57. package/build/components/inserter/block-patterns-tab.js +4 -2
  58. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  59. package/build/components/inserter/block-types-tab.js +12 -7
  60. package/build/components/inserter/block-types-tab.js.map +1 -1
  61. package/build/components/inserter/index.js +2 -1
  62. package/build/components/inserter/index.js.map +1 -1
  63. package/build/components/inspector-controls/groups.js +2 -0
  64. package/build/components/inspector-controls/groups.js.map +1 -1
  65. package/build/components/inspector-controls-tabs/styles-tab.js +2 -0
  66. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  67. package/build/components/inspector-controls-tabs/utils.js +5 -3
  68. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  69. package/build/components/list-view/block-select-button.js +7 -2
  70. package/build/components/list-view/block-select-button.js.map +1 -1
  71. package/build/components/list-view/block.js +13 -21
  72. package/build/components/list-view/block.js.map +1 -1
  73. package/build/components/list-view/drop-indicator.js +37 -10
  74. package/build/components/list-view/drop-indicator.js.map +1 -1
  75. package/build/components/list-view/index.js +31 -7
  76. package/build/components/list-view/index.js.map +1 -1
  77. package/build/components/list-view/leaf.js +2 -1
  78. package/build/components/list-view/leaf.js.map +1 -1
  79. package/build/components/list-view/use-block-selection.js +1 -1
  80. package/build/components/list-view/use-block-selection.js.map +1 -1
  81. package/build/components/list-view/use-list-view-client-ids.js +7 -3
  82. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  83. package/build/components/list-view/use-list-view-drop-zone.js +8 -2
  84. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  85. package/build/components/media-replace-flow/index.js +5 -5
  86. package/build/components/media-replace-flow/index.js.map +1 -1
  87. package/build/components/navigable-toolbar/index.js +12 -4
  88. package/build/components/navigable-toolbar/index.js.map +1 -1
  89. package/build/components/off-canvas-editor/appender.js +2 -7
  90. package/build/components/off-canvas-editor/appender.js.map +1 -1
  91. package/build/components/off-canvas-editor/block-contents.js +6 -1
  92. package/build/components/off-canvas-editor/block-contents.js.map +1 -1
  93. package/build/components/off-canvas-editor/index.js +17 -14
  94. package/build/components/off-canvas-editor/index.js.map +1 -1
  95. package/build/components/resizable-box-popover/index.js +38 -0
  96. package/build/components/resizable-box-popover/index.js.map +1 -0
  97. package/build/components/rich-text/index.js +0 -1
  98. package/build/components/rich-text/index.js.map +1 -1
  99. package/build/components/rich-text/index.native.js +7 -11
  100. package/build/components/rich-text/index.native.js.map +1 -1
  101. package/build/components/spacing-sizes-control/spacing-input-control.js +8 -0
  102. package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  103. package/build/hooks/anchor.js +1 -1
  104. package/build/hooks/anchor.js.map +1 -1
  105. package/build/hooks/border.js +1 -1
  106. package/build/hooks/border.js.map +1 -1
  107. package/build/hooks/duotone.js +121 -70
  108. package/build/hooks/duotone.js.map +1 -1
  109. package/build/hooks/margin.js +27 -17
  110. package/build/hooks/margin.js.map +1 -1
  111. package/build/hooks/padding.js +19 -9
  112. package/build/hooks/padding.js.map +1 -1
  113. package/build/hooks/utils.js +22 -7
  114. package/build/hooks/utils.js.map +1 -1
  115. package/build/layouts/utils.js +3 -2
  116. package/build/layouts/utils.js.map +1 -1
  117. package/build/private-apis.js +13 -1
  118. package/build/private-apis.js.map +1 -1
  119. package/build/store/actions.js +8 -1
  120. package/build/store/actions.js.map +1 -1
  121. package/build/utils/object.js +6 -6
  122. package/build/utils/object.js.map +1 -1
  123. package/build/utils/transform-styles/index.js +2 -2
  124. package/build/utils/transform-styles/index.js.map +1 -1
  125. package/build/utils/use-should-contextual-toolbar-show.js +68 -0
  126. package/build/utils/use-should-contextual-toolbar-show.js.map +1 -0
  127. package/build-module/components/block-info-slot-fill/index.js +34 -0
  128. package/build-module/components/block-info-slot-fill/index.js.map +1 -0
  129. package/build-module/components/block-inspector/index.js +3 -2
  130. package/build-module/components/block-inspector/index.js.map +1 -1
  131. package/build-module/components/block-list/index.native.js +11 -19
  132. package/build-module/components/block-list/index.native.js.map +1 -1
  133. package/build-module/components/block-list/use-in-between-inserter.js +2 -1
  134. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  135. package/build-module/components/block-popover/inbetween.js +2 -9
  136. package/build-module/components/block-popover/inbetween.js.map +1 -1
  137. package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -9
  138. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  139. package/build-module/components/block-toolbar/index.js +2 -1
  140. package/build-module/components/block-toolbar/index.js.map +1 -1
  141. package/build-module/components/block-tools/block-contextual-toolbar.js +79 -9
  142. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  143. package/build-module/components/block-tools/selected-block-popover.js +10 -27
  144. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  145. package/build-module/components/caption/index.native.js +0 -1
  146. package/build-module/components/caption/index.native.js.map +1 -1
  147. package/build-module/components/date-format-picker/index.js +1 -1
  148. package/build-module/components/date-format-picker/index.js.map +1 -1
  149. package/build-module/components/editor-styles/index.js +4 -3
  150. package/build-module/components/editor-styles/index.js.map +1 -1
  151. package/build-module/components/font-sizes/fluid-utils.js +21 -14
  152. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  153. package/build-module/components/global-styles/border-panel.js +15 -59
  154. package/build-module/components/global-styles/border-panel.js.map +1 -1
  155. package/build-module/components/global-styles/color-panel.js +13 -13
  156. package/build-module/components/global-styles/color-panel.js.map +1 -1
  157. package/build-module/components/global-styles/color-panel.native.js +150 -0
  158. package/build-module/components/global-styles/color-panel.native.js.map +1 -0
  159. package/build-module/components/global-styles/dimensions-panel.js +22 -21
  160. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  161. package/build-module/components/global-styles/effects-panel.js +228 -0
  162. package/build-module/components/global-styles/effects-panel.js.map +1 -0
  163. package/build-module/components/global-styles/filters-panel.js +201 -0
  164. package/build-module/components/global-styles/filters-panel.js.map +1 -0
  165. package/build-module/components/global-styles/get-block-css-selector.js +1 -12
  166. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  167. package/build-module/components/global-styles/hooks.js +7 -0
  168. package/build-module/components/global-styles/hooks.js.map +1 -1
  169. package/build-module/components/global-styles/index.js +2 -0
  170. package/build-module/components/global-styles/index.js.map +1 -1
  171. package/build-module/components/global-styles/typography-panel.js +10 -10
  172. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  173. package/build-module/components/global-styles/use-global-styles-output.js +101 -83
  174. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  175. package/build-module/components/iframe/index.js +1 -1
  176. package/build-module/components/iframe/index.js.map +1 -1
  177. package/build-module/components/image-size-control/use-dimension-handler.js +5 -3
  178. package/build-module/components/image-size-control/use-dimension-handler.js.map +1 -1
  179. package/build-module/components/index.js +1 -0
  180. package/build-module/components/index.js.map +1 -1
  181. package/build-module/components/inserter/block-patterns-tab.js +5 -2
  182. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  183. package/build-module/components/inserter/block-types-tab.js +12 -6
  184. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  185. package/build-module/components/inserter/index.js +2 -1
  186. package/build-module/components/inserter/index.js.map +1 -1
  187. package/build-module/components/inspector-controls/groups.js +2 -0
  188. package/build-module/components/inspector-controls/groups.js.map +1 -1
  189. package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -0
  190. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  191. package/build-module/components/inspector-controls-tabs/utils.js +4 -3
  192. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
  193. package/build-module/components/list-view/block-select-button.js +7 -2
  194. package/build-module/components/list-view/block-select-button.js.map +1 -1
  195. package/build-module/components/list-view/block.js +15 -22
  196. package/build-module/components/list-view/block.js.map +1 -1
  197. package/build-module/components/list-view/drop-indicator.js +36 -10
  198. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  199. package/build-module/components/list-view/index.js +31 -8
  200. package/build-module/components/list-view/index.js.map +1 -1
  201. package/build-module/components/list-view/leaf.js +2 -1
  202. package/build-module/components/list-view/leaf.js.map +1 -1
  203. package/build-module/components/list-view/use-block-selection.js +1 -1
  204. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  205. package/build-module/components/list-view/use-list-view-client-ids.js +7 -3
  206. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  207. package/build-module/components/list-view/use-list-view-drop-zone.js +8 -4
  208. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  209. package/build-module/components/media-replace-flow/index.js +5 -5
  210. package/build-module/components/media-replace-flow/index.js.map +1 -1
  211. package/build-module/components/navigable-toolbar/index.js +12 -4
  212. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  213. package/build-module/components/off-canvas-editor/appender.js +1 -5
  214. package/build-module/components/off-canvas-editor/appender.js.map +1 -1
  215. package/build-module/components/off-canvas-editor/block-contents.js +5 -1
  216. package/build-module/components/off-canvas-editor/block-contents.js.map +1 -1
  217. package/build-module/components/off-canvas-editor/index.js +17 -14
  218. package/build-module/components/off-canvas-editor/index.js.map +1 -1
  219. package/build-module/components/resizable-box-popover/index.js +26 -0
  220. package/build-module/components/resizable-box-popover/index.js.map +1 -0
  221. package/build-module/components/rich-text/index.js +0 -1
  222. package/build-module/components/rich-text/index.js.map +1 -1
  223. package/build-module/components/rich-text/index.native.js +7 -10
  224. package/build-module/components/rich-text/index.native.js.map +1 -1
  225. package/build-module/components/spacing-sizes-control/spacing-input-control.js +7 -0
  226. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  227. package/build-module/hooks/anchor.js +1 -1
  228. package/build-module/hooks/anchor.js.map +1 -1
  229. package/build-module/hooks/border.js +1 -1
  230. package/build-module/hooks/border.js.map +1 -1
  231. package/build-module/hooks/duotone.js +118 -71
  232. package/build-module/hooks/duotone.js.map +1 -1
  233. package/build-module/hooks/margin.js +29 -18
  234. package/build-module/hooks/margin.js.map +1 -1
  235. package/build-module/hooks/padding.js +21 -10
  236. package/build-module/hooks/padding.js.map +1 -1
  237. package/build-module/hooks/utils.js +24 -9
  238. package/build-module/hooks/utils.js.map +1 -1
  239. package/build-module/layouts/utils.js +3 -2
  240. package/build-module/layouts/utils.js.map +1 -1
  241. package/build-module/private-apis.js +9 -1
  242. package/build-module/private-apis.js.map +1 -1
  243. package/build-module/store/actions.js +8 -1
  244. package/build-module/store/actions.js.map +1 -1
  245. package/build-module/utils/object.js +5 -5
  246. package/build-module/utils/object.js.map +1 -1
  247. package/build-module/utils/transform-styles/index.js +2 -2
  248. package/build-module/utils/transform-styles/index.js.map +1 -1
  249. package/build-module/utils/use-should-contextual-toolbar-show.js +56 -0
  250. package/build-module/utils/use-should-contextual-toolbar-show.js.map +1 -0
  251. package/build-style/content-rtl.css +9 -6
  252. package/build-style/content.css +9 -6
  253. package/build-style/style-rtl.css +272 -54
  254. package/build-style/style.css +272 -54
  255. package/package.json +32 -32
  256. package/src/components/block-info-slot-fill/index.js +24 -0
  257. package/src/components/block-inspector/index.js +3 -0
  258. package/src/components/block-inspector/style.scss +6 -4
  259. package/src/components/block-list/content.scss +16 -15
  260. package/src/components/block-list/index.native.js +19 -38
  261. package/src/components/block-list/use-in-between-inserter.js +4 -1
  262. package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +9 -9
  263. package/src/components/block-mover/style.scss +10 -4
  264. package/src/components/block-mover/test/index.native.js +4 -4
  265. package/src/components/block-popover/inbetween.js +2 -13
  266. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -12
  267. package/src/components/block-toolbar/index.js +4 -3
  268. package/src/components/block-toolbar/style.scss +56 -33
  269. package/src/components/block-tools/block-contextual-toolbar.js +94 -11
  270. package/src/components/block-tools/selected-block-popover.js +11 -44
  271. package/src/components/block-tools/style.scss +157 -3
  272. package/src/components/caption/index.native.js +0 -1
  273. package/src/components/date-format-picker/index.js +1 -1
  274. package/src/components/editor-styles/index.js +9 -5
  275. package/src/components/font-sizes/fluid-utils.js +31 -14
  276. package/src/components/font-sizes/test/fluid-utils.js +5 -16
  277. package/src/components/global-styles/README.md +129 -16
  278. package/src/components/global-styles/border-panel.js +13 -61
  279. package/src/components/global-styles/color-panel.js +13 -13
  280. package/src/components/global-styles/color-panel.native.js +207 -0
  281. package/src/components/global-styles/dimensions-panel.js +47 -20
  282. package/src/components/global-styles/effects-panel.js +228 -0
  283. package/src/components/global-styles/filters-panel.js +230 -0
  284. package/src/components/global-styles/get-block-css-selector.js +0 -11
  285. package/src/components/global-styles/hooks.js +10 -0
  286. package/src/components/global-styles/index.js +2 -0
  287. package/src/components/global-styles/style.scss +43 -0
  288. package/src/components/global-styles/test/typography-utils.js +63 -22
  289. package/src/components/global-styles/test/use-global-styles-output.js +130 -8
  290. package/src/components/global-styles/typography-panel.js +37 -11
  291. package/src/components/global-styles/use-global-styles-output.js +88 -72
  292. package/src/components/iframe/index.js +1 -1
  293. package/src/components/image-size-control/use-dimension-handler.js +4 -3
  294. package/src/components/index.js +5 -1
  295. package/src/components/inserter/block-patterns-tab.js +3 -1
  296. package/src/components/inserter/block-types-tab.js +9 -6
  297. package/src/components/inserter/index.js +1 -1
  298. package/src/components/inspector-controls/groups.js +2 -0
  299. package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
  300. package/src/components/inspector-controls-tabs/utils.js +4 -3
  301. package/src/components/list-view/README.md +2 -0
  302. package/src/components/list-view/block-select-button.js +6 -1
  303. package/src/components/list-view/block.js +24 -31
  304. package/src/components/list-view/drop-indicator.js +67 -22
  305. package/src/components/list-view/index.js +26 -3
  306. package/src/components/list-view/leaf.js +1 -0
  307. package/src/components/list-view/style.scss +18 -4
  308. package/src/components/list-view/test/use-list-view-drop-zone.js +188 -0
  309. package/src/components/list-view/use-block-selection.js +1 -1
  310. package/src/components/list-view/use-list-view-client-ids.js +5 -3
  311. package/src/components/list-view/use-list-view-drop-zone.js +9 -3
  312. package/src/components/media-replace-flow/README.md +3 -2
  313. package/src/components/media-replace-flow/index.js +4 -5
  314. package/src/components/navigable-toolbar/index.js +12 -3
  315. package/src/components/off-canvas-editor/appender.js +1 -4
  316. package/src/components/off-canvas-editor/block-contents.js +4 -0
  317. package/src/components/off-canvas-editor/index.js +15 -11
  318. package/src/components/resizable-box-popover/index.js +27 -0
  319. package/src/components/rich-text/index.js +0 -1
  320. package/src/components/rich-text/index.native.js +2 -5
  321. package/src/components/spacing-sizes-control/spacing-input-control.js +10 -0
  322. package/src/components/spacing-sizes-control/style.scss +7 -7
  323. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
  324. package/src/hooks/anchor.js +1 -1
  325. package/src/hooks/border.js +1 -1
  326. package/src/hooks/duotone.js +162 -99
  327. package/src/hooks/margin.js +31 -26
  328. package/src/hooks/padding.js +24 -18
  329. package/src/hooks/test/anchor.js +113 -0
  330. package/src/hooks/test/color.js +0 -9
  331. package/src/hooks/test/use-typography-props.js +2 -2
  332. package/src/hooks/test/utils.js +20 -101
  333. package/src/hooks/utils.js +23 -6
  334. package/src/layouts/utils.js +2 -2
  335. package/src/private-apis.js +8 -0
  336. package/src/store/actions.js +8 -1
  337. package/src/style.scss +1 -0
  338. package/src/utils/object.js +5 -5
  339. package/src/utils/test/object.js +53 -15
  340. package/src/utils/transform-styles/index.js +2 -2
  341. package/src/utils/use-should-contextual-toolbar-show.js +75 -0
  342. package/tsconfig.json +1 -0
  343. package/build/components/rich-text/use-native-props.js +0 -11
  344. package/build/components/rich-text/use-native-props.js.map +0 -1
  345. package/build/components/rich-text/use-native-props.native.js +0 -24
  346. package/build/components/rich-text/use-native-props.native.js.map +0 -1
  347. package/build/hooks/color-panel.native.js +0 -77
  348. package/build/hooks/color-panel.native.js.map +0 -1
  349. package/build-module/components/rich-text/use-native-props.js +0 -4
  350. package/build-module/components/rich-text/use-native-props.js.map +0 -1
  351. package/build-module/components/rich-text/use-native-props.native.js +0 -15
  352. package/build-module/components/rich-text/use-native-props.native.js.map +0 -1
  353. package/build-module/hooks/color-panel.native.js +0 -62
  354. package/build-module/hooks/color-panel.native.js.map +0 -1
  355. package/src/components/rich-text/use-native-props.js +0 -3
  356. package/src/components/rich-text/use-native-props.native.js +0 -17
  357. package/src/hooks/color-panel.native.js +0 -63
@@ -35,11 +35,14 @@
35
35
  }
36
36
 
37
37
  // Block multi selection
38
- .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) {
39
- // Apply a rounded radius to the entire block.
38
+ // Apply a rounded radius to the entire block when multi selected, but with low specificity
39
+ // so explicit radii set by tools are preserved.
40
+ &:where(.block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)) {
40
41
  border-radius: $radius-block-ui;
41
42
  overflow: hidden;
43
+ }
42
44
 
45
+ .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) {
43
46
  // Hide the native selection indicator, for the selection, and children.
44
47
  &::selection,
45
48
  & ::selection {
@@ -68,24 +71,22 @@
68
71
  // Show outline in high contrast mode.
69
72
  outline: 2px solid transparent;
70
73
  }
74
+
75
+ // Don't show the highlight focus style when multi selected.
76
+ &.is-highlighted::after {
77
+ box-shadow: none;
78
+ }
71
79
  }
72
80
 
73
- // Block highlight, and navigation mode, not focus.
74
- // By not using a pseudo element, we can limit ourselves to only
75
- // using ::after, leaving ::before free. Otherwise, highlight + multi-select
76
- // would require the opacity-changing overlay to be on ::before.
81
+ // Block highlight, and navigation mode, and focus.
82
+ // This piece of code has gone back and forth between using a pseudo element
83
+ // vs. styling the block directly. Ultimately we likely need a pseudo element
84
+ // (unless styles like focus and selection overlay can be rendered as separate elements),
85
+ // since things like border-radius need to be able to be set on the block itself.
77
86
  .block-editor-block-list__block.is-highlighted,
78
87
  .block-editor-block-list__block.is-highlighted ~ .is-multi-selected,
79
88
  &.is-navigate-mode .block-editor-block-list__block.is-selected,
80
- & .is-block-moving-mode.block-editor-block-list__block.has-child-selected {
81
- border-radius: $radius-block-ui;
82
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
83
-
84
- // Show outline in high contrast mode.
85
- outline: 2px solid transparent;
86
- }
87
-
88
- // Block focus.
89
+ & .is-block-moving-mode.block-editor-block-list__block.has-child-selected,
89
90
  .block-editor-block-list__block:not([contenteditable]):focus {
90
91
  outline: none;
91
92
 
@@ -6,7 +6,7 @@ import { View, Platform, TouchableWithoutFeedback } from 'react-native';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { Component, createContext } from '@wordpress/element';
9
+ import { Component } from '@wordpress/element';
10
10
  import { withDispatch, withSelect } from '@wordpress/data';
11
11
  import { compose, withPreferredColorScheme } from '@wordpress/compose';
12
12
  import { createBlock } from '@wordpress/blocks';
@@ -33,7 +33,6 @@ import {
33
33
  import { BlockDraggableWrapper } from '../block-draggable';
34
34
  import { store as blockEditorStore } from '../../store';
35
35
 
36
- export const OnCaretVerticalPositionChange = createContext();
37
36
  const identity = ( x ) => x;
38
37
 
39
38
  const stylesMemo = {};
@@ -70,8 +69,6 @@ export class BlockList extends Component {
70
69
  };
71
70
  this.renderItem = this.renderItem.bind( this );
72
71
  this.renderBlockListFooter = this.renderBlockListFooter.bind( this );
73
- this.onCaretVerticalPositionChange =
74
- this.onCaretVerticalPositionChange.bind( this );
75
72
  this.scrollViewInnerRef = this.scrollViewInnerRef.bind( this );
76
73
  this.addBlockToEndOfPost = this.addBlockToEndOfPost.bind( this );
77
74
  this.shouldFlatListPreventAutomaticScroll =
@@ -94,15 +91,6 @@ export class BlockList extends Component {
94
91
  this.props.insertBlock( newBlock, this.props.blockCount );
95
92
  }
96
93
 
97
- onCaretVerticalPositionChange( targetId, caretY, previousCaretY ) {
98
- KeyboardAwareFlatList.handleCaretVerticalPositionChange(
99
- this.scrollViewRef,
100
- targetId,
101
- caretY,
102
- previousCaretY
103
- );
104
- }
105
-
106
94
  scrollViewInnerRef( ref ) {
107
95
  this.scrollViewRef = ref;
108
96
  }
@@ -209,13 +197,7 @@ export class BlockList extends Component {
209
197
  </BlockListConsumer>
210
198
  );
211
199
 
212
- return (
213
- <OnCaretVerticalPositionChange.Provider
214
- value={ this.onCaretVerticalPositionChange }
215
- >
216
- { blockList }
217
- </OnCaretVerticalPositionChange.Provider>
218
- );
200
+ return blockList;
219
201
  }
220
202
 
221
203
  renderList( extraProps = {} ) {
@@ -237,8 +219,7 @@ export class BlockList extends Component {
237
219
  } = this.props;
238
220
  const { parentScrollRef, onScroll } = extraProps;
239
221
 
240
- const { blockToolbar, blockBorder, headerToolbar, floatingToolbar } =
241
- styles;
222
+ const { blockToolbar, headerToolbar, floatingToolbar } = styles;
242
223
 
243
224
  const containerStyle = {
244
225
  flex: isRootList ? 1 : 0,
@@ -250,6 +231,15 @@ export class BlockList extends Component {
250
231
  const isContentStretch = contentResizeMode === 'stretch';
251
232
  const isMultiBlocks = blockClientIds.length > 1;
252
233
  const { isWider } = alignmentHelpers;
234
+ const extraScrollHeight =
235
+ headerToolbar.height +
236
+ blockToolbar.height +
237
+ ( isFloatingToolbarVisible ? floatingToolbar.height : 0 );
238
+
239
+ const scrollViewStyle = [
240
+ { flex: isRootList ? 1 : 0 },
241
+ ! isRootList && styles.overflowVisible,
242
+ ];
253
243
 
254
244
  return (
255
245
  <View
@@ -263,24 +253,12 @@ export class BlockList extends Component {
263
253
  ? { removeClippedSubviews: false }
264
254
  : {} ) } // Disable clipping on Android to fix focus losing. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/741#issuecomment-472746541
265
255
  accessibilityLabel="block-list"
266
- autoScroll={ this.props.autoScroll }
267
256
  innerRef={ ( ref ) => {
268
257
  this.scrollViewInnerRef( parentScrollRef || ref );
269
258
  } }
270
- extraScrollHeight={
271
- blockToolbar.height + blockBorder.width
272
- }
273
- inputAccessoryViewHeight={
274
- headerToolbar.height +
275
- ( isFloatingToolbarVisible
276
- ? floatingToolbar.height
277
- : 0 )
278
- }
259
+ extraScrollHeight={ extraScrollHeight }
279
260
  keyboardShouldPersistTaps="always"
280
- scrollViewStyle={ [
281
- { flex: isRootList ? 1 : 0 },
282
- ! isRootList && styles.overflowVisible,
283
- ] }
261
+ scrollViewStyle={ scrollViewStyle }
284
262
  extraData={ this.getExtraData() }
285
263
  scrollEnabled={ isRootList }
286
264
  contentContainerStyle={ [
@@ -407,6 +385,7 @@ export default compose( [
407
385
  ( select, { rootClientId, orientation, filterInnerBlocks } ) => {
408
386
  const {
409
387
  getBlockCount,
388
+ getBlockHierarchyRootClientId,
410
389
  getBlockOrder,
411
390
  getSelectedBlockClientId,
412
391
  isBlockInsertionPointVisible,
@@ -427,10 +406,12 @@ export default compose( [
427
406
  const isReadOnly = getSettings().readOnly;
428
407
 
429
408
  const blockCount = getBlockCount();
430
- const hasRootInnerBlocks = !! blockCount;
409
+ const rootBlockId = getBlockHierarchyRootClientId(
410
+ selectedBlockClientId
411
+ );
431
412
 
432
413
  const isFloatingToolbarVisible =
433
- !! selectedBlockClientId && hasRootInnerBlocks;
414
+ !! selectedBlockClientId && !! getBlockCount( rootBlockId );
434
415
  const isRTL = getSettings().isRTL;
435
416
 
436
417
  return {
@@ -4,6 +4,7 @@
4
4
  import { useRefEffect } from '@wordpress/compose';
5
5
  import { useSelect, useDispatch } from '@wordpress/data';
6
6
  import { useContext } from '@wordpress/element';
7
+ import { isRTL } from '@wordpress/i18n';
7
8
 
8
9
  /**
9
10
  * Internal dependencies
@@ -93,7 +94,9 @@ export function useInBetweenInserter() {
93
94
  blockElRect.top > offsetTop ) ||
94
95
  ( blockEl.classList.contains( 'wp-block' ) &&
95
96
  orientation === 'horizontal' &&
96
- blockElRect.left > offsetLeft )
97
+ ( isRTL()
98
+ ? blockElRect.right < offsetLeft
99
+ : blockElRect.left > offsetLeft ) )
97
100
  );
98
101
  } );
99
102
 
@@ -8,7 +8,7 @@ import {
8
8
  getBlock,
9
9
  within,
10
10
  getEditorHtml,
11
- changeTextOfRichText,
11
+ typeInRichText,
12
12
  } from 'test/helpers';
13
13
 
14
14
  /**
@@ -71,7 +71,7 @@ describe( 'Block Actions Menu', () => {
71
71
  within( paragraphBlock ).getByPlaceholderText(
72
72
  'Start writing…'
73
73
  );
74
- changeTextOfRichText( paragraphField, 'Hello!' );
74
+ typeInRichText( paragraphField, 'Hello!' );
75
75
 
76
76
  // Add Spacer block
77
77
  await addBlock( screen, 'Spacer' );
@@ -132,7 +132,7 @@ describe( 'Block Actions Menu', () => {
132
132
  within( paragraphBlock ).getByPlaceholderText(
133
133
  'Start writing…'
134
134
  );
135
- changeTextOfRichText( paragraphField, 'Hello!' );
135
+ typeInRichText( paragraphField, 'Hello!' );
136
136
 
137
137
  // Add Spacer block
138
138
  await addBlock( screen, 'Spacer' );
@@ -179,7 +179,7 @@ describe( 'Block Actions Menu', () => {
179
179
  within( paragraphBlock ).getByPlaceholderText(
180
180
  'Start writing…'
181
181
  );
182
- changeTextOfRichText( paragraphField, 'Hello!' );
182
+ typeInRichText( paragraphField, 'Hello!' );
183
183
 
184
184
  // Add Spacer block
185
185
  await addBlock( screen, 'Spacer' );
@@ -228,7 +228,7 @@ describe( 'Block Actions Menu', () => {
228
228
  within( paragraphBlock ).getByPlaceholderText(
229
229
  'Start writing…'
230
230
  );
231
- changeTextOfRichText( paragraphField, 'Hello!' );
231
+ typeInRichText( paragraphField, 'Hello!' );
232
232
 
233
233
  // Add Spacer block
234
234
  await addBlock( screen, 'Spacer' );
@@ -275,7 +275,7 @@ describe( 'Block Actions Menu', () => {
275
275
  within( paragraphBlock ).getByPlaceholderText(
276
276
  'Start writing…'
277
277
  );
278
- changeTextOfRichText( paragraphField, 'Hello!' );
278
+ typeInRichText( paragraphField, 'Hello!' );
279
279
 
280
280
  // Add Spacer block
281
281
  await addBlock( screen, 'Spacer' );
@@ -322,7 +322,7 @@ describe( 'Block Actions Menu', () => {
322
322
  within( paragraphBlock ).getByPlaceholderText(
323
323
  'Start writing…'
324
324
  );
325
- changeTextOfRichText( paragraphField, 'Hello!' );
325
+ typeInRichText( paragraphField, 'Hello!' );
326
326
 
327
327
  // Add Spacer block
328
328
  await addBlock( screen, 'Spacer' );
@@ -368,7 +368,7 @@ describe( 'Block Actions Menu', () => {
368
368
  within( paragraphBlock ).getByPlaceholderText(
369
369
  'Start writing…'
370
370
  );
371
- changeTextOfRichText( paragraphField, 'Hello!' );
371
+ typeInRichText( paragraphField, 'Hello!' );
372
372
 
373
373
  // Add Spacer block
374
374
  await addBlock( screen, 'Spacer' );
@@ -405,7 +405,7 @@ describe( 'Block Actions Menu', () => {
405
405
  within( paragraphBlock ).getByPlaceholderText(
406
406
  'Start writing…'
407
407
  );
408
- changeTextOfRichText( paragraphField, 'Hello!' );
408
+ typeInRichText( paragraphField, 'Hello!' );
409
409
 
410
410
  // Add Spacer block
411
411
  await addBlock( screen, 'Spacer' );
@@ -35,11 +35,14 @@
35
35
  > * {
36
36
  width: $block-toolbar-height * 0.5;
37
37
  min-width: 0 !important; // overrides default button width.
38
- padding-left: 0 !important;
39
- padding-right: 0 !important;
40
38
  overflow: hidden;
41
39
  }
42
40
 
41
+ .block-editor-block-mover-button {
42
+ padding-left: 0;
43
+ padding-right: 0;
44
+ }
45
+
43
46
  .block-editor-block-mover-button.is-up-button svg {
44
47
  left: 5px;
45
48
  }
@@ -55,9 +58,12 @@
55
58
  @include break-small() {
56
59
  width: $block-toolbar-height * 0.5;
57
60
  min-width: 0 !important; // overrides default button width.
58
- padding-left: 0 !important;
59
- padding-right: 0 !important;
60
61
  overflow: hidden;
62
+
63
+ .block-editor-block-mover &.has-icon.has-icon {
64
+ padding-left: 0;
65
+ padding-right: 0;
66
+ }
61
67
  }
62
68
  }
63
69
 
@@ -9,7 +9,7 @@ import {
9
9
  within,
10
10
  getEditorHtml,
11
11
  render,
12
- changeTextOfRichText,
12
+ typeInRichText,
13
13
  } from 'test/helpers';
14
14
 
15
15
  /**
@@ -89,7 +89,7 @@ describe( 'Block Mover Picker', () => {
89
89
  within( paragraphBlock ).getByPlaceholderText(
90
90
  'Start writing…'
91
91
  );
92
- changeTextOfRichText( paragraphField, 'Hello!' );
92
+ typeInRichText( paragraphField, 'Hello!' );
93
93
 
94
94
  // Add Spacer block
95
95
  await addBlock( screen, 'Spacer' );
@@ -138,7 +138,7 @@ describe( 'Block Mover Picker', () => {
138
138
  within( paragraphBlock ).getByPlaceholderText(
139
139
  'Start writing…'
140
140
  );
141
- changeTextOfRichText( paragraphField, 'Hello!' );
141
+ typeInRichText( paragraphField, 'Hello!' );
142
142
 
143
143
  // Add Spacer block
144
144
  await addBlock( screen, 'Spacer' );
@@ -176,7 +176,7 @@ describe( 'Block Mover Picker', () => {
176
176
  within( paragraphBlock ).getByPlaceholderText(
177
177
  'Start writing…'
178
178
  );
179
- changeTextOfRichText( paragraphField, 'Hello!' );
179
+ typeInRichText( paragraphField, 'Hello!' );
180
180
 
181
181
  // Add Spacer block
182
182
  await addBlock( screen, 'Spacer' );
@@ -106,16 +106,7 @@ function BlockPopoverInbetween( {
106
106
  nextRect && previousRect
107
107
  ? nextRect.top - previousRect.bottom
108
108
  : 0;
109
-
110
- if ( isRTL() ) {
111
- // vertical, rtl
112
- left = previousRect
113
- ? previousRect.right
114
- : nextRect.right;
115
- } else {
116
- // vertical, ltr
117
- left = previousRect ? previousRect.left : nextRect.left;
118
- }
109
+ left = previousRect ? previousRect.left : nextRect.left;
119
110
  } else {
120
111
  top = previousRect ? previousRect.top : nextRect.top;
121
112
  height = previousRect
@@ -124,9 +115,7 @@ function BlockPopoverInbetween( {
124
115
 
125
116
  if ( isRTL() ) {
126
117
  // non vertical, rtl
127
- left = previousRect
128
- ? previousRect.left
129
- : nextRect.right;
118
+ left = nextRect ? nextRect.right : previousRect.left;
130
119
  width =
131
120
  previousRect && nextRect
132
121
  ? previousRect.left - nextRect.right
@@ -29,7 +29,6 @@ import BlockHTMLConvertButton from './block-html-convert-button';
29
29
  import __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';
30
30
  import BlockSettingsMenuControls from '../block-settings-menu-controls';
31
31
  import { store as blockEditorStore } from '../../store';
32
- import useBlockDisplayTitle from '../block-title/use-block-display-title';
33
32
  import { useShowMoversGestures } from '../block-toolbar/utils';
34
33
 
35
34
  const noop = () => {};
@@ -138,11 +137,6 @@ export function BlockSettingsDropdown( {
138
137
  [ __experimentalSelectBlock ]
139
138
  );
140
139
 
141
- const blockTitle = useBlockDisplayTitle( {
142
- clientId: firstBlockClientId,
143
- maximumLength: 25,
144
- } );
145
-
146
140
  const updateSelectionAfterRemove = useCallback(
147
141
  __experimentalSelectBlock
148
142
  ? () => {
@@ -173,12 +167,8 @@ export function BlockSettingsDropdown( {
173
167
  ]
174
168
  );
175
169
 
176
- const label = sprintf(
177
- /* translators: %s: block name */
178
- __( 'Remove %s' ),
179
- blockTitle
180
- );
181
- const removeBlockLabel = count === 1 ? label : __( 'Remove blocks' );
170
+ const removeBlockLabel =
171
+ count === 1 ? __( 'Delete' ) : __( 'Delete blocks' );
182
172
 
183
173
  // Allows highlighting the parent block outline when focusing or hovering
184
174
  // the parent block selector within the child.
@@ -99,6 +99,7 @@ const BlockToolbar = ( { hideDragHandle } ) => {
99
99
  // header area and not contextually to the block.
100
100
  const displayHeaderToolbar =
101
101
  useViewportMatch( 'medium', '<' ) || hasFixedToolbar;
102
+ const isLargeViewport = ! useViewportMatch( 'medium', '<' );
102
103
 
103
104
  if ( blockType ) {
104
105
  if ( ! hasBlockSupport( blockType, '__experimentalToolbar', true ) ) {
@@ -124,9 +125,9 @@ const BlockToolbar = ( { hideDragHandle } ) => {
124
125
 
125
126
  return (
126
127
  <div className={ classes }>
127
- { ! isMultiToolbar &&
128
- ! displayHeaderToolbar &&
129
- ! isContentLocked && <BlockParentSelector /> }
128
+ { ! isMultiToolbar && isLargeViewport && ! isContentLocked && (
129
+ <BlockParentSelector />
130
+ ) }
130
131
  <div ref={ nodeRef } { ...showMoversGestures }>
131
132
  { ( shouldShowVisualToolbar || isMultiToolbar ) &&
132
133
  ! isContentLocked && (
@@ -56,26 +56,46 @@
56
56
  }
57
57
  }
58
58
 
59
- .block-editor-block-contextual-toolbar.has-parent:not(.is-fixed) {
60
- margin-left: calc(#{$grid-unit-60} + #{$grid-unit-10});
59
+ // on desktop browsers the fixed toolbar has tweaked borders
60
+ @include break-medium() {
61
+ .block-editor-block-contextual-toolbar.is-fixed {
62
+ .block-editor-block-toolbar {
63
+ .components-toolbar-group,
64
+ .components-toolbar {
65
+ border-right: none;
66
+
67
+ &::after {
68
+ content: "";
69
+ width: $border-width;
70
+ margin-top: $grid-unit + $grid-unit-05;
71
+ margin-bottom: $grid-unit + $grid-unit-05;
72
+ background-color: $gray-300;
73
+ margin-left: $grid-unit;
74
+ }
75
+
76
+ & .components-toolbar-group.components-toolbar-group {
77
+ &::after {
78
+ display: none;
79
+ }
80
+ }
81
+ }
61
82
 
62
- .show-icon-labels & {
63
- margin-left: 0;
83
+ > :last-child,
84
+ > :last-child .components-toolbar-group,
85
+ > :last-child .components-toolbar {
86
+ &::after {
87
+ display: none;
88
+ }
89
+ }
90
+ }
64
91
  }
65
92
  }
66
93
 
67
- .block-editor-block-parent-selector {
68
- position: absolute;
69
- top: -$border-width;
70
- left: calc(-#{$grid-unit-60} - #{$grid-unit-10} - #{$border-width});
94
+ .block-editor-block-contextual-toolbar.has-parent:not(.is-fixed) {
95
+ margin-left: calc(#{$grid-unit-60} + #{$grid-unit-10});
71
96
 
72
97
  .show-icon-labels & {
73
- position: relative;
74
- left: auto;
75
- top: auto;
76
- margin-top: -$border-width;
77
- margin-left: -$border-width;
78
- margin-bottom: -$border-width;
98
+ margin-left: 0;
79
99
  }
80
100
  }
81
101
 
@@ -152,21 +172,38 @@
152
172
  .block-editor-block-icon {
153
173
  width: 0 !important;
154
174
  height: 0 !important;
175
+ min-width: 0 !important;
155
176
  }
156
177
  }
157
178
 
158
179
  // Parent selector overrides
159
180
 
160
181
  .block-editor-block-parent-selector__button {
182
+ border-top-right-radius: 0;
183
+ border-bottom-right-radius: 0;
184
+
161
185
  .block-editor-block-icon {
162
186
  width: 0;
163
187
  }
164
188
  }
165
189
 
166
- .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container {
190
+ .block-editor-block-mover .block-editor-block-mover__move-button-container {
167
191
  width: auto;
168
192
  }
169
193
 
194
+ .block-editor-block-mover.is-horizontal {
195
+ .block-editor-block-mover__move-button-container,
196
+ .block-editor-block-mover-button {
197
+ padding-left: 6px;
198
+ padding-right: 6px;
199
+ }
200
+ }
201
+
202
+ .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover-button {
203
+ padding-left: $grid-unit;
204
+ padding-right: $grid-unit;
205
+ }
206
+
170
207
  // Mover overrides.
171
208
  .block-editor-block-toolbar__block-controls .block-editor-block-mover {
172
209
  border-left: 1px solid $gray-900;
@@ -179,15 +216,9 @@
179
216
  border-left-color: $gray-200;
180
217
  }
181
218
 
182
- .block-editor-block-mover-button {
183
- // The specificity can be reduced once https://github.com/WordPress/gutenberg/blob/try/block-toolbar-labels/packages/block-editor/src/components/block-mover/style.scss#L34 is also dealt with.
184
- padding-left: $grid-unit !important;
185
- padding-right: $grid-unit !important;
186
- }
187
-
188
- .block-editor-block-mover__drag-handle.has-icon {
189
- padding-left: 12px !important;
190
- padding-right: 12px !important;
219
+ .block-editor-block-mover .block-editor-block-mover__drag-handle.has-icon {
220
+ padding-left: $grid-unit-15;
221
+ padding-right: $grid-unit-15;
191
222
  }
192
223
 
193
224
  .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-mover__move-button-container {
@@ -204,18 +235,10 @@
204
235
 
205
236
  .block-editor-block-mover__move-button-container {
206
237
  border-left: 1px solid $gray-900;
207
-
208
- &::before {
209
- content: "";
210
- display: block;
211
- height: 1px;
212
- background: $gray-900;
213
- order: 2;
214
- }
215
238
  }
216
239
 
217
240
  .is-down-button.is-down-button.is-down-button {
218
- order: 3;
241
+ order: 2;
219
242
  }
220
243
 
221
244
  .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-mover__move-button-container::before {