@wordpress/block-editor 12.5.0 → 12.7.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 (442) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +2 -6
  3. package/build/autocompleters/block.js +6 -2
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/block-draggable/index.js +6 -3
  6. package/build/components/block-draggable/index.js.map +1 -1
  7. package/build/components/block-draggable/index.native.js +2 -2
  8. package/build/components/block-draggable/index.native.js.map +1 -1
  9. package/build/components/block-edit/edit.js +25 -13
  10. package/build/components/block-edit/edit.js.map +1 -1
  11. package/build/components/block-editing-mode/index.js +1 -1
  12. package/build/components/block-editing-mode/index.js.map +1 -1
  13. package/build/components/block-list/block-outline.native.js +14 -18
  14. package/build/components/block-list/block-outline.native.js.map +1 -1
  15. package/build/components/block-list/block.js +4 -2
  16. package/build/components/block-list/block.js.map +1 -1
  17. package/build/components/block-list/block.native.js +21 -42
  18. package/build/components/block-list/block.native.js.map +1 -1
  19. package/build/components/block-list/index.js +2 -4
  20. package/build/components/block-list/index.js.map +1 -1
  21. package/build/components/block-mover/index.native.js +1 -1
  22. package/build/components/block-mover/index.native.js.map +1 -1
  23. package/build/components/block-parent-selector/index.js +6 -21
  24. package/build/components/block-parent-selector/index.js.map +1 -1
  25. package/build/components/block-preview/auto.js +6 -1
  26. package/build/components/block-preview/auto.js.map +1 -1
  27. package/build/components/block-removal-warning-modal/index.js +1 -4
  28. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  29. package/build/components/block-settings/button.native.js +2 -2
  30. package/build/components/block-settings/button.native.js.map +1 -1
  31. package/build/components/block-settings-menu/block-settings-dropdown.js +3 -17
  32. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  33. package/build/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +7 -5
  34. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -0
  35. package/build/components/block-toolbar/index.js +4 -33
  36. package/build/components/block-toolbar/index.js.map +1 -1
  37. package/build/components/block-toolbar/index.native.js +62 -3
  38. package/build/components/block-toolbar/index.native.js.map +1 -1
  39. package/build/components/block-toolbar/utils.js +56 -51
  40. package/build/components/block-toolbar/utils.js.map +1 -1
  41. package/build/components/block-tools/block-contextual-toolbar.js +4 -2
  42. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  43. package/build/components/block-variation-picker/index.native.js +10 -20
  44. package/build/components/block-variation-picker/index.native.js.map +1 -1
  45. package/build/components/colors-gradients/control.js +4 -2
  46. package/build/components/colors-gradients/control.js.map +1 -1
  47. package/build/components/editor-styles/index.js +2 -2
  48. package/build/components/editor-styles/index.js.map +1 -1
  49. package/build/components/font-sizes/fluid-utils.js +11 -11
  50. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  51. package/build/components/global-styles/behaviors-panel.js +66 -0
  52. package/build/components/global-styles/behaviors-panel.js.map +1 -0
  53. package/build/components/global-styles/color-panel.js +21 -15
  54. package/build/components/global-styles/color-panel.js.map +1 -1
  55. package/build/components/global-styles/dimensions-panel.js +13 -2
  56. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  57. package/build/components/global-styles/get-block-css-selector.js +4 -8
  58. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  59. package/build/components/global-styles/hooks.js +131 -27
  60. package/build/components/global-styles/hooks.js.map +1 -1
  61. package/build/components/global-styles/index.js +20 -0
  62. package/build/components/global-styles/index.js.map +1 -1
  63. package/build/components/global-styles/typography-panel.js +18 -3
  64. package/build/components/global-styles/typography-panel.js.map +1 -1
  65. package/build/components/global-styles/typography-utils.js +4 -4
  66. package/build/components/global-styles/typography-utils.js.map +1 -1
  67. package/build/components/global-styles/use-global-styles-output.js +12 -18
  68. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  69. package/build/components/global-styles/utils.js +7 -7
  70. package/build/components/global-styles/utils.js.map +1 -1
  71. package/build/components/iframe/index.js +36 -48
  72. package/build/components/iframe/index.js.map +1 -1
  73. package/build/components/iframe/use-compatibility-styles.js +5 -0
  74. package/build/components/iframe/use-compatibility-styles.js.map +1 -1
  75. package/build/components/index.js +1 -10
  76. package/build/components/index.js.map +1 -1
  77. package/build/components/inner-blocks/index.js +3 -1
  78. package/build/components/inner-blocks/index.js.map +1 -1
  79. package/build/components/inner-blocks/index.native.js +3 -1
  80. package/build/components/inner-blocks/index.native.js.map +1 -1
  81. package/build/components/inner-blocks/use-nested-settings-update.js +33 -7
  82. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  83. package/build/components/inserter/hooks/use-block-types-state.js +6 -2
  84. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  85. package/build/components/inserter/hooks/use-debounced-input.js +5 -7
  86. package/build/components/inserter/hooks/use-debounced-input.js.map +1 -1
  87. package/build/components/inserter/hooks/use-patterns-state.js +3 -2
  88. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  89. package/build/components/inserter/index.js +2 -4
  90. package/build/components/inserter/index.js.map +1 -1
  91. package/build/components/inserter/index.native.js +21 -32
  92. package/build/components/inserter/index.native.js.map +1 -1
  93. package/build/components/inserter/reusable-block-rename-hint.js +23 -3
  94. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -1
  95. package/build/components/inserter/reusable-blocks-tab.js +3 -2
  96. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  97. package/build/components/inserter-list-item/index.js +1 -1
  98. package/build/components/inserter-list-item/index.js.map +1 -1
  99. package/build/components/link-control/index.js +51 -7
  100. package/build/components/link-control/index.js.map +1 -1
  101. package/build/components/link-control/link-preview.js +3 -3
  102. package/build/components/link-control/link-preview.js.map +1 -1
  103. package/build/components/link-control/search-item.js +1 -1
  104. package/build/components/link-control/search-item.js.map +1 -1
  105. package/build/components/list-view/use-list-view-client-ids.js +2 -2
  106. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  107. package/build/components/list-view/use-list-view-drop-zone.js +6 -1
  108. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  109. package/build/components/media-placeholder/index.native.js +65 -31
  110. package/build/components/media-placeholder/index.native.js.map +1 -1
  111. package/build/components/media-replace-flow/index.native.js +15 -3
  112. package/build/components/media-replace-flow/index.native.js.map +1 -1
  113. package/build/components/preview-options/index.js +2 -2
  114. package/build/components/preview-options/index.js.map +1 -1
  115. package/build/components/rich-text/content.js +0 -36
  116. package/build/components/rich-text/content.js.map +1 -1
  117. package/build/components/rich-text/format-edit.js +57 -28
  118. package/build/components/rich-text/format-edit.js.map +1 -1
  119. package/build/components/rich-text/get-rich-text-values.js +111 -0
  120. package/build/components/rich-text/get-rich-text-values.js.map +1 -0
  121. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
  122. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  123. package/build/components/spacing-sizes-control/input-controls/axial.js +6 -2
  124. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  125. package/build/components/spacing-sizes-control/input-controls/separated.js +5 -1
  126. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  127. package/build/components/spacing-sizes-control/input-controls/single.js +5 -1
  128. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  129. package/build/components/spacing-sizes-control/utils.js +2 -2
  130. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  131. package/build/components/use-block-display-information/index.js +7 -3
  132. package/build/components/use-block-display-information/index.js.map +1 -1
  133. package/build/components/use-block-drop-zone/index.native.js +49 -8
  134. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  135. package/build/components/use-setting/index.js +5 -9
  136. package/build/components/use-setting/index.js.map +1 -1
  137. package/build/hooks/behaviors.js +5 -12
  138. package/build/hooks/behaviors.js.map +1 -1
  139. package/build/hooks/border.js +2 -1
  140. package/build/hooks/border.js.map +1 -1
  141. package/build/hooks/margin.js +1 -1
  142. package/build/hooks/margin.js.map +1 -1
  143. package/build/hooks/padding.js +1 -1
  144. package/build/hooks/padding.js.map +1 -1
  145. package/build/hooks/style.js +11 -2
  146. package/build/hooks/style.js.map +1 -1
  147. package/build/hooks/utils.js +1 -7
  148. package/build/hooks/utils.js.map +1 -1
  149. package/build/private-apis.js +10 -3
  150. package/build/private-apis.js.map +1 -1
  151. package/build/store/actions.js +3 -4
  152. package/build/store/actions.js.map +1 -1
  153. package/build/store/private-selectors.js +5 -6
  154. package/build/store/private-selectors.js.map +1 -1
  155. package/build/store/reducer.js +0 -1
  156. package/build/store/reducer.js.map +1 -1
  157. package/build/store/selectors.js +23 -79
  158. package/build/store/selectors.js.map +1 -1
  159. package/build/utils/object.js +38 -2
  160. package/build/utils/object.js.map +1 -1
  161. package/build-module/autocompleters/block.js +7 -3
  162. package/build-module/autocompleters/block.js.map +1 -1
  163. package/build-module/components/block-draggable/index.js +6 -3
  164. package/build-module/components/block-draggable/index.js.map +1 -1
  165. package/build-module/components/block-draggable/index.native.js +2 -2
  166. package/build-module/components/block-draggable/index.native.js.map +1 -1
  167. package/build-module/components/block-edit/edit.js +27 -10
  168. package/build-module/components/block-edit/edit.js.map +1 -1
  169. package/build-module/components/block-editing-mode/index.js +1 -1
  170. package/build-module/components/block-editing-mode/index.js.map +1 -1
  171. package/build-module/components/block-list/block-outline.native.js +14 -18
  172. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  173. package/build-module/components/block-list/block.js +4 -2
  174. package/build-module/components/block-list/block.js.map +1 -1
  175. package/build-module/components/block-list/block.native.js +24 -43
  176. package/build-module/components/block-list/block.native.js.map +1 -1
  177. package/build-module/components/block-list/index.js +2 -3
  178. package/build-module/components/block-list/index.js.map +1 -1
  179. package/build-module/components/block-mover/index.native.js +3 -3
  180. package/build-module/components/block-mover/index.native.js.map +1 -1
  181. package/build-module/components/block-parent-selector/index.js +7 -22
  182. package/build-module/components/block-parent-selector/index.js.map +1 -1
  183. package/build-module/components/block-preview/auto.js +6 -1
  184. package/build-module/components/block-preview/auto.js.map +1 -1
  185. package/build-module/components/block-removal-warning-modal/index.js +1 -4
  186. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  187. package/build-module/components/block-settings/button.native.js +3 -3
  188. package/build-module/components/block-settings/button.native.js.map +1 -1
  189. package/build-module/components/block-settings-menu/block-settings-dropdown.js +4 -18
  190. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  191. package/build-module/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +9 -7
  192. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -0
  193. package/build-module/components/block-toolbar/index.js +6 -35
  194. package/build-module/components/block-toolbar/index.js.map +1 -1
  195. package/build-module/components/block-toolbar/index.native.js +60 -4
  196. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  197. package/build-module/components/block-toolbar/utils.js +54 -49
  198. package/build-module/components/block-toolbar/utils.js.map +1 -1
  199. package/build-module/components/block-tools/block-contextual-toolbar.js +4 -2
  200. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  201. package/build-module/components/block-variation-picker/index.native.js +13 -23
  202. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  203. package/build-module/components/colors-gradients/control.js +3 -2
  204. package/build-module/components/colors-gradients/control.js.map +1 -1
  205. package/build-module/components/editor-styles/index.js +2 -2
  206. package/build-module/components/editor-styles/index.js.map +1 -1
  207. package/build-module/components/font-sizes/fluid-utils.js +11 -11
  208. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  209. package/build-module/components/global-styles/behaviors-panel.js +57 -0
  210. package/build-module/components/global-styles/behaviors-panel.js.map +1 -0
  211. package/build-module/components/global-styles/color-panel.js +21 -15
  212. package/build-module/components/global-styles/color-panel.js.map +1 -1
  213. package/build-module/components/global-styles/dimensions-panel.js +13 -2
  214. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  215. package/build-module/components/global-styles/get-block-css-selector.js +4 -8
  216. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  217. package/build-module/components/global-styles/hooks.js +127 -27
  218. package/build-module/components/global-styles/hooks.js.map +1 -1
  219. package/build-module/components/global-styles/index.js +2 -1
  220. package/build-module/components/global-styles/index.js.map +1 -1
  221. package/build-module/components/global-styles/typography-panel.js +18 -3
  222. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  223. package/build-module/components/global-styles/typography-utils.js +4 -4
  224. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  225. package/build-module/components/global-styles/use-global-styles-output.js +13 -18
  226. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  227. package/build-module/components/global-styles/utils.js +6 -6
  228. package/build-module/components/global-styles/utils.js.map +1 -1
  229. package/build-module/components/iframe/index.js +37 -49
  230. package/build-module/components/iframe/index.js.map +1 -1
  231. package/build-module/components/iframe/use-compatibility-styles.js +5 -0
  232. package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
  233. package/build-module/components/index.js +0 -5
  234. package/build-module/components/index.js.map +1 -1
  235. package/build-module/components/inner-blocks/index.js +3 -1
  236. package/build-module/components/inner-blocks/index.js.map +1 -1
  237. package/build-module/components/inner-blocks/index.native.js +3 -1
  238. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  239. package/build-module/components/inner-blocks/use-nested-settings-update.js +30 -7
  240. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  241. package/build-module/components/inserter/hooks/use-block-types-state.js +7 -3
  242. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  243. package/build-module/components/inserter/hooks/use-debounced-input.js +5 -7
  244. package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -1
  245. package/build-module/components/inserter/hooks/use-patterns-state.js +3 -2
  246. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  247. package/build-module/components/inserter/index.js +2 -4
  248. package/build-module/components/inserter/index.js.map +1 -1
  249. package/build-module/components/inserter/index.native.js +22 -33
  250. package/build-module/components/inserter/index.native.js.map +1 -1
  251. package/build-module/components/inserter/reusable-block-rename-hint.js +22 -3
  252. package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -1
  253. package/build-module/components/inserter/reusable-blocks-tab.js +3 -2
  254. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  255. package/build-module/components/inserter-list-item/index.js +1 -1
  256. package/build-module/components/inserter-list-item/index.js.map +1 -1
  257. package/build-module/components/link-control/index.js +49 -7
  258. package/build-module/components/link-control/index.js.map +1 -1
  259. package/build-module/components/link-control/link-preview.js +3 -3
  260. package/build-module/components/link-control/link-preview.js.map +1 -1
  261. package/build-module/components/link-control/search-item.js +1 -1
  262. package/build-module/components/link-control/search-item.js.map +1 -1
  263. package/build-module/components/list-view/use-list-view-client-ids.js +2 -2
  264. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  265. package/build-module/components/list-view/use-list-view-drop-zone.js +6 -1
  266. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  267. package/build-module/components/media-placeholder/index.native.js +66 -33
  268. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  269. package/build-module/components/media-replace-flow/index.native.js +15 -3
  270. package/build-module/components/media-replace-flow/index.native.js.map +1 -1
  271. package/build-module/components/preview-options/index.js +2 -2
  272. package/build-module/components/preview-options/index.js.map +1 -1
  273. package/build-module/components/rich-text/content.js +1 -36
  274. package/build-module/components/rich-text/content.js.map +1 -1
  275. package/build-module/components/rich-text/format-edit.js +51 -26
  276. package/build-module/components/rich-text/format-edit.js.map +1 -1
  277. package/build-module/components/rich-text/get-rich-text-values.js +100 -0
  278. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -0
  279. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
  280. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  281. package/build-module/components/spacing-sizes-control/input-controls/axial.js +7 -3
  282. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  283. package/build-module/components/spacing-sizes-control/input-controls/separated.js +6 -2
  284. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  285. package/build-module/components/spacing-sizes-control/input-controls/single.js +6 -2
  286. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  287. package/build-module/components/spacing-sizes-control/utils.js +2 -2
  288. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  289. package/build-module/components/use-block-display-information/index.js +7 -3
  290. package/build-module/components/use-block-display-information/index.js.map +1 -1
  291. package/build-module/components/use-block-drop-zone/index.native.js +50 -8
  292. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  293. package/build-module/components/use-setting/index.js +5 -9
  294. package/build-module/components/use-setting/index.js.map +1 -1
  295. package/build-module/hooks/behaviors.js +5 -12
  296. package/build-module/hooks/behaviors.js.map +1 -1
  297. package/build-module/hooks/border.js +2 -1
  298. package/build-module/hooks/border.js.map +1 -1
  299. package/build-module/hooks/margin.js +1 -1
  300. package/build-module/hooks/margin.js.map +1 -1
  301. package/build-module/hooks/padding.js +1 -1
  302. package/build-module/hooks/padding.js.map +1 -1
  303. package/build-module/hooks/style.js +11 -2
  304. package/build-module/hooks/style.js.map +1 -1
  305. package/build-module/hooks/utils.js +2 -7
  306. package/build-module/hooks/utils.js.map +1 -1
  307. package/build-module/private-apis.js +7 -2
  308. package/build-module/private-apis.js.map +1 -1
  309. package/build-module/store/actions.js +4 -5
  310. package/build-module/store/actions.js.map +1 -1
  311. package/build-module/store/private-selectors.js +3 -3
  312. package/build-module/store/private-selectors.js.map +1 -1
  313. package/build-module/store/reducer.js +0 -1
  314. package/build-module/store/reducer.js.map +1 -1
  315. package/build-module/store/selectors.js +20 -75
  316. package/build-module/store/selectors.js.map +1 -1
  317. package/build-module/utils/object.js +34 -2
  318. package/build-module/utils/object.js.map +1 -1
  319. package/build-style/content-rtl.css +2 -1
  320. package/build-style/content.css +2 -1
  321. package/build-style/style-rtl.css +25 -6
  322. package/build-style/style.css +25 -6
  323. package/package.json +32 -32
  324. package/src/autocompleters/block.js +21 -6
  325. package/src/components/block-controls/README.md +89 -0
  326. package/src/components/block-draggable/index.js +13 -4
  327. package/src/components/block-draggable/index.native.js +7 -3
  328. package/src/components/block-draggable/test/index.native.js +2 -57
  329. package/src/components/block-edit/edit.js +26 -9
  330. package/src/components/block-edit/test/edit.js +1 -1
  331. package/src/components/block-editing-mode/index.js +1 -1
  332. package/src/components/block-list/block-outline.native.js +26 -25
  333. package/src/components/block-list/block.js +6 -1
  334. package/src/components/block-list/block.native.js +24 -38
  335. package/src/components/block-list/block.native.scss +18 -40
  336. package/src/components/block-list/index.js +3 -6
  337. package/src/components/block-list/style.native.scss +3 -3
  338. package/src/components/block-list/test/block-invalid-warning.native.js +8 -1
  339. package/src/components/block-mover/index.native.js +3 -3
  340. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +40 -6
  341. package/src/components/block-parent-selector/index.js +30 -42
  342. package/src/components/block-preview/auto.js +8 -1
  343. package/src/components/block-preview/style.scss +2 -1
  344. package/src/components/block-removal-warning-modal/index.js +0 -3
  345. package/src/components/block-settings/button.native.js +12 -6
  346. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -13
  347. package/src/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +15 -10
  348. package/src/components/block-toolbar/index.js +36 -64
  349. package/src/components/block-toolbar/index.native.js +86 -6
  350. package/src/components/{block-mobile-toolbar/test/block-actions-menu.native.js → block-toolbar/test/block-toolbar-menu.native.js} +20 -54
  351. package/src/components/block-toolbar/test/index.native.js +42 -0
  352. package/src/components/block-toolbar/utils.js +57 -45
  353. package/src/components/block-tools/block-contextual-toolbar.js +43 -35
  354. package/src/components/block-tools/style.scss +17 -5
  355. package/src/components/block-variation-picker/index.native.js +52 -72
  356. package/src/components/button-block-appender/styles.native.scss +2 -2
  357. package/src/components/caption/README.md +49 -0
  358. package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
  359. package/src/components/colors-gradients/control.js +3 -2
  360. package/src/components/editor-styles/index.js +2 -2
  361. package/src/components/font-sizes/fluid-utils.js +17 -17
  362. package/src/components/font-sizes/test/fluid-utils.js +6 -6
  363. package/src/components/global-styles/behaviors-panel.js +71 -0
  364. package/src/components/global-styles/color-panel.js +23 -16
  365. package/src/components/global-styles/dimensions-panel.js +8 -2
  366. package/src/components/global-styles/get-block-css-selector.js +5 -9
  367. package/src/components/global-styles/hooks.js +134 -31
  368. package/src/components/global-styles/index.js +3 -0
  369. package/src/components/global-styles/test/typography-utils.js +6 -6
  370. package/src/components/global-styles/typography-panel.js +17 -5
  371. package/src/components/global-styles/typography-utils.js +4 -4
  372. package/src/components/global-styles/use-global-styles-output.js +36 -18
  373. package/src/components/global-styles/utils.js +17 -7
  374. package/src/components/iframe/index.js +30 -56
  375. package/src/components/iframe/use-compatibility-styles.js +5 -0
  376. package/src/components/index.js +0 -5
  377. package/src/components/inner-blocks/README.md +10 -0
  378. package/src/components/inner-blocks/index.js +4 -0
  379. package/src/components/inner-blocks/index.native.js +4 -0
  380. package/src/components/inner-blocks/use-nested-settings-update.js +32 -5
  381. package/src/components/inserter/hooks/use-block-types-state.js +15 -6
  382. package/src/components/inserter/hooks/use-debounced-input.js +8 -7
  383. package/src/components/inserter/hooks/use-patterns-state.js +2 -1
  384. package/src/components/inserter/index.js +2 -3
  385. package/src/components/inserter/index.native.js +17 -36
  386. package/src/components/inserter/reusable-block-rename-hint.js +18 -1
  387. package/src/components/inserter/reusable-blocks-tab.js +4 -1
  388. package/src/components/inserter/style.native.scss +10 -15
  389. package/src/components/inserter-list-item/index.js +3 -1
  390. package/src/components/link-control/README.md +12 -3
  391. package/src/components/link-control/index.js +47 -7
  392. package/src/components/link-control/link-preview.js +6 -4
  393. package/src/components/link-control/search-item.js +1 -1
  394. package/src/components/link-control/style.scss +11 -3
  395. package/src/components/link-control/test/index.js +28 -1
  396. package/src/components/list-view/use-list-view-client-ids.js +2 -2
  397. package/src/components/list-view/use-list-view-drop-zone.js +5 -1
  398. package/src/components/media-placeholder/index.native.js +108 -59
  399. package/src/components/media-placeholder/styles.native.scss +59 -24
  400. package/src/components/media-replace-flow/index.native.js +12 -3
  401. package/src/components/media-upload/test/index.native.js +1 -0
  402. package/src/components/preview-options/README.md +18 -17
  403. package/src/components/preview-options/index.js +2 -2
  404. package/src/components/rich-text/content.js +1 -46
  405. package/src/components/rich-text/format-edit.js +62 -38
  406. package/src/components/rich-text/get-rich-text-values.js +99 -0
  407. package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
  408. package/src/components/spacing-sizes-control/input-controls/axial.js +17 -2
  409. package/src/components/spacing-sizes-control/input-controls/separated.js +17 -2
  410. package/src/components/spacing-sizes-control/input-controls/single.js +12 -2
  411. package/src/components/spacing-sizes-control/test/utils.js +9 -1
  412. package/src/components/spacing-sizes-control/utils.js +2 -2
  413. package/src/components/text-transform-control/README.md +44 -0
  414. package/src/components/use-block-display-information/index.js +12 -5
  415. package/src/components/use-block-drop-zone/index.native.js +65 -28
  416. package/src/components/use-setting/index.js +8 -8
  417. package/src/hooks/behaviors.js +10 -16
  418. package/src/hooks/border.js +2 -1
  419. package/src/hooks/margin.js +4 -1
  420. package/src/hooks/padding.js +4 -1
  421. package/src/hooks/style.js +7 -3
  422. package/src/hooks/utils.js +5 -7
  423. package/src/private-apis.js +9 -1
  424. package/src/store/actions.js +23 -30
  425. package/src/store/private-selectors.js +3 -6
  426. package/src/store/reducer.js +0 -1
  427. package/src/store/selectors.js +36 -85
  428. package/src/store/test/actions.js +3 -0
  429. package/src/store/test/private-selectors.js +5 -5
  430. package/src/store/test/reducer.js +14 -7
  431. package/src/store/test/selectors.js +8 -7
  432. package/src/utils/object.js +32 -2
  433. package/src/utils/test/object.js +36 -0
  434. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +0 -1
  435. package/build/components/block-mobile-toolbar/index.native.js +0 -135
  436. package/build/components/block-mobile-toolbar/index.native.js.map +0 -1
  437. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +0 -1
  438. package/build-module/components/block-mobile-toolbar/index.native.js +0 -116
  439. package/build-module/components/block-mobile-toolbar/index.native.js.map +0 -1
  440. package/src/components/block-mobile-toolbar/index.native.js +0 -127
  441. package/src/components/block-mobile-toolbar/style.native.scss +0 -16
  442. /package/src/components/{block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap → block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap} +0 -0
@@ -12,12 +12,9 @@ import {
12
12
  /**
13
13
  * WordPress dependencies
14
14
  */
15
- import { withSelect, useDispatch } from '@wordpress/data';
16
- import { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';
17
- import {
18
- createBlocksFromInnerBlocksTemplate,
19
- store as blocksStore,
20
- } from '@wordpress/blocks';
15
+ import { useDispatch } from '@wordpress/data';
16
+ import { usePreferredColorSchemeStyle } from '@wordpress/compose';
17
+ import { createBlocksFromInnerBlocksTemplate } from '@wordpress/blocks';
21
18
  import { __ } from '@wordpress/i18n';
22
19
  import {
23
20
  PanelBody,
@@ -26,7 +23,6 @@ import {
26
23
  InserterButton,
27
24
  } from '@wordpress/components';
28
25
  import { Icon, close } from '@wordpress/icons';
29
- import { useMemo } from '@wordpress/element';
30
26
 
31
27
  /**
32
28
  * Internal dependencies
@@ -45,28 +41,25 @@ function BlockVariationPicker( { isVisible, onClose, clientId, variations } ) {
45
41
  styles.cancelButtonDark
46
42
  );
47
43
 
48
- const leftButton = useMemo(
49
- () => (
50
- <TouchableWithoutFeedback onPress={ onClose } hitSlop={ hitSlop }>
51
- <View>
52
- { isIOS ? (
53
- <Text
54
- style={ cancelButtonStyle }
55
- maxFontSizeMultiplier={ 2 }
56
- >
57
- { __( 'Cancel' ) }
58
- </Text>
59
- ) : (
60
- <Icon
61
- icon={ close }
62
- size={ 24 }
63
- style={ styles.closeIcon }
64
- />
65
- ) }
66
- </View>
67
- </TouchableWithoutFeedback>
68
- ),
69
- [ onClose, cancelButtonStyle ]
44
+ const leftButton = (
45
+ <TouchableWithoutFeedback onPress={ onClose } hitSlop={ hitSlop }>
46
+ <View>
47
+ { isIOS ? (
48
+ <Text
49
+ style={ cancelButtonStyle }
50
+ maxFontSizeMultiplier={ 2 }
51
+ >
52
+ { __( 'Cancel' ) }
53
+ </Text>
54
+ ) : (
55
+ <Icon
56
+ icon={ close }
57
+ size={ 24 }
58
+ style={ styles.closeIcon }
59
+ />
60
+ ) }
61
+ </View>
62
+ </TouchableWithoutFeedback>
70
63
  );
71
64
 
72
65
  const onVariationSelect = ( variation ) => {
@@ -77,51 +70,38 @@ function BlockVariationPicker( { isVisible, onClose, clientId, variations } ) {
77
70
  onClose();
78
71
  };
79
72
 
80
- return useMemo(
81
- () => (
82
- <BottomSheet
83
- isVisible={ isVisible }
84
- onClose={ onClose }
85
- title={ __( 'Select a layout' ) }
86
- contentStyle={ styles.contentStyle }
87
- leftButton={ leftButton }
88
- testID="block-variation-modal"
73
+ return (
74
+ <BottomSheet
75
+ isVisible={ isVisible }
76
+ onClose={ onClose }
77
+ title={ __( 'Select a layout' ) }
78
+ contentStyle={ styles.contentStyle }
79
+ leftButton={ leftButton }
80
+ testID="block-variation-modal"
81
+ >
82
+ <ScrollView
83
+ horizontal
84
+ showsHorizontalScrollIndicator={ false }
85
+ contentContainerStyle={ styles.contentContainerStyle }
86
+ style={ styles.containerStyle }
89
87
  >
90
- <ScrollView
91
- horizontal
92
- showsHorizontalScrollIndicator={ false }
93
- contentContainerStyle={ styles.contentContainerStyle }
94
- style={ styles.containerStyle }
95
- >
96
- { variations.map( ( v ) => {
97
- return (
98
- <InserterButton
99
- item={ v }
100
- key={ v.name }
101
- onSelect={ () => onVariationSelect( v ) }
102
- />
103
- );
104
- } ) }
105
- </ScrollView>
106
- <PanelBody>
107
- <FooterMessageControl
108
- label={ __(
109
- 'Note: Column layout may vary between themes and screen sizes'
110
- ) }
88
+ { variations.map( ( v ) => (
89
+ <InserterButton
90
+ item={ v }
91
+ key={ v.name }
92
+ onSelect={ () => onVariationSelect( v ) }
111
93
  />
112
- </PanelBody>
113
- </BottomSheet>
114
- ),
115
- [ variations, isVisible, onClose ]
94
+ ) ) }
95
+ </ScrollView>
96
+ <PanelBody>
97
+ <FooterMessageControl
98
+ label={ __(
99
+ 'Note: Column layout may vary between themes and screen sizes'
100
+ ) }
101
+ />
102
+ </PanelBody>
103
+ </BottomSheet>
116
104
  );
117
105
  }
118
106
 
119
- export default compose(
120
- withSelect( ( select, {} ) => {
121
- const { getBlockVariations } = select( blocksStore );
122
-
123
- return {
124
- date: getBlockVariations( 'core/columns', 'block' ),
125
- };
126
- } )
127
- )( BlockVariationPicker );
107
+ export default BlockVariationPicker;
@@ -3,8 +3,8 @@
3
3
  align-items: center;
4
4
  justify-content: center;
5
5
  padding: 9px;
6
- margin-left: 0;
7
- margin-right: 0;
6
+ margin-left: $grid-unit;
7
+ margin-right: $grid-unit;
8
8
  border-radius: 4px;
9
9
  }
10
10
 
@@ -0,0 +1,49 @@
1
+ ## Caption
2
+
3
+ The `Caption` component renders the [caption part](https://wordpress.org/documentation/article/gallery-block/#caption) of some blocks (image, gallery...).
4
+
5
+ This component encapsulates the "caption" behaviour and styles over a `<RichText>` so it can be used in other components such as the `BlockCaption` component.
6
+
7
+ ## Table of contents
8
+
9
+ 1. [Development guidelines](#development-guidelines)
10
+ 2. [Related components](#related-components)
11
+
12
+ ## Development guidelines
13
+
14
+ ### Usage
15
+
16
+ Renders a Caption area:
17
+
18
+ ```jsx
19
+ import { Caption } from '@wordpress/block-editor';
20
+ const BlockCaption = ( {
21
+ onBlur,
22
+ onChange,
23
+ onFocus,
24
+ isSelected,
25
+ shouldDisplay,
26
+ text,
27
+ insertBlocksAfter,
28
+ } ) => (
29
+ <View >
30
+ <Caption
31
+ isSelected={ isSelected }
32
+ onBlur={ onBlur }
33
+ onChange={ onChange }
34
+ onFocus={ onFocus }
35
+ shouldDisplay={ shouldDisplay }
36
+ value={ text }
37
+ insertBlocksAfter={ insertBlocksAfter }
38
+ />
39
+ </View>
40
+ );
41
+ ```
42
+
43
+ ### Props
44
+
45
+ The properties `isSelected`, `onBlur`, `onChange`, `onFocus`, `shouldDisplay`, `value`, `insertBlocksAfter` of this component are passed directly to their related props of its inner `<RichText>` component ([see detailed info about the RichText component's props](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md)).
46
+
47
+ ## Related components
48
+
49
+ Caption components is mostly used by the [`BlockCaption`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-caption) component.
@@ -172,7 +172,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
172
172
  <button
173
173
  aria-expanded="false"
174
174
  aria-haspopup="true"
175
- aria-label="Custom color picker. The currently selected color is called "red" and has a value of "#-f-0-0"."
175
+ aria-label="Custom color picker. The currently selected color is called "red" and has a value of "#f00"."
176
176
  class="components-color-palette__custom-color-button"
177
177
  style="background: rgb(255, 0, 0);"
178
178
  />
@@ -6,6 +6,7 @@ import classnames from 'classnames';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
+ import { __ } from '@wordpress/i18n';
9
10
  import {
10
11
  BaseControl,
11
12
  __experimentalVStack as VStack,
@@ -28,12 +29,12 @@ const colorsAndGradientKeys = [
28
29
 
29
30
  const TAB_COLOR = {
30
31
  name: 'color',
31
- title: 'Solid',
32
+ title: __( 'Solid' ),
32
33
  value: 'color',
33
34
  };
34
35
  const TAB_GRADIENT = {
35
36
  name: 'gradient',
36
- title: 'Gradient',
37
+ title: __( 'Gradient' ),
37
38
  value: 'gradient',
38
39
  };
39
40
 
@@ -43,13 +43,13 @@ function useDarkThemeBodyClassName( styles ) {
43
43
  body.appendChild( tempCanvas );
44
44
 
45
45
  backgroundColor = defaultView
46
- .getComputedStyle( tempCanvas, null )
46
+ ?.getComputedStyle( tempCanvas, null )
47
47
  .getPropertyValue( 'background-color' );
48
48
 
49
49
  body.removeChild( tempCanvas );
50
50
  } else {
51
51
  backgroundColor = defaultView
52
- .getComputedStyle( canvas, null )
52
+ ?.getComputedStyle( canvas, null )
53
53
  .getPropertyValue( 'background-color' );
54
54
  }
55
55
  const colordBackgroundColor = colord( backgroundColor );
@@ -32,8 +32,8 @@ const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';
32
32
  * ```
33
33
  *
34
34
  * @param {Object} args
35
- * @param {?string} args.minimumViewPortWidth Minimum viewport size from which type will have fluidity. Optional if fontSize is specified.
36
- * @param {?string} args.maximumViewPortWidth Maximum size up to which type will have fluidity. Optional if fontSize is specified.
35
+ * @param {?string} args.minimumViewportWidth Minimum viewport size from which type will have fluidity. Optional if fontSize is specified.
36
+ * @param {?string} args.maximumViewportWidth Maximum size up to which type will have fluidity. Optional if fontSize is specified.
37
37
  * @param {string|number} [args.fontSize] Size to derive maximumFontSize and minimumFontSize from, if necessary. Optional if minimumFontSize and maximumFontSize are specified.
38
38
  * @param {?string} args.maximumFontSize Maximum font size for any clamp() calculation. Optional.
39
39
  * @param {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional.
@@ -46,8 +46,8 @@ export function getComputedFluidTypographyValue( {
46
46
  minimumFontSize,
47
47
  maximumFontSize,
48
48
  fontSize,
49
- minimumViewPortWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH,
50
- maximumViewPortWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
49
+ minimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH,
50
+ maximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
51
51
  scaleFactor = DEFAULT_SCALE_FACTOR,
52
52
  minimumFontSizeLimit,
53
53
  } ) {
@@ -163,19 +163,19 @@ export function getComputedFluidTypographyValue( {
163
163
  } );
164
164
 
165
165
  // Viewport widths defined for fluid typography. Normalize units
166
- const maximumViewPortWidthParsed = getTypographyValueAndUnit(
167
- maximumViewPortWidth,
166
+ const maximumViewportWidthParsed = getTypographyValueAndUnit(
167
+ maximumViewportWidth,
168
168
  { coerceTo: fontSizeUnit }
169
169
  );
170
- const minumumViewPortWidthParsed = getTypographyValueAndUnit(
171
- minimumViewPortWidth,
170
+ const minimumViewportWidthParsed = getTypographyValueAndUnit(
171
+ minimumViewportWidth,
172
172
  { coerceTo: fontSizeUnit }
173
173
  );
174
174
 
175
175
  // Protect against unsupported units.
176
176
  if (
177
- ! maximumViewPortWidthParsed ||
178
- ! minumumViewPortWidthParsed ||
177
+ ! maximumViewportWidthParsed ||
178
+ ! minimumViewportWidthParsed ||
179
179
  ! minimumFontSizeRem
180
180
  ) {
181
181
  return null;
@@ -183,23 +183,23 @@ export function getComputedFluidTypographyValue( {
183
183
 
184
184
  // Build CSS rule.
185
185
  // Borrowed from https://websemantics.uk/tools/responsive-font-calculator/.
186
- const minViewPortWidthOffsetValue = roundToPrecision(
187
- minumumViewPortWidthParsed.value / 100,
186
+ const minViewportWidthOffsetValue = roundToPrecision(
187
+ minimumViewportWidthParsed.value / 100,
188
188
  3
189
189
  );
190
190
 
191
- const viewPortWidthOffset =
192
- roundToPrecision( minViewPortWidthOffsetValue, 3 ) + fontSizeUnit;
191
+ const viewportWidthOffset =
192
+ roundToPrecision( minViewportWidthOffsetValue, 3 ) + fontSizeUnit;
193
193
  const linearFactor =
194
194
  100 *
195
195
  ( ( maximumFontSizeParsed.value - minimumFontSizeParsed.value ) /
196
- ( maximumViewPortWidthParsed.value -
197
- minumumViewPortWidthParsed.value ) );
196
+ ( maximumViewportWidthParsed.value -
197
+ minimumViewportWidthParsed.value ) );
198
198
  const linearFactorScaled = roundToPrecision(
199
199
  ( linearFactor || 1 ) * scaleFactor,
200
200
  3
201
201
  );
202
- const fluidTargetFontSize = `${ minimumFontSizeRem.value }${ minimumFontSizeRem.unit } + ((1vw - ${ viewPortWidthOffset }) * ${ linearFactorScaled })`;
202
+ const fluidTargetFontSize = `${ minimumFontSizeRem.value }${ minimumFontSizeRem.unit } + ((1vw - ${ viewportWidthOffset }) * ${ linearFactorScaled })`;
203
203
 
204
204
  return `clamp(${ minimumFontSize }, ${ fluidTargetFontSize }, ${ maximumFontSize })`;
205
205
  }
@@ -56,8 +56,8 @@ describe( 'getComputedFluidTypographyValue()', () => {
56
56
  it( 'should return a fluid font size when given a min and max viewport width', () => {
57
57
  const fluidTypographyValues = getComputedFluidTypographyValue( {
58
58
  fontSize: '30px',
59
- minimumViewPortWidth: '500px',
60
- maximumViewPortWidth: '1000px',
59
+ minimumViewportWidth: '500px',
60
+ maximumViewportWidth: '1000px',
61
61
  } );
62
62
  expect( fluidTypographyValues ).toBe(
63
63
  'clamp(18.959px, 1.185rem + ((1vw - 5px) * 2.208), 30px)'
@@ -74,18 +74,18 @@ describe( 'getComputedFluidTypographyValue()', () => {
74
74
  );
75
75
  } );
76
76
 
77
- it( 'should return null when maximumViewPortWidth is not a supported value or unit', () => {
77
+ it( 'should return null when maximumViewportWidth is not a supported value or unit', () => {
78
78
  const fluidTypographyValues = getComputedFluidTypographyValue( {
79
79
  fontSize: '30px',
80
- maximumViewPortWidth: 'min(calc(100% - 60px), 1200px)',
80
+ maximumViewportWidth: 'min(calc(100% - 60px), 1200px)',
81
81
  } );
82
82
  expect( fluidTypographyValues ).toBeNull();
83
83
  } );
84
84
 
85
- it( 'should return `null` font size when minimumViewPortWidth is not a supported value or unit', () => {
85
+ it( 'should return `null` font size when minimumViewportWidth is not a supported value or unit', () => {
86
86
  const fluidTypographyValues = getComputedFluidTypographyValue( {
87
87
  fontSize: '33px',
88
- minimumViewPortWidth: 'calc(100% - 60px)',
88
+ minimumViewportWidth: 'calc(100% - 60px)',
89
89
  } );
90
90
  expect( fluidTypographyValues ).toBeNull();
91
91
  } );
@@ -0,0 +1,71 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { SelectControl } from '@wordpress/components';
5
+ import { __ } from '@wordpress/i18n';
6
+
7
+ export default function ( { onChange, value, behaviors } ) {
8
+ const defaultBehaviors = {
9
+ default: {
10
+ value: 'default',
11
+ label: __( 'Default' ),
12
+ },
13
+ noBehaviors: {
14
+ value: '',
15
+ label: __( 'No behaviors' ),
16
+ },
17
+ };
18
+
19
+ const behaviorsOptions = Object.entries( behaviors ).map(
20
+ ( [ behaviorName ] ) => ( {
21
+ value: behaviorName,
22
+ // Capitalize the first letter of the behavior name.
23
+ label: `${ behaviorName.charAt( 0 ).toUpperCase() }${ behaviorName
24
+ .slice( 1 )
25
+ .toLowerCase() }`,
26
+ } )
27
+ );
28
+
29
+ const options = [
30
+ ...Object.values( defaultBehaviors ),
31
+ ...behaviorsOptions,
32
+ ];
33
+
34
+ const animations = [
35
+ {
36
+ value: 'zoom',
37
+ label: __( 'Zoom' ),
38
+ },
39
+ {
40
+ value: 'fade',
41
+ label: __( 'Fade' ),
42
+ },
43
+ ];
44
+ return (
45
+ <div style={ { marginTop: '2rem' } }>
46
+ <SelectControl
47
+ label={ __( 'Behaviors' ) }
48
+ // At the moment we are only supporting one behavior (Lightbox)
49
+ value={ value }
50
+ options={ options }
51
+ onChange={ onChange }
52
+ hideCancelButton={ true }
53
+ size="__unstable-large"
54
+ />
55
+ { value === 'lightbox' && (
56
+ <SelectControl
57
+ label={ __( 'Animation' ) }
58
+ value={
59
+ behaviors?.lightbox.animation
60
+ ? behaviors?.lightbox.animation
61
+ : ''
62
+ }
63
+ options={ animations }
64
+ onChange={ onChange }
65
+ hideCancelButton={ false }
66
+ size="__unstable-large"
67
+ />
68
+ ) }
69
+ </div>
70
+ );
71
+ }
@@ -328,22 +328,6 @@ export default function ColorPanel( {
328
328
  : gradientValue;
329
329
  };
330
330
 
331
- // Text Color
332
- const showTextPanel = useHasTextPanel( settings );
333
- const textColor = decodeValue( inheritedValue?.color?.text );
334
- const userTextColor = decodeValue( value?.color?.text );
335
- const hasTextColor = () => !! userTextColor;
336
- const setTextColor = ( newColor ) => {
337
- onChange(
338
- setImmutably(
339
- value,
340
- [ 'color', 'text' ],
341
- encodeColorValue( newColor )
342
- )
343
- );
344
- };
345
- const resetTextColor = () => setTextColor( undefined );
346
-
347
331
  // BackgroundColor
348
332
  const showBackgroundPanel = useHasBackgroundPanel( settings );
349
333
  const backgroundColor = decodeValue( inheritedValue?.color?.background );
@@ -424,6 +408,29 @@ export default function ColorPanel( {
424
408
  onChange( newValue );
425
409
  };
426
410
 
411
+ // Text Color
412
+ const showTextPanel = useHasTextPanel( settings );
413
+ const textColor = decodeValue( inheritedValue?.color?.text );
414
+ const userTextColor = decodeValue( value?.color?.text );
415
+ const hasTextColor = () => !! userTextColor;
416
+ const setTextColor = ( newColor ) => {
417
+ let changedObject = setImmutably(
418
+ value,
419
+ [ 'color', 'text' ],
420
+ encodeColorValue( newColor )
421
+ );
422
+ if ( textColor === linkColor ) {
423
+ changedObject = setImmutably(
424
+ changedObject,
425
+ [ 'elements', 'link', 'color', 'text' ],
426
+ encodeColorValue( newColor )
427
+ );
428
+ }
429
+
430
+ onChange( changedObject );
431
+ };
432
+ const resetTextColor = () => setTextColor( undefined );
433
+
427
434
  // Elements
428
435
  const elements = [
429
436
  {
@@ -207,18 +207,24 @@ export default function DimensionsPanel( {
207
207
  // in global styles but not in block inspector.
208
208
  includeLayoutControls = false,
209
209
  } ) {
210
+ const { dimensions, spacing } = settings;
211
+
210
212
  const decodeValue = ( rawValue ) => {
211
213
  if ( rawValue && typeof rawValue === 'object' ) {
212
214
  return Object.keys( rawValue ).reduce( ( acc, key ) => {
213
215
  acc[ key ] = getValueFromVariable(
214
- { settings },
216
+ { settings: { dimensions, spacing } },
215
217
  '',
216
218
  rawValue[ key ]
217
219
  );
218
220
  return acc;
219
221
  }, {} );
220
222
  }
221
- return getValueFromVariable( { settings }, '', rawValue );
223
+ return getValueFromVariable(
224
+ { settings: { dimensions, spacing } },
225
+ '',
226
+ rawValue
227
+ );
222
228
  };
223
229
 
224
230
  const showSpacingPresetsControl = useHasSpacingPresets( settings );
@@ -1,12 +1,8 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { get } from 'lodash';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
9
4
  import { scopeSelector } from './utils';
5
+ import { getValueFromObjectPath } from '../../utils/object';
10
6
 
11
7
  /**
12
8
  * Determine the CSS selector for the block type and target provided, returning
@@ -69,15 +65,15 @@ export function getBlockCSSSelector(
69
65
  if ( hasSelectors ) {
70
66
  // Get selector from either `feature.root` or shorthand path.
71
67
  const featureSelector =
72
- get( selectors, `${ path }.root`, null ) ||
73
- get( selectors, path, null );
68
+ getValueFromObjectPath( selectors, `${ path }.root`, null ) ||
69
+ getValueFromObjectPath( selectors, path, null );
74
70
 
75
71
  // Return feature selector if found or any available fallback.
76
72
  return featureSelector || fallbackSelector;
77
73
  }
78
74
 
79
75
  // Try getting old experimental supports selector value.
80
- const featureSelector = get(
76
+ const featureSelector = getValueFromObjectPath(
81
77
  supports,
82
78
  `${ path }.__experimentalSelector`,
83
79
  null
@@ -98,7 +94,7 @@ export function getBlockCSSSelector(
98
94
 
99
95
  // Use selectors API if available.
100
96
  if ( hasSelectors ) {
101
- subfeatureSelector = get( selectors, path, null );
97
+ subfeatureSelector = getValueFromObjectPath( selectors, path, null );
102
98
  }
103
99
 
104
100
  // Only return if we have a subfeature selector.