@wordpress/block-editor 10.4.0 → 11.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 (638) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +0 -1
  3. package/build/autocompleters/block.js +2 -6
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/autocompleters/link.js +2 -0
  6. package/build/autocompleters/link.js.map +1 -1
  7. package/build/components/block-card/index.js +51 -3
  8. package/build/components/block-card/index.js.map +1 -1
  9. package/build/components/block-draggable/index.native.js +46 -39
  10. package/build/components/block-draggable/index.native.js.map +1 -1
  11. package/build/components/block-edit/edit.js +4 -3
  12. package/build/components/block-edit/edit.js.map +1 -1
  13. package/build/components/block-edit/edit.native.js +4 -7
  14. package/build/components/block-edit/edit.native.js.map +1 -1
  15. package/build/components/block-inspector/index.js +35 -33
  16. package/build/components/block-inspector/index.js.map +1 -1
  17. package/build/components/block-list/block-list-context.native.js +5 -8
  18. package/build/components/block-list/block-list-context.native.js.map +1 -1
  19. package/build/components/block-list/block.js +55 -24
  20. package/build/components/block-list/block.js.map +1 -1
  21. package/build/components/block-list/block.native.js +61 -28
  22. package/build/components/block-list/block.native.js.map +1 -1
  23. package/build/components/block-lock/menu-item.js +1 -1
  24. package/build/components/block-lock/menu-item.js.map +1 -1
  25. package/build/components/block-lock/modal.js +16 -9
  26. package/build/components/block-lock/modal.js.map +1 -1
  27. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +12 -4
  28. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  29. package/build/components/block-pattern-setup/index.js +3 -2
  30. package/build/components/block-pattern-setup/index.js.map +1 -1
  31. package/build/components/block-patterns-list/index.js +33 -11
  32. package/build/components/block-patterns-list/index.js.map +1 -1
  33. package/build/components/block-preview/auto.js +9 -3
  34. package/build/components/block-preview/auto.js.map +1 -1
  35. package/build/components/block-preview/index.js +5 -9
  36. package/build/components/block-preview/index.js.map +1 -1
  37. package/build/components/block-settings-menu/block-settings-dropdown.js +5 -2
  38. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  39. package/build/components/block-styles/utils.js +3 -3
  40. package/build/components/block-styles/utils.js.map +1 -1
  41. package/build/components/block-switcher/index.js +19 -4
  42. package/build/components/block-switcher/index.js.map +1 -1
  43. package/build/components/block-toolbar/index.js +5 -1
  44. package/build/components/block-toolbar/index.js.map +1 -1
  45. package/build/components/block-tools/insertion-point.js +8 -49
  46. package/build/components/block-tools/insertion-point.js.map +1 -1
  47. package/build/components/block-tools/selected-block-popover.js +27 -4
  48. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  49. package/build/components/block-variation-picker/index.js +1 -2
  50. package/build/components/block-variation-picker/index.js.map +1 -1
  51. package/build/components/colors/with-colors.js +4 -3
  52. package/build/components/colors/with-colors.js.map +1 -1
  53. package/build/components/font-sizes/fluid-utils.js +24 -40
  54. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  55. package/build/components/font-sizes/with-font-sizes.js +7 -5
  56. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  57. package/build/components/height-control/index.js +115 -0
  58. package/build/components/height-control/index.js.map +1 -0
  59. package/build/components/iframe/index.js +11 -8
  60. package/build/components/iframe/index.js.map +1 -1
  61. package/build/components/image-editor/use-save-image.js +2 -0
  62. package/build/components/image-editor/use-save-image.js.map +1 -1
  63. package/build/components/image-editor/zoom-dropdown.js +1 -0
  64. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  65. package/build/components/index.js +18 -0
  66. package/build/components/index.js.map +1 -1
  67. package/build/components/inner-blocks/index.js +25 -9
  68. package/build/components/inner-blocks/index.js.map +1 -1
  69. package/build/components/inner-blocks/use-inner-block-template-sync.js +25 -10
  70. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  71. package/build/components/inserter/block-patterns-explorer/sidebar.js +1 -0
  72. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  73. package/build/components/inserter/block-patterns-tab.js +25 -46
  74. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  75. package/build/components/inserter/block-types-tab.js +3 -1
  76. package/build/components/inserter/block-types-tab.js.map +1 -1
  77. package/build/components/inserter/hooks/use-debounced-input.js +27 -0
  78. package/build/components/inserter/hooks/use-debounced-input.js.map +1 -0
  79. package/build/components/inserter/index.js +8 -3
  80. package/build/components/inserter/index.js.map +1 -1
  81. package/build/components/inserter/index.native.js +3 -4
  82. package/build/components/inserter/index.native.js.map +1 -1
  83. package/build/components/inserter/media-tab/hooks.js +103 -0
  84. package/build/components/inserter/media-tab/hooks.js.map +1 -0
  85. package/build/components/inserter/media-tab/index.js +32 -0
  86. package/build/components/inserter/media-tab/index.js.map +1 -0
  87. package/build/components/inserter/media-tab/media-list.js +100 -0
  88. package/build/components/inserter/media-tab/media-list.js.map +1 -0
  89. package/build/components/inserter/media-tab/media-panel.js +96 -0
  90. package/build/components/inserter/media-tab/media-panel.js.map +1 -0
  91. package/build/components/inserter/media-tab/media-tab.js +120 -0
  92. package/build/components/inserter/media-tab/media-tab.js.map +1 -0
  93. package/build/components/inserter/media-tab/utils.js +54 -0
  94. package/build/components/inserter/media-tab/utils.js.map +1 -0
  95. package/build/components/inserter/menu.js +35 -12
  96. package/build/components/inserter/menu.js.map +1 -1
  97. package/build/components/inserter/mobile-tab-navigation.js +70 -0
  98. package/build/components/inserter/mobile-tab-navigation.js.map +1 -0
  99. package/build/components/inserter/quick-inserter.js +1 -0
  100. package/build/components/inserter/quick-inserter.js.map +1 -1
  101. package/build/components/inserter/reusable-blocks-tab.js +4 -1
  102. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  103. package/build/components/inserter/search-results.js +3 -1
  104. package/build/components/inserter/search-results.js.map +1 -1
  105. package/build/components/inserter/tabs.js +16 -2
  106. package/build/components/inserter/tabs.js.map +1 -1
  107. package/build/components/inserter-list-item/index.js +4 -1
  108. package/build/components/inserter-list-item/index.js.map +1 -1
  109. package/build/components/inspector-controls/groups.js +2 -0
  110. package/build/components/inspector-controls/groups.js.map +1 -1
  111. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +46 -0
  112. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -0
  113. package/build/components/inspector-controls-tabs/index.js +71 -0
  114. package/build/components/inspector-controls-tabs/index.js.map +1 -0
  115. package/build/components/inspector-controls-tabs/settings-tab.js +28 -0
  116. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -0
  117. package/build/components/inspector-controls-tabs/styles-tab.js +61 -0
  118. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -0
  119. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +97 -0
  120. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -0
  121. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +18 -0
  122. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -0
  123. package/build/components/inspector-controls-tabs/utils.js +37 -0
  124. package/build/components/inspector-controls-tabs/utils.js.map +1 -0
  125. package/build/components/link-control/index.js +19 -34
  126. package/build/components/link-control/index.js.map +1 -1
  127. package/build/components/link-control/search-input.js +1 -2
  128. package/build/components/link-control/search-input.js.map +1 -1
  129. package/build/components/link-control/use-internal-input-value.js +26 -0
  130. package/build/components/link-control/use-internal-input-value.js.map +1 -0
  131. package/build/components/list-view/block.js +10 -5
  132. package/build/components/list-view/block.js.map +1 -1
  133. package/build/components/list-view/branch.js +22 -15
  134. package/build/components/list-view/branch.js.map +1 -1
  135. package/build/components/media-upload/index.native.js +2 -3
  136. package/build/components/media-upload/index.native.js.map +1 -1
  137. package/build/components/off-canvas-editor/appender.js +104 -0
  138. package/build/components/off-canvas-editor/appender.js.map +1 -0
  139. package/build/components/off-canvas-editor/block-contents.js +100 -0
  140. package/build/components/off-canvas-editor/block-contents.js.map +1 -0
  141. package/build/components/off-canvas-editor/block-edit-button.js +50 -0
  142. package/build/components/off-canvas-editor/block-edit-button.js.map +1 -0
  143. package/build/components/off-canvas-editor/block-select-button.js +119 -0
  144. package/build/components/off-canvas-editor/block-select-button.js.map +1 -0
  145. package/build/components/off-canvas-editor/block.js +324 -0
  146. package/build/components/off-canvas-editor/block.js.map +1 -0
  147. package/build/components/off-canvas-editor/branch.js +179 -0
  148. package/build/components/off-canvas-editor/branch.js.map +1 -0
  149. package/build/components/off-canvas-editor/context.js +19 -0
  150. package/build/components/off-canvas-editor/context.js.map +1 -0
  151. package/build/components/off-canvas-editor/drop-indicator.js +118 -0
  152. package/build/components/off-canvas-editor/drop-indicator.js.map +1 -0
  153. package/build/components/off-canvas-editor/expander.js +41 -0
  154. package/build/components/off-canvas-editor/expander.js.map +1 -0
  155. package/build/components/off-canvas-editor/index.js +213 -0
  156. package/build/components/off-canvas-editor/index.js.map +1 -0
  157. package/build/components/off-canvas-editor/leaf.js +60 -0
  158. package/build/components/off-canvas-editor/leaf.js.map +1 -0
  159. package/build/components/off-canvas-editor/link-ui.js +185 -0
  160. package/build/components/off-canvas-editor/link-ui.js.map +1 -0
  161. package/build/components/off-canvas-editor/update-attributes.js +108 -0
  162. package/build/components/off-canvas-editor/update-attributes.js.map +1 -0
  163. package/build/components/off-canvas-editor/use-block-selection.js +139 -0
  164. package/build/components/off-canvas-editor/use-block-selection.js.map +1 -0
  165. package/build/components/off-canvas-editor/use-list-view-client-ids.js +33 -0
  166. package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
  167. package/build/components/off-canvas-editor/use-list-view-drop-zone.js +235 -0
  168. package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
  169. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +60 -0
  170. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
  171. package/build/components/off-canvas-editor/utils.js +60 -0
  172. package/build/components/off-canvas-editor/utils.js.map +1 -0
  173. package/build/components/rich-text/format-toolbar/index.js +8 -4
  174. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  175. package/build/components/rich-text/index.js +3 -3
  176. package/build/components/rich-text/index.js.map +1 -1
  177. package/build/components/rich-text/index.native.js +0 -2
  178. package/build/components/rich-text/index.native.js.map +1 -1
  179. package/build/components/rich-text/use-insert-replacement-text.js +43 -0
  180. package/build/components/rich-text/use-insert-replacement-text.js.map +1 -0
  181. package/build/components/rich-text/use-undo-automatic-change.js +9 -1
  182. package/build/components/rich-text/use-undo-automatic-change.js.map +1 -1
  183. package/build/components/rich-text/utils.js +1 -19
  184. package/build/components/rich-text/utils.js.map +1 -1
  185. package/build/components/spacing-sizes-control/spacing-input-control.js +12 -3
  186. package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  187. package/build/components/ungroup-button/index.native.js +4 -2
  188. package/build/components/ungroup-button/index.native.js.map +1 -1
  189. package/build/components/url-input/index.js +46 -43
  190. package/build/components/url-input/index.js.map +1 -1
  191. package/build/components/url-popover/index.js +31 -2
  192. package/build/components/url-popover/index.js.map +1 -1
  193. package/build/components/use-block-display-information/index.js +8 -4
  194. package/build/components/use-block-display-information/index.js.map +1 -1
  195. package/build/components/use-setting/index.js +10 -2
  196. package/build/components/use-setting/index.js.map +1 -1
  197. package/build/hooks/child-layout.js +209 -0
  198. package/build/hooks/child-layout.js.map +1 -0
  199. package/build/hooks/color-panel.js +17 -1
  200. package/build/hooks/color-panel.js.map +1 -1
  201. package/build/hooks/color.js +1 -1
  202. package/build/hooks/color.js.map +1 -1
  203. package/build/hooks/content-lock-ui.js +14 -7
  204. package/build/hooks/content-lock-ui.js.map +1 -1
  205. package/build/hooks/dimensions.js +65 -16
  206. package/build/hooks/dimensions.js.map +1 -1
  207. package/build/hooks/layout.js +59 -3
  208. package/build/hooks/layout.js.map +1 -1
  209. package/build/hooks/margin.js +4 -2
  210. package/build/hooks/margin.js.map +1 -1
  211. package/build/hooks/min-height.js +139 -0
  212. package/build/hooks/min-height.js.map +1 -0
  213. package/build/hooks/padding.js +4 -2
  214. package/build/hooks/padding.js.map +1 -1
  215. package/build/hooks/style.js +3 -2
  216. package/build/hooks/style.js.map +1 -1
  217. package/build/layouts/flex.js +22 -21
  218. package/build/layouts/flex.js.map +1 -1
  219. package/build/store/actions.js +26 -0
  220. package/build/store/actions.js.map +1 -1
  221. package/build/store/reducer.js +420 -265
  222. package/build/store/reducer.js.map +1 -1
  223. package/build/store/selectors.js +73 -49
  224. package/build/store/selectors.js.map +1 -1
  225. package/build/utils/sorting.js +63 -0
  226. package/build/utils/sorting.js.map +1 -0
  227. package/build-module/autocompleters/block.js +2 -6
  228. package/build-module/autocompleters/block.js.map +1 -1
  229. package/build-module/autocompleters/link.js +2 -0
  230. package/build-module/autocompleters/link.js.map +1 -1
  231. package/build-module/components/block-card/index.js +45 -3
  232. package/build-module/components/block-card/index.js.map +1 -1
  233. package/build-module/components/block-draggable/index.native.js +40 -31
  234. package/build-module/components/block-draggable/index.native.js.map +1 -1
  235. package/build-module/components/block-edit/edit.js +4 -2
  236. package/build-module/components/block-edit/edit.js.map +1 -1
  237. package/build-module/components/block-edit/edit.native.js +4 -6
  238. package/build-module/components/block-edit/edit.native.js.map +1 -1
  239. package/build-module/components/block-inspector/index.js +32 -30
  240. package/build-module/components/block-inspector/index.js.map +1 -1
  241. package/build-module/components/block-list/block-list-context.native.js +5 -8
  242. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  243. package/build-module/components/block-list/block.js +55 -25
  244. package/build-module/components/block-list/block.js.map +1 -1
  245. package/build-module/components/block-list/block.native.js +61 -28
  246. package/build-module/components/block-list/block.native.js.map +1 -1
  247. package/build-module/components/block-lock/menu-item.js +2 -2
  248. package/build-module/components/block-lock/menu-item.js.map +1 -1
  249. package/build-module/components/block-lock/modal.js +17 -10
  250. package/build-module/components/block-lock/modal.js.map +1 -1
  251. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +13 -6
  252. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  253. package/build-module/components/block-pattern-setup/index.js +3 -2
  254. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  255. package/build-module/components/block-patterns-list/index.js +35 -13
  256. package/build-module/components/block-patterns-list/index.js.map +1 -1
  257. package/build-module/components/block-preview/auto.js +9 -3
  258. package/build-module/components/block-preview/auto.js.map +1 -1
  259. package/build-module/components/block-preview/index.js +5 -8
  260. package/build-module/components/block-preview/index.js.map +1 -1
  261. package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -2
  262. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  263. package/build-module/components/block-styles/utils.js +3 -3
  264. package/build-module/components/block-styles/utils.js.map +1 -1
  265. package/build-module/components/block-switcher/index.js +19 -4
  266. package/build-module/components/block-switcher/index.js.map +1 -1
  267. package/build-module/components/block-toolbar/index.js +6 -2
  268. package/build-module/components/block-toolbar/index.js.map +1 -1
  269. package/build-module/components/block-tools/insertion-point.js +8 -49
  270. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  271. package/build-module/components/block-tools/selected-block-popover.js +27 -5
  272. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  273. package/build-module/components/block-variation-picker/index.js +1 -2
  274. package/build-module/components/block-variation-picker/index.js.map +1 -1
  275. package/build-module/components/colors/with-colors.js +5 -4
  276. package/build-module/components/colors/with-colors.js.map +1 -1
  277. package/build-module/components/font-sizes/fluid-utils.js +24 -40
  278. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  279. package/build-module/components/font-sizes/with-font-sizes.js +8 -6
  280. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  281. package/build-module/components/height-control/index.js +103 -0
  282. package/build-module/components/height-control/index.js.map +1 -0
  283. package/build-module/components/iframe/index.js +11 -8
  284. package/build-module/components/iframe/index.js.map +1 -1
  285. package/build-module/components/image-editor/use-save-image.js +2 -0
  286. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  287. package/build-module/components/image-editor/zoom-dropdown.js +1 -0
  288. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  289. package/build-module/components/index.js +2 -0
  290. package/build-module/components/index.js.map +1 -1
  291. package/build-module/components/inner-blocks/index.js +27 -11
  292. package/build-module/components/inner-blocks/index.js.map +1 -1
  293. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +23 -10
  294. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  295. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +1 -0
  296. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  297. package/build-module/components/inserter/block-patterns-tab.js +27 -49
  298. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  299. package/build-module/components/inserter/block-types-tab.js +3 -2
  300. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  301. package/build-module/components/inserter/hooks/use-debounced-input.js +18 -0
  302. package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -0
  303. package/build-module/components/inserter/index.js +8 -3
  304. package/build-module/components/inserter/index.js.map +1 -1
  305. package/build-module/components/inserter/index.native.js +3 -5
  306. package/build-module/components/inserter/index.native.js.map +1 -1
  307. package/build-module/components/inserter/media-tab/hooks.js +89 -0
  308. package/build-module/components/inserter/media-tab/hooks.js.map +1 -0
  309. package/build-module/components/inserter/media-tab/index.js +4 -0
  310. package/build-module/components/inserter/media-tab/index.js.map +1 -0
  311. package/build-module/components/inserter/media-tab/media-list.js +86 -0
  312. package/build-module/components/inserter/media-tab/media-list.js.map +1 -0
  313. package/build-module/components/inserter/media-tab/media-panel.js +77 -0
  314. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -0
  315. package/build-module/components/inserter/media-tab/media-tab.js +100 -0
  316. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -0
  317. package/build-module/components/inserter/media-tab/utils.js +45 -0
  318. package/build-module/components/inserter/media-tab/utils.js.map +1 -0
  319. package/build-module/components/inserter/menu.js +33 -12
  320. package/build-module/components/inserter/menu.js.map +1 -1
  321. package/build-module/components/inserter/mobile-tab-navigation.js +61 -0
  322. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -0
  323. package/build-module/components/inserter/quick-inserter.js +1 -0
  324. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  325. package/build-module/components/inserter/reusable-blocks-tab.js +3 -1
  326. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  327. package/build-module/components/inserter/search-results.js +3 -2
  328. package/build-module/components/inserter/search-results.js.map +1 -1
  329. package/build-module/components/inserter/tabs.js +15 -2
  330. package/build-module/components/inserter/tabs.js.map +1 -1
  331. package/build-module/components/inserter-list-item/index.js +5 -2
  332. package/build-module/components/inserter-list-item/index.js.map +1 -1
  333. package/build-module/components/inspector-controls/groups.js +2 -0
  334. package/build-module/components/inspector-controls/groups.js.map +1 -1
  335. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +32 -0
  336. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -0
  337. package/build-module/components/inspector-controls-tabs/index.js +56 -0
  338. package/build-module/components/inspector-controls-tabs/index.js.map +1 -0
  339. package/build-module/components/inspector-controls-tabs/settings-tab.js +17 -0
  340. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -0
  341. package/build-module/components/inspector-controls-tabs/styles-tab.js +46 -0
  342. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -0
  343. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +81 -0
  344. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -0
  345. package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +8 -0
  346. package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -0
  347. package/build-module/components/inspector-controls-tabs/utils.js +26 -0
  348. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -0
  349. package/build-module/components/link-control/index.js +18 -34
  350. package/build-module/components/link-control/index.js.map +1 -1
  351. package/build-module/components/link-control/search-input.js +1 -2
  352. package/build-module/components/link-control/search-input.js.map +1 -1
  353. package/build-module/components/link-control/use-internal-input-value.js +18 -0
  354. package/build-module/components/link-control/use-internal-input-value.js.map +1 -0
  355. package/build-module/components/list-view/block.js +10 -5
  356. package/build-module/components/list-view/block.js.map +1 -1
  357. package/build-module/components/list-view/branch.js +21 -14
  358. package/build-module/components/list-view/branch.js.map +1 -1
  359. package/build-module/components/media-upload/index.native.js +2 -4
  360. package/build-module/components/media-upload/index.native.js.map +1 -1
  361. package/build-module/components/off-canvas-editor/appender.js +89 -0
  362. package/build-module/components/off-canvas-editor/appender.js.map +1 -0
  363. package/build-module/components/off-canvas-editor/block-contents.js +85 -0
  364. package/build-module/components/off-canvas-editor/block-contents.js.map +1 -0
  365. package/build-module/components/off-canvas-editor/block-edit-button.js +35 -0
  366. package/build-module/components/off-canvas-editor/block-edit-button.js.map +1 -0
  367. package/build-module/components/off-canvas-editor/block-select-button.js +101 -0
  368. package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -0
  369. package/build-module/components/off-canvas-editor/block.js +298 -0
  370. package/build-module/components/off-canvas-editor/block.js.map +1 -0
  371. package/build-module/components/off-canvas-editor/branch.js +164 -0
  372. package/build-module/components/off-canvas-editor/branch.js.map +1 -0
  373. package/build-module/components/off-canvas-editor/context.js +7 -0
  374. package/build-module/components/off-canvas-editor/context.js.map +1 -0
  375. package/build-module/components/off-canvas-editor/drop-indicator.js +111 -0
  376. package/build-module/components/off-canvas-editor/drop-indicator.js.map +1 -0
  377. package/build-module/components/off-canvas-editor/expander.js +32 -0
  378. package/build-module/components/off-canvas-editor/expander.js.map +1 -0
  379. package/build-module/components/off-canvas-editor/index.js +189 -0
  380. package/build-module/components/off-canvas-editor/index.js.map +1 -0
  381. package/build-module/components/off-canvas-editor/leaf.js +45 -0
  382. package/build-module/components/off-canvas-editor/leaf.js.map +1 -0
  383. package/build-module/components/off-canvas-editor/link-ui.js +165 -0
  384. package/build-module/components/off-canvas-editor/link-ui.js.map +1 -0
  385. package/build-module/components/off-canvas-editor/update-attributes.js +97 -0
  386. package/build-module/components/off-canvas-editor/update-attributes.js.map +1 -0
  387. package/build-module/components/off-canvas-editor/use-block-selection.js +124 -0
  388. package/build-module/components/off-canvas-editor/use-block-selection.js.map +1 -0
  389. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +24 -0
  390. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
  391. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +220 -0
  392. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
  393. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +50 -0
  394. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
  395. package/build-module/components/off-canvas-editor/utils.js +44 -0
  396. package/build-module/components/off-canvas-editor/utils.js.map +1 -0
  397. package/build-module/components/rich-text/format-toolbar/index.js +6 -2
  398. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  399. package/build-module/components/rich-text/index.js +2 -3
  400. package/build-module/components/rich-text/index.js.map +1 -1
  401. package/build-module/components/rich-text/index.native.js +0 -2
  402. package/build-module/components/rich-text/index.native.js.map +1 -1
  403. package/build-module/components/rich-text/use-insert-replacement-text.js +33 -0
  404. package/build-module/components/rich-text/use-insert-replacement-text.js.map +1 -0
  405. package/build-module/components/rich-text/use-undo-automatic-change.js +9 -1
  406. package/build-module/components/rich-text/use-undo-automatic-change.js.map +1 -1
  407. package/build-module/components/rich-text/utils.js +1 -16
  408. package/build-module/components/rich-text/utils.js.map +1 -1
  409. package/build-module/components/spacing-sizes-control/spacing-input-control.js +12 -3
  410. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  411. package/build-module/components/ungroup-button/index.native.js +3 -2
  412. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  413. package/build-module/components/url-input/index.js +46 -43
  414. package/build-module/components/url-input/index.js.map +1 -1
  415. package/build-module/components/url-popover/index.js +30 -3
  416. package/build-module/components/url-popover/index.js.map +1 -1
  417. package/build-module/components/use-block-display-information/index.js +9 -5
  418. package/build-module/components/use-block-display-information/index.js.map +1 -1
  419. package/build-module/components/use-setting/index.js +9 -2
  420. package/build-module/components/use-setting/index.js.map +1 -1
  421. package/build-module/hooks/child-layout.js +189 -0
  422. package/build-module/hooks/child-layout.js.map +1 -0
  423. package/build-module/hooks/color-panel.js +17 -1
  424. package/build-module/hooks/color-panel.js.map +1 -1
  425. package/build-module/hooks/color.js +1 -1
  426. package/build-module/hooks/color.js.map +1 -1
  427. package/build-module/hooks/content-lock-ui.js +16 -9
  428. package/build-module/hooks/content-lock-ui.js.map +1 -1
  429. package/build-module/hooks/dimensions.js +60 -16
  430. package/build-module/hooks/dimensions.js.map +1 -1
  431. package/build-module/hooks/layout.js +57 -2
  432. package/build-module/hooks/layout.js.map +1 -1
  433. package/build-module/hooks/margin.js +4 -2
  434. package/build-module/hooks/margin.js.map +1 -1
  435. package/build-module/hooks/min-height.js +116 -0
  436. package/build-module/hooks/min-height.js.map +1 -0
  437. package/build-module/hooks/padding.js +4 -2
  438. package/build-module/hooks/padding.js.map +1 -1
  439. package/build-module/hooks/style.js +4 -3
  440. package/build-module/hooks/style.js.map +1 -1
  441. package/build-module/layouts/flex.js +23 -22
  442. package/build-module/layouts/flex.js.map +1 -1
  443. package/build-module/store/actions.js +22 -0
  444. package/build-module/store/actions.js.map +1 -1
  445. package/build-module/store/reducer.js +415 -265
  446. package/build-module/store/reducer.js.map +1 -1
  447. package/build-module/store/selectors.js +66 -48
  448. package/build-module/store/selectors.js.map +1 -1
  449. package/build-module/utils/sorting.js +56 -0
  450. package/build-module/utils/sorting.js.map +1 -0
  451. package/build-style/content-rtl.css +701 -0
  452. package/build-style/content.css +701 -0
  453. package/build-style/default-editor-styles-rtl.css +14 -0
  454. package/build-style/default-editor-styles.css +14 -0
  455. package/build-style/style-rtl.css +305 -668
  456. package/build-style/style.css +305 -668
  457. package/package.json +32 -30
  458. package/src/autocompleters/block.js +2 -6
  459. package/src/autocompleters/link.js +2 -0
  460. package/src/components/alignment-control/README.md +1 -1
  461. package/src/components/alignment-control/test/index.js +4 -1
  462. package/src/components/block-alignment-control/test/index.js +4 -1
  463. package/src/components/block-alignment-control/test/index.native.js +4 -4
  464. package/src/components/block-card/index.js +46 -2
  465. package/src/components/block-card/style.scss +4 -0
  466. package/src/components/block-content-overlay/{style.scss → content.scss} +7 -1
  467. package/src/components/block-draggable/content.scss +20 -0
  468. package/src/components/block-draggable/index.native.js +54 -40
  469. package/src/components/block-draggable/style.scss +0 -21
  470. package/src/components/block-draggable/test/helpers.native.js +7 -9
  471. package/src/components/block-draggable/test/index.native.js +35 -45
  472. package/src/components/block-edit/edit.js +5 -2
  473. package/src/components/block-edit/edit.native.js +5 -6
  474. package/src/components/block-inspector/index.js +96 -81
  475. package/src/components/block-inspector/style.scss +9 -1
  476. package/src/components/block-list/block-list-context.native.js +5 -8
  477. package/src/components/block-list/block.js +74 -23
  478. package/src/components/block-list/block.native.js +78 -23
  479. package/src/components/block-list/{style.scss → content.scss} +11 -20
  480. package/src/components/block-list-appender/{style.scss → content.scss} +0 -0
  481. package/src/components/block-lock/menu-item.js +5 -2
  482. package/src/components/block-lock/modal.js +19 -36
  483. package/src/components/block-lock/style.scss +8 -17
  484. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +24 -6
  485. package/src/components/block-mover/style.scss +0 -1
  486. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -2
  487. package/src/components/block-pattern-setup/index.js +2 -1
  488. package/src/components/block-patterns-list/index.js +47 -24
  489. package/src/components/block-popover/style.scss +1 -1
  490. package/src/components/block-preview/README.md +15 -10
  491. package/src/components/block-preview/auto.js +7 -1
  492. package/src/components/block-preview/content.scss +4 -0
  493. package/src/components/block-preview/index.js +7 -12
  494. package/src/components/block-preview/style.scss +0 -7
  495. package/src/components/block-preview/test/index.js +18 -35
  496. package/src/components/block-selection-clearer/test/index.js +12 -12
  497. package/src/components/block-settings-menu/block-settings-dropdown.js +32 -20
  498. package/src/components/block-styles/utils.js +3 -3
  499. package/src/components/block-switcher/index.js +19 -4
  500. package/src/components/block-switcher/test/index.js +4 -0
  501. package/src/components/block-toolbar/index.js +12 -5
  502. package/src/components/block-toolbar/style.scss +10 -0
  503. package/src/components/block-tools/insertion-point.js +3 -47
  504. package/src/components/block-tools/selected-block-popover.js +80 -34
  505. package/src/components/block-tools/style.scss +27 -5
  506. package/src/components/block-variation-picker/index.js +1 -4
  507. package/src/components/block-vertical-alignment-control/test/index.js +4 -1
  508. package/src/components/colors/with-colors.js +13 -23
  509. package/src/components/default-block-appender/{style.scss → content.scss} +1 -0
  510. package/src/components/font-sizes/fluid-utils.js +37 -64
  511. package/src/components/font-sizes/test/fluid-utils.js +5 -5
  512. package/src/components/font-sizes/with-font-sizes.js +14 -11
  513. package/src/components/height-control/index.js +123 -0
  514. package/src/components/height-control/stories/index.js +21 -0
  515. package/src/components/height-control/style.scss +5 -0
  516. package/src/components/iframe/index.js +25 -18
  517. package/src/components/image-editor/use-save-image.js +2 -0
  518. package/src/components/image-editor/zoom-dropdown.js +1 -0
  519. package/src/components/index.js +2 -0
  520. package/src/components/inner-blocks/{style.scss → content.scss} +0 -0
  521. package/src/components/inner-blocks/index.js +30 -10
  522. package/src/components/inner-blocks/use-inner-block-template-sync.js +28 -10
  523. package/src/components/inserter/block-patterns-explorer/sidebar.js +1 -0
  524. package/src/components/inserter/block-patterns-tab.js +28 -71
  525. package/src/components/inserter/block-types-tab.js +3 -2
  526. package/src/components/inserter/hooks/use-debounced-input.js +17 -0
  527. package/src/components/inserter/index.js +10 -2
  528. package/src/components/inserter/index.native.js +1 -1
  529. package/src/components/inserter/media-tab/hooks.js +88 -0
  530. package/src/components/inserter/media-tab/index.js +3 -0
  531. package/src/components/inserter/media-tab/media-list.js +93 -0
  532. package/src/components/inserter/media-tab/media-panel.js +83 -0
  533. package/src/components/inserter/media-tab/media-tab.js +135 -0
  534. package/src/components/inserter/media-tab/utils.js +37 -0
  535. package/src/components/inserter/menu.js +55 -13
  536. package/src/components/inserter/mobile-tab-navigation.js +85 -0
  537. package/src/components/inserter/quick-inserter.js +1 -0
  538. package/src/components/inserter/reusable-blocks-tab.js +4 -2
  539. package/src/components/inserter/search-results.js +3 -2
  540. package/src/components/inserter/stories/index.js +1 -1
  541. package/src/components/inserter/stories/{fixtures.js → utils/fixtures.js} +0 -0
  542. package/src/components/inserter/style.scss +184 -18
  543. package/src/components/inserter/tabs.js +12 -1
  544. package/src/components/inserter/test/reusable-blocks-tab.js +14 -57
  545. package/src/components/inserter-list-item/index.js +11 -1
  546. package/src/components/inserter-list-item/style.scss +26 -0
  547. package/src/components/inspector-controls/groups.js +2 -0
  548. package/src/components/inspector-controls-tabs/advanced-controls-panel.js +37 -0
  549. package/src/components/inspector-controls-tabs/index.js +62 -0
  550. package/src/components/inspector-controls-tabs/settings-tab.js +18 -0
  551. package/src/components/inspector-controls-tabs/styles-tab.js +51 -0
  552. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +89 -0
  553. package/src/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +9 -0
  554. package/src/components/inspector-controls-tabs/utils.js +28 -0
  555. package/src/components/line-height-control/test/index.js +5 -5
  556. package/src/components/link-control/README.md +1 -1
  557. package/src/components/link-control/index.js +24 -39
  558. package/src/components/link-control/search-input.js +1 -2
  559. package/src/components/link-control/test/index.js +400 -582
  560. package/src/components/link-control/use-internal-input-value.js +22 -0
  561. package/src/components/list-view/block.js +7 -3
  562. package/src/components/list-view/branch.js +21 -14
  563. package/src/components/list-view/style.scss +20 -9
  564. package/src/components/media-placeholder/{style.scss → content.scss} +0 -0
  565. package/src/components/media-replace-flow/test/index.js +37 -9
  566. package/src/components/media-upload/test/index.native.js +2 -0
  567. package/src/components/off-canvas-editor/README.md +5 -0
  568. package/src/components/off-canvas-editor/appender.js +93 -0
  569. package/src/components/off-canvas-editor/block-contents.js +89 -0
  570. package/src/components/off-canvas-editor/block-edit-button.js +27 -0
  571. package/src/components/off-canvas-editor/block-select-button.js +113 -0
  572. package/src/components/off-canvas-editor/block.js +401 -0
  573. package/src/components/off-canvas-editor/branch.js +208 -0
  574. package/src/components/off-canvas-editor/context.js +8 -0
  575. package/src/components/off-canvas-editor/drop-indicator.js +126 -0
  576. package/src/components/off-canvas-editor/expander.js +26 -0
  577. package/src/components/off-canvas-editor/index.js +242 -0
  578. package/src/components/off-canvas-editor/leaf.js +52 -0
  579. package/src/components/off-canvas-editor/link-ui.js +166 -0
  580. package/src/components/off-canvas-editor/style.scss +26 -0
  581. package/src/components/off-canvas-editor/test/utils.js +50 -0
  582. package/src/components/off-canvas-editor/update-attributes.js +99 -0
  583. package/src/components/off-canvas-editor/use-block-selection.js +169 -0
  584. package/src/components/off-canvas-editor/use-list-view-client-ids.js +29 -0
  585. package/src/components/off-canvas-editor/use-list-view-drop-zone.js +260 -0
  586. package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +58 -0
  587. package/src/components/off-canvas-editor/utils.js +58 -0
  588. package/src/components/plain-text/{style.scss → content.scss} +0 -0
  589. package/src/components/recursion-provider/test/index.js +27 -29
  590. package/src/components/responsive-block-control/test/index.js +69 -92
  591. package/src/components/rich-text/content.scss +42 -0
  592. package/src/components/rich-text/format-toolbar/index.js +6 -4
  593. package/src/components/rich-text/index.js +2 -2
  594. package/src/components/rich-text/index.native.js +0 -2
  595. package/src/components/rich-text/style.scss +0 -43
  596. package/src/components/rich-text/use-insert-replacement-text.js +31 -0
  597. package/src/components/rich-text/use-undo-automatic-change.js +7 -1
  598. package/src/components/rich-text/utils.js +2 -21
  599. package/src/components/spacing-sizes-control/spacing-input-control.js +9 -0
  600. package/src/components/ungroup-button/index.native.js +6 -2
  601. package/src/components/url-input/index.js +57 -73
  602. package/src/components/url-popover/README.md +12 -3
  603. package/src/components/url-popover/index.js +33 -3
  604. package/src/components/url-popover/test/__snapshots__/index.js.snap +8 -6
  605. package/src/components/url-popover/test/index.js +21 -9
  606. package/src/components/use-block-display-information/index.js +14 -5
  607. package/src/components/use-setting/index.js +20 -2
  608. package/src/components/use-setting/test/index.js +99 -0
  609. package/src/content.scss +10 -0
  610. package/src/hooks/child-layout.js +190 -0
  611. package/src/hooks/color-panel.js +13 -1
  612. package/src/hooks/color.js +2 -0
  613. package/src/hooks/content-lock-ui.js +47 -35
  614. package/src/hooks/dimensions.js +119 -21
  615. package/src/hooks/layout.js +62 -3
  616. package/src/hooks/margin.js +4 -3
  617. package/src/hooks/min-height.js +104 -0
  618. package/src/hooks/padding.js +4 -3
  619. package/src/hooks/style.js +10 -2
  620. package/src/hooks/test/style.js +4 -0
  621. package/src/hooks/test/use-typography-props.js +1 -1
  622. package/src/layouts/flex.js +43 -38
  623. package/src/store/actions.js +22 -0
  624. package/src/store/reducer.js +480 -434
  625. package/src/store/selectors.js +70 -64
  626. package/src/store/test/actions.js +18 -0
  627. package/src/store/test/performance.js +71 -0
  628. package/src/store/test/reducer.js +662 -490
  629. package/src/store/test/selectors.js +1839 -1306
  630. package/src/style.scss +4 -7
  631. package/src/utils/sorting.js +54 -0
  632. package/src/utils/test/sorting.js +49 -0
  633. package/tsconfig.tsbuildinfo +1 -1
  634. package/build/components/block-preview/live.js +0 -30
  635. package/build/components/block-preview/live.js.map +0 -1
  636. package/build-module/components/block-preview/live.js +0 -20
  637. package/build-module/components/block-preview/live.js.map +0 -1
  638. package/src/components/block-preview/live.js +0 -19
@@ -79,7 +79,6 @@ function InbetweenInsertionPointPopover( {
79
79
  isInserterShown: insertionPoint?.__unstableWithInserter,
80
80
  };
81
81
  }, [] );
82
- const isVertical = orientation === 'vertical';
83
82
 
84
83
  const disableMotion = useReducedMotion();
85
84
 
@@ -105,65 +104,22 @@ function InbetweenInsertionPointPopover( {
105
104
  }
106
105
  }
107
106
 
108
- // Define animation variants for the line element.
109
- const horizontalLine = {
110
- start: {
111
- width: 0,
112
- top: '50%',
113
- bottom: '50%',
114
- x: 0,
115
- },
116
- rest: {
117
- width: 4,
118
- top: 0,
119
- bottom: 0,
120
- x: -2,
121
- },
122
- hover: {
123
- width: 4,
124
- top: 0,
125
- bottom: 0,
126
- x: -2,
127
- },
128
- };
129
- const verticalLine = {
130
- start: {
131
- height: 0,
132
- left: '50%',
133
- right: '50%',
134
- y: 0,
135
- },
136
- rest: {
137
- height: 4,
138
- left: 0,
139
- right: 0,
140
- y: -2,
141
- },
142
- hover: {
143
- height: 4,
144
- left: 0,
145
- right: 0,
146
- y: -2,
147
- },
148
- };
149
107
  const lineVariants = {
150
108
  // Initial position starts from the center and invisible.
151
109
  start: {
152
- ...( ! isVertical ? horizontalLine.start : verticalLine.start ),
153
110
  opacity: 0,
111
+ scale: 0,
154
112
  },
155
113
  // The line expands to fill the container. If the inserter is visible it
156
114
  // is delayed so it appears orchestrated.
157
115
  rest: {
158
- ...( ! isVertical ? horizontalLine.rest : verticalLine.rest ),
159
116
  opacity: 1,
160
- borderRadius: '2px',
117
+ scale: 1,
161
118
  transition: { delay: isInserterShown ? 0.5 : 0, type: 'tween' },
162
119
  },
163
120
  hover: {
164
- ...( ! isVertical ? horizontalLine.hover : verticalLine.hover ),
165
121
  opacity: 1,
166
- borderRadius: '2px',
122
+ scale: 1,
167
123
  transition: { delay: 0.5, type: 'tween' },
168
124
  },
169
125
  };
@@ -21,6 +21,7 @@ import BlockContextualToolbar from './block-contextual-toolbar';
21
21
  import { store as blockEditorStore } from '../../store';
22
22
  import BlockPopover from '../block-popover';
23
23
  import useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';
24
+ import Inserter from '../inserter';
24
25
 
25
26
  function selector( select ) {
26
27
  const {
@@ -28,13 +29,16 @@ function selector( select ) {
28
29
  isMultiSelecting,
29
30
  hasMultiSelection,
30
31
  isTyping,
32
+ __experimentalIsBlockInterfaceHidden: isBlockInterfaceHidden,
31
33
  getSettings,
32
34
  getLastMultiSelectedBlockClientId,
33
35
  } = select( blockEditorStore );
36
+
34
37
  return {
35
38
  editorMode: __unstableGetEditorMode(),
36
39
  isMultiSelecting: isMultiSelecting(),
37
40
  isTyping: isTyping(),
41
+ isBlockInterfaceHidden: isBlockInterfaceHidden(),
38
42
  hasFixedToolbar: getSettings().hasFixedToolbar,
39
43
  isDistractionFree: getSettings().isDistractionFree,
40
44
  lastClientId: hasMultiSelection()
@@ -56,6 +60,7 @@ function SelectedBlockPopover( {
56
60
  editorMode,
57
61
  isMultiSelecting,
58
62
  isTyping,
63
+ isBlockInterfaceHidden,
59
64
  hasFixedToolbar,
60
65
  isDistractionFree,
61
66
  lastClientId,
@@ -92,7 +97,8 @@ function SelectedBlockPopover( {
92
97
  isLargeViewport &&
93
98
  ! isMultiSelecting &&
94
99
  ! showEmptyBlockSideInserter &&
95
- ! isTyping;
100
+ ! isTyping &&
101
+ ! isBlockInterfaceHidden;
96
102
  const canFocusHiddenToolbar =
97
103
  editorMode === 'edit' &&
98
104
  ! shouldShowContextualToolbar &&
@@ -124,45 +130,85 @@ function SelectedBlockPopover( {
124
130
  clientId,
125
131
  } );
126
132
 
127
- if ( ! shouldShowBreadcrumb && ! shouldShowContextualToolbar ) {
133
+ if (
134
+ ! shouldShowBreadcrumb &&
135
+ ! shouldShowContextualToolbar &&
136
+ ! showEmptyBlockSideInserter
137
+ ) {
128
138
  return null;
129
139
  }
130
140
 
131
141
  return (
132
- <BlockPopover
133
- clientId={ capturingClientId || clientId }
134
- bottomClientId={ lastClientId }
135
- className={ classnames( 'block-editor-block-list__block-popover', {
136
- 'is-insertion-point-visible': isInsertionPointVisible,
137
- } ) }
138
- __unstablePopoverSlot={ __unstablePopoverSlot }
139
- __unstableContentRef={ __unstableContentRef }
140
- resize={ false }
141
- { ...popoverProps }
142
- >
143
- { shouldShowContextualToolbar && showContents && (
144
- <BlockContextualToolbar
145
- // If the toolbar is being shown because of being forced
146
- // it should focus the toolbar right after the mount.
147
- focusOnMount={ isToolbarForced.current }
148
- __experimentalInitialIndex={
149
- initialToolbarItemIndexRef.current
150
- }
151
- __experimentalOnIndexChange={ ( index ) => {
152
- initialToolbarItemIndexRef.current = index;
153
- } }
154
- // Resets the index whenever the active block changes so
155
- // this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169
156
- key={ clientId }
157
- />
142
+ <>
143
+ { showEmptyBlockSideInserter && (
144
+ <BlockPopover
145
+ clientId={ capturingClientId || clientId }
146
+ __unstableCoverTarget
147
+ bottomClientId={ lastClientId }
148
+ className={ classnames(
149
+ 'block-editor-block-list__block-side-inserter-popover',
150
+ {
151
+ 'is-insertion-point-visible':
152
+ isInsertionPointVisible,
153
+ }
154
+ ) }
155
+ __unstablePopoverSlot={ __unstablePopoverSlot }
156
+ __unstableContentRef={ __unstableContentRef }
157
+ resize={ false }
158
+ shift={ false }
159
+ { ...popoverProps }
160
+ >
161
+ <div className="block-editor-block-list__empty-block-inserter">
162
+ <Inserter
163
+ position="bottom right"
164
+ rootClientId={ rootClientId }
165
+ clientId={ clientId }
166
+ __experimentalIsQuick
167
+ />
168
+ </div>
169
+ </BlockPopover>
158
170
  ) }
159
- { shouldShowBreadcrumb && (
160
- <BlockSelectionButton
161
- clientId={ clientId }
162
- rootClientId={ rootClientId }
163
- />
171
+ { ( shouldShowBreadcrumb || shouldShowContextualToolbar ) && (
172
+ <BlockPopover
173
+ clientId={ capturingClientId || clientId }
174
+ bottomClientId={ lastClientId }
175
+ className={ classnames(
176
+ 'block-editor-block-list__block-popover',
177
+ {
178
+ 'is-insertion-point-visible':
179
+ isInsertionPointVisible,
180
+ }
181
+ ) }
182
+ __unstablePopoverSlot={ __unstablePopoverSlot }
183
+ __unstableContentRef={ __unstableContentRef }
184
+ resize={ false }
185
+ { ...popoverProps }
186
+ >
187
+ { shouldShowContextualToolbar && showContents && (
188
+ <BlockContextualToolbar
189
+ // If the toolbar is being shown because of being forced
190
+ // it should focus the toolbar right after the mount.
191
+ focusOnMount={ isToolbarForced.current }
192
+ __experimentalInitialIndex={
193
+ initialToolbarItemIndexRef.current
194
+ }
195
+ __experimentalOnIndexChange={ ( index ) => {
196
+ initialToolbarItemIndexRef.current = index;
197
+ } }
198
+ // Resets the index whenever the active block changes so
199
+ // this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169
200
+ key={ clientId }
201
+ />
202
+ ) }
203
+ { shouldShowBreadcrumb && (
204
+ <BlockSelectionButton
205
+ clientId={ clientId }
206
+ rootClientId={ rootClientId }
207
+ />
208
+ ) }
209
+ </BlockPopover>
164
210
  ) }
165
- </BlockPopover>
211
+ </>
166
212
  );
167
213
  }
168
214
 
@@ -13,17 +13,22 @@
13
13
  .block-editor-block-list__insertion-point-indicator {
14
14
  position: absolute;
15
15
  background: var(--wp-admin-theme-color);
16
+ border-radius: 2px;
17
+ transform-origin: center;
18
+ opacity: 0;
19
+ will-change: transform, opacity;
16
20
 
17
21
  .block-editor-block-list__insertion-point.is-vertical > & {
18
- top: 50%;
19
- height: $border-width;
22
+ top: calc(50% - 2px);
23
+ height: 4px;
24
+ width: 100%;
20
25
  }
21
26
 
22
27
  .block-editor-block-list__insertion-point.is-horizontal > & {
23
28
  top: 0;
24
- right: 0;
25
- left: 50%;
26
- width: $border-width;
29
+ bottom: 0;
30
+ left: calc(50% - 2px);
31
+ width: 4px;
27
32
  }
28
33
  }
29
34
 
@@ -32,6 +37,8 @@
32
37
  // Don't show on mobile.
33
38
  display: none;
34
39
  position: absolute;
40
+ will-change: transform;
41
+
35
42
  @include break-mobile() {
36
43
  display: flex;
37
44
  }
@@ -42,7 +49,16 @@
42
49
  left: calc(50% - #{$button-size-small * 0.5});
43
50
  }
44
51
 
52
+ .block-editor-block-list__block-side-inserter-popover .components-popover__content > div {
53
+ pointer-events: none;
54
+
55
+ > * {
56
+ pointer-events: all;
57
+ }
58
+ }
59
+
45
60
  // Sibling inserter / "inbetweenserter".
61
+ .block-editor-block-list__empty-block-inserter,
46
62
  .block-editor-default-block-appender,
47
63
  .block-editor-block-list__insertion-point-inserter {
48
64
  .block-editor-inserter__toggle.components-button.has-icon {
@@ -166,6 +182,12 @@
166
182
  &:active {
167
183
  color: $white;
168
184
  }
185
+
186
+ // Make sure the button has no hover style when it's disabled.
187
+ &[aria-disabled="true"]:hover {
188
+ color: $white;
189
+ }
190
+
169
191
  display: flex;
170
192
  }
171
193
  .block-selection-button_select-button.components-button {
@@ -49,10 +49,7 @@ function BlockVariationPicker( {
49
49
  className="block-editor-block-variation-picker__variation"
50
50
  label={ variation.description || variation.title }
51
51
  />
52
- <span
53
- className="block-editor-block-variation-picker__variation-label"
54
- role="presentation"
55
- >
52
+ <span className="block-editor-block-variation-picker__variation-label">
56
53
  { variation.title }
57
54
  </span>
58
55
  </li>
@@ -45,7 +45,7 @@ describe( 'BlockVerticalAlignmentUI', () => {
45
45
  advanceTimers: jest.advanceTimersByTime,
46
46
  } );
47
47
 
48
- render(
48
+ const { unmount } = render(
49
49
  <BlockVerticalAlignmentUI
50
50
  isToolbar
51
51
  value={ alignment }
@@ -70,6 +70,9 @@ describe( 'BlockVerticalAlignmentUI', () => {
70
70
  name: /^Align \w+$/,
71
71
  } )
72
72
  ).toHaveLength( 3 );
73
+
74
+ // Cancel running effects, like delayed dropdown menu popover positioning.
75
+ unmount();
73
76
  } );
74
77
 
75
78
  it( 'should call onChange with undefined, when the control is already active', async () => {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { kebabCase, reduce } from 'lodash';
4
+ import { kebabCase } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -83,18 +83,14 @@ const withEditorColorPalette = () =>
83
83
  * @return {WPComponent} The component that can be used as a HOC.
84
84
  */
85
85
  function createColorHOC( colorTypes, withColorPalette ) {
86
- const colorMap = reduce(
87
- colorTypes,
88
- ( colorObject, colorType ) => {
89
- return {
90
- ...colorObject,
91
- ...( typeof colorType === 'string'
92
- ? { [ colorType ]: kebabCase( colorType ) }
93
- : colorType ),
94
- };
95
- },
96
- {}
97
- );
86
+ const colorMap = colorTypes.reduce( ( colorObject, colorType ) => {
87
+ return {
88
+ ...colorObject,
89
+ ...( typeof colorType === 'string'
90
+ ? { [ colorType ]: kebabCase( colorType ) }
91
+ : colorType ),
92
+ };
93
+ }, {} );
98
94
 
99
95
  return compose( [
100
96
  withColorPalette,
@@ -118,13 +114,8 @@ function createColorHOC( colorTypes, withColorPalette ) {
118
114
  }
119
115
 
120
116
  createSetters() {
121
- return reduce(
122
- colorMap,
123
- (
124
- settersAccumulator,
125
- colorContext,
126
- colorAttributeName
127
- ) => {
117
+ return Object.keys( colorMap ).reduce(
118
+ ( settersAccumulator, colorAttributeName ) => {
128
119
  const upperFirstColorAttributeName =
129
120
  upperFirst( colorAttributeName );
130
121
  const customColorAttributeName = `custom${ upperFirstColorAttributeName }`;
@@ -163,9 +154,8 @@ function createColorHOC( colorTypes, withColorPalette ) {
163
154
  { attributes, colors },
164
155
  previousState
165
156
  ) {
166
- return reduce(
167
- colorMap,
168
- ( newState, colorContext, colorAttributeName ) => {
157
+ return Object.entries( colorMap ).reduce(
158
+ ( newState, [ colorAttributeName, colorContext ] ) => {
169
159
  const colorObject = getColorObjectByAttributeValues(
170
160
  colors,
171
161
  attributes[ colorAttributeName ],
@@ -34,6 +34,7 @@
34
34
 
35
35
  // The black plus that shows up on the right side of an empty paragraph block, or the initial appender
36
36
  // that exists only on empty documents.
37
+ .block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter,
37
38
  .block-editor-default-block-appender .block-editor-inserter {
38
39
  position: absolute;
39
40
  top: 0;
@@ -9,7 +9,6 @@ const DEFAULT_MAXIMUM_VIEWPORT_WIDTH = '1600px';
9
9
  const DEFAULT_MINIMUM_VIEWPORT_WIDTH = '768px';
10
10
  const DEFAULT_SCALE_FACTOR = 1;
11
11
  const DEFAULT_MINIMUM_FONT_SIZE_FACTOR = 0.75;
12
- const DEFAULT_MAXIMUM_FONT_SIZE_FACTOR = 1.5;
13
12
  const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';
14
13
 
15
14
  /**
@@ -41,7 +40,6 @@ const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';
41
40
  * @param {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional.
42
41
  * @param {?number} args.scaleFactor A scale factor to determine how fast a font scales within boundaries. Optional.
43
42
  * @param {?number} args.minimumFontSizeFactor How much to scale defaultFontSize by to derive minimumFontSize. Optional.
44
- * @param {?number} args.maximumFontSizeFactor How much to scale defaultFontSize by to derive maximumFontSize. Optional.
45
43
  *
46
44
  * @return {string|null} A font-size value using clamp().
47
45
  */
@@ -53,15 +51,8 @@ export function getComputedFluidTypographyValue( {
53
51
  maximumViewPortWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
54
52
  scaleFactor = DEFAULT_SCALE_FACTOR,
55
53
  minimumFontSizeFactor = DEFAULT_MINIMUM_FONT_SIZE_FACTOR,
56
- maximumFontSizeFactor = DEFAULT_MAXIMUM_FONT_SIZE_FACTOR,
57
54
  minimumFontSizeLimit = DEFAULT_MINIMUM_FONT_SIZE_LIMIT,
58
55
  } ) {
59
- /*
60
- * Caches minimumFontSize in minimumFontSizeValue
61
- * so we can check if minimumFontSize exists later.
62
- */
63
- let minimumFontSizeValue = minimumFontSize;
64
-
65
56
  /*
66
57
  * Calculates missing minimumFontSize and maximumFontSize from
67
58
  * defaultFontSize if provided.
@@ -75,15 +66,6 @@ export function getComputedFluidTypographyValue( {
75
66
  return null;
76
67
  }
77
68
 
78
- // If no minimumFontSize is provided, derive using min scale factor.
79
- if ( ! minimumFontSizeValue ) {
80
- minimumFontSizeValue =
81
- roundToPrecision(
82
- fontSizeParsed.value * minimumFontSizeFactor,
83
- 3
84
- ) + fontSizeParsed.unit;
85
- }
86
-
87
69
  // Parses the minimum font size limit, so we can perform checks using it.
88
70
  const minimumFontSizeLimitParsed = getTypographyValueAndUnit(
89
71
  minimumFontSizeLimit,
@@ -92,57 +74,51 @@ export function getComputedFluidTypographyValue( {
92
74
  }
93
75
  );
94
76
 
95
- if ( !! minimumFontSizeLimitParsed?.value ) {
77
+ // Don't enforce minimum font size if a font size has explicitly set a min and max value.
78
+ if (
79
+ !! minimumFontSizeLimitParsed?.value &&
80
+ ! minimumFontSize &&
81
+ ! maximumFontSize
82
+ ) {
96
83
  /*
97
84
  * If a minimum size was not passed to this function
98
- * and the user-defined font size is lower than `minimumFontSizeLimit`,
99
- * then uses the user-defined font size as the minimum font-size.
85
+ * and the user-defined font size is lower than $minimum_font_size_limit,
86
+ * do not calculate a fluid value.
100
87
  */
101
- if (
102
- ! minimumFontSize &&
103
- fontSizeParsed?.value < minimumFontSizeLimitParsed?.value
104
- ) {
105
- minimumFontSizeValue = `${ fontSizeParsed.value }${ fontSizeParsed.unit }`;
106
- } else {
107
- const minimumFontSizeParsed = getTypographyValueAndUnit(
108
- minimumFontSizeValue,
109
- {
110
- coerceTo: fontSizeParsed.unit,
111
- }
112
- );
113
-
114
- /*
115
- * Otherwise, if the passed or calculated minimum font size is lower than `minimumFontSizeLimit`
116
- * use `minimumFontSizeLimit` instead.
117
- */
118
- if (
119
- !! minimumFontSizeParsed?.value &&
120
- minimumFontSizeParsed.value <
121
- minimumFontSizeLimitParsed.value
122
- ) {
123
- minimumFontSizeValue = `${ minimumFontSizeLimitParsed.value }${ minimumFontSizeLimitParsed.unit }`;
124
- }
88
+ if ( fontSizeParsed?.value <= minimumFontSizeLimitParsed?.value ) {
89
+ return null;
125
90
  }
126
91
  }
127
92
 
128
- // If no maximumFontSize is provided, derive using max scale factor.
93
+ // If no fluid max font size is available use the incoming value.
129
94
  if ( ! maximumFontSize ) {
130
- maximumFontSize =
131
- roundToPrecision(
132
- fontSizeParsed.value * maximumFontSizeFactor,
133
- 3
134
- ) + fontSizeParsed.unit;
95
+ maximumFontSize = `${ fontSizeParsed.value }${ fontSizeParsed.unit }`;
135
96
  }
136
- }
137
97
 
138
- // Return early if one of the provided inputs is not provided.
139
- if ( ! minimumFontSizeValue || ! maximumFontSize ) {
140
- return null;
98
+ /*
99
+ * If no minimumFontSize is provided, create one using
100
+ * the given font size multiplied by the min font size scale factor.
101
+ */
102
+ if ( ! minimumFontSize ) {
103
+ const calculatedMinimumFontSize = roundToPrecision(
104
+ fontSizeParsed.value * minimumFontSizeFactor,
105
+ 3
106
+ );
107
+
108
+ // Only use calculated min font size if it's > $minimum_font_size_limit value.
109
+ if (
110
+ !! minimumFontSizeLimitParsed?.value &&
111
+ calculatedMinimumFontSize < minimumFontSizeLimitParsed?.value
112
+ ) {
113
+ minimumFontSize = `${ minimumFontSizeLimitParsed.value }${ minimumFontSizeLimitParsed.unit }`;
114
+ } else {
115
+ minimumFontSize = `${ calculatedMinimumFontSize }${ fontSizeParsed.unit }`;
116
+ }
117
+ }
141
118
  }
142
119
 
143
120
  // Grab the minimum font size and normalize it in order to use the value for calculations.
144
- const minimumFontSizeParsed =
145
- getTypographyValueAndUnit( minimumFontSizeValue );
121
+ const minimumFontSizeParsed = getTypographyValueAndUnit( minimumFontSize );
146
122
 
147
123
  // We get a 'preferred' unit to keep units consistent when calculating,
148
124
  // otherwise the result will not be accurate.
@@ -159,12 +135,9 @@ export function getComputedFluidTypographyValue( {
159
135
  }
160
136
 
161
137
  // Uses rem for accessible fluid target font scaling.
162
- const minimumFontSizeRem = getTypographyValueAndUnit(
163
- minimumFontSizeValue,
164
- {
165
- coerceTo: 'rem',
166
- }
167
- );
138
+ const minimumFontSizeRem = getTypographyValueAndUnit( minimumFontSize, {
139
+ coerceTo: 'rem',
140
+ } );
168
141
 
169
142
  // Viewport widths defined for fluid typography. Normalize units
170
143
  const maximumViewPortWidthParsed = getTypographyValueAndUnit(
@@ -205,7 +178,7 @@ export function getComputedFluidTypographyValue( {
205
178
  );
206
179
  const fluidTargetFontSize = `${ minimumFontSizeRem.value }${ minimumFontSizeRem.unit } + ((1vw - ${ viewPortWidthOffset }) * ${ linearFactorScaled })`;
207
180
 
208
- return `clamp(${ minimumFontSizeValue }, ${ fluidTargetFontSize }, ${ maximumFontSize })`;
181
+ return `clamp(${ minimumFontSize }, ${ fluidTargetFontSize }, ${ maximumFontSize })`;
209
182
  }
210
183
 
211
184
  /**
@@ -33,7 +33,7 @@ describe( 'getComputedFluidTypographyValue()', () => {
33
33
  fontSize: '30px',
34
34
  } );
35
35
  expect( fluidTypographyValues ).toBe(
36
- 'clamp(22.5px, 1.406rem + ((1vw - 7.68px) * 2.704), 45px)'
36
+ 'clamp(22.5px, 1.406rem + ((1vw - 7.68px) * 0.901), 30px)'
37
37
  );
38
38
  } );
39
39
 
@@ -42,7 +42,7 @@ describe( 'getComputedFluidTypographyValue()', () => {
42
42
  fontSize: '30px',
43
43
  } );
44
44
  expect( fluidTypographyValues ).toBe(
45
- 'clamp(22.5px, 1.406rem + ((1vw - 7.68px) * 2.704), 45px)'
45
+ 'clamp(22.5px, 1.406rem + ((1vw - 7.68px) * 0.901), 30px)'
46
46
  );
47
47
  } );
48
48
 
@@ -53,7 +53,7 @@ describe( 'getComputedFluidTypographyValue()', () => {
53
53
  maximumViewPortWidth: '1000px',
54
54
  } );
55
55
  expect( fluidTypographyValues ).toBe(
56
- 'clamp(22.5px, 1.406rem + ((1vw - 5px) * 4.5), 45px)'
56
+ 'clamp(22.5px, 1.406rem + ((1vw - 5px) * 1.5), 30px)'
57
57
  );
58
58
  } );
59
59
 
@@ -63,7 +63,7 @@ describe( 'getComputedFluidTypographyValue()', () => {
63
63
  scaleFactor: '2',
64
64
  } );
65
65
  expect( fluidTypographyValues ).toBe(
66
- 'clamp(22.5px, 1.406rem + ((1vw - 7.68px) * 5.409), 45px)'
66
+ 'clamp(22.5px, 1.406rem + ((1vw - 7.68px) * 1.803), 30px)'
67
67
  );
68
68
  } );
69
69
 
@@ -74,7 +74,7 @@ describe( 'getComputedFluidTypographyValue()', () => {
74
74
  maximumFontSizeFactor: '2',
75
75
  } );
76
76
  expect( fluidTypographyValues ).toBe(
77
- 'clamp(15px, 0.938rem + ((1vw - 7.68px) * 5.409), 60px)'
77
+ 'clamp(15px, 0.938rem + ((1vw - 7.68px) * 1.803), 30px)'
78
78
  );
79
79
  } );
80
80
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { find, pickBy, reduce } from 'lodash';
4
+ import { find, pickBy } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -43,8 +43,7 @@ export default ( ...fontSizeNames ) => {
43
43
  * and the value is the custom font size attribute name.
44
44
  * Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized.
45
45
  */
46
- const fontSizeAttributeNames = reduce(
47
- fontSizeNames,
46
+ const fontSizeAttributeNames = fontSizeNames.reduce(
48
47
  ( fontSizeAttributeNamesAccumulator, fontSizeAttributeName ) => {
49
48
  fontSizeAttributeNamesAccumulator[
50
49
  fontSizeAttributeName
@@ -81,12 +80,13 @@ export default ( ...fontSizeNames ) => {
81
80
  }
82
81
 
83
82
  createSetters() {
84
- return reduce(
85
- fontSizeAttributeNames,
83
+ return Object.entries( fontSizeAttributeNames ).reduce(
86
84
  (
87
85
  settersAccumulator,
88
- customFontSizeAttributeName,
89
- fontSizeAttributeName
86
+ [
87
+ fontSizeAttributeName,
88
+ customFontSizeAttributeName,
89
+ ]
90
90
  ) => {
91
91
  const upperFirstFontSizeAttributeName =
92
92
  upperFirst( fontSizeAttributeName );
@@ -159,15 +159,18 @@ export default ( ...fontSizeNames ) => {
159
159
  return null;
160
160
  }
161
161
 
162
- const newState = reduce(
162
+ const newState = Object.entries(
163
163
  pickBy(
164
164
  fontSizeAttributeNames,
165
165
  didAttributesChange
166
- ),
166
+ )
167
+ ).reduce(
167
168
  (
168
169
  newStateAccumulator,
169
- customFontSizeAttributeName,
170
- fontSizeAttributeName
170
+ [
171
+ fontSizeAttributeName,
172
+ customFontSizeAttributeName,
173
+ ]
171
174
  ) => {
172
175
  const fontSizeAttributeValue =
173
176
  attributes[ fontSizeAttributeName ];