@wordpress/block-editor 12.4.0 → 12.6.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 (524) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +1 -0
  3. package/build/components/block-draggable/index.js +6 -3
  4. package/build/components/block-draggable/index.js.map +1 -1
  5. package/build/components/block-draggable/index.native.js +2 -2
  6. package/build/components/block-draggable/index.native.js.map +1 -1
  7. package/build/components/block-edit/edit.js +25 -13
  8. package/build/components/block-edit/edit.js.map +1 -1
  9. package/build/components/block-heading-level-dropdown/heading-level-icon.js +10 -2
  10. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  11. package/build/components/block-heading-level-dropdown/index.native.js +4 -3
  12. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  13. package/build/components/block-list/block-outline.native.js +14 -18
  14. package/build/components/block-list/block-outline.native.js.map +1 -1
  15. package/build/components/block-list/block.native.js +21 -42
  16. package/build/components/block-list/block.native.js.map +1 -1
  17. package/build/components/block-lock/toolbar.js +25 -6
  18. package/build/components/block-lock/toolbar.js.map +1 -1
  19. package/build/components/block-mover/index.native.js +1 -1
  20. package/build/components/block-mover/index.native.js.map +1 -1
  21. package/build/components/block-parent-selector/index.js +8 -5
  22. package/build/components/block-parent-selector/index.js.map +1 -1
  23. package/build/components/block-removal-warning-modal/index.js +15 -25
  24. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  25. package/build/components/block-settings/button.native.js +2 -2
  26. package/build/components/block-settings/button.native.js.map +1 -1
  27. package/build/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +10 -11
  28. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -0
  29. package/build/components/block-toolbar/index.js +12 -8
  30. package/build/components/block-toolbar/index.js.map +1 -1
  31. package/build/components/block-toolbar/index.native.js +62 -3
  32. package/build/components/block-toolbar/index.native.js.map +1 -1
  33. package/build/components/block-tools/block-contextual-toolbar.js +7 -11
  34. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  35. package/build/components/colors-gradients/control.js +4 -2
  36. package/build/components/colors-gradients/control.js.map +1 -1
  37. package/build/components/dimensions-tool/aspect-ratio-tool.js +99 -0
  38. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
  39. package/build/components/dimensions-tool/index.js +207 -0
  40. package/build/components/dimensions-tool/index.js.map +1 -0
  41. package/build/components/dimensions-tool/scale-tool.js +111 -0
  42. package/build/components/dimensions-tool/scale-tool.js.map +1 -0
  43. package/build/components/dimensions-tool/width-height-tool.js +125 -0
  44. package/build/components/dimensions-tool/width-height-tool.js.map +1 -0
  45. package/build/components/global-styles/color-panel.js +22 -16
  46. package/build/components/global-styles/color-panel.js.map +1 -1
  47. package/build/components/global-styles/dimensions-panel.js +13 -2
  48. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  49. package/build/components/global-styles/filters-panel.js +1 -1
  50. package/build/components/global-styles/filters-panel.js.map +1 -1
  51. package/build/components/global-styles/get-block-css-selector.js +4 -8
  52. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  53. package/build/components/global-styles/hooks.js +15 -25
  54. package/build/components/global-styles/hooks.js.map +1 -1
  55. package/build/components/global-styles/typography-panel.js +52 -5
  56. package/build/components/global-styles/typography-panel.js.map +1 -1
  57. package/build/components/global-styles/use-global-styles-output.js +12 -18
  58. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  59. package/build/components/global-styles/utils.js +6 -6
  60. package/build/components/global-styles/utils.js.map +1 -1
  61. package/build/components/iframe/index.js +36 -48
  62. package/build/components/iframe/index.js.map +1 -1
  63. package/build/components/iframe/use-compatibility-styles.js +5 -0
  64. package/build/components/iframe/use-compatibility-styles.js.map +1 -1
  65. package/build/components/image-editor/aspect-ratio-dropdown.js +1 -1
  66. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  67. package/build/components/image-editor/use-save-image.js +1 -2
  68. package/build/components/image-editor/use-save-image.js.map +1 -1
  69. package/build/components/image-size-control/index.js +6 -0
  70. package/build/components/image-size-control/index.js.map +1 -1
  71. package/build/components/index.js +9 -0
  72. package/build/components/index.js.map +1 -1
  73. package/build/components/inner-blocks/index.js +3 -1
  74. package/build/components/inner-blocks/index.js.map +1 -1
  75. package/build/components/inner-blocks/index.native.js +3 -1
  76. package/build/components/inner-blocks/index.native.js.map +1 -1
  77. package/build/components/inner-blocks/use-nested-settings-update.js +33 -7
  78. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  79. package/build/components/inserter/block-patterns-explorer/patterns-list.js +2 -2
  80. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  81. package/build/components/inserter/block-patterns-tab.js +7 -35
  82. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  83. package/build/components/inserter/hooks/use-block-types-state.js +3 -4
  84. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  85. package/build/components/inserter/hooks/use-patterns-state.js +9 -3
  86. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  87. package/build/components/inserter/index.js +2 -4
  88. package/build/components/inserter/index.js.map +1 -1
  89. package/build/components/inserter/index.native.js +21 -32
  90. package/build/components/inserter/index.native.js.map +1 -1
  91. package/build/components/inserter/media-tab/hooks.js +2 -21
  92. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  93. package/build/components/inserter/reusable-block-rename-hint.js +82 -0
  94. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -0
  95. package/build/components/inserter/reusable-blocks-tab.js +6 -2
  96. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  97. package/build/components/inserter/reusable-blocks-tab.native.js +2 -2
  98. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  99. package/build/components/inserter/tabs.native.js +1 -1
  100. package/build/components/inserter/tabs.native.js.map +1 -1
  101. package/build/components/inserter-draggable-blocks/index.js +9 -1
  102. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  103. package/build/components/link-control/constants.js +1 -1
  104. package/build/components/link-control/constants.js.map +1 -1
  105. package/build/components/link-control/index.js +21 -16
  106. package/build/components/link-control/index.js.map +1 -1
  107. package/build/components/link-control/search-create-button.js +5 -21
  108. package/build/components/link-control/search-create-button.js.map +1 -1
  109. package/build/components/link-control/search-input.js +4 -4
  110. package/build/components/link-control/search-input.js.map +1 -1
  111. package/build/components/link-control/search-item.js +13 -30
  112. package/build/components/link-control/search-item.js.map +1 -1
  113. package/build/components/link-control/search-results.js +2 -2
  114. package/build/components/link-control/search-results.js.map +1 -1
  115. package/build/components/link-control/settings-drawer.js +2 -3
  116. package/build/components/link-control/settings-drawer.js.map +1 -1
  117. package/build/components/list-view/appender.js +2 -6
  118. package/build/components/list-view/appender.js.map +1 -1
  119. package/build/components/list-view/use-list-view-client-ids.js +2 -2
  120. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  121. package/build/components/media-placeholder/index.native.js +65 -31
  122. package/build/components/media-placeholder/index.native.js.map +1 -1
  123. package/build/components/preview-options/index.js +2 -2
  124. package/build/components/preview-options/index.js.map +1 -1
  125. package/build/components/provider/index.js +5 -2
  126. package/build/components/provider/index.js.map +1 -1
  127. package/build/components/provider/use-block-sync.js +21 -0
  128. package/build/components/provider/use-block-sync.js.map +1 -1
  129. package/build/components/resolution-tool/index.js +55 -0
  130. package/build/components/resolution-tool/index.js.map +1 -0
  131. package/build/components/rich-text/content.js +0 -36
  132. package/build/components/rich-text/content.js.map +1 -1
  133. package/build/components/rich-text/get-rich-text-values.js +118 -0
  134. package/build/components/rich-text/get-rich-text-values.js.map +1 -0
  135. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
  136. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  137. package/build/components/spacing-sizes-control/input-controls/axial.js +6 -2
  138. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  139. package/build/components/spacing-sizes-control/input-controls/separated.js +5 -1
  140. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  141. package/build/components/spacing-sizes-control/input-controls/single.js +5 -1
  142. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  143. package/build/components/spacing-sizes-control/utils.js +1 -1
  144. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  145. package/build/components/url-input/index.js +4 -2
  146. package/build/components/url-input/index.js.map +1 -1
  147. package/build/components/use-block-display-information/index.js +7 -3
  148. package/build/components/use-block-display-information/index.js.map +1 -1
  149. package/build/components/use-block-drop-zone/index.native.js +49 -8
  150. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  151. package/build/components/use-setting/index.js +5 -9
  152. package/build/components/use-setting/index.js.map +1 -1
  153. package/build/components/writing-flow/use-tab-nav.js +10 -27
  154. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  155. package/build/components/writing-mode-control/index.js +70 -0
  156. package/build/components/writing-mode-control/index.js.map +1 -0
  157. package/build/hooks/behaviors.js +25 -20
  158. package/build/hooks/behaviors.js.map +1 -1
  159. package/build/hooks/margin.js +1 -1
  160. package/build/hooks/margin.js.map +1 -1
  161. package/build/hooks/padding.js +1 -1
  162. package/build/hooks/padding.js.map +1 -1
  163. package/build/hooks/supports.js +7 -1
  164. package/build/hooks/supports.js.map +1 -1
  165. package/build/hooks/typography.js +2 -1
  166. package/build/hooks/typography.js.map +1 -1
  167. package/build/hooks/utils.js +5 -9
  168. package/build/hooks/utils.js.map +1 -1
  169. package/build/private-apis.js +16 -3
  170. package/build/private-apis.js.map +1 -1
  171. package/build/private-apis.native.js +3 -0
  172. package/build/private-apis.native.js.map +1 -1
  173. package/build/store/actions.js +196 -2
  174. package/build/store/actions.js.map +1 -1
  175. package/build/store/defaults.js +1 -0
  176. package/build/store/defaults.js.map +1 -1
  177. package/build/store/index.js +10 -1
  178. package/build/store/index.js.map +1 -1
  179. package/build/store/private-actions.js +46 -40
  180. package/build/store/private-actions.js.map +1 -1
  181. package/build/store/private-selectors.js +8 -9
  182. package/build/store/private-selectors.js.map +1 -1
  183. package/build/store/reducer.js +22 -9
  184. package/build/store/reducer.js.map +1 -1
  185. package/build/store/selectors.js +52 -23
  186. package/build/store/selectors.js.map +1 -1
  187. package/build/utils/object.js +38 -2
  188. package/build/utils/object.js.map +1 -1
  189. package/build-module/components/block-draggable/index.js +6 -3
  190. package/build-module/components/block-draggable/index.js.map +1 -1
  191. package/build-module/components/block-draggable/index.native.js +2 -2
  192. package/build-module/components/block-draggable/index.native.js.map +1 -1
  193. package/build-module/components/block-edit/edit.js +27 -10
  194. package/build-module/components/block-edit/edit.js.map +1 -1
  195. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +9 -2
  196. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  197. package/build-module/components/block-heading-level-dropdown/index.native.js +4 -3
  198. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  199. package/build-module/components/block-list/block-outline.native.js +14 -18
  200. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  201. package/build-module/components/block-list/block.native.js +24 -43
  202. package/build-module/components/block-list/block.native.js.map +1 -1
  203. package/build-module/components/block-lock/toolbar.js +25 -7
  204. package/build-module/components/block-lock/toolbar.js.map +1 -1
  205. package/build-module/components/block-mover/index.native.js +3 -3
  206. package/build-module/components/block-mover/index.native.js.map +1 -1
  207. package/build-module/components/block-parent-selector/index.js +7 -5
  208. package/build-module/components/block-parent-selector/index.js.map +1 -1
  209. package/build-module/components/block-removal-warning-modal/index.js +17 -24
  210. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  211. package/build-module/components/block-settings/button.native.js +3 -3
  212. package/build-module/components/block-settings/button.native.js.map +1 -1
  213. package/build-module/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +13 -13
  214. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -0
  215. package/build-module/components/block-toolbar/index.js +12 -8
  216. package/build-module/components/block-toolbar/index.js.map +1 -1
  217. package/build-module/components/block-toolbar/index.native.js +60 -4
  218. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  219. package/build-module/components/block-tools/block-contextual-toolbar.js +8 -11
  220. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  221. package/build-module/components/colors-gradients/control.js +3 -2
  222. package/build-module/components/colors-gradients/control.js.map +1 -1
  223. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +87 -0
  224. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
  225. package/build-module/components/dimensions-tool/index.js +195 -0
  226. package/build-module/components/dimensions-tool/index.js.map +1 -0
  227. package/build-module/components/dimensions-tool/scale-tool.js +103 -0
  228. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -0
  229. package/build-module/components/dimensions-tool/width-height-tool.js +122 -0
  230. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -0
  231. package/build-module/components/global-styles/color-panel.js +22 -16
  232. package/build-module/components/global-styles/color-panel.js.map +1 -1
  233. package/build-module/components/global-styles/dimensions-panel.js +13 -2
  234. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  235. package/build-module/components/global-styles/filters-panel.js +2 -2
  236. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  237. package/build-module/components/global-styles/get-block-css-selector.js +4 -8
  238. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  239. package/build-module/components/global-styles/hooks.js +14 -24
  240. package/build-module/components/global-styles/hooks.js.map +1 -1
  241. package/build-module/components/global-styles/typography-panel.js +51 -5
  242. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  243. package/build-module/components/global-styles/use-global-styles-output.js +13 -18
  244. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  245. package/build-module/components/global-styles/utils.js +5 -5
  246. package/build-module/components/global-styles/utils.js.map +1 -1
  247. package/build-module/components/iframe/index.js +37 -49
  248. package/build-module/components/iframe/index.js.map +1 -1
  249. package/build-module/components/iframe/use-compatibility-styles.js +5 -0
  250. package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
  251. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -1
  252. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  253. package/build-module/components/image-editor/use-save-image.js +1 -2
  254. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  255. package/build-module/components/image-size-control/index.js +5 -0
  256. package/build-module/components/image-size-control/index.js.map +1 -1
  257. package/build-module/components/index.js +1 -0
  258. package/build-module/components/index.js.map +1 -1
  259. package/build-module/components/inner-blocks/index.js +3 -1
  260. package/build-module/components/inner-blocks/index.js.map +1 -1
  261. package/build-module/components/inner-blocks/index.native.js +3 -1
  262. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  263. package/build-module/components/inner-blocks/use-nested-settings-update.js +30 -7
  264. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  265. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +2 -2
  266. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  267. package/build-module/components/inserter/block-patterns-tab.js +7 -33
  268. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  269. package/build-module/components/inserter/hooks/use-block-types-state.js +3 -4
  270. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  271. package/build-module/components/inserter/hooks/use-patterns-state.js +9 -3
  272. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  273. package/build-module/components/inserter/index.js +2 -4
  274. package/build-module/components/inserter/index.js.map +1 -1
  275. package/build-module/components/inserter/index.native.js +22 -33
  276. package/build-module/components/inserter/index.native.js.map +1 -1
  277. package/build-module/components/inserter/media-tab/hooks.js +2 -21
  278. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  279. package/build-module/components/inserter/reusable-block-rename-hint.js +67 -0
  280. package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -0
  281. package/build-module/components/inserter/reusable-blocks-tab.js +5 -2
  282. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  283. package/build-module/components/inserter/reusable-blocks-tab.native.js +2 -2
  284. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  285. package/build-module/components/inserter/tabs.native.js +1 -1
  286. package/build-module/components/inserter/tabs.native.js.map +1 -1
  287. package/build-module/components/inserter-draggable-blocks/index.js +9 -2
  288. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  289. package/build-module/components/link-control/constants.js +1 -1
  290. package/build-module/components/link-control/constants.js.map +1 -1
  291. package/build-module/components/link-control/index.js +21 -16
  292. package/build-module/components/link-control/index.js.map +1 -1
  293. package/build-module/components/link-control/search-create-button.js +7 -20
  294. package/build-module/components/link-control/search-create-button.js.map +1 -1
  295. package/build-module/components/link-control/search-input.js +4 -4
  296. package/build-module/components/link-control/search-input.js.map +1 -1
  297. package/build-module/components/link-control/search-item.js +14 -28
  298. package/build-module/components/link-control/search-item.js.map +1 -1
  299. package/build-module/components/link-control/search-results.js +3 -3
  300. package/build-module/components/link-control/search-results.js.map +1 -1
  301. package/build-module/components/link-control/settings-drawer.js +4 -5
  302. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  303. package/build-module/components/list-view/appender.js +2 -6
  304. package/build-module/components/list-view/appender.js.map +1 -1
  305. package/build-module/components/list-view/use-list-view-client-ids.js +2 -2
  306. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  307. package/build-module/components/media-placeholder/index.native.js +66 -33
  308. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  309. package/build-module/components/preview-options/index.js +2 -2
  310. package/build-module/components/preview-options/index.js.map +1 -1
  311. package/build-module/components/provider/index.js +5 -2
  312. package/build-module/components/provider/index.js.map +1 -1
  313. package/build-module/components/provider/use-block-sync.js +21 -0
  314. package/build-module/components/provider/use-block-sync.js.map +1 -1
  315. package/build-module/components/resolution-tool/index.js +45 -0
  316. package/build-module/components/resolution-tool/index.js.map +1 -0
  317. package/build-module/components/rich-text/content.js +1 -36
  318. package/build-module/components/rich-text/content.js.map +1 -1
  319. package/build-module/components/rich-text/get-rich-text-values.js +105 -0
  320. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -0
  321. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
  322. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  323. package/build-module/components/spacing-sizes-control/input-controls/axial.js +7 -3
  324. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  325. package/build-module/components/spacing-sizes-control/input-controls/separated.js +6 -2
  326. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  327. package/build-module/components/spacing-sizes-control/input-controls/single.js +6 -2
  328. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  329. package/build-module/components/spacing-sizes-control/utils.js +1 -1
  330. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  331. package/build-module/components/url-input/index.js +4 -2
  332. package/build-module/components/url-input/index.js.map +1 -1
  333. package/build-module/components/use-block-display-information/index.js +7 -3
  334. package/build-module/components/use-block-display-information/index.js.map +1 -1
  335. package/build-module/components/use-block-drop-zone/index.native.js +50 -8
  336. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  337. package/build-module/components/use-setting/index.js +5 -9
  338. package/build-module/components/use-setting/index.js.map +1 -1
  339. package/build-module/components/writing-flow/use-tab-nav.js +8 -26
  340. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  341. package/build-module/components/writing-mode-control/index.js +57 -0
  342. package/build-module/components/writing-mode-control/index.js.map +1 -0
  343. package/build-module/hooks/behaviors.js +26 -20
  344. package/build-module/hooks/behaviors.js.map +1 -1
  345. package/build-module/hooks/margin.js +1 -1
  346. package/build-module/hooks/margin.js.map +1 -1
  347. package/build-module/hooks/padding.js +1 -1
  348. package/build-module/hooks/padding.js.map +1 -1
  349. package/build-module/hooks/supports.js +7 -1
  350. package/build-module/hooks/supports.js.map +1 -1
  351. package/build-module/hooks/typography.js +2 -1
  352. package/build-module/hooks/typography.js.map +1 -1
  353. package/build-module/hooks/utils.js +6 -9
  354. package/build-module/hooks/utils.js.map +1 -1
  355. package/build-module/private-apis.js +11 -2
  356. package/build-module/private-apis.js.map +1 -1
  357. package/build-module/private-apis.native.js +2 -0
  358. package/build-module/private-apis.native.js.map +1 -1
  359. package/build-module/store/actions.js +193 -3
  360. package/build-module/store/actions.js.map +1 -1
  361. package/build-module/store/defaults.js +1 -0
  362. package/build-module/store/defaults.js.map +1 -1
  363. package/build-module/store/index.js +10 -1
  364. package/build-module/store/index.js.map +1 -1
  365. package/build-module/store/private-actions.js +45 -36
  366. package/build-module/store/private-actions.js.map +1 -1
  367. package/build-module/store/private-selectors.js +5 -5
  368. package/build-module/store/private-selectors.js.map +1 -1
  369. package/build-module/store/reducer.js +22 -9
  370. package/build-module/store/reducer.js.map +1 -1
  371. package/build-module/store/selectors.js +49 -21
  372. package/build-module/store/selectors.js.map +1 -1
  373. package/build-module/utils/object.js +34 -2
  374. package/build-module/utils/object.js.map +1 -1
  375. package/build-style/content-rtl.css +4 -0
  376. package/build-style/content.css +4 -0
  377. package/build-style/style-rtl.css +137 -129
  378. package/build-style/style.css +137 -129
  379. package/package.json +33 -32
  380. package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -6
  381. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -5
  382. package/src/components/block-controls/README.md +89 -0
  383. package/src/components/block-draggable/index.js +13 -4
  384. package/src/components/block-draggable/index.native.js +7 -3
  385. package/src/components/block-draggable/style.scss +1 -0
  386. package/src/components/block-draggable/test/index.native.js +0 -54
  387. package/src/components/block-edit/edit.js +26 -9
  388. package/src/components/block-edit/test/edit.js +1 -1
  389. package/src/components/block-heading-level-dropdown/heading-level-icon.js +6 -1
  390. package/src/components/block-heading-level-dropdown/index.native.js +8 -4
  391. package/src/components/block-inspector/style.scss +2 -1
  392. package/src/components/block-list/block-outline.native.js +26 -25
  393. package/src/components/block-list/block.native.js +24 -38
  394. package/src/components/block-list/block.native.scss +18 -40
  395. package/src/components/block-list/style.native.scss +3 -3
  396. package/src/components/block-lock/toolbar.js +34 -6
  397. package/src/components/block-mover/index.native.js +3 -3
  398. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +16 -6
  399. package/src/components/block-parent-selector/index.js +13 -8
  400. package/src/components/block-removal-warning-modal/index.js +17 -33
  401. package/src/components/block-settings/button.native.js +12 -6
  402. package/src/components/{block-mobile-toolbar/block-actions-menu.native.js → block-toolbar/block-toolbar-menu.native.js} +19 -18
  403. package/src/components/block-toolbar/index.js +11 -9
  404. package/src/components/block-toolbar/index.native.js +86 -6
  405. package/src/components/{block-mobile-toolbar/test/block-actions-menu.native.js → block-toolbar/test/block-toolbar-menu.native.js} +20 -54
  406. package/src/components/block-toolbar/test/index.native.js +42 -0
  407. package/src/components/block-tools/block-contextual-toolbar.js +5 -11
  408. package/src/components/block-tools/style.scss +73 -26
  409. package/src/components/button-block-appender/styles.native.scss +2 -2
  410. package/src/components/caption/README.md +49 -0
  411. package/src/components/colors-gradients/control.js +3 -2
  412. package/src/components/default-block-appender/content.scss +11 -0
  413. package/src/components/dimensions-tool/aspect-ratio-tool.js +124 -0
  414. package/src/components/dimensions-tool/index.js +212 -0
  415. package/src/components/dimensions-tool/scale-tool.js +124 -0
  416. package/src/components/dimensions-tool/stories/aspect-ratio-tool.js +52 -0
  417. package/src/components/dimensions-tool/stories/index.js +54 -0
  418. package/src/components/dimensions-tool/stories/scale-tool.js +48 -0
  419. package/src/components/dimensions-tool/stories/width-height-tool.js +54 -0
  420. package/src/components/dimensions-tool/test/index.js +641 -0
  421. package/src/components/dimensions-tool/width-height-tool.js +113 -0
  422. package/src/components/font-family/README.md +71 -0
  423. package/src/components/global-styles/color-panel.js +24 -17
  424. package/src/components/global-styles/dimensions-panel.js +8 -2
  425. package/src/components/global-styles/filters-panel.js +2 -2
  426. package/src/components/global-styles/get-block-css-selector.js +5 -9
  427. package/src/components/global-styles/hooks.js +22 -26
  428. package/src/components/global-styles/typography-panel.js +57 -5
  429. package/src/components/global-styles/use-global-styles-output.js +36 -18
  430. package/src/components/global-styles/utils.js +15 -6
  431. package/src/components/iframe/index.js +30 -56
  432. package/src/components/iframe/use-compatibility-styles.js +5 -0
  433. package/src/components/image-editor/aspect-ratio-dropdown.js +1 -1
  434. package/src/components/image-editor/use-save-image.js +0 -1
  435. package/src/components/image-size-control/index.js +6 -0
  436. package/src/components/index.js +1 -0
  437. package/src/components/inner-blocks/README.md +10 -0
  438. package/src/components/inner-blocks/index.js +4 -0
  439. package/src/components/inner-blocks/index.native.js +4 -0
  440. package/src/components/inner-blocks/use-nested-settings-update.js +32 -5
  441. package/src/components/inserter/block-patterns-explorer/patterns-list.js +8 -2
  442. package/src/components/inserter/block-patterns-tab.js +8 -56
  443. package/src/components/inserter/hooks/use-block-types-state.js +3 -4
  444. package/src/components/inserter/hooks/use-patterns-state.js +35 -19
  445. package/src/components/inserter/index.js +2 -3
  446. package/src/components/inserter/index.native.js +17 -36
  447. package/src/components/inserter/media-tab/hooks.js +2 -22
  448. package/src/components/inserter/reusable-block-rename-hint.js +69 -0
  449. package/src/components/inserter/reusable-blocks-tab.js +5 -1
  450. package/src/components/inserter/reusable-blocks-tab.native.js +2 -2
  451. package/src/components/inserter/style.native.scss +10 -15
  452. package/src/components/inserter/style.scss +28 -0
  453. package/src/components/inserter/tabs.native.js +5 -1
  454. package/src/components/inserter-draggable-blocks/index.js +13 -2
  455. package/src/components/link-control/constants.js +1 -1
  456. package/src/components/link-control/index.js +36 -29
  457. package/src/components/link-control/search-create-button.js +8 -26
  458. package/src/components/link-control/search-input.js +4 -3
  459. package/src/components/link-control/search-item.js +21 -43
  460. package/src/components/link-control/search-results.js +48 -46
  461. package/src/components/link-control/settings-drawer.js +6 -5
  462. package/src/components/link-control/style.scss +58 -123
  463. package/src/components/link-control/test/index.js +161 -123
  464. package/src/components/list-view/appender.js +5 -6
  465. package/src/components/list-view/style.scss +1 -2
  466. package/src/components/list-view/use-list-view-client-ids.js +2 -2
  467. package/src/components/media-placeholder/index.native.js +108 -59
  468. package/src/components/media-placeholder/styles.native.scss +59 -24
  469. package/src/components/media-replace-flow/test/index.js +1 -1
  470. package/src/components/panel-color-settings/README.md +98 -0
  471. package/src/components/preview-options/README.md +18 -17
  472. package/src/components/preview-options/index.js +2 -2
  473. package/src/components/provider/index.js +9 -2
  474. package/src/components/provider/test/use-block-sync.js +21 -6
  475. package/src/components/provider/use-block-sync.js +19 -0
  476. package/src/components/recursion-provider/README.md +101 -0
  477. package/src/components/resolution-tool/index.js +56 -0
  478. package/src/components/resolution-tool/stories/index.js +48 -0
  479. package/src/components/rich-text/content.js +1 -46
  480. package/src/components/rich-text/get-rich-text-values.js +105 -0
  481. package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
  482. package/src/components/spacing-sizes-control/input-controls/axial.js +17 -2
  483. package/src/components/spacing-sizes-control/input-controls/separated.js +17 -2
  484. package/src/components/spacing-sizes-control/input-controls/single.js +12 -2
  485. package/src/components/spacing-sizes-control/utils.js +1 -1
  486. package/src/components/text-transform-control/README.md +44 -0
  487. package/src/components/url-input/index.js +2 -0
  488. package/src/components/use-block-display-information/index.js +12 -5
  489. package/src/components/use-block-drop-zone/index.native.js +65 -28
  490. package/src/components/use-setting/index.js +8 -8
  491. package/src/components/writing-flow/use-tab-nav.js +10 -33
  492. package/src/components/writing-mode-control/index.js +68 -0
  493. package/src/components/writing-mode-control/style.scss +18 -0
  494. package/src/hooks/behaviors.js +25 -16
  495. package/src/hooks/margin.js +4 -1
  496. package/src/hooks/padding.js +4 -1
  497. package/src/hooks/supports.js +7 -0
  498. package/src/hooks/typography.js +2 -0
  499. package/src/hooks/utils.js +8 -7
  500. package/src/private-apis.js +13 -1
  501. package/src/private-apis.native.js +2 -0
  502. package/src/store/actions.js +195 -3
  503. package/src/store/defaults.js +1 -0
  504. package/src/store/index.js +10 -0
  505. package/src/store/private-actions.js +39 -39
  506. package/src/store/private-selectors.js +5 -8
  507. package/src/store/reducer.js +22 -9
  508. package/src/store/selectors.js +87 -25
  509. package/src/store/test/actions.js +114 -0
  510. package/src/store/test/private-actions.js +56 -0
  511. package/src/store/test/private-selectors.js +5 -5
  512. package/src/store/test/reducer.js +14 -7
  513. package/src/store/test/selectors.js +1 -1
  514. package/src/utils/object.js +32 -2
  515. package/src/utils/test/object.js +36 -0
  516. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +0 -1
  517. package/build/components/block-mobile-toolbar/index.native.js +0 -135
  518. package/build/components/block-mobile-toolbar/index.native.js.map +0 -1
  519. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +0 -1
  520. package/build-module/components/block-mobile-toolbar/index.native.js +0 -116
  521. package/build-module/components/block-mobile-toolbar/index.native.js.map +0 -1
  522. package/src/components/block-mobile-toolbar/index.native.js +0 -127
  523. package/src/components/block-mobile-toolbar/style.native.scss +0 -16
  524. /package/src/components/{block-mobile-toolbar/test/__snapshots__/block-actions-menu.native.js.snap → block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap} +0 -0
@@ -138,7 +138,7 @@ describe( 'Basic rendering', () => {
138
138
  render( <LinkControl /> );
139
139
 
140
140
  // Search Input UI.
141
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
141
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
142
142
 
143
143
  expect( searchInput ).toBeVisible();
144
144
  } );
@@ -147,7 +147,7 @@ describe( 'Basic rendering', () => {
147
147
  render( <LinkControl /> );
148
148
 
149
149
  // Search Input UI.
150
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
150
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
151
151
 
152
152
  expect( searchInput ).toBeVisible();
153
153
  // Make sure we use the ARIA 1.0 pattern with aria-owns.
@@ -170,7 +170,7 @@ describe( 'Basic rendering', () => {
170
170
  render( <LinkControl /> );
171
171
 
172
172
  // Search Input UI.
173
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
173
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
174
174
 
175
175
  // Simulate searching for a term.
176
176
  await user.type( searchInput, 'Hello' );
@@ -283,7 +283,7 @@ describe( 'Basic rendering', () => {
283
283
  render( <LinkControl /> );
284
284
 
285
285
  // Search Input UI.
286
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
286
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
287
287
 
288
288
  // Simulate searching for a term.
289
289
  await user.type( searchInput, searchTerm );
@@ -296,7 +296,7 @@ describe( 'Basic rendering', () => {
296
296
  render( <LinkControl value={ { url: 'https://example.com' } } /> );
297
297
 
298
298
  expect(
299
- screen.queryByRole( 'combobox', { name: 'URL' } )
299
+ screen.queryByRole( 'combobox', { name: 'Link' } )
300
300
  ).not.toBeInTheDocument();
301
301
  } );
302
302
 
@@ -309,7 +309,7 @@ describe( 'Basic rendering', () => {
309
309
  );
310
310
 
311
311
  expect(
312
- screen.getByRole( 'combobox', { name: 'URL' } )
312
+ screen.getByRole( 'combobox', { name: 'Link' } )
313
313
  ).toBeVisible();
314
314
  } );
315
315
 
@@ -327,7 +327,7 @@ describe( 'Basic rendering', () => {
327
327
  await user.click( editButton );
328
328
 
329
329
  expect(
330
- screen.getByRole( 'combobox', { name: 'URL' } )
330
+ screen.getByRole( 'combobox', { name: 'Link' } )
331
331
  ).toBeVisible();
332
332
 
333
333
  // If passed `forceIsEditingLink` of `false` while editing, should
@@ -340,7 +340,7 @@ describe( 'Basic rendering', () => {
340
340
  );
341
341
 
342
342
  expect(
343
- screen.queryByRole( 'combobox', { name: 'URL' } )
343
+ screen.queryByRole( 'combobox', { name: 'Link' } )
344
344
  ).not.toBeInTheDocument();
345
345
  } );
346
346
 
@@ -405,6 +405,32 @@ describe( 'Basic rendering', () => {
405
405
 
406
406
  expect( mockOnRemove ).toHaveBeenCalled();
407
407
  } );
408
+
409
+ it( 'should revert to "editing" mode when onRemove is triggered', async () => {
410
+ const user = userEvent.setup();
411
+ const mockOnRemove = jest.fn();
412
+
413
+ render(
414
+ <LinkControl
415
+ value={ { url: 'https://example.com' } }
416
+ onRemove={ mockOnRemove }
417
+ />
418
+ );
419
+
420
+ const unLinkButton = screen.queryByRole( 'button', {
421
+ name: 'Unlink',
422
+ } );
423
+ expect( unLinkButton ).toBeVisible();
424
+
425
+ await user.click( unLinkButton );
426
+
427
+ expect( mockOnRemove ).toHaveBeenCalled();
428
+
429
+ // Should revert back to editing mode.
430
+ expect(
431
+ screen.getByRole( 'combobox', { name: 'Link' } )
432
+ ).toBeVisible();
433
+ } );
408
434
  } );
409
435
  } );
410
436
 
@@ -424,7 +450,7 @@ describe( 'Searching for a link', () => {
424
450
  render( <LinkControl /> );
425
451
 
426
452
  // Search Input UI.
427
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
453
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
428
454
 
429
455
  // Simulate searching for a term.
430
456
  await user.type( searchInput, searchTerm );
@@ -448,7 +474,9 @@ describe( 'Searching for a link', () => {
448
474
  render( <LinkControl /> );
449
475
 
450
476
  // Search Input UI.
451
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
477
+ const searchInput = screen.getByRole( 'combobox', {
478
+ name: 'Link',
479
+ } );
452
480
 
453
481
  // Simulate searching for a term.
454
482
  await user.type( searchInput, searchTerm );
@@ -476,16 +504,16 @@ describe( 'Searching for a link', () => {
476
504
  // The fallback URL suggestion should not be shown when input is not URL-like.
477
505
  expect(
478
506
  searchResultElements[ searchResultElements.length - 1 ]
479
- ).not.toHaveTextContent( 'URL' );
507
+ ).not.toHaveTextContent( 'Press ENTER to add this link' );
480
508
  }
481
509
  );
482
510
 
483
511
  it.each( [
484
- [ 'https://wordpress.org', 'URL' ],
485
- [ 'http://wordpress.org', 'URL' ],
486
- [ 'www.wordpress.org', 'URL' ],
487
- [ 'wordpress.org', 'URL' ],
488
- [ 'ftp://wordpress.org', 'URL' ],
512
+ [ 'https://wordpress.org', 'link' ],
513
+ [ 'http://wordpress.org', 'link' ],
514
+ [ 'www.wordpress.org', 'link' ],
515
+ [ 'wordpress.org', 'link' ],
516
+ [ 'ftp://wordpress.org', 'link' ],
489
517
  [ 'mailto:hello@wordpress.org', 'mailto' ],
490
518
  [ 'tel:123456789', 'tel' ],
491
519
  [ '#internal', 'internal' ],
@@ -497,7 +525,9 @@ describe( 'Searching for a link', () => {
497
525
  render( <LinkControl /> );
498
526
 
499
527
  // Search Input UI.
500
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
528
+ const searchInput = screen.getByRole( 'combobox', {
529
+ name: 'Link',
530
+ } );
501
531
 
502
532
  // Simulate searching for a term.
503
533
  await user.type( searchInput, searchTerm );
@@ -528,7 +558,7 @@ describe( 'Searching for a link', () => {
528
558
  render( <LinkControl /> );
529
559
 
530
560
  // Search Input UI.
531
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
561
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
532
562
 
533
563
  // Simulate searching for a term.
534
564
  await user.type( searchInput, searchTerm );
@@ -571,7 +601,7 @@ describe( 'Searching for a link', () => {
571
601
  render( <LinkControl showSuggestions={ false } /> );
572
602
 
573
603
  // Search Input UI.
574
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
604
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
575
605
 
576
606
  // Simulate searching for a term.
577
607
  await user.type( searchInput, 'anything' );
@@ -582,12 +612,43 @@ describe( 'Searching for a link', () => {
582
612
  expect( mockFetchSearchSuggestions ).not.toHaveBeenCalled();
583
613
  } );
584
614
 
615
+ it( 'should not display a URL suggestion when input is not likely to be a URL.', async () => {
616
+ const searchTerm = 'unlikelytobeaURL';
617
+ const user = userEvent.setup();
618
+ render( <LinkControl /> );
619
+
620
+ // Search Input UI.
621
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
622
+
623
+ // Simulate searching for a term.
624
+ await user.type( searchInput, searchTerm );
625
+
626
+ const searchResultElements = within(
627
+ await screen.findByRole( 'listbox', {
628
+ name: /Search results for.*/,
629
+ } )
630
+ ).getAllByRole( 'option' );
631
+
632
+ const lastSearchResultItem =
633
+ searchResultElements[ searchResultElements.length - 1 ];
634
+
635
+ // We should see a search result for each of the expect search suggestions.
636
+ expect( searchResultElements ).toHaveLength(
637
+ fauxEntitySuggestions.length
638
+ );
639
+
640
+ // The URL search suggestion should not exist.
641
+ expect( lastSearchResultItem ).not.toHaveTextContent(
642
+ 'Press ENTER to add this link'
643
+ );
644
+ } );
645
+
585
646
  it( 'should not display a URL suggestion as a default fallback when noURLSuggestion is passed.', async () => {
586
647
  const user = userEvent.setup();
587
648
  render( <LinkControl noURLSuggestion /> );
588
649
 
589
650
  // Search Input UI.
590
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
651
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
591
652
 
592
653
  // Simulate searching for a term.
593
654
  await user.type( searchInput, 'couldbeurlorentitysearchterm' );
@@ -617,7 +678,9 @@ describe( 'Manual link entry', () => {
617
678
  render( <LinkControl /> );
618
679
 
619
680
  // Search Input UI.
620
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
681
+ const searchInput = screen.getByRole( 'combobox', {
682
+ name: 'Link',
683
+ } );
621
684
 
622
685
  // Simulate searching for a term.
623
686
  await user.type( searchInput, searchTerm );
@@ -630,7 +693,6 @@ describe( 'Manual link entry', () => {
630
693
 
631
694
  expect( searchResultElements ).toBeVisible();
632
695
  expect( searchResultElements ).toHaveTextContent( searchTerm );
633
- expect( searchResultElements ).toHaveTextContent( 'URL' );
634
696
  expect( searchResultElements ).toHaveTextContent(
635
697
  'Press ENTER to add this link'
636
698
  );
@@ -653,19 +715,9 @@ describe( 'Manual link entry', () => {
653
715
 
654
716
  // Search Input UI.
655
717
  const searchInput = screen.getByRole( 'combobox', {
656
- name: 'URL',
657
- } );
658
-
659
- let submitButton = screen.getByRole( 'button', {
660
- name: 'Save',
718
+ name: 'Link',
661
719
  } );
662
720
 
663
- expect( submitButton ).toHaveAttribute(
664
- 'aria-disabled',
665
- 'true'
666
- );
667
- expect( submitButton ).toBeVisible();
668
-
669
721
  if ( searchString.length ) {
670
722
  // Simulate searching for a term.
671
723
  await user.type( searchInput, searchString );
@@ -677,102 +729,74 @@ describe( 'Manual link entry', () => {
677
729
  // Attempt to submit the empty search value in the input.
678
730
  await user.keyboard( '[Enter]' );
679
731
 
680
- submitButton = screen.getByRole( 'button', {
681
- name: 'Save',
682
- } );
683
-
684
- // Verify the UI hasn't allowed submission.
732
+ // Verify the UI hasn't allowed submission because
733
+ // the search input is still visible.
685
734
  expect( searchInput ).toBeVisible();
686
- expect( submitButton ).toHaveAttribute(
687
- 'aria-disabled',
688
- 'true'
689
- );
690
- expect( submitButton ).toBeVisible();
691
735
  }
692
736
  );
693
737
 
694
738
  it.each( testTable )(
695
- 'should not allow creation of links %s via the UI "submit" button',
739
+ 'should not allow editing of links to a new link %s via the UI "submit" button',
696
740
  async ( _desc, searchString ) => {
697
741
  const user = userEvent.setup();
698
742
 
699
- render( <LinkControl /> );
743
+ render(
744
+ <LinkControl
745
+ value={ fauxEntitySuggestions[ 0 ] }
746
+ forceIsEditingLink
747
+ />
748
+ );
700
749
 
701
750
  // Search Input UI.
702
751
  const searchInput = screen.getByRole( 'combobox', {
703
- name: 'URL',
752
+ name: 'Link',
704
753
  } );
705
754
 
706
- let submitButton = screen.queryByRole( 'button', {
707
- name: 'Save',
708
- } );
755
+ // Remove the existing link.
756
+ await user.clear( searchInput );
709
757
 
710
- expect( submitButton ).toHaveAttribute(
711
- 'aria-disabled',
712
- 'true'
713
- );
714
- expect( submitButton ).toBeVisible();
715
-
716
- // Simulate searching for a term.
717
758
  if ( searchString.length ) {
718
- // Simulate searching for a term.
719
759
  await user.type( searchInput, searchString );
720
760
  } else {
721
761
  // Simulate clearing the search term.
722
762
  await user.clear( searchInput );
723
763
  }
724
764
 
725
- // Attempt to submit the empty search value in the input.
726
- await user.click( submitButton );
727
-
728
- submitButton = screen.queryByRole( 'button', {
765
+ const submitButton = screen.queryByRole( 'button', {
729
766
  name: 'Save',
730
767
  } );
731
768
 
732
- // Verify the UI hasn't allowed submission.
733
- expect( searchInput ).toBeVisible();
769
+ // debug the UI state
770
+ // screen.debug();
771
+
772
+ // Verify the submission UI is disabled.
773
+ expect( submitButton ).toBeVisible();
734
774
  expect( submitButton ).toHaveAttribute(
735
775
  'aria-disabled',
736
776
  'true'
737
777
  );
738
- expect( submitButton ).toBeVisible();
778
+
779
+ // Attempt to submit the empty search value in the input.
780
+ await user.click( submitButton );
781
+
782
+ // Verify the UI hasn't allowed submission because
783
+ // the search input is still visible.
784
+ expect( searchInput ).toBeVisible();
739
785
  }
740
786
  );
741
787
  } );
742
788
 
743
789
  describe( 'Handling cancellation', () => {
744
- it( 'should allow cancellation of the link creation process and reset any entered values', async () => {
745
- const user = userEvent.setup();
790
+ it( 'should not show cancellation button during link creation', async () => {
746
791
  const mockOnRemove = jest.fn();
747
- const mockOnCancel = jest.fn();
748
792
 
749
793
  render( <LinkControl onRemove={ mockOnRemove } /> );
750
794
 
751
- // Search Input UI.
752
- const searchInput = screen.getByRole( 'combobox', {
753
- name: 'URL',
754
- } );
755
-
756
795
  const cancelButton = screen.queryByRole( 'button', {
757
796
  name: 'Cancel',
758
797
  } );
759
798
 
760
- expect( cancelButton ).toBeEnabled();
761
- expect( cancelButton ).toBeVisible();
762
-
763
- // Simulate adding a link for a term.
764
- await user.type( searchInput, 'https://www.wordpress.org' );
765
-
766
- // Attempt to submit the empty search value in the input.
767
- await user.click( cancelButton );
768
-
769
- // Verify the consumer can handle the cancellation.
770
- expect( mockOnRemove ).toHaveBeenCalled();
771
-
772
- // Ensure optional callback is not called.
773
- expect( mockOnCancel ).not.toHaveBeenCalled();
774
-
775
- expect( searchInput ).toHaveValue( '' );
799
+ expect( cancelButton ).not.toBeInTheDocument();
776
800
  } );
777
801
 
778
802
  it( 'should allow cancellation of the link editing process and reset any entered values', async () => {
@@ -809,7 +833,7 @@ describe( 'Manual link entry', () => {
809
833
  await toggleSettingsDrawer( user );
810
834
 
811
835
  let searchInput = screen.getByRole( 'combobox', {
812
- name: 'URL',
836
+ name: 'Link',
813
837
  } );
814
838
 
815
839
  let textInput = screen.getByRole( 'textbox', {
@@ -844,7 +868,7 @@ describe( 'Manual link entry', () => {
844
868
 
845
869
  // Re-query the inputs as they have been replaced.
846
870
  searchInput = screen.getByRole( 'combobox', {
847
- name: 'URL',
871
+ name: 'Link',
848
872
  } );
849
873
 
850
874
  textInput = screen.getByRole( 'textbox', {
@@ -860,7 +884,13 @@ describe( 'Manual link entry', () => {
860
884
  const user = userEvent.setup();
861
885
  const mockOnCancel = jest.fn();
862
886
 
863
- render( <LinkControl onCancel={ mockOnCancel } /> );
887
+ render(
888
+ <LinkControl
889
+ value={ fauxEntitySuggestions[ 0 ] }
890
+ onCancel={ mockOnCancel }
891
+ forceIsEditingLink
892
+ />
893
+ );
864
894
 
865
895
  const cancelButton = screen.queryByRole( 'button', {
866
896
  name: 'Cancel',
@@ -886,7 +916,7 @@ describe( 'Manual link entry', () => {
886
916
 
887
917
  // Search Input UI.
888
918
  const searchInput = screen.getByRole( 'combobox', {
889
- name: 'URL',
919
+ name: 'Link',
890
920
  } );
891
921
 
892
922
  // Simulate searching for a term.
@@ -922,7 +952,7 @@ describe( 'Default search suggestions', () => {
922
952
  // Verify input has no value has default suggestions should only show
923
953
  // when this does not have a value.
924
954
  // Search Input UI.
925
- expect( screen.getByRole( 'combobox', { name: 'URL' } ) ).toHaveValue(
955
+ expect( screen.getByRole( 'combobox', { name: 'Link' } ) ).toHaveValue(
926
956
  ''
927
957
  );
928
958
 
@@ -951,7 +981,7 @@ describe( 'Default search suggestions', () => {
951
981
  } );
952
982
  await user.click( currentLinkBtn );
953
983
 
954
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
984
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
955
985
 
956
986
  // Search input is set to the URL value.
957
987
  expect( searchInput ).toHaveValue( initialValue.url );
@@ -973,7 +1003,7 @@ describe( 'Default search suggestions', () => {
973
1003
  render( <LinkControl showInitialSuggestions /> );
974
1004
 
975
1005
  // Search Input UI.
976
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1006
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
977
1007
 
978
1008
  // Simulate searching for a term.
979
1009
  await user.type( searchInput, searchTerm );
@@ -1011,7 +1041,7 @@ describe( 'Default search suggestions', () => {
1011
1041
 
1012
1042
  render( <LinkControl showInitialSuggestions /> );
1013
1043
 
1014
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1044
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
1015
1045
 
1016
1046
  const searchResultsField = screen.queryByRole( 'listbox', {
1017
1047
  name: 'Suggestions',
@@ -1069,7 +1099,9 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
1069
1099
  render( <LinkControlConsumer /> );
1070
1100
 
1071
1101
  // Search Input UI.
1072
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1102
+ const searchInput = screen.getByRole( 'combobox', {
1103
+ name: 'Link',
1104
+ } );
1073
1105
 
1074
1106
  // Simulate searching for a term.
1075
1107
  await user.type( searchInput, entityNameText );
@@ -1136,7 +1168,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
1136
1168
  render( <LinkControlConsumer /> );
1137
1169
 
1138
1170
  // Search Input UI.
1139
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1171
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
1140
1172
 
1141
1173
  // Simulate searching for a term.
1142
1174
  await user.type( searchInput, 'Some new page to create' );
@@ -1185,7 +1217,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
1185
1217
  render( <LinkControlConsumer /> );
1186
1218
 
1187
1219
  // Search Input UI.
1188
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1220
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
1189
1221
 
1190
1222
  // Simulate searching for a term.
1191
1223
  await user.type( searchInput, entityNameText );
@@ -1228,7 +1260,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
1228
1260
  render( <LinkControlConsumer /> );
1229
1261
 
1230
1262
  // Search Input UI.
1231
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1263
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
1232
1264
 
1233
1265
  // Simulate searching for a term.
1234
1266
  await user.type( searchInput, entityNameText );
@@ -1252,7 +1284,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
1252
1284
 
1253
1285
  // Search Input UI.
1254
1286
  const searchInput = screen.getByRole( 'combobox', {
1255
- name: 'URL',
1287
+ name: 'Link',
1256
1288
  } );
1257
1289
 
1258
1290
  const searchResultsField = screen.queryByRole( 'listbox' );
@@ -1272,7 +1304,9 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
1272
1304
  );
1273
1305
 
1274
1306
  // Search Input UI.
1275
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1307
+ const searchInput = screen.getByRole( 'combobox', {
1308
+ name: 'Link',
1309
+ } );
1276
1310
 
1277
1311
  const searchResultsField = screen.queryByRole( 'listbox' );
1278
1312
 
@@ -1295,7 +1329,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
1295
1329
 
1296
1330
  // Search Input UI.
1297
1331
  const searchInput = screen.getByRole( 'combobox', {
1298
- name: 'URL',
1332
+ name: 'Link',
1299
1333
  } );
1300
1334
 
1301
1335
  // Simulate searching for a term.
@@ -1329,7 +1363,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
1329
1363
  render( <LinkControl createSuggestion={ createSuggestion } /> );
1330
1364
 
1331
1365
  // Search Input UI.
1332
- searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1366
+ searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
1333
1367
 
1334
1368
  // Simulate searching for a term.
1335
1369
  await user.type( searchInput, searchText );
@@ -1344,7 +1378,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
1344
1378
 
1345
1379
  await user.click( createButton );
1346
1380
 
1347
- searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1381
+ searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
1348
1382
 
1349
1383
  const errorNotice = screen.getAllByText(
1350
1384
  'API response returned invalid entity.'
@@ -1417,7 +1451,7 @@ describe( 'Selecting links', () => {
1417
1451
  // Simulate searching for a term.
1418
1452
  await user.click( currentLinkBtn );
1419
1453
 
1420
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1454
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
1421
1455
  currentLinkUI = screen.queryByLabelText( 'Currently selected' );
1422
1456
 
1423
1457
  // We should be back to showing the search input.
@@ -1458,7 +1492,7 @@ describe( 'Selecting links', () => {
1458
1492
 
1459
1493
  // Search Input UI.
1460
1494
  const searchInput = screen.getByRole( 'combobox', {
1461
- name: 'URL',
1495
+ name: 'Link',
1462
1496
  } );
1463
1497
 
1464
1498
  // Simulate searching for a term.
@@ -1520,7 +1554,7 @@ describe( 'Selecting links', () => {
1520
1554
 
1521
1555
  // Search Input UI.
1522
1556
  const searchInput = screen.getByRole( 'combobox', {
1523
- name: 'URL',
1557
+ name: 'Link',
1524
1558
  } );
1525
1559
 
1526
1560
  // Simulate searching for a term.
@@ -1609,7 +1643,9 @@ describe( 'Selecting links', () => {
1609
1643
  ).toBeVisible();
1610
1644
 
1611
1645
  // Search Input UI.
1612
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1646
+ const searchInput = screen.getByRole( 'combobox', {
1647
+ name: 'Link',
1648
+ } );
1613
1649
 
1614
1650
  // Step down into the search results, highlighting the first result item.
1615
1651
  triggerArrowDown( searchInput );
@@ -1665,7 +1701,9 @@ describe( 'Selecting links', () => {
1665
1701
  render( <LinkControl value={ selectedLink } forceIsEditingLink /> );
1666
1702
 
1667
1703
  // focus the search input
1668
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1704
+ const searchInput = screen.getByRole( 'combobox', {
1705
+ name: 'Link',
1706
+ } );
1669
1707
 
1670
1708
  fireEvent.focus( searchInput );
1671
1709
 
@@ -1707,10 +1745,7 @@ describe( 'Addition Settings UI', () => {
1707
1745
 
1708
1746
  render( <LinkControlConsumer /> );
1709
1747
 
1710
- const settingsToggle = screen.queryByRole( 'button', {
1711
- name: 'Link Settings',
1712
- ariaControls: 'link-settings-1',
1713
- } );
1748
+ const settingsToggle = getSettingsDrawerToggle();
1714
1749
 
1715
1750
  expect( settingsToggle ).not.toBeInTheDocument();
1716
1751
  } );
@@ -1727,10 +1762,7 @@ describe( 'Addition Settings UI', () => {
1727
1762
 
1728
1763
  const user = userEvent.setup();
1729
1764
 
1730
- const settingsToggle = screen.queryByRole( 'button', {
1731
- name: 'Link Settings',
1732
- ariaControls: 'link-settings-1',
1733
- } );
1765
+ const settingsToggle = getSettingsDrawerToggle();
1734
1766
 
1735
1767
  expect( settingsToggle ).toHaveAttribute( 'aria-expanded', 'false' );
1736
1768
 
@@ -1891,7 +1923,7 @@ describe( 'Post types', () => {
1891
1923
  render( <LinkControl /> );
1892
1924
 
1893
1925
  // Search Input UI.
1894
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1926
+ const searchInput = screen.getByRole( 'combobox', { name: 'Link' } );
1895
1927
 
1896
1928
  // Simulate searching for a term.
1897
1929
  await user.type( searchInput, searchTerm );
@@ -1918,7 +1950,9 @@ describe( 'Post types', () => {
1918
1950
  render( <LinkControl suggestionsQuery={ { type: postType } } /> );
1919
1951
 
1920
1952
  // Search Input UI.
1921
- const searchInput = screen.getByRole( 'combobox', { name: 'URL' } );
1953
+ const searchInput = screen.getByRole( 'combobox', {
1954
+ name: 'Link',
1955
+ } );
1922
1956
 
1923
1957
  // Simulate searching for a term.
1924
1958
  await user.type( searchInput, searchTerm );
@@ -2376,10 +2410,14 @@ describe( 'Controlling link title text', () => {
2376
2410
  } );
2377
2411
  } );
2378
2412
 
2379
- async function toggleSettingsDrawer( user ) {
2380
- const settingsToggle = screen.queryByRole( 'button', {
2381
- name: 'Link Settings',
2413
+ function getSettingsDrawerToggle() {
2414
+ return screen.queryByRole( 'button', {
2415
+ name: 'Advanced',
2382
2416
  } );
2417
+ }
2418
+
2419
+ async function toggleSettingsDrawer( user ) {
2420
+ const settingsToggle = getSettingsDrawerToggle();
2383
2421
 
2384
2422
  await user.click( settingsToggle );
2385
2423
  }
@@ -21,16 +21,15 @@ export const Appender = forwardRef(
21
21
  const { insertedBlock, setInsertedBlock } = useListViewContext();
22
22
 
23
23
  const instanceId = useInstanceId( Appender );
24
- const { hideInserter } = useSelect(
24
+ const hideInserter = useSelect(
25
25
  ( select ) => {
26
26
  const { getTemplateLock, __unstableGetEditorMode } =
27
27
  select( blockEditorStore );
28
28
 
29
- return {
30
- hideInserter:
31
- !! getTemplateLock( clientId ) ||
32
- __unstableGetEditorMode() === 'zoom-out',
33
- };
29
+ return (
30
+ !! getTemplateLock( clientId ) ||
31
+ __unstableGetEditorMode() === 'zoom-out'
32
+ );
34
33
  },
35
34
  [ clientId ]
36
35
  );
@@ -408,8 +408,7 @@ $block-navigation-max-indent: 8;
408
408
 
409
409
  .block-editor-list-view-drop-indicator__line {
410
410
  background: var(--wp-admin-theme-color);
411
- height: 6px;
412
- border: 1px solid $white;
411
+ height: 4px;
413
412
  border-radius: 4px;
414
413
  }
415
414
  }