@wordpress/block-editor 15.21.0 → 15.22.1-next.v.202606191442.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 (554) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/build/components/block-card/index.cjs +4 -5
  3. package/build/components/block-card/index.cjs.map +2 -2
  4. package/build/components/block-compare/index.cjs +2 -2
  5. package/build/components/block-compare/index.cjs.map +2 -2
  6. package/build/components/block-inspector/index.cjs +3 -4
  7. package/build/components/block-inspector/index.cjs.map +2 -2
  8. package/build/components/block-mover/mover-description.cjs +6 -6
  9. package/build/components/block-mover/mover-description.cjs.map +1 -1
  10. package/build/components/block-patterns-list/index.cjs +1 -1
  11. package/build/components/block-patterns-list/index.cjs.map +2 -2
  12. package/build/components/block-patterns-paging/index.cjs +4 -4
  13. package/build/components/block-patterns-paging/index.cjs.map +2 -2
  14. package/build/components/block-popover/use-popover-scroll.cjs.map +1 -1
  15. package/build/components/block-quick-navigation/index.cjs +7 -5
  16. package/build/components/block-quick-navigation/index.cjs.map +2 -2
  17. package/build/components/block-switcher/block-transformations-menu.cjs +16 -15
  18. package/build/components/block-switcher/block-transformations-menu.cjs.map +2 -2
  19. package/build/components/block-switcher/index.cjs +4 -4
  20. package/build/components/block-switcher/index.cjs.map +2 -2
  21. package/build/components/block-toolbar/edit-section-button.cjs.map +1 -1
  22. package/build/components/block-tools/use-block-toolbar-popover-props.cjs +10 -4
  23. package/build/components/block-tools/use-block-toolbar-popover-props.cjs.map +2 -2
  24. package/build/components/child-layout-control/index.cjs +51 -19
  25. package/build/components/child-layout-control/index.cjs.map +2 -2
  26. package/build/components/dimensions-tool/index.cjs +4 -5
  27. package/build/components/dimensions-tool/index.cjs.map +2 -2
  28. package/build/components/dimensions-tool/scale-tool.cjs +1 -1
  29. package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
  30. package/build/components/global-styles/advanced-panel.cjs +23 -15
  31. package/build/components/global-styles/advanced-panel.cjs.map +2 -2
  32. package/build/components/global-styles/background-panel.cjs +2 -2
  33. package/build/components/global-styles/background-panel.cjs.map +2 -2
  34. package/build/components/global-styles/border-panel.cjs +2 -0
  35. package/build/components/global-styles/border-panel.cjs.map +2 -2
  36. package/build/components/global-styles/dimensions-panel.cjs +2 -2
  37. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  38. package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
  39. package/build/components/grid/grid-item-resizer.cjs.map +1 -1
  40. package/build/components/grid/grid-visualizer.cjs.map +1 -1
  41. package/build/components/iframe/index.cjs +6 -3
  42. package/build/components/iframe/index.cjs.map +3 -3
  43. package/build/components/image-editor/use-transform-image.cjs.map +1 -1
  44. package/build/components/inner-blocks/use-inner-block-template-sync.cjs +3 -1
  45. package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +2 -2
  46. package/build/components/inserter/get-appender-label.cjs.map +1 -1
  47. package/build/components/inserter/hooks/use-patterns-state.cjs +1 -1
  48. package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
  49. package/build/components/inserter/index.cjs +179 -220
  50. package/build/components/inserter/index.cjs.map +3 -3
  51. package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
  52. package/build/components/inserter/search-items.cjs.map +1 -1
  53. package/build/components/inserter/search-results.cjs +1 -1
  54. package/build/components/inserter/search-results.cjs.map +2 -2
  55. package/build/components/inspector-controls/fill.cjs +1 -3
  56. package/build/components/inspector-controls/fill.cjs.map +2 -2
  57. package/build/components/inspector-controls-tabs/index.cjs.map +2 -2
  58. package/build/components/inspector-controls-tabs/styles-tab.cjs +1 -1
  59. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  60. package/build/components/keyboard-shortcuts/index.cjs.map +1 -1
  61. package/build/components/line-height-control/index.cjs.map +1 -1
  62. package/build/components/link-control/index.cjs +1 -1
  63. package/build/components/link-control/index.cjs.map +1 -1
  64. package/build/components/link-control/normalize-url.cjs.map +1 -1
  65. package/build/components/list-view/block-select-button.cjs +10 -12
  66. package/build/components/list-view/block-select-button.cjs.map +2 -2
  67. package/build/components/list-view/block.cjs +2 -1
  68. package/build/components/list-view/block.cjs.map +2 -2
  69. package/build/components/list-view/utils.cjs.map +1 -1
  70. package/build/components/preset-input-control/custom-value-controls.cjs.map +2 -2
  71. package/build/components/provider/index.cjs.map +1 -1
  72. package/build/components/provider/use-block-sync.cjs +11 -2
  73. package/build/components/provider/use-block-sync.cjs.map +2 -2
  74. package/build/components/rich-text/event-listeners/before-input-rules.cjs +5 -5
  75. package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
  76. package/build/components/rich-text/event-listeners/delete.cjs +4 -4
  77. package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
  78. package/build/components/rich-text/event-listeners/enter.cjs +7 -2
  79. package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
  80. package/build/components/rich-text/event-listeners/input-events.cjs +4 -4
  81. package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
  82. package/build/components/rich-text/event-listeners/input-rules.cjs +17 -4
  83. package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
  84. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +4 -4
  85. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
  86. package/build/components/rich-text/event-listeners/paste-handler.cjs.map +1 -1
  87. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +4 -4
  88. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
  89. package/build/components/rich-text/event-listeners/shortcuts.cjs +4 -4
  90. package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
  91. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +4 -4
  92. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
  93. package/build/components/rich-text/index.cjs +1 -23
  94. package/build/components/rich-text/index.cjs.map +2 -2
  95. package/build/components/rich-text/prevent-event-discovery.cjs +1 -1
  96. package/build/components/rich-text/prevent-event-discovery.cjs.map +1 -1
  97. package/build/components/use-block-commands/index.cjs +5 -5
  98. package/build/components/use-block-commands/index.cjs.map +2 -2
  99. package/build/components/writing-flow/use-tab-nav.cjs.map +1 -1
  100. package/build/hooks/anchor.cjs +12 -16
  101. package/build/hooks/anchor.cjs.map +2 -2
  102. package/build/hooks/background.cjs.map +1 -1
  103. package/build/hooks/block-fields/index.cjs +13 -2
  104. package/build/hooks/block-fields/index.cjs.map +2 -2
  105. package/build/hooks/border.cjs +0 -3
  106. package/build/hooks/border.cjs.map +2 -2
  107. package/build/hooks/color.cjs +1 -4
  108. package/build/hooks/color.cjs.map +2 -2
  109. package/build/hooks/dimensions.cjs +13 -5
  110. package/build/hooks/dimensions.cjs.map +2 -2
  111. package/build/hooks/fit-text.cjs +11 -0
  112. package/build/hooks/fit-text.cjs.map +2 -2
  113. package/build/hooks/layout-child.cjs +27 -2
  114. package/build/hooks/layout-child.cjs.map +2 -2
  115. package/build/hooks/list-view.cjs +10 -7
  116. package/build/hooks/list-view.cjs.map +2 -2
  117. package/build/hooks/position.cjs +19 -22
  118. package/build/hooks/position.cjs.map +2 -2
  119. package/build/hooks/spacing-visualizer.cjs.map +1 -1
  120. package/build/hooks/state-utils.cjs.map +1 -1
  121. package/build/hooks/style.cjs +42 -2
  122. package/build/hooks/style.cjs.map +2 -2
  123. package/build/hooks/supports.cjs +0 -7
  124. package/build/hooks/supports.cjs.map +2 -2
  125. package/build/private-apis.cjs +4 -0
  126. package/build/private-apis.cjs.map +2 -2
  127. package/build/store/actions.cjs +7 -3
  128. package/build/store/actions.cjs.map +2 -2
  129. package/build/store/private-actions.cjs +1 -2
  130. package/build/store/private-actions.cjs.map +2 -2
  131. package/build/store/private-selectors.cjs +42 -2
  132. package/build/store/private-selectors.cjs.map +2 -2
  133. package/build/store/reducer.cjs +14 -6
  134. package/build/store/reducer.cjs.map +2 -2
  135. package/build/store/selectors.cjs +60 -41
  136. package/build/store/selectors.cjs.map +2 -2
  137. package/build/utils/dom.cjs.map +1 -1
  138. package/build/utils/selection.cjs +1 -1
  139. package/build-module/components/block-card/index.mjs +5 -6
  140. package/build-module/components/block-card/index.mjs.map +2 -2
  141. package/build-module/components/block-compare/index.mjs +1 -1
  142. package/build-module/components/block-compare/index.mjs.map +2 -2
  143. package/build-module/components/block-inspector/index.mjs +3 -5
  144. package/build-module/components/block-inspector/index.mjs.map +2 -2
  145. package/build-module/components/block-mover/mover-description.mjs +6 -6
  146. package/build-module/components/block-mover/mover-description.mjs.map +1 -1
  147. package/build-module/components/block-patterns-list/index.mjs +1 -1
  148. package/build-module/components/block-patterns-list/index.mjs.map +2 -2
  149. package/build-module/components/block-patterns-paging/index.mjs +4 -4
  150. package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
  151. package/build-module/components/block-popover/use-popover-scroll.mjs.map +1 -1
  152. package/build-module/components/block-quick-navigation/index.mjs +8 -6
  153. package/build-module/components/block-quick-navigation/index.mjs.map +2 -2
  154. package/build-module/components/block-switcher/block-transformations-menu.mjs +16 -15
  155. package/build-module/components/block-switcher/block-transformations-menu.mjs.map +2 -2
  156. package/build-module/components/block-switcher/index.mjs +4 -4
  157. package/build-module/components/block-switcher/index.mjs.map +2 -2
  158. package/build-module/components/block-toolbar/edit-section-button.mjs.map +1 -1
  159. package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs +10 -4
  160. package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs.map +2 -2
  161. package/build-module/components/child-layout-control/index.mjs +51 -19
  162. package/build-module/components/child-layout-control/index.mjs.map +2 -2
  163. package/build-module/components/dimensions-tool/index.mjs +4 -5
  164. package/build-module/components/dimensions-tool/index.mjs.map +2 -2
  165. package/build-module/components/dimensions-tool/scale-tool.mjs +1 -1
  166. package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
  167. package/build-module/components/global-styles/advanced-panel.mjs +23 -15
  168. package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
  169. package/build-module/components/global-styles/background-panel.mjs +3 -3
  170. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  171. package/build-module/components/global-styles/border-panel.mjs +2 -0
  172. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  173. package/build-module/components/global-styles/dimensions-panel.mjs +3 -4
  174. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  175. package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
  176. package/build-module/components/grid/grid-item-resizer.mjs.map +1 -1
  177. package/build-module/components/grid/grid-visualizer.mjs.map +1 -1
  178. package/build-module/components/iframe/index.mjs +6 -3
  179. package/build-module/components/iframe/index.mjs.map +2 -2
  180. package/build-module/components/image-editor/use-transform-image.mjs.map +1 -1
  181. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +3 -1
  182. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +2 -2
  183. package/build-module/components/inserter/get-appender-label.mjs.map +1 -1
  184. package/build-module/components/inserter/hooks/use-patterns-state.mjs +1 -1
  185. package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
  186. package/build-module/components/inserter/index.mjs +185 -222
  187. package/build-module/components/inserter/index.mjs.map +3 -3
  188. package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
  189. package/build-module/components/inserter/search-items.mjs.map +1 -1
  190. package/build-module/components/inserter/search-results.mjs +1 -1
  191. package/build-module/components/inserter/search-results.mjs.map +2 -2
  192. package/build-module/components/inspector-controls/fill.mjs +1 -3
  193. package/build-module/components/inspector-controls/fill.mjs.map +2 -2
  194. package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
  195. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +1 -1
  196. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  197. package/build-module/components/keyboard-shortcuts/index.mjs.map +1 -1
  198. package/build-module/components/line-height-control/index.mjs.map +1 -1
  199. package/build-module/components/link-control/index.mjs +1 -1
  200. package/build-module/components/link-control/index.mjs.map +1 -1
  201. package/build-module/components/link-control/normalize-url.mjs.map +1 -1
  202. package/build-module/components/list-view/block-select-button.mjs +10 -12
  203. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  204. package/build-module/components/list-view/block.mjs +2 -1
  205. package/build-module/components/list-view/block.mjs.map +2 -2
  206. package/build-module/components/list-view/utils.mjs.map +1 -1
  207. package/build-module/components/preset-input-control/custom-value-controls.mjs.map +2 -2
  208. package/build-module/components/provider/index.mjs.map +1 -1
  209. package/build-module/components/provider/use-block-sync.mjs +11 -2
  210. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  211. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +5 -5
  212. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
  213. package/build-module/components/rich-text/event-listeners/delete.mjs +4 -4
  214. package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
  215. package/build-module/components/rich-text/event-listeners/enter.mjs +7 -2
  216. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  217. package/build-module/components/rich-text/event-listeners/input-events.mjs +4 -4
  218. package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
  219. package/build-module/components/rich-text/event-listeners/input-rules.mjs +17 -4
  220. package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
  221. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +4 -4
  222. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
  223. package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +1 -1
  224. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +4 -4
  225. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
  226. package/build-module/components/rich-text/event-listeners/shortcuts.mjs +4 -4
  227. package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
  228. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +4 -4
  229. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
  230. package/build-module/components/rich-text/index.mjs +1 -23
  231. package/build-module/components/rich-text/index.mjs.map +2 -2
  232. package/build-module/components/rich-text/prevent-event-discovery.mjs +1 -1
  233. package/build-module/components/rich-text/prevent-event-discovery.mjs.map +1 -1
  234. package/build-module/components/use-block-commands/index.mjs +5 -5
  235. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  236. package/build-module/components/writing-flow/use-tab-nav.mjs.map +1 -1
  237. package/build-module/hooks/anchor.mjs +12 -16
  238. package/build-module/hooks/anchor.mjs.map +2 -2
  239. package/build-module/hooks/background.mjs.map +1 -1
  240. package/build-module/hooks/block-fields/index.mjs +13 -2
  241. package/build-module/hooks/block-fields/index.mjs.map +2 -2
  242. package/build-module/hooks/border.mjs +1 -4
  243. package/build-module/hooks/border.mjs.map +2 -2
  244. package/build-module/hooks/color.mjs +2 -5
  245. package/build-module/hooks/color.mjs.map +2 -2
  246. package/build-module/hooks/dimensions.mjs +13 -6
  247. package/build-module/hooks/dimensions.mjs.map +2 -2
  248. package/build-module/hooks/fit-text.mjs +11 -0
  249. package/build-module/hooks/fit-text.mjs.map +2 -2
  250. package/build-module/hooks/layout-child.mjs +27 -2
  251. package/build-module/hooks/layout-child.mjs.map +2 -2
  252. package/build-module/hooks/list-view.mjs +10 -7
  253. package/build-module/hooks/list-view.mjs.map +2 -2
  254. package/build-module/hooks/position.mjs +20 -23
  255. package/build-module/hooks/position.mjs.map +2 -2
  256. package/build-module/hooks/spacing-visualizer.mjs.map +1 -1
  257. package/build-module/hooks/state-utils.mjs.map +1 -1
  258. package/build-module/hooks/style.mjs +44 -3
  259. package/build-module/hooks/style.mjs.map +2 -2
  260. package/build-module/hooks/supports.mjs +0 -7
  261. package/build-module/hooks/supports.mjs.map +2 -2
  262. package/build-module/private-apis.mjs +8 -0
  263. package/build-module/private-apis.mjs.map +2 -2
  264. package/build-module/store/actions.mjs +7 -3
  265. package/build-module/store/actions.mjs.map +2 -2
  266. package/build-module/store/private-actions.mjs +1 -2
  267. package/build-module/store/private-actions.mjs.map +2 -2
  268. package/build-module/store/private-selectors.mjs +39 -1
  269. package/build-module/store/private-selectors.mjs.map +2 -2
  270. package/build-module/store/reducer.mjs +14 -6
  271. package/build-module/store/reducer.mjs.map +2 -2
  272. package/build-module/store/selectors.mjs +62 -42
  273. package/build-module/store/selectors.mjs.map +2 -2
  274. package/build-module/utils/dom.mjs.map +1 -1
  275. package/build-module/utils/selection.mjs +1 -1
  276. package/build-style/content-rtl.css +12 -0
  277. package/build-style/content.css +12 -0
  278. package/build-style/style-rtl.css +26 -8
  279. package/build-style/style.css +26 -8
  280. package/package.json +54 -46
  281. package/src/components/block-breadcrumb/README.md +2 -2
  282. package/src/components/block-card/index.js +7 -13
  283. package/src/components/block-compare/README.md +6 -6
  284. package/src/components/block-compare/index.js +1 -3
  285. package/src/components/block-inspector/index.js +2 -10
  286. package/src/components/block-patterns-list/index.js +1 -2
  287. package/src/components/block-preview/README.md +1 -1
  288. package/src/components/block-quick-navigation/index.js +7 -7
  289. package/src/components/block-switcher/block-transformations-menu.js +16 -18
  290. package/src/components/block-switcher/index.js +4 -4
  291. package/src/components/block-tools/use-block-toolbar-popover-props.js +10 -4
  292. package/src/components/block-types-list/README.md +0 -19
  293. package/src/components/child-layout-control/index.js +65 -20
  294. package/src/components/child-layout-control/test/index.js +64 -0
  295. package/src/components/dimensions-tool/index.js +4 -9
  296. package/src/components/dimensions-tool/scale-tool.js +1 -2
  297. package/src/components/dimensions-tool/test/index.js +89 -11
  298. package/src/components/global-styles/advanced-panel.js +5 -1
  299. package/src/components/global-styles/background-panel.js +3 -3
  300. package/src/components/global-styles/border-panel.js +2 -0
  301. package/src/components/global-styles/dimensions-panel.js +13 -15
  302. package/src/components/global-styles/shadow-panel-components.js +0 -1
  303. package/src/components/iframe/index.js +8 -3
  304. package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -1
  305. package/src/components/inserter/hooks/use-patterns-state.js +1 -1
  306. package/src/components/inserter/index.js +257 -288
  307. package/src/components/inserter/media-tab/media-preview.js +0 -1
  308. package/src/components/inserter/search-results.js +1 -3
  309. package/src/components/inspector-controls/fill.js +6 -8
  310. package/src/components/inspector-controls-tabs/index.js +0 -1
  311. package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
  312. package/src/components/justify-content-control/README.md +1 -1
  313. package/src/components/list-view/block-select-button.js +9 -14
  314. package/src/components/list-view/block.js +1 -0
  315. package/src/components/media-placeholder/README.md +1 -29
  316. package/src/components/media-upload/README.md +0 -19
  317. package/src/components/preset-input-control/custom-value-controls.js +0 -1
  318. package/src/components/provider/test/use-block-sync.js +40 -0
  319. package/src/components/provider/use-block-sync.js +12 -2
  320. package/src/components/rich-text/event-listeners/before-input-rules.js +5 -4
  321. package/src/components/rich-text/event-listeners/delete.js +9 -4
  322. package/src/components/rich-text/event-listeners/enter.js +9 -2
  323. package/src/components/rich-text/event-listeners/input-events.js +13 -4
  324. package/src/components/rich-text/event-listeners/input-rules.js +20 -4
  325. package/src/components/rich-text/event-listeners/insert-replacement-text.js +9 -4
  326. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +9 -4
  327. package/src/components/rich-text/event-listeners/shortcuts.js +13 -4
  328. package/src/components/rich-text/event-listeners/undo-automatic-change.js +5 -4
  329. package/src/components/rich-text/index.js +1 -33
  330. package/src/components/unit-control/README.md +1 -1
  331. package/src/components/url-popover/README.md +1 -1
  332. package/src/components/use-block-commands/index.js +5 -5
  333. package/src/hooks/anchor.js +9 -17
  334. package/src/hooks/block-fields/index.js +27 -2
  335. package/src/hooks/border.js +1 -5
  336. package/src/hooks/color.js +1 -6
  337. package/src/hooks/dimensions.js +15 -8
  338. package/src/hooks/fit-text.js +16 -0
  339. package/src/hooks/layout-child.js +41 -2
  340. package/src/hooks/list-view.js +10 -11
  341. package/src/hooks/position.js +23 -27
  342. package/src/hooks/style.js +80 -2
  343. package/src/hooks/supports.js +0 -9
  344. package/src/hooks/test/dimensions.js +71 -0
  345. package/src/hooks/test/layout-child.js +165 -0
  346. package/src/hooks/test/style.js +126 -4
  347. package/src/private-apis.js +8 -0
  348. package/src/store/actions.js +13 -3
  349. package/src/store/private-actions.js +1 -4
  350. package/src/store/private-selectors.js +89 -0
  351. package/src/store/reducer.js +19 -7
  352. package/src/store/selectors.js +91 -53
  353. package/src/store/test/actions.js +21 -0
  354. package/src/store/test/private-selectors.js +138 -0
  355. package/src/store/test/reducer.js +46 -0
  356. package/src/store/test/selectors.js +77 -0
  357. package/build/components/media-upload-progress/constants.cjs +0 -46
  358. package/build/components/media-upload-progress/constants.cjs.map +0 -7
  359. package/build/components/rich-text/native/format-edit.cjs +0 -60
  360. package/build/components/rich-text/native/format-edit.cjs.map +0 -7
  361. package/build/components/rich-text/native/index.cjs +0 -28
  362. package/build/components/rich-text/native/index.cjs.map +0 -7
  363. package/build/components/rich-text/native/use-format-types.cjs +0 -139
  364. package/build/components/rich-text/native/use-format-types.cjs.map +0 -7
  365. package/build-module/components/media-upload-progress/constants.mjs +0 -16
  366. package/build-module/components/media-upload-progress/constants.mjs.map +0 -7
  367. package/build-module/components/rich-text/native/format-edit.mjs +0 -39
  368. package/build-module/components/rich-text/native/format-edit.mjs.map +0 -7
  369. package/build-module/components/rich-text/native/index.mjs +0 -7
  370. package/build-module/components/rich-text/native/index.mjs.map +0 -7
  371. package/build-module/components/rich-text/native/use-format-types.mjs +0 -114
  372. package/build-module/components/rich-text/native/use-format-types.mjs.map +0 -7
  373. package/src/components/audio-player/audio-url-parser.native.js +0 -20
  374. package/src/components/audio-player/index.native.js +0 -225
  375. package/src/components/audio-player/styles.native.scss +0 -114
  376. package/src/components/audio-player/test/audio-url-parser.native.js +0 -53
  377. package/src/components/block-alignment-control/test/index.native.js +0 -37
  378. package/src/components/block-alignment-control/ui.native.js +0 -86
  379. package/src/components/block-caption/README.md +0 -104
  380. package/src/components/block-caption/index.native.js +0 -89
  381. package/src/components/block-caption/styles.native.scss +0 -7
  382. package/src/components/block-controls/slot.native.js +0 -33
  383. package/src/components/block-draggable/draggable-chip.native.js +0 -49
  384. package/src/components/block-draggable/dropping-insertion-point.native.js +0 -181
  385. package/src/components/block-draggable/dropping-insertion-point.native.scss +0 -8
  386. package/src/components/block-draggable/index.native.js +0 -467
  387. package/src/components/block-draggable/style.native.scss +0 -19
  388. package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +0 -73
  389. package/src/components/block-draggable/test/helpers.native.js +0 -182
  390. package/src/components/block-draggable/test/index.native.js +0 -419
  391. package/src/components/block-draggable/use-scroll-when-dragging.native.js +0 -135
  392. package/src/components/block-edit/edit.native.js +0 -49
  393. package/src/components/block-edit/test/edit.native.js +0 -65
  394. package/src/components/block-heading-level-dropdown/index.native.js +0 -68
  395. package/src/components/block-icon/index.native.js +0 -47
  396. package/src/components/block-icon/style.native.scss +0 -7
  397. package/src/components/block-list/block-crash-boundary.native.js +0 -43
  398. package/src/components/block-list/block-crash-warning.native.js +0 -21
  399. package/src/components/block-list/block-invalid-warning.native.js +0 -70
  400. package/src/components/block-list/block-list-context.native.js +0 -172
  401. package/src/components/block-list/block-list-item-cell.native.js +0 -62
  402. package/src/components/block-list/block-list-item.native.js +0 -209
  403. package/src/components/block-list/block-list-item.native.scss +0 -16
  404. package/src/components/block-list/block-outline.native.js +0 -77
  405. package/src/components/block-list/block-selection-button.native.js +0 -100
  406. package/src/components/block-list/block-selection-button.native.scss +0 -34
  407. package/src/components/block-list/block.native.js +0 -716
  408. package/src/components/block-list/block.native.scss +0 -62
  409. package/src/components/block-list/grid-item.native.js +0 -58
  410. package/src/components/block-list/index.native.js +0 -437
  411. package/src/components/block-list/insertion-point.native.js +0 -36
  412. package/src/components/block-list/style.native.scss +0 -117
  413. package/src/components/block-list/test/block-invalid-warning.native.js +0 -62
  414. package/src/components/block-list/test/block-list-context.native.js +0 -243
  415. package/src/components/block-list/test/block-outline.native.js +0 -255
  416. package/src/components/block-list/test/fixtures/block-list-context.native.js +0 -79
  417. package/src/components/block-list/test/index.native.js +0 -205
  418. package/src/components/block-list/use-block-props/index.native.js +0 -10
  419. package/src/components/block-list/use-scroll-upon-insertion.native.js +0 -52
  420. package/src/components/block-list-appender/index.native.js +0 -70
  421. package/src/components/block-list-appender/style.native.scss +0 -8
  422. package/src/components/block-media-update-progress/README.md +0 -100
  423. package/src/components/block-media-update-progress/index.native.js +0 -299
  424. package/src/components/block-media-update-progress/styles.native.scss +0 -9
  425. package/src/components/block-media-update-progress/test/index.native.js +0 -543
  426. package/src/components/block-mover/index.native.js +0 -193
  427. package/src/components/block-mover/mover-description.native.js +0 -155
  428. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -218
  429. package/src/components/block-mover/test/index.native.js +0 -186
  430. package/src/components/block-settings/button.native.js +0 -41
  431. package/src/components/block-settings/container.native.js +0 -91
  432. package/src/components/block-settings/container.native.scss +0 -4
  433. package/src/components/block-settings/index.native.js +0 -5
  434. package/src/components/block-styles/index.native.js +0 -94
  435. package/src/components/block-styles/preview.native.js +0 -109
  436. package/src/components/block-styles/style.native.scss +0 -64
  437. package/src/components/block-switcher/block-transformations-menu.native.js +0 -91
  438. package/src/components/block-toolbar/block-toolbar-menu.native.js +0 -477
  439. package/src/components/block-toolbar/index.native.js +0 -126
  440. package/src/components/block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap +0 -125
  441. package/src/components/block-toolbar/test/block-toolbar-menu.native.js +0 -405
  442. package/src/components/block-toolbar/test/index.native.js +0 -36
  443. package/src/components/block-types-list/index.native.js +0 -175
  444. package/src/components/block-types-list/style.native.scss +0 -25
  445. package/src/components/block-variation-picker/index.native.js +0 -107
  446. package/src/components/block-variation-picker/style.native.scss +0 -32
  447. package/src/components/button-block-appender/index.native.js +0 -92
  448. package/src/components/button-block-appender/styles.native.scss +0 -43
  449. package/src/components/caption/README.md +0 -44
  450. package/src/components/caption/index.native.js +0 -61
  451. package/src/components/colors-gradients/panel-color-gradient-settings.native.js +0 -59
  452. package/src/components/contrast-checker/index.native.js +0 -113
  453. package/src/components/contrast-checker/style.native.scss +0 -26
  454. package/src/components/convert-to-group-buttons/index.native.js +0 -79
  455. package/src/components/default-block-appender/index.native.js +0 -113
  456. package/src/components/default-block-appender/style.native.scss +0 -18
  457. package/src/components/floating-toolbar/floatingToolbar.android.scss +0 -4
  458. package/src/components/floating-toolbar/floatingToolbar.ios.scss +0 -3
  459. package/src/components/floating-toolbar/index.native.js +0 -141
  460. package/src/components/floating-toolbar/styles.native.scss +0 -43
  461. package/src/components/font-sizes/index.native.js +0 -7
  462. package/src/components/global-styles/color-panel.native.js +0 -207
  463. package/src/components/global-styles/test/use-global-styles-context.native.js +0 -435
  464. package/src/components/global-styles/use-global-styles-context.native.js +0 -592
  465. package/src/components/gradients/index.native.js +0 -2
  466. package/src/components/image-link-destinations/index.native.js +0 -152
  467. package/src/components/image-link-destinations/style.native.scss +0 -16
  468. package/src/components/index.native.js +0 -108
  469. package/src/components/inner-blocks/constants.native.js +0 -5
  470. package/src/components/inner-blocks/index.native.js +0 -221
  471. package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +0 -124
  472. package/src/components/inserter/block-types-tab.native.js +0 -76
  473. package/src/components/inserter/hooks/use-block-type-impressions.native.js +0 -47
  474. package/src/components/inserter/hooks/use-clipboard-block.native.js +0 -40
  475. package/src/components/inserter/index.native.js +0 -424
  476. package/src/components/inserter/menu.native.js +0 -237
  477. package/src/components/inserter/no-results.native.js +0 -49
  478. package/src/components/inserter/reusable-blocks-tab.native.js +0 -45
  479. package/src/components/inserter/search-results.native.js +0 -67
  480. package/src/components/inserter/style.native.scss +0 -83
  481. package/src/components/inserter/tabs.native.js +0 -152
  482. package/src/components/inserter/test/__snapshots__/index.native.js.snap +0 -117
  483. package/src/components/inserter/test/fixtures/index.native.js +0 -12
  484. package/src/components/inserter/test/index.native.js +0 -273
  485. package/src/components/inserter/test/reusable-blocks-tab.native.js +0 -62
  486. package/src/components/inserter/test/utils.native.js +0 -37
  487. package/src/components/inserter/utils.native.js +0 -46
  488. package/src/components/inserter-button/index.native.js +0 -108
  489. package/src/components/inserter-button/style.native.scss +0 -72
  490. package/src/components/inspector-controls/fill.native.js +0 -62
  491. package/src/components/inspector-controls/slot.native.js +0 -35
  492. package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +0 -31
  493. package/src/components/line-height-control/index.native.js +0 -28
  494. package/src/components/media-placeholder/index.native.js +0 -258
  495. package/src/components/media-placeholder/styles.native.scss +0 -108
  496. package/src/components/media-replace-flow/index.native.js +0 -12
  497. package/src/components/media-upload/constants.native.js +0 -14
  498. package/src/components/media-upload/index.native.js +0 -356
  499. package/src/components/media-upload/style.native.scss +0 -4
  500. package/src/components/media-upload/test/index.native.js +0 -172
  501. package/src/components/media-upload-progress/README.md +0 -100
  502. package/src/components/media-upload-progress/constants.js +0 -6
  503. package/src/components/media-upload-progress/index.native.js +0 -233
  504. package/src/components/media-upload-progress/styles.native.scss +0 -15
  505. package/src/components/media-upload-progress/test/index.native.js +0 -220
  506. package/src/components/plain-text/index.native.js +0 -164
  507. package/src/components/plain-text/style.native.scss +0 -10
  508. package/src/components/provider/index.native.js +0 -32
  509. package/src/components/rich-text/embed-handler-picker.native.js +0 -65
  510. package/src/components/rich-text/file-paste-handler.native.js +0 -3
  511. package/src/components/rich-text/format-toolbar/index.native.js +0 -21
  512. package/src/components/rich-text/format-toolbar-container.native.js +0 -16
  513. package/src/components/rich-text/index.native.js +0 -701
  514. package/src/components/rich-text/input-event.native.js +0 -10
  515. package/src/components/rich-text/native/format-edit.js +0 -44
  516. package/src/components/rich-text/native/get-format-colors.native.js +0 -47
  517. package/src/components/rich-text/native/index.js +0 -1
  518. package/src/components/rich-text/native/index.native.js +0 -1389
  519. package/src/components/rich-text/native/style.native.scss +0 -28
  520. package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +0 -79
  521. package/src/components/rich-text/native/test/index.native.js +0 -345
  522. package/src/components/rich-text/native/test/performance/rich-text.native.js +0 -44
  523. package/src/components/rich-text/native/toolbar-button-with-options.native.js +0 -61
  524. package/src/components/rich-text/native/use-format-types.js +0 -146
  525. package/src/components/rich-text/remove-browser-shortcuts.native.js +0 -1
  526. package/src/components/rich-text/shortcut.native.js +0 -10
  527. package/src/components/ungroup-button/README.md +0 -23
  528. package/src/components/ungroup-button/index.native.js +0 -77
  529. package/src/components/unsupported-block-details/index.native.js +0 -187
  530. package/src/components/unsupported-block-details/style.native.scss +0 -56
  531. package/src/components/url-input/index.native.js +0 -33
  532. package/src/components/use-block-drop-zone/index.native.js +0 -207
  533. package/src/components/use-on-block-drop/index.native.js +0 -115
  534. package/src/components/use-unsupported-block-editor/index.native.js +0 -59
  535. package/src/components/video-player/gridicon-play.native.js +0 -13
  536. package/src/components/video-player/index.native.js +0 -133
  537. package/src/components/video-player/styles.native.scss +0 -29
  538. package/src/components/warning/index.native.js +0 -64
  539. package/src/components/warning/style.native.scss +0 -47
  540. package/src/hooks/align.native.js +0 -49
  541. package/src/hooks/custom-class-name.native.js +0 -70
  542. package/src/hooks/index.native.js +0 -36
  543. package/src/hooks/layout.native.js +0 -23
  544. package/src/hooks/test/__snapshots__/align.native.js.snap +0 -73
  545. package/src/hooks/test/__snapshots__/anchor.native.js.snap +0 -7
  546. package/src/hooks/test/align.native.js +0 -134
  547. package/src/hooks/test/anchor.native.js +0 -32
  548. package/src/hooks/test/use-editor-wrapper-styles.native.js +0 -282
  549. package/src/hooks/typography.native.js +0 -60
  550. package/src/hooks/use-editor-wrapper-styles.native.js +0 -250
  551. package/src/hooks/use-editor-wrapper-styles.native.scss +0 -12
  552. package/src/index.native.js +0 -6
  553. package/src/private-apis.native.js +0 -21
  554. package/src/store/defaults.native.js +0 -23
@@ -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 ) => {
@@ -27,6 +27,7 @@ import {
27
27
  getSelectedBlockStyleState,
28
28
  hasSelectedStyleState,
29
29
  isSelectedBlockStyleStateShownOnCanvas,
30
+ shouldRenderBlockListView,
30
31
  } from '../private-selectors';
31
32
  import { getBlockEditingMode } from '../selectors';
32
33
  import { deviceTypeKey } from '../private-keys';
@@ -75,6 +76,143 @@ describe( 'private selectors', () => {
75
76
  } );
76
77
  } );
77
78
 
79
+ describe( 'shouldRenderBlockListView', () => {
80
+ const blockWithListViewSupport = 'core/test-list-view-support';
81
+ const blockWithoutListViewSupport = 'core/test-no-list-view-support';
82
+
83
+ const createState = (
84
+ blockName,
85
+ { allowedBlocks, innerBlocks = [] } = {}
86
+ ) => {
87
+ const blockListSettings = new Map();
88
+ if ( allowedBlocks !== undefined ) {
89
+ blockListSettings.set( 'client-1', { allowedBlocks } );
90
+ }
91
+
92
+ return {
93
+ blocks: {
94
+ byClientId: new Map( [
95
+ [ 'client-1', { name: blockName } ],
96
+ ] ),
97
+ order: new Map( [ [ 'client-1', innerBlocks ] ] ),
98
+ parents: new Map(),
99
+ },
100
+ blockListSettings,
101
+ };
102
+ };
103
+
104
+ beforeAll( () => {
105
+ registerBlockType( blockWithListViewSupport, {
106
+ apiVersion: 3,
107
+ title: 'List View support',
108
+ category: 'text',
109
+ supports: {
110
+ listView: true,
111
+ },
112
+ } );
113
+ registerBlockType( blockWithoutListViewSupport, {
114
+ apiVersion: 3,
115
+ title: 'No List View support',
116
+ category: 'text',
117
+ } );
118
+ } );
119
+
120
+ afterAll( () => {
121
+ unregisterBlockType( blockWithListViewSupport );
122
+ unregisterBlockType( blockWithoutListViewSupport );
123
+ } );
124
+
125
+ it( 'returns true for blocks with list view support', () => {
126
+ const state = createState( blockWithListViewSupport );
127
+
128
+ expect( shouldRenderBlockListView( state, 'client-1' ) ).toBe(
129
+ true
130
+ );
131
+ } );
132
+
133
+ it( 'returns false when empty and insertion is disallowed via `allowedBlocks: []`', () => {
134
+ const state = createState( blockWithListViewSupport, {
135
+ allowedBlocks: [],
136
+ } );
137
+
138
+ expect( shouldRenderBlockListView( state, 'client-1' ) ).toBe(
139
+ false
140
+ );
141
+ } );
142
+
143
+ it( 'returns false when empty and insertion is disallowed via `allowedBlocks: false`', () => {
144
+ const state = createState( blockWithListViewSupport, {
145
+ allowedBlocks: false,
146
+ } );
147
+
148
+ expect( shouldRenderBlockListView( state, 'client-1' ) ).toBe(
149
+ false
150
+ );
151
+ } );
152
+
153
+ it( 'returns true when empty but insertion is allowed', () => {
154
+ // e.g. a static, still-empty gallery: nothing yet, but the user can
155
+ // start inserting, so its List View stays available.
156
+ const state = createState( blockWithListViewSupport, {
157
+ allowedBlocks: [ 'core/image' ],
158
+ } );
159
+
160
+ expect( shouldRenderBlockListView( state, 'client-1' ) ).toBe(
161
+ true
162
+ );
163
+ } );
164
+
165
+ it( 'returns true when empty with no allowedBlocks restriction', () => {
166
+ const state = createState( blockWithListViewSupport );
167
+
168
+ expect( shouldRenderBlockListView( state, 'client-1' ) ).toBe(
169
+ true
170
+ );
171
+ } );
172
+
173
+ it( 'returns true when insertion is disallowed but the block still has inner blocks', () => {
174
+ const state = createState( blockWithListViewSupport, {
175
+ allowedBlocks: [],
176
+ innerBlocks: [ 'child-1' ],
177
+ } );
178
+
179
+ expect( shouldRenderBlockListView( state, 'client-1' ) ).toBe(
180
+ true
181
+ );
182
+ } );
183
+
184
+ it( 'does not grant list view support to unsupported block types', () => {
185
+ const state = createState( blockWithoutListViewSupport, {
186
+ allowedBlocks: [],
187
+ } );
188
+
189
+ expect( shouldRenderBlockListView( state, 'client-1' ) ).toBe(
190
+ false
191
+ );
192
+ } );
193
+
194
+ it( 'preserves the navigation block special case', () => {
195
+ const state = createState( 'core/navigation' );
196
+
197
+ expect( shouldRenderBlockListView( state, 'client-1' ) ).toBe(
198
+ true
199
+ );
200
+ } );
201
+
202
+ it( 'keeps navigation in list view even when empty and insertion is disallowed', () => {
203
+ // The navigation special case takes precedence over the
204
+ // `allowedBlocks` exclusion: even with nothing to show and no
205
+ // insertion allowed, navigation still participates in List View.
206
+ const state = createState( 'core/navigation', {
207
+ allowedBlocks: [],
208
+ } );
209
+
210
+ expect( shouldRenderBlockListView( state, 'client-1' ) ).toBe(
211
+ true
212
+ );
213
+ } );
214
+ } );
215
+
78
216
  describe( 'getSelectedBlockStyleState', () => {
79
217
  it( 'returns default when the block has no selected state', () => {
80
218
  const state = {};
@@ -2236,6 +2236,52 @@ describe( 'state', () => {
2236
2236
  expect( subsequentState.isPersistentChange ).toBe( true );
2237
2237
  } );
2238
2238
 
2239
+ it( 'should flag ignored history for an explicitly marked not persistent change', () => {
2240
+ let original = deepFreeze(
2241
+ blocks( undefined, {
2242
+ type: 'RESET_BLOCKS',
2243
+ blocks: [
2244
+ {
2245
+ clientId: 'kumquat',
2246
+ attributes: {},
2247
+ innerBlocks: [],
2248
+ },
2249
+ ],
2250
+ } )
2251
+ );
2252
+ original = blocks( original, {
2253
+ type: 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT',
2254
+ history: 'ignore',
2255
+ } );
2256
+
2257
+ const nextState = blocks( original, {
2258
+ type: 'UPDATE_BLOCK_ATTRIBUTES',
2259
+ clientIds: [ 'kumquat' ],
2260
+ attributes: {
2261
+ updated: true,
2262
+ },
2263
+ } );
2264
+
2265
+ expect( nextState.isPersistentChange ).toBe( false );
2266
+ expect( nextState.lastBlockChangeHistoryMode ).toBe(
2267
+ 'ignore'
2268
+ );
2269
+
2270
+ // A subsequent change should clear the ignored history.
2271
+ const subsequentState = blocks( nextState, {
2272
+ type: 'UPDATE_BLOCK_ATTRIBUTES',
2273
+ clientIds: [ 'kumquat' ],
2274
+ attributes: {
2275
+ other: true,
2276
+ },
2277
+ } );
2278
+
2279
+ expect( subsequentState.isPersistentChange ).toBe( true );
2280
+ expect(
2281
+ subsequentState.lastBlockChangeHistoryMode
2282
+ ).toBeUndefined();
2283
+ } );
2284
+
2239
2285
  it( 'should retain reference for same state, same persistence', () => {
2240
2286
  const original = deepFreeze(
2241
2287
  blocks( undefined, {
@@ -4031,6 +4031,82 @@ describe( 'selectors', () => {
4031
4031
  } )
4032
4032
  );
4033
4033
  } );
4034
+
4035
+ it( 'should use variation metadata for transformation items', () => {
4036
+ registerBlockType( 'core/variation-transform-source', {
4037
+ apiVersion: 3,
4038
+ category: 'text',
4039
+ title: 'Variation Transform Source',
4040
+ edit: () => {},
4041
+ save: () => {},
4042
+ transforms: {
4043
+ to: [
4044
+ {
4045
+ type: 'block',
4046
+ blocks: [ 'core/variation-transform-target' ],
4047
+ variationName: 'grid',
4048
+ transform: () => {},
4049
+ },
4050
+ ],
4051
+ },
4052
+ } );
4053
+ registerBlockType( 'core/variation-transform-target', {
4054
+ apiVersion: 3,
4055
+ category: 'design',
4056
+ title: 'Group',
4057
+ icon: 'group',
4058
+ edit: () => {},
4059
+ save: () => {},
4060
+ variations: [
4061
+ {
4062
+ name: 'grid',
4063
+ title: 'Grid',
4064
+ icon: 'grid',
4065
+ attributes: { layout: { type: 'grid' } },
4066
+ scope: [ 'transform' ],
4067
+ },
4068
+ ],
4069
+ } );
4070
+
4071
+ const state = {
4072
+ blocks: {
4073
+ byClientId: new Map(),
4074
+ attributes: new Map(),
4075
+ order: new Map(),
4076
+ parents: new Map(),
4077
+ cache: {},
4078
+ blockEditingModes: new Map(),
4079
+ },
4080
+ preferences: {
4081
+ insertUsage: {
4082
+ 'core/variation-transform-target/grid': {
4083
+ count: 10,
4084
+ time: 1000,
4085
+ },
4086
+ },
4087
+ },
4088
+ blockListSettings: new Map(),
4089
+ settings: {},
4090
+ };
4091
+ const blocks = [ { name: 'core/variation-transform-source' } ];
4092
+
4093
+ try {
4094
+ const items = getBlockTransformItems( state, blocks );
4095
+
4096
+ expect( items ).toHaveLength( 1 );
4097
+ expect( items[ 0 ] ).toMatchObject( {
4098
+ id: 'core/variation-transform-target/grid',
4099
+ name: 'core/variation-transform-target',
4100
+ variationName: 'grid',
4101
+ title: 'Grid',
4102
+ icon: 'grid',
4103
+ frecency: 2.5,
4104
+ } );
4105
+ } finally {
4106
+ unregisterBlockType( 'core/variation-transform-source' );
4107
+ unregisterBlockType( 'core/variation-transform-target' );
4108
+ }
4109
+ } );
4034
4110
  } );
4035
4111
 
4036
4112
  describe( 'isValidTemplate', () => {
@@ -5005,6 +5081,7 @@ describe( '__unstableGetClientIdsTree', () => {
5005
5081
  },
5006
5082
  { clientId: 'baz', innerBlocks: [] },
5007
5083
  ] );
5084
+ expect( console ).toHaveWarned();
5008
5085
  } );
5009
5086
 
5010
5087
  it( "should return the full content tree starting from the root, consisting of stripped down block object containing only its client ID and its inner blocks' client IDs", () => {
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/block-editor/src/components/media-upload-progress/constants.js
21
- var constants_exports = {};
22
- __export(constants_exports, {
23
- MEDIA_UPLOAD_STATE_FAILED: () => MEDIA_UPLOAD_STATE_FAILED,
24
- MEDIA_UPLOAD_STATE_IDLE: () => MEDIA_UPLOAD_STATE_IDLE,
25
- MEDIA_UPLOAD_STATE_PAUSED: () => MEDIA_UPLOAD_STATE_PAUSED,
26
- MEDIA_UPLOAD_STATE_RESET: () => MEDIA_UPLOAD_STATE_RESET,
27
- MEDIA_UPLOAD_STATE_SUCCEEDED: () => MEDIA_UPLOAD_STATE_SUCCEEDED,
28
- MEDIA_UPLOAD_STATE_UPLOADING: () => MEDIA_UPLOAD_STATE_UPLOADING
29
- });
30
- module.exports = __toCommonJS(constants_exports);
31
- var MEDIA_UPLOAD_STATE_IDLE = 0;
32
- var MEDIA_UPLOAD_STATE_UPLOADING = 1;
33
- var MEDIA_UPLOAD_STATE_SUCCEEDED = 2;
34
- var MEDIA_UPLOAD_STATE_FAILED = 3;
35
- var MEDIA_UPLOAD_STATE_RESET = 4;
36
- var MEDIA_UPLOAD_STATE_PAUSED = 11;
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- MEDIA_UPLOAD_STATE_FAILED,
40
- MEDIA_UPLOAD_STATE_IDLE,
41
- MEDIA_UPLOAD_STATE_PAUSED,
42
- MEDIA_UPLOAD_STATE_RESET,
43
- MEDIA_UPLOAD_STATE_SUCCEEDED,
44
- MEDIA_UPLOAD_STATE_UPLOADING
45
- });
46
- //# sourceMappingURL=constants.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/media-upload-progress/constants.js"],
4
- "sourcesContent": ["export const MEDIA_UPLOAD_STATE_IDLE = 0;\nexport const MEDIA_UPLOAD_STATE_UPLOADING = 1;\nexport const MEDIA_UPLOAD_STATE_SUCCEEDED = 2;\nexport const MEDIA_UPLOAD_STATE_FAILED = 3;\nexport const MEDIA_UPLOAD_STATE_RESET = 4;\nexport const MEDIA_UPLOAD_STATE_PAUSED = 11;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,0BAA0B;AAChC,IAAM,+BAA+B;AACrC,IAAM,+BAA+B;AACrC,IAAM,4BAA4B;AAClC,IAAM,2BAA2B;AACjC,IAAM,4BAA4B;",
6
- "names": []
7
- }
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/block-editor/src/components/rich-text/native/format-edit.js
21
- var format_edit_exports = {};
22
- __export(format_edit_exports, {
23
- default: () => FormatEdit
24
- });
25
- module.exports = __toCommonJS(format_edit_exports);
26
- var import_rich_text = require("@wordpress/rich-text");
27
- var import_jsx_runtime = require("react/jsx-runtime");
28
- function FormatEdit({
29
- formatTypes,
30
- onChange,
31
- onFocus,
32
- value,
33
- forwardedRef
34
- }) {
35
- return formatTypes.map((settings) => {
36
- const { name, edit: Edit } = settings;
37
- if (!Edit) {
38
- return null;
39
- }
40
- const activeFormat = (0, import_rich_text.getActiveFormat)(value, name);
41
- const isActive = activeFormat !== void 0;
42
- const activeObject = (0, import_rich_text.getActiveObject)(value);
43
- const isObjectActive = activeObject !== void 0 && activeObject.type === name;
44
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
- Edit,
46
- {
47
- isActive,
48
- activeAttributes: isActive ? activeFormat.attributes || {} : {},
49
- isObjectActive,
50
- activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {},
51
- value,
52
- onChange,
53
- onFocus,
54
- contentRef: forwardedRef
55
- },
56
- name
57
- );
58
- });
59
- }
60
- //# sourceMappingURL=format-edit.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/components/rich-text/native/format-edit.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getActiveFormat, getActiveObject } from '@wordpress/rich-text';\n\nexport default function FormatEdit( {\n\tformatTypes,\n\tonChange,\n\tonFocus,\n\tvalue,\n\tforwardedRef,\n} ) {\n\treturn formatTypes.map( ( settings ) => {\n\t\tconst { name, edit: Edit } = settings;\n\n\t\tif ( ! Edit ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst activeFormat = getActiveFormat( value, name );\n\t\tconst isActive = activeFormat !== undefined;\n\t\tconst activeObject = getActiveObject( value );\n\t\tconst isObjectActive =\n\t\t\tactiveObject !== undefined && activeObject.type === name;\n\n\t\treturn (\n\t\t\t<Edit\n\t\t\t\tkey={ name }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tactiveAttributes={\n\t\t\t\t\tisActive ? activeFormat.attributes || {} : {}\n\t\t\t\t}\n\t\t\t\tisObjectActive={ isObjectActive }\n\t\t\t\tactiveObjectAttributes={\n\t\t\t\t\tisObjectActive ? activeObject.attributes || {} : {}\n\t\t\t\t}\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tcontentRef={ forwardedRef }\n\t\t\t/>\n\t\t);\n\t} );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAiD;AAuB9C;AArBY,SAAR,WAA6B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,SAAO,YAAY,IAAK,CAAE,aAAc;AACvC,UAAM,EAAE,MAAM,MAAM,KAAK,IAAI;AAE7B,QAAK,CAAE,MAAO;AACb,aAAO;AAAA,IACR;AAEA,UAAM,mBAAe,kCAAiB,OAAO,IAAK;AAClD,UAAM,WAAW,iBAAiB;AAClC,UAAM,mBAAe,kCAAiB,KAAM;AAC5C,UAAM,iBACL,iBAAiB,UAAa,aAAa,SAAS;AAErD,WACC;AAAA,MAAC;AAAA;AAAA,QAEA;AAAA,QACA,kBACC,WAAW,aAAa,cAAc,CAAC,IAAI,CAAC;AAAA,QAE7C;AAAA,QACA,wBACC,iBAAiB,aAAa,cAAc,CAAC,IAAI,CAAC;AAAA,QAEnD;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAa;AAAA;AAAA,MAZP;AAAA,IAaP;AAAA,EAEF,CAAE;AACH;",
6
- "names": []
7
- }