@wordpress/block-editor 12.17.0 → 12.18.1

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 (421) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +32 -0
  3. package/build/components/block-draggable/index.js +11 -3
  4. package/build/components/block-draggable/index.js.map +1 -1
  5. package/build/components/block-edit/context.js +3 -1
  6. package/build/components/block-edit/context.js.map +1 -1
  7. package/build/components/block-edit/index.js +4 -2
  8. package/build/components/block-edit/index.js.map +1 -1
  9. package/build/components/block-editing-mode/index.js +6 -3
  10. package/build/components/block-editing-mode/index.js.map +1 -1
  11. package/build/components/block-inspector/index.js +5 -2
  12. package/build/components/block-inspector/index.js.map +1 -1
  13. package/build/components/block-list/block.js +4 -3
  14. package/build/components/block-list/block.js.map +1 -1
  15. package/build/components/block-list/block.native.js +9 -5
  16. package/build/components/block-list/block.native.js.map +1 -1
  17. package/build/components/block-list/index.js +30 -4
  18. package/build/components/block-list/index.js.map +1 -1
  19. package/build/components/block-list/private-block-context.js +1 -1
  20. package/build/components/block-list/private-block-context.js.map +1 -1
  21. package/build/components/block-list/use-in-between-inserter.js +1 -1
  22. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  23. package/build/components/block-lock/toolbar.js +8 -2
  24. package/build/components/block-lock/toolbar.js.map +1 -1
  25. package/build/components/block-popover/inbetween.js +15 -3
  26. package/build/components/block-popover/inbetween.js.map +1 -1
  27. package/build/components/block-preview/auto.js +1 -1
  28. package/build/components/block-preview/auto.js.map +1 -1
  29. package/build/components/block-removal-warning-modal/index.js +3 -2
  30. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  31. package/build/components/block-settings-menu/block-settings-dropdown.js +2 -4
  32. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  33. package/build/components/block-switcher/block-transformations-menu.js +12 -1
  34. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  35. package/build/components/block-switcher/index.js +119 -90
  36. package/build/components/block-switcher/index.js.map +1 -1
  37. package/build/components/block-tools/insertion-point.js +10 -3
  38. package/build/components/block-tools/insertion-point.js.map +1 -1
  39. package/build/components/dimensions-tool/aspect-ratio-tool.js +2 -1
  40. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  41. package/build/components/font-sizes/fluid-utils.js +7 -1
  42. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  43. package/build/components/global-styles/border-panel.js +5 -14
  44. package/build/components/global-styles/border-panel.js.map +1 -1
  45. package/build/components/global-styles/dimensions-panel.js +30 -5
  46. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  47. package/build/components/global-styles/effects-panel.js +7 -1
  48. package/build/components/global-styles/effects-panel.js.map +1 -1
  49. package/build/components/global-styles/hooks.js +11 -8
  50. package/build/components/global-styles/hooks.js.map +1 -1
  51. package/build/components/global-styles/typography-panel.js +31 -14
  52. package/build/components/global-styles/typography-panel.js.map +1 -1
  53. package/build/components/global-styles/use-global-styles-output.js +6 -0
  54. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  55. package/build/components/iframe/get-compatibility-styles.js +99 -0
  56. package/build/components/iframe/get-compatibility-styles.js.map +1 -0
  57. package/build/components/iframe/index.js +2 -3
  58. package/build/components/iframe/index.js.map +1 -1
  59. package/build/components/index.js +16 -2
  60. package/build/components/index.js.map +1 -1
  61. package/build/components/index.native.js +16 -2
  62. package/build/components/index.native.js.map +1 -1
  63. package/build/components/inspector-controls/groups.js +2 -0
  64. package/build/components/inspector-controls/groups.js.map +1 -1
  65. package/build/components/inspector-controls-tabs/styles-tab.js +3 -0
  66. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  67. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
  68. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  69. package/build/components/link-control/link-preview.js +30 -26
  70. package/build/components/link-control/link-preview.js.map +1 -1
  71. package/build/components/link-control/search-input.js +1 -9
  72. package/build/components/link-control/search-input.js.map +1 -1
  73. package/build/components/list-view/block-contents.js +3 -1
  74. package/build/components/list-view/block-contents.js.map +1 -1
  75. package/build/components/list-view/block.js +10 -1
  76. package/build/components/list-view/block.js.map +1 -1
  77. package/build/components/list-view/branch.js +29 -8
  78. package/build/components/list-view/branch.js.map +1 -1
  79. package/build/components/list-view/drop-indicator.js +100 -32
  80. package/build/components/list-view/drop-indicator.js.map +1 -1
  81. package/build/components/list-view/index.js +52 -4
  82. package/build/components/list-view/index.js.map +1 -1
  83. package/build/components/list-view/leaf.js +2 -2
  84. package/build/components/list-view/leaf.js.map +1 -1
  85. package/build/components/list-view/use-list-view-block-indexes.js +30 -0
  86. package/build/components/list-view/use-list-view-block-indexes.js.map +1 -0
  87. package/build/components/list-view/use-list-view-drop-zone.js +56 -5
  88. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  89. package/build/components/list-view/utils.js +92 -0
  90. package/build/components/list-view/utils.js.map +1 -1
  91. package/build/components/provider/index.js +1 -1
  92. package/build/components/provider/index.js.map +1 -1
  93. package/build/components/recursion-provider/index.js +21 -0
  94. package/build/components/recursion-provider/index.js.map +1 -1
  95. package/build/components/rich-text/index.js +30 -6
  96. package/build/components/rich-text/index.js.map +1 -1
  97. package/build/components/rich-text/native/index.native.js +9 -9
  98. package/build/components/rich-text/native/index.native.js.map +1 -1
  99. package/build/components/use-block-drop-zone/index.js +30 -7
  100. package/build/components/use-block-drop-zone/index.js.map +1 -1
  101. package/build/components/use-on-block-drop/index.js +50 -8
  102. package/build/components/use-on-block-drop/index.js.map +1 -1
  103. package/build/hooks/block-hooks.js +5 -14
  104. package/build/hooks/block-hooks.js.map +1 -1
  105. package/build/hooks/content-lock-ui.js +17 -42
  106. package/build/hooks/content-lock-ui.js.map +1 -1
  107. package/build/hooks/dimensions.js +71 -1
  108. package/build/hooks/dimensions.js.map +1 -1
  109. package/build/hooks/effects.js +66 -0
  110. package/build/hooks/effects.js.map +1 -0
  111. package/build/hooks/index.js +17 -4
  112. package/build/hooks/index.js.map +1 -1
  113. package/build/hooks/index.native.js +13 -0
  114. package/build/hooks/index.native.js.map +1 -1
  115. package/build/hooks/style.js +9 -2
  116. package/build/hooks/style.js.map +1 -1
  117. package/build/hooks/supports.js +2 -1
  118. package/build/hooks/supports.js.map +1 -1
  119. package/build/hooks/typography.native.js +2 -2
  120. package/build/hooks/typography.native.js.map +1 -1
  121. package/build/hooks/use-bindings-attributes.js +115 -0
  122. package/build/hooks/use-bindings-attributes.js.map +1 -0
  123. package/build/hooks/use-shadow-props.js +46 -0
  124. package/build/hooks/use-shadow-props.js.map +1 -0
  125. package/build/hooks/utils.js +12 -7
  126. package/build/hooks/utils.js.map +1 -1
  127. package/build/index.js +14 -0
  128. package/build/index.js.map +1 -1
  129. package/build/store/actions.js +10 -6
  130. package/build/store/actions.js.map +1 -1
  131. package/build/store/index.js +2 -0
  132. package/build/store/index.js.map +1 -1
  133. package/build/store/private-actions.js +37 -0
  134. package/build/store/private-actions.js.map +1 -1
  135. package/build/store/private-selectors.js +60 -9
  136. package/build/store/private-selectors.js.map +1 -1
  137. package/build/store/reducer.js +44 -3
  138. package/build/store/reducer.js.map +1 -1
  139. package/build/store/resolvers.js +27 -0
  140. package/build/store/resolvers.js.map +1 -0
  141. package/build/store/selectors.js +94 -56
  142. package/build/store/selectors.js.map +1 -1
  143. package/build/store/utils.js +5 -26
  144. package/build/store/utils.js.map +1 -1
  145. package/build/utils/index.js +0 -16
  146. package/build/utils/index.js.map +1 -1
  147. package/build/utils/math.js +13 -0
  148. package/build/utils/math.js.map +1 -1
  149. package/build/utils/object.js +17 -0
  150. package/build/utils/object.js.map +1 -1
  151. package/build/utils/transform-styles/index.js +37 -27
  152. package/build/utils/transform-styles/index.js.map +1 -1
  153. package/build-module/components/block-draggable/index.js +11 -3
  154. package/build-module/components/block-draggable/index.js.map +1 -1
  155. package/build-module/components/block-edit/context.js +1 -0
  156. package/build-module/components/block-edit/context.js.map +1 -1
  157. package/build-module/components/block-edit/index.js +5 -3
  158. package/build-module/components/block-edit/index.js.map +1 -1
  159. package/build-module/components/block-editing-mode/index.js +7 -4
  160. package/build-module/components/block-editing-mode/index.js.map +1 -1
  161. package/build-module/components/block-inspector/index.js +5 -2
  162. package/build-module/components/block-inspector/index.js.map +1 -1
  163. package/build-module/components/block-list/block.js +6 -5
  164. package/build-module/components/block-list/block.js.map +1 -1
  165. package/build-module/components/block-list/block.native.js +11 -7
  166. package/build-module/components/block-list/block.native.js.map +1 -1
  167. package/build-module/components/block-list/index.js +31 -5
  168. package/build-module/components/block-list/index.js.map +1 -1
  169. package/build-module/components/block-list/private-block-context.js +1 -1
  170. package/build-module/components/block-list/private-block-context.js.map +1 -1
  171. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  172. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  173. package/build-module/components/block-lock/toolbar.js +8 -2
  174. package/build-module/components/block-lock/toolbar.js.map +1 -1
  175. package/build-module/components/block-popover/inbetween.js +15 -3
  176. package/build-module/components/block-popover/inbetween.js.map +1 -1
  177. package/build-module/components/block-preview/auto.js +3 -3
  178. package/build-module/components/block-preview/auto.js.map +1 -1
  179. package/build-module/components/block-removal-warning-modal/index.js +3 -2
  180. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  181. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -4
  182. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  183. package/build-module/components/block-switcher/block-transformations-menu.js +12 -1
  184. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  185. package/build-module/components/block-switcher/index.js +116 -86
  186. package/build-module/components/block-switcher/index.js.map +1 -1
  187. package/build-module/components/block-tools/insertion-point.js +10 -3
  188. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  189. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +2 -1
  190. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  191. package/build-module/components/font-sizes/fluid-utils.js +7 -1
  192. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  193. package/build-module/components/global-styles/border-panel.js +5 -14
  194. package/build-module/components/global-styles/border-panel.js.map +1 -1
  195. package/build-module/components/global-styles/dimensions-panel.js +30 -5
  196. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  197. package/build-module/components/global-styles/effects-panel.js +7 -1
  198. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  199. package/build-module/components/global-styles/hooks.js +11 -8
  200. package/build-module/components/global-styles/hooks.js.map +1 -1
  201. package/build-module/components/global-styles/typography-panel.js +32 -15
  202. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  203. package/build-module/components/global-styles/use-global-styles-output.js +6 -0
  204. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  205. package/build-module/components/iframe/get-compatibility-styles.js +93 -0
  206. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -0
  207. package/build-module/components/iframe/index.js +2 -3
  208. package/build-module/components/iframe/index.js.map +1 -1
  209. package/build-module/components/index.js +1 -1
  210. package/build-module/components/index.js.map +1 -1
  211. package/build-module/components/index.native.js +1 -1
  212. package/build-module/components/index.native.js.map +1 -1
  213. package/build-module/components/inspector-controls/groups.js +2 -0
  214. package/build-module/components/inspector-controls/groups.js.map +1 -1
  215. package/build-module/components/inspector-controls-tabs/styles-tab.js +3 -0
  216. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  217. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
  218. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  219. package/build-module/components/link-control/link-preview.js +32 -28
  220. package/build-module/components/link-control/link-preview.js.map +1 -1
  221. package/build-module/components/link-control/search-input.js +1 -8
  222. package/build-module/components/link-control/search-input.js.map +1 -1
  223. package/build-module/components/list-view/block-contents.js +3 -1
  224. package/build-module/components/list-view/block-contents.js.map +1 -1
  225. package/build-module/components/list-view/block.js +10 -1
  226. package/build-module/components/list-view/block.js.map +1 -1
  227. package/build-module/components/list-view/branch.js +30 -9
  228. package/build-module/components/list-view/branch.js.map +1 -1
  229. package/build-module/components/list-view/drop-indicator.js +99 -32
  230. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  231. package/build-module/components/list-view/index.js +54 -6
  232. package/build-module/components/list-view/index.js.map +1 -1
  233. package/build-module/components/list-view/leaf.js +2 -2
  234. package/build-module/components/list-view/leaf.js.map +1 -1
  235. package/build-module/components/list-view/use-list-view-block-indexes.js +23 -0
  236. package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -0
  237. package/build-module/components/list-view/use-list-view-drop-zone.js +58 -7
  238. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  239. package/build-module/components/list-view/utils.js +91 -0
  240. package/build-module/components/list-view/utils.js.map +1 -1
  241. package/build-module/components/provider/index.js +1 -1
  242. package/build-module/components/provider/index.js.map +1 -1
  243. package/build-module/components/recursion-provider/index.js +17 -0
  244. package/build-module/components/recursion-provider/index.js.map +1 -1
  245. package/build-module/components/rich-text/index.js +30 -6
  246. package/build-module/components/rich-text/index.js.map +1 -1
  247. package/build-module/components/rich-text/native/index.native.js +9 -9
  248. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  249. package/build-module/components/use-block-drop-zone/index.js +31 -8
  250. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  251. package/build-module/components/use-on-block-drop/index.js +51 -9
  252. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  253. package/build-module/hooks/block-hooks.js +5 -14
  254. package/build-module/hooks/block-hooks.js.map +1 -1
  255. package/build-module/hooks/content-lock-ui.js +19 -43
  256. package/build-module/hooks/content-lock-ui.js.map +1 -1
  257. package/build-module/hooks/dimensions.js +70 -2
  258. package/build-module/hooks/dimensions.js.map +1 -1
  259. package/build-module/hooks/effects.js +51 -0
  260. package/build-module/hooks/effects.js.map +1 -0
  261. package/build-module/hooks/index.js +5 -3
  262. package/build-module/hooks/index.js.map +1 -1
  263. package/build-module/hooks/index.native.js +1 -0
  264. package/build-module/hooks/index.native.js.map +1 -1
  265. package/build-module/hooks/style.js +9 -2
  266. package/build-module/hooks/style.js.map +1 -1
  267. package/build-module/hooks/supports.js +2 -1
  268. package/build-module/hooks/supports.js.map +1 -1
  269. package/build-module/hooks/typography.native.js +2 -2
  270. package/build-module/hooks/typography.native.js.map +1 -1
  271. package/build-module/hooks/use-bindings-attributes.js +112 -0
  272. package/build-module/hooks/use-bindings-attributes.js.map +1 -0
  273. package/build-module/hooks/use-shadow-props.js +39 -0
  274. package/build-module/hooks/use-shadow-props.js.map +1 -0
  275. package/build-module/hooks/utils.js +14 -9
  276. package/build-module/hooks/utils.js.map +1 -1
  277. package/build-module/index.js +1 -1
  278. package/build-module/index.js.map +1 -1
  279. package/build-module/store/actions.js +10 -6
  280. package/build-module/store/actions.js.map +1 -1
  281. package/build-module/store/index.js +2 -0
  282. package/build-module/store/index.js.map +1 -1
  283. package/build-module/store/private-actions.js +35 -0
  284. package/build-module/store/private-actions.js.map +1 -1
  285. package/build-module/store/private-selectors.js +53 -8
  286. package/build-module/store/private-selectors.js.map +1 -1
  287. package/build-module/store/reducer.js +43 -3
  288. package/build-module/store/reducer.js.map +1 -1
  289. package/build-module/store/resolvers.js +20 -0
  290. package/build-module/store/resolvers.js.map +1 -0
  291. package/build-module/store/selectors.js +89 -52
  292. package/build-module/store/selectors.js.map +1 -1
  293. package/build-module/store/utils.js +3 -23
  294. package/build-module/store/utils.js.map +1 -1
  295. package/build-module/utils/index.js +0 -1
  296. package/build-module/utils/index.js.map +1 -1
  297. package/build-module/utils/math.js +12 -0
  298. package/build-module/utils/math.js.map +1 -1
  299. package/build-module/utils/object.js +16 -0
  300. package/build-module/utils/object.js.map +1 -1
  301. package/build-module/utils/transform-styles/index.js +36 -27
  302. package/build-module/utils/transform-styles/index.js.map +1 -1
  303. package/build-style/content-rtl.css +33 -16
  304. package/build-style/content.css +33 -16
  305. package/build-style/default-editor-styles-rtl.css +1 -1
  306. package/build-style/default-editor-styles.css +1 -1
  307. package/build-style/style-rtl.css +169 -114
  308. package/build-style/style.css +169 -114
  309. package/package.json +31 -31
  310. package/src/components/block-canvas/style.scss +8 -1
  311. package/src/components/block-draggable/index.js +16 -5
  312. package/src/components/block-edit/context.js +1 -0
  313. package/src/components/block-edit/index.js +4 -0
  314. package/src/components/block-editing-mode/index.js +12 -7
  315. package/src/components/block-inspector/index.js +5 -2
  316. package/src/components/block-list/block.js +5 -4
  317. package/src/components/block-list/block.native.js +13 -3
  318. package/src/components/block-list/content.scss +34 -5
  319. package/src/components/block-list/index.js +52 -16
  320. package/src/components/block-list/private-block-context.js +1 -1
  321. package/src/components/block-list/use-in-between-inserter.js +1 -2
  322. package/src/components/block-lock/toolbar.js +10 -2
  323. package/src/components/block-popover/inbetween.js +22 -2
  324. package/src/components/block-preview/auto.js +3 -3
  325. package/src/components/block-removal-warning-modal/index.js +3 -2
  326. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -7
  327. package/src/components/block-switcher/block-transformations-menu.js +18 -1
  328. package/src/components/block-switcher/index.js +133 -111
  329. package/src/components/block-switcher/style.scss +6 -4
  330. package/src/components/block-switcher/test/index.js +113 -230
  331. package/src/components/block-toolbar/style.scss +22 -18
  332. package/src/components/block-tools/insertion-point.js +15 -2
  333. package/src/components/block-tools/style.scss +8 -7
  334. package/src/components/dimensions-tool/aspect-ratio-tool.js +4 -1
  335. package/src/components/font-sizes/fluid-utils.js +8 -2
  336. package/src/components/font-sizes/test/fluid-utils.js +9 -0
  337. package/src/components/global-styles/border-panel.js +7 -17
  338. package/src/components/global-styles/dimensions-panel.js +50 -1
  339. package/src/components/global-styles/effects-panel.js +16 -1
  340. package/src/components/global-styles/hooks.js +11 -6
  341. package/src/components/global-styles/typography-panel.js +45 -13
  342. package/src/components/global-styles/use-global-styles-output.js +6 -0
  343. package/src/components/iframe/get-compatibility-styles.js +120 -0
  344. package/src/components/iframe/index.js +2 -3
  345. package/src/components/index.js +4 -2
  346. package/src/components/index.native.js +4 -2
  347. package/src/components/inspector-controls/groups.js +2 -0
  348. package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
  349. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -0
  350. package/src/components/link-control/link-preview.js +31 -55
  351. package/src/components/link-control/search-input.js +1 -9
  352. package/src/components/link-control/style.scss +31 -85
  353. package/src/components/link-control/test/index.js +2 -1
  354. package/src/components/list-view/block-contents.js +5 -1
  355. package/src/components/list-view/block.js +9 -0
  356. package/src/components/list-view/branch.js +30 -10
  357. package/src/components/list-view/drop-indicator.js +139 -46
  358. package/src/components/list-view/index.js +74 -3
  359. package/src/components/list-view/leaf.js +2 -2
  360. package/src/components/list-view/style.scss +102 -13
  361. package/src/components/list-view/test/use-list-view-drop-zone.js +4 -0
  362. package/src/components/list-view/test/utils.js +218 -1
  363. package/src/components/list-view/use-list-view-block-indexes.js +29 -0
  364. package/src/components/list-view/use-list-view-drop-zone.js +78 -6
  365. package/src/components/list-view/utils.js +116 -0
  366. package/src/components/provider/index.js +3 -1
  367. package/src/components/recursion-provider/README.md +2 -2
  368. package/src/components/recursion-provider/index.js +17 -0
  369. package/src/components/rich-text/index.js +48 -10
  370. package/src/components/rich-text/native/index.native.js +10 -10
  371. package/src/components/use-block-drop-zone/index.js +60 -19
  372. package/src/components/use-block-drop-zone/test/index.js +32 -61
  373. package/src/components/use-on-block-drop/index.js +92 -11
  374. package/src/hooks/block-hooks.js +5 -17
  375. package/src/hooks/content-lock-ui.js +15 -55
  376. package/src/hooks/dimensions.js +74 -3
  377. package/src/hooks/effects.js +57 -0
  378. package/src/hooks/index.js +4 -2
  379. package/src/hooks/index.native.js +1 -0
  380. package/src/hooks/style.js +12 -0
  381. package/src/hooks/supports.js +2 -0
  382. package/src/hooks/test/effects.js +39 -0
  383. package/src/hooks/typography.native.js +2 -2
  384. package/src/hooks/use-bindings-attributes.js +148 -0
  385. package/src/hooks/use-shadow-props.js +37 -0
  386. package/src/hooks/utils.js +30 -10
  387. package/src/index.js +2 -0
  388. package/src/store/actions.js +9 -4
  389. package/src/store/index.js +2 -0
  390. package/src/store/private-actions.js +32 -0
  391. package/src/store/private-selectors.js +78 -21
  392. package/src/store/reducer.js +49 -2
  393. package/src/store/resolvers.js +17 -0
  394. package/src/store/selectors.js +169 -161
  395. package/src/store/test/registry-selectors.js +431 -0
  396. package/src/store/test/selectors.js +14 -400
  397. package/src/store/utils.js +10 -33
  398. package/src/style.scss +0 -1
  399. package/src/utils/index.js +0 -1
  400. package/src/utils/math.js +12 -0
  401. package/src/utils/object.js +16 -0
  402. package/src/utils/transform-styles/index.js +52 -37
  403. package/tsconfig.tsbuildinfo +1 -1
  404. package/build/components/iframe/use-compatibility-styles.js +0 -100
  405. package/build/components/iframe/use-compatibility-styles.js.map +0 -1
  406. package/build/hooks/custom-fields.js +0 -106
  407. package/build/hooks/custom-fields.js.map +0 -1
  408. package/build/utils/block-variation-transforms.js +0 -42
  409. package/build/utils/block-variation-transforms.js.map +0 -1
  410. package/build-module/components/iframe/use-compatibility-styles.js +0 -94
  411. package/build-module/components/iframe/use-compatibility-styles.js.map +0 -1
  412. package/build-module/hooks/custom-fields.js +0 -99
  413. package/build-module/hooks/custom-fields.js.map +0 -1
  414. package/build-module/utils/block-variation-transforms.js +0 -35
  415. package/build-module/utils/block-variation-transforms.js.map +0 -1
  416. package/src/components/block-switcher/test/__snapshots__/index.js.snap +0 -116
  417. package/src/components/contrast-checker/style.scss +0 -3
  418. package/src/components/iframe/use-compatibility-styles.js +0 -122
  419. package/src/hooks/custom-fields.js +0 -115
  420. package/src/utils/block-variation-transforms.js +0 -38
  421. package/src/utils/test/block-variation-transforms.js +0 -94
@@ -1,7 +1,12 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import classnames from 'classnames';
5
+
1
6
  /**
2
7
  * WordPress dependencies
3
8
  */
4
- import { useState, useEffect, useCallback } from '@wordpress/element';
9
+ import { Platform, useState, useEffect, useCallback } from '@wordpress/element';
5
10
  import { useDispatch, useSelect } from '@wordpress/data';
6
11
  import { getBlockSupport } from '@wordpress/blocks';
7
12
  import deprecated from '@wordpress/deprecated';
@@ -18,8 +23,7 @@ import { MarginVisualizer } from './margin';
18
23
  import { PaddingVisualizer } from './padding';
19
24
  import { store as blockEditorStore } from '../store';
20
25
  import { unlock } from '../lock-unlock';
21
-
22
- import { cleanEmptyObject } from './utils';
26
+ import { cleanEmptyObject, shouldSkipSerialization } from './utils';
23
27
 
24
28
  export const DIMENSIONS_SUPPORT_KEY = 'dimensions';
25
29
  export const SPACING_SUPPORT_KEY = 'spacing';
@@ -125,6 +129,73 @@ export function DimensionsPanel( { clientId, name, setAttributes, settings } ) {
125
129
  );
126
130
  }
127
131
 
132
+ /**
133
+ * Determine whether there is block support for dimensions.
134
+ *
135
+ * @param {string} blockName Block name.
136
+ * @param {string} feature Background image feature to check for.
137
+ *
138
+ * @return {boolean} Whether there is support.
139
+ */
140
+ export function hasDimensionsSupport( blockName, feature = 'any' ) {
141
+ if ( Platform.OS !== 'web' ) {
142
+ return false;
143
+ }
144
+
145
+ const support = getBlockSupport( blockName, DIMENSIONS_SUPPORT_KEY );
146
+
147
+ if ( support === true ) {
148
+ return true;
149
+ }
150
+
151
+ if ( feature === 'any' ) {
152
+ return !! ( support?.aspectRatio || !! support?.minHeight );
153
+ }
154
+
155
+ return !! support?.[ feature ];
156
+ }
157
+
158
+ export default {
159
+ useBlockProps,
160
+ attributeKeys: [ 'minHeight', 'style' ],
161
+ hasSupport( name ) {
162
+ return hasDimensionsSupport( name, 'aspectRatio' );
163
+ },
164
+ };
165
+
166
+ function useBlockProps( { name, minHeight, style } ) {
167
+ if (
168
+ ! hasDimensionsSupport( name, 'aspectRatio' ) ||
169
+ shouldSkipSerialization( name, DIMENSIONS_SUPPORT_KEY, 'aspectRatio' )
170
+ ) {
171
+ return {};
172
+ }
173
+
174
+ const className = classnames( {
175
+ 'has-aspect-ratio': !! style?.dimensions?.aspectRatio,
176
+ } );
177
+
178
+ // Allow dimensions-based inline style overrides to override any global styles rules that
179
+ // might be set for the block, and therefore affect the display of the aspect ratio.
180
+ const inlineStyleOverrides = {};
181
+
182
+ // Apply rules to unset incompatible styles.
183
+ // Note that a set `aspectRatio` will win out if both an aspect ratio and a minHeight are set.
184
+ // This is because the aspect ratio is a newer block support, so (in theory) any aspect ratio
185
+ // that is set should be intentional and should override any existing minHeight. The Cover block
186
+ // and dimensions controls have logic that will manually clear the aspect ratio if a minHeight
187
+ // is set.
188
+ if ( style?.dimensions?.aspectRatio ) {
189
+ // To ensure the aspect ratio does not get overridden by `minHeight` unset any existing rule.
190
+ inlineStyleOverrides.minHeight = 'unset';
191
+ } else if ( minHeight || style?.dimensions?.minHeight ) {
192
+ // To ensure the minHeight does not get overridden by `aspectRatio` unset any existing rule.
193
+ inlineStyleOverrides.aspectRatio = 'unset';
194
+ }
195
+
196
+ return { className, style: inlineStyleOverrides };
197
+ }
198
+
128
199
  /**
129
200
  * @deprecated
130
201
  */
@@ -0,0 +1,57 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { hasBlockSupport } from '@wordpress/blocks';
5
+ import { useSelect } from '@wordpress/data';
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import StylesEffectsPanel, {
10
+ useHasEffectsPanel,
11
+ } from '../components/global-styles/effects-panel';
12
+ import { InspectorControls } from '../components';
13
+ import { store as blockEditorStore } from '../store';
14
+ import { cleanEmptyObject } from './utils';
15
+
16
+ export const SHADOW_SUPPORT_KEY = 'shadow';
17
+ export const EFFECTS_SUPPORT_KEYS = [ SHADOW_SUPPORT_KEY ];
18
+
19
+ export function hasEffectsSupport( blockName ) {
20
+ return EFFECTS_SUPPORT_KEYS.some( ( key ) =>
21
+ hasBlockSupport( blockName, key )
22
+ );
23
+ }
24
+
25
+ function EffectsInspectorControl( { children, resetAllFilter } ) {
26
+ return (
27
+ <InspectorControls group="effects" resetAllFilter={ resetAllFilter }>
28
+ { children }
29
+ </InspectorControls>
30
+ );
31
+ }
32
+ export function EffectsPanel( { clientId, setAttributes, settings } ) {
33
+ const isEnabled = useHasEffectsPanel( settings );
34
+ const value = useSelect(
35
+ ( select ) =>
36
+ select( blockEditorStore ).getBlockAttributes( clientId )?.style,
37
+ [ clientId ]
38
+ );
39
+
40
+ const onChange = ( newStyle ) => {
41
+ setAttributes( { style: cleanEmptyObject( newStyle ) } );
42
+ };
43
+
44
+ if ( ! isEnabled ) {
45
+ return null;
46
+ }
47
+
48
+ return (
49
+ <StylesEffectsPanel
50
+ as={ EffectsInspectorControl }
51
+ panelId={ clientId }
52
+ settings={ settings }
53
+ value={ value }
54
+ onChange={ onChange }
55
+ />
56
+ );
57
+ }
@@ -16,6 +16,7 @@ import './generated-class-name';
16
16
  import style from './style';
17
17
  import './settings';
18
18
  import color from './color';
19
+ import dimensions from './dimensions';
19
20
  import duotone from './duotone';
20
21
  import fontFamily from './font-family';
21
22
  import fontSize from './font-size';
@@ -25,9 +26,9 @@ import layout from './layout';
25
26
  import childLayout from './layout-child';
26
27
  import contentLockUI from './content-lock-ui';
27
28
  import './metadata';
28
- import customFields from './custom-fields';
29
29
  import blockHooks from './block-hooks';
30
30
  import blockRenaming from './block-renaming';
31
+ import './use-bindings-attributes';
31
32
 
32
33
  createBlockEditFilter(
33
34
  [
@@ -39,7 +40,6 @@ createBlockEditFilter(
39
40
  position,
40
41
  layout,
41
42
  contentLockUI,
42
- window.__experimentalConnections ? customFields : null,
43
43
  blockHooks,
44
44
  blockRenaming,
45
45
  ].filter( Boolean )
@@ -48,6 +48,7 @@ createBlockListBlockFilter( [
48
48
  align,
49
49
  style,
50
50
  color,
51
+ dimensions,
51
52
  duotone,
52
53
  fontFamily,
53
54
  fontSize,
@@ -70,6 +71,7 @@ createBlockSaveFilter( [
70
71
  export { useCustomSides } from './dimensions';
71
72
  export { useLayoutClasses, useLayoutStyles } from './layout';
72
73
  export { getBorderClassesAndStyles, useBorderProps } from './use-border-props';
74
+ export { getShadowClassesAndStyles, useShadowProps } from './use-shadow-props';
73
75
  export { getColorClassesAndStyles, useColorProps } from './use-color-props';
74
76
  export { getSpacingClassesAndStyles } from './use-spacing-props';
75
77
  export { getTypographyClassesAndStyles } from './use-typography-props';
@@ -28,6 +28,7 @@ createBlockSaveFilter( [
28
28
  ] );
29
29
 
30
30
  export { getBorderClassesAndStyles, useBorderProps } from './use-border-props';
31
+ export { getShadowClassesAndStyles, useShadowProps } from './use-shadow-props';
31
32
  export { getColorClassesAndStyles, useColorProps } from './use-color-props';
32
33
  export { getSpacingClassesAndStyles } from './use-spacing-props';
33
34
  export { useCachedTruthy } from './use-cached-truthy';
@@ -27,6 +27,11 @@ import {
27
27
  SPACING_SUPPORT_KEY,
28
28
  DimensionsPanel,
29
29
  } from './dimensions';
30
+ import {
31
+ EFFECTS_SUPPORT_KEYS,
32
+ SHADOW_SUPPORT_KEY,
33
+ EffectsPanel,
34
+ } from './effects';
30
35
  import {
31
36
  shouldSkipSerialization,
32
37
  useStyleOverride,
@@ -37,6 +42,7 @@ import { useBlockEditingMode } from '../components/block-editing-mode';
37
42
 
38
43
  const styleSupportKeys = [
39
44
  ...TYPOGRAPHY_SUPPORT_KEYS,
45
+ ...EFFECTS_SUPPORT_KEYS,
40
46
  BORDER_SUPPORT_KEY,
41
47
  COLOR_SUPPORT_KEY,
42
48
  DIMENSIONS_SUPPORT_KEY,
@@ -110,6 +116,7 @@ const skipSerializationPathsEdit = {
110
116
  [ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
111
117
  SPACING_SUPPORT_KEY,
112
118
  ],
119
+ [ `${ SHADOW_SUPPORT_KEY }` ]: [ SHADOW_SUPPORT_KEY ],
113
120
  };
114
121
 
115
122
  /**
@@ -126,10 +133,14 @@ const skipSerializationPathsEdit = {
126
133
  */
127
134
  const skipSerializationPathsSave = {
128
135
  ...skipSerializationPathsEdit,
136
+ [ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: [
137
+ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio`,
138
+ ], // Skip serialization of aspect ratio in save mode.
129
139
  [ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.
130
140
  };
131
141
 
132
142
  const skipSerializationPathsSaveChecks = {
143
+ [ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: true,
133
144
  [ `${ BACKGROUND_SUPPORT_KEY }` ]: true,
134
145
  };
135
146
 
@@ -336,6 +347,7 @@ function BlockStyleControls( {
336
347
  <TypographyPanel { ...passedProps } />
337
348
  <BorderPanel { ...passedProps } />
338
349
  <DimensionsPanel { ...passedProps } />
350
+ <EffectsPanel { ...passedProps } />
339
351
  </>
340
352
  );
341
353
  }
@@ -59,8 +59,10 @@ const TYPOGRAPHY_SUPPORT_KEYS = [
59
59
  WRITING_MODE_SUPPORT_KEY,
60
60
  LETTER_SPACING_SUPPORT_KEY,
61
61
  ];
62
+ const EFFECTS_SUPPORT_KEYS = [ 'shadow' ];
62
63
  const SPACING_SUPPORT_KEY = 'spacing';
63
64
  const styleSupportKeys = [
65
+ ...EFFECTS_SUPPORT_KEYS,
64
66
  ...TYPOGRAPHY_SUPPORT_KEYS,
65
67
  BORDER_SUPPORT_KEY,
66
68
  COLOR_SUPPORT_KEY,
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { hasEffectsSupport } from '../effects';
5
+
6
+ describe( 'effects', () => {
7
+ describe( 'hasEffectsSupport', () => {
8
+ it( 'should return false if the block does not support effects', () => {
9
+ const settings = {
10
+ supports: {
11
+ shadow: false,
12
+ },
13
+ };
14
+
15
+ expect( hasEffectsSupport( settings ) ).toBe( false );
16
+ } );
17
+
18
+ it( 'should return true if the block supports effects', () => {
19
+ const settings = {
20
+ supports: {
21
+ shadow: true,
22
+ },
23
+ };
24
+
25
+ expect( hasEffectsSupport( settings ) ).toBe( true );
26
+ } );
27
+
28
+ it( 'should return true if the block supports effects and other features', () => {
29
+ const settings = {
30
+ supports: {
31
+ shadow: true,
32
+ align: true,
33
+ },
34
+ };
35
+
36
+ expect( hasEffectsSupport( settings ) ).toBe( true );
37
+ } );
38
+ } );
39
+ } );
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useSelect } from '@wordpress/data';
5
- import { pure } from '@wordpress/compose';
5
+ import { memo } from '@wordpress/element';
6
6
  import { PanelBody } from '@wordpress/components';
7
7
  import { __ } from '@wordpress/i18n';
8
8
 
@@ -57,4 +57,4 @@ function TypographyPanelPure( { clientId, setAttributes, settings } ) {
57
57
  // We don't want block controls to re-render when typing inside a block. `pure`
58
58
  // will prevent re-renders unless props change, so only pass the needed props
59
59
  // and not the whole attributes object.
60
- export const TypographyPanel = pure( TypographyPanelPure );
60
+ export const TypographyPanel = memo( TypographyPanelPure );
@@ -0,0 +1,148 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { getBlockType } from '@wordpress/blocks';
5
+ import { createHigherOrderComponent } from '@wordpress/compose';
6
+ import { useRegistry, useSelect } from '@wordpress/data';
7
+ import { addFilter } from '@wordpress/hooks';
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import { store as blockEditorStore } from '../store';
12
+ import { useBlockEditContext } from '../components/block-edit/context';
13
+ import { unlock } from '../lock-unlock';
14
+
15
+ /** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */
16
+ /** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */
17
+
18
+ /**
19
+ * Given a binding of block attributes, returns a higher order component that
20
+ * overrides its `attributes` and `setAttributes` props to sync any changes needed.
21
+ *
22
+ * @return {WPHigherOrderComponent} Higher-order component.
23
+ */
24
+
25
+ const BLOCK_BINDINGS_ALLOWED_BLOCKS = {
26
+ 'core/paragraph': [ 'content' ],
27
+ 'core/heading': [ 'content' ],
28
+ 'core/image': [ 'url', 'title', 'alt' ],
29
+ 'core/button': [ 'url', 'text', 'linkTarget' ],
30
+ };
31
+
32
+ const createEditFunctionWithBindingsAttribute = () =>
33
+ createHigherOrderComponent(
34
+ ( BlockEdit ) => ( props ) => {
35
+ const { clientId, name: blockName } = useBlockEditContext();
36
+ const { getBlockBindingsSource } = unlock(
37
+ useSelect( blockEditorStore )
38
+ );
39
+ const { getBlockAttributes, updateBlockAttributes } =
40
+ useSelect( blockEditorStore );
41
+
42
+ const updatedAttributes = getBlockAttributes( clientId );
43
+ if ( updatedAttributes?.metadata?.bindings ) {
44
+ Object.entries( updatedAttributes.metadata.bindings ).forEach(
45
+ ( [ attributeName, settings ] ) => {
46
+ const source = getBlockBindingsSource(
47
+ settings.source.name
48
+ );
49
+
50
+ if ( source ) {
51
+ // Second argument (`updateMetaValue`) will be used to update the value in the future.
52
+ const {
53
+ placeholder,
54
+ useValue: [ metaValue = null ] = [],
55
+ } = source.useSource(
56
+ props,
57
+ settings.source.attributes
58
+ );
59
+
60
+ if ( placeholder && ! metaValue ) {
61
+ // If the attribute is `src` or `href`, a placeholder can't be used because it is not a valid url.
62
+ // Adding this workaround until attributes and metadata fields types are improved and include `url`.
63
+ const htmlAttribute =
64
+ getBlockType( blockName ).attributes[
65
+ attributeName
66
+ ].attribute;
67
+ if (
68
+ htmlAttribute === 'src' ||
69
+ htmlAttribute === 'href'
70
+ ) {
71
+ updatedAttributes[ attributeName ] = null;
72
+ } else {
73
+ updatedAttributes[ attributeName ] =
74
+ placeholder;
75
+ }
76
+ }
77
+
78
+ if ( metaValue ) {
79
+ updatedAttributes[ attributeName ] = metaValue;
80
+ }
81
+ }
82
+ }
83
+ );
84
+ }
85
+
86
+ const registry = useRegistry();
87
+
88
+ return (
89
+ <>
90
+ <BlockEdit
91
+ key="edit"
92
+ attributes={ updatedAttributes }
93
+ setAttributes={ ( newAttributes, blockId ) =>
94
+ registry.batch( () =>
95
+ updateBlockAttributes( blockId, newAttributes )
96
+ )
97
+ }
98
+ { ...props }
99
+ />
100
+ </>
101
+ );
102
+ },
103
+ 'useBoundAttributes'
104
+ );
105
+
106
+ /**
107
+ * Filters a registered block's settings to enhance a block's `edit` component
108
+ * to upgrade bound attributes.
109
+ *
110
+ * @param {WPBlockSettings} settings Registered block settings.
111
+ *
112
+ * @return {WPBlockSettings} Filtered block settings.
113
+ */
114
+ function shimAttributeSource( settings ) {
115
+ if ( ! ( settings.name in BLOCK_BINDINGS_ALLOWED_BLOCKS ) ) {
116
+ return settings;
117
+ }
118
+ settings.edit = createEditFunctionWithBindingsAttribute()( settings.edit );
119
+
120
+ return settings;
121
+ }
122
+
123
+ addFilter(
124
+ 'blocks.registerBlockType',
125
+ 'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',
126
+ shimAttributeSource
127
+ );
128
+
129
+ // Add the context to all blocks.
130
+ addFilter(
131
+ 'blocks.registerBlockType',
132
+ 'core/block-bindings-ui',
133
+ ( settings, name ) => {
134
+ if ( ! ( name in BLOCK_BINDINGS_ALLOWED_BLOCKS ) ) {
135
+ return settings;
136
+ }
137
+ const contextItems = [ 'postId', 'postType', 'queryId' ];
138
+ const usesContextArray = settings.usesContext;
139
+ const oldUsesContextArray = new Set( usesContextArray );
140
+ contextItems.forEach( ( item ) => {
141
+ if ( ! oldUsesContextArray.has( item ) ) {
142
+ usesContextArray.push( item );
143
+ }
144
+ } );
145
+ settings.usesContext = usesContextArray;
146
+ return settings;
147
+ }
148
+ );
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { getInlineStyles } from './style';
5
+
6
+ // This utility is intended to assist where the serialization of the shadow
7
+ // block support is being skipped for a block but the shadow related CSS classes
8
+ // & styles still need to be generated so they can be applied to inner elements.
9
+
10
+ /**
11
+ * Provides the CSS class names and inline styles for a block's shadow support
12
+ * attributes.
13
+ *
14
+ * @param {Object} attributes Block attributes.
15
+ * @return {Object} Shadow block support derived CSS classes & styles.
16
+ */
17
+ export function getShadowClassesAndStyles( attributes ) {
18
+ const shadow = attributes.style?.shadow || '';
19
+
20
+ return {
21
+ className: undefined,
22
+ style: getInlineStyles( { shadow } ),
23
+ };
24
+ }
25
+
26
+ /**
27
+ * Derives the shadow related props for a block from its shadow block support
28
+ * attributes.
29
+ *
30
+ * @param {Object} attributes Block attributes.
31
+ *
32
+ * @return {Object} ClassName & style props from shadow block support.
33
+ */
34
+ export function useShadowProps( attributes ) {
35
+ const shadowProps = getShadowClassesAndStyles( attributes );
36
+ return shadowProps;
37
+ }
@@ -2,9 +2,9 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { getBlockSupport } from '@wordpress/blocks';
5
- import { useMemo, useEffect, useId, useState } from '@wordpress/element';
5
+ import { memo, useMemo, useEffect, useId, useState } from '@wordpress/element';
6
6
  import { useDispatch } from '@wordpress/data';
7
- import { createHigherOrderComponent, pure } from '@wordpress/compose';
7
+ import { createHigherOrderComponent } from '@wordpress/compose';
8
8
  import { addFilter } from '@wordpress/hooks';
9
9
 
10
10
  /**
@@ -177,7 +177,10 @@ export function useBlockSettings( name, parentLayout ) {
177
177
  backgroundImage,
178
178
  backgroundSize,
179
179
  fontFamilies,
180
- fontSizes,
180
+ userFontSizes,
181
+ themeFontSizes,
182
+ defaultFontSizes,
183
+ defaultFontSizesEnabled,
181
184
  customFontSize,
182
185
  fontStyle,
183
186
  fontWeight,
@@ -192,6 +195,7 @@ export function useBlockSettings( name, parentLayout ) {
192
195
  blockGap,
193
196
  spacingSizes,
194
197
  units,
198
+ aspectRatio,
195
199
  minHeight,
196
200
  layout,
197
201
  borderColor,
@@ -218,11 +222,15 @@ export function useBlockSettings( name, parentLayout ) {
218
222
  isTextEnabled,
219
223
  isHeadingEnabled,
220
224
  isButtonEnabled,
225
+ shadow,
221
226
  ] = useSettings(
222
227
  'background.backgroundImage',
223
228
  'background.backgroundSize',
224
229
  'typography.fontFamilies',
225
- 'typography.fontSizes',
230
+ 'typography.fontSizes.custom',
231
+ 'typography.fontSizes.theme',
232
+ 'typography.fontSizes.default',
233
+ 'typography.defaultFontSizes',
226
234
  'typography.customFontSize',
227
235
  'typography.fontStyle',
228
236
  'typography.fontWeight',
@@ -237,6 +245,7 @@ export function useBlockSettings( name, parentLayout ) {
237
245
  'spacing.blockGap',
238
246
  'spacing.spacingSizes',
239
247
  'spacing.units',
248
+ 'dimensions.aspectRatio',
240
249
  'dimensions.minHeight',
241
250
  'layout',
242
251
  'border.color',
@@ -262,7 +271,8 @@ export function useBlockSettings( name, parentLayout ) {
262
271
  'color.link',
263
272
  'color.text',
264
273
  'color.heading',
265
- 'color.button'
274
+ 'color.button',
275
+ 'shadow'
266
276
  );
267
277
 
268
278
  const rawSettings = useMemo( () => {
@@ -304,9 +314,12 @@ export function useBlockSettings( name, parentLayout ) {
304
314
  custom: fontFamilies,
305
315
  },
306
316
  fontSizes: {
307
- custom: fontSizes,
317
+ custom: userFontSizes,
318
+ theme: themeFontSizes,
319
+ default: defaultFontSizes,
308
320
  },
309
321
  customFontSize,
322
+ defaultFontSizes: defaultFontSizesEnabled,
310
323
  fontStyle,
311
324
  fontWeight,
312
325
  lineHeight,
@@ -332,16 +345,21 @@ export function useBlockSettings( name, parentLayout ) {
332
345
  width: borderWidth,
333
346
  },
334
347
  dimensions: {
348
+ aspectRatio,
335
349
  minHeight,
336
350
  },
337
351
  layout,
338
352
  parentLayout,
353
+ shadow,
339
354
  };
340
355
  }, [
341
356
  backgroundImage,
342
357
  backgroundSize,
343
358
  fontFamilies,
344
- fontSizes,
359
+ userFontSizes,
360
+ themeFontSizes,
361
+ defaultFontSizes,
362
+ defaultFontSizesEnabled,
345
363
  customFontSize,
346
364
  fontStyle,
347
365
  fontWeight,
@@ -356,6 +374,7 @@ export function useBlockSettings( name, parentLayout ) {
356
374
  blockGap,
357
375
  spacingSizes,
358
376
  units,
377
+ aspectRatio,
359
378
  minHeight,
360
379
  layout,
361
380
  parentLayout,
@@ -383,6 +402,7 @@ export function useBlockSettings( name, parentLayout ) {
383
402
  isTextEnabled,
384
403
  isHeadingEnabled,
385
404
  isButtonEnabled,
405
+ shadow,
386
406
  ] );
387
407
 
388
408
  return useSettingsForBlockElement( rawSettings, name );
@@ -390,10 +410,10 @@ export function useBlockSettings( name, parentLayout ) {
390
410
 
391
411
  export function createBlockEditFilter( features ) {
392
412
  // We don't want block controls to re-render when typing inside a block.
393
- // `pure` will prevent re-renders unless props change, so only pass the
413
+ // `memo` will prevent re-renders unless props change, so only pass the
394
414
  // needed props and not the whole attributes object.
395
415
  features = features.map( ( settings ) => {
396
- return { ...settings, Edit: pure( settings.edit ) };
416
+ return { ...settings, Edit: memo( settings.edit ) };
397
417
  } );
398
418
  const withBlockEditHooks = createHigherOrderComponent(
399
419
  ( OriginalBlockEdit ) => ( props ) => {
@@ -476,7 +496,7 @@ function BlockProps( { index, useBlockProps, setAllWrapperProps, ...props } ) {
476
496
  return null;
477
497
  }
478
498
 
479
- const BlockPropsPure = pure( BlockProps );
499
+ const BlockPropsPure = memo( BlockProps );
480
500
 
481
501
  export function createBlockListBlockFilter( features ) {
482
502
  const withBlockListBlockHooks = createHigherOrderComponent(
package/src/index.js CHANGED
@@ -11,6 +11,8 @@ export {
11
11
  useCustomSides as __experimentalUseCustomSides,
12
12
  getSpacingClassesAndStyles as __experimentalGetSpacingClassesAndStyles,
13
13
  getGapCSSValue as __experimentalGetGapCSSValue,
14
+ getShadowClassesAndStyles as __experimentalGetShadowClassesAndStyles,
15
+ useShadowProps as __experimentalUseShadowProps,
14
16
  useCachedTruthy,
15
17
  } from './hooks';
16
18
  export * from './components';