@wordpress/block-editor 12.15.0 → 12.16.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 (500) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +9 -4
  3. package/build/components/block-canvas/index.js +22 -6
  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-controls/hook.js +3 -23
  8. package/build/components/block-controls/hook.js.map +1 -1
  9. package/build/components/block-edit/context.js +5 -1
  10. package/build/components/block-edit/context.js.map +1 -1
  11. package/build/components/block-edit/index.js +18 -9
  12. package/build/components/block-edit/index.js.map +1 -1
  13. package/build/components/block-info-slot-fill/index.js +3 -4
  14. package/build/components/block-info-slot-fill/index.js.map +1 -1
  15. package/build/components/block-list/block.js +28 -9
  16. package/build/components/block-list/block.js.map +1 -1
  17. package/build/components/block-list/block.native.js +14 -5
  18. package/build/components/block-list/block.native.js.map +1 -1
  19. package/build/components/block-list/use-block-props/index.js +61 -18
  20. package/build/components/block-list/use-block-props/index.js.map +1 -1
  21. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  22. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  23. package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
  24. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  25. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  26. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  27. package/build/components/block-patterns-list/index.js +1 -1
  28. package/build/components/block-patterns-list/index.js.map +1 -1
  29. package/build/components/block-removal-warning-modal/index.js +2 -9
  30. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  31. package/build/components/block-rename/modal.js +3 -0
  32. package/build/components/block-rename/modal.js.map +1 -1
  33. package/build/components/block-settings/container.native.js +6 -4
  34. package/build/components/block-settings/container.native.js.map +1 -1
  35. package/build/components/block-styles/index.js +1 -1
  36. package/build/components/block-styles/index.js.map +1 -1
  37. package/build/components/block-styles/index.native.js +3 -2
  38. package/build/components/block-styles/index.native.js.map +1 -1
  39. package/build/components/block-toolbar/index.js +89 -27
  40. package/build/components/block-toolbar/index.js.map +1 -1
  41. package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
  42. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  43. package/build/components/block-tools/block-toolbar-popover.js +86 -0
  44. package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
  45. package/build/components/block-tools/index.js +27 -24
  46. package/build/components/block-tools/index.js.map +1 -1
  47. package/build/components/block-types-list/index.native.js +4 -3
  48. package/build/components/block-types-list/index.native.js.map +1 -1
  49. package/build/components/block-variation-picker/index.native.js +2 -1
  50. package/build/components/block-variation-picker/index.native.js.map +1 -1
  51. package/build/components/colors-gradients/control.js +28 -17
  52. package/build/components/colors-gradients/control.js.map +1 -1
  53. package/build/components/duotone-control/index.js +1 -4
  54. package/build/components/duotone-control/index.js.map +1 -1
  55. package/build/components/global-styles/color-panel.js +22 -20
  56. package/build/components/global-styles/color-panel.js.map +1 -1
  57. package/build/components/global-styles/filters-panel.js +9 -3
  58. package/build/components/global-styles/filters-panel.js.map +1 -1
  59. package/build/components/global-styles/typography-panel.js +20 -31
  60. package/build/components/global-styles/typography-panel.js.map +1 -1
  61. package/build/components/image-link-destinations/index.native.js +118 -0
  62. package/build/components/image-link-destinations/index.native.js.map +1 -0
  63. package/build/components/index.native.js +8 -0
  64. package/build/components/index.native.js.map +1 -1
  65. package/build/components/inserter/media-tab/media-panel.js +2 -2
  66. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  67. package/build/components/inserter/menu.js +14 -7
  68. package/build/components/inserter/menu.js.map +1 -1
  69. package/build/components/inserter/preview-panel.js +2 -2
  70. package/build/components/inserter/preview-panel.js.map +1 -1
  71. package/build/components/inserter-button/index.native.js +98 -0
  72. package/build/components/inserter-button/index.native.js.map +1 -0
  73. package/build/components/inserter-button/sparkles.js +23 -0
  74. package/build/components/inserter-button/sparkles.js.map +1 -0
  75. package/build/components/inserter-draggable-blocks/index.js +8 -4
  76. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  77. package/build/components/inspector-controls/fill.js +3 -3
  78. package/build/components/inspector-controls/fill.js.map +1 -1
  79. package/build/components/inspector-controls/fill.native.js +3 -3
  80. package/build/components/inspector-controls/fill.native.js.map +1 -1
  81. package/build/components/navigable-toolbar/index.js +2 -2
  82. package/build/components/navigable-toolbar/index.js.map +1 -1
  83. package/build/components/preview-options/index.js +6 -62
  84. package/build/components/preview-options/index.js.map +1 -1
  85. package/build/components/rich-text/content.js +26 -23
  86. package/build/components/rich-text/content.js.map +1 -1
  87. package/build/components/rich-text/get-rich-text-values.js +2 -1
  88. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  89. package/build/components/rich-text/index.js +2 -30
  90. package/build/components/rich-text/index.js.map +1 -1
  91. package/build/components/rich-text/index.native.js +9 -16
  92. package/build/components/rich-text/index.native.js.map +1 -1
  93. package/build/components/rich-text/native/get-format-colors.native.js +22 -24
  94. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  95. package/build/components/rich-text/native/index.native.js +7 -34
  96. package/build/components/rich-text/native/index.native.js.map +1 -1
  97. package/build/components/rich-text/use-input-rules.js +5 -1
  98. package/build/components/rich-text/use-input-rules.js.map +1 -1
  99. package/build/components/rich-text/with-deprecations.js +50 -0
  100. package/build/components/rich-text/with-deprecations.js.map +1 -0
  101. package/build/components/use-block-drop-zone/index.js +70 -8
  102. package/build/components/use-block-drop-zone/index.js.map +1 -1
  103. package/build/components/use-on-block-drop/index.js +1 -1
  104. package/build/components/use-on-block-drop/index.js.map +1 -1
  105. package/build/components/use-resize-canvas/index.js +4 -1
  106. package/build/components/use-resize-canvas/index.js.map +1 -1
  107. package/build/components/use-settings/index.js +14 -0
  108. package/build/components/use-settings/index.js.map +1 -1
  109. package/build/hooks/align.js +20 -68
  110. package/build/hooks/align.js.map +1 -1
  111. package/build/hooks/align.native.js +11 -1
  112. package/build/hooks/align.native.js.map +1 -1
  113. package/build/hooks/anchor.js +13 -29
  114. package/build/hooks/anchor.js.map +1 -1
  115. package/build/hooks/background.js +28 -31
  116. package/build/hooks/background.js.map +1 -1
  117. package/build/hooks/block-hooks.js +24 -32
  118. package/build/hooks/block-hooks.js.map +1 -1
  119. package/build/hooks/block-renaming.js +18 -22
  120. package/build/hooks/block-renaming.js.map +1 -1
  121. package/build/hooks/border.js +58 -80
  122. package/build/hooks/border.js.map +1 -1
  123. package/build/hooks/color.js +76 -89
  124. package/build/hooks/color.js.map +1 -1
  125. package/build/hooks/content-lock-ui.js +29 -29
  126. package/build/hooks/content-lock-ui.js.map +1 -1
  127. package/build/hooks/custom-class-name.js +12 -29
  128. package/build/hooks/custom-class-name.js.map +1 -1
  129. package/build/hooks/custom-fields.js +24 -38
  130. package/build/hooks/custom-fields.js.map +1 -1
  131. package/build/hooks/dimensions.js +21 -17
  132. package/build/hooks/dimensions.js.map +1 -1
  133. package/build/hooks/duotone.js +31 -61
  134. package/build/hooks/duotone.js.map +1 -1
  135. package/build/hooks/font-family.js +16 -25
  136. package/build/hooks/font-family.js.map +1 -1
  137. package/build/hooks/font-size.js +51 -119
  138. package/build/hooks/font-size.js.map +1 -1
  139. package/build/hooks/index.js +25 -14
  140. package/build/hooks/index.js.map +1 -1
  141. package/build/hooks/index.native.js +10 -3
  142. package/build/hooks/index.native.js.map +1 -1
  143. package/build/hooks/layout-child.js +68 -0
  144. package/build/hooks/layout-child.js.map +1 -0
  145. package/build/hooks/layout.js +16 -101
  146. package/build/hooks/layout.js.map +1 -1
  147. package/build/hooks/padding.js +2 -2
  148. package/build/hooks/padding.js.map +1 -1
  149. package/build/hooks/position.js +40 -62
  150. package/build/hooks/position.js.map +1 -1
  151. package/build/hooks/style.js +51 -88
  152. package/build/hooks/style.js.map +1 -1
  153. package/build/hooks/typography.js +34 -14
  154. package/build/hooks/typography.js.map +1 -1
  155. package/build/hooks/utils.js +154 -7
  156. package/build/hooks/utils.js.map +1 -1
  157. package/build/private-apis.js +0 -2
  158. package/build/private-apis.js.map +1 -1
  159. package/build/store/private-actions.js +8 -0
  160. package/build/store/private-actions.js.map +1 -1
  161. package/build/store/private-selectors.js +34 -0
  162. package/build/store/private-selectors.js.map +1 -1
  163. package/build/store/reducer.js +8 -0
  164. package/build/store/reducer.js.map +1 -1
  165. package/build/store/selectors.js +10 -60
  166. package/build/store/selectors.js.map +1 -1
  167. package/build/store/utils.js +66 -0
  168. package/build/store/utils.js.map +1 -0
  169. package/build/utils/object.js +21 -61
  170. package/build/utils/object.js.map +1 -1
  171. package/build/utils/selection.js +9 -1
  172. package/build/utils/selection.js.map +1 -1
  173. package/build-module/components/block-canvas/index.js +23 -7
  174. package/build-module/components/block-canvas/index.js.map +1 -1
  175. package/build-module/components/block-card/index.js +1 -1
  176. package/build-module/components/block-card/index.js.map +1 -1
  177. package/build-module/components/block-controls/hook.js +4 -24
  178. package/build-module/components/block-controls/hook.js.map +1 -1
  179. package/build-module/components/block-edit/context.js +2 -0
  180. package/build-module/components/block-edit/context.js.map +1 -1
  181. package/build-module/components/block-edit/index.js +19 -10
  182. package/build-module/components/block-edit/index.js.map +1 -1
  183. package/build-module/components/block-info-slot-fill/index.js +3 -3
  184. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  185. package/build-module/components/block-list/block.js +29 -10
  186. package/build-module/components/block-list/block.js.map +1 -1
  187. package/build-module/components/block-list/block.native.js +14 -5
  188. package/build-module/components/block-list/block.native.js.map +1 -1
  189. package/build-module/components/block-list/use-block-props/index.js +62 -19
  190. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  191. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  192. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  193. package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
  194. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  195. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  196. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  197. package/build-module/components/block-patterns-list/index.js +1 -1
  198. package/build-module/components/block-patterns-list/index.js.map +1 -1
  199. package/build-module/components/block-removal-warning-modal/index.js +3 -10
  200. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  201. package/build-module/components/block-rename/modal.js +3 -0
  202. package/build-module/components/block-rename/modal.js.map +1 -1
  203. package/build-module/components/block-settings/container.native.js +4 -2
  204. package/build-module/components/block-settings/container.native.js.map +1 -1
  205. package/build-module/components/block-styles/index.js +1 -1
  206. package/build-module/components/block-styles/index.js.map +1 -1
  207. package/build-module/components/block-styles/index.native.js +3 -2
  208. package/build-module/components/block-styles/index.native.js.map +1 -1
  209. package/build-module/components/block-toolbar/index.js +88 -25
  210. package/build-module/components/block-toolbar/index.js.map +1 -1
  211. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
  212. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  213. package/build-module/components/block-tools/block-toolbar-popover.js +76 -0
  214. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
  215. package/build-module/components/block-tools/index.js +27 -24
  216. package/build-module/components/block-tools/index.js.map +1 -1
  217. package/build-module/components/block-types-list/index.native.js +2 -1
  218. package/build-module/components/block-types-list/index.native.js.map +1 -1
  219. package/build-module/components/block-variation-picker/index.native.js +2 -1
  220. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  221. package/build-module/components/colors-gradients/control.js +29 -18
  222. package/build-module/components/colors-gradients/control.js.map +1 -1
  223. package/build-module/components/duotone-control/index.js +1 -4
  224. package/build-module/components/duotone-control/index.js.map +1 -1
  225. package/build-module/components/global-styles/color-panel.js +23 -21
  226. package/build-module/components/global-styles/color-panel.js.map +1 -1
  227. package/build-module/components/global-styles/filters-panel.js +10 -4
  228. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  229. package/build-module/components/global-styles/typography-panel.js +20 -31
  230. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  231. package/build-module/components/image-link-destinations/index.native.js +109 -0
  232. package/build-module/components/image-link-destinations/index.native.js.map +1 -0
  233. package/build-module/components/index.native.js +1 -0
  234. package/build-module/components/index.native.js.map +1 -1
  235. package/build-module/components/inserter/media-tab/media-panel.js +1 -1
  236. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  237. package/build-module/components/inserter/menu.js +14 -7
  238. package/build-module/components/inserter/menu.js.map +1 -1
  239. package/build-module/components/inserter/preview-panel.js +2 -2
  240. package/build-module/components/inserter/preview-panel.js.map +1 -1
  241. package/build-module/components/inserter-button/index.native.js +89 -0
  242. package/build-module/components/inserter-button/index.native.js.map +1 -0
  243. package/build-module/components/inserter-button/sparkles.js +15 -0
  244. package/build-module/components/inserter-button/sparkles.js.map +1 -0
  245. package/build-module/components/inserter-draggable-blocks/index.js +9 -5
  246. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  247. package/build-module/components/inspector-controls/fill.js +3 -3
  248. package/build-module/components/inspector-controls/fill.js.map +1 -1
  249. package/build-module/components/inspector-controls/fill.native.js +3 -3
  250. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  251. package/build-module/components/navigable-toolbar/index.js +2 -2
  252. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  253. package/build-module/components/preview-options/index.js +6 -62
  254. package/build-module/components/preview-options/index.js.map +1 -1
  255. package/build-module/components/rich-text/content.js +25 -21
  256. package/build-module/components/rich-text/content.js.map +1 -1
  257. package/build-module/components/rich-text/get-rich-text-values.js +2 -1
  258. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
  259. package/build-module/components/rich-text/index.js +4 -32
  260. package/build-module/components/rich-text/index.js.map +1 -1
  261. package/build-module/components/rich-text/index.native.js +10 -18
  262. package/build-module/components/rich-text/index.native.js.map +1 -1
  263. package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
  264. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  265. package/build-module/components/rich-text/native/index.native.js +7 -34
  266. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  267. package/build-module/components/rich-text/use-input-rules.js +5 -1
  268. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  269. package/build-module/components/rich-text/with-deprecations.js +42 -0
  270. package/build-module/components/rich-text/with-deprecations.js.map +1 -0
  271. package/build-module/components/use-block-drop-zone/index.js +69 -8
  272. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  273. package/build-module/components/use-on-block-drop/index.js +1 -1
  274. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  275. package/build-module/components/use-resize-canvas/index.js +4 -1
  276. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  277. package/build-module/components/use-settings/index.js +13 -1
  278. package/build-module/components/use-settings/index.js.map +1 -1
  279. package/build-module/hooks/align.js +19 -66
  280. package/build-module/hooks/align.js.map +1 -1
  281. package/build-module/hooks/align.native.js +1 -0
  282. package/build-module/hooks/align.native.js.map +1 -1
  283. package/build-module/hooks/anchor.js +11 -26
  284. package/build-module/hooks/anchor.js.map +1 -1
  285. package/build-module/hooks/background.js +26 -28
  286. package/build-module/hooks/background.js.map +1 -1
  287. package/build-module/hooks/block-hooks.js +22 -30
  288. package/build-module/hooks/block-hooks.js.map +1 -1
  289. package/build-module/hooks/block-renaming.js +17 -21
  290. package/build-module/hooks/block-renaming.js.map +1 -1
  291. package/build-module/hooks/border.js +57 -78
  292. package/build-module/hooks/border.js.map +1 -1
  293. package/build-module/hooks/color.js +74 -86
  294. package/build-module/hooks/color.js.map +1 -1
  295. package/build-module/hooks/content-lock-ui.js +27 -27
  296. package/build-module/hooks/content-lock-ui.js.map +1 -1
  297. package/build-module/hooks/custom-class-name.js +11 -27
  298. package/build-module/hooks/custom-class-name.js.map +1 -1
  299. package/build-module/hooks/custom-fields.js +20 -39
  300. package/build-module/hooks/custom-fields.js.map +1 -1
  301. package/build-module/hooks/dimensions.js +21 -16
  302. package/build-module/hooks/dimensions.js.map +1 -1
  303. package/build-module/hooks/duotone.js +30 -61
  304. package/build-module/hooks/duotone.js.map +1 -1
  305. package/build-module/hooks/font-family.js +14 -23
  306. package/build-module/hooks/font-family.js.map +1 -1
  307. package/build-module/hooks/font-size.js +49 -119
  308. package/build-module/hooks/font-size.js.map +1 -1
  309. package/build-module/hooks/index.js +18 -14
  310. package/build-module/hooks/index.js.map +1 -1
  311. package/build-module/hooks/index.native.js +5 -3
  312. package/build-module/hooks/index.native.js.map +1 -1
  313. package/build-module/hooks/layout-child.js +60 -0
  314. package/build-module/hooks/layout-child.js.map +1 -0
  315. package/build-module/hooks/layout.js +13 -98
  316. package/build-module/hooks/layout.js.map +1 -1
  317. package/build-module/hooks/padding.js +2 -2
  318. package/build-module/hooks/padding.js.map +1 -1
  319. package/build-module/hooks/position.js +38 -59
  320. package/build-module/hooks/position.js.map +1 -1
  321. package/build-module/hooks/style.js +51 -84
  322. package/build-module/hooks/style.js.map +1 -1
  323. package/build-module/hooks/typography.js +33 -12
  324. package/build-module/hooks/typography.js.map +1 -1
  325. package/build-module/hooks/utils.js +149 -6
  326. package/build-module/hooks/utils.js.map +1 -1
  327. package/build-module/private-apis.js +0 -2
  328. package/build-module/private-apis.js.map +1 -1
  329. package/build-module/store/private-actions.js +7 -0
  330. package/build-module/store/private-actions.js.map +1 -1
  331. package/build-module/store/private-selectors.js +33 -1
  332. package/build-module/store/private-selectors.js.map +1 -1
  333. package/build-module/store/reducer.js +8 -0
  334. package/build-module/store/reducer.js.map +1 -1
  335. package/build-module/store/selectors.js +3 -53
  336. package/build-module/store/selectors.js.map +1 -1
  337. package/build-module/store/utils.js +56 -0
  338. package/build-module/store/utils.js.map +1 -0
  339. package/build-module/utils/object.js +21 -60
  340. package/build-module/utils/object.js.map +1 -1
  341. package/build-module/utils/selection.js +9 -1
  342. package/build-module/utils/selection.js.map +1 -1
  343. package/build-style/style-rtl.css +113 -293
  344. package/build-style/style.css +113 -293
  345. package/package.json +31 -31
  346. package/src/components/block-canvas/index.js +31 -17
  347. package/src/components/block-caption/README.md +2 -2
  348. package/src/components/block-card/index.js +5 -3
  349. package/src/components/block-card/style.scss +7 -3
  350. package/src/components/block-controls/hook.js +8 -30
  351. package/src/components/block-controls/test/index.js +3 -3
  352. package/src/components/block-edit/context.js +3 -0
  353. package/src/components/block-edit/index.js +36 -10
  354. package/src/components/block-info-slot-fill/index.js +6 -3
  355. package/src/components/block-inspector/style.scss +0 -4
  356. package/src/components/block-list/block.js +39 -5
  357. package/src/components/block-list/block.native.js +18 -4
  358. package/src/components/block-list/use-block-props/index.js +74 -21
  359. package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
  360. package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
  361. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
  362. package/src/components/block-patterns-list/index.js +1 -1
  363. package/src/components/block-removal-warning-modal/index.js +7 -14
  364. package/src/components/block-rename/modal.js +7 -1
  365. package/src/components/block-settings/container.native.js +3 -5
  366. package/src/components/block-styles/index.js +1 -1
  367. package/src/components/block-styles/index.native.js +4 -2
  368. package/src/components/block-styles/style.scss +0 -11
  369. package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
  370. package/src/components/block-toolbar/index.js +180 -95
  371. package/src/components/block-toolbar/style.scss +50 -66
  372. package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
  373. package/src/components/block-tools/block-toolbar-popover.js +90 -0
  374. package/src/components/block-tools/index.js +42 -29
  375. package/src/components/block-tools/style.scss +60 -172
  376. package/src/components/block-types-list/index.native.js +2 -1
  377. package/src/components/block-variation-picker/index.native.js +1 -1
  378. package/src/components/colors-gradients/control.js +49 -30
  379. package/src/components/colors-gradients/style.scss +0 -7
  380. package/src/components/duotone-control/index.js +2 -5
  381. package/src/components/duotone-control/style.scss +1 -6
  382. package/src/components/global-styles/color-panel.js +34 -25
  383. package/src/components/global-styles/filters-panel.js +8 -4
  384. package/src/components/global-styles/typography-panel.js +23 -43
  385. package/src/components/image-link-destinations/index.native.js +152 -0
  386. package/src/components/image-link-destinations/style.native.scss +16 -0
  387. package/src/components/index.native.js +1 -0
  388. package/src/components/inner-blocks/README.md +13 -2
  389. package/src/components/inserter/media-tab/media-panel.js +1 -1
  390. package/src/components/inserter/menu.js +16 -8
  391. package/src/components/inserter/preview-panel.js +2 -2
  392. package/src/components/inserter/style.scss +15 -17
  393. package/src/components/inserter-button/README.md +62 -0
  394. package/src/components/inserter-button/index.native.js +116 -0
  395. package/src/components/inserter-button/sparkles.js +15 -0
  396. package/src/components/inserter-button/style.native.scss +72 -0
  397. package/src/components/inserter-draggable-blocks/index.js +18 -5
  398. package/src/components/inspector-controls/fill.js +6 -3
  399. package/src/components/inspector-controls/fill.native.js +6 -3
  400. package/src/components/link-control/style.scss +1 -1
  401. package/src/components/link-control/test/index.js +1 -1
  402. package/src/components/navigable-toolbar/README.md +2 -0
  403. package/src/components/navigable-toolbar/index.js +2 -2
  404. package/src/components/preview-options/index.js +6 -86
  405. package/src/components/rich-text/content.js +27 -20
  406. package/src/components/rich-text/get-rich-text-values.js +6 -1
  407. package/src/components/rich-text/index.js +5 -46
  408. package/src/components/rich-text/index.native.js +8 -25
  409. package/src/components/rich-text/native/get-format-colors.native.js +33 -40
  410. package/src/components/rich-text/native/index.native.js +7 -48
  411. package/src/components/rich-text/use-input-rules.js +6 -1
  412. package/src/components/rich-text/with-deprecations.js +51 -0
  413. package/src/components/use-block-drop-zone/index.js +114 -14
  414. package/src/components/use-on-block-drop/index.js +2 -1
  415. package/src/components/use-resize-canvas/README.md +3 -3
  416. package/src/components/use-resize-canvas/index.js +4 -1
  417. package/src/components/use-settings/index.js +15 -1
  418. package/src/hooks/align.js +15 -76
  419. package/src/hooks/align.native.js +1 -0
  420. package/src/hooks/anchor.js +13 -33
  421. package/src/hooks/background.js +28 -23
  422. package/src/hooks/block-hooks.js +22 -51
  423. package/src/hooks/block-renaming.js +23 -37
  424. package/src/hooks/border.js +67 -118
  425. package/src/hooks/color.js +100 -132
  426. package/src/hooks/content-lock-ui.js +110 -122
  427. package/src/hooks/custom-class-name.js +8 -40
  428. package/src/hooks/custom-fields.js +20 -47
  429. package/src/hooks/dimensions.js +20 -16
  430. package/src/hooks/duotone.js +70 -127
  431. package/src/hooks/font-family.js +10 -29
  432. package/src/hooks/font-size.js +66 -162
  433. package/src/hooks/index.js +42 -14
  434. package/src/hooks/index.native.js +6 -3
  435. package/src/hooks/layout-child.js +53 -0
  436. package/src/hooks/layout.js +13 -102
  437. package/src/hooks/padding.js +2 -2
  438. package/src/hooks/position.js +50 -90
  439. package/src/hooks/style.js +117 -187
  440. package/src/hooks/test/align.js +1 -178
  441. package/src/hooks/typography.js +20 -16
  442. package/src/hooks/utils.js +187 -6
  443. package/src/private-apis.js +0 -2
  444. package/src/store/private-actions.js +8 -0
  445. package/src/store/private-selectors.js +45 -0
  446. package/src/store/reducer.js +8 -0
  447. package/src/store/selectors.js +5 -69
  448. package/src/store/utils.js +74 -0
  449. package/src/style.scss +0 -2
  450. package/src/utils/object.js +18 -69
  451. package/src/utils/selection.js +9 -2
  452. package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
  453. package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  454. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
  455. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  456. package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
  457. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  458. package/build/components/block-tools/back-compat.js +0 -45
  459. package/build/components/block-tools/back-compat.js.map +0 -1
  460. package/build/components/block-tools/block-contextual-toolbar.js +0 -91
  461. package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
  462. package/build/components/block-tools/selected-block-tools.js +0 -113
  463. package/build/components/block-tools/selected-block-tools.js.map +0 -1
  464. package/build/components/inserter/hooks/use-debounced-input.js +0 -22
  465. package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
  466. package/build/components/use-display-block-controls/index.js +0 -39
  467. package/build/components/use-display-block-controls/index.js.map +0 -1
  468. package/build/components/use-display-block-controls/index.native.js +0 -39
  469. package/build/components/use-display-block-controls/index.native.js.map +0 -1
  470. package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
  471. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  472. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
  473. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  474. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
  475. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  476. package/build-module/components/block-tools/back-compat.js +0 -35
  477. package/build-module/components/block-tools/back-compat.js.map +0 -1
  478. package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
  479. package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
  480. package/build-module/components/block-tools/selected-block-tools.js +0 -105
  481. package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
  482. package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
  483. package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
  484. package/build-module/components/use-display-block-controls/index.js +0 -32
  485. package/build-module/components/use-display-block-controls/index.js.map +0 -1
  486. package/build-module/components/use-display-block-controls/index.native.js +0 -32
  487. package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
  488. package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
  489. package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
  490. package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
  491. package/src/components/block-parent-selector/style.scss +0 -11
  492. package/src/components/block-tools/back-compat.js +0 -35
  493. package/src/components/block-tools/block-contextual-toolbar.js +0 -100
  494. package/src/components/block-tools/selected-block-tools.js +0 -127
  495. package/src/components/inserter/hooks/use-debounced-input.js +0 -18
  496. package/src/components/preview-options/README.md +0 -94
  497. package/src/components/preview-options/style.scss +0 -64
  498. package/src/components/use-display-block-controls/index.js +0 -36
  499. package/src/components/use-display-block-controls/index.native.js +0 -37
  500. package/src/hooks/test/color.js +0 -112
@@ -0,0 +1,72 @@
1
+ /** @format */
2
+ .touchableArea {
3
+ border-radius: 8px 8px 8px 8px;
4
+ }
5
+
6
+ .disabled {
7
+ opacity: 0.3;
8
+ }
9
+
10
+ .modalIconWrapper {
11
+ width: 104px;
12
+ height: 64px;
13
+ background-color: $gray-light; //#f3f6f8
14
+ border-radius: 8px 8px 8px 8px;
15
+ justify-content: center;
16
+ align-items: center;
17
+ }
18
+
19
+ .modalIconWrapperDark {
20
+ background-color: rgba($white, 0.07);
21
+ }
22
+
23
+ .newIndicator {
24
+ height: 22;
25
+ left: 6;
26
+ position: absolute;
27
+ top: 6;
28
+ width: 22;
29
+ }
30
+
31
+ .modalIcon {
32
+ width: 32px;
33
+ height: 32px;
34
+ justify-content: center;
35
+ align-items: center;
36
+ }
37
+
38
+ .modalItemLabel {
39
+ background-color: transparent;
40
+ padding-left: 2;
41
+ padding-right: 2;
42
+ padding-top: 4;
43
+ padding-bottom: 0;
44
+ justify-content: center;
45
+ text-align: center;
46
+ font-size: 12;
47
+ color: $gray-dark;
48
+ }
49
+
50
+ .modalItemLabelDark {
51
+ color: $white;
52
+ }
53
+
54
+ .clipboardBlock {
55
+ background-color: transparent;
56
+ border-width: 1px;
57
+ border-color: $light-gray-400;
58
+ }
59
+
60
+ .clipboardBlockDark {
61
+ border-color: $gray-70;
62
+ }
63
+
64
+ .modalItem {
65
+ flex-direction: column;
66
+ justify-content: flex-start;
67
+ align-items: center;
68
+ padding-left: $grid-unit-20 * 0.5;
69
+ padding-right: $grid-unit-20 * 0.5;
70
+ padding-top: 0;
71
+ padding-bottom: 0;
72
+ }
@@ -2,19 +2,24 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { Draggable } from '@wordpress/components';
5
- import { serialize, store as blocksStore } from '@wordpress/blocks';
5
+ import {
6
+ createBlock,
7
+ serialize,
8
+ store as blocksStore,
9
+ } from '@wordpress/blocks';
6
10
  import { useSelect } from '@wordpress/data';
7
11
  /**
8
12
  * Internal dependencies
9
13
  */
10
14
  import BlockDraggableChip from '../block-draggable/draggable-chip';
15
+ import { PATTERN_TYPES } from '../inserter/block-patterns-tab/utils';
11
16
 
12
17
  const InserterDraggableBlocks = ( {
13
18
  isEnabled,
14
19
  blocks,
15
20
  icon,
16
21
  children,
17
- isPattern,
22
+ pattern,
18
23
  } ) => {
19
24
  const transferData = {
20
25
  type: 'inserter',
@@ -36,13 +41,21 @@ const InserterDraggableBlocks = ( {
36
41
  __experimentalTransferDataType="wp-blocks"
37
42
  transferData={ transferData }
38
43
  onDragStart={ ( event ) => {
39
- event.dataTransfer.setData( 'text/html', serialize( blocks ) );
44
+ const parsedBlocks =
45
+ pattern?.type === PATTERN_TYPES.user &&
46
+ pattern?.syncStatus !== 'unsynced'
47
+ ? [ createBlock( 'core/block', { ref: pattern.id } ) ]
48
+ : blocks;
49
+ event.dataTransfer.setData(
50
+ 'text/html',
51
+ serialize( parsedBlocks )
52
+ );
40
53
  } }
41
54
  __experimentalDragComponent={
42
55
  <BlockDraggableChip
43
56
  count={ blocks.length }
44
- icon={ icon || ( ! isPattern && blockTypeIcon ) }
45
- isPattern={ isPattern }
57
+ icon={ icon || ( ! pattern && blockTypeIcon ) }
58
+ isPattern={ !! pattern }
46
59
  />
47
60
  }
48
61
  >
@@ -12,7 +12,10 @@ import { useEffect, useContext } from '@wordpress/element';
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
- import useDisplayBlockControls from '../use-display-block-controls';
15
+ import {
16
+ useBlockEditContext,
17
+ mayDisplayControlsKey,
18
+ } from '../block-edit/context';
16
19
  import groups from './groups';
17
20
 
18
21
  export default function InspectorControlsFill( {
@@ -33,13 +36,13 @@ export default function InspectorControlsFill( {
33
36
  group = __experimentalGroup;
34
37
  }
35
38
 
36
- const isDisplayed = useDisplayBlockControls();
39
+ const context = useBlockEditContext();
37
40
  const Fill = groups[ group ]?.Fill;
38
41
  if ( ! Fill ) {
39
42
  warning( `Unknown InspectorControls group "${ group }" provided.` );
40
43
  return null;
41
44
  }
42
- if ( ! isDisplayed ) {
45
+ if ( ! context[ mayDisplayControlsKey ] ) {
43
46
  return null;
44
47
  }
45
48
 
@@ -15,7 +15,10 @@ import deprecated from '@wordpress/deprecated';
15
15
  * Internal dependencies
16
16
  */
17
17
  import groups from './groups';
18
- import useDisplayBlockControls from '../use-display-block-controls';
18
+ import {
19
+ useBlockEditContext,
20
+ mayDisplayControlsKey,
21
+ } from '../block-edit/context';
19
22
  import { BlockSettingsButton } from '../block-settings';
20
23
 
21
24
  export default function InspectorControlsFill( {
@@ -35,14 +38,14 @@ export default function InspectorControlsFill( {
35
38
  );
36
39
  group = __experimentalGroup;
37
40
  }
38
- const isDisplayed = useDisplayBlockControls();
41
+ const context = useBlockEditContext();
39
42
 
40
43
  const Fill = groups[ group ]?.Fill;
41
44
  if ( ! Fill ) {
42
45
  warning( `Unknown InspectorControls group "${ group }" provided.` );
43
46
  return null;
44
47
  }
45
- if ( ! isDisplayed ) {
48
+ if ( ! context[ mayDisplayControlsKey ] ) {
46
49
  return null;
47
50
  }
48
51
 
@@ -74,7 +74,7 @@ $preview-image-height: 140px;
74
74
  border-radius: $radius-block-ui;
75
75
  height: $button-size-next-default-40px; // components do not properly support unstable-large yet.
76
76
  margin: 0;
77
- padding: $grid-unit-10 $grid-unit-20;
77
+ padding: $grid-unit-10 $button-size-next-default-40px $grid-unit-10 $grid-unit-20;
78
78
  position: relative;
79
79
  width: 100%;
80
80
  }
@@ -2140,7 +2140,7 @@ describe( 'Post types', () => {
2140
2140
  describe( 'Rich link previews', () => {
2141
2141
  const selectedLink = {
2142
2142
  id: '1',
2143
- title: 'Wordpress.org', // Customize this for differentiation in assertions.
2143
+ title: 'WordPress.org', // Customize this for differentiation in assertions.
2144
2144
  url: 'https://www.wordpress.org',
2145
2145
  type: 'URL',
2146
2146
  };
@@ -8,6 +8,8 @@ The component accepts the following props. Props not included in this set will b
8
8
 
9
9
  ## `focusOnMount`
10
10
 
11
+ _Note: this prop is deprecated._
12
+
11
13
  Whether to immediately focus when the component mounts.
12
14
 
13
15
  - Type: `Boolean`
@@ -162,7 +162,7 @@ function useToolbarFocus( {
162
162
  const index = items.findIndex( ( item ) => item.tabIndex === 0 );
163
163
  onIndexChange( index );
164
164
  };
165
- }, [ initialIndex, initialFocusOnMount, toolbarRef ] );
165
+ }, [ initialIndex, initialFocusOnMount, onIndexChange, toolbarRef ] );
166
166
 
167
167
  const { lastFocus } = useSelect( ( select ) => {
168
168
  const { getLastFocus } = select( blockEditorStore );
@@ -210,9 +210,9 @@ export default function NavigableToolbar( {
210
210
  useToolbarFocus( {
211
211
  toolbarRef,
212
212
  focusOnMount,
213
- isAccessibleToolbar,
214
213
  defaultIndex: initialIndex,
215
214
  onIndexChange,
215
+ isAccessibleToolbar,
216
216
  shouldUseKeyboardFocusShortcut,
217
217
  focusEditorOnEscape,
218
218
  } );
@@ -1,91 +1,11 @@
1
- /**
2
- * External dependencies
3
- */
4
- import classnames from 'classnames';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
9
- import { useViewportMatch } from '@wordpress/compose';
10
- import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
11
- import { __ } from '@wordpress/i18n';
12
- import { check, desktop, mobile, tablet } from '@wordpress/icons';
13
-
14
- export default function PreviewOptions( {
15
- children,
16
- viewLabel,
17
- className,
18
- isEnabled = true,
19
- deviceType,
20
- setDeviceType,
21
- label,
22
- showIconLabels,
23
- } ) {
24
- const isMobile = useViewportMatch( 'small', '<' );
25
- if ( isMobile ) return null;
26
-
27
- const popoverProps = {
28
- className: classnames(
29
- className,
30
- 'block-editor-post-preview__dropdown-content'
31
- ),
32
- placement: 'bottom-end',
33
- };
34
- const toggleProps = {
35
- className: 'block-editor-post-preview__button-toggle',
36
- disabled: ! isEnabled,
37
- __experimentalIsFocusable: ! isEnabled,
38
- children: viewLabel,
39
- showTooltip: ! showIconLabels,
40
- };
41
- const menuProps = {
42
- 'aria-label': __( 'View options' ),
43
- };
44
-
45
- const deviceIcons = {
46
- mobile,
47
- tablet,
48
- desktop,
49
- };
4
+ import deprecated from '@wordpress/deprecated';
50
5
 
51
- return (
52
- <DropdownMenu
53
- className="block-editor-post-preview__dropdown"
54
- popoverProps={ popoverProps }
55
- toggleProps={ toggleProps }
56
- menuProps={ menuProps }
57
- icon={ deviceIcons[ deviceType.toLowerCase() ] }
58
- label={ label || __( 'Preview' ) }
59
- disableOpenOnArrowDown={ ! isEnabled }
60
- >
61
- { ( renderProps ) => (
62
- <>
63
- <MenuGroup>
64
- <MenuItem
65
- className="block-editor-post-preview__button-resize"
66
- onClick={ () => setDeviceType( 'Desktop' ) }
67
- icon={ deviceType === 'Desktop' && check }
68
- >
69
- { __( 'Desktop' ) }
70
- </MenuItem>
71
- <MenuItem
72
- className="block-editor-post-preview__button-resize"
73
- onClick={ () => setDeviceType( 'Tablet' ) }
74
- icon={ deviceType === 'Tablet' && check }
75
- >
76
- { __( 'Tablet' ) }
77
- </MenuItem>
78
- <MenuItem
79
- className="block-editor-post-preview__button-resize"
80
- onClick={ () => setDeviceType( 'Mobile' ) }
81
- icon={ deviceType === 'Mobile' && check }
82
- >
83
- { __( 'Mobile' ) }
84
- </MenuItem>
85
- </MenuGroup>
86
- { children?.( renderProps ) }
87
- </>
88
- ) }
89
- </DropdownMenu>
90
- );
6
+ export default function PreviewOptions() {
7
+ deprecated( 'wp.blockEditor.PreviewOptions', {
8
+ version: '6.5',
9
+ } );
10
+ return null;
91
11
  }
@@ -5,36 +5,43 @@ import { RawHTML } from '@wordpress/element';
5
5
  import { children as childrenSource } from '@wordpress/blocks';
6
6
  import deprecated from '@wordpress/deprecated';
7
7
 
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import RichText from './';
12
+
8
13
  /**
9
14
  * Internal dependencies
10
15
  */
11
16
  import { getMultilineTag } from './utils';
12
17
 
13
- export const Content = ( { value, tagName: Tag, multiline, ...props } ) => {
14
- // Handle deprecated `children` and `node` sources.
15
- if ( Array.isArray( value ) ) {
18
+ export function Content( {
19
+ value,
20
+ tagName: Tag,
21
+ multiline,
22
+ format,
23
+ ...props
24
+ } ) {
25
+ if ( RichText.isEmpty( value ) ) {
26
+ const MultilineTag = getMultilineTag( multiline );
27
+ value = MultilineTag ? <MultilineTag /> : null;
28
+ } else if ( Array.isArray( value ) ) {
16
29
  deprecated( 'wp.blockEditor.RichText value prop as children type', {
17
30
  since: '6.1',
18
31
  version: '6.3',
19
32
  alternative: 'value prop as string',
20
33
  link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/',
21
34
  } );
22
-
23
- value = childrenSource.toHTML( value );
24
- }
25
-
26
- const MultilineTag = getMultilineTag( multiline );
27
-
28
- if ( ! value && MultilineTag ) {
29
- value = `<${ MultilineTag }></${ MultilineTag }>`;
30
- }
31
-
32
- const content = <RawHTML>{ value }</RawHTML>;
33
-
34
- if ( Tag ) {
35
- const { format, ...restProps } = props;
36
- return <Tag { ...restProps }>{ content }</Tag>;
35
+ value = <RawHTML>{ childrenSource.toHTML( value ) }</RawHTML>;
36
+ } else if ( typeof value === 'string' ) {
37
+ // To do: deprecate.
38
+ value = <RawHTML>{ value }</RawHTML>;
39
+ } else {
40
+ // To do: create a toReactComponent method on RichTextData, which we
41
+ // might in the future also use for the editable tree. See
42
+ // https://github.com/WordPress/gutenberg/pull/41655.
43
+ value = <RawHTML>{ value.toHTMLString() }</RawHTML>;
37
44
  }
38
45
 
39
- return content;
40
- };
46
+ return Tag ? <Tag { ...props }>{ value }</Tag> : value;
47
+ }
@@ -6,6 +6,7 @@ import {
6
6
  getSaveElement,
7
7
  __unstableGetBlockProps as getBlockProps,
8
8
  } from '@wordpress/blocks';
9
+ import { RichTextData } from '@wordpress/rich-text';
9
10
 
10
11
  /**
11
12
  * Internal dependencies
@@ -95,5 +96,9 @@ export function getRichTextValues( blocks = [] ) {
95
96
  const values = [];
96
97
  addValuesForBlocks( values, blocks );
97
98
  getBlockProps.skipFilters = false;
98
- return values;
99
+ return values.map( ( value ) =>
100
+ value instanceof RichTextData
101
+ ? value
102
+ : RichTextData.fromHTMLString( value )
103
+ );
99
104
  }
@@ -13,14 +13,11 @@ import {
13
13
  createContext,
14
14
  } from '@wordpress/element';
15
15
  import { useDispatch, useSelect } from '@wordpress/data';
16
- import { children as childrenSource } from '@wordpress/blocks';
17
- import { useInstanceId, useMergeRefs } from '@wordpress/compose';
16
+ import { useMergeRefs } from '@wordpress/compose';
18
17
  import {
19
18
  __unstableUseRichText as useRichText,
20
- __unstableCreateElement,
21
19
  removeFormat,
22
20
  } from '@wordpress/rich-text';
23
- import deprecated from '@wordpress/deprecated';
24
21
  import { Popover } from '@wordpress/components';
25
22
 
26
23
  /**
@@ -46,7 +43,7 @@ import { useFirefoxCompat } from './use-firefox-compat';
46
43
  import FormatEdit from './format-edit';
47
44
  import { getAllowedFormats } from './utils';
48
45
  import { Content } from './content';
49
- import RichTextMultiline from './multiline';
46
+ import { withDeprecations } from './with-deprecations';
50
47
 
51
48
  export const keyboardShortcutContext = createContext();
52
49
  export const inputEventContext = createContext();
@@ -387,47 +384,9 @@ export function RichTextWrapper(
387
384
  );
388
385
  }
389
386
 
390
- const ForwardedRichTextWrapper = forwardRef( RichTextWrapper );
391
-
392
- function RichTextSwitcher( props, ref ) {
393
- let value = props.value;
394
- let onChange = props.onChange;
395
-
396
- // Handle deprecated format.
397
- if ( Array.isArray( value ) ) {
398
- deprecated( 'wp.blockEditor.RichText value prop as children type', {
399
- since: '6.1',
400
- version: '6.3',
401
- alternative: 'value prop as string',
402
- link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/',
403
- } );
404
-
405
- value = childrenSource.toHTML( props.value );
406
- onChange = ( newValue ) =>
407
- props.onChange(
408
- childrenSource.fromDOM(
409
- __unstableCreateElement( document, newValue ).childNodes
410
- )
411
- );
412
- }
413
-
414
- const Component = props.multiline
415
- ? RichTextMultiline
416
- : ForwardedRichTextWrapper;
417
- const instanceId = useInstanceId( RichTextSwitcher );
418
-
419
- return (
420
- <Component
421
- { ...props }
422
- identifier={ props.identifier || instanceId }
423
- value={ value }
424
- onChange={ onChange }
425
- ref={ ref }
426
- />
427
- );
428
- }
429
-
430
- const ForwardedRichTextContainer = forwardRef( RichTextSwitcher );
387
+ const ForwardedRichTextContainer = withDeprecations(
388
+ forwardRef( RichTextWrapper )
389
+ );
431
390
 
432
391
  ForwardedRichTextContainer.Content = Content;
433
392
  ForwardedRichTextContainer.isEmpty = ( value ) => {
@@ -39,17 +39,17 @@ import FormatToolbarContainer from './format-toolbar-container';
39
39
  import { store as blockEditorStore } from '../../store';
40
40
  import {
41
41
  addActiveFormats,
42
- getMultilineTag,
43
42
  getAllowedFormats,
44
43
  createLinkInParagraph,
45
44
  } from './utils';
46
45
  import EmbedHandlerPicker from './embed-handler-picker';
47
46
  import { Content } from './content';
48
47
  import RichText from './native';
48
+ import { withDeprecations } from './with-deprecations';
49
49
 
50
50
  const classes = 'block-editor-rich-text__editable';
51
51
 
52
- function RichTextWrapper(
52
+ export function RichTextWrapper(
53
53
  {
54
54
  children,
55
55
  tagName,
@@ -58,7 +58,6 @@ function RichTextWrapper(
58
58
  value: originalValue,
59
59
  onChange: originalOnChange,
60
60
  isSelected: originalIsSelected,
61
- multiline,
62
61
  inlineToolbar,
63
62
  wrapperClassName,
64
63
  autocompleters,
@@ -80,7 +79,6 @@ function RichTextWrapper(
80
79
  disableLineBreaks,
81
80
  unstableOnFocus,
82
81
  __unstableAllowPrefixTransformations,
83
- __unstableMultilineRootTag,
84
82
  // Native props.
85
83
  __unstableMobileNoFocusOnMount,
86
84
  deleteEnter,
@@ -179,7 +177,6 @@ function RichTextWrapper(
179
177
  selectionChange,
180
178
  __unstableMarkAutomaticChange,
181
179
  } = useDispatch( blockEditorStore );
182
- const multilineTag = getMultilineTag( multiline );
183
180
  const adjustedAllowedFormats = getAllowedFormats( {
184
181
  allowedFormats,
185
182
  disableFormats,
@@ -261,10 +258,7 @@ function RichTextWrapper(
261
258
  if ( ! hasPastedBlocks || ! isEmpty( before ) ) {
262
259
  blocks.push(
263
260
  onSplit(
264
- toHTMLString( {
265
- value: before,
266
- multilineTag,
267
- } ),
261
+ toHTMLString( { value: before } ),
268
262
  ! isAfterOriginal
269
263
  )
270
264
  );
@@ -288,13 +282,7 @@ function RichTextWrapper(
288
282
  : ! onSplitMiddle || ! isEmpty( after )
289
283
  ) {
290
284
  blocks.push(
291
- onSplit(
292
- toHTMLString( {
293
- value: after,
294
- multilineTag,
295
- } ),
296
- isAfterOriginal
297
- )
285
+ onSplit( toHTMLString( { value: after } ), isAfterOriginal )
298
286
  );
299
287
  }
300
288
 
@@ -308,7 +296,7 @@ function RichTextWrapper(
308
296
 
309
297
  onReplace( blocks, indexToSelect, initialPosition );
310
298
  },
311
- [ onReplace, onSplit, multilineTag, onSplitMiddle ]
299
+ [ onReplace, onSplit, onSplitMiddle ]
312
300
  );
313
301
 
314
302
  const onEnter = useCallback(
@@ -370,7 +358,6 @@ function RichTextWrapper(
370
358
  onReplace,
371
359
  onSplit,
372
360
  __unstableMarkAutomaticChange,
373
- multiline,
374
361
  splitValue,
375
362
  onSplitAtEnd,
376
363
  ]
@@ -392,9 +379,6 @@ function RichTextWrapper(
392
379
  if ( isInternal ) {
393
380
  const pastedValue = create( {
394
381
  html,
395
- multilineTag,
396
- multilineWrapperTags:
397
- multilineTag === 'li' ? [ 'ul', 'ol' ] : undefined,
398
382
  preserveWhiteSpace,
399
383
  } );
400
384
  addActiveFormats( pastedValue, activeFormats );
@@ -496,7 +480,6 @@ function RichTextWrapper(
496
480
  onSplit,
497
481
  splitValue,
498
482
  __unstableEmbedURLOnPaste,
499
- multilineTag,
500
483
  preserveWhiteSpace,
501
484
  pastePlainText,
502
485
  ]
@@ -568,7 +551,6 @@ function RichTextWrapper(
568
551
  onPaste={ onPaste }
569
552
  __unstableIsSelected={ isSelected }
570
553
  __unstableInputRule={ inputRule }
571
- __unstableMultilineTag={ multilineTag }
572
554
  __unstableOnEnterFormattedText={ enterFormattedText }
573
555
  __unstableOnExitFormattedText={ exitFormattedText }
574
556
  __unstableOnCreateUndoLevel={ __unstableMarkLastChangeAsPersistent }
@@ -582,7 +564,6 @@ function RichTextWrapper(
582
564
  __unstableAllowPrefixTransformations={
583
565
  __unstableAllowPrefixTransformations
584
566
  }
585
- __unstableMultilineRootTag={ __unstableMultilineRootTag }
586
567
  // Native props.
587
568
  blockIsSelected={
588
569
  originalIsSelected !== undefined
@@ -675,7 +656,9 @@ function RichTextWrapper(
675
656
  );
676
657
  }
677
658
 
678
- const ForwardedRichTextContainer = forwardRef( RichTextWrapper );
659
+ const ForwardedRichTextContainer = withDeprecations(
660
+ forwardRef( RichTextWrapper )
661
+ );
679
662
 
680
663
  ForwardedRichTextContainer.Content = Content;
681
664