@wordpress/block-editor 15.20.0 → 15.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/components/block-compare/index.cjs +2 -2
  3. package/build/components/block-compare/index.cjs.map +2 -2
  4. package/build/components/block-list/use-block-props/index.cjs +1 -1
  5. package/build/components/block-list/use-block-props/index.cjs.map +2 -2
  6. package/build/components/block-patterns-list/index.cjs +1 -1
  7. package/build/components/block-patterns-list/index.cjs.map +2 -2
  8. package/build/components/block-switcher/block-transformations-menu.cjs +16 -15
  9. package/build/components/block-switcher/block-transformations-menu.cjs.map +2 -2
  10. package/build/components/block-switcher/index.cjs +4 -4
  11. package/build/components/block-switcher/index.cjs.map +2 -2
  12. package/build/components/child-layout-control/index.cjs +10 -5
  13. package/build/components/child-layout-control/index.cjs.map +2 -2
  14. package/build/components/global-styles/advanced-panel.cjs +23 -15
  15. package/build/components/global-styles/advanced-panel.cjs.map +2 -2
  16. package/build/components/global-styles/background-panel.cjs +2 -2
  17. package/build/components/global-styles/background-panel.cjs.map +2 -2
  18. package/build/components/global-styles/border-panel.cjs +2 -0
  19. package/build/components/global-styles/border-panel.cjs.map +2 -2
  20. package/build/components/global-styles/dimensions-panel.cjs +5 -4
  21. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  22. package/build/components/iframe/index.cjs +3 -0
  23. package/build/components/iframe/index.cjs.map +2 -2
  24. package/build/components/inner-blocks/use-inner-block-template-sync.cjs +3 -1
  25. package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +2 -2
  26. package/build/components/inserter/hooks/use-patterns-state.cjs +1 -1
  27. package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
  28. package/build/components/inserter/index.cjs +179 -220
  29. package/build/components/inserter/index.cjs.map +3 -3
  30. package/build/components/inserter/media-tab/utils.cjs +1 -1
  31. package/build/components/inserter/media-tab/utils.cjs.map +2 -2
  32. package/build/components/inserter/search-results.cjs +1 -1
  33. package/build/components/inserter/search-results.cjs.map +2 -2
  34. package/build/components/list-view/block-select-button.cjs +10 -12
  35. package/build/components/list-view/block-select-button.cjs.map +2 -2
  36. package/build/components/list-view/block.cjs +2 -1
  37. package/build/components/list-view/block.cjs.map +2 -2
  38. package/build/components/provider/use-block-sync.cjs +11 -2
  39. package/build/components/provider/use-block-sync.cjs.map +2 -2
  40. package/build/components/rich-text/event-listeners/before-input-rules.cjs +4 -4
  41. package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
  42. package/build/components/rich-text/event-listeners/delete.cjs +4 -4
  43. package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
  44. package/build/components/rich-text/event-listeners/enter.cjs +7 -2
  45. package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
  46. package/build/components/rich-text/event-listeners/input-events.cjs +4 -4
  47. package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
  48. package/build/components/rich-text/event-listeners/input-rules.cjs +17 -4
  49. package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
  50. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +4 -4
  51. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
  52. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +4 -4
  53. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
  54. package/build/components/rich-text/event-listeners/shortcuts.cjs +4 -4
  55. package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
  56. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +4 -4
  57. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
  58. package/build/components/rich-text/index.cjs +1 -23
  59. package/build/components/rich-text/index.cjs.map +2 -2
  60. package/build/components/use-block-commands/index.cjs +5 -5
  61. package/build/components/use-block-commands/index.cjs.map +2 -2
  62. package/build/hooks/anchor.cjs +11 -15
  63. package/build/hooks/anchor.cjs.map +2 -2
  64. package/build/hooks/border.cjs +0 -3
  65. package/build/hooks/border.cjs.map +2 -2
  66. package/build/hooks/color.cjs +1 -4
  67. package/build/hooks/color.cjs.map +2 -2
  68. package/build/hooks/dimensions.cjs +0 -3
  69. package/build/hooks/dimensions.cjs.map +2 -2
  70. package/build/hooks/fit-text.cjs +11 -0
  71. package/build/hooks/fit-text.cjs.map +2 -2
  72. package/build/hooks/position.cjs +19 -22
  73. package/build/hooks/position.cjs.map +2 -2
  74. package/build/hooks/supports.cjs +0 -7
  75. package/build/hooks/supports.cjs.map +2 -2
  76. package/build/store/actions.cjs +7 -3
  77. package/build/store/actions.cjs.map +2 -2
  78. package/build/store/private-actions.cjs +1 -2
  79. package/build/store/private-actions.cjs.map +2 -2
  80. package/build/store/private-selectors.cjs +29 -0
  81. package/build/store/private-selectors.cjs.map +2 -2
  82. package/build/store/reducer.cjs +14 -6
  83. package/build/store/reducer.cjs.map +2 -2
  84. package/build/store/selectors.cjs +60 -41
  85. package/build/store/selectors.cjs.map +2 -2
  86. package/build-module/components/block-compare/index.mjs +1 -1
  87. package/build-module/components/block-compare/index.mjs.map +2 -2
  88. package/build-module/components/block-list/use-block-props/index.mjs +1 -1
  89. package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
  90. package/build-module/components/block-patterns-list/index.mjs +1 -1
  91. package/build-module/components/block-patterns-list/index.mjs.map +2 -2
  92. package/build-module/components/block-switcher/block-transformations-menu.mjs +16 -15
  93. package/build-module/components/block-switcher/block-transformations-menu.mjs.map +2 -2
  94. package/build-module/components/block-switcher/index.mjs +4 -4
  95. package/build-module/components/block-switcher/index.mjs.map +2 -2
  96. package/build-module/components/child-layout-control/index.mjs +10 -5
  97. package/build-module/components/child-layout-control/index.mjs.map +2 -2
  98. package/build-module/components/global-styles/advanced-panel.mjs +23 -15
  99. package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
  100. package/build-module/components/global-styles/background-panel.mjs +3 -3
  101. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  102. package/build-module/components/global-styles/border-panel.mjs +2 -0
  103. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  104. package/build-module/components/global-styles/dimensions-panel.mjs +9 -6
  105. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  106. package/build-module/components/iframe/index.mjs +3 -0
  107. package/build-module/components/iframe/index.mjs.map +2 -2
  108. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +3 -1
  109. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +2 -2
  110. package/build-module/components/inserter/hooks/use-patterns-state.mjs +1 -1
  111. package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
  112. package/build-module/components/inserter/index.mjs +185 -222
  113. package/build-module/components/inserter/index.mjs.map +3 -3
  114. package/build-module/components/inserter/media-tab/utils.mjs +1 -1
  115. package/build-module/components/inserter/media-tab/utils.mjs.map +2 -2
  116. package/build-module/components/inserter/search-results.mjs +1 -1
  117. package/build-module/components/inserter/search-results.mjs.map +2 -2
  118. package/build-module/components/list-view/block-select-button.mjs +10 -12
  119. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  120. package/build-module/components/list-view/block.mjs +2 -1
  121. package/build-module/components/list-view/block.mjs.map +2 -2
  122. package/build-module/components/provider/use-block-sync.mjs +11 -2
  123. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  124. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +4 -4
  125. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
  126. package/build-module/components/rich-text/event-listeners/delete.mjs +4 -4
  127. package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
  128. package/build-module/components/rich-text/event-listeners/enter.mjs +7 -2
  129. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  130. package/build-module/components/rich-text/event-listeners/input-events.mjs +4 -4
  131. package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
  132. package/build-module/components/rich-text/event-listeners/input-rules.mjs +17 -4
  133. package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
  134. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +4 -4
  135. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
  136. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +4 -4
  137. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
  138. package/build-module/components/rich-text/event-listeners/shortcuts.mjs +4 -4
  139. package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
  140. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +4 -4
  141. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
  142. package/build-module/components/rich-text/index.mjs +1 -23
  143. package/build-module/components/rich-text/index.mjs.map +2 -2
  144. package/build-module/components/use-block-commands/index.mjs +5 -5
  145. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  146. package/build-module/hooks/anchor.mjs +11 -15
  147. package/build-module/hooks/anchor.mjs.map +2 -2
  148. package/build-module/hooks/border.mjs +1 -4
  149. package/build-module/hooks/border.mjs.map +2 -2
  150. package/build-module/hooks/color.mjs +2 -5
  151. package/build-module/hooks/color.mjs.map +2 -2
  152. package/build-module/hooks/dimensions.mjs +1 -4
  153. package/build-module/hooks/dimensions.mjs.map +2 -2
  154. package/build-module/hooks/fit-text.mjs +11 -0
  155. package/build-module/hooks/fit-text.mjs.map +2 -2
  156. package/build-module/hooks/position.mjs +20 -23
  157. package/build-module/hooks/position.mjs.map +2 -2
  158. package/build-module/hooks/supports.mjs +0 -7
  159. package/build-module/hooks/supports.mjs.map +2 -2
  160. package/build-module/store/actions.mjs +7 -3
  161. package/build-module/store/actions.mjs.map +2 -2
  162. package/build-module/store/private-actions.mjs +1 -2
  163. package/build-module/store/private-actions.mjs.map +2 -2
  164. package/build-module/store/private-selectors.mjs +26 -0
  165. package/build-module/store/private-selectors.mjs.map +2 -2
  166. package/build-module/store/reducer.mjs +14 -6
  167. package/build-module/store/reducer.mjs.map +2 -2
  168. package/build-module/store/selectors.mjs +62 -42
  169. package/build-module/store/selectors.mjs.map +2 -2
  170. package/build-style/content-rtl.css +12 -0
  171. package/build-style/content.css +12 -0
  172. package/build-style/style-rtl.css +26 -8
  173. package/build-style/style.css +26 -8
  174. package/package.json +51 -48
  175. package/src/components/block-breadcrumb/README.md +2 -2
  176. package/src/components/block-compare/README.md +6 -6
  177. package/src/components/block-compare/index.js +1 -3
  178. package/src/components/block-list/use-block-props/index.js +1 -1
  179. package/src/components/block-patterns-list/index.js +1 -1
  180. package/src/components/block-preview/README.md +1 -1
  181. package/src/components/block-switcher/block-transformations-menu.js +16 -18
  182. package/src/components/block-switcher/index.js +4 -4
  183. package/src/components/block-types-list/README.md +0 -19
  184. package/src/components/child-layout-control/index.js +15 -8
  185. package/src/components/child-layout-control/test/index.js +126 -0
  186. package/src/components/colors/test/with-colors.js +1 -1
  187. package/src/components/global-styles/advanced-panel.js +5 -1
  188. package/src/components/global-styles/background-panel.js +3 -3
  189. package/src/components/global-styles/border-panel.js +2 -0
  190. package/src/components/global-styles/dimensions-panel.js +23 -16
  191. package/src/components/iframe/index.js +3 -0
  192. package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -1
  193. package/src/components/inserter/hooks/use-patterns-state.js +1 -1
  194. package/src/components/inserter/index.js +257 -288
  195. package/src/components/inserter/media-tab/utils.js +1 -1
  196. package/src/components/inserter/search-results.js +1 -3
  197. package/src/components/justify-content-control/README.md +1 -1
  198. package/src/components/list-view/block-select-button.js +9 -13
  199. package/src/components/list-view/block.js +1 -0
  200. package/src/components/media-placeholder/README.md +1 -29
  201. package/src/components/media-upload/README.md +0 -19
  202. package/src/components/provider/test/use-block-sync.js +40 -0
  203. package/src/components/provider/use-block-sync.js +12 -2
  204. package/src/components/rich-text/event-listeners/before-input-rules.js +5 -4
  205. package/src/components/rich-text/event-listeners/delete.js +9 -4
  206. package/src/components/rich-text/event-listeners/enter.js +9 -2
  207. package/src/components/rich-text/event-listeners/input-events.js +13 -4
  208. package/src/components/rich-text/event-listeners/input-rules.js +20 -4
  209. package/src/components/rich-text/event-listeners/insert-replacement-text.js +9 -4
  210. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +9 -4
  211. package/src/components/rich-text/event-listeners/shortcuts.js +13 -4
  212. package/src/components/rich-text/event-listeners/undo-automatic-change.js +5 -4
  213. package/src/components/rich-text/index.js +1 -33
  214. package/src/components/unit-control/README.md +1 -1
  215. package/src/components/url-popover/README.md +1 -1
  216. package/src/components/use-block-commands/index.js +5 -5
  217. package/src/hooks/anchor.js +9 -17
  218. package/src/hooks/border.js +1 -5
  219. package/src/hooks/color.js +1 -6
  220. package/src/hooks/dimensions.js +1 -5
  221. package/src/hooks/fit-text.js +16 -0
  222. package/src/hooks/position.js +23 -27
  223. package/src/hooks/supports.js +0 -9
  224. package/src/store/actions.js +13 -3
  225. package/src/store/private-actions.js +1 -4
  226. package/src/store/private-selectors.js +59 -0
  227. package/src/store/reducer.js +19 -7
  228. package/src/store/selectors.js +91 -53
  229. package/src/store/test/actions.js +21 -0
  230. package/src/store/test/private-selectors.js +53 -0
  231. package/src/store/test/reducer.js +46 -0
  232. package/src/store/test/selectors.js +77 -0
  233. package/build/components/media-upload-progress/constants.cjs +0 -46
  234. package/build/components/media-upload-progress/constants.cjs.map +0 -7
  235. package/build/components/rich-text/native/format-edit.cjs +0 -60
  236. package/build/components/rich-text/native/format-edit.cjs.map +0 -7
  237. package/build/components/rich-text/native/index.cjs +0 -28
  238. package/build/components/rich-text/native/index.cjs.map +0 -7
  239. package/build/components/rich-text/native/use-format-types.cjs +0 -139
  240. package/build/components/rich-text/native/use-format-types.cjs.map +0 -7
  241. package/build-module/components/media-upload-progress/constants.mjs +0 -16
  242. package/build-module/components/media-upload-progress/constants.mjs.map +0 -7
  243. package/build-module/components/rich-text/native/format-edit.mjs +0 -39
  244. package/build-module/components/rich-text/native/format-edit.mjs.map +0 -7
  245. package/build-module/components/rich-text/native/index.mjs +0 -7
  246. package/build-module/components/rich-text/native/index.mjs.map +0 -7
  247. package/build-module/components/rich-text/native/use-format-types.mjs +0 -114
  248. package/build-module/components/rich-text/native/use-format-types.mjs.map +0 -7
  249. package/src/components/audio-player/audio-url-parser.native.js +0 -20
  250. package/src/components/audio-player/index.native.js +0 -225
  251. package/src/components/audio-player/styles.native.scss +0 -114
  252. package/src/components/audio-player/test/audio-url-parser.native.js +0 -53
  253. package/src/components/block-alignment-control/test/index.native.js +0 -37
  254. package/src/components/block-alignment-control/ui.native.js +0 -86
  255. package/src/components/block-caption/README.md +0 -104
  256. package/src/components/block-caption/index.native.js +0 -89
  257. package/src/components/block-caption/styles.native.scss +0 -7
  258. package/src/components/block-controls/slot.native.js +0 -33
  259. package/src/components/block-draggable/draggable-chip.native.js +0 -49
  260. package/src/components/block-draggable/dropping-insertion-point.native.js +0 -181
  261. package/src/components/block-draggable/dropping-insertion-point.native.scss +0 -8
  262. package/src/components/block-draggable/index.native.js +0 -467
  263. package/src/components/block-draggable/style.native.scss +0 -19
  264. package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +0 -73
  265. package/src/components/block-draggable/test/helpers.native.js +0 -182
  266. package/src/components/block-draggable/test/index.native.js +0 -419
  267. package/src/components/block-draggable/use-scroll-when-dragging.native.js +0 -135
  268. package/src/components/block-edit/edit.native.js +0 -49
  269. package/src/components/block-edit/test/edit.native.js +0 -65
  270. package/src/components/block-heading-level-dropdown/index.native.js +0 -68
  271. package/src/components/block-icon/index.native.js +0 -47
  272. package/src/components/block-icon/style.native.scss +0 -7
  273. package/src/components/block-list/block-crash-boundary.native.js +0 -43
  274. package/src/components/block-list/block-crash-warning.native.js +0 -21
  275. package/src/components/block-list/block-invalid-warning.native.js +0 -70
  276. package/src/components/block-list/block-list-context.native.js +0 -172
  277. package/src/components/block-list/block-list-item-cell.native.js +0 -62
  278. package/src/components/block-list/block-list-item.native.js +0 -209
  279. package/src/components/block-list/block-list-item.native.scss +0 -16
  280. package/src/components/block-list/block-outline.native.js +0 -77
  281. package/src/components/block-list/block-selection-button.native.js +0 -100
  282. package/src/components/block-list/block-selection-button.native.scss +0 -34
  283. package/src/components/block-list/block.native.js +0 -716
  284. package/src/components/block-list/block.native.scss +0 -62
  285. package/src/components/block-list/grid-item.native.js +0 -58
  286. package/src/components/block-list/index.native.js +0 -437
  287. package/src/components/block-list/insertion-point.native.js +0 -36
  288. package/src/components/block-list/style.native.scss +0 -117
  289. package/src/components/block-list/test/block-invalid-warning.native.js +0 -62
  290. package/src/components/block-list/test/block-list-context.native.js +0 -243
  291. package/src/components/block-list/test/block-outline.native.js +0 -255
  292. package/src/components/block-list/test/fixtures/block-list-context.native.js +0 -79
  293. package/src/components/block-list/test/index.native.js +0 -205
  294. package/src/components/block-list/use-block-props/index.native.js +0 -10
  295. package/src/components/block-list/use-scroll-upon-insertion.native.js +0 -52
  296. package/src/components/block-list-appender/index.native.js +0 -70
  297. package/src/components/block-list-appender/style.native.scss +0 -8
  298. package/src/components/block-media-update-progress/README.md +0 -100
  299. package/src/components/block-media-update-progress/index.native.js +0 -299
  300. package/src/components/block-media-update-progress/styles.native.scss +0 -9
  301. package/src/components/block-media-update-progress/test/index.native.js +0 -543
  302. package/src/components/block-mover/index.native.js +0 -193
  303. package/src/components/block-mover/mover-description.native.js +0 -155
  304. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -218
  305. package/src/components/block-mover/test/index.native.js +0 -186
  306. package/src/components/block-settings/button.native.js +0 -41
  307. package/src/components/block-settings/container.native.js +0 -91
  308. package/src/components/block-settings/container.native.scss +0 -4
  309. package/src/components/block-settings/index.native.js +0 -5
  310. package/src/components/block-styles/index.native.js +0 -94
  311. package/src/components/block-styles/preview.native.js +0 -109
  312. package/src/components/block-styles/style.native.scss +0 -64
  313. package/src/components/block-switcher/block-transformations-menu.native.js +0 -91
  314. package/src/components/block-toolbar/block-toolbar-menu.native.js +0 -477
  315. package/src/components/block-toolbar/index.native.js +0 -126
  316. package/src/components/block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap +0 -125
  317. package/src/components/block-toolbar/test/block-toolbar-menu.native.js +0 -405
  318. package/src/components/block-toolbar/test/index.native.js +0 -36
  319. package/src/components/block-types-list/index.native.js +0 -175
  320. package/src/components/block-types-list/style.native.scss +0 -25
  321. package/src/components/block-variation-picker/index.native.js +0 -107
  322. package/src/components/block-variation-picker/style.native.scss +0 -32
  323. package/src/components/button-block-appender/index.native.js +0 -92
  324. package/src/components/button-block-appender/styles.native.scss +0 -43
  325. package/src/components/caption/README.md +0 -44
  326. package/src/components/caption/index.native.js +0 -61
  327. package/src/components/colors-gradients/panel-color-gradient-settings.native.js +0 -59
  328. package/src/components/contrast-checker/index.native.js +0 -113
  329. package/src/components/contrast-checker/style.native.scss +0 -26
  330. package/src/components/convert-to-group-buttons/index.native.js +0 -79
  331. package/src/components/default-block-appender/index.native.js +0 -113
  332. package/src/components/default-block-appender/style.native.scss +0 -18
  333. package/src/components/floating-toolbar/floatingToolbar.android.scss +0 -4
  334. package/src/components/floating-toolbar/floatingToolbar.ios.scss +0 -3
  335. package/src/components/floating-toolbar/index.native.js +0 -141
  336. package/src/components/floating-toolbar/styles.native.scss +0 -43
  337. package/src/components/font-sizes/index.native.js +0 -7
  338. package/src/components/global-styles/color-panel.native.js +0 -207
  339. package/src/components/global-styles/test/use-global-styles-context.native.js +0 -435
  340. package/src/components/global-styles/use-global-styles-context.native.js +0 -592
  341. package/src/components/gradients/index.native.js +0 -2
  342. package/src/components/image-link-destinations/index.native.js +0 -152
  343. package/src/components/image-link-destinations/style.native.scss +0 -16
  344. package/src/components/index.native.js +0 -108
  345. package/src/components/inner-blocks/constants.native.js +0 -5
  346. package/src/components/inner-blocks/index.native.js +0 -221
  347. package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +0 -124
  348. package/src/components/inserter/block-types-tab.native.js +0 -76
  349. package/src/components/inserter/hooks/use-block-type-impressions.native.js +0 -47
  350. package/src/components/inserter/hooks/use-clipboard-block.native.js +0 -40
  351. package/src/components/inserter/index.native.js +0 -424
  352. package/src/components/inserter/menu.native.js +0 -237
  353. package/src/components/inserter/no-results.native.js +0 -49
  354. package/src/components/inserter/reusable-blocks-tab.native.js +0 -45
  355. package/src/components/inserter/search-results.native.js +0 -67
  356. package/src/components/inserter/style.native.scss +0 -83
  357. package/src/components/inserter/tabs.native.js +0 -152
  358. package/src/components/inserter/test/__snapshots__/index.native.js.snap +0 -117
  359. package/src/components/inserter/test/fixtures/index.native.js +0 -12
  360. package/src/components/inserter/test/index.native.js +0 -273
  361. package/src/components/inserter/test/reusable-blocks-tab.native.js +0 -62
  362. package/src/components/inserter/test/utils.native.js +0 -37
  363. package/src/components/inserter/utils.native.js +0 -46
  364. package/src/components/inserter-button/index.native.js +0 -108
  365. package/src/components/inserter-button/style.native.scss +0 -72
  366. package/src/components/inspector-controls/fill.native.js +0 -62
  367. package/src/components/inspector-controls/slot.native.js +0 -35
  368. package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +0 -31
  369. package/src/components/line-height-control/index.native.js +0 -28
  370. package/src/components/media-placeholder/index.native.js +0 -258
  371. package/src/components/media-placeholder/styles.native.scss +0 -108
  372. package/src/components/media-replace-flow/index.native.js +0 -12
  373. package/src/components/media-upload/constants.native.js +0 -14
  374. package/src/components/media-upload/index.native.js +0 -356
  375. package/src/components/media-upload/style.native.scss +0 -4
  376. package/src/components/media-upload/test/index.native.js +0 -172
  377. package/src/components/media-upload-progress/README.md +0 -100
  378. package/src/components/media-upload-progress/constants.js +0 -6
  379. package/src/components/media-upload-progress/index.native.js +0 -233
  380. package/src/components/media-upload-progress/styles.native.scss +0 -15
  381. package/src/components/media-upload-progress/test/index.native.js +0 -220
  382. package/src/components/plain-text/index.native.js +0 -164
  383. package/src/components/plain-text/style.native.scss +0 -10
  384. package/src/components/provider/index.native.js +0 -32
  385. package/src/components/rich-text/embed-handler-picker.native.js +0 -65
  386. package/src/components/rich-text/file-paste-handler.native.js +0 -3
  387. package/src/components/rich-text/format-toolbar/index.native.js +0 -21
  388. package/src/components/rich-text/format-toolbar-container.native.js +0 -16
  389. package/src/components/rich-text/index.native.js +0 -701
  390. package/src/components/rich-text/input-event.native.js +0 -10
  391. package/src/components/rich-text/native/format-edit.js +0 -44
  392. package/src/components/rich-text/native/get-format-colors.native.js +0 -47
  393. package/src/components/rich-text/native/index.js +0 -1
  394. package/src/components/rich-text/native/index.native.js +0 -1389
  395. package/src/components/rich-text/native/style.native.scss +0 -28
  396. package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +0 -79
  397. package/src/components/rich-text/native/test/index.native.js +0 -345
  398. package/src/components/rich-text/native/test/performance/rich-text.native.js +0 -44
  399. package/src/components/rich-text/native/toolbar-button-with-options.native.js +0 -61
  400. package/src/components/rich-text/native/use-format-types.js +0 -146
  401. package/src/components/rich-text/remove-browser-shortcuts.native.js +0 -1
  402. package/src/components/rich-text/shortcut.native.js +0 -10
  403. package/src/components/ungroup-button/README.md +0 -23
  404. package/src/components/ungroup-button/index.native.js +0 -77
  405. package/src/components/unsupported-block-details/index.native.js +0 -187
  406. package/src/components/unsupported-block-details/style.native.scss +0 -56
  407. package/src/components/url-input/index.native.js +0 -33
  408. package/src/components/use-block-drop-zone/index.native.js +0 -207
  409. package/src/components/use-on-block-drop/index.native.js +0 -115
  410. package/src/components/use-unsupported-block-editor/index.native.js +0 -59
  411. package/src/components/video-player/gridicon-play.native.js +0 -13
  412. package/src/components/video-player/index.native.js +0 -133
  413. package/src/components/video-player/styles.native.scss +0 -29
  414. package/src/components/warning/index.native.js +0 -64
  415. package/src/components/warning/style.native.scss +0 -47
  416. package/src/hooks/align.native.js +0 -49
  417. package/src/hooks/custom-class-name.native.js +0 -70
  418. package/src/hooks/index.native.js +0 -36
  419. package/src/hooks/layout.native.js +0 -23
  420. package/src/hooks/test/__snapshots__/align.native.js.snap +0 -73
  421. package/src/hooks/test/__snapshots__/anchor.native.js.snap +0 -7
  422. package/src/hooks/test/align.native.js +0 -134
  423. package/src/hooks/test/anchor.native.js +0 -32
  424. package/src/hooks/test/use-editor-wrapper-styles.native.js +0 -282
  425. package/src/hooks/typography.native.js +0 -60
  426. package/src/hooks/use-editor-wrapper-styles.native.js +0 -250
  427. package/src/hooks/use-editor-wrapper-styles.native.scss +0 -12
  428. package/src/index.native.js +0 -6
  429. package/src/private-apis.native.js +0 -21
  430. package/src/store/defaults.native.js +0 -23
@@ -5,7 +5,6 @@ import { addFilter } from '@wordpress/hooks';
5
5
  import { TextControl, ExternalLink } from '@wordpress/components';
6
6
  import { __ } from '@wordpress/i18n';
7
7
  import { hasBlockSupport } from '@wordpress/blocks';
8
- import { Platform } from '@wordpress/element';
9
8
 
10
9
  /**
11
10
  * Internal dependencies
@@ -53,8 +52,6 @@ function BlockEditAnchorControlPure( { anchor, setAttributes } ) {
53
52
  return null;
54
53
  }
55
54
 
56
- const isWeb = Platform.OS === 'web';
57
-
58
55
  return (
59
56
  <InspectorControls group="advanced">
60
57
  <TextControl
@@ -65,23 +62,18 @@ function BlockEditAnchorControlPure( { anchor, setAttributes } ) {
65
62
  <>
66
63
  { __(
67
64
  'Enter a word or two—without spaces—to make a unique web address just for this block, called an “anchor”. Then, you’ll be able to link directly to this section of your page.'
68
- ) }
69
- { isWeb && (
70
- <>
71
- { ' ' }
72
- <ExternalLink
73
- href={ __(
74
- 'https://wordpress.org/documentation/article/page-jumps/'
75
- ) }
76
- >
77
- { __( 'Learn more about anchors' ) }
78
- </ExternalLink>
79
- </>
80
- ) }
65
+ ) }{ ' ' }
66
+ <ExternalLink
67
+ href={ __(
68
+ 'https://wordpress.org/documentation/article/page-jumps/'
69
+ ) }
70
+ >
71
+ { __( 'Learn more about anchors' ) }
72
+ </ExternalLink>
81
73
  </>
82
74
  }
83
75
  value={ anchor || '' }
84
- placeholder={ ! isWeb ? __( 'Add an anchor' ) : null }
76
+ placeholder={ null }
85
77
  onChange={ ( nextValue ) => {
86
78
  nextValue = nextValue.replace( ANCHOR_REGEX, '-' );
87
79
  setAttributes( {
@@ -8,7 +8,7 @@ import clsx from 'clsx';
8
8
  */
9
9
  import { hasBlockSupport, getBlockSupport } from '@wordpress/blocks';
10
10
  import { __experimentalHasSplitBorders as hasSplitBorders } from '@wordpress/components';
11
- import { Platform, useCallback, useMemo } from '@wordpress/element';
11
+ import { useCallback, useMemo } from '@wordpress/element';
12
12
  import { addFilter } from '@wordpress/hooks';
13
13
  import { useSelect } from '@wordpress/data';
14
14
  import { __ } from '@wordpress/i18n';
@@ -217,10 +217,6 @@ export function BorderPanel( { clientId, name, setAttributes, settings } ) {
217
217
  * @return {boolean} Whether there is support.
218
218
  */
219
219
  export function hasBorderSupport( blockName, feature = 'any' ) {
220
- if ( Platform.OS !== 'web' ) {
221
- return false;
222
- }
223
-
224
220
  const support = getBlockSupport( blockName, BORDER_SUPPORT_KEY );
225
221
 
226
222
  if ( support === true ) {
@@ -8,7 +8,7 @@ import clsx from 'clsx';
8
8
  */
9
9
  import { addFilter } from '@wordpress/hooks';
10
10
  import { getBlockSupport } from '@wordpress/blocks';
11
- import { useMemo, Platform, useCallback } from '@wordpress/element';
11
+ import { useMemo, useCallback } from '@wordpress/element';
12
12
  import { useSelect } from '@wordpress/data';
13
13
 
14
14
  /**
@@ -55,10 +55,6 @@ const hasColorSupport = ( blockNameOrType ) => {
55
55
  };
56
56
 
57
57
  const hasLinkColorSupport = ( blockType ) => {
58
- if ( Platform.OS !== 'web' ) {
59
- return false;
60
- }
61
-
62
58
  const colorSupport = getBlockSupport( blockType, COLOR_SUPPORT_KEY );
63
59
 
64
60
  return (
@@ -342,7 +338,6 @@ export function ColorEdit( {
342
338
 
343
339
  const enableContrastChecking =
344
340
  ! isStateSelected &&
345
- Platform.OS === 'web' &&
346
341
  ! value?.color?.gradient &&
347
342
  ( settings?.color?.text || settings?.color?.link ) &&
348
343
  // Contrast checking is enabled by default.
@@ -6,7 +6,7 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { Platform, useState, useEffect, useCallback } from '@wordpress/element';
9
+ import { useState, useEffect, useCallback } from '@wordpress/element';
10
10
  import { useDispatch, useSelect } from '@wordpress/data';
11
11
  import { getBlockSupport } from '@wordpress/blocks';
12
12
  import deprecated from '@wordpress/deprecated';
@@ -171,10 +171,6 @@ export function DimensionsPanel( { clientId, name, setAttributes, settings } ) {
171
171
  * @return {boolean} Whether there is support.
172
172
  */
173
173
  export function hasDimensionsSupport( blockName, feature = 'any' ) {
174
- if ( Platform.OS !== 'web' ) {
175
- return false;
176
- }
177
-
178
174
  const support = getBlockSupport( blockName, DIMENSIONS_SUPPORT_KEY );
179
175
 
180
176
  if ( support === true ) {
@@ -23,6 +23,7 @@ import { store as blockEditorStore } from '../store';
23
23
  import { useBlockElement } from '../components/block-list/use-block-props/use-block-refs';
24
24
  import InspectorControls from '../components/inspector-controls';
25
25
  import FitTextSizeWarning from '../components/fit-text-size-warning';
26
+ import { unlock } from '../lock-unlock';
26
27
 
27
28
  export const FIT_TEXT_SUPPORT_KEY = 'typography.fitText';
28
29
 
@@ -248,9 +249,24 @@ export function FitTextControl( {
248
249
  fontSize,
249
250
  style,
250
251
  } ) {
252
+ const hasSelectedStyleState = useSelect(
253
+ ( select ) => {
254
+ const { hasSelectedStyleState: hasSelectedBlockStyleState } =
255
+ unlock( select( blockEditorStore ) );
256
+
257
+ return hasSelectedBlockStyleState( clientId );
258
+ },
259
+ [ clientId ]
260
+ );
261
+
251
262
  if ( ! hasBlockSupport( name, FIT_TEXT_SUPPORT_KEY ) ) {
252
263
  return null;
253
264
  }
265
+
266
+ if ( hasSelectedStyleState ) {
267
+ return null;
268
+ }
269
+
254
270
  return (
255
271
  <ToolsPanelItem
256
272
  hasValue={ () => fitText }
@@ -11,7 +11,7 @@ import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
11
11
  import { BaseControl, CustomSelectControl } from '@wordpress/components';
12
12
  import { useInstanceId } from '@wordpress/compose';
13
13
  import { useSelect } from '@wordpress/data';
14
- import { useMemo, Platform } from '@wordpress/element';
14
+ import { useMemo } from '@wordpress/element';
15
15
 
16
16
  /**
17
17
  * Internal dependencies
@@ -264,32 +264,28 @@ export function PositionPanelPure( {
264
264
  : DEFAULT_OPTION;
265
265
 
266
266
  // Only display position controls if there is at least one option to choose from.
267
- return Platform.select( {
268
- web:
269
- options.length > 1 ? (
270
- <InspectorControls group="position">
271
- <BaseControl help={ stickyHelpText }>
272
- <CustomSelectControl
273
- __next40pxDefaultSize
274
- label={ __( 'Position' ) }
275
- hideLabelFromVision
276
- describedBy={ sprintf(
277
- // translators: %s: Currently selected position.
278
- __( 'Currently selected position: %s' ),
279
- selectedOption.name
280
- ) }
281
- options={ options }
282
- value={ selectedOption }
283
- onChange={ ( { selectedItem } ) => {
284
- onChangeType( selectedItem.value );
285
- } }
286
- size="__unstable-large"
287
- />
288
- </BaseControl>
289
- </InspectorControls>
290
- ) : null,
291
- native: null,
292
- } );
267
+ return options.length > 1 ? (
268
+ <InspectorControls group="position">
269
+ <BaseControl help={ stickyHelpText }>
270
+ <CustomSelectControl
271
+ __next40pxDefaultSize
272
+ label={ __( 'Position' ) }
273
+ hideLabelFromVision
274
+ describedBy={ sprintf(
275
+ // translators: %s: Currently selected position.
276
+ __( 'Currently selected position: %s' ),
277
+ selectedOption.name
278
+ ) }
279
+ options={ options }
280
+ value={ selectedOption }
281
+ onChange={ ( { selectedItem } ) => {
282
+ onChangeType( selectedItem.value );
283
+ } }
284
+ size="__unstable-large"
285
+ />
286
+ </BaseControl>
287
+ </InspectorControls>
288
+ ) : null;
293
289
  }
294
290
 
295
291
  export default {
@@ -2,7 +2,6 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
5
- import { Platform } from '@wordpress/element';
6
5
 
7
6
  const ALIGN_SUPPORT_KEY = 'align';
8
7
  const ALIGN_WIDE_SUPPORT_KEY = 'alignWide';
@@ -120,10 +119,6 @@ export const getAlignWideSupport = ( nameOrType ) =>
120
119
  * @return {boolean} Whether there is support.
121
120
  */
122
121
  export function hasBorderSupport( nameOrType, feature = 'any' ) {
123
- if ( Platform.OS !== 'web' ) {
124
- return false;
125
- }
126
-
127
122
  const support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );
128
123
 
129
124
  if ( support === true ) {
@@ -177,10 +172,6 @@ export const hasColorSupport = ( nameOrType ) => {
177
172
  * @return {boolean} Whether the block supports the feature.
178
173
  */
179
174
  export const hasLinkColorSupport = ( nameOrType ) => {
180
- if ( Platform.OS !== 'web' ) {
181
- return false;
182
- }
183
-
184
175
  const colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );
185
176
 
186
177
  return (
@@ -822,6 +822,8 @@ export const __unstableDeleteSelection =
822
822
  ...targetBlock.attributes,
823
823
  ...updatedAttributes,
824
824
  },
825
+ // Block A's inner blocks sit inside the selection; only B's survive.
826
+ innerBlocks: blockB.innerBlocks,
825
827
  },
826
828
  ...( isForward ? [] : blocksWithTheSameType ),
827
829
  ];
@@ -1646,12 +1648,20 @@ export function __unstableMarkLastChangeAsPersistent() {
1646
1648
  }
1647
1649
 
1648
1650
  /**
1649
- * Action that signals that the next block change should be marked explicitly as not persistent.
1651
+ * Action that signals that the next block change should be marked explicitly
1652
+ * as not persistent.
1650
1653
  *
1654
+ * By default, non-persistent changes may still merge into undo history. Use
1655
+ * `history: 'ignore'` for derived changes that should never be captured by undo.
1656
+ *
1657
+ * @param {Object} options Options object.
1658
+ * @param {string} options.history How the change should interact with history.
1651
1659
  * @return {Object} Action object.
1652
1660
  */
1653
- export function __unstableMarkNextChangeAsNotPersistent() {
1654
- return { type: 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT' };
1661
+ export function __unstableMarkNextChangeAsNotPersistent( {
1662
+ history = 'merge',
1663
+ } = {} ) {
1664
+ return { type: 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT', history };
1655
1665
  }
1656
1666
 
1657
1667
  /**
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { Platform } from '@wordpress/element';
5
4
  import deprecated from '@wordpress/deprecated';
6
5
  import { speak } from '@wordpress/a11y';
7
6
  import { __ } from '@wordpress/i18n';
@@ -56,9 +55,7 @@ export function __experimentalUpdateSettings(
56
55
 
57
56
  let cleanSettings = incomingSettings;
58
57
 
59
- // There are no plugins in the mobile apps, so there is no
60
- // need to strip the experimental settings:
61
- if ( stripExperimentalSettings && Platform.OS === 'web' ) {
58
+ if ( stripExperimentalSettings ) {
62
59
  cleanSettings = {};
63
60
  for ( const key in incomingSettings ) {
64
61
  if ( ! privateSettings.includes( key ) ) {
@@ -116,6 +116,48 @@ export function isContainerInsertableToInContentOnlyMode(
116
116
  );
117
117
  }
118
118
 
119
+ function getClientIdWithClientIdsTreeUnmemoized( state, clientId ) {
120
+ return {
121
+ clientId,
122
+ innerBlocks: getClientIdsTreeUnmemoized( state, clientId ),
123
+ };
124
+ }
125
+
126
+ function getClientIdsTreeUnmemoized( state, rootClientId = '' ) {
127
+ return getBlockOrder( state, rootClientId ).map( ( clientId ) =>
128
+ getClientIdWithClientIdsTreeUnmemoized( state, clientId )
129
+ );
130
+ }
131
+
132
+ /**
133
+ * Returns a stripped down block object containing only its client ID,
134
+ * and its inner blocks' client IDs.
135
+ *
136
+ * @param {Object} state Editor state.
137
+ * @param {string} clientId Client ID of the block to get.
138
+ *
139
+ * @return {Object} Client IDs of the post blocks.
140
+ */
141
+ export const getClientIdWithClientIdsTree = createSelector(
142
+ getClientIdWithClientIdsTreeUnmemoized,
143
+ ( state ) => [ state.blocks.order ]
144
+ );
145
+
146
+ /**
147
+ * Returns the block tree represented in the block-editor store from the
148
+ * given root, consisting of stripped down block objects containing only
149
+ * their client IDs, and their inner blocks' client IDs.
150
+ *
151
+ * @param {Object} state Editor state.
152
+ * @param {?string} rootClientId Optional root client ID of block list.
153
+ *
154
+ * @return {Object[]} Client IDs of the post blocks.
155
+ */
156
+ export const getClientIdsTree = createSelector(
157
+ getClientIdsTreeUnmemoized,
158
+ ( state ) => [ state.blocks.order ]
159
+ );
160
+
119
161
  function getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {
120
162
  const blockOrder = getBlockOrder( state, rootClientId );
121
163
  const result = [];
@@ -1079,6 +1121,23 @@ export function getSelectedBlockStyleState( state, clientId ) {
1079
1121
  return state.selectedBlockStyleState.value ?? DEFAULT_BLOCK_STYLE_STATE;
1080
1122
  }
1081
1123
 
1124
+ /**
1125
+ * Returns whether a non-default style state is selected for a block.
1126
+ *
1127
+ * @param {Object} state Global application state.
1128
+ * @param {string} clientId The block client ID.
1129
+ *
1130
+ * @return {boolean} Whether a non-default block style state is selected.
1131
+ */
1132
+ export function hasSelectedStyleState( state, clientId ) {
1133
+ const selectedState = getSelectedBlockStyleState( state, clientId );
1134
+
1135
+ return (
1136
+ selectedState.viewport !== DEFAULT_BLOCK_STYLE_STATE.viewport ||
1137
+ selectedState.pseudo !== DEFAULT_BLOCK_STYLE_STATE.pseudo
1138
+ );
1139
+ }
1140
+
1082
1141
  /**
1083
1142
  * Returns whether the selected style state is shown on the canvas.
1084
1143
  *
@@ -419,18 +419,20 @@ const withBlockTree =
419
419
  */
420
420
  function withPersistentBlockChange( reducer ) {
421
421
  let lastAction;
422
- let markNextChangeAsNotPersistent = false;
422
+ let nextHistoryMode;
423
423
 
424
424
  return ( state, action ) => {
425
425
  const nextState = reducer( state, action );
426
426
 
427
- const wasMarkedAsNotPersistent = markNextChangeAsNotPersistent;
428
- markNextChangeAsNotPersistent =
429
- action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT';
427
+ const pendingHistoryMode = nextHistoryMode;
428
+ nextHistoryMode =
429
+ action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'
430
+ ? action.history ?? 'merge'
431
+ : undefined;
430
432
 
431
433
  const isExplicitPersistentChange =
432
434
  action.type === 'MARK_LAST_CHANGE_AS_PERSISTENT' ||
433
- wasMarkedAsNotPersistent;
435
+ pendingHistoryMode;
434
436
 
435
437
  // Defer to previous state value (or default) unless changing or
436
438
  // explicitly marking as persistent.
@@ -442,7 +444,7 @@ function withPersistentBlockChange( reducer ) {
442
444
  }
443
445
 
444
446
  const isPersistentChange = isExplicitPersistentChange
445
- ? ! wasMarkedAsNotPersistent
447
+ ? ! pendingHistoryMode
446
448
  : ! isUpdatingSameBlockAttribute( action, lastAction );
447
449
 
448
450
  // In comparing against the previous action, consider only those which
@@ -450,7 +452,17 @@ function withPersistentBlockChange( reducer ) {
450
452
  // have resulted in a changed state.
451
453
  lastAction = action;
452
454
 
453
- return { ...nextState, isPersistentChange };
455
+ if ( pendingHistoryMode === 'ignore' ) {
456
+ return {
457
+ ...nextState,
458
+ isPersistentChange,
459
+ lastBlockChangeHistoryMode: 'ignore',
460
+ };
461
+ }
462
+
463
+ const { lastBlockChangeHistoryMode, ...blockChange } = nextState;
464
+
465
+ return { ...blockChange, isPersistentChange };
454
466
  };
455
467
  }
456
468
 
@@ -12,7 +12,6 @@ import {
12
12
  store as blocksStore,
13
13
  privateApis as blocksPrivateApis,
14
14
  } from '@wordpress/blocks';
15
- import { Platform } from '@wordpress/element';
16
15
  import { applyFilters } from '@wordpress/hooks';
17
16
  import { symbol } from '@wordpress/icons';
18
17
  import { create, remove, toHTMLString } from '@wordpress/rich-text';
@@ -44,6 +43,8 @@ import {
44
43
  getParentSectionBlock,
45
44
  isZoomOut,
46
45
  isContainerInsertableToInContentOnlyMode,
46
+ getClientIdWithClientIdsTree,
47
+ getClientIdsTree,
47
48
  } from './private-selectors';
48
49
 
49
50
  const { isContentBlock } = unlock( blocksPrivateApis );
@@ -107,14 +108,6 @@ const DEFAULT_INSERTER_OPTIONS = {
107
108
  */
108
109
  export function getBlockName( state, clientId ) {
109
110
  const block = state.blocks.byClientId.get( clientId );
110
- const socialLinkName = 'core/social-link';
111
-
112
- if ( Platform.OS !== 'web' && block?.name === socialLinkName ) {
113
- const attributes = state.blocks.attributes.get( clientId );
114
- const { service } = attributes ?? {};
115
-
116
- return service ? `${ socialLinkName }-${ service }` : socialLinkName;
117
- }
118
111
  return block ? block.name : null;
119
112
  }
120
113
 
@@ -225,22 +218,16 @@ export function getBlocks( state, rootClientId ) {
225
218
  *
226
219
  * @return {Object} Client IDs of the post blocks.
227
220
  */
228
- export const __unstableGetClientIdWithClientIdsTree = createSelector(
229
- ( state, clientId ) => {
230
- deprecated(
231
- "wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",
232
- {
233
- since: '6.3',
234
- version: '6.5',
235
- }
236
- );
237
- return {
238
- clientId,
239
- innerBlocks: __unstableGetClientIdsTree( state, clientId ),
240
- };
241
- },
242
- ( state ) => [ state.blocks.order ]
243
- );
221
+ export function __unstableGetClientIdWithClientIdsTree( state, clientId ) {
222
+ deprecated(
223
+ "wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",
224
+ {
225
+ since: '6.3',
226
+ version: '6.5',
227
+ }
228
+ );
229
+ return getClientIdWithClientIdsTree( state, clientId );
230
+ }
244
231
 
245
232
  /**
246
233
  * Returns the block tree represented in the block-editor store from the
@@ -254,21 +241,16 @@ export const __unstableGetClientIdWithClientIdsTree = createSelector(
254
241
  *
255
242
  * @return {Object[]} Client IDs of the post blocks.
256
243
  */
257
- export const __unstableGetClientIdsTree = createSelector(
258
- ( state, rootClientId = '' ) => {
259
- deprecated(
260
- "wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",
261
- {
262
- since: '6.3',
263
- version: '6.5',
264
- }
265
- );
266
- return getBlockOrder( state, rootClientId ).map( ( clientId ) =>
267
- __unstableGetClientIdWithClientIdsTree( state, clientId )
268
- );
269
- },
270
- ( state ) => [ state.blocks.order ]
271
- );
244
+ export function __unstableGetClientIdsTree( state, rootClientId ) {
245
+ deprecated(
246
+ "wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",
247
+ {
248
+ since: '6.3',
249
+ version: '6.5',
250
+ }
251
+ );
252
+ return getClientIdsTree( state, rootClientId );
253
+ }
272
254
 
273
255
  /**
274
256
  * Returns an array containing the clientIds of all descendants of the blocks
@@ -2303,6 +2285,19 @@ const buildBlockTypeItem =
2303
2285
  };
2304
2286
  };
2305
2287
 
2288
+ const buildBlockVariationItem = ( state, item ) => ( variation ) => {
2289
+ const variationId = `${ item.id }/${ variation.name }`;
2290
+ const { time, count = 0 } = getInsertUsage( state, variationId ) || {};
2291
+ return {
2292
+ ...item,
2293
+ id: variationId,
2294
+ icon: variation.icon || item.icon,
2295
+ title: variation.title || item.title,
2296
+ frecency: calculateFrecency( time, count ),
2297
+ variationName: variation.name,
2298
+ };
2299
+ };
2300
+
2306
2301
  /**
2307
2302
  * Determines the items that appear in the inserter. Includes both static
2308
2303
  * items (e.g. a regular block type) and dynamic items (e.g. a reusable block).
@@ -2483,20 +2478,21 @@ export const getInserterItems = createRegistrySelector( ( select ) =>
2483
2478
  *
2484
2479
  * Items are returned ordered descendingly by their 'frecency'.
2485
2480
  *
2486
- * @param {Object} state Editor state.
2487
- * @param {Object|Object[]} blocks Block object or array objects.
2488
- * @param {?string} rootClientId Optional root client ID of block list.
2481
+ * @param {Object} state Editor state.
2482
+ * @param {Object|Object[]} blocks Block object or array objects.
2483
+ * @param {?string} rootClientId Optional root client ID of block list.
2489
2484
  *
2490
2485
  * @return {WPEditorTransformItem[]} Items that appear in inserter.
2491
2486
  *
2492
2487
  * @typedef {Object} WPEditorTransformItem
2493
- * @property {string} id Unique identifier for the item.
2494
- * @property {string} name The type of block to create.
2495
- * @property {string} title Title of the item, as it appears in the inserter.
2496
- * @property {string} icon Dashicon for the item, as it appears in the inserter.
2497
- * @property {boolean} isDisabled Whether or not the user should be prevented from inserting
2498
- * this item.
2499
- * @property {number} frecency Heuristic that combines frequency and recency.
2488
+ * @property {string} id Unique identifier for the item.
2489
+ * @property {string} name The type of block to create.
2490
+ * @property {?string} variationName The target block variation name.
2491
+ * @property {string} title Title of the item, as it appears in the inserter.
2492
+ * @property {string} icon Dashicon for the item, as it appears in the inserter.
2493
+ * @property {boolean} isDisabled Whether or not the user should be prevented from inserting
2494
+ * this item.
2495
+ * @property {number} frecency Heuristic that combines frequency and recency.
2500
2496
  */
2501
2497
  export const getBlockTransformItems = createRegistrySelector( ( select ) =>
2502
2498
  createSelector(
@@ -2526,14 +2522,37 @@ export const getBlockTransformItems = createRegistrySelector( ( select ) =>
2526
2522
  const possibleTransforms = getPossibleBlockTransformations(
2527
2523
  normalizedBlocks
2528
2524
  ).reduce( ( accumulator, block ) => {
2529
- if ( itemsByName[ block?.name ] ) {
2530
- accumulator.push( itemsByName[ block.name ] );
2525
+ const item = itemsByName[ block?.name ];
2526
+
2527
+ if ( ! item ) {
2528
+ return accumulator;
2529
+ }
2530
+
2531
+ const { variationName } = block;
2532
+
2533
+ if ( ! variationName ) {
2534
+ accumulator.push( item );
2535
+ return accumulator;
2536
+ }
2537
+
2538
+ const variation = getBlockVariations(
2539
+ item.name,
2540
+ 'transform'
2541
+ )?.find( ( { name } ) => name === variationName );
2542
+
2543
+ if ( ! variation ) {
2544
+ accumulator.push( item );
2545
+ return accumulator;
2531
2546
  }
2547
+
2548
+ accumulator.push(
2549
+ buildBlockVariationItem( state, item )( variation )
2550
+ );
2532
2551
  return accumulator;
2533
2552
  }, [] );
2534
2553
  return orderBy(
2535
2554
  possibleTransforms,
2536
- ( block ) => itemsByName[ block.name ].frecency,
2555
+ ( block ) => block.frecency,
2537
2556
  'desc'
2538
2557
  );
2539
2558
  },
@@ -2902,6 +2921,25 @@ export function isLastBlockChangePersistent( state ) {
2902
2921
  return state.blocks.isPersistentChange;
2903
2922
  }
2904
2923
 
2924
+ /**
2925
+ * Returns how the most recent block change interacts with undo history.
2926
+ *
2927
+ * - `persistent` changes create a new undo level.
2928
+ * - `merge` changes do not create a new undo level, but may merge into the
2929
+ * prior stack item history.
2930
+ * - `ignore` changes should never be captured by undo history.
2931
+ *
2932
+ * @param {Object} state Block editor state.
2933
+ *
2934
+ * @return {'persistent'|'merge'|'ignore'} Block change history behavior.
2935
+ */
2936
+ export function __unstableGetLastBlockChangeHistoryMode( state ) {
2937
+ if ( state.blocks.lastBlockChangeHistoryMode ) {
2938
+ return state.blocks.lastBlockChangeHistoryMode;
2939
+ }
2940
+ return state.blocks.isPersistentChange === false ? 'merge' : 'persistent';
2941
+ }
2942
+
2905
2943
  /**
2906
2944
  * Returns the block list settings for an array of blocks, if any exist.
2907
2945
  *
@@ -53,6 +53,7 @@ const {
53
53
  updateBlockListSettings,
54
54
  updateSettings,
55
55
  validateBlocksToTemplate,
56
+ __unstableMarkNextChangeAsNotPersistent,
56
57
  registerInserterMediaCategory,
57
58
  setBlockEditingMode,
58
59
  unsetBlockEditingMode,
@@ -814,6 +815,26 @@ describe( 'actions', () => {
814
815
  } );
815
816
  } );
816
817
 
818
+ describe( '__unstableMarkNextChangeAsNotPersistent', () => {
819
+ it( 'should use merge history by default', () => {
820
+ expect( __unstableMarkNextChangeAsNotPersistent() ).toEqual( {
821
+ type: 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT',
822
+ history: 'merge',
823
+ } );
824
+ } );
825
+
826
+ it( 'should allow ignoring history for the next change', () => {
827
+ expect(
828
+ __unstableMarkNextChangeAsNotPersistent( {
829
+ history: 'ignore',
830
+ } )
831
+ ).toEqual( {
832
+ type: 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT',
833
+ history: 'ignore',
834
+ } );
835
+ } );
836
+ } );
837
+
817
838
  describe( 'mergeBlocks', () => {
818
839
  afterEach( () => {
819
840
  getBlockTypes().forEach( ( block ) => {