@wordpress/block-editor 8.0.12-next.33ec3857e2.0 → 8.0.15

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 (399) hide show
  1. package/README.md +0 -4
  2. package/build/components/block-caption/index.native.js +3 -14
  3. package/build/components/block-caption/index.native.js.map +1 -1
  4. package/build/components/block-inspector/index.js +33 -12
  5. package/build/components/block-inspector/index.js.map +1 -1
  6. package/build/components/block-list/block.js +1 -1
  7. package/build/components/block-list/block.js.map +1 -1
  8. package/build/components/block-list/block.native.js +2 -3
  9. package/build/components/block-list/block.native.js.map +1 -1
  10. package/build/components/block-list/use-block-props/index.js +1 -3
  11. package/build/components/block-list/use-block-props/index.js.map +1 -1
  12. package/build/components/block-list/use-in-between-inserter.js +1 -1
  13. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  14. package/build/components/block-list-appender/index.js +11 -3
  15. package/build/components/block-list-appender/index.js.map +1 -1
  16. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +2 -2
  17. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  18. package/build/components/block-mover/button.js +2 -2
  19. package/build/components/block-mover/button.js.map +1 -1
  20. package/build/components/block-mover/index.js +2 -2
  21. package/build/components/block-mover/index.js.map +1 -1
  22. package/build/components/block-mover/index.native.js +2 -2
  23. package/build/components/block-mover/index.native.js.map +1 -1
  24. package/build/components/block-preview/auto.js +2 -10
  25. package/build/components/block-preview/auto.js.map +1 -1
  26. package/build/components/block-settings/container.native.js +1 -2
  27. package/build/components/block-settings/container.native.js.map +1 -1
  28. package/build/components/block-styles/index.js +134 -110
  29. package/build/components/block-styles/index.js.map +1 -1
  30. package/build/components/block-styles/utils.js +0 -39
  31. package/build/components/block-styles/utils.js.map +1 -1
  32. package/build/components/block-switcher/block-styles-menu.js +23 -3
  33. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  34. package/build/components/block-tools/back-compat.js +1 -2
  35. package/build/components/block-tools/back-compat.js.map +1 -1
  36. package/build/components/block-tools/block-selection-button.js +3 -3
  37. package/build/components/block-tools/block-selection-button.js.map +1 -1
  38. package/build/components/block-tools/index.js +9 -0
  39. package/build/components/block-tools/index.js.map +1 -1
  40. package/build/components/block-tools/insertion-point.js +1 -11
  41. package/build/components/block-tools/insertion-point.js.map +1 -1
  42. package/build/components/button-block-appender/index.js +1 -2
  43. package/build/components/button-block-appender/index.js.map +1 -1
  44. package/build/components/colors-gradients/panel-color-gradient-settings.js +10 -51
  45. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  46. package/build/components/default-block-appender/index.js +19 -16
  47. package/build/components/default-block-appender/index.js.map +1 -1
  48. package/build/components/default-style-picker/index.js +3 -18
  49. package/build/components/default-style-picker/index.js.map +1 -1
  50. package/build/components/font-appearance-control/index.js +11 -11
  51. package/build/components/font-appearance-control/index.js.map +1 -1
  52. package/build/components/gradients/use-gradient.js +4 -4
  53. package/build/components/gradients/use-gradient.js.map +1 -1
  54. package/build/components/iframe/index.js +6 -7
  55. package/build/components/iframe/index.js.map +1 -1
  56. package/build/components/index.js +9 -9
  57. package/build/components/index.js.map +1 -1
  58. package/build/components/inner-blocks/default-block-appender.js +4 -2
  59. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  60. package/build/components/inserter/hooks/use-insertion-point.js +2 -2
  61. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  62. package/build/components/inserter/index.js +2 -2
  63. package/build/components/inserter/index.js.map +1 -1
  64. package/build/components/inserter/index.native.js +3 -3
  65. package/build/components/inserter/index.native.js.map +1 -1
  66. package/build/components/inserter/quick-inserter.js +1 -1
  67. package/build/components/inserter/quick-inserter.js.map +1 -1
  68. package/build/components/inserter/tabs.native.js +4 -7
  69. package/build/components/inserter/tabs.native.js.map +1 -1
  70. package/build/components/inspector-controls/block-support-slot-container.js +1 -2
  71. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  72. package/build/components/inspector-controls/block-support-tools-panel.js +50 -22
  73. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  74. package/build/components/inspector-controls/fill.native.js +5 -3
  75. package/build/components/inspector-controls/fill.native.js.map +1 -1
  76. package/build/components/inspector-controls/groups.js +0 -2
  77. package/build/components/inspector-controls/groups.js.map +1 -1
  78. package/build/components/inspector-controls/slot.js +3 -1
  79. package/build/components/inspector-controls/slot.js.map +1 -1
  80. package/build/components/letter-spacing-control/index.js +6 -6
  81. package/build/components/letter-spacing-control/index.js.map +1 -1
  82. package/build/components/list-view/block-select-button.js +3 -23
  83. package/build/components/list-view/block-select-button.js.map +1 -1
  84. package/build/components/list-view/use-list-view-drop-zone.js +1 -1
  85. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  86. package/build/components/media-placeholder/index.js +0 -2
  87. package/build/components/media-placeholder/index.js.map +1 -1
  88. package/build/components/media-replace-flow/index.js +0 -2
  89. package/build/components/media-replace-flow/index.js.map +1 -1
  90. package/build/components/provider/use-block-sync.js +37 -10
  91. package/build/components/provider/use-block-sync.js.map +1 -1
  92. package/build/components/rich-text/file-paste-handler.js +1 -1
  93. package/build/components/rich-text/file-paste-handler.js.map +1 -1
  94. package/build/components/rich-text/use-input-rules.js +1 -3
  95. package/build/components/rich-text/use-input-rules.js.map +1 -1
  96. package/build/components/selection-scroll-into-view/index.js +1 -2
  97. package/build/components/selection-scroll-into-view/index.js.map +1 -1
  98. package/build/components/use-canvas-click-redirect/index.js +66 -0
  99. package/build/components/use-canvas-click-redirect/index.js.map +1 -0
  100. package/build/components/use-on-block-drop/index.js +4 -8
  101. package/build/components/use-on-block-drop/index.js.map +1 -1
  102. package/build/components/use-setting/index.js +7 -0
  103. package/build/components/use-setting/index.js.map +1 -1
  104. package/build/components/writing-flow/use-multi-selection.js +1 -3
  105. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  106. package/build/hooks/border-color.js +5 -63
  107. package/build/hooks/border-color.js.map +1 -1
  108. package/build/hooks/border-radius.js +0 -47
  109. package/build/hooks/border-radius.js.map +1 -1
  110. package/build/hooks/border-style.js +0 -41
  111. package/build/hooks/border-style.js.map +1 -1
  112. package/build/hooks/border-width.js +31 -70
  113. package/build/hooks/border-width.js.map +1 -1
  114. package/build/hooks/border.js +11 -81
  115. package/build/hooks/border.js.map +1 -1
  116. package/build/hooks/color.js +6 -5
  117. package/build/hooks/color.js.map +1 -1
  118. package/build/hooks/layout.js +2 -1
  119. package/build/hooks/layout.js.map +1 -1
  120. package/build/hooks/letter-spacing.js +1 -1
  121. package/build/hooks/letter-spacing.js.map +1 -1
  122. package/build/hooks/style.js +2 -1
  123. package/build/hooks/style.js.map +1 -1
  124. package/build/hooks/typography.js +1 -1
  125. package/build/hooks/typography.js.map +1 -1
  126. package/build/layouts/flex.js +9 -29
  127. package/build/layouts/flex.js.map +1 -1
  128. package/build/layouts/flow.js +10 -6
  129. package/build/layouts/flow.js.map +1 -1
  130. package/build/store/actions.js +5 -4
  131. package/build/store/actions.js.map +1 -1
  132. package/build/store/defaults.js +1 -5
  133. package/build/store/defaults.js.map +1 -1
  134. package/build/store/reducer.js +24 -1
  135. package/build/store/reducer.js.map +1 -1
  136. package/build/store/selectors.js +2 -2
  137. package/build/store/selectors.js.map +1 -1
  138. package/build/utils/get-paste-event-data.js +1 -1
  139. package/build/utils/get-paste-event-data.js.map +1 -1
  140. package/build/utils/parse-css-unit-to-px.js +1 -1
  141. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  142. package/build-module/components/block-caption/index.native.js +3 -13
  143. package/build-module/components/block-caption/index.native.js.map +1 -1
  144. package/build-module/components/block-inspector/index.js +33 -12
  145. package/build-module/components/block-inspector/index.js.map +1 -1
  146. package/build-module/components/block-list/block.js +1 -1
  147. package/build-module/components/block-list/block.js.map +1 -1
  148. package/build-module/components/block-list/block.native.js +2 -3
  149. package/build-module/components/block-list/block.native.js.map +1 -1
  150. package/build-module/components/block-list/use-block-props/index.js +1 -3
  151. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  152. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  153. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  154. package/build-module/components/block-list-appender/index.js +10 -3
  155. package/build-module/components/block-list-appender/index.js.map +1 -1
  156. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +2 -2
  157. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  158. package/build-module/components/block-mover/button.js +2 -2
  159. package/build-module/components/block-mover/button.js.map +1 -1
  160. package/build-module/components/block-mover/index.js +2 -2
  161. package/build-module/components/block-mover/index.js.map +1 -1
  162. package/build-module/components/block-mover/index.native.js +2 -2
  163. package/build-module/components/block-mover/index.native.js.map +1 -1
  164. package/build-module/components/block-preview/auto.js +2 -10
  165. package/build-module/components/block-preview/auto.js.map +1 -1
  166. package/build-module/components/block-settings/container.native.js +1 -2
  167. package/build-module/components/block-settings/container.native.js.map +1 -1
  168. package/build-module/components/block-styles/index.js +133 -112
  169. package/build-module/components/block-styles/index.js.map +1 -1
  170. package/build-module/components/block-styles/utils.js +0 -34
  171. package/build-module/components/block-styles/utils.js.map +1 -1
  172. package/build-module/components/block-switcher/block-styles-menu.js +21 -3
  173. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  174. package/build-module/components/block-tools/back-compat.js +1 -2
  175. package/build-module/components/block-tools/back-compat.js.map +1 -1
  176. package/build-module/components/block-tools/block-selection-button.js +3 -3
  177. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  178. package/build-module/components/block-tools/index.js +9 -0
  179. package/build-module/components/block-tools/index.js.map +1 -1
  180. package/build-module/components/block-tools/insertion-point.js +1 -11
  181. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  182. package/build-module/components/button-block-appender/index.js +1 -2
  183. package/build-module/components/button-block-appender/index.js.map +1 -1
  184. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +13 -54
  185. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  186. package/build-module/components/default-block-appender/index.js +18 -15
  187. package/build-module/components/default-block-appender/index.js.map +1 -1
  188. package/build-module/components/default-style-picker/index.js +3 -17
  189. package/build-module/components/default-style-picker/index.js.map +1 -1
  190. package/build-module/components/font-appearance-control/index.js +12 -12
  191. package/build-module/components/font-appearance-control/index.js.map +1 -1
  192. package/build-module/components/gradients/use-gradient.js +4 -3
  193. package/build-module/components/gradients/use-gradient.js.map +1 -1
  194. package/build-module/components/iframe/index.js +6 -7
  195. package/build-module/components/iframe/index.js.map +1 -1
  196. package/build-module/components/index.js +1 -1
  197. package/build-module/components/index.js.map +1 -1
  198. package/build-module/components/inner-blocks/default-block-appender.js +4 -2
  199. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  200. package/build-module/components/inserter/hooks/use-insertion-point.js +2 -2
  201. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  202. package/build-module/components/inserter/index.js +2 -2
  203. package/build-module/components/inserter/index.js.map +1 -1
  204. package/build-module/components/inserter/index.native.js +4 -4
  205. package/build-module/components/inserter/index.native.js.map +1 -1
  206. package/build-module/components/inserter/quick-inserter.js +1 -1
  207. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  208. package/build-module/components/inserter/tabs.native.js +4 -7
  209. package/build-module/components/inserter/tabs.native.js.map +1 -1
  210. package/build-module/components/inspector-controls/block-support-slot-container.js +1 -2
  211. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  212. package/build-module/components/inspector-controls/block-support-tools-panel.js +50 -22
  213. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  214. package/build-module/components/inspector-controls/fill.native.js +5 -3
  215. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  216. package/build-module/components/inspector-controls/groups.js +0 -2
  217. package/build-module/components/inspector-controls/groups.js.map +1 -1
  218. package/build-module/components/inspector-controls/slot.js +3 -1
  219. package/build-module/components/inspector-controls/slot.js.map +1 -1
  220. package/build-module/components/letter-spacing-control/index.js +6 -6
  221. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  222. package/build-module/components/list-view/block-select-button.js +3 -22
  223. package/build-module/components/list-view/block-select-button.js.map +1 -1
  224. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
  225. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  226. package/build-module/components/media-placeholder/index.js +0 -2
  227. package/build-module/components/media-placeholder/index.js.map +1 -1
  228. package/build-module/components/media-replace-flow/index.js +0 -2
  229. package/build-module/components/media-replace-flow/index.js.map +1 -1
  230. package/build-module/components/provider/use-block-sync.js +41 -14
  231. package/build-module/components/provider/use-block-sync.js.map +1 -1
  232. package/build-module/components/rich-text/file-paste-handler.js +1 -1
  233. package/build-module/components/rich-text/file-paste-handler.js.map +1 -1
  234. package/build-module/components/rich-text/use-input-rules.js +1 -2
  235. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  236. package/build-module/components/selection-scroll-into-view/index.js +1 -2
  237. package/build-module/components/selection-scroll-into-view/index.js.map +1 -1
  238. package/build-module/components/use-canvas-click-redirect/index.js +54 -0
  239. package/build-module/components/use-canvas-click-redirect/index.js.map +1 -0
  240. package/build-module/components/use-on-block-drop/index.js +4 -8
  241. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  242. package/build-module/components/use-setting/index.js +7 -0
  243. package/build-module/components/use-setting/index.js.map +1 -1
  244. package/build-module/components/writing-flow/use-multi-selection.js +4 -3
  245. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  246. package/build-module/hooks/border-color.js +7 -61
  247. package/build-module/hooks/border-color.js.map +1 -1
  248. package/build-module/hooks/border-radius.js +0 -42
  249. package/build-module/hooks/border-radius.js.map +1 -1
  250. package/build-module/hooks/border-style.js +0 -36
  251. package/build-module/hooks/border-style.js.map +1 -1
  252. package/build-module/hooks/border-width.js +32 -66
  253. package/build-module/hooks/border-width.js.map +1 -1
  254. package/build-module/hooks/border.js +12 -80
  255. package/build-module/hooks/border.js.map +1 -1
  256. package/build-module/hooks/color.js +6 -5
  257. package/build-module/hooks/color.js.map +1 -1
  258. package/build-module/hooks/layout.js +2 -1
  259. package/build-module/hooks/layout.js.map +1 -1
  260. package/build-module/hooks/letter-spacing.js +1 -1
  261. package/build-module/hooks/letter-spacing.js.map +1 -1
  262. package/build-module/hooks/style.js +2 -1
  263. package/build-module/hooks/style.js.map +1 -1
  264. package/build-module/hooks/typography.js +1 -1
  265. package/build-module/hooks/typography.js.map +1 -1
  266. package/build-module/layouts/flex.js +9 -29
  267. package/build-module/layouts/flex.js.map +1 -1
  268. package/build-module/layouts/flow.js +10 -6
  269. package/build-module/layouts/flow.js.map +1 -1
  270. package/build-module/store/actions.js +5 -4
  271. package/build-module/store/actions.js.map +1 -1
  272. package/build-module/store/defaults.js +1 -5
  273. package/build-module/store/defaults.js.map +1 -1
  274. package/build-module/store/reducer.js +24 -1
  275. package/build-module/store/reducer.js.map +1 -1
  276. package/build-module/store/selectors.js +2 -2
  277. package/build-module/store/selectors.js.map +1 -1
  278. package/build-module/utils/get-paste-event-data.js +1 -1
  279. package/build-module/utils/get-paste-event-data.js.map +1 -1
  280. package/build-module/utils/parse-css-unit-to-px.js +1 -1
  281. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  282. package/build-style/style-rtl.css +180 -212
  283. package/build-style/style.css +180 -212
  284. package/package.json +27 -27
  285. package/src/components/block-caption/index.native.js +4 -22
  286. package/src/components/block-inspector/index.js +32 -13
  287. package/src/components/block-list/block.js +1 -1
  288. package/src/components/block-list/block.native.js +2 -2
  289. package/src/components/block-list/use-block-props/index.js +1 -3
  290. package/src/components/block-list/use-in-between-inserter.js +1 -1
  291. package/src/components/block-list-appender/index.js +21 -5
  292. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +2 -5
  293. package/src/components/block-mover/button.js +2 -6
  294. package/src/components/block-mover/index.js +2 -5
  295. package/src/components/block-mover/index.native.js +2 -5
  296. package/src/components/block-preview/auto.js +2 -7
  297. package/src/components/block-settings/container.native.js +0 -1
  298. package/src/components/block-styles/index.js +145 -125
  299. package/src/components/block-styles/style.scss +51 -59
  300. package/src/components/block-styles/test/{utils.js → index.js} +1 -60
  301. package/src/components/block-styles/utils.js +0 -39
  302. package/src/components/block-switcher/block-styles-menu.js +38 -3
  303. package/src/components/block-tools/back-compat.js +0 -1
  304. package/src/components/block-tools/block-selection-button.js +3 -9
  305. package/src/components/block-tools/index.js +11 -0
  306. package/src/components/block-tools/insertion-point.js +1 -10
  307. package/src/components/border-style-control/style.scss +1 -0
  308. package/src/components/button-block-appender/index.js +0 -1
  309. package/src/components/colors-gradients/panel-color-gradient-settings.js +19 -75
  310. package/src/components/colors-gradients/style.scss +5 -42
  311. package/src/components/default-block-appender/index.js +24 -17
  312. package/src/components/default-block-appender/style.scss +0 -4
  313. package/src/components/default-block-appender/test/__snapshots__/index.js.snap +24 -12
  314. package/src/components/default-block-appender/test/index.js +14 -4
  315. package/src/components/default-style-picker/index.js +6 -18
  316. package/src/components/font-appearance-control/index.js +12 -12
  317. package/src/components/gradients/use-gradient.js +7 -7
  318. package/src/components/iframe/index.js +6 -13
  319. package/src/components/index.js +1 -1
  320. package/src/components/inner-blocks/README.md +0 -2
  321. package/src/components/inner-blocks/default-block-appender.js +7 -2
  322. package/src/components/inserter/hooks/use-insertion-point.js +2 -9
  323. package/src/components/inserter/index.js +2 -2
  324. package/src/components/inserter/index.native.js +4 -7
  325. package/src/components/inserter/quick-inserter.js +1 -1
  326. package/src/components/inserter/tabs.native.js +4 -5
  327. package/src/components/inspector-controls/block-support-slot-container.js +1 -3
  328. package/src/components/inspector-controls/block-support-tools-panel.js +57 -21
  329. package/src/components/inspector-controls/fill.native.js +3 -4
  330. package/src/components/inspector-controls/groups.js +0 -2
  331. package/src/components/inspector-controls/slot.js +7 -2
  332. package/src/components/letter-spacing-control/index.js +6 -6
  333. package/src/components/link-control/README.md +1 -1
  334. package/src/components/link-control/test/index.js +0 -2
  335. package/src/components/list-view/block-select-button.js +1 -20
  336. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  337. package/src/components/media-placeholder/index.js +0 -2
  338. package/src/components/media-replace-flow/index.js +0 -2
  339. package/src/components/provider/use-block-sync.js +45 -11
  340. package/src/components/rich-text/file-paste-handler.js +1 -3
  341. package/src/components/rich-text/use-input-rules.js +1 -2
  342. package/src/components/selection-scroll-into-view/index.js +0 -1
  343. package/src/components/url-input/README.md +0 -5
  344. package/src/components/use-canvas-click-redirect/index.js +57 -0
  345. package/src/components/use-on-block-drop/index.js +4 -11
  346. package/src/components/use-setting/index.js +9 -0
  347. package/src/components/writing-flow/use-multi-selection.js +9 -12
  348. package/src/hooks/border-color.js +3 -55
  349. package/src/hooks/border-radius.js +0 -32
  350. package/src/hooks/border-style.js +0 -26
  351. package/src/hooks/border-width.js +32 -56
  352. package/src/hooks/border.js +20 -115
  353. package/src/hooks/border.scss +17 -3
  354. package/src/hooks/color.js +13 -14
  355. package/src/hooks/layout.js +1 -0
  356. package/src/hooks/letter-spacing.js +1 -1
  357. package/src/hooks/style.js +2 -1
  358. package/src/hooks/test/style.js +0 -2
  359. package/src/hooks/typography.js +1 -1
  360. package/src/layouts/flex.js +8 -31
  361. package/src/layouts/flow.js +8 -6
  362. package/src/store/actions.js +5 -5
  363. package/src/store/defaults.js +0 -2
  364. package/src/store/reducer.js +23 -1
  365. package/src/store/selectors.js +2 -2
  366. package/src/store/test/reducer.js +35 -0
  367. package/src/store/test/selectors.js +1 -1
  368. package/src/style.scss +3 -4
  369. package/src/utils/get-paste-event-data.js +1 -1
  370. package/src/utils/parse-css-unit-to-px.js +1 -1
  371. package/src/utils/test/parse-css-unit-to-px.js +0 -1
  372. package/tsconfig.tsbuildinfo +1 -1
  373. package/build/components/block-styles/menu-items.js +0 -63
  374. package/build/components/block-styles/menu-items.js.map +0 -1
  375. package/build/components/block-styles/preview-panel.js +0 -45
  376. package/build/components/block-styles/preview-panel.js.map +0 -1
  377. package/build/components/block-styles/use-styles-for-block.js +0 -119
  378. package/build/components/block-styles/use-styles-for-block.js.map +0 -1
  379. package/build/components/rich-text/prevent-event-discovery.js +0 -33
  380. package/build/components/rich-text/prevent-event-discovery.js.map +0 -1
  381. package/build/components/use-display-block-controls/index.native.js +0 -45
  382. package/build/components/use-display-block-controls/index.native.js.map +0 -1
  383. package/build-module/components/block-styles/menu-items.js +0 -50
  384. package/build-module/components/block-styles/menu-items.js.map +0 -1
  385. package/build-module/components/block-styles/preview-panel.js +0 -35
  386. package/build-module/components/block-styles/preview-panel.js.map +0 -1
  387. package/build-module/components/block-styles/use-styles-for-block.js +0 -107
  388. package/build-module/components/block-styles/use-styles-for-block.js.map +0 -1
  389. package/build-module/components/rich-text/prevent-event-discovery.js +0 -25
  390. package/build-module/components/rich-text/prevent-event-discovery.js.map +0 -1
  391. package/build-module/components/use-display-block-controls/index.native.js +0 -34
  392. package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
  393. package/src/components/block-styles/menu-items.js +0 -49
  394. package/src/components/block-styles/preview-panel.js +0 -36
  395. package/src/components/block-styles/use-styles-for-block.js +0 -99
  396. package/src/components/rich-text/prevent-event-discovery.js +0 -23
  397. package/src/components/use-display-block-controls/index.native.js +0 -38
  398. package/src/components/writing-flow/test/use-multi-selection.js +0 -36
  399. package/src/hooks/dimensions.scss +0 -5
@@ -1,12 +1,7 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import {
5
- getActiveStyle,
6
- getDefaultStyle,
7
- getRenderedStyles,
8
- replaceActiveStyle,
9
- } from '../utils';
4
+ import { getActiveStyle, replaceActiveStyle } from '../utils';
10
5
 
11
6
  describe( 'getActiveStyle', () => {
12
7
  it( 'Should return the undefined if no active style', () => {
@@ -79,57 +74,3 @@ describe( 'replaceActiveStyle', () => {
79
74
  );
80
75
  } );
81
76
  } );
82
-
83
- describe( 'getRenderedStyles', () => {
84
- it( 'Should return an empty array if styles is falsy', () => {
85
- expect( getRenderedStyles( null ) ).toEqual( [] );
86
- } );
87
-
88
- it( 'Should return an empty array if styles array is empty', () => {
89
- expect( getRenderedStyles( [] ) ).toEqual( [] );
90
- } );
91
-
92
- it( 'Should return styles collection if there is a default', () => {
93
- const styles = [
94
- { name: 'hazlenut' },
95
- { name: 'cashew', isDefault: true },
96
- ];
97
-
98
- expect( getRenderedStyles( styles ) ).toEqual( styles );
99
- } );
100
-
101
- it( 'Should add a default item to the styles collection if there is no default', () => {
102
- const styles = [ { name: 'pistachio' }, { name: 'peanut' } ];
103
- const defaultStyle = {
104
- name: 'default',
105
- label: 'Default',
106
- isDefault: true,
107
- };
108
-
109
- expect( getRenderedStyles( styles ) ).toEqual( [
110
- defaultStyle,
111
- ...styles,
112
- ] );
113
- } );
114
- } );
115
-
116
- describe( 'getDefaultStyle', () => {
117
- it( 'Should return default style object', () => {
118
- const styles = [
119
- { name: 'trout' },
120
- { name: 'bream', isDefault: true },
121
- ];
122
-
123
- expect( getDefaultStyle( styles ) ).toEqual( styles[ 1 ] );
124
- } );
125
-
126
- it( 'Should return `undefined` if there is no default', () => {
127
- const styles = [ { name: 'snapper' }, { name: 'perch' } ];
128
-
129
- expect( getDefaultStyle( styles ) ).toBeUndefined();
130
- } );
131
-
132
- it( 'Should return `undefined` if `styles` argument is no passed', () => {
133
- expect( getDefaultStyle() ).toBeUndefined();
134
- } );
135
- } );
@@ -6,7 +6,6 @@ import { find } from 'lodash';
6
6
  * WordPress dependencies
7
7
  */
8
8
  import TokenList from '@wordpress/token-list';
9
- import { _x } from '@wordpress/i18n';
10
9
 
11
10
  /**
12
11
  * Returns the active style from the given className.
@@ -52,41 +51,3 @@ export function replaceActiveStyle( className, activeStyle, newStyle ) {
52
51
 
53
52
  return list.value;
54
53
  }
55
-
56
- /**
57
- * Returns a collection of styles that can be represented on the frontend.
58
- * The function checks a style collection for a default style. If none is found, it adds one to
59
- * act as a fallback for when there is no active style applied to a block. The default item also serves
60
- * as a switch on the frontend to deactivate non-default styles.
61
- *
62
- * @param {Array} styles Block style variations.
63
- *
64
- * @return {Array<Object?>} The style collection.
65
- */
66
- export function getRenderedStyles( styles ) {
67
- if ( ! styles || styles.length === 0 ) {
68
- return [];
69
- }
70
-
71
- return getDefaultStyle( styles )
72
- ? styles
73
- : [
74
- {
75
- name: 'default',
76
- label: _x( 'Default', 'block style' ),
77
- isDefault: true,
78
- },
79
- ...styles,
80
- ];
81
- }
82
-
83
- /**
84
- * Returns a style object from a collection of styles where that style object is the default block style.
85
- *
86
- * @param {Array} styles Block style variations.
87
- *
88
- * @return {Object?} The default style object, if found.
89
- */
90
- export function getDefaultStyle( styles ) {
91
- return find( styles, 'isDefault' );
92
- }
@@ -3,21 +3,56 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { MenuGroup } from '@wordpress/components';
6
+ import { useState } from '@wordpress/element';
7
+ import { useSelect } from '@wordpress/data';
8
+ import {
9
+ cloneBlock,
10
+ getBlockFromExample,
11
+ store as blocksStore,
12
+ } from '@wordpress/blocks';
6
13
 
7
14
  /**
8
15
  * Internal dependencies
9
16
  */
10
- import BlockStylesMenuItems from '../block-styles/menu-items';
17
+ import BlockStyles from '../block-styles';
18
+ import PreviewBlockPopover from './preview-block-popover';
11
19
 
12
20
  export default function BlockStylesMenu( { hoveredBlock, onSwitch } ) {
13
- const { clientId } = hoveredBlock;
21
+ const { name, clientId } = hoveredBlock;
22
+ const [ hoveredClassName, setHoveredClassName ] = useState();
23
+ const blockType = useSelect(
24
+ ( select ) => select( blocksStore ).getBlockType( name ),
25
+ [ name ]
26
+ );
14
27
 
15
28
  return (
16
29
  <MenuGroup
17
30
  label={ __( 'Styles' ) }
18
31
  className="block-editor-block-switcher__styles__menugroup"
19
32
  >
20
- <BlockStylesMenuItems clientId={ clientId } onSwitch={ onSwitch } />
33
+ { hoveredClassName && (
34
+ <PreviewBlockPopover
35
+ blocks={
36
+ blockType && blockType.example
37
+ ? getBlockFromExample( blockType.name, {
38
+ attributes: {
39
+ ...blockType.example.attributes,
40
+ className: hoveredClassName,
41
+ },
42
+ innerBlocks: blockType.example.innerBlocks,
43
+ } )
44
+ : cloneBlock( hoveredBlock, {
45
+ className: hoveredClassName,
46
+ } )
47
+ }
48
+ />
49
+ ) }
50
+ <BlockStyles
51
+ clientId={ clientId }
52
+ onSwitch={ onSwitch }
53
+ onHoverClassName={ setHoveredClassName }
54
+ itemRole="menuitem"
55
+ />
21
56
  </MenuGroup>
22
57
  );
23
58
  }
@@ -22,7 +22,6 @@ export default function BlockToolsBackCompat( { children } ) {
22
22
 
23
23
  deprecated( 'wp.components.Popover.Slot name="block-toolbar"', {
24
24
  alternative: 'wp.blockEditor.BlockTools',
25
- since: '5.8',
26
25
  } );
27
26
 
28
27
  return (
@@ -59,7 +59,7 @@ function BlockSelectionButton( { clientId, rootClientId, blockElement } ) {
59
59
  hasBlockMovingClientId,
60
60
  getBlockListSettings,
61
61
  } = select( blockEditorStore );
62
- const index = getBlockIndex( clientId, rootClientId );
62
+ const index = getBlockIndex( clientId );
63
63
  const { name, attributes } = getBlock( clientId );
64
64
  const blockMovingMode = hasBlockMovingClientId();
65
65
  return {
@@ -169,14 +169,8 @@ function BlockSelectionButton( { clientId, rootClientId, blockElement } ) {
169
169
  if ( ( isEnter || isSpace ) && startingBlockClientId ) {
170
170
  const sourceRoot = getBlockRootClientId( startingBlockClientId );
171
171
  const destRoot = getBlockRootClientId( selectedBlockClientId );
172
- const sourceBlockIndex = getBlockIndex(
173
- startingBlockClientId,
174
- sourceRoot
175
- );
176
- let destinationBlockIndex = getBlockIndex(
177
- selectedBlockClientId,
178
- destRoot
179
- );
172
+ const sourceBlockIndex = getBlockIndex( startingBlockClientId );
173
+ let destinationBlockIndex = getBlockIndex( selectedBlockClientId );
180
174
  if (
181
175
  sourceBlockIndex < destinationBlockIndex &&
182
176
  sourceRoot === destRoot
@@ -95,6 +95,17 @@ export default function BlockTools( {
95
95
  } else if (
96
96
  isMatch( 'core/block-editor/delete-multi-selection', event )
97
97
  ) {
98
+ /**
99
+ * Check if the target element is a text area, input or
100
+ * event.defaultPrevented and return early. In all these
101
+ * cases backspace could be handled elsewhere.
102
+ */
103
+ if (
104
+ [ 'INPUT', 'TEXTAREA' ].includes( event.target.nodeName ) ||
105
+ event.defaultPrevented
106
+ ) {
107
+ return;
108
+ }
98
109
  const clientIds = getSelectedBlockClientIds();
99
110
  if ( clientIds.length > 1 ) {
100
111
  event.preventDefault();
@@ -32,7 +32,7 @@ function InsertionPointPopover( {
32
32
  __unstablePopoverSlot,
33
33
  __unstableContentRef,
34
34
  } ) {
35
- const { selectBlock, hideInsertionPoint } = useDispatch( blockEditorStore );
35
+ const { selectBlock } = useDispatch( blockEditorStore );
36
36
  const openRef = useContext( InsertionPointOpenRef );
37
37
  const ref = useRef();
38
38
  const {
@@ -195,14 +195,6 @@ function InsertionPointPopover( {
195
195
  }
196
196
  }
197
197
 
198
- function maybeHideInserterPoint( event ) {
199
- // Only hide the inserter if it's triggered on the wrapper,
200
- // and the inserter is not open.
201
- if ( event.target === ref.current && ! openRef.current ) {
202
- hideInsertionPoint();
203
- }
204
- }
205
-
206
198
  // Only show the in-between inserter between blocks, so when there's a
207
199
  // previous and a next element.
208
200
  const showInsertionPointInserter =
@@ -317,7 +309,6 @@ function InsertionPointPopover( {
317
309
  className={ classnames( className, {
318
310
  'is-with-inserter': showInsertionPointInserter,
319
311
  } ) }
320
- onHoverEnd={ maybeHideInserterPoint }
321
312
  style={ style }
322
313
  >
323
314
  <motion.div
@@ -7,6 +7,7 @@
7
7
 
8
8
  .components-border-style-control__buttons {
9
9
  display: inline-flex;
10
+ margin-bottom: $grid-unit-30;
10
11
 
11
12
  .components-button.has-icon {
12
13
  min-width: 30px;
@@ -90,7 +90,6 @@ function ButtonBlockAppender(
90
90
  export const ButtonBlockerAppender = forwardRef( ( props, ref ) => {
91
91
  deprecated( `wp.blockEditor.ButtonBlockerAppender`, {
92
92
  alternative: 'wp.blockEditor.ButtonBlockAppender',
93
- since: '5.9',
94
93
  } );
95
94
 
96
95
  return ButtonBlockAppender( props, ref );
@@ -7,17 +7,8 @@ import { every, isEmpty } from 'lodash';
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
- import {
11
- __experimentalItemGroup as ItemGroup,
12
- __experimentalItem as Item,
13
- __experimentalHStack as HStack,
14
- __experimentalSpacer as Spacer,
15
- FlexItem,
16
- ColorIndicator,
17
- PanelBody,
18
- Dropdown,
19
- } from '@wordpress/components';
20
- import { sprintf, __, isRTL } from '@wordpress/i18n';
10
+ import { PanelBody, ColorIndicator } from '@wordpress/components';
11
+ import { sprintf, __ } from '@wordpress/i18n';
21
12
 
22
13
  /**
23
14
  * Internal dependencies
@@ -136,13 +127,6 @@ export const PanelColorGradientSettingsInner = ( {
136
127
  </span>
137
128
  );
138
129
 
139
- let dropdownPosition;
140
- let popoverProps;
141
- if ( __experimentalIsRenderedInSidebar ) {
142
- dropdownPosition = isRTL() ? 'bottom right' : 'bottom left';
143
- popoverProps = { __unstableForcePosition: true };
144
- }
145
-
146
130
  return (
147
131
  <PanelBody
148
132
  className={ classnames(
@@ -152,63 +136,23 @@ export const PanelColorGradientSettingsInner = ( {
152
136
  title={ showTitle ? titleElement : undefined }
153
137
  { ...props }
154
138
  >
155
- <ItemGroup
156
- isBordered
157
- isSeparated
158
- className="block-editor-panel-color-gradient-settings__item-group"
159
- >
160
- { settings.map( ( setting, index ) => (
161
- <Dropdown
162
- position={ dropdownPosition }
163
- popoverProps={ popoverProps }
164
- className="block-editor-panel-color-gradient-settings__dropdown"
165
- key={ index }
166
- contentClassName="block-editor-panel-color-gradient-settings__dropdown-content"
167
- renderToggle={ ( { isOpen, onToggle } ) => {
168
- return (
169
- <Item
170
- onClick={ onToggle }
171
- className={ classnames(
172
- 'block-editor-panel-color-gradient-settings__item',
173
- { 'is-open': isOpen }
174
- ) }
175
- >
176
- <HStack justify="flex-start">
177
- <ColorIndicator
178
- className="block-editor-panel-color-gradient-settings__color-indicator"
179
- colorValue={
180
- setting.gradientValue ??
181
- setting.colorValue
182
- }
183
- />
184
- <FlexItem>{ setting.label }</FlexItem>
185
- </HStack>
186
- </Item>
187
- );
188
- } }
189
- renderContent={ () => (
190
- <ColorGradientControl
191
- showTitle={ false }
192
- { ...{
193
- colors,
194
- gradients,
195
- disableCustomColors,
196
- disableCustomGradients,
197
- __experimentalHasMultipleOrigins,
198
- __experimentalIsRenderedInSidebar,
199
- enableAlpha,
200
- ...setting,
201
- } }
202
- />
203
- ) }
204
- />
205
- ) ) }
206
- </ItemGroup>
207
- { !! children && (
208
- <>
209
- <Spacer marginY={ 4 } /> { children }
210
- </>
211
- ) }
139
+ { settings.map( ( setting, index ) => (
140
+ <ColorGradientControl
141
+ showTitle={ showTitle }
142
+ key={ index }
143
+ { ...{
144
+ colors,
145
+ gradients,
146
+ disableCustomColors,
147
+ disableCustomGradients,
148
+ __experimentalHasMultipleOrigins,
149
+ __experimentalIsRenderedInSidebar,
150
+ enableAlpha,
151
+ ...setting,
152
+ } }
153
+ />
154
+ ) ) }
155
+ { children }
212
156
  </PanelBody>
213
157
  );
214
158
  };
@@ -5,14 +5,13 @@
5
5
  }
6
6
 
7
7
  .block-editor-panel-color-gradient-settings {
8
- .block-editor-panel-color-gradient-settings__panel-title {
9
- display: flex;
10
- gap: $grid-unit-15;
8
+ .component-color-indicator {
9
+ vertical-align: text-bottom;
10
+ }
11
11
 
12
+ &__panel-title {
12
13
  .component-color-indicator {
13
- width: $grid-unit-15;
14
- height: $grid-unit-15;
15
- align-self: center;
14
+ display: inline-block;
16
15
  }
17
16
  }
18
17
 
@@ -38,40 +37,4 @@
38
37
  .block-editor-block-inspector & .components-base-control {
39
38
  margin-bottom: inherit;
40
39
  }
41
-
42
- .block-editor-panel-color-gradient-settings__dropdown {
43
- display: block;
44
- }
45
- }
46
-
47
- .block-editor-panel-color-gradient-settings__dropdown-content .components-popover__content {
48
- & > div {
49
- width: $sidebar-width;
50
- }
51
- }
52
-
53
- @include break-medium() {
54
- .block-editor-panel-color-gradient-settings__dropdown-content .components-popover__content {
55
- margin-right: #{ math.div($sidebar-width, 2) + $grid-unit-20 } !important;
56
- margin-top: #{ -($grid-unit-60 + $grid-unit-15) } !important;
57
- }
58
40
  }
59
-
60
- .block-editor-panel-color-gradient-settings__dropdown:last-child > div {
61
- border-bottom-width: 0;
62
- }
63
-
64
- .block-editor-panel-color-gradient-settings__item {
65
- padding-top: $grid-unit-15 !important;
66
- padding-bottom: $grid-unit-15 !important;
67
- .block-editor-panel-color-gradient-settings__color-indicator {
68
- // Show a diagonal line (crossed out) for empty swatches.
69
- background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
70
- }
71
-
72
- &.is-open {
73
- background: $gray-100;
74
- color: var(--wp-admin-theme-color);
75
- }
76
- }
77
-
@@ -8,9 +8,9 @@ import classnames from 'classnames';
8
8
  */
9
9
  import { __ } from '@wordpress/i18n';
10
10
  import { compose } from '@wordpress/compose';
11
+ import { getDefaultBlockName } from '@wordpress/blocks';
11
12
  import { decodeEntities } from '@wordpress/html-entities';
12
13
  import { withSelect, withDispatch } from '@wordpress/data';
13
- import { ENTER, SPACE } from '@wordpress/keycodes';
14
14
 
15
15
  /**
16
16
  * Internal dependencies
@@ -26,12 +26,13 @@ export const ZWNBSP = '\ufeff';
26
26
 
27
27
  export function DefaultBlockAppender( {
28
28
  isLocked,
29
+ isVisible,
29
30
  onAppend,
30
31
  showPrompt,
31
32
  placeholder,
32
33
  rootClientId,
33
34
  } ) {
34
- if ( isLocked ) {
35
+ if ( isLocked || ! isVisible ) {
35
36
  return null;
36
37
  }
37
38
 
@@ -47,23 +48,20 @@ export function DefaultBlockAppender( {
47
48
  >
48
49
  <p
49
50
  tabIndex="0"
51
+ // Only necessary for `useCanvasClickRedirect` to consider it
52
+ // as a target. Ideally it should consider any tabbable target,
53
+ // but the inserter is rendered in place while it should be
54
+ // rendered in a popover, just like it does for an empty
55
+ // paragraph block.
56
+ contentEditable
57
+ suppressContentEditableWarning
50
58
  // We want this element to be styled as a paragraph by themes.
51
59
  // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
52
60
  role="button"
53
- aria-label={ __( 'Add default block' ) }
61
+ aria-label={ __( 'Add block' ) }
54
62
  // A wrapping container for this one already has the wp-block className.
55
63
  className="block-editor-default-block-appender__content"
56
- onKeyDown={ ( event ) => {
57
- if ( ENTER === event.keyCode || SPACE === event.keyCode ) {
58
- onAppend();
59
- }
60
- } }
61
- onClick={ () => onAppend() }
62
- onFocus={ () => {
63
- if ( showPrompt ) {
64
- onAppend();
65
- }
66
- } }
64
+ onFocus={ onAppend }
67
65
  >
68
66
  { showPrompt ? value : ZWNBSP }
69
67
  </p>
@@ -79,14 +77,23 @@ export function DefaultBlockAppender( {
79
77
 
80
78
  export default compose(
81
79
  withSelect( ( select, ownProps ) => {
82
- const { getBlockCount, getSettings, getTemplateLock } = select(
83
- blockEditorStore
84
- );
80
+ const {
81
+ getBlockCount,
82
+ getBlockName,
83
+ isBlockValid,
84
+ getSettings,
85
+ getTemplateLock,
86
+ } = select( blockEditorStore );
85
87
 
86
88
  const isEmpty = ! getBlockCount( ownProps.rootClientId );
89
+ const isLastBlockDefault =
90
+ getBlockName( ownProps.lastBlockClientId ) ===
91
+ getDefaultBlockName();
92
+ const isLastBlockValid = isBlockValid( ownProps.lastBlockClientId );
87
93
  const { bodyPlaceholder } = getSettings();
88
94
 
89
95
  return {
96
+ isVisible: isEmpty || ! isLastBlockDefault || ! isLastBlockValid,
90
97
  showPrompt: isEmpty,
91
98
  isLocked: !! getTemplateLock( ownProps.rootClientId ),
92
99
  placeholder: bodyPlaceholder,
@@ -126,7 +126,3 @@
126
126
  display: flex;
127
127
  }
128
128
  }
129
-
130
- .block-editor-default-block-appender__content {
131
- cursor: text;
132
- }
@@ -6,12 +6,24 @@ exports[`DefaultBlockAppender should append a default block when input focused 1
6
6
  data-root-client-id=""
7
7
  >
8
8
  <p
9
- aria-label="Add default block"
9
+ aria-label="Add block"
10
10
  className="block-editor-default-block-appender__content"
11
- onClick={[Function]}
12
- onFocus={[Function]}
13
- onKeyDown={[Function]}
11
+ contentEditable={true}
12
+ onFocus={
13
+ [MockFunction] {
14
+ "calls": Array [
15
+ Array [],
16
+ ],
17
+ "results": Array [
18
+ Object {
19
+ "type": "return",
20
+ "value": undefined,
21
+ },
22
+ ],
23
+ }
24
+ }
14
25
  role="button"
26
+ suppressContentEditableWarning={true}
15
27
  tabIndex="0"
16
28
  >
17
29
  Type / to choose a block
@@ -30,12 +42,12 @@ exports[`DefaultBlockAppender should match snapshot 1`] = `
30
42
  data-root-client-id=""
31
43
  >
32
44
  <p
33
- aria-label="Add default block"
45
+ aria-label="Add block"
34
46
  className="block-editor-default-block-appender__content"
35
- onClick={[Function]}
36
- onFocus={[Function]}
37
- onKeyDown={[Function]}
47
+ contentEditable={true}
48
+ onFocus={[MockFunction]}
38
49
  role="button"
50
+ suppressContentEditableWarning={true}
39
51
  tabIndex="0"
40
52
  >
41
53
  Type / to choose a block
@@ -54,12 +66,12 @@ exports[`DefaultBlockAppender should optionally show without prompt 1`] = `
54
66
  data-root-client-id=""
55
67
  >
56
68
  <p
57
- aria-label="Add default block"
69
+ aria-label="Add block"
58
70
  className="block-editor-default-block-appender__content"
59
- onClick={[Function]}
60
- onFocus={[Function]}
61
- onKeyDown={[Function]}
71
+ contentEditable={true}
72
+ onFocus={[MockFunction]}
62
73
  role="button"
74
+ suppressContentEditableWarning={true}
63
75
  tabIndex="0"
64
76
  >
65
77
  
@@ -14,10 +14,16 @@ describe( 'DefaultBlockAppender', () => {
14
14
  expect( onAppend ).toHaveBeenCalledWith();
15
15
  };
16
16
 
17
+ it( 'should render nothing if not visible', () => {
18
+ const wrapper = shallow( <DefaultBlockAppender /> );
19
+
20
+ expect( wrapper.type() ).toBe( null );
21
+ } );
22
+
17
23
  it( 'should match snapshot', () => {
18
24
  const onAppend = jest.fn();
19
25
  const wrapper = shallow(
20
- <DefaultBlockAppender onAppend={ onAppend } showPrompt />
26
+ <DefaultBlockAppender isVisible onAppend={ onAppend } showPrompt />
21
27
  );
22
28
 
23
29
  expect( wrapper ).toMatchSnapshot();
@@ -26,10 +32,10 @@ describe( 'DefaultBlockAppender', () => {
26
32
  it( 'should append a default block when input focused', () => {
27
33
  const onAppend = jest.fn();
28
34
  const wrapper = shallow(
29
- <DefaultBlockAppender onAppend={ onAppend } showPrompt />
35
+ <DefaultBlockAppender isVisible onAppend={ onAppend } showPrompt />
30
36
  );
31
37
 
32
- wrapper.find( 'p' ).simulate( 'click' );
38
+ wrapper.find( 'p' ).simulate( 'focus' );
33
39
 
34
40
  expect( wrapper ).toMatchSnapshot();
35
41
 
@@ -39,7 +45,11 @@ describe( 'DefaultBlockAppender', () => {
39
45
  it( 'should optionally show without prompt', () => {
40
46
  const onAppend = jest.fn();
41
47
  const wrapper = shallow(
42
- <DefaultBlockAppender onAppend={ onAppend } showPrompt={ false } />
48
+ <DefaultBlockAppender
49
+ isVisible
50
+ onAppend={ onAppend }
51
+ showPrompt={ false }
52
+ />
43
53
  );
44
54
  const input = wrapper.find( 'p' );
45
55