@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":["clsx","useSelect","useDispatch","TextControl","TextareaControl","ToolbarButton","ToolbarGroup","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","displayShortcut","isKeyboardEvent","__","BlockControls","InnerBlocks","useInnerBlocksProps","InspectorControls","RichText","useBlockProps","store","blockEditorStore","getColorClassName","isURL","prependHTTP","useState","useEffect","useRef","link","linkIcon","removeSubmenu","speak","createBlock","useMergeRefs","usePrevious","ItemSubmenuIcon","LinkUI","updateAttributes","getColors","getNavigationChildBlockProps","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ALLOWED_BLOCKS","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","NavigationSubmenuEdit","attributes","isSelected","setAttributes","mergeBlocks","onReplace","context","clientId","label","url","description","rel","title","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","__unstableMarkNextChangeAsNotPersistent","replaceBlock","selectBlock","isLinkOpen","setIsLinkOpen","openedBy","setOpenedBy","popoverAnchor","setPopoverAnchor","listItemRef","itemLabelPlaceholder","ref","dropdownMenuProps","parentCount","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasChildren","selectedBlockHasChildren","onlyDescendantIsEmptyLink","select","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","getBlock","getBlockCount","getBlockOrder","_onlyDescendantIsEmptyLink","selectedBlockId","selectedBlockChildren","length","singleBlock","prevHasChildren","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","textColor","customTextColor","backgroundColor","customBackgroundColor","onKeyDown","primary","preventDefault","stopPropagation","blockProps","className","style","color","innerBlocksColors","allowedBlocks","filter","blockName","navigationChildBlockProps","innerBlocksProps","defaultBlock","directInsert","__experimentalCaptureToolbars","renderAppender","ButtonBlockAppender","ParentElement","transformToLink","newLinkBlock","canConvertToLink","children","icon","shortcut","onClick","currentTarget","disabled","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","__next40pxDefaultSize","value","onChange","labelValue","autoComplete","urlValue","descriptionValue","help","titleValue","relValue","identifier","onMerge","placeholder","withoutInteractiveFormatting","onClose","anchor","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP } from '@wordpress/url';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { link as linkIcon, removeSubmenu } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\nimport { createBlock } from '@wordpress/blocks';\nimport { useMergeRefs, usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ItemSubmenuIcon } from './icons';\nimport { LinkUI } from '../navigation-link/link-ui';\nimport { updateAttributes } from '../navigation-link/update-attributes';\nimport {\n\tgetColors,\n\tgetNavigationChildBlockProps,\n} from '../navigation/edit/utils';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst ALLOWED_BLOCKS = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n\t'core/page-list',\n];\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/navigation-link',\n};\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that\n\t\t// doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\n */\n\n/**\n * Navigation Link Block Attributes\n *\n * @typedef {Object} WPNavigationLinkBlockAttributes\n *\n * @property {string} [label] Link text.\n * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.\n * @property {string} [type] The type such as post, page, tag, category and other custom types.\n * @property {string} [rel] The relationship of the linked URL.\n * @property {number} [id] A post or term id.\n * @property {boolean} [opensInNewTab] Sets link target to _blank when true.\n * @property {string} [url] Link href.\n * @property {string} [title] Link title attribute.\n */\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { label, url, description, rel, title } = attributes;\n\n\tconst { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlock,\n\t\tselectBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\t// Store what element opened the popover, so we know where to return focus to (toolbar button vs navigation link text)\n\tconst [ openedBy, setOpenedBy ] = useState( null );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add text…' );\n\tconst ref = useRef();\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst {\n\t\tparentCount,\n\t\tisParentOfSelectedBlock,\n\t\tisImmediateParentOfSelectedBlock,\n\t\thasChildren,\n\t\tselectedBlockHasChildren,\n\t\tonlyDescendantIsEmptyLink,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tlet _onlyDescendantIsEmptyLink;\n\n\t\t\tconst selectedBlockId = getSelectedBlockClientId();\n\n\t\t\tconst selectedBlockChildren = getBlockOrder( selectedBlockId );\n\n\t\t\t// Check for a single descendant in the submenu. If that block\n\t\t\t// is a link block in a \"placeholder\" state with no label then\n\t\t\t// we can consider as an \"empty\" link.\n\t\t\tif ( selectedBlockChildren?.length === 1 ) {\n\t\t\t\tconst singleBlock = getBlock( selectedBlockChildren[ 0 ] );\n\n\t\t\t\t_onlyDescendantIsEmptyLink =\n\t\t\t\t\tsingleBlock?.name === 'core/navigation-link' &&\n\t\t\t\t\t! singleBlock?.attributes?.label;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tparentCount: getBlockParentsByBlockName(\n\t\t\t\t\tclientId,\n\t\t\t\t\t'core/navigation-submenu'\n\t\t\t\t).length,\n\t\t\t\tisParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\tisImmediateParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasChildren: !! getBlockCount( clientId ),\n\t\t\t\tselectedBlockHasChildren: !! selectedBlockChildren?.length,\n\t\t\t\tonlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst prevHasChildren = usePrevious( hasChildren );\n\n\t// Show the LinkControl on mount if the URL is empty\n\t// ( When adding a new menu item)\n\t// This can't be done in the useState call because it conflicts\n\t// with the autofocus behavior of the BlockListBlock component.\n\tuseEffect( () => {\n\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}, [] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, parentCount > 0 );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\t// Required to prevent the command center from opening,\n\t\t\t// as it shares the CMD+K shortcut.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/59845.\n\t\t\tevent.preventDefault();\n\t\t\t// If we don't stop propagation, this event bubbles up to the parent submenu item\n\t\t\tevent.stopPropagation();\n\t\t\tsetIsLinkOpen( true );\n\t\t\tsetOpenedBy( ref.current );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, listItemRef ] ),\n\t\tclassName: clsx( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasChildren,\n\t\t\t'has-text-color': !! textColor || !! customTextColor,\n\t\t\t[ getColorClassName( 'color', textColor ) ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || customBackgroundColor,\n\t\t\t[ getColorClassName( 'background-color', backgroundColor ) ]:\n\t\t\t\t!! backgroundColor,\n\t\t\t'open-on-click': openSubmenusOnClick,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: ! textColor && customTextColor,\n\t\t\tbackgroundColor: ! backgroundColor && customBackgroundColor,\n\t\t},\n\t\tonKeyDown,\n\t} );\n\n\t// Always use overlay colors for submenus.\n\tconst innerBlocksColors = getColors( context, true );\n\n\tconst allowedBlocks =\n\t\tparentCount >= maxNestingLevel\n\t\t\t? ALLOWED_BLOCKS.filter(\n\t\t\t\t\t( blockName ) => blockName !== 'core/navigation-submenu'\n\t\t\t )\n\t\t\t: ALLOWED_BLOCKS;\n\n\tconst navigationChildBlockProps =\n\t\tgetNavigationChildBlockProps( innerBlocksColors );\n\tconst innerBlocksProps = useInnerBlocksProps( navigationChildBlockProps, {\n\t\tallowedBlocks,\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\n\t\t// Ensure block toolbar is not too far removed from item\n\t\t// being edited.\n\t\t// see: https://github.com/WordPress/gutenberg/pull/34615.\n\t\t__experimentalCaptureToolbars: true,\n\n\t\trenderAppender:\n\t\t\tisSelected ||\n\t\t\t( isImmediateParentOfSelectedBlock &&\n\t\t\t\t! selectedBlockHasChildren ) ||\n\t\t\t// Show the appender while dragging to allow inserting element between item and the appender.\n\t\t\thasChildren\n\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t: false,\n\t} );\n\n\tconst ParentElement = openSubmenusOnClick ? 'button' : 'a';\n\n\tfunction transformToLink() {\n\t\tconst newLinkBlock = createBlock( 'core/navigation-link', attributes );\n\t\treplaceBlock( clientId, newLinkBlock );\n\t}\n\n\tuseEffect( () => {\n\t\t// If block becomes empty, transform to Navigation Link.\n\t\tif ( ! hasChildren && prevHasChildren ) {\n\t\t\t// This side-effect should not create an undo level as those should\n\t\t\t// only be created via user interactions.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\ttransformToLink();\n\t\t}\n\t}, [ hasChildren, prevHasChildren ] );\n\n\tconst canConvertToLink =\n\t\t! selectedBlockHasChildren || onlyDescendantIsEmptyLink;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ ! openSubmenusOnClick && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\tsetOpenedBy( event.currentTarget );\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\t<ToolbarButton\n\t\t\t\t\t\tname=\"revert\"\n\t\t\t\t\t\ticon={ removeSubmenu }\n\t\t\t\t\t\ttitle={ __( 'Convert to Link' ) }\n\t\t\t\t\t\tonClick={ transformToLink }\n\t\t\t\t\t\tclassName=\"wp-block-navigation__submenu__revert\"\n\t\t\t\t\t\tdisabled={ ! canConvertToLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t{ /* Warning, this duplicated in packages/block-library/src/navigation-link/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tlabel: '',\n\t\t\t\t\t\t\turl: '',\n\t\t\t\t\t\t\tdescription: '',\n\t\t\t\t\t\t\ttitle: '',\n\t\t\t\t\t\t\trel: '',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! label }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { label: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\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\tvalue={ label || '' }\n\t\t\t\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! url }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { url: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\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\tvalue={ url || '' }\n\t\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { url: urlValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! description }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { description: '' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! title }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { title: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\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\tvalue={ title || '' }\n\t\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Additional information to help clarify the purpose of the link.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! rel }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { rel: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\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\tvalue={ rel || '' }\n\t\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The relationship of the linked URL as space-separated link types.'\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</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<ParentElement className=\"wp-block-navigation-item__content\">\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\tsetAttributes( { label: labelValue } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\tsetOpenedBy( ref.current );\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{ description && (\n\t\t\t\t\t\t<span className=\"wp-block-navigation-item__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! openSubmenusOnClick && isLinkOpen && (\n\t\t\t\t\t\t<LinkUI\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tlink={ attributes }\n\t\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( false );\n\t\t\t\t\t\t\t\tif ( openedBy ) {\n\t\t\t\t\t\t\t\t\topenedBy.focus();\n\t\t\t\t\t\t\t\t\tsetOpenedBy( null );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tselectBlock( clientId );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { url: '' } );\n\t\t\t\t\t\t\t\tspeak( __( 'Link removed.' ), 'assertive' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonChange={ ( updatedValue ) => {\n\t\t\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\tattributes\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</ParentElement>\n\t\t\t\t{ ( showSubmenuIcon || openSubmenusOnClick ) && (\n\t\t\t\t\t<span className=\"wp-block-navigation__submenu-icon\">\n\t\t\t\t\t\t<ItemSubmenuIcon />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,WAAW,EACXC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,eAAe,EAAEC,eAAe,QAAQ,qBAAqB;AACtE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,aAAa,EACbC,WAAW,EACXC,mBAAmB,EACnBC,iBAAiB,EACjBC,QAAQ,EACRC,aAAa,EACbC,KAAK,IAAIC,gBAAgB,EACzBC,iBAAiB,QACX,yBAAyB;AAChC,SAASC,KAAK,EAAEC,WAAW,QAAQ,gBAAgB;AACnD,SAASC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AAChE,SAASC,IAAI,IAAIC,QAAQ,EAAEC,aAAa,QAAQ,kBAAkB;AAClE,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;;AAE9D;AACA;AACA;A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AAC;UAC5C,CAAG;UACHsJ,QAAQ,EAAKe,YAAY,IAAM;YAC9B7I,gBAAgB,CACf6I,YAAY,EACZ/G,aAAa,EACbF,UACD,CAAC;UACF;QAAG,CACH,CACD;MAAA,CACa,CAAC,EACd,CAAEY,eAAe,IAAIE,mBAAmB,kBACzCrC,IAAA;QAAM0F,SAAS,EAAC,mCAAmC;QAAAkB,QAAA,eAClD5G,IAAA,CAACP,eAAe,IAAE;MAAC,CACd,CACN,eACDO,IAAA;QAAA,GAAUkG;MAAgB,CAAI,CAAC;IAAA,CAC3B,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useSelect","useDispatch","TextControl","TextareaControl","ToolbarButton","ToolbarGroup","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","displayShortcut","isKeyboardEvent","__","BlockControls","InnerBlocks","useInnerBlocksProps","InspectorControls","RichText","useBlockProps","store","blockEditorStore","getColorClassName","isURL","prependHTTP","useState","useEffect","useRef","link","linkIcon","removeSubmenu","speak","createBlock","useMergeRefs","usePrevious","ItemSubmenuIcon","LinkUI","updateAttributes","getColors","getNavigationChildBlockProps","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ALLOWED_BLOCKS","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","NavigationSubmenuEdit","attributes","isSelected","setAttributes","mergeBlocks","onReplace","context","clientId","label","url","description","rel","title","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","__unstableMarkNextChangeAsNotPersistent","replaceBlock","selectBlock","isLinkOpen","setIsLinkOpen","openedBy","setOpenedBy","popoverAnchor","setPopoverAnchor","listItemRef","itemLabelPlaceholder","ref","dropdownMenuProps","parentCount","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasChildren","selectedBlockHasChildren","onlyDescendantIsEmptyLink","select","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","getBlock","getBlockCount","getBlockOrder","_onlyDescendantIsEmptyLink","selectedBlockId","selectedBlockChildren","length","singleBlock","prevHasChildren","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","textColor","customTextColor","backgroundColor","customBackgroundColor","onKeyDown","primary","preventDefault","stopPropagation","blockProps","className","style","color","innerBlocksColors","allowedBlocks","filter","blockName","navigationChildBlockProps","innerBlocksProps","defaultBlock","directInsert","__experimentalCaptureToolbars","renderAppender","ButtonBlockAppender","ParentElement","transformToLink","newLinkBlock","canConvertToLink","children","icon","shortcut","onClick","currentTarget","disabled","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","__next40pxDefaultSize","value","onChange","labelValue","autoComplete","urlValue","type","descriptionValue","help","titleValue","relValue","identifier","onMerge","placeholder","withoutInteractiveFormatting","onClose","anchor","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP } from '@wordpress/url';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { link as linkIcon, removeSubmenu } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\nimport { createBlock } from '@wordpress/blocks';\nimport { useMergeRefs, usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ItemSubmenuIcon } from './icons';\nimport { LinkUI } from '../navigation-link/link-ui';\nimport { updateAttributes } from '../navigation-link/update-attributes';\nimport {\n\tgetColors,\n\tgetNavigationChildBlockProps,\n} from '../navigation/edit/utils';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst ALLOWED_BLOCKS = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n\t'core/page-list',\n];\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/navigation-link',\n};\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that\n\t\t// doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\n */\n\n/**\n * Navigation Link Block Attributes\n *\n * @typedef {Object} WPNavigationLinkBlockAttributes\n *\n * @property {string} [label] Link text.\n * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.\n * @property {string} [type] The type such as post, page, tag, category and other custom types.\n * @property {string} [rel] The relationship of the linked URL.\n * @property {number} [id] A post or term id.\n * @property {boolean} [opensInNewTab] Sets link target to _blank when true.\n * @property {string} [url] Link href.\n * @property {string} [title] Link title attribute.\n */\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { label, url, description, rel, title } = attributes;\n\n\tconst { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlock,\n\t\tselectBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\t// Store what element opened the popover, so we know where to return focus to (toolbar button vs navigation link text)\n\tconst [ openedBy, setOpenedBy ] = useState( null );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add text…' );\n\tconst ref = useRef();\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst {\n\t\tparentCount,\n\t\tisParentOfSelectedBlock,\n\t\tisImmediateParentOfSelectedBlock,\n\t\thasChildren,\n\t\tselectedBlockHasChildren,\n\t\tonlyDescendantIsEmptyLink,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tlet _onlyDescendantIsEmptyLink;\n\n\t\t\tconst selectedBlockId = getSelectedBlockClientId();\n\n\t\t\tconst selectedBlockChildren = getBlockOrder( selectedBlockId );\n\n\t\t\t// Check for a single descendant in the submenu. If that block\n\t\t\t// is a link block in a \"placeholder\" state with no label then\n\t\t\t// we can consider as an \"empty\" link.\n\t\t\tif ( selectedBlockChildren?.length === 1 ) {\n\t\t\t\tconst singleBlock = getBlock( selectedBlockChildren[ 0 ] );\n\n\t\t\t\t_onlyDescendantIsEmptyLink =\n\t\t\t\t\tsingleBlock?.name === 'core/navigation-link' &&\n\t\t\t\t\t! singleBlock?.attributes?.label;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tparentCount: getBlockParentsByBlockName(\n\t\t\t\t\tclientId,\n\t\t\t\t\t'core/navigation-submenu'\n\t\t\t\t).length,\n\t\t\t\tisParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\tisImmediateParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasChildren: !! getBlockCount( clientId ),\n\t\t\t\tselectedBlockHasChildren: !! selectedBlockChildren?.length,\n\t\t\t\tonlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst prevHasChildren = usePrevious( hasChildren );\n\n\t// Show the LinkControl on mount if the URL is empty\n\t// ( When adding a new menu item)\n\t// This can't be done in the useState call because it conflicts\n\t// with the autofocus behavior of the BlockListBlock component.\n\tuseEffect( () => {\n\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}, [] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, parentCount > 0 );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\t// Required to prevent the command center from opening,\n\t\t\t// as it shares the CMD+K shortcut.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/59845.\n\t\t\tevent.preventDefault();\n\t\t\t// If we don't stop propagation, this event bubbles up to the parent submenu item\n\t\t\tevent.stopPropagation();\n\t\t\tsetIsLinkOpen( true );\n\t\t\tsetOpenedBy( ref.current );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, listItemRef ] ),\n\t\tclassName: clsx( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasChildren,\n\t\t\t'has-text-color': !! textColor || !! customTextColor,\n\t\t\t[ getColorClassName( 'color', textColor ) ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || customBackgroundColor,\n\t\t\t[ getColorClassName( 'background-color', backgroundColor ) ]:\n\t\t\t\t!! backgroundColor,\n\t\t\t'open-on-click': openSubmenusOnClick,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: ! textColor && customTextColor,\n\t\t\tbackgroundColor: ! backgroundColor && customBackgroundColor,\n\t\t},\n\t\tonKeyDown,\n\t} );\n\n\t// Always use overlay colors for submenus.\n\tconst innerBlocksColors = getColors( context, true );\n\n\tconst allowedBlocks =\n\t\tparentCount >= maxNestingLevel\n\t\t\t? ALLOWED_BLOCKS.filter(\n\t\t\t\t\t( blockName ) => blockName !== 'core/navigation-submenu'\n\t\t\t )\n\t\t\t: ALLOWED_BLOCKS;\n\n\tconst navigationChildBlockProps =\n\t\tgetNavigationChildBlockProps( innerBlocksColors );\n\tconst innerBlocksProps = useInnerBlocksProps( navigationChildBlockProps, {\n\t\tallowedBlocks,\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\n\t\t// Ensure block toolbar is not too far removed from item\n\t\t// being edited.\n\t\t// see: https://github.com/WordPress/gutenberg/pull/34615.\n\t\t__experimentalCaptureToolbars: true,\n\n\t\trenderAppender:\n\t\t\tisSelected ||\n\t\t\t( isImmediateParentOfSelectedBlock &&\n\t\t\t\t! selectedBlockHasChildren ) ||\n\t\t\t// Show the appender while dragging to allow inserting element between item and the appender.\n\t\t\thasChildren\n\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t: false,\n\t} );\n\n\tconst ParentElement = openSubmenusOnClick ? 'button' : 'a';\n\n\tfunction transformToLink() {\n\t\tconst newLinkBlock = createBlock( 'core/navigation-link', attributes );\n\t\treplaceBlock( clientId, newLinkBlock );\n\t}\n\n\tuseEffect( () => {\n\t\t// If block becomes empty, transform to Navigation Link.\n\t\tif ( ! hasChildren && prevHasChildren ) {\n\t\t\t// This side-effect should not create an undo level as those should\n\t\t\t// only be created via user interactions.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\ttransformToLink();\n\t\t}\n\t}, [ hasChildren, prevHasChildren ] );\n\n\tconst canConvertToLink =\n\t\t! selectedBlockHasChildren || onlyDescendantIsEmptyLink;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ ! openSubmenusOnClick && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\tsetOpenedBy( event.currentTarget );\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\t<ToolbarButton\n\t\t\t\t\t\tname=\"revert\"\n\t\t\t\t\t\ticon={ removeSubmenu }\n\t\t\t\t\t\ttitle={ __( 'Convert to Link' ) }\n\t\t\t\t\t\tonClick={ transformToLink }\n\t\t\t\t\t\tclassName=\"wp-block-navigation__submenu__revert\"\n\t\t\t\t\t\tdisabled={ ! canConvertToLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t{ /* Warning, this duplicated in packages/block-library/src/navigation-link/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tlabel: '',\n\t\t\t\t\t\t\turl: '',\n\t\t\t\t\t\t\tdescription: '',\n\t\t\t\t\t\t\ttitle: '',\n\t\t\t\t\t\t\trel: '',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! label }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { label: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\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\tvalue={ label || '' }\n\t\t\t\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! url }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { url: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\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\tvalue={ url || '' }\n\t\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { url: urlValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\ttype=\"url\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! description }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { description: '' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! title }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { title: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\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\tvalue={ title || '' }\n\t\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Additional information to help clarify the purpose of the link.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! rel }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { rel: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\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\tvalue={ rel || '' }\n\t\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The relationship of the linked URL as space-separated link types.'\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</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<ParentElement className=\"wp-block-navigation-item__content\">\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\tsetAttributes( { label: labelValue } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\tsetOpenedBy( ref.current );\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{ description && (\n\t\t\t\t\t\t<span className=\"wp-block-navigation-item__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! openSubmenusOnClick && isLinkOpen && (\n\t\t\t\t\t\t<LinkUI\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tlink={ attributes }\n\t\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( false );\n\t\t\t\t\t\t\t\tif ( openedBy ) {\n\t\t\t\t\t\t\t\t\topenedBy.focus();\n\t\t\t\t\t\t\t\t\tsetOpenedBy( null );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tselectBlock( clientId );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { url: '' } );\n\t\t\t\t\t\t\t\tspeak( __( 'Link removed.' ), 'assertive' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonChange={ ( updatedValue ) => {\n\t\t\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\tattributes\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</ParentElement>\n\t\t\t\t{ ( showSubmenuIcon || openSubmenusOnClick ) && (\n\t\t\t\t\t<span className=\"wp-block-navigation__submenu-icon\">\n\t\t\t\t\t\t<ItemSubmenuIcon />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,WAAW,EACXC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,eAAe,EAAEC,eAAe,QAAQ,qBAAqB;AACtE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,aAAa,EACbC,WAAW,EACXC,mBAAmB,EACnBC,iBAAiB,EACjBC,QAAQ,EACRC,aAAa,EACbC,KAAK,IAAIC,gBAAgB,EACzBC,iBAAiB,QACX,yBAAyB;AAChC,SAASC,KAAK,EAAEC,WAAW,QAAQ,gBAAgB;AACnD,SAASC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AAChE,SAASC,IAAI,IAAIC,QAAQ,EAAEC,aAAa,QAAQ,kBAAkB;AAClE,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;;AAE9D;AACA;AACA;AACA,SAASC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C,EAAE,WAAY,CAAC;UAC5C,CAAG;UACHsJ,QAAQ,EAAKgB,YAAY,IAAM;YAC9B9I,gBAAgB,CACf8I,YAAY,EACZhH,aAAa,EACbF,UACD,CAAC;UACF;QAAG,CACH,CACD;MAAA,CACa,CAAC,EACd,CAAEY,eAAe,IAAIE,mBAAmB,kBACzCrC,IAAA;QAAM0F,SAAS,EAAC,mCAAmC;QAAAkB,QAAA,eAClD5G,IAAA,CAACP,eAAe,IAAE;MAAC,CACd,CACN,eACDO,IAAA;QAAA,GAAUkG;MAAgB,CAAI,CAAC;IAAA,CAC3B,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","createBlock","InspectorControls","BlockControls","useBlockProps","useInnerBlocksProps","getColorClassName","store","blockEditorStore","Warning","ToolbarButton","Spinner","Notice","ComboboxControl","Button","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__","sprintf","useMemo","useState","useEffect","useCallback","useEntityRecords","useSelect","useDispatch","useConvertToNavigationLinks","convertDescription","ConvertToLinksModal","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MAX_PAGE_COUNT","NOOP","BlockContent","blockProps","innerBlocksProps","hasResolvedPages","blockList","pages","parentPageID","children","className","status","isDismissible","length","parentPageDetails","find","page","id","title","rendered","PageListEdit","context","clientId","attributes","setAttributes","isOpen","setOpen","openModal","closeModal","dropdownMenuProps","records","hasResolved","per_page","_fields","orderby","order","allowConvertToLinks","pagesByParentId","Map","sortedPages","sort","a","b","menu_order","localeCompare","reduce","accumulator","parent","has","get","push","set","textColor","backgroundColor","style","color","pagesTree","makePagesTree","parentId","level","childPages","tree","hasChildren","item","value","label","repeat","rawName","getBlockList","template","pageProps","trim","link","url","isNested","hasSelectedChild","parentClientId","hasDraggedChild","isChildOfNavigation","select","getBlockParentsByBlockName","hasSelectedInnerBlock","hasDraggedInnerBlock","blockParents","navigationBlockParents","convertToNavigationLinks","renderAppender","__unstableDisableDropZone","templateLock","onInput","onChange","selectBlock","resetAll","hasValue","onDeselect","isShownByDefault","__nextHasNoMarginBottom","__next40pxDefaultSize","options","help","gridColumn","variant","accessibleWhenDisabled","disabled","onClick","group","onClose"],"sources":["@wordpress/block-library/src/page-list/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tgetColorClassName,\n\tstore as blockEditorStore,\n\tWarning,\n} from '@wordpress/block-editor';\nimport {\n\tToolbarButton,\n\tSpinner,\n\tNotice,\n\tComboboxControl,\n\tButton,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo, useState, useEffect, useCallback } from '@wordpress/element';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useConvertToNavigationLinks } from './use-convert-to-navigation-links';\nimport {\n\tconvertDescription,\n\tConvertToLinksModal,\n} from './convert-to-links-modal';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n// We only show the edit option when page count is <= MAX_PAGE_COUNT\n// Performance of Navigation Links is not good past this value.\nconst MAX_PAGE_COUNT = 100;\nconst NOOP = () => {};\nfunction BlockContent( {\n\tblockProps,\n\tinnerBlocksProps,\n\thasResolvedPages,\n\tblockList,\n\tpages,\n\tparentPageID,\n} ) {\n\tif ( ! hasResolvedPages ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<div className=\"wp-block-page-list__loading-indicator-container\">\n\t\t\t\t\t<Spinner className=\"wp-block-page-list__loading-indicator\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( pages === null ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __( 'Page List: Cannot retrieve Pages.' ) }\n\t\t\t\t</Notice>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( pages.length === 0 ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Notice status=\"info\" isDismissible={ false }>\n\t\t\t\t\t{ __( 'Page List: Cannot retrieve Pages.' ) }\n\t\t\t\t</Notice>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( blockList.length === 0 ) {\n\t\tconst parentPageDetails = pages.find(\n\t\t\t( page ) => page.id === parentPageID\n\t\t);\n\n\t\tif ( parentPageDetails?.title?.rendered ) {\n\t\t\treturn (\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %s: Page title.\n\t\t\t\t\t\t\t__( 'Page List: \"%s\" page has no children.' ),\n\t\t\t\t\t\t\tparentPageDetails.title.rendered\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Warning>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __( 'Page List: Cannot retrieve Pages.' ) }\n\t\t\t\t</Notice>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( pages.length > 0 ) {\n\t\treturn <ul { ...innerBlocksProps }></ul>;\n\t}\n}\n\nexport default function PageListEdit( {\n\tcontext,\n\tclientId,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { parentPageID } = attributes;\n\tconst [ isOpen, setOpen ] = useState( false );\n\tconst openModal = useCallback( () => setOpen( true ), [] );\n\tconst closeModal = () => setOpen( false );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst { records: pages, hasResolved: hasResolvedPages } = useEntityRecords(\n\t\t'postType',\n\t\t'page',\n\t\t{\n\t\t\tper_page: MAX_PAGE_COUNT,\n\t\t\t_fields: [ 'id', 'link', 'menu_order', 'parent', 'title', 'type' ],\n\t\t\t// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby\n\t\t\t// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent\n\t\t\t// sort.\n\t\t\torderby: 'menu_order',\n\t\t\torder: 'asc',\n\t\t}\n\t);\n\n\tconst allowConvertToLinks =\n\t\t'showSubmenuIcon' in context &&\n\t\tpages?.length > 0 &&\n\t\tpages?.length <= MAX_PAGE_COUNT;\n\n\tconst pagesByParentId = useMemo( () => {\n\t\tif ( pages === null ) {\n\t\t\treturn new Map();\n\t\t}\n\n\t\t// TODO: Once the REST API supports passing multiple values to\n\t\t// 'orderby', this can be removed.\n\t\t// https://core.trac.wordpress.org/ticket/39037\n\t\tconst sortedPages = pages.sort( ( a, b ) => {\n\t\t\tif ( a.menu_order === b.menu_order ) {\n\t\t\t\treturn a.title.rendered.localeCompare( b.title.rendered );\n\t\t\t}\n\t\t\treturn a.menu_order - b.menu_order;\n\t\t} );\n\n\t\treturn sortedPages.reduce( ( accumulator, page ) => {\n\t\t\tconst { parent } = page;\n\t\t\tif ( accumulator.has( parent ) ) {\n\t\t\t\taccumulator.get( parent ).push( page );\n\t\t\t} else {\n\t\t\t\taccumulator.set( parent, [ page ] );\n\t\t\t}\n\t\t\treturn accumulator;\n\t\t}, new Map() );\n\t}, [ pages ] );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( 'wp-block-page-list', {\n\t\t\t'has-text-color': !! context.textColor,\n\t\t\t[ getColorClassName( 'color', context.textColor ) ]:\n\t\t\t\t!! context.textColor,\n\t\t\t'has-background': !! context.backgroundColor,\n\t\t\t[ getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tcontext.backgroundColor\n\t\t\t) ]: !! context.backgroundColor,\n\t\t} ),\n\t\tstyle: { ...context.style?.color },\n\t} );\n\n\tconst pagesTree = useMemo(\n\t\tfunction makePagesTree( parentId = 0, level = 0 ) {\n\t\t\tconst childPages = pagesByParentId.get( parentId );\n\n\t\t\tif ( ! childPages?.length ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn childPages.reduce( ( tree, page ) => {\n\t\t\t\tconst hasChildren = pagesByParentId.has( page.id );\n\t\t\t\tconst item = {\n\t\t\t\t\tvalue: page.id,\n\t\t\t\t\tlabel: '— '.repeat( level ) + page.title.rendered,\n\t\t\t\t\trawName: page.title.rendered,\n\t\t\t\t};\n\t\t\t\ttree.push( item );\n\t\t\t\tif ( hasChildren ) {\n\t\t\t\t\ttree.push( ...makePagesTree( page.id, level + 1 ) );\n\t\t\t\t}\n\t\t\t\treturn tree;\n\t\t\t}, [] );\n\t\t},\n\t\t[ pagesByParentId ]\n\t);\n\n\tconst blockList = useMemo(\n\t\tfunction getBlockList( parentId = parentPageID ) {\n\t\t\tconst childPages = pagesByParentId.get( parentId );\n\n\t\t\tif ( ! childPages?.length ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn childPages.reduce( ( template, page ) => {\n\t\t\t\tconst hasChildren = pagesByParentId.has( page.id );\n\t\t\t\tconst pageProps = {\n\t\t\t\t\tid: page.id,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t// translators: displayed when a page has an empty title.\n\t\t\t\t\t\tpage.title?.rendered?.trim() !== ''\n\t\t\t\t\t\t\t? page.title?.rendered\n\t\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\ttitle:\n\t\t\t\t\t\t// translators: displayed when a page has an empty title.\n\t\t\t\t\t\tpage.title?.rendered?.trim() !== ''\n\t\t\t\t\t\t\t? page.title?.rendered\n\t\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\tlink: page.url,\n\t\t\t\t\thasChildren,\n\t\t\t\t};\n\t\t\t\tlet item = null;\n\t\t\t\tconst children = getBlockList( page.id );\n\t\t\t\titem = createBlock(\n\t\t\t\t\t'core/page-list-item',\n\t\t\t\t\tpageProps,\n\t\t\t\t\tchildren\n\t\t\t\t);\n\t\t\t\ttemplate.push( item );\n\n\t\t\t\treturn template;\n\t\t\t}, [] );\n\t\t},\n\t\t[ pagesByParentId, parentPageID ]\n\t);\n\n\tconst {\n\t\tisNested,\n\t\thasSelectedChild,\n\t\tparentClientId,\n\t\thasDraggedChild,\n\t\tisChildOfNavigation,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\thasDraggedInnerBlock,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst blockParents = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/navigation-submenu',\n\t\t\t\ttrue\n\t\t\t);\n\t\t\tconst navigationBlockParents = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/navigation',\n\t\t\t\ttrue\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tisNested: blockParents.length > 0,\n\t\t\t\tisChildOfNavigation: navigationBlockParents.length > 0,\n\t\t\t\thasSelectedChild: hasSelectedInnerBlock( clientId, true ),\n\t\t\t\thasDraggedChild: hasDraggedInnerBlock( clientId, true ),\n\t\t\t\tparentClientId: navigationBlockParents[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst convertToNavigationLinks = useConvertToNavigationLinks( {\n\t\tclientId,\n\t\tpages,\n\t\tparentClientId,\n\t\tparentPageID,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\trenderAppender: false,\n\t\t__unstableDisableDropZone: true,\n\t\ttemplateLock: isChildOfNavigation ? false : 'all',\n\t\tonInput: NOOP,\n\t\tonChange: NOOP,\n\t\tvalue: blockList,\n\t} );\n\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( hasSelectedChild || hasDraggedChild ) {\n\t\t\topenModal();\n\t\t\tselectBlock( parentClientId );\n\t\t}\n\t}, [\n\t\thasSelectedChild,\n\t\thasDraggedChild,\n\t\tparentClientId,\n\t\tselectBlock,\n\t\topenModal,\n\t] );\n\n\tuseEffect( () => {\n\t\tsetAttributes( { isNested } );\n\t}, [ isNested, setAttributes ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ( pagesTree.length > 0 || allowConvertToLinks ) && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetAttributes( { parentPageID: 0 } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ pagesTree.length > 0 && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Parent Page' ) }\n\t\t\t\t\t\t\t\thasValue={ () => parentPageID !== 0 }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { parentPageID: 0 } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ComboboxControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tclassName=\"editor-page-attributes__parent\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Parent' ) }\n\t\t\t\t\t\t\t\t\tvalue={ parentPageID }\n\t\t\t\t\t\t\t\t\toptions={ pagesTree }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tparentPageID: value ?? 0,\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\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Choose a page to show only its subpages.'\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</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ allowConvertToLinks && (\n\t\t\t\t\t\t\t<div style={ { gridColumn: '1 / -1' } }>\n\t\t\t\t\t\t\t\t<p>{ convertDescription }</p>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ ! hasResolvedPages }\n\t\t\t\t\t\t\t\t\tonClick={ convertToNavigationLinks }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t{ allowConvertToLinks && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ttitle={ __( 'Edit' ) }\n\t\t\t\t\t\t\tonClick={ openModal }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t{ isOpen && (\n\t\t\t\t\t\t<ConvertToLinksModal\n\t\t\t\t\t\t\tonClick={ convertToNavigationLinks }\n\t\t\t\t\t\t\tonClose={ closeModal }\n\t\t\t\t\t\t\tdisabled={ ! hasResolvedPages }\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\t<BlockContent\n\t\t\t\tblockProps={ blockProps }\n\t\t\t\tinnerBlocksProps={ innerBlocksProps }\n\t\t\t\thasResolvedPages={ hasResolvedPages }\n\t\t\t\tblockList={ blockList }\n\t\t\t\tpages={ pages }\n\t\t\t\tparentPageID={ parentPageID }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SACCC,iBAAiB,EACjBC,aAAa,EACbC,aAAa,EACbC,mBAAmB,EACnBC,iBAAiB,EACjBC,KAAK,IAAIC,gBAAgB,EACzBC,OAAO,QACD,yBAAyB;AAChC,SACCC,aAAa,EACbC,OAAO,EACPC,MAAM,EACNC,eAAe,EACfC,MAAM,EACNC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAC9E,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,2BAA2B,QAAQ,mCAAmC;AAC/E,SACCC,kBAAkB,EAClBC,mBAAmB,QACb,0BAA0B;AACjC,SAASC,8BAA8B,QAAQ,gBAAgB;;AAE/D;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AACA,MAAMC,cAAc,GAAG,GAAG;AAC1B,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,SAASC,YAAYA,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AAE8C,UAAU,EAAE;UAAS,CAAG;UAAA3F,QAAA,gBACtCd,IAAA;YAAAc,QAAA,EAAKlB;UAAkB,CAAK,CAAC,eAC7BI,IAAA,CAACnB,MAAM;YACNyH,qBAAqB;YACrBI,OAAO,EAAC,SAAS;YACjBC,sBAAsB;YACtBC,QAAQ,EAAG,CAAElG,gBAAkB;YAC/BmG,OAAO,EAAGnB,wBAA0B;YAAA5E,QAAA,EAElC5B,EAAE,CAAE,MAAO;UAAC,CACP,CAAC;QAAA,CACL,CACL;MAAA,CACU;IAAC,CACK,CACnB,EACCuD,mBAAmB,iBACpBvC,KAAA,CAAAE,SAAA;MAAAU,QAAA,gBACCd,IAAA,CAAC9B,aAAa;QAAC4I,KAAK,EAAC,OAAO;QAAAhG,QAAA,eAC3Bd,IAAA,CAACvB,aAAa;UACb8C,KAAK,EAAGrC,EAAE,CAAE,MAAO,CAAG;UACtB2H,OAAO,EAAG7E,SAAW;UAAAlB,QAAA,EAEnB5B,EAAE,CAAE,MAAO;QAAC,CACA;MAAC,CACF,CAAC,EACd4C,MAAM,iBACP9B,IAAA,CAACH,mBAAmB;QACnBgH,OAAO,EAAGnB,wBAA0B;QACpCqB,OAAO,EAAG9E,UAAY;QACtB2E,QAAQ,EAAG,CAAElG;MAAkB,CAC/B,CACD;IAAA,CACA,CACF,eACDV,IAAA,CAACO,YAAY;MACZC,UAAU,EAAGA,UAAY;MACzBC,gBAAgB,EAAGA,gBAAkB;MACrCC,gBAAgB,EAAGA,gBAAkB;MACrCC,SAAS,EAAGA,SAAW;MACvBC,KAAK,EAAGA,KAAO;MACfC,YAAY,EAAGA;IAAc,CAC7B,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","createBlock","InspectorControls","BlockControls","useBlockProps","useInnerBlocksProps","getColorClassName","store","blockEditorStore","Warning","ToolbarButton","Spinner","Notice","ComboboxControl","Button","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__","sprintf","useMemo","useState","useEffect","useCallback","useEntityRecords","useSelect","useDispatch","useConvertToNavigationLinks","convertDescription","ConvertToLinksModal","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MAX_PAGE_COUNT","NOOP","BlockContent","blockProps","innerBlocksProps","hasResolvedPages","blockList","pages","parentPageID","children","className","status","isDismissible","length","parentPageDetails","find","page","id","title","rendered","PageListEdit","context","clientId","attributes","setAttributes","isOpen","setOpen","openModal","closeModal","dropdownMenuProps","records","hasResolved","per_page","_fields","orderby","order","allowConvertToLinks","pagesByParentId","Map","sortedPages","sort","a","b","menu_order","localeCompare","reduce","accumulator","parent","has","get","push","set","textColor","backgroundColor","style","color","pagesTree","makePagesTree","parentId","level","childPages","tree","hasChildren","item","value","label","repeat","rawName","getBlockList","template","pageProps","trim","link","url","isNested","hasSelectedChild","parentClientId","hasDraggedChild","isChildOfNavigation","select","getBlockParentsByBlockName","hasSelectedInnerBlock","hasDraggedInnerBlock","blockParents","navigationBlockParents","convertToNavigationLinks","renderAppender","__unstableDisableDropZone","templateLock","onInput","onChange","selectBlock","resetAll","hasValue","onDeselect","isShownByDefault","__nextHasNoMarginBottom","__next40pxDefaultSize","options","help","gridColumn","variant","accessibleWhenDisabled","disabled","onClick","group","onClose"],"sources":["@wordpress/block-library/src/page-list/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tgetColorClassName,\n\tstore as blockEditorStore,\n\tWarning,\n} from '@wordpress/block-editor';\nimport {\n\tToolbarButton,\n\tSpinner,\n\tNotice,\n\tComboboxControl,\n\tButton,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo, useState, useEffect, useCallback } from '@wordpress/element';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useConvertToNavigationLinks } from './use-convert-to-navigation-links';\nimport {\n\tconvertDescription,\n\tConvertToLinksModal,\n} from './convert-to-links-modal';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n// We only show the edit option when page count is <= MAX_PAGE_COUNT\n// Performance of Navigation Links is not good past this value.\nconst MAX_PAGE_COUNT = 100;\nconst NOOP = () => {};\nfunction BlockContent( {\n\tblockProps,\n\tinnerBlocksProps,\n\thasResolvedPages,\n\tblockList,\n\tpages,\n\tparentPageID,\n} ) {\n\tif ( ! hasResolvedPages ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<div className=\"wp-block-page-list__loading-indicator-container\">\n\t\t\t\t\t<Spinner className=\"wp-block-page-list__loading-indicator\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( pages === null ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __( 'Page List: Cannot retrieve Pages.' ) }\n\t\t\t\t</Notice>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( pages.length === 0 ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Notice status=\"info\" isDismissible={ false }>\n\t\t\t\t\t{ __( 'Page List: Cannot retrieve Pages.' ) }\n\t\t\t\t</Notice>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( blockList.length === 0 ) {\n\t\tconst parentPageDetails = pages.find(\n\t\t\t( page ) => page.id === parentPageID\n\t\t);\n\n\t\tif ( parentPageDetails?.title?.rendered ) {\n\t\t\treturn (\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<Warning>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %s: Page title.\n\t\t\t\t\t\t\t__( 'Page List: \"%s\" page has no children.' ),\n\t\t\t\t\t\t\tparentPageDetails.title.rendered\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Warning>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __( 'Page List: Cannot retrieve Pages.' ) }\n\t\t\t\t</Notice>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( pages.length > 0 ) {\n\t\treturn <ul { ...innerBlocksProps }></ul>;\n\t}\n}\n\nexport default function PageListEdit( {\n\tcontext,\n\tclientId,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { parentPageID } = attributes;\n\tconst [ isOpen, setOpen ] = useState( false );\n\tconst openModal = useCallback( () => setOpen( true ), [] );\n\tconst closeModal = () => setOpen( false );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst { records: pages, hasResolved: hasResolvedPages } = useEntityRecords(\n\t\t'postType',\n\t\t'page',\n\t\t{\n\t\t\tper_page: MAX_PAGE_COUNT,\n\t\t\t_fields: [ 'id', 'link', 'menu_order', 'parent', 'title', 'type' ],\n\t\t\t// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby\n\t\t\t// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent\n\t\t\t// sort.\n\t\t\torderby: 'menu_order',\n\t\t\torder: 'asc',\n\t\t}\n\t);\n\n\tconst allowConvertToLinks =\n\t\t'showSubmenuIcon' in context &&\n\t\tpages?.length > 0 &&\n\t\tpages?.length <= MAX_PAGE_COUNT;\n\n\tconst pagesByParentId = useMemo( () => {\n\t\tif ( pages === null ) {\n\t\t\treturn new Map();\n\t\t}\n\n\t\t// TODO: Once the REST API supports passing multiple values to\n\t\t// 'orderby', this can be removed.\n\t\t// https://core.trac.wordpress.org/ticket/39037\n\t\tconst sortedPages = pages.sort( ( a, b ) => {\n\t\t\tif ( a.menu_order === b.menu_order ) {\n\t\t\t\treturn a.title.rendered.localeCompare( b.title.rendered );\n\t\t\t}\n\t\t\treturn a.menu_order - b.menu_order;\n\t\t} );\n\n\t\treturn sortedPages.reduce( ( accumulator, page ) => {\n\t\t\tconst { parent } = page;\n\t\t\tif ( accumulator.has( parent ) ) {\n\t\t\t\taccumulator.get( parent ).push( page );\n\t\t\t} else {\n\t\t\t\taccumulator.set( parent, [ page ] );\n\t\t\t}\n\t\t\treturn accumulator;\n\t\t}, new Map() );\n\t}, [ pages ] );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( 'wp-block-page-list', {\n\t\t\t'has-text-color': !! context.textColor,\n\t\t\t[ getColorClassName( 'color', context.textColor ) ]:\n\t\t\t\t!! context.textColor,\n\t\t\t'has-background': !! context.backgroundColor,\n\t\t\t[ getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tcontext.backgroundColor\n\t\t\t) ]: !! context.backgroundColor,\n\t\t} ),\n\t\tstyle: { ...context.style?.color },\n\t} );\n\n\tconst pagesTree = useMemo(\n\t\tfunction makePagesTree( parentId = 0, level = 0 ) {\n\t\t\tconst childPages = pagesByParentId.get( parentId );\n\n\t\t\tif ( ! childPages?.length ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn childPages.reduce( ( tree, page ) => {\n\t\t\t\tconst hasChildren = pagesByParentId.has( page.id );\n\t\t\t\tconst item = {\n\t\t\t\t\tvalue: page.id,\n\t\t\t\t\tlabel: '— '.repeat( level ) + page.title.rendered,\n\t\t\t\t\trawName: page.title.rendered,\n\t\t\t\t};\n\t\t\t\ttree.push( item );\n\t\t\t\tif ( hasChildren ) {\n\t\t\t\t\ttree.push( ...makePagesTree( page.id, level + 1 ) );\n\t\t\t\t}\n\t\t\t\treturn tree;\n\t\t\t}, [] );\n\t\t},\n\t\t[ pagesByParentId ]\n\t);\n\n\tconst blockList = useMemo(\n\t\tfunction getBlockList( parentId = parentPageID ) {\n\t\t\tconst childPages = pagesByParentId.get( parentId );\n\n\t\t\tif ( ! childPages?.length ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn childPages.reduce( ( template, page ) => {\n\t\t\t\tconst hasChildren = pagesByParentId.has( page.id );\n\t\t\t\tconst pageProps = {\n\t\t\t\t\tid: page.id,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t// translators: displayed when a page has an empty title.\n\t\t\t\t\t\tpage.title?.rendered?.trim() !== ''\n\t\t\t\t\t\t\t? page.title?.rendered\n\t\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\ttitle:\n\t\t\t\t\t\t// translators: displayed when a page has an empty title.\n\t\t\t\t\t\tpage.title?.rendered?.trim() !== ''\n\t\t\t\t\t\t\t? page.title?.rendered\n\t\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\tlink: page.url,\n\t\t\t\t\thasChildren,\n\t\t\t\t};\n\t\t\t\tlet item = null;\n\t\t\t\tconst children = getBlockList( page.id );\n\t\t\t\titem = createBlock(\n\t\t\t\t\t'core/page-list-item',\n\t\t\t\t\tpageProps,\n\t\t\t\t\tchildren\n\t\t\t\t);\n\t\t\t\ttemplate.push( item );\n\n\t\t\t\treturn template;\n\t\t\t}, [] );\n\t\t},\n\t\t[ pagesByParentId, parentPageID ]\n\t);\n\n\tconst {\n\t\tisNested,\n\t\thasSelectedChild,\n\t\tparentClientId,\n\t\thasDraggedChild,\n\t\tisChildOfNavigation,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\thasDraggedInnerBlock,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst blockParents = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/navigation-submenu',\n\t\t\t\ttrue\n\t\t\t);\n\t\t\tconst navigationBlockParents = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/navigation',\n\t\t\t\ttrue\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tisNested: blockParents.length > 0,\n\t\t\t\tisChildOfNavigation: navigationBlockParents.length > 0,\n\t\t\t\thasSelectedChild: hasSelectedInnerBlock( clientId, true ),\n\t\t\t\thasDraggedChild: hasDraggedInnerBlock( clientId, true ),\n\t\t\t\tparentClientId: navigationBlockParents[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst convertToNavigationLinks = useConvertToNavigationLinks( {\n\t\tclientId,\n\t\tpages,\n\t\tparentClientId,\n\t\tparentPageID,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\trenderAppender: false,\n\t\t__unstableDisableDropZone: true,\n\t\ttemplateLock: isChildOfNavigation ? false : 'all',\n\t\tonInput: NOOP,\n\t\tonChange: NOOP,\n\t\tvalue: blockList,\n\t} );\n\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( hasSelectedChild || hasDraggedChild ) {\n\t\t\topenModal();\n\t\t\tselectBlock( parentClientId );\n\t\t}\n\t}, [\n\t\thasSelectedChild,\n\t\thasDraggedChild,\n\t\tparentClientId,\n\t\tselectBlock,\n\t\topenModal,\n\t] );\n\n\tuseEffect( () => {\n\t\tsetAttributes( { isNested } );\n\t}, [ isNested, setAttributes ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ( pagesTree.length > 0 || allowConvertToLinks ) && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetAttributes( { parentPageID: 0 } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ pagesTree.length > 0 && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Parent Page' ) }\n\t\t\t\t\t\t\t\thasValue={ () => parentPageID !== 0 }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { parentPageID: 0 } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ComboboxControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tclassName=\"editor-page-attributes__parent\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Parent' ) }\n\t\t\t\t\t\t\t\t\tvalue={ parentPageID }\n\t\t\t\t\t\t\t\t\toptions={ pagesTree }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tparentPageID: value ?? 0,\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\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Choose a page to show only its subpages.'\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</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ allowConvertToLinks && (\n\t\t\t\t\t\t\t<div style={ { gridColumn: '1 / -1' } }>\n\t\t\t\t\t\t\t\t<p>{ convertDescription }</p>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ ! hasResolvedPages }\n\t\t\t\t\t\t\t\t\tonClick={ convertToNavigationLinks }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t{ allowConvertToLinks && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ttitle={ __( 'Edit' ) }\n\t\t\t\t\t\t\tonClick={ openModal }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t{ isOpen && (\n\t\t\t\t\t\t<ConvertToLinksModal\n\t\t\t\t\t\t\tonClick={ convertToNavigationLinks }\n\t\t\t\t\t\t\tonClose={ closeModal }\n\t\t\t\t\t\t\tdisabled={ ! hasResolvedPages }\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\t<BlockContent\n\t\t\t\tblockProps={ blockProps }\n\t\t\t\tinnerBlocksProps={ innerBlocksProps }\n\t\t\t\thasResolvedPages={ hasResolvedPages }\n\t\t\t\tblockList={ blockList }\n\t\t\t\tpages={ pages }\n\t\t\t\tparentPageID={ parentPageID }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SACCC,iBAAiB,EACjBC,aAAa,EACbC,aAAa,EACbC,mBAAmB,EACnBC,iBAAiB,EACjBC,KAAK,IAAIC,gBAAgB,EACzBC,OAAO,QACD,yBAAyB;AAChC,SACCC,aAAa,EACbC,OAAO,EACPC,MAAM,EACNC,eAAe,EACfC,MAAM,EACNC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC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AM,iBACP9B,IAAA,CAACH,mBAAmB;QACnBgH,OAAO,EAAGnB,wBAA0B;QACpCqB,OAAO,EAAG9E,UAAY;QACtB2E,QAAQ,EAAG,CAAElG;MAAkB,CAC/B,CACD;IAAA,CACA,CACF,eACDV,IAAA,CAACO,YAAY;MACZC,UAAU,EAAGA,UAAY;MACzBC,gBAAgB,EAAGA,gBAAkB;MACrCC,gBAAgB,EAAGA,gBAAkB;MACrCC,SAAS,EAAGA,SAAW;MACvBC,KAAK,EAAGA,KAAO;MACfC,YAAY,EAAGA;IAAc,CAC7B,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["createBlock","useDispatch","store","blockEditorStore","createNavigationLinks","pages","linkMap","navigationLinks","forEach","id","title","link","url","type","parent","_linkMap$id$innerBloc","innerBlocks","label","rendered","kind","push","parentLinkInnerBlocks","findNavigationLinkById","navigationLink","attributes","length","foundNavigationLink","convertToNavigationLinks","parentPageID","parentPage","transformSubmenus","listOfLinks","block","index","listOfLinksArray","transformedBlock","useConvertToNavigationLinks","clientId","parentClientId","replaceBlock","selectBlock"],"sources":["@wordpress/block-library/src/page-list/use-convert-to-navigation-links.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Converts an array of pages into a nested array of navigation link blocks.\n *\n * @param {Array} pages An array of pages.\n *\n * @return {Array} A nested array of navigation link blocks.\n */\nfunction createNavigationLinks( pages = [] ) {\n\tconst linkMap = {};\n\tconst navigationLinks = [];\n\tpages.forEach( ( { id, title, link: url, type, parent } ) => {\n\t\t// See if a placeholder exists. This is created if children appear before parents in list.\n\t\tconst innerBlocks = linkMap[ id ]?.innerBlocks ?? [];\n\t\tlinkMap[ id ] = createBlock(\n\t\t\t'core/navigation-link',\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tlabel: title.rendered,\n\t\t\t\turl,\n\t\t\t\ttype,\n\t\t\t\tkind: 'post-type',\n\t\t\t},\n\t\t\tinnerBlocks\n\t\t);\n\n\t\tif ( ! parent ) {\n\t\t\tnavigationLinks.push( linkMap[ id ] );\n\t\t} else {\n\t\t\tif ( ! linkMap[ parent ] ) {\n\t\t\t\t// Use a placeholder if the child appears before parent in list.\n\t\t\t\tlinkMap[ parent ] = { innerBlocks: [] };\n\t\t\t}\n\t\t\t// Although these variables are not referenced, they are needed to store the innerBlocks in memory.\n\t\t\tconst parentLinkInnerBlocks = linkMap[ parent ].innerBlocks;\n\t\t\tparentLinkInnerBlocks.push( linkMap[ id ] );\n\t\t}\n\t} );\n\n\treturn navigationLinks;\n}\n\n/**\n * Finds a navigation link block by id, recursively.\n * It might be possible to make this a more generic helper function.\n *\n * @param {Array} navigationLinks An array of navigation link blocks.\n * @param {number} id The id of the navigation link to find.\n *\n * @return {Object|null} The navigation link block with the given id.\n */\nfunction findNavigationLinkById( navigationLinks, id ) {\n\tfor ( const navigationLink of navigationLinks ) {\n\t\t// Is this the link we're looking for?\n\t\tif ( navigationLink.attributes.id === id ) {\n\t\t\treturn navigationLink;\n\t\t}\n\n\t\t// If not does it have innerBlocks?\n\t\tif ( navigationLink.innerBlocks && navigationLink.innerBlocks.length ) {\n\t\t\tconst foundNavigationLink = findNavigationLinkById(\n\t\t\t\tnavigationLink.innerBlocks,\n\t\t\t\tid\n\t\t\t);\n\n\t\t\tif ( foundNavigationLink ) {\n\t\t\t\treturn foundNavigationLink;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function convertToNavigationLinks( pages = [], parentPageID = null ) {\n\tlet navigationLinks = createNavigationLinks( pages );\n\n\t// If a parent page ID is provided, only return the children of that page.\n\tif ( parentPageID ) {\n\t\tconst parentPage = findNavigationLinkById(\n\t\t\tnavigationLinks,\n\t\t\tparentPageID\n\t\t);\n\t\tif ( parentPage && parentPage.innerBlocks ) {\n\t\t\tnavigationLinks = parentPage.innerBlocks;\n\t\t}\n\t}\n\n\t// Transform all links with innerBlocks into Submenus. This can't be done\n\t// sooner because page objects have no information on their children.\n\tconst transformSubmenus = ( listOfLinks ) => {\n\t\tlistOfLinks.forEach( ( block, index, listOfLinksArray ) => {\n\t\t\tconst { attributes, innerBlocks } = block;\n\t\t\tif ( innerBlocks.length !== 0 ) {\n\t\t\t\ttransformSubmenus( innerBlocks );\n\t\t\t\tconst transformedBlock = createBlock(\n\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\tattributes,\n\t\t\t\t\tinnerBlocks\n\t\t\t\t);\n\t\t\t\tlistOfLinksArray[ index ] = transformedBlock;\n\t\t\t}\n\t\t} );\n\t};\n\n\ttransformSubmenus( navigationLinks );\n\treturn navigationLinks;\n}\n\nexport function useConvertToNavigationLinks( {\n\tclientId,\n\tpages,\n\tparentClientId,\n\tparentPageID,\n} ) {\n\tconst { replaceBlock, selectBlock } = useDispatch( blockEditorStore );\n\n\treturn () => {\n\t\tconst navigationLinks = convertToNavigationLinks( pages, parentPageID );\n\n\t\t// Replace the Page List block with the Navigation Links.\n\t\treplaceBlock( clientId, navigationLinks );\n\n\t\t// Select the Navigation block to reveal the changes.\n\t\tselectBlock( parentClientId );\n\t};\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,qBAAqBA,CAAEC,KAAK,GAAG,EAAE,EAAG;EAC5C,MAAMC,OAAO,GAAG,CAAC,CAAC;EAClB,MAAMC,eAAe,GAAG,EAAE;EAC1BF,KAAK,CAACG,OAAO,CAAE,CAAE;IAAEC,EAAE;IAAEC,KAAK;IAAEC,IAAI,EAAEC,GA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Q,EAAE9B,eAAgB,CAAC;;IAEzC;IACAiC,WAAW,CAAEF,cAAe,CAAC;EAC9B,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["createBlock","useDispatch","store","blockEditorStore","createNavigationLinks","pages","linkMap","navigationLinks","forEach","id","title","link","url","type","parent","_linkMap$id$innerBloc","innerBlocks","label","rendered","kind","push","parentLinkInnerBlocks","findNavigationLinkById","navigationLink","attributes","length","foundNavigationLink","convertToNavigationLinks","parentPageID","parentPage","transformSubmenus","listOfLinks","block","index","listOfLinksArray","transformedBlock","useConvertToNavigationLinks","clientId","parentClientId","replaceBlock","selectBlock"],"sources":["@wordpress/block-library/src/page-list/use-convert-to-navigation-links.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Converts an array of pages into a nested array of navigation link blocks.\n *\n * @param {Array} pages An array of pages.\n *\n * @return {Array} A nested array of navigation link blocks.\n */\nfunction createNavigationLinks( pages = [] ) {\n\tconst linkMap = {};\n\tconst navigationLinks = [];\n\tpages.forEach( ( { id, title, link: url, type, parent } ) => {\n\t\t// See if a placeholder exists. This is created if children appear before parents in list.\n\t\tconst innerBlocks = linkMap[ id ]?.innerBlocks ?? [];\n\t\tlinkMap[ id ] = createBlock(\n\t\t\t'core/navigation-link',\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tlabel: title.rendered,\n\t\t\t\turl,\n\t\t\t\ttype,\n\t\t\t\tkind: 'post-type',\n\t\t\t},\n\t\t\tinnerBlocks\n\t\t);\n\n\t\tif ( ! parent ) {\n\t\t\tnavigationLinks.push( linkMap[ id ] );\n\t\t} else {\n\t\t\tif ( ! linkMap[ parent ] ) {\n\t\t\t\t// Use a placeholder if the child appears before parent in list.\n\t\t\t\tlinkMap[ parent ] = { innerBlocks: [] };\n\t\t\t}\n\t\t\t// Although these variables are not referenced, they are needed to store the innerBlocks in memory.\n\t\t\tconst parentLinkInnerBlocks = linkMap[ parent ].innerBlocks;\n\t\t\tparentLinkInnerBlocks.push( linkMap[ id ] );\n\t\t}\n\t} );\n\n\treturn navigationLinks;\n}\n\n/**\n * Finds a navigation link block by id, recursively.\n * It might be possible to make this a more generic helper function.\n *\n * @param {Array} navigationLinks An array of navigation link blocks.\n * @param {number} id The id of the navigation link to find.\n *\n * @return {Object|null} The navigation link block with the given id.\n */\nfunction findNavigationLinkById( navigationLinks, id ) {\n\tfor ( const navigationLink of navigationLinks ) {\n\t\t// Is this the link we're looking for?\n\t\tif ( navigationLink.attributes.id === id ) {\n\t\t\treturn navigationLink;\n\t\t}\n\n\t\t// If not does it have innerBlocks?\n\t\tif ( navigationLink.innerBlocks && navigationLink.innerBlocks.length ) {\n\t\t\tconst foundNavigationLink = findNavigationLinkById(\n\t\t\t\tnavigationLink.innerBlocks,\n\t\t\t\tid\n\t\t\t);\n\n\t\t\tif ( foundNavigationLink ) {\n\t\t\t\treturn foundNavigationLink;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function convertToNavigationLinks( pages = [], parentPageID = null ) {\n\tlet navigationLinks = createNavigationLinks( pages );\n\n\t// If a parent page ID is provided, only return the children of that page.\n\tif ( parentPageID ) {\n\t\tconst parentPage = findNavigationLinkById(\n\t\t\tnavigationLinks,\n\t\t\tparentPageID\n\t\t);\n\t\tif ( parentPage && parentPage.innerBlocks ) {\n\t\t\tnavigationLinks = parentPage.innerBlocks;\n\t\t}\n\t}\n\n\t// Transform all links with innerBlocks into Submenus. This can't be done\n\t// sooner because page objects have no information on their children.\n\tconst transformSubmenus = ( listOfLinks ) => {\n\t\tlistOfLinks.forEach( ( block, index, listOfLinksArray ) => {\n\t\t\tconst { attributes, innerBlocks } = block;\n\t\t\tif ( innerBlocks.length !== 0 ) {\n\t\t\t\ttransformSubmenus( innerBlocks );\n\t\t\t\tconst transformedBlock = createBlock(\n\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\tattributes,\n\t\t\t\t\tinnerBlocks\n\t\t\t\t);\n\t\t\t\tlistOfLinksArray[ index ] = transformedBlock;\n\t\t\t}\n\t\t} );\n\t};\n\n\ttransformSubmenus( navigationLinks );\n\treturn navigationLinks;\n}\n\nexport function useConvertToNavigationLinks( {\n\tclientId,\n\tpages,\n\tparentClientId,\n\tparentPageID,\n} ) {\n\tconst { replaceBlock, selectBlock } = useDispatch( blockEditorStore );\n\n\treturn () => {\n\t\tconst navigationLinks = convertToNavigationLinks( pages, parentPageID );\n\n\t\t// Replace the Page List block with the Navigation Links.\n\t\treplaceBlock( clientId, navigationLinks );\n\n\t\t// Select the Navigation block to reveal the changes.\n\t\tselectBlock( parentClientId );\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,qBAAqBA,CAAEC,KAAK,GAAG,EAAE,EAAG;EAC5C,MAAMC,OAAO,GAAG,CAAC,CAAC;EAClB,MAAMC,eAAe,GAAG,EAAE;EAC1BF,KAAK,CAACG,OAAO,CAAE,CAAE;IAAEC,EAAE;IAAEC,KAAK;IAAEC,IAAI,EAAEC,GAAG;IAAEC,IAAI;IAAEC;EAAO,CAAC,KAAM;IAAA,IAAAC,qBAAA;IAC5D;IACA,MAAMC,WAAW,IAAAD,qBAAA,GAAGT,OAAO,CAAEG,EAAE,CAAE,EAAEO,WAAW,cAAAD,qBAAA,cAAAA,qBAAA,GAAI,EAAE;IACpDT,OAAO,CAAEG,EAAE,CAAE,GAAGT,WAAW,CAC1B,sBAAsB,EACtB;MACCS,EAAE;MACFQ,KAAK,EAAEP,KAAK,CAACQ,QAAQ;MACrBN,GAAG;MACHC,IAAI;MACJM,IAAI,EAAE;IACP,CAAC,EACDH,WACD,CAAC;IAED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AAGsB,UAAU,CAACb,WAAW;IACzC;EACD;;EAEA;EACA;EACA,MAAMc,iBAAiB,GAAKC,WAAW,IAAM;IAC5CA,WAAW,CAACvB,OAAO,CAAE,CAAEwB,KAAK,EAAEC,KAAK,EAAEC,gBAAgB,KAAM;MAC1D,MAAM;QAAEV,UAAU;QAAER;MAAY,CAAC,GAAGgB,KAAK;MACzC,IAAKhB,WAAW,CAACS,MAAM,KAAK,CAAC,EAAG;QAC/BK,iBAAiB,CAAEd,WAAY,CAAC;QAChC,MAAMmB,gBAAgB,GAAGnC,WAAW,CACnC,yBAAyB,EACzBwB,UAAU,EACVR,WACD,CAAC;QACDkB,gBAAgB,CAAED,KAAK,CAAE,GAAGE,gBAAgB;MAC7C;IACD,CAAE,CAAC;EACJ,CAAC;EAEDL,iBAAiB,CAAEvB,eAAgB,CAAC;EACpC,OAAOA,eAAe;AACvB;AAEA,OAAO,SAAS6B,2BAA2BA,CAAE;EAC5CC,QAAQ;EACRhC,KAAK;EACLiC,cAAc;EACdV;AACD,CAAC,EAAG;EACH,MAAM;IAAEW,YAAY;IAAEC;EAAY,CAAC,GAAGvC,WAAW,CAAEE,gBAAiB,CAAC;EAErE,OAAO,MAAM;IACZ,MAAMI,eAAe,GAAGoB,wBAAwB,CAAEtB,KAAK,EAAEuB,YAAa,CAAC;;IAEvE;IACAW,YAAY,CAAEF,QAAQ,EAAE9B,eAAgB,CAAC;;IAEzC;IACAiC,WAAW,CAAEF,cAAe,CAAC;EAC9B,CAAC;AACF","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["cloneBlock","useSelect","useDispatch","useRegistry","useState","useEffect","Warning","store","blockEditorStore","useBlockProps","coreStore","__","sprintf","useParsePatternDependencies","jsx","_jsx","PatternEdit","attributes","clientId","registry","selectedPattern","select","__experimentalGetParsedPattern","slug","currentThemeStylesheet","getCurrentTheme","stylesheet","replaceBlocks","setBlockEditingMode","__unstableMarkNextChangeAsNotPersistent","getBlockRootClientId","getBlockEditingMode","hasRecursionError","setHasRecursionError","parsePatternDependencies","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","theme","undefined","blocks","error","window","queueMicrotask","rootClientId","clonedBlocks","length","categories","metadata","patternName","title","rootEditingMode","batch","props","children"],"sources":["@wordpress/block-library/src/pattern/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\tWarning,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useParsePatternDependencies } from './recursion-detector';\n\nconst PatternEdit = ( { attributes, clientId } ) => {\n\tconst registry = useRegistry();\n\tconst selectedPattern = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).__experimentalGetParsedPattern(\n\t\t\t\tattributes.slug\n\t\t\t),\n\t\t[ attributes.slug ]\n\t);\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.stylesheet,\n\t\t[]\n\t);\n\n\tconst {\n\t\treplaceBlocks,\n\t\tsetBlockEditingMode,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\tconst { getBlockRootClientId, getBlockEditingMode } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst [ hasRecursionError, setHasRecursionError ] = useState( false );\n\tconst parsePatternDependencies = useParsePatternDependencies();\n\n\t// Duplicated in packages/editor/src/components/start-template-options/index.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\t// Run this effect when the component loads.\n\t// This adds the Pattern's contents to the post.\n\t// This change won't be saved.\n\t// It will continue to pull from the pattern file unless changes are made to its respective template part.\n\tuseEffect( () => {\n\t\tif ( ! hasRecursionError && selectedPattern?.blocks ) {\n\t\t\ttry {\n\t\t\t\tparsePatternDependencies( selectedPattern );\n\t\t\t} catch ( error ) {\n\t\t\t\tsetHasRecursionError( true );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We batch updates to block list settings to avoid triggering cascading renders\n\t\t\t// for each container block included in a tree and optimize initial render.\n\t\t\t// Since the above uses microtasks, we need to use a microtask here as well,\n\t\t\t// because nested pattern blocks cannot be inserted if the parent block supports\n\t\t\t// inner blocks but doesn't have blockSettings in the state.\n\t\t\twindow.queueMicrotask( () => {\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\t\t// Clone blocks from the pattern before insertion to ensure they receive\n\t\t\t\t// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.\n\t\t\t\tconst clonedBlocks = selectedPattern.blocks.map( ( block ) =>\n\t\t\t\t\tcloneBlock(\n\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t// If the pattern has a single block and categories, we should add the\n\t\t\t\t// categories of the pattern to the block's metadata.\n\t\t\t\tif (\n\t\t\t\t\tclonedBlocks.length === 1 &&\n\t\t\t\t\tselectedPattern.categories?.length > 0\n\t\t\t\t) {\n\t\t\t\t\tclonedBlocks[ 0 ].attributes = {\n\t\t\t\t\t\t...clonedBlocks[ 0 ].attributes,\n\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\t...clonedBlocks[ 0 ].attributes.metadata,\n\t\t\t\t\t\t\tcategories: selectedPattern.categories,\n\t\t\t\t\t\t\tpatternName: selectedPattern.name,\n\t\t\t\t\t\t\tname:\n\t\t\t\t\t\t\t\tclonedBlocks[ 0 ].attributes.metadata.name ||\n\t\t\t\t\t\t\t\tselectedPattern.title,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst rootEditingMode = getBlockEditingMode( rootClientId );\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t// Temporarily set the root block to default mode to allow replacing the pattern.\n\t\t\t\t\t// This could happen when the page is disabling edits of non-content blocks.\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\tsetBlockEditingMode( rootClientId, 'default' );\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\treplaceBlocks( clientId, clonedBlocks );\n\t\t\t\t\t// Restore the root block's original mode.\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\tsetBlockEditingMode( rootClientId, rootEditingMode );\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\t}, [\n\t\tclientId,\n\t\thasRecursionError,\n\t\tselectedPattern,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlocks,\n\t\tgetBlockEditingMode,\n\t\tsetBlockEditingMode,\n\t\tgetBlockRootClientId,\n\t] );\n\n\tconst props = useBlockProps();\n\n\tif ( hasRecursionError ) {\n\t\treturn (\n\t\t\t<div { ...props }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: A warning in which %s is the name of a pattern.\n\t\t\t\t\t\t__( 'Pattern \"%s\" cannot be rendered inside itself.' ),\n\t\t\t\t\t\tselectedPattern?.name\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn <div { ...props } />;\n};\n\nexport default PatternEdit;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,SAAS,EAAEC,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AACrE,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SACCC,OAAO,EACPC,KAAK,IAAIC,gBAAgB,EACzBC,aAAa,QACP,yBAAyB;AAChC,SAASF,KAAK,IAAIG,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,SAASC,2BAA2B,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnE,MAAMC,WAAW,GAAGA,CAAE;EAAEC,UAAU;EAAEC;AAAS,CAAC,KAAM;EACnD,MAAMC,QAAQ,GAAGhB,WAAW,CAAC,CAAC;EAC9B,MAAMiB,eAAe,GAAGnB,SAAS,CAC9BoB,MAAM,IACPA,MAAM,CAAEb,gBAAiB,CAAC,CAACc,8BAA8B,CACxDL,UAAU,CAACM,IACZ,CAAC,EACF,CAAEN,UAAU,CAACM,IAAI,CAClB,CAAC;EAED,MAAMC,sBAAsB,GAAGvB,SAAS,CACrCoB,MAAM,IAAMA,MAAM,CAAEX,SAAU,CAAC,CAACe,eAAe,CAAC,CAAC,EAAEC,UAAU,EAC/D,EACD,CAAC;EAED,MAAM;IACLC,aAAa;IACbC,mBAAmB;IACnBC;EACD,CAAC,GAAG3B,WAAW,CAAEM,gBAAiB,CAAC;EACnC,MAAM;IAAEsB,oBAAoB;IAAEC;EAAoB,CAAC,GAClD9B,SAAS,CAAEO,gBAAiB,CAAC;EAE9B,M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OAAO;QAAAoD,QAAA,EACL9C,OAAO;QACR;QACAD,EAAE,CAAE,gDAAiD,CAAC,EACtDS,eAAe,EAAEoB,IAClB;MAAC,CACO;IAAC,CACN,CAAC;EAER;EAEA,oBAAOzB,IAAA;IAAA,GAAU0C;EAAK,CAAI,CAAC;AAC5B,CAAC;AAED,eAAezC,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["cloneBlock","useSelect","useDispatch","useRegistry","useState","useEffect","Warning","store","blockEditorStore","useBlockProps","coreStore","__","sprintf","useParsePatternDependencies","jsx","_jsx","PatternEdit","attributes","clientId","registry","selectedPattern","select","__experimentalGetParsedPattern","slug","currentThemeStylesheet","getCurrentTheme","stylesheet","replaceBlocks","setBlockEditingMode","__unstableMarkNextChangeAsNotPersistent","getBlockRootClientId","getBlockEditingMode","hasRecursionError","setHasRecursionError","parsePatternDependencies","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","theme","undefined","blocks","error","window","queueMicrotask","rootClientId","clonedBlocks","length","categories","metadata","patternName","title","rootEditingMode","batch","props","children"],"sources":["@wordpress/block-library/src/pattern/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\tWarning,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useParsePatternDependencies } from './recursion-detector';\n\nconst PatternEdit = ( { attributes, clientId } ) => {\n\tconst registry = useRegistry();\n\tconst selectedPattern = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).__experimentalGetParsedPattern(\n\t\t\t\tattributes.slug\n\t\t\t),\n\t\t[ attributes.slug ]\n\t);\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.stylesheet,\n\t\t[]\n\t);\n\n\tconst {\n\t\treplaceBlocks,\n\t\tsetBlockEditingMode,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\tconst { getBlockRootClientId, getBlockEditingMode } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst [ hasRecursionError, setHasRecursionError ] = useState( false );\n\tconst parsePatternDependencies = useParsePatternDependencies();\n\n\t// Duplicated in packages/editor/src/components/start-template-options/index.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\t// Run this effect when the component loads.\n\t// This adds the Pattern's contents to the post.\n\t// This change won't be saved.\n\t// It will continue to pull from the pattern file unless changes are made to its respective template part.\n\tuseEffect( () => {\n\t\tif ( ! hasRecursionError && selectedPattern?.blocks ) {\n\t\t\ttry {\n\t\t\t\tparsePatternDependencies( selectedPattern );\n\t\t\t} catch ( error ) {\n\t\t\t\tsetHasRecursionError( true );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We batch updates to block list settings to avoid triggering cascading renders\n\t\t\t// for each container block included in a tree and optimize initial render.\n\t\t\t// Since the above uses microtasks, we need to use a microtask here as well,\n\t\t\t// because nested pattern blocks cannot be inserted if the parent block supports\n\t\t\t// inner blocks but doesn't have blockSettings in the state.\n\t\t\twindow.queueMicrotask( () => {\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\t\t// Clone blocks from the pattern before insertion to ensure they receive\n\t\t\t\t// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.\n\t\t\t\tconst clonedBlocks = selectedPattern.blocks.map( ( block ) =>\n\t\t\t\t\tcloneBlock(\n\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t// If the pattern has a single block and categories, we should add the\n\t\t\t\t// categories of the pattern to the block's metadata.\n\t\t\t\tif (\n\t\t\t\t\tclonedBlocks.length === 1 &&\n\t\t\t\t\tselectedPattern.categories?.length > 0\n\t\t\t\t) {\n\t\t\t\t\tclonedBlocks[ 0 ].attributes = {\n\t\t\t\t\t\t...clonedBlocks[ 0 ].attributes,\n\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\t...clonedBlocks[ 0 ].attributes.metadata,\n\t\t\t\t\t\t\tcategories: selectedPattern.categories,\n\t\t\t\t\t\t\tpatternName: selectedPattern.name,\n\t\t\t\t\t\t\tname:\n\t\t\t\t\t\t\t\tclonedBlocks[ 0 ].attributes.metadata.name ||\n\t\t\t\t\t\t\t\tselectedPattern.title,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst rootEditingMode = getBlockEditingMode( rootClientId );\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t// Temporarily set the root block to default mode to allow replacing the pattern.\n\t\t\t\t\t// This could happen when the page is disabling edits of non-content blocks.\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\tsetBlockEditingMode( rootClientId, 'default' );\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\treplaceBlocks( clientId, clonedBlocks );\n\t\t\t\t\t// Restore the root block's original mode.\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\tsetBlockEditingMode( rootClientId, rootEditingMode );\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\t}, [\n\t\tclientId,\n\t\thasRecursionError,\n\t\tselectedPattern,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlocks,\n\t\tgetBlockEditingMode,\n\t\tsetBlockEditingMode,\n\t\tgetBlockRootClientId,\n\t] );\n\n\tconst props = useBlockProps();\n\n\tif ( hasRecursionError ) {\n\t\treturn (\n\t\t\t<div { ...props }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: A warning in which %s is the name of a pattern.\n\t\t\t\t\t\t__( 'Pattern \"%s\" cannot be rendered inside itself.' ),\n\t\t\t\t\t\tselectedPattern?.name\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn <div { ...props } />;\n};\n\nexport default PatternEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,SAAS,EAAEC,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AACrE,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SACCC,OAAO,EACPC,KAAK,IAAIC,gBAAgB,EACzBC,aAAa,QACP,yBAAyB;AAChC,SAASF,KAAK,IAAIG,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,SAASC,2BAA2B,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnE,MAAMC,WAAW,GAAGA,CAAE;EAAEC,UAAU;EAAEC;AAAS,CAAC,KAAM;EACnD,MAAMC,QAAQ,GAAGhB,WAAW,CAAC,CAAC;EAC9B,MAAMiB,eAAe,GAAGnB,SAAS,CAC9BoB,MAAM,IACPA,MAAM,C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Aa,CAAC;UACvC;UACApB,uCAAuC,CAAC,CAAC;UACzCD,mBAAmB,CAAEoB,YAAY,EAAEO,eAAgB,CAAC;QACrD,CAAE,CAAC;MACJ,CAAE,CAAC;IACJ;EACD,CAAC,EAAE,CACFrC,QAAQ,EACRc,iBAAiB,EACjBZ,eAAe,EACfS,uCAAuC,EACvCF,aAAa,EACbI,mBAAmB,EACnBH,mBAAmB,EACnBE,oBAAoB,CACnB,CAAC;EAEH,MAAM2B,KAAK,GAAGhD,aAAa,CAAC,CAAC;EAE7B,IAAKuB,iBAAiB,EAAG;IACxB,oBACCjB,IAAA;MAAA,GAAU0C,KAAK;MAAAC,QAAA,eACd3C,IAAA,CAACT,OAAO;QAAAoD,QAAA,EACL9C,OAAO;QACR;QACAD,EAAE,CAAE,gDAAiD,CAAC,EACtDS,eAAe,EAAEoB,IAClB;MAAC,CACO;IAAC,CACN,CAAC;EAER;EAEA,oBAAOzB,IAAA;IAAA,GAAU0C;EAAK,CAAI,CAAC;AAC5B,CAAC;AAED,eAAezC,WAAW","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","AlignmentControl","BlockControls","InspectorControls","RichText","useBlockProps","ComboboxControl","PanelBody","SelectControl","ToggleControl","__experimentalVStack","VStack","useSelect","useDispatch","__","sprintf","store","coreStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","minimumUsersForCombobox","AUTHORS_QUERY","who","per_page","PostAuthorEdit","isSelected","context","postType","postId","queryId","attributes","setAttributes","isDescendentOfQueryLoop","Number","isFinite","authorId","authorDetails","authors","supportsAuthor","select","_getPostType$supports","getEditedEntityRecord","getUser","getUsers","getPostType","_authorId","author","supports","editEntityRecord","textAlign","showAvatar","showBio","byline","isLink","linkTarget","avatarSizes","authorName","name","avatar_urls","Object","keys","forEach","size","push","value","label","blockProps","className","authorOptions","length","map","id","handleSelect","nextAuthorId","showCombobox","showAuthorControl","children","title","spacing","__next40pxDefaultSize","__nextHasNoMarginBottom","options","onChange","allowReset","checked","avatarSize","group","nextAlign","width","src","alt","isEmpty","identifier","placeholder","href","onClick","event","preventDefault","dangerouslySetInnerHTML","__html","description"],"sources":["@wordpress/block-library/src/post-author/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tComboboxControl,\n\tPanelBody,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst minimumUsersForCombobox = 25;\n\nconst AUTHORS_QUERY = {\n\twho: 'authors',\n\tper_page: 100,\n};\n\nfunction PostAuthorEdit( {\n\tisSelected,\n\tcontext: { postType, postId, queryId },\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { authorId, authorDetails, authors, supportsAuthor } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser, getUsers, getPostType } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorId: _authorId,\n\t\t\t\tauthorDetails: _authorId ? getUser( _authorId ) : null,\n\t\t\t\tauthors: getUsers( AUTHORS_QUERY ),\n\t\t\t\tsupportsAuthor:\n\t\t\t\t\tgetPostType( postType )?.supports?.author ?? false,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst { textAlign, showAvatar, showBio, byline, isLink, linkTarget } =\n\t\tattributes;\n\tconst avatarSizes = [];\n\tconst authorName = authorDetails?.name || __( 'Post Author' );\n\tif ( authorDetails?.avatar_urls ) {\n\t\tObject.keys( authorDetails.avatar_urls ).forEach( ( size ) => {\n\t\t\tavatarSizes.push( {\n\t\t\t\tvalue: size,\n\t\t\t\tlabel: `${ size } x ${ size }`,\n\t\t\t} );\n\t\t} );\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst authorOptions = authors?.length\n\t\t? authors.map( ( { id, name } ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: id,\n\t\t\t\t\tlabel: name,\n\t\t\t\t};\n\t\t } )\n\t\t: [];\n\n\tconst handleSelect = ( nextAuthorId ) => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tauthor: nextAuthorId,\n\t\t} );\n\t};\n\n\tconst showCombobox = authorOptions.length >= minimumUsersForCombobox;\n\tconst showAuthorControl =\n\t\t!! postId && ! isDescendentOfQueryLoop && authorOptions.length > 0;\n\n\tif ( ! supportsAuthor ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t__( 'This post type (%s) does not support the author.' ),\n\t\t\t\t\tpostType\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\tclassName=\"wp-block-post-author__inspector-settings\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showAuthorControl &&\n\t\t\t\t\t\t\t( ( showCombobox && (\n\t\t\t\t\t\t\t\t<ComboboxControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) || (\n\t\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show avatar' ) }\n\t\t\t\t\t\t\tchecked={ showAvatar }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showAvatar: ! showAvatar } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ showAvatar && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Avatar size' ) }\n\t\t\t\t\t\t\t\tvalue={ attributes.avatarSize }\n\t\t\t\t\t\t\t\toptions={ avatarSizes }\n\t\t\t\t\t\t\t\tonChange={ ( size ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tavatarSize: Number( size ),\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\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show bio' ) }\n\t\t\t\t\t\t\tchecked={ showBio }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showBio: ! showBio } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link author name to author page' ) }\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ showAvatar && authorDetails?.avatar_urls && (\n\t\t\t\t\t<div className=\"wp-block-post-author__avatar\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\twidth={ attributes.avatarSize }\n\t\t\t\t\t\t\tsrc={\n\t\t\t\t\t\t\t\tauthorDetails.avatar_urls[\n\t\t\t\t\t\t\t\t\tattributes.avatarSize\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\talt={ authorDetails.name }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"wp-block-post-author__content\">\n\t\t\t\t\t{ ( ! RichText.isEmpty( byline ) || isSelected ) && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tidentifier=\"byline\"\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__byline\"\n\t\t\t\t\t\t\taria-label={ __( 'Post author byline text' ) }\n\t\t\t\t\t\t\tplaceholder={ __( 'Write byline…' ) }\n\t\t\t\t\t\t\tvalue={ byline }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { byline: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<p className=\"wp-block-post-author__name\">\n\t\t\t\t\t\t{ isLink ? (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref=\"#post-author-pseudo-link\"\n\t\t\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ authorName }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tauthorName\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t{ showBio && (\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__bio\"\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t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,SAAS,EAAC,4BAA4B;UAAAS,QAAA,EACtCvB,MAAM,gBACPtC,IAAA;YACC+E,IAAI,EAAC,0BAA0B;YAC/BC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;YAAArB,QAAA,EAE7CpB;UAAU,CACV,CAAC,GAEJA;QACA,CACC,CAAC,EACFL,OAAO,iBACRpC,IAAA;UACCoD,SAAS,EAAC,2BAA2B;UACrC+B,uBAAuB,EAAG;YACzBC,MAAM,EAAE/D,aAAa,EAAEgE;UACxB;QAAG,CACH,CACD;MAAA,CACG,CAAC;IAAA,CACF,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,eAAe5E,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["clsx","AlignmentControl","BlockControls","InspectorControls","RichText","useBlockProps","ComboboxControl","PanelBody","SelectControl","ToggleControl","__experimentalVStack","VStack","useSelect","useDispatch","__","sprintf","store","coreStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","minimumUsersForCombobox","AUTHORS_QUERY","who","per_page","PostAuthorEdit","isSelected","context","postType","postId","queryId","attributes","setAttributes","isDescendentOfQueryLoop","Number","isFinite","authorId","authorDetails","authors","supportsAuthor","select","_getPostType$supports","getEditedEntityRecord","getUser","getUsers","getPostType","_authorId","author","supports","editEntityRecord","textAlign","showAvatar","showBio","byline","isLink","linkTarget","avatarSizes","authorName","name","avatar_urls","Object","keys","forEach","size","push","value","label","blockProps","className","authorOptions","length","map","id","handleSelect","nextAuthorId","showCombobox","showAuthorControl","children","title","spacing","__next40pxDefaultSize","__nextHasNoMarginBottom","options","onChange","allowReset","checked","avatarSize","group","nextAlign","width","src","alt","isEmpty","identifier","placeholder","href","onClick","event","preventDefault","dangerouslySetInnerHTML","__html","description"],"sources":["@wordpress/block-library/src/post-author/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tComboboxControl,\n\tPanelBody,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst minimumUsersForCombobox = 25;\n\nconst AUTHORS_QUERY = {\n\twho: 'authors',\n\tper_page: 100,\n};\n\nfunction PostAuthorEdit( {\n\tisSelected,\n\tcontext: { postType, postId, queryId },\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { authorId, authorDetails, authors, supportsAuthor } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser, getUsers, getPostType } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorId: _authorId,\n\t\t\t\tauthorDetails: _authorId ? getUser( _authorId ) : null,\n\t\t\t\tauthors: getUsers( AUTHORS_QUERY ),\n\t\t\t\tsupportsAuthor:\n\t\t\t\t\tgetPostType( postType )?.supports?.author ?? false,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst { textAlign, showAvatar, showBio, byline, isLink, linkTarget } =\n\t\tattributes;\n\tconst avatarSizes = [];\n\tconst authorName = authorDetails?.name || __( 'Post Author' );\n\tif ( authorDetails?.avatar_urls ) {\n\t\tObject.keys( authorDetails.avatar_urls ).forEach( ( size ) => {\n\t\t\tavatarSizes.push( {\n\t\t\t\tvalue: size,\n\t\t\t\tlabel: `${ size } x ${ size }`,\n\t\t\t} );\n\t\t} );\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst authorOptions = authors?.length\n\t\t? authors.map( ( { id, name } ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: id,\n\t\t\t\t\tlabel: name,\n\t\t\t\t};\n\t\t } )\n\t\t: [];\n\n\tconst handleSelect = ( nextAuthorId ) => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tauthor: nextAuthorId,\n\t\t} );\n\t};\n\n\tconst showCombobox = authorOptions.length >= minimumUsersForCombobox;\n\tconst showAuthorControl =\n\t\t!! postId && ! isDescendentOfQueryLoop && authorOptions.length > 0;\n\n\tif ( ! supportsAuthor ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t__( 'This post type (%s) does not support the author.' ),\n\t\t\t\t\tpostType\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\tclassName=\"wp-block-post-author__inspector-settings\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showAuthorControl &&\n\t\t\t\t\t\t\t( ( showCombobox && (\n\t\t\t\t\t\t\t\t<ComboboxControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) || (\n\t\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show avatar' ) }\n\t\t\t\t\t\t\tchecked={ showAvatar }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showAvatar: ! showAvatar } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ showAvatar && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Avatar size' ) }\n\t\t\t\t\t\t\t\tvalue={ attributes.avatarSize }\n\t\t\t\t\t\t\t\toptions={ avatarSizes }\n\t\t\t\t\t\t\t\tonChange={ ( size ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tavatarSize: Number( size ),\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\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show bio' ) }\n\t\t\t\t\t\t\tchecked={ showBio }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showBio: ! showBio } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link author name to author page' ) }\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ showAvatar && authorDetails?.avatar_urls && (\n\t\t\t\t\t<div className=\"wp-block-post-author__avatar\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\twidth={ attributes.avatarSize }\n\t\t\t\t\t\t\tsrc={\n\t\t\t\t\t\t\t\tauthorDetails.avatar_urls[\n\t\t\t\t\t\t\t\t\tattributes.avatarSize\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\talt={ authorDetails.name }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"wp-block-post-author__content\">\n\t\t\t\t\t{ ( ! RichText.isEmpty( byline ) || isSelected ) && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tidentifier=\"byline\"\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__byline\"\n\t\t\t\t\t\t\taria-label={ __( 'Post author byline text' ) }\n\t\t\t\t\t\t\tplaceholder={ __( 'Write byline…' ) }\n\t\t\t\t\t\t\tvalue={ byline }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { byline: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<p className=\"wp-block-post-author__name\">\n\t\t\t\t\t\t{ isLink ? (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref=\"#post-author-pseudo-link\"\n\t\t\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ authorName }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tauthorName\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t{ showBio && (\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__bio\"\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: authorDetails?.description,\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</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default PostAuthorEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACRC,aAAa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zBC,MAAM,EAAE/D,aAAa,EAAEgE;UACxB;QAAG,CACH,CACD;MAAA,CACG,CAAC;IAAA,CACF,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,eAAe5E,cAAc","ignoreList":[]}
@@ -48,10 +48,17 @@ const metadata = {
48
48
  fontSize: true
49
49
  }
50
50
  },
51
+ __experimentalBorder: {
52
+ radius: true,
53
+ color: true,
54
+ width: true,
55
+ style: true
56
+ },
51
57
  interactivity: {
52
58
  clientNavigation: true
53
59
  }
54
- }
60
+ },
61
+ style: "wp-block-post-comments-count"
55
62
  };
56
63
  import edit from './edit';
57
64
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["postCommentsCount","icon","initBlock","metadata","$schema","apiVersion","__experimental","name","title","category","description","textdomain","attributes","textAlign","type","usesContext","supports","html","color","gradients","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","edit","settings","init"],"sources":["@wordpress/block-library/src/post-comments-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postCommentsCount as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,IAAIC,IAAI,QAAQ,kBAAkB;;AAE5D;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,cAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,QAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAd,6BAAA;QAAAO,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;EAAA;AAAA;AAE5C,OAAOC,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAE9B;AAAK,CAAC,GAAGJ,QAAQ;AACzB,SAASA,QAAQ,EAAEI,IAAI;AAEvB,OAAO,MAAM+B,QAAQ,GAAG;EACvBrC,IAAI;EACJoC;AACD,CAAC;AAED,OAAO,MAAME,IAAI,GAAGA,CAAA,KAAMrC,SAAS,CAAE;EAAEK,IAAI;EAAEJ,QAAQ;EAAEmC;AAAS,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["postCommentsCount","icon","initBlock","metadata","$schema","apiVersion","__experimental","name","title","category","description","textdomain","attributes","textAlign","type","usesContext","supports","html","color","gradients","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalBorder","radius","width","style","interactivity","clientNavigation","edit","settings","init"],"sources":["@wordpress/block-library/src/post-comments-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postCommentsCount as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,IAAIC,IAAI,QAAQ,kBAAkB;;AAE5D;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,cAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,QAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAd,6BAAA;QAAAO,QAAA;MAAA;IAAA;IAAAQ,oBAAA;MAAAC,MAAA;MAAAlB,KAAA;MAAAmB,KAAA;MAAAC,KAAA;IAAA;IAAAC,aAAA;MAAAC,gBAAA;IAAA;EAAA;EAAAF,KAAA;AAAA;AAE5C,OAAOG,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAElC;AAAK,CAAC,GAAGJ,QAAQ;AACzB,SAASA,QAAQ,EAAEI,IAAI;AAEvB,OAAO,MAAMmC,QAAQ,GAAG;EACvBzC,IAAI;EACJwC;AACD,CAAC;AAED,OAAO,MAAME,IAAI,GAAGA,CAAA,KAAMzC,SAAS,CAAE;EAAEK,IAAI;EAAEJ,QAAQ;EAAEuC;AAAS,CAAE,CAAC","ignoreList":[]}