@wordpress/block-editor 12.16.0 → 12.16.1-next.79a6196f.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 (650) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +3 -6
  3. package/build/components/block-canvas/index.js +0 -2
  4. package/build/components/block-canvas/index.js.map +1 -1
  5. package/build/components/block-card/index.js +1 -1
  6. package/build/components/block-card/index.js.map +1 -1
  7. package/build/components/block-draggable/draggable-chip.js +6 -1
  8. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  9. package/build/components/block-draggable/index.js +76 -6
  10. package/build/components/block-draggable/index.js.map +1 -1
  11. package/build/components/block-draggable/index.native.js +0 -6
  12. package/build/components/block-draggable/index.native.js.map +1 -1
  13. package/build/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  14. package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  15. package/build/components/block-editing-mode/index.js +2 -3
  16. package/build/components/block-editing-mode/index.js.map +1 -1
  17. package/build/components/block-inspector/index.js +1 -1
  18. package/build/components/block-inspector/index.js.map +1 -1
  19. package/build/components/block-list/block-list-item-cell.native.js +1 -0
  20. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  21. package/build/components/block-list/block.js +245 -102
  22. package/build/components/block-list/block.js.map +1 -1
  23. package/build/components/block-list/block.native.js +46 -20
  24. package/build/components/block-list/block.native.js.map +1 -1
  25. package/build/components/block-list/index.native.js +3 -5
  26. package/build/components/block-list/index.native.js.map +1 -1
  27. package/build/components/block-list/private-block-context.js +14 -0
  28. package/build/components/block-list/private-block-context.js.map +1 -0
  29. package/build/components/block-list/use-block-props/index.js +33 -96
  30. package/build/components/block-list/use-block-props/index.js.map +1 -1
  31. package/build/components/block-list/use-in-between-inserter.js +3 -2
  32. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  33. package/build/components/block-list/use-scroll-upon-insertion.native.js +41 -0
  34. package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
  35. package/build/components/block-lock/toolbar.js +21 -27
  36. package/build/components/block-lock/toolbar.js.map +1 -1
  37. package/build/components/block-mover/index.js +2 -1
  38. package/build/components/block-mover/index.js.map +1 -1
  39. package/build/components/block-patterns-list/index.js +4 -4
  40. package/build/components/block-patterns-list/index.js.map +1 -1
  41. package/build/components/block-switcher/index.js +4 -4
  42. package/build/components/block-switcher/index.js.map +1 -1
  43. package/build/components/block-toolbar/index.js +1 -2
  44. package/build/components/block-toolbar/index.js.map +1 -1
  45. package/build/components/block-tools/block-toolbar-popover.js +0 -2
  46. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  47. package/build/components/block-variation-transforms/index.js +29 -2
  48. package/build/components/block-variation-transforms/index.js.map +1 -1
  49. package/build/components/border-radius-control/linked-button.js +1 -1
  50. package/build/components/border-radius-control/linked-button.js.map +1 -1
  51. package/build/components/colors/utils.js +10 -2
  52. package/build/components/colors/utils.js.map +1 -1
  53. package/build/components/colors/with-colors.js +6 -2
  54. package/build/components/colors/with-colors.js.map +1 -1
  55. package/build/components/font-sizes/utils.js +10 -2
  56. package/build/components/font-sizes/utils.js.map +1 -1
  57. package/build/components/global-styles/border-panel.js +2 -1
  58. package/build/components/global-styles/border-panel.js.map +1 -1
  59. package/build/components/global-styles/color-panel.js +2 -1
  60. package/build/components/global-styles/color-panel.js.map +1 -1
  61. package/build/components/global-styles/dimensions-panel.js +4 -3
  62. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  63. package/build/components/global-styles/effects-panel.js +2 -1
  64. package/build/components/global-styles/effects-panel.js.map +1 -1
  65. package/build/components/global-styles/filters-panel.js +1 -4
  66. package/build/components/global-styles/filters-panel.js.map +1 -1
  67. package/build/components/global-styles/get-global-styles-changes.js +192 -0
  68. package/build/components/global-styles/get-global-styles-changes.js.map +1 -0
  69. package/build/components/global-styles/hooks.js +3 -2
  70. package/build/components/global-styles/hooks.js.map +1 -1
  71. package/build/components/global-styles/image-settings-panel.js +7 -1
  72. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  73. package/build/components/global-styles/index.js +7 -0
  74. package/build/components/global-styles/index.js.map +1 -1
  75. package/build/components/global-styles/typography-panel.js +33 -15
  76. package/build/components/global-styles/typography-panel.js.map +1 -1
  77. package/build/components/global-styles/use-global-styles-output.js +22 -8
  78. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  79. package/build/components/global-styles/utils.js +8 -1
  80. package/build/components/global-styles/utils.js.map +1 -1
  81. package/build/components/height-control/index.js +6 -2
  82. package/build/components/height-control/index.js.map +1 -1
  83. package/build/components/image-size-control/index.js +2 -2
  84. package/build/components/image-size-control/index.js.map +1 -1
  85. package/build/components/index.native.js +6 -5
  86. package/build/components/index.native.js.map +1 -1
  87. package/build/components/inner-blocks/index.js +61 -22
  88. package/build/components/inner-blocks/index.js.map +1 -1
  89. package/build/components/inner-blocks/index.native.js +18 -4
  90. package/build/components/inner-blocks/index.native.js.map +1 -1
  91. package/build/components/inner-blocks/use-inner-block-template-sync.js +5 -6
  92. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  93. package/build/components/inner-blocks/use-nested-settings-update.js +5 -9
  94. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  95. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  96. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  97. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -9
  98. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  99. package/build/components/inserter/block-patterns-tab/patterns-filter.js +10 -10
  100. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  101. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +9 -9
  102. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  103. package/build/components/inserter/block-patterns-tab/utils.js +10 -14
  104. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  105. package/build/components/inserter/hooks/use-block-types-state.js +4 -14
  106. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  107. package/build/components/inserter/hooks/use-patterns-state.js +1 -1
  108. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  109. package/build/components/inserter/index.js +1 -2
  110. package/build/components/inserter/index.js.map +1 -1
  111. package/build/components/inserter/library.js +3 -7
  112. package/build/components/inserter/library.js.map +1 -1
  113. package/build/components/inserter/menu.js +14 -28
  114. package/build/components/inserter/menu.js.map +1 -1
  115. package/build/components/inserter/tabs.js +21 -21
  116. package/build/components/inserter/tabs.js.map +1 -1
  117. package/build/components/inserter-draggable-blocks/index.js +1 -1
  118. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  119. package/build/components/inserter-list-item/index.js +2 -4
  120. package/build/components/inserter-list-item/index.js.map +1 -1
  121. package/build/components/inspector-controls/block-support-tools-panel.js +3 -1
  122. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  123. package/build/components/inspector-controls-tabs/index.js +34 -23
  124. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  125. package/build/components/list-view/block-select-button.js +4 -0
  126. package/build/components/list-view/block-select-button.js.map +1 -1
  127. package/build/components/list-view/block.js +57 -3
  128. package/build/components/list-view/block.js.map +1 -1
  129. package/build/components/media-upload-progress/constants.js +19 -0
  130. package/build/components/media-upload-progress/constants.js.map +1 -0
  131. package/build/components/media-upload-progress/index.native.js +42 -17
  132. package/build/components/media-upload-progress/index.native.js.map +1 -1
  133. package/build/components/navigable-toolbar/index.js +9 -14
  134. package/build/components/navigable-toolbar/index.js.map +1 -1
  135. package/build/components/plain-text/index.native.js +8 -3
  136. package/build/components/plain-text/index.native.js.map +1 -1
  137. package/build/components/provider/index.js +3 -1
  138. package/build/components/provider/index.js.map +1 -1
  139. package/build/components/provider/use-block-sync.js +7 -1
  140. package/build/components/provider/use-block-sync.js.map +1 -1
  141. package/build/components/rich-text/index.js +17 -7
  142. package/build/components/rich-text/index.js.map +1 -1
  143. package/build/components/rich-text/native/index.native.js +16 -24
  144. package/build/components/rich-text/native/index.native.js.map +1 -1
  145. package/build/components/rich-text/use-input-rules.js +2 -2
  146. package/build/components/rich-text/use-input-rules.js.map +1 -1
  147. package/build/components/rich-text/use-mark-persistent.js +1 -1
  148. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  149. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  150. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  151. package/build/components/url-input/index.js +9 -6
  152. package/build/components/url-input/index.js.map +1 -1
  153. package/build/components/use-block-commands/index.js +14 -18
  154. package/build/components/use-block-commands/index.js.map +1 -1
  155. package/build/components/use-block-drop-zone/index.js +51 -22
  156. package/build/components/use-block-drop-zone/index.js.map +1 -1
  157. package/build/components/use-moving-animation/index.js +100 -92
  158. package/build/components/use-moving-animation/index.js.map +1 -1
  159. package/build/components/use-on-block-drop/index.js +8 -11
  160. package/build/components/use-on-block-drop/index.js.map +1 -1
  161. package/build/components/writing-flow/index.js +0 -1
  162. package/build/components/writing-flow/index.js.map +1 -1
  163. package/build/components/writing-flow/use-drag-selection.js +15 -4
  164. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  165. package/build/components/writing-flow/use-selection-observer.js +73 -27
  166. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  167. package/build/components/writing-flow/use-tab-nav.js +7 -4
  168. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  169. package/build/hooks/align.js +1 -1
  170. package/build/hooks/align.js.map +1 -1
  171. package/build/hooks/anchor.js +1 -1
  172. package/build/hooks/anchor.js.map +1 -1
  173. package/build/hooks/aria-label.js +9 -1
  174. package/build/hooks/aria-label.js.map +1 -1
  175. package/build/hooks/background.js +185 -20
  176. package/build/hooks/background.js.map +1 -1
  177. package/build/hooks/border.js +5 -10
  178. package/build/hooks/border.js.map +1 -1
  179. package/build/hooks/color.js +13 -11
  180. package/build/hooks/color.js.map +1 -1
  181. package/build/hooks/custom-class-name.js +1 -1
  182. package/build/hooks/custom-class-name.js.map +1 -1
  183. package/build/hooks/custom-class-name.native.js +9 -1
  184. package/build/hooks/custom-class-name.native.js.map +1 -1
  185. package/build/hooks/dimensions.js +4 -9
  186. package/build/hooks/dimensions.js.map +1 -1
  187. package/build/hooks/font-family.js +7 -3
  188. package/build/hooks/font-family.js.map +1 -1
  189. package/build/hooks/font-size.js +1 -1
  190. package/build/hooks/font-size.js.map +1 -1
  191. package/build/hooks/index.js +4 -4
  192. package/build/hooks/index.js.map +1 -1
  193. package/build/hooks/index.native.js +5 -3
  194. package/build/hooks/index.native.js.map +1 -1
  195. package/build/hooks/layout.js +10 -4
  196. package/build/hooks/layout.js.map +1 -1
  197. package/build/hooks/style.js +1 -1
  198. package/build/hooks/style.js.map +1 -1
  199. package/build/hooks/typography.js +4 -9
  200. package/build/hooks/typography.js.map +1 -1
  201. package/build/hooks/typography.native.js +43 -18
  202. package/build/hooks/typography.native.js.map +1 -1
  203. package/build/hooks/use-typography-props.js +10 -2
  204. package/build/hooks/use-typography-props.js.map +1 -1
  205. package/build/hooks/utils.js +48 -5
  206. package/build/hooks/utils.js.map +1 -1
  207. package/build/private-apis.js +2 -4
  208. package/build/private-apis.js.map +1 -1
  209. package/build/private-apis.native.js +0 -2
  210. package/build/private-apis.native.js.map +1 -1
  211. package/build/store/actions.js +0 -16
  212. package/build/store/actions.js.map +1 -1
  213. package/build/store/private-actions.js +51 -5
  214. package/build/store/private-actions.js.map +1 -1
  215. package/build/store/private-selectors.js +12 -0
  216. package/build/store/private-selectors.js.map +1 -1
  217. package/build/store/reducer.js +14 -6
  218. package/build/store/reducer.js.map +1 -1
  219. package/build/store/selectors.js +1 -13
  220. package/build/store/selectors.js.map +1 -1
  221. package/build/store/undo-ignore.js +12 -0
  222. package/build/store/undo-ignore.js.map +1 -0
  223. package/build/store/utils.js +1 -1
  224. package/build/store/utils.js.map +1 -1
  225. package/build/utils/get-px-from-css-unit.js +16 -0
  226. package/build/utils/get-px-from-css-unit.js.map +1 -0
  227. package/build/utils/index.js +2 -2
  228. package/build/utils/index.js.map +1 -1
  229. package/build/utils/object.js +17 -38
  230. package/build/utils/object.js.map +1 -1
  231. package/build/utils/use-can-block-toolbar-be-focused.js +46 -0
  232. package/build/utils/use-can-block-toolbar-be-focused.js.map +1 -0
  233. package/build-module/components/block-canvas/index.js +0 -2
  234. package/build-module/components/block-canvas/index.js.map +1 -1
  235. package/build-module/components/block-card/index.js +1 -1
  236. package/build-module/components/block-card/index.js.map +1 -1
  237. package/build-module/components/block-draggable/draggable-chip.js +6 -1
  238. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  239. package/build-module/components/block-draggable/index.js +76 -6
  240. package/build-module/components/block-draggable/index.js.map +1 -1
  241. package/build-module/components/block-draggable/index.native.js +1 -7
  242. package/build-module/components/block-draggable/index.native.js.map +1 -1
  243. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  244. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  245. package/build-module/components/block-editing-mode/index.js +3 -4
  246. package/build-module/components/block-editing-mode/index.js.map +1 -1
  247. package/build-module/components/block-inspector/index.js +1 -1
  248. package/build-module/components/block-inspector/index.js.map +1 -1
  249. package/build-module/components/block-list/block-list-item-cell.native.js +1 -0
  250. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  251. package/build-module/components/block-list/block.js +249 -106
  252. package/build-module/components/block-list/block.js.map +1 -1
  253. package/build-module/components/block-list/block.native.js +48 -22
  254. package/build-module/components/block-list/block.native.js.map +1 -1
  255. package/build-module/components/block-list/index.native.js +3 -5
  256. package/build-module/components/block-list/index.native.js.map +1 -1
  257. package/build-module/components/block-list/private-block-context.js +6 -0
  258. package/build-module/components/block-list/private-block-context.js.map +1 -0
  259. package/build-module/components/block-list/use-block-props/index.js +34 -97
  260. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  261. package/build-module/components/block-list/use-in-between-inserter.js +3 -2
  262. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  263. package/build-module/components/block-list/use-scroll-upon-insertion.native.js +33 -0
  264. package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
  265. package/build-module/components/block-lock/toolbar.js +22 -28
  266. package/build-module/components/block-lock/toolbar.js.map +1 -1
  267. package/build-module/components/block-mover/index.js +2 -1
  268. package/build-module/components/block-mover/index.js.map +1 -1
  269. package/build-module/components/block-patterns-list/index.js +5 -5
  270. package/build-module/components/block-patterns-list/index.js.map +1 -1
  271. package/build-module/components/block-switcher/index.js +4 -4
  272. package/build-module/components/block-switcher/index.js.map +1 -1
  273. package/build-module/components/block-toolbar/index.js +1 -2
  274. package/build-module/components/block-toolbar/index.js.map +1 -1
  275. package/build-module/components/block-tools/block-toolbar-popover.js +0 -2
  276. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  277. package/build-module/components/block-variation-transforms/index.js +30 -3
  278. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  279. package/build-module/components/border-radius-control/linked-button.js +1 -1
  280. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  281. package/build-module/components/colors/utils.js +9 -1
  282. package/build-module/components/colors/utils.js.map +1 -1
  283. package/build-module/components/colors/with-colors.js +5 -1
  284. package/build-module/components/colors/with-colors.js.map +1 -1
  285. package/build-module/components/font-sizes/utils.js +9 -1
  286. package/build-module/components/font-sizes/utils.js.map +1 -1
  287. package/build-module/components/global-styles/border-panel.js +3 -2
  288. package/build-module/components/global-styles/border-panel.js.map +1 -1
  289. package/build-module/components/global-styles/color-panel.js +3 -2
  290. package/build-module/components/global-styles/color-panel.js.map +1 -1
  291. package/build-module/components/global-styles/dimensions-panel.js +5 -4
  292. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  293. package/build-module/components/global-styles/effects-panel.js +3 -2
  294. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  295. package/build-module/components/global-styles/filters-panel.js +2 -5
  296. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  297. package/build-module/components/global-styles/get-global-styles-changes.js +184 -0
  298. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -0
  299. package/build-module/components/global-styles/hooks.js +3 -2
  300. package/build-module/components/global-styles/hooks.js.map +1 -1
  301. package/build-module/components/global-styles/image-settings-panel.js +7 -1
  302. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  303. package/build-module/components/global-styles/index.js +1 -0
  304. package/build-module/components/global-styles/index.js.map +1 -1
  305. package/build-module/components/global-styles/typography-panel.js +35 -17
  306. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  307. package/build-module/components/global-styles/use-global-styles-output.js +15 -1
  308. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  309. package/build-module/components/global-styles/utils.js +7 -0
  310. package/build-module/components/global-styles/utils.js.map +1 -1
  311. package/build-module/components/height-control/index.js +6 -2
  312. package/build-module/components/height-control/index.js.map +1 -1
  313. package/build-module/components/image-size-control/index.js +2 -2
  314. package/build-module/components/image-size-control/index.js.map +1 -1
  315. package/build-module/components/index.native.js +2 -1
  316. package/build-module/components/index.native.js.map +1 -1
  317. package/build-module/components/inner-blocks/index.js +62 -23
  318. package/build-module/components/inner-blocks/index.js.map +1 -1
  319. package/build-module/components/inner-blocks/index.native.js +18 -4
  320. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  321. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +5 -6
  322. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  323. package/build-module/components/inner-blocks/use-nested-settings-update.js +6 -10
  324. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  325. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  326. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  327. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +11 -10
  328. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  329. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +11 -11
  330. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  331. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +11 -11
  332. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  333. package/build-module/components/inserter/block-patterns-tab/utils.js +7 -11
  334. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  335. package/build-module/components/inserter/hooks/use-block-types-state.js +4 -14
  336. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  337. package/build-module/components/inserter/hooks/use-patterns-state.js +2 -2
  338. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  339. package/build-module/components/inserter/index.js +1 -2
  340. package/build-module/components/inserter/index.js.map +1 -1
  341. package/build-module/components/inserter/library.js +3 -7
  342. package/build-module/components/inserter/library.js.map +1 -1
  343. package/build-module/components/inserter/menu.js +14 -28
  344. package/build-module/components/inserter/menu.js.map +1 -1
  345. package/build-module/components/inserter/tabs.js +22 -22
  346. package/build-module/components/inserter/tabs.js.map +1 -1
  347. package/build-module/components/inserter-draggable-blocks/index.js +2 -2
  348. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  349. package/build-module/components/inserter-list-item/index.js +2 -4
  350. package/build-module/components/inserter-list-item/index.js.map +1 -1
  351. package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -1
  352. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  353. package/build-module/components/inspector-controls-tabs/index.js +35 -24
  354. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  355. package/build-module/components/list-view/block-select-button.js +4 -0
  356. package/build-module/components/list-view/block-select-button.js.map +1 -1
  357. package/build-module/components/list-view/block.js +58 -4
  358. package/build-module/components/list-view/block.js.map +1 -1
  359. package/build-module/components/media-upload-progress/constants.js +7 -0
  360. package/build-module/components/media-upload-progress/constants.js.map +1 -0
  361. package/build-module/components/media-upload-progress/index.native.js +37 -8
  362. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  363. package/build-module/components/navigable-toolbar/index.js +9 -14
  364. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  365. package/build-module/components/plain-text/index.native.js +6 -1
  366. package/build-module/components/plain-text/index.native.js.map +1 -1
  367. package/build-module/components/provider/index.js +3 -1
  368. package/build-module/components/provider/index.js.map +1 -1
  369. package/build-module/components/provider/use-block-sync.js +7 -1
  370. package/build-module/components/provider/use-block-sync.js.map +1 -1
  371. package/build-module/components/rich-text/index.js +17 -7
  372. package/build-module/components/rich-text/index.js.map +1 -1
  373. package/build-module/components/rich-text/native/index.native.js +16 -23
  374. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  375. package/build-module/components/rich-text/use-input-rules.js +2 -2
  376. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  377. package/build-module/components/rich-text/use-mark-persistent.js +1 -1
  378. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  379. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  380. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  381. package/build-module/components/url-input/index.js +9 -6
  382. package/build-module/components/url-input/index.js.map +1 -1
  383. package/build-module/components/use-block-commands/index.js +14 -18
  384. package/build-module/components/use-block-commands/index.js.map +1 -1
  385. package/build-module/components/use-block-drop-zone/index.js +51 -23
  386. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  387. package/build-module/components/use-moving-animation/index.js +102 -94
  388. package/build-module/components/use-moving-animation/index.js.map +1 -1
  389. package/build-module/components/use-on-block-drop/index.js +8 -11
  390. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  391. package/build-module/components/writing-flow/index.js +0 -1
  392. package/build-module/components/writing-flow/index.js.map +1 -1
  393. package/build-module/components/writing-flow/use-drag-selection.js +15 -4
  394. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  395. package/build-module/components/writing-flow/use-selection-observer.js +73 -27
  396. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  397. package/build-module/components/writing-flow/use-tab-nav.js +7 -4
  398. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  399. package/build-module/hooks/align.js +1 -1
  400. package/build-module/hooks/align.js.map +1 -1
  401. package/build-module/hooks/anchor.js +1 -1
  402. package/build-module/hooks/anchor.js.map +1 -1
  403. package/build-module/hooks/aria-label.js +7 -1
  404. package/build-module/hooks/aria-label.js.map +1 -1
  405. package/build-module/hooks/background.js +181 -19
  406. package/build-module/hooks/background.js.map +1 -1
  407. package/build-module/hooks/border.js +2 -8
  408. package/build-module/hooks/border.js.map +1 -1
  409. package/build-module/hooks/color.js +11 -9
  410. package/build-module/hooks/color.js.map +1 -1
  411. package/build-module/hooks/custom-class-name.js +1 -1
  412. package/build-module/hooks/custom-class-name.js.map +1 -1
  413. package/build-module/hooks/custom-class-name.native.js +7 -1
  414. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  415. package/build-module/hooks/dimensions.js +1 -7
  416. package/build-module/hooks/dimensions.js.map +1 -1
  417. package/build-module/hooks/font-family.js +6 -2
  418. package/build-module/hooks/font-family.js.map +1 -1
  419. package/build-module/hooks/font-size.js +1 -1
  420. package/build-module/hooks/font-size.js.map +1 -1
  421. package/build-module/hooks/index.js +5 -5
  422. package/build-module/hooks/index.js.map +1 -1
  423. package/build-module/hooks/index.native.js +6 -4
  424. package/build-module/hooks/index.native.js.map +1 -1
  425. package/build-module/hooks/layout.js +9 -3
  426. package/build-module/hooks/layout.js.map +1 -1
  427. package/build-module/hooks/style.js +1 -1
  428. package/build-module/hooks/style.js.map +1 -1
  429. package/build-module/hooks/typography.js +1 -7
  430. package/build-module/hooks/typography.js.map +1 -1
  431. package/build-module/hooks/typography.native.js +43 -17
  432. package/build-module/hooks/typography.native.js.map +1 -1
  433. package/build-module/hooks/use-typography-props.js +9 -1
  434. package/build-module/hooks/use-typography-props.js.map +1 -1
  435. package/build-module/hooks/utils.js +47 -5
  436. package/build-module/hooks/utils.js.map +1 -1
  437. package/build-module/private-apis.js +2 -4
  438. package/build-module/private-apis.js.map +1 -1
  439. package/build-module/private-apis.native.js +0 -2
  440. package/build-module/private-apis.native.js.map +1 -1
  441. package/build-module/store/actions.js +0 -15
  442. package/build-module/store/actions.js.map +1 -1
  443. package/build-module/store/private-actions.js +49 -4
  444. package/build-module/store/private-actions.js.map +1 -1
  445. package/build-module/store/private-selectors.js +11 -0
  446. package/build-module/store/private-selectors.js.map +1 -1
  447. package/build-module/store/reducer.js +14 -6
  448. package/build-module/store/reducer.js.map +1 -1
  449. package/build-module/store/selectors.js +1 -12
  450. package/build-module/store/selectors.js.map +1 -1
  451. package/build-module/store/undo-ignore.js +5 -0
  452. package/build-module/store/undo-ignore.js.map +1 -0
  453. package/build-module/store/utils.js +2 -2
  454. package/build-module/store/utils.js.map +1 -1
  455. package/build-module/utils/get-px-from-css-unit.js +9 -0
  456. package/build-module/utils/get-px-from-css-unit.js.map +1 -0
  457. package/build-module/utils/index.js +1 -1
  458. package/build-module/utils/index.js.map +1 -1
  459. package/build-module/utils/object.js +16 -37
  460. package/build-module/utils/object.js.map +1 -1
  461. package/build-module/utils/use-can-block-toolbar-be-focused.js +40 -0
  462. package/build-module/utils/use-can-block-toolbar-be-focused.js.map +1 -0
  463. package/build-style/content-rtl.css +7 -6
  464. package/build-style/content.css +7 -6
  465. package/build-style/style-rtl.css +51 -8
  466. package/build-style/style.css +51 -8
  467. package/package.json +31 -31
  468. package/src/components/alignment-control/README.md +0 -5
  469. package/src/components/block-alignment-control/README.md +0 -5
  470. package/src/components/block-alignment-matrix-control/README.md +0 -10
  471. package/src/components/block-breadcrumb/README.md +0 -5
  472. package/src/components/block-canvas/index.js +0 -2
  473. package/src/components/block-canvas/style.scss +6 -0
  474. package/src/components/block-caption/README.md +0 -5
  475. package/src/components/block-card/README.md +0 -5
  476. package/src/components/block-card/index.js +1 -1
  477. package/src/components/block-draggable/draggable-chip.js +11 -1
  478. package/src/components/block-draggable/index.js +116 -4
  479. package/src/components/block-draggable/index.native.js +0 -5
  480. package/src/components/block-draggable/style.scss +35 -0
  481. package/src/components/block-draggable/test/helpers.native.js +8 -7
  482. package/src/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  483. package/src/components/block-editing-mode/index.js +3 -3
  484. package/src/components/block-icon/README.md +0 -5
  485. package/src/components/block-inspector/README.md +0 -5
  486. package/src/components/block-inspector/index.js +3 -1
  487. package/src/components/block-list/block-list-item-cell.native.js +5 -1
  488. package/src/components/block-list/block.js +290 -119
  489. package/src/components/block-list/block.native.js +55 -21
  490. package/src/components/block-list/content.scss +14 -10
  491. package/src/components/block-list/index.native.js +3 -5
  492. package/src/components/block-list/{block-list-block-context.js → private-block-context.js} +1 -1
  493. package/src/components/block-list/use-block-props/index.js +32 -128
  494. package/src/components/block-list/use-in-between-inserter.js +4 -1
  495. package/src/components/block-list/use-scroll-upon-insertion.native.js +52 -0
  496. package/src/components/block-lock/toolbar.js +23 -34
  497. package/src/components/block-mover/README.md +0 -5
  498. package/src/components/block-mover/index.js +1 -1
  499. package/src/components/block-parent-selector/README.md +0 -5
  500. package/src/components/block-patterns-list/README.md +0 -5
  501. package/src/components/block-patterns-list/index.js +8 -5
  502. package/src/components/block-switcher/index.js +49 -59
  503. package/src/components/block-toolbar/README.md +0 -5
  504. package/src/components/block-toolbar/index.js +1 -2
  505. package/src/components/block-tools/block-toolbar-popover.js +4 -10
  506. package/src/components/block-types-list/README.md +0 -5
  507. package/src/components/block-variation-picker/README.md +0 -5
  508. package/src/components/block-variation-transforms/README.md +0 -5
  509. package/src/components/block-variation-transforms/index.js +49 -3
  510. package/src/components/border-radius-control/linked-button.js +1 -1
  511. package/src/components/caption/README.md +0 -5
  512. package/src/components/color-palette/test/__snapshots__/control.js.snap +0 -1
  513. package/src/components/colors/utils.js +8 -1
  514. package/src/components/colors/with-colors.js +3 -1
  515. package/src/components/contrast-checker/README.md +0 -4
  516. package/src/components/copy-handler/README.md +0 -10
  517. package/src/components/font-sizes/utils.js +7 -1
  518. package/src/components/global-styles/border-panel.js +2 -1
  519. package/src/components/global-styles/color-panel.js +2 -1
  520. package/src/components/global-styles/dimensions-panel.js +4 -3
  521. package/src/components/global-styles/effects-panel.js +2 -1
  522. package/src/components/global-styles/filters-panel.js +2 -5
  523. package/src/components/global-styles/get-global-styles-changes.js +210 -0
  524. package/src/components/global-styles/hooks.js +5 -0
  525. package/src/components/global-styles/image-settings-panel.js +6 -0
  526. package/src/components/global-styles/index.js +1 -0
  527. package/src/components/global-styles/test/get-global-styles-changes.js +234 -0
  528. package/src/components/global-styles/typography-panel.js +47 -14
  529. package/src/components/global-styles/use-global-styles-output.js +9 -5
  530. package/src/components/global-styles/utils.js +7 -0
  531. package/src/components/height-control/README.md +2 -7
  532. package/src/components/height-control/index.js +4 -0
  533. package/src/components/image-size-control/index.js +5 -2
  534. package/src/components/index.native.js +2 -2
  535. package/src/components/inner-blocks/index.js +68 -29
  536. package/src/components/inner-blocks/index.native.js +19 -7
  537. package/src/components/inner-blocks/use-inner-block-template-sync.js +5 -7
  538. package/src/components/inner-blocks/use-nested-settings-update.js +6 -13
  539. package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  540. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -15
  541. package/src/components/inserter/block-patterns-tab/patterns-filter.js +15 -13
  542. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +15 -18
  543. package/src/components/inserter/block-patterns-tab/utils.js +11 -12
  544. package/src/components/inserter/hooks/use-block-types-state.js +9 -11
  545. package/src/components/inserter/hooks/use-patterns-state.js +2 -2
  546. package/src/components/inserter/index.js +0 -1
  547. package/src/components/inserter/library.js +2 -8
  548. package/src/components/inserter/menu.js +13 -31
  549. package/src/components/inserter/style.scss +6 -4
  550. package/src/components/inserter/tabs.js +34 -25
  551. package/src/components/inserter-draggable-blocks/index.js +2 -2
  552. package/src/components/inserter-list-item/index.js +6 -6
  553. package/src/components/inspector-controls/block-support-tools-panel.js +2 -0
  554. package/src/components/inspector-controls-tabs/index.js +39 -28
  555. package/src/components/inspector-controls-tabs/style.scss +3 -2
  556. package/src/components/letter-spacing-control/README.md +0 -5
  557. package/src/components/line-height-control/README.md +0 -5
  558. package/src/components/list-view/README.md +0 -5
  559. package/src/components/list-view/block-select-button.js +4 -0
  560. package/src/components/list-view/block.js +73 -2
  561. package/src/components/list-view/style.scss +6 -0
  562. package/src/components/media-upload-progress/constants.js +6 -0
  563. package/src/components/media-upload-progress/index.native.js +66 -14
  564. package/src/components/media-upload-progress/test/index.native.js +2 -2
  565. package/src/components/multi-selection-inspector/README.md +0 -5
  566. package/src/components/navigable-toolbar/index.js +13 -11
  567. package/src/components/plain-text/index.native.js +6 -1
  568. package/src/components/provider/index.js +1 -1
  569. package/src/components/provider/test/use-block-sync.js +20 -17
  570. package/src/components/provider/use-block-sync.js +6 -0
  571. package/src/components/rich-text/index.js +18 -6
  572. package/src/components/rich-text/native/index.native.js +16 -24
  573. package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +3 -3
  574. package/src/components/rich-text/native/test/index.native.js +72 -5
  575. package/src/components/rich-text/use-input-rules.js +2 -2
  576. package/src/components/rich-text/use-mark-persistent.js +1 -2
  577. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  578. package/src/components/text-decoration-control/README.md +40 -0
  579. package/src/components/text-transform-control/README.md +0 -4
  580. package/src/components/ungroup-button/README.md +0 -5
  581. package/src/components/unit-control/README.md +0 -4
  582. package/src/components/url-input/index.js +11 -11
  583. package/src/components/use-block-commands/index.js +18 -21
  584. package/src/components/use-block-drop-zone/index.js +85 -34
  585. package/src/components/use-moving-animation/index.js +107 -103
  586. package/src/components/use-on-block-drop/index.js +7 -23
  587. package/src/components/use-on-block-drop/test/index.js +12 -26
  588. package/src/components/use-resize-canvas/README.md +0 -4
  589. package/src/components/use-settings/README.md +0 -4
  590. package/src/components/writing-flow/index.js +0 -1
  591. package/src/components/writing-flow/use-drag-selection.js +18 -4
  592. package/src/components/writing-flow/use-selection-observer.js +99 -37
  593. package/src/components/writing-flow/use-tab-nav.js +7 -7
  594. package/src/hooks/align.js +1 -5
  595. package/src/hooks/anchor.js +1 -5
  596. package/src/hooks/aria-label.js +8 -5
  597. package/src/hooks/background.js +253 -21
  598. package/src/hooks/border.js +2 -13
  599. package/src/hooks/color.js +19 -14
  600. package/src/hooks/custom-class-name.js +1 -5
  601. package/src/hooks/custom-class-name.native.js +8 -5
  602. package/src/hooks/dimensions.js +1 -7
  603. package/src/hooks/font-family.js +4 -7
  604. package/src/hooks/font-size.js +1 -6
  605. package/src/hooks/index.js +19 -5
  606. package/src/hooks/index.native.js +17 -4
  607. package/src/hooks/layout.js +5 -2
  608. package/src/hooks/style.js +1 -6
  609. package/src/hooks/test/anchor.js +4 -9
  610. package/src/hooks/test/custom-class-name.js +3 -8
  611. package/src/hooks/test/style.js +4 -14
  612. package/src/hooks/typography.js +1 -7
  613. package/src/hooks/typography.native.js +31 -33
  614. package/src/hooks/use-typography-props.js +7 -1
  615. package/src/hooks/utils.js +76 -6
  616. package/src/private-apis.js +2 -4
  617. package/src/private-apis.native.js +0 -2
  618. package/src/store/actions.js +0 -15
  619. package/src/store/private-actions.js +44 -4
  620. package/src/store/private-selectors.js +11 -0
  621. package/src/store/reducer.js +16 -5
  622. package/src/store/selectors.js +5 -13
  623. package/src/store/undo-ignore.js +4 -0
  624. package/src/store/utils.js +2 -2
  625. package/src/style.scss +1 -0
  626. package/src/utils/get-px-from-css-unit.js +8 -0
  627. package/src/utils/index.js +1 -1
  628. package/src/utils/object.js +16 -35
  629. package/src/utils/test/object.js +1 -96
  630. package/src/utils/use-can-block-toolbar-be-focused.js +48 -0
  631. package/build/components/block-list/block-list-block-context.js +0 -14
  632. package/build/components/block-list/block-list-block-context.js.map +0 -1
  633. package/build/hooks/custom-fields.js +0 -106
  634. package/build/hooks/custom-fields.js.map +0 -1
  635. package/build/utils/parse-css-unit-to-px.js +0 -302
  636. package/build/utils/parse-css-unit-to-px.js.map +0 -1
  637. package/build/utils/use-should-contextual-toolbar-show.js +0 -63
  638. package/build/utils/use-should-contextual-toolbar-show.js.map +0 -1
  639. package/build-module/components/block-list/block-list-block-context.js +0 -6
  640. package/build-module/components/block-list/block-list-block-context.js.map +0 -1
  641. package/build-module/hooks/custom-fields.js +0 -99
  642. package/build-module/hooks/custom-fields.js.map +0 -1
  643. package/build-module/utils/parse-css-unit-to-px.js +0 -294
  644. package/build-module/utils/parse-css-unit-to-px.js.map +0 -1
  645. package/build-module/utils/use-should-contextual-toolbar-show.js +0 -57
  646. package/build-module/utils/use-should-contextual-toolbar-show.js.map +0 -1
  647. package/src/hooks/custom-fields.js +0 -115
  648. package/src/utils/parse-css-unit-to-px.js +0 -329
  649. package/src/utils/test/parse-css-unit-to-px.js +0 -172
  650. package/src/utils/use-should-contextual-toolbar-show.js +0 -85
@@ -15,6 +15,7 @@ import {
15
15
  ButtonGroup,
16
16
  ToggleControl,
17
17
  PanelBody,
18
+ privateApis as componentsPrivateApis,
18
19
  } from '@wordpress/components';
19
20
  import { __ } from '@wordpress/i18n';
20
21
 
@@ -27,8 +28,8 @@ import { useSettings } from '../components/use-settings';
27
28
  import { getLayoutType, getLayoutTypes } from '../layouts';
28
29
  import { useBlockEditingMode } from '../components/block-editing-mode';
29
30
  import { LAYOUT_DEFINITIONS } from '../layouts/definitions';
30
- import { kebabCase } from '../utils/object';
31
31
  import { useBlockSettings, useStyleOverride } from './utils';
32
+ import { unlock } from '../lock-unlock';
32
33
 
33
34
  const layoutBlockSupportKey = 'layout';
34
35
 
@@ -48,6 +49,7 @@ function hasLayoutBlockSupport( blockName ) {
48
49
  * @return { Array } Array of CSS classname strings.
49
50
  */
50
51
  export function useLayoutClasses( blockAttributes = {}, blockName = '' ) {
52
+ const { kebabCase } = unlock( componentsPrivateApis );
51
53
  const rootPaddingAlignment = useSelect( ( select ) => {
52
54
  const { getSettings } = select( blockEditorStore );
53
55
  return getSettings().__experimentalFeatures
@@ -348,7 +350,8 @@ function BlockWithLayoutStyles( { block: BlockListBlock, props } ) {
348
350
  : layout || defaultBlockLayout || {};
349
351
  const layoutClasses = useLayoutClasses( attributes, name );
350
352
 
351
- const selectorPrefix = `wp-container-${ kebabCase( name ) }-layout-`;
353
+ const { kebabCase } = unlock( componentsPrivateApis );
354
+ const selectorPrefix = `wp-container-${ kebabCase( name ) }-is-layout-`;
352
355
  // Higher specificity to override defaults from theme.json.
353
356
  const selector = `.${ selectorPrefix }${ id }.${ selectorPrefix }${ id }`;
354
357
  const [ blockGapSupport ] = useSettings( 'spacing.blockGap' );
@@ -343,6 +343,7 @@ function BlockStyleControls( {
343
343
  export default {
344
344
  edit: BlockStyleControls,
345
345
  hasSupport: hasStyleSupport,
346
+ addSaveProps,
346
347
  attributeKeys: [ 'style' ],
347
348
  useBlockProps,
348
349
  };
@@ -455,9 +456,3 @@ addFilter(
455
456
  'core/style/addAttribute',
456
457
  addAttribute
457
458
  );
458
-
459
- addFilter(
460
- 'blocks.getSaveContent.extraProps',
461
- 'core/style/addSaveProps',
462
- addSaveProps
463
- );
@@ -6,7 +6,7 @@ import { applyFilters } from '@wordpress/hooks';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import '../anchor';
9
+ import anchor from '../anchor';
10
10
 
11
11
  const noop = () => {};
12
12
 
@@ -62,14 +62,9 @@ describe( 'anchor', () => {
62
62
  } );
63
63
 
64
64
  describe( 'addSaveProps', () => {
65
- const getSaveContentExtraProps = applyFilters.bind(
66
- null,
67
- 'blocks.getSaveContent.extraProps'
68
- );
69
-
70
65
  it( 'should do nothing if the block settings do not define anchor support', () => {
71
66
  const attributes = { anchor: 'foo' };
72
- const extraProps = getSaveContentExtraProps(
67
+ const extraProps = anchor.addSaveProps(
73
68
  {},
74
69
  blockSettings,
75
70
  attributes
@@ -80,7 +75,7 @@ describe( 'anchor', () => {
80
75
 
81
76
  it( 'should inject anchor attribute ID', () => {
82
77
  const attributes = { anchor: 'foo' };
83
- const extraProps = getSaveContentExtraProps(
78
+ const extraProps = anchor.addSaveProps(
84
79
  {},
85
80
  {
86
81
  ...blockSettings,
@@ -96,7 +91,7 @@ describe( 'anchor', () => {
96
91
 
97
92
  it( 'should remove an anchor attribute ID when field is cleared', () => {
98
93
  const attributes = { anchor: '' };
99
- const extraProps = getSaveContentExtraProps(
94
+ const extraProps = anchor.addSaveProps(
100
95
  {},
101
96
  {
102
97
  ...blockSettings,
@@ -6,7 +6,7 @@ import { applyFilters } from '@wordpress/hooks';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import '../custom-class-name';
9
+ import customClassName from '../custom-class-name';
10
10
 
11
11
  describe( 'custom className', () => {
12
12
  const blockSettings = {
@@ -40,14 +40,9 @@ describe( 'custom className', () => {
40
40
  } );
41
41
 
42
42
  describe( 'addSaveProps', () => {
43
- const addSaveProps = applyFilters.bind(
44
- null,
45
- 'blocks.getSaveContent.extraProps'
46
- );
47
-
48
43
  it( 'should do nothing if the block settings do not define custom className support', () => {
49
44
  const attributes = { className: 'foo' };
50
- const extraProps = addSaveProps(
45
+ const extraProps = customClassName.addSaveProps(
51
46
  {},
52
47
  {
53
48
  ...blockSettings,
@@ -63,7 +58,7 @@ describe( 'custom className', () => {
63
58
 
64
59
  it( 'should inject the custom className', () => {
65
60
  const attributes = { className: 'bar' };
66
- const extraProps = addSaveProps(
61
+ const extraProps = customClassName.addSaveProps(
67
62
  { className: 'foo' },
68
63
  blockSettings,
69
64
  attributes
@@ -1,12 +1,7 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { applyFilters } from '@wordpress/hooks';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
9
- import { getInlineStyles, omitStyle } from '../style';
4
+ import _style, { getInlineStyles, omitStyle } from '../style';
10
5
 
11
6
  describe( 'getInlineStyles', () => {
12
7
  it( 'should return an empty object when called with undefined', () => {
@@ -120,11 +115,6 @@ describe( 'getInlineStyles', () => {
120
115
  } );
121
116
 
122
117
  describe( 'addSaveProps', () => {
123
- const addSaveProps = applyFilters.bind(
124
- null,
125
- 'blocks.getSaveContent.extraProps'
126
- );
127
-
128
118
  const blockSettings = {
129
119
  save: () => <div className="default" />,
130
120
  category: 'text',
@@ -166,7 +156,7 @@ describe( 'addSaveProps', () => {
166
156
  };
167
157
 
168
158
  it( 'should serialize all styles by default', () => {
169
- const extraProps = addSaveProps( {}, blockSettings, attributes );
159
+ const extraProps = _style.addSaveProps( {}, blockSettings, attributes );
170
160
 
171
161
  expect( extraProps.style ).toEqual( {
172
162
  background:
@@ -183,7 +173,7 @@ describe( 'addSaveProps', () => {
183
173
  const settings = applySkipSerialization( {
184
174
  typography: true,
185
175
  } );
186
- const extraProps = addSaveProps( {}, settings, attributes );
176
+ const extraProps = _style.addSaveProps( {}, settings, attributes );
187
177
 
188
178
  expect( extraProps.style ).toEqual( {
189
179
  background:
@@ -198,7 +188,7 @@ describe( 'addSaveProps', () => {
198
188
  color: [ 'gradient' ],
199
189
  typography: [ 'textDecoration', 'textTransform' ],
200
190
  } );
201
- const extraProps = addSaveProps( {}, settings, attributes );
191
+ const extraProps = _style.addSaveProps( {}, settings, attributes );
202
192
 
203
193
  expect( extraProps.style ).toEqual( {
204
194
  color: '#d92828',
@@ -4,7 +4,6 @@
4
4
  import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
5
5
  import { useMemo, useCallback } from '@wordpress/element';
6
6
  import { useSelect } from '@wordpress/data';
7
- import { pure } from '@wordpress/compose';
8
7
 
9
8
  /**
10
9
  * Internal dependencies
@@ -109,7 +108,7 @@ function TypographyInspectorControl( { children, resetAllFilter } ) {
109
108
  );
110
109
  }
111
110
 
112
- function TypographyPanelPure( { clientId, name, setAttributes, settings } ) {
111
+ export function TypographyPanel( { clientId, name, setAttributes, settings } ) {
113
112
  function selector( select ) {
114
113
  const { style, fontFamily, fontSize } =
115
114
  select( blockEditorStore ).getBlockAttributes( clientId ) || {};
@@ -147,11 +146,6 @@ function TypographyPanelPure( { clientId, name, setAttributes, settings } ) {
147
146
  );
148
147
  }
149
148
 
150
- // We don't want block controls to re-render when typing inside a block. `pure`
151
- // will prevent re-renders unless props change, so only pass the needed props
152
- // and not the whole attributes object.
153
- export const TypographyPanel = pure( TypographyPanelPure );
154
-
155
149
  export const hasTypographySupport = ( blockName ) => {
156
150
  return TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>
157
151
  hasBlockSupport( blockName, key )
@@ -1,10 +1,8 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { hasBlockSupport } from '@wordpress/blocks';
5
- /**
6
- * External dependencies
7
- */
4
+ import { useSelect } from '@wordpress/data';
5
+ import { pure } from '@wordpress/compose';
8
6
  import { PanelBody } from '@wordpress/components';
9
7
  import { __ } from '@wordpress/i18n';
10
8
 
@@ -12,17 +10,12 @@ import { __ } from '@wordpress/i18n';
12
10
  * Internal dependencies
13
11
  */
14
12
  import InspectorControls from '../components/inspector-controls';
13
+ import { useHasTypographyPanel } from '../components/global-styles/typography-panel';
15
14
 
16
- import {
17
- LINE_HEIGHT_SUPPORT_KEY,
18
- LineHeightEdit,
19
- useIsLineHeightDisabled,
20
- } from './line-height';
21
- import {
22
- FONT_SIZE_SUPPORT_KEY,
23
- FontSizeEdit,
24
- useIsFontSizeDisabled,
25
- } from './font-size';
15
+ import { store as blockEditorStore } from '../store';
16
+
17
+ import { LINE_HEIGHT_SUPPORT_KEY, LineHeightEdit } from './line-height';
18
+ import { FONT_SIZE_SUPPORT_KEY, FontSizeEdit } from './font-size';
26
19
 
27
20
  export const TYPOGRAPHY_SUPPORT_KEY = 'typography';
28
21
  export const TYPOGRAPHY_SUPPORT_KEYS = [
@@ -30,11 +23,26 @@ export const TYPOGRAPHY_SUPPORT_KEYS = [
30
23
  FONT_SIZE_SUPPORT_KEY,
31
24
  ];
32
25
 
33
- export function TypographyPanel( props ) {
34
- const isDisabled = useIsTypographyDisabled( props );
35
- const isSupported = hasTypographySupport( props.name );
36
-
37
- if ( isDisabled || ! isSupported ) return null;
26
+ function TypographyPanelPure( { clientId, setAttributes, settings } ) {
27
+ function selector( select ) {
28
+ const { style, fontFamily, fontSize } =
29
+ select( blockEditorStore ).getBlockAttributes( clientId ) || {};
30
+ return { style, fontFamily, fontSize };
31
+ }
32
+ const { style, fontSize } = useSelect( selector, [ clientId ] );
33
+ const isEnabled = useHasTypographyPanel( settings );
34
+
35
+ if ( ! isEnabled ) {
36
+ return null;
37
+ }
38
+
39
+ const props = {
40
+ attributes: {
41
+ fontSize,
42
+ style,
43
+ },
44
+ setAttributes,
45
+ };
38
46
 
39
47
  return (
40
48
  <InspectorControls>
@@ -46,17 +54,7 @@ export function TypographyPanel( props ) {
46
54
  );
47
55
  }
48
56
 
49
- const hasTypographySupport = ( blockName ) => {
50
- return TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>
51
- hasBlockSupport( blockName, key )
52
- );
53
- };
54
-
55
- function useIsTypographyDisabled( props = {} ) {
56
- const configs = [
57
- useIsFontSizeDisabled( props ),
58
- useIsLineHeightDisabled( props ),
59
- ];
60
-
61
- return configs.filter( Boolean ).length === configs.length;
62
- }
57
+ // We don't want block controls to re-render when typing inside a block. `pure`
58
+ // will prevent re-renders unless props change, so only pass the needed props
59
+ // and not the whole attributes object.
60
+ export const TypographyPanel = pure( TypographyPanelPure );
@@ -3,6 +3,11 @@
3
3
  */
4
4
  import classnames from 'classnames';
5
5
 
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { privateApis as componentsPrivateApis } from '@wordpress/components';
10
+
6
11
  /**
7
12
  * Internal dependencies
8
13
  */
@@ -12,7 +17,7 @@ import {
12
17
  getTypographyFontSizeValue,
13
18
  getFluidTypographyOptionsFromSettings,
14
19
  } from '../components/global-styles/typography-utils';
15
- import { kebabCase } from '../utils/object';
20
+ import { unlock } from '../lock-unlock';
16
21
 
17
22
  /*
18
23
  * This utility is intended to assist where the serialization of the typography
@@ -29,6 +34,7 @@ import { kebabCase } from '../utils/object';
29
34
  * @return {Object} Typography block support derived CSS classes & styles.
30
35
  */
31
36
  export function getTypographyClassesAndStyles( attributes, settings ) {
37
+ const { kebabCase } = unlock( componentsPrivateApis );
32
38
  let typographyStyles = attributes?.style?.typography || {};
33
39
  const fluidTypographySettings =
34
40
  getFluidTypographyOptionsFromSettings( settings );
@@ -174,8 +174,13 @@ export function useStyleOverride( { id, css, assets, __unstableType } = {} ) {
174
174
  */
175
175
  export function useBlockSettings( name, parentLayout ) {
176
176
  const [
177
+ backgroundImage,
178
+ backgroundSize,
177
179
  fontFamilies,
178
- fontSizes,
180
+ userFontSizes,
181
+ themeFontSizes,
182
+ defaultFontSizes,
183
+ defaultFontSizesEnabled,
179
184
  customFontSize,
180
185
  fontStyle,
181
186
  fontWeight,
@@ -217,8 +222,13 @@ export function useBlockSettings( name, parentLayout ) {
217
222
  isHeadingEnabled,
218
223
  isButtonEnabled,
219
224
  ] = useSettings(
225
+ 'background.backgroundImage',
226
+ 'background.backgroundSize',
220
227
  'typography.fontFamilies',
221
- 'typography.fontSizes',
228
+ 'typography.fontSizes.custom',
229
+ 'typography.fontSizes.theme',
230
+ 'typography.fontSizes.default',
231
+ 'typography.defaultFontSizes',
222
232
  'typography.customFontSize',
223
233
  'typography.fontStyle',
224
234
  'typography.fontWeight',
@@ -263,6 +273,10 @@ export function useBlockSettings( name, parentLayout ) {
263
273
 
264
274
  const rawSettings = useMemo( () => {
265
275
  return {
276
+ background: {
277
+ backgroundImage,
278
+ backgroundSize,
279
+ },
266
280
  color: {
267
281
  palette: {
268
282
  custom: customColors,
@@ -296,9 +310,12 @@ export function useBlockSettings( name, parentLayout ) {
296
310
  custom: fontFamilies,
297
311
  },
298
312
  fontSizes: {
299
- custom: fontSizes,
313
+ custom: userFontSizes,
314
+ theme: themeFontSizes,
315
+ default: defaultFontSizes,
300
316
  },
301
317
  customFontSize,
318
+ defaultFontSizes: defaultFontSizesEnabled,
302
319
  fontStyle,
303
320
  fontWeight,
304
321
  lineHeight,
@@ -330,8 +347,13 @@ export function useBlockSettings( name, parentLayout ) {
330
347
  parentLayout,
331
348
  };
332
349
  }, [
350
+ backgroundImage,
351
+ backgroundSize,
333
352
  fontFamilies,
334
- fontSizes,
353
+ userFontSizes,
354
+ themeFontSizes,
355
+ defaultFontSizes,
356
+ defaultFontSizesEnabled,
335
357
  customFontSize,
336
358
  fontStyle,
337
359
  fontWeight,
@@ -418,12 +440,14 @@ export function createBlockEditFilter( features ) {
418
440
  neededProps[ key ] = props.attributes[ key ];
419
441
  }
420
442
  }
443
+
421
444
  return (
422
445
  <Edit
423
446
  // We can use the index because the array length
424
447
  // is fixed per page load right now.
425
448
  key={ i }
426
449
  name={ props.name }
450
+ isSelected={ props.isSelected }
427
451
  clientId={ props.clientId }
428
452
  setAttributes={ props.setAttributes }
429
453
  __unstableParentLayout={
@@ -488,10 +512,10 @@ export function createBlockListBlockFilter( features ) {
488
512
  }
489
513
 
490
514
  if (
491
- ! hasSupport( props.name ) ||
492
515
  // Skip rendering if none of the needed attributes are
493
516
  // set.
494
- ! Object.keys( neededProps ).length
517
+ ! Object.keys( neededProps ).length ||
518
+ ! hasSupport( props.name )
495
519
  ) {
496
520
  return null;
497
521
  }
@@ -543,3 +567,49 @@ export function createBlockListBlockFilter( features ) {
543
567
  withBlockListBlockHooks
544
568
  );
545
569
  }
570
+
571
+ export function createBlockSaveFilter( features ) {
572
+ function extraPropsFromHooks( props, name, attributes ) {
573
+ return features.reduce( ( accu, feature ) => {
574
+ const { hasSupport, attributeKeys = [], addSaveProps } = feature;
575
+
576
+ const neededAttributes = {};
577
+ for ( const key of attributeKeys ) {
578
+ if ( attributes[ key ] ) {
579
+ neededAttributes[ key ] = attributes[ key ];
580
+ }
581
+ }
582
+
583
+ if (
584
+ // Skip rendering if none of the needed attributes are
585
+ // set.
586
+ ! Object.keys( neededAttributes ).length ||
587
+ ! hasSupport( name )
588
+ ) {
589
+ return accu;
590
+ }
591
+
592
+ return addSaveProps( accu, name, neededAttributes );
593
+ }, props );
594
+ }
595
+ addFilter(
596
+ 'blocks.getSaveContent.extraProps',
597
+ 'core/editor/hooks',
598
+ extraPropsFromHooks,
599
+ 0
600
+ );
601
+ addFilter(
602
+ 'blocks.getSaveContent.extraProps',
603
+ 'core/editor/hooks',
604
+ ( props ) => {
605
+ // Previously we had a filter deleting the className if it was an empty
606
+ // string. That filter is no longer running, so now we need to delete it
607
+ // here.
608
+ if ( props.hasOwnProperty( 'className' ) && ! props.className ) {
609
+ delete props.className;
610
+ }
611
+
612
+ return props;
613
+ }
614
+ );
615
+ }
@@ -5,12 +5,11 @@ import * as globalStyles from './components/global-styles';
5
5
  import { ExperimentalBlockEditorProvider } from './components/provider';
6
6
  import { lock } from './lock-unlock';
7
7
  import { getRichTextValues } from './components/rich-text/get-rich-text-values';
8
- import { kebabCase } from './utils/object';
9
8
  import ResizableBoxPopover from './components/resizable-box-popover';
10
9
  import { ComposedPrivateInserter as PrivateInserter } from './components/inserter';
11
10
  import { PrivateListView } from './components/list-view';
12
11
  import BlockInfo from './components/block-info-slot-fill';
13
- import { useShouldContextualToolbarShow } from './utils/use-should-contextual-toolbar-show';
12
+ import { useCanBlockToolbarBeFocused } from './utils/use-can-block-toolbar-be-focused';
14
13
  import { cleanEmptyObject, useStyleOverride } from './hooks/utils';
15
14
  import BlockQuickNavigation from './components/block-quick-navigation';
16
15
  import { LayoutStyle } from './components/block-list/layout';
@@ -36,12 +35,11 @@ lock( privateApis, {
36
35
  ExperimentalBlockEditorProvider,
37
36
  getDuotoneFilter,
38
37
  getRichTextValues,
39
- kebabCase,
40
38
  PrivateInserter,
41
39
  PrivateListView,
42
40
  ResizableBoxPopover,
43
41
  BlockInfo,
44
- useShouldContextualToolbarShow,
42
+ useCanBlockToolbarBeFocused,
45
43
  cleanEmptyObject,
46
44
  useStyleOverride,
47
45
  BlockQuickNavigation,
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import * as globalStyles from './components/global-styles';
5
5
  import { ExperimentalBlockEditorProvider } from './components/provider';
6
- import { kebabCase } from './utils/object';
7
6
  import { lock } from './lock-unlock';
8
7
 
9
8
  /**
@@ -12,6 +11,5 @@ import { lock } from './lock-unlock';
12
11
  export const privateApis = {};
13
12
  lock( privateApis, {
14
13
  ...globalStyles,
15
- kebabCase,
16
14
  ExperimentalBlockEditorProvider,
17
15
  } );
@@ -1919,18 +1919,3 @@ export function unsetBlockEditingMode( clientId = '' ) {
1919
1919
  clientId,
1920
1920
  };
1921
1921
  }
1922
-
1923
- /**
1924
- * Action that sets the element that had focus when focus leaves the editor canvas.
1925
- *
1926
- * @param {Object} lastFocus The last focused element.
1927
- *
1928
- *
1929
- * @return {Object} Action object.
1930
- */
1931
- export function setLastFocus( lastFocus = null ) {
1932
- return {
1933
- type: 'LAST_FOCUS',
1934
- lastFocus,
1935
- };
1936
- }
@@ -3,6 +3,11 @@
3
3
  */
4
4
  import { Platform } from '@wordpress/element';
5
5
 
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { undoIgnoreBlocks } from './undo-ignore';
10
+
6
11
  const castArray = ( maybeArray ) =>
7
12
  Array.isArray( maybeArray ) ? maybeArray : [ maybeArray ];
8
13
 
@@ -291,10 +296,45 @@ export function deleteStyleOverride( id ) {
291
296
  };
292
297
  }
293
298
 
294
- export function syncDerivedBlockAttributes( clientId, attributes ) {
299
+ /**
300
+ * A higher-order action that mark every change inside a callback as "non-persistent"
301
+ * and ignore pushing to the undo history stack. It's primarily used for synchronized
302
+ * derived updates from the block editor without affecting the undo history.
303
+ *
304
+ * @param {() => void} callback The synchronous callback to derive updates.
305
+ */
306
+ export function syncDerivedUpdates( callback ) {
307
+ return ( { dispatch, select, registry } ) => {
308
+ registry.batch( () => {
309
+ // Mark every change in the `callback` as non-persistent.
310
+ dispatch( {
311
+ type: 'SET_EXPLICIT_PERSISTENT',
312
+ isPersistentChange: false,
313
+ } );
314
+ callback();
315
+ dispatch( {
316
+ type: 'SET_EXPLICIT_PERSISTENT',
317
+ isPersistentChange: undefined,
318
+ } );
319
+
320
+ // Ignore pushing undo stack for the updated blocks.
321
+ const updatedBlocks = select.getBlocks();
322
+ undoIgnoreBlocks.add( updatedBlocks );
323
+ } );
324
+ };
325
+ }
326
+
327
+ /**
328
+ * Action that sets the element that had focus when focus leaves the editor canvas.
329
+ *
330
+ * @param {Object} lastFocus The last focused element.
331
+ *
332
+ *
333
+ * @return {Object} Action object.
334
+ */
335
+ export function setLastFocus( lastFocus = null ) {
295
336
  return {
296
- type: 'SYNC_DERIVED_BLOCK_ATTRIBUTES',
297
- clientIds: [ clientId ],
298
- attributes,
337
+ type: 'LAST_FOCUS',
338
+ lastFocus,
299
339
  };
300
340
  }
@@ -281,3 +281,14 @@ export const hasAllowedPatterns = createSelector(
281
281
  ),
282
282
  ]
283
283
  );
284
+
285
+ /**
286
+ * Returns the element of the last element that had focus when focus left the editor canvas.
287
+ *
288
+ * @param {Object} state Block editor state.
289
+ *
290
+ * @return {Object} Element.
291
+ */
292
+ export function getLastFocus( state ) {
293
+ return state.lastFocus;
294
+ }
@@ -453,14 +453,25 @@ const withBlockTree =
453
453
  function withPersistentBlockChange( reducer ) {
454
454
  let lastAction;
455
455
  let markNextChangeAsNotPersistent = false;
456
+ let explicitPersistent;
456
457
 
457
458
  return ( state, action ) => {
458
459
  let nextState = reducer( state, action );
459
460
 
460
- if ( action.type === 'SYNC_DERIVED_BLOCK_ATTRIBUTES' ) {
461
- return nextState.isPersistentChange
462
- ? { ...nextState, isPersistentChange: false }
463
- : nextState;
461
+ let nextIsPersistentChange;
462
+ if ( action.type === 'SET_EXPLICIT_PERSISTENT' ) {
463
+ explicitPersistent = action.isPersistentChange;
464
+ nextIsPersistentChange = state.isPersistentChange ?? true;
465
+ }
466
+
467
+ if ( explicitPersistent !== undefined ) {
468
+ nextIsPersistentChange = explicitPersistent;
469
+ return nextIsPersistentChange === nextState.isPersistentChange
470
+ ? nextState
471
+ : {
472
+ ...nextState,
473
+ isPersistentChange: nextIsPersistentChange,
474
+ };
464
475
  }
465
476
 
466
477
  const isExplicitPersistentChange =
@@ -473,7 +484,7 @@ function withPersistentBlockChange( reducer ) {
473
484
  markNextChangeAsNotPersistent =
474
485
  action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT';
475
486
 
476
- const nextIsPersistentChange = state?.isPersistentChange ?? true;
487
+ nextIsPersistentChange = state?.isPersistentChange ?? true;
477
488
  if ( state.isPersistentChange === nextIsPersistentChange ) {
478
489
  return state;
479
490
  }
@@ -2742,8 +2742,11 @@ export const __unstableGetContentLockingParent = createSelector(
2742
2742
  while ( state.blocks.parents.has( current ) ) {
2743
2743
  current = state.blocks.parents.get( current );
2744
2744
  if (
2745
- current &&
2746
- getTemplateLock( state, current ) === 'contentOnly'
2745
+ ( current &&
2746
+ getBlockName( state, current ) === 'core/block' &&
2747
+ window.__experimentalPatternPartialSyncing ) ||
2748
+ ( current &&
2749
+ getTemplateLock( state, current ) === 'contentOnly' )
2747
2750
  ) {
2748
2751
  result = current;
2749
2752
  }
@@ -2943,14 +2946,3 @@ export const isGroupable = createRegistrySelector(
2943
2946
  );
2944
2947
  }
2945
2948
  );
2946
-
2947
- /**
2948
- * Returns the element of the last element that had focus when focus left the editor canvas.
2949
- *
2950
- * @param {Object} state Block editor state.
2951
- *
2952
- * @return {Object} Element.
2953
- */
2954
- export function getLastFocus( state ) {
2955
- return state.lastFocus;
2956
- }