@wordpress/block-library 9.23.0 → 9.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (606) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/button/edit.js +29 -17
  3. package/build/button/edit.js.map +1 -1
  4. package/build/code/index.js +2 -1
  5. package/build/code/index.js.map +1 -1
  6. package/build/columns/edit.js +18 -22
  7. package/build/columns/edit.js.map +1 -1
  8. package/build/comment-author-name/edit.js +41 -12
  9. package/build/comment-author-name/edit.js.map +1 -1
  10. package/build/comment-date/edit.js +41 -12
  11. package/build/comment-date/edit.js.map +1 -1
  12. package/build/comment-edit-link/edit.js +27 -7
  13. package/build/comment-edit-link/edit.js.map +1 -1
  14. package/build/comments/edit/comments-inspector-controls.js +1 -3
  15. package/build/comments/edit/comments-inspector-controls.js.map +1 -1
  16. package/build/comments-pagination/edit.js +23 -9
  17. package/build/comments-pagination/edit.js.map +1 -1
  18. package/build/comments-title/edit.js +41 -12
  19. package/build/comments-title/edit.js.map +1 -1
  20. package/build/details/edit.js +27 -3
  21. package/build/details/edit.js.map +1 -1
  22. package/build/details/index.js +2 -1
  23. package/build/details/index.js.map +1 -1
  24. package/build/embed/edit.js +2 -4
  25. package/build/embed/edit.js.map +1 -1
  26. package/build/embed/embed-controls.js +41 -22
  27. package/build/embed/embed-controls.js.map +1 -1
  28. package/build/file/inspector.js +73 -30
  29. package/build/file/inspector.js.map +1 -1
  30. package/build/form/edit.js +67 -37
  31. package/build/form/edit.js.map +1 -1
  32. package/build/form-input/edit.js +47 -18
  33. package/build/form-input/edit.js.map +1 -1
  34. package/build/html/index.js +2 -1
  35. package/build/html/index.js.map +1 -1
  36. package/build/image/constants.js +2 -1
  37. package/build/image/constants.js.map +1 -1
  38. package/build/image/edit.js +1 -1
  39. package/build/image/edit.js.map +1 -1
  40. package/build/image/image.js +1 -4
  41. package/build/image/image.js.map +1 -1
  42. package/build/latest-posts/edit.js +154 -82
  43. package/build/latest-posts/edit.js.map +1 -1
  44. package/build/list/ordered-list-settings.js +131 -52
  45. package/build/list/ordered-list-settings.js.map +1 -1
  46. package/build/more/index.js +2 -1
  47. package/build/more/index.js.map +1 -1
  48. package/build/navigation/edit/index.js +93 -51
  49. package/build/navigation/edit/index.js.map +1 -1
  50. package/build/navigation/edit/overlay-menu-preview.js +43 -27
  51. package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
  52. package/build/navigation-link/index.js +3 -0
  53. package/build/navigation-link/index.js.map +1 -1
  54. package/build/navigation-link/transforms.js +2 -0
  55. package/build/navigation-link/transforms.js.map +1 -1
  56. package/build/navigation-link/update-attributes.js +1 -0
  57. package/build/navigation-link/update-attributes.js.map +1 -1
  58. package/build/navigation-submenu/index.js +3 -0
  59. package/build/navigation-submenu/index.js.map +1 -1
  60. package/build/post-comments-count/index.js +3 -1
  61. package/build/post-comments-count/index.js.map +1 -1
  62. package/build/post-comments-count/transforms.js +26 -0
  63. package/build/post-comments-count/transforms.js.map +1 -0
  64. package/build/post-comments-link/index.js +3 -1
  65. package/build/post-comments-link/index.js.map +1 -1
  66. package/build/post-comments-link/transforms.js +26 -0
  67. package/build/post-comments-link/transforms.js.map +1 -0
  68. package/build/post-excerpt/edit.js +3 -1
  69. package/build/post-excerpt/edit.js.map +1 -1
  70. package/build/post-excerpt/index.js +2 -1
  71. package/build/post-excerpt/index.js.map +1 -1
  72. package/build/post-navigation-link/edit.js +3 -1
  73. package/build/post-navigation-link/edit.js.map +1 -1
  74. package/build/post-navigation-link/index.js +2 -1
  75. package/build/post-navigation-link/index.js.map +1 -1
  76. package/build/post-navigation-link/variations.js +13 -13
  77. package/build/post-navigation-link/variations.js.map +1 -1
  78. package/build/post-template/edit.js +5 -3
  79. package/build/post-template/edit.js.map +1 -1
  80. package/build/post-terms/edit.js +3 -1
  81. package/build/post-terms/edit.js.map +1 -1
  82. package/build/post-terms/index.js +4 -2
  83. package/build/post-terms/index.js.map +1 -1
  84. package/build/post-title/edit.js +56 -18
  85. package/build/post-title/edit.js.map +1 -1
  86. package/build/preformatted/transforms.js +5 -1
  87. package/build/preformatted/transforms.js.map +1 -1
  88. package/build/query/edit/enhanced-pagination-modal.js +1 -1
  89. package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
  90. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
  91. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  92. package/build/read-more/index.js +2 -1
  93. package/build/read-more/index.js.map +1 -1
  94. package/build/rss/edit.js +120 -46
  95. package/build/rss/edit.js.map +1 -1
  96. package/build/rss/index.js +2 -1
  97. package/build/rss/index.js.map +1 -1
  98. package/build/search/edit.js +76 -86
  99. package/build/search/edit.js.map +1 -1
  100. package/build/separator/edit.js +52 -20
  101. package/build/separator/edit.js.map +1 -1
  102. package/build/shortcode/index.js +2 -1
  103. package/build/shortcode/index.js.map +1 -1
  104. package/build/social-link/variations.js +53 -48
  105. package/build/social-link/variations.js.map +1 -1
  106. package/build/social-links/edit.js +35 -45
  107. package/build/social-links/edit.js.map +1 -1
  108. package/build/table/edit.js +3 -2
  109. package/build/table/edit.js.map +1 -1
  110. package/build/table/index.js +8 -4
  111. package/build/table/index.js.map +1 -1
  112. package/build/video/tracks-editor.js +40 -12
  113. package/build/video/tracks-editor.js.map +1 -1
  114. package/build-module/button/edit.js +30 -18
  115. package/build-module/button/edit.js.map +1 -1
  116. package/build-module/code/index.js +2 -1
  117. package/build-module/code/index.js.map +1 -1
  118. package/build-module/columns/edit.js +18 -22
  119. package/build-module/columns/edit.js.map +1 -1
  120. package/build-module/comment-author-name/edit.js +42 -13
  121. package/build-module/comment-author-name/edit.js.map +1 -1
  122. package/build-module/comment-date/edit.js +42 -13
  123. package/build-module/comment-date/edit.js.map +1 -1
  124. package/build-module/comment-edit-link/edit.js +28 -8
  125. package/build-module/comment-edit-link/edit.js.map +1 -1
  126. package/build-module/comments/edit/comments-inspector-controls.js +1 -3
  127. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
  128. package/build-module/comments-pagination/edit.js +24 -10
  129. package/build-module/comments-pagination/edit.js.map +1 -1
  130. package/build-module/comments-title/edit.js +42 -13
  131. package/build-module/comments-title/edit.js.map +1 -1
  132. package/build-module/details/edit.js +29 -5
  133. package/build-module/details/edit.js.map +1 -1
  134. package/build-module/details/index.js +2 -1
  135. package/build-module/details/index.js.map +1 -1
  136. package/build-module/embed/edit.js +2 -4
  137. package/build-module/embed/edit.js.map +1 -1
  138. package/build-module/embed/embed-controls.js +42 -23
  139. package/build-module/embed/embed-controls.js.map +1 -1
  140. package/build-module/file/inspector.js +74 -31
  141. package/build-module/file/inspector.js.map +1 -1
  142. package/build-module/form/edit.js +68 -38
  143. package/build-module/form/edit.js.map +1 -1
  144. package/build-module/form-input/edit.js +48 -19
  145. package/build-module/form-input/edit.js.map +1 -1
  146. package/build-module/html/index.js +2 -1
  147. package/build-module/html/index.js.map +1 -1
  148. package/build-module/image/constants.js +1 -0
  149. package/build-module/image/constants.js.map +1 -1
  150. package/build-module/image/edit.js +2 -2
  151. package/build-module/image/edit.js.map +1 -1
  152. package/build-module/image/image.js +2 -5
  153. package/build-module/image/image.js.map +1 -1
  154. package/build-module/latest-posts/edit.js +155 -83
  155. package/build-module/latest-posts/edit.js.map +1 -1
  156. package/build-module/list/ordered-list-settings.js +132 -53
  157. package/build-module/list/ordered-list-settings.js.map +1 -1
  158. package/build-module/more/index.js +2 -1
  159. package/build-module/more/index.js.map +1 -1
  160. package/build-module/navigation/edit/index.js +94 -52
  161. package/build-module/navigation/edit/index.js.map +1 -1
  162. package/build-module/navigation/edit/overlay-menu-preview.js +44 -28
  163. package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
  164. package/build-module/navigation-link/index.js +3 -0
  165. package/build-module/navigation-link/index.js.map +1 -1
  166. package/build-module/navigation-link/transforms.js +2 -0
  167. package/build-module/navigation-link/transforms.js.map +1 -1
  168. package/build-module/navigation-link/update-attributes.js +1 -0
  169. package/build-module/navigation-link/update-attributes.js.map +1 -1
  170. package/build-module/navigation-submenu/index.js +3 -0
  171. package/build-module/navigation-submenu/index.js.map +1 -1
  172. package/build-module/post-comments-count/index.js +3 -1
  173. package/build-module/post-comments-count/index.js.map +1 -1
  174. package/build-module/post-comments-count/transforms.js +19 -0
  175. package/build-module/post-comments-count/transforms.js.map +1 -0
  176. package/build-module/post-comments-link/index.js +3 -1
  177. package/build-module/post-comments-link/index.js.map +1 -1
  178. package/build-module/post-comments-link/transforms.js +19 -0
  179. package/build-module/post-comments-link/transforms.js.map +1 -0
  180. package/build-module/post-excerpt/edit.js +4 -2
  181. package/build-module/post-excerpt/edit.js.map +1 -1
  182. package/build-module/post-excerpt/index.js +2 -1
  183. package/build-module/post-excerpt/index.js.map +1 -1
  184. package/build-module/post-navigation-link/edit.js +4 -2
  185. package/build-module/post-navigation-link/edit.js.map +1 -1
  186. package/build-module/post-navigation-link/index.js +2 -1
  187. package/build-module/post-navigation-link/index.js.map +1 -1
  188. package/build-module/post-navigation-link/variations.js +13 -13
  189. package/build-module/post-navigation-link/variations.js.map +1 -1
  190. package/build-module/post-template/edit.js +5 -3
  191. package/build-module/post-template/edit.js.map +1 -1
  192. package/build-module/post-terms/edit.js +4 -2
  193. package/build-module/post-terms/edit.js.map +1 -1
  194. package/build-module/post-terms/index.js +4 -2
  195. package/build-module/post-terms/index.js.map +1 -1
  196. package/build-module/post-title/edit.js +57 -19
  197. package/build-module/post-title/edit.js.map +1 -1
  198. package/build-module/preformatted/transforms.js +5 -1
  199. package/build-module/preformatted/transforms.js.map +1 -1
  200. package/build-module/query/edit/enhanced-pagination-modal.js +1 -1
  201. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
  202. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
  203. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  204. package/build-module/read-more/index.js +2 -1
  205. package/build-module/read-more/index.js.map +1 -1
  206. package/build-module/rss/edit.js +121 -47
  207. package/build-module/rss/edit.js.map +1 -1
  208. package/build-module/rss/index.js +2 -1
  209. package/build-module/rss/index.js.map +1 -1
  210. package/build-module/search/edit.js +78 -88
  211. package/build-module/search/edit.js.map +1 -1
  212. package/build-module/separator/edit.js +54 -22
  213. package/build-module/separator/edit.js.map +1 -1
  214. package/build-module/shortcode/index.js +2 -1
  215. package/build-module/shortcode/index.js.map +1 -1
  216. package/build-module/social-link/variations.js +53 -48
  217. package/build-module/social-link/variations.js.map +1 -1
  218. package/build-module/social-links/edit.js +37 -47
  219. package/build-module/social-links/edit.js.map +1 -1
  220. package/build-module/table/edit.js +4 -3
  221. package/build-module/table/edit.js.map +1 -1
  222. package/build-module/table/index.js +8 -4
  223. package/build-module/table/index.js.map +1 -1
  224. package/build-module/video/tracks-editor.js +41 -13
  225. package/build-module/video/tracks-editor.js.map +1 -1
  226. package/build-style/archives/editor-rtl.css +47 -11
  227. package/build-style/archives/editor.css +47 -11
  228. package/build-style/archives/style-rtl.css +47 -11
  229. package/build-style/archives/style.css +47 -11
  230. package/build-style/audio/editor-rtl.css +47 -11
  231. package/build-style/audio/editor.css +47 -11
  232. package/build-style/audio/style-rtl.css +47 -11
  233. package/build-style/audio/style.css +47 -11
  234. package/build-style/audio/theme-rtl.css +47 -11
  235. package/build-style/audio/theme.css +47 -11
  236. package/build-style/avatar/editor-rtl.css +47 -11
  237. package/build-style/avatar/editor.css +47 -11
  238. package/build-style/avatar/style-rtl.css +47 -11
  239. package/build-style/avatar/style.css +47 -11
  240. package/build-style/button/editor-rtl.css +47 -11
  241. package/build-style/button/editor.css +47 -11
  242. package/build-style/button/style-rtl.css +47 -12
  243. package/build-style/button/style.css +47 -12
  244. package/build-style/buttons/editor-rtl.css +47 -11
  245. package/build-style/buttons/editor.css +47 -11
  246. package/build-style/buttons/style-rtl.css +50 -11
  247. package/build-style/buttons/style.css +50 -11
  248. package/build-style/calendar/style-rtl.css +47 -11
  249. package/build-style/calendar/style.css +47 -11
  250. package/build-style/categories/editor-rtl.css +47 -11
  251. package/build-style/categories/editor.css +47 -11
  252. package/build-style/categories/style-rtl.css +47 -11
  253. package/build-style/categories/style.css +47 -11
  254. package/build-style/classic-rtl.css +47 -11
  255. package/build-style/classic.css +47 -11
  256. package/build-style/code/editor-rtl.css +47 -11
  257. package/build-style/code/editor.css +47 -11
  258. package/build-style/code/style-rtl.css +47 -11
  259. package/build-style/code/style.css +47 -11
  260. package/build-style/code/theme-rtl.css +47 -11
  261. package/build-style/code/theme.css +47 -11
  262. package/build-style/columns/editor-rtl.css +47 -11
  263. package/build-style/columns/editor.css +47 -11
  264. package/build-style/columns/style-rtl.css +47 -11
  265. package/build-style/columns/style.css +47 -11
  266. package/build-style/comment-author-avatar/editor-rtl.css +47 -11
  267. package/build-style/comment-author-avatar/editor.css +47 -11
  268. package/build-style/comment-author-name/style-rtl.css +47 -11
  269. package/build-style/comment-author-name/style.css +47 -11
  270. package/build-style/comment-content/style-rtl.css +47 -11
  271. package/build-style/comment-content/style.css +47 -11
  272. package/build-style/comment-date/style-rtl.css +47 -11
  273. package/build-style/comment-date/style.css +47 -11
  274. package/build-style/comment-edit-link/style-rtl.css +47 -11
  275. package/build-style/comment-edit-link/style.css +47 -11
  276. package/build-style/comment-reply-link/style-rtl.css +47 -11
  277. package/build-style/comment-reply-link/style.css +47 -11
  278. package/build-style/comment-template/style-rtl.css +47 -11
  279. package/build-style/comment-template/style.css +47 -11
  280. package/build-style/comments/editor-rtl.css +47 -11
  281. package/build-style/comments/editor.css +47 -11
  282. package/build-style/comments/style-rtl.css +47 -11
  283. package/build-style/comments/style.css +47 -11
  284. package/build-style/comments-pagination/editor-rtl.css +47 -11
  285. package/build-style/comments-pagination/editor.css +47 -11
  286. package/build-style/comments-pagination/style-rtl.css +47 -11
  287. package/build-style/comments-pagination/style.css +47 -11
  288. package/build-style/comments-pagination-numbers/editor-rtl.css +47 -11
  289. package/build-style/comments-pagination-numbers/editor.css +47 -11
  290. package/build-style/comments-title/editor-rtl.css +47 -11
  291. package/build-style/comments-title/editor.css +47 -11
  292. package/build-style/common-rtl.css +130 -9
  293. package/build-style/common.css +130 -9
  294. package/build-style/cover/editor-rtl.css +47 -11
  295. package/build-style/cover/editor.css +47 -11
  296. package/build-style/cover/style-rtl.css +47 -11
  297. package/build-style/cover/style.css +47 -11
  298. package/build-style/details/editor-rtl.css +47 -11
  299. package/build-style/details/editor.css +47 -11
  300. package/build-style/details/style-rtl.css +47 -11
  301. package/build-style/details/style.css +47 -11
  302. package/build-style/editor-elements-rtl.css +47 -11
  303. package/build-style/editor-elements.css +47 -11
  304. package/build-style/editor-rtl.css +57 -15
  305. package/build-style/editor.css +57 -15
  306. package/build-style/elements-rtl.css +47 -11
  307. package/build-style/elements.css +47 -11
  308. package/build-style/embed/editor-rtl.css +47 -11
  309. package/build-style/embed/editor.css +47 -11
  310. package/build-style/embed/style-rtl.css +47 -11
  311. package/build-style/embed/style.css +47 -11
  312. package/build-style/embed/theme-rtl.css +47 -11
  313. package/build-style/embed/theme.css +47 -11
  314. package/build-style/file/editor-rtl.css +47 -11
  315. package/build-style/file/editor.css +47 -11
  316. package/build-style/file/style-rtl.css +47 -11
  317. package/build-style/file/style.css +47 -11
  318. package/build-style/footnotes/style-rtl.css +47 -11
  319. package/build-style/footnotes/style.css +47 -11
  320. package/build-style/form-input/editor-rtl.css +47 -11
  321. package/build-style/form-input/editor.css +47 -11
  322. package/build-style/form-input/style-rtl.css +47 -11
  323. package/build-style/form-input/style.css +47 -11
  324. package/build-style/form-submission-notification/editor-rtl.css +47 -11
  325. package/build-style/form-submission-notification/editor.css +47 -11
  326. package/build-style/form-submit-button/style-rtl.css +47 -11
  327. package/build-style/form-submit-button/style.css +47 -11
  328. package/build-style/freeform/editor-rtl.css +47 -11
  329. package/build-style/freeform/editor.css +47 -11
  330. package/build-style/gallery/editor-rtl.css +47 -11
  331. package/build-style/gallery/editor.css +47 -11
  332. package/build-style/gallery/style-rtl.css +48 -11
  333. package/build-style/gallery/style.css +48 -11
  334. package/build-style/gallery/theme-rtl.css +47 -11
  335. package/build-style/gallery/theme.css +47 -11
  336. package/build-style/group/editor-rtl.css +47 -11
  337. package/build-style/group/editor.css +47 -11
  338. package/build-style/group/style-rtl.css +47 -11
  339. package/build-style/group/style.css +47 -11
  340. package/build-style/group/theme-rtl.css +47 -11
  341. package/build-style/group/theme.css +47 -11
  342. package/build-style/heading/style-rtl.css +47 -11
  343. package/build-style/heading/style.css +47 -11
  344. package/build-style/html/editor-rtl.css +48 -11
  345. package/build-style/html/editor.css +48 -11
  346. package/build-style/image/editor-rtl.css +47 -11
  347. package/build-style/image/editor.css +47 -11
  348. package/build-style/image/style-rtl.css +47 -11
  349. package/build-style/image/style.css +47 -11
  350. package/build-style/image/theme-rtl.css +47 -11
  351. package/build-style/image/theme.css +47 -11
  352. package/build-style/latest-comments/style-rtl.css +47 -11
  353. package/build-style/latest-comments/style.css +47 -11
  354. package/build-style/latest-posts/editor-rtl.css +47 -11
  355. package/build-style/latest-posts/editor.css +47 -11
  356. package/build-style/latest-posts/style-rtl.css +47 -11
  357. package/build-style/latest-posts/style.css +47 -11
  358. package/build-style/list/style-rtl.css +47 -11
  359. package/build-style/list/style.css +47 -11
  360. package/build-style/loginout/style-rtl.css +47 -11
  361. package/build-style/loginout/style.css +47 -11
  362. package/build-style/media-text/editor-rtl.css +47 -11
  363. package/build-style/media-text/editor.css +47 -11
  364. package/build-style/media-text/style-rtl.css +47 -11
  365. package/build-style/media-text/style.css +47 -11
  366. package/build-style/more/editor-rtl.css +47 -11
  367. package/build-style/more/editor.css +47 -11
  368. package/build-style/navigation/editor-rtl.css +55 -14
  369. package/build-style/navigation/editor.css +55 -14
  370. package/build-style/navigation/style-rtl.css +47 -11
  371. package/build-style/navigation/style.css +47 -11
  372. package/build-style/navigation-link/editor-rtl.css +47 -11
  373. package/build-style/navigation-link/editor.css +47 -11
  374. package/build-style/navigation-link/style-rtl.css +47 -11
  375. package/build-style/navigation-link/style.css +47 -11
  376. package/build-style/navigation-submenu/editor-rtl.css +47 -11
  377. package/build-style/navigation-submenu/editor.css +47 -11
  378. package/build-style/nextpage/editor-rtl.css +47 -11
  379. package/build-style/nextpage/editor.css +47 -11
  380. package/build-style/page-list/editor-rtl.css +47 -11
  381. package/build-style/page-list/editor.css +47 -11
  382. package/build-style/page-list/style-rtl.css +47 -11
  383. package/build-style/page-list/style.css +47 -11
  384. package/build-style/paragraph/editor-rtl.css +47 -11
  385. package/build-style/paragraph/editor.css +47 -11
  386. package/build-style/paragraph/style-rtl.css +47 -11
  387. package/build-style/paragraph/style.css +47 -11
  388. package/build-style/post-author/editor-rtl.css +47 -11
  389. package/build-style/post-author/editor.css +47 -11
  390. package/build-style/post-author/style-rtl.css +47 -11
  391. package/build-style/post-author/style.css +47 -11
  392. package/build-style/post-author-biography/style-rtl.css +47 -11
  393. package/build-style/post-author-biography/style.css +47 -11
  394. package/build-style/post-author-name/style-rtl.css +47 -11
  395. package/build-style/post-author-name/style.css +47 -11
  396. package/build-style/post-comments-count/style-rtl.css +47 -11
  397. package/build-style/post-comments-count/style.css +47 -11
  398. package/build-style/post-comments-form/editor-rtl.css +47 -11
  399. package/build-style/post-comments-form/editor.css +47 -11
  400. package/build-style/post-comments-form/style-rtl.css +47 -14
  401. package/build-style/post-comments-form/style.css +47 -14
  402. package/build-style/post-comments-link/style-rtl.css +47 -11
  403. package/build-style/post-comments-link/style.css +47 -11
  404. package/build-style/post-content/style-rtl.css +47 -11
  405. package/build-style/post-content/style.css +47 -11
  406. package/build-style/post-date/style-rtl.css +47 -11
  407. package/build-style/post-date/style.css +47 -11
  408. package/build-style/post-excerpt/editor-rtl.css +47 -11
  409. package/build-style/post-excerpt/editor.css +47 -11
  410. package/build-style/post-excerpt/style-rtl.css +47 -11
  411. package/build-style/post-excerpt/style.css +47 -11
  412. package/build-style/post-featured-image/editor-rtl.css +47 -11
  413. package/build-style/post-featured-image/editor.css +47 -11
  414. package/build-style/post-featured-image/style-rtl.css +47 -11
  415. package/build-style/post-featured-image/style.css +47 -11
  416. package/build-style/post-navigation-link/style-rtl.css +47 -11
  417. package/build-style/post-navigation-link/style.css +47 -11
  418. package/build-style/post-template/style-rtl.css +47 -11
  419. package/build-style/post-template/style.css +47 -11
  420. package/build-style/post-terms/style-rtl.css +47 -11
  421. package/build-style/post-terms/style.css +47 -11
  422. package/build-style/post-time-to-read/style-rtl.css +47 -11
  423. package/build-style/post-time-to-read/style.css +47 -11
  424. package/build-style/post-title/style-rtl.css +47 -11
  425. package/build-style/post-title/style.css +47 -11
  426. package/build-style/preformatted/style-rtl.css +47 -11
  427. package/build-style/preformatted/style.css +47 -11
  428. package/build-style/pullquote/editor-rtl.css +48 -12
  429. package/build-style/pullquote/editor.css +48 -12
  430. package/build-style/pullquote/style-rtl.css +49 -14
  431. package/build-style/pullquote/style.css +49 -14
  432. package/build-style/pullquote/theme-rtl.css +49 -13
  433. package/build-style/pullquote/theme.css +49 -13
  434. package/build-style/query/editor-rtl.css +47 -11
  435. package/build-style/query/editor.css +47 -11
  436. package/build-style/query-pagination/editor-rtl.css +47 -11
  437. package/build-style/query-pagination/editor.css +47 -11
  438. package/build-style/query-pagination/style-rtl.css +47 -11
  439. package/build-style/query-pagination/style.css +47 -11
  440. package/build-style/query-pagination-numbers/editor-rtl.css +47 -11
  441. package/build-style/query-pagination-numbers/editor.css +47 -11
  442. package/build-style/query-title/style-rtl.css +47 -11
  443. package/build-style/query-title/style.css +47 -11
  444. package/build-style/query-total/style-rtl.css +47 -11
  445. package/build-style/query-total/style.css +47 -11
  446. package/build-style/quote/style-rtl.css +47 -11
  447. package/build-style/quote/style.css +47 -11
  448. package/build-style/quote/theme-rtl.css +47 -11
  449. package/build-style/quote/theme.css +47 -11
  450. package/build-style/read-more/style-rtl.css +47 -11
  451. package/build-style/read-more/style.css +47 -11
  452. package/build-style/reset-rtl.css +47 -11
  453. package/build-style/reset.css +47 -11
  454. package/build-style/rss/editor-rtl.css +47 -11
  455. package/build-style/rss/editor.css +47 -11
  456. package/build-style/rss/style-rtl.css +47 -11
  457. package/build-style/rss/style.css +47 -11
  458. package/build-style/search/editor-rtl.css +47 -11
  459. package/build-style/search/editor.css +47 -11
  460. package/build-style/search/style-rtl.css +47 -11
  461. package/build-style/search/style.css +47 -11
  462. package/build-style/search/theme-rtl.css +47 -11
  463. package/build-style/search/theme.css +47 -11
  464. package/build-style/separator/editor-rtl.css +47 -11
  465. package/build-style/separator/editor.css +47 -11
  466. package/build-style/separator/style-rtl.css +47 -11
  467. package/build-style/separator/style.css +47 -11
  468. package/build-style/separator/theme-rtl.css +47 -11
  469. package/build-style/separator/theme.css +47 -11
  470. package/build-style/shortcode/editor-rtl.css +47 -11
  471. package/build-style/shortcode/editor.css +47 -11
  472. package/build-style/site-logo/editor-rtl.css +47 -11
  473. package/build-style/site-logo/editor.css +47 -11
  474. package/build-style/site-logo/style-rtl.css +47 -11
  475. package/build-style/site-logo/style.css +47 -11
  476. package/build-style/site-tagline/editor-rtl.css +47 -11
  477. package/build-style/site-tagline/editor.css +47 -11
  478. package/build-style/site-tagline/style-rtl.css +47 -11
  479. package/build-style/site-tagline/style.css +47 -11
  480. package/build-style/site-title/editor-rtl.css +47 -11
  481. package/build-style/site-title/editor.css +47 -11
  482. package/build-style/site-title/style-rtl.css +47 -11
  483. package/build-style/site-title/style.css +47 -11
  484. package/build-style/social-link/editor-rtl.css +47 -11
  485. package/build-style/social-link/editor.css +47 -11
  486. package/build-style/social-links/editor-rtl.css +47 -11
  487. package/build-style/social-links/editor.css +47 -11
  488. package/build-style/social-links/style-rtl.css +47 -11
  489. package/build-style/social-links/style.css +47 -11
  490. package/build-style/spacer/editor-rtl.css +47 -11
  491. package/build-style/spacer/editor.css +47 -11
  492. package/build-style/spacer/style-rtl.css +47 -11
  493. package/build-style/spacer/style.css +47 -11
  494. package/build-style/style-rtl.css +53 -18
  495. package/build-style/style.css +53 -18
  496. package/build-style/table/editor-rtl.css +47 -11
  497. package/build-style/table/editor.css +47 -11
  498. package/build-style/table/style-rtl.css +47 -11
  499. package/build-style/table/style.css +47 -11
  500. package/build-style/table/theme-rtl.css +47 -11
  501. package/build-style/table/theme.css +47 -11
  502. package/build-style/table-of-contents/style-rtl.css +47 -11
  503. package/build-style/table-of-contents/style.css +47 -11
  504. package/build-style/tag-cloud/editor-rtl.css +47 -11
  505. package/build-style/tag-cloud/editor.css +47 -11
  506. package/build-style/tag-cloud/style-rtl.css +47 -11
  507. package/build-style/tag-cloud/style.css +47 -11
  508. package/build-style/template-part/editor-rtl.css +47 -11
  509. package/build-style/template-part/editor.css +47 -11
  510. package/build-style/template-part/theme-rtl.css +47 -11
  511. package/build-style/template-part/theme.css +47 -11
  512. package/build-style/term-description/style-rtl.css +47 -11
  513. package/build-style/term-description/style.css +47 -11
  514. package/build-style/text-columns/editor-rtl.css +47 -11
  515. package/build-style/text-columns/editor.css +47 -11
  516. package/build-style/text-columns/style-rtl.css +47 -11
  517. package/build-style/text-columns/style.css +47 -11
  518. package/build-style/theme-rtl.css +49 -13
  519. package/build-style/theme.css +49 -13
  520. package/build-style/verse/style-rtl.css +47 -11
  521. package/build-style/verse/style.css +47 -11
  522. package/build-style/video/editor-rtl.css +47 -11
  523. package/build-style/video/editor.css +47 -11
  524. package/build-style/video/style-rtl.css +47 -11
  525. package/build-style/video/style.css +47 -11
  526. package/build-style/video/theme-rtl.css +47 -11
  527. package/build-style/video/theme.css +47 -11
  528. package/package.json +35 -35
  529. package/src/button/edit.js +44 -29
  530. package/src/button/style.scss +0 -1
  531. package/src/buttons/style.scss +5 -0
  532. package/src/code/block.json +2 -1
  533. package/src/columns/edit.js +20 -31
  534. package/src/comment-author-name/edit.js +54 -13
  535. package/src/comment-date/edit.js +50 -15
  536. package/src/comment-edit-link/edit.js +39 -11
  537. package/src/comments/edit/comments-inspector-controls.js +0 -2
  538. package/src/comments-pagination/edit.js +29 -9
  539. package/src/comments-title/edit.js +53 -15
  540. package/src/details/block.json +2 -1
  541. package/src/details/edit.js +36 -4
  542. package/src/embed/edit.js +3 -5
  543. package/src/embed/embed-controls.js +55 -33
  544. package/src/file/inspector.js +99 -45
  545. package/src/form/edit.js +91 -46
  546. package/src/form-input/edit.js +56 -18
  547. package/src/gallery/style.scss +1 -0
  548. package/src/html/block.json +2 -1
  549. package/src/html/editor.scss +1 -0
  550. package/src/image/constants.js +1 -0
  551. package/src/image/edit.js +2 -1
  552. package/src/image/image.js +7 -5
  553. package/src/latest-posts/edit.js +206 -98
  554. package/src/list/ordered-list-settings.js +172 -62
  555. package/src/more/block.json +2 -1
  556. package/src/navigation/edit/index.js +127 -64
  557. package/src/navigation/edit/overlay-menu-preview.js +43 -26
  558. package/src/navigation/editor.scss +8 -4
  559. package/src/navigation-link/block.json +3 -0
  560. package/src/navigation-link/index.php +4 -0
  561. package/src/navigation-link/transforms.js +2 -1
  562. package/src/navigation-link/update-attributes.js +1 -0
  563. package/src/navigation-submenu/block.json +3 -0
  564. package/src/navigation-submenu/index.php +4 -0
  565. package/src/post-comments-count/index.js +2 -0
  566. package/src/post-comments-count/transforms.js +20 -0
  567. package/src/post-comments-form/style.scss +0 -5
  568. package/src/post-comments-link/index.js +2 -0
  569. package/src/post-comments-link/transforms.js +20 -0
  570. package/src/post-excerpt/block.json +2 -1
  571. package/src/post-excerpt/edit.js +13 -8
  572. package/src/post-navigation-link/block.json +2 -1
  573. package/src/post-navigation-link/edit.js +13 -8
  574. package/src/post-navigation-link/variations.js +13 -13
  575. package/src/post-template/edit.js +4 -3
  576. package/src/post-terms/block.json +4 -2
  577. package/src/post-terms/edit.js +13 -8
  578. package/src/post-title/edit.js +76 -24
  579. package/src/preformatted/test/__snapshots__/transforms.native.js.snap +6 -0
  580. package/src/preformatted/test/transforms.native.js +6 -1
  581. package/src/preformatted/transforms.js +7 -1
  582. package/src/pullquote/editor.scss +1 -1
  583. package/src/pullquote/style.scss +2 -3
  584. package/src/pullquote/theme.scss +2 -2
  585. package/src/query/edit/enhanced-pagination-modal.js +1 -5
  586. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -13
  587. package/src/read-more/block.json +2 -1
  588. package/src/rss/block.json +2 -1
  589. package/src/rss/edit.js +141 -55
  590. package/src/search/edit.js +84 -99
  591. package/src/separator/edit.js +66 -21
  592. package/src/shortcode/block.json +2 -1
  593. package/src/site-title/index.php +1 -1
  594. package/src/social-link/index.php +49 -49
  595. package/src/social-link/variations.js +53 -48
  596. package/src/social-links/edit.js +39 -60
  597. package/src/table/block.json +8 -4
  598. package/src/table/edit.js +6 -2
  599. package/src/verse/test/__snapshots__/transforms.native.js.snap +6 -0
  600. package/src/verse/test/transforms.native.js +5 -1
  601. package/src/video/tracks-editor.js +57 -16
  602. package/build/search/icons.js +0 -121
  603. package/build/search/icons.js.map +0 -1
  604. package/build-module/search/icons.js +0 -114
  605. package/build-module/search/icons.js.map +0 -1
  606. package/src/search/icons.js +0 -89
@@ -1 +1 @@
1
- {"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","showContent","type","summary","source","selector","attribute","allowedBlocks","placeholder","supports","__experimentalOnEnter","align","anchor","color","gradients","link","__experimentalDefaultControls","background","text","__experimentalBorder","width","style","html","spacing","margin","padding","blockGap","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowEditing","interactivity","clientNavigation","editorStyle","settings","icon","example","__","innerBlocks","content","__experimentalLabel","context","customName","hasSummary","trim","length","sprintf","save","edit","transforms","init","initBlock"],"sources":["@wordpress/block-library/src/details/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { details as icon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsummary: __( 'La Mancha' ),\n\t\t\tshowContent: true,\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\tcontent: __(\n\t\t\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { summary } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\t\tconst hasSummary = summary?.trim().length > 0;\n\n\t\t// In the list view, use the block's summary as the label.\n\t\t// If the summary is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || hasSummary ) ) {\n\t\t\treturn customName || summary;\n\t\t}\n\n\t\tif ( context === 'accessibility' ) {\n\t\t\treturn ! hasSummary\n\t\t\t\t? __( 'Details. Empty.' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text; summary title. */\n\t\t\t\t\t\t__( 'Details. %s' ),\n\t\t\t\t\t\tsummary\n\t\t\t\t );\n\t\t}\n\t},\n\tsave,\n\tedit,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,WAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EA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AAW,EAAE,CACZ;MACCnD,IAAI,EAAE,gBAAgB;MACtBM,UAAU,EAAE;QACX8C,OAAO,EAAE,IAAAF,QAAE,EACV,kOACD;MACD;IACD,CAAC;EAEH,CAAC;EACDG,mBAAmBA,CAAE/C,UAAU,EAAE;IAAEgD;EAAQ,CAAC,EAAG;IAC9C,MAAM;MAAE7C;IAAQ,CAAC,GAAGH,UAAU;IAE9B,MAAMiD,UAAU,GAAGjD,UAAU,EAAEV,QAAQ,EAAEI,IAAI;IAC7C,MAAMwD,UAAU,GAAG/C,OAAO,EAAEgD,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC;;IAE7C;IACA;IACA,IAAKJ,OAAO,KAAK,WAAW,KAAMC,UAAU,IAAIC,UAAU,CAAE,EAAG;MAC9D,OAAOD,UAAU,IAAI9C,OAAO;IAC7B;IAEA,IAAK6C,OAAO,KAAK,eAAe,EAAG;MAClC,OAAO,CAAEE,UAAU,GAChB,IAAAN,QAAE,EAAE,iBAAkB,CAAC,GACvB,IAAAS,aAAO,EACP;MACA,IAAAT,QAAE,EAAE,aAAc,CAAC,EACnBzC,OACA,CAAC;IACL;EACD,CAAC;EACDmD,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEhE,IAAI;EAAEJ,QAAQ;EAAEmD;AAAS,CAAE,CAAC;AAAClD,OAAA,CAAAkE,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","showContent","type","summary","source","selector","role","attribute","allowedBlocks","placeholder","supports","__experimentalOnEnter","align","anchor","color","gradients","link","__experimentalDefaultControls","background","text","__experimentalBorder","width","style","html","spacing","margin","padding","blockGap","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowEditing","interactivity","clientNavigation","editorStyle","settings","icon","example","__","innerBlocks","content","__experimentalLabel","context","customName","hasSummary","trim","length","sprintf","save","edit","transforms","init","initBlock"],"sources":["@wordpress/block-library/src/details/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { details as icon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsummary: __( 'La Mancha' ),\n\t\t\tshowContent: true,\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\tcontent: __(\n\t\t\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { summary } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\t\tconst hasSummary = summary?.trim().length > 0;\n\n\t\t// In the list view, use the block's summary as the label.\n\t\t// If the summary is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || hasSummary ) ) {\n\t\t\treturn customName || summary;\n\t\t}\n\n\t\tif ( context === 'accessibility' ) {\n\t\t\treturn ! hasSummary\n\t\t\t\t? __( 'Details. Empty.' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text; summary title. */\n\t\t\t\t\t\t__( 'Details. %s' ),\n\t\t\t\t\t\tsummary\n\t\t\t\t );\n\t\t}\n\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C,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEjE,IAAI;EAAEJ,QAAQ;EAAEoD;AAAS,CAAE,CAAC;AAACnD,OAAA,CAAAmE,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -107,20 +107,18 @@ const EmbedEdit = props => {
107
107
  * @return {Object} Merged attributes.
108
108
  */
109
109
  const getMergedAttributes = () => (0, _util.getMergedAttributesWithPreview)(attributes, preview, title, responsive);
110
- const toggleResponsive = () => {
110
+ function toggleResponsive(newAllowResponsive) {
111
111
  const {
112
- allowResponsive,
113
112
  className
114
113
  } = attributes;
115
114
  const {
116
115
  html
117
116
  } = preview;
118
- const newAllowResponsive = !allowResponsive;
119
117
  setAttributes({
120
118
  allowResponsive: newAllowResponsive,
121
119
  className: (0, _util.getClassNames)(html, className, responsive && newAllowResponsive)
122
120
  });
123
- };
121
+ }
124
122
  (0, _element.useEffect)(() => {
125
123
  if (preview?.html || !cannotEmbed || !hasResolved) {
126
124
  return;
@@ -1 +1 @@
1
- {"version":3,"names":["_util","require","_embedControls","_interopRequireDefault","_icons","_embedLoading","_embedPlaceholder","_embedPreview","_clsx","_i18n","_element","_data","_blockEditor","_coreData","_primitives","_url","_caption","_jsxRuntime","EmbedEdit","props","attributes","providerNameSlug","previewable","responsive","url","attributesUrl","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","defaultEmbedInfo","title","_x","icon","embedContentIcon","getEmbedInfoByProvider","setURL","useState","isEditingURL","setIsEditingURL","invalidateResolution","useDispatch","coreStore","preview","fetching","themeSupportsResponsive","cannotEmbed","hasResolved","useSelect","select","getEmbedPreview","isPreviewEmbedFallback","isRequestingEmbedPreview","getThemeSupports","hasFinishedResolution","embedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","data","status","validPreview","getMergedAttributes","getMergedAttributesWithPreview","toggleResponsive","allowResponsive","className","newAllowResponsive","getClassNames","useEffect","newURL","replace","getAuthority","URL","host","toString","mergedAttributes","hasChanges","Object","keys","some","key","upgradedBlock","createUpgradedEmbedBlock","blockProps","useBlockProps","jsx","View","children","default","label","sprintf","__","showEmbedPlaceholder","onSubmit","event","preventDefault","blockClass","removeAspectRatioClasses","value","onChange","fallback","tryAgain","caption","classFromPreview","clsx","jsxs","Fragment","showEditButton","blockSupportsResponsive","switchBackToURLInput","onCaptionChange","Caption","showToolbarButton","_default","exports"],"sources":["@wordpress/block-library/src/embed/edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tremoveAspectRatioClasses,\n\tfallback,\n\tgetEmbedInfoByProvider,\n\tgetMergedAttributesWithPreview,\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';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\nimport { getAuthority } from '@wordpress/url';\nimport { Caption } from '../utils/caption';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: {\n\t\t\tproviderNameSlug,\n\t\t\tpreviewable,\n\t\t\tresponsive,\n\t\t\turl: attributesUrl,\n\t\t},\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst { icon, title } =\n\t\tgetEmbedInfoByProvider( providerNameSlug ) || defaultEmbedInfo;\n\n\tconst [ url, setURL ] = useState( attributesUrl );\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst {\n\t\tpreview,\n\t\tfetching,\n\t\tthemeSupportsResponsive,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEmbedPreview,\n\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\tisRequestingEmbedPreview,\n\t\t\t\tgetThemeSupports,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\t\t\tif ( ! attributesUrl ) {\n\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t}\n\n\t\t\tconst embedPreview = getEmbedPreview( attributesUrl );\n\t\t\tconst previewIsFallback = isPreviewEmbedFallback( attributesUrl );\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 `data.status` set to 404, rather\n\t\t\t// than generating a fallback response as other embeds do.\n\t\t\tconst wordpressCantEmbed = embedPreview?.data?.status === 404;\n\t\t\tconst validPreview =\n\t\t\t\t!! embedPreview && ! badEmbedProvider && ! wordpressCantEmbed;\n\t\t\treturn {\n\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\tfetching: isRequestingEmbedPreview( attributesUrl ),\n\t\t\t\tthemeSupportsResponsive:\n\t\t\t\t\tgetThemeSupports()[ 'responsive-embeds' ],\n\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t\thasResolved: hasFinishedResolution( 'getEmbedPreview', [\n\t\t\t\t\tattributesUrl,\n\t\t\t\t] ),\n\t\t\t};\n\t\t},\n\t\t[ attributesUrl ]\n\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = () =>\n\t\tgetMergedAttributesWithPreview(\n\t\t\tattributes,\n\t\t\tpreview,\n\t\t\ttitle,\n\t\t\tresponsive\n\t\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 || ! hasResolved ) {\n\t\t\treturn;\n\t\t}\n\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 = attributesUrl.replace( /\\/$/, '' );\n\t\tsetURL( newURL );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [\n\t\tpreview?.html,\n\t\tattributesUrl,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t\tsetAttributes,\n\t] );\n\n\t// Try a different provider in case the embed url is not supported.\n\tuseEffect( () => {\n\t\tif ( ! cannotEmbed || fetching || ! url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Until X provider is supported in WordPress, as a workaround we use Twitter provider.\n\t\tif ( getAuthority( url ) === 'x.com' ) {\n\t\t\tconst newURL = new URL( url );\n\t\t\tnewURL.host = 'twitter.com';\n\t\t\tsetAttributes( { url: newURL.toString() } );\n\t\t}\n\t}, [ url, cannotEmbed, fetching, setAttributes ] );\n\n\t// Handle incoming preview.\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview,\n\t\t\t// we set the attributes derived from the preview data.\n\t\t\tconst mergedAttributes = getMergedAttributes();\n\t\t\tconst hasChanges = Object.keys( mergedAttributes ).some(\n\t\t\t\t( key ) => mergedAttributes[ key ] !== attributes[ key ]\n\t\t\t);\n\n\t\t\tif ( hasChanges ) {\n\t\t\t\tsetAttributes( mergedAttributes );\n\t\t\t}\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tmergedAttributes\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\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\t// translators: %s: type of embed e.g: \"YouTube\", \"Twitter\", etc. \"Embed\" is used when no specific type exists\n\tconst label = sprintf( __( '%s URL' ), title );\n\n\t// No preview, or we can't embed the current URL, or we've clicked the edit button.\n\tconst showEmbedPlaceholder = ! preview || cannotEmbed || isEditingURL;\n\n\tif ( showEmbedPlaceholder ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\tif ( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the embed URL was changed, we need to reset the aspect ratio class.\n\t\t\t\t\t\t// To do this we have to remove the existing ratio class so it can be recalculated.\n\t\t\t\t\t\tconst blockClass = removeAspectRatioClasses(\n\t\t\t\t\t\t\tattributes.className\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\tsetAttributes( { url, className: blockClass } );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ url }\n\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\tonChange={ ( value ) => setURL( value ) }\n\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [ url ] );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\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\tcaption,\n\t\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = clsx( classFromPreview, props.className );\n\n\treturn (\n\t\t<>\n\t\t\t<EmbedControls\n\t\t\t\tshowEditButton={ preview && ! cannotEmbed }\n\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t/>\n\t\t\t<figure\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( blockProps.className, className, {\n\t\t\t\t\t[ `is-type-${ type }` ]: type,\n\t\t\t\t\t[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,\n\t\t\t\t\t[ `wp-block-embed-${ providerNameSlug }` ]:\n\t\t\t\t\t\tproviderNameSlug,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<EmbedPreview\n\t\t\t\t\tpreview={ preview }\n\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\turl={ url }\n\t\t\t\t\ttype={ type }\n\t\t\t\t\tcaption={ caption }\n\t\t\t\t\tonCaptionChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { caption: value } )\n\t\t\t\t\t}\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Embed caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSelected }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAQA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,aAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAKA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AAKA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,SAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,IAAA,GAAAd,OAAA;AACA,IAAAe,QAAA,GAAAf,OAAA;AAA2C,IAAAgB,WAAA,GAAAhB,OAAA;AAhC3C;AACA;AACA;;AAeA;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AAAuE,QAAA,gBAEL,IAAA3E,WAAA,CAAAyE,GAAA,EAACnF,aAAA,CAAAsF,OAAY;QACZjD,OAAO,EAAGA,OAAS;QACnBtB,WAAW,EAAGA,WAAa;QAC3BgD,SAAS,EAAGA,SAAW;QACvB9C,GAAG,EAAGA,GAAK;QACXoC,IAAI,EAAGA,IAAM;QACb+C,OAAO,EAAGA,OAAS;QACnBQ,eAAe,EAAKZ,KAAK,IACxB3E,aAAa,CAAE;UAAE+E,OAAO,EAAEJ;QAAM,CAAE,CAClC;QACD7E,UAAU,EAAGA,UAAY;QACzBQ,IAAI,EAAGA,IAAM;QACb4D,KAAK,EAAGA,KAAO;QACfjE,iBAAiB,EAAGA,iBAAmB;QACvCT,UAAU,EAAGA,UAAY;QACzBQ,aAAa,EAAGA;MAAe,CAC/B,CAAC,eACF,IAAAX,WAAA,CAAAyE,GAAA,EAAC1E,QAAA,CAAAoG,OAAO;QACPhG,UAAU,EAAGA,UAAY;QACzBQ,aAAa,EAAGA,aAAe;QAC/BF,UAAU,EAAGA,UAAY;QACzBG,iBAAiB,EAAGA,iBAAmB;QACvCiE,KAAK,EAAG,IAAAE,QAAE,EAAE,oBAAqB,CAAG;QACpCqB,iBAAiB,EAAG3F;MAAY,CAChC,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL,CAAC;AAAC,IAAA4F,QAAA,GAAAC,OAAA,CAAA1B,OAAA,GAEa3E,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_util","require","_embedControls","_interopRequireDefault","_icons","_embedLoading","_embedPlaceholder","_embedPreview","_clsx","_i18n","_element","_data","_blockEditor","_coreData","_primitives","_url","_caption","_jsxRuntime","EmbedEdit","props","attributes","providerNameSlug","previewable","responsive","url","attributesUrl","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","defaultEmbedInfo","title","_x","icon","embedContentIcon","getEmbedInfoByProvider","setURL","useState","isEditingURL","setIsEditingURL","invalidateResolution","useDispatch","coreStore","preview","fetching","themeSupportsResponsive","cannotEmbed","hasResolved","useSelect","select","getEmbedPreview","isPreviewEmbedFallback","isRequestingEmbedPreview","getThemeSupports","hasFinishedResolution","embedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","data","status","validPreview","getMergedAttributes","getMergedAttributesWithPreview","toggleResponsive","newAllowResponsive","className","allowResponsive","getClassNames","useEffect","newURL","replace","getAuthority","URL","host","toString","mergedAttributes","hasChanges","Object","keys","some","key","upgradedBlock","createUpgradedEmbedBlock","blockProps","useBlockProps","jsx","View","children","default","label","sprintf","__","showEmbedPlaceholder","onSubmit","event","preventDefault","blockClass","removeAspectRatioClasses","value","onChange","fallback","tryAgain","caption","classFromPreview","clsx","jsxs","Fragment","showEditButton","blockSupportsResponsive","switchBackToURLInput","onCaptionChange","Caption","showToolbarButton","_default","exports"],"sources":["@wordpress/block-library/src/embed/edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tremoveAspectRatioClasses,\n\tfallback,\n\tgetEmbedInfoByProvider,\n\tgetMergedAttributesWithPreview,\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';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\nimport { getAuthority } from '@wordpress/url';\nimport { Caption } from '../utils/caption';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: {\n\t\t\tproviderNameSlug,\n\t\t\tpreviewable,\n\t\t\tresponsive,\n\t\t\turl: attributesUrl,\n\t\t},\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst { icon, title } =\n\t\tgetEmbedInfoByProvider( providerNameSlug ) || defaultEmbedInfo;\n\n\tconst [ url, setURL ] = useState( attributesUrl );\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst {\n\t\tpreview,\n\t\tfetching,\n\t\tthemeSupportsResponsive,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEmbedPreview,\n\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\tisRequestingEmbedPreview,\n\t\t\t\tgetThemeSupports,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\t\t\tif ( ! attributesUrl ) {\n\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t}\n\n\t\t\tconst embedPreview = getEmbedPreview( attributesUrl );\n\t\t\tconst previewIsFallback = isPreviewEmbedFallback( attributesUrl );\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 `data.status` set to 404, rather\n\t\t\t// than generating a fallback response as other embeds do.\n\t\t\tconst wordpressCantEmbed = embedPreview?.data?.status === 404;\n\t\t\tconst validPreview =\n\t\t\t\t!! embedPreview && ! badEmbedProvider && ! wordpressCantEmbed;\n\t\t\treturn {\n\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\tfetching: isRequestingEmbedPreview( attributesUrl ),\n\t\t\t\tthemeSupportsResponsive:\n\t\t\t\t\tgetThemeSupports()[ 'responsive-embeds' ],\n\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t\thasResolved: hasFinishedResolution( 'getEmbedPreview', [\n\t\t\t\t\tattributesUrl,\n\t\t\t\t] ),\n\t\t\t};\n\t\t},\n\t\t[ attributesUrl ]\n\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = () =>\n\t\tgetMergedAttributesWithPreview(\n\t\t\tattributes,\n\t\t\tpreview,\n\t\t\ttitle,\n\t\t\tresponsive\n\t\t);\n\n\tfunction toggleResponsive( newAllowResponsive ) {\n\t\tconst { className } = attributes;\n\t\tconst { html } = preview;\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 || ! hasResolved ) {\n\t\t\treturn;\n\t\t}\n\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 = attributesUrl.replace( /\\/$/, '' );\n\t\tsetURL( newURL );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [\n\t\tpreview?.html,\n\t\tattributesUrl,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t\tsetAttributes,\n\t] );\n\n\t// Try a different provider in case the embed url is not supported.\n\tuseEffect( () => {\n\t\tif ( ! cannotEmbed || fetching || ! url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Until X provider is supported in WordPress, as a workaround we use Twitter provider.\n\t\tif ( getAuthority( url ) === 'x.com' ) {\n\t\t\tconst newURL = new URL( url );\n\t\t\tnewURL.host = 'twitter.com';\n\t\t\tsetAttributes( { url: newURL.toString() } );\n\t\t}\n\t}, [ url, cannotEmbed, fetching, setAttributes ] );\n\n\t// Handle incoming preview.\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview,\n\t\t\t// we set the attributes derived from the preview data.\n\t\t\tconst mergedAttributes = getMergedAttributes();\n\t\t\tconst hasChanges = Object.keys( mergedAttributes ).some(\n\t\t\t\t( key ) => mergedAttributes[ key ] !== attributes[ key ]\n\t\t\t);\n\n\t\t\tif ( hasChanges ) {\n\t\t\t\tsetAttributes( mergedAttributes );\n\t\t\t}\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tmergedAttributes\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\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\t// translators: %s: type of embed e.g: \"YouTube\", \"Twitter\", etc. \"Embed\" is used when no specific type exists\n\tconst label = sprintf( __( '%s URL' ), title );\n\n\t// No preview, or we can't embed the current URL, or we've clicked the edit button.\n\tconst showEmbedPlaceholder = ! preview || cannotEmbed || isEditingURL;\n\n\tif ( showEmbedPlaceholder ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\tif ( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the embed URL was changed, we need to reset the aspect ratio class.\n\t\t\t\t\t\t// To do this we have to remove the existing ratio class so it can be recalculated.\n\t\t\t\t\t\tconst blockClass = removeAspectRatioClasses(\n\t\t\t\t\t\t\tattributes.className\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\tsetAttributes( { url, className: blockClass } );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ url }\n\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\tonChange={ ( value ) => setURL( value ) }\n\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [ url ] );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\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\tcaption,\n\t\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = clsx( classFromPreview, props.className );\n\n\treturn (\n\t\t<>\n\t\t\t<EmbedControls\n\t\t\t\tshowEditButton={ preview && ! cannotEmbed }\n\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t/>\n\t\t\t<figure\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( blockProps.className, className, {\n\t\t\t\t\t[ `is-type-${ type }` ]: type,\n\t\t\t\t\t[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,\n\t\t\t\t\t[ `wp-block-embed-${ providerNameSlug }` ]:\n\t\t\t\t\t\tproviderNameSlug,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<EmbedPreview\n\t\t\t\t\tpreview={ preview }\n\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\turl={ url }\n\t\t\t\t\ttype={ type }\n\t\t\t\t\tcaption={ caption }\n\t\t\t\t\tonCaptionChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { caption: value } )\n\t\t\t\t\t}\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Embed caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSelected }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAQA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,aAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAKA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AAKA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,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YV,IAAI,EAAG,GAAIA,IAAI;QAC7B,CAAE,eAAgBvC,gBAAgB,EAAG,GAAIA,gBAAgB;QACzD,CAAE,kBAAmBA,gBAAgB,EAAG,GACvCA;MACF,CAAE,CAAG;MAAAuE,QAAA,gBAEL,IAAA3E,WAAA,CAAAyE,GAAA,EAACnF,aAAA,CAAAsF,OAAY;QACZjD,OAAO,EAAGA,OAAS;QACnBtB,WAAW,EAAGA,WAAa;QAC3BgD,SAAS,EAAGA,SAAW;QACvB9C,GAAG,EAAGA,GAAK;QACXoC,IAAI,EAAGA,IAAM;QACb+C,OAAO,EAAGA,OAAS;QACnBQ,eAAe,EAAKZ,KAAK,IACxB3E,aAAa,CAAE;UAAE+E,OAAO,EAAEJ;QAAM,CAAE,CAClC;QACD7E,UAAU,EAAGA,UAAY;QACzBQ,IAAI,EAAGA,IAAM;QACb4D,KAAK,EAAGA,KAAO;QACfjE,iBAAiB,EAAGA,iBAAmB;QACvCT,UAAU,EAAGA,UAAY;QACzBQ,aAAa,EAAGA;MAAe,CAC/B,CAAC,eACF,IAAAX,WAAA,CAAAyE,GAAA,EAAC1E,QAAA,CAAAoG,OAAO;QACPhG,UAAU,EAAGA,UAAY;QACzBQ,aAAa,EAAGA,aAAe;QAC/BF,UAAU,EAAGA,UAAY;QACzBG,iBAAiB,EAAGA,iBAAmB;QACvCiE,KAAK,EAAG,IAAAE,QAAE,EAAE,oBAAqB,CAAG;QACpCqB,iBAAiB,EAAG3F;MAAY,CAChC,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL,CAAC;AAAC,IAAA4F,QAAA,GAAAC,OAAA,CAAA1B,OAAA,GAEa3E,SAAS","ignoreList":[]}
@@ -8,11 +8,16 @@ var _i18n = require("@wordpress/i18n");
8
8
  var _components = require("@wordpress/components");
9
9
  var _blockEditor = require("@wordpress/block-editor");
10
10
  var _icons = require("@wordpress/icons");
11
+ var _hooks = require("../utils/hooks");
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  /**
13
14
  * WordPress dependencies
14
15
  */
15
16
 
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+
16
21
  function getResponsiveHelp(checked) {
17
22
  return checked ? (0, _i18n.__)('This embed will preserve its aspect ratio when the browser is resized.') : (0, _i18n.__)('This embed may not preserve its aspect ratio when the browser is resized.');
18
23
  }
@@ -23,29 +28,43 @@ const EmbedControls = ({
23
28
  allowResponsive,
24
29
  toggleResponsive,
25
30
  switchBackToURLInput
26
- }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
27
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
28
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
29
- children: showEditButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
30
- className: "components-toolbar__control",
31
- label: (0, _i18n.__)('Edit URL'),
32
- icon: _icons.edit,
33
- onClick: switchBackToURLInput
31
+ }) => {
32
+ const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
34
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
35
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
36
+ children: showEditButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
37
+ className: "components-toolbar__control",
38
+ label: (0, _i18n.__)('Edit URL'),
39
+ icon: _icons.edit,
40
+ onClick: switchBackToURLInput
41
+ })
34
42
  })
35
- })
36
- }), themeSupportsResponsive && blockSupportsResponsive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
37
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
38
- title: (0, _i18n.__)('Media settings'),
39
- className: "blocks-responsive",
40
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
41
- __nextHasNoMarginBottom: true,
42
- label: (0, _i18n.__)('Resize for smaller devices'),
43
- checked: allowResponsive,
44
- help: getResponsiveHelp,
45
- onChange: toggleResponsive
43
+ }), themeSupportsResponsive && blockSupportsResponsive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
44
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanel, {
45
+ label: (0, _i18n.__)('Media settings'),
46
+ resetAll: () => {
47
+ toggleResponsive(true);
48
+ },
49
+ dropdownMenuProps: dropdownMenuProps,
50
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
51
+ label: (0, _i18n.__)('Media settings'),
52
+ isShownByDefault: true,
53
+ hasValue: () => !allowResponsive,
54
+ onDeselect: () => {
55
+ toggleResponsive(!allowResponsive);
56
+ },
57
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
58
+ __nextHasNoMarginBottom: true,
59
+ label: (0, _i18n.__)('Resize for smaller devices'),
60
+ checked: allowResponsive,
61
+ help: getResponsiveHelp,
62
+ onChange: toggleResponsive
63
+ })
64
+ })
46
65
  })
47
- })
48
- })]
49
- });
66
+ })]
67
+ });
68
+ };
50
69
  var _default = exports.default = EmbedControls;
51
70
  //# sourceMappingURL=embed-controls.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_blockEditor","_icons","_jsxRuntime","getResponsiveHelp","checked","__","EmbedControls","blockSupportsResponsive","showEditButton","themeSupportsResponsive","allowResponsive","toggleResponsive","switchBackToURLInput","jsxs","Fragment","children","jsx","BlockControls","ToolbarGroup","ToolbarButton","className","label","icon","edit","onClick","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","help","onChange","_default","exports","default"],"sources":["@wordpress/block-library/src/embed/embed-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tToolbarButton,\n\tPanelBody,\n\tToggleControl,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { BlockControls, InspectorControls } from '@wordpress/block-editor';\nimport { edit } from '@wordpress/icons';\n\nfunction getResponsiveHelp( checked ) {\n\treturn checked\n\t\t? __(\n\t\t\t\t'This embed will preserve its aspect ratio when the browser is resized.'\n\t\t )\n\t\t: __(\n\t\t\t\t'This embed may not preserve its aspect ratio when the browser is resized.'\n\t\t );\n}\n\nconst EmbedControls = ( {\n\tblockSupportsResponsive,\n\tshowEditButton,\n\tthemeSupportsResponsive,\n\tallowResponsive,\n\ttoggleResponsive,\n\tswitchBackToURLInput,\n} ) => (\n\t<>\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t{ showEditButton && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tclassName=\"components-toolbar__control\"\n\t\t\t\t\t\tlabel={ __( 'Edit URL' ) }\n\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\tonClick={ switchBackToURLInput }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t\t{ themeSupportsResponsive && blockSupportsResponsive && (\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'Media settings' ) }\n\t\t\t\t\tclassName=\"blocks-responsive\"\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Resize for smaller devices' ) }\n\t\t\t\t\t\tchecked={ allowResponsive }\n\t\t\t\t\t\thelp={ getResponsiveHelp }\n\t\t\t\t\t\tonChange={ toggleResponsive }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t) }\n\t</>\n);\n\nexport default EmbedControls;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAA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C5CD,OAAO,EAAGM,eAAiB;QAC3BoB,IAAI,EAAG3B,iBAAmB;QAC1B4B,QAAQ,EAAGpB;MAAkB,CAC7B;IAAC,CACQ;EAAC,CACM,CACnB;AAAA,CACA,CACF;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa5B,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_blockEditor","_icons","_hooks","_jsxRuntime","getResponsiveHelp","checked","__","EmbedControls","blockSupportsResponsive","showEditButton","themeSupportsResponsive","allowResponsive","toggleResponsive","switchBackToURLInput","dropdownMenuProps","useToolsPanelDropdownMenuProps","jsxs","Fragment","children","jsx","BlockControls","ToolbarGroup","ToolbarButton","className","label","icon","edit","onClick","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","ToggleControl","__nextHasNoMarginBottom","help","onChange","_default","exports","default"],"sources":["@wordpress/block-library/src/embed/embed-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tToolbarButton,\n\tToggleControl,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { BlockControls, InspectorControls } from '@wordpress/block-editor';\nimport { edit } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nfunction getResponsiveHelp( checked ) {\n\treturn checked\n\t\t? __(\n\t\t\t\t'This embed will preserve its aspect ratio when the browser is resized.'\n\t\t )\n\t\t: __(\n\t\t\t\t'This embed may not preserve its aspect ratio when the browser is resized.'\n\t\t );\n}\n\nconst EmbedControls = ( {\n\tblockSupportsResponsive,\n\tshowEditButton,\n\tthemeSupportsResponsive,\n\tallowResponsive,\n\ttoggleResponsive,\n\tswitchBackToURLInput,\n} ) => {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ showEditButton && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tclassName=\"components-toolbar__control\"\n\t\t\t\t\t\t\tlabel={ __( 'Edit URL' ) }\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tonClick={ switchBackToURLInput }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t{ themeSupportsResponsive && blockSupportsResponsive && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Media settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\ttoggleResponsive( true );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Media settings' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => ! allowResponsive }\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\ttoggleResponsive( ! allowResponsive );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Resize for smaller devices' ) }\n\t\t\t\t\t\t\t\tchecked={ allowResponsive }\n\t\t\t\t\t\t\t\thelp={ getResponsiveHelp }\n\t\t\t\t\t\t\t\tonChange={ toggleResponsive }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport default EmbedControls;\n"],"mappings":";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BAAiB,CAAG;QAChCwB,QAAQ,EAAGA,CAAA,KAAM;UAChBlB,gBAAgB,CAAE,IAAK,CAAC;QACzB,CAAG;QACHE,iBAAiB,EAAGA,iBAAmB;QAAAI,QAAA,eAEvC,IAAAf,WAAA,CAAAgB,GAAA,EAACpB,WAAA,CAAAgC,4BAAc;UACdP,KAAK,EAAG,IAAAlB,QAAE,EAAE,gBAAiB,CAAG;UAChC0B,gBAAgB;UAChBC,QAAQ,EAAGA,CAAA,KAAM,CAAEtB,eAAiB;UACpCuB,UAAU,EAAGA,CAAA,KAAM;YAClBtB,gBAAgB,CAAE,CAAED,eAAgB,CAAC;UACtC,CAAG;UAAAO,QAAA,eAEH,IAAAf,WAAA,CAAAgB,GAAA,EAACpB,WAAA,CAAAoC,aAAa;YACbC,uBAAuB;YACvBZ,KAAK,EAAG,IAAAlB,QAAE,EAAE,4BAA6B,CAAG;YAC5CD,OAAO,EAAGM,eAAiB;YAC3B0B,IAAI,EAAGjC,iBAAmB;YAC1BkC,QAAQ,EAAG1B;UAAkB,CAC7B;QAAC,CACa;MAAC,CACN;IAAC,CACK,CACnB;EAAA,CACA,CAAC;AAEL,CAAC;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEalC,aAAa","ignoreList":[]}
@@ -8,6 +8,7 @@ var _i18n = require("@wordpress/i18n");
8
8
  var _components = require("@wordpress/components");
9
9
  var _blockEditor = require("@wordpress/block-editor");
10
10
  var _edit = require("./edit");
11
+ var _hooks = require("../utils/hooks");
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  /**
13
14
  * WordPress dependencies
@@ -34,6 +35,7 @@ function FileBlockInspector({
34
35
  textLinkHref,
35
36
  attachmentPage
36
37
  } = hrefs;
38
+ const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
37
39
  let linkDestinationOptions = [{
38
40
  value: href,
39
41
  label: (0, _i18n.__)('URL')
@@ -49,42 +51,83 @@ function FileBlockInspector({
49
51
  }
50
52
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
51
53
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.InspectorControls, {
52
- children: [href.endsWith('.pdf') && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.PanelBody, {
53
- title: (0, _i18n.__)('PDF settings'),
54
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
55
- __nextHasNoMarginBottom: true,
54
+ children: [href.endsWith('.pdf') && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
55
+ label: (0, _i18n.__)('PDF settings'),
56
+ resetAll: () => {
57
+ changeDisplayPreview(true);
58
+ changePreviewHeight(600);
59
+ },
60
+ dropdownMenuProps: dropdownMenuProps,
61
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
56
62
  label: (0, _i18n.__)('Show inline embed'),
57
- help: displayPreview ? (0, _i18n.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null,
58
- checked: !!displayPreview,
59
- onChange: changeDisplayPreview
60
- }), displayPreview && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
61
- __nextHasNoMarginBottom: true,
62
- __next40pxDefaultSize: true,
63
+ isShownByDefault: true,
64
+ hasValue: () => !displayPreview,
65
+ onDeselect: () => changeDisplayPreview(true),
66
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
67
+ __nextHasNoMarginBottom: true,
68
+ label: (0, _i18n.__)('Show inline embed'),
69
+ help: displayPreview ? (0, _i18n.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null,
70
+ checked: !!displayPreview,
71
+ onChange: changeDisplayPreview
72
+ })
73
+ }), displayPreview && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
63
74
  label: (0, _i18n.__)('Height in pixels'),
64
- min: _edit.MIN_PREVIEW_HEIGHT,
65
- max: Math.max(_edit.MAX_PREVIEW_HEIGHT, previewHeight),
66
- value: previewHeight,
67
- onChange: changePreviewHeight
75
+ isShownByDefault: true,
76
+ hasValue: () => previewHeight !== 600,
77
+ onDeselect: () => changePreviewHeight(600),
78
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
79
+ __nextHasNoMarginBottom: true,
80
+ __next40pxDefaultSize: true,
81
+ label: (0, _i18n.__)('Height in pixels'),
82
+ min: _edit.MIN_PREVIEW_HEIGHT,
83
+ max: Math.max(_edit.MAX_PREVIEW_HEIGHT, previewHeight),
84
+ value: previewHeight,
85
+ onChange: changePreviewHeight
86
+ })
68
87
  })]
69
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.PanelBody, {
70
- title: (0, _i18n.__)('Settings'),
71
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
72
- __next40pxDefaultSize: true,
73
- __nextHasNoMarginBottom: true,
88
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
89
+ label: (0, _i18n.__)('Settings'),
90
+ resetAll: () => {
91
+ changeLinkDestinationOption(href);
92
+ changeOpenInNewWindow(false);
93
+ changeShowDownloadButton(true);
94
+ },
95
+ dropdownMenuProps: dropdownMenuProps,
96
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
74
97
  label: (0, _i18n.__)('Link to'),
75
- value: textLinkHref,
76
- options: linkDestinationOptions,
77
- onChange: changeLinkDestinationOption
78
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
79
- __nextHasNoMarginBottom: true,
98
+ isShownByDefault: true,
99
+ hasValue: () => textLinkHref !== href,
100
+ onDeselect: () => changeLinkDestinationOption(href),
101
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
102
+ __next40pxDefaultSize: true,
103
+ __nextHasNoMarginBottom: true,
104
+ label: (0, _i18n.__)('Link to'),
105
+ value: textLinkHref,
106
+ options: linkDestinationOptions,
107
+ onChange: changeLinkDestinationOption
108
+ })
109
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
80
110
  label: (0, _i18n.__)('Open in new tab'),
81
- checked: openInNewWindow,
82
- onChange: changeOpenInNewWindow
83
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
84
- __nextHasNoMarginBottom: true,
111
+ isShownByDefault: true,
112
+ hasValue: () => !!openInNewWindow,
113
+ onDeselect: () => changeOpenInNewWindow(false),
114
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
115
+ __nextHasNoMarginBottom: true,
116
+ label: (0, _i18n.__)('Open in new tab'),
117
+ checked: openInNewWindow,
118
+ onChange: changeOpenInNewWindow
119
+ })
120
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
85
121
  label: (0, _i18n.__)('Show download button'),
86
- checked: showDownloadButton,
87
- onChange: changeShowDownloadButton
122
+ isShownByDefault: true,
123
+ hasValue: () => !showDownloadButton,
124
+ onDeselect: () => changeShowDownloadButton(true),
125
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
126
+ __nextHasNoMarginBottom: true,
127
+ label: (0, _i18n.__)('Show download button'),
128
+ checked: showDownloadButton,
129
+ onChange: changeShowDownloadButton
130
+ })
88
131
  })]
89
132
  })]
90
133
  })
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_blockEditor","_edit","_jsxRuntime","FileBlockInspector","hrefs","openInNewWindow","showDownloadButton","changeLinkDestinationOption","changeOpenInNewWindow","changeShowDownloadButton","displayPreview","changeDisplayPreview","previewHeight","changePreviewHeight","href","textLinkHref","attachmentPage","linkDestinationOptions","value","label","__","jsx","Fragment","children","jsxs","InspectorControls","endsWith","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","help","checked","onChange","RangeControl","__next40pxDefaultSize","min","MIN_PREVIEW_HEIGHT","max","Math","MAX_PREVIEW_HEIGHT","SelectControl","options"],"sources":["@wordpress/block-library/src/file/inspector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tPanelBody,\n\tRangeControl,\n\tSelectControl,\n\tToggleControl,\n} from '@wordpress/components';\nimport { InspectorControls } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { MIN_PREVIEW_HEIGHT, MAX_PREVIEW_HEIGHT } from './edit';\n\nexport default function FileBlockInspector( {\n\threfs,\n\topenInNewWindow,\n\tshowDownloadButton,\n\tchangeLinkDestinationOption,\n\tchangeOpenInNewWindow,\n\tchangeShowDownloadButton,\n\tdisplayPreview,\n\tchangeDisplayPreview,\n\tpreviewHeight,\n\tchangePreviewHeight,\n} ) {\n\tconst { href, textLinkHref, attachmentPage } = hrefs;\n\n\tlet linkDestinationOptions = [ { value: href, label: __( 'URL' ) } ];\n\tif ( attachmentPage ) {\n\t\tlinkDestinationOptions = [\n\t\t\t{ value: href, label: __( 'Media file' ) },\n\t\t\t{ value: attachmentPage, label: __( 'Attachment page' ) },\n\t\t];\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ href.endsWith( '.pdf' ) && (\n\t\t\t\t\t<PanelBody title={ __( 'PDF settings' ) }>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show inline embed' ) }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tdisplayPreview\n\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\"Note: Most phone and tablet browsers won't display embedded PDFs.\"\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ !! displayPreview }\n\t\t\t\t\t\t\tonChange={ changeDisplayPreview }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ displayPreview && (\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Height in pixels' ) }\n\t\t\t\t\t\t\t\tmin={ MIN_PREVIEW_HEIGHT }\n\t\t\t\t\t\t\t\tmax={ Math.max(\n\t\t\t\t\t\t\t\t\tMAX_PREVIEW_HEIGHT,\n\t\t\t\t\t\t\t\t\tpreviewHeight\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ previewHeight }\n\t\t\t\t\t\t\t\tonChange={ changePreviewHeight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\tvalue={ textLinkHref }\n\t\t\t\t\t\toptions={ linkDestinationOptions }\n\t\t\t\t\t\tonChange={ changeLinkDestinationOption }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewWindow }\n\t\t\t\t\t\tonChange={ changeOpenInNewWindow }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show download button' ) }\n\t\t\t\t\t\tchecked={ showDownloadButton }\n\t\t\t\t\t\tonChange={ changeShowDownloadButton }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\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,QAAE,EAAE,sBAAuB,CAAG;UACtCY,OAAO,EAAG1B,kBAAoB;UAC9B2B,QAAQ,EAAGxB;QAA0B,CACrC,CAAC;MAAA,CACQ,CAAC;IAAA,CACM;EAAC,CACnB,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_blockEditor","_edit","_hooks","_jsxRuntime","FileBlockInspector","hrefs","openInNewWindow","showDownloadButton","changeLinkDestinationOption","changeOpenInNewWindow","changeShowDownloadButton","displayPreview","changeDisplayPreview","previewHeight","changePreviewHeight","href","textLinkHref","attachmentPage","dropdownMenuProps","useToolsPanelDropdownMenuProps","linkDestinationOptions","value","label","__","jsx","Fragment","children","jsxs","InspectorControls","endsWith","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","ToggleControl","__nextHasNoMarginBottom","help","checked","onChange","RangeControl","__next40pxDefaultSize","min","MIN_PREVIEW_HEIGHT","max","Math","MAX_PREVIEW_HEIGHT","SelectControl","options"],"sources":["@wordpress/block-library/src/file/inspector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tRangeControl,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { InspectorControls } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { MIN_PREVIEW_HEIGHT, MAX_PREVIEW_HEIGHT } from './edit';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function FileBlockInspector( {\n\threfs,\n\topenInNewWindow,\n\tshowDownloadButton,\n\tchangeLinkDestinationOption,\n\tchangeOpenInNewWindow,\n\tchangeShowDownloadButton,\n\tdisplayPreview,\n\tchangeDisplayPreview,\n\tpreviewHeight,\n\tchangePreviewHeight,\n} ) {\n\tconst { href, textLinkHref, attachmentPage } = hrefs;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tlet linkDestinationOptions = [ { value: href, label: __( 'URL' ) } ];\n\tif ( attachmentPage ) {\n\t\tlinkDestinationOptions = [\n\t\t\t{ value: href, label: __( 'Media file' ) },\n\t\t\t{ value: attachmentPage, label: __( 'Attachment page' ) },\n\t\t];\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ href.endsWith( '.pdf' ) && (\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'PDF settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tchangeDisplayPreview( true );\n\t\t\t\t\t\t\tchangePreviewHeight( 600 );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Show inline embed' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => ! displayPreview }\n\t\t\t\t\t\t\tonDeselect={ () => changeDisplayPreview( true ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Show inline embed' ) }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tdisplayPreview\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t\"Note: Most phone and tablet browsers won't display embedded PDFs.\"\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchecked={ !! displayPreview }\n\t\t\t\t\t\t\t\tonChange={ changeDisplayPreview }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t{ displayPreview && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Height in pixels' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => previewHeight !== 600 }\n\t\t\t\t\t\t\t\tonDeselect={ () => changePreviewHeight( 600 ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Height in pixels' ) }\n\t\t\t\t\t\t\t\t\tmin={ MIN_PREVIEW_HEIGHT }\n\t\t\t\t\t\t\t\t\tmax={ Math.max(\n\t\t\t\t\t\t\t\t\t\tMAX_PREVIEW_HEIGHT,\n\t\t\t\t\t\t\t\t\t\tpreviewHeight\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tvalue={ previewHeight }\n\t\t\t\t\t\t\t\t\tonChange={ changePreviewHeight }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t) }\n\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tchangeLinkDestinationOption( href );\n\t\t\t\t\t\tchangeOpenInNewWindow( false );\n\t\t\t\t\t\tchangeShowDownloadButton( true );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => textLinkHref !== href }\n\t\t\t\t\t\tonDeselect={ () => changeLinkDestinationOption( href ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\t\tvalue={ textLinkHref }\n\t\t\t\t\t\t\toptions={ linkDestinationOptions }\n\t\t\t\t\t\t\tonChange={ changeLinkDestinationOption }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! openInNewWindow }\n\t\t\t\t\t\tonDeselect={ () => changeOpenInNewWindow( false ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tchecked={ openInNewWindow }\n\t\t\t\t\t\t\tonChange={ changeOpenInNewWindow }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show download button' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! showDownloadButton }\n\t\t\t\t\t\tonDeselect={ () => changeShowDownloadButton( true ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show download button' ) }\n\t\t\t\t\t\t\tchecked={ showDownloadButton }\n\t\t\t\t\t\t\tonChange={ changeShowDownloadButton }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,YAAA,GAAAF,OAAA;AAK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AO,EAAGjC,eAAiB;YAC3BkC,QAAQ,EAAG/B;UAAuB,CAClC;QAAC,CACa,CAAC,eACjB,IAAAN,WAAA,CAAAqB,GAAA,EAACzB,WAAA,CAAAiC,4BAAc;UACdV,KAAK,EAAG,IAAAC,QAAE,EAAE,sBAAuB,CAAG;UACtCU,gBAAgB;UAChBC,QAAQ,EAAGA,CAAA,KAAM,CAAE3B,kBAAoB;UACvC4B,UAAU,EAAGA,CAAA,KAAMzB,wBAAwB,CAAE,IAAK,CAAG;UAAAgB,QAAA,eAErD,IAAAvB,WAAA,CAAAqB,GAAA,EAACzB,WAAA,CAAAqC,aAAa;YACbC,uBAAuB;YACvBf,KAAK,EAAG,IAAAC,QAAE,EAAE,sBAAuB,CAAG;YACtCgB,OAAO,EAAGhC,kBAAoB;YAC9BiC,QAAQ,EAAG9B;UAA0B,CACrC;QAAC,CACa,CAAC;MAAA,CACN,CAAC;IAAA,CACK;EAAC,CACnB,CAAC;AAEL","ignoreList":[]}
@@ -8,6 +8,7 @@ var _i18n = require("@wordpress/i18n");
8
8
  var _blockEditor = require("@wordpress/block-editor");
9
9
  var _components = require("@wordpress/components");
10
10
  var _data = require("@wordpress/data");
11
+ var _hooks = require("../utils/hooks");
11
12
  var _utils = require("./utils.js");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  /**
@@ -36,6 +37,15 @@ const Edit = ({
36
37
  setAttributes,
37
38
  clientId
38
39
  }) => {
40
+ const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
41
+ const resetAllSettings = () => {
42
+ setAttributes({
43
+ submissionMethod: 'email',
44
+ email: undefined,
45
+ action: undefined,
46
+ method: 'post'
47
+ });
48
+ };
39
49
  const {
40
50
  action,
41
51
  method,
@@ -60,46 +70,66 @@ const Edit = ({
60
70
  });
61
71
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
62
72
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
63
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.PanelBody, {
64
- title: (0, _i18n.__)('Settings'),
65
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
66
- __nextHasNoMarginBottom: true,
67
- __next40pxDefaultSize: true,
73
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
74
+ dropdownMenuProps: dropdownMenuProps,
75
+ label: (0, _i18n.__)('Settings'),
76
+ resetAll: resetAllSettings,
77
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
78
+ hasValue: () => submissionMethod !== 'email',
68
79
  label: (0, _i18n.__)('Submissions method'),
69
- options: [
70
- // TODO: Allow plugins to add their own submission methods.
71
- {
72
- label: (0, _i18n.__)('Send email'),
73
- value: 'email'
74
- }, {
75
- label: (0, _i18n.__)('- Custom -'),
76
- value: 'custom'
77
- }],
78
- value: submissionMethod,
79
- onChange: value => setAttributes({
80
- submissionMethod: value
80
+ onDeselect: () => setAttributes({
81
+ submissionMethod: 'email'
81
82
  }),
82
- help: submissionMethod === 'custom' ? (0, _i18n.__)('Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "Advanced" section.') : (0, _i18n.__)('Select the method to use for form submissions.')
83
- }), submissionMethod === 'email' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
84
- __nextHasNoMarginBottom: true,
85
- __next40pxDefaultSize: true,
86
- autoComplete: "off",
83
+ isShownByDefault: true,
84
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
85
+ __nextHasNoMarginBottom: true,
86
+ __next40pxDefaultSize: true,
87
+ label: (0, _i18n.__)('Submissions method'),
88
+ options: [
89
+ // TODO: Allow plugins to add their own submission methods.
90
+ {
91
+ label: (0, _i18n.__)('Send email'),
92
+ value: 'email'
93
+ }, {
94
+ label: (0, _i18n.__)('- Custom -'),
95
+ value: 'custom'
96
+ }],
97
+ value: submissionMethod,
98
+ onChange: value => setAttributes({
99
+ submissionMethod: value
100
+ }),
101
+ help: submissionMethod === 'custom' ? (0, _i18n.__)('Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "Advanced" section.') : (0, _i18n.__)('Select the method to use for form submissions.')
102
+ })
103
+ }), submissionMethod === 'email' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
104
+ hasValue: () => !!email,
87
105
  label: (0, _i18n.__)('Email for form submissions'),
88
- value: email,
89
- required: true,
90
- onChange: value => {
91
- setAttributes({
92
- email: value
93
- });
94
- setAttributes({
95
- action: `mailto:${value}`
96
- });
97
- setAttributes({
98
- method: 'post'
99
- });
100
- },
101
- help: (0, _i18n.__)('The email address where form submissions will be sent. Separate multiple email addresses with a comma.'),
102
- type: "email"
106
+ onDeselect: () => setAttributes({
107
+ email: undefined,
108
+ action: undefined,
109
+ method: 'post'
110
+ }),
111
+ isShownByDefault: true,
112
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
113
+ __nextHasNoMarginBottom: true,
114
+ __next40pxDefaultSize: true,
115
+ autoComplete: "off",
116
+ label: (0, _i18n.__)('Email for form submissions'),
117
+ value: email || '',
118
+ required: true,
119
+ onChange: value => {
120
+ setAttributes({
121
+ email: value
122
+ });
123
+ setAttributes({
124
+ action: `mailto:${value}`
125
+ });
126
+ setAttributes({
127
+ method: 'post'
128
+ });
129
+ },
130
+ help: (0, _i18n.__)('The email address where form submissions will be sent. Separate multiple email addresses with a comma.'),
131
+ type: "email"
132
+ })
103
133
  })]
104
134
  })
105
135
  }), submissionMethod !== 'email' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.InspectorControls, {