@wordpress/block-editor 13.2.0 → 13.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (367) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +0 -1
  3. package/build/components/block-breadcrumb/index.js +12 -1
  4. package/build/components/block-breadcrumb/index.js.map +1 -1
  5. package/build/components/block-lock/toolbar.js +0 -1
  6. package/build/components/block-lock/toolbar.js.map +1 -1
  7. package/build/components/block-mover/button.js +1 -1
  8. package/build/components/block-mover/button.js.map +1 -1
  9. package/build/components/block-mover/index.js +1 -1
  10. package/build/components/block-mover/index.js.map +1 -1
  11. package/build/components/block-pattern-setup/setup-toolbar.js +2 -2
  12. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  13. package/build/components/block-patterns-paging/index.js +5 -7
  14. package/build/components/block-patterns-paging/index.js.map +1 -1
  15. package/build/components/block-quick-navigation/index.js +20 -17
  16. package/build/components/block-quick-navigation/index.js.map +1 -1
  17. package/build/components/block-rename/modal.js +4 -12
  18. package/build/components/block-rename/modal.js.map +1 -1
  19. package/build/components/block-toolbar/shuffle.js +1 -0
  20. package/build/components/block-toolbar/shuffle.js.map +1 -1
  21. package/build/components/block-tools/block-selection-button.js +7 -58
  22. package/build/components/block-tools/block-selection-button.js.map +1 -1
  23. package/build/components/block-tools/block-toolbar-breadcrumb.js +9 -2
  24. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  25. package/build/components/block-tools/index.js +14 -1
  26. package/build/components/block-tools/index.js.map +1 -1
  27. package/build/components/block-tools/use-show-block-tools.js +4 -2
  28. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  29. package/build/components/block-tools/zoom-out-mode-inserters.js +5 -4
  30. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  31. package/build/components/block-tools/zoom-out-popover.js +57 -0
  32. package/build/components/block-tools/zoom-out-popover.js.map +1 -0
  33. package/build/components/block-tools/zoom-out-toolbar.js +138 -0
  34. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -0
  35. package/build/components/button-block-appender/index.js +3 -1
  36. package/build/components/button-block-appender/index.js.map +1 -1
  37. package/build/components/child-layout-control/index.js +26 -18
  38. package/build/components/child-layout-control/index.js.map +1 -1
  39. package/build/components/date-format-picker/index.js +10 -1
  40. package/build/components/date-format-picker/index.js.map +1 -1
  41. package/build/components/dimensions-tool/index.js +6 -4
  42. package/build/components/dimensions-tool/index.js.map +1 -1
  43. package/build/components/font-appearance-control/index.js +26 -61
  44. package/build/components/font-appearance-control/index.js.map +1 -1
  45. package/build/components/global-styles/background-panel.js +178 -116
  46. package/build/components/global-styles/background-panel.js.map +1 -1
  47. package/build/components/global-styles/border-panel.js +2 -1
  48. package/build/components/global-styles/border-panel.js.map +1 -1
  49. package/build/components/global-styles/color-panel.js +2 -1
  50. package/build/components/global-styles/color-panel.js.map +1 -1
  51. package/build/components/global-styles/dimensions-panel.js +2 -1
  52. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  53. package/build/components/global-styles/filters-panel.js +2 -1
  54. package/build/components/global-styles/filters-panel.js.map +1 -1
  55. package/build/components/global-styles/hooks.js +8 -0
  56. package/build/components/global-styles/hooks.js.map +1 -1
  57. package/build/components/global-styles/image-settings-panel.js +2 -1
  58. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  59. package/build/components/global-styles/typography-panel.js +50 -12
  60. package/build/components/global-styles/typography-panel.js.map +1 -1
  61. package/build/components/global-styles/typography-utils.js +50 -0
  62. package/build/components/global-styles/typography-utils.js.map +1 -1
  63. package/build/components/global-styles/use-global-styles-output.js +23 -8
  64. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  65. package/build/components/global-styles/utils.js +17 -7
  66. package/build/components/global-styles/utils.js.map +1 -1
  67. package/build/components/grid/grid-item-movers.js +11 -14
  68. package/build/components/grid/grid-item-movers.js.map +1 -1
  69. package/build/components/grid/grid-item-resizer.js +2 -2
  70. package/build/components/grid/grid-item-resizer.js.map +1 -1
  71. package/build/components/grid/grid-visualizer.js +116 -36
  72. package/build/components/grid/grid-visualizer.js.map +1 -1
  73. package/build/components/grid/use-grid-layout-sync.js +29 -22
  74. package/build/components/grid/use-grid-layout-sync.js.map +1 -1
  75. package/build/components/inner-blocks/index.js +1 -1
  76. package/build/components/inner-blocks/index.js.map +1 -1
  77. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
  78. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  79. package/build/components/inserter/menu.js +26 -4
  80. package/build/components/inserter/menu.js.map +1 -1
  81. package/build/components/inserter/quick-inserter.js +2 -1
  82. package/build/components/inserter/quick-inserter.js.map +1 -1
  83. package/build/components/inspector-controls/block-support-tools-panel.js +2 -1
  84. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  85. package/build/components/link-control/link-preview.js +1 -1
  86. package/build/components/link-control/link-preview.js.map +1 -1
  87. package/build/components/media-placeholder/index.js +19 -23
  88. package/build/components/media-placeholder/index.js.map +1 -1
  89. package/build/components/navigable-toolbar/index.js +3 -1
  90. package/build/components/navigable-toolbar/index.js.map +1 -1
  91. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
  92. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  93. package/build/components/tabbed-sidebar/index.js +66 -0
  94. package/build/components/tabbed-sidebar/index.js.map +1 -0
  95. package/build/components/url-popover/index.js +3 -0
  96. package/build/components/url-popover/index.js.map +1 -1
  97. package/build/hooks/background.js +26 -4
  98. package/build/hooks/background.js.map +1 -1
  99. package/build/hooks/block-hooks.js +11 -17
  100. package/build/hooks/block-hooks.js.map +1 -1
  101. package/build/hooks/block-style-variation.js +169 -4
  102. package/build/hooks/block-style-variation.js.map +1 -1
  103. package/build/hooks/duotone.js +16 -11
  104. package/build/hooks/duotone.js.map +1 -1
  105. package/build/hooks/grid-visualizer.js +65 -0
  106. package/build/hooks/grid-visualizer.js.map +1 -0
  107. package/build/hooks/index.js +15 -2
  108. package/build/hooks/index.js.map +1 -1
  109. package/build/hooks/layout-child.js +39 -22
  110. package/build/hooks/layout-child.js.map +1 -1
  111. package/build/hooks/position.js +2 -9
  112. package/build/hooks/position.js.map +1 -1
  113. package/build/hooks/use-bindings-attributes.js +16 -6
  114. package/build/hooks/use-bindings-attributes.js.map +1 -1
  115. package/build/hooks/utils.js +2 -0
  116. package/build/hooks/utils.js.map +1 -1
  117. package/build/layouts/constrained.js +44 -2
  118. package/build/layouts/constrained.js.map +1 -1
  119. package/build/layouts/grid.js +90 -51
  120. package/build/layouts/grid.js.map +1 -1
  121. package/build/private-apis.js +6 -1
  122. package/build/private-apis.js.map +1 -1
  123. package/build/store/defaults.js +0 -2
  124. package/build/store/defaults.js.map +1 -1
  125. package/build/store/defaults.native.js +0 -3
  126. package/build/store/defaults.native.js.map +1 -1
  127. package/build/store/private-keys.js +2 -1
  128. package/build/store/private-keys.js.map +1 -1
  129. package/build/utils/format-font-style.js +45 -0
  130. package/build/utils/format-font-style.js.map +1 -0
  131. package/build/utils/format-font-weight.js +68 -0
  132. package/build/utils/format-font-weight.js.map +1 -0
  133. package/build/utils/get-editor-region.js +34 -0
  134. package/build/utils/get-editor-region.js.map +1 -0
  135. package/build/utils/get-font-styles-and-weights.js +167 -0
  136. package/build/utils/get-font-styles-and-weights.js.map +1 -0
  137. package/build/utils/pasting.js +5 -13
  138. package/build/utils/pasting.js.map +1 -1
  139. package/build-module/components/block-breadcrumb/index.js +12 -1
  140. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  141. package/build-module/components/block-lock/toolbar.js +0 -1
  142. package/build-module/components/block-lock/toolbar.js.map +1 -1
  143. package/build-module/components/block-mover/button.js +1 -1
  144. package/build-module/components/block-mover/button.js.map +1 -1
  145. package/build-module/components/block-mover/index.js +1 -1
  146. package/build-module/components/block-mover/index.js.map +1 -1
  147. package/build-module/components/block-pattern-setup/setup-toolbar.js +2 -2
  148. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  149. package/build-module/components/block-patterns-paging/index.js +5 -7
  150. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  151. package/build-module/components/block-quick-navigation/index.js +20 -17
  152. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  153. package/build-module/components/block-rename/modal.js +5 -13
  154. package/build-module/components/block-rename/modal.js.map +1 -1
  155. package/build-module/components/block-toolbar/shuffle.js +1 -0
  156. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  157. package/build-module/components/block-tools/block-selection-button.js +10 -61
  158. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  159. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +9 -2
  160. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  161. package/build-module/components/block-tools/index.js +14 -1
  162. package/build-module/components/block-tools/index.js.map +1 -1
  163. package/build-module/components/block-tools/use-show-block-tools.js +4 -2
  164. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  165. package/build-module/components/block-tools/zoom-out-mode-inserters.js +5 -4
  166. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  167. package/build-module/components/block-tools/zoom-out-popover.js +48 -0
  168. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -0
  169. package/build-module/components/block-tools/zoom-out-toolbar.js +131 -0
  170. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -0
  171. package/build-module/components/button-block-appender/index.js +3 -1
  172. package/build-module/components/button-block-appender/index.js.map +1 -1
  173. package/build-module/components/child-layout-control/index.js +27 -19
  174. package/build-module/components/child-layout-control/index.js.map +1 -1
  175. package/build-module/components/date-format-picker/index.js +11 -3
  176. package/build-module/components/date-format-picker/index.js.map +1 -1
  177. package/build-module/components/dimensions-tool/index.js +6 -4
  178. package/build-module/components/dimensions-tool/index.js.map +1 -1
  179. package/build-module/components/font-appearance-control/index.js +28 -63
  180. package/build-module/components/font-appearance-control/index.js.map +1 -1
  181. package/build-module/components/global-styles/background-panel.js +181 -119
  182. package/build-module/components/global-styles/background-panel.js.map +1 -1
  183. package/build-module/components/global-styles/border-panel.js +3 -2
  184. package/build-module/components/global-styles/border-panel.js.map +1 -1
  185. package/build-module/components/global-styles/color-panel.js +3 -2
  186. package/build-module/components/global-styles/color-panel.js.map +1 -1
  187. package/build-module/components/global-styles/dimensions-panel.js +3 -2
  188. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  189. package/build-module/components/global-styles/filters-panel.js +3 -2
  190. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  191. package/build-module/components/global-styles/hooks.js +8 -0
  192. package/build-module/components/global-styles/hooks.js.map +1 -1
  193. package/build-module/components/global-styles/image-settings-panel.js +3 -2
  194. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  195. package/build-module/components/global-styles/typography-panel.js +52 -14
  196. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  197. package/build-module/components/global-styles/typography-utils.js +48 -0
  198. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  199. package/build-module/components/global-styles/use-global-styles-output.js +23 -8
  200. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  201. package/build-module/components/global-styles/utils.js +15 -6
  202. package/build-module/components/global-styles/utils.js.map +1 -1
  203. package/build-module/components/grid/grid-item-movers.js +11 -14
  204. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  205. package/build-module/components/grid/grid-item-resizer.js +2 -2
  206. package/build-module/components/grid/grid-item-resizer.js.map +1 -1
  207. package/build-module/components/grid/grid-visualizer.js +117 -37
  208. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  209. package/build-module/components/grid/use-grid-layout-sync.js +29 -22
  210. package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
  211. package/build-module/components/inner-blocks/index.js +1 -1
  212. package/build-module/components/inner-blocks/index.js.map +1 -1
  213. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
  214. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  215. package/build-module/components/inserter/menu.js +26 -4
  216. package/build-module/components/inserter/menu.js.map +1 -1
  217. package/build-module/components/inserter/quick-inserter.js +2 -1
  218. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  219. package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -2
  220. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  221. package/build-module/components/link-control/link-preview.js +1 -1
  222. package/build-module/components/link-control/link-preview.js.map +1 -1
  223. package/build-module/components/media-placeholder/index.js +19 -23
  224. package/build-module/components/media-placeholder/index.js.map +1 -1
  225. package/build-module/components/navigable-toolbar/index.js +3 -1
  226. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  227. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
  228. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  229. package/build-module/components/tabbed-sidebar/index.js +60 -0
  230. package/build-module/components/tabbed-sidebar/index.js.map +1 -0
  231. package/build-module/components/url-popover/index.js +3 -0
  232. package/build-module/components/url-popover/index.js.map +1 -1
  233. package/build-module/hooks/background.js +26 -4
  234. package/build-module/hooks/background.js.map +1 -1
  235. package/build-module/hooks/block-hooks.js +11 -17
  236. package/build-module/hooks/block-hooks.js.map +1 -1
  237. package/build-module/hooks/block-style-variation.js +168 -4
  238. package/build-module/hooks/block-style-variation.js.map +1 -1
  239. package/build-module/hooks/duotone.js +16 -11
  240. package/build-module/hooks/duotone.js.map +1 -1
  241. package/build-module/hooks/grid-visualizer.js +64 -0
  242. package/build-module/hooks/grid-visualizer.js.map +1 -0
  243. package/build-module/hooks/index.js +3 -0
  244. package/build-module/hooks/index.js.map +1 -1
  245. package/build-module/hooks/layout-child.js +39 -22
  246. package/build-module/hooks/layout-child.js.map +1 -1
  247. package/build-module/hooks/position.js +2 -9
  248. package/build-module/hooks/position.js.map +1 -1
  249. package/build-module/hooks/use-bindings-attributes.js +16 -6
  250. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  251. package/build-module/hooks/utils.js +2 -0
  252. package/build-module/hooks/utils.js.map +1 -1
  253. package/build-module/layouts/constrained.js +44 -2
  254. package/build-module/layouts/constrained.js.map +1 -1
  255. package/build-module/layouts/grid.js +90 -51
  256. package/build-module/layouts/grid.js.map +1 -1
  257. package/build-module/private-apis.js +8 -3
  258. package/build-module/private-apis.js.map +1 -1
  259. package/build-module/store/defaults.js +0 -2
  260. package/build-module/store/defaults.js.map +1 -1
  261. package/build-module/store/defaults.native.js +0 -3
  262. package/build-module/store/defaults.native.js.map +1 -1
  263. package/build-module/store/private-keys.js +1 -0
  264. package/build-module/store/private-keys.js.map +1 -1
  265. package/build-module/utils/format-font-style.js +39 -0
  266. package/build-module/utils/format-font-style.js.map +1 -0
  267. package/build-module/utils/format-font-weight.js +62 -0
  268. package/build-module/utils/format-font-weight.js.map +1 -0
  269. package/build-module/utils/get-editor-region.js +28 -0
  270. package/build-module/utils/get-editor-region.js.map +1 -0
  271. package/build-module/utils/get-font-styles-and-weights.js +160 -0
  272. package/build-module/utils/get-font-styles-and-weights.js.map +1 -0
  273. package/build-module/utils/pasting.js +5 -13
  274. package/build-module/utils/pasting.js.map +1 -1
  275. package/build-style/content-rtl.css +1 -0
  276. package/build-style/content.css +1 -0
  277. package/build-style/style-rtl.css +207 -96
  278. package/build-style/style.css +207 -96
  279. package/package.json +32 -32
  280. package/src/components/block-breadcrumb/index.js +16 -1
  281. package/src/components/block-lock/toolbar.js +0 -1
  282. package/src/components/block-mover/button.js +1 -1
  283. package/src/components/block-mover/index.js +1 -1
  284. package/src/components/block-pattern-setup/setup-toolbar.js +2 -2
  285. package/src/components/block-patterns-paging/index.js +8 -11
  286. package/src/components/block-patterns-paging/style.scss +18 -0
  287. package/src/components/block-quick-navigation/index.js +21 -28
  288. package/src/components/block-rename/modal.js +2 -8
  289. package/src/components/block-switcher/test/index.js +6 -6
  290. package/src/components/block-toolbar/shuffle.js +1 -0
  291. package/src/components/block-toolbar/style.scss +1 -11
  292. package/src/components/block-tools/block-selection-button.js +11 -83
  293. package/src/components/block-tools/block-toolbar-breadcrumb.js +9 -4
  294. package/src/components/block-tools/index.js +21 -1
  295. package/src/components/block-tools/style.scss +15 -0
  296. package/src/components/block-tools/use-show-block-tools.js +14 -6
  297. package/src/components/block-tools/zoom-out-mode-inserters.js +5 -4
  298. package/src/components/block-tools/zoom-out-popover.js +49 -0
  299. package/src/components/block-tools/zoom-out-toolbar.js +140 -0
  300. package/src/components/button-block-appender/index.js +2 -1
  301. package/src/components/child-layout-control/index.js +41 -23
  302. package/src/components/date-format-picker/index.js +10 -1
  303. package/src/components/date-format-picker/style.scss +0 -9
  304. package/src/components/dimensions-tool/index.js +97 -89
  305. package/src/components/font-appearance-control/index.js +29 -83
  306. package/src/components/font-appearance-control/style.scss +3 -5
  307. package/src/components/global-styles/background-panel.js +249 -170
  308. package/src/components/global-styles/border-panel.js +3 -2
  309. package/src/components/global-styles/color-panel.js +3 -2
  310. package/src/components/global-styles/dimensions-panel.js +3 -2
  311. package/src/components/global-styles/filters-panel.js +3 -2
  312. package/src/components/global-styles/hooks.js +9 -0
  313. package/src/components/global-styles/image-settings-panel.js +3 -2
  314. package/src/components/global-styles/style.scss +105 -20
  315. package/src/components/global-styles/test/typography-utils.js +269 -0
  316. package/src/components/global-styles/typography-panel.js +49 -12
  317. package/src/components/global-styles/typography-utils.js +63 -0
  318. package/src/components/global-styles/use-global-styles-output.js +23 -8
  319. package/src/components/global-styles/utils.js +17 -6
  320. package/src/components/grid/grid-item-movers.js +11 -27
  321. package/src/components/grid/grid-item-resizer.js +3 -2
  322. package/src/components/grid/grid-visualizer.js +171 -54
  323. package/src/components/grid/style.scss +43 -8
  324. package/src/components/grid/use-grid-layout-sync.js +31 -28
  325. package/src/components/iframe/content.scss +1 -0
  326. package/src/components/inner-blocks/index.js +2 -1
  327. package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -16
  328. package/src/components/inserter/menu.js +47 -13
  329. package/src/components/inserter/quick-inserter.js +6 -1
  330. package/src/components/inserter/style.scss +1 -49
  331. package/src/components/inspector-controls/block-support-tools-panel.js +3 -3
  332. package/src/components/link-control/link-preview.js +1 -1
  333. package/src/components/media-placeholder/index.js +22 -32
  334. package/src/components/navigable-toolbar/index.js +3 -1
  335. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +6 -1
  336. package/src/components/tabbed-sidebar/README.md +76 -0
  337. package/src/components/tabbed-sidebar/index.js +70 -0
  338. package/src/components/tabbed-sidebar/style.scss +53 -0
  339. package/src/components/url-popover/index.js +3 -0
  340. package/src/hooks/background.js +25 -10
  341. package/src/hooks/block-hooks.js +9 -16
  342. package/src/hooks/block-style-variation.js +202 -3
  343. package/src/hooks/duotone.js +16 -12
  344. package/src/hooks/grid-visualizer.js +64 -0
  345. package/src/hooks/index.js +3 -0
  346. package/src/hooks/layout-child.js +53 -37
  347. package/src/hooks/position.js +3 -10
  348. package/src/hooks/test/get-variation-styles-with-ref-values.js +91 -0
  349. package/src/hooks/use-bindings-attributes.js +18 -4
  350. package/src/hooks/utils.js +2 -0
  351. package/src/layouts/constrained.js +43 -2
  352. package/src/layouts/grid.js +146 -51
  353. package/src/private-apis.js +12 -1
  354. package/src/store/defaults.js +0 -2
  355. package/src/store/defaults.native.js +0 -3
  356. package/src/store/private-keys.js +1 -0
  357. package/src/style.scss +1 -1
  358. package/src/utils/format-font-style.js +40 -0
  359. package/src/utils/format-font-weight.js +63 -0
  360. package/src/utils/get-editor-region.js +31 -0
  361. package/src/utils/get-font-styles-and-weights.js +191 -0
  362. package/src/utils/pasting.js +5 -12
  363. package/src/utils/test/format-font-style.js +34 -0
  364. package/src/utils/test/format-font-weight.js +66 -0
  365. package/src/utils/test/get-font-styles-and-weights.js +513 -0
  366. package/tsconfig.tsbuildinfo +1 -1
  367. package/src/hooks/position.scss +0 -18
@@ -22,11 +22,19 @@ import {
22
22
  __experimentalItemGroup as ItemGroup,
23
23
  __experimentalHStack as HStack,
24
24
  __experimentalTruncate as Truncate,
25
+ Dropdown,
26
+ __experimentalDropdownContentWrapper as DropdownContentWrapper,
25
27
  } from '@wordpress/components';
26
28
  import { __, _x, sprintf } from '@wordpress/i18n';
27
29
  import { store as noticesStore } from '@wordpress/notices';
28
30
  import { getFilename } from '@wordpress/url';
29
- import { useCallback, Platform, useRef } from '@wordpress/element';
31
+ import {
32
+ useCallback,
33
+ Platform,
34
+ useRef,
35
+ useState,
36
+ useEffect,
37
+ } from '@wordpress/element';
30
38
  import { useDispatch, useSelect } from '@wordpress/data';
31
39
  import { focus } from '@wordpress/dom';
32
40
  import { isBlobURL } from '@wordpress/blob';
@@ -34,7 +42,7 @@ import { isBlobURL } from '@wordpress/blob';
34
42
  /**
35
43
  * Internal dependencies
36
44
  */
37
- import { TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
45
+ import { useToolsPanelDropdownMenuProps } from './utils';
38
46
  import { setImmutably } from '../../utils/object';
39
47
  import MediaReplaceFlow from '../media-replace-flow';
40
48
  import { store as blockEditorStore } from '../../store';
@@ -43,8 +51,14 @@ import { getResolvedThemeFilePath } from './theme-file-uri-utils';
43
51
  const IMAGE_BACKGROUND_TYPE = 'image';
44
52
  const DEFAULT_CONTROLS = {
45
53
  backgroundImage: true,
46
- backgroundSize: false,
47
54
  };
55
+ const BACKGROUND_POPOVER_PROPS = {
56
+ placement: 'left-start',
57
+ offset: 36,
58
+ shift: true,
59
+ className: 'block-editor-global-styles-background-panel__popover',
60
+ };
61
+ const noop = () => {};
48
62
 
49
63
  /**
50
64
  * Checks site settings to see if the background panel may be used.
@@ -141,21 +155,30 @@ export const backgroundPositionToCoords = ( value ) => {
141
155
  return { x, y };
142
156
  };
143
157
 
144
- function InspectorImagePreview( { label, filename, url: imgUrl } ) {
145
- const imgLabel =
146
- label || getFilename( imgUrl ) || __( 'Add background image' );
147
-
158
+ function InspectorImagePreviewItem( {
159
+ as = 'span',
160
+ imgUrl,
161
+ toggleProps = {},
162
+ filename,
163
+ label,
164
+ className,
165
+ onToggleCallback = noop,
166
+ } ) {
167
+ useEffect( () => {
168
+ if ( typeof toggleProps?.isOpen !== 'undefined' ) {
169
+ onToggleCallback( toggleProps?.isOpen );
170
+ }
171
+ }, [ toggleProps?.isOpen, onToggleCallback ] );
148
172
  return (
149
- <ItemGroup as="span">
150
- <HStack justify={ imgUrl ? 'flex-start' : 'center' } as="span">
173
+ <ItemGroup as={ as } className={ className } { ...toggleProps }>
174
+ <HStack
175
+ justify="flex-start"
176
+ as="span"
177
+ className="block-editor-global-styles-background-panel__inspector-preview-inner"
178
+ >
151
179
  { imgUrl && (
152
180
  <span
153
- className={ clsx(
154
- 'block-editor-global-styles-background-panel__inspector-image-indicator-wrapper',
155
- {
156
- 'has-image': imgUrl,
157
- }
158
- ) }
181
+ className="block-editor-global-styles-background-panel__inspector-image-indicator-wrapper"
159
182
  aria-hidden
160
183
  >
161
184
  <span
@@ -166,19 +189,19 @@ function InspectorImagePreview( { label, filename, url: imgUrl } ) {
166
189
  />
167
190
  </span>
168
191
  ) }
169
- <FlexItem as="span">
192
+ <FlexItem as="span" style={ imgUrl ? {} : { flexGrow: 1 } }>
170
193
  <Truncate
171
194
  numberOfLines={ 1 }
172
195
  className="block-editor-global-styles-background-panel__inspector-media-replace-title"
173
196
  >
174
- { imgLabel }
197
+ { label }
175
198
  </Truncate>
176
199
  <VisuallyHidden as="span">
177
200
  { imgUrl
178
201
  ? sprintf(
179
202
  /* translators: %s: file name */
180
203
  __( 'Background image: %s' ),
181
- filename || imgLabel
204
+ filename || label
182
205
  )
183
206
  : __( 'No background image selected' ) }
184
207
  </VisuallyHidden>
@@ -188,12 +211,64 @@ function InspectorImagePreview( { label, filename, url: imgUrl } ) {
188
211
  );
189
212
  }
190
213
 
191
- function BackgroundImageToolsPanelItem( {
192
- panelId,
193
- isShownByDefault,
214
+ function BackgroundControlsPanel( {
215
+ label,
216
+ filename,
217
+ url: imgUrl,
218
+ children,
219
+ onToggle: onToggleCallback = noop,
220
+ hasImageValue,
221
+ } ) {
222
+ if ( ! hasImageValue ) {
223
+ return;
224
+ }
225
+
226
+ const imgLabel =
227
+ label || getFilename( imgUrl ) || __( 'Add background image' );
228
+
229
+ return (
230
+ <Dropdown
231
+ popoverProps={ BACKGROUND_POPOVER_PROPS }
232
+ renderToggle={ ( { onToggle, isOpen } ) => {
233
+ const toggleProps = {
234
+ onClick: onToggle,
235
+ className:
236
+ 'block-editor-global-styles-background-panel__dropdown-toggle',
237
+ 'aria-expanded': isOpen,
238
+ 'aria-label': __(
239
+ 'Background size, position and repeat options.'
240
+ ),
241
+ isOpen,
242
+ };
243
+ return (
244
+ <InspectorImagePreviewItem
245
+ imgUrl={ imgUrl }
246
+ filename={ filename }
247
+ label={ imgLabel }
248
+ toggleProps={ toggleProps }
249
+ as="button"
250
+ onToggleCallback={ onToggleCallback }
251
+ />
252
+ );
253
+ } }
254
+ renderContent={ () => (
255
+ <DropdownContentWrapper
256
+ className="block-editor-global-styles-background-panel__dropdown-content-wrapper"
257
+ paddingSize="medium"
258
+ >
259
+ { children }
260
+ </DropdownContentWrapper>
261
+ ) }
262
+ />
263
+ );
264
+ }
265
+
266
+ function BackgroundImageControls( {
194
267
  onChange,
195
268
  style,
196
269
  inheritedValue,
270
+ onRemoveImage = noop,
271
+ displayInPanel,
197
272
  themeFileURIs,
198
273
  } ) {
199
274
  const mediaUpload = useSelect(
@@ -204,9 +279,7 @@ function BackgroundImageToolsPanelItem( {
204
279
  const { id, title, url } = style?.background?.backgroundImage || {
205
280
  ...inheritedValue?.background?.backgroundImage,
206
281
  };
207
-
208
282
  const replaceContainerRef = useRef();
209
-
210
283
  const { createErrorNotice } = useDispatch( noticesStore );
211
284
  const onUploadError = ( message ) => {
212
285
  createErrorNotice( message, { type: 'snackbar' } );
@@ -279,16 +352,6 @@ function BackgroundImageToolsPanelItem( {
279
352
  } );
280
353
  };
281
354
 
282
- const resetAllFilter = useCallback( ( previousValue ) => {
283
- return {
284
- ...previousValue,
285
- style: {
286
- ...previousValue.style,
287
- background: undefined,
288
- },
289
- };
290
- }, [] );
291
-
292
355
  const hasValue = hasBackgroundImageValue( style );
293
356
 
294
357
  const closeAndFocus = () => {
@@ -307,72 +370,69 @@ function BackgroundImageToolsPanelItem( {
307
370
  setImmutably( style, [ 'background', 'backgroundImage' ], 'none' )
308
371
  );
309
372
  const canRemove = ! hasValue && hasBackgroundImageValue( inheritedValue );
373
+ const imgLabel =
374
+ title || getFilename( url ) || __( 'Add background image' );
310
375
 
311
376
  return (
312
- <ToolsPanelItem
313
- className="single-column"
314
- hasValue={ () => hasValue }
315
- label={ __( 'Background image' ) }
316
- onDeselect={ resetBackgroundImage }
317
- isShownByDefault={ isShownByDefault }
318
- resetAllFilter={ resetAllFilter }
319
- panelId={ panelId }
377
+ <div
378
+ ref={ replaceContainerRef }
379
+ className="block-editor-global-styles-background-panel__image-tools-panel-item"
320
380
  >
321
- <div
322
- className="block-editor-global-styles-background-panel__inspector-media-replace-container"
323
- ref={ replaceContainerRef }
381
+ <MediaReplaceFlow
382
+ mediaId={ id }
383
+ mediaURL={ url }
384
+ allowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }
385
+ accept="image/*"
386
+ onSelect={ onSelectMedia }
387
+ popoverProps={ {
388
+ className: clsx( {
389
+ 'block-editor-global-styles-background-panel__media-replace-popover':
390
+ displayInPanel,
391
+ } ),
392
+ } }
393
+ name={
394
+ <InspectorImagePreviewItem
395
+ className="block-editor-global-styles-background-panel__image-preview"
396
+ imgUrl={ getResolvedThemeFilePath(
397
+ url,
398
+ themeFileURIs
399
+ ) }
400
+ filename={ title }
401
+ label={ imgLabel }
402
+ />
403
+ }
404
+ variant="secondary"
324
405
  >
325
- <MediaReplaceFlow
326
- mediaId={ id }
327
- mediaURL={ url }
328
- allowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }
329
- accept="image/*"
330
- onSelect={ onSelectMedia }
331
- name={
332
- <InspectorImagePreview
333
- label={ title }
334
- filename={ title }
335
- url={ getResolvedThemeFilePath(
336
- url,
337
- themeFileURIs
338
- ) }
339
- />
340
- }
341
- variant="secondary"
342
- >
343
- { canRemove && (
344
- <MenuItem
345
- onClick={ () => {
346
- closeAndFocus();
347
- onRemove();
348
- } }
349
- >
350
- { __( 'Remove' ) }
351
- </MenuItem>
352
- ) }
353
- { hasValue && (
354
- <MenuItem
355
- onClick={ () => {
356
- closeAndFocus();
357
- resetBackgroundImage();
358
- } }
359
- >
360
- { __( 'Reset ' ) }
361
- </MenuItem>
362
- ) }
363
- </MediaReplaceFlow>
364
- <DropZone
365
- onFilesDrop={ onFilesDrop }
366
- label={ __( 'Drop to upload' ) }
367
- />
368
- </div>
369
- </ToolsPanelItem>
406
+ { canRemove && (
407
+ <MenuItem
408
+ onClick={ () => {
409
+ closeAndFocus();
410
+ onRemove();
411
+ } }
412
+ >
413
+ { __( 'Remove' ) }
414
+ </MenuItem>
415
+ ) }
416
+ { hasValue && (
417
+ <MenuItem
418
+ onClick={ () => {
419
+ closeAndFocus();
420
+ onRemoveImage();
421
+ } }
422
+ >
423
+ { __( 'Reset ' ) }
424
+ </MenuItem>
425
+ ) }
426
+ </MediaReplaceFlow>
427
+ <DropZone
428
+ onFilesDrop={ onFilesDrop }
429
+ label={ __( 'Drop to upload' ) }
430
+ />
431
+ </div>
370
432
  );
371
433
  }
372
434
 
373
- function BackgroundSizeToolsPanelItem( {
374
- panelId,
375
- isShownByDefault,
435
+ function BackgroundSizeControls( {
376
436
  onChange,
377
437
  style,
378
438
  inheritedValue,
@@ -417,22 +477,6 @@ function BackgroundSizeToolsPanelItem( {
417
477
  ( currentValueForToggle === 'cover' && repeatValue === undefined )
418
478
  );
419
479
 
420
- const hasValue = hasBackgroundSizeValue( style );
421
-
422
- const resetAllFilter = useCallback( ( previousValue ) => {
423
- return {
424
- ...previousValue,
425
- style: {
426
- ...previousValue.style,
427
- background: {
428
- ...previousValue.style?.background,
429
- backgroundRepeat: undefined,
430
- backgroundSize: undefined,
431
- },
432
- },
433
- };
434
- }, [] );
435
-
436
480
  const updateBackgroundSize = ( next ) => {
437
481
  // When switching to 'contain' toggle the repeat off.
438
482
  let nextRepeat = repeatValue;
@@ -502,31 +546,12 @@ function BackgroundSizeToolsPanelItem( {
502
546
  )
503
547
  );
504
548
 
505
- const resetBackgroundSize = () =>
506
- onChange(
507
- setImmutably( style, [ 'background' ], {
508
- ...style?.background,
509
- backgroundPosition: undefined,
510
- backgroundRepeat: undefined,
511
- backgroundSize: undefined,
512
- } )
513
- );
514
-
515
549
  return (
516
- <VStack
517
- as={ ToolsPanelItem }
518
- spacing={ 2 }
519
- className="single-column"
520
- hasValue={ () => hasValue }
521
- label={ __( 'Size' ) }
522
- onDeselect={ resetBackgroundSize }
523
- isShownByDefault={ isShownByDefault }
524
- resetAllFilter={ resetAllFilter }
525
- panelId={ panelId }
526
- >
550
+ <VStack spacing={ 3 } className="single-column">
527
551
  <FocalPointPicker
528
552
  __next40pxDefaultSize
529
- label={ __( 'Position' ) }
553
+ __nextHasNoMarginBottom
554
+ label={ __( 'Focal point' ) }
530
555
  url={ getResolvedThemeFilePath( imageValue, themeFileURIs ) }
531
556
  value={ backgroundPositionToCoords( positionValue ) }
532
557
  onChange={ updateBackgroundPosition }
@@ -567,26 +592,25 @@ function BackgroundSizeToolsPanelItem( {
567
592
  />
568
593
  </ToggleGroupControl>
569
594
  <HStack justify="flex-start" spacing={ 2 } as="span">
570
- { currentValueForToggle !== undefined &&
571
- currentValueForToggle !== 'cover' &&
572
- currentValueForToggle !== 'contain' ? (
573
- <UnitControl
574
- aria-label={ __( 'Background image width' ) }
575
- onChange={ updateBackgroundSize }
576
- value={ sizeValue }
577
- size="__unstable-large"
578
- __unstableInputWidth="100px"
579
- min={ 0 }
580
- placeholder={ __( 'Auto' ) }
581
- />
582
- ) : null }
583
- { currentValueForToggle !== 'cover' && (
584
- <ToggleControl
585
- label={ __( 'Repeat' ) }
586
- checked={ repeatCheckedValue }
587
- onChange={ toggleIsRepeated }
588
- />
589
- ) }
595
+ <UnitControl
596
+ aria-label={ __( 'Background image width' ) }
597
+ onChange={ updateBackgroundSize }
598
+ value={ sizeValue }
599
+ size="__unstable-large"
600
+ __unstableInputWidth="100px"
601
+ min={ 0 }
602
+ placeholder={ __( 'Auto' ) }
603
+ disabled={
604
+ currentValueForToggle !== 'auto' ||
605
+ currentValueForToggle === undefined
606
+ }
607
+ />
608
+ <ToggleControl
609
+ label={ __( 'Repeat' ) }
610
+ checked={ repeatCheckedValue }
611
+ onChange={ toggleIsRepeated }
612
+ disabled={ currentValueForToggle === 'cover' }
613
+ />
590
614
  </HStack>
591
615
  </VStack>
592
616
  );
@@ -600,6 +624,7 @@ function BackgroundToolsPanel( {
600
624
  children,
601
625
  headerLabel,
602
626
  } ) {
627
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
603
628
  const resetAll = () => {
604
629
  const updatedValue = resetAllFilter( value );
605
630
  onChange( updatedValue );
@@ -612,7 +637,7 @@ function BackgroundToolsPanel( {
612
637
  label={ headerLabel }
613
638
  resetAll={ resetAll }
614
639
  panelId={ panelId }
615
- dropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }
640
+ dropdownMenuProps={ dropdownMenuProps }
616
641
  >
617
642
  { children }
618
643
  </VStack>
@@ -637,8 +662,24 @@ export default function BackgroundPanel( {
637
662
  background: {},
638
663
  };
639
664
  }, [] );
640
- const shouldShowBackgroundSizeControls =
641
- settings?.background?.backgroundSize;
665
+
666
+ const resetBackground = () =>
667
+ onChange( setImmutably( value, [ 'background' ], {} ) );
668
+
669
+ const { title, url } = value?.background?.backgroundImage || {
670
+ ...inheritedValue?.background?.backgroundImage,
671
+ };
672
+ const hasImageValue =
673
+ hasBackgroundImageValue( value ) ||
674
+ hasBackgroundImageValue( inheritedValue );
675
+
676
+ const shouldShowBackgroundImageControls =
677
+ hasImageValue &&
678
+ ( settings?.background?.backgroundSize ||
679
+ settings?.background?.backgroundPosition ||
680
+ settings?.background?.backgroundRepeat );
681
+
682
+ const [ isDropDownOpen, setIsDropDownOpen ] = useState( false );
642
683
 
643
684
  return (
644
685
  <Wrapper
@@ -648,25 +689,63 @@ export default function BackgroundPanel( {
648
689
  panelId={ panelId }
649
690
  headerLabel={ headerLabel }
650
691
  >
651
- <BackgroundImageToolsPanelItem
652
- onChange={ onChange }
653
- panelId={ panelId }
692
+ <div
693
+ className={ clsx(
694
+ 'block-editor-global-styles-background-panel__inspector-media-replace-container',
695
+ {
696
+ 'is-open': isDropDownOpen,
697
+ }
698
+ ) }
699
+ >
700
+ { shouldShowBackgroundImageControls ? (
701
+ <BackgroundControlsPanel
702
+ label={ title }
703
+ filename={ title }
704
+ url={ getResolvedThemeFilePath( url, themeFileURIs ) }
705
+ onToggle={ setIsDropDownOpen }
706
+ hasImageValue={ hasImageValue }
707
+ >
708
+ <VStack spacing={ 3 } className="single-column">
709
+ <BackgroundImageControls
710
+ onChange={ onChange }
711
+ style={ value }
712
+ inheritedValue={ inheritedValue }
713
+ themeFileURIs={ themeFileURIs }
714
+ displayInPanel
715
+ onRemoveImage={ () => {
716
+ setIsDropDownOpen( false );
717
+ resetBackground();
718
+ } }
719
+ />
720
+ <BackgroundSizeControls
721
+ onChange={ onChange }
722
+ panelId={ panelId }
723
+ style={ value }
724
+ defaultValues={ defaultValues }
725
+ inheritedValue={ inheritedValue }
726
+ themeFileURIs={ themeFileURIs }
727
+ />
728
+ </VStack>
729
+ </BackgroundControlsPanel>
730
+ ) : (
731
+ <BackgroundImageControls
732
+ onChange={ onChange }
733
+ style={ value }
734
+ inheritedValue={ inheritedValue }
735
+ themeFileURIs={ themeFileURIs }
736
+ />
737
+ ) }
738
+ </div>
739
+
740
+ { /* Dummy ToolsPanel items, so we can control what's in the dropdown popover */ }
741
+ <ToolsPanelItem
742
+ hasValue={ () => hasImageValue }
743
+ label={ __( 'Image' ) }
744
+ onDeselect={ resetBackground }
654
745
  isShownByDefault={ defaultControls.backgroundImage }
655
- style={ value }
656
- inheritedValue={ inheritedValue }
657
- themeFileURIs={ themeFileURIs }
746
+ panelId={ panelId }
747
+ className="block-editor-global-styles-background-panel__hidden-tools-panel-item"
658
748
  />
659
- { shouldShowBackgroundSizeControls && (
660
- <BackgroundSizeToolsPanelItem
661
- onChange={ onChange }
662
- panelId={ panelId }
663
- isShownByDefault={ defaultControls.backgroundSize }
664
- style={ value }
665
- inheritedValue={ inheritedValue }
666
- defaultValues={ defaultValues }
667
- themeFileURIs={ themeFileURIs }
668
- />
669
- ) }
670
749
  </Wrapper>
671
750
  );
672
751
  }
@@ -18,7 +18,7 @@ import { __ } from '@wordpress/i18n';
18
18
  */
19
19
  import BorderRadiusControl from '../border-radius-control';
20
20
  import { useColorsPerOrigin } from './hooks';
21
- import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
21
+ import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
22
22
  import { setImmutably } from '../../utils/object';
23
23
  import { useBorderPanelLabel } from '../../hooks/border';
24
24
  import { ShadowPopover, useShadowPresets } from './shadow-panel-components';
@@ -69,6 +69,7 @@ function BorderToolsPanel( {
69
69
  children,
70
70
  label,
71
71
  } ) {
72
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
72
73
  const resetAll = () => {
73
74
  const updatedValue = resetAllFilter( value );
74
75
  onChange( updatedValue );
@@ -79,7 +80,7 @@ function BorderToolsPanel( {
79
80
  label={ label }
80
81
  resetAll={ resetAll }
81
82
  panelId={ panelId }
82
- dropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }
83
+ dropdownMenuProps={ dropdownMenuProps }
83
84
  >
84
85
  { children }
85
86
  </ToolsPanel>
@@ -27,7 +27,7 @@ import { __, sprintf } from '@wordpress/i18n';
27
27
  */
28
28
  import ColorGradientControl from '../colors-gradients/control';
29
29
  import { useColorsPerOrigin, useGradientsPerOrigin } from './hooks';
30
- import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
30
+ import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
31
31
  import { setImmutably } from '../../utils/object';
32
32
  import { unlock } from '../../lock-unlock';
33
33
 
@@ -116,6 +116,7 @@ function ColorToolsPanel( {
116
116
  panelId,
117
117
  children,
118
118
  } ) {
119
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
119
120
  const resetAll = () => {
120
121
  const updatedValue = resetAllFilter( value );
121
122
  onChange( updatedValue );
@@ -131,7 +132,7 @@ function ColorToolsPanel( {
131
132
  className="color-block-support-panel"
132
133
  __experimentalFirstVisibleItemClass="first"
133
134
  __experimentalLastVisibleItemClass="last"
134
- dropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }
135
+ dropdownMenuProps={ dropdownMenuProps }
135
136
  >
136
137
  <div className="color-block-support-panel__inner-wrapper">
137
138
  { children }
@@ -22,7 +22,7 @@ import { useCallback, useState, Platform } from '@wordpress/element';
22
22
  /**
23
23
  * Internal dependencies
24
24
  */
25
- import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
25
+ import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
26
26
  import SpacingSizesControl from '../spacing-sizes-control';
27
27
  import HeightControl from '../height-control';
28
28
  import ChildLayoutControl from '../child-layout-control';
@@ -175,6 +175,7 @@ function DimensionsToolsPanel( {
175
175
  panelId,
176
176
  children,
177
177
  } ) {
178
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
178
179
  const resetAll = () => {
179
180
  const updatedValue = resetAllFilter( value );
180
181
  onChange( updatedValue );
@@ -185,7 +186,7 @@ function DimensionsToolsPanel( {
185
186
  label={ __( 'Dimensions' ) }
186
187
  resetAll={ resetAll }
187
188
  panelId={ panelId }
188
- dropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }
189
+ dropdownMenuProps={ dropdownMenuProps }
189
190
  >
190
191
  { children }
191
192
  </ToolsPanel>
@@ -28,7 +28,7 @@ import { useCallback, useMemo } from '@wordpress/element';
28
28
  /**
29
29
  * Internal dependencies
30
30
  */
31
- import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
31
+ import { getValueFromVariable, useToolsPanelDropdownMenuProps } from './utils';
32
32
  import { setImmutably } from '../../utils/object';
33
33
 
34
34
  const EMPTY_ARRAY = [];
@@ -72,6 +72,7 @@ function FiltersToolsPanel( {
72
72
  panelId,
73
73
  children,
74
74
  } ) {
75
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
75
76
  const resetAll = () => {
76
77
  const updatedValue = resetAllFilter( value );
77
78
  onChange( updatedValue );
@@ -82,7 +83,7 @@ function FiltersToolsPanel( {
82
83
  label={ _x( 'Filters', 'Name for applying graphical effects' ) }
83
84
  resetAll={ resetAll }
84
85
  panelId={ panelId }
85
- dropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }
86
+ dropdownMenuProps={ dropdownMenuProps }
86
87
  >
87
88
  { children }
88
89
  </ToolsPanel>
@@ -373,6 +373,15 @@ export function useSettingsForBlockElement(
373
373
  }
374
374
  } );
375
375
 
376
+ [ 'backgroundImage', 'backgroundSize' ].forEach( ( key ) => {
377
+ if ( ! supportedStyles.includes( key ) ) {
378
+ updatedSettings.background = {
379
+ ...updatedSettings.background,
380
+ [ key ]: false,
381
+ };
382
+ }
383
+ } );
384
+
376
385
  updatedSettings.shadow = supportedStyles.includes( 'shadow' )
377
386
  ? updatedSettings.shadow
378
387
  : false;