@wordpress/block-library 6.0.17-next.33ec3857e2.0 → 6.0.17

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 (763) hide show
  1. package/CHANGELOG.md +0 -4
  2. package/build/archives/index.js +0 -1
  3. package/build/archives/index.js.map +1 -1
  4. package/build/audio/index.js +0 -1
  5. package/build/audio/index.js.map +1 -1
  6. package/build/block/index.js +0 -1
  7. package/build/block/index.js.map +1 -1
  8. package/build/button/edit.native.js +1 -1
  9. package/build/button/edit.native.js.map +1 -1
  10. package/build/button/index.js +1 -5
  11. package/build/button/index.js.map +1 -1
  12. package/build/buttons/index.js +0 -1
  13. package/build/buttons/index.js.map +1 -1
  14. package/build/buttons/transforms.js +0 -1
  15. package/build/buttons/transforms.js.map +1 -1
  16. package/build/calendar/index.js +0 -1
  17. package/build/calendar/index.js.map +1 -1
  18. package/build/categories/index.js +0 -1
  19. package/build/categories/index.js.map +1 -1
  20. package/build/code/index.js +1 -6
  21. package/build/code/index.js.map +1 -1
  22. package/build/column/index.js +0 -1
  23. package/build/column/index.js.map +1 -1
  24. package/build/columns/index.js +0 -1
  25. package/build/columns/index.js.map +1 -1
  26. package/build/comment-author-avatar/edit.js +1 -2
  27. package/build/comment-author-avatar/edit.js.map +1 -1
  28. package/build/comment-author-avatar/index.js +2 -7
  29. package/build/comment-author-avatar/index.js.map +1 -1
  30. package/build/comment-author-name/index.js +0 -1
  31. package/build/comment-author-name/index.js.map +1 -1
  32. package/build/comment-content/index.js +0 -1
  33. package/build/comment-content/index.js.map +1 -1
  34. package/build/comment-date/index.js +0 -1
  35. package/build/comment-date/index.js.map +1 -1
  36. package/build/comment-edit-link/index.js +1 -2
  37. package/build/comment-edit-link/index.js.map +1 -1
  38. package/build/comment-reply-link/index.js +0 -1
  39. package/build/comment-reply-link/index.js.map +1 -1
  40. package/build/comment-template/edit.js +23 -98
  41. package/build/comment-template/edit.js.map +1 -1
  42. package/build/comment-template/index.js +2 -4
  43. package/build/comment-template/index.js.map +1 -1
  44. package/build/comments-query-loop/edit.js +2 -2
  45. package/build/comments-query-loop/edit.js.map +1 -1
  46. package/build/comments-query-loop/index.js +7 -4
  47. package/build/comments-query-loop/index.js.map +1 -1
  48. package/build/comments-query-loop/toolbar.js +3 -3
  49. package/build/comments-query-loop/toolbar.js.map +1 -1
  50. package/build/cover/edit.js +1 -2
  51. package/build/cover/edit.js.map +1 -1
  52. package/build/cover/index.js +0 -1
  53. package/build/cover/index.js.map +1 -1
  54. package/build/embed/deprecated.js +0 -1
  55. package/build/embed/deprecated.js.map +1 -1
  56. package/build/embed/edit.native.js +20 -23
  57. package/build/embed/edit.native.js.map +1 -1
  58. package/build/embed/embed-bottom-sheet.native.js +85 -0
  59. package/build/embed/embed-bottom-sheet.native.js.map +1 -0
  60. package/build/embed/embed-placeholder.native.js +2 -9
  61. package/build/embed/embed-placeholder.native.js.map +1 -1
  62. package/build/embed/index.js +0 -1
  63. package/build/embed/index.js.map +1 -1
  64. package/build/embed/transforms.js +0 -1
  65. package/build/embed/transforms.js.map +1 -1
  66. package/build/embed/util.js +0 -1
  67. package/build/embed/util.js.map +1 -1
  68. package/build/file/index.js +0 -1
  69. package/build/file/index.js.map +1 -1
  70. package/build/freeform/index.js +0 -1
  71. package/build/freeform/index.js.map +1 -1
  72. package/build/gallery/edit.js +1 -5
  73. package/build/gallery/edit.js.map +1 -1
  74. package/build/gallery/index.js +0 -1
  75. package/build/gallery/index.js.map +1 -1
  76. package/build/group/edit.native.js +1 -1
  77. package/build/group/edit.native.js.map +1 -1
  78. package/build/group/index.js +4 -9
  79. package/build/group/index.js.map +1 -1
  80. package/build/heading/index.js +0 -1
  81. package/build/heading/index.js.map +1 -1
  82. package/build/heading/transforms.js +0 -1
  83. package/build/heading/transforms.js.map +1 -1
  84. package/build/home-link/index.js +0 -1
  85. package/build/home-link/index.js.map +1 -1
  86. package/build/html/index.js +0 -1
  87. package/build/html/index.js.map +1 -1
  88. package/build/image/edit.js +5 -56
  89. package/build/image/edit.js.map +1 -1
  90. package/build/image/edit.native.js +1 -1
  91. package/build/image/edit.native.js.map +1 -1
  92. package/build/image/image.js +4 -15
  93. package/build/image/image.js.map +1 -1
  94. package/build/image/index.js +1 -5
  95. package/build/image/index.js.map +1 -1
  96. package/build/index.js +1 -5
  97. package/build/index.js.map +1 -1
  98. package/build/latest-comments/index.js +0 -1
  99. package/build/latest-comments/index.js.map +1 -1
  100. package/build/latest-posts/deprecated.js +0 -1
  101. package/build/latest-posts/deprecated.js.map +1 -1
  102. package/build/latest-posts/index.js +0 -1
  103. package/build/latest-posts/index.js.map +1 -1
  104. package/build/list/index.js +0 -1
  105. package/build/list/index.js.map +1 -1
  106. package/build/loginout/index.js +0 -1
  107. package/build/loginout/index.js.map +1 -1
  108. package/build/media-text/index.js +0 -1
  109. package/build/media-text/index.js.map +1 -1
  110. package/build/missing/index.js +0 -1
  111. package/build/missing/index.js.map +1 -1
  112. package/build/more/index.js +0 -1
  113. package/build/more/index.js.map +1 -1
  114. package/build/navigation/deprecated.js +1 -3
  115. package/build/navigation/deprecated.js.map +1 -1
  116. package/build/navigation/edit/index.js +106 -59
  117. package/build/navigation/edit/index.js.map +1 -1
  118. package/build/navigation/edit/navigation-menu-selector.js +3 -2
  119. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  120. package/build/navigation/edit/placeholder/index.js +15 -7
  121. package/build/navigation/edit/placeholder/index.js.map +1 -1
  122. package/build/navigation/edit/responsive-wrapper.js +9 -7
  123. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  124. package/build/navigation/edit/unsaved-inner-blocks.js +3 -11
  125. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  126. package/build/navigation/edit/use-navigation-notice.js +54 -0
  127. package/build/navigation/edit/use-navigation-notice.js.map +1 -0
  128. package/build/navigation/index.js +1 -3
  129. package/build/navigation/index.js.map +1 -1
  130. package/build/navigation/menu-items-to-blocks.js +1 -4
  131. package/build/navigation/menu-items-to-blocks.js.map +1 -1
  132. package/build/navigation/use-navigation-menu.js +9 -2
  133. package/build/navigation/use-navigation-menu.js.map +1 -1
  134. package/build/navigation/view.js +12 -7
  135. package/build/navigation/view.js.map +1 -1
  136. package/build/navigation-area/edit.js +1 -2
  137. package/build/navigation-area/edit.js.map +1 -1
  138. package/build/navigation-area/index.js +1 -2
  139. package/build/navigation-area/index.js.map +1 -1
  140. package/build/navigation-link/edit.js +0 -7
  141. package/build/navigation-link/edit.js.map +1 -1
  142. package/build/navigation-link/index.js +0 -1
  143. package/build/navigation-link/index.js.map +1 -1
  144. package/build/navigation-submenu/edit.js +0 -1
  145. package/build/navigation-submenu/edit.js.map +1 -1
  146. package/build/navigation-submenu/index.js +0 -1
  147. package/build/navigation-submenu/index.js.map +1 -1
  148. package/build/nextpage/index.js +0 -1
  149. package/build/nextpage/index.js.map +1 -1
  150. package/build/page-list/index.js +1 -6
  151. package/build/page-list/index.js.map +1 -1
  152. package/build/paragraph/edit.js +2 -12
  153. package/build/paragraph/edit.js.map +1 -1
  154. package/build/paragraph/index.js +0 -1
  155. package/build/paragraph/index.js.map +1 -1
  156. package/build/paragraph/transforms.js +0 -1
  157. package/build/paragraph/transforms.js.map +1 -1
  158. package/build/pattern/index.js +0 -1
  159. package/build/pattern/index.js.map +1 -1
  160. package/build/post-author/index.js +0 -1
  161. package/build/post-author/index.js.map +1 -1
  162. package/build/post-comment/index.js +0 -1
  163. package/build/post-comment/index.js.map +1 -1
  164. package/build/post-comments/index.js +0 -1
  165. package/build/post-comments/index.js.map +1 -1
  166. package/build/post-comments-count/index.js +0 -1
  167. package/build/post-comments-count/index.js.map +1 -1
  168. package/build/post-comments-form/index.js +0 -1
  169. package/build/post-comments-form/index.js.map +1 -1
  170. package/build/post-comments-link/index.js +0 -1
  171. package/build/post-comments-link/index.js.map +1 -1
  172. package/build/post-content/index.js +0 -1
  173. package/build/post-content/index.js.map +1 -1
  174. package/build/post-date/index.js +0 -1
  175. package/build/post-date/index.js.map +1 -1
  176. package/build/post-excerpt/index.js +0 -1
  177. package/build/post-excerpt/index.js.map +1 -1
  178. package/build/post-featured-image/dimension-controls.js +30 -50
  179. package/build/post-featured-image/dimension-controls.js.map +1 -1
  180. package/build/post-featured-image/edit.js +3 -7
  181. package/build/post-featured-image/edit.js.map +1 -1
  182. package/build/post-featured-image/index.js +0 -1
  183. package/build/post-featured-image/index.js.map +1 -1
  184. package/build/post-navigation-link/index.js +0 -1
  185. package/build/post-navigation-link/index.js.map +1 -1
  186. package/build/post-template/index.js +0 -1
  187. package/build/post-template/index.js.map +1 -1
  188. package/build/post-terms/index.js +0 -1
  189. package/build/post-terms/index.js.map +1 -1
  190. package/build/post-title/index.js +0 -1
  191. package/build/post-title/index.js.map +1 -1
  192. package/build/preformatted/edit.native.js +1 -2
  193. package/build/preformatted/edit.native.js.map +1 -1
  194. package/build/preformatted/index.js +0 -1
  195. package/build/preformatted/index.js.map +1 -1
  196. package/build/pullquote/index.js +1 -8
  197. package/build/pullquote/index.js.map +1 -1
  198. package/build/query/index.js +0 -1
  199. package/build/query/index.js.map +1 -1
  200. package/build/query-pagination/index.js +0 -1
  201. package/build/query-pagination/index.js.map +1 -1
  202. package/build/query-pagination-next/index.js +0 -1
  203. package/build/query-pagination-next/index.js.map +1 -1
  204. package/build/query-pagination-numbers/index.js +0 -1
  205. package/build/query-pagination-numbers/index.js.map +1 -1
  206. package/build/query-pagination-previous/index.js +0 -1
  207. package/build/query-pagination-previous/index.js.map +1 -1
  208. package/build/query-title/index.js +0 -1
  209. package/build/query-title/index.js.map +1 -1
  210. package/build/quote/index.js +0 -1
  211. package/build/quote/index.js.map +1 -1
  212. package/build/rss/index.js +0 -1
  213. package/build/rss/index.js.map +1 -1
  214. package/build/search/edit.js +3 -5
  215. package/build/search/edit.js.map +1 -1
  216. package/build/search/index.js +1 -8
  217. package/build/search/index.js.map +1 -1
  218. package/build/separator/index.js +0 -1
  219. package/build/separator/index.js.map +1 -1
  220. package/build/shortcode/index.js +0 -1
  221. package/build/shortcode/index.js.map +1 -1
  222. package/build/site-logo/edit.js +9 -6
  223. package/build/site-logo/edit.js.map +1 -1
  224. package/build/site-logo/index.js +0 -4
  225. package/build/site-logo/index.js.map +1 -1
  226. package/build/site-tagline/index.js +1 -2
  227. package/build/site-tagline/index.js.map +1 -1
  228. package/build/site-title/index.js +0 -1
  229. package/build/site-title/index.js.map +1 -1
  230. package/build/social-link/index.js +1 -2
  231. package/build/social-link/index.js.map +1 -1
  232. package/build/social-links/index.js +1 -2
  233. package/build/social-links/index.js.map +1 -1
  234. package/build/spacer/index.js +0 -1
  235. package/build/spacer/index.js.map +1 -1
  236. package/build/table/index.js +1 -7
  237. package/build/table/index.js.map +1 -1
  238. package/build/table-of-contents/index.js +0 -1
  239. package/build/table-of-contents/index.js.map +1 -1
  240. package/build/tag-cloud/index.js +0 -1
  241. package/build/tag-cloud/index.js.map +1 -1
  242. package/build/template-part/index.js +9 -26
  243. package/build/template-part/index.js.map +1 -1
  244. package/build/term-description/index.js +0 -1
  245. package/build/term-description/index.js.map +1 -1
  246. package/build/text-columns/index.js +0 -1
  247. package/build/text-columns/index.js.map +1 -1
  248. package/build/verse/index.js +0 -1
  249. package/build/verse/index.js.map +1 -1
  250. package/build/video/index.js +0 -1
  251. package/build/video/index.js.map +1 -1
  252. package/build-module/archives/index.js +0 -1
  253. package/build-module/archives/index.js.map +1 -1
  254. package/build-module/audio/index.js +0 -1
  255. package/build-module/audio/index.js.map +1 -1
  256. package/build-module/block/index.js +0 -1
  257. package/build-module/block/index.js.map +1 -1
  258. package/build-module/button/edit.native.js +1 -1
  259. package/build-module/button/edit.native.js.map +1 -1
  260. package/build-module/button/index.js +1 -5
  261. package/build-module/button/index.js.map +1 -1
  262. package/build-module/buttons/index.js +0 -1
  263. package/build-module/buttons/index.js.map +1 -1
  264. package/build-module/buttons/transforms.js +0 -1
  265. package/build-module/buttons/transforms.js.map +1 -1
  266. package/build-module/calendar/index.js +0 -1
  267. package/build-module/calendar/index.js.map +1 -1
  268. package/build-module/categories/index.js +0 -1
  269. package/build-module/categories/index.js.map +1 -1
  270. package/build-module/code/index.js +1 -6
  271. package/build-module/code/index.js.map +1 -1
  272. package/build-module/column/index.js +0 -1
  273. package/build-module/column/index.js.map +1 -1
  274. package/build-module/columns/index.js +0 -1
  275. package/build-module/columns/index.js.map +1 -1
  276. package/build-module/comment-author-avatar/edit.js +2 -3
  277. package/build-module/comment-author-avatar/edit.js.map +1 -1
  278. package/build-module/comment-author-avatar/index.js +2 -7
  279. package/build-module/comment-author-avatar/index.js.map +1 -1
  280. package/build-module/comment-author-name/index.js +0 -1
  281. package/build-module/comment-author-name/index.js.map +1 -1
  282. package/build-module/comment-content/index.js +0 -1
  283. package/build-module/comment-content/index.js.map +1 -1
  284. package/build-module/comment-date/index.js +0 -1
  285. package/build-module/comment-date/index.js.map +1 -1
  286. package/build-module/comment-edit-link/index.js +1 -2
  287. package/build-module/comment-edit-link/index.js.map +1 -1
  288. package/build-module/comment-reply-link/index.js +0 -1
  289. package/build-module/comment-reply-link/index.js.map +1 -1
  290. package/build-module/comment-template/edit.js +23 -97
  291. package/build-module/comment-template/edit.js.map +1 -1
  292. package/build-module/comment-template/index.js +2 -4
  293. package/build-module/comment-template/index.js.map +1 -1
  294. package/build-module/comments-query-loop/edit.js +2 -2
  295. package/build-module/comments-query-loop/edit.js.map +1 -1
  296. package/build-module/comments-query-loop/index.js +7 -4
  297. package/build-module/comments-query-loop/index.js.map +1 -1
  298. package/build-module/comments-query-loop/toolbar.js +3 -3
  299. package/build-module/comments-query-loop/toolbar.js.map +1 -1
  300. package/build-module/cover/edit.js +1 -2
  301. package/build-module/cover/edit.js.map +1 -1
  302. package/build-module/cover/index.js +0 -1
  303. package/build-module/cover/index.js.map +1 -1
  304. package/build-module/embed/deprecated.js +0 -1
  305. package/build-module/embed/deprecated.js.map +1 -1
  306. package/build-module/embed/edit.native.js +21 -24
  307. package/build-module/embed/edit.native.js.map +1 -1
  308. package/build-module/embed/embed-bottom-sheet.native.js +74 -0
  309. package/build-module/embed/embed-bottom-sheet.native.js.map +1 -0
  310. package/build-module/embed/embed-placeholder.native.js +2 -9
  311. package/build-module/embed/embed-placeholder.native.js.map +1 -1
  312. package/build-module/embed/index.js +0 -1
  313. package/build-module/embed/index.js.map +1 -1
  314. package/build-module/embed/transforms.js +0 -1
  315. package/build-module/embed/transforms.js.map +1 -1
  316. package/build-module/embed/util.js +0 -1
  317. package/build-module/embed/util.js.map +1 -1
  318. package/build-module/file/index.js +0 -1
  319. package/build-module/file/index.js.map +1 -1
  320. package/build-module/freeform/index.js +0 -1
  321. package/build-module/freeform/index.js.map +1 -1
  322. package/build-module/gallery/edit.js +1 -5
  323. package/build-module/gallery/edit.js.map +1 -1
  324. package/build-module/gallery/index.js +0 -1
  325. package/build-module/gallery/index.js.map +1 -1
  326. package/build-module/group/edit.native.js +1 -1
  327. package/build-module/group/edit.native.js.map +1 -1
  328. package/build-module/group/index.js +4 -9
  329. package/build-module/group/index.js.map +1 -1
  330. package/build-module/heading/index.js +0 -1
  331. package/build-module/heading/index.js.map +1 -1
  332. package/build-module/heading/transforms.js +0 -1
  333. package/build-module/heading/transforms.js.map +1 -1
  334. package/build-module/home-link/index.js +0 -1
  335. package/build-module/home-link/index.js.map +1 -1
  336. package/build-module/html/index.js +0 -1
  337. package/build-module/html/index.js.map +1 -1
  338. package/build-module/image/edit.js +4 -52
  339. package/build-module/image/edit.js.map +1 -1
  340. package/build-module/image/edit.native.js +1 -1
  341. package/build-module/image/edit.native.js.map +1 -1
  342. package/build-module/image/image.js +5 -16
  343. package/build-module/image/image.js.map +1 -1
  344. package/build-module/image/index.js +1 -5
  345. package/build-module/image/index.js.map +1 -1
  346. package/build-module/index.js +1 -3
  347. package/build-module/index.js.map +1 -1
  348. package/build-module/latest-comments/index.js +0 -1
  349. package/build-module/latest-comments/index.js.map +1 -1
  350. package/build-module/latest-posts/deprecated.js +0 -1
  351. package/build-module/latest-posts/deprecated.js.map +1 -1
  352. package/build-module/latest-posts/index.js +0 -1
  353. package/build-module/latest-posts/index.js.map +1 -1
  354. package/build-module/list/index.js +0 -1
  355. package/build-module/list/index.js.map +1 -1
  356. package/build-module/loginout/index.js +0 -1
  357. package/build-module/loginout/index.js.map +1 -1
  358. package/build-module/media-text/index.js +0 -1
  359. package/build-module/media-text/index.js.map +1 -1
  360. package/build-module/missing/index.js +0 -1
  361. package/build-module/missing/index.js.map +1 -1
  362. package/build-module/more/index.js +0 -1
  363. package/build-module/more/index.js.map +1 -1
  364. package/build-module/navigation/deprecated.js +1 -3
  365. package/build-module/navigation/deprecated.js.map +1 -1
  366. package/build-module/navigation/edit/index.js +104 -59
  367. package/build-module/navigation/edit/index.js.map +1 -1
  368. package/build-module/navigation/edit/navigation-menu-selector.js +3 -2
  369. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  370. package/build-module/navigation/edit/placeholder/index.js +15 -7
  371. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  372. package/build-module/navigation/edit/responsive-wrapper.js +9 -7
  373. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  374. package/build-module/navigation/edit/unsaved-inner-blocks.js +4 -13
  375. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  376. package/build-module/navigation/edit/use-navigation-notice.js +44 -0
  377. package/build-module/navigation/edit/use-navigation-notice.js.map +1 -0
  378. package/build-module/navigation/index.js +1 -3
  379. package/build-module/navigation/index.js.map +1 -1
  380. package/build-module/navigation/menu-items-to-blocks.js +1 -4
  381. package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
  382. package/build-module/navigation/use-navigation-menu.js +9 -2
  383. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  384. package/build-module/navigation/view.js +12 -7
  385. package/build-module/navigation/view.js.map +1 -1
  386. package/build-module/navigation-area/edit.js +1 -2
  387. package/build-module/navigation-area/edit.js.map +1 -1
  388. package/build-module/navigation-area/index.js +1 -2
  389. package/build-module/navigation-area/index.js.map +1 -1
  390. package/build-module/navigation-link/edit.js +0 -7
  391. package/build-module/navigation-link/edit.js.map +1 -1
  392. package/build-module/navigation-link/index.js +0 -1
  393. package/build-module/navigation-link/index.js.map +1 -1
  394. package/build-module/navigation-submenu/edit.js +0 -1
  395. package/build-module/navigation-submenu/edit.js.map +1 -1
  396. package/build-module/navigation-submenu/index.js +0 -1
  397. package/build-module/navigation-submenu/index.js.map +1 -1
  398. package/build-module/nextpage/index.js +0 -1
  399. package/build-module/nextpage/index.js.map +1 -1
  400. package/build-module/page-list/index.js +1 -6
  401. package/build-module/page-list/index.js.map +1 -1
  402. package/build-module/paragraph/edit.js +3 -13
  403. package/build-module/paragraph/edit.js.map +1 -1
  404. package/build-module/paragraph/index.js +0 -1
  405. package/build-module/paragraph/index.js.map +1 -1
  406. package/build-module/paragraph/transforms.js +0 -1
  407. package/build-module/paragraph/transforms.js.map +1 -1
  408. package/build-module/pattern/index.js +0 -1
  409. package/build-module/pattern/index.js.map +1 -1
  410. package/build-module/post-author/index.js +0 -1
  411. package/build-module/post-author/index.js.map +1 -1
  412. package/build-module/post-comment/index.js +0 -1
  413. package/build-module/post-comment/index.js.map +1 -1
  414. package/build-module/post-comments/index.js +0 -1
  415. package/build-module/post-comments/index.js.map +1 -1
  416. package/build-module/post-comments-count/index.js +0 -1
  417. package/build-module/post-comments-count/index.js.map +1 -1
  418. package/build-module/post-comments-form/index.js +0 -1
  419. package/build-module/post-comments-form/index.js.map +1 -1
  420. package/build-module/post-comments-link/index.js +0 -1
  421. package/build-module/post-comments-link/index.js.map +1 -1
  422. package/build-module/post-content/index.js +0 -1
  423. package/build-module/post-content/index.js.map +1 -1
  424. package/build-module/post-date/index.js +0 -1
  425. package/build-module/post-date/index.js.map +1 -1
  426. package/build-module/post-excerpt/index.js +0 -1
  427. package/build-module/post-excerpt/index.js.map +1 -1
  428. package/build-module/post-featured-image/dimension-controls.js +29 -52
  429. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  430. package/build-module/post-featured-image/edit.js +4 -8
  431. package/build-module/post-featured-image/edit.js.map +1 -1
  432. package/build-module/post-featured-image/index.js +0 -1
  433. package/build-module/post-featured-image/index.js.map +1 -1
  434. package/build-module/post-navigation-link/index.js +0 -1
  435. package/build-module/post-navigation-link/index.js.map +1 -1
  436. package/build-module/post-template/index.js +0 -1
  437. package/build-module/post-template/index.js.map +1 -1
  438. package/build-module/post-terms/index.js +0 -1
  439. package/build-module/post-terms/index.js.map +1 -1
  440. package/build-module/post-title/index.js +0 -1
  441. package/build-module/post-title/index.js.map +1 -1
  442. package/build-module/preformatted/edit.native.js +1 -2
  443. package/build-module/preformatted/edit.native.js.map +1 -1
  444. package/build-module/preformatted/index.js +0 -1
  445. package/build-module/preformatted/index.js.map +1 -1
  446. package/build-module/pullquote/index.js +1 -8
  447. package/build-module/pullquote/index.js.map +1 -1
  448. package/build-module/query/index.js +0 -1
  449. package/build-module/query/index.js.map +1 -1
  450. package/build-module/query-pagination/index.js +0 -1
  451. package/build-module/query-pagination/index.js.map +1 -1
  452. package/build-module/query-pagination-next/index.js +0 -1
  453. package/build-module/query-pagination-next/index.js.map +1 -1
  454. package/build-module/query-pagination-numbers/index.js +0 -1
  455. package/build-module/query-pagination-numbers/index.js.map +1 -1
  456. package/build-module/query-pagination-previous/index.js +0 -1
  457. package/build-module/query-pagination-previous/index.js.map +1 -1
  458. package/build-module/query-title/index.js +0 -1
  459. package/build-module/query-title/index.js.map +1 -1
  460. package/build-module/quote/index.js +0 -1
  461. package/build-module/quote/index.js.map +1 -1
  462. package/build-module/rss/index.js +0 -1
  463. package/build-module/rss/index.js.map +1 -1
  464. package/build-module/search/edit.js +3 -5
  465. package/build-module/search/edit.js.map +1 -1
  466. package/build-module/search/index.js +1 -8
  467. package/build-module/search/index.js.map +1 -1
  468. package/build-module/separator/index.js +0 -1
  469. package/build-module/separator/index.js.map +1 -1
  470. package/build-module/shortcode/index.js +0 -1
  471. package/build-module/shortcode/index.js.map +1 -1
  472. package/build-module/site-logo/edit.js +9 -6
  473. package/build-module/site-logo/edit.js.map +1 -1
  474. package/build-module/site-logo/index.js +0 -4
  475. package/build-module/site-logo/index.js.map +1 -1
  476. package/build-module/site-tagline/index.js +1 -2
  477. package/build-module/site-tagline/index.js.map +1 -1
  478. package/build-module/site-title/index.js +0 -1
  479. package/build-module/site-title/index.js.map +1 -1
  480. package/build-module/social-link/index.js +1 -2
  481. package/build-module/social-link/index.js.map +1 -1
  482. package/build-module/social-links/index.js +1 -2
  483. package/build-module/social-links/index.js.map +1 -1
  484. package/build-module/spacer/index.js +0 -1
  485. package/build-module/spacer/index.js.map +1 -1
  486. package/build-module/table/index.js +1 -7
  487. package/build-module/table/index.js.map +1 -1
  488. package/build-module/table-of-contents/index.js +0 -1
  489. package/build-module/table-of-contents/index.js.map +1 -1
  490. package/build-module/tag-cloud/index.js +0 -1
  491. package/build-module/tag-cloud/index.js.map +1 -1
  492. package/build-module/template-part/index.js +9 -26
  493. package/build-module/template-part/index.js.map +1 -1
  494. package/build-module/term-description/index.js +0 -1
  495. package/build-module/term-description/index.js.map +1 -1
  496. package/build-module/text-columns/index.js +0 -1
  497. package/build-module/text-columns/index.js.map +1 -1
  498. package/build-module/verse/index.js +0 -1
  499. package/build-module/verse/index.js.map +1 -1
  500. package/build-module/video/index.js +0 -1
  501. package/build-module/video/index.js.map +1 -1
  502. package/build-style/columns/style-rtl.css +3 -4
  503. package/build-style/columns/style.css +3 -4
  504. package/build-style/common-rtl.css +0 -19
  505. package/build-style/common.css +0 -19
  506. package/build-style/cover/style-rtl.css +0 -4
  507. package/build-style/cover/style.css +0 -4
  508. package/build-style/editor-rtl.css +26 -46
  509. package/build-style/editor.css +26 -49
  510. package/build-style/gallery/editor-rtl.css +12 -0
  511. package/build-style/gallery/editor.css +12 -0
  512. package/build-style/gallery/style-rtl.css +0 -3
  513. package/build-style/gallery/style.css +0 -3
  514. package/build-style/group/theme-rtl.css +1 -1
  515. package/build-style/group/theme.css +1 -1
  516. package/build-style/{comments-pagination → home-link}/style-rtl.css +21 -21
  517. package/build-style/{comments-pagination/editor.css → home-link/style.css} +22 -20
  518. package/build-style/navigation/editor-rtl.css +2 -0
  519. package/build-style/navigation/editor.css +2 -0
  520. package/build-style/navigation/style-rtl.css +44 -18
  521. package/build-style/navigation/style.css +44 -18
  522. package/build-style/post-comments/style-rtl.css +0 -1
  523. package/build-style/post-comments/style.css +0 -1
  524. package/build-style/post-featured-image/editor-rtl.css +7 -0
  525. package/build-style/post-featured-image/editor.css +7 -0
  526. package/build-style/post-featured-image/style-rtl.css +1 -1
  527. package/build-style/post-featured-image/style.css +1 -1
  528. package/build-style/post-title/style-rtl.css +0 -3
  529. package/build-style/post-title/style.css +0 -3
  530. package/build-style/pullquote/style-rtl.css +0 -1
  531. package/build-style/pullquote/style.css +0 -1
  532. package/build-style/query-pagination/editor-rtl.css +4 -0
  533. package/build-style/query-pagination/editor.css +4 -0
  534. package/build-style/query-pagination/style-rtl.css +2 -6
  535. package/build-style/query-pagination/style.css +2 -6
  536. package/build-style/site-logo/editor-rtl.css +1 -11
  537. package/build-style/site-logo/editor.css +1 -11
  538. package/build-style/site-logo/style-rtl.css +3 -1
  539. package/build-style/site-logo/style.css +3 -1
  540. package/build-style/style-rtl.css +98 -123
  541. package/build-style/style.css +98 -125
  542. package/build-style/table/style-rtl.css +0 -1
  543. package/build-style/table/style.css +0 -1
  544. package/build-style/theme-rtl.css +1 -1
  545. package/build-style/theme.css +1 -1
  546. package/package.json +31 -31
  547. package/src/archives/block.json +0 -1
  548. package/src/audio/block.json +0 -1
  549. package/src/block/block.json +0 -1
  550. package/src/button/block.json +1 -5
  551. package/src/button/edit.native.js +1 -1
  552. package/src/buttons/block.json +1 -2
  553. package/src/calendar/block.json +0 -1
  554. package/src/calendar/index.php +39 -35
  555. package/src/categories/block.json +0 -1
  556. package/src/code/block.json +1 -6
  557. package/src/column/block.json +0 -1
  558. package/src/columns/block.json +0 -1
  559. package/src/columns/style.scss +5 -8
  560. package/src/comment-author-avatar/block.json +2 -7
  561. package/src/comment-author-avatar/edit.js +2 -7
  562. package/src/comment-author-avatar/index.php +6 -25
  563. package/src/comment-author-name/block.json +0 -1
  564. package/src/comment-content/block.json +0 -1
  565. package/src/comment-date/block.json +0 -1
  566. package/src/comment-edit-link/block.json +0 -1
  567. package/src/comment-edit-link/index.js +1 -1
  568. package/src/comment-reply-link/block.json +0 -1
  569. package/src/comment-template/block.json +2 -4
  570. package/src/comment-template/edit.js +37 -111
  571. package/src/comment-template/index.php +19 -46
  572. package/src/comments-query-loop/block.json +7 -4
  573. package/src/comments-query-loop/edit.js +5 -2
  574. package/src/comments-query-loop/toolbar.js +3 -3
  575. package/src/common.scss +0 -19
  576. package/src/cover/block.json +0 -1
  577. package/src/cover/edit.js +0 -1
  578. package/src/cover/style.scss +0 -4
  579. package/src/editor.scss +0 -2
  580. package/src/embed/block.json +0 -1
  581. package/src/embed/edit.native.js +18 -23
  582. package/src/embed/embed-bottom-sheet.native.js +78 -0
  583. package/src/embed/embed-placeholder.native.js +0 -8
  584. package/src/embed/test/__snapshots__/index.native.js.snap +0 -10
  585. package/src/embed/test/index.native.js +88 -228
  586. package/src/file/block.json +0 -1
  587. package/src/freeform/block.json +0 -1
  588. package/src/gallery/block.json +0 -1
  589. package/src/gallery/edit.js +0 -13
  590. package/src/gallery/editor.scss +14 -0
  591. package/src/gallery/index.php +1 -1
  592. package/src/gallery/style.scss +0 -4
  593. package/src/group/block.json +4 -9
  594. package/src/group/edit.native.js +1 -1
  595. package/src/group/theme.scss +5 -4
  596. package/src/heading/block.json +0 -1
  597. package/src/home-link/block.json +0 -1
  598. package/src/home-link/index.php +3 -3
  599. package/src/home-link/style.scss +51 -0
  600. package/src/html/block.json +0 -1
  601. package/src/image/block.json +1 -5
  602. package/src/image/edit.js +0 -44
  603. package/src/image/edit.native.js +1 -1
  604. package/src/image/image.js +3 -14
  605. package/src/index.js +0 -4
  606. package/src/latest-comments/block.json +0 -1
  607. package/src/latest-posts/block.json +0 -1
  608. package/src/list/block.json +0 -1
  609. package/src/loginout/block.json +0 -1
  610. package/src/media-text/block.json +0 -1
  611. package/src/missing/block.json +0 -1
  612. package/src/more/block.json +0 -1
  613. package/src/navigation/block.json +17 -6
  614. package/src/navigation/deprecated.js +0 -2
  615. package/src/navigation/edit/index.js +172 -89
  616. package/src/navigation/edit/navigation-menu-selector.js +19 -13
  617. package/src/navigation/edit/placeholder/index.js +40 -24
  618. package/src/navigation/edit/responsive-wrapper.js +10 -7
  619. package/src/navigation/edit/unsaved-inner-blocks.js +13 -25
  620. package/src/navigation/edit/use-navigation-notice.js +37 -0
  621. package/src/navigation/editor.scss +2 -0
  622. package/src/navigation/index.php +23 -12
  623. package/src/navigation/menu-items-to-blocks.js +1 -2
  624. package/src/navigation/style.scss +57 -19
  625. package/src/navigation/use-navigation-menu.js +20 -0
  626. package/src/navigation/view.js +13 -7
  627. package/src/navigation-area/block.json +7 -3
  628. package/src/navigation-area/edit.js +1 -2
  629. package/src/navigation-link/block.json +3 -2
  630. package/src/navigation-link/edit.js +0 -5
  631. package/src/navigation-link/index.php +3 -3
  632. package/src/navigation-submenu/block.json +3 -2
  633. package/src/navigation-submenu/index.php +3 -3
  634. package/src/nextpage/block.json +0 -1
  635. package/src/page-list/block.json +0 -4
  636. package/src/page-list/index.php +3 -3
  637. package/src/paragraph/block.json +0 -1
  638. package/src/paragraph/edit.js +4 -12
  639. package/src/pattern/block.json +0 -1
  640. package/src/post-author/block.json +0 -1
  641. package/src/post-comment/block.json +0 -1
  642. package/src/post-comments/block.json +0 -1
  643. package/src/post-comments/style.scss +0 -1
  644. package/src/post-comments-count/block.json +0 -1
  645. package/src/post-comments-form/block.json +1 -6
  646. package/src/post-comments-link/block.json +0 -1
  647. package/src/post-content/block.json +0 -1
  648. package/src/post-date/block.json +0 -1
  649. package/src/post-excerpt/block.json +0 -1
  650. package/src/post-featured-image/block.json +0 -1
  651. package/src/post-featured-image/dimension-controls.js +50 -75
  652. package/src/post-featured-image/edit.js +5 -12
  653. package/src/post-featured-image/editor.scss +8 -0
  654. package/src/post-featured-image/style.scss +1 -1
  655. package/src/post-navigation-link/block.json +0 -1
  656. package/src/post-template/block.json +0 -1
  657. package/src/post-terms/block.json +0 -1
  658. package/src/post-title/block.json +0 -1
  659. package/src/post-title/style.scss +2 -6
  660. package/src/preformatted/block.json +0 -1
  661. package/src/preformatted/edit.native.js +1 -3
  662. package/src/pullquote/block.json +1 -8
  663. package/src/pullquote/style.scss +0 -1
  664. package/src/query/block.json +0 -1
  665. package/src/query-pagination/block.json +0 -1
  666. package/src/query-pagination/editor.scss +4 -0
  667. package/src/query-pagination/style.scss +2 -12
  668. package/src/query-pagination-next/block.json +0 -1
  669. package/src/query-pagination-next/index.php +19 -42
  670. package/src/query-pagination-numbers/block.json +0 -1
  671. package/src/query-pagination-previous/block.json +0 -1
  672. package/src/query-pagination-previous/index.php +13 -45
  673. package/src/query-title/block.json +0 -1
  674. package/src/quote/block.json +0 -1
  675. package/src/rss/block.json +0 -1
  676. package/src/search/block.json +1 -8
  677. package/src/search/edit.js +1 -2
  678. package/src/search/index.php +10 -20
  679. package/src/separator/block.json +0 -1
  680. package/src/shortcode/block.json +0 -1
  681. package/src/site-logo/block.json +0 -4
  682. package/src/site-logo/edit.js +6 -5
  683. package/src/site-logo/editor.scss +1 -15
  684. package/src/site-logo/index.php +0 -4
  685. package/src/site-logo/style.scss +3 -1
  686. package/src/site-tagline/block.json +1 -2
  687. package/src/site-title/block.json +0 -1
  688. package/src/social-link/block.json +1 -2
  689. package/src/social-links/block.json +8 -3
  690. package/src/spacer/block.json +0 -1
  691. package/src/style.scss +2 -3
  692. package/src/table/block.json +1 -7
  693. package/src/table/style.scss +0 -1
  694. package/src/table-of-contents/block.json +0 -1
  695. package/src/tag-cloud/block.json +0 -1
  696. package/src/template-part/block.json +8 -1
  697. package/src/template-part/index.js +0 -28
  698. package/src/term-description/block.json +0 -1
  699. package/src/text-columns/block.json +0 -1
  700. package/src/verse/block.json +0 -1
  701. package/src/video/block.json +0 -1
  702. package/build/comment-template/util.js +0 -66
  703. package/build/comment-template/util.js.map +0 -1
  704. package/build/comments-pagination/comments-pagination-arrow-controls.js +0 -39
  705. package/build/comments-pagination/comments-pagination-arrow-controls.js.map +0 -1
  706. package/build/comments-pagination/edit.js +0 -80
  707. package/build/comments-pagination/edit.js.map +0 -1
  708. package/build/comments-pagination/index.js +0 -71
  709. package/build/comments-pagination/index.js.map +0 -1
  710. package/build/comments-pagination/save.js +0 -18
  711. package/build/comments-pagination/save.js.map +0 -1
  712. package/build/comments-pagination-numbers/edit.js +0 -47
  713. package/build/comments-pagination-numbers/edit.js.map +0 -1
  714. package/build/comments-pagination-numbers/index.js +0 -47
  715. package/build/comments-pagination-numbers/index.js.map +0 -1
  716. package/build/embed/embed-controls.native.js +0 -69
  717. package/build/embed/embed-controls.native.js.map +0 -1
  718. package/build/embed/embed-link-settings.native.js +0 -101
  719. package/build/embed/embed-link-settings.native.js.map +0 -1
  720. package/build-module/comment-template/util.js +0 -57
  721. package/build-module/comment-template/util.js.map +0 -1
  722. package/build-module/comments-pagination/comments-pagination-arrow-controls.js +0 -30
  723. package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +0 -1
  724. package/build-module/comments-pagination/edit.js +0 -67
  725. package/build-module/comments-pagination/edit.js.map +0 -1
  726. package/build-module/comments-pagination/index.js +0 -57
  727. package/build-module/comments-pagination/index.js.map +0 -1
  728. package/build-module/comments-pagination/save.js +0 -10
  729. package/build-module/comments-pagination/save.js.map +0 -1
  730. package/build-module/comments-pagination-numbers/edit.js +0 -40
  731. package/build-module/comments-pagination-numbers/edit.js.map +0 -1
  732. package/build-module/comments-pagination-numbers/index.js +0 -34
  733. package/build-module/comments-pagination-numbers/index.js.map +0 -1
  734. package/build-module/embed/embed-controls.native.js +0 -54
  735. package/build-module/embed/embed-controls.native.js.map +0 -1
  736. package/build-module/embed/embed-link-settings.native.js +0 -90
  737. package/build-module/embed/embed-link-settings.native.js.map +0 -1
  738. package/build-style/comment-template/style-rtl.css +0 -91
  739. package/build-style/comment-template/style.css +0 -91
  740. package/build-style/comments-pagination/editor-rtl.css +0 -100
  741. package/build-style/comments-pagination/style.css +0 -106
  742. package/build-style/comments-pagination-numbers/editor-rtl.css +0 -85
  743. package/build-style/comments-pagination-numbers/editor.css +0 -86
  744. package/src/comment-template/style.scss +0 -17
  745. package/src/comment-template/test/index.js +0 -45
  746. package/src/comment-template/util.js +0 -56
  747. package/src/comments-pagination/block.json +0 -37
  748. package/src/comments-pagination/comments-pagination-arrow-controls.js +0 -44
  749. package/src/comments-pagination/edit.js +0 -78
  750. package/src/comments-pagination/editor.scss +0 -34
  751. package/src/comments-pagination/index.js +0 -20
  752. package/src/comments-pagination/index.php +0 -39
  753. package/src/comments-pagination/save.js +0 -8
  754. package/src/comments-pagination/style.scss +0 -38
  755. package/src/comments-pagination-numbers/block.json +0 -16
  756. package/src/comments-pagination-numbers/edit.js +0 -22
  757. package/src/comments-pagination-numbers/editor.scss +0 -12
  758. package/src/comments-pagination-numbers/index.js +0 -18
  759. package/src/comments-pagination-numbers/index.php +0 -69
  760. package/src/embed/embed-controls.native.js +0 -65
  761. package/src/embed/embed-link-settings.native.js +0 -100
  762. package/src/gallery/test/use-get-new-images.js +0 -93
  763. package/src/navigation/README.md +0 -13
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/cover/index.js"],"names":["name","metadata","settings","icon","example","attributes","customOverlayColor","dimRatio","url","innerBlocks","customFontSize","content","align","transforms","save","edit","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,kBAAkB,EAAE,SADT;AAEXC,MAAAA,QAAQ,EAAE,EAFC;AAGXC,MAAAA,GAAG,EAAE;AAHM,KADJ;AAMRC,IAAAA,WAAW,EAAE,CACZ;AACCT,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXK,QAAAA,cAAc,EAAE,EADL;AAEXC,QAAAA,OAAO,EAAE,cAAI,8BAAJ,CAFE;AAGXC,QAAAA,KAAK,EAAE;AAHI;AAFb,KADY;AANL,GAFc;AAmBvBC,EAAAA,UAAU,EAAVA,mBAnBuB;AAoBvBC,EAAAA,IAAI,EAAJA,aApBuB;AAqBvBC,EAAAA,IAAI,EAAJA,aArBuB;AAsBvBC,EAAAA,UAAU,EAAVA;AAtBuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { cover as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcustomOverlayColor: '#065174',\n\t\t\tdimRatio: 40,\n\t\t\turl: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomFontSize: 48,\n\t\t\t\t\tcontent: __( '<strong>Snow Patrol</strong>' ),\n\t\t\t\t\talign: 'center',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tsave,\n\tedit,\n\tdeprecated,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/cover/index.js"],"names":["name","metadata","settings","icon","example","attributes","customOverlayColor","dimRatio","url","innerBlocks","customFontSize","content","align","transforms","save","edit","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,kBAAkB,EAAE,SADT;AAEXC,MAAAA,QAAQ,EAAE,EAFC;AAGXC,MAAAA,GAAG,EAAE;AAHM,KADJ;AAMRC,IAAAA,WAAW,EAAE,CACZ;AACCT,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXK,QAAAA,cAAc,EAAE,EADL;AAEXC,QAAAA,OAAO,EAAE,cAAI,8BAAJ,CAFE;AAGXC,QAAAA,KAAK,EAAE;AAHI;AAFb,KADY;AANL,GAFc;AAmBvBC,EAAAA,UAAU,EAAVA,mBAnBuB;AAoBvBC,EAAAA,IAAI,EAAJA,aApBuB;AAqBvBC,EAAAA,IAAI,EAAJA,aArBuB;AAsBvBC,EAAAA,UAAU,EAAVA;AAtBuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { cover as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcustomOverlayColor: '#065174',\n\t\t\tdimRatio: 40,\n\t\t\turl: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomFontSize: 48,\n\t\t\t\t\tcontent: __( '<strong>Snow Patrol</strong>' ),\n\t\t\t\t\talign: 'center',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tsave,\n\tedit,\n\tdeprecated,\n};\n"]}
@@ -21,7 +21,6 @@ var _blockEditor = require("@wordpress/block-editor");
21
21
  * Internal dependencies
22
22
  */
23
23
  const metadata = {
24
- $schema: "https://schemas.wp.org/trunk/block.json",
25
24
  apiVersion: 2,
26
25
  name: "core/embed",
27
26
  title: "Embed",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/embed/deprecated.js"],"names":["attributes","blockAttributes","metadata","deprecated","save","url","caption","type","providerNameSlug","embedClassName","RichText","isEmpty"],"mappings":";;;;;;;;;;;AAGA;;AAUA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;;AAGA,MAAM;AAAEA,EAAAA,UAAU,EAAEC;AAAd,IAAkCC,QAAxC;AAEA,MAAMC,UAAU,GAAG,CAClB;AACCH,EAAAA,UAAU,EAAEC,eADb;;AAECG,EAAAA,IAAI,OAA6D;AAAA,QAA3D;AAAEJ,MAAAA,UAAU,EAAE;AAAEK,QAAAA,GAAF;AAAOC,QAAAA,OAAP;AAAgBC,QAAAA,IAAhB;AAAsBC,QAAAA;AAAtB;AAAd,KAA2D;;AAChE,QAAK,CAAEH,GAAP,EAAa;AACZ,aAAO,IAAP;AACA;;AAED,UAAMI,cAAc,GAAG,yBAAY,gBAAZ,EAA8B;AACpD,OAAG,WAAWF,IAAM,EAApB,GAAyBA,IAD2B;AAEpD,OAAG,eAAeC,gBAAkB,EAApC,GAAyCA;AAFW,KAA9B,CAAvB;AAKA,WACC;AAAQ,MAAA,SAAS,EAAGC;AAApB,OACI,KAAKJ,GAAK;AAAI;AADlB,MAEG,CAAEK,sBAASC,OAAT,CAAkBL,OAAlB,CAAF,IACD,4BAAC,qBAAD,CAAU,OAAV;AACC,MAAA,OAAO,EAAC,YADT;AAEC,MAAA,KAAK,EAAGA;AAFT,MAHF,CADD;AAWA;;AAvBF,CADkB,CAAnB;eA4BeH,U","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\n/**\n * WordPress dependencies\n */\nimport { RichText } from '@wordpress/block-editor';\n\nconst { attributes: blockAttributes } = metadata;\n\nconst deprecated = [\n\t{\n\t\tattributes: blockAttributes,\n\t\tsave( { attributes: { url, caption, type, providerNameSlug } } ) {\n\t\t\tif ( ! url ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst embedClassName = classnames( 'wp-block-embed', {\n\t\t\t\t[ `is-type-${ type }` ]: type,\n\t\t\t\t[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,\n\t\t\t} );\n\n\t\t\treturn (\n\t\t\t\t<figure className={ embedClassName }>\n\t\t\t\t\t{ `\\n${ url }\\n` /* URL needs to be on its own line. */ }\n\t\t\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t\t\t<RichText.Content\n\t\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</figure>\n\t\t\t);\n\t\t},\n\t},\n];\n\nexport default deprecated;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/embed/deprecated.js"],"names":["attributes","blockAttributes","metadata","deprecated","save","url","caption","type","providerNameSlug","embedClassName","RichText","isEmpty"],"mappings":";;;;;;;;;;;AAGA;;AAUA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;;AAGA,MAAM;AAAEA,EAAAA,UAAU,EAAEC;AAAd,IAAkCC,QAAxC;AAEA,MAAMC,UAAU,GAAG,CAClB;AACCH,EAAAA,UAAU,EAAEC,eADb;;AAECG,EAAAA,IAAI,OAA6D;AAAA,QAA3D;AAAEJ,MAAAA,UAAU,EAAE;AAAEK,QAAAA,GAAF;AAAOC,QAAAA,OAAP;AAAgBC,QAAAA,IAAhB;AAAsBC,QAAAA;AAAtB;AAAd,KAA2D;;AAChE,QAAK,CAAEH,GAAP,EAAa;AACZ,aAAO,IAAP;AACA;;AAED,UAAMI,cAAc,GAAG,yBAAY,gBAAZ,EAA8B;AACpD,OAAG,WAAWF,IAAM,EAApB,GAAyBA,IAD2B;AAEpD,OAAG,eAAeC,gBAAkB,EAApC,GAAyCA;AAFW,KAA9B,CAAvB;AAKA,WACC;AAAQ,MAAA,SAAS,EAAGC;AAApB,OACI,KAAKJ,GAAK;AAAI;AADlB,MAEG,CAAEK,sBAASC,OAAT,CAAkBL,OAAlB,CAAF,IACD,4BAAC,qBAAD,CAAU,OAAV;AACC,MAAA,OAAO,EAAC,YADT;AAEC,MAAA,KAAK,EAAGA;AAFT,MAHF,CADD;AAWA;;AAvBF,CADkB,CAAnB;eA4BeH,U","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\n/**\n * WordPress dependencies\n */\nimport { RichText } from '@wordpress/block-editor';\n\nconst { attributes: blockAttributes } = metadata;\n\nconst deprecated = [\n\t{\n\t\tattributes: blockAttributes,\n\t\tsave( { attributes: { url, caption, type, providerNameSlug } } ) {\n\t\t\tif ( ! url ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst embedClassName = classnames( 'wp-block-embed', {\n\t\t\t\t[ `is-type-${ type }` ]: type,\n\t\t\t\t[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,\n\t\t\t} );\n\n\t\t\treturn (\n\t\t\t\t<figure className={ embedClassName }>\n\t\t\t\t\t{ `\\n${ url }\\n` /* URL needs to be on its own line. */ }\n\t\t\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t\t\t<RichText.Content\n\t\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</figure>\n\t\t\t);\n\t\t},\n\t},\n];\n\nexport default deprecated;\n"]}
@@ -21,7 +21,7 @@ var _embedPlaceholder = _interopRequireDefault(require("./embed-placeholder"));
21
21
 
22
22
  var _embedPreview = _interopRequireDefault(require("./embed-preview"));
23
23
 
24
- var _embedLinkSettings = _interopRequireDefault(require("./embed-link-settings"));
24
+ var _embedBottomSheet = _interopRequireDefault(require("./embed-bottom-sheet"));
25
25
 
26
26
  var _classnames = _interopRequireDefault(require("classnames"));
27
27
 
@@ -192,15 +192,6 @@ const EmbedEdit = props => {
192
192
  }
193
193
  }, [preview, isEditingURL]);
194
194
  (0, _element.useEffect)(() => setShowEmbedBottomSheet(isEditingURL), [isEditingURL]);
195
- const onEditURL = (0, _element.useCallback)(value => {
196
- // The order of the following calls is important, we need to update the URL attribute before changing `isEditingURL`,
197
- // otherwise the side-effect that potentially replaces the block when updating the local state won't use the new URL
198
- // for creating the new block.
199
- setAttributes({
200
- url: value
201
- });
202
- setIsEditingURL(false);
203
- }, []);
204
195
  const blockProps = (0, _blockEditor.useBlockProps)();
205
196
 
206
197
  if (fetching) {
@@ -225,8 +216,11 @@ const EmbedEdit = props => {
225
216
  const isProviderPreviewable = PREVIEWABLE_PROVIDERS.includes(providerNameSlug) || // For WordPress embeds, we enable the inline preview for all its providers
226
217
  // except the ones that are not supported yet.
227
218
  WP_EMBED_TYPE === type && !NOT_PREVIEWABLE_WP_EMBED_PROVIDERS.includes(providerNameSlug);
228
- const linkLabel = WP_EMBED_TYPE === type ? 'WordPress' : title;
229
- return (0, _element.createElement)(_element.Fragment, null, showEmbedPlaceholder ? (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_primitives.View, blockProps, (0, _element.createElement)(_embedPlaceholder.default, {
219
+ const bottomSheetLabel = WP_EMBED_TYPE === type ? 'WordPress' : title;
220
+ return (0, _element.createElement)(_element.Fragment, null, showEmbedPlaceholder ? (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_embedControls.default, {
221
+ showEditButton: cannotEmbed,
222
+ switchBackToURLInput: () => setIsEditingURL(true)
223
+ }), (0, _element.createElement)(_primitives.View, blockProps, (0, _element.createElement)(_embedPlaceholder.default, {
230
224
  icon: icon,
231
225
  isSelected: isSelected,
232
226
  label: title,
@@ -238,16 +232,14 @@ const EmbedEdit = props => {
238
232
  fallback: () => (0, _util.fallback)(url, onReplace),
239
233
  tryAgain: () => {
240
234
  invalidateResolution('getEmbedPreview', [url]);
241
- },
242
- openEmbedLinkSettings: () => setShowEmbedBottomSheet(true)
235
+ }
243
236
  }))) : (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_embedControls.default, {
237
+ showEditButton: preview && !cannotEmbed,
244
238
  themeSupportsResponsive: themeSupportsResponsive,
245
239
  blockSupportsResponsive: responsive,
246
240
  allowResponsive: allowResponsive,
247
241
  toggleResponsive: toggleResponsive,
248
- url: url,
249
- linkLabel: linkLabel,
250
- onEditURL: onEditURL
242
+ switchBackToURLInput: () => setIsEditingURL(true)
251
243
  }), (0, _element.createElement)(_primitives.View, blockProps, (0, _element.createElement)(_embedPreview.default, {
252
244
  align: align,
253
245
  className: className,
@@ -263,15 +255,20 @@ const EmbedEdit = props => {
263
255
  type: type,
264
256
  url: url,
265
257
  isDefaultEmbedInfo: !embedInfoByProvider
266
- }))), (0, _element.createElement)(_embedLinkSettings.default // eslint-disable-next-line jsx-a11y/no-autofocus
267
- , {
268
- autoFocus: true,
258
+ }))), (0, _element.createElement)(_embedBottomSheet.default, {
269
259
  value: url,
270
- label: linkLabel,
260
+ label: bottomSheetLabel,
271
261
  isVisible: showEmbedBottomSheet,
272
262
  onClose: () => setShowEmbedBottomSheet(false),
273
- onSubmit: onEditURL,
274
- withBottomSheet: true
263
+ onSubmit: value => {
264
+ // The order of the following calls is important, we need to update the URL attribute before changing `isEditingURL`,
265
+ // otherwise the side-effect that potentially replaces the block when updating the local state won't use the new URL
266
+ // for creating the new block.
267
+ setAttributes({
268
+ url: value
269
+ });
270
+ setIsEditingURL(false);
271
+ }
275
272
  }));
276
273
  };
277
274
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/embed/edit.native.js"],"names":["PREVIEWABLE_PROVIDERS","NOT_PREVIEWABLE_WP_EMBED_PROVIDERS","WP_EMBED_TYPE","EmbedEdit","props","attributes","align","providerNameSlug","previewable","responsive","url","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","clientId","defaultEmbedInfo","title","icon","embedContentIcon","embedInfoByProvider","wasBlockJustInserted","select","blockEditorStore","isEditingURL","setIsEditingURL","showEmbedBottomSheet","setShowEmbedBottomSheet","invalidateResolution","coreStore","preview","fetching","themeSupportsResponsive","cannotEmbed","getEmbedPreview","hasFinishedResolution","isPreviewEmbedFallback","getThemeSupports","embedPreview","hasResolvedEmbedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","code","validPreview","getMergedAttributes","ignorePreviousClassName","allowResponsive","className","toggleResponsive","newAllowResponsive","newURL","replace","upgradedBlock","onEditURL","value","blockProps","showEmbedPlaceholder","classFromPreview","isProviderPreviewable","includes","linkLabel","event"],"mappings":";;;;;;;;;AA0BA;;AAvBA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AAEA;;AACA;;AAIA;;AACA;;AAjCA;AACA;AACA;;AAeA;AACA;AACA;;AAGA;AACA;AACA;AAWA;AACA;AACA,MAAMA,qBAAqB,GAAG,CAAE,SAAF,EAAa,SAAb,EAAwB,WAAxB,EAAqC,OAArC,CAA9B,C,CACA;AACA;;AACA,MAAMC,kCAAkC,GAAG,CAAE,WAAF,CAA3C;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A,WAAW,EAAGvD,WAXf;AAYC,IAAA,IAAI,EAAGoC,IAZR;AAaC,IAAA,GAAG,EAAGlC,GAbP;AAcC,IAAA,kBAAkB,EAAG,CAAEW;AAdxB,IADD,CAVD,CA1BF,EAwDC,4BAAC,0BAAD,CACC;AADD;AAEC,IAAA,SAAS,MAFV;AAGC,IAAA,KAAK,EAAGX,GAHT;AAIC,IAAA,KAAK,EAAGuD,SAJT;AAKC,IAAA,SAAS,EAAGtC,oBALb;AAMC,IAAA,OAAO,EAAG,MAAMC,uBAAuB,CAAE,KAAF,CANxC;AAOC,IAAA,QAAQ,EAAG8B,SAPZ;AAQC,IAAA,eAAe;AARhB,IAxDD,CADD;AAqEA,CA3QD;;eA6QevD,S","sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tfallback,\n\tgetAttributesFromPreview,\n\tgetEmbedInfoByProvider,\n} from './util';\nimport EmbedControls from './embed-controls';\nimport { embedContentIcon } from './icons';\nimport EmbedLoading from './embed-loading';\nimport EmbedPlaceholder from './embed-placeholder';\nimport EmbedPreview from './embed-preview';\nimport EmbedLinkSettings from './embed-link-settings';\n\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useCallback, useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\n\n// The inline preview feature will be released progressible, for this reason\n// the embed will only be considered previewable for the following providers list.\nconst PREVIEWABLE_PROVIDERS = [ 'youtube', 'twitter', 'instagram', 'vimeo' ];\n// Some providers are rendering the inline preview as a WordPress embed and\n// are not supported yet, so we need to disallow them with a fixed providers list.\nconst NOT_PREVIEWABLE_WP_EMBED_PROVIDERS = [ 'pinterest' ];\n\nconst WP_EMBED_TYPE = 'wp-embed';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: { align, providerNameSlug, previewable, responsive, url },\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t\tclientId,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst embedInfoByProvider = getEmbedInfoByProvider( providerNameSlug );\n\tconst { icon, title } = embedInfoByProvider || defaultEmbedInfo;\n\n\tconst { wasBlockJustInserted } = useSelect(\n\t\t( select ) => ( {\n\t\t\twasBlockJustInserted: select(\n\t\t\t\tblockEditorStore\n\t\t\t).wasBlockJustInserted( clientId, 'inserter_menu' ),\n\t\t} ),\n\t\t[ clientId ]\n\t);\n\tconst [ isEditingURL, setIsEditingURL ] = useState(\n\t\tisSelected && wasBlockJustInserted && ! url\n\t);\n\tconst [ showEmbedBottomSheet, setShowEmbedBottomSheet ] = useState(\n\t\tisEditingURL\n\t);\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst {\n\t\tpreview,\n\t\tfetching,\n\t\tthemeSupportsResponsive,\n\t\tcannotEmbed,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEmbedPreview,\n\t\t\t\thasFinishedResolution,\n\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\tgetThemeSupports,\n\t\t\t} = select( coreStore );\n\t\t\tif ( ! url ) {\n\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t}\n\n\t\t\tconst embedPreview = getEmbedPreview( url );\n\t\t\tconst hasResolvedEmbedPreview = hasFinishedResolution(\n\t\t\t\t'getEmbedPreview',\n\t\t\t\t[ url ]\n\t\t\t);\n\t\t\tconst previewIsFallback = isPreviewEmbedFallback( url );\n\n\t\t\t// The external oEmbed provider does not exist. We got no type info and no html.\n\t\t\tconst badEmbedProvider =\n\t\t\t\tembedPreview?.html === false &&\n\t\t\t\tembedPreview?.type === undefined;\n\t\t\t// Some WordPress URLs that can't be embedded will cause the API to return\n\t\t\t// a valid JSON response with no HTML and `code` set to 404, rather\n\t\t\t// than generating a fallback response as other embeds do.\n\t\t\tconst wordpressCantEmbed = embedPreview?.code === '404';\n\t\t\tconst validPreview =\n\t\t\t\t!! embedPreview && ! badEmbedProvider && ! wordpressCantEmbed;\n\n\t\t\treturn {\n\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\tfetching: ! hasResolvedEmbedPreview,\n\t\t\t\tthemeSupportsResponsive: getThemeSupports()[\n\t\t\t\t\t'responsive-embeds'\n\t\t\t\t],\n\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t};\n\t\t},\n\t\t[ url ]\n\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @param {boolean} ignorePreviousClassName Determines if the previous className attribute should be ignored when merging.\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = ( ignorePreviousClassName = false ) => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\treturn {\n\t\t\t...attributes,\n\t\t\t...getAttributesFromPreview(\n\t\t\t\tpreview,\n\t\t\t\ttitle,\n\t\t\t\tignorePreviousClassName ? undefined : className,\n\t\t\t\tresponsive,\n\t\t\t\tallowResponsive\n\t\t\t),\n\t\t};\n\t};\n\n\tconst toggleResponsive = () => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\tconst { html } = preview;\n\t\tconst newAllowResponsive = ! allowResponsive;\n\n\t\tsetAttributes( {\n\t\t\tallowResponsive: newAllowResponsive,\n\t\t\tclassName: getClassNames(\n\t\t\t\thtml,\n\t\t\t\tclassName,\n\t\t\t\tresponsive && newAllowResponsive\n\t\t\t),\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! preview?.html || ! cannotEmbed || fetching ) {\n\t\t\treturn;\n\t\t}\n\t\t// At this stage, we're not fetching the preview and know it can't be embedded,\n\t\t// so try removing any trailing slash, and resubmit.\n\t\tconst newURL = url.replace( /\\/$/, '' );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [ preview?.html, url ] );\n\n\t// Handle incoming preview\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview, we set the attributes derived from\n\t\t\t// the preview data. In this case when getting the merged attributes,\n\t\t\t// we ignore the previous classname because it might not match the expected\n\t\t\t// classes by the new preview.\n\t\t\tsetAttributes( getMergedAttributes( true ) );\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tgetMergedAttributes()\n\t\t\t\t);\n\n\t\t\t\tif ( upgradedBlock ) {\n\t\t\t\t\tonReplace( upgradedBlock );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [ preview, isEditingURL ] );\n\n\tuseEffect( () => setShowEmbedBottomSheet( isEditingURL ), [\n\t\tisEditingURL,\n\t] );\n\n\tconst onEditURL = useCallback( ( value ) => {\n\t\t// The order of the following calls is important, we need to update the URL attribute before changing `isEditingURL`,\n\t\t// otherwise the side-effect that potentially replaces the block when updating the local state won't use the new URL\n\t\t// for creating the new block.\n\t\tsetAttributes( { url: value } );\n\t\tsetIsEditingURL( false );\n\t}, [] );\n\n\tconst blockProps = useBlockProps();\n\n\tif ( fetching ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedLoading />\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst showEmbedPlaceholder = ! preview || cannotEmbed;\n\n\t// Even though we set attributes that get derived from the preview,\n\t// we don't access them directly because for the initial render,\n\t// the `setAttributes` call will not have taken effect. If we're\n\t// rendering responsive content, setting the responsive classes\n\t// after the preview has been rendered can result in unwanted\n\t// clipping or scrollbars. The `getAttributesFromPreview` function\n\t// that `getMergedAttributes` uses is memoized so that we're not\n\t// calculating them on every render.\n\tconst {\n\t\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = classnames( classFromPreview, props.className );\n\n\tconst isProviderPreviewable =\n\t\tPREVIEWABLE_PROVIDERS.includes( providerNameSlug ) ||\n\t\t// For WordPress embeds, we enable the inline preview for all its providers\n\t\t// except the ones that are not supported yet.\n\t\t( WP_EMBED_TYPE === type &&\n\t\t\t! NOT_PREVIEWABLE_WP_EMBED_PROVIDERS.includes( providerNameSlug ) );\n\n\tconst linkLabel = WP_EMBED_TYPE === type ? 'WordPress' : title;\n\n\treturn (\n\t\t<>\n\t\t\t{ showEmbedPlaceholder ? (\n\t\t\t\t<>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonPress={ ( event ) => {\n\t\t\t\t\t\t\t\tonFocus( event );\n\t\t\t\t\t\t\t\tsetIsEditingURL( true );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [\n\t\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\topenEmbedLinkSettings={ () =>\n\t\t\t\t\t\t\t\tsetShowEmbedBottomSheet( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<EmbedControls\n\t\t\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tlinkLabel={ linkLabel }\n\t\t\t\t\t\tonEditURL={ onEditURL }\n\t\t\t\t\t/>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPreview\n\t\t\t\t\t\t\talign={ align }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tpreview={ preview }\n\t\t\t\t\t\t\tisProviderPreviewable={ isProviderPreviewable }\n\t\t\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\tisDefaultEmbedInfo={ ! embedInfoByProvider }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<EmbedLinkSettings\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\tautoFocus\n\t\t\t\tvalue={ url }\n\t\t\t\tlabel={ linkLabel }\n\t\t\t\tisVisible={ showEmbedBottomSheet }\n\t\t\t\tonClose={ () => setShowEmbedBottomSheet( false ) }\n\t\t\t\tonSubmit={ onEditURL }\n\t\t\t\twithBottomSheet\n\t\t\t/>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/embed/edit.native.js"],"names":["PREVIEWABLE_PROVIDERS","NOT_PREVIEWABLE_WP_EMBED_PROVIDERS","WP_EMBED_TYPE","EmbedEdit","props","attributes","align","providerNameSlug","previewable","responsive","url","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","clientId","defaultEmbedInfo","title","icon","embedContentIcon","embedInfoByProvider","wasBlockJustInserted","select","blockEditorStore","isEditingURL","setIsEditingURL","showEmbedBottomSheet","setShowEmbedBottomSheet","invalidateResolution","coreStore","preview","fetching","themeSupportsResponsive","cannotEmbed","getEmbedPreview","hasFinishedResolution","isPreviewEmbedFallback","getThemeSupports","embedPreview","hasResolvedEmbedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","code","validPreview","getMergedAttributes","ignorePreviousClassName","allowResponsive","className","toggleResponsive","newAllowResponsive","newURL","replace","upgradedBlock","blockProps","showEmbedPlaceholder","classFromPreview","isProviderPreviewable","includes","bottomSheetLabel","event","value"],"mappings":";;;;;;;;;AA0BA;;AAvBA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AAEA;;AACA;;AAIA;;AACA;;AAjCA;AACA;AACA;;AAeA;AACA;AACA;;AAGA;AACA;AACA;AAWA;AACA;AACA,MAAMA,qBAAqB,GAAG,CAAE,SAAF,EAAa,SAAb,EAAwB,WAAxB,EAAqC,OAArC,CAA9B,C,CACA;AACA;;AACA,MAAMC,kCAAkC,GAAG,CAAE,WAAF,CAA3C;AAEA,MAAMC,aAAa,GAAG,UAAtB;;AAEA,MAAMC,SAAS,GAAKC,KAAF,IAAa;AAC9B,QAAM;AACLC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA,gBAAT;AAA2BC,MAAAA,WAA3B;AAAwCC,MAAAA,UAAxC;AAAoDC,MAAAA;AAApD,KADP;AAELL,IAAAA,UAFK;AAGLM,IAAAA,UAHK;AAILC,IAAAA,SAJK;AAKLC,IAAAA,aALK;AAMLC,IAAAA,iBANK;AAOLC,IAAAA,OAPK;AAQLC,IAAAA;AARK,MASFZ,KATJ;AAWA,QAAMa,gBAAgB,GAAG;AACxBC,IAAAA,KAAK,EAAE,cAAI,OAAJ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{\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tfallback,\n\tgetAttributesFromPreview,\n\tgetEmbedInfoByProvider,\n} from './util';\nimport EmbedControls from './embed-controls';\nimport { embedContentIcon } from './icons';\nimport EmbedLoading from './embed-loading';\nimport EmbedPlaceholder from './embed-placeholder';\nimport EmbedPreview from './embed-preview';\nimport EmbedBottomSheet from './embed-bottom-sheet';\n\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\n\n// The inline preview feature will be released progressible, for this reason\n// the embed will only be considered previewable for the following providers list.\nconst PREVIEWABLE_PROVIDERS = [ 'youtube', 'twitter', 'instagram', 'vimeo' ];\n// Some providers are rendering the inline preview as a WordPress embed and\n// are not supported yet, so we need to disallow them with a fixed providers list.\nconst NOT_PREVIEWABLE_WP_EMBED_PROVIDERS = [ 'pinterest' ];\n\nconst WP_EMBED_TYPE = 'wp-embed';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: { align, providerNameSlug, previewable, responsive, url },\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t\tclientId,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst embedInfoByProvider = getEmbedInfoByProvider( providerNameSlug );\n\tconst { icon, title } = embedInfoByProvider || defaultEmbedInfo;\n\n\tconst { wasBlockJustInserted } = useSelect(\n\t\t( select ) => ( {\n\t\t\twasBlockJustInserted: select(\n\t\t\t\tblockEditorStore\n\t\t\t).wasBlockJustInserted( clientId, 'inserter_menu' ),\n\t\t} ),\n\t\t[ clientId ]\n\t);\n\tconst [ isEditingURL, setIsEditingURL ] = useState(\n\t\tisSelected && wasBlockJustInserted && ! url\n\t);\n\tconst [ showEmbedBottomSheet, setShowEmbedBottomSheet ] = useState(\n\t\tisEditingURL\n\t);\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst {\n\t\tpreview,\n\t\tfetching,\n\t\tthemeSupportsResponsive,\n\t\tcannotEmbed,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEmbedPreview,\n\t\t\t\thasFinishedResolution,\n\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\tgetThemeSupports,\n\t\t\t} = select( coreStore );\n\t\t\tif ( ! url ) {\n\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t}\n\n\t\t\tconst embedPreview = getEmbedPreview( url );\n\t\t\tconst hasResolvedEmbedPreview = hasFinishedResolution(\n\t\t\t\t'getEmbedPreview',\n\t\t\t\t[ url ]\n\t\t\t);\n\t\t\tconst previewIsFallback = isPreviewEmbedFallback( url );\n\n\t\t\t// The external oEmbed provider does not exist. We got no type info and no html.\n\t\t\tconst badEmbedProvider =\n\t\t\t\tembedPreview?.html === false &&\n\t\t\t\tembedPreview?.type === undefined;\n\t\t\t// Some WordPress URLs that can't be embedded will cause the API to return\n\t\t\t// a valid JSON response with no HTML and `code` set to 404, rather\n\t\t\t// than generating a fallback response as other embeds do.\n\t\t\tconst wordpressCantEmbed = embedPreview?.code === '404';\n\t\t\tconst validPreview =\n\t\t\t\t!! embedPreview && ! badEmbedProvider && ! wordpressCantEmbed;\n\n\t\t\treturn {\n\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\tfetching: ! hasResolvedEmbedPreview,\n\t\t\t\tthemeSupportsResponsive: getThemeSupports()[\n\t\t\t\t\t'responsive-embeds'\n\t\t\t\t],\n\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t};\n\t\t},\n\t\t[ url ]\n\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @param {boolean} ignorePreviousClassName Determines if the previous className attribute should be ignored when merging.\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = ( ignorePreviousClassName = false ) => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\treturn {\n\t\t\t...attributes,\n\t\t\t...getAttributesFromPreview(\n\t\t\t\tpreview,\n\t\t\t\ttitle,\n\t\t\t\tignorePreviousClassName ? undefined : className,\n\t\t\t\tresponsive,\n\t\t\t\tallowResponsive\n\t\t\t),\n\t\t};\n\t};\n\n\tconst toggleResponsive = () => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\tconst { html } = preview;\n\t\tconst newAllowResponsive = ! allowResponsive;\n\n\t\tsetAttributes( {\n\t\t\tallowResponsive: newAllowResponsive,\n\t\t\tclassName: getClassNames(\n\t\t\t\thtml,\n\t\t\t\tclassName,\n\t\t\t\tresponsive && newAllowResponsive\n\t\t\t),\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! preview?.html || ! cannotEmbed || fetching ) {\n\t\t\treturn;\n\t\t}\n\t\t// At this stage, we're not fetching the preview and know it can't be embedded,\n\t\t// so try removing any trailing slash, and resubmit.\n\t\tconst newURL = url.replace( /\\/$/, '' );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [ preview?.html, url ] );\n\n\t// Handle incoming preview\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview, we set the attributes derived from\n\t\t\t// the preview data. In this case when getting the merged attributes,\n\t\t\t// we ignore the previous classname because it might not match the expected\n\t\t\t// classes by the new preview.\n\t\t\tsetAttributes( getMergedAttributes( true ) );\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tgetMergedAttributes()\n\t\t\t\t);\n\n\t\t\t\tif ( upgradedBlock ) {\n\t\t\t\t\tonReplace( upgradedBlock );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [ preview, isEditingURL ] );\n\n\tuseEffect( () => setShowEmbedBottomSheet( isEditingURL ), [\n\t\tisEditingURL,\n\t] );\n\n\tconst blockProps = useBlockProps();\n\n\tif ( fetching ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedLoading />\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst showEmbedPlaceholder = ! preview || cannotEmbed;\n\n\t// Even though we set attributes that get derived from the preview,\n\t// we don't access them directly because for the initial render,\n\t// the `setAttributes` call will not have taken effect. If we're\n\t// rendering responsive content, setting the responsive classes\n\t// after the preview has been rendered can result in unwanted\n\t// clipping or scrollbars. The `getAttributesFromPreview` function\n\t// that `getMergedAttributes` uses is memoized so that we're not\n\t// calculating them on every render.\n\tconst {\n\t\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = classnames( classFromPreview, props.className );\n\n\tconst isProviderPreviewable =\n\t\tPREVIEWABLE_PROVIDERS.includes( providerNameSlug ) ||\n\t\t// For WordPress embeds, we enable the inline preview for all its providers\n\t\t// except the ones that are not supported yet.\n\t\t( WP_EMBED_TYPE === type &&\n\t\t\t! NOT_PREVIEWABLE_WP_EMBED_PROVIDERS.includes( providerNameSlug ) );\n\n\tconst bottomSheetLabel = WP_EMBED_TYPE === type ? 'WordPress' : title;\n\n\treturn (\n\t\t<>\n\t\t\t{ showEmbedPlaceholder ? (\n\t\t\t\t<>\n\t\t\t\t\t<EmbedControls\n\t\t\t\t\t\tshowEditButton={ cannotEmbed }\n\t\t\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonPress={ ( event ) => {\n\t\t\t\t\t\t\t\tonFocus( event );\n\t\t\t\t\t\t\t\tsetIsEditingURL( true );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [\n\t\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<EmbedControls\n\t\t\t\t\t\tshowEditButton={ preview && ! cannotEmbed }\n\t\t\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPreview\n\t\t\t\t\t\t\talign={ align }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tpreview={ preview }\n\t\t\t\t\t\t\tisProviderPreviewable={ isProviderPreviewable }\n\t\t\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\tisDefaultEmbedInfo={ ! embedInfoByProvider }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<EmbedBottomSheet\n\t\t\t\tvalue={ url }\n\t\t\t\tlabel={ bottomSheetLabel }\n\t\t\t\tisVisible={ showEmbedBottomSheet }\n\t\t\t\tonClose={ () => setShowEmbedBottomSheet( false ) }\n\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t// The order of the following calls is important, we need to update the URL attribute before changing `isEditingURL`,\n\t\t\t\t\t// otherwise the side-effect that potentially replaces the block when updating the local state won't use the new URL\n\t\t\t\t\t// for creating the new block.\n\t\t\t\t\tsetAttributes( { url: value } );\n\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _element = require("@wordpress/element");
9
+
10
+ var _i18n = require("@wordpress/i18n");
11
+
12
+ var _components = require("@wordpress/components");
13
+
14
+ var _url = require("@wordpress/url");
15
+
16
+ var _data = require("@wordpress/data");
17
+
18
+ var _notices = require("@wordpress/notices");
19
+
20
+ /**
21
+ * WordPress dependencies
22
+ */
23
+ const EmbedBottomSheet = _ref => {
24
+ let {
25
+ value,
26
+ label,
27
+ isVisible,
28
+ onClose,
29
+ onSubmit
30
+ } = _ref;
31
+ const [url, setURL] = (0, _element.useState)(value);
32
+ const {
33
+ createErrorNotice
34
+ } = (0, _data.useDispatch)(_notices.store);
35
+ const linkSettingsOptions = {
36
+ url: {
37
+ label: (0, _i18n.sprintf)( // translators: %s: embed block variant's label e.g: "Twitter".
38
+ (0, _i18n.__)('%s link'), label),
39
+ placeholder: (0, _i18n.__)('Add link'),
40
+ autoFocus: true,
41
+ autoFill: true
42
+ },
43
+ footer: {
44
+ label: (0, _element.createElement)(_components.FooterMessageLink, {
45
+ href: (0, _i18n.__)('https://wordpress.org/support/article/embeds/'),
46
+ value: (0, _i18n.__)('Learn more about embeds')
47
+ }),
48
+ separatorType: 'topFullWidth'
49
+ }
50
+ };
51
+ const onDismiss = (0, _element.useCallback)(() => {
52
+ if (url !== '') {
53
+ if ((0, _url.isURL)(url)) {
54
+ onSubmit(url);
55
+ } else {
56
+ createErrorNotice((0, _i18n.__)('Invalid URL. Please enter a valid URL.')); // If the URL was already defined, we submit it to stop showing the embed placeholder.
57
+
58
+ onSubmit(value);
59
+ }
60
+ } else {
61
+ // Resets the URL when new value is empty
62
+ onSubmit('');
63
+ }
64
+ }, [url, onSubmit, value]);
65
+
66
+ function setAttributes(attributes) {
67
+ setURL(attributes.url);
68
+ }
69
+
70
+ return (0, _element.createElement)(_components.LinkSettingsNavigation, {
71
+ isVisible: isVisible,
72
+ url: url,
73
+ onClose: onClose,
74
+ onDismiss: onDismiss,
75
+ setAttributes: setAttributes,
76
+ options: linkSettingsOptions,
77
+ testID: "embed-edit-url-modal",
78
+ withBottomSheet: true,
79
+ showIcon: true
80
+ });
81
+ };
82
+
83
+ var _default = EmbedBottomSheet;
84
+ exports.default = _default;
85
+ //# sourceMappingURL=embed-bottom-sheet.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/embed/embed-bottom-sheet.native.js"],"names":["EmbedBottomSheet","value","label","isVisible","onClose","onSubmit","url","setURL","createErrorNotice","noticesStore","linkSettingsOptions","placeholder","autoFocus","autoFill","footer","separatorType","onDismiss","setAttributes","attributes"],"mappings":";;;;;;;AAWA;;AARA;;AACA;;AAIA;;AACA;;AACA;;AAVA;AACA;AACA;AAWA,MAAMA,gBAAgB,GAAG,QAAsD;AAAA,MAApD;AAAEC,IAAAA,KAAF;AAASC,IAAAA,KAAT;AAAgBC,IAAAA,SAAhB;AAA2BC,IAAAA,OAA3B;AAAoCC,IAAAA;AAApC,GAAoD;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AAA,SAAS,EAAGY,SAJb;AAKC,IAAA,aAAa,EAAGC,aALjB;AAMC,IAAA,OAAO,EAAGP,mBANX;AAOC,IAAA,MAAM,EAAC,sBAPR;AAQC,IAAA,eAAe,MARhB;AASC,IAAA,QAAQ;AATT,IADD;AAaA,CA9DD;;eAgEeV,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tLinkSettingsNavigation,\n\tFooterMessageLink,\n} from '@wordpress/components';\nimport { isURL } from '@wordpress/url';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { useCallback, useState } from '@wordpress/element';\n\nconst EmbedBottomSheet = ( { value, label, isVisible, onClose, onSubmit } ) => {\n\tconst [ url, setURL ] = useState( value );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst linkSettingsOptions = {\n\t\turl: {\n\t\t\tlabel: sprintf(\n\t\t\t\t// translators: %s: embed block variant's label e.g: \"Twitter\".\n\t\t\t\t__( '%s link' ),\n\t\t\t\tlabel\n\t\t\t),\n\t\t\tplaceholder: __( 'Add link' ),\n\t\t\tautoFocus: true,\n\t\t\tautoFill: true,\n\t\t},\n\t\tfooter: {\n\t\t\tlabel: (\n\t\t\t\t<FooterMessageLink\n\t\t\t\t\thref={ __(\n\t\t\t\t\t\t'https://wordpress.org/support/article/embeds/'\n\t\t\t\t\t) }\n\t\t\t\t\tvalue={ __( 'Learn more about embeds' ) }\n\t\t\t\t/>\n\t\t\t),\n\t\t\tseparatorType: 'topFullWidth',\n\t\t},\n\t};\n\n\tconst onDismiss = useCallback( () => {\n\t\tif ( url !== '' ) {\n\t\t\tif ( isURL( url ) ) {\n\t\t\t\tonSubmit( url );\n\t\t\t} else {\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t__( 'Invalid URL. Please enter a valid URL.' )\n\t\t\t\t);\n\t\t\t\t// If the URL was already defined, we submit it to stop showing the embed placeholder.\n\t\t\t\tonSubmit( value );\n\t\t\t}\n\t\t} else {\n\t\t\t// Resets the URL when new value is empty\n\t\t\tonSubmit( '' );\n\t\t}\n\t}, [ url, onSubmit, value ] );\n\n\tfunction setAttributes( attributes ) {\n\t\tsetURL( attributes.url );\n\t}\n\n\treturn (\n\t\t<LinkSettingsNavigation\n\t\t\tisVisible={ isVisible }\n\t\t\turl={ url }\n\t\t\tonClose={ onClose }\n\t\t\tonDismiss={ onDismiss }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\toptions={ linkSettingsOptions }\n\t\t\ttestID=\"embed-edit-url-modal\"\n\t\t\twithBottomSheet\n\t\t\tshowIcon\n\t\t/>\n\t);\n};\n\nexport default EmbedBottomSheet;\n"]}
@@ -44,8 +44,7 @@ const EmbedPlaceholder = _ref => {
44
44
  onPress,
45
45
  cannotEmbed,
46
46
  fallback,
47
- tryAgain,
48
- openEmbedLinkSettings
47
+ tryAgain
49
48
  } = _ref;
50
49
  const containerStyle = (0, _compose.usePreferredColorSchemeStyle)(_styles.default.embed__container, _styles.default['embed__container--dark']);
51
50
  const labelStyle = (0, _compose.usePreferredColorSchemeStyle)(_styles.default.embed__label, _styles.default['embed__label--dark']);
@@ -66,15 +65,9 @@ const EmbedPlaceholder = _ref => {
66
65
  label: (0, _i18n.__)('Convert to link'),
67
66
  value: 'convertToLinkOption',
68
67
  onSelect: fallback
69
- },
70
- editLink: {
71
- id: 'editLinkOption',
72
- label: (0, _i18n.__)('Edit link'),
73
- value: 'editLinkOption',
74
- onSelect: openEmbedLinkSettings
75
68
  }
76
69
  };
77
- const options = (0, _lodash.compact)([cannotEmbed && errorPickerOptions.retry, cannotEmbed && errorPickerOptions.convertToLink, cannotEmbed && errorPickerOptions.editLink]);
70
+ const options = (0, _lodash.compact)([cannotEmbed && errorPickerOptions.retry, cannotEmbed && errorPickerOptions.convertToLink]);
78
71
 
79
72
  function onPickerSelect(value) {
80
73
  const selectedItem = options.find(item => item.value === value);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/embed/embed-placeholder.native.js"],"names":["EmbedPlaceholder","icon","isSelected","label","onPress","cannotEmbed","fallback","tryAgain","openEmbedLinkSettings","containerStyle","styles","embed__container","labelStyle","embed__label","descriptionStyle","embed__description","descriptionErrorStyle","actionStyle","embed__action","embedIconErrorStyle","cannotEmbedMenuPickerRef","errorPickerOptions","retry","id","value","onSelect","convertToLink","editLink","options","onPickerSelect","selectedItem","find","item","resolveOnPressEvent","current","presentPicker","noticeOutline","fill"],"mappings":";;;;;;;;;AAaA;;AAVA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAnBA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAMA,gBAAgB,GAAG,QASlB;AAAA,MAToB;AAC1BC,IAAAA,IAD0B;AAE1BC,IAAAA,UAF0B;AAG1BC,IAAAA,KAH0B;AAI1BC,IAAAA,OAJ0B;AAK1BC,IAAAA,WAL0B;AAM1BC,IAAAA,QAN0B;AAO1BC,IAAAA,QAP0B;AAQ1BC,IAAAA;AAR0B,GASpB;AACN,QAAMC,cAAc,GAAG,2CACtBC,gBAAOC,gBADe,EAEtBD,gBAAQ,wBAAR,CAFsB,CAAvB;AAIA,QAAME,UAAU,GAAG,2CAClBF,gBAAOG,YADW,EAElBH,gBAAQ,oBAAR,CAFkB,CAAnB;AAIA,QAAMI,gBAAgB,GAAGJ,gBAAOK,kBAAhC;AACA,QAAMC,qBAAqB,GAAGN,gBAAQ,2BAAR,CAA9B;AACA,QAAMO,WAAW,GAAG,2CACnBP,gBAAOQ,aADY,EAEnBR,gBAAQ,qBAAR,CAFmB,CAApB;AAIA,QAAMS,mBAAmB,GAAGT,gBAAQ,oBAAR,CAA5B;AAEA,QAAMU,wBAAwB,GAAG,sBAAjC;AAEA,QAAMC,kBAAkB,GAAG;AAC1BC,IAAAA,KAAK,EAAE;AACNC,MAAAA,EAAE,EAAE,aADE;AAENpB,MAAAA,KAAK,EAAE,cAAI,OAAJ,CAF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;AAAM,IAAA,KAAK,EAAGO;AAAd,KACGJ,WAAW,GACZ,qDACC,4BAAC,gBAAD;AACC,IAAA,IAAI,EAAG+B,wBADR;AAEC,IAAA,IAAI,EAAGjB,mBAAmB,CAACkB,IAF5B;AAGC,IAAA,KAAK,EAAGlB;AAHT,IADD,EAMC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,CACPL,gBADO,EAEPE,qBAFO;AADT,KAMG,cAAI,uBAAJ,CANH,CAND,EAcC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGC;AAAd,KACG,cAAI,cAAJ,CADH,CAdD,EAiBC,4BAAC,kBAAD;AACC,IAAA,KAAK,EAAG,cAAI,eAAJ,CADT;AAEC,IAAA,GAAG,EAAGG,wBAFP;AAGC,IAAA,OAAO,EAAGQ,OAHX;AAIC,IAAA,QAAQ,EAAGC,cAJZ;AAKC,IAAA,gBAAgB,MALjB;AAMC,IAAA,SAAS;AANV,IAjBD,CADY,GA4BZ,qDACC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAG5B;AAAlB,IADD,EAEC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGW;AAAd,KAA6BT,KAA7B,CAFD,EAGC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGc;AAAd,KACG,cAAI,UAAJ,CADH,CAHD,CA7BF,CAVD,CADD,CADD;AAqDA,CA1HD;;eA4HejB,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableWithoutFeedback } from 'react-native';\nimport { compact } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { Icon, Picker } from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport { noticeOutline } from '../../../components/src/mobile/gridicons';\n\nconst EmbedPlaceholder = ( {\n\ticon,\n\tisSelected,\n\tlabel,\n\tonPress,\n\tcannotEmbed,\n\tfallback,\n\ttryAgain,\n\topenEmbedLinkSettings,\n} ) => {\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__container,\n\t\tstyles[ 'embed__container--dark' ]\n\t);\n\tconst labelStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__label,\n\t\tstyles[ 'embed__label--dark' ]\n\t);\n\tconst descriptionStyle = styles.embed__description;\n\tconst descriptionErrorStyle = styles[ 'embed__description--error' ];\n\tconst actionStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__action,\n\t\tstyles[ 'embed__action--dark' ]\n\t);\n\tconst embedIconErrorStyle = styles[ 'embed__icon--error' ];\n\n\tconst cannotEmbedMenuPickerRef = useRef();\n\n\tconst errorPickerOptions = {\n\t\tretry: {\n\t\t\tid: 'retryOption',\n\t\t\tlabel: __( 'Retry' ),\n\t\t\tvalue: 'retryOption',\n\t\t\tonSelect: tryAgain,\n\t\t},\n\t\tconvertToLink: {\n\t\t\tid: 'convertToLinkOption',\n\t\t\tlabel: __( 'Convert to link' ),\n\t\t\tvalue: 'convertToLinkOption',\n\t\t\tonSelect: fallback,\n\t\t},\n\t\teditLink: {\n\t\t\tid: 'editLinkOption',\n\t\t\tlabel: __( 'Edit link' ),\n\t\t\tvalue: 'editLinkOption',\n\t\t\tonSelect: openEmbedLinkSettings,\n\t\t},\n\t};\n\n\tconst options = compact( [\n\t\tcannotEmbed && errorPickerOptions.retry,\n\t\tcannotEmbed && errorPickerOptions.convertToLink,\n\t\tcannotEmbed && errorPickerOptions.editLink,\n\t] );\n\n\tfunction onPickerSelect( value ) {\n\t\tconst selectedItem = options.find( ( item ) => item.value === value );\n\t\tselectedItem.onSelect();\n\t}\n\n\t// When the content cannot be embedded the onPress should trigger the Picker instead of the onPress prop.\n\tfunction resolveOnPressEvent() {\n\t\tif ( cannotEmbed ) {\n\t\t\tcannotEmbedMenuPickerRef.current?.presentPicker();\n\t\t} else {\n\t\t\tonPress();\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\taccessibilityHint={\n\t\t\t\t\tcannotEmbed\n\t\t\t\t\t\t? __( 'Double tap to view embed options.' )\n\t\t\t\t\t\t: __( 'Double tap to add a link.' )\n\t\t\t\t}\n\t\t\t\tonPress={ resolveOnPressEvent }\n\t\t\t\tdisabled={ ! isSelected }\n\t\t\t>\n\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t{ cannotEmbed ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ noticeOutline }\n\t\t\t\t\t\t\t\tfill={ embedIconErrorStyle.fill }\n\t\t\t\t\t\t\t\tstyle={ embedIconErrorStyle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\tdescriptionStyle,\n\t\t\t\t\t\t\t\t\tdescriptionErrorStyle,\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Unable to embed media' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text style={ actionStyle }>\n\t\t\t\t\t\t\t\t{ __( 'More options' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Picker\n\t\t\t\t\t\t\t\ttitle={ __( 'Embed options' ) }\n\t\t\t\t\t\t\t\tref={ cannotEmbedMenuPickerRef }\n\t\t\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\t\t\tonChange={ onPickerSelect }\n\t\t\t\t\t\t\t\thideCancelButton\n\t\t\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t\t\t<Text style={ labelStyle }>{ label }</Text>\n\t\t\t\t\t\t\t<Text style={ actionStyle }>\n\t\t\t\t\t\t\t\t{ __( 'ADD LINK' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</>\n\t);\n};\n\nexport default EmbedPlaceholder;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/embed/embed-placeholder.native.js"],"names":["EmbedPlaceholder","icon","isSelected","label","onPress","cannotEmbed","fallback","tryAgain","containerStyle","styles","embed__container","labelStyle","embed__label","descriptionStyle","embed__description","descriptionErrorStyle","actionStyle","embed__action","embedIconErrorStyle","cannotEmbedMenuPickerRef","errorPickerOptions","retry","id","value","onSelect","convertToLink","options","onPickerSelect","selectedItem","find","item","resolveOnPressEvent","current","presentPicker","noticeOutline","fill"],"mappings":";;;;;;;;;AAaA;;AAVA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAnBA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAMA,gBAAgB,GAAG,QAQlB;AAAA,MARoB;AAC1BC,IAAAA,IAD0B;AAE1BC,IAAAA,UAF0B;AAG1BC,IAAAA,KAH0B;AAI1BC,IAAAA,OAJ0B;AAK1BC,IAAAA,WAL0B;AAM1BC,IAAAA,QAN0B;AAO1BC,IAAAA;AAP0B,GAQpB;AACN,QAAMC,cAAc,GAAG,2CACtBC,gBAAOC,gBADe,EAEtBD,gBAAQ,wBAAR,CAFsB,CAAvB;AAIA,QAAME,UAAU,GAAG,2CAClBF,gBAAOG,YADW,EAElBH,gBAAQ,oBAAR,CAFkB,CAAnB;AAIA,QAAMI,gBAAgB,GAAGJ,gBAAOK,kBAAhC;AACA,QAAMC,qBAAqB,GAAGN,gBAAQ,2BAAR,CAA9B;AACA,QAAMO,WAAW,GAAG,2CACnBP,gBAAOQ,aADY,EAEnBR,gBAAQ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iBAAD;AAAM,IAAA,KAAK,EAAGM;AAAd,KACGH,WAAW,GACZ,qDACC,4BAAC,gBAAD;AACC,IAAA,IAAI,EAAG6B,wBADR;AAEC,IAAA,IAAI,EAAGhB,mBAAmB,CAACiB,IAF5B;AAGC,IAAA,KAAK,EAAGjB;AAHT,IADD,EAMC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,CACPL,gBADO,EAEPE,qBAFO;AADT,KAMG,cAAI,uBAAJ,CANH,CAND,EAcC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGC;AAAd,KACG,cAAI,cAAJ,CADH,CAdD,EAiBC,4BAAC,kBAAD;AACC,IAAA,KAAK,EAAG,cAAI,eAAJ,CADT;AAEC,IAAA,GAAG,EAAGG,wBAFP;AAGC,IAAA,OAAO,EAAGO,OAHX;AAIC,IAAA,QAAQ,EAAGC,cAJZ;AAKC,IAAA,gBAAgB,MALjB;AAMC,IAAA,SAAS;AANV,IAjBD,CADY,GA4BZ,qDACC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAG1B;AAAlB,IADD,EAEC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGU;AAAd,KAA6BR,KAA7B,CAFD,EAGC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGa;AAAd,KACG,cAAI,UAAJ,CADH,CAHD,CA7BF,CAVD,CADD,CADD;AAqDA,CAlHD;;eAoHehB,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableWithoutFeedback } from 'react-native';\nimport { compact } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { Icon, Picker } from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport { noticeOutline } from '../../../components/src/mobile/gridicons';\n\nconst EmbedPlaceholder = ( {\n\ticon,\n\tisSelected,\n\tlabel,\n\tonPress,\n\tcannotEmbed,\n\tfallback,\n\ttryAgain,\n} ) => {\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__container,\n\t\tstyles[ 'embed__container--dark' ]\n\t);\n\tconst labelStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__label,\n\t\tstyles[ 'embed__label--dark' ]\n\t);\n\tconst descriptionStyle = styles.embed__description;\n\tconst descriptionErrorStyle = styles[ 'embed__description--error' ];\n\tconst actionStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__action,\n\t\tstyles[ 'embed__action--dark' ]\n\t);\n\tconst embedIconErrorStyle = styles[ 'embed__icon--error' ];\n\n\tconst cannotEmbedMenuPickerRef = useRef();\n\n\tconst errorPickerOptions = {\n\t\tretry: {\n\t\t\tid: 'retryOption',\n\t\t\tlabel: __( 'Retry' ),\n\t\t\tvalue: 'retryOption',\n\t\t\tonSelect: tryAgain,\n\t\t},\n\t\tconvertToLink: {\n\t\t\tid: 'convertToLinkOption',\n\t\t\tlabel: __( 'Convert to link' ),\n\t\t\tvalue: 'convertToLinkOption',\n\t\t\tonSelect: fallback,\n\t\t},\n\t};\n\n\tconst options = compact( [\n\t\tcannotEmbed && errorPickerOptions.retry,\n\t\tcannotEmbed && errorPickerOptions.convertToLink,\n\t] );\n\n\tfunction onPickerSelect( value ) {\n\t\tconst selectedItem = options.find( ( item ) => item.value === value );\n\t\tselectedItem.onSelect();\n\t}\n\n\t// When the content cannot be embedded the onPress should trigger the Picker instead of the onPress prop.\n\tfunction resolveOnPressEvent() {\n\t\tif ( cannotEmbed ) {\n\t\t\tcannotEmbedMenuPickerRef.current?.presentPicker();\n\t\t} else {\n\t\t\tonPress();\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\taccessibilityHint={\n\t\t\t\t\tcannotEmbed\n\t\t\t\t\t\t? __( 'Double tap to view embed options.' )\n\t\t\t\t\t\t: __( 'Double tap to add a link.' )\n\t\t\t\t}\n\t\t\t\tonPress={ resolveOnPressEvent }\n\t\t\t\tdisabled={ ! isSelected }\n\t\t\t>\n\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t{ cannotEmbed ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ noticeOutline }\n\t\t\t\t\t\t\t\tfill={ embedIconErrorStyle.fill }\n\t\t\t\t\t\t\t\tstyle={ embedIconErrorStyle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\tdescriptionStyle,\n\t\t\t\t\t\t\t\t\tdescriptionErrorStyle,\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Unable to embed media' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text style={ actionStyle }>\n\t\t\t\t\t\t\t\t{ __( 'More options' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Picker\n\t\t\t\t\t\t\t\ttitle={ __( 'Embed options' ) }\n\t\t\t\t\t\t\t\tref={ cannotEmbedMenuPickerRef }\n\t\t\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\t\t\tonChange={ onPickerSelect }\n\t\t\t\t\t\t\t\thideCancelButton\n\t\t\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t\t\t<Text style={ labelStyle }>{ label }</Text>\n\t\t\t\t\t\t\t<Text style={ actionStyle }>\n\t\t\t\t\t\t\t\t{ __( 'ADD LINK' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</>\n\t);\n};\n\nexport default EmbedPlaceholder;\n"]}
@@ -23,7 +23,6 @@ var _icons = require("./icons");
23
23
  * Internal dependencies
24
24
  */
25
25
  const metadata = {
26
- $schema: "https://schemas.wp.org/trunk/block.json",
27
26
  apiVersion: 2,
28
27
  name: "core/embed",
29
28
  title: "Embed",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/embed/index.js"],"names":["name","metadata","settings","icon","embedContentIcon","edit","save","transforms","variations","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AATA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAEC,uBADiB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA,mBAJuB;AAKvBC,EAAAA,UAAU,EAAVA,mBALuB;AAMvBC,EAAAA,UAAU,EAAVA;AANuB,CAAjB","sourcesContent":["/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport save from './save';\nimport metadata from './block.json';\nimport transforms from './transforms';\nimport variations from './variations';\nimport deprecated from './deprecated';\nimport { embedContentIcon } from './icons';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: embedContentIcon,\n\tedit,\n\tsave,\n\ttransforms,\n\tvariations,\n\tdeprecated,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/embed/index.js"],"names":["name","metadata","settings","icon","embedContentIcon","edit","save","transforms","variations","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AATA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAEC,uBADiB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA,mBAJuB;AAKvBC,EAAAA,UAAU,EAAVA,mBALuB;AAMvBC,EAAAA,UAAU,EAAVA;AANuB,CAAjB","sourcesContent":["/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport save from './save';\nimport metadata from './block.json';\nimport transforms from './transforms';\nimport variations from './variations';\nimport deprecated from './deprecated';\nimport { embedContentIcon } from './icons';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: embedContentIcon,\n\tedit,\n\tsave,\n\ttransforms,\n\tvariations,\n\tdeprecated,\n};\n"]}
@@ -15,7 +15,6 @@ var _blocks = require("@wordpress/blocks");
15
15
  * Internal dependencies
16
16
  */
17
17
  const metadata = {
18
- $schema: "https://schemas.wp.org/trunk/block.json",
19
18
  apiVersion: 2,
20
19
  name: "core/embed",
21
20
  title: "Embed",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/embed/transforms.js"],"names":["name","EMBED_BLOCK","metadata","transforms","from","type","isMatch","node","nodeName","test","textContent","match","length","transform","url","trim","to","blocks","caption","value","content"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM;AAAEA,EAAAA,IAAI,EAAEC;AAAR,IAAwBC,QAA9B;AAEA;AACA;AACA;;AACA,MAAMC,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,KADP;AAECC,IAAAA,OAAO,EAAIC,IAAF;AAAA;;AAAA,aACRA,IAAI,CAACC,QAAL,KAAkB,GAAlB,IACA,4BAA4BC,IAA5B,CAAkCF,IAAI,CAACG,WAAvC,CADA,IAEA,sBAAAH,IAAI,CAACG,WAAL,iGAAkBC,KAAlB,CAAyB,SAAzB,iFAAsCC,MAAtC,MAAiD,CAHzC;AAAA,KAFV;AAMCC,IAAAA,SAAS,EAAIN,IAAF,IAAY;AACtB,aAAO,yBAAaN,WAAb,EAA0B;AAChCa,QAAAA,GAAG,EAAEP,IAAI,CAACG,WAAL,CAAiBK,IAAjB;AAD2B,OAA1B,CAAP;AAGA;AAVF,GADK,CADY;AAelBC,EAAAA,EAAE,EAAE,CACH;AACCX,IAAAA,IAAI,EAAE,OADP;AAECY,IAAAA,MAAM,EAAE,CAAE,gBAAF,CAFT;AAGCX,IAAAA,OAAO,EAAE;AAAA,UAAE;AAAEQ,QAAAA;AAAF,OAAF;AAAA,aAAe,CAAC,CAAEA,GAAlB;AAAA,KAHV;AAICD,IAAAA,SAAS,EAAE,SAAwB;AAAA,UAAtB;AAAEC,QAAAA,GAAF;AAAOI,QAAAA;AAAP,OAAsB;AAClC,UAAIC,KAAK,GAAI,YAAYL,GAAK,KAAKA,GAAK,MAAxC;;AACA,UAAKI,OAAL,aAAKA,OAAL,eAAKA,OAAO,CAAEH,IAAT,EAAL,EAAuB;AACtBI,QAAAA,KAAK,IAAK,SAASD,OAAS,EAA5B;AACA;;AACD,aAAO,yBAAa,gBAAb,EAA+B;AACrCE,QAAAA,OAAO,EAAED;AAD4B,OAA/B,CAAP;AAGA;AAZF,GADG;AAfc,CAAnB;eAiCehB,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\nconst { name: EMBED_BLOCK } = metadata;\n\n/**\n * Default transforms for generic embeds.\n */\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tisMatch: ( node ) =>\n\t\t\t\tnode.nodeName === 'P' &&\n\t\t\t\t/^\\s*(https?:\\/\\/\\S+)\\s*$/i.test( node.textContent ) &&\n\t\t\t\tnode.textContent?.match( /https/gi )?.length === 1,\n\t\t\ttransform: ( node ) => {\n\t\t\t\treturn createBlock( EMBED_BLOCK, {\n\t\t\t\t\turl: node.textContent.trim(),\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\tisMatch: ( { url } ) => !! url,\n\t\t\ttransform: ( { url, caption } ) => {\n\t\t\t\tlet value = `<a href=\"${ url }\">${ url }</a>`;\n\t\t\t\tif ( caption?.trim() ) {\n\t\t\t\t\tvalue += `<br />${ caption }`;\n\t\t\t\t}\n\t\t\t\treturn createBlock( 'core/paragraph', {\n\t\t\t\t\tcontent: value,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/embed/transforms.js"],"names":["name","EMBED_BLOCK","metadata","transforms","from","type","isMatch","node","nodeName","test","textContent","match","length","transform","url","trim","to","blocks","caption","value","content"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM;AAAEA,EAAAA,IAAI,EAAEC;AAAR,IAAwBC,QAA9B;AAEA;AACA;AACA;;AACA,MAAMC,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,KADP;AAECC,IAAAA,OAAO,EAAIC,IAAF;AAAA;;AAAA,aACRA,IAAI,CAACC,QAAL,KAAkB,GAAlB,IACA,4BAA4BC,IAA5B,CAAkCF,IAAI,CAACG,WAAvC,CADA,IAEA,sBAAAH,IAAI,CAACG,WAAL,iGAAkBC,KAAlB,CAAyB,SAAzB,iFAAsCC,MAAtC,MAAiD,CAHzC;AAAA,KAFV;AAMCC,IAAAA,SAAS,EAAIN,IAAF,IAAY;AACtB,aAAO,yBAAaN,WAAb,EAA0B;AAChCa,QAAAA,GAAG,EAAEP,IAAI,CAACG,WAAL,CAAiBK,IAAjB;AAD2B,OAA1B,CAAP;AAGA;AAVF,GADK,CADY;AAelBC,EAAAA,EAAE,EAAE,CACH;AACCX,IAAAA,IAAI,EAAE,OADP;AAECY,IAAAA,MAAM,EAAE,CAAE,gBAAF,CAFT;AAGCX,IAAAA,OAAO,EAAE;AAAA,UAAE;AAAEQ,QAAAA;AAAF,OAAF;AAAA,aAAe,CAAC,CAAEA,GAAlB;AAAA,KAHV;AAICD,IAAAA,SAAS,EAAE,SAAwB;AAAA,UAAtB;AAAEC,QAAAA,GAAF;AAAOI,QAAAA;AAAP,OAAsB;AAClC,UAAIC,KAAK,GAAI,YAAYL,GAAK,KAAKA,GAAK,MAAxC;;AACA,UAAKI,OAAL,aAAKA,OAAL,eAAKA,OAAO,CAAEH,IAAT,EAAL,EAAuB;AACtBI,QAAAA,KAAK,IAAK,SAASD,OAAS,EAA5B;AACA;;AACD,aAAO,yBAAa,gBAAb,EAA+B;AACrCE,QAAAA,OAAO,EAAED;AAD4B,OAA/B,CAAP;AAGA;AAZF,GADG;AAfc,CAAnB;eAiCehB,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\nconst { name: EMBED_BLOCK } = metadata;\n\n/**\n * Default transforms for generic embeds.\n */\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tisMatch: ( node ) =>\n\t\t\t\tnode.nodeName === 'P' &&\n\t\t\t\t/^\\s*(https?:\\/\\/\\S+)\\s*$/i.test( node.textContent ) &&\n\t\t\t\tnode.textContent?.match( /https/gi )?.length === 1,\n\t\t\ttransform: ( node ) => {\n\t\t\t\treturn createBlock( EMBED_BLOCK, {\n\t\t\t\t\turl: node.textContent.trim(),\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\tisMatch: ( { url } ) => !! url,\n\t\t\ttransform: ( { url, caption } ) => {\n\t\t\t\tlet value = `<a href=\"${ url }\">${ url }</a>`;\n\t\t\t\tif ( caption?.trim() ) {\n\t\t\t\t\tvalue += `<br />${ caption }`;\n\t\t\t\t}\n\t\t\t\treturn createBlock( 'core/paragraph', {\n\t\t\t\t\tcontent: value,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
@@ -39,7 +39,6 @@ var _blocks = require("@wordpress/blocks");
39
39
  * Internal dependencies
40
40
  */
41
41
  const metadata = {
42
- $schema: "https://schemas.wp.org/trunk/block.json",
43
42
  apiVersion: 2,
44
43
  name: "core/embed",
45
44
  title: "Embed",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/embed/util.js"],"names":["name","DEFAULT_EMBED_BLOCK","metadata","getEmbedInfoByProvider","provider","find","matchesPatterns","url","patterns","some","pattern","match","findMoreSuitableBlock","isFromWordPress","html","includes","getPhotoHtml","photo","imageUrl","thumbnail_url","photoPreview","title","createUpgradedEmbedBlock","props","attributesFromPreview","preview","attributes","providerNameSlug","type","restAttributes","matchedBlock","isCurrentBlockWP","WP_EMBED_TYPE","shouldCreateNewBlock","wpVariation","removeAspectRatioClasses","existingClassNames","aspectRatioClassNames","ASPECT_RATIOS","reduce","accumulator","className","getClassNames","allowResponsive","previewDocument","document","implementation","createHTMLDocument","body","innerHTML","iframe","querySelector","height","width","aspectRatio","toFixed","ratioIndex","length","potentialRatio","ratio","ratioDiff","fallback","onReplace","link","content","getAttributesFromPreview","currentClassNames","isResponsive","provider_name","providerName","toLowerCase"],"mappings":";;;;;;;;;;;;;AAeA;;AAZA;;AAKA;;AACA;;AACA;;AAMA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAQA;AACA;AACA;;;;;;;;;;;;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AACA;;AACA,QAAM;AAAEX,IAAAA,IAAF;AAAQsD,IAAAA,aAAa,EAAEC;AAAvB,MAAwC5C,OAA9C;AACA,QAAME,gBAAgB,GAAG,uBACxB,CAAE0C,YAAY,IAAIhD,KAAlB,EAA0BiD,WAA1B,EADwB,CAAzB;;AAIA,MAAKzD,eAAe,CAAEC,IAAF,CAApB,EAA+B;AAC9Bc,IAAAA,IAAI,GAAGI,wBAAP;AACA;;AAED,MAAKlB,IAAI,IAAI,YAAYc,IAAzB,EAAgC;AAC/BF,IAAAA,UAAU,CAACE,IAAX,GAAkBA,IAAlB;AACAF,IAAAA,UAAU,CAACC,gBAAX,GAA8BA,gBAA9B;AACA;;AAEDD,EAAAA,UAAU,CAACe,SAAX,GAAuBC,aAAa,CACnC5B,IADmC,EAEnCoD,iBAFmC,EAGnCC,YAAY,IAAIxB,eAHmB,CAApC;AAMA,SAAOjB,UAAP;AACA,CAtCsC,CAAjC","sourcesContent":["/**\n * Internal dependencies\n */\nimport { ASPECT_RATIOS, WP_EMBED_TYPE } from './constants';\n\n/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport classnames from 'classnames/dedupe';\nimport memoize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport {\n\tcreateBlock,\n\tgetBlockType,\n\tgetBlockVariations,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\nconst { name: DEFAULT_EMBED_BLOCK } = metadata;\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\n/**\n * Returns the embed block's information by matching the provided service provider\n *\n * @param {string} provider The embed block's provider\n * @return {WPBlockVariation} The embed block's information\n */\nexport const getEmbedInfoByProvider = ( provider ) =>\n\tgetBlockVariations( DEFAULT_EMBED_BLOCK )?.find(\n\t\t( { name } ) => name === provider\n\t);\n\n/**\n * Returns true if any of the regular expressions match the URL.\n *\n * @param {string} url The URL to test.\n * @param {Array} patterns The list of regular expressions to test agains.\n * @return {boolean} True if any of the regular expressions match the URL.\n */\nexport const matchesPatterns = ( url, patterns = [] ) =>\n\tpatterns.some( ( pattern ) => url.match( pattern ) );\n\n/**\n * Finds the block variation that should be used for the URL,\n * based on the provided URL and the variation's patterns.\n *\n * @param {string} url The URL to test.\n * @return {WPBlockVariation} The block variation that should be used for this URL\n */\nexport const findMoreSuitableBlock = ( url ) =>\n\tgetBlockVariations( DEFAULT_EMBED_BLOCK )?.find( ( { patterns } ) =>\n\t\tmatchesPatterns( url, patterns )\n\t);\n\nexport const isFromWordPress = ( html ) =>\n\thtml && html.includes( 'class=\"wp-embedded-content\"' );\n\nexport const getPhotoHtml = ( photo ) => {\n\t// 100% width for the preview so it fits nicely into the document, some \"thumbnails\" are\n\t// actually the full size photo. If thumbnails not found, use full image.\n\tconst imageUrl = photo.thumbnail_url || photo.url;\n\tconst photoPreview = (\n\t\t<p>\n\t\t\t<img src={ imageUrl } alt={ photo.title } width=\"100%\" />\n\t\t</p>\n\t);\n\treturn renderToString( photoPreview );\n};\n\n/**\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\nexport const createUpgradedEmbedBlock = (\n\tprops,\n\tattributesFromPreview = {}\n) => {\n\tconst { preview, attributes = {} } = props;\n\tconst { url, providerNameSlug, type, ...restAttributes } = attributes;\n\n\tif ( ! url || ! getBlockType( DEFAULT_EMBED_BLOCK ) ) return;\n\n\tconst matchedBlock = findMoreSuitableBlock( url );\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tconst isCurrentBlockWP =\n\t\tproviderNameSlug === 'wordpress' || type === WP_EMBED_TYPE;\n\t// if current block is not WordPress and a more suitable block found\n\t// that is different from the current one, create the new matched block\n\tconst shouldCreateNewBlock =\n\t\t! isCurrentBlockWP &&\n\t\tmatchedBlock &&\n\t\t( matchedBlock.attributes.providerNameSlug !== providerNameSlug ||\n\t\t\t! providerNameSlug );\n\tif ( shouldCreateNewBlock ) {\n\t\treturn createBlock( DEFAULT_EMBED_BLOCK, {\n\t\t\turl,\n\t\t\t...restAttributes,\n\t\t\t...matchedBlock.attributes,\n\t\t} );\n\t}\n\n\tconst wpVariation = getBlockVariations( DEFAULT_EMBED_BLOCK )?.find(\n\t\t( { name } ) => name === 'wordpress'\n\t);\n\n\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\tif (\n\t\t! wpVariation ||\n\t\t! preview ||\n\t\t! isFromWordPress( preview.html ) ||\n\t\tisCurrentBlockWP\n\t) {\n\t\treturn;\n\t}\n\n\t// This is not the WordPress embed block so transform it into one.\n\treturn createBlock( DEFAULT_EMBED_BLOCK, {\n\t\turl,\n\t\t...wpVariation.attributes,\n\t\t// By now we have the preview, but when the new block first renders, it\n\t\t// won't have had all the attributes set, and so won't get the correct\n\t\t// type and it won't render correctly. So, we pass through the current attributes\n\t\t// here so that the initial render works when we switch to the WordPress\n\t\t// block. This only affects the WordPress block because it can't be\n\t\t// rendered in the usual Sandbox (it has a sandbox of its own) and it\n\t\t// relies on the preview to set the correct render type.\n\t\t...attributesFromPreview,\n\t} );\n};\n\n/**\n * Removes all previously set aspect ratio related classes and return the rest\n * existing class names.\n *\n * @param {string} existingClassNames Any existing class names.\n * @return {string} The class names without any aspect ratio related class.\n */\nexport const removeAspectRatioClasses = ( existingClassNames ) => {\n\tif ( ! existingClassNames ) {\n\t\t// Avoids extraneous work and also, by returning the same value as\n\t\t// received, ensures the post is not dirtied by a change of the block\n\t\t// attribute from `undefined` to an emtpy string.\n\t\treturn existingClassNames;\n\t}\n\tconst aspectRatioClassNames = ASPECT_RATIOS.reduce(\n\t\t( accumulator, { className } ) => {\n\t\t\taccumulator[ className ] = false;\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ 'wp-has-aspect-ratio': false }\n\t);\n\treturn classnames( existingClassNames, aspectRatioClassNames );\n};\n\n/**\n * Returns class names with any relevant responsive aspect ratio names.\n *\n * @param {string} html The preview HTML that possibly contains an iframe with width and height set.\n * @param {string} existingClassNames Any existing class names.\n * @param {boolean} allowResponsive If the responsive class names should be added, or removed.\n * @return {string} Deduped class names.\n */\nexport function getClassNames(\n\thtml,\n\texistingClassNames,\n\tallowResponsive = true\n) {\n\tif ( ! allowResponsive ) {\n\t\treturn removeAspectRatioClasses( existingClassNames );\n\t}\n\n\tconst previewDocument = document.implementation.createHTMLDocument( '' );\n\tpreviewDocument.body.innerHTML = html;\n\tconst iframe = previewDocument.body.querySelector( 'iframe' );\n\n\t// If we have a fixed aspect iframe, and it's a responsive embed block.\n\tif ( iframe && iframe.height && iframe.width ) {\n\t\tconst aspectRatio = ( iframe.width / iframe.height ).toFixed( 2 );\n\t\t// Given the actual aspect ratio, find the widest ratio to support it.\n\t\tfor (\n\t\t\tlet ratioIndex = 0;\n\t\t\tratioIndex < ASPECT_RATIOS.length;\n\t\t\tratioIndex++\n\t\t) {\n\t\t\tconst potentialRatio = ASPECT_RATIOS[ ratioIndex ];\n\t\t\tif ( aspectRatio >= potentialRatio.ratio ) {\n\t\t\t\t// Evaluate the difference between actual aspect ratio and closest match.\n\t\t\t\t// If the difference is too big, do not scale the embed according to aspect ratio.\n\t\t\t\tconst ratioDiff = aspectRatio - potentialRatio.ratio;\n\t\t\t\tif ( ratioDiff > 0.1 ) {\n\t\t\t\t\t// No close aspect ratio match found.\n\t\t\t\t\treturn removeAspectRatioClasses( existingClassNames );\n\t\t\t\t}\n\t\t\t\t// Close aspect ratio match found.\n\t\t\t\treturn classnames(\n\t\t\t\t\tremoveAspectRatioClasses( existingClassNames ),\n\t\t\t\t\tpotentialRatio.className,\n\t\t\t\t\t'wp-has-aspect-ratio'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn existingClassNames;\n}\n\n/**\n * Fallback behaviour for unembeddable URLs.\n * Creates a paragraph block containing a link to the URL, and calls `onReplace`.\n *\n * @param {string} url The URL that could not be embedded.\n * @param {Function} onReplace Function to call with the created fallback block.\n */\nexport function fallback( url, onReplace ) {\n\tconst link = <a href={ url }>{ url }</a>;\n\tonReplace(\n\t\tcreateBlock( 'core/paragraph', { content: renderToString( link ) } )\n\t);\n}\n\n/***\n * Gets block attributes based on the preview and responsive state.\n *\n * @param {Object} preview The preview data.\n * @param {string} title The block's title, e.g. Twitter.\n * @param {Object} currentClassNames The block's current class names.\n * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.\n * @param {boolean} allowResponsive Apply responsive classes to fixed size content.\n * @return {Object} Attributes and values.\n */\nexport const getAttributesFromPreview = memoize(\n\t(\n\t\tpreview,\n\t\ttitle,\n\t\tcurrentClassNames,\n\t\tisResponsive,\n\t\tallowResponsive = true\n\t) => {\n\t\tif ( ! preview ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst attributes = {};\n\t\t// Some plugins only return HTML with no type info, so default this to 'rich'.\n\t\tlet { type = 'rich' } = preview;\n\t\t// If we got a provider name from the API, use it for the slug, otherwise we use the title,\n\t\t// because not all embed code gives us a provider name.\n\t\tconst { html, provider_name: providerName } = preview;\n\t\tconst providerNameSlug = kebabCase(\n\t\t\t( providerName || title ).toLowerCase()\n\t\t);\n\n\t\tif ( isFromWordPress( html ) ) {\n\t\t\ttype = WP_EMBED_TYPE;\n\t\t}\n\n\t\tif ( html || 'photo' === type ) {\n\t\t\tattributes.type = type;\n\t\t\tattributes.providerNameSlug = providerNameSlug;\n\t\t}\n\n\t\tattributes.className = getClassNames(\n\t\t\thtml,\n\t\t\tcurrentClassNames,\n\t\t\tisResponsive && allowResponsive\n\t\t);\n\n\t\treturn attributes;\n\t}\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/embed/util.js"],"names":["name","DEFAULT_EMBED_BLOCK","metadata","getEmbedInfoByProvider","provider","find","matchesPatterns","url","patterns","some","pattern","match","findMoreSuitableBlock","isFromWordPress","html","includes","getPhotoHtml","photo","imageUrl","thumbnail_url","photoPreview","title","createUpgradedEmbedBlock","props","attributesFromPreview","preview","attributes","providerNameSlug","type","restAttributes","matchedBlock","isCurrentBlockWP","WP_EMBED_TYPE","shouldCreateNewBlock","wpVariation","removeAspectRatioClasses","existingClassNames","aspectRatioClassNames","ASPECT_RATIOS","reduce","accumulator","className","getClassNames","allowResponsive","previewDocument","document","implementation","createHTMLDocument","body","innerHTML","iframe","querySelector","height","width","aspectRatio","toFixed","ratioIndex","length","potentialRatio","ratio","ratioDiff","fallback","onReplace","link","content","getAttributesFromPreview","currentClassNames","isResponsive","provider_name","providerName","toLowerCase"],"mappings":";;;;;;;;;;;;;AAeA;;AAZA;;AAKA;;AACA;;AACA;;AAMA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAQA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM;AAAEA,EAAAA,IAAI,EAAEC;AAAR,IAAgCC,QAAtC;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMC,sBAAsB,GAAKC,QAAF;AAAA;;AAAA,gCACrC,gCAAoBH,mBAApB,CADqC,wDACrC,oBAA2CI,IAA3C,CACC;AAAA,QAAE;AAAEL,MAAAA;AAAF,KAAF;AAAA,WAAgBA,IAAI,KAAKI,QAAzB;AAAA,GADD,CADqC;AAAA,CAA/B;AAKP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAME,eAAe,GAAG,UAAEC,GAAF;AAAA,MAAOC,QAAP,uEAAkB,EAAlB;AAAA,SAC9BA,QAAQ,CAACC,IAAT,CAAiBC,OAAF,IAAeH,GAAG,CAACI,KAAJ,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mB,CAApC;AAMA,SAAOjB,UAAP;AACA,CAtCsC,CAAjC","sourcesContent":["/**\n * Internal dependencies\n */\nimport { ASPECT_RATIOS, WP_EMBED_TYPE } from './constants';\n\n/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport classnames from 'classnames/dedupe';\nimport memoize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport {\n\tcreateBlock,\n\tgetBlockType,\n\tgetBlockVariations,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\nconst { name: DEFAULT_EMBED_BLOCK } = metadata;\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\n/**\n * Returns the embed block's information by matching the provided service provider\n *\n * @param {string} provider The embed block's provider\n * @return {WPBlockVariation} The embed block's information\n */\nexport const getEmbedInfoByProvider = ( provider ) =>\n\tgetBlockVariations( DEFAULT_EMBED_BLOCK )?.find(\n\t\t( { name } ) => name === provider\n\t);\n\n/**\n * Returns true if any of the regular expressions match the URL.\n *\n * @param {string} url The URL to test.\n * @param {Array} patterns The list of regular expressions to test agains.\n * @return {boolean} True if any of the regular expressions match the URL.\n */\nexport const matchesPatterns = ( url, patterns = [] ) =>\n\tpatterns.some( ( pattern ) => url.match( pattern ) );\n\n/**\n * Finds the block variation that should be used for the URL,\n * based on the provided URL and the variation's patterns.\n *\n * @param {string} url The URL to test.\n * @return {WPBlockVariation} The block variation that should be used for this URL\n */\nexport const findMoreSuitableBlock = ( url ) =>\n\tgetBlockVariations( DEFAULT_EMBED_BLOCK )?.find( ( { patterns } ) =>\n\t\tmatchesPatterns( url, patterns )\n\t);\n\nexport const isFromWordPress = ( html ) =>\n\thtml && html.includes( 'class=\"wp-embedded-content\"' );\n\nexport const getPhotoHtml = ( photo ) => {\n\t// 100% width for the preview so it fits nicely into the document, some \"thumbnails\" are\n\t// actually the full size photo. If thumbnails not found, use full image.\n\tconst imageUrl = photo.thumbnail_url || photo.url;\n\tconst photoPreview = (\n\t\t<p>\n\t\t\t<img src={ imageUrl } alt={ photo.title } width=\"100%\" />\n\t\t</p>\n\t);\n\treturn renderToString( photoPreview );\n};\n\n/**\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\nexport const createUpgradedEmbedBlock = (\n\tprops,\n\tattributesFromPreview = {}\n) => {\n\tconst { preview, attributes = {} } = props;\n\tconst { url, providerNameSlug, type, ...restAttributes } = attributes;\n\n\tif ( ! url || ! getBlockType( DEFAULT_EMBED_BLOCK ) ) return;\n\n\tconst matchedBlock = findMoreSuitableBlock( url );\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tconst isCurrentBlockWP =\n\t\tproviderNameSlug === 'wordpress' || type === WP_EMBED_TYPE;\n\t// if current block is not WordPress and a more suitable block found\n\t// that is different from the current one, create the new matched block\n\tconst shouldCreateNewBlock =\n\t\t! isCurrentBlockWP &&\n\t\tmatchedBlock &&\n\t\t( matchedBlock.attributes.providerNameSlug !== providerNameSlug ||\n\t\t\t! providerNameSlug );\n\tif ( shouldCreateNewBlock ) {\n\t\treturn createBlock( DEFAULT_EMBED_BLOCK, {\n\t\t\turl,\n\t\t\t...restAttributes,\n\t\t\t...matchedBlock.attributes,\n\t\t} );\n\t}\n\n\tconst wpVariation = getBlockVariations( DEFAULT_EMBED_BLOCK )?.find(\n\t\t( { name } ) => name === 'wordpress'\n\t);\n\n\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\tif (\n\t\t! wpVariation ||\n\t\t! preview ||\n\t\t! isFromWordPress( preview.html ) ||\n\t\tisCurrentBlockWP\n\t) {\n\t\treturn;\n\t}\n\n\t// This is not the WordPress embed block so transform it into one.\n\treturn createBlock( DEFAULT_EMBED_BLOCK, {\n\t\turl,\n\t\t...wpVariation.attributes,\n\t\t// By now we have the preview, but when the new block first renders, it\n\t\t// won't have had all the attributes set, and so won't get the correct\n\t\t// type and it won't render correctly. So, we pass through the current attributes\n\t\t// here so that the initial render works when we switch to the WordPress\n\t\t// block. This only affects the WordPress block because it can't be\n\t\t// rendered in the usual Sandbox (it has a sandbox of its own) and it\n\t\t// relies on the preview to set the correct render type.\n\t\t...attributesFromPreview,\n\t} );\n};\n\n/**\n * Removes all previously set aspect ratio related classes and return the rest\n * existing class names.\n *\n * @param {string} existingClassNames Any existing class names.\n * @return {string} The class names without any aspect ratio related class.\n */\nexport const removeAspectRatioClasses = ( existingClassNames ) => {\n\tif ( ! existingClassNames ) {\n\t\t// Avoids extraneous work and also, by returning the same value as\n\t\t// received, ensures the post is not dirtied by a change of the block\n\t\t// attribute from `undefined` to an emtpy string.\n\t\treturn existingClassNames;\n\t}\n\tconst aspectRatioClassNames = ASPECT_RATIOS.reduce(\n\t\t( accumulator, { className } ) => {\n\t\t\taccumulator[ className ] = false;\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ 'wp-has-aspect-ratio': false }\n\t);\n\treturn classnames( existingClassNames, aspectRatioClassNames );\n};\n\n/**\n * Returns class names with any relevant responsive aspect ratio names.\n *\n * @param {string} html The preview HTML that possibly contains an iframe with width and height set.\n * @param {string} existingClassNames Any existing class names.\n * @param {boolean} allowResponsive If the responsive class names should be added, or removed.\n * @return {string} Deduped class names.\n */\nexport function getClassNames(\n\thtml,\n\texistingClassNames,\n\tallowResponsive = true\n) {\n\tif ( ! allowResponsive ) {\n\t\treturn removeAspectRatioClasses( existingClassNames );\n\t}\n\n\tconst previewDocument = document.implementation.createHTMLDocument( '' );\n\tpreviewDocument.body.innerHTML = html;\n\tconst iframe = previewDocument.body.querySelector( 'iframe' );\n\n\t// If we have a fixed aspect iframe, and it's a responsive embed block.\n\tif ( iframe && iframe.height && iframe.width ) {\n\t\tconst aspectRatio = ( iframe.width / iframe.height ).toFixed( 2 );\n\t\t// Given the actual aspect ratio, find the widest ratio to support it.\n\t\tfor (\n\t\t\tlet ratioIndex = 0;\n\t\t\tratioIndex < ASPECT_RATIOS.length;\n\t\t\tratioIndex++\n\t\t) {\n\t\t\tconst potentialRatio = ASPECT_RATIOS[ ratioIndex ];\n\t\t\tif ( aspectRatio >= potentialRatio.ratio ) {\n\t\t\t\t// Evaluate the difference between actual aspect ratio and closest match.\n\t\t\t\t// If the difference is too big, do not scale the embed according to aspect ratio.\n\t\t\t\tconst ratioDiff = aspectRatio - potentialRatio.ratio;\n\t\t\t\tif ( ratioDiff > 0.1 ) {\n\t\t\t\t\t// No close aspect ratio match found.\n\t\t\t\t\treturn removeAspectRatioClasses( existingClassNames );\n\t\t\t\t}\n\t\t\t\t// Close aspect ratio match found.\n\t\t\t\treturn classnames(\n\t\t\t\t\tremoveAspectRatioClasses( existingClassNames ),\n\t\t\t\t\tpotentialRatio.className,\n\t\t\t\t\t'wp-has-aspect-ratio'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn existingClassNames;\n}\n\n/**\n * Fallback behaviour for unembeddable URLs.\n * Creates a paragraph block containing a link to the URL, and calls `onReplace`.\n *\n * @param {string} url The URL that could not be embedded.\n * @param {Function} onReplace Function to call with the created fallback block.\n */\nexport function fallback( url, onReplace ) {\n\tconst link = <a href={ url }>{ url }</a>;\n\tonReplace(\n\t\tcreateBlock( 'core/paragraph', { content: renderToString( link ) } )\n\t);\n}\n\n/***\n * Gets block attributes based on the preview and responsive state.\n *\n * @param {Object} preview The preview data.\n * @param {string} title The block's title, e.g. Twitter.\n * @param {Object} currentClassNames The block's current class names.\n * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.\n * @param {boolean} allowResponsive Apply responsive classes to fixed size content.\n * @return {Object} Attributes and values.\n */\nexport const getAttributesFromPreview = memoize(\n\t(\n\t\tpreview,\n\t\ttitle,\n\t\tcurrentClassNames,\n\t\tisResponsive,\n\t\tallowResponsive = true\n\t) => {\n\t\tif ( ! preview ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst attributes = {};\n\t\t// Some plugins only return HTML with no type info, so default this to 'rich'.\n\t\tlet { type = 'rich' } = preview;\n\t\t// If we got a provider name from the API, use it for the slug, otherwise we use the title,\n\t\t// because not all embed code gives us a provider name.\n\t\tconst { html, provider_name: providerName } = preview;\n\t\tconst providerNameSlug = kebabCase(\n\t\t\t( providerName || title ).toLowerCase()\n\t\t);\n\n\t\tif ( isFromWordPress( html ) ) {\n\t\t\ttype = WP_EMBED_TYPE;\n\t\t}\n\n\t\tif ( html || 'photo' === type ) {\n\t\t\tattributes.type = type;\n\t\t\tattributes.providerNameSlug = providerNameSlug;\n\t\t}\n\n\t\tattributes.className = getClassNames(\n\t\t\thtml,\n\t\t\tcurrentClassNames,\n\t\t\tisResponsive && allowResponsive\n\t\t);\n\n\t\treturn attributes;\n\t}\n);\n"]}
@@ -27,7 +27,6 @@ var _transforms = _interopRequireDefault(require("./transforms"));
27
27
  * Internal dependencies
28
28
  */
29
29
  const metadata = {
30
- $schema: "https://schemas.wp.org/trunk/block.json",
31
30
  apiVersion: 2,
32
31
  name: "core/file",
33
32
  title: "File",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/file/index.js"],"names":["name","metadata","settings","icon","example","attributes","href","fileName","transforms","deprecated","edit","save"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,WADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,IAAI,EACH,8EAFU;AAGXC,MAAAA,QAAQ,EAAE,cAAI,sBAAJ,EAA4B,kBAA5B;AAHC;AADJ,GAFc;AASvBC,EAAAA,UAAU,EAAVA,mBATuB;AAUvBC,EAAAA,UAAU,EAAVA,mBAVuB;AAWvBC,EAAAA,IAAI,EAAJA,aAXuB;AAYvBC,EAAAA,IAAI,EAAJA;AAZuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { file as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\thref:\n\t\t\t\t'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',\n\t\t\tfileName: _x( 'Armstrong_Small_Step', 'Name of the file' ),\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tedit,\n\tsave,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/file/index.js"],"names":["name","metadata","settings","icon","example","attributes","href","fileName","transforms","deprecated","edit","save"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,WADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,IAAI,EACH,8EAFU;AAGXC,MAAAA,QAAQ,EAAE,cAAI,sBAAJ,EAA4B,kBAA5B;AAHC;AADJ,GAFc;AASvBC,EAAAA,UAAU,EAAVA,mBATuB;AAUvBC,EAAAA,UAAU,EAAVA,mBAVuB;AAWvBC,EAAAA,IAAI,EAAJA,aAXuB;AAYvBC,EAAAA,IAAI,EAAJA;AAZuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { file as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\thref:\n\t\t\t\t'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',\n\t\t\tfileName: _x( 'Armstrong_Small_Step', 'Name of the file' ),\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tedit,\n\tsave,\n};\n"]}
@@ -21,7 +21,6 @@ var _save = _interopRequireDefault(require("./save"));
21
21
  * Internal dependencies
22
22
  */
23
23
  const metadata = {
24
- $schema: "https://schemas.wp.org/trunk/block.json",
25
24
  apiVersion: 2,
26
25
  name: "core/freeform",
27
26
  title: "Classic",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/freeform/index.js"],"names":["name","metadata","settings","icon","edit","save"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,cADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { classic as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/freeform/index.js"],"names":["name","metadata","settings","icon","edit","save"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,cADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { classic as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n"]}
@@ -136,9 +136,6 @@ function GalleryEdit(props) {
136
136
 
137
137
  return (_select$getBlock = select(_blockEditor.store).getBlock(clientId)) === null || _select$getBlock === void 0 ? void 0 : _select$getBlock.innerBlocks;
138
138
  }, [clientId]);
139
- const wasBlockJustInserted = (0, _data.useSelect)(select => {
140
- return select(_blockEditor.store).wasBlockJustInserted(clientId, 'inserter_menu');
141
- }, [clientId]);
142
139
  const images = (0, _element.useMemo)(() => innerBlockImages === null || innerBlockImages === void 0 ? void 0 : innerBlockImages.map(block => ({
143
140
  clientId: block.clientId,
144
141
  id: block.attributes.id,
@@ -378,8 +375,7 @@ function GalleryEdit(props) {
378
375
  multiple: true,
379
376
  value: hasImageIds ? images : {},
380
377
  onError: onUploadError,
381
- notices: hasImages ? undefined : noticeUI,
382
- autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted
378
+ notices: hasImages ? undefined : noticeUI
383
379
  });
384
380
  const blockProps = (0, _blockEditor.useBlockProps)({
385
381
  className: (0, _classnames.default)(className, 'has-nested-images')