@wordpress/block-library 8.34.0 → 8.35.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 (721) hide show
  1. package/CHANGELOG.md +8 -3
  2. package/build/audio/edit.js +2 -2
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/avatar/edit.js +2 -2
  5. package/build/avatar/edit.js.map +1 -1
  6. package/build/block/edit.js +23 -165
  7. package/build/block/edit.js.map +1 -1
  8. package/build/button/deprecated.js +16 -16
  9. package/build/button/deprecated.js.map +1 -1
  10. package/build/button/edit.js +3 -7
  11. package/build/button/edit.js.map +1 -1
  12. package/build/button/index.js +1 -0
  13. package/build/button/index.js.map +1 -1
  14. package/build/button/save.js +3 -3
  15. package/build/button/save.js.map +1 -1
  16. package/build/buttons/deprecated.js +2 -2
  17. package/build/buttons/deprecated.js.map +1 -1
  18. package/build/buttons/edit.js +2 -2
  19. package/build/buttons/edit.js.map +1 -1
  20. package/build/buttons/save.js +2 -2
  21. package/build/buttons/save.js.map +1 -1
  22. package/build/categories/edit.js +2 -2
  23. package/build/categories/edit.js.map +1 -1
  24. package/build/column/deprecated.js +2 -2
  25. package/build/column/deprecated.js.map +1 -1
  26. package/build/column/edit.js +2 -2
  27. package/build/column/edit.js.map +1 -1
  28. package/build/column/save.js +2 -2
  29. package/build/column/save.js.map +1 -1
  30. package/build/columns/deprecated.js +3 -3
  31. package/build/columns/deprecated.js.map +1 -1
  32. package/build/columns/edit.js +2 -2
  33. package/build/columns/edit.js.map +1 -1
  34. package/build/columns/save.js +2 -2
  35. package/build/columns/save.js.map +1 -1
  36. package/build/comment-author-name/edit.js +2 -2
  37. package/build/comment-author-name/edit.js.map +1 -1
  38. package/build/comment-content/edit.js +2 -2
  39. package/build/comment-content/edit.js.map +1 -1
  40. package/build/comment-edit-link/edit.js +2 -2
  41. package/build/comment-edit-link/edit.js.map +1 -1
  42. package/build/comment-reply-link/edit.js +2 -2
  43. package/build/comment-reply-link/edit.js.map +1 -1
  44. package/build/comments/edit/comments-legacy.js +2 -2
  45. package/build/comments/edit/comments-legacy.js.map +1 -1
  46. package/build/comments-title/edit.js +2 -2
  47. package/build/comments-title/edit.js.map +1 -1
  48. package/build/cover/deprecated.js +38 -38
  49. package/build/cover/deprecated.js.map +1 -1
  50. package/build/cover/edit/index.js +6 -6
  51. package/build/cover/edit/index.js.map +1 -1
  52. package/build/cover/edit/resizable-cover-popover.js +2 -2
  53. package/build/cover/edit/resizable-cover-popover.js.map +1 -1
  54. package/build/cover/edit.native.js +2 -2
  55. package/build/cover/edit.native.js.map +1 -1
  56. package/build/cover/save.js +5 -5
  57. package/build/cover/save.js.map +1 -1
  58. package/build/embed/deprecated.js +3 -3
  59. package/build/embed/deprecated.js.map +1 -1
  60. package/build/embed/edit.js +2 -2
  61. package/build/embed/edit.js.map +1 -1
  62. package/build/embed/edit.native.js +2 -2
  63. package/build/embed/edit.native.js.map +1 -1
  64. package/build/embed/embed-preview.js +3 -3
  65. package/build/embed/embed-preview.js.map +1 -1
  66. package/build/embed/embed-preview.native.js +2 -2
  67. package/build/embed/embed-preview.native.js.map +1 -1
  68. package/build/embed/icons.js +7 -1
  69. package/build/embed/icons.js.map +1 -1
  70. package/build/embed/save.js +2 -2
  71. package/build/embed/save.js.map +1 -1
  72. package/build/embed/util.js +10 -8
  73. package/build/embed/util.js.map +1 -1
  74. package/build/embed/variations.js +9 -0
  75. package/build/embed/variations.js.map +1 -1
  76. package/build/file/deprecated.js +2 -2
  77. package/build/file/deprecated.js.map +1 -1
  78. package/build/file/edit.js +3 -3
  79. package/build/file/edit.js.map +1 -1
  80. package/build/file/save.js +2 -2
  81. package/build/file/save.js.map +1 -1
  82. package/build/form-input/deprecated.js +3 -3
  83. package/build/form-input/deprecated.js.map +1 -1
  84. package/build/form-input/edit.js +4 -4
  85. package/build/form-input/edit.js.map +1 -1
  86. package/build/form-input/save.js +3 -3
  87. package/build/form-input/save.js.map +1 -1
  88. package/build/form-submission-notification/edit.js +2 -2
  89. package/build/form-submission-notification/edit.js.map +1 -1
  90. package/build/form-submission-notification/save.js +2 -2
  91. package/build/form-submission-notification/save.js.map +1 -1
  92. package/build/gallery/deprecated.js +3 -3
  93. package/build/gallery/deprecated.js.map +1 -1
  94. package/build/gallery/edit.js +2 -2
  95. package/build/gallery/edit.js.map +1 -1
  96. package/build/gallery/gallery.js +2 -2
  97. package/build/gallery/gallery.js.map +1 -1
  98. package/build/gallery/save.js +3 -3
  99. package/build/gallery/save.js.map +1 -1
  100. package/build/gallery/v1/gallery-image.js +2 -2
  101. package/build/gallery/v1/gallery-image.js.map +1 -1
  102. package/build/gallery/v1/gallery.js +3 -3
  103. package/build/gallery/v1/gallery.js.map +1 -1
  104. package/build/gallery/v1/save.js +3 -3
  105. package/build/gallery/v1/save.js.map +1 -1
  106. package/build/group/deprecated.js +4 -4
  107. package/build/group/deprecated.js.map +1 -1
  108. package/build/heading/deprecated.js +6 -6
  109. package/build/heading/deprecated.js.map +1 -1
  110. package/build/heading/edit.js +2 -19
  111. package/build/heading/edit.js.map +1 -1
  112. package/build/heading/edit.native.js +2 -2
  113. package/build/heading/edit.native.js.map +1 -1
  114. package/build/heading/index.js +1 -0
  115. package/build/heading/index.js.map +1 -1
  116. package/build/heading/save.js +2 -2
  117. package/build/heading/save.js.map +1 -1
  118. package/build/home-link/edit.js +2 -2
  119. package/build/home-link/edit.js.map +1 -1
  120. package/build/html/edit.js +0 -2
  121. package/build/html/edit.js.map +1 -1
  122. package/build/image/deprecated.js +10 -10
  123. package/build/image/deprecated.js.map +1 -1
  124. package/build/image/edit.js +7 -5
  125. package/build/image/edit.js.map +1 -1
  126. package/build/image/image.js +5 -3
  127. package/build/image/image.js.map +1 -1
  128. package/build/image/save.js +3 -3
  129. package/build/image/save.js.map +1 -1
  130. package/build/latest-posts/edit.js +5 -5
  131. package/build/latest-posts/edit.js.map +1 -1
  132. package/build/list/deprecated.js +90 -1
  133. package/build/list/deprecated.js.map +1 -1
  134. package/build/list/index.js +0 -2
  135. package/build/list/index.js.map +1 -1
  136. package/build/list-item/edit.js +1 -8
  137. package/build/list-item/edit.js.map +1 -1
  138. package/build/list-item/index.js +2 -1
  139. package/build/list-item/index.js.map +1 -1
  140. package/build/media-text/deprecated.js +10 -10
  141. package/build/media-text/deprecated.js.map +1 -1
  142. package/build/media-text/edit.js +2 -2
  143. package/build/media-text/edit.js.map +1 -1
  144. package/build/media-text/media-container.js +2 -2
  145. package/build/media-text/media-container.js.map +1 -1
  146. package/build/media-text/save.js +3 -3
  147. package/build/media-text/save.js.map +1 -1
  148. package/build/navigation/edit/index.js +3 -3
  149. package/build/navigation/edit/index.js.map +1 -1
  150. package/build/navigation/edit/responsive-wrapper.js +3 -3
  151. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  152. package/build/navigation/edit/utils.js +2 -2
  153. package/build/navigation/edit/utils.js.map +1 -1
  154. package/build/navigation-link/edit.js +3 -3
  155. package/build/navigation-link/edit.js.map +1 -1
  156. package/build/navigation-submenu/edit.js +2 -2
  157. package/build/navigation-submenu/edit.js.map +1 -1
  158. package/build/page-list/edit.js +2 -2
  159. package/build/page-list/edit.js.map +1 -1
  160. package/build/page-list-item/edit.js +3 -3
  161. package/build/page-list-item/edit.js.map +1 -1
  162. package/build/paragraph/deprecated.js +6 -6
  163. package/build/paragraph/deprecated.js.map +1 -1
  164. package/build/paragraph/edit.js +2 -18
  165. package/build/paragraph/edit.js.map +1 -1
  166. package/build/paragraph/index.js +1 -0
  167. package/build/paragraph/index.js.map +1 -1
  168. package/build/paragraph/save.js +2 -2
  169. package/build/paragraph/save.js.map +1 -1
  170. package/build/paragraph/transforms.js +1 -0
  171. package/build/paragraph/transforms.js.map +1 -1
  172. package/build/pattern/edit.js +1 -1
  173. package/build/pattern/edit.js.map +1 -1
  174. package/build/post-author/edit.js +2 -2
  175. package/build/post-author/edit.js.map +1 -1
  176. package/build/post-author-biography/edit.js +2 -2
  177. package/build/post-author-biography/edit.js.map +1 -1
  178. package/build/post-author-name/edit.js +2 -2
  179. package/build/post-author-name/edit.js.map +1 -1
  180. package/build/post-comments-count/edit.js +2 -2
  181. package/build/post-comments-count/edit.js.map +1 -1
  182. package/build/post-comments-form/edit.js +2 -2
  183. package/build/post-comments-form/edit.js.map +1 -1
  184. package/build/post-comments-form/form.js +2 -2
  185. package/build/post-comments-form/form.js.map +1 -1
  186. package/build/post-comments-link/edit.js +2 -2
  187. package/build/post-comments-link/edit.js.map +1 -1
  188. package/build/post-date/edit.js +2 -2
  189. package/build/post-date/edit.js.map +1 -1
  190. package/build/post-excerpt/edit.js +3 -3
  191. package/build/post-excerpt/edit.js.map +1 -1
  192. package/build/post-featured-image/dimension-controls.js +20 -28
  193. package/build/post-featured-image/dimension-controls.js.map +1 -1
  194. package/build/post-featured-image/edit.js +3 -3
  195. package/build/post-featured-image/edit.js.map +1 -1
  196. package/build/post-featured-image/overlay.js +2 -2
  197. package/build/post-featured-image/overlay.js.map +1 -1
  198. package/build/post-navigation-link/edit.js +2 -2
  199. package/build/post-navigation-link/edit.js.map +1 -1
  200. package/build/post-template/edit.js +6 -6
  201. package/build/post-template/edit.js.map +1 -1
  202. package/build/post-terms/edit.js +2 -2
  203. package/build/post-terms/edit.js.map +1 -1
  204. package/build/post-time-to-read/edit.js +3 -3
  205. package/build/post-time-to-read/edit.js.map +1 -1
  206. package/build/post-title/edit.js +2 -2
  207. package/build/post-title/edit.js.map +1 -1
  208. package/build/pullquote/deprecated.js +7 -7
  209. package/build/pullquote/deprecated.js.map +1 -1
  210. package/build/pullquote/edit.js +2 -2
  211. package/build/pullquote/edit.js.map +1 -1
  212. package/build/pullquote/save.js +2 -2
  213. package/build/pullquote/save.js.map +1 -1
  214. package/build/query-title/edit.js +2 -2
  215. package/build/query-title/edit.js.map +1 -1
  216. package/build/quote/deprecated.js +3 -3
  217. package/build/quote/deprecated.js.map +1 -1
  218. package/build/quote/edit.js +2 -2
  219. package/build/quote/edit.js.map +1 -1
  220. package/build/quote/save.js +2 -2
  221. package/build/quote/save.js.map +1 -1
  222. package/build/rss/edit.js +8 -6
  223. package/build/rss/edit.js.map +1 -1
  224. package/build/search/edit.js +6 -6
  225. package/build/search/edit.js.map +1 -1
  226. package/build/search/edit.native.js +2 -2
  227. package/build/search/edit.native.js.map +1 -1
  228. package/build/separator/deprecated.js +2 -2
  229. package/build/separator/deprecated.js.map +1 -1
  230. package/build/separator/edit.js +2 -2
  231. package/build/separator/edit.js.map +1 -1
  232. package/build/separator/save.js +2 -2
  233. package/build/separator/save.js.map +1 -1
  234. package/build/shortcode/edit.js +7 -10
  235. package/build/shortcode/edit.js.map +1 -1
  236. package/build/site-logo/edit.js +4 -4
  237. package/build/site-logo/edit.js.map +1 -1
  238. package/build/site-tagline/edit.js +2 -2
  239. package/build/site-tagline/edit.js.map +1 -1
  240. package/build/site-title/edit.js +2 -2
  241. package/build/site-title/edit.js.map +1 -1
  242. package/build/social-link/edit.js +3 -3
  243. package/build/social-link/edit.js.map +1 -1
  244. package/build/social-links/deprecated.js +2 -2
  245. package/build/social-links/deprecated.js.map +1 -1
  246. package/build/social-links/edit.js +2 -2
  247. package/build/social-links/edit.js.map +1 -1
  248. package/build/social-links/save.js +2 -2
  249. package/build/social-links/save.js.map +1 -1
  250. package/build/spacer/edit.js +3 -3
  251. package/build/spacer/edit.js.map +1 -1
  252. package/build/table/deprecated.js +8 -8
  253. package/build/table/deprecated.js.map +1 -1
  254. package/build/table/edit.js +3 -3
  255. package/build/table/edit.js.map +1 -1
  256. package/build/table/save.js +3 -3
  257. package/build/table/save.js.map +1 -1
  258. package/build/term-description/edit.js +2 -2
  259. package/build/term-description/edit.js.map +1 -1
  260. package/build/utils/caption.js +2 -2
  261. package/build/utils/caption.js.map +1 -1
  262. package/build/verse/deprecated.js +2 -2
  263. package/build/verse/deprecated.js.map +1 -1
  264. package/build/verse/edit.js +2 -2
  265. package/build/verse/edit.js.map +1 -1
  266. package/build/verse/save.js +2 -2
  267. package/build/verse/save.js.map +1 -1
  268. package/build/video/edit.js +2 -2
  269. package/build/video/edit.js.map +1 -1
  270. package/build-module/audio/edit.js +2 -2
  271. package/build-module/audio/edit.js.map +1 -1
  272. package/build-module/avatar/edit.js +2 -2
  273. package/build-module/avatar/edit.js.map +1 -1
  274. package/build-module/block/edit.js +27 -169
  275. package/build-module/block/edit.js.map +1 -1
  276. package/build-module/button/deprecated.js +16 -16
  277. package/build-module/button/deprecated.js.map +1 -1
  278. package/build-module/button/edit.js +3 -7
  279. package/build-module/button/edit.js.map +1 -1
  280. package/build-module/button/index.js +1 -0
  281. package/build-module/button/index.js.map +1 -1
  282. package/build-module/button/save.js +3 -3
  283. package/build-module/button/save.js.map +1 -1
  284. package/build-module/buttons/deprecated.js +2 -2
  285. package/build-module/buttons/deprecated.js.map +1 -1
  286. package/build-module/buttons/edit.js +2 -2
  287. package/build-module/buttons/edit.js.map +1 -1
  288. package/build-module/buttons/save.js +2 -2
  289. package/build-module/buttons/save.js.map +1 -1
  290. package/build-module/categories/edit.js +2 -2
  291. package/build-module/categories/edit.js.map +1 -1
  292. package/build-module/column/deprecated.js +2 -2
  293. package/build-module/column/deprecated.js.map +1 -1
  294. package/build-module/column/edit.js +2 -2
  295. package/build-module/column/edit.js.map +1 -1
  296. package/build-module/column/save.js +2 -2
  297. package/build-module/column/save.js.map +1 -1
  298. package/build-module/columns/deprecated.js +3 -3
  299. package/build-module/columns/deprecated.js.map +1 -1
  300. package/build-module/columns/edit.js +2 -2
  301. package/build-module/columns/edit.js.map +1 -1
  302. package/build-module/columns/save.js +2 -2
  303. package/build-module/columns/save.js.map +1 -1
  304. package/build-module/comment-author-name/edit.js +2 -2
  305. package/build-module/comment-author-name/edit.js.map +1 -1
  306. package/build-module/comment-content/edit.js +2 -2
  307. package/build-module/comment-content/edit.js.map +1 -1
  308. package/build-module/comment-edit-link/edit.js +2 -2
  309. package/build-module/comment-edit-link/edit.js.map +1 -1
  310. package/build-module/comment-reply-link/edit.js +2 -2
  311. package/build-module/comment-reply-link/edit.js.map +1 -1
  312. package/build-module/comments/edit/comments-legacy.js +2 -2
  313. package/build-module/comments/edit/comments-legacy.js.map +1 -1
  314. package/build-module/comments-title/edit.js +2 -2
  315. package/build-module/comments-title/edit.js.map +1 -1
  316. package/build-module/cover/deprecated.js +38 -38
  317. package/build-module/cover/deprecated.js.map +1 -1
  318. package/build-module/cover/edit/index.js +6 -6
  319. package/build-module/cover/edit/index.js.map +1 -1
  320. package/build-module/cover/edit/resizable-cover-popover.js +2 -2
  321. package/build-module/cover/edit/resizable-cover-popover.js.map +1 -1
  322. package/build-module/cover/edit.native.js +2 -2
  323. package/build-module/cover/edit.native.js.map +1 -1
  324. package/build-module/cover/save.js +5 -5
  325. package/build-module/cover/save.js.map +1 -1
  326. package/build-module/embed/deprecated.js +3 -3
  327. package/build-module/embed/deprecated.js.map +1 -1
  328. package/build-module/embed/edit.js +2 -2
  329. package/build-module/embed/edit.js.map +1 -1
  330. package/build-module/embed/edit.native.js +2 -2
  331. package/build-module/embed/edit.native.js.map +1 -1
  332. package/build-module/embed/embed-preview.js +3 -3
  333. package/build-module/embed/embed-preview.js.map +1 -1
  334. package/build-module/embed/embed-preview.native.js +2 -2
  335. package/build-module/embed/embed-preview.native.js.map +1 -1
  336. package/build-module/embed/icons.js +6 -0
  337. package/build-module/embed/icons.js.map +1 -1
  338. package/build-module/embed/save.js +2 -2
  339. package/build-module/embed/save.js.map +1 -1
  340. package/build-module/embed/util.js +10 -8
  341. package/build-module/embed/util.js.map +1 -1
  342. package/build-module/embed/variations.js +10 -1
  343. package/build-module/embed/variations.js.map +1 -1
  344. package/build-module/file/deprecated.js +2 -2
  345. package/build-module/file/deprecated.js.map +1 -1
  346. package/build-module/file/edit.js +3 -3
  347. package/build-module/file/edit.js.map +1 -1
  348. package/build-module/file/save.js +2 -2
  349. package/build-module/file/save.js.map +1 -1
  350. package/build-module/form-input/deprecated.js +3 -3
  351. package/build-module/form-input/deprecated.js.map +1 -1
  352. package/build-module/form-input/edit.js +4 -4
  353. package/build-module/form-input/edit.js.map +1 -1
  354. package/build-module/form-input/save.js +3 -3
  355. package/build-module/form-input/save.js.map +1 -1
  356. package/build-module/form-submission-notification/edit.js +2 -2
  357. package/build-module/form-submission-notification/edit.js.map +1 -1
  358. package/build-module/form-submission-notification/save.js +2 -2
  359. package/build-module/form-submission-notification/save.js.map +1 -1
  360. package/build-module/gallery/deprecated.js +3 -3
  361. package/build-module/gallery/deprecated.js.map +1 -1
  362. package/build-module/gallery/edit.js +2 -2
  363. package/build-module/gallery/edit.js.map +1 -1
  364. package/build-module/gallery/gallery.js +2 -2
  365. package/build-module/gallery/gallery.js.map +1 -1
  366. package/build-module/gallery/save.js +3 -3
  367. package/build-module/gallery/save.js.map +1 -1
  368. package/build-module/gallery/v1/gallery-image.js +2 -2
  369. package/build-module/gallery/v1/gallery-image.js.map +1 -1
  370. package/build-module/gallery/v1/gallery.js +3 -3
  371. package/build-module/gallery/v1/gallery.js.map +1 -1
  372. package/build-module/gallery/v1/save.js +3 -3
  373. package/build-module/gallery/v1/save.js.map +1 -1
  374. package/build-module/group/deprecated.js +4 -4
  375. package/build-module/group/deprecated.js.map +1 -1
  376. package/build-module/heading/deprecated.js +6 -6
  377. package/build-module/heading/deprecated.js.map +1 -1
  378. package/build-module/heading/edit.js +2 -19
  379. package/build-module/heading/edit.js.map +1 -1
  380. package/build-module/heading/edit.native.js +2 -2
  381. package/build-module/heading/edit.native.js.map +1 -1
  382. package/build-module/heading/index.js +1 -0
  383. package/build-module/heading/index.js.map +1 -1
  384. package/build-module/heading/save.js +2 -2
  385. package/build-module/heading/save.js.map +1 -1
  386. package/build-module/home-link/edit.js +2 -2
  387. package/build-module/home-link/edit.js.map +1 -1
  388. package/build-module/html/edit.js +0 -2
  389. package/build-module/html/edit.js.map +1 -1
  390. package/build-module/image/deprecated.js +10 -10
  391. package/build-module/image/deprecated.js.map +1 -1
  392. package/build-module/image/edit.js +7 -5
  393. package/build-module/image/edit.js.map +1 -1
  394. package/build-module/image/image.js +5 -3
  395. package/build-module/image/image.js.map +1 -1
  396. package/build-module/image/save.js +3 -3
  397. package/build-module/image/save.js.map +1 -1
  398. package/build-module/latest-posts/edit.js +6 -6
  399. package/build-module/latest-posts/edit.js.map +1 -1
  400. package/build-module/list/deprecated.js +90 -1
  401. package/build-module/list/deprecated.js.map +1 -1
  402. package/build-module/list/index.js +0 -2
  403. package/build-module/list/index.js.map +1 -1
  404. package/build-module/list-item/edit.js +2 -9
  405. package/build-module/list-item/edit.js.map +1 -1
  406. package/build-module/list-item/index.js +2 -1
  407. package/build-module/list-item/index.js.map +1 -1
  408. package/build-module/media-text/deprecated.js +10 -10
  409. package/build-module/media-text/deprecated.js.map +1 -1
  410. package/build-module/media-text/edit.js +2 -2
  411. package/build-module/media-text/edit.js.map +1 -1
  412. package/build-module/media-text/media-container.js +2 -2
  413. package/build-module/media-text/media-container.js.map +1 -1
  414. package/build-module/media-text/save.js +3 -3
  415. package/build-module/media-text/save.js.map +1 -1
  416. package/build-module/navigation/edit/index.js +3 -3
  417. package/build-module/navigation/edit/index.js.map +1 -1
  418. package/build-module/navigation/edit/responsive-wrapper.js +3 -3
  419. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  420. package/build-module/navigation/edit/utils.js +2 -2
  421. package/build-module/navigation/edit/utils.js.map +1 -1
  422. package/build-module/navigation-link/edit.js +3 -3
  423. package/build-module/navigation-link/edit.js.map +1 -1
  424. package/build-module/navigation-submenu/edit.js +2 -2
  425. package/build-module/navigation-submenu/edit.js.map +1 -1
  426. package/build-module/page-list/edit.js +2 -2
  427. package/build-module/page-list/edit.js.map +1 -1
  428. package/build-module/page-list-item/edit.js +3 -3
  429. package/build-module/page-list-item/edit.js.map +1 -1
  430. package/build-module/paragraph/deprecated.js +6 -6
  431. package/build-module/paragraph/deprecated.js.map +1 -1
  432. package/build-module/paragraph/edit.js +2 -18
  433. package/build-module/paragraph/edit.js.map +1 -1
  434. package/build-module/paragraph/index.js +1 -0
  435. package/build-module/paragraph/index.js.map +1 -1
  436. package/build-module/paragraph/save.js +2 -2
  437. package/build-module/paragraph/save.js.map +1 -1
  438. package/build-module/paragraph/transforms.js +1 -0
  439. package/build-module/paragraph/transforms.js.map +1 -1
  440. package/build-module/pattern/edit.js +1 -1
  441. package/build-module/pattern/edit.js.map +1 -1
  442. package/build-module/post-author/edit.js +2 -2
  443. package/build-module/post-author/edit.js.map +1 -1
  444. package/build-module/post-author-biography/edit.js +2 -2
  445. package/build-module/post-author-biography/edit.js.map +1 -1
  446. package/build-module/post-author-name/edit.js +2 -2
  447. package/build-module/post-author-name/edit.js.map +1 -1
  448. package/build-module/post-comments-count/edit.js +2 -2
  449. package/build-module/post-comments-count/edit.js.map +1 -1
  450. package/build-module/post-comments-form/edit.js +2 -2
  451. package/build-module/post-comments-form/edit.js.map +1 -1
  452. package/build-module/post-comments-form/form.js +2 -2
  453. package/build-module/post-comments-form/form.js.map +1 -1
  454. package/build-module/post-comments-link/edit.js +2 -2
  455. package/build-module/post-comments-link/edit.js.map +1 -1
  456. package/build-module/post-date/edit.js +2 -2
  457. package/build-module/post-date/edit.js.map +1 -1
  458. package/build-module/post-excerpt/edit.js +3 -3
  459. package/build-module/post-excerpt/edit.js.map +1 -1
  460. package/build-module/post-featured-image/dimension-controls.js +20 -28
  461. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  462. package/build-module/post-featured-image/edit.js +3 -3
  463. package/build-module/post-featured-image/edit.js.map +1 -1
  464. package/build-module/post-featured-image/overlay.js +2 -2
  465. package/build-module/post-featured-image/overlay.js.map +1 -1
  466. package/build-module/post-navigation-link/edit.js +2 -2
  467. package/build-module/post-navigation-link/edit.js.map +1 -1
  468. package/build-module/post-template/edit.js +7 -7
  469. package/build-module/post-template/edit.js.map +1 -1
  470. package/build-module/post-terms/edit.js +2 -2
  471. package/build-module/post-terms/edit.js.map +1 -1
  472. package/build-module/post-time-to-read/edit.js +3 -3
  473. package/build-module/post-time-to-read/edit.js.map +1 -1
  474. package/build-module/post-title/edit.js +2 -2
  475. package/build-module/post-title/edit.js.map +1 -1
  476. package/build-module/pullquote/deprecated.js +7 -7
  477. package/build-module/pullquote/deprecated.js.map +1 -1
  478. package/build-module/pullquote/edit.js +2 -2
  479. package/build-module/pullquote/edit.js.map +1 -1
  480. package/build-module/pullquote/save.js +2 -2
  481. package/build-module/pullquote/save.js.map +1 -1
  482. package/build-module/query-title/edit.js +2 -2
  483. package/build-module/query-title/edit.js.map +1 -1
  484. package/build-module/quote/deprecated.js +3 -3
  485. package/build-module/quote/deprecated.js.map +1 -1
  486. package/build-module/quote/edit.js +2 -2
  487. package/build-module/quote/edit.js.map +1 -1
  488. package/build-module/quote/save.js +2 -2
  489. package/build-module/quote/save.js.map +1 -1
  490. package/build-module/rss/edit.js +10 -8
  491. package/build-module/rss/edit.js.map +1 -1
  492. package/build-module/search/edit.js +6 -6
  493. package/build-module/search/edit.js.map +1 -1
  494. package/build-module/search/edit.native.js +2 -2
  495. package/build-module/search/edit.native.js.map +1 -1
  496. package/build-module/separator/deprecated.js +2 -2
  497. package/build-module/separator/deprecated.js.map +1 -1
  498. package/build-module/separator/edit.js +2 -2
  499. package/build-module/separator/edit.js.map +1 -1
  500. package/build-module/separator/save.js +2 -2
  501. package/build-module/separator/save.js.map +1 -1
  502. package/build-module/shortcode/edit.js +8 -11
  503. package/build-module/shortcode/edit.js.map +1 -1
  504. package/build-module/site-logo/edit.js +4 -4
  505. package/build-module/site-logo/edit.js.map +1 -1
  506. package/build-module/site-tagline/edit.js +2 -2
  507. package/build-module/site-tagline/edit.js.map +1 -1
  508. package/build-module/site-title/edit.js +2 -2
  509. package/build-module/site-title/edit.js.map +1 -1
  510. package/build-module/social-link/edit.js +3 -3
  511. package/build-module/social-link/edit.js.map +1 -1
  512. package/build-module/social-links/deprecated.js +2 -2
  513. package/build-module/social-links/deprecated.js.map +1 -1
  514. package/build-module/social-links/edit.js +2 -2
  515. package/build-module/social-links/edit.js.map +1 -1
  516. package/build-module/social-links/save.js +2 -2
  517. package/build-module/social-links/save.js.map +1 -1
  518. package/build-module/spacer/edit.js +3 -3
  519. package/build-module/spacer/edit.js.map +1 -1
  520. package/build-module/table/deprecated.js +8 -8
  521. package/build-module/table/deprecated.js.map +1 -1
  522. package/build-module/table/edit.js +3 -3
  523. package/build-module/table/edit.js.map +1 -1
  524. package/build-module/table/save.js +3 -3
  525. package/build-module/table/save.js.map +1 -1
  526. package/build-module/term-description/edit.js +2 -2
  527. package/build-module/term-description/edit.js.map +1 -1
  528. package/build-module/utils/caption.js +2 -2
  529. package/build-module/utils/caption.js.map +1 -1
  530. package/build-module/verse/deprecated.js +2 -2
  531. package/build-module/verse/deprecated.js.map +1 -1
  532. package/build-module/verse/edit.js +2 -2
  533. package/build-module/verse/edit.js.map +1 -1
  534. package/build-module/verse/save.js +2 -2
  535. package/build-module/verse/save.js.map +1 -1
  536. package/build-module/video/edit.js +2 -2
  537. package/build-module/video/edit.js.map +1 -1
  538. package/build-style/block/editor-rtl.css +4 -4
  539. package/build-style/block/editor.css +4 -4
  540. package/build-style/buttons/editor-rtl.css +1 -1
  541. package/build-style/buttons/editor.css +1 -1
  542. package/build-style/buttons/style-rtl.css +1 -1
  543. package/build-style/buttons/style.css +1 -1
  544. package/build-style/common-rtl.css +3 -7
  545. package/build-style/common.css +3 -7
  546. package/build-style/editor-rtl.css +15 -32
  547. package/build-style/editor.css +15 -32
  548. package/build-style/group/editor-rtl.css +2 -1
  549. package/build-style/group/editor.css +2 -1
  550. package/build-style/image/editor-rtl.css +3 -0
  551. package/build-style/image/editor.css +3 -0
  552. package/build-style/image/style-rtl.css +1 -2
  553. package/build-style/image/style.css +1 -2
  554. package/build-style/post-template/style-rtl.css +0 -3
  555. package/build-style/post-template/style.css +0 -3
  556. package/build-style/rss/editor-rtl.css +1 -10
  557. package/build-style/rss/editor.css +1 -10
  558. package/build-style/shortcode/editor-rtl.css +0 -4
  559. package/build-style/shortcode/editor.css +0 -4
  560. package/build-style/style-rtl.css +5 -13
  561. package/build-style/style.css +5 -13
  562. package/build-style/template-part/editor-rtl.css +3 -7
  563. package/build-style/template-part/editor.css +3 -7
  564. package/package.json +36 -36
  565. package/src/audio/edit.js +2 -2
  566. package/src/avatar/edit.js +2 -2
  567. package/src/block/edit.js +30 -245
  568. package/src/block/editor.scss +7 -5
  569. package/src/button/block.json +1 -0
  570. package/src/button/deprecated.js +16 -16
  571. package/src/button/edit.js +3 -9
  572. package/src/button/save.js +3 -3
  573. package/src/buttons/deprecated.js +2 -2
  574. package/src/buttons/edit.js +2 -2
  575. package/src/buttons/editor.scss +1 -3
  576. package/src/buttons/save.js +2 -2
  577. package/src/buttons/style.scss +1 -3
  578. package/src/categories/edit.js +2 -2
  579. package/src/code/theme.native.scss +1 -1
  580. package/src/column/deprecated.js +2 -2
  581. package/src/column/edit.js +2 -2
  582. package/src/column/save.js +2 -2
  583. package/src/columns/deprecated.js +3 -3
  584. package/src/columns/edit.js +2 -2
  585. package/src/columns/save.js +2 -2
  586. package/src/comment-author-name/edit.js +2 -2
  587. package/src/comment-content/edit.js +2 -2
  588. package/src/comment-edit-link/edit.js +2 -2
  589. package/src/comment-reply-link/edit.js +2 -2
  590. package/src/comments/edit/comments-legacy.js +2 -2
  591. package/src/comments-title/edit.js +2 -2
  592. package/src/common.scss +4 -4
  593. package/src/cover/deprecated.js +38 -38
  594. package/src/cover/edit/index.js +6 -9
  595. package/src/cover/edit/resizable-cover-popover.js +2 -2
  596. package/src/cover/edit.native.js +2 -2
  597. package/src/cover/save.js +5 -5
  598. package/src/embed/deprecated.js +3 -3
  599. package/src/embed/edit.js +2 -2
  600. package/src/embed/edit.native.js +2 -2
  601. package/src/embed/embed-preview.js +3 -3
  602. package/src/embed/embed-preview.native.js +2 -2
  603. package/src/embed/icons.js +9 -0
  604. package/src/embed/save.js +2 -2
  605. package/src/embed/util.js +10 -6
  606. package/src/embed/variations.js +9 -0
  607. package/src/file/deprecated.js +2 -2
  608. package/src/file/edit.js +3 -3
  609. package/src/file/save.js +2 -2
  610. package/src/form-input/deprecated.js +3 -3
  611. package/src/form-input/edit.js +4 -4
  612. package/src/form-input/save.js +3 -3
  613. package/src/form-submission-notification/edit.js +2 -2
  614. package/src/form-submission-notification/save.js +4 -7
  615. package/src/gallery/deprecated.js +3 -3
  616. package/src/gallery/edit.js +2 -2
  617. package/src/gallery/gallery.js +2 -2
  618. package/src/gallery/save.js +3 -3
  619. package/src/gallery/test/helpers.native.js +3 -3
  620. package/src/gallery/v1/gallery-image.js +2 -2
  621. package/src/gallery/v1/gallery.js +3 -3
  622. package/src/gallery/v1/save.js +3 -3
  623. package/src/group/deprecated.js +4 -4
  624. package/src/group/editor.scss +2 -1
  625. package/src/heading/block.json +1 -0
  626. package/src/heading/deprecated.js +6 -6
  627. package/src/heading/edit.js +2 -23
  628. package/src/heading/edit.native.js +2 -2
  629. package/src/heading/save.js +2 -2
  630. package/src/heading/test/__snapshots__/transforms.native.js.snap +1 -1
  631. package/src/home-link/edit.js +2 -2
  632. package/src/html/edit.js +0 -2
  633. package/src/image/deprecated.js +10 -10
  634. package/src/image/edit.js +5 -3
  635. package/src/image/editor.scss +13 -7
  636. package/src/image/image.js +5 -2
  637. package/src/image/save.js +3 -3
  638. package/src/image/style.scss +1 -3
  639. package/src/latest-posts/edit.js +6 -6
  640. package/src/latest-posts/index.php +1 -0
  641. package/src/list/block.json +0 -2
  642. package/src/list/deprecated.js +88 -1
  643. package/src/list/index.php +54 -0
  644. package/src/list/test/__snapshots__/edit.native.js.snap +11 -11
  645. package/src/list/test/__snapshots__/transforms.native.js.snap +3 -3
  646. package/src/list/test/edit.native.js +24 -24
  647. package/src/list/test/transforms.native.js +1 -1
  648. package/src/list-item/block.json +2 -1
  649. package/src/list-item/edit.js +0 -15
  650. package/src/media-text/deprecated.js +10 -10
  651. package/src/media-text/edit.js +2 -2
  652. package/src/media-text/media-container.js +2 -2
  653. package/src/media-text/save.js +3 -3
  654. package/src/navigation/edit/index.js +3 -3
  655. package/src/navigation/edit/responsive-wrapper.js +3 -3
  656. package/src/navigation/edit/utils.js +2 -2
  657. package/src/navigation/index.php +52 -1
  658. package/src/navigation-link/edit.js +3 -3
  659. package/src/navigation-submenu/edit.js +2 -2
  660. package/src/page-list/edit.js +2 -2
  661. package/src/page-list-item/edit.js +3 -3
  662. package/src/paragraph/block.json +1 -0
  663. package/src/paragraph/deprecated.js +6 -6
  664. package/src/paragraph/edit.js +2 -23
  665. package/src/paragraph/save.js +2 -2
  666. package/src/paragraph/test/__snapshots__/transforms.native.js.snap +1 -1
  667. package/src/pattern/edit.js +1 -1
  668. package/src/post-author/edit.js +2 -2
  669. package/src/post-author-biography/edit.js +2 -2
  670. package/src/post-author-name/edit.js +2 -2
  671. package/src/post-comments-count/edit.js +2 -2
  672. package/src/post-comments-form/edit.js +2 -2
  673. package/src/post-comments-form/form.js +2 -2
  674. package/src/post-comments-link/edit.js +2 -2
  675. package/src/post-date/edit.js +2 -2
  676. package/src/post-excerpt/edit.js +3 -3
  677. package/src/post-featured-image/dimension-controls.js +30 -36
  678. package/src/post-featured-image/edit.js +3 -3
  679. package/src/post-featured-image/overlay.js +2 -2
  680. package/src/post-navigation-link/edit.js +2 -2
  681. package/src/post-template/edit.js +7 -7
  682. package/src/post-template/style.scss +0 -4
  683. package/src/post-terms/edit.js +2 -2
  684. package/src/post-time-to-read/edit.js +3 -3
  685. package/src/post-title/edit.js +2 -2
  686. package/src/pullquote/deprecated.js +7 -7
  687. package/src/pullquote/edit.js +2 -2
  688. package/src/pullquote/save.js +2 -2
  689. package/src/query-title/edit.js +2 -2
  690. package/src/quote/deprecated.js +3 -3
  691. package/src/quote/edit.js +2 -2
  692. package/src/quote/save.js +2 -2
  693. package/src/rss/edit.js +30 -23
  694. package/src/rss/editor.scss +2 -16
  695. package/src/search/edit.js +6 -6
  696. package/src/search/edit.native.js +2 -2
  697. package/src/separator/deprecated.js +2 -2
  698. package/src/separator/edit.js +2 -2
  699. package/src/separator/save.js +2 -2
  700. package/src/shortcode/edit.js +13 -17
  701. package/src/shortcode/editor.scss +0 -6
  702. package/src/site-logo/edit.js +4 -4
  703. package/src/site-logo/index.php +2 -0
  704. package/src/site-tagline/edit.js +2 -2
  705. package/src/site-title/edit.js +2 -2
  706. package/src/social-link/edit.js +3 -3
  707. package/src/social-links/deprecated.js +2 -2
  708. package/src/social-links/edit.js +2 -2
  709. package/src/social-links/save.js +2 -2
  710. package/src/spacer/edit.js +3 -3
  711. package/src/table/deprecated.js +12 -20
  712. package/src/table/edit.js +3 -3
  713. package/src/table/save.js +3 -3
  714. package/src/template-part/editor.scss +5 -8
  715. package/src/term-description/edit.js +2 -2
  716. package/src/utils/caption.js +2 -2
  717. package/src/verse/deprecated.js +2 -2
  718. package/src/verse/edit.js +2 -2
  719. package/src/verse/save.js +2 -2
  720. package/src/video/edit.js +2 -2
  721. package/tsconfig.tsbuildinfo +1 -1
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -31,7 +31,7 @@ export default function ResponsiveWrapper({
31
31
  if (!isResponsive) {
32
32
  return children;
33
33
  }
34
- const responsiveContainerClasses = classnames('wp-block-navigation__responsive-container', {
34
+ const responsiveContainerClasses = clsx('wp-block-navigation__responsive-container', {
35
35
  'has-text-color': !!overlayTextColor.color || !!overlayTextColor?.class,
36
36
  [getColorClassName('color', overlayTextColor?.slug)]: !!overlayTextColor?.slug,
37
37
  'has-background': !!overlayBackgroundColor.color || overlayBackgroundColor?.class,
@@ -43,7 +43,7 @@ export default function ResponsiveWrapper({
43
43
  color: !overlayTextColor?.slug && overlayTextColor?.color,
44
44
  backgroundColor: !overlayBackgroundColor?.slug && overlayBackgroundColor?.color && overlayBackgroundColor.color
45
45
  };
46
- const openButtonClasses = classnames('wp-block-navigation__responsive-container-open', {
46
+ const openButtonClasses = clsx('wp-block-navigation__responsive-container-open', {
47
47
  'always-shown': isHiddenByDefault
48
48
  });
49
49
  const modalId = `${id}-modal`;
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","close","Icon","Button","__","getColorClassName","OverlayMenuIcon","ResponsiveWrapper","children","id","isOpen","isResponsive","onToggle","isHiddenByDefault","overlayBackgroundColor","overlayTextColor","hasIcon","icon","responsiveContainerClasses","color","class","slug","styles","backgroundColor","openButtonClasses","modalId","dialogProps","className","role","createElement","Fragment","onClick","style","tabIndex"],"sources":["@wordpress/block-library/src/navigation/edit/responsive-wrapper.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { close, Icon } from '@wordpress/icons';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { getColorClassName } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport OverlayMenuIcon from './overlay-menu-icon';\n\nexport default function ResponsiveWrapper( {\n\tchildren,\n\tid,\n\tisOpen,\n\tisResponsive,\n\tonToggle,\n\tisHiddenByDefault,\n\toverlayBackgroundColor,\n\toverlayTextColor,\n\thasIcon,\n\ticon,\n} ) {\n\tif ( ! isResponsive ) {\n\t\treturn children;\n\t}\n\n\tconst responsiveContainerClasses = classnames(\n\t\t'wp-block-navigation__responsive-container',\n\t\t{\n\t\t\t'has-text-color':\n\t\t\t\t!! overlayTextColor.color || !! overlayTextColor?.class,\n\t\t\t[ getColorClassName( 'color', overlayTextColor?.slug ) ]:\n\t\t\t\t!! overlayTextColor?.slug,\n\t\t\t'has-background':\n\t\t\t\t!! overlayBackgroundColor.color ||\n\t\t\t\toverlayBackgroundColor?.class,\n\t\t\t[ getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\toverlayBackgroundColor?.slug\n\t\t\t) ]: !! overlayBackgroundColor?.slug,\n\t\t\t'is-menu-open': isOpen,\n\t\t\t'hidden-by-default': isHiddenByDefault,\n\t\t}\n\t);\n\n\tconst styles = {\n\t\tcolor: ! overlayTextColor?.slug && overlayTextColor?.color,\n\t\tbackgroundColor:\n\t\t\t! overlayBackgroundColor?.slug &&\n\t\t\toverlayBackgroundColor?.color &&\n\t\t\toverlayBackgroundColor.color,\n\t};\n\n\tconst openButtonClasses = classnames(\n\t\t'wp-block-navigation__responsive-container-open',\n\t\t{ 'always-shown': isHiddenByDefault }\n\t);\n\n\tconst modalId = `${ id }-modal`;\n\n\tconst dialogProps = {\n\t\tclassName: 'wp-block-navigation__responsive-dialog',\n\t\t...( isOpen && {\n\t\t\trole: 'dialog',\n\t\t\t'aria-modal': true,\n\t\t\t'aria-label': __( 'Menu' ),\n\t\t} ),\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isOpen && (\n\t\t\t\t<Button\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\taria-label={ hasIcon && __( 'Open menu' ) }\n\t\t\t\t\tclassName={ openButtonClasses }\n\t\t\t\t\tonClick={ () => onToggle( true ) }\n\t\t\t\t>\n\t\t\t\t\t{ hasIcon && <OverlayMenuIcon icon={ icon } /> }\n\t\t\t\t\t{ ! hasIcon && __( 'Menu' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\n\t\t\t<div\n\t\t\t\tclassName={ responsiveContainerClasses }\n\t\t\t\tstyle={ styles }\n\t\t\t\tid={ modalId }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"wp-block-navigation__responsive-close\"\n\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t>\n\t\t\t\t\t<div { ...dialogProps }>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation__responsive-container-close\"\n\t\t\t\t\t\t\taria-label={ hasIcon && __( 'Close menu' ) }\n\t\t\t\t\t\t\tonClick={ () => onToggle( false ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ hasIcon && <Icon icon={ close } /> }\n\t\t\t\t\t\t\t{ ! hasIcon && __( 'Close' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation__responsive-container-content\"\n\t\t\t\t\t\t\tid={ `${ modalId }-content` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,KAAK,EAAEC,IAAI,QAAQ,kBAAkB;AAC9C,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,iBAAiB,QAAQ,yBAAyB;;AAE3D;AACA;AACA;AACA,OAAOC,eAAe,MAAM,qBAAqB;AAEjD,eAAe,SAASC,iBAAiBA,CAAE;EAC1CC,QAAQ;EACRC,EAAE;EACFC,MAAM;EACNC,YAAY;EACZC,QAAQ;EACRC,iBAAiB;EACjBC,sBAAsB;EACtBC,gBAAgB;EAChBC,OAAO;EACPC;AACD,CAAC,EAAG;EACH,IAAK,CAAEN,YAAY,EAAG;IACrB,OAAOH,QAAQ;EAChB;EAEA,MAAMU,0BAA0B,GAAGlB,UAAU,CAC5C,2CAA2C,EAC3C;IACC,gBAAgB,EACf,CAAC,CAAEe,gBAAgB,CAACI,KAAK,IAAI,CAAC,CAAEJ,gBAAgB,EAAEK,KAAK;IACxD,CAAEf,iBAAiB,CAAE,OAAO,EAAEU,gBAAgB,EAAEM,IAAK,CAAC,GACrD,CAAC,CAAEN,gBAAgB,EAAEM,IAAI;IAC1B,gBAAgB,EACf,CAAC,CAAEP,sBAAsB,CAACK,KAAK,IAC/BL,sBAAsB,EAAEM,KAAK;IAC9B,CAAEf,iBAAiB,CAClB,kBAAkB,EAClBS,sBAAsB,EAAEO,IACzB,CAAC,GAAI,CAAC,CAAEP,sBAAsB,EAAEO,IAAI;IACpC,cAAc,EAAEX,MAAM;IACtB,mBAAmB,EAAEG;EACtB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AAG;IAC5C2B,OAAO,EAAGA,CAAA,KAAMnB,QAAQ,CAAE,KAAM;EAAG,GAEjCI,OAAO,IAAIa,aAAA,CAAC3B,IAAI;IAACe,IAAI,EAAGhB;EAAO,CAAE,CAAC,EAClC,CAAEe,OAAO,IAAIZ,EAAE,CAAE,OAAQ,CACpB,CAAC,EACTyB,aAAA;IACCF,SAAS,EAAC,mDAAmD;IAC7DlB,EAAE,EAAI,GAAGgB,OAAS;EAAW,GAE3BjB,QACE,CACD,CACD,CACD,CACJ,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","close","Icon","Button","__","getColorClassName","OverlayMenuIcon","ResponsiveWrapper","children","id","isOpen","isResponsive","onToggle","isHiddenByDefault","overlayBackgroundColor","overlayTextColor","hasIcon","icon","responsiveContainerClasses","color","class","slug","styles","backgroundColor","openButtonClasses","modalId","dialogProps","className","role","createElement","Fragment","onClick","style","tabIndex"],"sources":["@wordpress/block-library/src/navigation/edit/responsive-wrapper.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { close, Icon } from '@wordpress/icons';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { getColorClassName } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport OverlayMenuIcon from './overlay-menu-icon';\n\nexport default function ResponsiveWrapper( {\n\tchildren,\n\tid,\n\tisOpen,\n\tisResponsive,\n\tonToggle,\n\tisHiddenByDefault,\n\toverlayBackgroundColor,\n\toverlayTextColor,\n\thasIcon,\n\ticon,\n} ) {\n\tif ( ! isResponsive ) {\n\t\treturn children;\n\t}\n\n\tconst responsiveContainerClasses = clsx(\n\t\t'wp-block-navigation__responsive-container',\n\t\t{\n\t\t\t'has-text-color':\n\t\t\t\t!! overlayTextColor.color || !! overlayTextColor?.class,\n\t\t\t[ getColorClassName( 'color', overlayTextColor?.slug ) ]:\n\t\t\t\t!! overlayTextColor?.slug,\n\t\t\t'has-background':\n\t\t\t\t!! overlayBackgroundColor.color ||\n\t\t\t\toverlayBackgroundColor?.class,\n\t\t\t[ getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\toverlayBackgroundColor?.slug\n\t\t\t) ]: !! overlayBackgroundColor?.slug,\n\t\t\t'is-menu-open': isOpen,\n\t\t\t'hidden-by-default': isHiddenByDefault,\n\t\t}\n\t);\n\n\tconst styles = {\n\t\tcolor: ! overlayTextColor?.slug && overlayTextColor?.color,\n\t\tbackgroundColor:\n\t\t\t! overlayBackgroundColor?.slug &&\n\t\t\toverlayBackgroundColor?.color &&\n\t\t\toverlayBackgroundColor.color,\n\t};\n\n\tconst openButtonClasses = clsx(\n\t\t'wp-block-navigation__responsive-container-open',\n\t\t{ 'always-shown': isHiddenByDefault }\n\t);\n\n\tconst modalId = `${ id }-modal`;\n\n\tconst dialogProps = {\n\t\tclassName: 'wp-block-navigation__responsive-dialog',\n\t\t...( isOpen && {\n\t\t\trole: 'dialog',\n\t\t\t'aria-modal': true,\n\t\t\t'aria-label': __( 'Menu' ),\n\t\t} ),\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isOpen && (\n\t\t\t\t<Button\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\taria-label={ hasIcon && __( 'Open menu' ) }\n\t\t\t\t\tclassName={ openButtonClasses }\n\t\t\t\t\tonClick={ () => onToggle( true ) }\n\t\t\t\t>\n\t\t\t\t\t{ hasIcon && <OverlayMenuIcon icon={ icon } /> }\n\t\t\t\t\t{ ! hasIcon && __( 'Menu' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\n\t\t\t<div\n\t\t\t\tclassName={ responsiveContainerClasses }\n\t\t\t\tstyle={ styles }\n\t\t\t\tid={ modalId }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"wp-block-navigation__responsive-close\"\n\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t>\n\t\t\t\t\t<div { ...dialogProps }>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation__responsive-container-close\"\n\t\t\t\t\t\t\taria-label={ hasIcon && __( 'Close menu' ) }\n\t\t\t\t\t\t\tonClick={ () => onToggle( false ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ hasIcon && <Icon icon={ close } /> }\n\t\t\t\t\t\t\t{ ! hasIcon && __( 'Close' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation__responsive-container-content\"\n\t\t\t\t\t\t\tid={ `${ modalId }-content` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\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,KAAK,EAAEC,IAAI,QAAQ,kBAAkB;AAC9C,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,iBAAiB,QAAQ,yBAAyB;;AAE3D;AACA;AACA;AACA,OAAOC,eAAe,MAAM,qBAAqB;AAEjD,eAAe,SAASC,iBAAiBA,CAAE;EAC1CC,QAAQ;EACRC,EAAE;EACFC,MAAM;EACNC,YAAY;EACZC,QAAQ;EACRC,iBAAiB;EACjBC,sBAAsB;EACtBC,gBAAgB;EAChBC,OAAO;EACPC;AACD,CAAC,EAAG;EACH,IAAK,CAAEN,YAAY,EAAG;IACrB,OAAOH,QAAQ;EAChB;EAEA,MAAMU,0BAA0B,GAAGlB,IAAI,CACtC,2CAA2C,EAC3C;IACC,gBAAgB,EACf,CAAC,CAAEe,gBAAgB,CAACI,KAAK,IAAI,CAAC,CAAEJ,gBAAgB,EAAEK,KAAK;IACxD,CAAEf,iBAAiB,CAAE,OAAO,EAAEU,gBAAgB,EAAEM,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R,EAEDyB,aAAA;IACCF,SAAS,EAAGT,0BAA4B;IACxCc,KAAK,EAAGV,MAAQ;IAChBb,EAAE,EAAGgB;EAAS,GAEdI,aAAA;IACCF,SAAS,EAAC,uCAAuC;IACjDM,QAAQ,EAAC;EAAI,GAEbJ,aAAA;IAAA,GAAUH;EAAW,GACpBG,aAAA,CAAC1B,MAAM;IACNwB,SAAS,EAAC,iDAAiD;IAC3D,cAAaX,OAAO,IAAIZ,EAAE,CAAE,YAAa,CAAG;IAC5C2B,OAAO,EAAGA,CAAA,KAAMnB,QAAQ,CAAE,KAAM;EAAG,GAEjCI,OAAO,IAAIa,aAAA,CAAC3B,IAAI;IAACe,IAAI,EAAGhB;EAAO,CAAE,CAAC,EAClC,CAAEe,OAAO,IAAIZ,EAAE,CAAE,OAAQ,CACpB,CAAC,EACTyB,aAAA;IACCF,SAAS,EAAC,mDAAmD;IAC7DlB,EAAE,EAAI,GAAGgB,OAAS;EAAW,GAE3BjB,QACE,CACD,CACD,CACD,CACJ,CAAC;AAEL","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
5
5
  function getComputedStyle(node) {
6
6
  return node.ownerDocument.defaultView.getComputedStyle(node);
7
7
  }
@@ -71,7 +71,7 @@ export function getColors(context, isSubMenu) {
71
71
  }
72
72
  export function getNavigationChildBlockProps(innerBlocksColors) {
73
73
  return {
74
- className: classnames('wp-block-navigation__submenu-container', {
74
+ className: clsx('wp-block-navigation__submenu-container', {
75
75
  'has-text-color': !!(innerBlocksColors.textColor || innerBlocksColors.customTextColor),
76
76
  [`has-${innerBlocksColors.textColor}-color`]: !!innerBlocksColors.textColor,
77
77
  'has-background': !!(innerBlocksColors.backgroundColor || innerBlocksColors.customBackgroundColor),
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","getComputedStyle","node","ownerDocument","defaultView","detectColors","colorsDetectionElement","setColor","setBackground","color","backgroundColorNode","backgroundColor","parentNode","nodeType","ELEMENT_NODE","getColors","context","isSubMenu","textColor","customTextColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","style","colors","text","background","getNavigationChildBlockProps","innerBlocksColors","className"],"sources":["@wordpress/block-library/src/navigation/edit/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\nfunction getComputedStyle( node ) {\n\treturn node.ownerDocument.defaultView.getComputedStyle( node );\n}\n\nexport function detectColors(\n\tcolorsDetectionElement,\n\tsetColor,\n\tsetBackground\n) {\n\tif ( ! colorsDetectionElement ) {\n\t\treturn;\n\t}\n\tsetColor( getComputedStyle( colorsDetectionElement ).color );\n\n\tlet backgroundColorNode = colorsDetectionElement;\n\tlet backgroundColor =\n\t\tgetComputedStyle( backgroundColorNode ).backgroundColor;\n\twhile (\n\t\tbackgroundColor === 'rgba(0, 0, 0, 0)' &&\n\t\tbackgroundColorNode.parentNode &&\n\t\tbackgroundColorNode.parentNode.nodeType ===\n\t\t\tbackgroundColorNode.parentNode.ELEMENT_NODE\n\t) {\n\t\tbackgroundColorNode = backgroundColorNode.parentNode;\n\t\tbackgroundColor =\n\t\t\tgetComputedStyle( backgroundColorNode ).backgroundColor;\n\t}\n\n\tsetBackground( backgroundColor );\n}\n\n/**\n * Determine the colors for a menu.\n *\n * Order of priority is:\n * 1: Overlay custom colors (if submenu)\n * 2: Overlay theme colors (if submenu)\n * 3: Custom colors\n * 4: Theme colors\n * 5: Global styles\n *\n * @param {Object} context\n * @param {boolean} isSubMenu\n */\nexport function getColors( context, isSubMenu ) {\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t\toverlayTextColor,\n\t\tcustomOverlayTextColor,\n\t\toverlayBackgroundColor,\n\t\tcustomOverlayBackgroundColor,\n\t\tstyle,\n\t} = context;\n\n\tconst colors = {};\n\n\tif ( isSubMenu && !! customOverlayTextColor ) {\n\t\tcolors.customTextColor = customOverlayTextColor;\n\t} else if ( isSubMenu && !! overlayTextColor ) {\n\t\tcolors.textColor = overlayTextColor;\n\t} else if ( !! customTextColor ) {\n\t\tcolors.customTextColor = customTextColor;\n\t} else if ( !! textColor ) {\n\t\tcolors.textColor = textColor;\n\t} else if ( !! style?.color?.text ) {\n\t\tcolors.customTextColor = style.color.text;\n\t}\n\n\tif ( isSubMenu && !! customOverlayBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customOverlayBackgroundColor;\n\t} else if ( isSubMenu && !! overlayBackgroundColor ) {\n\t\tcolors.backgroundColor = overlayBackgroundColor;\n\t} else if ( !! customBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customBackgroundColor;\n\t} else if ( !! backgroundColor ) {\n\t\tcolors.backgroundColor = backgroundColor;\n\t} else if ( !! style?.color?.background ) {\n\t\tcolors.customTextColor = style.color.background;\n\t}\n\n\treturn colors;\n}\n\nexport function getNavigationChildBlockProps( innerBlocksColors ) {\n\treturn {\n\t\tclassName: classnames( 'wp-block-navigation__submenu-container', {\n\t\t\t'has-text-color': !! (\n\t\t\t\tinnerBlocksColors.textColor || innerBlocksColors.customTextColor\n\t\t\t),\n\t\t\t[ `has-${ innerBlocksColors.textColor }-color` ]:\n\t\t\t\t!! innerBlocksColors.textColor,\n\t\t\t'has-background': !! (\n\t\t\t\tinnerBlocksColors.backgroundColor ||\n\t\t\t\tinnerBlocksColors.customBackgroundColor\n\t\t\t),\n\t\t\t[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]:\n\t\t\t\t!! innerBlocksColors.backgroundColor,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: innerBlocksColors.customTextColor,\n\t\t\tbackgroundColor: innerBlocksColors.customBackgroundColor,\n\t\t},\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAEnC,SAASC,gBAAgBA,CAAEC,IAAI,EAAG;EACjC,OAAOA,IAAI,CAACC,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,CAACnB,eAAiB,mBAAkB,GAC9D,CAAC,CAAEmB,iBAAiB,CAACnB;IACvB,CAAE,CAAC;IACHc,KAAK,EAAE;MACNhB,KAAK,EAAEqB,iBAAiB,CAACX,eAAe;MACxCR,eAAe,EAAEmB,iBAAiB,CAACV;IACpC;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["clsx","getComputedStyle","node","ownerDocument","defaultView","detectColors","colorsDetectionElement","setColor","setBackground","color","backgroundColorNode","backgroundColor","parentNode","nodeType","ELEMENT_NODE","getColors","context","isSubMenu","textColor","customTextColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","style","colors","text","background","getNavigationChildBlockProps","innerBlocksColors","className"],"sources":["@wordpress/block-library/src/navigation/edit/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\nfunction getComputedStyle( node ) {\n\treturn node.ownerDocument.defaultView.getComputedStyle( node );\n}\n\nexport function detectColors(\n\tcolorsDetectionElement,\n\tsetColor,\n\tsetBackground\n) {\n\tif ( ! colorsDetectionElement ) {\n\t\treturn;\n\t}\n\tsetColor( getComputedStyle( colorsDetectionElement ).color );\n\n\tlet backgroundColorNode = colorsDetectionElement;\n\tlet backgroundColor =\n\t\tgetComputedStyle( backgroundColorNode ).backgroundColor;\n\twhile (\n\t\tbackgroundColor === 'rgba(0, 0, 0, 0)' &&\n\t\tbackgroundColorNode.parentNode &&\n\t\tbackgroundColorNode.parentNode.nodeType ===\n\t\t\tbackgroundColorNode.parentNode.ELEMENT_NODE\n\t) {\n\t\tbackgroundColorNode = backgroundColorNode.parentNode;\n\t\tbackgroundColor =\n\t\t\tgetComputedStyle( backgroundColorNode ).backgroundColor;\n\t}\n\n\tsetBackground( backgroundColor );\n}\n\n/**\n * Determine the colors for a menu.\n *\n * Order of priority is:\n * 1: Overlay custom colors (if submenu)\n * 2: Overlay theme colors (if submenu)\n * 3: Custom colors\n * 4: Theme colors\n * 5: Global styles\n *\n * @param {Object} context\n * @param {boolean} isSubMenu\n */\nexport function getColors( context, isSubMenu ) {\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t\toverlayTextColor,\n\t\tcustomOverlayTextColor,\n\t\toverlayBackgroundColor,\n\t\tcustomOverlayBackgroundColor,\n\t\tstyle,\n\t} = context;\n\n\tconst colors = {};\n\n\tif ( isSubMenu && !! customOverlayTextColor ) {\n\t\tcolors.customTextColor = customOverlayTextColor;\n\t} else if ( isSubMenu && !! overlayTextColor ) {\n\t\tcolors.textColor = overlayTextColor;\n\t} else if ( !! customTextColor ) {\n\t\tcolors.customTextColor = customTextColor;\n\t} else if ( !! textColor ) {\n\t\tcolors.textColor = textColor;\n\t} else if ( !! style?.color?.text ) {\n\t\tcolors.customTextColor = style.color.text;\n\t}\n\n\tif ( isSubMenu && !! customOverlayBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customOverlayBackgroundColor;\n\t} else if ( isSubMenu && !! overlayBackgroundColor ) {\n\t\tcolors.backgroundColor = overlayBackgroundColor;\n\t} else if ( !! customBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customBackgroundColor;\n\t} else if ( !! backgroundColor ) {\n\t\tcolors.backgroundColor = backgroundColor;\n\t} else if ( !! style?.color?.background ) {\n\t\tcolors.customTextColor = style.color.background;\n\t}\n\n\treturn colors;\n}\n\nexport function getNavigationChildBlockProps( innerBlocksColors ) {\n\treturn {\n\t\tclassName: clsx( 'wp-block-navigation__submenu-container', {\n\t\t\t'has-text-color': !! (\n\t\t\t\tinnerBlocksColors.textColor || innerBlocksColors.customTextColor\n\t\t\t),\n\t\t\t[ `has-${ innerBlocksColors.textColor }-color` ]:\n\t\t\t\t!! innerBlocksColors.textColor,\n\t\t\t'has-background': !! (\n\t\t\t\tinnerBlocksColors.backgroundColor ||\n\t\t\t\tinnerBlocksColors.customBackgroundColor\n\t\t\t),\n\t\t\t[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]:\n\t\t\t\t!! innerBlocksColors.backgroundColor,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: innerBlocksColors.customTextColor,\n\t\t\tbackgroundColor: innerBlocksColors.customBackgroundColor,\n\t\t},\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAEvB,SAASC,gBAAgBA,CAAEC,IAAI,EAAG;EACjC,OAAOA,IAAI,CAACC,aAAa,CAACC,WAAW,CAACH,gBAAgB,CAAEC,IAAK,CAAC;AAC/D;AAEA,OAAO,SAASG,YAAYA,CAC3BC,sBAAsB,EACtBC,QAAQ,EACRC,aAAa,EACZ;EACD,IAAK,CAAEF,sBAAsB,EAAG;IAC/B;EACD;EACAC,QAAQ,CAAEN,gBAAgB,CAAEK,sBAAuB,CAAC,CAACG,KAAM,CAAC;EAE5D,IAAIC,mBAAmB,GAAGJ,sBAAsB;EAChD,IAAIK,eAAe,GAClBV,gBAAgB,CAAES,mBAAoB,CAAC,CAACC,eAAe;EACxD,OACCA,eAAe,KAAK,kBAAkB,IACtCD,mBAAmB,CAACE,UAAU,IAC9BF,mBAAmB,CAACE,UAAU,CAACC,QAAQ,KACtCH,mBAAmB,CAACE,UAAU,CAACE,YAAY,EAC3C;IACDJ,mBAAmB,GAAGA,mBAAmB,CAACE,UAAU;IACpDD,eAAe,GACdV,gBAAgB,CAAES,mBAAoB,CAAC,CAACC,eAAe;EACzD;EAEAH,aAAa,CAAEG,eAAgB,CAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,SAASA,CAAEC,OAAO,EAAEC,SAAS,EAAG;EAC/C,MAAM;IACLC,SAAS;IACTC,eAAe;IACfR,eAAe;IACfS,qBAAqB;IACrBC,gBAAgB;IAChBC,sBAAsB;IACtBC,sBAAsB;IACtBC,4BAA4B;IAC5BC;EACD,CAAC,GAAGT,OAAO;EA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;MAC1D,gBAAgB,EAAE,CAAC,EAClB8B,iBAAiB,CAACZ,SAAS,IAAIY,iBAAiB,CAACX,eAAe,CAChE;MACD,CAAG,OAAOW,iBAAiB,CAACZ,SAAW,QAAO,GAC7C,CAAC,CAAEY,iBAAiB,CAACZ,SAAS;MAC/B,gBAAgB,EAAE,CAAC,EAClBY,iBAAiB,CAACnB,eAAe,IACjCmB,iBAAiB,CAACV,qBAAqB,CACvC;MACD,CAAG,OAAOU,iBAAiB,CAACnB,eAAiB,mBAAkB,GAC9D,CAAC,CAAEmB,iBAAiB,CAACnB;IACvB,CAAE,CAAC;IACHc,KAAK,EAAE;MACNhB,KAAK,EAAEqB,iBAAiB,CAACX,eAAe;MACxCR,eAAe,EAAEmB,iBAAiB,CAACV;IACpC;EACD,CAAC;AACF","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -367,7 +367,7 @@ export default function NavigationLinkEdit({
367
367
  }
368
368
  const blockProps = useBlockProps({
369
369
  ref: useMergeRefs([setPopoverAnchor, listItemRef]),
370
- className: classnames('wp-block-navigation-item', {
370
+ className: clsx('wp-block-navigation-item', {
371
371
  'is-editing': isSelected || isParentOfSelectedBlock,
372
372
  'is-dragging-within': isDraggingWithin,
373
373
  'has-link': !!url,
@@ -397,7 +397,7 @@ export default function NavigationLinkEdit({
397
397
  setOpenedBy(ref.current);
398
398
  };
399
399
  }
400
- const classes = classnames('wp-block-navigation-item__content', {
400
+ const classes = clsx('wp-block-navigation-item__content', {
401
401
  'wp-block-navigation-link__placeholder': !url || isInvalid || isDraft
402
402
  });
403
403
  const missingText = getMissingText(type);
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","createBlock","useSelect","useDispatch","PanelBody","TextControl","TextareaControl","ToolbarButton","Tooltip","ToolbarGroup","displayShortcut","isKeyboardEvent","__","BlockControls","InspectorControls","RichText","useBlockProps","store","blockEditorStore","getColorClassName","useInnerBlocksProps","isURL","prependHTTP","safeDecodeURI","useState","useEffect","useRef","__unstableStripHTML","stripHTML","decodeEntities","link","linkIcon","addSubmenu","coreStore","useMergeRefs","usePrevious","LinkUI","updateAttributes","getColors","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","useIsInvalidLink","kind","type","id","isPostType","hasId","Number","isInteger","postStatus","select","getEntityRecord","status","isInvalid","isDraft","getMissingText","missingText","Controls","attributes","setAttributes","setIsLabelFieldFocused","label","url","description","title","rel","createElement","__nextHasNoMarginBottom","__next40pxDefaultSize","value","onChange","labelValue","autoComplete","onFocus","onBlur","urlValue","descriptionValue","help","titleValue","relValue","NavigationLinkEdit","isSelected","insertBlocksAfter","mergeBlocks","onReplace","context","clientId","maxNestingLevel","replaceBlock","__unstableMarkNextChangeAsNotPersistent","selectBlock","selectPreviousBlock","isLinkOpen","setIsLinkOpen","openedBy","setOpenedBy","popoverAnchor","setPopoverAnchor","listItemRef","itemLabelPlaceholder","ref","prevUrl","isLabelFieldFocused","isAtMaxNesting","isTopLevelLink","isParentOfSelectedBlock","hasChildren","getBlockCount","getBlockName","getBlockRootClientId","hasSelectedInnerBlock","getBlockParentsByBlockName","length","getBlocks","transformToSubmenu","innerBlocks","newSubmenu","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","removeLink","undefined","opensInNewTab","textColor","customTextColor","backgroundColor","customBackgroundColor","onKeyDown","primary","preventDefault","stopPropagation","blockProps","className","style","color","innerBlocksProps","defaultBlock","directInsert","renderAppender","onClick","classes","placeholderText","tooltipText","Fragment","icon","shortcut","currentTarget","text","identifier","onMerge","__unstableOnSplitAtEnd","placeholder","withoutInteractiveFormatting","allowedFormats","trim","onClose","anchor","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tTooltip,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP, safeDecodeURI } from '@wordpress/url';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { link as linkIcon, addSubmenu } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs, usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { LinkUI } from './link-ui';\nimport { updateAttributes } from './update-attributes';\nimport { getColors } from '../navigation/edit/utils';\n\nconst DEFAULT_BLOCK = { name: 'core/navigation-link' };\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}, [ elementRef ] );\n\n\treturn isDraggingWithin;\n};\n\nconst useIsInvalidLink = ( kind, type, id ) => {\n\tconst isPostType =\n\t\tkind === 'post-type' || type === 'post' || type === 'page';\n\tconst hasId = Number.isInteger( id );\n\tconst postStatus = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isPostType ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( 'postType', type, id )?.status;\n\t\t},\n\t\t[ isPostType, type, id ]\n\t);\n\n\t// Check Navigation Link validity if:\n\t// 1. Link is 'post-type'.\n\t// 2. It has an id.\n\t// 3. It's neither null, nor undefined, as valid items might be either of those while loading.\n\t// If those conditions are met, check if\n\t// 1. The post status is published.\n\t// 2. The Navigation Link item has no label.\n\t// If either of those is true, invalidate.\n\tconst isInvalid =\n\t\tisPostType && hasId && postStatus && 'trash' === postStatus;\n\tconst isDraft = 'draft' === postStatus;\n\n\treturn [ isInvalid, isDraft ];\n};\n\nfunction getMissingText( type ) {\n\tlet missingText = '';\n\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\t\t/* translators: label for missing post in navigation link block */\n\t\t\tmissingText = __( 'Select post' );\n\t\t\tbreak;\n\t\tcase 'page':\n\t\t\t/* translators: label for missing page in navigation link block */\n\t\t\tmissingText = __( 'Select page' );\n\t\t\tbreak;\n\t\tcase 'category':\n\t\t\t/* translators: label for missing category in navigation link block */\n\t\t\tmissingText = __( 'Select category' );\n\t\t\tbreak;\n\t\tcase 'tag':\n\t\t\t/* translators: label for missing tag in navigation link block */\n\t\t\tmissingText = __( 'Select tag' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* translators: label for missing values in navigation link block */\n\t\t\tmissingText = __( 'Add link' );\n\t}\n\n\treturn missingText;\n}\n\n/*\n * Warning, this duplicated in\n * packages/block-library/src/navigation-submenu/edit.js\n * Consider reuseing this components for both blocks.\n */\nfunction Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {\n\tconst { label, url, description, title, rel } = attributes;\n\treturn (\n\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvalue={ label ? stripHTML( label ) : '' }\n\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t} }\n\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tonFocus={ () => setIsLabelFieldFocused( true ) }\n\t\t\t\tonBlur={ () => setIsLabelFieldFocused( false ) }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvalue={ url ? safeDecodeURI( url ) : '' }\n\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t{ url: urlValue },\n\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\tattributes\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\tautoComplete=\"off\"\n\t\t\t/>\n\t\t\t<TextareaControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ description || '' }\n\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\tsetAttributes( { description: descriptionValue } );\n\t\t\t\t} }\n\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvalue={ title || '' }\n\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t} }\n\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Additional information to help clarify the purpose of the link.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvalue={ rel || '' }\n\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t} }\n\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\thelp={ __(\n\t\t\t\t\t'The relationship of the linked URL as space-separated link types.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function NavigationLinkEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { id, label, type, url, description, kind } = attributes;\n\n\tconst [ isInvalid, isDraft ] = useIsInvalidLink( kind, type, id );\n\tconst { maxNestingLevel } = context;\n\n\tconst {\n\t\treplaceBlock,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tselectBlock,\n\t\tselectPreviousBlock,\n\t} = useDispatch( blockEditorStore );\n\t// Have the link editing ui open on mount when lacking a url and selected.\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( isSelected && ! url );\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 label…' );\n\tconst ref = useRef();\n\tconst prevUrl = usePrevious( url );\n\n\t// Change the label using inspector causes rich text to change focus on firefox.\n\t// This is a workaround to keep the focus on the label field when label filed is focused we don't render the rich text.\n\tconst [ isLabelFieldFocused, setIsLabelFieldFocused ] = useState( false );\n\n\tconst {\n\t\tisAtMaxNesting,\n\t\tisTopLevelLink,\n\t\tisParentOfSelectedBlock,\n\t\thasChildren,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, [\n\t\t\t\t\t\t'core/navigation-link',\n\t\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\t] ).length >= maxNestingLevel,\n\t\t\t\tisTopLevelLink:\n\t\t\t\t\tgetBlockName( getBlockRootClientId( clientId ) ) ===\n\t\t\t\t\t'core/navigation',\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\thasChildren: !! getBlockCount( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, maxNestingLevel ]\n\t);\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\n\t/**\n\t * Transform to submenu block.\n\t */\n\tconst transformToSubmenu = () => {\n\t\tlet innerBlocks = getBlocks( clientId );\n\t\tif ( innerBlocks.length === 0 ) {\n\t\t\tinnerBlocks = [ createBlock( 'core/navigation-link' ) ];\n\t\t\tselectBlock( innerBlocks[ 0 ].clientId );\n\t\t}\n\t\tconst newSubmenu = createBlock(\n\t\t\t'core/navigation-submenu',\n\t\t\tattributes,\n\t\t\tinnerBlocks\n\t\t);\n\t\treplaceBlock( clientId, newSubmenu );\n\t};\n\n\tuseEffect( () => {\n\t\t// If block has inner blocks, transform to Submenu.\n\t\tif ( hasChildren ) {\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\ttransformToSubmenu();\n\t\t}\n\t}, [ hasChildren ] );\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\t// We only want to do this when the URL has gone from nothing to a new URL AND the label looks like a URL\n\t\tif (\n\t\t\t! prevUrl &&\n\t\t\turl &&\n\t\t\tisLinkOpen &&\n\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t) {\n\t\t\t// Focus and select the label text.\n\t\t\tselectLabelText();\n\t\t}\n\t}, [ prevUrl, url, isLinkOpen, label ] );\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\t/**\n\t * Removes the current link if set.\n\t */\n\tfunction removeLink() {\n\t\t// Reset all attributes that comprise the link.\n\t\t// It is critical that all attributes are reset\n\t\t// to their default values otherwise this may\n\t\t// in advertently trigger side effects because\n\t\t// the values will have \"changed\".\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlabel: undefined,\n\t\t\tid: undefined,\n\t\t\tkind: undefined,\n\t\t\ttype: undefined,\n\t\t\topensInNewTab: false,\n\t\t} );\n\n\t\t// Close the link editing UI.\n\t\tsetIsLinkOpen( false );\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelLink );\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 this link is a child of a parent submenu item, the parent submenu item event will also open, closing this popover\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: classnames( '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} ),\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\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\t...blockProps,\n\t\t\tclassName: 'remove-outline', // Remove the outline from the inner blocks container.\n\t\t},\n\t\t{\n\t\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\t\tdirectInsert: true,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tif ( ! url || isInvalid || isDraft ) {\n\t\tblockProps.onClick = () => {\n\t\t\tsetIsLinkOpen( true );\n\t\t\tsetOpenedBy( ref.current );\n\t\t};\n\t}\n\n\tconst classes = classnames( 'wp-block-navigation-item__content', {\n\t\t'wp-block-navigation-link__placeholder': ! url || isInvalid || isDraft,\n\t} );\n\n\tconst missingText = getMissingText( type );\n\t/* translators: Whether the navigation link is Invalid or a Draft. */\n\tconst placeholderText = `(${\n\t\tisInvalid ? __( 'Invalid' ) : __( 'Draft' )\n\t})`;\n\tconst tooltipText =\n\t\tisInvalid || isDraft\n\t\t\t? __( 'This item has been deleted, or is a draft' )\n\t\t\t: __( 'This item is missing a link' );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\tsetOpenedBy( event.currentTarget );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isAtMaxNesting && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"submenu\"\n\t\t\t\t\t\t\ticon={ addSubmenu }\n\t\t\t\t\t\t\ttitle={ __( 'Add submenu' ) }\n\t\t\t\t\t\t\tonClick={ transformToSubmenu }\n\t\t\t\t\t\t/>\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-submenu/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<Controls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tsetIsLabelFieldFocused={ setIsLabelFieldFocused }\n\t\t\t\t/>\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<a className={ classes }>\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{ ! url ? (\n\t\t\t\t\t\t<div className=\"wp-block-navigation-link__placeholder-text\">\n\t\t\t\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t\t\t\t<span>{ missingText }</span>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isInvalid &&\n\t\t\t\t\t\t\t\t! isDraft &&\n\t\t\t\t\t\t\t\t! isLabelFieldFocused && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: labelValue,\n\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'core/navigation-link'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigation link text'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ description && (\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"wp-block-navigation-item__description\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ( isInvalid ||\n\t\t\t\t\t\t\t\tisDraft ||\n\t\t\t\t\t\t\t\tisLabelFieldFocused ) && (\n\t\t\t\t\t\t\t\t<div className=\"wp-block-navigation-link__placeholder-text wp-block-navigation-link__label\">\n\t\t\t\t\t\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigation link text'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// Some attributes are stored in an escaped form. It's a legacy issue.\n\t\t\t\t\t\t\t\t\t\t\t\t// Ideally they would be stored in a raw, unescaped form.\n\t\t\t\t\t\t\t\t\t\t\t\t// Unescape is used here to \"recover\" the escaped characters\n\t\t\t\t\t\t\t\t\t\t\t\t// so they display without encoding.\n\t\t\t\t\t\t\t\t\t\t\t\t// See `updateAttributes` for more details.\n\t\t\t\t\t\t\t\t\t\t\t\t`${ decodeEntities( label ) } ${\n\t\t\t\t\t\t\t\t\t\t\t\t\tisInvalid || isDraft\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? placeholderText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t\t\t}`.trim()\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ 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\t// If there is no link then remove the auto-inserted block.\n\t\t\t\t\t\t\t\t// This avoids empty blocks which can provided a poor UX.\n\t\t\t\t\t\t\t\tif ( ! url ) {\n\t\t\t\t\t\t\t\t\t// Select the previous block to keep focus nearby\n\t\t\t\t\t\t\t\t\tselectPreviousBlock( clientId, true );\n\t\t\t\t\t\t\t\t\t// Remove the link.\n\t\t\t\t\t\t\t\t\tonReplace( [] );\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\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 if ( ref.current ) {\n\t\t\t\t\t\t\t\t\t// select the ref when adding a new link\n\t\t\t\t\t\t\t\t\tref.current.focus();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Fallback\n\t\t\t\t\t\t\t\t\tselectPreviousBlock( clientId, true );\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={ removeLink }\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</a>\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,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,SAAS,EACTC,WAAW,EACXC,eAAe,EACfC,aAAa,EACbC,OAAO,EACPC,YAAY,QACN,uBAAuB;AAC9B,SAASC,eAAe,EAAEC,eAAe,QAAQ,qBAAqB;A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Aa,EACbD,UACD,CAAC;IACF;EAAG,CACH,CAEA,CAAC,EACJQ,aAAA;IAAA,GAAU6E;EAAgB,CAAI,CAC1B,CACJ,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","createBlock","useSelect","useDispatch","PanelBody","TextControl","TextareaControl","ToolbarButton","Tooltip","ToolbarGroup","displayShortcut","isKeyboardEvent","__","BlockControls","InspectorControls","RichText","useBlockProps","store","blockEditorStore","getColorClassName","useInnerBlocksProps","isURL","prependHTTP","safeDecodeURI","useState","useEffect","useRef","__unstableStripHTML","stripHTML","decodeEntities","link","linkIcon","addSubmenu","coreStore","useMergeRefs","usePrevious","LinkUI","updateAttributes","getColors","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","useIsInvalidLink","kind","type","id","isPostType","hasId","Number","isInteger","postStatus","select","getEntityRecord","status","isInvalid","isDraft","getMissingText","missingText","Controls","attributes","setAttributes","setIsLabelFieldFocused","label","url","description","title","rel","createElement","__nextHasNoMarginBottom","__next40pxDefaultSize","value","onChange","labelValue","autoComplete","onFocus","onBlur","urlValue","descriptionValue","help","titleValue","relValue","NavigationLinkEdit","isSelected","insertBlocksAfter","mergeBlocks","onReplace","context","clientId","maxNestingLevel","replaceBlock","__unstableMarkNextChangeAsNotPersistent","selectBlock","selectPreviousBlock","isLinkOpen","setIsLinkOpen","openedBy","setOpenedBy","popoverAnchor","setPopoverAnchor","listItemRef","itemLabelPlaceholder","ref","prevUrl","isLabelFieldFocused","isAtMaxNesting","isTopLevelLink","isParentOfSelectedBlock","hasChildren","getBlockCount","getBlockName","getBlockRootClientId","hasSelectedInnerBlock","getBlockParentsByBlockName","length","getBlocks","transformToSubmenu","innerBlocks","newSubmenu","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","removeLink","undefined","opensInNewTab","textColor","customTextColor","backgroundColor","customBackgroundColor","onKeyDown","primary","preventDefault","stopPropagation","blockProps","className","style","color","innerBlocksProps","defaultBlock","directInsert","renderAppender","onClick","classes","placeholderText","tooltipText","Fragment","icon","shortcut","currentTarget","text","identifier","onMerge","__unstableOnSplitAtEnd","placeholder","withoutInteractiveFormatting","allowedFormats","trim","onClose","anchor","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tTooltip,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP, safeDecodeURI } from '@wordpress/url';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { link as linkIcon, addSubmenu } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs, usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { LinkUI } from './link-ui';\nimport { updateAttributes } from './update-attributes';\nimport { getColors } from '../navigation/edit/utils';\n\nconst DEFAULT_BLOCK = { name: 'core/navigation-link' };\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}, [ elementRef ] );\n\n\treturn isDraggingWithin;\n};\n\nconst useIsInvalidLink = ( kind, type, id ) => {\n\tconst isPostType =\n\t\tkind === 'post-type' || type === 'post' || type === 'page';\n\tconst hasId = Number.isInteger( id );\n\tconst postStatus = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isPostType ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( 'postType', type, id )?.status;\n\t\t},\n\t\t[ isPostType, type, id ]\n\t);\n\n\t// Check Navigation Link validity if:\n\t// 1. Link is 'post-type'.\n\t// 2. It has an id.\n\t// 3. It's neither null, nor undefined, as valid items might be either of those while loading.\n\t// If those conditions are met, check if\n\t// 1. The post status is published.\n\t// 2. The Navigation Link item has no label.\n\t// If either of those is true, invalidate.\n\tconst isInvalid =\n\t\tisPostType && hasId && postStatus && 'trash' === postStatus;\n\tconst isDraft = 'draft' === postStatus;\n\n\treturn [ isInvalid, isDraft ];\n};\n\nfunction getMissingText( type ) {\n\tlet missingText = '';\n\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\t\t/* translators: label for missing post in navigation link block */\n\t\t\tmissingText = __( 'Select post' );\n\t\t\tbreak;\n\t\tcase 'page':\n\t\t\t/* translators: label for missing page in navigation link block */\n\t\t\tmissingText = __( 'Select page' );\n\t\t\tbreak;\n\t\tcase 'category':\n\t\t\t/* translators: label for missing category in navigation link block */\n\t\t\tmissingText = __( 'Select category' );\n\t\t\tbreak;\n\t\tcase 'tag':\n\t\t\t/* translators: label for missing tag in navigation link block */\n\t\t\tmissingText = __( 'Select tag' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* translators: label for missing values in navigation link block */\n\t\t\tmissingText = __( 'Add link' );\n\t}\n\n\treturn missingText;\n}\n\n/*\n * Warning, this duplicated in\n * packages/block-library/src/navigation-submenu/edit.js\n * Consider reuseing this components for both blocks.\n */\nfunction Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {\n\tconst { label, url, description, title, rel } = attributes;\n\treturn (\n\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvalue={ label ? stripHTML( label ) : '' }\n\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t} }\n\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tonFocus={ () => setIsLabelFieldFocused( true ) }\n\t\t\t\tonBlur={ () => setIsLabelFieldFocused( false ) }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvalue={ url ? safeDecodeURI( url ) : '' }\n\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t{ url: urlValue },\n\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\tattributes\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\tautoComplete=\"off\"\n\t\t\t/>\n\t\t\t<TextareaControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ description || '' }\n\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\tsetAttributes( { description: descriptionValue } );\n\t\t\t\t} }\n\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvalue={ title || '' }\n\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t} }\n\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Additional information to help clarify the purpose of the link.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvalue={ rel || '' }\n\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t} }\n\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\thelp={ __(\n\t\t\t\t\t'The relationship of the linked URL as space-separated link types.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function NavigationLinkEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { id, label, type, url, description, kind } = attributes;\n\n\tconst [ isInvalid, isDraft ] = useIsInvalidLink( kind, type, id );\n\tconst { maxNestingLevel } = context;\n\n\tconst {\n\t\treplaceBlock,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tselectBlock,\n\t\tselectPreviousBlock,\n\t} = useDispatch( blockEditorStore );\n\t// Have the link editing ui open on mount when lacking a url and selected.\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( isSelected && ! url );\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 label…' );\n\tconst ref = useRef();\n\tconst prevUrl = usePrevious( url );\n\n\t// Change the label using inspector causes rich text to change focus on firefox.\n\t// This is a workaround to keep the focus on the label field when label filed is focused we don't render the rich text.\n\tconst [ isLabelFieldFocused, setIsLabelFieldFocused ] = useState( false );\n\n\tconst {\n\t\tisAtMaxNesting,\n\t\tisTopLevelLink,\n\t\tisParentOfSelectedBlock,\n\t\thasChildren,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, [\n\t\t\t\t\t\t'core/navigation-link',\n\t\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\t] ).length >= maxNestingLevel,\n\t\t\t\tisTopLevelLink:\n\t\t\t\t\tgetBlockName( getBlockRootClientId( clientId ) ) ===\n\t\t\t\t\t'core/navigation',\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\thasChildren: !! getBlockCount( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, maxNestingLevel ]\n\t);\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\n\t/**\n\t * Transform to submenu block.\n\t */\n\tconst transformToSubmenu = () => {\n\t\tlet innerBlocks = getBlocks( clientId );\n\t\tif ( innerBlocks.length === 0 ) {\n\t\t\tinnerBlocks = [ createBlock( 'core/navigation-link' ) ];\n\t\t\tselectBlock( innerBlocks[ 0 ].clientId );\n\t\t}\n\t\tconst newSubmenu = createBlock(\n\t\t\t'core/navigation-submenu',\n\t\t\tattributes,\n\t\t\tinnerBlocks\n\t\t);\n\t\treplaceBlock( clientId, newSubmenu );\n\t};\n\n\tuseEffect( () => {\n\t\t// If block has inner blocks, transform to Submenu.\n\t\tif ( hasChildren ) {\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\ttransformToSubmenu();\n\t\t}\n\t}, [ hasChildren ] );\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\t// We only want to do this when the URL has gone from nothing to a new URL AND the label looks like a URL\n\t\tif (\n\t\t\t! prevUrl &&\n\t\t\turl &&\n\t\t\tisLinkOpen &&\n\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t) {\n\t\t\t// Focus and select the label text.\n\t\t\tselectLabelText();\n\t\t}\n\t}, [ prevUrl, url, isLinkOpen, label ] );\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\t/**\n\t * Removes the current link if set.\n\t */\n\tfunction removeLink() {\n\t\t// Reset all attributes that comprise the link.\n\t\t// It is critical that all attributes are reset\n\t\t// to their default values otherwise this may\n\t\t// in advertently trigger side effects because\n\t\t// the values will have \"changed\".\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlabel: undefined,\n\t\t\tid: undefined,\n\t\t\tkind: undefined,\n\t\t\ttype: undefined,\n\t\t\topensInNewTab: false,\n\t\t} );\n\n\t\t// Close the link editing UI.\n\t\tsetIsLinkOpen( false );\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelLink );\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 this link is a child of a parent submenu item, the parent submenu item event will also open, closing this popover\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} ),\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\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\t...blockProps,\n\t\t\tclassName: 'remove-outline', // Remove the outline from the inner blocks container.\n\t\t},\n\t\t{\n\t\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\t\tdirectInsert: true,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tif ( ! url || isInvalid || isDraft ) {\n\t\tblockProps.onClick = () => {\n\t\t\tsetIsLinkOpen( true );\n\t\t\tsetOpenedBy( ref.current );\n\t\t};\n\t}\n\n\tconst classes = clsx( 'wp-block-navigation-item__content', {\n\t\t'wp-block-navigation-link__placeholder': ! url || isInvalid || isDraft,\n\t} );\n\n\tconst missingText = getMissingText( type );\n\t/* translators: Whether the navigation link is Invalid or a Draft. */\n\tconst placeholderText = `(${\n\t\tisInvalid ? __( 'Invalid' ) : __( 'Draft' )\n\t})`;\n\tconst tooltipText =\n\t\tisInvalid || isDraft\n\t\t\t? __( 'This item has been deleted, or is a draft' )\n\t\t\t: __( 'This item is missing a link' );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\tsetOpenedBy( event.currentTarget );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isAtMaxNesting && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"submenu\"\n\t\t\t\t\t\t\ticon={ addSubmenu }\n\t\t\t\t\t\t\ttitle={ __( 'Add submenu' ) }\n\t\t\t\t\t\t\tonClick={ transformToSubmenu }\n\t\t\t\t\t\t/>\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-submenu/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<Controls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tsetIsLabelFieldFocused={ setIsLabelFieldFocused }\n\t\t\t\t/>\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<a className={ classes }>\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{ ! url ? (\n\t\t\t\t\t\t<div className=\"wp-block-navigation-link__placeholder-text\">\n\t\t\t\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t\t\t\t<span>{ missingText }</span>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isInvalid &&\n\t\t\t\t\t\t\t\t! isDraft &&\n\t\t\t\t\t\t\t\t! isLabelFieldFocused && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: labelValue,\n\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'core/navigation-link'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigation link text'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ description && (\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"wp-block-navigation-item__description\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ( isInvalid ||\n\t\t\t\t\t\t\t\tisDraft ||\n\t\t\t\t\t\t\t\tisLabelFieldFocused ) && (\n\t\t\t\t\t\t\t\t<div className=\"wp-block-navigation-link__placeholder-text wp-block-navigation-link__label\">\n\t\t\t\t\t\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigation link text'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// Some attributes are stored in an escaped form. It's a legacy issue.\n\t\t\t\t\t\t\t\t\t\t\t\t// Ideally they would be stored in a raw, unescaped form.\n\t\t\t\t\t\t\t\t\t\t\t\t// Unescape is used here to \"recover\" the escaped characters\n\t\t\t\t\t\t\t\t\t\t\t\t// so they display without encoding.\n\t\t\t\t\t\t\t\t\t\t\t\t// See `updateAttributes` for more details.\n\t\t\t\t\t\t\t\t\t\t\t\t`${ decodeEntities( label ) } ${\n\t\t\t\t\t\t\t\t\t\t\t\t\tisInvalid || isDraft\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? placeholderText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t\t\t}`.trim()\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ 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\t// If there is no link then remove the auto-inserted block.\n\t\t\t\t\t\t\t\t// This avoids empty blocks which can provided a poor UX.\n\t\t\t\t\t\t\t\tif ( ! url ) {\n\t\t\t\t\t\t\t\t\t// Select the previous block to keep focus nearby\n\t\t\t\t\t\t\t\t\tselectPreviousBlock( clientId, true );\n\t\t\t\t\t\t\t\t\t// Remove the link.\n\t\t\t\t\t\t\t\t\tonReplace( [] );\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\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 if ( ref.current ) {\n\t\t\t\t\t\t\t\t\t// select the ref when adding a new link\n\t\t\t\t\t\t\t\t\tref.current.focus();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Fallback\n\t\t\t\t\t\t\t\t\tselectPreviousBlock( clientId, true );\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={ removeLink }\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</a>\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;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AC,CAAC;MACpB,CAAC,MAAM;QACN;QACA5B,mBAAmB,CAAEL,QAAQ,EAAE,IAAK,CAAC;MACtC;IACD,CAAG;IACH8E,MAAM,EAAGpE,aAAe;IACxBqE,QAAQ,EAAGrC,UAAY;IACvB1D,QAAQ,EAAKgG,YAAY,IAAM;MAC9B/I,gBAAgB,CACf+I,YAAY,EACZ3G,aAAa,EACbD,UACD,CAAC;IACF;EAAG,CACH,CAEA,CAAC,EACJQ,aAAA;IAAA,GAAU6E;EAAgB,CAAI,CAC1B,CACJ,CAAC;AAEL","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -251,7 +251,7 @@ export default function NavigationSubmenuEdit({
251
251
  }
252
252
  const blockProps = useBlockProps({
253
253
  ref: useMergeRefs([setPopoverAnchor, listItemRef]),
254
- className: classnames('wp-block-navigation-item', {
254
+ className: clsx('wp-block-navigation-item', {
255
255
  'is-editing': isSelected || isParentOfSelectedBlock,
256
256
  'is-dragging-within': isDraggingWithin,
257
257
  'has-link': !!url,
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useSelect","useDispatch","PanelBody","TextControl","TextareaControl","ToolbarButton","ToolbarGroup","displayShortcut","isKeyboardEvent","__","BlockControls","InnerBlocks","useInnerBlocksProps","InspectorControls","RichText","useBlockProps","store","blockEditorStore","getColorClassName","isURL","prependHTTP","useState","useEffect","useRef","link","linkIcon","removeSubmenu","useResourcePermissions","speak","createBlock","useMergeRefs","usePrevious","ItemSubmenuIcon","LinkUI","updateAttributes","getColors","getNavigationChildBlockProps","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","type","url","description","rel","title","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","__unstableMarkNextChangeAsNotPersistent","replaceBlock","selectBlock","isLinkOpen","setIsLinkOpen","openedBy","setOpenedBy","popoverAnchor","setPopoverAnchor","listItemRef","itemLabelPlaceholder","ref","pagesPermissions","postsPermissions","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","userCanCreate","canCreate","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","createElement","Fragment","icon","shortcut","onClick","currentTarget","isDisabled","__nextHasNoMarginBottom","__next40pxDefaultSize","value","onChange","labelValue","autoComplete","urlValue","descriptionValue","help","titleValue","relValue","identifier","onMerge","placeholder","withoutInteractiveFormatting","allowedFormats","onClose","anchor","hasCreateSuggestion","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\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 { useResourcePermissions } from '@wordpress/core-data';\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';\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, type, 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\n\tconst pagesPermissions = useResourcePermissions( 'pages' );\n\tconst postsPermissions = useResourcePermissions( 'posts' );\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\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = pagesPermissions.canCreate;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = postsPermissions.canCreate;\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 propogation, 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: classnames( '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\tisDisabled={ ! 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<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\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\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ url || '' }\n\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { url: urlValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\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) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Additional information to help clarify the purpose of the link.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\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) }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\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{\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\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\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\t\tsetOpenedBy( ref.current );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\t{ ! 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\thasCreateSuggestion={ userCanCreate }\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,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,SAAS,EACTC,WAAW,EACXC,eAAe,EACfC,aAAa,EACbC,YAAY,QACN,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,MA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AE,eAAgB,CAAC,EAAE,WAAY,CAAC;IAC5C,CAAG;IACHiJ,QAAQ,EAAKiB,YAAY,IAAM;MAC9BzI,gBAAgB,CACfyI,YAAY,EACZlH,aAAa,EACbF,UACD,CAAC;IACF;EAAG,CACH,CAEY,CAAC,EACd,CAAEa,eAAe,IAAIE,mBAAmB,KACzC0E,aAAA;IAAMlB,SAAS,EAAC;EAAmC,GAClDkB,aAAA,CAAChH,eAAe,MAAE,CACb,CACN,EACDgH,aAAA;IAAA,GAAUV;EAAgB,CAAI,CAC1B,CACJ,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useSelect","useDispatch","PanelBody","TextControl","TextareaControl","ToolbarButton","ToolbarGroup","displayShortcut","isKeyboardEvent","__","BlockControls","InnerBlocks","useInnerBlocksProps","InspectorControls","RichText","useBlockProps","store","blockEditorStore","getColorClassName","isURL","prependHTTP","useState","useEffect","useRef","link","linkIcon","removeSubmenu","useResourcePermissions","speak","createBlock","useMergeRefs","usePrevious","ItemSubmenuIcon","LinkUI","updateAttributes","getColors","getNavigationChildBlockProps","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","type","url","description","rel","title","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","__unstableMarkNextChangeAsNotPersistent","replaceBlock","selectBlock","isLinkOpen","setIsLinkOpen","openedBy","setOpenedBy","popoverAnchor","setPopoverAnchor","listItemRef","itemLabelPlaceholder","ref","pagesPermissions","postsPermissions","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","userCanCreate","canCreate","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","createElement","Fragment","icon","shortcut","onClick","currentTarget","isDisabled","__nextHasNoMarginBottom","__next40pxDefaultSize","value","onChange","labelValue","autoComplete","urlValue","descriptionValue","help","titleValue","relValue","identifier","onMerge","placeholder","withoutInteractiveFormatting","allowedFormats","onClose","anchor","hasCreateSuggestion","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\tPanelBody,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\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 { useResourcePermissions } from '@wordpress/core-data';\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';\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, type, 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\n\tconst pagesPermissions = useResourcePermissions( 'pages' );\n\tconst postsPermissions = useResourcePermissions( 'posts' );\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\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = pagesPermissions.canCreate;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = postsPermissions.canCreate;\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 propogation, 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\tisDisabled={ ! 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<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\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\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ url || '' }\n\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { url: urlValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\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) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Additional information to help clarify the purpose of the link.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\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) }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\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{\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\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\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\t\tsetOpenedBy( ref.current );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\t{ ! 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\thasCreateSuggestion={ userCanCreate }\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,SAAS,EACTC,WAAW,EACXC,eAAe,EACfC,aAAa,EACbC,YAAY,QACN,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,sBAAsB,QAAQ,sBAAsB;AAC7D,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;;AAE9D;AACA;AACA;AACA,SAASC,eAAe,QAAQ,SAAS;AACzC,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SACCC,SAAS,EACTC,4BAA4B,QACtB,0BAA0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, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -132,7 +132,7 @@ export default function PageListEdit({
132
132
  }, new Map());
133
133
  }, [pages]);
134
134
  const blockProps = useBlockProps({
135
- className: classnames('wp-block-page-list', {
135
+ className: clsx('wp-block-page-list', {
136
136
  'has-text-color': !!context.textColor,
137
137
  [getColorClassName('color', context.textColor)]: !!context.textColor,
138
138
  'has-background': !!context.backgroundColor,