@wordpress/block-library 9.8.4 → 9.9.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 (453) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/avatar/index.js +2 -1
  3. package/build/avatar/index.js.map +1 -1
  4. package/build/block/edit.js +1 -4
  5. package/build/block/edit.js.map +1 -1
  6. package/build/button/edit.js +2 -4
  7. package/build/button/edit.js.map +1 -1
  8. package/build/comment-author-name/index.js +2 -1
  9. package/build/comment-author-name/index.js.map +1 -1
  10. package/build/comment-content/index.js +2 -1
  11. package/build/comment-content/index.js.map +1 -1
  12. package/build/comment-date/index.js +2 -1
  13. package/build/comment-date/index.js.map +1 -1
  14. package/build/comment-edit-link/index.js +2 -1
  15. package/build/comment-edit-link/index.js.map +1 -1
  16. package/build/comment-reply-link/index.js +2 -1
  17. package/build/comment-reply-link/index.js.map +1 -1
  18. package/build/comments-pagination-next/index.js +5 -0
  19. package/build/comments-pagination-next/index.js.map +1 -1
  20. package/build/comments-pagination-numbers/index.js +2 -1
  21. package/build/comments-pagination-numbers/index.js.map +1 -1
  22. package/build/comments-pagination-previous/index.js +5 -0
  23. package/build/comments-pagination-previous/index.js.map +1 -1
  24. package/build/comments-title/index.js +2 -1
  25. package/build/comments-title/index.js.map +1 -1
  26. package/build/cover/edit/index.js +4 -2
  27. package/build/cover/edit/index.js.map +1 -1
  28. package/build/file/index.js +8 -4
  29. package/build/file/index.js.map +1 -1
  30. package/build/image/edit.js +2 -4
  31. package/build/image/edit.js.map +1 -1
  32. package/build/image/image.js +6 -10
  33. package/build/image/image.js.map +1 -1
  34. package/build/post-navigation-link/index.js +6 -0
  35. package/build/post-navigation-link/index.js.map +1 -1
  36. package/build/post-navigation-link/variations.js +14 -2
  37. package/build/post-navigation-link/variations.js.map +1 -1
  38. package/build/post-time-to-read/index.js +2 -1
  39. package/build/post-time-to-read/index.js.map +1 -1
  40. package/build/query/edit/inspector-controls/index.js +2 -2
  41. package/build/query/edit/inspector-controls/index.js.map +1 -1
  42. package/build/query/edit/inspector-controls/pages-control.js +1 -1
  43. package/build/query/edit/inspector-controls/pages-control.js.map +1 -1
  44. package/build/query/edit/inspector-controls/per-page-control.js +1 -1
  45. package/build/query/edit/inspector-controls/per-page-control.js.map +1 -1
  46. package/build/query/index.js +1 -0
  47. package/build/query/index.js.map +1 -1
  48. package/build/query-no-results/index.js +8 -0
  49. package/build/query-no-results/index.js.map +1 -1
  50. package/build/query-pagination-numbers/index.js +2 -1
  51. package/build/query-pagination-numbers/index.js.map +1 -1
  52. package/build/query-title/index.js +5 -0
  53. package/build/query-title/index.js.map +1 -1
  54. package/build/site-logo/edit.js +5 -3
  55. package/build/site-logo/edit.js.map +1 -1
  56. package/build/table-of-contents/index.js +42 -1
  57. package/build/table-of-contents/index.js.map +1 -1
  58. package/build/term-description/index.js +2 -1
  59. package/build/term-description/index.js.map +1 -1
  60. package/build-module/avatar/index.js +2 -1
  61. package/build-module/avatar/index.js.map +1 -1
  62. package/build-module/block/edit.js +1 -4
  63. package/build-module/block/edit.js.map +1 -1
  64. package/build-module/button/edit.js +4 -6
  65. package/build-module/button/edit.js.map +1 -1
  66. package/build-module/comment-author-name/index.js +2 -1
  67. package/build-module/comment-author-name/index.js.map +1 -1
  68. package/build-module/comment-content/index.js +2 -1
  69. package/build-module/comment-content/index.js.map +1 -1
  70. package/build-module/comment-date/index.js +2 -1
  71. package/build-module/comment-date/index.js.map +1 -1
  72. package/build-module/comment-edit-link/index.js +2 -1
  73. package/build-module/comment-edit-link/index.js.map +1 -1
  74. package/build-module/comment-reply-link/index.js +2 -1
  75. package/build-module/comment-reply-link/index.js.map +1 -1
  76. package/build-module/comments-pagination-next/index.js +5 -0
  77. package/build-module/comments-pagination-next/index.js.map +1 -1
  78. package/build-module/comments-pagination-numbers/index.js +2 -1
  79. package/build-module/comments-pagination-numbers/index.js.map +1 -1
  80. package/build-module/comments-pagination-previous/index.js +5 -0
  81. package/build-module/comments-pagination-previous/index.js.map +1 -1
  82. package/build-module/comments-title/index.js +2 -1
  83. package/build-module/comments-title/index.js.map +1 -1
  84. package/build-module/cover/edit/index.js +5 -3
  85. package/build-module/cover/edit/index.js.map +1 -1
  86. package/build-module/file/index.js +8 -4
  87. package/build-module/file/index.js.map +1 -1
  88. package/build-module/image/edit.js +4 -6
  89. package/build-module/image/edit.js.map +1 -1
  90. package/build-module/image/image.js +5 -9
  91. package/build-module/image/image.js.map +1 -1
  92. package/build-module/post-navigation-link/index.js +6 -0
  93. package/build-module/post-navigation-link/index.js.map +1 -1
  94. package/build-module/post-navigation-link/variations.js +14 -2
  95. package/build-module/post-navigation-link/variations.js.map +1 -1
  96. package/build-module/post-time-to-read/index.js +2 -1
  97. package/build-module/post-time-to-read/index.js.map +1 -1
  98. package/build-module/query/edit/inspector-controls/index.js +2 -2
  99. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  100. package/build-module/query/edit/inspector-controls/pages-control.js +1 -1
  101. package/build-module/query/edit/inspector-controls/pages-control.js.map +1 -1
  102. package/build-module/query/edit/inspector-controls/per-page-control.js +1 -1
  103. package/build-module/query/edit/inspector-controls/per-page-control.js.map +1 -1
  104. package/build-module/query/index.js +1 -0
  105. package/build-module/query/index.js.map +1 -1
  106. package/build-module/query-no-results/index.js +8 -0
  107. package/build-module/query-no-results/index.js.map +1 -1
  108. package/build-module/query-pagination-numbers/index.js +2 -1
  109. package/build-module/query-pagination-numbers/index.js.map +1 -1
  110. package/build-module/query-title/index.js +5 -0
  111. package/build-module/query-title/index.js.map +1 -1
  112. package/build-module/site-logo/edit.js +5 -3
  113. package/build-module/site-logo/edit.js.map +1 -1
  114. package/build-module/table-of-contents/index.js +42 -1
  115. package/build-module/table-of-contents/index.js.map +1 -1
  116. package/build-module/term-description/index.js +2 -1
  117. package/build-module/term-description/index.js.map +1 -1
  118. package/build-style/archives/editor-rtl.css +10 -1
  119. package/build-style/archives/editor.css +10 -1
  120. package/build-style/archives/style-rtl.css +10 -1
  121. package/build-style/archives/style.css +10 -1
  122. package/build-style/audio/editor-rtl.css +10 -1
  123. package/build-style/audio/editor.css +10 -1
  124. package/build-style/audio/style-rtl.css +10 -1
  125. package/build-style/audio/style.css +10 -1
  126. package/build-style/audio/theme-rtl.css +10 -1
  127. package/build-style/audio/theme.css +10 -1
  128. package/build-style/avatar/editor-rtl.css +10 -1
  129. package/build-style/avatar/editor.css +10 -1
  130. package/build-style/avatar/style-rtl.css +10 -1
  131. package/build-style/avatar/style.css +10 -1
  132. package/build-style/button/editor-rtl.css +10 -1
  133. package/build-style/button/editor.css +10 -1
  134. package/build-style/button/style-rtl.css +10 -1
  135. package/build-style/button/style.css +10 -1
  136. package/build-style/buttons/editor-rtl.css +10 -1
  137. package/build-style/buttons/editor.css +10 -1
  138. package/build-style/buttons/style-rtl.css +11 -1
  139. package/build-style/buttons/style.css +11 -1
  140. package/build-style/calendar/style-rtl.css +10 -1
  141. package/build-style/calendar/style.css +10 -1
  142. package/build-style/categories/editor-rtl.css +10 -1
  143. package/build-style/categories/editor.css +10 -1
  144. package/build-style/categories/style-rtl.css +10 -1
  145. package/build-style/categories/style.css +10 -1
  146. package/build-style/classic-rtl.css +10 -1
  147. package/build-style/classic.css +10 -1
  148. package/build-style/code/editor-rtl.css +10 -1
  149. package/build-style/code/editor.css +10 -1
  150. package/build-style/code/style-rtl.css +10 -1
  151. package/build-style/code/style.css +10 -1
  152. package/build-style/code/theme-rtl.css +10 -1
  153. package/build-style/code/theme.css +10 -1
  154. package/build-style/columns/editor-rtl.css +10 -1
  155. package/build-style/columns/editor.css +10 -1
  156. package/build-style/columns/style-rtl.css +10 -1
  157. package/build-style/columns/style.css +10 -1
  158. package/build-style/comment-author-avatar/editor-rtl.css +10 -1
  159. package/build-style/comment-author-avatar/editor.css +10 -1
  160. package/build-style/comment-author-name/style-rtl.css +10 -1
  161. package/build-style/comment-author-name/style.css +10 -1
  162. package/build-style/comment-content/style-rtl.css +10 -1
  163. package/build-style/comment-content/style.css +10 -1
  164. package/build-style/comment-date/style-rtl.css +10 -1
  165. package/build-style/comment-date/style.css +10 -1
  166. package/build-style/comment-edit-link/style-rtl.css +10 -1
  167. package/build-style/comment-edit-link/style.css +10 -1
  168. package/build-style/comment-reply-link/style-rtl.css +10 -1
  169. package/build-style/comment-reply-link/style.css +10 -1
  170. package/build-style/comment-template/style-rtl.css +10 -1
  171. package/build-style/comment-template/style.css +10 -1
  172. package/build-style/comments/editor-rtl.css +10 -1
  173. package/build-style/comments/editor.css +10 -1
  174. package/build-style/comments/style-rtl.css +10 -1
  175. package/build-style/comments/style.css +10 -1
  176. package/build-style/comments-pagination/editor-rtl.css +10 -1
  177. package/build-style/comments-pagination/editor.css +10 -1
  178. package/build-style/comments-pagination/style-rtl.css +10 -1
  179. package/build-style/comments-pagination/style.css +10 -1
  180. package/build-style/comments-pagination-numbers/editor-rtl.css +10 -1
  181. package/build-style/comments-pagination-numbers/editor.css +10 -1
  182. package/build-style/comments-title/editor-rtl.css +10 -1
  183. package/build-style/comments-title/editor.css +10 -1
  184. package/build-style/common-rtl.css +10 -1
  185. package/build-style/common.css +10 -1
  186. package/build-style/cover/editor-rtl.css +10 -1
  187. package/build-style/cover/editor.css +10 -1
  188. package/build-style/cover/style-rtl.css +10 -1
  189. package/build-style/cover/style.css +10 -1
  190. package/build-style/details/editor-rtl.css +10 -1
  191. package/build-style/details/editor.css +10 -1
  192. package/build-style/details/style-rtl.css +10 -1
  193. package/build-style/details/style.css +10 -1
  194. package/build-style/editor-elements-rtl.css +10 -1
  195. package/build-style/editor-elements.css +10 -1
  196. package/build-style/editor-rtl.css +16 -19
  197. package/build-style/editor.css +16 -19
  198. package/build-style/elements-rtl.css +10 -1
  199. package/build-style/elements.css +10 -1
  200. package/build-style/embed/editor-rtl.css +10 -1
  201. package/build-style/embed/editor.css +10 -1
  202. package/build-style/embed/style-rtl.css +10 -1
  203. package/build-style/embed/style.css +10 -1
  204. package/build-style/embed/theme-rtl.css +10 -1
  205. package/build-style/embed/theme.css +10 -1
  206. package/build-style/file/editor-rtl.css +10 -1
  207. package/build-style/file/editor.css +10 -1
  208. package/build-style/file/style-rtl.css +10 -1
  209. package/build-style/file/style.css +10 -1
  210. package/build-style/footnotes/style-rtl.css +10 -1
  211. package/build-style/footnotes/style.css +10 -1
  212. package/build-style/form-input/editor-rtl.css +10 -1
  213. package/build-style/form-input/editor.css +10 -1
  214. package/build-style/form-input/style-rtl.css +10 -1
  215. package/build-style/form-input/style.css +10 -1
  216. package/build-style/form-submission-notification/editor-rtl.css +10 -1
  217. package/build-style/form-submission-notification/editor.css +10 -1
  218. package/build-style/form-submit-button/style-rtl.css +10 -1
  219. package/build-style/form-submit-button/style.css +10 -1
  220. package/build-style/freeform/editor-rtl.css +10 -1
  221. package/build-style/freeform/editor.css +10 -1
  222. package/build-style/gallery/editor-rtl.css +10 -1
  223. package/build-style/gallery/editor.css +10 -1
  224. package/build-style/gallery/style-rtl.css +10 -1
  225. package/build-style/gallery/style.css +10 -1
  226. package/build-style/gallery/theme-rtl.css +10 -1
  227. package/build-style/gallery/theme.css +10 -1
  228. package/build-style/group/editor-rtl.css +12 -3
  229. package/build-style/group/editor.css +12 -3
  230. package/build-style/group/style-rtl.css +10 -1
  231. package/build-style/group/style.css +10 -1
  232. package/build-style/group/theme-rtl.css +10 -1
  233. package/build-style/group/theme.css +10 -1
  234. package/build-style/heading/style-rtl.css +10 -1
  235. package/build-style/heading/style.css +10 -1
  236. package/build-style/html/editor-rtl.css +10 -1
  237. package/build-style/html/editor.css +10 -1
  238. package/build-style/image/editor-rtl.css +10 -1
  239. package/build-style/image/editor.css +10 -1
  240. package/build-style/image/style-rtl.css +10 -1
  241. package/build-style/image/style.css +10 -1
  242. package/build-style/image/theme-rtl.css +10 -1
  243. package/build-style/image/theme.css +10 -1
  244. package/build-style/latest-comments/style-rtl.css +10 -1
  245. package/build-style/latest-comments/style.css +10 -1
  246. package/build-style/latest-posts/editor-rtl.css +10 -1
  247. package/build-style/latest-posts/editor.css +10 -1
  248. package/build-style/latest-posts/style-rtl.css +10 -1
  249. package/build-style/latest-posts/style.css +10 -1
  250. package/build-style/list/style-rtl.css +10 -1
  251. package/build-style/list/style.css +10 -1
  252. package/build-style/loginout/style-rtl.css +10 -1
  253. package/build-style/loginout/style.css +10 -1
  254. package/build-style/media-text/editor-rtl.css +10 -1
  255. package/build-style/media-text/editor.css +10 -1
  256. package/build-style/media-text/style-rtl.css +10 -1
  257. package/build-style/media-text/style.css +10 -1
  258. package/build-style/more/editor-rtl.css +10 -1
  259. package/build-style/more/editor.css +10 -1
  260. package/build-style/navigation/editor-rtl.css +10 -1
  261. package/build-style/navigation/editor.css +10 -1
  262. package/build-style/navigation/style-rtl.css +10 -1
  263. package/build-style/navigation/style.css +10 -1
  264. package/build-style/navigation-link/editor-rtl.css +10 -1
  265. package/build-style/navigation-link/editor.css +10 -1
  266. package/build-style/navigation-link/style-rtl.css +10 -1
  267. package/build-style/navigation-link/style.css +10 -1
  268. package/build-style/navigation-submenu/editor-rtl.css +10 -1
  269. package/build-style/navigation-submenu/editor.css +10 -1
  270. package/build-style/nextpage/editor-rtl.css +10 -1
  271. package/build-style/nextpage/editor.css +10 -1
  272. package/build-style/page-list/editor-rtl.css +10 -1
  273. package/build-style/page-list/editor.css +10 -1
  274. package/build-style/page-list/style-rtl.css +10 -1
  275. package/build-style/page-list/style.css +10 -1
  276. package/build-style/paragraph/editor-rtl.css +10 -1
  277. package/build-style/paragraph/editor.css +10 -1
  278. package/build-style/paragraph/style-rtl.css +10 -1
  279. package/build-style/paragraph/style.css +10 -1
  280. package/build-style/post-author/editor-rtl.css +10 -1
  281. package/build-style/post-author/editor.css +10 -1
  282. package/build-style/post-author/style-rtl.css +10 -1
  283. package/build-style/post-author/style.css +10 -1
  284. package/build-style/post-author-biography/style-rtl.css +10 -1
  285. package/build-style/post-author-biography/style.css +10 -1
  286. package/build-style/post-author-name/style-rtl.css +10 -1
  287. package/build-style/post-author-name/style.css +10 -1
  288. package/build-style/post-comments-form/editor-rtl.css +10 -1
  289. package/build-style/post-comments-form/editor.css +10 -1
  290. package/build-style/post-comments-form/style-rtl.css +10 -1
  291. package/build-style/post-comments-form/style.css +10 -1
  292. package/build-style/post-content/style-rtl.css +10 -1
  293. package/build-style/post-content/style.css +10 -1
  294. package/build-style/post-date/style-rtl.css +10 -1
  295. package/build-style/post-date/style.css +10 -1
  296. package/build-style/post-excerpt/editor-rtl.css +10 -1
  297. package/build-style/post-excerpt/editor.css +10 -1
  298. package/build-style/post-excerpt/style-rtl.css +10 -1
  299. package/build-style/post-excerpt/style.css +10 -1
  300. package/build-style/post-featured-image/editor-rtl.css +10 -1
  301. package/build-style/post-featured-image/editor.css +10 -1
  302. package/build-style/post-featured-image/style-rtl.css +10 -1
  303. package/build-style/post-featured-image/style.css +10 -1
  304. package/build-style/post-navigation-link/style-rtl.css +10 -1
  305. package/build-style/post-navigation-link/style.css +10 -1
  306. package/build-style/post-template/editor-rtl.css +10 -1
  307. package/build-style/post-template/editor.css +10 -1
  308. package/build-style/post-template/style-rtl.css +10 -1
  309. package/build-style/post-template/style.css +10 -1
  310. package/build-style/post-terms/style-rtl.css +10 -1
  311. package/build-style/post-terms/style.css +10 -1
  312. package/build-style/post-time-to-read/style-rtl.css +10 -1
  313. package/build-style/post-time-to-read/style.css +10 -1
  314. package/build-style/post-title/style-rtl.css +10 -1
  315. package/build-style/post-title/style.css +10 -1
  316. package/build-style/preformatted/style-rtl.css +10 -1
  317. package/build-style/preformatted/style.css +10 -1
  318. package/build-style/pullquote/editor-rtl.css +10 -1
  319. package/build-style/pullquote/editor.css +10 -1
  320. package/build-style/pullquote/style-rtl.css +10 -1
  321. package/build-style/pullquote/style.css +10 -1
  322. package/build-style/pullquote/theme-rtl.css +10 -1
  323. package/build-style/pullquote/theme.css +10 -1
  324. package/build-style/query/editor-rtl.css +10 -1
  325. package/build-style/query/editor.css +10 -1
  326. package/build-style/query-pagination/editor-rtl.css +10 -1
  327. package/build-style/query-pagination/editor.css +10 -1
  328. package/build-style/query-pagination/style-rtl.css +10 -1
  329. package/build-style/query-pagination/style.css +10 -1
  330. package/build-style/query-pagination-numbers/editor-rtl.css +10 -1
  331. package/build-style/query-pagination-numbers/editor.css +10 -1
  332. package/build-style/query-title/style-rtl.css +10 -1
  333. package/build-style/query-title/style.css +10 -1
  334. package/build-style/quote/style-rtl.css +10 -1
  335. package/build-style/quote/style.css +10 -1
  336. package/build-style/quote/theme-rtl.css +10 -1
  337. package/build-style/quote/theme.css +10 -1
  338. package/build-style/read-more/style-rtl.css +10 -1
  339. package/build-style/read-more/style.css +10 -1
  340. package/build-style/reset-rtl.css +10 -1
  341. package/build-style/reset.css +10 -1
  342. package/build-style/rss/editor-rtl.css +10 -1
  343. package/build-style/rss/editor.css +10 -1
  344. package/build-style/rss/style-rtl.css +10 -1
  345. package/build-style/rss/style.css +10 -1
  346. package/build-style/search/editor-rtl.css +10 -1
  347. package/build-style/search/editor.css +10 -1
  348. package/build-style/search/style-rtl.css +10 -1
  349. package/build-style/search/style.css +10 -1
  350. package/build-style/search/theme-rtl.css +10 -1
  351. package/build-style/search/theme.css +10 -1
  352. package/build-style/separator/editor-rtl.css +10 -1
  353. package/build-style/separator/editor.css +10 -1
  354. package/build-style/separator/style-rtl.css +10 -1
  355. package/build-style/separator/style.css +10 -1
  356. package/build-style/separator/theme-rtl.css +10 -1
  357. package/build-style/separator/theme.css +10 -1
  358. package/build-style/shortcode/editor-rtl.css +10 -1
  359. package/build-style/shortcode/editor.css +10 -1
  360. package/build-style/site-logo/editor-rtl.css +10 -1
  361. package/build-style/site-logo/editor.css +10 -1
  362. package/build-style/site-logo/style-rtl.css +10 -1
  363. package/build-style/site-logo/style.css +10 -1
  364. package/build-style/site-tagline/editor-rtl.css +10 -1
  365. package/build-style/site-tagline/editor.css +10 -1
  366. package/build-style/site-tagline/style-rtl.css +10 -1
  367. package/build-style/site-tagline/style.css +10 -1
  368. package/build-style/site-title/editor-rtl.css +10 -1
  369. package/build-style/site-title/editor.css +10 -1
  370. package/build-style/site-title/style-rtl.css +10 -1
  371. package/build-style/site-title/style.css +10 -1
  372. package/build-style/social-link/editor-rtl.css +10 -1
  373. package/build-style/social-link/editor.css +10 -1
  374. package/build-style/social-links/editor-rtl.css +14 -12
  375. package/build-style/social-links/editor.css +14 -12
  376. package/build-style/social-links/style-rtl.css +10 -1
  377. package/build-style/social-links/style.css +10 -1
  378. package/build-style/spacer/editor-rtl.css +10 -1
  379. package/build-style/spacer/editor.css +10 -1
  380. package/build-style/spacer/style-rtl.css +10 -1
  381. package/build-style/spacer/style.css +10 -1
  382. package/build-style/style-rtl.css +11 -1
  383. package/build-style/style.css +11 -1
  384. package/build-style/table/editor-rtl.css +10 -1
  385. package/build-style/table/editor.css +10 -1
  386. package/build-style/table/style-rtl.css +10 -1
  387. package/build-style/table/style.css +10 -1
  388. package/build-style/table/theme-rtl.css +10 -1
  389. package/build-style/table/theme.css +10 -1
  390. package/build-style/table-of-contents/style-rtl.css +10 -1
  391. package/build-style/table-of-contents/style.css +10 -1
  392. package/build-style/tag-cloud/editor-rtl.css +10 -1
  393. package/build-style/tag-cloud/editor.css +10 -1
  394. package/build-style/tag-cloud/style-rtl.css +10 -1
  395. package/build-style/tag-cloud/style.css +10 -1
  396. package/build-style/template-part/editor-rtl.css +10 -1
  397. package/build-style/template-part/editor.css +10 -1
  398. package/build-style/template-part/theme-rtl.css +10 -1
  399. package/build-style/template-part/theme.css +10 -1
  400. package/build-style/term-description/style-rtl.css +10 -1
  401. package/build-style/term-description/style.css +10 -1
  402. package/build-style/text-columns/editor-rtl.css +10 -1
  403. package/build-style/text-columns/editor.css +10 -1
  404. package/build-style/text-columns/style-rtl.css +10 -1
  405. package/build-style/text-columns/style.css +10 -1
  406. package/build-style/theme-rtl.css +10 -1
  407. package/build-style/theme.css +10 -1
  408. package/build-style/verse/style-rtl.css +10 -1
  409. package/build-style/verse/style.css +10 -1
  410. package/build-style/video/editor-rtl.css +10 -1
  411. package/build-style/video/editor.css +10 -1
  412. package/build-style/video/style-rtl.css +10 -1
  413. package/build-style/video/style.css +10 -1
  414. package/build-style/video/theme-rtl.css +10 -1
  415. package/build-style/video/theme.css +10 -1
  416. package/package.json +35 -35
  417. package/src/avatar/index.js +1 -0
  418. package/src/block/edit.js +1 -2
  419. package/src/button/edit.js +6 -8
  420. package/src/buttons/style.scss +2 -0
  421. package/src/categories/index.php +1 -1
  422. package/src/comment-author-name/index.js +1 -0
  423. package/src/comment-content/index.js +1 -0
  424. package/src/comment-date/index.js +1 -0
  425. package/src/comment-edit-link/index.js +1 -0
  426. package/src/comment-reply-link/index.js +1 -0
  427. package/src/comments-pagination-next/block.json +5 -0
  428. package/src/comments-pagination-numbers/index.js +1 -0
  429. package/src/comments-pagination-previous/block.json +5 -0
  430. package/src/comments-title/index.js +1 -0
  431. package/src/cover/edit/index.js +6 -2
  432. package/src/editor.scss +0 -1
  433. package/src/file/block.json +8 -4
  434. package/src/group/editor.scss +2 -2
  435. package/src/image/edit.js +6 -8
  436. package/src/image/image.js +5 -7
  437. package/src/post-navigation-link/block.json +6 -0
  438. package/src/post-navigation-link/variations.js +12 -0
  439. package/src/post-time-to-read/index.js +1 -0
  440. package/src/query/block.json +1 -0
  441. package/src/query/edit/inspector-controls/index.js +2 -2
  442. package/src/query/edit/inspector-controls/pages-control.js +1 -1
  443. package/src/query/edit/inspector-controls/per-page-control.js +1 -1
  444. package/src/query-no-results/block.json +10 -0
  445. package/src/query-pagination-numbers/index.js +1 -0
  446. package/src/query-title/block.json +5 -0
  447. package/src/site-logo/edit.js +1 -0
  448. package/src/social-links/editor.scss +4 -13
  449. package/src/table-of-contents/block.json +52 -1
  450. package/src/term-description/index.js +1 -0
  451. package/build-style/post-content/editor-rtl.css +0 -95
  452. package/build-style/post-content/editor.css +0 -95
  453. package/src/post-content/editor.scss +0 -4
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useEntityProp","store","coreStore","useEffect","useMemo","useRef","Placeholder","Spinner","compose","useResizeObserver","withColors","ColorPalette","useBlockProps","useSettings","useInnerBlocksProps","__experimentalUseGradient","blockEditorStore","__","useSelect","useDispatch","isBlobURL","noticesStore","attributesFromMedia","IMAGE_BACKGROUND_TYPE","VIDEO_BACKGROUND_TYPE","dimRatioToClass","isContentPositionCenter","getPositionClassName","mediaPosition","CoverInspectorControls","CoverBlockControls","CoverPlaceholder","ResizableCoverPopover","getMediaColor","compositeIsDark","DEFAULT_BACKGROUND_COLOR","DEFAULT_OVERLAY_COLOR","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getInnerBlocksTemplate","attributes","align","placeholder","isTemporaryMedia","id","url","CoverEdit","clientId","isSelected","overlayColor","setAttributes","setOverlayColor","toggleSelection","context","postId","postType","contentPosition","originalUrl","backgroundType","originalBackgroundType","useFeaturedImage","dimRatio","focalPoint","hasParallax","isDark","isRepeated","minHeight","minHeightUnit","alt","allowedBlocks","templateLock","tagName","TagName","isUserOverlayColor","featuredImage","__unstableMarkNextChangeAsNotPersistent","media","select","getMedia","mediaUrl","source_url","averageBackgroundColor","newOverlayColor","color","newIsDark","replaceAll","createErrorNotice","gradientClass","gradientValue","onSelectMedia","newMedia","mediaAttributes","isImage","type","media_type","includes","undefined","newDimRatio","onClearMedia","onSetOverlayColor","onUpdateDimRatio","onUploadError","message","isUploadingMedia","isImageBackground","isVideoBackground","resizeListener","height","width","resizableBoxDimensions","minHeightWithUnit","isImgElement","style","backgroundImage","backgroundPosition","bgStyle","backgroundColor","mediaStyle","objectPosition","hasBackground","hasInnerBlocks","getBlock","innerBlocks","length","ref","blockProps","fontSizes","hasFontSizes","innerBlocksTemplate","fontSize","innerBlocksProps","className","template","templateInsertUpdatesSelection","dropZoneElement","current","mediaElement","currentSettings","toggleUseFeaturedImage","newUseFeaturedImage","blockControls","inspectorControls","coverRef","updateDimRatio","resizableCoverProps","onResizeStart","onResize","value","onResizeStop","newMinHeight","showHandle","dimensions","aspectRatio","size","children","onError","disableCustomColors","onChange","clearable","classes","showOverlay","class","withIllustration","src","role","autoPlay","muted","loop","disableMediaButtons"],"sources":["@wordpress/block-library/src/cover/edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { Placeholder, Spinner } from '@wordpress/components';\nimport { compose, useResizeObserver } from '@wordpress/compose';\nimport {\n\twithColors,\n\tColorPalette,\n\tuseBlockProps,\n\tuseSettings,\n\tuseInnerBlocksProps,\n\t__experimentalUseGradient,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport {\n\tattributesFromMedia,\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from '../shared';\nimport CoverInspectorControls from './inspector-controls';\nimport CoverBlockControls from './block-controls';\nimport CoverPlaceholder from './cover-placeholder';\nimport ResizableCoverPopover from './resizable-cover-popover';\nimport {\n\tgetMediaColor,\n\tcompositeIsDark,\n\tDEFAULT_BACKGROUND_COLOR,\n\tDEFAULT_OVERLAY_COLOR,\n} from './color-utils';\n\nfunction getInnerBlocksTemplate( attributes ) {\n\treturn [\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\talign: 'center',\n\t\t\t\tplaceholder: __( 'Write title…' ),\n\t\t\t\t...attributes,\n\t\t\t},\n\t\t],\n\t];\n}\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while\n * the media (image or video) is being uploaded and will not have an id allocated yet.\n *\n * @param {number} id The id of the media.\n * @param {string} url The url of the media.\n *\n * @return {boolean} Is the URL a Blob URL.\n */\nconst isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );\n\nfunction CoverEdit( {\n\tattributes,\n\tclientId,\n\tisSelected,\n\toverlayColor,\n\tsetAttributes,\n\tsetOverlayColor,\n\ttoggleSelection,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tcontentPosition,\n\t\tid,\n\t\turl: originalUrl,\n\t\tbackgroundType: originalBackgroundType,\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\tallowedBlocks,\n\t\ttemplateLock,\n\t\ttagName: TagName = 'div',\n\t\tisUserOverlayColor,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst media = useSelect(\n\t\t( select ) =>\n\t\t\tfeaturedImage &&\n\t\t\tselect( coreStore ).getMedia( featuredImage, { context: 'view' } ),\n\t\t[ featuredImage ]\n\t);\n\tconst mediaUrl = media?.source_url;\n\n\t// User can change the featured image outside of the block, but we still\n\t// need to update the block when that happens. This effect should only\n\t// run when the featured image changes in that case. All other cases are\n\t// handled in their respective callbacks.\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tif ( ! useFeaturedImage ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst averageBackgroundColor = await getMediaColor( mediaUrl );\n\n\t\t\tlet newOverlayColor = overlayColor.color;\n\t\t\tif ( ! isUserOverlayColor ) {\n\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t}\n\n\t\t\tconst newIsDark = compositeIsDark(\n\t\t\t\tdimRatio,\n\t\t\t\tnewOverlayColor,\n\t\t\t\taverageBackgroundColor\n\t\t\t);\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t\t} );\n\t\t} )();\n\t\t// Disable reason: Update the block only when the featured image changes.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ mediaUrl ] );\n\n\t// instead of destructuring the attributes\n\t// we define the url and background type\n\t// depending on the value of the useFeaturedImage flag\n\t// to preview in edit the dynamic featured image\n\tconst url = useFeaturedImage\n\t\t? mediaUrl\n\t\t: // Ensure the url is not malformed due to sanitization through `wp_kses`.\n\t\t originalUrl?.replaceAll( '&amp;', '&' );\n\tconst backgroundType = useFeaturedImage\n\t\t? IMAGE_BACKGROUND_TYPE\n\t\t: originalBackgroundType;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { gradientClass, gradientValue } = __experimentalUseGradient();\n\n\tconst onSelectMedia = async ( newMedia ) => {\n\t\tconst mediaAttributes = attributesFromMedia( newMedia );\n\t\tconst isImage = [ newMedia?.type, newMedia?.media_type ].includes(\n\t\t\tIMAGE_BACKGROUND_TYPE\n\t\t);\n\n\t\tconst averageBackgroundColor = await getMediaColor(\n\t\t\tisImage ? newMedia?.url : undefined\n\t\t);\n\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\tsetOverlayColor( newOverlayColor );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\t// See issue #52835 for context.\n\t\tconst newDimRatio =\n\t\t\toriginalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\t...mediaAttributes,\n\t\t\tfocalPoint: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t} );\n\t};\n\n\tconst onClearMedia = () => {\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = DEFAULT_OVERLAY_COLOR;\n\t\t\tsetOverlayColor( undefined );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\tDEFAULT_BACKGROUND_COLOR\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t\tbackgroundType: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onSetOverlayColor = async ( newOverlayColor ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetOverlayColor( newOverlayColor );\n\n\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\n\t\tsetAttributes( {\n\t\t\tisUserOverlayColor: true,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUpdateDimRatio = async ( newDimRatio ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\toverlayColor.color,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst isUploadingMedia = isTemporaryMedia( id, url );\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst [ resizeListener, { height, width } ] = useResizeObserver();\n\tconst resizableBoxDimensions = useMemo( () => {\n\t\treturn {\n\t\t\theight: minHeightUnit === 'px' ? minHeight : 'auto',\n\t\t\twidth: 'auto',\n\t\t};\n\t}, [ minHeight, minHeightUnit ] );\n\n\tconst minHeightWithUnit =\n\t\tminHeight && minHeightUnit\n\t\t\t? `${ minHeight }${ minHeightUnit }`\n\t\t\t: minHeight;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeightWithUnit || undefined,\n\t};\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst bgStyle = { backgroundColor: overlayColor.color };\n\tconst mediaStyle = {\n\t\tobjectPosition:\n\t\t\tfocalPoint && isImgElement\n\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t: undefined,\n\t};\n\n\tconst hasBackground = !! ( url || overlayColor.color || gradientValue );\n\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlock( clientId ).innerBlocks.length >\n\t\t\t0,\n\t\t[ clientId ]\n\t);\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\t// Check for fontSize support before we pass a fontSize attribute to the innerBlocks.\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\tconst hasFontSizes = fontSizes?.length > 0;\n\tconst innerBlocksTemplate = getInnerBlocksTemplate( {\n\t\tfontSize: hasFontSizes ? 'large' : undefined,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t},\n\t\t{\n\t\t\t// Avoid template sync when the `templateLock` value is `all` or `contentOnly`.\n\t\t\t// See: https://github.com/WordPress/gutenberg/pull/45632\n\t\t\ttemplate: ! hasInnerBlocks ? innerBlocksTemplate : undefined,\n\t\t\ttemplateInsertUpdatesSelection: true,\n\t\t\tallowedBlocks,\n\t\t\ttemplateLock,\n\t\t\tdropZoneElement: ref.current,\n\t\t}\n\t);\n\n\tconst mediaElement = useRef();\n\tconst currentSettings = {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\thasInnerBlocks,\n\t\turl,\n\t\tisImgElement,\n\t\toverlayColor,\n\t};\n\n\tconst toggleUseFeaturedImage = async () => {\n\t\tconst newUseFeaturedImage = ! useFeaturedImage;\n\n\t\tconst averageBackgroundColor = newUseFeaturedImage\n\t\t\t? await getMediaColor( mediaUrl )\n\t\t\t: DEFAULT_BACKGROUND_COLOR;\n\n\t\tconst newOverlayColor = ! isUserOverlayColor\n\t\t\t? averageBackgroundColor\n\t\t\t: overlayColor.color;\n\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t} else {\n\t\t\t\tsetOverlayColor( undefined );\n\t\t\t}\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newDimRatio = dimRatio === 100 ? 50 : dimRatio;\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tid: undefined,\n\t\t\turl: undefined,\n\t\t\tuseFeaturedImage: newUseFeaturedImage,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tbackgroundType: useFeaturedImage\n\t\t\t\t? IMAGE_BACKGROUND_TYPE\n\t\t\t\t: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst blockControls = (\n\t\t<CoverBlockControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst inspectorControls = (\n\t\t<CoverInspectorControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tclientId={ clientId }\n\t\t\tsetOverlayColor={ onSetOverlayColor }\n\t\t\tcoverRef={ ref }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tupdateDimRatio={ onUpdateDimRatio }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst resizableCoverProps = {\n\t\tclassName: 'block-library-cover__resize-container',\n\t\tclientId,\n\t\theight,\n\t\tminHeight: minHeightWithUnit,\n\t\tonResizeStart: () => {\n\t\t\tsetAttributes( { minHeightUnit: 'px' } );\n\t\t\ttoggleSelection( false );\n\t\t},\n\t\tonResize: ( value ) => {\n\t\t\tsetAttributes( { minHeight: value } );\n\t\t},\n\t\tonResizeStop: ( newMinHeight ) => {\n\t\t\ttoggleSelection( true );\n\t\t\tsetAttributes( { minHeight: newMinHeight } );\n\t\t},\n\t\t// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.\n\t\tshowHandle: ! attributes.style?.dimensions?.aspectRatio ? true : false,\n\t\tsize: resizableBoxDimensions,\n\t\twidth,\n\t};\n\n\tif ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ blockControls }\n\t\t\t\t{ inspectorControls }\n\t\t\t\t{ isSelected && (\n\t\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t\t) }\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\tminHeight: minHeightWithUnit || undefined,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t<CoverPlaceholder\n\t\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"wp-block-cover__placeholder-background-options\">\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\tvalue={ overlayColor.color }\n\t\t\t\t\t\t\t\tonChange={ onSetOverlayColor }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CoverPlaceholder>\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-dark-theme': isDark,\n\t\t\t'is-light': ! isDark,\n\t\t\t'is-transient': isUploadingMedia,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst showOverlay =\n\t\turl || ! useFeaturedImage || ( useFeaturedImage && ! url );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( classes, blockProps.className ) }\n\t\t\t\tstyle={ { ...style, ...blockProps.style } }\n\t\t\t\tdata-url={ url }\n\t\t\t>\n\t\t\t\t{ resizeListener }\n\t\t\t\t{ showOverlay && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ overlayColor.class ]: overlayColor.class,\n\t\t\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ { backgroundImage: gradientValue, ...bgStyle } }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ ! url && useFeaturedImage && (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\tclassName=\"wp-block-cover__image--placeholder-image\"\n\t\t\t\t\t\twithIllustration\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ url &&\n\t\t\t\t\tisImageBackground &&\n\t\t\t\t\t( isImgElement ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\tclassName=\"wp-block-cover__image-background\"\n\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t'wp-block-cover__image-background'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ { backgroundImage, backgroundPosition } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ url && isVideoBackground && (\n\t\t\t\t\t<video\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background\"\n\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isUploadingMedia && <Spinner /> }\n\t\t\t\t<CoverPlaceholder\n\t\t\t\t\tdisableMediaButtons\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t/>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</TagName>\n\t\t\t{ isSelected && (\n\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithColors( { overlayColor: 'background-color' } ),\n] )( CoverEdit );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACxE,SAASC,SAAS,EAAEC,O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,EACFrE,GAAG,IAAI4D,iBAAiB,iBACzBvE,IAAA;QACC0F,GAAG,EAAGY,YAAc;QACpBL,SAAS,EAAC,kCAAkC;QAC5CkC,QAAQ;QACRC,KAAK;QACLC,IAAI;QACJJ,GAAG,EAAGtH,GAAK;QACXmE,KAAK,EAAGK;MAAY,CACpB,CACD,EACCd,gBAAgB,iBAAIrE,IAAA,CAAC/B,OAAO,IAAE,CAAC,eACjC+B,IAAA,CAACP,gBAAgB;QAChB6I,mBAAmB;QACnB/E,aAAa,EAAGA,aAAe;QAC/BkE,OAAO,EAAGtD,aAAe;QACzBqC,sBAAsB,EAAGA;MAAwB,CACjD,CAAC,eACFxG,IAAA;QAAA,GAAUgG;MAAgB,CAAI,CAAC;IAAA,CACvB,CAAC,EACRlF,UAAU,iBACXd,IAAA,CAACN,qBAAqB;MAAA,GAAMoH;IAAmB,CAAI,CACnD;EAAA,CACA,CAAC;AAEL;AAEA,eAAe5I,OAAO,CAAE,CACvBE,UAAU,CAAE;EAAE2C,YAAY,EAAE;AAAmB,CAAE,CAAC,CACjD,CAAC,CAAEH,SAAU,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useEntityProp","store","coreStore","useEffect","useMemo","useRef","Placeholder","Spinner","compose","useResizeObserver","withColors","ColorPalette","useBlockProps","useSettings","useInnerBlocksProps","__experimentalUseGradient","blockEditorStore","useBlockEditingMode","__","useSelect","useDispatch","isBlobURL","noticesStore","attributesFromMedia","IMAGE_BACKGROUND_TYPE","VIDEO_BACKGROUND_TYPE","dimRatioToClass","isContentPositionCenter","getPositionClassName","mediaPosition","CoverInspectorControls","CoverBlockControls","CoverPlaceholder","ResizableCoverPopover","getMediaColor","compositeIsDark","DEFAULT_BACKGROUND_COLOR","DEFAULT_OVERLAY_COLOR","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getInnerBlocksTemplate","attributes","align","placeholder","isTemporaryMedia","id","url","CoverEdit","clientId","isSelected","overlayColor","setAttributes","setOverlayColor","toggleSelection","context","postId","postType","contentPosition","originalUrl","backgroundType","originalBackgroundType","useFeaturedImage","dimRatio","focalPoint","hasParallax","isDark","isRepeated","minHeight","minHeightUnit","alt","allowedBlocks","templateLock","tagName","TagName","isUserOverlayColor","featuredImage","__unstableMarkNextChangeAsNotPersistent","media","select","getMedia","mediaUrl","source_url","averageBackgroundColor","newOverlayColor","color","newIsDark","replaceAll","createErrorNotice","gradientClass","gradientValue","onSelectMedia","newMedia","mediaAttributes","isImage","type","media_type","includes","undefined","newDimRatio","onClearMedia","onSetOverlayColor","onUpdateDimRatio","onUploadError","message","isUploadingMedia","isImageBackground","isVideoBackground","blockEditingMode","hasNonContentControls","resizeListener","height","width","resizableBoxDimensions","minHeightWithUnit","isImgElement","style","backgroundImage","backgroundPosition","bgStyle","backgroundColor","mediaStyle","objectPosition","hasBackground","hasInnerBlocks","getBlock","innerBlocks","length","ref","blockProps","fontSizes","hasFontSizes","innerBlocksTemplate","fontSize","innerBlocksProps","className","template","templateInsertUpdatesSelection","dropZoneElement","current","mediaElement","currentSettings","toggleUseFeaturedImage","newUseFeaturedImage","blockControls","inspectorControls","coverRef","updateDimRatio","resizableCoverProps","onResizeStart","onResize","value","onResizeStop","newMinHeight","showHandle","dimensions","aspectRatio","size","children","onError","disableCustomColors","onChange","clearable","classes","showOverlay","class","withIllustration","src","role","autoPlay","muted","loop","disableMediaButtons"],"sources":["@wordpress/block-library/src/cover/edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { Placeholder, Spinner } from '@wordpress/components';\nimport { compose, useResizeObserver } from '@wordpress/compose';\nimport {\n\twithColors,\n\tColorPalette,\n\tuseBlockProps,\n\tuseSettings,\n\tuseInnerBlocksProps,\n\t__experimentalUseGradient,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport {\n\tattributesFromMedia,\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from '../shared';\nimport CoverInspectorControls from './inspector-controls';\nimport CoverBlockControls from './block-controls';\nimport CoverPlaceholder from './cover-placeholder';\nimport ResizableCoverPopover from './resizable-cover-popover';\nimport {\n\tgetMediaColor,\n\tcompositeIsDark,\n\tDEFAULT_BACKGROUND_COLOR,\n\tDEFAULT_OVERLAY_COLOR,\n} from './color-utils';\n\nfunction getInnerBlocksTemplate( attributes ) {\n\treturn [\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\talign: 'center',\n\t\t\t\tplaceholder: __( 'Write title…' ),\n\t\t\t\t...attributes,\n\t\t\t},\n\t\t],\n\t];\n}\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while\n * the media (image or video) is being uploaded and will not have an id allocated yet.\n *\n * @param {number} id The id of the media.\n * @param {string} url The url of the media.\n *\n * @return {boolean} Is the URL a Blob URL.\n */\nconst isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );\n\nfunction CoverEdit( {\n\tattributes,\n\tclientId,\n\tisSelected,\n\toverlayColor,\n\tsetAttributes,\n\tsetOverlayColor,\n\ttoggleSelection,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tcontentPosition,\n\t\tid,\n\t\turl: originalUrl,\n\t\tbackgroundType: originalBackgroundType,\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\tallowedBlocks,\n\t\ttemplateLock,\n\t\ttagName: TagName = 'div',\n\t\tisUserOverlayColor,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst media = useSelect(\n\t\t( select ) =>\n\t\t\tfeaturedImage &&\n\t\t\tselect( coreStore ).getMedia( featuredImage, { context: 'view' } ),\n\t\t[ featuredImage ]\n\t);\n\tconst mediaUrl = media?.source_url;\n\n\t// User can change the featured image outside of the block, but we still\n\t// need to update the block when that happens. This effect should only\n\t// run when the featured image changes in that case. All other cases are\n\t// handled in their respective callbacks.\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tif ( ! useFeaturedImage ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst averageBackgroundColor = await getMediaColor( mediaUrl );\n\n\t\t\tlet newOverlayColor = overlayColor.color;\n\t\t\tif ( ! isUserOverlayColor ) {\n\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t}\n\n\t\t\tconst newIsDark = compositeIsDark(\n\t\t\t\tdimRatio,\n\t\t\t\tnewOverlayColor,\n\t\t\t\taverageBackgroundColor\n\t\t\t);\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t\t} );\n\t\t} )();\n\t\t// Disable reason: Update the block only when the featured image changes.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ mediaUrl ] );\n\n\t// instead of destructuring the attributes\n\t// we define the url and background type\n\t// depending on the value of the useFeaturedImage flag\n\t// to preview in edit the dynamic featured image\n\tconst url = useFeaturedImage\n\t\t? mediaUrl\n\t\t: // Ensure the url is not malformed due to sanitization through `wp_kses`.\n\t\t originalUrl?.replaceAll( '&amp;', '&' );\n\tconst backgroundType = useFeaturedImage\n\t\t? IMAGE_BACKGROUND_TYPE\n\t\t: originalBackgroundType;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { gradientClass, gradientValue } = __experimentalUseGradient();\n\n\tconst onSelectMedia = async ( newMedia ) => {\n\t\tconst mediaAttributes = attributesFromMedia( newMedia );\n\t\tconst isImage = [ newMedia?.type, newMedia?.media_type ].includes(\n\t\t\tIMAGE_BACKGROUND_TYPE\n\t\t);\n\n\t\tconst averageBackgroundColor = await getMediaColor(\n\t\t\tisImage ? newMedia?.url : undefined\n\t\t);\n\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\tsetOverlayColor( newOverlayColor );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\t// See issue #52835 for context.\n\t\tconst newDimRatio =\n\t\t\toriginalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\t...mediaAttributes,\n\t\t\tfocalPoint: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t} );\n\t};\n\n\tconst onClearMedia = () => {\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = DEFAULT_OVERLAY_COLOR;\n\t\t\tsetOverlayColor( undefined );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\tDEFAULT_BACKGROUND_COLOR\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t\tbackgroundType: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onSetOverlayColor = async ( newOverlayColor ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetOverlayColor( newOverlayColor );\n\n\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\n\t\tsetAttributes( {\n\t\t\tisUserOverlayColor: true,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUpdateDimRatio = async ( newDimRatio ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\toverlayColor.color,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst isUploadingMedia = isTemporaryMedia( id, url );\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tconst [ resizeListener, { height, width } ] = useResizeObserver();\n\tconst resizableBoxDimensions = useMemo( () => {\n\t\treturn {\n\t\t\theight: minHeightUnit === 'px' ? minHeight : 'auto',\n\t\t\twidth: 'auto',\n\t\t};\n\t}, [ minHeight, minHeightUnit ] );\n\n\tconst minHeightWithUnit =\n\t\tminHeight && minHeightUnit\n\t\t\t? `${ minHeight }${ minHeightUnit }`\n\t\t\t: minHeight;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeightWithUnit || undefined,\n\t};\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst bgStyle = { backgroundColor: overlayColor.color };\n\tconst mediaStyle = {\n\t\tobjectPosition:\n\t\t\tfocalPoint && isImgElement\n\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t: undefined,\n\t};\n\n\tconst hasBackground = !! ( url || overlayColor.color || gradientValue );\n\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlock( clientId ).innerBlocks.length >\n\t\t\t0,\n\t\t[ clientId ]\n\t);\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\t// Check for fontSize support before we pass a fontSize attribute to the innerBlocks.\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\tconst hasFontSizes = fontSizes?.length > 0;\n\tconst innerBlocksTemplate = getInnerBlocksTemplate( {\n\t\tfontSize: hasFontSizes ? 'large' : undefined,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t},\n\t\t{\n\t\t\t// Avoid template sync when the `templateLock` value is `all` or `contentOnly`.\n\t\t\t// See: https://github.com/WordPress/gutenberg/pull/45632\n\t\t\ttemplate: ! hasInnerBlocks ? innerBlocksTemplate : undefined,\n\t\t\ttemplateInsertUpdatesSelection: true,\n\t\t\tallowedBlocks,\n\t\t\ttemplateLock,\n\t\t\tdropZoneElement: ref.current,\n\t\t}\n\t);\n\n\tconst mediaElement = useRef();\n\tconst currentSettings = {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\thasInnerBlocks,\n\t\turl,\n\t\tisImgElement,\n\t\toverlayColor,\n\t};\n\n\tconst toggleUseFeaturedImage = async () => {\n\t\tconst newUseFeaturedImage = ! useFeaturedImage;\n\n\t\tconst averageBackgroundColor = newUseFeaturedImage\n\t\t\t? await getMediaColor( mediaUrl )\n\t\t\t: DEFAULT_BACKGROUND_COLOR;\n\n\t\tconst newOverlayColor = ! isUserOverlayColor\n\t\t\t? averageBackgroundColor\n\t\t\t: overlayColor.color;\n\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t} else {\n\t\t\t\tsetOverlayColor( undefined );\n\t\t\t}\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newDimRatio = dimRatio === 100 ? 50 : dimRatio;\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tid: undefined,\n\t\t\turl: undefined,\n\t\t\tuseFeaturedImage: newUseFeaturedImage,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tbackgroundType: useFeaturedImage\n\t\t\t\t? IMAGE_BACKGROUND_TYPE\n\t\t\t\t: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst blockControls = (\n\t\t<CoverBlockControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst inspectorControls = (\n\t\t<CoverInspectorControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tclientId={ clientId }\n\t\t\tsetOverlayColor={ onSetOverlayColor }\n\t\t\tcoverRef={ ref }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tupdateDimRatio={ onUpdateDimRatio }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst resizableCoverProps = {\n\t\tclassName: 'block-library-cover__resize-container',\n\t\tclientId,\n\t\theight,\n\t\tminHeight: minHeightWithUnit,\n\t\tonResizeStart: () => {\n\t\t\tsetAttributes( { minHeightUnit: 'px' } );\n\t\t\ttoggleSelection( false );\n\t\t},\n\t\tonResize: ( value ) => {\n\t\t\tsetAttributes( { minHeight: value } );\n\t\t},\n\t\tonResizeStop: ( newMinHeight ) => {\n\t\t\ttoggleSelection( true );\n\t\t\tsetAttributes( { minHeight: newMinHeight } );\n\t\t},\n\t\t// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.\n\t\tshowHandle: ! attributes.style?.dimensions?.aspectRatio ? true : false,\n\t\tsize: resizableBoxDimensions,\n\t\twidth,\n\t};\n\n\tif ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ blockControls }\n\t\t\t\t{ inspectorControls }\n\t\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t\t) }\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\tminHeight: minHeightWithUnit || undefined,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t<CoverPlaceholder\n\t\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"wp-block-cover__placeholder-background-options\">\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\tvalue={ overlayColor.color }\n\t\t\t\t\t\t\t\tonChange={ onSetOverlayColor }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CoverPlaceholder>\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-dark-theme': isDark,\n\t\t\t'is-light': ! isDark,\n\t\t\t'is-transient': isUploadingMedia,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst showOverlay =\n\t\turl || ! useFeaturedImage || ( useFeaturedImage && ! url );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( classes, blockProps.className ) }\n\t\t\t\tstyle={ { ...style, ...blockProps.style } }\n\t\t\t\tdata-url={ url }\n\t\t\t>\n\t\t\t\t{ resizeListener }\n\t\t\t\t{ showOverlay && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ overlayColor.class ]: overlayColor.class,\n\t\t\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ { backgroundImage: gradientValue, ...bgStyle } }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ ! url && useFeaturedImage && (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\tclassName=\"wp-block-cover__image--placeholder-image\"\n\t\t\t\t\t\twithIllustration\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ url &&\n\t\t\t\t\tisImageBackground &&\n\t\t\t\t\t( isImgElement ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\tclassName=\"wp-block-cover__image-background\"\n\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t'wp-block-cover__image-background'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ { backgroundImage, backgroundPosition } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ url && isVideoBackground && (\n\t\t\t\t\t<video\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background\"\n\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isUploadingMedia && <Spinner /> }\n\t\t\t\t<CoverPlaceholder\n\t\t\t\t\tdisableMediaButtons\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t/>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</TagName>\n\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithColors( { overlayColor: 'background-color' } ),\n] )( CoverEdit );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACxE,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,oBAAoB;AAC/D,SAASC,WAAW,EAAEC,OAAO,QAAQ,uBAAuB;AAC5D,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,oBAAoB;AAC/D,SACCC,UAAU,EACVC,YAAY,EACZC,aAAa,EACbC,WAAW,EACXC,mBAAmB,EACnBC,yBAAyB,EACzBd,KAAK,IAAIe,gBAAgB,EACzBC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAi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qE,KAAK,EAAGK;MAAY,CACpB,CACD,EACChB,gBAAgB,iBAAIrE,IAAA,CAAChC,OAAO,IAAE,CAAC,eACjCgC,IAAA,CAACP,gBAAgB;QAChB+I,mBAAmB;QACnBjF,aAAa,EAAGA,aAAe;QAC/BoE,OAAO,EAAGxD,aAAe;QACzBuC,sBAAsB,EAAGA;MAAwB,CACjD,CAAC,eACF1G,IAAA;QAAA,GAAUkG;MAAgB,CAAI,CAAC;IAAA,CACvB,CAAC,EACRzB,qBAAqB,IAAI3D,UAAU,iBACpCd,IAAA,CAACN,qBAAqB;MAAA,GAAMsH;IAAmB,CAAI,CACnD;EAAA,CACA,CAAC;AAEL;AAEA,eAAe/I,OAAO,CAAE,CACvBE,UAAU,CAAE;EAAE4C,YAAY,EAAE;AAAmB,CAAE,CAAC,CACjD,CAAC,CAAEH,SAAU,CAAC","ignoreList":[]}
@@ -28,7 +28,8 @@ const metadata = {
28
28
  role: "local"
29
29
  },
30
30
  href: {
31
- type: "string"
31
+ type: "string",
32
+ role: "content"
32
33
  },
33
34
  fileId: {
34
35
  type: "string",
@@ -39,13 +40,15 @@ const metadata = {
39
40
  fileName: {
40
41
  type: "rich-text",
41
42
  source: "rich-text",
42
- selector: "a:not([download])"
43
+ selector: "a:not([download])",
44
+ role: "content"
43
45
  },
44
46
  textLinkHref: {
45
47
  type: "string",
46
48
  source: "attribute",
47
49
  selector: "a:not([download])",
48
- attribute: "href"
50
+ attribute: "href",
51
+ role: "content"
49
52
  },
50
53
  textLinkTarget: {
51
54
  type: "string",
@@ -60,7 +63,8 @@ const metadata = {
60
63
  downloadButtonText: {
61
64
  type: "rich-text",
62
65
  source: "rich-text",
63
- selector: "a[download]"
66
+ selector: "a[download]",
67
+ role: "content"
64
68
  },
65
69
  displayPreview: {
66
70
  type: "boolean"
@@ -1 +1 @@
1
- {"version":3,"names":["_x","file","icon","initBlock","deprecated","edit","metadata","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","id","type","blob","role","href","fileId","source","selector","attribute","fileName","textLinkHref","textLinkTarget","showDownloadButton","downloadButtonText","displayPreview","previewHeight","supports","anchor","align","spacing","margin","padding","color","gradients","link","text","__experimentalDefaultControls","background","__experimentalBorder","radius","width","style","interactivity","editorStyle","save","transforms","settings","example","init"],"sources":["@wordpress/block-library/src/file/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { file as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\thref: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',\n\t\t\tfileName: _x( 'Armstrong_Small_Step', 'Name of the file' ),\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,IAAIC,IAAI,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,EAAA;MAAAC,IAAA;IAAA;IAAAC,IAAA;MAAAD,IAAA;MAAAE,IAAA;IAAA;IAAAC,IAAA;MAAAH,IAAA;IAAA;IAAAI,MAAA;MAAAJ,IAAA;MAAAK,MAAA;MAAAC,QAAA;MAAAC,SAAA;IAAA;IAAAC,QAAA;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QAAQ;EAAE8C;AAAS,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_x","file","icon","initBlock","deprecated","edit","metadata","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","id","type","blob","role","href","fileId","source","selector","attribute","fileName","textLinkHref","textLinkTarget","showDownloadButton","downloadButtonText","displayPreview","previewHeight","supports","anchor","align","spacing","margin","padding","color","gradients","link","text","__experimentalDefaultControls","background","__experimentalBorder","radius","width","style","interactivity","editorStyle","save","transforms","settings","example","init"],"sources":["@wordpress/block-library/src/file/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { file as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\thref: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',\n\t\t\tfileName: _x( 'Armstrong_Small_Step', 'Name of the file' ),\n\t\t},\n\t},\n\ttransforms,\n\tdeprecated,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,IAAIC,IAAI,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,EAAA;MAAAC,IAAA;IAAA;IAAAC,IAAA;MAA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QAAQ,EAAEzB,EAAE,CAAE,sBAAsB,EAAE,kBAAmB;IAC1D;EACD,CAAC;EACDmD,UAAU;EACV/C,UAAU;EACVC,IAAI;EACJ6C;AACD,CAAC;AAED,OAAO,MAAMI,IAAI,GAAGA,CAAA,KAAMnD,SAAS,CAAE;EAAEM,IAAI;EAAEH,QAAQ;EAAE8C;AAAS,CAAE,CAAC","ignoreList":[]}
@@ -7,9 +7,9 @@ import clsx from 'clsx';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { isBlobURL, createBlobURL } from '@wordpress/blob';
10
- import { store as blocksStore, createBlock } from '@wordpress/blocks';
10
+ import { createBlock, getBlockBindingsSource } from '@wordpress/blocks';
11
11
  import { Placeholder } from '@wordpress/components';
12
- import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
12
+ import { useDispatch, useSelect } from '@wordpress/data';
13
13
  import { BlockIcon, useBlockProps, MediaPlaceholder, store as blockEditorStore, __experimentalUseBorderProps as useBorderProps, __experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles, useBlockEditingMode } from '@wordpress/block-editor';
14
14
  import { useEffect, useRef, useState } from '@wordpress/element';
15
15
  import { __, sprintf } from '@wordpress/i18n';
@@ -20,7 +20,6 @@ import { useResizeObserver } from '@wordpress/compose';
20
20
  /**
21
21
  * Internal dependencies
22
22
  */
23
- import { unlock } from '../lock-unlock';
24
23
  import { useUploadMediaFromBlobURL } from '../utils/hooks';
25
24
  import Image from './image';
26
25
  import { isValidFileType } from './utils';
@@ -88,7 +87,6 @@ export function ImageEdit({
88
87
  metadata
89
88
  } = attributes;
90
89
  const [temporaryURL, setTemporaryURL] = useState(attributes.blob);
91
- const registry = useRegistry();
92
90
  const containerRef = useRef();
93
91
  // Only observe the max width from the parent container when the parent layout is not flex nor grid.
94
92
  // This won't work for them because the container width changes with the image.
@@ -314,10 +312,10 @@ export function ImageEdit({
314
312
  if (!isSingleSelected) {
315
313
  return {};
316
314
  }
317
- const blockBindingsSource = unlock(select(blocksStore)).getBlockBindingsSource(metadata?.bindings?.url?.source);
315
+ const blockBindingsSource = getBlockBindingsSource(metadata?.bindings?.url?.source);
318
316
  return {
319
317
  lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({
320
- registry,
318
+ select,
321
319
  context,
322
320
  args: metadata?.bindings?.url?.args
323
321
  }),
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","isBlobURL","createBlobURL","store","blocksStore","createBlock","Placeholder","useDispatch","useSelect","useRegistry","BlockIcon","useBlockProps","MediaPlaceholder","blockEditorStore","__experimentalUseBorderProps","useBorderProps","__experimentalGetShadowClassesAndStyles","getShadowClassesAndStyles","useBlockEditingMode","useEffect","useRef","useState","__","sprintf","image","icon","plugins","pluginsIcon","noticesStore","useResizeObserver","unlock","useUploadMediaFromBlobURL","Image","isValidFileType","useMaxWidthObserver","LINK_DESTINATION_ATTACHMENT","LINK_DESTINATION_CUSTOM","LINK_DESTINATION_MEDIA","LINK_DESTINATION_NONE","ALLOWED_MEDIA_TYPES","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","pickRelevantMediaFiles","size","imageProps","Object","fromEntries","entries","filter","key","includes","url","sizes","media_details","source_url","isExternalImage","id","hasSize","_image$sizes$size","_image$media_details$","ImageEdit","attributes","setAttributes","isSelected","isSingleSelected","className","insertBlocksAfter","onReplace","context","clientId","__unstableParentLayout","parentLayout","alt","caption","width","height","sizeSlug","aspectRatio","scale","align","metadata","temporaryURL","setTemporaryURL","blob","registry","containerRef","isMaxWidthContainerWidth","type","maxWidthObserver","maxContentWidth","placeholderResizeListener","placeholderWidth","isSmallContainer","altRef","current","captionRef","__unstableMarkNextChangeAsNotPersistent","replaceBlock","undefined","getSettings","getBlockRootClientId","getBlockName","canInsertBlockType","blockEditingMode","createErrorNotice","onUploadError","message","src","onSelectImagesList","images","win","ownerDocument","defaultView","every","file","File","files","rootClientId","some","imageBlocks","map","galleryBlock","onSelectImage","media","Array","isArray","title","imageDefaultSize","newSize","mediaAttributes","omittedCaption","restMediaAttributes","additionalAttributes","linkDestination","window","wp","view","settings","defaultProps","link","href","onSelectURL","newURL","allowedTypes","onChange","onError","isExternal","mediaPreview","borderProps","shadowProps","classes","style","keys","length","blockProps","ref","lockUrlControls","lockUrlControlsMessage","select","blockBindingsSource","getBlockBindingsSource","bindings","source","canUserEditValue","args","label","placeholder","content","withIllustration","instructions","objectFit","children","parentLayoutType","onSelect","accept","handleUpload","value","disableMediaButtons"],"sources":["@wordpress/block-library/src/image/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL, createBlobURL } from '@wordpress/blob';\nimport { store as blocksStore, createBlock } from '@wordpress/blocks';\nimport { Placeholder } from '@wordpress/components';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport {\n\tBlockIcon,\n\tuseBlockProps,\n\tMediaPlaceholder,\n\tstore as blockEditorStore,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { image as icon, plugins as pluginsIcon } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { useResizeObserver } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { useUploadMediaFromBlobURL } from '../utils/hooks';\nimport Image from './image';\nimport { isValidFileType } from './utils';\nimport { useMaxWidthObserver } from './use-max-width-observer';\n\n/**\n * Module constants\n */\nimport {\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_CUSTOM,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_NONE,\n\tALLOWED_MEDIA_TYPES,\n} from './constants';\n\nexport const pickRelevantMediaFiles = ( image, size ) => {\n\tconst imageProps = Object.fromEntries(\n\t\tObject.entries( image ?? {} ).filter( ( [ key ] ) =>\n\t\t\t[ 'alt', 'id', 'link', 'caption' ].includes( key )\n\t\t)\n\t);\n\n\timageProps.url =\n\t\timage?.sizes?.[ size ]?.url ||\n\t\timage?.media_details?.sizes?.[ size ]?.source_url ||\n\t\timage.url;\n\treturn imageProps;\n};\n\n/**\n * Is the url for the image hosted externally. An externally hosted image has no\n * id and is not a blob url.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the url an externally hosted url?\n */\nexport const isExternalImage = ( id, url ) => url && ! id && ! isBlobURL( url );\n\n/**\n * Checks if WP generated the specified image size. Size generation is skipped\n * when the image is smaller than the said size.\n *\n * @param {Object} image\n * @param {string} size\n *\n * @return {boolean} Whether or not it has default image size.\n */\nfunction hasSize( image, size ) {\n\treturn (\n\t\t'url' in ( image?.sizes?.[ size ] ?? {} ) ||\n\t\t'source_url' in ( image?.media_details?.sizes?.[ size ] ?? {} )\n\t);\n}\n\nexport function ImageEdit( {\n\tattributes,\n\tsetAttributes,\n\tisSelected: isSingleSelected,\n\tclassName,\n\tinsertBlocksAfter,\n\tonReplace,\n\tcontext,\n\tclientId,\n\t__unstableParentLayout: parentLayout,\n} ) {\n\tconst {\n\t\turl = '',\n\t\talt,\n\t\tcaption,\n\t\tid,\n\t\twidth,\n\t\theight,\n\t\tsizeSlug,\n\t\taspectRatio,\n\t\tscale,\n\t\talign,\n\t\tmetadata,\n\t} = attributes;\n\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\n\tconst registry = useRegistry();\n\tconst containerRef = useRef();\n\t// Only observe the max width from the parent container when the parent layout is not flex nor grid.\n\t// This won't work for them because the container width changes with the image.\n\t// TODO: Find a way to observe the container width for flex and grid layouts.\n\tconst isMaxWidthContainerWidth =\n\t\t! parentLayout ||\n\t\t( parentLayout.type !== 'flex' && parentLayout.type !== 'grid' );\n\tconst [ maxWidthObserver, maxContentWidth ] = useMaxWidthObserver();\n\n\tconst [ placeholderResizeListener, { width: placeholderWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst isSmallContainer = placeholderWidth && placeholderWidth < 160;\n\n\tconst altRef = useRef();\n\tuseEffect( () => {\n\t\taltRef.current = alt;\n\t}, [ alt ] );\n\n\tconst captionRef = useRef();\n\tuseEffect( () => {\n\t\tcaptionRef.current = caption;\n\t}, [ caption ] );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, replaceBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( [ 'wide', 'full' ].includes( align ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined,\n\t\t\t\taspectRatio: undefined,\n\t\t\t\tscale: undefined,\n\t\t\t} );\n\t\t}\n\t}, [ __unstableMarkNextChangeAsNotPersistent, align, setAttributes ] );\n\n\tconst {\n\t\tgetSettings,\n\t\tgetBlockRootClientId,\n\t\tgetBlockName,\n\t\tcanInsertBlockType,\n\t} = useSelect( blockEditorStore );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetAttributes( {\n\t\t\tsrc: undefined,\n\t\t\tid: undefined,\n\t\t\turl: undefined,\n\t\t\tblob: undefined,\n\t\t} );\n\t}\n\n\tfunction onSelectImagesList( images ) {\n\t\tconst win = containerRef.current?.ownerDocument.defaultView;\n\n\t\tif ( images.every( ( file ) => file instanceof win.File ) ) {\n\t\t\t/** @type {File[]} */\n\t\t\tconst files = images;\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\tif ( files.some( ( file ) => ! isValidFileType( file ) ) ) {\n\t\t\t\t// Copied from the same notice in the gallery block.\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t\t),\n\t\t\t\t\t{ id: 'gallery-upload-invalid-file', type: 'snackbar' }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst imageBlocks = files\n\t\t\t\t.filter( ( file ) => isValidFileType( file ) )\n\t\t\t\t.map( ( file ) =>\n\t\t\t\t\tcreateBlock( 'core/image', {\n\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t} )\n\t\t\t\t);\n\n\t\t\tif ( getBlockName( rootClientId ) === 'core/gallery' ) {\n\t\t\t\treplaceBlock( clientId, imageBlocks );\n\t\t\t} else if ( canInsertBlockType( 'core/gallery', rootClientId ) ) {\n\t\t\t\tconst galleryBlock = createBlock(\n\t\t\t\t\t'core/gallery',\n\t\t\t\t\t{},\n\t\t\t\t\timageBlocks\n\t\t\t\t);\n\n\t\t\t\treplaceBlock( clientId, galleryBlock );\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction onSelectImage( media ) {\n\t\tif ( Array.isArray( media ) ) {\n\t\t\tonSelectImagesList( media );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! media || ! media.url ) {\n\t\t\tsetAttributes( {\n\t\t\t\turl: undefined,\n\t\t\t\talt: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\ttitle: undefined,\n\t\t\t\tcaption: undefined,\n\t\t\t\tblob: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetTemporaryURL( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\tconst { imageDefaultSize } = getSettings();\n\n\t\t// Try to use the previous selected image size if its available\n\t\t// otherwise try the default image size or fallback to \"full\"\n\t\tlet newSize = 'full';\n\t\tif ( sizeSlug && hasSize( media, sizeSlug ) ) {\n\t\t\tnewSize = sizeSlug;\n\t\t} else if ( hasSize( media, imageDefaultSize ) ) {\n\t\t\tnewSize = imageDefaultSize;\n\t\t}\n\n\t\tlet mediaAttributes = pickRelevantMediaFiles( media, newSize );\n\n\t\t// If a caption text was meanwhile written by the user,\n\t\t// make sure the text is not overwritten by empty captions.\n\t\tif ( captionRef.current && ! mediaAttributes.caption ) {\n\t\t\tconst { caption: omittedCaption, ...restMediaAttributes } =\n\t\t\t\tmediaAttributes;\n\t\t\tmediaAttributes = restMediaAttributes;\n\t\t}\n\n\t\tlet additionalAttributes;\n\t\t// Reset the dimension attributes if changing to a different image.\n\t\tif ( ! media.id || media.id !== id ) {\n\t\t\tadditionalAttributes = {\n\t\t\t\tsizeSlug: newSize,\n\t\t\t};\n\t\t} else {\n\t\t\t// Keep the same url when selecting the same file, so \"Resolution\"\n\t\t\t// option is not changed.\n\t\t\tadditionalAttributes = { url };\n\t\t}\n\n\t\t// Check if default link setting should be used.\n\t\tlet linkDestination = attributes.linkDestination;\n\t\tif ( ! linkDestination ) {\n\t\t\t// Use the WordPress option to determine the proper default.\n\t\t\t// The constants used in Gutenberg do not match WP options so a little more complicated than ideal.\n\t\t\t// TODO: fix this in a follow up PR, requires updating media-text and ui component.\n\t\t\tswitch (\n\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\tLINK_DESTINATION_NONE\n\t\t\t) {\n\t\t\t\tcase 'file':\n\t\t\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\t\t\tlinkDestination = LINK_DESTINATION_MEDIA;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\t\t\tlinkDestination = LINK_DESTINATION_ATTACHMENT;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LINK_DESTINATION_CUSTOM:\n\t\t\t\t\tlinkDestination = LINK_DESTINATION_CUSTOM;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LINK_DESTINATION_NONE:\n\t\t\t\t\tlinkDestination = LINK_DESTINATION_NONE;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Check if the image is linked to it's media.\n\t\tlet href;\n\t\tswitch ( linkDestination ) {\n\t\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\t\thref = media.url;\n\t\t\t\tbreak;\n\t\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\t\thref = media.link;\n\t\t\t\tbreak;\n\t\t}\n\t\tmediaAttributes.href = href;\n\n\t\tsetAttributes( {\n\t\t\tblob: undefined,\n\t\t\t...mediaAttributes,\n\t\t\t...additionalAttributes,\n\t\t\tlinkDestination,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onSelectURL( newURL ) {\n\t\tif ( newURL !== url ) {\n\t\t\tsetAttributes( {\n\t\t\t\tblob: undefined,\n\t\t\t\turl: newURL,\n\t\t\t\tid: undefined,\n\t\t\t\tsizeSlug: getSettings().imageDefaultSize,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\tonChange: onSelectImage,\n\t\tonError: onUploadError,\n\t} );\n\n\tconst isExternal = isExternalImage( id, url );\n\tconst src = isExternal ? url : undefined;\n\tconst mediaPreview = !! url && (\n\t\t<img\n\t\t\talt={ __( 'Edit image' ) }\n\t\t\ttitle={ __( 'Edit image' ) }\n\t\t\tclassName=\"edit-image-preview\"\n\t\t\tsrc={ url }\n\t\t/>\n\t);\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\n\tconst classes = clsx( className, {\n\t\t'is-transient': !! temporaryURL,\n\t\t'is-resized': !! width || !! height,\n\t\t[ `size-${ sizeSlug }` ]: sizeSlug,\n\t\t'has-custom-border':\n\t\t\t!! borderProps.className ||\n\t\t\t( borderProps.style &&\n\t\t\t\tObject.keys( borderProps.style ).length > 0 ),\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tref: containerRef,\n\t\tclassName: classes,\n\t} );\n\n\t// Much of this description is duplicated from MediaPlaceholder.\n\tconst { lockUrlControls = false, lockUrlControlsMessage } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSingleSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst blockBindingsSource = unlock(\n\t\t\t\tselect( blocksStore )\n\t\t\t).getBlockBindingsSource( metadata?.bindings?.url?.source );\n\n\t\t\treturn {\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! metadata?.bindings?.url &&\n\t\t\t\t\t! blockBindingsSource?.canUserEditValue?.( {\n\t\t\t\t\t\tregistry,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: metadata?.bindings?.url?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockUrlControlsMessage: blockBindingsSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\tblockBindingsSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t};\n\t\t},\n\t\t[ context, isSingleSelected, metadata?.bindings?.url ]\n\t);\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ clsx( 'block-editor-media-placeholder', {\n\t\t\t\t\t[ borderProps.className ]:\n\t\t\t\t\t\t!! borderProps.className && ! isSingleSelected,\n\t\t\t\t} ) }\n\t\t\t\ticon={\n\t\t\t\t\t! isSmallContainer &&\n\t\t\t\t\t( lockUrlControls ? pluginsIcon : icon )\n\t\t\t\t}\n\t\t\t\twithIllustration={ ! isSingleSelected || isSmallContainer }\n\t\t\t\tlabel={ ! isSmallContainer && __( 'Image' ) }\n\t\t\t\tinstructions={\n\t\t\t\t\t! lockUrlControls &&\n\t\t\t\t\t! isSmallContainer &&\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Upload or drag an image file here, or pick one from your library.'\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tstyle={ {\n\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t! ( width && height ) && aspectRatio\n\t\t\t\t\t\t\t? aspectRatio\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\twidth: height && aspectRatio ? '100%' : width,\n\t\t\t\t\theight: width && aspectRatio ? '100%' : height,\n\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t...shadowProps.style,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ lockUrlControls &&\n\t\t\t\t\t! isSmallContainer &&\n\t\t\t\t\tlockUrlControlsMessage }\n\n\t\t\t\t{ ! lockUrlControls && ! isSmallContainer && content }\n\t\t\t\t{ placeholderResizeListener }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t<Image\n\t\t\t\t\ttemporaryURL={ temporaryURL }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSingleSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\tonSelectImage={ onSelectImage }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\tonUploadError={ onUploadError }\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tblockEditingMode={ blockEditingMode }\n\t\t\t\t\tparentLayoutType={ parentLayout?.type }\n\t\t\t\t\tmaxContentWidth={ maxContentWidth }\n\t\t\t\t/>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\thandleUpload={ ( files ) => files.length === 1 }\n\t\t\t\t\tvalue={ { id, src } }\n\t\t\t\t\tmediaPreview={ mediaPreview }\n\t\t\t\t\tdisableMediaButtons={ temporaryURL || url }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t\t{\n\t\t\t\t// The listener cannot be placed as the first element as it will break the in-between inserter.\n\t\t\t\t// See https://github.com/WordPress/gutenberg/blob/71134165868298fc15e22896d0c28b41b3755ff7/packages/block-editor/src/components/block-list/use-in-between-inserter.js#L120\n\t\t\t\tisSingleSelected && isMaxWidthContainerWidth && maxWidthObserver\n\t\t\t}\n\t\t</>\n\t);\n}\n\nexport default ImageEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,aAAa,QAAQ,iBAAiB;AAC1D,SAASC,KAAK,IAAIC,WAAW,EAAEC,WAAW,QAAQ,mBAAmB;AACrE,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,WAAW,EAAEC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACrE,SACCC,SAAS,EACTC,aAAa,EACbC,gBAAgB,EAChBT,KAAK,IAAIU,gBAAgB,EACzBC,4BAA4B,IAAIC,cAAc,EAC9CC,uCAAuC,IAAIC,yBAAyB,EACpEC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,IAAI,EAAEC,OAAO,IAAIC,WAAW,QAAQ,kBAAkB;AACxE,SAASxB,KAAK,IAAIyB,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,iBAAiB,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,yBAAyB,QAAQ,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W,EAAGA,WAAa;QAC3BQ,MAAM,EAAC,SAAS;QAChB/B,YAAY,EAAG5G,mBAAqB;QACpC4I,YAAY,EAAK3D,KAAK,IAAMA,KAAK,CAACqC,MAAM,KAAK,CAAG;QAChDuB,KAAK,EAAG;UAAExH,EAAE;UAAEmD;QAAI,CAAG;QACrBwC,YAAY,EAAGA,YAAc;QAC7B8B,mBAAmB,EAAGhG,YAAY,IAAI9B;MAAK,CAC3C,CAAC;IAAA,CACK,CAAC;IAER;IACA;IACAa,gBAAgB,IAAIsB,wBAAwB,IAAIE,gBAAgB;EAAA,CAEhE,CAAC;AAEL;AAEA,eAAe5B,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["clsx","isBlobURL","createBlobURL","createBlock","getBlockBindingsSource","Placeholder","useDispatch","useSelect","BlockIcon","useBlockProps","MediaPlaceholder","store","blockEditorStore","__experimentalUseBorderProps","useBorderProps","__experimentalGetShadowClassesAndStyles","getShadowClassesAndStyles","useBlockEditingMode","useEffect","useRef","useState","__","sprintf","image","icon","plugins","pluginsIcon","noticesStore","useResizeObserver","useUploadMediaFromBlobURL","Image","isValidFileType","useMaxWidthObserver","LINK_DESTINATION_ATTACHMENT","LINK_DESTINATION_CUSTOM","LINK_DESTINATION_MEDIA","LINK_DESTINATION_NONE","ALLOWED_MEDIA_TYPES","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","pickRelevantMediaFiles","size","imageProps","Object","fromEntries","entries","filter","key","includes","url","sizes","media_details","source_url","isExternalImage","id","hasSize","_image$sizes$size","_image$media_details$","ImageEdit","attributes","setAttributes","isSelected","isSingleSelected","className","insertBlocksAfter","onReplace","context","clientId","__unstableParentLayout","parentLayout","alt","caption","width","height","sizeSlug","aspectRatio","scale","align","metadata","temporaryURL","setTemporaryURL","blob","containerRef","isMaxWidthContainerWidth","type","maxWidthObserver","maxContentWidth","placeholderResizeListener","placeholderWidth","isSmallContainer","altRef","current","captionRef","__unstableMarkNextChangeAsNotPersistent","replaceBlock","undefined","getSettings","getBlockRootClientId","getBlockName","canInsertBlockType","blockEditingMode","createErrorNotice","onUploadError","message","src","onSelectImagesList","images","win","ownerDocument","defaultView","every","file","File","files","rootClientId","some","imageBlocks","map","galleryBlock","onSelectImage","media","Array","isArray","title","imageDefaultSize","newSize","mediaAttributes","omittedCaption","restMediaAttributes","additionalAttributes","linkDestination","window","wp","view","settings","defaultProps","link","href","onSelectURL","newURL","allowedTypes","onChange","onError","isExternal","mediaPreview","borderProps","shadowProps","classes","style","keys","length","blockProps","ref","lockUrlControls","lockUrlControlsMessage","select","blockBindingsSource","bindings","source","canUserEditValue","args","label","placeholder","content","withIllustration","instructions","objectFit","children","parentLayoutType","onSelect","accept","handleUpload","value","disableMediaButtons"],"sources":["@wordpress/block-library/src/image/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL, createBlobURL } from '@wordpress/blob';\nimport { createBlock, getBlockBindingsSource } from '@wordpress/blocks';\nimport { Placeholder } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tBlockIcon,\n\tuseBlockProps,\n\tMediaPlaceholder,\n\tstore as blockEditorStore,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { image as icon, plugins as pluginsIcon } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { useResizeObserver } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { useUploadMediaFromBlobURL } from '../utils/hooks';\nimport Image from './image';\nimport { isValidFileType } from './utils';\nimport { useMaxWidthObserver } from './use-max-width-observer';\n\n/**\n * Module constants\n */\nimport {\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_CUSTOM,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_NONE,\n\tALLOWED_MEDIA_TYPES,\n} from './constants';\n\nexport const pickRelevantMediaFiles = ( image, size ) => {\n\tconst imageProps = Object.fromEntries(\n\t\tObject.entries( image ?? {} ).filter( ( [ key ] ) =>\n\t\t\t[ 'alt', 'id', 'link', 'caption' ].includes( key )\n\t\t)\n\t);\n\n\timageProps.url =\n\t\timage?.sizes?.[ size ]?.url ||\n\t\timage?.media_details?.sizes?.[ size ]?.source_url ||\n\t\timage.url;\n\treturn imageProps;\n};\n\n/**\n * Is the url for the image hosted externally. An externally hosted image has no\n * id and is not a blob url.\n *\n * @param {number=} id The id of the image.\n * @param {string=} url The url of the image.\n *\n * @return {boolean} Is the url an externally hosted url?\n */\nexport const isExternalImage = ( id, url ) => url && ! id && ! isBlobURL( url );\n\n/**\n * Checks if WP generated the specified image size. Size generation is skipped\n * when the image is smaller than the said size.\n *\n * @param {Object} image\n * @param {string} size\n *\n * @return {boolean} Whether or not it has default image size.\n */\nfunction hasSize( image, size ) {\n\treturn (\n\t\t'url' in ( image?.sizes?.[ size ] ?? {} ) ||\n\t\t'source_url' in ( image?.media_details?.sizes?.[ size ] ?? {} )\n\t);\n}\n\nexport function ImageEdit( {\n\tattributes,\n\tsetAttributes,\n\tisSelected: isSingleSelected,\n\tclassName,\n\tinsertBlocksAfter,\n\tonReplace,\n\tcontext,\n\tclientId,\n\t__unstableParentLayout: parentLayout,\n} ) {\n\tconst {\n\t\turl = '',\n\t\talt,\n\t\tcaption,\n\t\tid,\n\t\twidth,\n\t\theight,\n\t\tsizeSlug,\n\t\taspectRatio,\n\t\tscale,\n\t\talign,\n\t\tmetadata,\n\t} = attributes;\n\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\n\tconst containerRef = useRef();\n\t// Only observe the max width from the parent container when the parent layout is not flex nor grid.\n\t// This won't work for them because the container width changes with the image.\n\t// TODO: Find a way to observe the container width for flex and grid layouts.\n\tconst isMaxWidthContainerWidth =\n\t\t! parentLayout ||\n\t\t( parentLayout.type !== 'flex' && parentLayout.type !== 'grid' );\n\tconst [ maxWidthObserver, maxContentWidth ] = useMaxWidthObserver();\n\n\tconst [ placeholderResizeListener, { width: placeholderWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst isSmallContainer = placeholderWidth && placeholderWidth < 160;\n\n\tconst altRef = useRef();\n\tuseEffect( () => {\n\t\taltRef.current = alt;\n\t}, [ alt ] );\n\n\tconst captionRef = useRef();\n\tuseEffect( () => {\n\t\tcaptionRef.current = caption;\n\t}, [ caption ] );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, replaceBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( [ 'wide', 'full' ].includes( align ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\twidth: undefined,\n\t\t\t\theight: undefined,\n\t\t\t\taspectRatio: undefined,\n\t\t\t\tscale: undefined,\n\t\t\t} );\n\t\t}\n\t}, [ __unstableMarkNextChangeAsNotPersistent, align, setAttributes ] );\n\n\tconst {\n\t\tgetSettings,\n\t\tgetBlockRootClientId,\n\t\tgetBlockName,\n\t\tcanInsertBlockType,\n\t} = useSelect( blockEditorStore );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetAttributes( {\n\t\t\tsrc: undefined,\n\t\t\tid: undefined,\n\t\t\turl: undefined,\n\t\t\tblob: undefined,\n\t\t} );\n\t}\n\n\tfunction onSelectImagesList( images ) {\n\t\tconst win = containerRef.current?.ownerDocument.defaultView;\n\n\t\tif ( images.every( ( file ) => file instanceof win.File ) ) {\n\t\t\t/** @type {File[]} */\n\t\t\tconst files = images;\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\tif ( files.some( ( file ) => ! isValidFileType( file ) ) ) {\n\t\t\t\t// Copied from the same notice in the gallery block.\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t\t),\n\t\t\t\t\t{ id: 'gallery-upload-invalid-file', type: 'snackbar' }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst imageBlocks = files\n\t\t\t\t.filter( ( file ) => isValidFileType( file ) )\n\t\t\t\t.map( ( file ) =>\n\t\t\t\t\tcreateBlock( 'core/image', {\n\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t} )\n\t\t\t\t);\n\n\t\t\tif ( getBlockName( rootClientId ) === 'core/gallery' ) {\n\t\t\t\treplaceBlock( clientId, imageBlocks );\n\t\t\t} else if ( canInsertBlockType( 'core/gallery', rootClientId ) ) {\n\t\t\t\tconst galleryBlock = createBlock(\n\t\t\t\t\t'core/gallery',\n\t\t\t\t\t{},\n\t\t\t\t\timageBlocks\n\t\t\t\t);\n\n\t\t\t\treplaceBlock( clientId, galleryBlock );\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction onSelectImage( media ) {\n\t\tif ( Array.isArray( media ) ) {\n\t\t\tonSelectImagesList( media );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! media || ! media.url ) {\n\t\t\tsetAttributes( {\n\t\t\t\turl: undefined,\n\t\t\t\talt: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\ttitle: undefined,\n\t\t\t\tcaption: undefined,\n\t\t\t\tblob: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetTemporaryURL( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\tconst { imageDefaultSize } = getSettings();\n\n\t\t// Try to use the previous selected image size if its available\n\t\t// otherwise try the default image size or fallback to \"full\"\n\t\tlet newSize = 'full';\n\t\tif ( sizeSlug && hasSize( media, sizeSlug ) ) {\n\t\t\tnewSize = sizeSlug;\n\t\t} else if ( hasSize( media, imageDefaultSize ) ) {\n\t\t\tnewSize = imageDefaultSize;\n\t\t}\n\n\t\tlet mediaAttributes = pickRelevantMediaFiles( media, newSize );\n\n\t\t// If a caption text was meanwhile written by the user,\n\t\t// make sure the text is not overwritten by empty captions.\n\t\tif ( captionRef.current && ! mediaAttributes.caption ) {\n\t\t\tconst { caption: omittedCaption, ...restMediaAttributes } =\n\t\t\t\tmediaAttributes;\n\t\t\tmediaAttributes = restMediaAttributes;\n\t\t}\n\n\t\tlet additionalAttributes;\n\t\t// Reset the dimension attributes if changing to a different image.\n\t\tif ( ! media.id || media.id !== id ) {\n\t\t\tadditionalAttributes = {\n\t\t\t\tsizeSlug: newSize,\n\t\t\t};\n\t\t} else {\n\t\t\t// Keep the same url when selecting the same file, so \"Resolution\"\n\t\t\t// option is not changed.\n\t\t\tadditionalAttributes = { url };\n\t\t}\n\n\t\t// Check if default link setting should be used.\n\t\tlet linkDestination = attributes.linkDestination;\n\t\tif ( ! linkDestination ) {\n\t\t\t// Use the WordPress option to determine the proper default.\n\t\t\t// The constants used in Gutenberg do not match WP options so a little more complicated than ideal.\n\t\t\t// TODO: fix this in a follow up PR, requires updating media-text and ui component.\n\t\t\tswitch (\n\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\tLINK_DESTINATION_NONE\n\t\t\t) {\n\t\t\t\tcase 'file':\n\t\t\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\t\t\tlinkDestination = LINK_DESTINATION_MEDIA;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\t\t\tlinkDestination = LINK_DESTINATION_ATTACHMENT;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LINK_DESTINATION_CUSTOM:\n\t\t\t\t\tlinkDestination = LINK_DESTINATION_CUSTOM;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LINK_DESTINATION_NONE:\n\t\t\t\t\tlinkDestination = LINK_DESTINATION_NONE;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Check if the image is linked to it's media.\n\t\tlet href;\n\t\tswitch ( linkDestination ) {\n\t\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\t\thref = media.url;\n\t\t\t\tbreak;\n\t\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\t\thref = media.link;\n\t\t\t\tbreak;\n\t\t}\n\t\tmediaAttributes.href = href;\n\n\t\tsetAttributes( {\n\t\t\tblob: undefined,\n\t\t\t...mediaAttributes,\n\t\t\t...additionalAttributes,\n\t\t\tlinkDestination,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onSelectURL( newURL ) {\n\t\tif ( newURL !== url ) {\n\t\t\tsetAttributes( {\n\t\t\t\tblob: undefined,\n\t\t\t\turl: newURL,\n\t\t\t\tid: undefined,\n\t\t\t\tsizeSlug: getSettings().imageDefaultSize,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\tonChange: onSelectImage,\n\t\tonError: onUploadError,\n\t} );\n\n\tconst isExternal = isExternalImage( id, url );\n\tconst src = isExternal ? url : undefined;\n\tconst mediaPreview = !! url && (\n\t\t<img\n\t\t\talt={ __( 'Edit image' ) }\n\t\t\ttitle={ __( 'Edit image' ) }\n\t\t\tclassName=\"edit-image-preview\"\n\t\t\tsrc={ url }\n\t\t/>\n\t);\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\n\tconst classes = clsx( className, {\n\t\t'is-transient': !! temporaryURL,\n\t\t'is-resized': !! width || !! height,\n\t\t[ `size-${ sizeSlug }` ]: sizeSlug,\n\t\t'has-custom-border':\n\t\t\t!! borderProps.className ||\n\t\t\t( borderProps.style &&\n\t\t\t\tObject.keys( borderProps.style ).length > 0 ),\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tref: containerRef,\n\t\tclassName: classes,\n\t} );\n\n\t// Much of this description is duplicated from MediaPlaceholder.\n\tconst { lockUrlControls = false, lockUrlControlsMessage } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSingleSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst blockBindingsSource = getBlockBindingsSource(\n\t\t\t\tmetadata?.bindings?.url?.source\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! metadata?.bindings?.url &&\n\t\t\t\t\t! blockBindingsSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: metadata?.bindings?.url?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockUrlControlsMessage: blockBindingsSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\tblockBindingsSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t};\n\t\t},\n\t\t[ context, isSingleSelected, metadata?.bindings?.url ]\n\t);\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ clsx( 'block-editor-media-placeholder', {\n\t\t\t\t\t[ borderProps.className ]:\n\t\t\t\t\t\t!! borderProps.className && ! isSingleSelected,\n\t\t\t\t} ) }\n\t\t\t\ticon={\n\t\t\t\t\t! isSmallContainer &&\n\t\t\t\t\t( lockUrlControls ? pluginsIcon : icon )\n\t\t\t\t}\n\t\t\t\twithIllustration={ ! isSingleSelected || isSmallContainer }\n\t\t\t\tlabel={ ! isSmallContainer && __( 'Image' ) }\n\t\t\t\tinstructions={\n\t\t\t\t\t! lockUrlControls &&\n\t\t\t\t\t! isSmallContainer &&\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Upload or drag an image file here, or pick one from your library.'\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tstyle={ {\n\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t! ( width && height ) && aspectRatio\n\t\t\t\t\t\t\t? aspectRatio\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\twidth: height && aspectRatio ? '100%' : width,\n\t\t\t\t\theight: width && aspectRatio ? '100%' : height,\n\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t...shadowProps.style,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ lockUrlControls &&\n\t\t\t\t\t! isSmallContainer &&\n\t\t\t\t\tlockUrlControlsMessage }\n\n\t\t\t\t{ ! lockUrlControls && ! isSmallContainer && content }\n\t\t\t\t{ placeholderResizeListener }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t<Image\n\t\t\t\t\ttemporaryURL={ temporaryURL }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSingleSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\tonSelectImage={ onSelectImage }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\tonUploadError={ onUploadError }\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tblockEditingMode={ blockEditingMode }\n\t\t\t\t\tparentLayoutType={ parentLayout?.type }\n\t\t\t\t\tmaxContentWidth={ maxContentWidth }\n\t\t\t\t/>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\thandleUpload={ ( files ) => files.length === 1 }\n\t\t\t\t\tvalue={ { id, src } }\n\t\t\t\t\tmediaPreview={ mediaPreview }\n\t\t\t\t\tdisableMediaButtons={ temporaryURL || url }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t\t{\n\t\t\t\t// The listener cannot be placed as the first element as it will break the in-between inserter.\n\t\t\t\t// See https://github.com/WordPress/gutenberg/blob/71134165868298fc15e22896d0c28b41b3755ff7/packages/block-editor/src/components/block-list/use-in-between-inserter.js#L120\n\t\t\t\tisSingleSelected && isMaxWidthContainerWidth && maxWidthObserver\n\t\t\t}\n\t\t</>\n\t);\n}\n\nexport default ImageEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,aAAa,QAAQ,iBAAiB;AAC1D,SAASC,WAAW,EAAEC,sBAAsB,QAAQ,mBAAmB;AACvE,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,SAAS,EACTC,aAAa,EACbC,gBAAgB,EAChBC,KAAK,IAAIC,gBAAgB,EACzBC,4BAA4B,IAAIC,cAAc,EAC9CC,uCAAuC,IAAIC,yBAAyB,EACpEC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,IAAI,EAAEC,OAAO,IAAIC,WAAW,QAAQ,kBAAkB;AACxE,SAASf,KAAK,IAAIgB,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,iBAAiB,QAAQ,oBAAoB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G3G,mBAAqB;QACpC0I,YAAY,EAAK1D,KAAK,IAAMA,KAAK,CAACqC,MAAM,KAAK,CAAG;QAChDsB,KAAK,EAAG;UAAEtH,EAAE;UAAEkD;QAAI,CAAG;QACrBwC,YAAY,EAAGA,YAAc;QAC7B6B,mBAAmB,EAAG9F,YAAY,IAAI9B;MAAK,CAC3C,CAAC;IAAA,CACK,CAAC;IAER;IACA;IACAa,gBAAgB,IAAIqB,wBAAwB,IAAIE,gBAAgB;EAAA,CAEhE,CAAC;AAEL;AAEA,eAAe3B,SAAS","ignoreList":[]}
@@ -4,13 +4,13 @@
4
4
  import { isBlobURL } from '@wordpress/blob';
5
5
  import { ExternalLink, ResizableBox, Spinner, TextareaControl, TextControl, ToolbarButton, ToolbarGroup, Dropdown, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalUseCustomUnits as useCustomUnits, Placeholder } from '@wordpress/components';
6
6
  import { useViewportMatch } from '@wordpress/compose';
7
- import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
7
+ import { useSelect, useDispatch } from '@wordpress/data';
8
8
  import { BlockControls, InspectorControls, __experimentalImageURLInputUI as ImageURLInputUI, MediaReplaceFlow, store as blockEditorStore, useSettings, __experimentalImageEditor as ImageEditor, __experimentalUseBorderProps as useBorderProps, __experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
9
9
  import { useEffect, useMemo, useState, useRef } from '@wordpress/element';
10
10
  import { __, _x, sprintf, isRTL } from '@wordpress/i18n';
11
11
  import { DOWN } from '@wordpress/keycodes';
12
12
  import { getFilename } from '@wordpress/url';
13
- import { switchToBlockType, store as blocksStore } from '@wordpress/blocks';
13
+ import { getBlockBindingsSource, switchToBlockType } from '@wordpress/blocks';
14
14
  import { crop, overlayText, upload } from '@wordpress/icons';
15
15
  import { store as noticesStore } from '@wordpress/notices';
16
16
  import { store as coreStore } from '@wordpress/core-data';
@@ -109,7 +109,6 @@ export default function Image({
109
109
  // The only supported unit is px, so we can parseInt to strip the px here.
110
110
  const numericWidth = width ? parseInt(width, 10) : undefined;
111
111
  const numericHeight = height ? parseInt(height, 10) : undefined;
112
- const registry = useRegistry();
113
112
  const imageRef = useRef();
114
113
  const {
115
114
  allowResize = true
@@ -418,9 +417,6 @@ export default function Image({
418
417
  if (!isSingleSelected) {
419
418
  return {};
420
419
  }
421
- const {
422
- getBlockBindingsSource
423
- } = unlock(select(blocksStore));
424
420
  const {
425
421
  url: urlBinding,
426
422
  alt: altBinding,
@@ -432,7 +428,7 @@ export default function Image({
432
428
  const titleBindingSource = getBlockBindingsSource(titleBinding?.source);
433
429
  return {
434
430
  lockUrlControls: !!urlBinding && !urlBindingSource?.canUserEditValue?.({
435
- registry,
431
+ select,
436
432
  context,
437
433
  args: urlBinding?.args
438
434
  }),
@@ -445,14 +441,14 @@ export default function Image({
445
441
  // This is a temporary solution until we support overriding the caption on the frontend.
446
442
  hasParentPattern,
447
443
  lockAltControls: !!altBinding && !altBindingSource?.canUserEditValue?.({
448
- registry,
444
+ select,
449
445
  context,
450
446
  args: altBinding?.args
451
447
  }),
452
448
  lockAltControlsMessage: altBindingSource?.label ? sprintf( /* translators: %s: Label of the bindings source. */
453
449
  __('Connected to %s'), altBindingSource.label) : __('Connected to dynamic data'),
454
450
  lockTitleControls: !!titleBinding && !titleBindingSource?.canUserEditValue?.({
455
- registry,
451
+ select,
456
452
  context,
457
453
  args: titleBinding?.args
458
454
  }),