@wordpress/block-library 9.2.0 → 9.4.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 (623) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/audio/edit.js +20 -8
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/audio/index.js +4 -0
  5. package/build/audio/index.js.map +1 -1
  6. package/build/audio/transforms.js +1 -1
  7. package/build/audio/transforms.js.map +1 -1
  8. package/build/block/edit.js +38 -24
  9. package/build/block/edit.js.map +1 -1
  10. package/build/block/index.js +5 -1
  11. package/build/block/index.js.map +1 -1
  12. package/build/button/edit.js +1 -1
  13. package/build/button/edit.js.map +1 -1
  14. package/build/buttons/index.js +26 -0
  15. package/build/buttons/index.js.map +1 -1
  16. package/build/categories/edit.js +20 -3
  17. package/build/categories/edit.js.map +1 -1
  18. package/build/categories/index.js +8 -0
  19. package/build/categories/index.js.map +1 -1
  20. package/build/columns/index.js +2 -2
  21. package/build/columns/index.js.map +1 -1
  22. package/build/cover/edit/inspector-controls.js +2 -1
  23. package/build/cover/edit/inspector-controls.js.map +1 -1
  24. package/build/embed/embed-preview.js +4 -4
  25. package/build/embed/embed-preview.js.map +1 -1
  26. package/build/embed/variations.js +39 -34
  27. package/build/embed/variations.js.map +1 -1
  28. package/build/file/edit.js +14 -6
  29. package/build/file/edit.js.map +1 -1
  30. package/build/file/index.js +4 -0
  31. package/build/file/index.js.map +1 -1
  32. package/build/file/transforms.js +2 -3
  33. package/build/file/transforms.js.map +1 -1
  34. package/build/footnotes/index.js +1 -1
  35. package/build/footnotes/index.js.map +1 -1
  36. package/build/form-input/edit.js +2 -0
  37. package/build/form-input/edit.js.map +1 -1
  38. package/build/gallery/deprecated.js +6 -54
  39. package/build/gallery/deprecated.js.map +1 -1
  40. package/build/gallery/edit.js +9 -8
  41. package/build/gallery/edit.js.map +1 -1
  42. package/build/gallery/index.js +12 -2
  43. package/build/gallery/index.js.map +1 -1
  44. package/build/gallery/save.js +0 -11
  45. package/build/gallery/save.js.map +1 -1
  46. package/build/gallery/shared.js +0 -27
  47. package/build/gallery/shared.js.map +1 -1
  48. package/build/gallery/transforms.js +29 -80
  49. package/build/gallery/transforms.js.map +1 -1
  50. package/build/group/deprecated.js +2 -5
  51. package/build/group/deprecated.js.map +1 -1
  52. package/build/group/index.js +1 -0
  53. package/build/group/index.js.map +1 -1
  54. package/build/group/placeholder.js +5 -0
  55. package/build/group/placeholder.js.map +1 -1
  56. package/build/heading/index.js +14 -1
  57. package/build/heading/index.js.map +1 -1
  58. package/build/image/edit.js +14 -22
  59. package/build/image/edit.js.map +1 -1
  60. package/build/image/image.js +54 -28
  61. package/build/image/image.js.map +1 -1
  62. package/build/image/index.js +7 -0
  63. package/build/image/index.js.map +1 -1
  64. package/build/image/transforms.js +1 -1
  65. package/build/image/transforms.js.map +1 -1
  66. package/build/image/view.js +65 -49
  67. package/build/image/view.js.map +1 -1
  68. package/build/latest-comments/index.js +9 -0
  69. package/build/latest-comments/index.js.map +1 -1
  70. package/build/list/edit.js +3 -3
  71. package/build/list/edit.js.map +1 -1
  72. package/build/list-item/edit.js +3 -3
  73. package/build/list-item/edit.js.map +1 -1
  74. package/build/list-item/hooks/index.js +0 -7
  75. package/build/list-item/hooks/index.js.map +1 -1
  76. package/build/list-item/hooks/use-merge.js +8 -1
  77. package/build/list-item/hooks/use-merge.js.map +1 -1
  78. package/build/list-item/index.js +11 -1
  79. package/build/list-item/index.js.map +1 -1
  80. package/build/loginout/index.js +3 -0
  81. package/build/loginout/index.js.map +1 -1
  82. package/build/media-text/edit.js +3 -2
  83. package/build/media-text/edit.js.map +1 -1
  84. package/build/media-text/index.js +12 -0
  85. package/build/media-text/index.js.map +1 -1
  86. package/build/navigation/edit/navigation-menu-delete-control.js +1 -0
  87. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  88. package/build/navigation/use-navigation-menu.js +5 -1
  89. package/build/navigation/use-navigation-menu.js.map +1 -1
  90. package/build/navigation-link/link-ui.js +13 -17
  91. package/build/navigation-link/link-ui.js.map +1 -1
  92. package/build/navigation-submenu/edit.js +1 -12
  93. package/build/navigation-submenu/edit.js.map +1 -1
  94. package/build/page-list/convert-to-links-modal.js +1 -1
  95. package/build/page-list/convert-to-links-modal.js.map +1 -1
  96. package/build/page-list/edit.js +2 -1
  97. package/build/page-list/edit.js.map +1 -1
  98. package/build/page-list-item/edit.js +4 -1
  99. package/build/page-list-item/edit.js.map +1 -1
  100. package/build/paragraph/index.js +6 -0
  101. package/build/paragraph/index.js.map +1 -1
  102. package/build/paragraph/transforms.js +6 -0
  103. package/build/paragraph/transforms.js.map +1 -1
  104. package/build/post-author/index.js +8 -0
  105. package/build/post-author/index.js.map +1 -1
  106. package/build/post-author-biography/index.js +3 -0
  107. package/build/post-author-biography/index.js.map +1 -1
  108. package/build/post-author-name/index.js +3 -0
  109. package/build/post-author-name/index.js.map +1 -1
  110. package/build/post-content/index.js +3 -0
  111. package/build/post-content/index.js.map +1 -1
  112. package/build/post-date/edit.js +3 -1
  113. package/build/post-date/edit.js.map +1 -1
  114. package/build/post-date/index.js +3 -0
  115. package/build/post-date/index.js.map +1 -1
  116. package/build/post-excerpt/edit.js +1 -0
  117. package/build/post-excerpt/edit.js.map +1 -1
  118. package/build/post-excerpt/index.js +3 -0
  119. package/build/post-excerpt/index.js.map +1 -1
  120. package/build/post-featured-image/index.js +3 -0
  121. package/build/post-featured-image/index.js.map +1 -1
  122. package/build/post-terms/index.js +3 -0
  123. package/build/post-terms/index.js.map +1 -1
  124. package/build/post-title/edit.js +5 -1
  125. package/build/post-title/edit.js.map +1 -1
  126. package/build/post-title/index.js +3 -0
  127. package/build/post-title/index.js.map +1 -1
  128. package/build/query/edit/inspector-controls/author-control.js +3 -1
  129. package/build/query/edit/inspector-controls/author-control.js.map +1 -1
  130. package/build/query/edit/inspector-controls/index.js +27 -8
  131. package/build/query/edit/inspector-controls/index.js.map +1 -1
  132. package/build/query/edit/inspector-controls/order-control.js +1 -0
  133. package/build/query/edit/inspector-controls/order-control.js.map +1 -1
  134. package/build/query/edit/inspector-controls/parent-control.js +2 -1
  135. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  136. package/build/query/edit/inspector-controls/sticky-control.js +1 -0
  137. package/build/query/edit/inspector-controls/sticky-control.js.map +1 -1
  138. package/build/query/edit/inspector-controls/taxonomy-controls.js +5 -2
  139. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  140. package/build/query/edit/query-content.js +11 -2
  141. package/build/query/edit/query-content.js.map +1 -1
  142. package/build/query/edit/query-placeholder.js +1 -14
  143. package/build/query/edit/query-placeholder.js.map +1 -1
  144. package/build/query/edit/query-toolbar.js +54 -61
  145. package/build/query/edit/query-toolbar.js.map +1 -1
  146. package/build/query/index.js +34 -0
  147. package/build/query/index.js.map +1 -1
  148. package/build/query/utils.js +5 -1
  149. package/build/query/utils.js.map +1 -1
  150. package/build/query/variations.js +9 -55
  151. package/build/query/variations.js.map +1 -1
  152. package/build/query-pagination-numbers/edit.js +1 -0
  153. package/build/query-pagination-numbers/edit.js.map +1 -1
  154. package/build/query-title/edit.js +11 -19
  155. package/build/query-title/edit.js.map +1 -1
  156. package/build/query-title/use-archive-label.js +95 -0
  157. package/build/query-title/use-archive-label.js.map +1 -0
  158. package/build/quote/index.js +15 -1
  159. package/build/quote/index.js.map +1 -1
  160. package/build/search/index.js +3 -0
  161. package/build/search/index.js.map +1 -1
  162. package/build/site-logo/edit.js +4 -1
  163. package/build/site-logo/edit.js.map +1 -1
  164. package/build/site-tagline/edit.js +5 -2
  165. package/build/site-tagline/edit.js.map +1 -1
  166. package/build/site-tagline/index.js +6 -1
  167. package/build/site-tagline/index.js.map +1 -1
  168. package/build/site-title/edit.js +4 -1
  169. package/build/site-title/edit.js.map +1 -1
  170. package/build/site-title/index.js +6 -1
  171. package/build/site-title/index.js.map +1 -1
  172. package/build/social-link/edit.js +27 -7
  173. package/build/social-link/edit.js.map +1 -1
  174. package/build/social-link/icons/soundcloud.js +1 -1
  175. package/build/social-link/icons/soundcloud.js.map +1 -1
  176. package/build/social-links/index.js +12 -0
  177. package/build/social-links/index.js.map +1 -1
  178. package/build/table/edit.js +8 -17
  179. package/build/table/edit.js.map +1 -1
  180. package/build/tag-cloud/edit.js +4 -1
  181. package/build/tag-cloud/edit.js.map +1 -1
  182. package/build/template-part/edit/index.js +5 -3
  183. package/build/template-part/edit/index.js.map +1 -1
  184. package/build/template-part/edit/inner-blocks.js +8 -3
  185. package/build/template-part/edit/inner-blocks.js.map +1 -1
  186. package/build/template-part/edit/placeholder.js +23 -3
  187. package/build/template-part/edit/placeholder.js.map +1 -1
  188. package/build/template-part/edit/title-modal.js +21 -9
  189. package/build/template-part/edit/title-modal.js.map +1 -1
  190. package/build/term-description/index.js +12 -0
  191. package/build/term-description/index.js.map +1 -1
  192. package/build/utils/hooks.js +17 -1
  193. package/build/utils/hooks.js.map +1 -1
  194. package/build/video/deprecated.js +4 -0
  195. package/build/video/deprecated.js.map +1 -1
  196. package/build/video/edit.js +17 -7
  197. package/build/video/edit.js.map +1 -1
  198. package/build/video/index.js +4 -0
  199. package/build/video/index.js.map +1 -1
  200. package/build/video/transforms.js +1 -1
  201. package/build/video/transforms.js.map +1 -1
  202. package/build-module/audio/edit.js +20 -8
  203. package/build-module/audio/edit.js.map +1 -1
  204. package/build-module/audio/index.js +4 -0
  205. package/build-module/audio/index.js.map +1 -1
  206. package/build-module/audio/transforms.js +1 -1
  207. package/build-module/audio/transforms.js.map +1 -1
  208. package/build-module/block/edit.js +38 -24
  209. package/build-module/block/edit.js.map +1 -1
  210. package/build-module/block/index.js +5 -1
  211. package/build-module/block/index.js.map +1 -1
  212. package/build-module/button/edit.js +1 -1
  213. package/build-module/button/edit.js.map +1 -1
  214. package/build-module/buttons/index.js +26 -0
  215. package/build-module/buttons/index.js.map +1 -1
  216. package/build-module/categories/edit.js +21 -4
  217. package/build-module/categories/edit.js.map +1 -1
  218. package/build-module/categories/index.js +8 -0
  219. package/build-module/categories/index.js.map +1 -1
  220. package/build-module/columns/index.js +2 -2
  221. package/build-module/columns/index.js.map +1 -1
  222. package/build-module/cover/edit/inspector-controls.js +2 -1
  223. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  224. package/build-module/embed/embed-preview.js +4 -4
  225. package/build-module/embed/embed-preview.js.map +1 -1
  226. package/build-module/embed/variations.js +40 -35
  227. package/build-module/embed/variations.js.map +1 -1
  228. package/build-module/file/edit.js +15 -7
  229. package/build-module/file/edit.js.map +1 -1
  230. package/build-module/file/index.js +4 -0
  231. package/build-module/file/index.js.map +1 -1
  232. package/build-module/file/transforms.js +2 -3
  233. package/build-module/file/transforms.js.map +1 -1
  234. package/build-module/footnotes/index.js +1 -1
  235. package/build-module/footnotes/index.js.map +1 -1
  236. package/build-module/form-input/edit.js +2 -0
  237. package/build-module/form-input/edit.js.map +1 -1
  238. package/build-module/gallery/deprecated.js +6 -54
  239. package/build-module/gallery/deprecated.js.map +1 -1
  240. package/build-module/gallery/edit.js +10 -9
  241. package/build-module/gallery/edit.js.map +1 -1
  242. package/build-module/gallery/index.js +11 -1
  243. package/build-module/gallery/index.js.map +1 -1
  244. package/build-module/gallery/save.js +0 -11
  245. package/build-module/gallery/save.js.map +1 -1
  246. package/build-module/gallery/shared.js +0 -25
  247. package/build-module/gallery/shared.js.map +1 -1
  248. package/build-module/gallery/transforms.js +29 -80
  249. package/build-module/gallery/transforms.js.map +1 -1
  250. package/build-module/group/deprecated.js +2 -5
  251. package/build-module/group/deprecated.js.map +1 -1
  252. package/build-module/group/index.js +1 -0
  253. package/build-module/group/index.js.map +1 -1
  254. package/build-module/group/placeholder.js +5 -0
  255. package/build-module/group/placeholder.js.map +1 -1
  256. package/build-module/heading/index.js +14 -1
  257. package/build-module/heading/index.js.map +1 -1
  258. package/build-module/image/edit.js +13 -21
  259. package/build-module/image/edit.js.map +1 -1
  260. package/build-module/image/image.js +50 -24
  261. package/build-module/image/image.js.map +1 -1
  262. package/build-module/image/index.js +7 -0
  263. package/build-module/image/index.js.map +1 -1
  264. package/build-module/image/transforms.js +1 -1
  265. package/build-module/image/transforms.js.map +1 -1
  266. package/build-module/image/view.js +65 -49
  267. package/build-module/image/view.js.map +1 -1
  268. package/build-module/latest-comments/index.js +9 -0
  269. package/build-module/latest-comments/index.js.map +1 -1
  270. package/build-module/list/edit.js +3 -3
  271. package/build-module/list/edit.js.map +1 -1
  272. package/build-module/list-item/edit.js +3 -3
  273. package/build-module/list-item/edit.js.map +1 -1
  274. package/build-module/list-item/hooks/index.js +0 -1
  275. package/build-module/list-item/hooks/index.js.map +1 -1
  276. package/build-module/list-item/hooks/use-merge.js +8 -1
  277. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  278. package/build-module/list-item/index.js +11 -1
  279. package/build-module/list-item/index.js.map +1 -1
  280. package/build-module/loginout/index.js +3 -0
  281. package/build-module/loginout/index.js.map +1 -1
  282. package/build-module/media-text/edit.js +3 -2
  283. package/build-module/media-text/edit.js.map +1 -1
  284. package/build-module/media-text/index.js +12 -0
  285. package/build-module/media-text/index.js.map +1 -1
  286. package/build-module/navigation/edit/navigation-menu-delete-control.js +1 -0
  287. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  288. package/build-module/navigation/use-navigation-menu.js +5 -1
  289. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  290. package/build-module/navigation-link/link-ui.js +13 -17
  291. package/build-module/navigation-link/link-ui.js.map +1 -1
  292. package/build-module/navigation-submenu/edit.js +1 -12
  293. package/build-module/navigation-submenu/edit.js.map +1 -1
  294. package/build-module/page-list/convert-to-links-modal.js +1 -1
  295. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  296. package/build-module/page-list/edit.js +2 -1
  297. package/build-module/page-list/edit.js.map +1 -1
  298. package/build-module/page-list-item/edit.js +4 -1
  299. package/build-module/page-list-item/edit.js.map +1 -1
  300. package/build-module/paragraph/index.js +6 -0
  301. package/build-module/paragraph/index.js.map +1 -1
  302. package/build-module/paragraph/transforms.js +6 -0
  303. package/build-module/paragraph/transforms.js.map +1 -1
  304. package/build-module/post-author/index.js +8 -0
  305. package/build-module/post-author/index.js.map +1 -1
  306. package/build-module/post-author-biography/index.js +3 -0
  307. package/build-module/post-author-biography/index.js.map +1 -1
  308. package/build-module/post-author-name/index.js +3 -0
  309. package/build-module/post-author-name/index.js.map +1 -1
  310. package/build-module/post-content/index.js +3 -0
  311. package/build-module/post-content/index.js.map +1 -1
  312. package/build-module/post-date/edit.js +4 -2
  313. package/build-module/post-date/edit.js.map +1 -1
  314. package/build-module/post-date/index.js +3 -0
  315. package/build-module/post-date/index.js.map +1 -1
  316. package/build-module/post-excerpt/edit.js +1 -0
  317. package/build-module/post-excerpt/edit.js.map +1 -1
  318. package/build-module/post-excerpt/index.js +3 -0
  319. package/build-module/post-excerpt/index.js.map +1 -1
  320. package/build-module/post-featured-image/index.js +3 -0
  321. package/build-module/post-featured-image/index.js.map +1 -1
  322. package/build-module/post-terms/index.js +3 -0
  323. package/build-module/post-terms/index.js.map +1 -1
  324. package/build-module/post-title/edit.js +5 -1
  325. package/build-module/post-title/edit.js.map +1 -1
  326. package/build-module/post-title/index.js +3 -0
  327. package/build-module/post-title/index.js.map +1 -1
  328. package/build-module/query/edit/inspector-controls/author-control.js +3 -1
  329. package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
  330. package/build-module/query/edit/inspector-controls/index.js +28 -9
  331. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  332. package/build-module/query/edit/inspector-controls/order-control.js +1 -0
  333. package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
  334. package/build-module/query/edit/inspector-controls/parent-control.js +2 -1
  335. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  336. package/build-module/query/edit/inspector-controls/sticky-control.js +1 -0
  337. package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -1
  338. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +6 -4
  339. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  340. package/build-module/query/edit/query-content.js +11 -2
  341. package/build-module/query/edit/query-content.js.map +1 -1
  342. package/build-module/query/edit/query-placeholder.js +1 -14
  343. package/build-module/query/edit/query-placeholder.js.map +1 -1
  344. package/build-module/query/edit/query-toolbar.js +55 -62
  345. package/build-module/query/edit/query-toolbar.js.map +1 -1
  346. package/build-module/query/index.js +34 -0
  347. package/build-module/query/index.js.map +1 -1
  348. package/build-module/query/utils.js +5 -1
  349. package/build-module/query/utils.js.map +1 -1
  350. package/build-module/query/variations.js +4 -50
  351. package/build-module/query/variations.js.map +1 -1
  352. package/build-module/query-pagination-numbers/edit.js +1 -0
  353. package/build-module/query-pagination-numbers/edit.js.map +1 -1
  354. package/build-module/query-title/edit.js +12 -20
  355. package/build-module/query-title/edit.js.map +1 -1
  356. package/build-module/query-title/use-archive-label.js +88 -0
  357. package/build-module/query-title/use-archive-label.js.map +1 -0
  358. package/build-module/quote/index.js +15 -1
  359. package/build-module/quote/index.js.map +1 -1
  360. package/build-module/search/index.js +3 -0
  361. package/build-module/search/index.js.map +1 -1
  362. package/build-module/site-logo/edit.js +4 -1
  363. package/build-module/site-logo/edit.js.map +1 -1
  364. package/build-module/site-tagline/edit.js +5 -2
  365. package/build-module/site-tagline/edit.js.map +1 -1
  366. package/build-module/site-tagline/index.js +6 -1
  367. package/build-module/site-tagline/index.js.map +1 -1
  368. package/build-module/site-title/edit.js +4 -1
  369. package/build-module/site-title/edit.js.map +1 -1
  370. package/build-module/site-title/index.js +6 -1
  371. package/build-module/site-title/index.js.map +1 -1
  372. package/build-module/social-link/edit.js +28 -8
  373. package/build-module/social-link/edit.js.map +1 -1
  374. package/build-module/social-link/icons/soundcloud.js +1 -1
  375. package/build-module/social-link/icons/soundcloud.js.map +1 -1
  376. package/build-module/social-links/index.js +12 -0
  377. package/build-module/social-links/index.js.map +1 -1
  378. package/build-module/table/edit.js +9 -18
  379. package/build-module/table/edit.js.map +1 -1
  380. package/build-module/tag-cloud/edit.js +4 -1
  381. package/build-module/tag-cloud/edit.js.map +1 -1
  382. package/build-module/template-part/edit/index.js +5 -3
  383. package/build-module/template-part/edit/index.js.map +1 -1
  384. package/build-module/template-part/edit/inner-blocks.js +8 -3
  385. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  386. package/build-module/template-part/edit/placeholder.js +23 -3
  387. package/build-module/template-part/edit/placeholder.js.map +1 -1
  388. package/build-module/template-part/edit/title-modal.js +21 -9
  389. package/build-module/template-part/edit/title-modal.js.map +1 -1
  390. package/build-module/term-description/index.js +12 -0
  391. package/build-module/term-description/index.js.map +1 -1
  392. package/build-module/utils/hooks.js +16 -1
  393. package/build-module/utils/hooks.js.map +1 -1
  394. package/build-module/video/deprecated.js +4 -0
  395. package/build-module/video/deprecated.js.map +1 -1
  396. package/build-module/video/edit.js +18 -8
  397. package/build-module/video/edit.js.map +1 -1
  398. package/build-module/video/index.js +4 -0
  399. package/build-module/video/index.js.map +1 -1
  400. package/build-module/video/transforms.js +1 -1
  401. package/build-module/video/transforms.js.map +1 -1
  402. package/build-style/categories/editor-rtl.css +4 -0
  403. package/build-style/categories/editor.css +4 -0
  404. package/build-style/categories/style-rtl.css +4 -0
  405. package/build-style/categories/style.css +4 -0
  406. package/build-style/editor-rtl.css +16 -12
  407. package/build-style/editor.css +16 -12
  408. package/build-style/image/editor-rtl.css +8 -4
  409. package/build-style/image/editor.css +8 -4
  410. package/build-style/image/style-rtl.css +19 -0
  411. package/build-style/image/style.css +19 -0
  412. package/build-style/list/style-rtl.css +1 -1
  413. package/build-style/list/style.css +1 -1
  414. package/build-style/navigation/style-rtl.css +1 -4
  415. package/build-style/navigation/style.css +1 -4
  416. package/build-style/post-comments-form/style-rtl.css +12 -11
  417. package/build-style/post-comments-form/style.css +12 -11
  418. package/build-style/query/editor-rtl.css +3 -7
  419. package/build-style/query/editor.css +3 -7
  420. package/build-style/search/editor-rtl.css +1 -1
  421. package/build-style/search/editor.css +1 -1
  422. package/build-style/social-links/style-rtl.css +93 -93
  423. package/build-style/social-links/style.css +93 -93
  424. package/build-style/style-rtl.css +131 -109
  425. package/build-style/style.css +131 -109
  426. package/build-style/term-description/style-rtl.css +1 -0
  427. package/build-style/term-description/style.css +1 -0
  428. package/package.json +35 -35
  429. package/src/audio/block.json +4 -0
  430. package/src/audio/edit.js +19 -7
  431. package/src/audio/transforms.js +1 -1
  432. package/src/block/block.json +5 -1
  433. package/src/block/edit.js +58 -28
  434. package/src/block/test/edit.native.js +6 -2
  435. package/src/button/edit.js +1 -1
  436. package/src/button/index.php +14 -1
  437. package/src/buttons/block.json +20 -0
  438. package/src/buttons/index.js +6 -0
  439. package/src/categories/block.json +8 -0
  440. package/src/categories/edit.js +32 -4
  441. package/src/categories/editor.scss +4 -0
  442. package/src/categories/index.php +4 -1
  443. package/src/categories/style.scss +4 -0
  444. package/src/columns/index.js +1 -1
  445. package/src/cover/edit/inspector-controls.js +1 -0
  446. package/src/embed/embed-preview.js +4 -6
  447. package/src/embed/test/__snapshots__/index.native.js.snap +8 -8
  448. package/src/embed/test/index.js +1 -1
  449. package/src/embed/test/index.native.js +24 -23
  450. package/src/embed/variations.js +43 -35
  451. package/src/file/block.json +4 -0
  452. package/src/file/edit.js +19 -6
  453. package/src/file/transforms.js +1 -2
  454. package/src/footnotes/index.js +1 -2
  455. package/src/form-input/edit.js +2 -0
  456. package/src/gallery/block.json +10 -0
  457. package/src/gallery/deprecated.js +6 -55
  458. package/src/gallery/edit.js +13 -10
  459. package/src/gallery/gallery-styles.native.scss +0 -2
  460. package/src/gallery/index.js +1 -1
  461. package/src/gallery/save.js +0 -10
  462. package/src/gallery/shared.js +0 -28
  463. package/src/gallery/transforms.js +56 -99
  464. package/src/group/block.json +1 -0
  465. package/src/group/deprecated.js +3 -7
  466. package/src/group/placeholder.js +7 -0
  467. package/src/heading/block.json +12 -0
  468. package/src/heading/index.js +1 -0
  469. package/src/image/block.json +7 -0
  470. package/src/image/edit.js +11 -20
  471. package/src/image/editor.scss +6 -1
  472. package/src/image/image.js +91 -49
  473. package/src/image/index.php +58 -20
  474. package/src/image/style.scss +22 -0
  475. package/src/image/test/edit.native.js +1 -0
  476. package/src/image/transforms.js +1 -1
  477. package/src/image/view.js +69 -49
  478. package/src/latest-comments/block.json +9 -0
  479. package/src/list/edit.js +3 -3
  480. package/src/list/style.scss +1 -1
  481. package/src/list-item/block.json +11 -1
  482. package/src/list-item/edit.js +3 -3
  483. package/src/list-item/hooks/index.js +0 -1
  484. package/src/list-item/hooks/use-merge.js +19 -5
  485. package/src/loginout/block.json +3 -0
  486. package/src/media-text/block.json +12 -0
  487. package/src/media-text/edit.js +3 -2
  488. package/src/navigation/edit/navigation-menu-delete-control.js +1 -0
  489. package/src/navigation/index.php +1 -1
  490. package/src/navigation/style.scss +4 -9
  491. package/src/navigation/test/use-navigation-menu.js +54 -15
  492. package/src/navigation/use-navigation-menu.js +5 -1
  493. package/src/navigation-link/link-ui.js +8 -14
  494. package/src/navigation-submenu/edit.js +2 -14
  495. package/src/page-list/convert-to-links-modal.js +1 -1
  496. package/src/page-list/edit.js +2 -1
  497. package/src/page-list-item/edit.js +4 -4
  498. package/src/paragraph/block.json +6 -0
  499. package/src/post-author/index.js +8 -0
  500. package/src/post-author-biography/block.json +3 -0
  501. package/src/post-author-name/block.json +3 -0
  502. package/src/post-comments-form/style.scss +16 -13
  503. package/src/post-content/block.json +3 -0
  504. package/src/post-date/block.json +3 -0
  505. package/src/post-date/edit.js +5 -1
  506. package/src/post-date/index.php +8 -2
  507. package/src/post-excerpt/block.json +3 -0
  508. package/src/post-excerpt/edit.js +1 -0
  509. package/src/post-featured-image/block.json +3 -0
  510. package/src/post-terms/block.json +3 -0
  511. package/src/post-title/block.json +3 -0
  512. package/src/post-title/edit.js +5 -5
  513. package/src/query/edit/inspector-controls/author-control.js +2 -0
  514. package/src/query/edit/inspector-controls/index.js +44 -16
  515. package/src/query/edit/inspector-controls/order-control.js +1 -0
  516. package/src/query/edit/inspector-controls/parent-control.js +1 -0
  517. package/src/query/edit/inspector-controls/sticky-control.js +1 -0
  518. package/src/query/edit/inspector-controls/taxonomy-controls.js +8 -3
  519. package/src/query/edit/query-content.js +17 -3
  520. package/src/query/edit/query-placeholder.js +1 -21
  521. package/src/query/edit/query-toolbar.js +60 -72
  522. package/src/query/editor.scss +4 -9
  523. package/src/query/index.js +40 -0
  524. package/src/query/utils.js +4 -0
  525. package/src/query/variations.js +4 -46
  526. package/src/query-pagination-numbers/edit.js +1 -0
  527. package/src/query-title/edit.js +10 -17
  528. package/src/query-title/use-archive-label.js +99 -0
  529. package/src/quote/block.json +15 -1
  530. package/src/search/block.json +3 -0
  531. package/src/search/editor.scss +1 -1
  532. package/src/site-logo/edit.js +4 -1
  533. package/src/site-tagline/block.json +6 -1
  534. package/src/site-tagline/edit.js +5 -2
  535. package/src/site-title/edit.js +4 -1
  536. package/src/site-title/index.js +6 -1
  537. package/src/social-link/edit.js +29 -3
  538. package/src/social-link/icons/soundcloud.js +1 -1
  539. package/src/social-link/socials-with-bg.scss +1 -1
  540. package/src/social-link/socials-without-bg.scss +1 -1
  541. package/src/social-links/block.json +12 -0
  542. package/src/social-links/style.scss +2 -2
  543. package/src/table/edit.js +11 -24
  544. package/src/tag-cloud/edit.js +7 -1
  545. package/src/template-part/edit/index.js +5 -3
  546. package/src/template-part/edit/inner-blocks.js +8 -5
  547. package/src/template-part/edit/placeholder.js +31 -6
  548. package/src/template-part/edit/title-modal.js +19 -5
  549. package/src/term-description/block.json +12 -0
  550. package/src/term-description/style.scss +2 -0
  551. package/src/utils/hooks.js +19 -2
  552. package/src/video/block.json +4 -0
  553. package/src/video/edit.js +23 -8
  554. package/src/video/transforms.js +1 -1
  555. package/tsconfig.tsbuildinfo +1 -1
  556. package/build/gallery/edit-wrapper.js +0 -37
  557. package/build/gallery/edit-wrapper.js.map +0 -1
  558. package/build/gallery/v1/constants.js +0 -10
  559. package/build/gallery/v1/constants.js.map +0 -1
  560. package/build/gallery/v1/edit.js +0 -399
  561. package/build/gallery/v1/edit.js.map +0 -1
  562. package/build/gallery/v1/gallery-button.native.js +0 -55
  563. package/build/gallery/v1/gallery-button.native.js.map +0 -1
  564. package/build/gallery/v1/gallery-image.js +0 -285
  565. package/build/gallery/v1/gallery-image.js.map +0 -1
  566. package/build/gallery/v1/gallery-image.native.js +0 -297
  567. package/build/gallery/v1/gallery-image.native.js.map +0 -1
  568. package/build/gallery/v1/gallery.js +0 -112
  569. package/build/gallery/v1/gallery.js.map +0 -1
  570. package/build/gallery/v1/gallery.native.js +0 -139
  571. package/build/gallery/v1/gallery.native.js.map +0 -1
  572. package/build/gallery/v1/save.js +0 -81
  573. package/build/gallery/v1/save.js.map +0 -1
  574. package/build/gallery/v1/shared.js +0 -17
  575. package/build/gallery/v1/shared.js.map +0 -1
  576. package/build/gallery/v1/tiles.native.js +0 -83
  577. package/build/gallery/v1/tiles.native.js.map +0 -1
  578. package/build/list-item/hooks/use-split.js +0 -39
  579. package/build/list-item/hooks/use-split.js.map +0 -1
  580. package/build/utils/constants.js +0 -15
  581. package/build/utils/constants.js.map +0 -1
  582. package/build-module/gallery/edit-wrapper.js +0 -31
  583. package/build-module/gallery/edit-wrapper.js.map +0 -1
  584. package/build-module/gallery/v1/constants.js +0 -4
  585. package/build-module/gallery/v1/constants.js.map +0 -1
  586. package/build-module/gallery/v1/edit.js +0 -393
  587. package/build-module/gallery/v1/edit.js.map +0 -1
  588. package/build-module/gallery/v1/gallery-button.native.js +0 -46
  589. package/build-module/gallery/v1/gallery-button.native.js.map +0 -1
  590. package/build-module/gallery/v1/gallery-image.js +0 -279
  591. package/build-module/gallery/v1/gallery-image.js.map +0 -1
  592. package/build-module/gallery/v1/gallery-image.native.js +0 -291
  593. package/build-module/gallery/v1/gallery-image.native.js.map +0 -1
  594. package/build-module/gallery/v1/gallery.js +0 -104
  595. package/build-module/gallery/v1/gallery.js.map +0 -1
  596. package/build-module/gallery/v1/gallery.native.js +0 -131
  597. package/build-module/gallery/v1/gallery.native.js.map +0 -1
  598. package/build-module/gallery/v1/save.js +0 -74
  599. package/build-module/gallery/v1/save.js.map +0 -1
  600. package/build-module/gallery/v1/shared.js +0 -10
  601. package/build-module/gallery/v1/shared.js.map +0 -1
  602. package/build-module/gallery/v1/tiles.native.js +0 -75
  603. package/build-module/gallery/v1/tiles.native.js.map +0 -1
  604. package/build-module/list-item/hooks/use-split.js +0 -32
  605. package/build-module/list-item/hooks/use-split.js.map +0 -1
  606. package/build-module/utils/constants.js +0 -9
  607. package/build-module/utils/constants.js.map +0 -1
  608. package/src/gallery/edit-wrapper.js +0 -27
  609. package/src/gallery/v1/constants.js +0 -3
  610. package/src/gallery/v1/edit.js +0 -450
  611. package/src/gallery/v1/gallery-button.native.js +0 -47
  612. package/src/gallery/v1/gallery-image-style.native.scss +0 -109
  613. package/src/gallery/v1/gallery-image.js +0 -293
  614. package/src/gallery/v1/gallery-image.native.js +0 -348
  615. package/src/gallery/v1/gallery-styles.native.scss +0 -8
  616. package/src/gallery/v1/gallery.js +0 -125
  617. package/src/gallery/v1/gallery.native.js +0 -162
  618. package/src/gallery/v1/save.js +0 -98
  619. package/src/gallery/v1/shared.js +0 -19
  620. package/src/gallery/v1/tiles-styles.native.scss +0 -11
  621. package/src/gallery/v1/tiles.native.js +0 -79
  622. package/src/list-item/hooks/use-split.js +0 -33
  623. package/src/utils/constants.js +0 -8
@@ -1 +1 @@
1
- {"version":3,"names":["_blob","require","_blocks","_data","_notices","_i18n","stripFirstImage","attributes","shortcode","body","document","implementation","createHTMLDocument","innerHTML","content","nodeToRemove","querySelector","parentNode","removeChild","trim","getFirstAnchorAttributeFormHTML","html","attributeName","firstElementChild","nodeName","getAttribute","undefined","imageSchema","img","classes","schema","phrasingContentSchema","figure","children","a","figcaption","transforms","from","type","isMatch","node","transform","className","alignMatches","exec","anchor","id","align","idMatches","Number","anchorElement","linkDestination","href","rel","linkClass","getBlockAttributes","outerHTML","createBlock","files","some","file","indexOf","createErrorNotice","dispatch","noticesStore","__","every","blocks","map","url","createBlobURL","tag","source","attribute","selector","alt","caption","named","parseInt","replace","_default","exports","default"],"sources":["@wordpress/block-library/src/image/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlobURL } from '@wordpress/blob';\nimport { createBlock, getBlockAttributes } from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\n\nexport function stripFirstImage( attributes, { shortcode } ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = shortcode.content;\n\n\tlet nodeToRemove = body.querySelector( 'img' );\n\n\t// If an image has parents, find the topmost node to remove.\n\twhile (\n\t\tnodeToRemove &&\n\t\tnodeToRemove.parentNode &&\n\t\tnodeToRemove.parentNode !== body\n\t) {\n\t\tnodeToRemove = nodeToRemove.parentNode;\n\t}\n\n\tif ( nodeToRemove ) {\n\t\tnodeToRemove.parentNode.removeChild( nodeToRemove );\n\t}\n\n\treturn body.innerHTML.trim();\n}\n\nfunction getFirstAnchorAttributeFormHTML( html, attributeName ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = html;\n\n\tconst { firstElementChild } = body;\n\n\tif ( firstElementChild && firstElementChild.nodeName === 'A' ) {\n\t\treturn firstElementChild.getAttribute( attributeName ) || undefined;\n\t}\n}\n\nconst imageSchema = {\n\timg: {\n\t\tattributes: [ 'src', 'alt', 'title' ],\n\t\tclasses: [\n\t\t\t'alignleft',\n\t\t\t'aligncenter',\n\t\t\t'alignright',\n\t\t\t'alignnone',\n\t\t\t/^wp-image-\\d+$/,\n\t\t],\n\t},\n};\n\nconst schema = ( { phrasingContentSchema } ) => ( {\n\tfigure: {\n\t\trequire: [ 'img' ],\n\t\tchildren: {\n\t\t\t...imageSchema,\n\t\t\ta: {\n\t\t\t\tattributes: [ 'href', 'rel', 'target' ],\n\t\t\t\tchildren: imageSchema,\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t},\n\t\t},\n\t},\n} );\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tisMatch: ( node ) =>\n\t\t\t\tnode.nodeName === 'FIGURE' && !! node.querySelector( 'img' ),\n\t\t\tschema,\n\t\t\ttransform: ( node ) => {\n\t\t\t\t// Search both figure and image classes. Alignment could be\n\t\t\t\t// set on either. ID is set on the image.\n\t\t\t\tconst className =\n\t\t\t\t\tnode.className +\n\t\t\t\t\t' ' +\n\t\t\t\t\tnode.querySelector( 'img' ).className;\n\t\t\t\tconst alignMatches =\n\t\t\t\t\t/(?:^|\\s)align(left|center|right)(?:$|\\s)/.exec(\n\t\t\t\t\t\tclassName\n\t\t\t\t\t);\n\t\t\t\tconst anchor = node.id === '' ? undefined : node.id;\n\t\t\t\tconst align = alignMatches ? alignMatches[ 1 ] : undefined;\n\t\t\t\tconst idMatches = /(?:^|\\s)wp-image-(\\d+)(?:$|\\s)/.exec(\n\t\t\t\t\tclassName\n\t\t\t\t);\n\t\t\t\tconst id = idMatches ? Number( idMatches[ 1 ] ) : undefined;\n\t\t\t\tconst anchorElement = node.querySelector( 'a' );\n\t\t\t\tconst linkDestination =\n\t\t\t\t\tanchorElement && anchorElement.href ? 'custom' : undefined;\n\t\t\t\tconst href =\n\t\t\t\t\tanchorElement && anchorElement.href\n\t\t\t\t\t\t? anchorElement.href\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst rel =\n\t\t\t\t\tanchorElement && anchorElement.rel\n\t\t\t\t\t\t? anchorElement.rel\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst linkClass =\n\t\t\t\t\tanchorElement && anchorElement.className\n\t\t\t\t\t\t? anchorElement.className\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst attributes = getBlockAttributes(\n\t\t\t\t\t'core/image',\n\t\t\t\t\tnode.outerHTML,\n\t\t\t\t\t{\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tlinkDestination,\n\t\t\t\t\t\thref,\n\t\t\t\t\t\trel,\n\t\t\t\t\t\tlinkClass,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn createBlock( 'core/image', attributes );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// Note: when dragging and dropping multiple files onto a gallery this overrides the\n\t\t\t// gallery transform in order to add new images to the gallery instead of\n\t\t\t// creating a new gallery.\n\t\t\ttype: 'files',\n\t\t\tisMatch( files ) {\n\t\t\t\t// The following check is intended to catch non-image files when dropped together with images.\n\t\t\t\tif (\n\t\t\t\t\tfiles.some(\n\t\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) === 0\n\t\t\t\t\t) &&\n\t\t\t\t\tfiles.some(\n\t\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) !== 0\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tconst { createErrorNotice } = dispatch( noticesStore );\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'gallery-transform-invalid-file',\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn files.every(\n\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) === 0\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform( files ) {\n\t\t\t\tconst blocks = files.map( ( file ) => {\n\t\t\t\t\treturn createBlock( 'core/image', {\n\t\t\t\t\t\turl: createBlobURL( file ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t\treturn blocks;\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\ttag: 'caption',\n\t\t\tattributes: {\n\t\t\t\turl: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'src',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\talt: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'alt',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\tcaption: {\n\t\t\t\t\tshortcode: stripFirstImage,\n\t\t\t\t},\n\t\t\t\thref: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'href'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trel: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'rel'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tlinkClass: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'class'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tid: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tshortcode: ( { named: { id } } ) => {\n\t\t\t\t\t\tif ( ! id ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn parseInt( id.replace( 'attachment_', '' ), 10 );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\talign: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( { named: { align = 'alignnone' } } ) => {\n\t\t\t\t\t\treturn align.replace( 'align', '' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n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F;MACD,CAAC;MACDgC,EAAE,EAAE;QACHR,IAAI,EAAE,QAAQ;QACd9B,SAAS,EAAEA,CAAE;UAAEqE,KAAK,EAAE;YAAE/B;UAAG;QAAE,CAAC,KAAM;UACnC,IAAK,CAAEA,EAAE,EAAG;YACX;UACD;UAEA,OAAOgC,QAAQ,CAAEhC,EAAE,CAACiC,OAAO,CAAE,aAAa,EAAE,EAAG,CAAC,EAAE,EAAG,CAAC;QACvD;MACD,CAAC;MACDhC,KAAK,EAAE;QACNT,IAAI,EAAE,QAAQ;QACd9B,SAAS,EAAEA,CAAE;UAAEqE,KAAK,EAAE;YAAE9B,KAAK,GAAG;UAAY;QAAE,CAAC,KAAM;UACpD,OAAOA,KAAK,CAACgC,OAAO,CAAE,OAAO,EAAE,EAAG,CAAC;QACpC;MACD;IACD;EACD,CAAC;AAEH,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa9C,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_blob","require","_blocks","_data","_notices","_i18n","stripFirstImage","attributes","shortcode","body","document","implementation","createHTMLDocument","innerHTML","content","nodeToRemove","querySelector","parentNode","removeChild","trim","getFirstAnchorAttributeFormHTML","html","attributeName","firstElementChild","nodeName","getAttribute","undefined","imageSchema","img","classes","schema","phrasingContentSchema","figure","children","a","figcaption","transforms","from","type","isMatch","node","transform","className","alignMatches","exec","anchor","id","align","idMatches","Number","anchorElement","linkDestination","href","rel","linkClass","getBlockAttributes","outerHTML","createBlock","files","some","file","indexOf","createErrorNotice","dispatch","noticesStore","__","every","blocks","map","blob","createBlobURL","tag","url","source","attribute","selector","alt","caption","named","parseInt","replace","_default","exports","default"],"sources":["@wordpress/block-library/src/image/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlobURL } from '@wordpress/blob';\nimport { createBlock, getBlockAttributes } from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\n\nexport function stripFirstImage( attributes, { shortcode } ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = shortcode.content;\n\n\tlet nodeToRemove = body.querySelector( 'img' );\n\n\t// If an image has parents, find the topmost node to remove.\n\twhile (\n\t\tnodeToRemove &&\n\t\tnodeToRemove.parentNode &&\n\t\tnodeToRemove.parentNode !== body\n\t) {\n\t\tnodeToRemove = nodeToRemove.parentNode;\n\t}\n\n\tif ( nodeToRemove ) {\n\t\tnodeToRemove.parentNode.removeChild( nodeToRemove );\n\t}\n\n\treturn body.innerHTML.trim();\n}\n\nfunction getFirstAnchorAttributeFormHTML( html, attributeName ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = html;\n\n\tconst { firstElementChild } = body;\n\n\tif ( firstElementChild && firstElementChild.nodeName === 'A' ) {\n\t\treturn firstElementChild.getAttribute( attributeName ) || undefined;\n\t}\n}\n\nconst imageSchema = {\n\timg: {\n\t\tattributes: [ 'src', 'alt', 'title' ],\n\t\tclasses: [\n\t\t\t'alignleft',\n\t\t\t'aligncenter',\n\t\t\t'alignright',\n\t\t\t'alignnone',\n\t\t\t/^wp-image-\\d+$/,\n\t\t],\n\t},\n};\n\nconst schema = ( { phrasingContentSchema } ) => ( {\n\tfigure: {\n\t\trequire: [ 'img' ],\n\t\tchildren: {\n\t\t\t...imageSchema,\n\t\t\ta: {\n\t\t\t\tattributes: [ 'href', 'rel', 'target' ],\n\t\t\t\tchildren: imageSchema,\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t},\n\t\t},\n\t},\n} );\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tisMatch: ( node ) =>\n\t\t\t\tnode.nodeName === 'FIGURE' && !! node.querySelector( 'img' ),\n\t\t\tschema,\n\t\t\ttransform: ( node ) => {\n\t\t\t\t// Search both figure and image classes. Alignment could be\n\t\t\t\t// set on either. ID is set on the image.\n\t\t\t\tconst className =\n\t\t\t\t\tnode.className +\n\t\t\t\t\t' ' +\n\t\t\t\t\tnode.querySelector( 'img' ).className;\n\t\t\t\tconst alignMatches =\n\t\t\t\t\t/(?:^|\\s)align(left|center|right)(?:$|\\s)/.exec(\n\t\t\t\t\t\tclassName\n\t\t\t\t\t);\n\t\t\t\tconst anchor = node.id === '' ? undefined : node.id;\n\t\t\t\tconst align = alignMatches ? alignMatches[ 1 ] : undefined;\n\t\t\t\tconst idMatches = /(?:^|\\s)wp-image-(\\d+)(?:$|\\s)/.exec(\n\t\t\t\t\tclassName\n\t\t\t\t);\n\t\t\t\tconst id = idMatches ? Number( idMatches[ 1 ] ) : undefined;\n\t\t\t\tconst anchorElement = node.querySelector( 'a' );\n\t\t\t\tconst linkDestination =\n\t\t\t\t\tanchorElement && anchorElement.href ? 'custom' : undefined;\n\t\t\t\tconst href =\n\t\t\t\t\tanchorElement && anchorElement.href\n\t\t\t\t\t\t? anchorElement.href\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst rel =\n\t\t\t\t\tanchorElement && anchorElement.rel\n\t\t\t\t\t\t? anchorElement.rel\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst linkClass =\n\t\t\t\t\tanchorElement && anchorElement.className\n\t\t\t\t\t\t? anchorElement.className\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst attributes = getBlockAttributes(\n\t\t\t\t\t'core/image',\n\t\t\t\t\tnode.outerHTML,\n\t\t\t\t\t{\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tlinkDestination,\n\t\t\t\t\t\thref,\n\t\t\t\t\t\trel,\n\t\t\t\t\t\tlinkClass,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn createBlock( 'core/image', attributes );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// Note: when dragging and dropping multiple files onto a gallery this overrides the\n\t\t\t// gallery transform in order to add new images to the gallery instead of\n\t\t\t// creating a new gallery.\n\t\t\ttype: 'files',\n\t\t\tisMatch( files ) {\n\t\t\t\t// The following check is intended to catch non-image files when dropped together with images.\n\t\t\t\tif (\n\t\t\t\t\tfiles.some(\n\t\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) === 0\n\t\t\t\t\t) &&\n\t\t\t\t\tfiles.some(\n\t\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) !== 0\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tconst { createErrorNotice } = dispatch( noticesStore );\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'gallery-transform-invalid-file',\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn files.every(\n\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) === 0\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform( files ) {\n\t\t\t\tconst blocks = files.map( ( file ) => {\n\t\t\t\t\treturn createBlock( 'core/image', {\n\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t\treturn blocks;\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\ttag: 'caption',\n\t\t\tattributes: {\n\t\t\t\turl: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'src',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\talt: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'alt',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\tcaption: {\n\t\t\t\t\tshortcode: stripFirstImage,\n\t\t\t\t},\n\t\t\t\thref: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'href'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trel: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'rel'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tlinkClass: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'class'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tid: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tshortcode: ( { named: { id } } ) => {\n\t\t\t\t\t\tif ( ! id ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn parseInt( id.replace( 'attachment_', '' ), 10 );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\talign: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( { named: { align = 'alignnone' } } ) => {\n\t\t\t\t\t\treturn align.replace( 'align', '' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOO,SAASK,eAAeA,CA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,EAAE,EAAG,CAAC,EAAE,EAAG,CAAC;QACvD;MACD,CAAC;MACDjC,KAAK,EAAE;QACNT,IAAI,EAAE,QAAQ;QACd9B,SAAS,EAAEA,CAAE;UAAEsE,KAAK,EAAE;YAAE/B,KAAK,GAAG;UAAY;QAAE,CAAC,KAAM;UACpD,OAAOA,KAAK,CAACiC,OAAO,CAAE,OAAO,EAAE,EAAG,CAAC;QACpC;MACD;IACD;EACD,CAAC;AAEH,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa/C,UAAU","ignoreList":[]}
@@ -20,29 +20,18 @@ let isTouching = false;
20
20
  * @type {number}
21
21
  */
22
22
  let lastTouchTime = 0;
23
-
24
- /**
25
- * Stores the image reference of the currently opened lightbox.
26
- *
27
- * @type {HTMLElement}
28
- */
29
- let imageRef;
30
-
31
- /**
32
- * Stores the button reference of the currently opened lightbox.
33
- *
34
- * @type {HTMLElement}
35
- */
36
- let buttonRef;
37
23
  const {
38
24
  state,
39
25
  actions,
40
26
  callbacks
41
27
  } = (0, _interactivity.store)('core/image', {
42
28
  state: {
43
- currentImage: {},
29
+ currentImageId: null,
30
+ get currentImage() {
31
+ return state.metadata[state.currentImageId];
32
+ },
44
33
  get overlayOpened() {
45
- return state.currentImage.currentSrc;
34
+ return state.currentImageId !== null;
46
35
  },
47
36
  get roleAttribute() {
48
37
  return state.overlayOpened ? 'dialog' : null;
@@ -53,36 +42,63 @@ const {
53
42
  get enlargedSrc() {
54
43
  return state.currentImage.uploadedSrc || 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
55
44
  },
45
+ get figureStyles() {
46
+ return state.overlayOpened && `${state.currentImage.figureStyles?.replace(/margin[^;]*;?/g, '')};`;
47
+ },
56
48
  get imgStyles() {
57
49
  return state.overlayOpened && `${state.currentImage.imgStyles?.replace(/;$/, '')}; object-fit:cover;`;
50
+ },
51
+ get imageButtonRight() {
52
+ const {
53
+ imageId
54
+ } = (0, _interactivity.getContext)();
55
+ return state.metadata[imageId].imageButtonRight;
56
+ },
57
+ get imageButtonTop() {
58
+ const {
59
+ imageId
60
+ } = (0, _interactivity.getContext)();
61
+ return state.metadata[imageId].imageButtonTop;
62
+ },
63
+ get isContentHidden() {
64
+ const ctx = (0, _interactivity.getContext)();
65
+ return state.overlayEnabled && state.currentImageId === ctx.imageId;
66
+ },
67
+ get isContentVisible() {
68
+ const ctx = (0, _interactivity.getContext)();
69
+ return !state.overlayEnabled && state.currentImageId === ctx.imageId;
58
70
  }
59
71
  },
60
72
  actions: {
61
73
  showLightbox() {
62
- const ctx = (0, _interactivity.getContext)();
74
+ const {
75
+ imageId
76
+ } = (0, _interactivity.getContext)();
63
77
 
64
78
  // Bails out if the image has not loaded yet.
65
- if (!ctx.imageRef?.complete) {
79
+ if (!state.metadata[imageId].imageRef?.complete) {
66
80
  return;
67
81
  }
68
82
 
69
- // Stores the positons of the scroll to fix it until the overlay is
83
+ // Stores the positions of the scroll to fix it until the overlay is
70
84
  // closed.
71
85
  state.scrollTopReset = document.documentElement.scrollTop;
72
86
  state.scrollLeftReset = document.documentElement.scrollLeft;
73
87
 
74
- // Moves the information of the expaned image to the state.
75
- ctx.currentSrc = ctx.imageRef.currentSrc;
76
- imageRef = ctx.imageRef;
77
- buttonRef = ctx.buttonRef;
78
- state.currentImage = ctx;
88
+ // Sets the current expanded image in the state and enables the overlay.
79
89
  state.overlayEnabled = true;
90
+ state.currentImageId = imageId;
80
91
 
81
92
  // Computes the styles of the overlay for the animation.
82
93
  callbacks.setOverlayStyles();
83
94
  },
84
95
  hideLightbox() {
85
96
  if (state.overlayEnabled) {
97
+ // Starts the overlay closing animation. The showClosingAnimation
98
+ // class is used to avoid showing it on page load.
99
+ state.showClosingAnimation = true;
100
+ state.overlayEnabled = false;
101
+
86
102
  // Waits until the close animation has completed before allowing a
87
103
  // user to scroll again. The duration of this animation is defined in
88
104
  // the `styles.scss` file, but in any case we should wait a few
@@ -92,20 +108,13 @@ const {
92
108
  // Delays before changing the focus. Otherwise the focus ring will
93
109
  // appear on Firefox before the image has finished animating, which
94
110
  // looks broken.
95
- buttonRef.focus({
111
+ state.currentImage.buttonRef.focus({
96
112
  preventScroll: true
97
113
  });
98
114
 
99
- // Resets the current image to mark the overlay as closed.
100
- state.currentImage = {};
101
- imageRef = null;
102
- buttonRef = null;
115
+ // Resets the current image id to mark the overlay as closed.
116
+ state.currentImageId = null;
103
117
  }, 450);
104
-
105
- // Starts the overlay closing animation. The showClosingAnimation
106
- // class is used to avoid showing it on page load.
107
- state.showClosingAnimation = true;
108
- state.overlayEnabled = false;
109
118
  }
110
119
  },
111
120
  handleKeydown(event) {
@@ -167,7 +176,7 @@ const {
167
176
  },
168
177
  callbacks: {
169
178
  setOverlayStyles() {
170
- if (!imageRef) {
179
+ if (!state.currentImage.imageRef) {
171
180
  return;
172
181
  }
173
182
  let {
@@ -175,11 +184,11 @@ const {
175
184
  naturalHeight,
176
185
  offsetWidth: originalWidth,
177
186
  offsetHeight: originalHeight
178
- } = imageRef;
187
+ } = state.currentImage.imageRef;
179
188
  let {
180
189
  x: screenPosX,
181
190
  y: screenPosY
182
- } = imageRef.getBoundingClientRect();
191
+ } = state.currentImage.imageRef.getBoundingClientRect();
183
192
 
184
193
  // Natural ratio of the image clicked to open the lightbox.
185
194
  const naturalRatio = naturalWidth / naturalHeight;
@@ -216,6 +225,7 @@ const {
216
225
  let containerMaxHeight = imgMaxHeight;
217
226
  let containerWidth = imgMaxWidth;
218
227
  let containerHeight = imgMaxHeight;
228
+
219
229
  // Checks if the target image has a different ratio than the original
220
230
  // one (thumbnail). Recalculates the width and height.
221
231
  if (naturalRatio.toFixed(2) !== imgRatio.toFixed(2)) {
@@ -310,11 +320,14 @@ const {
310
320
  `;
311
321
  },
312
322
  setButtonStyles() {
313
- const ctx = (0, _interactivity.getContext)();
323
+ const {
324
+ imageId
325
+ } = (0, _interactivity.getContext)();
314
326
  const {
315
327
  ref
316
328
  } = (0, _interactivity.getElement)();
317
- ctx.imageRef = ref;
329
+ state.metadata[imageId].imageRef = ref;
330
+ state.metadata[imageId].currentSrc = ref.currentSrc;
318
331
  const {
319
332
  naturalWidth,
320
333
  naturalHeight,
@@ -344,11 +357,13 @@ const {
344
357
  }
345
358
  const buttonOffsetTop = figureHeight - offsetHeight;
346
359
  const buttonOffsetRight = figureWidth - offsetWidth;
360
+ let imageButtonTop = buttonOffsetTop + 16;
361
+ let imageButtonRight = buttonOffsetRight + 16;
347
362
 
348
363
  // In the case of an image with object-fit: contain, the size of the
349
364
  // <img> element can be larger than the image itself, so it needs to
350
365
  // calculate where to place the button.
351
- if (ctx.scaleAttr === 'contain') {
366
+ if (state.metadata[imageId].scaleAttr === 'contain') {
352
367
  // Natural ratio of the image.
353
368
  const naturalRatio = naturalWidth / naturalHeight;
354
369
  // Offset ratio of the image.
@@ -357,19 +372,18 @@ const {
357
372
  // If it reaches the width first, it keeps the width and compute the
358
373
  // height.
359
374
  const referenceHeight = offsetWidth / naturalRatio;
360
- ctx.imageButtonTop = (offsetHeight - referenceHeight) / 2 + buttonOffsetTop + 16;
361
- ctx.imageButtonRight = buttonOffsetRight + 16;
375
+ imageButtonTop = (offsetHeight - referenceHeight) / 2 + buttonOffsetTop + 16;
376
+ imageButtonRight = buttonOffsetRight + 16;
362
377
  } else {
363
378
  // If it reaches the height first, it keeps the height and compute
364
379
  // the width.
365
380
  const referenceWidth = offsetHeight * naturalRatio;
366
- ctx.imageButtonTop = buttonOffsetTop + 16;
367
- ctx.imageButtonRight = (offsetWidth - referenceWidth) / 2 + buttonOffsetRight + 16;
381
+ imageButtonTop = buttonOffsetTop + 16;
382
+ imageButtonRight = (offsetWidth - referenceWidth) / 2 + buttonOffsetRight + 16;
368
383
  }
369
- } else {
370
- ctx.imageButtonTop = buttonOffsetTop + 16;
371
- ctx.imageButtonRight = buttonOffsetRight + 16;
372
384
  }
385
+ state.metadata[imageId].imageButtonTop = imageButtonTop;
386
+ state.metadata[imageId].imageButtonRight = imageButtonRight;
373
387
  },
374
388
  setOverlayFocus() {
375
389
  if (state.overlayEnabled) {
@@ -381,11 +395,13 @@ const {
381
395
  }
382
396
  },
383
397
  initTriggerButton() {
384
- const ctx = (0, _interactivity.getContext)();
398
+ const {
399
+ imageId
400
+ } = (0, _interactivity.getContext)();
385
401
  const {
386
402
  ref
387
403
  } = (0, _interactivity.getElement)();
388
- ctx.buttonRef = ref;
404
+ state.metadata[imageId].buttonRef = ref;
389
405
  }
390
406
  }
391
407
  }, {
@@ -1 +1 @@
1
- {"version":3,"names":["_interactivity","require","isTouching","lastTouchTime","imageRef","buttonRef","state","actions","callbacks","store","currentImage","overlayOpened","currentSrc","roleAttribute","ariaModal","enlargedSrc","uploadedSrc","imgStyles","replace","showLightbox","ctx","getContext","complete","scrollTopReset","document","documentElement","scrollTop","scrollLeftReset","scrollLeft","overlayEnabled","setOverlayStyles","hideLightbox","setTimeout","focus","preventScroll","showClosingAnimation","handleKeydown","event","key","preventDefault","ref","getElement","querySelector","handleTouchMove","handleTouchStart","handleTouchEnd","Date","now","handleScroll","window","scrollTo","naturalWidth","naturalHeight","offsetWidth","originalWidth","offsetHeight","originalHeight","x","screenPosX","y","screenPosY","getBoundingClientRect","naturalRatio","originalRatio","scaleAttr","heightWithoutSpace","widthWithoutSpace","imgMaxWidth","parseFloat","targetWidth","imgMaxHeight","targetHeight","imgRatio","containerMaxWidth","containerMaxHeight","containerWidth","containerHeight","toFixed","reducedHeight","reducedWidth","horizontalPadding","innerWidth","verticalPadding","targetMaxWidth","Math","min","targetMaxHeight","innerHeight","targetContainerRatio","containerScale","lightboxImgWidth","lightboxImgHeight","overlayStyles","clientWidth","setButtonStyles","figure","parentElement","figureWidth","figureHeight","clientHeight","caption","captionComputedStyle","getComputedStyle","includes","position","marginTop","marginBottom","buttonOffsetTop","buttonOffsetRight","offsetRatio","referenceHeight","imageButtonTop","imageButtonRight","referenceWidth","setOverlayFocus","initTriggerButton","lock"],"sources":["@wordpress/block-library/src/image/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\n/**\n * Tracks whether user is touching screen; used to differentiate behavior for\n * touch and mouse input.\n *\n * @type {boolean}\n */\nlet isTouching = false;\n\n/**\n * Tracks the last time the screen was touched; used to differentiate behavior\n * for touch and mouse input.\n *\n * @type {number}\n */\nlet lastTouchTime = 0;\n\n/**\n * Stores the image reference of the currently opened lightbox.\n *\n * @type {HTMLElement}\n */\nlet imageRef;\n\n/**\n * Stores the button reference of the currently opened lightbox.\n *\n * @type {HTMLElement}\n */\nlet buttonRef;\n\nconst { state, actions, callbacks } = store(\n\t'core/image',\n\t{\n\t\tstate: {\n\t\t\tcurrentImage: {},\n\t\t\tget overlayOpened() {\n\t\t\t\treturn state.currentImage.currentSrc;\n\t\t\t},\n\t\t\tget roleAttribute() {\n\t\t\t\treturn state.overlayOpened ? 'dialog' : null;\n\t\t\t},\n\t\t\tget ariaModal() {\n\t\t\t\treturn state.overlayOpened ? 'true' : null;\n\t\t\t},\n\t\t\tget enlargedSrc() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.currentImage.uploadedSrc ||\n\t\t\t\t\t'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='\n\t\t\t\t);\n\t\t\t},\n\t\t\tget imgStyles() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayOpened &&\n\t\t\t\t\t`${ state.currentImage.imgStyles?.replace(\n\t\t\t\t\t\t/;$/,\n\t\t\t\t\t\t''\n\t\t\t\t\t) }; object-fit:cover;`\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tshowLightbox() {\n\t\t\t\tconst ctx = getContext();\n\n\t\t\t\t// Bails out if the image has not loaded yet.\n\t\t\t\tif ( ! ctx.imageRef?.complete ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Stores the positons of the scroll to fix it until the overlay is\n\t\t\t\t// closed.\n\t\t\t\tstate.scrollTopReset = document.documentElement.scrollTop;\n\t\t\t\tstate.scrollLeftReset = document.documentElement.scrollLeft;\n\n\t\t\t\t// Moves the information of the expaned image to the state.\n\t\t\t\tctx.currentSrc = ctx.imageRef.currentSrc;\n\t\t\t\timageRef = ctx.imageRef;\n\t\t\t\tbuttonRef = ctx.buttonRef;\n\t\t\t\tstate.currentImage = ctx;\n\t\t\t\tstate.overlayEnabled = true;\n\n\t\t\t\t// Computes the styles of the overlay for the animation.\n\t\t\t\tcallbacks.setOverlayStyles();\n\t\t\t},\n\t\t\thideLightbox() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Waits until the close animation has completed before allowing a\n\t\t\t\t\t// user to scroll again. The duration of this animation is defined in\n\t\t\t\t\t// the `styles.scss` file, but in any case we should wait a few\n\t\t\t\t\t// milliseconds longer than the duration, otherwise a user may scroll\n\t\t\t\t\t// too soon and cause the animation to look sloppy.\n\t\t\t\t\tsetTimeout( function () {\n\t\t\t\t\t\t// Delays before changing the focus. Otherwise the focus ring will\n\t\t\t\t\t\t// appear on Firefox before the image has finished animating, which\n\t\t\t\t\t\t// looks broken.\n\t\t\t\t\t\tbuttonRef.focus( {\n\t\t\t\t\t\t\tpreventScroll: true,\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t// Resets the current image to mark the overlay as closed.\n\t\t\t\t\t\tstate.currentImage = {};\n\t\t\t\t\t\timageRef = null;\n\t\t\t\t\t\tbuttonRef = null;\n\t\t\t\t\t}, 450 );\n\n\t\t\t\t\t// Starts the overlay closing animation. The showClosingAnimation\n\t\t\t\t\t// class is used to avoid showing it on page load.\n\t\t\t\t\tstate.showClosingAnimation = true;\n\t\t\t\t\tstate.overlayEnabled = false;\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleKeydown( event ) {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Focuses the close button when the user presses the tab key.\n\t\t\t\t\tif ( event.key === 'Tab' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t\t}\n\t\t\t\t\t// Closes the lightbox when the user presses the escape key.\n\t\t\t\t\tif ( event.key === 'Escape' ) {\n\t\t\t\t\t\tactions.hideLightbox();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchMove( event ) {\n\t\t\t\t// On mobile devices, prevents triggering the scroll event because\n\t\t\t\t// otherwise the page jumps around when it resets the scroll position.\n\t\t\t\t// This also means that closing the lightbox requires that a user\n\t\t\t\t// perform a simple tap. This may be changed in the future if there is a\n\t\t\t\t// better alternative to override or reset the scroll position during\n\t\t\t\t// swipe actions.\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchStart() {\n\t\t\t\tisTouching = true;\n\t\t\t},\n\t\t\thandleTouchEnd() {\n\t\t\t\t// Waits a few milliseconds before resetting to ensure that pinch to\n\t\t\t\t// zoom works consistently on mobile devices when the lightbox is open.\n\t\t\t\tlastTouchTime = Date.now();\n\t\t\t\tisTouching = false;\n\t\t\t},\n\t\t\thandleScroll() {\n\t\t\t\t// Prevents scrolling behaviors that trigger content shift while the\n\t\t\t\t// lightbox is open. It would be better to accomplish through CSS alone,\n\t\t\t\t// but using overflow: hidden is currently the only way to do so and\n\t\t\t\t// that causes a layout to shift and prevents the zoom animation from\n\t\t\t\t// working in some cases because it's not possible to account for the\n\t\t\t\t// layout shift when doing the animation calculations. Instead, it uses\n\t\t\t\t// JavaScript to prevent and reset the scrolling behavior.\n\t\t\t\tif ( state.overlayOpened ) {\n\t\t\t\t\t// Avoids overriding the scroll behavior on mobile devices because\n\t\t\t\t\t// doing so breaks the pinch to zoom functionality, and users should\n\t\t\t\t\t// be able to zoom in further on the high-res image.\n\t\t\t\t\tif ( ! isTouching && Date.now() - lastTouchTime > 450 ) {\n\t\t\t\t\t\t// It doesn't rely on `event.preventDefault()` to prevent scrolling\n\t\t\t\t\t\t// because the scroll event can't be canceled, so it resets the\n\t\t\t\t\t\t// position instead.\n\t\t\t\t\t\twindow.scrollTo(\n\t\t\t\t\t\t\tstate.scrollLeftReset,\n\t\t\t\t\t\t\tstate.scrollTopReset\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\tsetOverlayStyles() {\n\t\t\t\tif ( ! imageRef ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth: originalWidth,\n\t\t\t\t\toffsetHeight: originalHeight,\n\t\t\t\t} = imageRef;\n\t\t\t\tlet { x: screenPosX, y: screenPosY } =\n\t\t\t\t\timageRef.getBoundingClientRect();\n\n\t\t\t\t// Natural ratio of the image clicked to open the lightbox.\n\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t// Original ratio of the image clicked to open the lightbox.\n\t\t\t\tlet originalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// If it has object-fit: contain, recalculates the original sizes\n\t\t\t\t// and the screen position without the blank spaces.\n\t\t\t\tif ( state.currentImage.scaleAttr === 'contain' ) {\n\t\t\t\t\tif ( naturalRatio > originalRatio ) {\n\t\t\t\t\t\tconst heightWithoutSpace = originalWidth / naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the top space.\n\t\t\t\t\t\tscreenPosY +=\n\t\t\t\t\t\t\t( originalHeight - heightWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalHeight = heightWithoutSpace;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst widthWithoutSpace = originalHeight * naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the left space.\n\t\t\t\t\t\tscreenPosX += ( originalWidth - widthWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalWidth = widthWithoutSpace;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toriginalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// Typically, it uses the image's full-sized dimensions. If those\n\t\t\t\t// dimensions have not been set (i.e. an external image with only one\n\t\t\t\t// size), the image's dimensions in the lightbox are the same\n\t\t\t\t// as those of the image in the content.\n\t\t\t\tlet imgMaxWidth = parseFloat(\n\t\t\t\t\tstate.currentImage.targetWidth !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetWidth\n\t\t\t\t\t\t: naturalWidth\n\t\t\t\t);\n\t\t\t\tlet imgMaxHeight = parseFloat(\n\t\t\t\t\tstate.currentImage.targetHeight !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetHeight\n\t\t\t\t\t\t: naturalHeight\n\t\t\t\t);\n\n\t\t\t\t// Ratio of the biggest image stored in the database.\n\t\t\t\tlet imgRatio = imgMaxWidth / imgMaxHeight;\n\t\t\t\tlet containerMaxWidth = imgMaxWidth;\n\t\t\t\tlet containerMaxHeight = imgMaxHeight;\n\t\t\t\tlet containerWidth = imgMaxWidth;\n\t\t\t\tlet containerHeight = imgMaxHeight;\n\t\t\t\t// Checks if the target image has a different ratio than the original\n\t\t\t\t// one (thumbnail). Recalculates the width and height.\n\t\t\t\tif ( naturalRatio.toFixed( 2 ) !== imgRatio.toFixed( 2 ) ) {\n\t\t\t\t\tif ( naturalRatio > imgRatio ) {\n\t\t\t\t\t\t// If the width is reached before the height, it keeps the maxWidth\n\t\t\t\t\t\t// and recalculates the height unless the difference between the\n\t\t\t\t\t\t// maxHeight and the reducedHeight is higher than the maxWidth,\n\t\t\t\t\t\t// where it keeps the reducedHeight and recalculate the width.\n\t\t\t\t\t\tconst reducedHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\tif ( imgMaxHeight - reducedHeight > imgMaxWidth ) {\n\t\t\t\t\t\t\timgMaxHeight = reducedHeight;\n\t\t\t\t\t\t\timgMaxWidth = reducedHeight * naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If the height is reached before the width, it keeps the maxHeight\n\t\t\t\t\t\t// and recalculate the width unlesss the difference between the\n\t\t\t\t\t\t// maxWidth and the reducedWidth is higher than the maxHeight, where\n\t\t\t\t\t\t// it keeps the reducedWidth and recalculate the height.\n\t\t\t\t\t\tconst reducedWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\tif ( imgMaxWidth - reducedWidth > imgMaxHeight ) {\n\t\t\t\t\t\t\timgMaxWidth = reducedWidth;\n\t\t\t\t\t\t\timgMaxHeight = reducedWidth / naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontainerWidth = imgMaxWidth;\n\t\t\t\t\tcontainerHeight = imgMaxHeight;\n\t\t\t\t\timgRatio = imgMaxWidth / imgMaxHeight;\n\n\t\t\t\t\t// Calculates the max size of the container.\n\t\t\t\t\tif ( originalRatio > imgRatio ) {\n\t\t\t\t\t\tcontainerMaxWidth = imgMaxWidth;\n\t\t\t\t\t\tcontainerMaxHeight = containerMaxWidth / originalRatio;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontainerMaxHeight = imgMaxHeight;\n\t\t\t\t\t\tcontainerMaxWidth = containerMaxHeight * originalRatio;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If the image has been pixelated on purpose, it keeps that size.\n\t\t\t\tif (\n\t\t\t\t\toriginalWidth > containerWidth ||\n\t\t\t\t\toriginalHeight > containerHeight\n\t\t\t\t) {\n\t\t\t\t\tcontainerWidth = originalWidth;\n\t\t\t\t\tcontainerHeight = originalHeight;\n\t\t\t\t}\n\n\t\t\t\t// Calculates the final lightbox image size and the scale factor.\n\t\t\t\t// MaxWidth is either the window container (accounting for padding) or\n\t\t\t\t// the image resolution.\n\t\t\t\tlet horizontalPadding = 0;\n\t\t\t\tif ( window.innerWidth > 480 ) {\n\t\t\t\t\thorizontalPadding = 80;\n\t\t\t\t} else if ( window.innerWidth > 1920 ) {\n\t\t\t\t\thorizontalPadding = 160;\n\t\t\t\t}\n\t\t\t\tconst verticalPadding = 80;\n\n\t\t\t\tconst targetMaxWidth = Math.min(\n\t\t\t\t\twindow.innerWidth - horizontalPadding,\n\t\t\t\t\tcontainerWidth\n\t\t\t\t);\n\t\t\t\tconst targetMaxHeight = Math.min(\n\t\t\t\t\twindow.innerHeight - verticalPadding,\n\t\t\t\t\tcontainerHeight\n\t\t\t\t);\n\t\t\t\tconst targetContainerRatio = targetMaxWidth / targetMaxHeight;\n\n\t\t\t\tif ( originalRatio > targetContainerRatio ) {\n\t\t\t\t\t// If targetMaxWidth is reached before targetMaxHeight.\n\t\t\t\t\tcontainerWidth = targetMaxWidth;\n\t\t\t\t\tcontainerHeight = containerWidth / originalRatio;\n\t\t\t\t} else {\n\t\t\t\t\t// If targetMaxHeight is reached before targetMaxWidth.\n\t\t\t\t\tcontainerHeight = targetMaxHeight;\n\t\t\t\t\tcontainerWidth = containerHeight * originalRatio;\n\t\t\t\t}\n\n\t\t\t\tconst containerScale = originalWidth / containerWidth;\n\t\t\t\tconst lightboxImgWidth =\n\t\t\t\t\timgMaxWidth * ( containerWidth / containerMaxWidth );\n\t\t\t\tconst lightboxImgHeight =\n\t\t\t\t\timgMaxHeight * ( containerHeight / containerMaxHeight );\n\n\t\t\t\t// As of this writing, using the calculations above will render the\n\t\t\t\t// lightbox with a small, erroneous whitespace on the left side of the\n\t\t\t\t// image in iOS Safari, perhaps due to an inconsistency in how browsers\n\t\t\t\t// handle absolute positioning and CSS transformation. In any case,\n\t\t\t\t// adding 1 pixel to the container width and height solves the problem,\n\t\t\t\t// though this can be removed if the issue is fixed in the future.\n\t\t\t\tstate.overlayStyles = `\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${ screenPosY }px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${ screenPosX }px;\n\t\t\t\t\t--wp--lightbox-container-width: ${ containerWidth + 1 }px;\n\t\t\t\t\t--wp--lightbox-container-height: ${ containerHeight + 1 }px;\n\t\t\t\t\t--wp--lightbox-image-width: ${ lightboxImgWidth }px;\n\t\t\t\t\t--wp--lightbox-image-height: ${ lightboxImgHeight }px;\n\t\t\t\t\t--wp--lightbox-scale: ${ containerScale };\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${\n\t\t\t\t\t\twindow.innerWidth - document.documentElement.clientWidth\n\t\t\t\t\t}px;\n\t\t\t\t}\n\t\t\t`;\n\t\t\t},\n\t\t\tsetButtonStyles() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tctx.imageRef = ref;\n\n\t\t\t\tconst {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth,\n\t\t\t\t\toffsetHeight,\n\t\t\t\t} = ref;\n\n\t\t\t\t// If the image isn't loaded yet, it can't calculate where the button\n\t\t\t\t// should be.\n\t\t\t\tif ( naturalWidth === 0 || naturalHeight === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst figure = ref.parentElement;\n\t\t\t\tconst figureWidth = ref.parentElement.clientWidth;\n\n\t\t\t\t// It needs special handling for the height because a caption will cause\n\t\t\t\t// the figure to be taller than the image, which means it needs to\n\t\t\t\t// account for that when calculating the placement of the button in the\n\t\t\t\t// top right corner of the image.\n\t\t\t\tlet figureHeight = ref.parentElement.clientHeight;\n\t\t\t\tconst caption = figure.querySelector( 'figcaption' );\n\t\t\t\tif ( caption ) {\n\t\t\t\t\tconst captionComputedStyle =\n\t\t\t\t\t\twindow.getComputedStyle( caption );\n\t\t\t\t\tif (\n\t\t\t\t\t\t! [ 'absolute', 'fixed' ].includes(\n\t\t\t\t\t\t\tcaptionComputedStyle.position\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tfigureHeight =\n\t\t\t\t\t\t\tfigureHeight -\n\t\t\t\t\t\t\tcaption.offsetHeight -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginTop ) -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginBottom );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst buttonOffsetTop = figureHeight - offsetHeight;\n\t\t\t\tconst buttonOffsetRight = figureWidth - offsetWidth;\n\n\t\t\t\t// In the case of an image with object-fit: contain, the size of the\n\t\t\t\t// <img> element can be larger than the image itself, so it needs to\n\t\t\t\t// calculate where to place the button.\n\t\t\t\tif ( ctx.scaleAttr === 'contain' ) {\n\t\t\t\t\t// Natural ratio of the image.\n\t\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t\t// Offset ratio of the image.\n\t\t\t\t\tconst offsetRatio = offsetWidth / offsetHeight;\n\n\t\t\t\t\tif ( naturalRatio >= offsetRatio ) {\n\t\t\t\t\t\t// If it reaches the width first, it keeps the width and compute the\n\t\t\t\t\t\t// height.\n\t\t\t\t\t\tconst referenceHeight = offsetWidth / naturalRatio;\n\t\t\t\t\t\tctx.imageButtonTop =\n\t\t\t\t\t\t\t( offsetHeight - referenceHeight ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetTop +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t\tctx.imageButtonRight = buttonOffsetRight + 16;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it reaches the height first, it keeps the height and compute\n\t\t\t\t\t\t// the width.\n\t\t\t\t\t\tconst referenceWidth = offsetHeight * naturalRatio;\n\t\t\t\t\t\tctx.imageButtonTop = buttonOffsetTop + 16;\n\t\t\t\t\t\tctx.imageButtonRight =\n\t\t\t\t\t\t\t( offsetWidth - referenceWidth ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetRight +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tctx.imageButtonTop = buttonOffsetTop + 16;\n\t\t\t\t\tctx.imageButtonRight = buttonOffsetRight + 16;\n\t\t\t\t}\n\t\t\t},\n\t\t\tsetOverlayFocus() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Moves the focus to the dialog when it opens.\n\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\tref.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\tinitTriggerButton() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tctx.buttonRef = ref;\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"mappings":";;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,UAAU,GAAG,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,aAAa,GAAG,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA,IAAIC,QAAQ;;AAEZ;AACA;AACA;AACA;AACA;AACA,IAAIC,SAAS;AAEb,MAAM;EAAEC,KAAK;EAAEC,OAAO;EAAEC;AAAU,CAAC,GAAG,IAAAC,oBAAK,EAC1C,YAAY,EACZ;EACCH,KAAK,EAAE;IACNI,YAAY,EAAE,CAAC,CAAC;IAChB,IAAIC,aAAaA,CAAA,EAAG;MACnB,OAAOL,KAAK,CAACI,YAAY,CAACE,UAAU;IACrC,CAAC;IACD,IAAIC,aAAaA,CAAA,EAAG;MACnB,OAAOP,KAAK,CAACK,aAAa,GAAG,QAAQ,GAAG,IAAI;IAC7C,CAAC;IACD,IAAIG,SAASA,CAAA,EAAG;MACf,OAAOR,KAAK,CAACK,aAAa,GAAG,MAAM,GAAG,IAAI;IAC3C,CAAC;IACD,IAAII,WAAWA,CAAA,EAAG;MACjB,OACCT,KAAK,CAACI,YAAY,CAACM,WAAW,IAC9B,4DAA4D;IAE9D,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AKO,YAAY,IAAI+C,WAAW,EAAG;UAClC;UACA;UACA,MAAMC,eAAe,GAAGzD,WAAW,GAAGS,YAAY;UAClD1C,GAAG,CAAC2F,cAAc,GACjB,CAAExD,YAAY,GAAGuD,eAAe,IAAK,CAAC,GACtCH,eAAe,GACf,EAAE;UACHvF,GAAG,CAAC4F,gBAAgB,GAAGJ,iBAAiB,GAAG,EAAE;QAC9C,CAAC,MAAM;UACN;UACA;UACA,MAAMK,cAAc,GAAG1D,YAAY,GAAGO,YAAY;UAClD1C,GAAG,CAAC2F,cAAc,GAAGJ,eAAe,GAAG,EAAE;UACzCvF,GAAG,CAAC4F,gBAAgB,GACnB,CAAE3D,WAAW,GAAG4D,cAAc,IAAK,CAAC,GACpCL,iBAAiB,GACjB,EAAE;QACJ;MACD,CAAC,MAAM;QACNxF,GAAG,CAAC2F,cAAc,GAAGJ,eAAe,GAAG,EAAE;QACzCvF,GAAG,CAAC4F,gBAAgB,GAAGJ,iBAAiB,GAAG,EAAE;MAC9C;IACD,CAAC;IACDM,eAAeA,CAAA,EAAG;MACjB,IAAK5G,KAAK,CAACuB,cAAc,EAAG;QAC3B;QACA,MAAM;UAAEW;QAAI,CAAC,GAAG,IAAAC,yBAAU,EAAC,CAAC;QAC5BD,GAAG,CAACP,KAAK,CAAC,CAAC;MACZ;IACD,CAAC;IACDkF,iBAAiBA,CAAA,EAAG;MACnB,MAAM/F,GAAG,GAAG,IAAAC,yBAAU,EAAC,CAAC;MACxB,MAAM;QAAEmB;MAAI,CAAC,GAAG,IAAAC,yBAAU,EAAC,CAAC;MAC5BrB,GAAG,CAACf,SAAS,GAAGmC,GAAG;IACpB;EACD;AACD,CAAC,EACD;EAAE4E,IAAI,EAAE;AAAK,CACd,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_interactivity","require","isTouching","lastTouchTime","state","actions","callbacks","store","currentImageId","currentImage","metadata","overlayOpened","roleAttribute","ariaModal","enlargedSrc","uploadedSrc","figureStyles","replace","imgStyles","imageButtonRight","imageId","getContext","imageButtonTop","isContentHidden","ctx","overlayEnabled","isContentVisible","showLightbox","imageRef","complete","scrollTopReset","document","documentElement","scrollTop","scrollLeftReset","scrollLeft","setOverlayStyles","hideLightbox","showClosingAnimation","setTimeout","buttonRef","focus","preventScroll","handleKeydown","event","key","preventDefault","ref","getElement","querySelector","handleTouchMove","handleTouchStart","handleTouchEnd","Date","now","handleScroll","window","scrollTo","naturalWidth","naturalHeight","offsetWidth","originalWidth","offsetHeight","originalHeight","x","screenPosX","y","screenPosY","getBoundingClientRect","naturalRatio","originalRatio","scaleAttr","heightWithoutSpace","widthWithoutSpace","imgMaxWidth","parseFloat","targetWidth","imgMaxHeight","targetHeight","imgRatio","containerMaxWidth","containerMaxHeight","containerWidth","containerHeight","toFixed","reducedHeight","reducedWidth","horizontalPadding","innerWidth","verticalPadding","targetMaxWidth","Math","min","targetMaxHeight","innerHeight","targetContainerRatio","containerScale","lightboxImgWidth","lightboxImgHeight","overlayStyles","clientWidth","setButtonStyles","currentSrc","figure","parentElement","figureWidth","figureHeight","clientHeight","caption","captionComputedStyle","getComputedStyle","includes","position","marginTop","marginBottom","buttonOffsetTop","buttonOffsetRight","offsetRatio","referenceHeight","referenceWidth","setOverlayFocus","initTriggerButton","lock"],"sources":["@wordpress/block-library/src/image/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\n/**\n * Tracks whether user is touching screen; used to differentiate behavior for\n * touch and mouse input.\n *\n * @type {boolean}\n */\nlet isTouching = false;\n\n/**\n * Tracks the last time the screen was touched; used to differentiate behavior\n * for touch and mouse input.\n *\n * @type {number}\n */\nlet lastTouchTime = 0;\n\nconst { state, actions, callbacks } = store(\n\t'core/image',\n\t{\n\t\tstate: {\n\t\t\tcurrentImageId: null,\n\t\t\tget currentImage() {\n\t\t\t\treturn state.metadata[ state.currentImageId ];\n\t\t\t},\n\t\t\tget overlayOpened() {\n\t\t\t\treturn state.currentImageId !== null;\n\t\t\t},\n\t\t\tget roleAttribute() {\n\t\t\t\treturn state.overlayOpened ? 'dialog' : null;\n\t\t\t},\n\t\t\tget ariaModal() {\n\t\t\t\treturn state.overlayOpened ? 'true' : null;\n\t\t\t},\n\t\t\tget enlargedSrc() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.currentImage.uploadedSrc ||\n\t\t\t\t\t'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='\n\t\t\t\t);\n\t\t\t},\n\t\t\tget figureStyles() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayOpened &&\n\t\t\t\t\t`${ state.currentImage.figureStyles?.replace(\n\t\t\t\t\t\t/margin[^;]*;?/g,\n\t\t\t\t\t\t''\n\t\t\t\t\t) };`\n\t\t\t\t);\n\t\t\t},\n\t\t\tget imgStyles() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayOpened &&\n\t\t\t\t\t`${ state.currentImage.imgStyles?.replace(\n\t\t\t\t\t\t/;$/,\n\t\t\t\t\t\t''\n\t\t\t\t\t) }; object-fit:cover;`\n\t\t\t\t);\n\t\t\t},\n\t\t\tget imageButtonRight() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\treturn state.metadata[ imageId ].imageButtonRight;\n\t\t\t},\n\t\t\tget imageButtonTop() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\treturn state.metadata[ imageId ].imageButtonTop;\n\t\t\t},\n\t\t\tget isContentHidden() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayEnabled && state.currentImageId === ctx.imageId\n\t\t\t\t);\n\t\t\t},\n\t\t\tget isContentVisible() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn (\n\t\t\t\t\t! state.overlayEnabled &&\n\t\t\t\t\tstate.currentImageId === ctx.imageId\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tshowLightbox() {\n\t\t\t\tconst { imageId } = getContext();\n\n\t\t\t\t// Bails out if the image has not loaded yet.\n\t\t\t\tif ( ! state.metadata[ imageId ].imageRef?.complete ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Stores the positions of the scroll to fix it until the overlay is\n\t\t\t\t// closed.\n\t\t\t\tstate.scrollTopReset = document.documentElement.scrollTop;\n\t\t\t\tstate.scrollLeftReset = document.documentElement.scrollLeft;\n\n\t\t\t\t// Sets the current expanded image in the state and enables the overlay.\n\t\t\t\tstate.overlayEnabled = true;\n\t\t\t\tstate.currentImageId = imageId;\n\n\t\t\t\t// Computes the styles of the overlay for the animation.\n\t\t\t\tcallbacks.setOverlayStyles();\n\t\t\t},\n\t\t\thideLightbox() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Starts the overlay closing animation. The showClosingAnimation\n\t\t\t\t\t// class is used to avoid showing it on page load.\n\t\t\t\t\tstate.showClosingAnimation = true;\n\t\t\t\t\tstate.overlayEnabled = false;\n\n\t\t\t\t\t// Waits until the close animation has completed before allowing a\n\t\t\t\t\t// user to scroll again. The duration of this animation is defined in\n\t\t\t\t\t// the `styles.scss` file, but in any case we should wait a few\n\t\t\t\t\t// milliseconds longer than the duration, otherwise a user may scroll\n\t\t\t\t\t// too soon and cause the animation to look sloppy.\n\t\t\t\t\tsetTimeout( function () {\n\t\t\t\t\t\t// Delays before changing the focus. Otherwise the focus ring will\n\t\t\t\t\t\t// appear on Firefox before the image has finished animating, which\n\t\t\t\t\t\t// looks broken.\n\t\t\t\t\t\tstate.currentImage.buttonRef.focus( {\n\t\t\t\t\t\t\tpreventScroll: true,\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t// Resets the current image id to mark the overlay as closed.\n\t\t\t\t\t\tstate.currentImageId = null;\n\t\t\t\t\t}, 450 );\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleKeydown( event ) {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Focuses the close button when the user presses the tab key.\n\t\t\t\t\tif ( event.key === 'Tab' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t\t}\n\t\t\t\t\t// Closes the lightbox when the user presses the escape key.\n\t\t\t\t\tif ( event.key === 'Escape' ) {\n\t\t\t\t\t\tactions.hideLightbox();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchMove( event ) {\n\t\t\t\t// On mobile devices, prevents triggering the scroll event because\n\t\t\t\t// otherwise the page jumps around when it resets the scroll position.\n\t\t\t\t// This also means that closing the lightbox requires that a user\n\t\t\t\t// perform a simple tap. This may be changed in the future if there is a\n\t\t\t\t// better alternative to override or reset the scroll position during\n\t\t\t\t// swipe actions.\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchStart() {\n\t\t\t\tisTouching = true;\n\t\t\t},\n\t\t\thandleTouchEnd() {\n\t\t\t\t// Waits a few milliseconds before resetting to ensure that pinch to\n\t\t\t\t// zoom works consistently on mobile devices when the lightbox is open.\n\t\t\t\tlastTouchTime = Date.now();\n\t\t\t\tisTouching = false;\n\t\t\t},\n\t\t\thandleScroll() {\n\t\t\t\t// Prevents scrolling behaviors that trigger content shift while the\n\t\t\t\t// lightbox is open. It would be better to accomplish through CSS alone,\n\t\t\t\t// but using overflow: hidden is currently the only way to do so and\n\t\t\t\t// that causes a layout to shift and prevents the zoom animation from\n\t\t\t\t// working in some cases because it's not possible to account for the\n\t\t\t\t// layout shift when doing the animation calculations. Instead, it uses\n\t\t\t\t// JavaScript to prevent and reset the scrolling behavior.\n\t\t\t\tif ( state.overlayOpened ) {\n\t\t\t\t\t// Avoids overriding the scroll behavior on mobile devices because\n\t\t\t\t\t// doing so breaks the pinch to zoom functionality, and users should\n\t\t\t\t\t// be able to zoom in further on the high-res image.\n\t\t\t\t\tif ( ! isTouching && Date.now() - lastTouchTime > 450 ) {\n\t\t\t\t\t\t// It doesn't rely on `event.preventDefault()` to prevent scrolling\n\t\t\t\t\t\t// because the scroll event can't be canceled, so it resets the\n\t\t\t\t\t\t// position instead.\n\t\t\t\t\t\twindow.scrollTo(\n\t\t\t\t\t\t\tstate.scrollLeftReset,\n\t\t\t\t\t\t\tstate.scrollTopReset\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\tsetOverlayStyles() {\n\t\t\t\tif ( ! state.currentImage.imageRef ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth: originalWidth,\n\t\t\t\t\toffsetHeight: originalHeight,\n\t\t\t\t} = state.currentImage.imageRef;\n\t\t\t\tlet { x: screenPosX, y: screenPosY } =\n\t\t\t\t\tstate.currentImage.imageRef.getBoundingClientRect();\n\n\t\t\t\t// Natural ratio of the image clicked to open the lightbox.\n\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t// Original ratio of the image clicked to open the lightbox.\n\t\t\t\tlet originalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// If it has object-fit: contain, recalculates the original sizes\n\t\t\t\t// and the screen position without the blank spaces.\n\t\t\t\tif ( state.currentImage.scaleAttr === 'contain' ) {\n\t\t\t\t\tif ( naturalRatio > originalRatio ) {\n\t\t\t\t\t\tconst heightWithoutSpace = originalWidth / naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the top space.\n\t\t\t\t\t\tscreenPosY +=\n\t\t\t\t\t\t\t( originalHeight - heightWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalHeight = heightWithoutSpace;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst widthWithoutSpace = originalHeight * naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the left space.\n\t\t\t\t\t\tscreenPosX += ( originalWidth - widthWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalWidth = widthWithoutSpace;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toriginalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// Typically, it uses the image's full-sized dimensions. If those\n\t\t\t\t// dimensions have not been set (i.e. an external image with only one\n\t\t\t\t// size), the image's dimensions in the lightbox are the same\n\t\t\t\t// as those of the image in the content.\n\t\t\t\tlet imgMaxWidth = parseFloat(\n\t\t\t\t\tstate.currentImage.targetWidth !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetWidth\n\t\t\t\t\t\t: naturalWidth\n\t\t\t\t);\n\t\t\t\tlet imgMaxHeight = parseFloat(\n\t\t\t\t\tstate.currentImage.targetHeight !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetHeight\n\t\t\t\t\t\t: naturalHeight\n\t\t\t\t);\n\n\t\t\t\t// Ratio of the biggest image stored in the database.\n\t\t\t\tlet imgRatio = imgMaxWidth / imgMaxHeight;\n\t\t\t\tlet containerMaxWidth = imgMaxWidth;\n\t\t\t\tlet containerMaxHeight = imgMaxHeight;\n\t\t\t\tlet containerWidth = imgMaxWidth;\n\t\t\t\tlet containerHeight = imgMaxHeight;\n\n\t\t\t\t// Checks if the target image has a different ratio than the original\n\t\t\t\t// one (thumbnail). Recalculates the width and height.\n\t\t\t\tif ( naturalRatio.toFixed( 2 ) !== imgRatio.toFixed( 2 ) ) {\n\t\t\t\t\tif ( naturalRatio > imgRatio ) {\n\t\t\t\t\t\t// If the width is reached before the height, it keeps the maxWidth\n\t\t\t\t\t\t// and recalculates the height unless the difference between the\n\t\t\t\t\t\t// maxHeight and the reducedHeight is higher than the maxWidth,\n\t\t\t\t\t\t// where it keeps the reducedHeight and recalculate the width.\n\t\t\t\t\t\tconst reducedHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\tif ( imgMaxHeight - reducedHeight > imgMaxWidth ) {\n\t\t\t\t\t\t\timgMaxHeight = reducedHeight;\n\t\t\t\t\t\t\timgMaxWidth = reducedHeight * naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If the height is reached before the width, it keeps the maxHeight\n\t\t\t\t\t\t// and recalculate the width unlesss the difference between the\n\t\t\t\t\t\t// maxWidth and the reducedWidth is higher than the maxHeight, where\n\t\t\t\t\t\t// it keeps the reducedWidth and recalculate the height.\n\t\t\t\t\t\tconst reducedWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\tif ( imgMaxWidth - reducedWidth > imgMaxHeight ) {\n\t\t\t\t\t\t\timgMaxWidth = reducedWidth;\n\t\t\t\t\t\t\timgMaxHeight = reducedWidth / naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontainerWidth = imgMaxWidth;\n\t\t\t\t\tcontainerHeight = imgMaxHeight;\n\t\t\t\t\timgRatio = imgMaxWidth / imgMaxHeight;\n\n\t\t\t\t\t// Calculates the max size of the container.\n\t\t\t\t\tif ( originalRatio > imgRatio ) {\n\t\t\t\t\t\tcontainerMaxWidth = imgMaxWidth;\n\t\t\t\t\t\tcontainerMaxHeight = containerMaxWidth / originalRatio;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontainerMaxHeight = imgMaxHeight;\n\t\t\t\t\t\tcontainerMaxWidth = containerMaxHeight * originalRatio;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If the image has been pixelated on purpose, it keeps that size.\n\t\t\t\tif (\n\t\t\t\t\toriginalWidth > containerWidth ||\n\t\t\t\t\toriginalHeight > containerHeight\n\t\t\t\t) {\n\t\t\t\t\tcontainerWidth = originalWidth;\n\t\t\t\t\tcontainerHeight = originalHeight;\n\t\t\t\t}\n\n\t\t\t\t// Calculates the final lightbox image size and the scale factor.\n\t\t\t\t// MaxWidth is either the window container (accounting for padding) or\n\t\t\t\t// the image resolution.\n\t\t\t\tlet horizontalPadding = 0;\n\t\t\t\tif ( window.innerWidth > 480 ) {\n\t\t\t\t\thorizontalPadding = 80;\n\t\t\t\t} else if ( window.innerWidth > 1920 ) {\n\t\t\t\t\thorizontalPadding = 160;\n\t\t\t\t}\n\t\t\t\tconst verticalPadding = 80;\n\n\t\t\t\tconst targetMaxWidth = Math.min(\n\t\t\t\t\twindow.innerWidth - horizontalPadding,\n\t\t\t\t\tcontainerWidth\n\t\t\t\t);\n\t\t\t\tconst targetMaxHeight = Math.min(\n\t\t\t\t\twindow.innerHeight - verticalPadding,\n\t\t\t\t\tcontainerHeight\n\t\t\t\t);\n\t\t\t\tconst targetContainerRatio = targetMaxWidth / targetMaxHeight;\n\n\t\t\t\tif ( originalRatio > targetContainerRatio ) {\n\t\t\t\t\t// If targetMaxWidth is reached before targetMaxHeight.\n\t\t\t\t\tcontainerWidth = targetMaxWidth;\n\t\t\t\t\tcontainerHeight = containerWidth / originalRatio;\n\t\t\t\t} else {\n\t\t\t\t\t// If targetMaxHeight is reached before targetMaxWidth.\n\t\t\t\t\tcontainerHeight = targetMaxHeight;\n\t\t\t\t\tcontainerWidth = containerHeight * originalRatio;\n\t\t\t\t}\n\n\t\t\t\tconst containerScale = originalWidth / containerWidth;\n\t\t\t\tconst lightboxImgWidth =\n\t\t\t\t\timgMaxWidth * ( containerWidth / containerMaxWidth );\n\t\t\t\tconst lightboxImgHeight =\n\t\t\t\t\timgMaxHeight * ( containerHeight / containerMaxHeight );\n\n\t\t\t\t// As of this writing, using the calculations above will render the\n\t\t\t\t// lightbox with a small, erroneous whitespace on the left side of the\n\t\t\t\t// image in iOS Safari, perhaps due to an inconsistency in how browsers\n\t\t\t\t// handle absolute positioning and CSS transformation. In any case,\n\t\t\t\t// adding 1 pixel to the container width and height solves the problem,\n\t\t\t\t// though this can be removed if the issue is fixed in the future.\n\t\t\t\tstate.overlayStyles = `\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${ screenPosY }px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${ screenPosX }px;\n\t\t\t\t\t--wp--lightbox-container-width: ${ containerWidth + 1 }px;\n\t\t\t\t\t--wp--lightbox-container-height: ${ containerHeight + 1 }px;\n\t\t\t\t\t--wp--lightbox-image-width: ${ lightboxImgWidth }px;\n\t\t\t\t\t--wp--lightbox-image-height: ${ lightboxImgHeight }px;\n\t\t\t\t\t--wp--lightbox-scale: ${ containerScale };\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${\n\t\t\t\t\t\twindow.innerWidth - document.documentElement.clientWidth\n\t\t\t\t\t}px;\n\t\t\t\t}\n\t\t\t`;\n\t\t\t},\n\t\t\tsetButtonStyles() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\tconst { ref } = getElement();\n\n\t\t\t\tstate.metadata[ imageId ].imageRef = ref;\n\t\t\t\tstate.metadata[ imageId ].currentSrc = ref.currentSrc;\n\n\t\t\t\tconst {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth,\n\t\t\t\t\toffsetHeight,\n\t\t\t\t} = ref;\n\n\t\t\t\t// If the image isn't loaded yet, it can't calculate where the button\n\t\t\t\t// should be.\n\t\t\t\tif ( naturalWidth === 0 || naturalHeight === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst figure = ref.parentElement;\n\t\t\t\tconst figureWidth = ref.parentElement.clientWidth;\n\n\t\t\t\t// It needs special handling for the height because a caption will cause\n\t\t\t\t// the figure to be taller than the image, which means it needs to\n\t\t\t\t// account for that when calculating the placement of the button in the\n\t\t\t\t// top right corner of the image.\n\t\t\t\tlet figureHeight = ref.parentElement.clientHeight;\n\t\t\t\tconst caption = figure.querySelector( 'figcaption' );\n\t\t\t\tif ( caption ) {\n\t\t\t\t\tconst captionComputedStyle =\n\t\t\t\t\t\twindow.getComputedStyle( caption );\n\t\t\t\t\tif (\n\t\t\t\t\t\t! [ 'absolute', 'fixed' ].includes(\n\t\t\t\t\t\t\tcaptionComputedStyle.position\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tfigureHeight =\n\t\t\t\t\t\t\tfigureHeight -\n\t\t\t\t\t\t\tcaption.offsetHeight -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginTop ) -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginBottom );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst buttonOffsetTop = figureHeight - offsetHeight;\n\t\t\t\tconst buttonOffsetRight = figureWidth - offsetWidth;\n\n\t\t\t\tlet imageButtonTop = buttonOffsetTop + 16;\n\t\t\t\tlet imageButtonRight = buttonOffsetRight + 16;\n\n\t\t\t\t// In the case of an image with object-fit: contain, the size of the\n\t\t\t\t// <img> element can be larger than the image itself, so it needs to\n\t\t\t\t// calculate where to place the button.\n\t\t\t\tif ( state.metadata[ imageId ].scaleAttr === 'contain' ) {\n\t\t\t\t\t// Natural ratio of the image.\n\t\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t\t// Offset ratio of the image.\n\t\t\t\t\tconst offsetRatio = offsetWidth / offsetHeight;\n\n\t\t\t\t\tif ( naturalRatio >= offsetRatio ) {\n\t\t\t\t\t\t// If it reaches the width first, it keeps the width and compute the\n\t\t\t\t\t\t// height.\n\t\t\t\t\t\tconst referenceHeight = offsetWidth / naturalRatio;\n\t\t\t\t\t\timageButtonTop =\n\t\t\t\t\t\t\t( offsetHeight - referenceHeight ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetTop +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t\timageButtonRight = buttonOffsetRight + 16;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it reaches the height first, it keeps the height and compute\n\t\t\t\t\t\t// the width.\n\t\t\t\t\t\tconst referenceWidth = offsetHeight * naturalRatio;\n\t\t\t\t\t\timageButtonTop = buttonOffsetTop + 16;\n\t\t\t\t\t\timageButtonRight =\n\t\t\t\t\t\t\t( offsetWidth - referenceWidth ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetRight +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstate.metadata[ imageId ].imageButtonTop = imageButtonTop;\n\t\t\t\tstate.metadata[ imageId ].imageButtonRight = imageButtonRight;\n\t\t\t},\n\t\t\tsetOverlayFocus() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Moves the focus to the dialog when it opens.\n\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\tref.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\tinitTriggerButton() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tstate.metadata[ imageId ].buttonRef = ref;\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"mappings":";;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,UAAU,GAAG,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,aAAa,GAAG,CAAC;AAErB,MAAM;EAAEC,KAAK;EAAEC,OAAO;EAAEC;AAAU,CAAC,GAAG,IAAAC,oBAAK,EAC1C,YAAY,EACZ;EACCH,KAAK,EAAE;IACNI,cAAc,EAAE,IAAI;IACpB,IAAIC,YAAYA,CAAA,EAAG;MAClB,OAAOL,KAAK,CAACM,QAAQ,CAAEN,KAAK,CAACI,cAAc,CAAE;IAC9C,CAAC;IACD,IAAIG,aAAaA,CAAA,EAAG;MACnB,OAAOP,KAAK,CAACI,cAAc,KAAK,IAAI;IACrC,CAAC;IACD,IAAII,aAAaA,CAAA,EAAG;MACnB,OAAOR,KAAK,CAACO,aA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 const metadata = exports.metadata = {
45
45
  },
46
46
  supports: {
47
47
  align: true,
48
+ color: {
49
+ gradients: true,
50
+ link: true,
51
+ __experimentalDefaultControls: {
52
+ background: true,
53
+ text: true,
54
+ link: true
55
+ }
56
+ },
48
57
  html: false,
49
58
  spacing: {
50
59
  margin: true,
@@ -1 +1 @@
1
- {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","commentsToShow","type","minimum","maximum","displayAvatar","displayDate","displayExcerpt","supports","align","html","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","interactivity","clientNavigation","editorStyle","style","settings","icon","example","edit","init","initBlock"],"sources":["@wordpress/block-library/src/latest-comments/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { comment as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {},\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,cAAA;MAAAC,IAAA;MAAA;MAAAC,OAAA;MAAAC,OAAA;IAAA;IAAAC,aAAA;MAAAH,IAAA;MAAA;IAAA;IAAAI,WAAA;MAAAJ,IAAA;MAAA;IAAA;IAAAK,cAAA;MAAAL,IAAA;MAAA;IAAA;EAAA;EAAAM,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAC,6BAAA;QAAAR,QAAA;MAAA;IAAA;IAAAS,aAAA;MAAAC,gBAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,KAAA;AAAA;AAOA,MAAM;EAAEjC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAInB,MAAMkC,QAAQ,GAAArC,OAAA,CAAAqC,QAAA,GAAG;EACvBC,IAAI,EAAJA,cAAI;EACJC,OAAO,EAAE,CAAC,CAAC;EACXC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEvC,IAAI;EAAEJ,QAAQ;EAAEsC;AAAS,CAAE,CAAC;AAACrC,OAAA,CAAAyC,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","commentsToShow","type","minimum","maximum","displayAvatar","displayDate","displayExcerpt","supports","align","color","gradients","link","__experimentalDefaultControls","background","text","html","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","editorStyle","style","settings","icon","example","edit","init","initBlock"],"sources":["@wordpress/block-library/src/latest-comments/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { comment as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {},\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,cAAA;MAAAC,IAAA;MAAA;MAAAC,OAAA;MAAAC,OAAA;IAAA;IAAAC,aAAA;MAAAH,IAAA;MAAA;IAAA;IAAAI,WAAA;MAAAJ,IAAA;MAAA;IAAA;IAAAK,cAAA;MAAAL,IAAA;MAAA;IAAA;EAAA;EAAAM,QAAA;IAAAC,KAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;QAAAH,IAAA;MAAA;IAAA;IAAAI,IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAf,6BAAA;QAAAQ,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,KAAA;AAAA;AAOA,MAAM;EAAEtC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAInB,MAAMuC,QAAQ,GAAA1C,OAAA,CAAA0C,QAAA,GAAG;EACvBC,IAAI,EAAJA,cAAI;EACJC,OAAO,EAAE,CAAC,CAAC;EACXC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE5C,IAAI;EAAEJ,QAAQ;EAAE2C;AAAS,CAAE,CAAC;AAAC1C,OAAA,CAAA8C,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -103,7 +103,7 @@ function IndentUI({
103
103
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
104
104
  icon: (0, _i18n.isRTL)() ? _icons.formatOutdentRTL : _icons.formatOutdent,
105
105
  title: (0, _i18n.__)('Outdent'),
106
- describedBy: (0, _i18n.__)('Outdent list item'),
106
+ description: (0, _i18n.__)('Outdent list item'),
107
107
  disabled: !canOutdent,
108
108
  onClick: outdentList
109
109
  })
@@ -146,7 +146,7 @@ function Edit({
146
146
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
147
147
  icon: (0, _i18n.isRTL)() ? _icons.formatListBulletsRTL : _icons.formatListBullets,
148
148
  title: (0, _i18n.__)('Unordered'),
149
- describedBy: (0, _i18n.__)('Convert to unordered list'),
149
+ description: (0, _i18n.__)('Convert to unordered list'),
150
150
  isActive: ordered === false,
151
151
  onClick: () => {
152
152
  setAttributes({
@@ -156,7 +156,7 @@ function Edit({
156
156
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
157
157
  icon: (0, _i18n.isRTL)() ? _icons.formatListNumberedRTL : _icons.formatListNumbered,
158
158
  title: (0, _i18n.__)('Ordered'),
159
- describedBy: (0, _i18n.__)('Convert to ordered list'),
159
+ description: (0, _i18n.__)('Convert to ordered list'),
160
160
  isActive: ordered === true,
161
161
  onClick: () => {
162
162
  setAttributes({
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_components","_data","_i18n","_icons","_blocks","_element","_deprecated","_interopRequireDefault","_orderedListSettings","_utils","_tagName","_jsxRuntime","DEFAULT_BLOCK","name","TEMPLATE","NATIVE_MARGIN_SPACING","useMigrateOnLoad","attributes","clientId","registry","useRegistry","updateBlockAttributes","replaceInnerBlocks","useDispatch","blockEditorStore","useEffect","values","newAttributes","newInnerBlocks","migrateToListV2","deprecated","since","version","alternative","batch","useOutdentList","replaceBlocks","selectionChange","getBlockRootClientId","getBlockAttributes","getBlock","useSelect","useCallback","parentBlockId","parentBlockAttributes","newParentBlock","createBlock","innerBlocks","length","IndentUI","outdentList","canOutdent","select","getBlockName","jsx","Fragment","children","ToolbarButton","icon","isRTL","formatOutdentRTL","formatOutdent","title","__","describedBy","disabled","onClick","Edit","setAttributes","style","ordered","type","reversed","start","blockProps","useBlockProps","Platform","isNative","listStyleType","undefined","innerBlocksProps","useInnerBlocksProps","defaultBlock","directInsert","template","templateLock","templateInsertUpdatesSelection","marginVertical","marginHorizontal","renderAppender","__experimentalCaptureToolbars","controls","jsxs","BlockControls","group","formatListBulletsRTL","formatListBullets","isActive","formatListNumberedRTL","formatListNumbered","default"],"sources":["@wordpress/block-library/src/list/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarButton } from '@wordpress/components';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport {\n\tformatListBullets,\n\tformatListBulletsRTL,\n\tformatListNumbered,\n\tformatListNumberedRTL,\n\tformatOutdent,\n\tformatOutdentRTL,\n} from '@wordpress/icons';\nimport { createBlock } from '@wordpress/blocks';\nimport { useCallback, useEffect, Platform } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport OrderedListSettings from './ordered-list-settings';\nimport { migrateToListV2 } from './utils';\nimport TagName from './tag-name';\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/list-item',\n};\nconst TEMPLATE = [ [ 'core/list-item' ] ];\nconst NATIVE_MARGIN_SPACING = 8;\n\n/**\n * At the moment, deprecations don't handle create blocks from attributes\n * (like when using CPT templates). For this reason, this hook is necessary\n * to avoid breaking templates using the old list block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nfunction useMigrateOnLoad( attributes, clientId ) {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.values ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] = migrateToListV2( attributes );\n\n\t\tdeprecated( 'Value attribute on the list block', {\n\t\t\tsince: '6.0',\n\t\t\tversion: '6.5',\n\t\t\talternative: 'inner blocks',\n\t\t} );\n\n\t\tregistry.batch( () => {\n\t\t\tupdateBlockAttributes( clientId, newAttributes );\n\t\t\treplaceInnerBlocks( clientId, newInnerBlocks );\n\t\t} );\n\t}, [ attributes.values ] );\n}\n\nfunction useOutdentList( clientId ) {\n\tconst { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );\n\tconst { getBlockRootClientId, getBlockAttributes, getBlock } =\n\t\tuseSelect( blockEditorStore );\n\n\treturn useCallback( () => {\n\t\tconst parentBlockId = getBlockRootClientId( clientId );\n\t\tconst parentBlockAttributes = getBlockAttributes( parentBlockId );\n\t\t// Create a new parent block without the inner blocks.\n\t\tconst newParentBlock = createBlock(\n\t\t\t'core/list-item',\n\t\t\tparentBlockAttributes\n\t\t);\n\t\tconst { innerBlocks } = getBlock( clientId );\n\t\t// Replace the parent block with a new parent block without inner blocks,\n\t\t// and make the inner blocks siblings of the parent.\n\t\treplaceBlocks( [ parentBlockId ], [ newParentBlock, ...innerBlocks ] );\n\t\t// Select the last child of the list being outdent.\n\t\tselectionChange( innerBlocks[ innerBlocks.length - 1 ].clientId );\n\t}, [ clientId ] );\n}\n\nfunction IndentUI( { clientId } ) {\n\tconst outdentList = useOutdentList( clientId );\n\tconst canOutdent = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\tgetBlockName( getBlockRootClientId( clientId ) ) ===\n\t\t\t\t'core/list-item'\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatOutdentRTL : formatOutdent }\n\t\t\t\ttitle={ __( 'Outdent' ) }\n\t\t\t\tdescribedBy={ __( 'Outdent list item' ) }\n\t\t\t\tdisabled={ ! canOutdent }\n\t\t\t\tonClick={ outdentList }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default function Edit( { attributes, setAttributes, clientId, style } ) {\n\tconst { ordered, type, reversed, start } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tstyle: {\n\t\t\t...( Platform.isNative && style ),\n\t\t\tlistStyleType: ordered && type !== 'decimal' ? type : undefined,\n\t\t},\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\t\ttemplate: TEMPLATE,\n\t\ttemplateLock: false,\n\t\ttemplateInsertUpdatesSelection: true,\n\t\t...( Platform.isNative && {\n\t\t\tmarginVertical: NATIVE_MARGIN_SPACING,\n\t\t\tmarginHorizontal: NATIVE_MARGIN_SPACING,\n\t\t\trenderAppender: false,\n\t\t} ),\n\t\t__experimentalCaptureToolbars: true,\n\t} );\n\tuseMigrateOnLoad( attributes, clientId );\n\n\tconst controls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatListBulletsRTL : formatListBullets }\n\t\t\t\ttitle={ __( 'Unordered' ) }\n\t\t\t\tdescribedBy={ __( 'Convert to unordered list' ) }\n\t\t\t\tisActive={ ordered === false }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetAttributes( { ordered: false } );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatListNumberedRTL : formatListNumbered }\n\t\t\t\ttitle={ __( 'Ordered' ) }\n\t\t\t\tdescribedBy={ __( 'Convert to ordered list' ) }\n\t\t\t\tisActive={ ordered === true }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetAttributes( { ordered: true } );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<IndentUI clientId={ clientId } />\n\t\t</BlockControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TagName\n\t\t\t\tordered={ ordered }\n\t\t\t\treversed={ reversed }\n\t\t\t\tstart={ start }\n\t\t\t\t{ ...innerBlocksProps }\n\t\t\t/>\n\t\t\t{ controls }\n\t\t\t{ ordered && (\n\t\t\t\t<OrderedListSettings\n\t\t\t\t\t{ ...{\n\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\treversed,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAQA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAC,sBAAA,CAAAR,OAAA;AAKA,IAAAS,oBAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAH,sB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ecated","_interopRequireDefault","_orderedListSettings","_utils","_tagName","_jsxRuntime","DEFAULT_BLOCK","name","TEMPLATE","NATIVE_MARGIN_SPACING","useMigrateOnLoad","attributes","clientId","registry","useRegistry","updateBlockAttributes","replaceInnerBlocks","useDispatch","blockEditorStore","useEffect","values","newAttributes","newInnerBlocks","migrateToListV2","deprecated","since","version","alternative","batch","useOutdentList","replaceBlocks","selectionChange","getBlockRootClientId","getBlockAttributes","getBlock","useSelect","useCallback","parentBlockId","parentBlockAttributes","newParentBlock","createBlock","innerBlocks","length","IndentUI","outdentList","canOutdent","select","getBlockName","jsx","Fragment","children","ToolbarButton","icon","isRTL","formatOutdentRTL","formatOutdent","title","__","description","disabled","onClick","Edit","setAttributes","style","ordered","type","reversed","start","blockProps","useBlockProps","Platform","isNative","listStyleType","undefined","innerBlocksProps","useInnerBlocksProps","defaultBlock","directInsert","template","templateLock","templateInsertUpdatesSelection","marginVertical","marginHorizontal","renderAppender","__experimentalCaptureToolbars","controls","jsxs","BlockControls","group","formatListBulletsRTL","formatListBullets","isActive","formatListNumberedRTL","formatListNumbered","default"],"sources":["@wordpress/block-library/src/list/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarButton } from '@wordpress/components';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport {\n\tformatListBullets,\n\tformatListBulletsRTL,\n\tformatListNumbered,\n\tformatListNumberedRTL,\n\tformatOutdent,\n\tformatOutdentRTL,\n} from '@wordpress/icons';\nimport { createBlock } from '@wordpress/blocks';\nimport { useCallback, useEffect, Platform } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport OrderedListSettings from './ordered-list-settings';\nimport { migrateToListV2 } from './utils';\nimport TagName from './tag-name';\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/list-item',\n};\nconst TEMPLATE = [ [ 'core/list-item' ] ];\nconst NATIVE_MARGIN_SPACING = 8;\n\n/**\n * At the moment, deprecations don't handle create blocks from attributes\n * (like when using CPT templates). For this reason, this hook is necessary\n * to avoid breaking templates using the old list block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nfunction useMigrateOnLoad( attributes, clientId ) {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.values ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] = migrateToListV2( attributes );\n\n\t\tdeprecated( 'Value attribute on the list block', {\n\t\t\tsince: '6.0',\n\t\t\tversion: '6.5',\n\t\t\talternative: 'inner blocks',\n\t\t} );\n\n\t\tregistry.batch( () => {\n\t\t\tupdateBlockAttributes( clientId, newAttributes );\n\t\t\treplaceInnerBlocks( clientId, newInnerBlocks );\n\t\t} );\n\t}, [ attributes.values ] );\n}\n\nfunction useOutdentList( clientId ) {\n\tconst { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );\n\tconst { getBlockRootClientId, getBlockAttributes, getBlock } =\n\t\tuseSelect( blockEditorStore );\n\n\treturn useCallback( () => {\n\t\tconst parentBlockId = getBlockRootClientId( clientId );\n\t\tconst parentBlockAttributes = getBlockAttributes( parentBlockId );\n\t\t// Create a new parent block without the inner blocks.\n\t\tconst newParentBlock = createBlock(\n\t\t\t'core/list-item',\n\t\t\tparentBlockAttributes\n\t\t);\n\t\tconst { innerBlocks } = getBlock( clientId );\n\t\t// Replace the parent block with a new parent block without inner blocks,\n\t\t// and make the inner blocks siblings of the parent.\n\t\treplaceBlocks( [ parentBlockId ], [ newParentBlock, ...innerBlocks ] );\n\t\t// Select the last child of the list being outdent.\n\t\tselectionChange( innerBlocks[ innerBlocks.length - 1 ].clientId );\n\t}, [ clientId ] );\n}\n\nfunction IndentUI( { clientId } ) {\n\tconst outdentList = useOutdentList( clientId );\n\tconst canOutdent = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\tgetBlockName( getBlockRootClientId( clientId ) ) ===\n\t\t\t\t'core/list-item'\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatOutdentRTL : formatOutdent }\n\t\t\t\ttitle={ __( 'Outdent' ) }\n\t\t\t\tdescription={ __( 'Outdent list item' ) }\n\t\t\t\tdisabled={ ! canOutdent }\n\t\t\t\tonClick={ outdentList }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default function Edit( { attributes, setAttributes, clientId, style } ) {\n\tconst { ordered, type, reversed, start } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tstyle: {\n\t\t\t...( Platform.isNative && style ),\n\t\t\tlistStyleType: ordered && type !== 'decimal' ? type : undefined,\n\t\t},\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\t\ttemplate: TEMPLATE,\n\t\ttemplateLock: false,\n\t\ttemplateInsertUpdatesSelection: true,\n\t\t...( Platform.isNative && {\n\t\t\tmarginVertical: NATIVE_MARGIN_SPACING,\n\t\t\tmarginHorizontal: NATIVE_MARGIN_SPACING,\n\t\t\trenderAppender: false,\n\t\t} ),\n\t\t__experimentalCaptureToolbars: true,\n\t} );\n\tuseMigrateOnLoad( attributes, clientId );\n\n\tconst controls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatListBulletsRTL : formatListBullets }\n\t\t\t\ttitle={ __( 'Unordered' ) }\n\t\t\t\tdescription={ __( 'Convert to unordered list' ) }\n\t\t\t\tisActive={ ordered === false }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetAttributes( { ordered: false } );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatListNumberedRTL : formatListNumbered }\n\t\t\t\ttitle={ __( 'Ordered' ) }\n\t\t\t\tdescription={ __( 'Convert to ordered list' ) }\n\t\t\t\tisActive={ ordered === true }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetAttributes( { ordered: true } );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<IndentUI clientId={ clientId } />\n\t\t</BlockControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TagName\n\t\t\t\tordered={ ordered }\n\t\t\t\treversed={ reversed }\n\t\t\t\tstart={ start }\n\t\t\t\t{ ...innerBlocksProps }\n\t\t\t/>\n\t\t\t{ controls }\n\t\t\t{ ordered && (\n\t\t\t\t<OrderedListSettings\n\t\t\t\t\t{ ...{\n\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\treversed,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAQA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAC,sBAAA,CAAAR,OAAA;AAKA,IAAAS,oBAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAH,sBAAA,CAAAR,OAAA;AAAiC,IAAAY,WAAA,GAAAZ,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isRTL)() ? _icons.formatOutdentRTL : _icons.formatOutdent,
46
46
  title: (0, _i18n.__)('Outdent'),
47
- describedBy: (0, _i18n.__)('Outdent list item'),
47
+ description: (0, _i18n.__)('Outdent list item'),
48
48
  disabled: !canOutdent,
49
49
  onClick: () => outdentListItem()
50
50
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
51
51
  icon: (0, _i18n.isRTL)() ? _icons.formatIndentRTL : _icons.formatIndent,
52
52
  title: (0, _i18n.__)('Indent'),
53
- describedBy: (0, _i18n.__)('Indent list item'),
54
- isDisabled: !canIndent,
53
+ description: (0, _i18n.__)('Indent list item'),
54
+ disabled: !canIndent,
55
55
  onClick: () => indentListItem()
56
56
  })]
57
57
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_i18n","_components","_icons","_compose","_data","_hooks","_jsxRuntime","IndentUI","clientId","indentListItem","useIndentListItem","outdentListItem","useOutdentListItem","canIndent","canOutdent","useSelect","select","getBlockIndex","getBlockRootClientId","getBlockName","blockEditorStore","jsxs","Fragment","children","jsx","ToolbarButton","icon","isRTL","formatOutdentRTL","formatOutdent","title","__","describedBy","disabled","onClick","formatIndentRTL","formatIndent","isDisabled","ListItemEdit","attributes","setAttributes","mergeBlocks","placeholder","content","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","renderAppender","__unstableDisableDropZone","useEnterRef","useEnter","useSpaceRef","useSpace","onMerge","useMerge","RichText","ref","useMergeRefs","identifier","tagName","onChange","nextContent","value","BlockControls","group"],"sources":["@wordpress/block-library/src/list-item/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { ToolbarButton } from '@wordpress/components';\nimport {\n\tformatOutdent,\n\tformatOutdentRTL,\n\tformatIndentRTL,\n\tformatIndent,\n} from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseEnter,\n\tuseSpace,\n\tuseIndentListItem,\n\tuseOutdentListItem,\n\tuseMerge,\n} from './hooks';\n\nexport function IndentUI( { clientId } ) {\n\tconst indentListItem = useIndentListItem( clientId );\n\tconst outdentListItem = useOutdentListItem();\n\tconst { canIndent, canOutdent } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockIndex, getBlockRootClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tcanIndent: getBlockIndex( clientId ) > 0,\n\t\t\t\tcanOutdent:\n\t\t\t\t\tgetBlockName(\n\t\t\t\t\t\tgetBlockRootClientId( getBlockRootClientId( clientId ) )\n\t\t\t\t\t) === 'core/list-item',\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatOutdentRTL : formatOutdent }\n\t\t\t\ttitle={ __( 'Outdent' ) }\n\t\t\t\tdescribedBy={ __( 'Outdent list item' ) }\n\t\t\t\tdisabled={ ! canOutdent }\n\t\t\t\tonClick={ () => outdentListItem() }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatIndentRTL : formatIndent }\n\t\t\t\ttitle={ __( 'Indent' ) }\n\t\t\t\tdescribedBy={ __( 'Indent list item' ) }\n\t\t\t\tisDisabled={ ! canIndent }\n\t\t\t\tonClick={ () => indentListItem() }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default function ListItemEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tmergeBlocks,\n} ) {\n\tconst { placeholder, content } = attributes;\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\trenderAppender: false,\n\t\t__unstableDisableDropZone: true,\n\t} );\n\tconst useEnterRef = useEnter( { content, clientId } );\n\tconst useSpaceRef = useSpace( clientId );\n\tconst onMerge = useMerge( clientId, mergeBlocks );\n\treturn (\n\t\t<>\n\t\t\t<li { ...innerBlocksProps }>\n\t\t\t\t<RichText\n\t\t\t\t\tref={ useMergeRefs( [ useEnterRef, useSpaceRef ] ) }\n\t\t\t\t\tidentifier=\"content\"\n\t\t\t\t\ttagName=\"div\"\n\t\t\t\t\tonChange={ ( nextContent ) =>\n\t\t\t\t\t\tsetAttributes( { content: nextContent } )\n\t\t\t\t\t}\n\t\t\t\t\tvalue={ content }\n\t\t\t\t\taria-label={ __( 'List text' ) }\n\t\t\t\t\tplaceholder={ placeholder || __( 'List' ) }\n\t\t\t\t\tonMerge={ onMerge }\n\t\t\t\t/>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t</li>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<IndentUI clientId={ clientId } />\n\t\t\t</BlockControls>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAMA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAMiB,IAAAO,WAAA,GAAAP,OAAA;AA9BjB;AACA;AACA;;AAmBA;AACA;AACA;;AASO,SAASQ,QAAQA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACxC,MAAMC,cAAc,GAAG,IAAAC,wBAAiB,EAAEF,QAAS,CAAC;EACpD,MAAMG,eAAe,GAAG,IAAAC,yBAAkB,EAAC,CAAC;EAC5C,MAAM;IAAEC,SAAS;IAAEC;EAAW,CAAC,GAAG,IAAAC,eAAS,EACxCC,MAAM,IAAM;IACb,MAAM;MAAEC,aAAa;MAAEC,oBAAoB;MAAEC;I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AEL","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_i18n","_components","_icons","_compose","_data","_hooks","_jsxRuntime","IndentUI","clientId","indentListItem","useIndentListItem","outdentListItem","useOutdentListItem","canIndent","canOutdent","useSelect","select","getBlockIndex","getBlockRootClientId","getBlockName","blockEditorStore","jsxs","Fragment","children","jsx","ToolbarButton","icon","isRTL","formatOutdentRTL","formatOutdent","title","__","description","disabled","onClick","formatIndentRTL","formatIndent","ListItemEdit","attributes","setAttributes","mergeBlocks","placeholder","content","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","renderAppender","__unstableDisableDropZone","useEnterRef","useEnter","useSpaceRef","useSpace","onMerge","useMerge","RichText","ref","useMergeRefs","identifier","tagName","onChange","nextContent","value","BlockControls","group"],"sources":["@wordpress/block-library/src/list-item/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { ToolbarButton } from '@wordpress/components';\nimport {\n\tformatOutdent,\n\tformatOutdentRTL,\n\tformatIndentRTL,\n\tformatIndent,\n} from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseEnter,\n\tuseSpace,\n\tuseIndentListItem,\n\tuseOutdentListItem,\n\tuseMerge,\n} from './hooks';\n\nexport function IndentUI( { clientId } ) {\n\tconst indentListItem = useIndentListItem( clientId );\n\tconst outdentListItem = useOutdentListItem();\n\tconst { canIndent, canOutdent } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockIndex, getBlockRootClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tcanIndent: getBlockIndex( clientId ) > 0,\n\t\t\t\tcanOutdent:\n\t\t\t\t\tgetBlockName(\n\t\t\t\t\t\tgetBlockRootClientId( getBlockRootClientId( clientId ) )\n\t\t\t\t\t) === 'core/list-item',\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatOutdentRTL : formatOutdent }\n\t\t\t\ttitle={ __( 'Outdent' ) }\n\t\t\t\tdescription={ __( 'Outdent list item' ) }\n\t\t\t\tdisabled={ ! canOutdent }\n\t\t\t\tonClick={ () => outdentListItem() }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatIndentRTL : formatIndent }\n\t\t\t\ttitle={ __( 'Indent' ) }\n\t\t\t\tdescription={ __( 'Indent list item' ) }\n\t\t\t\tdisabled={ ! canIndent }\n\t\t\t\tonClick={ () => indentListItem() }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default function ListItemEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tmergeBlocks,\n} ) {\n\tconst { placeholder, content } = attributes;\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\trenderAppender: false,\n\t\t__unstableDisableDropZone: true,\n\t} );\n\tconst useEnterRef = useEnter( { content, clientId } );\n\tconst useSpaceRef = useSpace( clientId );\n\tconst onMerge = useMerge( clientId, mergeBlocks );\n\treturn (\n\t\t<>\n\t\t\t<li { ...innerBlocksProps }>\n\t\t\t\t<RichText\n\t\t\t\t\tref={ useMergeRefs( [ useEnterRef, useSpaceRef ] ) }\n\t\t\t\t\tidentifier=\"content\"\n\t\t\t\t\ttagName=\"div\"\n\t\t\t\t\tonChange={ ( nextContent ) =>\n\t\t\t\t\t\tsetAttributes( { content: nextContent } )\n\t\t\t\t\t}\n\t\t\t\t\tvalue={ content }\n\t\t\t\t\taria-label={ __( 'List text' ) }\n\t\t\t\t\tplaceholder={ placeholder || __( 'List' ) }\n\t\t\t\t\tonMerge={ onMerge }\n\t\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