@wordpress/block-library 9.4.0 → 9.6.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 (838) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build/archives/edit.js +1 -0
  3. package/build/archives/edit.js.map +1 -1
  4. package/build/audio/edit.js +1 -0
  5. package/build/audio/edit.js.map +1 -1
  6. package/build/avatar/edit.js +1 -0
  7. package/build/avatar/edit.js.map +1 -1
  8. package/build/avatar/user-control.js +1 -0
  9. package/build/avatar/user-control.js.map +1 -1
  10. package/build/button/edit.js +1 -0
  11. package/build/button/edit.js.map +1 -1
  12. package/build/categories/index.js +12 -0
  13. package/build/categories/index.js.map +1 -1
  14. package/build/column/edit.js +2 -2
  15. package/build/column/edit.js.map +1 -1
  16. package/build/column/index.js +2 -0
  17. package/build/column/index.js.map +1 -1
  18. package/build/comment-author-name/index.js +14 -1
  19. package/build/comment-author-name/index.js.map +1 -1
  20. package/build/comment-content/index.js +14 -1
  21. package/build/comment-content/index.js.map +1 -1
  22. package/build/comment-date/index.js +14 -1
  23. package/build/comment-date/index.js.map +1 -1
  24. package/build/comment-template/index.js +12 -0
  25. package/build/comment-template/index.js.map +1 -1
  26. package/build/comments-pagination/comments-pagination-arrow-controls.js +1 -0
  27. package/build/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
  28. package/build/comments-title/deprecated.js +3 -0
  29. package/build/comments-title/deprecated.js.map +1 -1
  30. package/build/comments-title/edit.js +3 -1
  31. package/build/comments-title/edit.js.map +1 -1
  32. package/build/comments-title/index.js +3 -0
  33. package/build/comments-title/index.js.map +1 -1
  34. package/build/cover/edit/inspector-controls.js +0 -1
  35. package/build/cover/edit/inspector-controls.js.map +1 -1
  36. package/build/details/edit.js +1 -0
  37. package/build/details/edit.js.map +1 -1
  38. package/build/embed/edit.js +12 -4
  39. package/build/embed/edit.js.map +1 -1
  40. package/build/embed/embed-placeholder.js +6 -3
  41. package/build/embed/embed-placeholder.js.map +1 -1
  42. package/build/embed/embed-preview.js +4 -18
  43. package/build/embed/embed-preview.js.map +1 -1
  44. package/build/file/index.js +12 -0
  45. package/build/file/index.js.map +1 -1
  46. package/build/file/inspector.js +1 -0
  47. package/build/file/inspector.js.map +1 -1
  48. package/build/form/edit.js +6 -4
  49. package/build/form/edit.js.map +1 -1
  50. package/build/form-input/edit.js +2 -0
  51. package/build/form-input/edit.js.map +1 -1
  52. package/build/gallery/edit.js +44 -14
  53. package/build/gallery/edit.js.map +1 -1
  54. package/build/gallery/gallery.native.js +4 -1
  55. package/build/gallery/gallery.native.js.map +1 -1
  56. package/build/gallery/gap-styles.js +1 -9
  57. package/build/gallery/gap-styles.js.map +1 -1
  58. package/build/gallery/use-image-sizes.js +2 -2
  59. package/build/gallery/use-image-sizes.js.map +1 -1
  60. package/build/group/edit.js +1 -1
  61. package/build/group/edit.js.map +1 -1
  62. package/build/group/index.js +27 -30
  63. package/build/group/index.js.map +1 -1
  64. package/build/group/variations.js +51 -3
  65. package/build/group/variations.js.map +1 -1
  66. package/build/heading/edit.js +2 -0
  67. package/build/heading/edit.js.map +1 -1
  68. package/build/heading/index.js +3 -0
  69. package/build/heading/index.js.map +1 -1
  70. package/build/image/image.js +6 -1
  71. package/build/image/image.js.map +1 -1
  72. package/build/image/transforms.js +4 -0
  73. package/build/image/transforms.js.map +1 -1
  74. package/build/image/view.js +1 -1
  75. package/build/image/view.js.map +1 -1
  76. package/build/latest-posts/edit.js +38 -11
  77. package/build/latest-posts/edit.js.map +1 -1
  78. package/build/list/index.js +10 -1
  79. package/build/list/index.js.map +1 -1
  80. package/build/list/ordered-list-settings.js +19 -17
  81. package/build/list/ordered-list-settings.js.map +1 -1
  82. package/build/list-item/index.js +11 -3
  83. package/build/list-item/index.js.map +1 -1
  84. package/build/loginout/index.js +14 -1
  85. package/build/loginout/index.js.map +1 -1
  86. package/build/media-text/edit.js +0 -1
  87. package/build/media-text/edit.js.map +1 -1
  88. package/build/missing/edit.js +10 -19
  89. package/build/missing/edit.js.map +1 -1
  90. package/build/navigation/edit/index.js +8 -8
  91. package/build/navigation/edit/index.js.map +1 -1
  92. package/build/navigation/edit/navigation-menu-name-control.js +1 -0
  93. package/build/navigation/edit/navigation-menu-name-control.js.map +1 -1
  94. package/build/navigation/edit/overlay-menu-preview.js +2 -0
  95. package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
  96. package/build/post-author/edit.js +60 -53
  97. package/build/post-author/edit.js.map +1 -1
  98. package/build/post-author/index.js +13 -0
  99. package/build/post-author/index.js.map +1 -1
  100. package/build/post-author-biography/index.js +14 -1
  101. package/build/post-author-biography/index.js.map +1 -1
  102. package/build/post-author-name/index.js +14 -1
  103. package/build/post-author-name/index.js.map +1 -1
  104. package/build/post-comment/edit.js +2 -0
  105. package/build/post-comment/edit.js.map +1 -1
  106. package/build/post-comments-form/index.js +12 -0
  107. package/build/post-comments-form/index.js.map +1 -1
  108. package/build/post-content/index.js +1 -0
  109. package/build/post-content/index.js.map +1 -1
  110. package/build/post-date/index.js +12 -0
  111. package/build/post-date/index.js.map +1 -1
  112. package/build/post-excerpt/edit.js +1 -0
  113. package/build/post-excerpt/edit.js.map +1 -1
  114. package/build/post-excerpt/index.js +12 -0
  115. package/build/post-excerpt/index.js.map +1 -1
  116. package/build/post-featured-image/dimension-controls.js +9 -2
  117. package/build/post-featured-image/dimension-controls.js.map +1 -1
  118. package/build/post-featured-image/edit.js +1 -0
  119. package/build/post-featured-image/edit.js.map +1 -1
  120. package/build/post-navigation-link/edit.js +7 -2
  121. package/build/post-navigation-link/edit.js.map +1 -1
  122. package/build/post-terms/edit.js +1 -0
  123. package/build/post-terms/edit.js.map +1 -1
  124. package/build/post-terms/index.js +12 -0
  125. package/build/post-terms/index.js.map +1 -1
  126. package/build/post-time-to-read/index.js +6 -0
  127. package/build/post-time-to-read/index.js.map +1 -1
  128. package/build/post-title/edit.js +5 -2
  129. package/build/post-title/edit.js.map +1 -1
  130. package/build/post-title/index.js +15 -0
  131. package/build/post-title/index.js.map +1 -1
  132. package/build/preformatted/index.js +12 -0
  133. package/build/preformatted/index.js.map +1 -1
  134. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +1 -0
  135. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  136. package/build/query/edit/inspector-controls/index.js +69 -9
  137. package/build/query/edit/inspector-controls/index.js.map +1 -1
  138. package/build/query/edit/inspector-controls/offset-controls.js +37 -0
  139. package/build/query/edit/inspector-controls/offset-controls.js.map +1 -0
  140. package/build/query/edit/inspector-controls/pages-control.js +36 -0
  141. package/build/query/edit/inspector-controls/pages-control.js.map +1 -0
  142. package/build/query/edit/inspector-controls/parent-control.js +1 -0
  143. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  144. package/build/query/edit/inspector-controls/per-page-control.js +40 -0
  145. package/build/query/edit/inspector-controls/per-page-control.js.map +1 -0
  146. package/build/query/edit/inspector-controls/sticky-control.js +1 -1
  147. package/build/query/edit/inspector-controls/sticky-control.js.map +1 -1
  148. package/build/query/edit/query-content.js +1 -1
  149. package/build/query/edit/query-content.js.map +1 -1
  150. package/build/query/edit/query-toolbar.js +3 -76
  151. package/build/query/edit/query-toolbar.js.map +1 -1
  152. package/build/query/utils.js +10 -5
  153. package/build/query/utils.js.map +1 -1
  154. package/build/query-pagination/query-pagination-arrow-controls.js +1 -0
  155. package/build/query-pagination/query-pagination-arrow-controls.js.map +1 -1
  156. package/build/query-pagination-numbers/edit.js +1 -0
  157. package/build/query-pagination-numbers/edit.js.map +1 -1
  158. package/build/query-title/edit.js +2 -0
  159. package/build/query-title/edit.js.map +1 -1
  160. package/build/query-title/index.js +15 -0
  161. package/build/query-title/index.js.map +1 -1
  162. package/build/quote/index.js +1 -0
  163. package/build/quote/index.js.map +1 -1
  164. package/build/quote/transforms.js +4 -0
  165. package/build/quote/transforms.js.map +1 -1
  166. package/build/search/edit.js +9 -5
  167. package/build/search/edit.js.map +1 -1
  168. package/build/site-logo/edit.js +15 -8
  169. package/build/site-logo/edit.js.map +1 -1
  170. package/build/site-tagline/edit.js +3 -3
  171. package/build/site-tagline/edit.js.map +1 -1
  172. package/build/site-tagline/index.js +12 -1
  173. package/build/site-tagline/index.js.map +1 -1
  174. package/build/site-title/edit.js +2 -2
  175. package/build/site-title/edit.js.map +1 -1
  176. package/build/site-title/index.js +10 -0
  177. package/build/site-title/index.js.map +1 -1
  178. package/build/social-link/edit.js +2 -1
  179. package/build/social-link/edit.js.map +1 -1
  180. package/build/spacer/controls.js +8 -13
  181. package/build/spacer/controls.js.map +1 -1
  182. package/build/table/edit.js +6 -5
  183. package/build/table/edit.js.map +1 -1
  184. package/build/table-of-contents/index.js +14 -1
  185. package/build/table-of-contents/index.js.map +1 -1
  186. package/build/tag-cloud/edit.js +69 -52
  187. package/build/tag-cloud/edit.js.map +1 -1
  188. package/build/tag-cloud/index.js +13 -1
  189. package/build/tag-cloud/index.js.map +1 -1
  190. package/build/template-part/edit/advanced-controls.js +2 -0
  191. package/build/template-part/edit/advanced-controls.js.map +1 -1
  192. package/build/template-part/edit/index.js +7 -6
  193. package/build/template-part/edit/index.js.map +1 -1
  194. package/build/template-part/edit/inner-blocks.js +6 -4
  195. package/build/template-part/edit/inner-blocks.js.map +1 -1
  196. package/build/video/edit-common-settings.js +1 -0
  197. package/build/video/edit-common-settings.js.map +1 -1
  198. package/build/video/edit.js +1 -1
  199. package/build/video/edit.js.map +1 -1
  200. package/build/video/tracks-editor.js +3 -0
  201. package/build/video/tracks-editor.js.map +1 -1
  202. package/build/video/transforms.js +4 -0
  203. package/build/video/transforms.js.map +1 -1
  204. package/build-module/archives/edit.js +1 -0
  205. package/build-module/archives/edit.js.map +1 -1
  206. package/build-module/audio/edit.js +1 -0
  207. package/build-module/audio/edit.js.map +1 -1
  208. package/build-module/avatar/edit.js +1 -0
  209. package/build-module/avatar/edit.js.map +1 -1
  210. package/build-module/avatar/user-control.js +1 -0
  211. package/build-module/avatar/user-control.js.map +1 -1
  212. package/build-module/button/edit.js +1 -0
  213. package/build-module/button/edit.js.map +1 -1
  214. package/build-module/categories/index.js +12 -0
  215. package/build-module/categories/index.js.map +1 -1
  216. package/build-module/column/edit.js +2 -2
  217. package/build-module/column/edit.js.map +1 -1
  218. package/build-module/column/index.js +2 -0
  219. package/build-module/column/index.js.map +1 -1
  220. package/build-module/comment-author-name/index.js +14 -1
  221. package/build-module/comment-author-name/index.js.map +1 -1
  222. package/build-module/comment-content/index.js +14 -1
  223. package/build-module/comment-content/index.js.map +1 -1
  224. package/build-module/comment-date/index.js +14 -1
  225. package/build-module/comment-date/index.js.map +1 -1
  226. package/build-module/comment-template/index.js +12 -0
  227. package/build-module/comment-template/index.js.map +1 -1
  228. package/build-module/comments-pagination/comments-pagination-arrow-controls.js +1 -0
  229. package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
  230. package/build-module/comments-title/deprecated.js +3 -0
  231. package/build-module/comments-title/deprecated.js.map +1 -1
  232. package/build-module/comments-title/edit.js +3 -1
  233. package/build-module/comments-title/edit.js.map +1 -1
  234. package/build-module/comments-title/index.js +3 -0
  235. package/build-module/comments-title/index.js.map +1 -1
  236. package/build-module/cover/edit/inspector-controls.js +0 -1
  237. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  238. package/build-module/details/edit.js +1 -0
  239. package/build-module/details/edit.js.map +1 -1
  240. package/build-module/embed/edit.js +13 -5
  241. package/build-module/embed/edit.js.map +1 -1
  242. package/build-module/embed/embed-placeholder.js +7 -4
  243. package/build-module/embed/embed-placeholder.js.map +1 -1
  244. package/build-module/embed/embed-preview.js +5 -19
  245. package/build-module/embed/embed-preview.js.map +1 -1
  246. package/build-module/file/index.js +12 -0
  247. package/build-module/file/index.js.map +1 -1
  248. package/build-module/file/inspector.js +1 -0
  249. package/build-module/file/inspector.js.map +1 -1
  250. package/build-module/form/edit.js +6 -4
  251. package/build-module/form/edit.js.map +1 -1
  252. package/build-module/form-input/edit.js +2 -0
  253. package/build-module/form-input/edit.js.map +1 -1
  254. package/build-module/gallery/edit.js +45 -15
  255. package/build-module/gallery/edit.js.map +1 -1
  256. package/build-module/gallery/gallery.native.js +4 -1
  257. package/build-module/gallery/gallery.native.js.map +1 -1
  258. package/build-module/gallery/gap-styles.js +1 -9
  259. package/build-module/gallery/gap-styles.js.map +1 -1
  260. package/build-module/gallery/use-image-sizes.js +2 -2
  261. package/build-module/gallery/use-image-sizes.js.map +1 -1
  262. package/build-module/group/edit.js +1 -1
  263. package/build-module/group/edit.js.map +1 -1
  264. package/build-module/group/index.js +27 -30
  265. package/build-module/group/index.js.map +1 -1
  266. package/build-module/group/variations.js +51 -3
  267. package/build-module/group/variations.js.map +1 -1
  268. package/build-module/heading/edit.js +2 -0
  269. package/build-module/heading/edit.js.map +1 -1
  270. package/build-module/heading/index.js +3 -0
  271. package/build-module/heading/index.js.map +1 -1
  272. package/build-module/image/image.js +7 -2
  273. package/build-module/image/image.js.map +1 -1
  274. package/build-module/image/transforms.js +5 -1
  275. package/build-module/image/transforms.js.map +1 -1
  276. package/build-module/image/view.js +1 -1
  277. package/build-module/image/view.js.map +1 -1
  278. package/build-module/latest-posts/edit.js +41 -14
  279. package/build-module/latest-posts/edit.js.map +1 -1
  280. package/build-module/list/index.js +10 -1
  281. package/build-module/list/index.js.map +1 -1
  282. package/build-module/list/ordered-list-settings.js +19 -17
  283. package/build-module/list/ordered-list-settings.js.map +1 -1
  284. package/build-module/list-item/index.js +11 -3
  285. package/build-module/list-item/index.js.map +1 -1
  286. package/build-module/loginout/index.js +14 -1
  287. package/build-module/loginout/index.js.map +1 -1
  288. package/build-module/media-text/edit.js +0 -1
  289. package/build-module/media-text/edit.js.map +1 -1
  290. package/build-module/missing/edit.js +10 -19
  291. package/build-module/missing/edit.js.map +1 -1
  292. package/build-module/navigation/edit/index.js +8 -8
  293. package/build-module/navigation/edit/index.js.map +1 -1
  294. package/build-module/navigation/edit/navigation-menu-name-control.js +1 -0
  295. package/build-module/navigation/edit/navigation-menu-name-control.js.map +1 -1
  296. package/build-module/navigation/edit/overlay-menu-preview.js +2 -0
  297. package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
  298. package/build-module/post-author/edit.js +61 -54
  299. package/build-module/post-author/edit.js.map +1 -1
  300. package/build-module/post-author/index.js +13 -0
  301. package/build-module/post-author/index.js.map +1 -1
  302. package/build-module/post-author-biography/index.js +14 -1
  303. package/build-module/post-author-biography/index.js.map +1 -1
  304. package/build-module/post-author-name/index.js +14 -1
  305. package/build-module/post-author-name/index.js.map +1 -1
  306. package/build-module/post-comment/edit.js +2 -0
  307. package/build-module/post-comment/edit.js.map +1 -1
  308. package/build-module/post-comments-form/index.js +12 -0
  309. package/build-module/post-comments-form/index.js.map +1 -1
  310. package/build-module/post-content/index.js +1 -0
  311. package/build-module/post-content/index.js.map +1 -1
  312. package/build-module/post-date/index.js +12 -0
  313. package/build-module/post-date/index.js.map +1 -1
  314. package/build-module/post-excerpt/edit.js +1 -0
  315. package/build-module/post-excerpt/edit.js.map +1 -1
  316. package/build-module/post-excerpt/index.js +12 -0
  317. package/build-module/post-excerpt/index.js.map +1 -1
  318. package/build-module/post-featured-image/dimension-controls.js +9 -2
  319. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  320. package/build-module/post-featured-image/edit.js +1 -0
  321. package/build-module/post-featured-image/edit.js.map +1 -1
  322. package/build-module/post-navigation-link/edit.js +7 -2
  323. package/build-module/post-navigation-link/edit.js.map +1 -1
  324. package/build-module/post-terms/edit.js +1 -0
  325. package/build-module/post-terms/edit.js.map +1 -1
  326. package/build-module/post-terms/index.js +12 -0
  327. package/build-module/post-terms/index.js.map +1 -1
  328. package/build-module/post-time-to-read/index.js +6 -0
  329. package/build-module/post-time-to-read/index.js.map +1 -1
  330. package/build-module/post-title/edit.js +5 -2
  331. package/build-module/post-title/edit.js.map +1 -1
  332. package/build-module/post-title/index.js +15 -0
  333. package/build-module/post-title/index.js.map +1 -1
  334. package/build-module/preformatted/index.js +12 -0
  335. package/build-module/preformatted/index.js.map +1 -1
  336. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -0
  337. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  338. package/build-module/query/edit/inspector-controls/index.js +71 -11
  339. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  340. package/build-module/query/edit/inspector-controls/offset-controls.js +29 -0
  341. package/build-module/query/edit/inspector-controls/offset-controls.js.map +1 -0
  342. package/build-module/query/edit/inspector-controls/pages-control.js +28 -0
  343. package/build-module/query/edit/inspector-controls/pages-control.js.map +1 -0
  344. package/build-module/query/edit/inspector-controls/parent-control.js +1 -0
  345. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  346. package/build-module/query/edit/inspector-controls/per-page-control.js +33 -0
  347. package/build-module/query/edit/inspector-controls/per-page-control.js.map +1 -0
  348. package/build-module/query/edit/inspector-controls/sticky-control.js +1 -1
  349. package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -1
  350. package/build-module/query/edit/query-content.js +1 -1
  351. package/build-module/query/edit/query-content.js.map +1 -1
  352. package/build-module/query/edit/query-toolbar.js +4 -78
  353. package/build-module/query/edit/query-toolbar.js.map +1 -1
  354. package/build-module/query/utils.js +10 -5
  355. package/build-module/query/utils.js.map +1 -1
  356. package/build-module/query-pagination/query-pagination-arrow-controls.js +1 -0
  357. package/build-module/query-pagination/query-pagination-arrow-controls.js.map +1 -1
  358. package/build-module/query-pagination-numbers/edit.js +1 -0
  359. package/build-module/query-pagination-numbers/edit.js.map +1 -1
  360. package/build-module/query-title/edit.js +2 -0
  361. package/build-module/query-title/edit.js.map +1 -1
  362. package/build-module/query-title/index.js +15 -0
  363. package/build-module/query-title/index.js.map +1 -1
  364. package/build-module/quote/index.js +1 -0
  365. package/build-module/quote/index.js.map +1 -1
  366. package/build-module/quote/transforms.js +4 -0
  367. package/build-module/quote/transforms.js.map +1 -1
  368. package/build-module/search/edit.js +10 -6
  369. package/build-module/search/edit.js.map +1 -1
  370. package/build-module/site-logo/edit.js +15 -8
  371. package/build-module/site-logo/edit.js.map +1 -1
  372. package/build-module/site-tagline/edit.js +3 -3
  373. package/build-module/site-tagline/edit.js.map +1 -1
  374. package/build-module/site-tagline/index.js +12 -1
  375. package/build-module/site-tagline/index.js.map +1 -1
  376. package/build-module/site-title/edit.js +2 -2
  377. package/build-module/site-title/edit.js.map +1 -1
  378. package/build-module/site-title/index.js +10 -0
  379. package/build-module/site-title/index.js.map +1 -1
  380. package/build-module/social-link/edit.js +2 -1
  381. package/build-module/social-link/edit.js.map +1 -1
  382. package/build-module/spacer/controls.js +9 -14
  383. package/build-module/spacer/controls.js.map +1 -1
  384. package/build-module/table/edit.js +6 -5
  385. package/build-module/table/edit.js.map +1 -1
  386. package/build-module/table-of-contents/index.js +14 -1
  387. package/build-module/table-of-contents/index.js.map +1 -1
  388. package/build-module/tag-cloud/edit.js +70 -53
  389. package/build-module/tag-cloud/edit.js.map +1 -1
  390. package/build-module/tag-cloud/index.js +13 -1
  391. package/build-module/tag-cloud/index.js.map +1 -1
  392. package/build-module/template-part/edit/advanced-controls.js +2 -0
  393. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  394. package/build-module/template-part/edit/index.js +7 -6
  395. package/build-module/template-part/edit/index.js.map +1 -1
  396. package/build-module/template-part/edit/inner-blocks.js +6 -4
  397. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  398. package/build-module/video/edit-common-settings.js +1 -0
  399. package/build-module/video/edit-common-settings.js.map +1 -1
  400. package/build-module/video/edit.js +1 -1
  401. package/build-module/video/edit.js.map +1 -1
  402. package/build-module/video/tracks-editor.js +3 -0
  403. package/build-module/video/tracks-editor.js.map +1 -1
  404. package/build-module/video/transforms.js +5 -1
  405. package/build-module/video/transforms.js.map +1 -1
  406. package/build-style/archives/editor-rtl.css +5 -2
  407. package/build-style/archives/editor.css +5 -2
  408. package/build-style/archives/style-rtl.css +5 -2
  409. package/build-style/archives/style.css +5 -2
  410. package/build-style/audio/editor-rtl.css +5 -2
  411. package/build-style/audio/editor.css +5 -2
  412. package/build-style/audio/style-rtl.css +5 -2
  413. package/build-style/audio/style.css +5 -2
  414. package/build-style/audio/theme-rtl.css +5 -2
  415. package/build-style/audio/theme.css +5 -2
  416. package/build-style/avatar/editor-rtl.css +5 -2
  417. package/build-style/avatar/editor.css +5 -2
  418. package/build-style/avatar/style-rtl.css +5 -2
  419. package/build-style/avatar/style.css +5 -2
  420. package/build-style/button/editor-rtl.css +5 -2
  421. package/build-style/button/editor.css +5 -2
  422. package/build-style/button/style-rtl.css +5 -2
  423. package/build-style/button/style.css +5 -2
  424. package/build-style/buttons/editor-rtl.css +5 -2
  425. package/build-style/buttons/editor.css +5 -2
  426. package/build-style/buttons/style-rtl.css +5 -2
  427. package/build-style/buttons/style.css +5 -2
  428. package/build-style/calendar/style-rtl.css +5 -2
  429. package/build-style/calendar/style.css +5 -2
  430. package/build-style/categories/editor-rtl.css +5 -2
  431. package/build-style/categories/editor.css +5 -2
  432. package/build-style/categories/style-rtl.css +5 -2
  433. package/build-style/categories/style.css +5 -2
  434. package/build-style/classic-rtl.css +5 -2
  435. package/build-style/classic.css +5 -2
  436. package/build-style/code/editor-rtl.css +5 -2
  437. package/build-style/code/editor.css +5 -2
  438. package/build-style/code/style-rtl.css +5 -2
  439. package/build-style/code/style.css +5 -2
  440. package/build-style/code/theme-rtl.css +5 -2
  441. package/build-style/code/theme.css +5 -2
  442. package/build-style/columns/editor-rtl.css +5 -2
  443. package/build-style/columns/editor.css +5 -2
  444. package/build-style/columns/style-rtl.css +5 -2
  445. package/build-style/columns/style.css +5 -2
  446. package/build-style/comment-author-avatar/editor-rtl.css +5 -2
  447. package/build-style/comment-author-avatar/editor.css +5 -2
  448. package/build-style/comment-author-name/style-rtl.css +94 -0
  449. package/build-style/comment-author-name/style.css +94 -0
  450. package/build-style/comment-content/style-rtl.css +9 -2
  451. package/build-style/comment-content/style.css +9 -2
  452. package/build-style/comment-date/style-rtl.css +94 -0
  453. package/build-style/comment-date/style.css +94 -0
  454. package/build-style/comment-template/style-rtl.css +5 -2
  455. package/build-style/comment-template/style.css +5 -2
  456. package/build-style/comments/editor-rtl.css +5 -2
  457. package/build-style/comments/editor.css +5 -2
  458. package/build-style/comments/style-rtl.css +5 -2
  459. package/build-style/comments/style.css +5 -2
  460. package/build-style/comments-pagination/editor-rtl.css +5 -2
  461. package/build-style/comments-pagination/editor.css +5 -2
  462. package/build-style/comments-pagination/style-rtl.css +5 -2
  463. package/build-style/comments-pagination/style.css +5 -2
  464. package/build-style/comments-pagination-numbers/editor-rtl.css +5 -2
  465. package/build-style/comments-pagination-numbers/editor.css +5 -2
  466. package/build-style/comments-title/editor-rtl.css +5 -2
  467. package/build-style/comments-title/editor.css +5 -2
  468. package/build-style/common-rtl.css +5 -2
  469. package/build-style/common.css +5 -2
  470. package/build-style/cover/editor-rtl.css +5 -2
  471. package/build-style/cover/editor.css +5 -2
  472. package/build-style/cover/style-rtl.css +5 -2
  473. package/build-style/cover/style.css +5 -2
  474. package/build-style/details/editor-rtl.css +5 -2
  475. package/build-style/details/editor.css +5 -2
  476. package/build-style/details/style-rtl.css +5 -2
  477. package/build-style/details/style.css +5 -2
  478. package/build-style/editor-elements-rtl.css +5 -2
  479. package/build-style/editor-elements.css +5 -2
  480. package/build-style/editor-rtl.css +47 -45
  481. package/build-style/editor.css +47 -45
  482. package/build-style/elements-rtl.css +5 -2
  483. package/build-style/elements.css +5 -2
  484. package/build-style/embed/editor-rtl.css +8 -2
  485. package/build-style/embed/editor.css +8 -2
  486. package/build-style/embed/style-rtl.css +5 -2
  487. package/build-style/embed/style.css +5 -2
  488. package/build-style/embed/theme-rtl.css +5 -2
  489. package/build-style/embed/theme.css +5 -2
  490. package/build-style/file/editor-rtl.css +5 -2
  491. package/build-style/file/editor.css +5 -2
  492. package/build-style/file/style-rtl.css +5 -2
  493. package/build-style/file/style.css +5 -2
  494. package/build-style/footnotes/style-rtl.css +5 -2
  495. package/build-style/footnotes/style.css +5 -2
  496. package/build-style/form-input/editor-rtl.css +5 -2
  497. package/build-style/form-input/editor.css +5 -2
  498. package/build-style/form-input/style-rtl.css +6 -2
  499. package/build-style/form-input/style.css +6 -2
  500. package/build-style/form-submission-notification/editor-rtl.css +5 -2
  501. package/build-style/form-submission-notification/editor.css +5 -2
  502. package/build-style/form-submit-button/style-rtl.css +5 -2
  503. package/build-style/form-submit-button/style.css +5 -2
  504. package/build-style/freeform/editor-rtl.css +5 -2
  505. package/build-style/freeform/editor.css +5 -2
  506. package/build-style/gallery/editor-rtl.css +5 -3
  507. package/build-style/gallery/editor.css +5 -3
  508. package/build-style/gallery/style-rtl.css +29 -9
  509. package/build-style/gallery/style.css +29 -9
  510. package/build-style/gallery/theme-rtl.css +5 -2
  511. package/build-style/gallery/theme.css +5 -2
  512. package/build-style/group/editor-rtl.css +5 -13
  513. package/build-style/group/editor.css +5 -13
  514. package/build-style/group/style-rtl.css +5 -2
  515. package/build-style/group/style.css +5 -2
  516. package/build-style/group/theme-rtl.css +5 -2
  517. package/build-style/group/theme.css +5 -2
  518. package/build-style/heading/style-rtl.css +5 -2
  519. package/build-style/heading/style.css +5 -2
  520. package/build-style/html/editor-rtl.css +5 -2
  521. package/build-style/html/editor.css +5 -2
  522. package/build-style/image/editor-rtl.css +13 -2
  523. package/build-style/image/editor.css +13 -2
  524. package/build-style/image/style-rtl.css +5 -2
  525. package/build-style/image/style.css +5 -2
  526. package/build-style/image/theme-rtl.css +5 -2
  527. package/build-style/image/theme.css +5 -2
  528. package/build-style/latest-comments/style-rtl.css +5 -2
  529. package/build-style/latest-comments/style.css +5 -2
  530. package/build-style/latest-posts/editor-rtl.css +12 -9
  531. package/build-style/latest-posts/editor.css +12 -9
  532. package/build-style/latest-posts/style-rtl.css +5 -2
  533. package/build-style/latest-posts/style.css +5 -2
  534. package/build-style/list/style-rtl.css +5 -2
  535. package/build-style/list/style.css +5 -2
  536. package/build-style/loginout/style-rtl.css +94 -0
  537. package/build-style/loginout/style.css +94 -0
  538. package/build-style/media-text/editor-rtl.css +5 -2
  539. package/build-style/media-text/editor.css +5 -2
  540. package/build-style/media-text/style-rtl.css +5 -2
  541. package/build-style/media-text/style.css +5 -2
  542. package/build-style/more/editor-rtl.css +5 -2
  543. package/build-style/more/editor.css +5 -2
  544. package/build-style/navigation/editor-rtl.css +9 -14
  545. package/build-style/navigation/editor.css +9 -14
  546. package/build-style/navigation/style-rtl.css +5 -2
  547. package/build-style/navigation/style.css +5 -2
  548. package/build-style/navigation-link/editor-rtl.css +5 -5
  549. package/build-style/navigation-link/editor.css +5 -5
  550. package/build-style/navigation-link/style-rtl.css +5 -2
  551. package/build-style/navigation-link/style.css +5 -2
  552. package/build-style/navigation-submenu/editor-rtl.css +5 -2
  553. package/build-style/navigation-submenu/editor.css +5 -2
  554. package/build-style/nextpage/editor-rtl.css +5 -2
  555. package/build-style/nextpage/editor.css +5 -2
  556. package/build-style/page-list/editor-rtl.css +5 -2
  557. package/build-style/page-list/editor.css +5 -2
  558. package/build-style/page-list/style-rtl.css +5 -2
  559. package/build-style/page-list/style.css +5 -2
  560. package/build-style/paragraph/editor-rtl.css +5 -2
  561. package/build-style/paragraph/editor.css +5 -2
  562. package/build-style/paragraph/style-rtl.css +5 -2
  563. package/build-style/paragraph/style.css +5 -2
  564. package/build-style/post-author/editor-rtl.css +95 -0
  565. package/build-style/post-author/editor.css +95 -0
  566. package/build-style/post-author/style-rtl.css +6 -2
  567. package/build-style/post-author/style.css +6 -2
  568. package/build-style/post-author-biography/style-rtl.css +94 -0
  569. package/build-style/post-author-biography/style.css +94 -0
  570. package/build-style/post-author-name/style-rtl.css +94 -0
  571. package/build-style/post-author-name/style.css +94 -0
  572. package/build-style/post-comments-form/editor-rtl.css +5 -2
  573. package/build-style/post-comments-form/editor.css +5 -2
  574. package/build-style/post-comments-form/style-rtl.css +5 -2
  575. package/build-style/post-comments-form/style.css +5 -2
  576. package/build-style/post-content/editor-rtl.css +5 -2
  577. package/build-style/post-content/editor.css +5 -2
  578. package/build-style/post-content/style-rtl.css +96 -0
  579. package/build-style/post-content/style.css +96 -0
  580. package/build-style/post-date/style-rtl.css +5 -2
  581. package/build-style/post-date/style.css +5 -2
  582. package/build-style/post-excerpt/editor-rtl.css +5 -2
  583. package/build-style/post-excerpt/editor.css +5 -2
  584. package/build-style/post-excerpt/style-rtl.css +6 -2
  585. package/build-style/post-excerpt/style.css +6 -2
  586. package/build-style/post-featured-image/editor-rtl.css +5 -2
  587. package/build-style/post-featured-image/editor.css +5 -2
  588. package/build-style/post-featured-image/style-rtl.css +5 -2
  589. package/build-style/post-featured-image/style.css +5 -2
  590. package/build-style/post-navigation-link/style-rtl.css +5 -2
  591. package/build-style/post-navigation-link/style.css +5 -2
  592. package/build-style/post-template/editor-rtl.css +5 -2
  593. package/build-style/post-template/editor.css +5 -2
  594. package/build-style/post-template/style-rtl.css +5 -2
  595. package/build-style/post-template/style.css +5 -2
  596. package/build-style/post-terms/style-rtl.css +5 -2
  597. package/build-style/post-terms/style.css +5 -2
  598. package/build-style/post-time-to-read/style-rtl.css +5 -2
  599. package/build-style/post-time-to-read/style.css +5 -2
  600. package/build-style/post-title/style-rtl.css +5 -2
  601. package/build-style/post-title/style.css +5 -2
  602. package/build-style/preformatted/style-rtl.css +5 -2
  603. package/build-style/preformatted/style.css +5 -2
  604. package/build-style/pullquote/editor-rtl.css +5 -2
  605. package/build-style/pullquote/editor.css +5 -2
  606. package/build-style/pullquote/style-rtl.css +5 -2
  607. package/build-style/pullquote/style.css +5 -2
  608. package/build-style/pullquote/theme-rtl.css +5 -2
  609. package/build-style/pullquote/theme.css +5 -2
  610. package/build-style/query/editor-rtl.css +5 -2
  611. package/build-style/query/editor.css +5 -2
  612. package/build-style/query-pagination/editor-rtl.css +5 -2
  613. package/build-style/query-pagination/editor.css +5 -2
  614. package/build-style/query-pagination/style-rtl.css +5 -2
  615. package/build-style/query-pagination/style.css +5 -2
  616. package/build-style/query-pagination-numbers/editor-rtl.css +5 -2
  617. package/build-style/query-pagination-numbers/editor.css +5 -2
  618. package/build-style/query-title/style-rtl.css +5 -2
  619. package/build-style/query-title/style.css +5 -2
  620. package/build-style/quote/style-rtl.css +5 -2
  621. package/build-style/quote/style.css +5 -2
  622. package/build-style/quote/theme-rtl.css +8 -5
  623. package/build-style/quote/theme.css +8 -5
  624. package/build-style/read-more/style-rtl.css +5 -2
  625. package/build-style/read-more/style.css +5 -2
  626. package/build-style/reset-rtl.css +5 -2
  627. package/build-style/reset.css +5 -2
  628. package/build-style/rss/editor-rtl.css +5 -2
  629. package/build-style/rss/editor.css +5 -2
  630. package/build-style/rss/style-rtl.css +5 -2
  631. package/build-style/rss/style.css +5 -2
  632. package/build-style/search/editor-rtl.css +8 -4
  633. package/build-style/search/editor.css +8 -4
  634. package/build-style/search/style-rtl.css +5 -2
  635. package/build-style/search/style.css +5 -2
  636. package/build-style/search/theme-rtl.css +5 -2
  637. package/build-style/search/theme.css +5 -2
  638. package/build-style/separator/editor-rtl.css +5 -2
  639. package/build-style/separator/editor.css +5 -2
  640. package/build-style/separator/style-rtl.css +5 -2
  641. package/build-style/separator/style.css +5 -2
  642. package/build-style/separator/theme-rtl.css +5 -2
  643. package/build-style/separator/theme.css +5 -2
  644. package/build-style/shortcode/editor-rtl.css +5 -2
  645. package/build-style/shortcode/editor.css +5 -2
  646. package/build-style/site-logo/editor-rtl.css +5 -2
  647. package/build-style/site-logo/editor.css +5 -2
  648. package/build-style/site-logo/style-rtl.css +5 -2
  649. package/build-style/site-logo/style.css +5 -2
  650. package/build-style/site-tagline/editor-rtl.css +5 -2
  651. package/build-style/site-tagline/editor.css +5 -2
  652. package/build-style/site-tagline/style-rtl.css +94 -0
  653. package/build-style/site-tagline/style.css +94 -0
  654. package/build-style/site-title/editor-rtl.css +5 -2
  655. package/build-style/site-title/editor.css +5 -2
  656. package/build-style/site-title/style-rtl.css +9 -3
  657. package/build-style/site-title/style.css +9 -3
  658. package/build-style/social-link/editor-rtl.css +5 -2
  659. package/build-style/social-link/editor.css +5 -2
  660. package/build-style/social-links/editor-rtl.css +5 -2
  661. package/build-style/social-links/editor.css +5 -2
  662. package/build-style/social-links/style-rtl.css +5 -2
  663. package/build-style/social-links/style.css +5 -2
  664. package/build-style/spacer/editor-rtl.css +5 -2
  665. package/build-style/spacer/editor.css +5 -2
  666. package/build-style/spacer/style-rtl.css +5 -2
  667. package/build-style/spacer/style.css +5 -2
  668. package/build-style/style-rtl.css +80 -10
  669. package/build-style/style.css +80 -10
  670. package/build-style/table/editor-rtl.css +5 -2
  671. package/build-style/table/editor.css +5 -2
  672. package/build-style/table/style-rtl.css +5 -2
  673. package/build-style/table/style.css +5 -2
  674. package/build-style/table/theme-rtl.css +5 -2
  675. package/build-style/table/theme.css +5 -2
  676. package/build-style/table-of-contents/style-rtl.css +94 -0
  677. package/build-style/table-of-contents/style.css +94 -0
  678. package/build-style/tag-cloud/editor-rtl.css +102 -0
  679. package/build-style/tag-cloud/editor.css +102 -0
  680. package/build-style/tag-cloud/style-rtl.css +5 -2
  681. package/build-style/tag-cloud/style.css +5 -2
  682. package/build-style/template-part/editor-rtl.css +5 -6
  683. package/build-style/template-part/editor.css +5 -6
  684. package/build-style/template-part/theme-rtl.css +5 -2
  685. package/build-style/template-part/theme.css +5 -2
  686. package/build-style/term-description/style-rtl.css +5 -2
  687. package/build-style/term-description/style.css +5 -2
  688. package/build-style/text-columns/editor-rtl.css +5 -2
  689. package/build-style/text-columns/editor.css +5 -2
  690. package/build-style/text-columns/style-rtl.css +5 -2
  691. package/build-style/text-columns/style.css +5 -2
  692. package/build-style/theme-rtl.css +8 -5
  693. package/build-style/theme.css +8 -5
  694. package/build-style/verse/style-rtl.css +5 -2
  695. package/build-style/verse/style.css +5 -2
  696. package/build-style/video/editor-rtl.css +5 -5
  697. package/build-style/video/editor.css +5 -5
  698. package/build-style/video/style-rtl.css +5 -2
  699. package/build-style/video/style.css +5 -2
  700. package/build-style/video/theme-rtl.css +5 -2
  701. package/build-style/video/theme.css +5 -2
  702. package/package.json +35 -35
  703. package/src/archives/edit.js +1 -0
  704. package/src/audio/edit.js +4 -3
  705. package/src/avatar/edit.js +1 -0
  706. package/src/avatar/user-control.js +1 -0
  707. package/src/button/edit.js +1 -0
  708. package/src/button/index.php +1 -14
  709. package/src/categories/block.json +12 -0
  710. package/src/column/block.json +2 -0
  711. package/src/column/edit.js +2 -2
  712. package/src/comment-author-name/block.json +14 -1
  713. package/src/comment-author-name/style.scss +4 -0
  714. package/src/comment-content/block.json +14 -1
  715. package/src/comment-content/style.scss +5 -0
  716. package/src/comment-date/block.json +14 -1
  717. package/src/comment-date/style.scss +4 -0
  718. package/src/comment-template/block.json +12 -0
  719. package/src/comments-pagination/comments-pagination-arrow-controls.js +1 -0
  720. package/src/comments-title/block.json +3 -0
  721. package/src/comments-title/edit.js +8 -1
  722. package/src/cover/edit/inspector-controls.js +0 -1
  723. package/src/details/edit.js +1 -0
  724. package/src/editor.scss +2 -0
  725. package/src/embed/edit.js +10 -1
  726. package/src/embed/editor.scss +4 -0
  727. package/src/embed/embed-placeholder.js +7 -4
  728. package/src/embed/embed-preview.js +3 -37
  729. package/src/file/block.json +12 -0
  730. package/src/file/inspector.js +1 -0
  731. package/src/form/edit.js +5 -2
  732. package/src/form-input/edit.js +2 -0
  733. package/src/form-input/style.scss +1 -0
  734. package/src/gallery/edit.js +80 -22
  735. package/src/gallery/editor.scss +1 -2
  736. package/src/gallery/gallery.native.js +2 -1
  737. package/src/gallery/gap-styles.js +1 -8
  738. package/src/gallery/style.scss +33 -7
  739. package/src/gallery/test/__snapshots__/index.native.js.snap +1 -1
  740. package/src/gallery/test/index.native.js +5 -5
  741. package/src/gallery/use-image-sizes.js +2 -2
  742. package/src/group/edit.js +1 -1
  743. package/src/group/editor.scss +1 -1
  744. package/src/group/index.js +26 -29
  745. package/src/group/variations.js +56 -0
  746. package/src/heading/block.json +3 -0
  747. package/src/heading/edit.js +3 -1
  748. package/src/image/editor.scss +12 -0
  749. package/src/image/image.js +7 -1
  750. package/src/image/transforms.js +7 -1
  751. package/src/image/view.js +1 -1
  752. package/src/latest-posts/edit.js +61 -17
  753. package/src/latest-posts/editor.scss +11 -10
  754. package/src/list/block.json +10 -1
  755. package/src/list/ordered-list-settings.js +20 -18
  756. package/src/list/test/edit.native.js +1 -3
  757. package/src/list-item/block.json +11 -3
  758. package/src/loginout/block.json +14 -1
  759. package/src/loginout/style.scss +4 -0
  760. package/src/media-text/edit.js +0 -1
  761. package/src/media-text/style.native.scss +2 -0
  762. package/src/missing/edit.js +12 -18
  763. package/src/navigation/edit/index.js +8 -8
  764. package/src/navigation/edit/navigation-menu-name-control.js +1 -0
  765. package/src/navigation/edit/overlay-menu-preview.js +2 -0
  766. package/src/navigation/editor.scss +5 -1
  767. package/src/navigation/index.php +10 -27
  768. package/src/navigation-link/editor.scss +0 -3
  769. package/src/post-author/block.json +13 -0
  770. package/src/post-author/edit.js +68 -57
  771. package/src/post-author/editor.scss +7 -0
  772. package/src/post-author/style.scss +1 -0
  773. package/src/post-author-biography/block.json +14 -1
  774. package/src/post-author-biography/style.scss +4 -0
  775. package/src/post-author-name/block.json +14 -1
  776. package/src/post-author-name/style.scss +4 -0
  777. package/src/post-comment/edit.js +2 -0
  778. package/src/post-comments-form/block.json +12 -0
  779. package/src/post-content/block.json +1 -0
  780. package/src/post-content/style.scss +5 -0
  781. package/src/post-date/block.json +12 -0
  782. package/src/post-excerpt/block.json +12 -0
  783. package/src/post-excerpt/edit.js +1 -0
  784. package/src/post-excerpt/style.scss +3 -0
  785. package/src/post-featured-image/dimension-controls.js +5 -0
  786. package/src/post-featured-image/edit.js +1 -0
  787. package/src/post-navigation-link/edit.js +8 -2
  788. package/src/post-terms/block.json +12 -0
  789. package/src/post-terms/edit.js +1 -0
  790. package/src/post-time-to-read/block.json +6 -0
  791. package/src/post-title/block.json +15 -0
  792. package/src/post-title/edit.js +5 -3
  793. package/src/preformatted/block.json +12 -0
  794. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +1 -0
  795. package/src/query/edit/inspector-controls/index.js +85 -12
  796. package/src/query/edit/inspector-controls/offset-controls.js +31 -0
  797. package/src/query/edit/inspector-controls/pages-control.js +27 -0
  798. package/src/query/edit/inspector-controls/parent-control.js +1 -0
  799. package/src/query/edit/inspector-controls/per-page-control.js +33 -0
  800. package/src/query/edit/inspector-controls/sticky-control.js +1 -1
  801. package/src/query/edit/query-content.js +1 -1
  802. package/src/query/edit/query-toolbar.js +1 -90
  803. package/src/query/utils.js +9 -5
  804. package/src/query-pagination/query-pagination-arrow-controls.js +1 -0
  805. package/src/query-pagination-numbers/edit.js +1 -0
  806. package/src/query-title/block.json +15 -0
  807. package/src/query-title/edit.js +9 -1
  808. package/src/quote/block.json +1 -0
  809. package/src/quote/test/transforms.native.js +1 -1
  810. package/src/quote/theme.scss +5 -3
  811. package/src/quote/transforms.js +11 -2
  812. package/src/search/edit.js +9 -9
  813. package/src/search/editor.scss +5 -2
  814. package/src/site-logo/edit.js +23 -9
  815. package/src/site-tagline/block.json +12 -1
  816. package/src/site-tagline/edit.js +2 -4
  817. package/src/site-tagline/style.scss +4 -0
  818. package/src/site-title/block.json +10 -0
  819. package/src/site-title/edit.js +2 -4
  820. package/src/site-title/style.scss +7 -2
  821. package/src/social-link/edit.js +2 -1
  822. package/src/spacer/controls.js +10 -13
  823. package/src/style.scss +9 -0
  824. package/src/table/edit.js +5 -4
  825. package/src/table-of-contents/block.json +14 -1
  826. package/src/table-of-contents/style.scss +4 -0
  827. package/src/tag-cloud/block.json +13 -1
  828. package/src/tag-cloud/edit.js +80 -56
  829. package/src/tag-cloud/editor.scss +19 -0
  830. package/src/template-part/edit/advanced-controls.js +2 -0
  831. package/src/template-part/edit/index.js +10 -7
  832. package/src/template-part/edit/inner-blocks.js +6 -4
  833. package/src/template-part/editor.scss +0 -5
  834. package/src/video/edit-common-settings.js +1 -0
  835. package/src/video/edit.js +2 -2
  836. package/src/video/editor.scss +0 -4
  837. package/src/video/tracks-editor.js +3 -0
  838. package/src/video/transforms.js +5 -1
@@ -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","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,CAAEC,UAAU,EAAE;EAAEC;AAAU,CAAC,EAAG;EAC5D,MAAM;IAAEC;EAAK,CAAC,GAAGC,QAAQ,CAACC,cAAc,CAACC,kBAAkB,CAAE,EAAG,CAAC;EAEjEH,IAAI,CAACI,SAAS,GAAGL,SAAS,CAACM,OAAO;EAElC,IAAIC,YAAY,GAAGN,IAAI,CAACO,aAAa,CAAE,KAAM,CAAC;;EAE9C;EACA,OACCD,YAAY,IACZA,YAAY,CAACE,UAAU,IACvBF,YAAY,CAACE,UAAU,KAAKR,IAAI,EAC/B;IACDM,YAAY,GAAGA,YAAY,CAACE,UAAU;EACvC;EAEA,IAAKF,YAAY,EAAG;IACnBA,YAAY,CAACE,UAAU,CAACC,WAAW,CAAEH,YAAa,CAAC;EACpD;EAEA,OAAON,IAAI,CAACI,SAAS,CAACM,IAAI,CAAC,CAAC;AAC7B;AAEA,SAASC,+BAA+BA,CAAEC,IAAI,EAAEC,aAAa,EAAG;EAC/D,MAAM;IAA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Y,+BAA+B,CACrCZ,SAAS,CAACM,OAAO,EACjB,MACD,CAAC;QACF;MACD,CAAC;MACDuC,GAAG,EAAE;QACJ7C,SAAS,EAAEA,CAAED,UAAU,EAAE;UAAEC;QAAU,CAAC,KAAM;UAC3C,OAAOY,+BAA+B,CACrCZ,SAAS,CAACM,OAAO,EACjB,KACD,CAAC;QACF;MACD,CAAC;MACDwC,SAAS,EAAE;QACV9C,SAAS,EAAEA,CAAED,UAAU,EAAE;UAAEC;QAAU,CAAC,KAAM;UAC3C,OAAOY,+BAA+B,CACrCZ,SAAS,CAACM,OAAO,EACjB,OACD,CAAC;QACF;MACD,CAAC;MACDgC,EAAE,EAAE;QACHR,IAAI,EAAE,QAAQ;QACd9B,SAAS,EAAEA,CAAE;UAAEsE,KAAK,EAAE;YAAEhC;UAAG;QAAE,CAAC,KAAM;UACnC,IAAK,CAAEA,EAAE,EAAG;YACX;UACD;UAEA,OAAOiC,QAAQ,CAAEjC,EAAE,CAACkC,OAAO,CAAE,aAAa,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":[]}
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","isBlobURL","url","blob","createBlock","files","some","file","indexOf","createErrorNotice","dispatch","noticesStore","__","every","blocks","map","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, isBlobURL } 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\n\t\t\t\tif ( isBlobURL( attributes.url ) ) {\n\t\t\t\t\tattributes.blob = attributes.url;\n\t\t\t\t\tdelete attributes.url;\n\t\t\t\t}\n\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,CAAEC,UAAU,EAAE;EAAEC;AAAU,CAAC,EAAG;EAC5D,MAAM;IAAEC;EAAK,CAAC,GAAGC,QAAQ,CAACC,cAAc,CAACC,kBAAkB,CAAE,EAAG,CAAC;EAEjEH,IAAI,CAACI,SAAS,GAAGL,SAAS,CAACM,OAAO;EAElC,IAAIC,YAAY,GAAGN,IAAI,CAACO,aAAa,CAAE,KAAM,CAAC;;EAE9C;EACA,OACCD,YAAY,IACZA,YAAY,CAACE,UAAU,IACvBF,YAAY,CAACE,UAAU,KAAKR,IAAI,EAC/B;IACDM,YAAY,GAAGA,YAAY,CAACE,UAAU;EACvC;EAEA,IAAKF,YAAY,EAAG;IACnBA,YAAY,CAACE,UAAU,CAACC,WAAW,CAAEH,YAAa,CAAC;EACpD;EAEA,OAAON,IAAI,CAACI,SAAS,CAACM,IAAI,CAAC,CAAC;AAC7B;AAEA,SAASC,+BAA+BA,CAAEC,IAAI,EAAEC,aAAa,EAAG;EAC/D,MAAM;IAAEb;EAAK,CAAC,GAAGC,QAAQ,CAACC,cAAc,CAACC,kBAAkB,CAAE,EAAG,CAAC;EAEjEH,IAAI,CAACI,SAAS,GAAGQ,IA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AAU,EAAE;UAAEC;QAAU,CAAC,KAAM;UAC3C,OAAOY,+BAA+B,CACrCZ,SAAS,CAACM,OAAO,EACjB,MACD,CAAC;QACF;MACD,CAAC;MACDuC,GAAG,EAAE;QACJ7C,SAAS,EAAEA,CAAED,UAAU,EAAE;UAAEC;QAAU,CAAC,KAAM;UAC3C,OAAOY,+BAA+B,CACrCZ,SAAS,CAACM,OAAO,EACjB,KACD,CAAC;QACF;MACD,CAAC;MACDwC,SAAS,EAAE;QACV9C,SAAS,EAAEA,CAAED,UAAU,EAAE;UAAEC;QAAU,CAAC,KAAM;UAC3C,OAAOY,+BAA+B,CACrCZ,SAAS,CAACM,OAAO,EACjB,OACD,CAAC;QACF;MACD,CAAC;MACDgC,EAAE,EAAE;QACHR,IAAI,EAAE,QAAQ;QACd9B,SAAS,EAAEA,CAAE;UAAEuE,KAAK,EAAE;YAAEjC;UAAG;QAAE,CAAC,KAAM;UACnC,IAAK,CAAEA,EAAE,EAAG;YACX;UACD;UAEA,OAAOkC,QAAQ,CAAElC,EAAE,CAACmC,OAAO,CAAE,aAAa,EAAE,EAAG,CAAC,EAAE,EAAG,CAAC;QACvD;MACD,CAAC;MACDlC,KAAK,EAAE;QACNT,IAAI,EAAE,QAAQ;QACd9B,SAAS,EAAEA,CAAE;UAAEuE,KAAK,EAAE;YAAEhC,KAAK,GAAG;UAAY;QAAE,CAAC,KAAM;UACpD,OAAOA,KAAK,CAACkC,OAAO,CAAE,OAAO,EAAE,EAAG,CAAC;QACpC;MACD;IACD;EACD,CAAC;AAEH,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEahD,UAAU","ignoreList":[]}
@@ -176,7 +176,7 @@ const {
176
176
  },
177
177
  callbacks: {
178
178
  setOverlayStyles() {
179
- if (!state.currentImage.imageRef) {
179
+ if (!state.overlayEnabled) {
180
180
  return;
181
181
  }
182
182
  let {
@@ -1 +1 @@
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,KAA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;IAC1C;EACD;AACD,CAAC,EACD;EAAE2E,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.overlayEnabled ) {\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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C,GAAG,IAAAC,yBAAU,EAAC,CAAC;MAC5B5C,KAAK,CAACM,QAAQ,CAAEU,OAAO,CAAE,CAACoB,SAAS,GAAGO,GAAG;IAC1C;EACD;AACD,CAAC,EACD;EAAE2E,IAAI,EAAE;AAAK,CACd,CAAC","ignoreList":[]}
@@ -156,17 +156,36 @@ function LatestPostsEdit({
156
156
  categories: allCategories
157
157
  });
158
158
  };
159
+ const imageAlignmentOptions = [{
160
+ value: 'none',
161
+ icon: _icons.alignNone,
162
+ label: (0, _i18n.__)('None')
163
+ }, {
164
+ value: 'left',
165
+ icon: _icons.positionLeft,
166
+ label: (0, _i18n.__)('Left')
167
+ }, {
168
+ value: 'center',
169
+ icon: _icons.positionCenter,
170
+ label: (0, _i18n.__)('Center')
171
+ }, {
172
+ value: 'right',
173
+ icon: _icons.positionRight,
174
+ label: (0, _i18n.__)('Right')
175
+ }];
159
176
  const hasPosts = !!latestPosts?.length;
160
177
  const inspectorControls = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.InspectorControls, {
161
178
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.PanelBody, {
162
179
  title: (0, _i18n.__)('Post content'),
163
180
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
181
+ __nextHasNoMarginBottom: true,
164
182
  label: (0, _i18n.__)('Post content'),
165
183
  checked: displayPostContent,
166
184
  onChange: value => setAttributes({
167
185
  displayPostContent: value
168
186
  })
169
187
  }), displayPostContent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RadioControl, {
188
+ className: "wp-block-latest-posts__post-content-radio",
170
189
  label: (0, _i18n.__)('Show:'),
171
190
  selected: displayPostContentRadio,
172
191
  options: [{
@@ -240,18 +259,26 @@ function LatestPostsEdit({
240
259
  featuredImageSizeWidth: undefined,
241
260
  featuredImageSizeHeight: undefined
242
261
  })
243
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.BaseControl, {
262
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControl, {
244
263
  className: "editor-latest-posts-image-alignment-control",
245
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BaseControl.VisualLabel, {
246
- children: (0, _i18n.__)('Image alignment')
247
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockAlignmentToolbar, {
248
- value: featuredImageAlign,
249
- onChange: value => setAttributes({
250
- featuredImageAlign: value
251
- }),
252
- controls: ['left', 'center', 'right'],
253
- isCollapsed: false
254
- })]
264
+ __nextHasNoMarginBottom: true,
265
+ __next40pxDefaultSize: true,
266
+ label: (0, _i18n.__)('Image alignment'),
267
+ value: featuredImageAlign || 'none',
268
+ onChange: value => setAttributes({
269
+ featuredImageAlign: value !== 'none' ? value : undefined
270
+ }),
271
+ children: imageAlignmentOptions.map(({
272
+ value,
273
+ icon,
274
+ label
275
+ }) => {
276
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOptionIcon, {
277
+ value: value,
278
+ icon: icon,
279
+ label: label
280
+ }, value);
281
+ })
255
282
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
256
283
  __nextHasNoMarginBottom: true,
257
284
  label: (0, _i18n.__)('Add link to featured image'),
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_date","_blockEditor","_data","_icons","_coreData","_notices","_compose","_element","_constants","_jsxRuntime","CATEGORIES_LIST_QUERY","per_page","context","USERS_LIST_QUERY","has_published_posts","getFeaturedImageDetails","post","size","_image$media_details$","image","_embedded","url","media_details","sizes","source_url","alt","alt_text","LatestPostsEdit","attributes","setAttributes","_categoriesList$reduc","instanceId","useInstanceId","postsToShow","order","orderBy","categories","selectedAuthor","displayFeaturedImage","displayPostContentRadio","displayPostContent","displayPostDate","displayAuthor","postLayout","columns","excerptLength","featuredImageAlign","featuredImageSizeSlug","featuredImageSizeWidth","featuredImageSizeHeight","addLinkToFeaturedImage","imageSizes","latestPosts","defaultImageWidth","defaultImageHeight","categoriesList","authorList","useSelect","select","_settings$imageDimens","_settings$imageDimens2","getEntityRecords","getUsers","coreStore","settings","blockEditorStore","getSettings","catIds","length","map","cat","id","latestPostsQuery","Object","fromEntries","entries","author","orderby","_embed","filter","value","imageDimensions","width","height","createWarningNotice","removeNotice","useDispatch","noticeStore","noticeId","showRedirectionPreventedNotice","event","preventDefault","__","type","imageSizeOptions","slug","name","label","categorySuggestions","reduce","accumulator","category","selectCategories","tokens","hasNoSuggestion","some","token","allCategories","includes","hasPosts","inspectorControls","jsxs","InspectorControls","children","PanelBody","title","jsx","ToggleControl","checked","onChange","RadioControl","selected","options","RangeControl","__nextHasNoMarginBottom","__next40pxDefaultSize","min","MIN_EXCERPT_LENGTH","max","MAX_EXCERPT_LENGTH","Fragment","__experimentalImageSizeControl","newAttrs","hasOwnProperty","imageWidth","imageHeight","imageSizeHelp","onChangeImage","undefined","BaseControl","className","VisualLabel","BlockAlignmentToolbar","controls","isCollapsed","QueryControls","numberOfItems","onOrderChange","onOrderByChange","onNumberOfItemsChange","onCategoryChange","selectedCategories","onAuthorChange","Number","selectedAuthorId","MAX_POSTS_COLUMNS","Math","required","blockProps","useBlockProps","clsx","Placeholder","icon","pin","Array","isArray","Spinner","displayPosts","slice","layoutControls","list","_x","onClick","isActive","grid","dateFormat","formats","date","BlockControls","ToolbarGroup","titleTrimmed","rendered","trim","excerpt","currentAuthor","find","excerptElement","document","createElement","innerHTML","textContent","innerText","imageSourceUrl","featuredImageAlt","imageClasses","renderFeaturedImage","featuredImage","src","style","maxWidth","maxHeight","needsReadMore","split","raw","postExcerpt","join","createInterpolateElement","sprintf","a","href","link","rel","span","dangerouslySetInnerHTML","__html","date_gmt","dateTime","format","dateI18n","content"],"sources":["@wordpress/block-library/src/latest-posts/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tPanelBody,\n\tPlaceholder,\n\tQueryControls,\n\tRadioControl,\n\tRangeControl,\n\tSpinner,\n\tToggleControl,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { dateI18n, format, getSettings } from '@wordpress/date';\nimport {\n\tInspectorControls,\n\tBlockAlignmentToolbar,\n\tBlockControls,\n\t__experimentalImageSizeControl as ImageSizeControl,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { pin, list, grid } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticeStore } from '@wordpress/notices';\nimport { useInstanceId } from '@wordpress/compose';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMIN_EXCERPT_LENGTH,\n\tMAX_EXCERPT_LENGTH,\n\tMAX_POSTS_COLUMNS,\n} from './constants';\n\n/**\n * Module Constants\n */\nconst CATEGORIES_LIST_QUERY = {\n\tper_page: -1,\n\tcontext: 'view',\n};\nconst USERS_LIST_QUERY = {\n\tper_page: -1,\n\thas_published_posts: [ 'post' ],\n\tcontext: 'view',\n};\n\nfunction getFeaturedImageDetails( post, size ) {\n\tconst image = post._embedded?.[ 'wp:featuredmedia' ]?.[ '0' ];\n\n\treturn {\n\t\turl:\n\t\t\timage?.media_details?.sizes?.[ size ]?.source_url ??\n\t\t\timage?.source_url,\n\t\talt: image?.alt_text,\n\t};\n}\n\nexport default function LatestPostsEdit( { attributes, setAttributes } ) {\n\tconst instanceId = useInstanceId( LatestPostsEdit );\n\tconst {\n\t\tpostsToShow,\n\t\torder,\n\t\torderBy,\n\t\tcategories,\n\t\tselectedAuthor,\n\t\tdisplayFeaturedImage,\n\t\tdisplayPostContentRadio,\n\t\tdisplayPostContent,\n\t\tdisplayPostDate,\n\t\tdisplayAuthor,\n\t\tpostLayout,\n\t\tcolumns,\n\t\texcerptLength,\n\t\tfeaturedImageAlign,\n\t\tfeaturedImageSizeSlug,\n\t\tfeaturedImageSizeWidth,\n\t\tfeaturedImageSizeHeight,\n\t\taddLinkToFeaturedImage,\n\t} = attributes;\n\tconst {\n\t\timageSizes,\n\t\tlatestPosts,\n\t\tdefaultImageWidth,\n\t\tdefaultImageHeight,\n\t\tcategoriesList,\n\t\tauthorList,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getUsers } = select( coreStore );\n\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\t\tconst catIds =\n\t\t\t\tcategories && categories.length > 0\n\t\t\t\t\t? categories.map( ( cat ) => cat.id )\n\t\t\t\t\t: [];\n\t\t\tconst latestPostsQuery = Object.fromEntries(\n\t\t\t\tObject.entries( {\n\t\t\t\t\tcategories: catIds,\n\t\t\t\t\tauthor: selectedAuthor,\n\t\t\t\t\torder,\n\t\t\t\t\torderby: orderBy,\n\t\t\t\t\tper_page: postsToShow,\n\t\t\t\t\t_embed: 'wp:featuredmedia',\n\t\t\t\t} ).filter( ( [ , value ] ) => typeof value !== 'undefined' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tdefaultImageWidth:\n\t\t\t\t\tsettings.imageDimensions?.[ featuredImageSizeSlug ]\n\t\t\t\t\t\t?.width ?? 0,\n\t\t\t\tdefaultImageHeight:\n\t\t\t\t\tsettings.imageDimensions?.[ featuredImageSizeSlug ]\n\t\t\t\t\t\t?.height ?? 0,\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tlatestPosts: getEntityRecords(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'post',\n\t\t\t\t\tlatestPostsQuery\n\t\t\t\t),\n\t\t\t\tcategoriesList: getEntityRecords(\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\t'category',\n\t\t\t\t\tCATEGORIES_LIST_QUERY\n\t\t\t\t),\n\t\t\t\tauthorList: getUsers( USERS_LIST_QUERY ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tfeaturedImageSizeSlug,\n\t\t\tpostsToShow,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tcategories,\n\t\t\tselectedAuthor,\n\t\t]\n\t);\n\n\t// If a user clicks to a link prevent redirection and show a warning.\n\tconst { createWarningNotice, removeNotice } = useDispatch( noticeStore );\n\tlet noticeId;\n\tconst showRedirectionPreventedNotice = ( event ) => {\n\t\tevent.preventDefault();\n\t\t// Remove previous warning if any, to show one at a time per block.\n\t\tremoveNotice( noticeId );\n\t\tnoticeId = `block-library/core/latest-posts/redirection-prevented/${ instanceId }`;\n\t\tcreateWarningNotice( __( 'Links are disabled in the editor.' ), {\n\t\t\tid: noticeId,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => slug !== 'full' )\n\t\t.map( ( { name, slug } ) => ( {\n\t\t\tvalue: slug,\n\t\t\tlabel: name,\n\t\t} ) );\n\tconst categorySuggestions =\n\t\tcategoriesList?.reduce(\n\t\t\t( accumulator, category ) => ( {\n\t\t\t\t...accumulator,\n\t\t\t\t[ category.name ]: category,\n\t\t\t} ),\n\t\t\t{}\n\t\t) ?? {};\n\tconst selectCategories = ( tokens ) => {\n\t\tconst hasNoSuggestion = tokens.some(\n\t\t\t( token ) =>\n\t\t\t\ttypeof token === 'string' && ! categorySuggestions[ token ]\n\t\t);\n\t\tif ( hasNoSuggestion ) {\n\t\t\treturn;\n\t\t}\n\t\t// Categories that are already will be objects, while new additions will be strings (the name).\n\t\t// allCategories nomalizes the array so that they are all objects.\n\t\tconst allCategories = tokens.map( ( token ) => {\n\t\t\treturn typeof token === 'string'\n\t\t\t\t? categorySuggestions[ token ]\n\t\t\t\t: token;\n\t\t} );\n\t\t// We do nothing if the category is not selected\n\t\t// from suggestions.\n\t\tif ( allCategories.includes( null ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tsetAttributes( { categories: allCategories } );\n\t};\n\n\tconst hasPosts = !! latestPosts?.length;\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Post content' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Post content' ) }\n\t\t\t\t\tchecked={ displayPostContent }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayPostContent: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ displayPostContent && (\n\t\t\t\t\t<RadioControl\n\t\t\t\t\t\tlabel={ __( 'Show:' ) }\n\t\t\t\t\t\tselected={ displayPostContentRadio }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{ label: __( 'Excerpt' ), value: 'excerpt' },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Full post' ),\n\t\t\t\t\t\t\t\tvalue: 'full_post',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdisplayPostContentRadio: value,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ displayPostContent &&\n\t\t\t\t\tdisplayPostContentRadio === 'excerpt' && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Max number of words' ) }\n\t\t\t\t\t\t\tvalue={ excerptLength }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { excerptLength: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ MIN_EXCERPT_LENGTH }\n\t\t\t\t\t\t\tmax={ MAX_EXCERPT_LENGTH }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Post meta' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display author name' ) }\n\t\t\t\t\tchecked={ displayAuthor }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayAuthor: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display post date' ) }\n\t\t\t\t\tchecked={ displayPostDate }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayPostDate: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Featured image' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display featured image' ) }\n\t\t\t\t\tchecked={ displayFeaturedImage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayFeaturedImage: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ displayFeaturedImage && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ImageSizeControl\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tconst newAttrs = {};\n\t\t\t\t\t\t\t\tif ( value.hasOwnProperty( 'width' ) ) {\n\t\t\t\t\t\t\t\t\tnewAttrs.featuredImageSizeWidth =\n\t\t\t\t\t\t\t\t\t\tvalue.width;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( value.hasOwnProperty( 'height' ) ) {\n\t\t\t\t\t\t\t\t\tnewAttrs.featuredImageSizeHeight =\n\t\t\t\t\t\t\t\t\t\tvalue.height;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetAttributes( newAttrs );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tslug={ featuredImageSizeSlug }\n\t\t\t\t\t\t\twidth={ featuredImageSizeWidth }\n\t\t\t\t\t\t\theight={ featuredImageSizeHeight }\n\t\t\t\t\t\t\timageWidth={ defaultImageWidth }\n\t\t\t\t\t\t\timageHeight={ defaultImageHeight }\n\t\t\t\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t\t\t\t\timageSizeHelp={ __(\n\t\t\t\t\t\t\t\t'Select the size of the source image.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChangeImage={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeSlug: value,\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeWidth: undefined,\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeHeight: undefined,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BaseControl className=\"editor-latest-posts-image-alignment-control\">\n\t\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t\t{ __( 'Image alignment' ) }\n\t\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t\t<BlockAlignmentToolbar\n\t\t\t\t\t\t\t\tvalue={ featuredImageAlign }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tfeaturedImageAlign: value,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontrols={ [ 'left', 'center', 'right' ] }\n\t\t\t\t\t\t\t\tisCollapsed={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Add link to featured image' ) }\n\t\t\t\t\t\t\tchecked={ addLinkToFeaturedImage }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\taddLinkToFeaturedImage: value,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Sorting and filtering' ) }>\n\t\t\t\t<QueryControls\n\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\tnumberOfItems={ postsToShow }\n\t\t\t\t\tonOrderChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { order: value } )\n\t\t\t\t\t}\n\t\t\t\t\tonOrderByChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { orderBy: value } )\n\t\t\t\t\t}\n\t\t\t\t\tonNumberOfItemsChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { postsToShow: value } )\n\t\t\t\t\t}\n\t\t\t\t\tcategorySuggestions={ categorySuggestions }\n\t\t\t\t\tonCategoryChange={ selectCategories }\n\t\t\t\t\tselectedCategories={ categories }\n\t\t\t\t\tonAuthorChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tselectedAuthor:\n\t\t\t\t\t\t\t\t'' !== value ? Number( value ) : undefined,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tauthorList={ authorList ?? [] }\n\t\t\t\t\tselectedAuthorId={ selectedAuthor }\n\t\t\t\t/>\n\n\t\t\t\t{ postLayout === 'grid' && (\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\tvalue={ columns }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { columns: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t! hasPosts\n\t\t\t\t\t\t\t\t? MAX_POSTS_COLUMNS\n\t\t\t\t\t\t\t\t: Math.min(\n\t\t\t\t\t\t\t\t\t\tMAX_POSTS_COLUMNS,\n\t\t\t\t\t\t\t\t\t\tlatestPosts.length\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t'wp-block-latest-posts__list': true,\n\t\t\t'is-grid': postLayout === 'grid',\n\t\t\t'has-dates': displayPostDate,\n\t\t\t'has-author': displayAuthor,\n\t\t\t[ `columns-${ columns }` ]: postLayout === 'grid',\n\t\t} ),\n\t} );\n\n\tif ( ! hasPosts ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ inspectorControls }\n\t\t\t\t<Placeholder icon={ pin } label={ __( 'Latest Posts' ) }>\n\t\t\t\t\t{ ! Array.isArray( latestPosts ) ? (\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t__( 'No posts found.' )\n\t\t\t\t\t) }\n\t\t\t\t</Placeholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Removing posts from display should be instant.\n\tconst displayPosts =\n\t\tlatestPosts.length > postsToShow\n\t\t\t? latestPosts.slice( 0, postsToShow )\n\t\t\t: latestPosts;\n\n\tconst layoutControls = [\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: _x( 'List view', 'Latest posts block display setting' ),\n\t\t\tonClick: () => setAttributes( { postLayout: 'list' } ),\n\t\t\tisActive: postLayout === 'list',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: _x( 'Grid view', 'Latest posts block display setting' ),\n\t\t\tonClick: () => setAttributes( { postLayout: 'grid' } ),\n\t\t\tisActive: postLayout === 'grid',\n\t\t},\n\t];\n\n\tconst dateFormat = getSettings().formats.date;\n\n\treturn (\n\t\t<>\n\t\t\t{ inspectorControls }\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ layoutControls } />\n\t\t\t</BlockControls>\n\t\t\t<ul { ...blockProps }>\n\t\t\t\t{ displayPosts.map( ( post ) => {\n\t\t\t\t\tconst titleTrimmed = post.title.rendered.trim();\n\t\t\t\t\tlet excerpt = post.excerpt.rendered;\n\t\t\t\t\tconst currentAuthor = authorList?.find(\n\t\t\t\t\t\t( author ) => author.id === post.author\n\t\t\t\t\t);\n\n\t\t\t\t\tconst excerptElement = document.createElement( 'div' );\n\t\t\t\t\texcerptElement.innerHTML = excerpt;\n\n\t\t\t\t\texcerpt =\n\t\t\t\t\t\texcerptElement.textContent ||\n\t\t\t\t\t\texcerptElement.innerText ||\n\t\t\t\t\t\t'';\n\n\t\t\t\t\tconst { url: imageSourceUrl, alt: featuredImageAlt } =\n\t\t\t\t\t\tgetFeaturedImageDetails( post, featuredImageSizeSlug );\n\t\t\t\t\tconst imageClasses = clsx( {\n\t\t\t\t\t\t'wp-block-latest-posts__featured-image': true,\n\t\t\t\t\t\t[ `align${ featuredImageAlign }` ]:\n\t\t\t\t\t\t\t!! featuredImageAlign,\n\t\t\t\t\t} );\n\t\t\t\t\tconst renderFeaturedImage =\n\t\t\t\t\t\tdisplayFeaturedImage && imageSourceUrl;\n\t\t\t\t\tconst featuredImage = renderFeaturedImage && (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={ imageSourceUrl }\n\t\t\t\t\t\t\talt={ featuredImageAlt }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmaxWidth: featuredImageSizeWidth,\n\t\t\t\t\t\t\t\tmaxHeight: featuredImageSizeHeight,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\n\t\t\t\t\tconst needsReadMore =\n\t\t\t\t\t\texcerptLength < excerpt.trim().split( ' ' ).length &&\n\t\t\t\t\t\tpost.excerpt.raw === '';\n\n\t\t\t\t\tconst postExcerpt = needsReadMore ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ excerpt\n\t\t\t\t\t\t\t\t.trim()\n\t\t\t\t\t\t\t\t.split( ' ', excerptLength )\n\t\t\t\t\t\t\t\t.join( ' ' ) }\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: Hidden accessibility text: Post title */\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'… <a>Read more<span>: %1$s</span></a>'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\ttitleTrimmed || __( '(no title)' )\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/anchor-has-content\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__read-more\"\n\t\t\t\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\tshowRedirectionPreventedNotice\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t\t\t<span className=\"screen-reader-text\" />\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\texcerpt\n\t\t\t\t\t);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li key={ post.id }>\n\t\t\t\t\t\t\t{ renderFeaturedImage && (\n\t\t\t\t\t\t\t\t<div className={ imageClasses }>\n\t\t\t\t\t\t\t\t\t{ addLinkToFeaturedImage ? (\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\tshowRedirectionPreventedNotice\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ featuredImage }\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\tfeaturedImage\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-title\"\n\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={\n\t\t\t\t\t\t\t\t\t!! titleTrimmed\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t__html: titleTrimmed,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ showRedirectionPreventedNotice }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ! titleTrimmed ? __( '(no title)' ) : null }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{ displayAuthor && currentAuthor && (\n\t\t\t\t\t\t\t\t<div className=\"wp-block-latest-posts__post-author\">\n\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: byline. %s: current author. */\n\t\t\t\t\t\t\t\t\t\t__( 'by %s' ),\n\t\t\t\t\t\t\t\t\t\tcurrentAuthor.name\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostDate && post.date_gmt && (\n\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\tdateTime={ format( 'c', post.date_gmt ) }\n\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-date\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ dateI18n( dateFormat, post.date_gmt ) }\n\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostContent &&\n\t\t\t\t\t\t\t\tdisplayPostContentRadio === 'excerpt' && (\n\t\t\t\t\t\t\t\t\t<div className=\"wp-block-latest-posts__post-excerpt\">\n\t\t\t\t\t\t\t\t\t\t{ postExcerpt }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostContent &&\n\t\t\t\t\t\t\t\tdisplayPostContentRadio === 'full_post' && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-full-content\"\n\t\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t\t\t\t__html: post.content.raw.trim(),\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAWA,IAAAE,KAA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AAI,CAACuM,QAAS,CAAG;YACzC3E,SAAS,EAAC,kCAAkC;YAAA3B,QAAA,EAE1C,IAAAyG,cAAQ,EAAE3C,UAAU,EAAE/J,IAAI,CAACuM,QAAS;UAAC,CAClC,CACN,EACC/K,kBAAkB,IACnBD,uBAAuB,KAAK,SAAS,iBACpC,IAAA9B,WAAA,CAAA2G,GAAA;YAAKwB,SAAS,EAAC,qCAAqC;YAAA3B,QAAA,EACjD2F;UAAW,CACT,CACL,EACApK,kBAAkB,IACnBD,uBAAuB,KAAK,WAAW,iBACtC,IAAA9B,WAAA,CAAA2G,GAAA;YACCwB,SAAS,EAAC,0CAA0C;YACpDyE,uBAAuB,EAAG;cACzBC,MAAM,EAAEtM,IAAI,CAAC2M,OAAO,CAAChB,GAAG,CAACrB,IAAI,CAAC;YAC/B;UAAG,CACH,CACD;QAAA,GAhEOtK,IAAI,CAACuD,EAiEX,CAAC;MAEP,CAAE;IAAC,CACA,CAAC;EAAA,CACJ,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_date","_blockEditor","_data","_icons","_coreData","_notices","_compose","_element","_constants","_jsxRuntime","CATEGORIES_LIST_QUERY","per_page","context","USERS_LIST_QUERY","has_published_posts","getFeaturedImageDetails","post","size","_image$media_details$","image","_embedded","url","media_details","sizes","source_url","alt","alt_text","LatestPostsEdit","attributes","setAttributes","_categoriesList$reduc","instanceId","useInstanceId","postsToShow","order","orderBy","categories","selectedAuthor","displayFeaturedImage","displayPostContentRadio","displayPostContent","displayPostDate","displayAuthor","postLayout","columns","excerptLength","featuredImageAlign","featuredImageSizeSlug","featuredImageSizeWidth","featuredImageSizeHeight","addLinkToFeaturedImage","imageSizes","latestPosts","defaultImageWidth","defaultImageHeight","categoriesList","authorList","useSelect","select","_settings$imageDimens","_settings$imageDimens2","getEntityRecords","getUsers","coreStore","settings","blockEditorStore","getSettings","catIds","length","map","cat","id","latestPostsQuery","Object","fromEntries","entries","author","orderby","_embed","filter","value","imageDimensions","width","height","createWarningNotice","removeNotice","useDispatch","noticeStore","noticeId","showRedirectionPreventedNotice","event","preventDefault","__","type","imageSizeOptions","slug","name","label","categorySuggestions","reduce","accumulator","category","selectCategories","tokens","hasNoSuggestion","some","token","allCategories","includes","imageAlignmentOptions","icon","alignNone","positionLeft","positionCenter","positionRight","hasPosts","inspectorControls","jsxs","InspectorControls","children","PanelBody","title","jsx","ToggleControl","__nextHasNoMarginBottom","checked","onChange","RadioControl","className","selected","options","RangeControl","__next40pxDefaultSize","min","MIN_EXCERPT_LENGTH","max","MAX_EXCERPT_LENGTH","Fragment","__experimentalImageSizeControl","newAttrs","hasOwnProperty","imageWidth","imageHeight","imageSizeHelp","onChangeImage","undefined","__experimentalToggleGroupControl","__experimentalToggleGroupControlOptionIcon","QueryControls","numberOfItems","onOrderChange","onOrderByChange","onNumberOfItemsChange","onCategoryChange","selectedCategories","onAuthorChange","Number","selectedAuthorId","MAX_POSTS_COLUMNS","Math","required","blockProps","useBlockProps","clsx","Placeholder","pin","Array","isArray","Spinner","displayPosts","slice","layoutControls","list","_x","onClick","isActive","grid","dateFormat","formats","date","BlockControls","ToolbarGroup","controls","titleTrimmed","rendered","trim","excerpt","currentAuthor","find","excerptElement","document","createElement","innerHTML","textContent","innerText","imageSourceUrl","featuredImageAlt","imageClasses","renderFeaturedImage","featuredImage","src","style","maxWidth","maxHeight","needsReadMore","split","raw","postExcerpt","join","createInterpolateElement","sprintf","a","href","link","rel","span","dangerouslySetInnerHTML","__html","date_gmt","dateTime","format","dateI18n","content"],"sources":["@wordpress/block-library/src/latest-posts/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tPlaceholder,\n\tQueryControls,\n\tRadioControl,\n\tRangeControl,\n\tSpinner,\n\tToggleControl,\n\tToolbarGroup,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { dateI18n, format, getSettings } from '@wordpress/date';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\t__experimentalImageSizeControl as ImageSizeControl,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tpin,\n\tlist,\n\tgrid,\n\talignNone,\n\tpositionLeft,\n\tpositionCenter,\n\tpositionRight,\n} from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticeStore } from '@wordpress/notices';\nimport { useInstanceId } from '@wordpress/compose';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMIN_EXCERPT_LENGTH,\n\tMAX_EXCERPT_LENGTH,\n\tMAX_POSTS_COLUMNS,\n} from './constants';\n\n/**\n * Module Constants\n */\nconst CATEGORIES_LIST_QUERY = {\n\tper_page: -1,\n\tcontext: 'view',\n};\nconst USERS_LIST_QUERY = {\n\tper_page: -1,\n\thas_published_posts: [ 'post' ],\n\tcontext: 'view',\n};\n\nfunction getFeaturedImageDetails( post, size ) {\n\tconst image = post._embedded?.[ 'wp:featuredmedia' ]?.[ '0' ];\n\n\treturn {\n\t\turl:\n\t\t\timage?.media_details?.sizes?.[ size ]?.source_url ??\n\t\t\timage?.source_url,\n\t\talt: image?.alt_text,\n\t};\n}\n\nexport default function LatestPostsEdit( { attributes, setAttributes } ) {\n\tconst instanceId = useInstanceId( LatestPostsEdit );\n\tconst {\n\t\tpostsToShow,\n\t\torder,\n\t\torderBy,\n\t\tcategories,\n\t\tselectedAuthor,\n\t\tdisplayFeaturedImage,\n\t\tdisplayPostContentRadio,\n\t\tdisplayPostContent,\n\t\tdisplayPostDate,\n\t\tdisplayAuthor,\n\t\tpostLayout,\n\t\tcolumns,\n\t\texcerptLength,\n\t\tfeaturedImageAlign,\n\t\tfeaturedImageSizeSlug,\n\t\tfeaturedImageSizeWidth,\n\t\tfeaturedImageSizeHeight,\n\t\taddLinkToFeaturedImage,\n\t} = attributes;\n\tconst {\n\t\timageSizes,\n\t\tlatestPosts,\n\t\tdefaultImageWidth,\n\t\tdefaultImageHeight,\n\t\tcategoriesList,\n\t\tauthorList,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getUsers } = select( coreStore );\n\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\t\tconst catIds =\n\t\t\t\tcategories && categories.length > 0\n\t\t\t\t\t? categories.map( ( cat ) => cat.id )\n\t\t\t\t\t: [];\n\t\t\tconst latestPostsQuery = Object.fromEntries(\n\t\t\t\tObject.entries( {\n\t\t\t\t\tcategories: catIds,\n\t\t\t\t\tauthor: selectedAuthor,\n\t\t\t\t\torder,\n\t\t\t\t\torderby: orderBy,\n\t\t\t\t\tper_page: postsToShow,\n\t\t\t\t\t_embed: 'wp:featuredmedia',\n\t\t\t\t} ).filter( ( [ , value ] ) => typeof value !== 'undefined' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tdefaultImageWidth:\n\t\t\t\t\tsettings.imageDimensions?.[ featuredImageSizeSlug ]\n\t\t\t\t\t\t?.width ?? 0,\n\t\t\t\tdefaultImageHeight:\n\t\t\t\t\tsettings.imageDimensions?.[ featuredImageSizeSlug ]\n\t\t\t\t\t\t?.height ?? 0,\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tlatestPosts: getEntityRecords(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'post',\n\t\t\t\t\tlatestPostsQuery\n\t\t\t\t),\n\t\t\t\tcategoriesList: getEntityRecords(\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\t'category',\n\t\t\t\t\tCATEGORIES_LIST_QUERY\n\t\t\t\t),\n\t\t\t\tauthorList: getUsers( USERS_LIST_QUERY ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tfeaturedImageSizeSlug,\n\t\t\tpostsToShow,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tcategories,\n\t\t\tselectedAuthor,\n\t\t]\n\t);\n\n\t// If a user clicks to a link prevent redirection and show a warning.\n\tconst { createWarningNotice, removeNotice } = useDispatch( noticeStore );\n\tlet noticeId;\n\tconst showRedirectionPreventedNotice = ( event ) => {\n\t\tevent.preventDefault();\n\t\t// Remove previous warning if any, to show one at a time per block.\n\t\tremoveNotice( noticeId );\n\t\tnoticeId = `block-library/core/latest-posts/redirection-prevented/${ instanceId }`;\n\t\tcreateWarningNotice( __( 'Links are disabled in the editor.' ), {\n\t\t\tid: noticeId,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => slug !== 'full' )\n\t\t.map( ( { name, slug } ) => ( {\n\t\t\tvalue: slug,\n\t\t\tlabel: name,\n\t\t} ) );\n\tconst categorySuggestions =\n\t\tcategoriesList?.reduce(\n\t\t\t( accumulator, category ) => ( {\n\t\t\t\t...accumulator,\n\t\t\t\t[ category.name ]: category,\n\t\t\t} ),\n\t\t\t{}\n\t\t) ?? {};\n\tconst selectCategories = ( tokens ) => {\n\t\tconst hasNoSuggestion = tokens.some(\n\t\t\t( token ) =>\n\t\t\t\ttypeof token === 'string' && ! categorySuggestions[ token ]\n\t\t);\n\t\tif ( hasNoSuggestion ) {\n\t\t\treturn;\n\t\t}\n\t\t// Categories that are already will be objects, while new additions will be strings (the name).\n\t\t// allCategories nomalizes the array so that they are all objects.\n\t\tconst allCategories = tokens.map( ( token ) => {\n\t\t\treturn typeof token === 'string'\n\t\t\t\t? categorySuggestions[ token ]\n\t\t\t\t: token;\n\t\t} );\n\t\t// We do nothing if the category is not selected\n\t\t// from suggestions.\n\t\tif ( allCategories.includes( null ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tsetAttributes( { categories: allCategories } );\n\t};\n\n\tconst imageAlignmentOptions = [\n\t\t{\n\t\t\tvalue: 'none',\n\t\t\ticon: alignNone,\n\t\t\tlabel: __( 'None' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'left',\n\t\t\ticon: positionLeft,\n\t\t\tlabel: __( 'Left' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'center',\n\t\t\ticon: positionCenter,\n\t\t\tlabel: __( 'Center' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'right',\n\t\t\ticon: positionRight,\n\t\t\tlabel: __( 'Right' ),\n\t\t},\n\t];\n\n\tconst hasPosts = !! latestPosts?.length;\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Post content' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Post content' ) }\n\t\t\t\t\tchecked={ displayPostContent }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayPostContent: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ displayPostContent && (\n\t\t\t\t\t<RadioControl\n\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-content-radio\"\n\t\t\t\t\t\tlabel={ __( 'Show:' ) }\n\t\t\t\t\t\tselected={ displayPostContentRadio }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{ label: __( 'Excerpt' ), value: 'excerpt' },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Full post' ),\n\t\t\t\t\t\t\t\tvalue: 'full_post',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdisplayPostContentRadio: value,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ displayPostContent &&\n\t\t\t\t\tdisplayPostContentRadio === 'excerpt' && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Max number of words' ) }\n\t\t\t\t\t\t\tvalue={ excerptLength }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { excerptLength: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ MIN_EXCERPT_LENGTH }\n\t\t\t\t\t\t\tmax={ MAX_EXCERPT_LENGTH }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Post meta' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display author name' ) }\n\t\t\t\t\tchecked={ displayAuthor }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayAuthor: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display post date' ) }\n\t\t\t\t\tchecked={ displayPostDate }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayPostDate: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Featured image' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display featured image' ) }\n\t\t\t\t\tchecked={ displayFeaturedImage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayFeaturedImage: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ displayFeaturedImage && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ImageSizeControl\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tconst newAttrs = {};\n\t\t\t\t\t\t\t\tif ( value.hasOwnProperty( 'width' ) ) {\n\t\t\t\t\t\t\t\t\tnewAttrs.featuredImageSizeWidth =\n\t\t\t\t\t\t\t\t\t\tvalue.width;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( value.hasOwnProperty( 'height' ) ) {\n\t\t\t\t\t\t\t\t\tnewAttrs.featuredImageSizeHeight =\n\t\t\t\t\t\t\t\t\t\tvalue.height;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetAttributes( newAttrs );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tslug={ featuredImageSizeSlug }\n\t\t\t\t\t\t\twidth={ featuredImageSizeWidth }\n\t\t\t\t\t\t\theight={ featuredImageSizeHeight }\n\t\t\t\t\t\t\timageWidth={ defaultImageWidth }\n\t\t\t\t\t\t\timageHeight={ defaultImageHeight }\n\t\t\t\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t\t\t\t\timageSizeHelp={ __(\n\t\t\t\t\t\t\t\t'Select the size of the source image.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChangeImage={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeSlug: value,\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeWidth: undefined,\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeHeight: undefined,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\tclassName=\"editor-latest-posts-image-alignment-control\"\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Image alignment' ) }\n\t\t\t\t\t\t\tvalue={ featuredImageAlign || 'none' }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tfeaturedImageAlign:\n\t\t\t\t\t\t\t\t\t\tvalue !== 'none' ? value : undefined,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ imageAlignmentOptions.map(\n\t\t\t\t\t\t\t\t( { value, icon, label } ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Add link to featured image' ) }\n\t\t\t\t\t\t\tchecked={ addLinkToFeaturedImage }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\taddLinkToFeaturedImage: value,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Sorting and filtering' ) }>\n\t\t\t\t<QueryControls\n\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\tnumberOfItems={ postsToShow }\n\t\t\t\t\tonOrderChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { order: value } )\n\t\t\t\t\t}\n\t\t\t\t\tonOrderByChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { orderBy: value } )\n\t\t\t\t\t}\n\t\t\t\t\tonNumberOfItemsChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { postsToShow: value } )\n\t\t\t\t\t}\n\t\t\t\t\tcategorySuggestions={ categorySuggestions }\n\t\t\t\t\tonCategoryChange={ selectCategories }\n\t\t\t\t\tselectedCategories={ categories }\n\t\t\t\t\tonAuthorChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tselectedAuthor:\n\t\t\t\t\t\t\t\t'' !== value ? Number( value ) : undefined,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tauthorList={ authorList ?? [] }\n\t\t\t\t\tselectedAuthorId={ selectedAuthor }\n\t\t\t\t/>\n\n\t\t\t\t{ postLayout === 'grid' && (\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\tvalue={ columns }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { columns: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t! hasPosts\n\t\t\t\t\t\t\t\t? MAX_POSTS_COLUMNS\n\t\t\t\t\t\t\t\t: Math.min(\n\t\t\t\t\t\t\t\t\t\tMAX_POSTS_COLUMNS,\n\t\t\t\t\t\t\t\t\t\tlatestPosts.length\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t'wp-block-latest-posts__list': true,\n\t\t\t'is-grid': postLayout === 'grid',\n\t\t\t'has-dates': displayPostDate,\n\t\t\t'has-author': displayAuthor,\n\t\t\t[ `columns-${ columns }` ]: postLayout === 'grid',\n\t\t} ),\n\t} );\n\n\tif ( ! hasPosts ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ inspectorControls }\n\t\t\t\t<Placeholder icon={ pin } label={ __( 'Latest Posts' ) }>\n\t\t\t\t\t{ ! Array.isArray( latestPosts ) ? (\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t__( 'No posts found.' )\n\t\t\t\t\t) }\n\t\t\t\t</Placeholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Removing posts from display should be instant.\n\tconst displayPosts =\n\t\tlatestPosts.length > postsToShow\n\t\t\t? latestPosts.slice( 0, postsToShow )\n\t\t\t: latestPosts;\n\n\tconst layoutControls = [\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: _x( 'List view', 'Latest posts block display setting' ),\n\t\t\tonClick: () => setAttributes( { postLayout: 'list' } ),\n\t\t\tisActive: postLayout === 'list',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: _x( 'Grid view', 'Latest posts block display setting' ),\n\t\t\tonClick: () => setAttributes( { postLayout: 'grid' } ),\n\t\t\tisActive: postLayout === 'grid',\n\t\t},\n\t];\n\n\tconst dateFormat = getSettings().formats.date;\n\n\treturn (\n\t\t<>\n\t\t\t{ inspectorControls }\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ layoutControls } />\n\t\t\t</BlockControls>\n\t\t\t<ul { ...blockProps }>\n\t\t\t\t{ displayPosts.map( ( post ) => {\n\t\t\t\t\tconst titleTrimmed = post.title.rendered.trim();\n\t\t\t\t\tlet excerpt = post.excerpt.rendered;\n\t\t\t\t\tconst currentAuthor = authorList?.find(\n\t\t\t\t\t\t( author ) => author.id === post.author\n\t\t\t\t\t);\n\n\t\t\t\t\tconst excerptElement = document.createElement( 'div' );\n\t\t\t\t\texcerptElement.innerHTML = excerpt;\n\n\t\t\t\t\texcerpt =\n\t\t\t\t\t\texcerptElement.textContent ||\n\t\t\t\t\t\texcerptElement.innerText ||\n\t\t\t\t\t\t'';\n\n\t\t\t\t\tconst { url: imageSourceUrl, alt: featuredImageAlt } =\n\t\t\t\t\t\tgetFeaturedImageDetails( post, featuredImageSizeSlug );\n\t\t\t\t\tconst imageClasses = clsx( {\n\t\t\t\t\t\t'wp-block-latest-posts__featured-image': true,\n\t\t\t\t\t\t[ `align${ featuredImageAlign }` ]:\n\t\t\t\t\t\t\t!! featuredImageAlign,\n\t\t\t\t\t} );\n\t\t\t\t\tconst renderFeaturedImage =\n\t\t\t\t\t\tdisplayFeaturedImage && imageSourceUrl;\n\t\t\t\t\tconst featuredImage = renderFeaturedImage && (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={ imageSourceUrl }\n\t\t\t\t\t\t\talt={ featuredImageAlt }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmaxWidth: featuredImageSizeWidth,\n\t\t\t\t\t\t\t\tmaxHeight: featuredImageSizeHeight,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\n\t\t\t\t\tconst needsReadMore =\n\t\t\t\t\t\texcerptLength < excerpt.trim().split( ' ' ).length &&\n\t\t\t\t\t\tpost.excerpt.raw === '';\n\n\t\t\t\t\tconst postExcerpt = needsReadMore ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ excerpt\n\t\t\t\t\t\t\t\t.trim()\n\t\t\t\t\t\t\t\t.split( ' ', excerptLength )\n\t\t\t\t\t\t\t\t.join( ' ' ) }\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: Hidden accessibility text: Post title */\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'… <a>Read more<span>: %1$s</span></a>'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\ttitleTrimmed || __( '(no title)' )\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/anchor-has-content\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__read-more\"\n\t\t\t\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\tshowRedirectionPreventedNotice\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t\t\t<span className=\"screen-reader-text\" />\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\texcerpt\n\t\t\t\t\t);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li key={ post.id }>\n\t\t\t\t\t\t\t{ renderFeaturedImage && (\n\t\t\t\t\t\t\t\t<div className={ imageClasses }>\n\t\t\t\t\t\t\t\t\t{ addLinkToFeaturedImage ? (\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\tshowRedirectionPreventedNotice\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ featuredImage }\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\tfeaturedImage\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-title\"\n\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={\n\t\t\t\t\t\t\t\t\t!! titleTrimmed\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t__html: titleTrimmed,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ showRedirectionPreventedNotice }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ! titleTrimmed ? __( '(no title)' ) : null }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{ displayAuthor && currentAuthor && (\n\t\t\t\t\t\t\t\t<div className=\"wp-block-latest-posts__post-author\">\n\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: byline. %s: current author. */\n\t\t\t\t\t\t\t\t\t\t__( 'by %s' ),\n\t\t\t\t\t\t\t\t\t\tcurrentAuthor.name\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostDate && post.date_gmt && (\n\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\tdateTime={ format( 'c', post.date_gmt ) }\n\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-date\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ dateI18n( dateFormat, post.date_gmt ) }\n\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostContent &&\n\t\t\t\t\t\t\t\tdisplayPostContentRadio === 'excerpt' && (\n\t\t\t\t\t\t\t\t\t<div className=\"wp-block-latest-posts__post-excerpt\">\n\t\t\t\t\t\t\t\t\t\t{ postExcerpt }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostContent &&\n\t\t\t\t\t\t\t\tdisplayPostContentRadio === 'full_post' && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-full-content\"\n\t\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t\t\t\t__html: post.content.raw.trim(),\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAYA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAOA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AASA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAX,OAAA;AAIqB,IAAAY,WAAA,GAAAZ,OAAA;AAnDrB;AACA;AACA;;AAGA;AACA;AACA;;AAqCA;AACA;AACA;;AAOA;AACA;AACA,GACA,MAAMa,qBAAqB,GAAG;EAC7BC,QAAQ,EAAE,CAAC,CAAC;EACZC,OAAO,EAAE;AACV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AAE,OAAQ,CAAC,EACb+F,aAAa,CAAC3F,IACf;UAAC,CACG,CACL,EACCvD,eAAe,IAAIzB,IAAI,CAAC0M,QAAQ,iBACjC,IAAAjN,WAAA,CAAAiH,GAAA;YACCiG,QAAQ,EAAG,IAAAC,YAAM,EAAE,GAAG,EAAE5M,IAAI,CAAC0M,QAAS,CAAG;YACzC1F,SAAS,EAAC,kCAAkC;YAAAT,QAAA,EAE1C,IAAAsG,cAAQ,EAAE5C,UAAU,EAAEjK,IAAI,CAAC0M,QAAS;UAAC,CAClC,CACN,EACClL,kBAAkB,IACnBD,uBAAuB,KAAK,SAAS,iBACpC,IAAA9B,WAAA,CAAAiH,GAAA;YAAKM,SAAS,EAAC,qCAAqC;YAAAT,QAAA,EACjDwF;UAAW,CACT,CACL,EACAvK,kBAAkB,IACnBD,uBAAuB,KAAK,WAAW,iBACtC,IAAA9B,WAAA,CAAAiH,GAAA;YACCM,SAAS,EAAC,0CAA0C;YACpDwF,uBAAuB,EAAG;cACzBC,MAAM,EAAEzM,IAAI,CAAC8M,OAAO,CAAChB,GAAG,CAACrB,IAAI,CAAC;YAC/B;UAAG,CACH,CACD;QAAA,GAhEOzK,IAAI,CAACuD,EAiEX,CAAC;MAEP,CAAE;IAAC,CACA,CAAC;EAAA,CACJ,CAAC;AAEL","ignoreList":[]}
@@ -25,7 +25,7 @@ const metadata = exports.metadata = {
25
25
  title: "List",
26
26
  category: "text",
27
27
  allowedBlocks: ["core/list-item"],
28
- description: "Create a bulleted or numbered list.",
28
+ description: "An organized collection of items displayed in a specific order.",
29
29
  keywords: ["bullet list", "ordered list", "numbered list"],
30
30
  textdomain: "default",
31
31
  attributes: {
@@ -59,6 +59,12 @@ const metadata = exports.metadata = {
59
59
  supports: {
60
60
  anchor: true,
61
61
  html: false,
62
+ __experimentalBorder: {
63
+ color: true,
64
+ radius: true,
65
+ style: true,
66
+ width: true
67
+ },
62
68
  typography: {
63
69
  fontSize: true,
64
70
  lineHeight: true,
@@ -95,6 +101,9 @@ const metadata = exports.metadata = {
95
101
  clientNavigation: true
96
102
  }
97
103
  },
104
+ selectors: {
105
+ border: ".wp-block-list:not(.wp-block-list .wp-block-list)"
106
+ },
98
107
  editorStyle: "wp-block-list-editor",
99
108
  style: "wp-block-list"
100
109
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","allowedBlocks","description","keywords","textdomain","attributes","ordered","type","__experimentalRole","values","source","selector","multiline","__unstableMultilineWrapperTags","start","reversed","placeholder","supports","anchor","html","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","color","gradients","link","background","text","spacing","margin","padding","__unstablePasteTextInline","__experimentalOnMerge","__experimentalSlashInserter","interactivity","clientNavigation","editorStyle","style","settings","icon","example","innerBlocks","content","__","transforms","edit","save","deprecated","init","initBlock"],"sources":["@wordpress/block-library/src/list/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { list as icon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nconst settings = {\n\ticon,\n\texample: {\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/list-item',\n\t\t\t\tattributes: { content: __( 'Alice.' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/list-item',\n\t\t\t\tattributes: { content: __( 'The White Rabbit.' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/list-item',\n\t\t\t\tattributes: { content: __( 'The Cheshire Cat.' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/list-item',\n\t\t\t\tattributes: { content: __( 'The Mad Hatter.' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/list-item',\n\t\t\t\tattributes: { content: __( 'The Queen of Hearts.' ) },\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport { settings };\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,KAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,WAAA,GAAAJ,sBAAA,CAAAH,OAAA;AAdA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAQ,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,aAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,OAAA;MAAAC,IAAA;MAAA;MAAAC,kBAAA;IAAA;IAAAC,MAAA;MAAAF,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAC,SAAA;MAAAC,8BAAA;MAAA;MAAAL,kBAAA;IAAA;IAAAD,IAAA;MAAAA,IAAA;IAAA;IAAAO,KAAA;MAAAP,IAAA;IAAA;IAAAQ,QAAA;MAAAR,IAAA;IAAA;IAAAS,WAAA;MAAAT,IAAA;IAAA;EAAA;EAAAU,QAAA;IAAAC,MAAA;IAAAC,IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BA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,UAAU,EAAVA;AACD,CAAC;AAIM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE1D,IAAI;EAAEJ,QAAQ;EAAEmD;AAAS,CAAE,CAAC;AAAClD,OAAA,CAAA4D,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","allowedBlocks","description","keywords","textdomain","attributes","ordered","type","__experimentalRole","values","source","selector","multiline","__unstableMultilineWrapperTags","start","reversed","placeholder","supports","anchor","html","__experimentalBorder","color","radius","style","width","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","gradients","link","background","text","spacing","margin","padding","__unstablePasteTextInline","__experimentalOnMerge","__experimentalSlashInserter","interactivity","clientNavigation","selectors","border","editorStyle","settings","icon","example","innerBlocks","content","__","transforms","edit","save","deprecated","init","initBlock"],"sources":["@wordpress/block-library/src/list/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { list as icon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nconst settings = {\n\ticon,\n\texample: {\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/list-item',\n\t\t\t\tattributes: { content: __( 'Alice.' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/list-item',\n\t\t\t\tattributes: { content: __( 'The White Rabbit.' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/list-item',\n\t\t\t\tattributes: { content: __( 'The Cheshire Cat.' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/list-item',\n\t\t\t\tattributes: { content: __( 'The Mad Hatter.' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/list-item',\n\t\t\t\tattributes: { content: __( 'The Queen of Hearts.' ) },\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport { settings };\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,KAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,WAAA,GAAAJ,sBAAA,CAAAH,OAAA;AAdA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAQ,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,aAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,OAAA;MAAAC,IAAA;MAAA;MAAAC,kBAAA;IAAA;IAAAC,MAAA;MAAAF,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAC,SAAA;MAAAC,8BAAA;MAAA;MAAAL,kBAAA;IAAA;IAAAD,IAAA;MAAAA,IAAA;IAAA;IAAAO,KAAA;MAAAP,IAAA;IAAA;IAAAQ,QAAA;MAAAR,IAAA;IAAA;IAAAS,WAAA;MAAAT,IAAA;IAAA;EAAA;EAAAU,QAAA;IAAAC,MAAA;IAAAC,IAAA;IAAAC,oBAAA;MAAAC,KAAA;MAAAC,MAAA;MAAAC,KAAA;MAAAC,KAAA;IAAA;IAAAC,UAAA;MAAAC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AAAC,QAAE,EAAE,sBAAuB;MAAE;IACrD,CAAC;EAEH,CAAC;EACDC,UAAU,EAAVA,mBAAU;EACVC,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA;AACD,CAAC;AAIM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE/D,IAAI;EAAEJ,QAAQ;EAAEwD;AAAS,CAAE,CAAC;AAACvD,OAAA,CAAAiE,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -20,23 +20,10 @@ const OrderedListSettings = ({
20
20
  }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
21
21
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.PanelBody, {
22
22
  title: (0, _i18n.__)('Settings'),
23
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
23
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
24
+ __next40pxDefaultSize: true,
24
25
  __nextHasNoMarginBottom: true,
25
- label: (0, _i18n.__)('Start value'),
26
- type: "number",
27
- onChange: value => {
28
- const int = parseInt(value, 10);
29
- setAttributes({
30
- // It should be possible to unset the value,
31
- // e.g. with an empty string.
32
- start: isNaN(int) ? undefined : int
33
- });
34
- },
35
- value: Number.isInteger(start) ? start.toString(10) : '',
36
- step: "1"
37
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
38
- __nextHasNoMarginBottom: true,
39
- label: (0, _i18n.__)('Numbering style'),
26
+ label: (0, _i18n.__)('List style'),
40
27
  options: [{
41
28
  label: (0, _i18n.__)('Numbers'),
42
29
  value: 'decimal'
@@ -57,9 +44,24 @@ const OrderedListSettings = ({
57
44
  onChange: newValue => setAttributes({
58
45
  type: newValue
59
46
  })
47
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
48
+ __next40pxDefaultSize: true,
49
+ __nextHasNoMarginBottom: true,
50
+ label: (0, _i18n.__)('Start value'),
51
+ type: "number",
52
+ onChange: value => {
53
+ const int = parseInt(value, 10);
54
+ setAttributes({
55
+ // It should be possible to unset the value,
56
+ // e.g. with an empty string.
57
+ start: isNaN(int) ? undefined : int
58
+ });
59
+ },
60
+ value: Number.isInteger(start) ? start.toString(10) : '',
61
+ step: "1"
60
62
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
61
63
  __nextHasNoMarginBottom: true,
62
- label: (0, _i18n.__)('Reverse list numbering'),
64
+ label: (0, _i18n.__)('Reverse order'),
63
65
  checked: reversed || false,
64
66
  onChange: value => {
65
67
  setAttributes({