@wordpress/block-library 9.17.0 → 9.19.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 (554) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/archives/index.js +9 -0
  3. package/build/archives/index.js.map +1 -1
  4. package/build/avatar/user-control.js +0 -1
  5. package/build/avatar/user-control.js.map +1 -1
  6. package/build/block/deprecated.js +0 -1
  7. package/build/block/deprecated.js.map +1 -1
  8. package/build/block/edit.js +0 -1
  9. package/build/block/edit.js.map +1 -1
  10. package/build/button/deprecated.js +0 -1
  11. package/build/button/deprecated.js.map +1 -1
  12. package/build/buttons/transforms.js +0 -1
  13. package/build/buttons/transforms.js.map +1 -1
  14. package/build/categories/edit.js +0 -1
  15. package/build/categories/edit.js.map +1 -1
  16. package/build/categories/index.js +9 -0
  17. package/build/categories/index.js.map +1 -1
  18. package/build/column/column-preview.native.js +0 -1
  19. package/build/column/column-preview.native.js.map +1 -1
  20. package/build/columns/columnCalculations.native.js +0 -1
  21. package/build/columns/columnCalculations.native.js.map +1 -1
  22. package/build/columns/deprecated.js +0 -1
  23. package/build/columns/deprecated.js.map +1 -1
  24. package/build/columns/edit.js +0 -1
  25. package/build/columns/edit.js.map +1 -1
  26. package/build/columns/edit.native.js +0 -1
  27. package/build/columns/edit.native.js.map +1 -1
  28. package/build/columns/transforms.js +0 -1
  29. package/build/columns/transforms.js.map +1 -1
  30. package/build/columns/utils.js +0 -1
  31. package/build/columns/utils.js.map +1 -1
  32. package/build/comment-template/edit.js +0 -1
  33. package/build/comment-template/edit.js.map +1 -1
  34. package/build/comment-template/hooks.js +0 -1
  35. package/build/comment-template/hooks.js.map +1 -1
  36. package/build/comment-template/util.js +0 -1
  37. package/build/comment-template/util.js.map +1 -1
  38. package/build/cover/edit/index.js +3 -1
  39. package/build/cover/edit/index.js.map +1 -1
  40. package/build/details/transforms.js +0 -1
  41. package/build/details/transforms.js.map +1 -1
  42. package/build/embed/embed-placeholder.native.js +0 -1
  43. package/build/embed/embed-placeholder.native.js.map +1 -1
  44. package/build/embed/util.js +0 -1
  45. package/build/embed/util.js.map +1 -1
  46. package/build/embed/variations.js +0 -1
  47. package/build/embed/variations.js.map +1 -1
  48. package/build/embed/wp-embed-preview.js +0 -1
  49. package/build/embed/wp-embed-preview.js.map +1 -1
  50. package/build/file/transforms.js +0 -1
  51. package/build/file/transforms.js.map +1 -1
  52. package/build/footnotes/edit.js +0 -1
  53. package/build/footnotes/edit.js.map +1 -1
  54. package/build/form/edit.js +4 -2
  55. package/build/form/edit.js.map +1 -1
  56. package/build/freeform/modal.js +0 -1
  57. package/build/freeform/modal.js.map +1 -1
  58. package/build/gallery/deprecated.js +0 -1
  59. package/build/gallery/deprecated.js.map +1 -1
  60. package/build/gallery/edit.js +0 -1
  61. package/build/gallery/edit.js.map +1 -1
  62. package/build/gallery/shared.js +0 -1
  63. package/build/gallery/shared.js.map +1 -1
  64. package/build/gallery/transforms.js +0 -1
  65. package/build/gallery/transforms.js.map +1 -1
  66. package/build/gallery/use-get-media.js +0 -1
  67. package/build/gallery/use-get-media.js.map +1 -1
  68. package/build/gallery/use-get-media.native.js +0 -1
  69. package/build/gallery/use-get-media.native.js.map +1 -1
  70. package/build/gallery/use-get-new-images.js +0 -1
  71. package/build/gallery/use-get-new-images.js.map +1 -1
  72. package/build/gallery/use-image-sizes.js +0 -1
  73. package/build/gallery/use-image-sizes.js.map +1 -1
  74. package/build/group/placeholder.js +0 -1
  75. package/build/group/placeholder.js.map +1 -1
  76. package/build/group/transforms.js +0 -1
  77. package/build/group/transforms.js.map +1 -1
  78. package/build/heading/transforms.js +0 -1
  79. package/build/heading/transforms.js.map +1 -1
  80. package/build/html/preview.js +0 -1
  81. package/build/html/preview.js.map +1 -1
  82. package/build/image/edit.js +0 -1
  83. package/build/image/edit.js.map +1 -1
  84. package/build/image/edit.native.js +0 -1
  85. package/build/image/edit.native.js.map +1 -1
  86. package/build/image/image.js +0 -1
  87. package/build/image/image.js.map +1 -1
  88. package/build/image/transforms.js +0 -1
  89. package/build/image/transforms.js.map +1 -1
  90. package/build/image/utils.js +0 -1
  91. package/build/image/utils.js.map +1 -1
  92. package/build/image/view.js +4 -4
  93. package/build/image/view.js.map +1 -1
  94. package/build/index.native.js +0 -1
  95. package/build/index.native.js.map +1 -1
  96. package/build/latest-posts/edit.js +0 -1
  97. package/build/latest-posts/edit.js.map +1 -1
  98. package/build/list/transforms.js +0 -1
  99. package/build/list/transforms.js.map +1 -1
  100. package/build/list/utils.js +0 -1
  101. package/build/list/utils.js.map +1 -1
  102. package/build/list-item/hooks/use-indent-list-item.js +0 -1
  103. package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
  104. package/build/list-item/transforms.js +0 -1
  105. package/build/list-item/transforms.js.map +1 -1
  106. package/build/media-text/edit.js +0 -1
  107. package/build/media-text/edit.js.map +1 -1
  108. package/build/more/save.js +0 -1
  109. package/build/more/save.js.map +1 -1
  110. package/build/navigation/deprecated.js +0 -1
  111. package/build/navigation/deprecated.js.map +1 -1
  112. package/build/navigation/edit/index.js +0 -1
  113. package/build/navigation/edit/index.js.map +1 -1
  114. package/build/navigation/edit/use-generate-default-navigation-title.js +0 -1
  115. package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
  116. package/build/navigation/menu-items-to-blocks.js +0 -1
  117. package/build/navigation/menu-items-to-blocks.js.map +1 -1
  118. package/build/navigation/use-template-part-area-label.js +0 -1
  119. package/build/navigation/use-template-part-area-label.js.map +1 -1
  120. package/build/navigation/view.js +2 -3
  121. package/build/navigation/view.js.map +1 -1
  122. package/build/navigation-link/edit.js +2 -1
  123. package/build/navigation-link/edit.js.map +1 -1
  124. package/build/navigation-link/hooks.js +0 -1
  125. package/build/navigation-link/hooks.js.map +1 -1
  126. package/build/navigation-submenu/edit.js +2 -1
  127. package/build/navigation-submenu/edit.js.map +1 -1
  128. package/build/page-list/edit.js +0 -1
  129. package/build/page-list/edit.js.map +1 -1
  130. package/build/page-list/use-convert-to-navigation-links.js +0 -1
  131. package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
  132. package/build/pattern/edit.js +0 -1
  133. package/build/pattern/edit.js.map +1 -1
  134. package/build/post-author/edit.js +0 -1
  135. package/build/post-author/edit.js.map +1 -1
  136. package/build/post-comments-count/index.js +8 -1
  137. package/build/post-comments-count/index.js.map +1 -1
  138. package/build/post-featured-image/dimension-controls.js +2 -39
  139. package/build/post-featured-image/dimension-controls.js.map +1 -1
  140. package/build/post-featured-image/edit.js +45 -3
  141. package/build/post-featured-image/edit.js.map +1 -1
  142. package/build/post-navigation-link/edit.js +1 -2
  143. package/build/post-navigation-link/edit.js.map +1 -1
  144. package/build/post-navigation-link/variations.js +0 -1
  145. package/build/post-navigation-link/variations.js.map +1 -1
  146. package/build/post-template/edit.js +14 -7
  147. package/build/post-template/edit.js.map +1 -1
  148. package/build/post-terms/edit.js +0 -1
  149. package/build/post-terms/edit.js.map +1 -1
  150. package/build/post-terms/hooks.js +0 -1
  151. package/build/post-terms/hooks.js.map +1 -1
  152. package/build/pullquote/blockquote.native.js +0 -1
  153. package/build/pullquote/blockquote.native.js.map +1 -1
  154. package/build/pullquote/transforms.js +0 -1
  155. package/build/pullquote/transforms.js.map +1 -1
  156. package/build/query/deprecated.js +0 -1
  157. package/build/query/deprecated.js.map +1 -1
  158. package/build/query/edit/inspector-controls/author-control.js +0 -1
  159. package/build/query/edit/inspector-controls/author-control.js.map +1 -1
  160. package/build/query/edit/inspector-controls/format-controls.js +0 -1
  161. package/build/query/edit/inspector-controls/format-controls.js.map +1 -1
  162. package/build/query/edit/inspector-controls/index.js +0 -1
  163. package/build/query/edit/inspector-controls/index.js.map +1 -1
  164. package/build/query/edit/inspector-controls/parent-control.js +0 -1
  165. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  166. package/build/query/edit/inspector-controls/sticky-control.js +3 -0
  167. package/build/query/edit/inspector-controls/sticky-control.js.map +1 -1
  168. package/build/query/edit/inspector-controls/taxonomy-controls.js +0 -1
  169. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  170. package/build/query/utils.js +0 -1
  171. package/build/query/utils.js.map +1 -1
  172. package/build/query/view.js +2 -2
  173. package/build/query/view.js.map +1 -1
  174. package/build/query-title/variations.js +0 -1
  175. package/build/query-title/variations.js.map +1 -1
  176. package/build/quote/deprecated.js +0 -1
  177. package/build/quote/deprecated.js.map +1 -1
  178. package/build/quote/transforms.js +0 -1
  179. package/build/quote/transforms.js.map +1 -1
  180. package/build/rss/edit.js +15 -1
  181. package/build/rss/edit.js.map +1 -1
  182. package/build/rss/index.js +14 -0
  183. package/build/rss/index.js.map +1 -1
  184. package/build/search/view.js +2 -2
  185. package/build/search/view.js.map +1 -1
  186. package/build/site-logo/edit.js +2 -5
  187. package/build/site-logo/edit.js.map +1 -1
  188. package/build/social-link/icons/discord.js +23 -0
  189. package/build/social-link/icons/discord.js.map +1 -0
  190. package/build/social-link/icons/index.js +11 -0
  191. package/build/social-link/icons/index.js.map +1 -1
  192. package/build/social-link/social-list.js +0 -1
  193. package/build/social-link/social-list.js.map +1 -1
  194. package/build/social-link/variations.js +7 -1
  195. package/build/social-link/variations.js.map +1 -1
  196. package/build/social-links/edit.js +0 -1
  197. package/build/social-links/edit.js.map +1 -1
  198. package/build/social-links/edit.native.js +0 -1
  199. package/build/social-links/edit.native.js.map +1 -1
  200. package/build/spacer/controls.js +0 -1
  201. package/build/spacer/controls.js.map +1 -1
  202. package/build/table/deprecated.js +0 -1
  203. package/build/table/deprecated.js.map +1 -1
  204. package/build/table/edit.js +0 -1
  205. package/build/table/edit.js.map +1 -1
  206. package/build/table/save.js +0 -1
  207. package/build/table/save.js.map +1 -1
  208. package/build/table/state.js +0 -1
  209. package/build/table/state.js.map +1 -1
  210. package/build/table/transforms.js +0 -1
  211. package/build/table/transforms.js.map +1 -1
  212. package/build/table-of-contents/list.js +0 -1
  213. package/build/table-of-contents/list.js.map +1 -1
  214. package/build/table-of-contents/utils.js +0 -1
  215. package/build/table-of-contents/utils.js.map +1 -1
  216. package/build/tag-cloud/edit.js +0 -1
  217. package/build/tag-cloud/edit.js.map +1 -1
  218. package/build/template-part/edit/advanced-controls.js +0 -1
  219. package/build/template-part/edit/advanced-controls.js.map +1 -1
  220. package/build/template-part/edit/import-controls.js +0 -1
  221. package/build/template-part/edit/import-controls.js.map +1 -1
  222. package/build/template-part/edit/selection-modal.js +0 -1
  223. package/build/template-part/edit/selection-modal.js.map +1 -1
  224. package/build/template-part/edit/utils/hooks.js +0 -1
  225. package/build/template-part/edit/utils/hooks.js.map +1 -1
  226. package/build/template-part/edit/utils/transformers.js +0 -1
  227. package/build/template-part/edit/utils/transformers.js.map +1 -1
  228. package/build/template-part/variations.js +0 -1
  229. package/build/template-part/variations.js.map +1 -1
  230. package/build/text-columns/edit.js +0 -1
  231. package/build/text-columns/edit.js.map +1 -1
  232. package/build/text-columns/save.js +0 -1
  233. package/build/text-columns/save.js.map +1 -1
  234. package/build/text-columns/transforms.js +0 -1
  235. package/build/text-columns/transforms.js.map +1 -1
  236. package/build/utils/get-transformed-metadata.js +0 -1
  237. package/build/utils/get-transformed-metadata.js.map +1 -1
  238. package/build/utils/search-patterns.js +0 -1
  239. package/build/utils/search-patterns.js.map +1 -1
  240. package/build/utils/transformation-categories.native.js +0 -1
  241. package/build/utils/transformation-categories.native.js.map +1 -1
  242. package/build/video/edit-common-settings.js +10 -3
  243. package/build/video/edit-common-settings.js.map +1 -1
  244. package/build/video/tracks-editor.js +0 -1
  245. package/build/video/tracks-editor.js.map +1 -1
  246. package/build/video/tracks.js +0 -1
  247. package/build/video/tracks.js.map +1 -1
  248. package/build-module/archives/index.js +9 -0
  249. package/build-module/archives/index.js.map +1 -1
  250. package/build-module/avatar/user-control.js +0 -1
  251. package/build-module/avatar/user-control.js.map +1 -1
  252. package/build-module/block/deprecated.js +0 -1
  253. package/build-module/block/deprecated.js.map +1 -1
  254. package/build-module/block/edit.js +0 -1
  255. package/build-module/block/edit.js.map +1 -1
  256. package/build-module/button/deprecated.js +0 -1
  257. package/build-module/button/deprecated.js.map +1 -1
  258. package/build-module/buttons/transforms.js +0 -1
  259. package/build-module/buttons/transforms.js.map +1 -1
  260. package/build-module/categories/edit.js +0 -1
  261. package/build-module/categories/edit.js.map +1 -1
  262. package/build-module/categories/index.js +9 -0
  263. package/build-module/categories/index.js.map +1 -1
  264. package/build-module/column/column-preview.native.js +0 -1
  265. package/build-module/column/column-preview.native.js.map +1 -1
  266. package/build-module/columns/columnCalculations.native.js +0 -1
  267. package/build-module/columns/columnCalculations.native.js.map +1 -1
  268. package/build-module/columns/deprecated.js +0 -1
  269. package/build-module/columns/deprecated.js.map +1 -1
  270. package/build-module/columns/edit.js +0 -1
  271. package/build-module/columns/edit.js.map +1 -1
  272. package/build-module/columns/edit.native.js +0 -1
  273. package/build-module/columns/edit.native.js.map +1 -1
  274. package/build-module/columns/transforms.js +0 -1
  275. package/build-module/columns/transforms.js.map +1 -1
  276. package/build-module/columns/utils.js +0 -1
  277. package/build-module/columns/utils.js.map +1 -1
  278. package/build-module/comment-template/edit.js +0 -1
  279. package/build-module/comment-template/edit.js.map +1 -1
  280. package/build-module/comment-template/hooks.js +0 -1
  281. package/build-module/comment-template/hooks.js.map +1 -1
  282. package/build-module/comment-template/util.js +0 -1
  283. package/build-module/comment-template/util.js.map +1 -1
  284. package/build-module/cover/edit/index.js +3 -1
  285. package/build-module/cover/edit/index.js.map +1 -1
  286. package/build-module/details/transforms.js +0 -1
  287. package/build-module/details/transforms.js.map +1 -1
  288. package/build-module/embed/embed-placeholder.native.js +0 -1
  289. package/build-module/embed/embed-placeholder.native.js.map +1 -1
  290. package/build-module/embed/util.js +0 -1
  291. package/build-module/embed/util.js.map +1 -1
  292. package/build-module/embed/variations.js +0 -1
  293. package/build-module/embed/variations.js.map +1 -1
  294. package/build-module/embed/wp-embed-preview.js +0 -1
  295. package/build-module/embed/wp-embed-preview.js.map +1 -1
  296. package/build-module/file/transforms.js +0 -1
  297. package/build-module/file/transforms.js.map +1 -1
  298. package/build-module/footnotes/edit.js +0 -1
  299. package/build-module/footnotes/edit.js.map +1 -1
  300. package/build-module/form/edit.js +4 -2
  301. package/build-module/form/edit.js.map +1 -1
  302. package/build-module/freeform/modal.js +0 -1
  303. package/build-module/freeform/modal.js.map +1 -1
  304. package/build-module/gallery/deprecated.js +0 -1
  305. package/build-module/gallery/deprecated.js.map +1 -1
  306. package/build-module/gallery/edit.js +0 -1
  307. package/build-module/gallery/edit.js.map +1 -1
  308. package/build-module/gallery/shared.js +0 -1
  309. package/build-module/gallery/shared.js.map +1 -1
  310. package/build-module/gallery/transforms.js +0 -1
  311. package/build-module/gallery/transforms.js.map +1 -1
  312. package/build-module/gallery/use-get-media.js +0 -1
  313. package/build-module/gallery/use-get-media.js.map +1 -1
  314. package/build-module/gallery/use-get-media.native.js +0 -1
  315. package/build-module/gallery/use-get-media.native.js.map +1 -1
  316. package/build-module/gallery/use-get-new-images.js +0 -1
  317. package/build-module/gallery/use-get-new-images.js.map +1 -1
  318. package/build-module/gallery/use-image-sizes.js +0 -1
  319. package/build-module/gallery/use-image-sizes.js.map +1 -1
  320. package/build-module/group/placeholder.js +0 -1
  321. package/build-module/group/placeholder.js.map +1 -1
  322. package/build-module/group/transforms.js +0 -1
  323. package/build-module/group/transforms.js.map +1 -1
  324. package/build-module/heading/transforms.js +0 -1
  325. package/build-module/heading/transforms.js.map +1 -1
  326. package/build-module/html/preview.js +0 -1
  327. package/build-module/html/preview.js.map +1 -1
  328. package/build-module/image/edit.js +0 -1
  329. package/build-module/image/edit.js.map +1 -1
  330. package/build-module/image/edit.native.js +0 -1
  331. package/build-module/image/edit.native.js.map +1 -1
  332. package/build-module/image/image.js +0 -1
  333. package/build-module/image/image.js.map +1 -1
  334. package/build-module/image/transforms.js +0 -1
  335. package/build-module/image/transforms.js.map +1 -1
  336. package/build-module/image/utils.js +0 -1
  337. package/build-module/image/utils.js.map +1 -1
  338. package/build-module/image/view.js +5 -5
  339. package/build-module/image/view.js.map +1 -1
  340. package/build-module/index.native.js +0 -1
  341. package/build-module/index.native.js.map +1 -1
  342. package/build-module/latest-posts/edit.js +0 -1
  343. package/build-module/latest-posts/edit.js.map +1 -1
  344. package/build-module/list/transforms.js +0 -1
  345. package/build-module/list/transforms.js.map +1 -1
  346. package/build-module/list/utils.js +0 -1
  347. package/build-module/list/utils.js.map +1 -1
  348. package/build-module/list-item/hooks/use-indent-list-item.js +0 -1
  349. package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
  350. package/build-module/list-item/transforms.js +0 -1
  351. package/build-module/list-item/transforms.js.map +1 -1
  352. package/build-module/media-text/edit.js +0 -1
  353. package/build-module/media-text/edit.js.map +1 -1
  354. package/build-module/more/save.js +0 -1
  355. package/build-module/more/save.js.map +1 -1
  356. package/build-module/navigation/deprecated.js +0 -1
  357. package/build-module/navigation/deprecated.js.map +1 -1
  358. package/build-module/navigation/edit/index.js +0 -1
  359. package/build-module/navigation/edit/index.js.map +1 -1
  360. package/build-module/navigation/edit/use-generate-default-navigation-title.js +0 -1
  361. package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
  362. package/build-module/navigation/menu-items-to-blocks.js +0 -1
  363. package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
  364. package/build-module/navigation/use-template-part-area-label.js +0 -1
  365. package/build-module/navigation/use-template-part-area-label.js.map +1 -1
  366. package/build-module/navigation/view.js +3 -4
  367. package/build-module/navigation/view.js.map +1 -1
  368. package/build-module/navigation-link/edit.js +2 -1
  369. package/build-module/navigation-link/edit.js.map +1 -1
  370. package/build-module/navigation-link/hooks.js +0 -1
  371. package/build-module/navigation-link/hooks.js.map +1 -1
  372. package/build-module/navigation-submenu/edit.js +2 -1
  373. package/build-module/navigation-submenu/edit.js.map +1 -1
  374. package/build-module/page-list/edit.js +0 -1
  375. package/build-module/page-list/edit.js.map +1 -1
  376. package/build-module/page-list/use-convert-to-navigation-links.js +0 -1
  377. package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
  378. package/build-module/pattern/edit.js +0 -1
  379. package/build-module/pattern/edit.js.map +1 -1
  380. package/build-module/post-author/edit.js +0 -1
  381. package/build-module/post-author/edit.js.map +1 -1
  382. package/build-module/post-comments-count/index.js +8 -1
  383. package/build-module/post-comments-count/index.js.map +1 -1
  384. package/build-module/post-featured-image/dimension-controls.js +3 -40
  385. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  386. package/build-module/post-featured-image/edit.js +46 -4
  387. package/build-module/post-featured-image/edit.js.map +1 -1
  388. package/build-module/post-navigation-link/edit.js +1 -2
  389. package/build-module/post-navigation-link/edit.js.map +1 -1
  390. package/build-module/post-navigation-link/variations.js +0 -1
  391. package/build-module/post-navigation-link/variations.js.map +1 -1
  392. package/build-module/post-template/edit.js +14 -7
  393. package/build-module/post-template/edit.js.map +1 -1
  394. package/build-module/post-terms/edit.js +0 -1
  395. package/build-module/post-terms/edit.js.map +1 -1
  396. package/build-module/post-terms/hooks.js +0 -1
  397. package/build-module/post-terms/hooks.js.map +1 -1
  398. package/build-module/pullquote/blockquote.native.js +0 -1
  399. package/build-module/pullquote/blockquote.native.js.map +1 -1
  400. package/build-module/pullquote/transforms.js +0 -1
  401. package/build-module/pullquote/transforms.js.map +1 -1
  402. package/build-module/query/deprecated.js +0 -1
  403. package/build-module/query/deprecated.js.map +1 -1
  404. package/build-module/query/edit/inspector-controls/author-control.js +0 -1
  405. package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
  406. package/build-module/query/edit/inspector-controls/format-controls.js +0 -1
  407. package/build-module/query/edit/inspector-controls/format-controls.js.map +1 -1
  408. package/build-module/query/edit/inspector-controls/index.js +0 -1
  409. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  410. package/build-module/query/edit/inspector-controls/parent-control.js +0 -1
  411. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  412. package/build-module/query/edit/inspector-controls/sticky-control.js +3 -0
  413. package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -1
  414. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +0 -1
  415. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  416. package/build-module/query/utils.js +0 -1
  417. package/build-module/query/utils.js.map +1 -1
  418. package/build-module/query/view.js +3 -3
  419. package/build-module/query/view.js.map +1 -1
  420. package/build-module/query-title/variations.js +0 -1
  421. package/build-module/query-title/variations.js.map +1 -1
  422. package/build-module/quote/deprecated.js +0 -1
  423. package/build-module/quote/deprecated.js.map +1 -1
  424. package/build-module/quote/transforms.js +0 -1
  425. package/build-module/quote/transforms.js.map +1 -1
  426. package/build-module/rss/edit.js +15 -1
  427. package/build-module/rss/edit.js.map +1 -1
  428. package/build-module/rss/index.js +14 -0
  429. package/build-module/rss/index.js.map +1 -1
  430. package/build-module/search/view.js +3 -3
  431. package/build-module/search/view.js.map +1 -1
  432. package/build-module/site-logo/edit.js +2 -5
  433. package/build-module/site-logo/edit.js.map +1 -1
  434. package/build-module/social-link/icons/discord.js +15 -0
  435. package/build-module/social-link/icons/discord.js.map +1 -0
  436. package/build-module/social-link/icons/index.js +1 -0
  437. package/build-module/social-link/icons/index.js.map +1 -1
  438. package/build-module/social-link/social-list.js +0 -1
  439. package/build-module/social-link/social-list.js.map +1 -1
  440. package/build-module/social-link/variations.js +8 -2
  441. package/build-module/social-link/variations.js.map +1 -1
  442. package/build-module/social-links/edit.js +0 -1
  443. package/build-module/social-links/edit.js.map +1 -1
  444. package/build-module/social-links/edit.native.js +0 -1
  445. package/build-module/social-links/edit.native.js.map +1 -1
  446. package/build-module/spacer/controls.js +0 -1
  447. package/build-module/spacer/controls.js.map +1 -1
  448. package/build-module/table/deprecated.js +0 -1
  449. package/build-module/table/deprecated.js.map +1 -1
  450. package/build-module/table/edit.js +0 -1
  451. package/build-module/table/edit.js.map +1 -1
  452. package/build-module/table/save.js +0 -1
  453. package/build-module/table/save.js.map +1 -1
  454. package/build-module/table/state.js +0 -1
  455. package/build-module/table/state.js.map +1 -1
  456. package/build-module/table/transforms.js +0 -1
  457. package/build-module/table/transforms.js.map +1 -1
  458. package/build-module/table-of-contents/list.js +0 -1
  459. package/build-module/table-of-contents/list.js.map +1 -1
  460. package/build-module/table-of-contents/utils.js +0 -1
  461. package/build-module/table-of-contents/utils.js.map +1 -1
  462. package/build-module/tag-cloud/edit.js +0 -1
  463. package/build-module/tag-cloud/edit.js.map +1 -1
  464. package/build-module/template-part/edit/advanced-controls.js +0 -1
  465. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  466. package/build-module/template-part/edit/import-controls.js +0 -1
  467. package/build-module/template-part/edit/import-controls.js.map +1 -1
  468. package/build-module/template-part/edit/selection-modal.js +0 -1
  469. package/build-module/template-part/edit/selection-modal.js.map +1 -1
  470. package/build-module/template-part/edit/utils/hooks.js +0 -1
  471. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  472. package/build-module/template-part/edit/utils/transformers.js +0 -1
  473. package/build-module/template-part/edit/utils/transformers.js.map +1 -1
  474. package/build-module/template-part/variations.js +0 -1
  475. package/build-module/template-part/variations.js.map +1 -1
  476. package/build-module/text-columns/edit.js +0 -1
  477. package/build-module/text-columns/edit.js.map +1 -1
  478. package/build-module/text-columns/save.js +0 -1
  479. package/build-module/text-columns/save.js.map +1 -1
  480. package/build-module/text-columns/transforms.js +0 -1
  481. package/build-module/text-columns/transforms.js.map +1 -1
  482. package/build-module/utils/get-transformed-metadata.js +0 -1
  483. package/build-module/utils/get-transformed-metadata.js.map +1 -1
  484. package/build-module/utils/search-patterns.js +0 -1
  485. package/build-module/utils/search-patterns.js.map +1 -1
  486. package/build-module/utils/transformation-categories.native.js +0 -1
  487. package/build-module/utils/transformation-categories.native.js.map +1 -1
  488. package/build-module/video/edit-common-settings.js +10 -3
  489. package/build-module/video/edit-common-settings.js.map +1 -1
  490. package/build-module/video/tracks-editor.js +0 -1
  491. package/build-module/video/tracks-editor.js.map +1 -1
  492. package/build-module/video/tracks.js +0 -1
  493. package/build-module/video/tracks.js.map +1 -1
  494. package/build-style/editor-rtl.css +15 -15
  495. package/build-style/editor.css +15 -15
  496. package/build-style/navigation-link/editor-rtl.css +5 -9
  497. package/build-style/navigation-link/editor.css +5 -9
  498. package/build-style/post-comments-count/style-rtl.css +103 -0
  499. package/build-style/post-comments-count/style.css +103 -0
  500. package/build-style/pullquote/style-rtl.css +4 -0
  501. package/build-style/pullquote/style.css +4 -0
  502. package/build-style/rss/editor-rtl.css +6 -0
  503. package/build-style/rss/editor.css +6 -0
  504. package/build-style/rss/style-rtl.css +6 -8
  505. package/build-style/rss/style.css +6 -8
  506. package/build-style/social-link/editor-rtl.css +1 -0
  507. package/build-style/social-link/editor.css +1 -0
  508. package/build-style/social-links/editor-rtl.css +3 -6
  509. package/build-style/social-links/editor.css +3 -6
  510. package/build-style/social-links/style-rtl.css +7 -0
  511. package/build-style/social-links/style.css +7 -0
  512. package/build-style/style-rtl.css +21 -8
  513. package/build-style/style.css +21 -8
  514. package/package.json +35 -35
  515. package/src/archives/block.json +9 -0
  516. package/src/block/index.php +1 -18
  517. package/src/categories/block.json +9 -0
  518. package/src/cover/edit/index.js +2 -0
  519. package/src/cover/test/edit.js +6 -6
  520. package/src/form/edit.js +2 -0
  521. package/src/image/view.js +10 -5
  522. package/src/navigation/index.php +11 -69
  523. package/src/navigation/view.js +8 -3
  524. package/src/navigation-link/edit.js +1 -0
  525. package/src/navigation-link/editor.scss +3 -24
  526. package/src/navigation-submenu/edit.js +1 -0
  527. package/src/post-comments-count/block.json +8 -1
  528. package/src/post-comments-count/style.scss +4 -0
  529. package/src/post-content/index.php +0 -23
  530. package/src/post-featured-image/dimension-controls.js +2 -43
  531. package/src/post-featured-image/edit.js +39 -3
  532. package/src/post-navigation-link/edit.js +1 -1
  533. package/src/post-template/edit.js +15 -6
  534. package/src/pullquote/style.scss +4 -0
  535. package/src/query/edit/inspector-controls/sticky-control.js +1 -0
  536. package/src/query/view.js +8 -3
  537. package/src/query-total/index.php +2 -0
  538. package/src/rss/block.json +14 -0
  539. package/src/rss/edit.js +14 -1
  540. package/src/rss/editor.scss +7 -0
  541. package/src/rss/style.scss +6 -8
  542. package/src/search/view.js +8 -3
  543. package/src/site-logo/edit.js +1 -5
  544. package/src/social-link/editor.scss +1 -0
  545. package/src/social-link/icons/discord.js +10 -0
  546. package/src/social-link/icons/index.js +1 -0
  547. package/src/social-link/index.php +4 -0
  548. package/src/social-link/socials-with-bg.scss +5 -0
  549. package/src/social-link/socials-without-bg.scss +4 -0
  550. package/src/social-link/variations.js +7 -0
  551. package/src/social-links/editor.scss +4 -1
  552. package/src/style.scss +1 -0
  553. package/src/template-part/index.php +3 -1
  554. package/src/video/edit-common-settings.js +11 -2
@@ -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.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\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\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,G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IACDqG,eAAeA,CAAA,EAAG;MACjB,IAAKpH,KAAK,CAACqB,cAAc,EAAG;QAC3B;QACA,MAAM;UAAEsB;QAAI,CAAC,GAAG,IAAAC,yBAAU,EAAC,CAAC;QAC5BD,GAAG,CAACN,KAAK,CAAC,CAAC;MACZ;IACD,CAAC;IACDgF,iBAAiBA,CAAA,EAAG;MACnB,MAAM;QAAErG;MAAQ,CAAC,GAAG,IAAAC,yBAAU,EAAC,CAAC;MAChC,MAAM;QAAE0B;MAAI,CAAC,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":[]}
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","withSyncEvent","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 {\n\tstore,\n\tgetContext,\n\tgetElement,\n\twithSyncEvent,\n} 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: withSyncEvent( ( 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: withSyncEvent( ( 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\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\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;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,UAAU,GAAG,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,aAAa,GAAG,CAAC;AAErB,MAAM;EAAEC,KAAK;EAAEC,OAAO;EAAEC;AAAU,CAAC,GAAG,IAAAC,oBAAK,EAC1C,YAAY,EACZ;EACCH,KAAK,EAAE;IACNI,cAAc,EAAE,IAAI;IACpB,IAAIC,YAAYA,CAAA,EAAG;MAClB,OAAOL,KAAK,CAACM,QAAQ,CAAEN,KAAK,CAACI,cAAc,CAAE;IAC9C,CAAC;IACD,IAAIG,aAAaA,CAAA,EAAG;MACnB,OAAOP,KAAK,CAACI,cAAc,KAAK,IAAI;IACrC,CAAC;IACD,IAAII,aAAaA,CAAA,EAAG;MACnB,OAAOR,KAAK,CAACO,aAAa,GAAG,QAAQ,GAAG,IAAI;IAC7C,CAAC;IACD,IAAIE,SAASA,CAAA,EAAG;MACf,OAAOT,KAAK,CAACO,aAAa,GAAG,MAAM,GAAG,IAAI;IAC3C,CAAC;IACD,IAAIG,WAAWA,CAAA,EAAG;MACjB,OACCV,KAAK,CAACK,YAAY,CAACM,WAAW,IAC9B,4DAA4D;IAE9D,CAAC;IACD,IAAIC,YAAYA,CAAA,EAAG;MAClB,OACCZ,KAAK,CAACO,aAAa,IACnB,GAAIP,KAAK,CAACK,YAAY,CAACO,YAAY,EAAEC,OAAO,CAC3C,gBAAgB,EAChB,EACD,CAAC,GAAI;IAEP,CAAC;IACD,IAAIC,SAASA,CAAA,EAAG;MACf,OACCd,KAAK,CAACO,aAAa,IACnB,GAAIP,KAAK,CAACK,YAAY,CAACS,SAAS,EAAED,OAAO,CACxC,IAAI,EAC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ACpCH,iBAAiB,GACjB,EAAE;QACJ;MACD;MAEAjH,KAAK,CAACM,QAAQ,CAAEU,OAAO,CAAE,CAACE,cAAc,GAAGA,cAAc;MACzDlB,KAAK,CAACM,QAAQ,CAAEU,OAAO,CAAE,CAACD,gBAAgB,GAAGA,gBAAgB;IAC9D,CAAC;IACDsG,eAAeA,CAAA,EAAG;MACjB,IAAKrH,KAAK,CAACqB,cAAc,EAAG;QAC3B;QACA,MAAM;UAAEuB;QAAI,CAAC,GAAG,IAAAC,yBAAU,EAAC,CAAC;QAC5BD,GAAG,CAACP,KAAK,CAAC,CAAC;MACZ;IACD,CAAC;IACDiF,iBAAiBA,CAAA,EAAG;MACnB,MAAM;QAAEtG;MAAQ,CAAC,GAAG,IAAAC,yBAAU,EAAC,CAAC;MAChC,MAAM;QAAE2B;MAAI,CAAC,GAAG,IAAAC,yBAAU,EAAC,CAAC;MAC5B7C,KAAK,CAACM,QAAQ,CAAEU,OAAO,CAAE,CAACoB,SAAS,GAAGQ,GAAG;IAC1C;EACD;AACD,CAAC,EACD;EAAE2E,IAAI,EAAE;AAAK,CACd,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_blocks","_hooks","paragraph","_interopRequireWildcard","image","heading","quote","gallery","archives","audio","button","calendar","categories","code","columns","column","cover","embed","file","html","mediaText","latestComments","latestPosts","list","listItem","missing","more","nextpage","preformatted","pullquote","reusableBlock","rss","search","separator","shortcode","spacer","table","textColumns","verse","video","tagCloud","classic","group","buttons","socialLink","socialLinks","_transformationCategories","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","coreBlocks","exports","reduce","accumulator","block","name","registerBlockVariations","metadata","settings","variations","sort","b","title","localeCompare","forEach","v","registerBlockType","icon","devOnly","__DEV__","iOSOnly","Platform","OS","addFilter","hiddenBlocks","includes","hasBlockSupport","supports","inserter","transforms","supportedMobileTransforms","transformationCategory","registerCoreBlocks","filter","Boolean","init","setDefaultBlockName","setFreeformContentHandlerName","setUnregisteredTypeHandlerName","setGroupingBlockName","NEW_BLOCK_TYPES"],"sources":["@wordpress/block-library/src/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\thasBlockSupport,\n\tregisterBlockType,\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport * as paragraph from './paragraph';\nimport * as image from './image';\nimport * as heading from './heading';\nimport * as quote from './quote';\nimport * as gallery from './gallery';\nimport * as archives from './archives';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as code from './code';\nimport * as columns from './columns';\nimport * as column from './column';\nimport * as cover from './cover';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as html from './html';\nimport * as mediaText from './media-text';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as nextpage from './nextpage';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as reusableBlock from './block';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\nimport * as tagCloud from './tag-cloud';\nimport * as classic from './freeform';\nimport * as group from './group';\nimport * as buttons from './buttons';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\n\nimport { transformationCategory } from './utils/transformation-categories';\n\nexport const coreBlocks = [\n\t// Common blocks are grouped at the top to prioritize their display\n\t// in various contexts — like the inserter and auto-complete components.\n\tparagraph,\n\timage,\n\theading,\n\tgallery,\n\tlist,\n\tlistItem,\n\tquote,\n\n\t// Register all remaining core blocks.\n\tshortcode,\n\tarchives,\n\taudio,\n\tbutton,\n\tcalendar,\n\tcategories,\n\tcode,\n\tcolumns,\n\tcolumn,\n\tcover,\n\tembed,\n\tgroup,\n\tfile,\n\thtml,\n\tmediaText,\n\tlatestComments,\n\tlatestPosts,\n\tmissing,\n\tmore,\n\tnextpage,\n\tpreformatted,\n\tpullquote,\n\trss,\n\tsearch,\n\tseparator,\n\treusableBlock,\n\tspacer,\n\ttable,\n\ttagCloud,\n\ttextColumns,\n\tverse,\n\tvideo,\n\tclassic,\n\tbuttons,\n\tsocialLink,\n\tsocialLinks,\n].reduce( ( accumulator, block ) => {\n\taccumulator[ block.name ] = block;\n\treturn accumulator;\n}, {} );\n\n/**\n * Function to register a block variations e.g. social icons different types.\n *\n * @param {Object} block The block which variations will be registered.\n */\nconst registerBlockVariations = ( block ) => {\n\tconst { metadata, settings, name } = block;\n\n\tif ( ! settings.variations ) {\n\t\treturn;\n\t}\n\n\t[ ...settings.variations ]\n\t\t.sort( ( a, b ) => a.title.localeCompare( b.title ) )\n\t\t.forEach( ( v ) => {\n\t\t\tregisterBlockType( `${ name }-${ v.name }`, {\n\t\t\t\t...metadata,\n\t\t\t\tname: `${ name }-${ v.name }`,\n\t\t\t\t...settings,\n\t\t\t\ticon: v.icon(),\n\t\t\t\ttitle: v.title,\n\t\t\t\tvariations: [],\n\t\t\t} );\n\t\t} );\n};\n\n// Only enable code block for development\n// eslint-disable-next-line no-undef\nconst devOnly = ( block ) => ( !! __DEV__ ? block : null );\n\n// eslint-disable-next-line no-unused-vars\nconst iOSOnly = ( block ) =>\n\tPlatform.OS === 'ios' ? block : devOnly( block );\n\n// Hide the Classic block and SocialLink block\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/react-native-editor',\n\t( settings, name ) => {\n\t\tconst hiddenBlocks = [ 'core/freeform', 'core/social-link' ];\n\t\tif (\n\t\t\thiddenBlocks.includes( name ) &&\n\t\t\thasBlockSupport( settings, 'inserter', true )\n\t\t) {\n\t\t\tsettings.supports = {\n\t\t\t\t...settings.supports,\n\t\t\t\tinserter: false,\n\t\t\t};\n\t\t}\n\n\t\treturn settings;\n\t}\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/react-native-editor',\n\t( settings, name ) => {\n\t\tif ( ! settings.transforms ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tif ( ! settings.transforms.supportedMobileTransforms ) {\n\t\t\treturn {\n\t\t\t\t...settings,\n\t\t\t\ttransforms: {\n\t\t\t\t\t...settings.transforms,\n\t\t\t\t\tsupportedMobileTransforms: transformationCategory( name ),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn settings;\n\t}\n);\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = () => {\n\t// When adding new blocks to this list please also consider updating /src/block-support/supported-blocks.json in the Gutenberg-Mobile repo\n\t[\n\t\tparagraph,\n\t\theading,\n\t\tdevOnly( code ),\n\t\tmissing,\n\t\tmore,\n\t\timage,\n\t\tvideo,\n\t\tnextpage,\n\t\tseparator,\n\t\tlist,\n\t\tlistItem,\n\t\tquote,\n\t\tmediaText,\n\t\tpreformatted,\n\t\tgallery,\n\t\tcolumns,\n\t\tcolumn,\n\t\tgroup,\n\t\tclassic,\n\t\tbutton,\n\t\tspacer,\n\t\tshortcode,\n\t\tbuttons,\n\t\tlatestPosts,\n\t\tverse,\n\t\tcover,\n\t\tsocialLink,\n\t\tsocialLinks,\n\t\tpullquote,\n\t\tfile,\n\t\taudio,\n\t\treusableBlock,\n\t\tsearch,\n\t\tembed,\n\t]\n\t\t.filter( Boolean )\n\t\t.forEach( ( { init } ) => init() );\n\n\tregisterBlockVariations( socialLink );\n\tsetDefaultBlockName( paragraph.name );\n\tsetFreeformContentHandlerName( classic.name );\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tif ( group ) {\n\t\tsetGroupingBlockName( group.name );\n\t}\n};\n\n/**\n * Dictates which block types are considered \"new.\" For each of the block types\n * below, if the native host app does not already have an impression count set,\n * an initial count will be set. When a block type's impression count is greater\n * than 0, a \"new\" badge is displayed on the block type within the block\n * inserter.\n *\n * With the below example, the Audio block will be displayed as \"new\" until its\n * impression count reaches 0, which occurs by various actions decrementing\n * the impression count.\n *\n * {\n * \t[ audio.name ]: 40\n * }\n *\n * @constant {{ string, number }}\n */\nexport const NEW_BLOCK_TYPES = {};\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAQA,IAAAE,MAAA,GAAAF,OAAA;AAKA,IAAAG,SAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,OAAA,GAAAF,uBAAA,CAAAJ,OAAA;AACA,IAAAO,KAAA,GAAAH,uBAAA,CAAAJ,OAAA;AACA,IAAAQ,OAAA,GAAAJ,uBAAA,CAAAJ,OAAA;AACA,IAAAS,QAAA,GAAAL,uBAAA,CAAAJ,OAAA;AACA,IAAAU,KAAA,GAAAN,uBAAA,CAAAJ,OAAA;AACA,IAAAW,MAAA,GAAAP,uBAAA,CAAAJ,OAAA;AACA,IAAAY,QAAA,GAAAR,uBAAA,CAAAJ,OAAA;AACA,IAAAa,UAAA,GAAAT,uBAAA,CAAAJ,OAAA;AACA,IAAAc,IAAA,GAAAV,uBAAA,CAAAJ,OAAA;AACA,IAAAe,OAAA,GAAAX,uBAAA,CAAAJ,OAAA;AACA,IAAAgB,MAAA,GAAAZ,uBAAA,CAAAJ,OAAA;AACA,IAAAiB,KAAA,GAAAb,uBA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ACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAhBAJ,OAAA,CAAA+B,kBAAA,GAAAA,kBAAA;AAiBO,MAAMQ,eAAe,GAAAvC,OAAA,CAAAuC,eAAA,GAAG,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_blocks","_hooks","paragraph","_interopRequireWildcard","image","heading","quote","gallery","archives","audio","button","calendar","categories","code","columns","column","cover","embed","file","html","mediaText","latestComments","latestPosts","list","listItem","missing","more","nextpage","preformatted","pullquote","reusableBlock","rss","search","separator","shortcode","spacer","table","textColumns","verse","video","tagCloud","classic","group","buttons","socialLink","socialLinks","_transformationCategories","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","coreBlocks","exports","reduce","accumulator","block","name","registerBlockVariations","metadata","settings","variations","sort","b","title","localeCompare","forEach","v","registerBlockType","icon","devOnly","__DEV__","iOSOnly","Platform","OS","addFilter","hiddenBlocks","includes","hasBlockSupport","supports","inserter","transforms","supportedMobileTransforms","transformationCategory","registerCoreBlocks","filter","Boolean","init","setDefaultBlockName","setFreeformContentHandlerName","setUnregisteredTypeHandlerName","setGroupingBlockName","NEW_BLOCK_TYPES"],"sources":["@wordpress/block-library/src/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\thasBlockSupport,\n\tregisterBlockType,\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport * as paragraph from './paragraph';\nimport * as image from './image';\nimport * as heading from './heading';\nimport * as quote from './quote';\nimport * as gallery from './gallery';\nimport * as archives from './archives';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as code from './code';\nimport * as columns from './columns';\nimport * as column from './column';\nimport * as cover from './cover';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as html from './html';\nimport * as mediaText from './media-text';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as nextpage from './nextpage';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as reusableBlock from './block';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\nimport * as tagCloud from './tag-cloud';\nimport * as classic from './freeform';\nimport * as group from './group';\nimport * as buttons from './buttons';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\n\nimport { transformationCategory } from './utils/transformation-categories';\n\nexport const coreBlocks = [\n\t// Common blocks are grouped at the top to prioritize their display\n\t// in various contexts — like the inserter and auto-complete components.\n\tparagraph,\n\timage,\n\theading,\n\tgallery,\n\tlist,\n\tlistItem,\n\tquote,\n\n\t// Register all remaining core blocks.\n\tshortcode,\n\tarchives,\n\taudio,\n\tbutton,\n\tcalendar,\n\tcategories,\n\tcode,\n\tcolumns,\n\tcolumn,\n\tcover,\n\tembed,\n\tgroup,\n\tfile,\n\thtml,\n\tmediaText,\n\tlatestComments,\n\tlatestPosts,\n\tmissing,\n\tmore,\n\tnextpage,\n\tpreformatted,\n\tpullquote,\n\trss,\n\tsearch,\n\tseparator,\n\treusableBlock,\n\tspacer,\n\ttable,\n\ttagCloud,\n\ttextColumns,\n\tverse,\n\tvideo,\n\tclassic,\n\tbuttons,\n\tsocialLink,\n\tsocialLinks,\n].reduce( ( accumulator, block ) => {\n\taccumulator[ block.name ] = block;\n\treturn accumulator;\n}, {} );\n\n/**\n * Function to register a block variations e.g. social icons different types.\n *\n * @param {Object} block The block which variations will be registered.\n */\nconst registerBlockVariations = ( block ) => {\n\tconst { metadata, settings, name } = block;\n\n\tif ( ! settings.variations ) {\n\t\treturn;\n\t}\n\n\t[ ...settings.variations ]\n\t\t.sort( ( a, b ) => a.title.localeCompare( b.title ) )\n\t\t.forEach( ( v ) => {\n\t\t\tregisterBlockType( `${ name }-${ v.name }`, {\n\t\t\t\t...metadata,\n\t\t\t\tname: `${ name }-${ v.name }`,\n\t\t\t\t...settings,\n\t\t\t\ticon: v.icon(),\n\t\t\t\ttitle: v.title,\n\t\t\t\tvariations: [],\n\t\t\t} );\n\t\t} );\n};\n\n// Only enable code block for development\n// eslint-disable-next-line no-undef\nconst devOnly = ( block ) => ( !! __DEV__ ? block : null );\n\n// eslint-disable-next-line no-unused-vars\nconst iOSOnly = ( block ) =>\n\tPlatform.OS === 'ios' ? block : devOnly( block );\n\n// Hide the Classic block and SocialLink block\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/react-native-editor',\n\t( settings, name ) => {\n\t\tconst hiddenBlocks = [ 'core/freeform', 'core/social-link' ];\n\t\tif (\n\t\t\thiddenBlocks.includes( name ) &&\n\t\t\thasBlockSupport( settings, 'inserter', true )\n\t\t) {\n\t\t\tsettings.supports = {\n\t\t\t\t...settings.supports,\n\t\t\t\tinserter: false,\n\t\t\t};\n\t\t}\n\n\t\treturn settings;\n\t}\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/react-native-editor',\n\t( settings, name ) => {\n\t\tif ( ! settings.transforms ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tif ( ! settings.transforms.supportedMobileTransforms ) {\n\t\t\treturn {\n\t\t\t\t...settings,\n\t\t\t\ttransforms: {\n\t\t\t\t\t...settings.transforms,\n\t\t\t\t\tsupportedMobileTransforms: transformationCategory( name ),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn settings;\n\t}\n);\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = () => {\n\t// When adding new blocks to this list please also consider updating /src/block-support/supported-blocks.json in the Gutenberg-Mobile repo\n\t[\n\t\tparagraph,\n\t\theading,\n\t\tdevOnly( code ),\n\t\tmissing,\n\t\tmore,\n\t\timage,\n\t\tvideo,\n\t\tnextpage,\n\t\tseparator,\n\t\tlist,\n\t\tlistItem,\n\t\tquote,\n\t\tmediaText,\n\t\tpreformatted,\n\t\tgallery,\n\t\tcolumns,\n\t\tcolumn,\n\t\tgroup,\n\t\tclassic,\n\t\tbutton,\n\t\tspacer,\n\t\tshortcode,\n\t\tbuttons,\n\t\tlatestPosts,\n\t\tverse,\n\t\tcover,\n\t\tsocialLink,\n\t\tsocialLinks,\n\t\tpullquote,\n\t\tfile,\n\t\taudio,\n\t\treusableBlock,\n\t\tsearch,\n\t\tembed,\n\t]\n\t\t.filter( Boolean )\n\t\t.forEach( ( { init } ) => init() );\n\n\tregisterBlockVariations( socialLink );\n\tsetDefaultBlockName( paragraph.name );\n\tsetFreeformContentHandlerName( classic.name );\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tif ( group ) {\n\t\tsetGroupingBlockName( group.name );\n\t}\n};\n\n/**\n * Dictates which block types are considered \"new.\" For each of the block types\n * below, if the native host app does not already have an impression count set,\n * an initial count will be set. When a block type's impression count is greater\n * than 0, a \"new\" badge is displayed on the block type within the block\n * inserter.\n *\n * With the below example, the Audio block will be displayed as \"new\" until its\n * impression count reaches 0, which occurs by various actions decrementing\n * the impression count.\n *\n * {\n * \t[ audio.name ]: 40\n * }\n *\n * @constant {{ string, number }}\n */\nexport const NEW_BLOCK_TYPES = {};\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAQA,IAAAE,MAAA,GAAAF,OAAA;A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ACPC,MAAM,EACN2B,KAAK,EACLD,OAAO,EACP/B,MAAM,EACNyB,MAAM,EACND,SAAS,EACTS,OAAO,EACPrB,WAAW,EACXgB,KAAK,EACLtB,KAAK,EACL4B,UAAU,EACVC,WAAW,EACXhB,SAAS,EACTX,IAAI,EACJT,KAAK,EACLqB,aAAa,EACbE,MAAM,EACNf,KAAK,CACL,CACCmF,MAAM,CAAEC,OAAQ,CAAC,CACjBpB,OAAO,CAAE,CAAE;IAAEqB;EAAK,CAAC,KAAMA,IAAI,CAAC,CAAE,CAAC;EAEnC7B,uBAAuB,CAAE7B,UAAW,CAAC;EACrC,IAAA2D,2BAAmB,EAAErG,SAAS,CAACsE,IAAK,CAAC;EACrC,IAAAgC,qCAA6B,EAAE/D,OAAO,CAAC+B,IAAK,CAAC;EAC7C,IAAAiC,sCAA8B,EAAEhF,OAAO,CAAC+C,IAAK,CAAC;EAC9C,IAAK9B,KAAK,EAAG;IACZ,IAAAgE,4BAAoB,EAAEhE,KAAK,CAAC8B,IAAK,CAAC;EACnC;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAhBAJ,OAAA,CAAA+B,kBAAA,GAAAA,kBAAA;AAiBO,MAAMQ,eAAe,GAAAvC,OAAA,CAAAuC,eAAA,GAAG,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_date","_blockEditor","_data","_icons","_coreData","_notices","_compose","_element","_constants","_hooks","_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","dropdownMenuProps","useToolsPanelDropdownMenuProps","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","useDispatch","noticeStore","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","__experimentalToolsPanel","resetAll","DEFAULT_EXCERPT_LENGTH","jsx","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked","onChange","RadioControl","selected","options","RangeControl","__next40pxDefaultSize","min","MIN_EXCERPT_LENGTH","max","MAX_EXCERPT_LENGTH","PanelBody","title","Fragment","__experimentalImageSizeControl","newAttrs","hasOwnProperty","imageWidth","imageHeight","imageSizeHelp","onChangeImage","undefined","__experimentalToggleGroupControl","className","__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\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\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\tDEFAULT_EXCERPT_LENGTH,\n} from './constants';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\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 dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\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 } = useDispatch( noticeStore );\n\tconst showRedirectionPreventedNotice = ( event ) => {\n\t\tevent.preventDefault();\n\t\tcreateWarningNotice( __( 'Links are disabled in the editor.' ), {\n\t\t\tid: `block-library/core/latest-posts/redirection-prevented/${ instanceId }`,\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<ToolsPanel\n\t\t\t\tlabel={ __( 'Post content' ) }\n\t\t\t\tresetAll={ () =>\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tdisplayPostContent: false,\n\t\t\t\t\t\tdisplayPostContentRadio: 'excerpt',\n\t\t\t\t\t\texcerptLength: DEFAULT_EXCERPT_LENGTH,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! displayPostContent }\n\t\t\t\t\tlabel={ __( 'Post content' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { displayPostContent: false } )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Post content' ) }\n\t\t\t\t\t\tchecked={ displayPostContent }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { displayPostContent: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t\t{ displayPostContent && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => displayPostContentRadio !== 'excerpt' }\n\t\t\t\t\t\tlabel={ __( 'Show' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdisplayPostContentRadio: 'excerpt',\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\tlabel={ __( 'Show' ) }\n\t\t\t\t\t\t\tselected={ displayPostContentRadio }\n\t\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t\t{ label: __( 'Excerpt' ), value: 'excerpt' },\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'Full post' ),\n\t\t\t\t\t\t\t\t\tvalue: 'full_post',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\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\tdisplayPostContentRadio: 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</ToolsPanelItem>\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<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\texcerptLength !== DEFAULT_EXCERPT_LENGTH\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={ __( 'Max number of words' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\texcerptLength: DEFAULT_EXCERPT_LENGTH,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Max number of words' ) }\n\t\t\t\t\t\t\t\tvalue={ excerptLength }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { excerptLength: value } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmin={ MIN_EXCERPT_LENGTH }\n\t\t\t\t\t\t\t\tmax={ MAX_EXCERPT_LENGTH }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t</ToolsPanel>\n\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Post meta' ) }\n\t\t\t\tresetAll={ () =>\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tdisplayAuthor: false,\n\t\t\t\t\t\tdisplayPostDate: false,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! displayAuthor }\n\t\t\t\t\tlabel={ __( 'Display author name' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { displayAuthor: false } )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display author name' ) }\n\t\t\t\t\t\tchecked={ displayAuthor }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { displayAuthor: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! displayPostDate }\n\t\t\t\t\tlabel={ __( 'Display post date' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { displayPostDate: false } )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display post date' ) }\n\t\t\t\t\t\tchecked={ displayPostDate }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { displayPostDate: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</ToolsPanel>\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: 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;AAcA,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;AAMA,IAAAY,MAAA,GAAAZ,OAAA;AAAgE,IAAAa,WAAA,GAAAb,OAAA;AAvDhE;AACA;AACA;;AAGA;AACA;AACA;;AAuCA;AACA;AACA;;AASA;AACA;AACA,GACA,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G,CAACrB,IAAI,CAAC;YAC/B;UAAG,CACH,CACD;QAAA,GAhEOhL,IAAI,CAACyD,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","_hooks","_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","dropdownMenuProps","useToolsPanelDropdownMenuProps","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","useDispatch","noticeStore","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","__experimentalToolsPanel","resetAll","DEFAULT_EXCERPT_LENGTH","jsx","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked","onChange","RadioControl","selected","options","RangeControl","__next40pxDefaultSize","min","MIN_EXCERPT_LENGTH","max","MAX_EXCERPT_LENGTH","PanelBody","title","Fragment","__experimentalImageSizeControl","newAttrs","hasOwnProperty","imageWidth","imageHeight","imageSizeHelp","onChangeImage","undefined","__experimentalToggleGroupControl","className","__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\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\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\tDEFAULT_EXCERPT_LENGTH,\n} from './constants';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\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 dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\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 } = useDispatch( noticeStore );\n\tconst showRedirectionPreventedNotice = ( event ) => {\n\t\tevent.preventDefault();\n\t\tcreateWarningNotice( __( 'Links are disabled in the editor.' ), {\n\t\t\tid: `block-library/core/latest-posts/redirection-prevented/${ instanceId }`,\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<ToolsPanel\n\t\t\t\tlabel={ __( 'Post content' ) }\n\t\t\t\tresetAll={ () =>\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tdisplayPostContent: false,\n\t\t\t\t\t\tdisplayPostContentRadio: 'excerpt',\n\t\t\t\t\t\texcerptLength: DEFAULT_EXCERPT_LENGTH,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! displayPostContent }\n\t\t\t\t\tlabel={ __( 'Post content' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { displayPostContent: false } )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Post content' ) }\n\t\t\t\t\t\tchecked={ displayPostContent }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { displayPostContent: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t\t{ displayPostContent && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => displayPostContentRadio !== 'excerpt' }\n\t\t\t\t\t\tlabel={ __( 'Show' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdisplayPostContentRadio: 'excerpt',\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\tlabel={ __( 'Show' ) }\n\t\t\t\t\t\t\tselected={ displayPostContentRadio }\n\t\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t\t{ label: __( 'Excerpt' ), value: 'excerpt' },\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'Full post' ),\n\t\t\t\t\t\t\t\t\tvalue: 'full_post',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\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\tdisplayPostContentRadio: 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</ToolsPanelItem>\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<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\texcerptLength !== DEFAULT_EXCERPT_LENGTH\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={ __( 'Max number of words' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\texcerptLength: DEFAULT_EXCERPT_LENGTH,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Max number of words' ) }\n\t\t\t\t\t\t\t\tvalue={ excerptLength }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { excerptLength: value } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmin={ MIN_EXCERPT_LENGTH }\n\t\t\t\t\t\t\t\tmax={ MAX_EXCERPT_LENGTH }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t</ToolsPanel>\n\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Post meta' ) }\n\t\t\t\tresetAll={ () =>\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tdisplayAuthor: false,\n\t\t\t\t\t\tdisplayPostDate: false,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! displayAuthor }\n\t\t\t\t\tlabel={ __( 'Display author name' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { displayAuthor: false } )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display author name' ) }\n\t\t\t\t\t\tchecked={ displayAuthor }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { displayAuthor: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! displayPostDate }\n\t\t\t\t\tlabel={ __( 'Display post date' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { displayPostDate: false } )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display post date' ) }\n\t\t\t\t\t\tchecked={ displayPostDate }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { displayPostDate: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</ToolsPanel>\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: 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;AAcA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,O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AAA6G,cAAQ,EAAE5C,UAAU,EAAExK,IAAI,CAACiN,QAAS;UAAC,CAClC,CACN,EACCvL,kBAAkB,IACnBD,uBAAuB,KAAK,SAAS,iBACpC,IAAAhC,WAAA,CAAAkH,GAAA;YAAK8B,SAAS,EAAC,qCAAqC;YAAAlC,QAAA,EACjD+F;UAAW,CACT,CACL,EACA5K,kBAAkB,IACnBD,uBAAuB,KAAK,WAAW,iBACtC,IAAAhC,WAAA,CAAAkH,GAAA;YACC8B,SAAS,EAAC,0CAA0C;YACpDsE,uBAAuB,EAAG;cACzBC,MAAM,EAAEhN,IAAI,CAACqN,OAAO,CAAChB,GAAG,CAACrB,IAAI,CAAC;YAC/B;UAAG,CACH,CACD;QAAA,GAhEOhL,IAAI,CAACyD,EAiEX,CAAC;MAEP,CAAE;IAAC,CACA,CAAC;EAAA,CACJ,CAAC;AAEL","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_richText","_utils","getListContentSchema","phrasingContentSchema","listContentSchema","ul","ol","attributes","forEach","tag","children","li","getListContentFlat","blocks","flatMap","name","innerBlocks","content","transforms","from","type","isMultiBlock","transform","blockAttributes","childBlocks","length","map","createBlock","value","create","html","split","result","toHTMLString","anchor","selector","schema","args","createListBlockFromDOMElement","prefix","ordered","to","block","_attributes","_default","exports","default"],"sources":["@wordpress/block-library/src/list/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { create, split, toHTMLString } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport { createListBlockFromDOMElement } from './utils';\n\nfunction getListContentSchema( { phrasingContentSchema } ) {\n\tconst listContentSchema = {\n\t\t...phrasingContentSchema,\n\t\tul: {},\n\t\tol: { attributes: [ 'type', 'start', 'reversed' ] },\n\t};\n\n\t// Recursion is needed.\n\t// Possible: ul > li > ul.\n\t// Impossible: ul > ul.\n\t[ 'ul', 'ol' ].forEach( ( tag ) => {\n\t\tlistContentSchema[ tag ].children = {\n\t\t\tli: {\n\t\t\t\tchildren: listContentSchema,\n\t\t\t},\n\t\t};\n\t} );\n\n\treturn listContentSchema;\n}\n\nfunction getListContentFlat( blocks ) {\n\treturn blocks.flatMap( ( { name, attributes, innerBlocks = [] } ) => {\n\t\tif ( name === 'core/list-item' ) {\n\t\t\treturn [ attributes.content, ...getListContentFlat( innerBlocks ) ];\n\t\t}\n\t\treturn getListContentFlat( innerBlocks );\n\t} );\n}\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ 'core/paragraph', 'core/heading' ],\n\t\t\ttransform: ( blockAttributes ) => {\n\t\t\t\tlet childBlocks = [];\n\t\t\t\tif ( blockAttributes.length > 1 ) {\n\t\t\t\t\tchildBlocks = blockAttributes.map( ( { content } ) => {\n\t\t\t\t\t\treturn createBlock( 'core/list-item', { content } );\n\t\t\t\t\t} );\n\t\t\t\t} else if ( blockAttributes.length === 1 ) {\n\t\t\t\t\tconst value = create( {\n\t\t\t\t\t\thtml: blockAttributes[ 0 ].content,\n\t\t\t\t\t} );\n\t\t\t\t\tchildBlocks = split( value, '\\n' ).map( ( result ) => {\n\t\t\t\t\t\treturn createBlock( 'core/list-item', {\n\t\t\t\t\t\t\tcontent: toHTMLString( { value: result } ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/list',\n\t\t\t\t\t{\n\t\t\t\t\t\tanchor: blockAttributes.anchor,\n\t\t\t\t\t},\n\t\t\t\t\tchildBlocks\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'ol,ul',\n\t\t\tschema: ( args ) => ( {\n\t\t\t\tol: getListContentSchema( args ).ol,\n\t\t\t\tul: getListContentSchema( args ).ul,\n\t\t\t} ),\n\t\t\ttransform: createListBlockFromDOMElement,\n\t\t},\n\t\t...[ '*', '-' ].map( ( prefix ) => ( {\n\t\t\ttype: 'prefix',\n\t\t\tprefix,\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock( 'core/list', {}, [\n\t\t\t\t\tcreateBlock( 'core/list-item', { content } ),\n\t\t\t\t] );\n\t\t\t},\n\t\t} ) ),\n\t\t...[ '1.', '1)' ].map( ( prefix ) => ( {\n\t\t\ttype: 'prefix',\n\t\t\tprefix,\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/list',\n\t\t\t\t\t{\n\t\t\t\t\t\tordered: true,\n\t\t\t\t\t},\n\t\t\t\t\t[ createBlock( 'core/list-item', { content } ) ]\n\t\t\t\t);\n\t\t\t},\n\t\t} ) ),\n\t],\n\tto: [\n\t\t...[ 'core/paragraph', 'core/heading' ].map( ( block ) => ( {\n\t\t\ttype: 'block',\n\t\t\tblocks: [ block ],\n\t\t\ttransform: ( _attributes, childBlocks ) => {\n\t\t\t\treturn getListContentFlat( childBlocks ).map( ( content ) =>\n\t\t\t\t\tcreateBlock( block, {\n\t\t\t\t\t\tcontent,\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,OAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASG,oBAAoBA,CAAE;EAAEC;AAAsB,CAAC,EAAG;EAC1D,MAAMC,iBAAiB,GAAG;IACzB,GAAGD,qBAAqB;IACxBE,EAAE,EAAE,CAAC,CAAC;IACNC,EAAE,EAAE;MAAEC,UAAU,EAAE,CAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IAAG;EACnD,CAAC;;EAED;EACA;E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ACL;EACDwB,EAAE,EAAE,CACH,GAAG,CAAE,gBAAgB,EAAE,cAAc,CAAE,CAACf,GAAG,CAAIgB,KAAK,KAAQ;IAC3DtB,IAAI,EAAE,OAAO;IACbP,MAAM,EAAE,CAAE6B,KAAK,CAAE;IACjBpB,SAAS,EAAEA,CAAEqB,WAAW,EAAEnB,WAAW,KAAM;MAC1C,OAAOZ,kBAAkB,CAAEY,WAAY,CAAC,CAACE,GAAG,CAAIT,OAAO,IACtD,IAAAU,mBAAW,EAAEe,KAAK,EAAE;QACnBzB;MACD,CAAE,CACH,CAAC;IACF;EACD,CAAC,CAAG,CAAC;AAEP,CAAC;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa5B,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_richText","_utils","getListContentSchema","phrasingContentSchema","listContentSchema","ul","ol","attributes","forEach","tag","children","li","getListContentFlat","blocks","flatMap","name","innerBlocks","content","transforms","from","type","isMultiBlock","transform","blockAttributes","childBlocks","length","map","createBlock","value","create","html","split","result","toHTMLString","anchor","selector","schema","args","createListBlockFromDOMElement","prefix","ordered","to","block","_attributes","_default","exports","default"],"sources":["@wordpress/block-library/src/list/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { create, split, toHTMLString } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport { createListBlockFromDOMElement } from './utils';\n\nfunction getListContentSchema( { phrasingContentSchema } ) {\n\tconst listContentSchema = {\n\t\t...phrasingContentSchema,\n\t\tul: {},\n\t\tol: { attributes: [ 'type', 'start', 'reversed' ] },\n\t};\n\n\t// Recursion is needed.\n\t// Possible: ul > li > ul.\n\t// Impossible: ul > ul.\n\t[ 'ul', 'ol' ].forEach( ( tag ) => {\n\t\tlistContentSchema[ tag ].children = {\n\t\t\tli: {\n\t\t\t\tchildren: listContentSchema,\n\t\t\t},\n\t\t};\n\t} );\n\n\treturn listContentSchema;\n}\n\nfunction getListContentFlat( blocks ) {\n\treturn blocks.flatMap( ( { name, attributes, innerBlocks = [] } ) => {\n\t\tif ( name === 'core/list-item' ) {\n\t\t\treturn [ attributes.content, ...getListContentFlat( innerBlocks ) ];\n\t\t}\n\t\treturn getListContentFlat( innerBlocks );\n\t} );\n}\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ 'core/paragraph', 'core/heading' ],\n\t\t\ttransform: ( blockAttributes ) => {\n\t\t\t\tlet childBlocks = [];\n\t\t\t\tif ( blockAttributes.length > 1 ) {\n\t\t\t\t\tchildBlocks = blockAttributes.map( ( { content } ) => {\n\t\t\t\t\t\treturn createBlock( 'core/list-item', { content } );\n\t\t\t\t\t} );\n\t\t\t\t} else if ( blockAttributes.length === 1 ) {\n\t\t\t\t\tconst value = create( {\n\t\t\t\t\t\thtml: blockAttributes[ 0 ].content,\n\t\t\t\t\t} );\n\t\t\t\t\tchildBlocks = split( value, '\\n' ).map( ( result ) => {\n\t\t\t\t\t\treturn createBlock( 'core/list-item', {\n\t\t\t\t\t\t\tcontent: toHTMLString( { value: result } ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/list',\n\t\t\t\t\t{\n\t\t\t\t\t\tanchor: blockAttributes.anchor,\n\t\t\t\t\t},\n\t\t\t\t\tchildBlocks\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'ol,ul',\n\t\t\tschema: ( args ) => ( {\n\t\t\t\tol: getListContentSchema( args ).ol,\n\t\t\t\tul: getListContentSchema( args ).ul,\n\t\t\t} ),\n\t\t\ttransform: createListBlockFromDOMElement,\n\t\t},\n\t\t...[ '*', '-' ].map( ( prefix ) => ( {\n\t\t\ttype: 'prefix',\n\t\t\tprefix,\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock( 'core/list', {}, [\n\t\t\t\t\tcreateBlock( 'core/list-item', { content } ),\n\t\t\t\t] );\n\t\t\t},\n\t\t} ) ),\n\t\t...[ '1.', '1)' ].map( ( prefix ) => ( {\n\t\t\ttype: 'prefix',\n\t\t\tprefix,\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/list',\n\t\t\t\t\t{\n\t\t\t\t\t\tordered: true,\n\t\t\t\t\t},\n\t\t\t\t\t[ createBlock( 'core/list-item', { content } ) ]\n\t\t\t\t);\n\t\t\t},\n\t\t} ) ),\n\t],\n\tto: [\n\t\t...[ 'core/paragraph', 'core/heading' ].map( ( block ) => ( {\n\t\t\ttype: 'block',\n\t\t\tblocks: [ block ],\n\t\t\ttransform: ( _attributes, childBlocks ) => {\n\t\t\t\treturn getListContentFlat( childBlocks ).map( ( content ) =>\n\t\t\t\t\tcreateBlock( block, {\n\t\t\t\t\t\tcontent,\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,OAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASG,oBAAoBA,CAAE;EAAEC;AAAsB,CAAC,EAAG;EAC1D,MAAMC,iBAAiB,GAAG;IACzB,GAAGD,qBAAqB;IACxBE,EAAE,EAAE,CAAC,CAAC;IACNC,EAAE,EAAE;MAAEC,UAAU,EAAE,CAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IAAG;EACnD,CAAC;;EAED;EACA;EACA;EACA,CAAE,IAAI,EAAE,IAAI,CAAE,CAACC,OAAO,CAAIC,GAAG,IAAM;IAClCL,iBAAiB,CAAEK,GAAG,CAAE,CAACC,QAAQ,GAAG;MACnCC,EAAE,EAAE;QACHD,QAAQ,EAAEN;MACX;IACD,CAAC;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,EAAEA,CAAEqB,WAAW,EAAEnB,WAAW,KAAM;MAC1C,OAAOZ,kBAAkB,CAAEY,WAAY,CAAC,CAACE,GAAG,CAAIT,OAAO,IACtD,IAAAU,mBAAW,EAAEe,KAAK,EAAE;QACnBzB;MACD,CAAE,CACH,CAAC;IACF;EACD,CAAC,CAAG,CAAC;AAEP,CAAC;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa5B,UAAU","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","LIST_STYLES","A","a","I","i","createListBlockFromDOMElement","listElement","type","getAttribute","listAttributes","ordered","tagName","anchor","id","undefined","start","parseInt","reversed","hasAttribute","innerBlocks","Array","from","children","map","listItem","childNodes","filter","node","nodeType","TEXT_NODE","textContent","trim","length","reverse","nestedList","nodes","hasNestedList","createBlock","content","innerHTML","htmlNodes","outerHTML","childAttributes","join","childInnerBlocks","migrateToListV2","attributes","values","otherAttributes","list","document","createElement","setAttribute","listBlock","rawHandler","HTML","migrateTypeToInlineStyle"],"sources":["@wordpress/block-library/src/list/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, rawHandler } from '@wordpress/blocks';\n\nconst LIST_STYLES = {\n\tA: 'upper-alpha',\n\ta: 'lower-alpha',\n\tI: 'upper-roman',\n\ti: 'lower-roman',\n};\n\nexport function createListBlockFromDOMElement( listElement ) {\n\tconst type = listElement.getAttribute( 'type' );\n\tconst listAttributes = {\n\t\tordered: 'OL' === listElement.tagName,\n\t\tanchor: listElement.id === '' ? undefined : listElement.id,\n\t\tstart: listElement.getAttribute( 'start' )\n\t\t\t? parseInt( listElement.getAttribute( 'start' ), 10 )\n\t\t\t: undefined,\n\t\treversed: listElement.hasAttribute( 'reversed' ) ? true : undefined,\n\t\ttype: type && LIST_STYLES[ type ] ? LIST_STYLES[ type ] : undefined,\n\t};\n\n\tconst innerBlocks = Array.from( listElement.children ).map(\n\t\t( listItem ) => {\n\t\t\tconst children = Array.from( listItem.childNodes ).filter(\n\t\t\t\t( node ) =>\n\t\t\t\t\tnode.nodeType !== node.TEXT_NODE ||\n\t\t\t\t\tnode.textContent.trim().length !== 0\n\t\t\t);\n\t\t\tchildren.reverse();\n\t\t\tconst [ nestedList, ...nodes ] = children;\n\n\t\t\tconst hasNestedList =\n\t\t\t\tnestedList?.tagName === 'UL' || nestedList?.tagName === 'OL';\n\t\t\tif ( ! hasNestedList ) {\n\t\t\t\treturn createBlock( 'core/list-item', {\n\t\t\t\t\tcontent: listItem.innerHTML,\n\t\t\t\t} );\n\t\t\t}\n\t\t\tconst htmlNodes = nodes.map( ( node ) => {\n\t\t\t\tif ( node.nodeType === node.TEXT_NODE ) {\n\t\t\t\t\treturn node.textContent;\n\t\t\t\t}\n\t\t\t\treturn node.outerHTML;\n\t\t\t} );\n\t\t\thtmlNodes.reverse();\n\t\t\tconst childAttributes = {\n\t\t\t\tcontent: htmlNodes.join( '' ).trim(),\n\t\t\t};\n\t\t\tconst childInnerBlocks = [\n\t\t\t\tcreateListBlockFromDOMElement( nestedList ),\n\t\t\t];\n\t\t\treturn createBlock(\n\t\t\t\t'core/list-item',\n\t\t\t\tchildAttributes,\n\t\t\t\tchildInnerBlocks\n\t\t\t);\n\t\t}\n\t);\n\n\treturn createBlock( 'core/list', listAttributes, innerBlocks );\n}\n\nexport function migrateToListV2( attributes ) {\n\tconst { values, start, reversed, ordered, type, ...otherAttributes } =\n\t\tattributes;\n\n\tconst list = document.createElement( ordered ? 'ol' : 'ul' );\n\tlist.innerHTML = values;\n\tif ( start ) {\n\t\tlist.setAttribute( 'start', start );\n\t}\n\tif ( reversed ) {\n\t\tlist.setAttribute( 'reversed', true );\n\t}\n\tif ( type ) {\n\t\tlist.setAttribute( 'type', type );\n\t}\n\n\tconst [ listBlock ] = rawHandler( { HTML: list.outerHTML } );\n\n\treturn [\n\t\t{ ...otherAttributes, ...listBlock.attributes },\n\t\tlistBlock.innerBlocks,\n\t];\n}\n\nexport function migrateTypeToInlineStyle( attributes ) {\n\tconst { type } = attributes;\n\n\tif ( type && LIST_STYLES[ type ] ) {\n\t\treturn {\n\t\t\t...attributes,\n\t\t\ttype: LIST_STYLES[ type ],\n\t\t};\n\t}\n\n\treturn attributes;\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,WAAW,GAAG;EACnBC,CAAC,EAAE,aAAa;EAChBC,CAAC,EAAE,aAAa;EAChBC,CAAC,EAAE,aAAa;EAChBC,CAAC,EAAE;AACJ,CAAC;AAEM,SAASC,6BAA6BA,CAAEC,WAAW,EAAG;EAC5D,MAAMC,IAAI,GAAGD,WAAW,CAACE,YAAY,CAAE,MAAO,CAAC;EAC/C,MAAMC,cAAc,GAAG;IACtBC,OAAO,EAAE,IAAI,KAAKJ,WAAW,CAACK,OAAO;IACrCC,MAAM,EAAEN,WAAW,CAACO,EAAE,KAAK,EAAE,GAAGC,SAAS,GAAGR,WAAW,CAACO,EAAE;IAC1DE,KAAK,EAAET,WAAW,CAACE,YAAY,CAAE,OAAQ,CAAC,GACvCQ,QAAQ,CAAEV,WAAW,CAACE,YAAY,CAAE,OAAQ,CAAC,EAAE,EAAG,CAAC,GACnDM,SAAS;IACZG,QAAQ,EAAEX,WAAW,CAACY,YAAY,CAAE,UAAW,CAAC,GAAG,IAAI,GAAGJ,SAAS;IACnEP,IAAI,EAAEA,IAAI,IAAIP,WAAW,CAAEO,IAAI,CAAE,GAAGP,WAAW,CAAEO,IAAI,CAAE,GAAGO;EAC3D,CAAC;EAED,MAAMK,WAAW,GAAGC,KAAK,CAACC,IAAI,CAAEf,WAAW,CAACgB,QAAS,CAAC,CAACC,GAAG,CACvDC,QAAQ,IAAM;IACf,MAAMF,QAAQ,GAAGF,KAAK,CAACC,IAAI,CAAEG,QAAQ,CAACC,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AE,GAAGyC;EAAgB,CAAC,GACnEF,UAAU;EAEX,MAAMG,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAEzC,OAAO,GAAG,IAAI,GAAG,IAAK,CAAC;EAC5DuC,IAAI,CAACV,SAAS,GAAGQ,MAAM;EACvB,IAAKhC,KAAK,EAAG;IACZkC,IAAI,CAACG,YAAY,CAAE,OAAO,EAAErC,KAAM,CAAC;EACpC;EACA,IAAKE,QAAQ,EAAG;IACfgC,IAAI,CAACG,YAAY,CAAE,UAAU,EAAE,IAAK,CAAC;EACtC;EACA,IAAK7C,IAAI,EAAG;IACX0C,IAAI,CAACG,YAAY,CAAE,MAAM,EAAE7C,IAAK,CAAC;EAClC;EAEA,MAAM,CAAE8C,SAAS,CAAE,GAAG,IAAAC,kBAAU,EAAE;IAAEC,IAAI,EAAEN,IAAI,CAACR;EAAU,CAAE,CAAC;EAE5D,OAAO,CACN;IAAE,GAAGO,eAAe;IAAE,GAAGK,SAAS,CAACP;EAAW,CAAC,EAC/CO,SAAS,CAAClC,WAAW,CACrB;AACF;AAEO,SAASqC,wBAAwBA,CAAEV,UAAU,EAAG;EACtD,MAAM;IAAEvC;EAAK,CAAC,GAAGuC,UAAU;EAE3B,IAAKvC,IAAI,IAAIP,WAAW,CAAEO,IAAI,CAAE,EAAG;IAClC,OAAO;MACN,GAAGuC,UAAU;MACbvC,IAAI,EAAEP,WAAW,CAAEO,IAAI;IACxB,CAAC;EACF;EAEA,OAAOuC,UAAU;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","LIST_STYLES","A","a","I","i","createListBlockFromDOMElement","listElement","type","getAttribute","listAttributes","ordered","tagName","anchor","id","undefined","start","parseInt","reversed","hasAttribute","innerBlocks","Array","from","children","map","listItem","childNodes","filter","node","nodeType","TEXT_NODE","textContent","trim","length","reverse","nestedList","nodes","hasNestedList","createBlock","content","innerHTML","htmlNodes","outerHTML","childAttributes","join","childInnerBlocks","migrateToListV2","attributes","values","otherAttributes","list","document","createElement","setAttribute","listBlock","rawHandler","HTML","migrateTypeToInlineStyle"],"sources":["@wordpress/block-library/src/list/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, rawHandler } from '@wordpress/blocks';\n\nconst LIST_STYLES = {\n\tA: 'upper-alpha',\n\ta: 'lower-alpha',\n\tI: 'upper-roman',\n\ti: 'lower-roman',\n};\n\nexport function createListBlockFromDOMElement( listElement ) {\n\tconst type = listElement.getAttribute( 'type' );\n\tconst listAttributes = {\n\t\tordered: 'OL' === listElement.tagName,\n\t\tanchor: listElement.id === '' ? undefined : listElement.id,\n\t\tstart: listElement.getAttribute( 'start' )\n\t\t\t? parseInt( listElement.getAttribute( 'start' ), 10 )\n\t\t\t: undefined,\n\t\treversed: listElement.hasAttribute( 'reversed' ) ? true : undefined,\n\t\ttype: type && LIST_STYLES[ type ] ? LIST_STYLES[ type ] : undefined,\n\t};\n\n\tconst innerBlocks = Array.from( listElement.children ).map(\n\t\t( listItem ) => {\n\t\t\tconst children = Array.from( listItem.childNodes ).filter(\n\t\t\t\t( node ) =>\n\t\t\t\t\tnode.nodeType !== node.TEXT_NODE ||\n\t\t\t\t\tnode.textContent.trim().length !== 0\n\t\t\t);\n\t\t\tchildren.reverse();\n\t\t\tconst [ nestedList, ...nodes ] = children;\n\n\t\t\tconst hasNestedList =\n\t\t\t\tnestedList?.tagName === 'UL' || nestedList?.tagName === 'OL';\n\t\t\tif ( ! hasNestedList ) {\n\t\t\t\treturn createBlock( 'core/list-item', {\n\t\t\t\t\tcontent: listItem.innerHTML,\n\t\t\t\t} );\n\t\t\t}\n\t\t\tconst htmlNodes = nodes.map( ( node ) => {\n\t\t\t\tif ( node.nodeType === node.TEXT_NODE ) {\n\t\t\t\t\treturn node.textContent;\n\t\t\t\t}\n\t\t\t\treturn node.outerHTML;\n\t\t\t} );\n\t\t\thtmlNodes.reverse();\n\t\t\tconst childAttributes = {\n\t\t\t\tcontent: htmlNodes.join( '' ).trim(),\n\t\t\t};\n\t\t\tconst childInnerBlocks = [\n\t\t\t\tcreateListBlockFromDOMElement( nestedList ),\n\t\t\t];\n\t\t\treturn createBlock(\n\t\t\t\t'core/list-item',\n\t\t\t\tchildAttributes,\n\t\t\t\tchildInnerBlocks\n\t\t\t);\n\t\t}\n\t);\n\n\treturn createBlock( 'core/list', listAttributes, innerBlocks );\n}\n\nexport function migrateToListV2( attributes ) {\n\tconst { values, start, reversed, ordered, type, ...otherAttributes } =\n\t\tattributes;\n\n\tconst list = document.createElement( ordered ? 'ol' : 'ul' );\n\tlist.innerHTML = values;\n\tif ( start ) {\n\t\tlist.setAttribute( 'start', start );\n\t}\n\tif ( reversed ) {\n\t\tlist.setAttribute( 'reversed', true );\n\t}\n\tif ( type ) {\n\t\tlist.setAttribute( 'type', type );\n\t}\n\n\tconst [ listBlock ] = rawHandler( { HTML: list.outerHTML } );\n\n\treturn [\n\t\t{ ...otherAttributes, ...listBlock.attributes },\n\t\tlistBlock.innerBlocks,\n\t];\n}\n\nexport function migrateTypeToInlineStyle( attributes ) {\n\tconst { type } = attributes;\n\n\tif ( type && LIST_STYLES[ type ] ) {\n\t\treturn {\n\t\t\t...attributes,\n\t\t\ttype: LIST_STYLES[ type ],\n\t\t};\n\t}\n\n\treturn attributes;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,WAAW,GAAG;EACnBC,CAAC,EAAE,aAAa;EAChBC,CAAC,EAAE,aAAa;EAChBC,CAAC,EAAE,aAAa;EAChBC,CAAC,EAAE;AACJ,CAAC;AAEM,SAASC,6BAA6BA,CAAEC,WAAW,EAAG;EAC5D,MAAMC,IAAI,GAAGD,WAAW,CAACE,YAAY,CAAE,MAAO,CAAC;EAC/C,MAAMC,cAAc,GAAG;IACtBC,OAAO,EAAE,IAAI,KAAKJ,WAAW,CAACK,OAAO;IACrCC,MAAM,EAAEN,WAAW,CAACO,EAAE,KAAK,EAAE,GAAGC,SAAS,GAAG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EAAG;EACtD,MAAM;IAAEvC;EAAK,CAAC,GAAGuC,UAAU;EAE3B,IAAKvC,IAAI,IAAIP,WAAW,CAAEO,IAAI,CAAE,EAAG;IAClC,OAAO;MACN,GAAGuC,UAAU;MACbvC,IAAI,EAAEP,WAAW,CAAEO,IAAI;IACxB,CAAC;EACF;EAEA,OAAOuC,UAAU;AAClB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_blockEditor","_blocks","useIndentListItem","clientId","replaceBlocks","selectionChange","multiSelect","useDispatch","blockEditorStore","getBlock","getPreviousBlockClientId","getSelectionStart","getSelectionEnd","hasMultiSelection","getMultiSelectedBlockClientIds","useSelect","useCallback","_hasMultiSelection","clientIds","clonedBlocks","map","_clientId","cloneBlock","previousSiblingId","newListItem","innerBlocks","length","createBlock","push","selectionStart","selectionEnd","attributeKey","offset"],"sources":["@wordpress/block-library/src/list-item/hooks/use-indent-list-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock, cloneBlock } from '@wordpress/blocks';\n\nexport default function useIndentListItem( clientId ) {\n\tconst { replaceBlocks, selectionChange, multiSelect } =\n\t\tuseDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlock,\n\t\tgetPreviousBlockClientId,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\thasMultiSelection,\n\t\tgetMultiSelectedBlockClientIds,\n\t} = useSelect( blockEditorStore );\n\treturn useCallback( () => {\n\t\tconst _hasMultiSelection = hasMultiSelection();\n\t\tconst clientIds = _hasMultiSelection\n\t\t\t? getMultiSelectedBlockClientIds()\n\t\t\t: [ clientId ];\n\t\tconst clonedBlocks = clientIds.map( ( _clientId ) =>\n\t\t\tcloneBlock( getBlock( _clientId ) )\n\t\t);\n\t\tconst previousSiblingId = getPreviousBlockClientId( clientId );\n\t\tconst newListItem = cloneBlock( getBlock( previousSiblingId ) );\n\t\t// If the sibling has no innerBlocks, create a new `list` block.\n\t\tif ( ! newListItem.innerBlocks?.length ) {\n\t\t\tnewListItem.innerBlocks = [ createBlock( 'core/list' ) ];\n\t\t}\n\t\t// A list item usually has one `list`, but it's possible to have\n\t\t// more. So we need to preserve the previous `list` blocks and\n\t\t// merge the new blocks to the last `list`.\n\t\tnewListItem.innerBlocks[\n\t\t\tnewListItem.innerBlocks.length - 1\n\t\t].innerBlocks.push( ...clonedBlocks );\n\n\t\t// We get the selection start/end here, because when\n\t\t// we replace blocks, the selection is updated too.\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\t\t// Replace the previous sibling of the block being indented and the indented blocks,\n\t\t// with a new block whose attributes are equal to the ones of the previous sibling and\n\t\t// whose descendants are the children of the previous sibling, followed by the indented blocks.\n\t\treplaceBlocks( [ previousSiblingId, ...clientIds ], [ newListItem ] );\n\t\tif ( ! _hasMultiSelection ) {\n\t\t\tselectionChange(\n\t\t\t\tclonedBlocks[ 0 ].clientId,\n\t\t\t\tselectionEnd.attributeKey,\n\t\t\t\tselectionEnd.clientId === selectionStart.clientId\n\t\t\t\t\t? selectionStart.offset\n\t\t\t\t\t: selectionEnd.offset,\n\t\t\t\tselectionEnd.offset\n\t\t\t);\n\t\t} else {\n\t\t\tmultiSelect(\n\t\t\t\tclonedBlocks[ 0 ].clientId,\n\t\t\t\tclonedBlocks[ clonedBlocks.length - 1 ].clientId\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}, [ clientId ] );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAM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IAAK,CAAEP,kBAAkB,EAAG;MAC3BZ,eAAe,CACdc,YAAY,CAAE,CAAC,CAAE,CAAChB,QAAQ,EAC1B2B,YAAY,CAACC,YAAY,EACzBD,YAAY,CAAC3B,QAAQ,KAAK0B,cAAc,CAAC1B,QAAQ,GAC9C0B,cAAc,CAACG,MAAM,GACrBF,YAAY,CAACE,MAAM,EACtBF,YAAY,CAACE,MACd,CAAC;IACF,CAAC,MAAM;MACN1B,WAAW,CACVa,YAAY,CAAE,CAAC,CAAE,CAAChB,QAAQ,EAC1BgB,YAAY,CAAEA,YAAY,CAACO,MAAM,GAAG,CAAC,CAAE,CAACvB,QACzC,CAAC;IACF;IAEA,OAAO,IAAI;EACZ,CAAC,EAAE,CAAEA,QAAQ,CAAG,CAAC;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_blockEditor","_blocks","useIndentListItem","clientId","replaceBlocks","selectionChange","multiSelect","useDispatch","blockEditorStore","getBlock","getPreviousBlockClientId","getSelectionStart","getSelectionEnd","hasMultiSelection","getMultiSelectedBlockClientIds","useSelect","useCallback","_hasMultiSelection","clientIds","clonedBlocks","map","_clientId","cloneBlock","previousSiblingId","newListItem","innerBlocks","length","createBlock","push","selectionStart","selectionEnd","attributeKey","offset"],"sources":["@wordpress/block-library/src/list-item/hooks/use-indent-list-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock, cloneBlock } from '@wordpress/blocks';\n\nexport default function useIndentListItem( clientId ) {\n\tconst { replaceBlocks, selectionChange, multiSelect } =\n\t\tuseDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlock,\n\t\tgetPreviousBlockClientId,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\thasMultiSelection,\n\t\tgetMultiSelectedBlockClientIds,\n\t} = useSelect( blockEditorStore );\n\treturn useCallback( () => {\n\t\tconst _hasMultiSelection = hasMultiSelection();\n\t\tconst clientIds = _hasMultiSelection\n\t\t\t? getMultiSelectedBlockClientIds()\n\t\t\t: [ clientId ];\n\t\tconst clonedBlocks = clientIds.map( ( _clientId ) =>\n\t\t\tcloneBlock( getBlock( _clientId ) )\n\t\t);\n\t\tconst previousSiblingId = getPreviousBlockClientId( clientId );\n\t\tconst newListItem = cloneBlock( getBlock( previousSiblingId ) );\n\t\t// If the sibling has no innerBlocks, create a new `list` block.\n\t\tif ( ! newListItem.innerBlocks?.length ) {\n\t\t\tnewListItem.innerBlocks = [ createBlock( 'core/list' ) ];\n\t\t}\n\t\t// A list item usually has one `list`, but it's possible to have\n\t\t// more. So we need to preserve the previous `list` blocks and\n\t\t// merge the new blocks to the last `list`.\n\t\tnewListItem.innerBlocks[\n\t\t\tnewListItem.innerBlocks.length - 1\n\t\t].innerBlocks.push( ...clonedBlocks );\n\n\t\t// We get the selection start/end here, because when\n\t\t// we replace blocks, the selection is updated too.\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\t\t// Replace the previous sibling of the block being indented and the indented blocks,\n\t\t// with a new block whose attributes are equal to the ones of the previous sibling and\n\t\t// whose descendants are the children of the previous sibling, followed by the indented blocks.\n\t\treplaceBlocks( [ previousSiblingId, ...clientIds ], [ newListItem ] );\n\t\tif ( ! _hasMultiSelection ) {\n\t\t\tselectionChange(\n\t\t\t\tclonedBlocks[ 0 ].clientId,\n\t\t\t\tselectionEnd.attributeKey,\n\t\t\t\tselectionEnd.clientId === selectionStart.clientId\n\t\t\t\t\t? selectionStart.offset\n\t\t\t\t\t: selectionEnd.offset,\n\t\t\t\tselectionEnd.offset\n\t\t\t);\n\t\t} else {\n\t\t\tmultiSelect(\n\t\t\t\tclonedBlocks[ 0 ].clientId,\n\t\t\t\tclonedBlocks[ clonedBlocks.length - 1 ].clientId\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}, [ clientId ] );\n}\n"],"mapp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,MAAMmB,YAAY,GAAGlB,eAAe,CAAC,CAAC;IACtC;IACA;IACA;IACAR,aAAa,CAAE,CAAEmB,iBAAiB,EAAE,GAAGL,SAAS,CAAE,EAAE,CAAEM,WAAW,CAAG,CAAC;IACrE,IAAK,CAAEP,kBAAkB,EAAG;MAC3BZ,eAAe,CACdc,YAAY,CAAE,CAAC,CAAE,CAAChB,QAAQ,EAC1B2B,YAAY,CAACC,YAAY,EACzBD,YAAY,CAAC3B,QAAQ,KAAK0B,cAAc,CAAC1B,QAAQ,GAC9C0B,cAAc,CAACG,MAAM,GACrBF,YAAY,CAACE,MAAM,EACtBF,YAAY,CAACE,MACd,CAAC;IACF,CAAC,MAAM;MACN1B,WAAW,CACVa,YAAY,CAAE,CAAC,CAAE,CAAChB,QAAQ,EAC1BgB,YAAY,CAAEA,YAAY,CAACO,MAAM,GAAG,CAAC,CAAE,CAACvB,QACzC,CAAC;IACF;IAEA,OAAO,IAAI;EACZ,CAAC,EAAE,CAAEA,QAAQ,CAAG,CAAC;AAClB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","transforms","to","type","blocks","transform","attributes","innerBlocks","createBlock","map","block","cloneBlock","_default","exports","default"],"sources":["@wordpress/block-library/src/list-item/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, cloneBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\ttransform: ( attributes, innerBlocks = [] ) => [\n\t\t\t\tcreateBlock( 'core/paragraph', attributes ),\n\t\t\t\t...innerBlocks.map( ( block ) => cloneBlock( block ) ),\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,UAAU,GAAG;EAClBC,EAAE,EAAE,CACH;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,gBAAgB,CAAE;IAC5BC,SAAS,EAAEA,CAAEC,UAAU,EAAEC,WAAW,GAAG,EAAE,KAAM,CAC9C,IAAAC,mBAAW,EAAE,gBAAgB,EAAEF,UAAW,CAAC,EAC3C,GAAGC,WAAW,CAACE,GAAG,CAAIC,KAAK,IAAM,IAAAC,kBAAU,EAAED,KAAM,CAAE,CAAC;EAExD,CAAC;AAEH,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEab,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","transforms","to","type","blocks","transform","attributes","innerBlocks","createBlock","map","block","cloneBlock","_default","exports","default"],"sources":["@wordpress/block-library/src/list-item/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, cloneBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\ttransform: ( attributes, innerBlocks = [] ) => [\n\t\t\t\tcreateBlock( 'core/paragraph', attributes ),\n\t\t\t\t...innerBlocks.map( ( block ) => cloneBlock( block ) ),\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,UAAU,GAAG;EAClBC,EAAE,EAAE,CACH;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,gBAAgB,CAAE;IAC5BC,SAAS,EAAEA,CAAEC,UAAU,EAAEC,WAAW,GAAG,EAAE,KAAM,CAC9C,IAAAC,mBAAW,EAAE,gBAAgB,EAAEF,UAAW,CAAC,EAC3C,GAAGC,WAAW,CAACE,GAAG,CAAIC,KAAK,IAAM,IAAAC,kBAAU,EAAED,KAAM,CAAE,CAAC;EAExD,CAAC;AAEH,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEab,UAAU","ignoreList":[]}