@wordpress/block-library 8.12.0 → 8.12.2

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 (1318) hide show
  1. package/build/archives/edit.js +2 -1
  2. package/build/archives/edit.js.map +1 -1
  3. package/build/archives/index.js +0 -1
  4. package/build/archives/index.js.map +1 -1
  5. package/build/audio/edit.js +4 -2
  6. package/build/audio/edit.js.map +1 -1
  7. package/build/audio/save.js +2 -1
  8. package/build/audio/save.js.map +1 -1
  9. package/build/avatar/edit.js +6 -3
  10. package/build/avatar/edit.js.map +1 -1
  11. package/build/avatar/index.js +1 -2
  12. package/build/avatar/index.js.map +1 -1
  13. package/build/block/edit.js +8 -4
  14. package/build/block/edit.js.map +1 -1
  15. package/build/block/index.js +1 -1
  16. package/build/button/deprecated.js +20 -15
  17. package/build/button/deprecated.js.map +1 -1
  18. package/build/button/edit.js +2 -4
  19. package/build/button/edit.js.map +1 -1
  20. package/build/button/save.js +4 -3
  21. package/build/button/save.js.map +1 -1
  22. package/build/buttons/deprecated.js +6 -5
  23. package/build/buttons/deprecated.js.map +1 -1
  24. package/build/buttons/edit.js +7 -2
  25. package/build/buttons/edit.js.map +1 -1
  26. package/build/buttons/edit.native.js +6 -6
  27. package/build/buttons/edit.native.js.map +1 -1
  28. package/build/buttons/index.js +1 -1
  29. package/build/buttons/save.js +2 -1
  30. package/build/buttons/save.js.map +1 -1
  31. package/build/buttons/transforms.js +1 -1
  32. package/build/calendar/edit.js +4 -2
  33. package/build/calendar/edit.js.map +1 -1
  34. package/build/calendar/index.js +0 -1
  35. package/build/calendar/index.js.map +1 -1
  36. package/build/categories/edit.js +2 -1
  37. package/build/categories/edit.js.map +1 -1
  38. package/build/categories/index.js +0 -1
  39. package/build/categories/index.js.map +1 -1
  40. package/build/code/edit.js +2 -1
  41. package/build/code/edit.js.map +1 -1
  42. package/build/code/save.js +2 -1
  43. package/build/code/save.js.map +1 -1
  44. package/build/column/edit.js +2 -1
  45. package/build/column/edit.js.map +1 -1
  46. package/build/column/edit.native.js +2 -1
  47. package/build/column/edit.native.js.map +1 -1
  48. package/build/column/index.js +1 -1
  49. package/build/column/save.js +2 -1
  50. package/build/column/save.js.map +1 -1
  51. package/build/columns/edit.js +6 -3
  52. package/build/columns/edit.js.map +1 -1
  53. package/build/columns/edit.native.js +4 -5
  54. package/build/columns/edit.native.js.map +1 -1
  55. package/build/columns/index.js +1 -1
  56. package/build/columns/save.js +2 -1
  57. package/build/columns/save.js.map +1 -1
  58. package/build/comment-author-avatar/edit.js +6 -8
  59. package/build/comment-author-avatar/edit.js.map +1 -1
  60. package/build/comment-author-avatar/index.js +0 -1
  61. package/build/comment-author-avatar/index.js.map +1 -1
  62. package/build/comment-author-name/edit.js +2 -1
  63. package/build/comment-author-name/edit.js.map +1 -1
  64. package/build/comment-author-name/index.js +0 -1
  65. package/build/comment-author-name/index.js.map +1 -1
  66. package/build/comment-content/edit.js +4 -2
  67. package/build/comment-content/edit.js.map +1 -1
  68. package/build/comment-content/index.js +0 -1
  69. package/build/comment-content/index.js.map +1 -1
  70. package/build/comment-date/edit.js +2 -1
  71. package/build/comment-date/edit.js.map +1 -1
  72. package/build/comment-date/index.js +0 -1
  73. package/build/comment-date/index.js.map +1 -1
  74. package/build/comment-edit-link/edit.js +2 -1
  75. package/build/comment-edit-link/edit.js.map +1 -1
  76. package/build/comment-edit-link/index.js +0 -1
  77. package/build/comment-edit-link/index.js.map +1 -1
  78. package/build/comment-reply-link/edit.js +2 -1
  79. package/build/comment-reply-link/edit.js.map +1 -1
  80. package/build/comment-reply-link/index.js +0 -1
  81. package/build/comment-reply-link/index.js.map +1 -1
  82. package/build/comment-template/edit.js +10 -10
  83. package/build/comment-template/edit.js.map +1 -1
  84. package/build/comment-template/index.js +0 -1
  85. package/build/comment-template/index.js.map +1 -1
  86. package/build/comments/deprecated.js +2 -1
  87. package/build/comments/deprecated.js.map +1 -1
  88. package/build/comments/edit/comments-legacy.js +2 -1
  89. package/build/comments/edit/comments-legacy.js.map +1 -1
  90. package/build/comments/edit/index.js +4 -2
  91. package/build/comments/edit/index.js.map +1 -1
  92. package/build/comments/index.js +0 -1
  93. package/build/comments/index.js.map +1 -1
  94. package/build/comments/save.js +2 -1
  95. package/build/comments/save.js.map +1 -1
  96. package/build/comments-pagination/edit.js +2 -1
  97. package/build/comments-pagination/edit.js.map +1 -1
  98. package/build/comments-pagination/index.js +1 -2
  99. package/build/comments-pagination/index.js.map +1 -1
  100. package/build/comments-pagination-next/edit.js +4 -7
  101. package/build/comments-pagination-next/edit.js.map +1 -1
  102. package/build/comments-pagination-next/index.js +0 -1
  103. package/build/comments-pagination-next/index.js.map +1 -1
  104. package/build/comments-pagination-numbers/edit.js +2 -1
  105. package/build/comments-pagination-numbers/edit.js.map +1 -1
  106. package/build/comments-pagination-numbers/index.js +0 -1
  107. package/build/comments-pagination-numbers/index.js.map +1 -1
  108. package/build/comments-pagination-previous/edit.js +4 -7
  109. package/build/comments-pagination-previous/edit.js.map +1 -1
  110. package/build/comments-pagination-previous/index.js +0 -1
  111. package/build/comments-pagination-previous/index.js.map +1 -1
  112. package/build/comments-title/edit.js +4 -9
  113. package/build/comments-title/edit.js.map +1 -1
  114. package/build/cover/deprecated.js +46 -36
  115. package/build/cover/deprecated.js.map +1 -1
  116. package/build/cover/edit/index.js +8 -7
  117. package/build/cover/edit/index.js.map +1 -1
  118. package/build/cover/edit/inspector-controls.js +4 -7
  119. package/build/cover/edit/inspector-controls.js.map +1 -1
  120. package/build/cover/edit/resizable-cover-popover.js +6 -7
  121. package/build/cover/edit/resizable-cover-popover.js.map +1 -1
  122. package/build/cover/edit.native.js +12 -11
  123. package/build/cover/edit.native.js.map +1 -1
  124. package/build/cover/index.js +1 -1
  125. package/build/cover/save.js +9 -7
  126. package/build/cover/save.js.map +1 -1
  127. package/build/cover/transforms.js +2 -2
  128. package/build/cover/transforms.js.map +1 -1
  129. package/build/details/edit.js +3 -7
  130. package/build/details/edit.js.map +1 -1
  131. package/build/details/index.js +1 -1
  132. package/build/details/init.js +16 -0
  133. package/build/details/init.js.map +1 -0
  134. package/build/details/save.js +2 -6
  135. package/build/details/save.js.map +1 -1
  136. package/build/embed/deprecated.js +4 -3
  137. package/build/embed/deprecated.js.map +1 -1
  138. package/build/embed/edit.js +6 -3
  139. package/build/embed/edit.js.map +1 -1
  140. package/build/embed/edit.native.js +6 -3
  141. package/build/embed/edit.native.js.map +1 -1
  142. package/build/embed/save.js +4 -3
  143. package/build/embed/save.js.map +1 -1
  144. package/build/embed/wp-embed-preview.js +4 -7
  145. package/build/embed/wp-embed-preview.js.map +1 -1
  146. package/build/embed/wp-embed-preview.native.js +4 -7
  147. package/build/embed/wp-embed-preview.native.js.map +1 -1
  148. package/build/file/deprecated.js +6 -3
  149. package/build/file/deprecated.js.map +1 -1
  150. package/build/file/edit.js +4 -2
  151. package/build/file/edit.js.map +1 -1
  152. package/build/file/index.js +1 -1
  153. package/build/file/save.js +2 -1
  154. package/build/file/save.js.map +1 -1
  155. package/build/file/view.js +9 -0
  156. package/build/file/view.js.map +1 -0
  157. package/build/footnotes/edit.js +57 -0
  158. package/build/footnotes/edit.js.map +1 -0
  159. package/build/footnotes/format.js +142 -0
  160. package/build/footnotes/format.js.map +1 -0
  161. package/build/footnotes/index.js +67 -0
  162. package/build/footnotes/index.js.map +1 -0
  163. package/build/freeform/edit.js +6 -3
  164. package/build/freeform/edit.js.map +1 -1
  165. package/build/freeform/edit.native.js +2 -4
  166. package/build/freeform/edit.native.js.map +1 -1
  167. package/build/freeform/modal.js +2 -1
  168. package/build/freeform/modal.js.map +1 -1
  169. package/build/gallery/deprecated.js +6 -4
  170. package/build/gallery/deprecated.js.map +1 -1
  171. package/build/gallery/edit-wrapper.js +4 -2
  172. package/build/gallery/edit-wrapper.js.map +1 -1
  173. package/build/gallery/edit.js +16 -13
  174. package/build/gallery/edit.js.map +1 -1
  175. package/build/gallery/gallery.js +2 -4
  176. package/build/gallery/gallery.js.map +1 -1
  177. package/build/gallery/gallery.native.js +3 -2
  178. package/build/gallery/gallery.native.js.map +1 -1
  179. package/build/gallery/index.js +1 -1
  180. package/build/gallery/save.js +2 -1
  181. package/build/gallery/save.js.map +1 -1
  182. package/build/gallery/shared-icon.native.js +4 -5
  183. package/build/gallery/shared-icon.native.js.map +1 -1
  184. package/build/gallery/v1/edit.js +8 -9
  185. package/build/gallery/v1/edit.js.map +1 -1
  186. package/build/gallery/v1/gallery.js +7 -7
  187. package/build/gallery/v1/gallery.js.map +1 -1
  188. package/build/gallery/v1/save.js +4 -3
  189. package/build/gallery/v1/save.js.map +1 -1
  190. package/build/group/deprecated.js +5 -3
  191. package/build/group/deprecated.js.map +1 -1
  192. package/build/group/edit.js +4 -1
  193. package/build/group/edit.js.map +1 -1
  194. package/build/group/index.js +1 -1
  195. package/build/group/placeholder.js +2 -1
  196. package/build/group/placeholder.js.map +1 -1
  197. package/build/group/save.js +2 -1
  198. package/build/group/save.js.map +1 -1
  199. package/build/heading/deprecated.js +8 -6
  200. package/build/heading/deprecated.js.map +1 -1
  201. package/build/heading/edit.js +9 -11
  202. package/build/heading/edit.js.map +1 -1
  203. package/build/heading/save.js +4 -3
  204. package/build/heading/save.js.map +1 -1
  205. package/build/home-link/edit.js +2 -1
  206. package/build/home-link/edit.js.map +1 -1
  207. package/build/home-link/index.js +0 -1
  208. package/build/home-link/index.js.map +1 -1
  209. package/build/html/edit.js +4 -3
  210. package/build/html/edit.js.map +1 -1
  211. package/build/image/deprecated.js +14 -12
  212. package/build/image/deprecated.js.map +1 -1
  213. package/build/image/edit.js +4 -7
  214. package/build/image/edit.js.map +1 -1
  215. package/build/image/edit.native.js +8 -8
  216. package/build/image/edit.native.js.map +1 -1
  217. package/build/image/image.js +109 -49
  218. package/build/image/image.js.map +1 -1
  219. package/build/image/index.js +6 -0
  220. package/build/image/index.js.map +1 -1
  221. package/build/image/interactivity.js +119 -6
  222. package/build/image/interactivity.js.map +1 -1
  223. package/build/image/save.js +10 -4
  224. package/build/image/save.js.map +1 -1
  225. package/build/image/utils.js +18 -0
  226. package/build/image/utils.js.map +1 -1
  227. package/build/index.js +3 -1
  228. package/build/index.js.map +1 -1
  229. package/build/latest-comments/edit.js +2 -1
  230. package/build/latest-comments/edit.js.map +1 -1
  231. package/build/latest-comments/index.js +0 -1
  232. package/build/latest-comments/index.js.map +1 -1
  233. package/build/latest-posts/deprecated.js +0 -1
  234. package/build/latest-posts/deprecated.js.map +1 -1
  235. package/build/latest-posts/edit.js +14 -7
  236. package/build/latest-posts/edit.js.map +1 -1
  237. package/build/latest-posts/edit.native.js +4 -5
  238. package/build/latest-posts/edit.native.js.map +1 -1
  239. package/build/latest-posts/index.js +0 -1
  240. package/build/latest-posts/index.js.map +1 -1
  241. package/build/list/deprecated.js +12 -10
  242. package/build/list/deprecated.js.map +1 -1
  243. package/build/list/edit.js +4 -5
  244. package/build/list/edit.js.map +1 -1
  245. package/build/list/ordered-list-settings.js +25 -1
  246. package/build/list/ordered-list-settings.js.map +1 -1
  247. package/build/list/save.js +6 -5
  248. package/build/list/save.js.map +1 -1
  249. package/build/list/tag-name.js +4 -7
  250. package/build/list/tag-name.js.map +1 -1
  251. package/build/list/tag-name.native.js +4 -7
  252. package/build/list/tag-name.native.js.map +1 -1
  253. package/build/list-item/edit.js +2 -1
  254. package/build/list-item/edit.js.map +1 -1
  255. package/build/list-item/edit.native.js +2 -1
  256. package/build/list-item/edit.native.js.map +1 -1
  257. package/build/list-item/save.js +2 -1
  258. package/build/list-item/save.js.map +1 -1
  259. package/build/{private-apis.js → lock-unlock.js} +1 -1
  260. package/build/lock-unlock.js.map +1 -0
  261. package/build/loginout/edit.js +4 -3
  262. package/build/loginout/edit.js.map +1 -1
  263. package/build/loginout/index.js +0 -1
  264. package/build/loginout/index.js.map +1 -1
  265. package/build/media-text/deprecated.js +43 -33
  266. package/build/media-text/deprecated.js.map +1 -1
  267. package/build/media-text/edit.js +7 -4
  268. package/build/media-text/edit.js.map +1 -1
  269. package/build/media-text/media-container.js +8 -7
  270. package/build/media-text/media-container.js.map +1 -1
  271. package/build/media-text/media-container.native.js +8 -8
  272. package/build/media-text/media-container.native.js.map +1 -1
  273. package/build/media-text/save.js +17 -13
  274. package/build/media-text/save.js.map +1 -1
  275. package/build/missing/edit.js +4 -3
  276. package/build/missing/edit.js.map +1 -1
  277. package/build/more/edit.js +2 -1
  278. package/build/more/edit.js.map +1 -1
  279. package/build/navigation/constants.js +8 -1
  280. package/build/navigation/constants.js.map +1 -1
  281. package/build/navigation/deprecated.js +1 -1
  282. package/build/navigation/deprecated.js.map +1 -1
  283. package/build/navigation/edit/index.js +35 -21
  284. package/build/navigation/edit/index.js.map +1 -1
  285. package/build/navigation/edit/inner-blocks.js +2 -1
  286. package/build/navigation/edit/inner-blocks.js.map +1 -1
  287. package/build/navigation/edit/leaf-more-menu.js +5 -9
  288. package/build/navigation/edit/leaf-more-menu.js.map +1 -1
  289. package/build/navigation/edit/menu-inspector-controls.js +12 -16
  290. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  291. package/build/navigation/edit/navigation-menu-selector.js +15 -7
  292. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  293. package/build/navigation/edit/responsive-wrapper.js +2 -1
  294. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  295. package/build/navigation/edit/unsaved-inner-blocks.js +3 -5
  296. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  297. package/build/navigation/index.js +2 -3
  298. package/build/navigation/index.js.map +1 -1
  299. package/build/navigation/use-navigation-menu.js +9 -7
  300. package/build/navigation/use-navigation-menu.js.map +1 -1
  301. package/build/navigation/view-modal.js +64 -0
  302. package/build/navigation/view-modal.js.map +1 -0
  303. package/build/navigation/view.js +61 -0
  304. package/build/navigation/view.js.map +1 -0
  305. package/build/navigation-link/edit.js +4 -2
  306. package/build/navigation-link/edit.js.map +1 -1
  307. package/build/navigation-submenu/edit.js +4 -2
  308. package/build/navigation-submenu/edit.js.map +1 -1
  309. package/build/nextpage/edit.js +2 -1
  310. package/build/nextpage/edit.js.map +1 -1
  311. package/build/page-list/edit.js +12 -6
  312. package/build/page-list/edit.js.map +1 -1
  313. package/build/page-list/index.js +0 -1
  314. package/build/page-list/index.js.map +1 -1
  315. package/build/page-list-item/edit.js +2 -1
  316. package/build/page-list-item/edit.js.map +1 -1
  317. package/build/paragraph/deprecated.js +5 -4
  318. package/build/paragraph/deprecated.js.map +1 -1
  319. package/build/paragraph/edit.js +4 -6
  320. package/build/paragraph/edit.js.map +1 -1
  321. package/build/paragraph/save.js +5 -4
  322. package/build/paragraph/save.js.map +1 -1
  323. package/build/pattern/edit.js +7 -32
  324. package/build/pattern/edit.js.map +1 -1
  325. package/build/pattern/index.js +3 -11
  326. package/build/pattern/index.js.map +1 -1
  327. package/build/post-author/edit.js +4 -2
  328. package/build/post-author/edit.js.map +1 -1
  329. package/build/post-author/index.js +0 -1
  330. package/build/post-author/index.js.map +1 -1
  331. package/build/post-author-biography/edit.js +2 -4
  332. package/build/post-author-biography/edit.js.map +1 -1
  333. package/build/post-author-biography/index.js +0 -1
  334. package/build/post-author-biography/index.js.map +1 -1
  335. package/build/post-author-name/edit.js +2 -1
  336. package/build/post-author-name/edit.js.map +1 -1
  337. package/build/post-author-name/index.js +0 -1
  338. package/build/post-author-name/index.js.map +1 -1
  339. package/build/post-comment/edit.js +4 -2
  340. package/build/post-comment/edit.js.map +1 -1
  341. package/build/post-comment/save.js +2 -1
  342. package/build/post-comment/save.js.map +1 -1
  343. package/build/post-comments-count/edit.js +2 -4
  344. package/build/post-comments-count/edit.js.map +1 -1
  345. package/build/post-comments-count/index.js +0 -1
  346. package/build/post-comments-count/index.js.map +1 -1
  347. package/build/post-comments-form/edit.js +2 -1
  348. package/build/post-comments-form/edit.js.map +1 -1
  349. package/build/post-comments-form/index.js +0 -1
  350. package/build/post-comments-form/index.js.map +1 -1
  351. package/build/post-comments-link/edit.js +2 -1
  352. package/build/post-comments-link/edit.js.map +1 -1
  353. package/build/post-comments-link/index.js +0 -1
  354. package/build/post-comments-link/index.js.map +1 -1
  355. package/build/post-content/edit.js +11 -10
  356. package/build/post-content/edit.js.map +1 -1
  357. package/build/post-content/index.js +1 -2
  358. package/build/post-content/index.js.map +1 -1
  359. package/build/post-date/edit.js +2 -1
  360. package/build/post-date/edit.js.map +1 -1
  361. package/build/post-date/index.js +0 -1
  362. package/build/post-date/index.js.map +1 -1
  363. package/build/post-excerpt/edit.js +6 -3
  364. package/build/post-excerpt/edit.js.map +1 -1
  365. package/build/post-excerpt/index.js +0 -1
  366. package/build/post-excerpt/index.js.map +1 -1
  367. package/build/post-featured-image/edit.js +4 -2
  368. package/build/post-featured-image/edit.js.map +1 -1
  369. package/build/post-featured-image/index.js +0 -1
  370. package/build/post-featured-image/index.js.map +1 -1
  371. package/build/post-featured-image/overlay.js +4 -5
  372. package/build/post-featured-image/overlay.js.map +1 -1
  373. package/build/post-navigation-link/edit.js +2 -1
  374. package/build/post-navigation-link/edit.js.map +1 -1
  375. package/build/post-navigation-link/index.js +0 -1
  376. package/build/post-navigation-link/index.js.map +1 -1
  377. package/build/post-template/edit.js +14 -9
  378. package/build/post-template/edit.js.map +1 -1
  379. package/build/post-template/index.js +1 -2
  380. package/build/post-template/index.js.map +1 -1
  381. package/build/post-terms/edit.js +4 -8
  382. package/build/post-terms/edit.js.map +1 -1
  383. package/build/post-terms/hooks.js +9 -5
  384. package/build/post-terms/hooks.js.map +1 -1
  385. package/build/post-terms/index.js +0 -1
  386. package/build/post-terms/index.js.map +1 -1
  387. package/build/post-time-to-read/edit.js +2 -1
  388. package/build/post-time-to-read/edit.js.map +1 -1
  389. package/build/post-time-to-read/init.js +16 -0
  390. package/build/post-time-to-read/init.js.map +1 -0
  391. package/build/post-title/edit.js +16 -16
  392. package/build/post-title/edit.js.map +1 -1
  393. package/build/post-title/index.js +0 -1
  394. package/build/post-title/index.js.map +1 -1
  395. package/build/preformatted/edit.js +4 -8
  396. package/build/preformatted/edit.js.map +1 -1
  397. package/build/preformatted/edit.native.js +2 -1
  398. package/build/preformatted/edit.native.js.map +1 -1
  399. package/build/preformatted/save.js +2 -1
  400. package/build/preformatted/save.js.map +1 -1
  401. package/build/pullquote/deprecated.js +10 -8
  402. package/build/pullquote/deprecated.js.map +1 -1
  403. package/build/pullquote/edit.js +2 -1
  404. package/build/pullquote/edit.js.map +1 -1
  405. package/build/pullquote/edit.native.js +2 -1
  406. package/build/pullquote/edit.native.js.map +1 -1
  407. package/build/pullquote/save.js +5 -4
  408. package/build/pullquote/save.js.map +1 -1
  409. package/build/query/deprecated.js +16 -10
  410. package/build/query/deprecated.js.map +1 -1
  411. package/build/query/edit/index.js +2 -4
  412. package/build/query/edit/index.js.map +1 -1
  413. package/build/query/edit/inspector-controls/index.js +4 -3
  414. package/build/query/edit/inspector-controls/index.js.map +1 -1
  415. package/build/query/edit/query-content.js +20 -6
  416. package/build/query/edit/query-content.js.map +1 -1
  417. package/build/query/edit/query-placeholder.js +4 -2
  418. package/build/query/edit/query-placeholder.js.map +1 -1
  419. package/build/query/index.js +1 -2
  420. package/build/query/index.js.map +1 -1
  421. package/build/query/save.js +2 -1
  422. package/build/query/save.js.map +1 -1
  423. package/build/query/utils.js +1 -2
  424. package/build/query/utils.js.map +1 -1
  425. package/build/query-no-results/edit.js +2 -1
  426. package/build/query-no-results/edit.js.map +1 -1
  427. package/build/query-no-results/index.js +0 -1
  428. package/build/query-no-results/index.js.map +1 -1
  429. package/build/query-pagination/deprecated.js +2 -1
  430. package/build/query-pagination/deprecated.js.map +1 -1
  431. package/build/query-pagination/edit.js +2 -1
  432. package/build/query-pagination/edit.js.map +1 -1
  433. package/build/query-pagination/index.js +1 -2
  434. package/build/query-pagination/index.js.map +1 -1
  435. package/build/query-pagination-next/edit.js +4 -7
  436. package/build/query-pagination-next/edit.js.map +1 -1
  437. package/build/query-pagination-next/index.js +0 -1
  438. package/build/query-pagination-next/index.js.map +1 -1
  439. package/build/query-pagination-numbers/edit.js +2 -1
  440. package/build/query-pagination-numbers/edit.js.map +1 -1
  441. package/build/query-pagination-numbers/index.js +1 -2
  442. package/build/query-pagination-numbers/index.js.map +1 -1
  443. package/build/query-pagination-previous/edit.js +4 -7
  444. package/build/query-pagination-previous/edit.js.map +1 -1
  445. package/build/query-pagination-previous/index.js +0 -1
  446. package/build/query-pagination-previous/index.js.map +1 -1
  447. package/build/query-title/edit.js +8 -11
  448. package/build/query-title/edit.js.map +1 -1
  449. package/build/query-title/index.js +0 -1
  450. package/build/query-title/index.js.map +1 -1
  451. package/build/quote/deprecated.js +4 -3
  452. package/build/quote/deprecated.js.map +1 -1
  453. package/build/quote/edit.js +7 -7
  454. package/build/quote/edit.js.map +1 -1
  455. package/build/quote/save.js +4 -3
  456. package/build/quote/save.js.map +1 -1
  457. package/build/read-more/edit.js +4 -7
  458. package/build/read-more/edit.js.map +1 -1
  459. package/build/read-more/index.js +0 -1
  460. package/build/read-more/index.js.map +1 -1
  461. package/build/rss/edit.js +4 -2
  462. package/build/rss/edit.js.map +1 -1
  463. package/build/rss/index.js +0 -1
  464. package/build/rss/index.js.map +1 -1
  465. package/build/search/edit.js +4 -3
  466. package/build/search/edit.js.map +1 -1
  467. package/build/search/edit.native.js +6 -8
  468. package/build/search/edit.native.js.map +1 -1
  469. package/build/search/index.js +0 -1
  470. package/build/search/index.js.map +1 -1
  471. package/build/separator/deprecated.js +5 -4
  472. package/build/separator/deprecated.js.map +1 -1
  473. package/build/separator/edit.js +5 -4
  474. package/build/separator/edit.js.map +1 -1
  475. package/build/separator/save.js +5 -4
  476. package/build/separator/save.js.map +1 -1
  477. package/build/shortcode/edit.js +4 -3
  478. package/build/shortcode/edit.js.map +1 -1
  479. package/build/site-logo/edit.js +10 -10
  480. package/build/site-logo/edit.js.map +1 -1
  481. package/build/site-logo/index.js +0 -1
  482. package/build/site-logo/index.js.map +1 -1
  483. package/build/site-tagline/edit.js +5 -5
  484. package/build/site-tagline/edit.js.map +1 -1
  485. package/build/site-tagline/icon.js +1 -4
  486. package/build/site-tagline/icon.js.map +1 -1
  487. package/build/site-tagline/index.js +0 -1
  488. package/build/site-tagline/index.js.map +1 -1
  489. package/build/site-title/edit/index.js +8 -9
  490. package/build/site-title/edit/index.js.map +1 -1
  491. package/build/site-title/index.js +0 -1
  492. package/build/site-title/index.js.map +1 -1
  493. package/build/social-link/edit.js +2 -1
  494. package/build/social-link/edit.js.map +1 -1
  495. package/build/social-link/index.js +0 -1
  496. package/build/social-link/index.js.map +1 -1
  497. package/build/social-links/deprecated.js +5 -4
  498. package/build/social-links/deprecated.js.map +1 -1
  499. package/build/social-links/edit.js +6 -6
  500. package/build/social-links/edit.js.map +1 -1
  501. package/build/social-links/index.js +1 -1
  502. package/build/social-links/save.js +2 -1
  503. package/build/social-links/save.js.map +1 -1
  504. package/build/spacer/deprecated.js +8 -7
  505. package/build/spacer/deprecated.js.map +1 -1
  506. package/build/spacer/edit.js +10 -10
  507. package/build/spacer/edit.js.map +1 -1
  508. package/build/spacer/edit.native.js +4 -5
  509. package/build/spacer/edit.native.js.map +1 -1
  510. package/build/spacer/save.js +21 -11
  511. package/build/spacer/save.js.map +1 -1
  512. package/build/spacer/save.native.js +8 -7
  513. package/build/spacer/save.native.js.map +1 -1
  514. package/build/table/deprecated.js +4 -2
  515. package/build/table/deprecated.js.map +1 -1
  516. package/build/table/edit.js +6 -4
  517. package/build/table/edit.js.map +1 -1
  518. package/build/table/save.js +2 -1
  519. package/build/table/save.js.map +1 -1
  520. package/build/table-of-contents/edit.js +4 -2
  521. package/build/table-of-contents/edit.js.map +1 -1
  522. package/build/table-of-contents/save.js +2 -1
  523. package/build/table-of-contents/save.js.map +1 -1
  524. package/build/tag-cloud/edit.js +2 -1
  525. package/build/tag-cloud/edit.js.map +1 -1
  526. package/build/tag-cloud/index.js +0 -1
  527. package/build/tag-cloud/index.js.map +1 -1
  528. package/build/template-part/edit/index.js +8 -4
  529. package/build/template-part/edit/index.js.map +1 -1
  530. package/build/template-part/edit/inner-blocks.js +3 -2
  531. package/build/template-part/edit/inner-blocks.js.map +1 -1
  532. package/build/template-part/index.js +0 -1
  533. package/build/template-part/index.js.map +1 -1
  534. package/build/term-description/edit.js +2 -1
  535. package/build/term-description/edit.js.map +1 -1
  536. package/build/term-description/index.js +0 -1
  537. package/build/term-description/index.js.map +1 -1
  538. package/build/text-columns/edit.js +4 -3
  539. package/build/text-columns/edit.js.map +1 -1
  540. package/build/text-columns/save.js +4 -3
  541. package/build/text-columns/save.js.map +1 -1
  542. package/build/utils/interactivity/directives.js +4 -7
  543. package/build/utils/interactivity/directives.js.map +1 -1
  544. package/build/utils/interactivity/index.js +1 -3
  545. package/build/utils/interactivity/index.js.map +1 -1
  546. package/build/utils/migrate-font-family.js +2 -2
  547. package/build/utils/migrate-font-family.js.map +1 -1
  548. package/build/verse/deprecated.js +4 -3
  549. package/build/verse/deprecated.js.map +1 -1
  550. package/build/verse/edit.js +4 -6
  551. package/build/verse/edit.js.map +1 -1
  552. package/build/verse/save.js +4 -3
  553. package/build/verse/save.js.map +1 -1
  554. package/build/video/deprecated.js +2 -1
  555. package/build/video/deprecated.js.map +1 -1
  556. package/build/video/edit.js +4 -2
  557. package/build/video/edit.js.map +1 -1
  558. package/build/video/edit.native.js +8 -8
  559. package/build/video/edit.native.js.map +1 -1
  560. package/build/video/save.js +2 -1
  561. package/build/video/save.js.map +1 -1
  562. package/build/video/tracks.js +4 -7
  563. package/build/video/tracks.js.map +1 -1
  564. package/build-module/archives/edit.js +2 -1
  565. package/build-module/archives/edit.js.map +1 -1
  566. package/build-module/archives/index.js +0 -1
  567. package/build-module/archives/index.js.map +1 -1
  568. package/build-module/audio/edit.js +4 -2
  569. package/build-module/audio/edit.js.map +1 -1
  570. package/build-module/audio/save.js +2 -1
  571. package/build-module/audio/save.js.map +1 -1
  572. package/build-module/avatar/edit.js +6 -3
  573. package/build-module/avatar/edit.js.map +1 -1
  574. package/build-module/avatar/index.js +1 -2
  575. package/build-module/avatar/index.js.map +1 -1
  576. package/build-module/block/edit.js +8 -4
  577. package/build-module/block/edit.js.map +1 -1
  578. package/build-module/block/index.js +1 -1
  579. package/build-module/button/deprecated.js +20 -15
  580. package/build-module/button/deprecated.js.map +1 -1
  581. package/build-module/button/edit.js +2 -3
  582. package/build-module/button/edit.js.map +1 -1
  583. package/build-module/button/save.js +4 -3
  584. package/build-module/button/save.js.map +1 -1
  585. package/build-module/buttons/deprecated.js +6 -5
  586. package/build-module/buttons/deprecated.js.map +1 -1
  587. package/build-module/buttons/edit.js +7 -2
  588. package/build-module/buttons/edit.js.map +1 -1
  589. package/build-module/buttons/edit.native.js +6 -6
  590. package/build-module/buttons/edit.native.js.map +1 -1
  591. package/build-module/buttons/index.js +1 -1
  592. package/build-module/buttons/save.js +2 -1
  593. package/build-module/buttons/save.js.map +1 -1
  594. package/build-module/buttons/transforms.js +1 -1
  595. package/build-module/calendar/edit.js +4 -2
  596. package/build-module/calendar/edit.js.map +1 -1
  597. package/build-module/calendar/index.js +0 -1
  598. package/build-module/calendar/index.js.map +1 -1
  599. package/build-module/categories/edit.js +2 -1
  600. package/build-module/categories/edit.js.map +1 -1
  601. package/build-module/categories/index.js +0 -1
  602. package/build-module/categories/index.js.map +1 -1
  603. package/build-module/code/edit.js +2 -1
  604. package/build-module/code/edit.js.map +1 -1
  605. package/build-module/code/save.js +2 -1
  606. package/build-module/code/save.js.map +1 -1
  607. package/build-module/column/edit.js +2 -1
  608. package/build-module/column/edit.js.map +1 -1
  609. package/build-module/column/edit.native.js +2 -1
  610. package/build-module/column/edit.native.js.map +1 -1
  611. package/build-module/column/index.js +1 -1
  612. package/build-module/column/save.js +2 -1
  613. package/build-module/column/save.js.map +1 -1
  614. package/build-module/columns/edit.js +6 -3
  615. package/build-module/columns/edit.js.map +1 -1
  616. package/build-module/columns/edit.native.js +4 -4
  617. package/build-module/columns/edit.native.js.map +1 -1
  618. package/build-module/columns/index.js +1 -1
  619. package/build-module/columns/save.js +2 -1
  620. package/build-module/columns/save.js.map +1 -1
  621. package/build-module/comment-author-avatar/edit.js +6 -5
  622. package/build-module/comment-author-avatar/edit.js.map +1 -1
  623. package/build-module/comment-author-avatar/index.js +0 -1
  624. package/build-module/comment-author-avatar/index.js.map +1 -1
  625. package/build-module/comment-author-name/edit.js +2 -1
  626. package/build-module/comment-author-name/edit.js.map +1 -1
  627. package/build-module/comment-author-name/index.js +0 -1
  628. package/build-module/comment-author-name/index.js.map +1 -1
  629. package/build-module/comment-content/edit.js +4 -2
  630. package/build-module/comment-content/edit.js.map +1 -1
  631. package/build-module/comment-content/index.js +0 -1
  632. package/build-module/comment-content/index.js.map +1 -1
  633. package/build-module/comment-date/edit.js +2 -1
  634. package/build-module/comment-date/edit.js.map +1 -1
  635. package/build-module/comment-date/index.js +0 -1
  636. package/build-module/comment-date/index.js.map +1 -1
  637. package/build-module/comment-edit-link/edit.js +2 -1
  638. package/build-module/comment-edit-link/edit.js.map +1 -1
  639. package/build-module/comment-edit-link/index.js +0 -1
  640. package/build-module/comment-edit-link/index.js.map +1 -1
  641. package/build-module/comment-reply-link/edit.js +2 -1
  642. package/build-module/comment-reply-link/edit.js.map +1 -1
  643. package/build-module/comment-reply-link/index.js +0 -1
  644. package/build-module/comment-reply-link/index.js.map +1 -1
  645. package/build-module/comment-template/edit.js +10 -7
  646. package/build-module/comment-template/edit.js.map +1 -1
  647. package/build-module/comment-template/index.js +0 -1
  648. package/build-module/comment-template/index.js.map +1 -1
  649. package/build-module/comments/deprecated.js +2 -1
  650. package/build-module/comments/deprecated.js.map +1 -1
  651. package/build-module/comments/edit/comments-legacy.js +2 -1
  652. package/build-module/comments/edit/comments-legacy.js.map +1 -1
  653. package/build-module/comments/edit/index.js +4 -2
  654. package/build-module/comments/edit/index.js.map +1 -1
  655. package/build-module/comments/index.js +0 -1
  656. package/build-module/comments/index.js.map +1 -1
  657. package/build-module/comments/save.js +2 -1
  658. package/build-module/comments/save.js.map +1 -1
  659. package/build-module/comments-pagination/edit.js +2 -1
  660. package/build-module/comments-pagination/edit.js.map +1 -1
  661. package/build-module/comments-pagination/index.js +1 -2
  662. package/build-module/comments-pagination/index.js.map +1 -1
  663. package/build-module/comments-pagination-next/edit.js +4 -4
  664. package/build-module/comments-pagination-next/edit.js.map +1 -1
  665. package/build-module/comments-pagination-next/index.js +0 -1
  666. package/build-module/comments-pagination-next/index.js.map +1 -1
  667. package/build-module/comments-pagination-numbers/edit.js +2 -1
  668. package/build-module/comments-pagination-numbers/edit.js.map +1 -1
  669. package/build-module/comments-pagination-numbers/index.js +0 -1
  670. package/build-module/comments-pagination-numbers/index.js.map +1 -1
  671. package/build-module/comments-pagination-previous/edit.js +4 -4
  672. package/build-module/comments-pagination-previous/edit.js.map +1 -1
  673. package/build-module/comments-pagination-previous/index.js +0 -1
  674. package/build-module/comments-pagination-previous/index.js.map +1 -1
  675. package/build-module/comments-title/edit.js +4 -8
  676. package/build-module/comments-title/edit.js.map +1 -1
  677. package/build-module/cover/deprecated.js +46 -36
  678. package/build-module/cover/deprecated.js.map +1 -1
  679. package/build-module/cover/edit/index.js +8 -6
  680. package/build-module/cover/edit/index.js.map +1 -1
  681. package/build-module/cover/edit/inspector-controls.js +4 -4
  682. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  683. package/build-module/cover/edit/resizable-cover-popover.js +5 -5
  684. package/build-module/cover/edit/resizable-cover-popover.js.map +1 -1
  685. package/build-module/cover/edit.native.js +12 -10
  686. package/build-module/cover/edit.native.js.map +1 -1
  687. package/build-module/cover/index.js +1 -1
  688. package/build-module/cover/save.js +9 -7
  689. package/build-module/cover/save.js.map +1 -1
  690. package/build-module/cover/transforms.js +1 -1
  691. package/build-module/cover/transforms.js.map +1 -1
  692. package/build-module/details/edit.js +3 -4
  693. package/build-module/details/edit.js.map +1 -1
  694. package/build-module/details/index.js +1 -1
  695. package/build-module/details/init.js +6 -0
  696. package/build-module/details/init.js.map +1 -0
  697. package/build-module/details/save.js +2 -3
  698. package/build-module/details/save.js.map +1 -1
  699. package/build-module/embed/deprecated.js +4 -3
  700. package/build-module/embed/deprecated.js.map +1 -1
  701. package/build-module/embed/edit.js +6 -3
  702. package/build-module/embed/edit.js.map +1 -1
  703. package/build-module/embed/edit.native.js +6 -3
  704. package/build-module/embed/edit.native.js.map +1 -1
  705. package/build-module/embed/save.js +4 -3
  706. package/build-module/embed/save.js.map +1 -1
  707. package/build-module/embed/wp-embed-preview.js +4 -4
  708. package/build-module/embed/wp-embed-preview.js.map +1 -1
  709. package/build-module/embed/wp-embed-preview.native.js +4 -4
  710. package/build-module/embed/wp-embed-preview.native.js.map +1 -1
  711. package/build-module/file/deprecated.js +6 -3
  712. package/build-module/file/deprecated.js.map +1 -1
  713. package/build-module/file/edit.js +4 -2
  714. package/build-module/file/edit.js.map +1 -1
  715. package/build-module/file/index.js +1 -1
  716. package/build-module/file/save.js +2 -1
  717. package/build-module/file/save.js.map +1 -1
  718. package/build-module/file/view.js +6 -0
  719. package/build-module/file/view.js.map +1 -0
  720. package/build-module/footnotes/edit.js +48 -0
  721. package/build-module/footnotes/edit.js.map +1 -0
  722. package/build-module/footnotes/format.js +126 -0
  723. package/build-module/footnotes/format.js.map +1 -0
  724. package/build-module/footnotes/index.js +48 -0
  725. package/build-module/footnotes/index.js.map +1 -0
  726. package/build-module/freeform/edit.js +6 -3
  727. package/build-module/freeform/edit.js.map +1 -1
  728. package/build-module/freeform/edit.native.js +2 -3
  729. package/build-module/freeform/edit.native.js.map +1 -1
  730. package/build-module/freeform/modal.js +2 -1
  731. package/build-module/freeform/modal.js.map +1 -1
  732. package/build-module/gallery/deprecated.js +6 -4
  733. package/build-module/gallery/deprecated.js.map +1 -1
  734. package/build-module/gallery/edit-wrapper.js +4 -2
  735. package/build-module/gallery/edit-wrapper.js.map +1 -1
  736. package/build-module/gallery/edit.js +16 -12
  737. package/build-module/gallery/edit.js.map +1 -1
  738. package/build-module/gallery/gallery.js +2 -3
  739. package/build-module/gallery/gallery.js.map +1 -1
  740. package/build-module/gallery/gallery.native.js +3 -2
  741. package/build-module/gallery/gallery.native.js.map +1 -1
  742. package/build-module/gallery/index.js +1 -1
  743. package/build-module/gallery/save.js +2 -1
  744. package/build-module/gallery/save.js.map +1 -1
  745. package/build-module/gallery/shared-icon.native.js +4 -4
  746. package/build-module/gallery/shared-icon.native.js.map +1 -1
  747. package/build-module/gallery/v1/edit.js +8 -8
  748. package/build-module/gallery/v1/edit.js.map +1 -1
  749. package/build-module/gallery/v1/gallery.js +7 -6
  750. package/build-module/gallery/v1/gallery.js.map +1 -1
  751. package/build-module/gallery/v1/save.js +4 -3
  752. package/build-module/gallery/v1/save.js.map +1 -1
  753. package/build-module/group/deprecated.js +5 -3
  754. package/build-module/group/deprecated.js.map +1 -1
  755. package/build-module/group/edit.js +4 -1
  756. package/build-module/group/edit.js.map +1 -1
  757. package/build-module/group/index.js +1 -1
  758. package/build-module/group/placeholder.js +2 -1
  759. package/build-module/group/placeholder.js.map +1 -1
  760. package/build-module/group/save.js +2 -1
  761. package/build-module/group/save.js.map +1 -1
  762. package/build-module/heading/deprecated.js +8 -6
  763. package/build-module/heading/deprecated.js.map +1 -1
  764. package/build-module/heading/edit.js +9 -9
  765. package/build-module/heading/edit.js.map +1 -1
  766. package/build-module/heading/save.js +4 -3
  767. package/build-module/heading/save.js.map +1 -1
  768. package/build-module/home-link/edit.js +2 -1
  769. package/build-module/home-link/edit.js.map +1 -1
  770. package/build-module/home-link/index.js +0 -1
  771. package/build-module/home-link/index.js.map +1 -1
  772. package/build-module/html/edit.js +4 -3
  773. package/build-module/html/edit.js.map +1 -1
  774. package/build-module/image/deprecated.js +14 -11
  775. package/build-module/image/deprecated.js.map +1 -1
  776. package/build-module/image/edit.js +3 -6
  777. package/build-module/image/edit.js.map +1 -1
  778. package/build-module/image/edit.native.js +8 -7
  779. package/build-module/image/edit.native.js.map +1 -1
  780. package/build-module/image/image.js +109 -52
  781. package/build-module/image/image.js.map +1 -1
  782. package/build-module/image/index.js +6 -0
  783. package/build-module/image/index.js.map +1 -1
  784. package/build-module/image/interactivity.js +119 -6
  785. package/build-module/image/interactivity.js.map +1 -1
  786. package/build-module/image/save.js +10 -4
  787. package/build-module/image/save.js.map +1 -1
  788. package/build-module/image/utils.js +16 -0
  789. package/build-module/image/utils.js.map +1 -1
  790. package/build-module/index.js +2 -1
  791. package/build-module/index.js.map +1 -1
  792. package/build-module/latest-comments/edit.js +2 -1
  793. package/build-module/latest-comments/edit.js.map +1 -1
  794. package/build-module/latest-comments/index.js +0 -1
  795. package/build-module/latest-comments/index.js.map +1 -1
  796. package/build-module/latest-posts/deprecated.js +0 -1
  797. package/build-module/latest-posts/deprecated.js.map +1 -1
  798. package/build-module/latest-posts/edit.js +15 -7
  799. package/build-module/latest-posts/edit.js.map +1 -1
  800. package/build-module/latest-posts/edit.native.js +4 -4
  801. package/build-module/latest-posts/edit.native.js.map +1 -1
  802. package/build-module/latest-posts/index.js +0 -1
  803. package/build-module/latest-posts/index.js.map +1 -1
  804. package/build-module/list/deprecated.js +12 -10
  805. package/build-module/list/deprecated.js.map +1 -1
  806. package/build-module/list/edit.js +4 -4
  807. package/build-module/list/edit.js.map +1 -1
  808. package/build-module/list/ordered-list-settings.js +26 -2
  809. package/build-module/list/ordered-list-settings.js.map +1 -1
  810. package/build-module/list/save.js +6 -5
  811. package/build-module/list/save.js.map +1 -1
  812. package/build-module/list/tag-name.js +4 -4
  813. package/build-module/list/tag-name.js.map +1 -1
  814. package/build-module/list/tag-name.native.js +4 -4
  815. package/build-module/list/tag-name.native.js.map +1 -1
  816. package/build-module/list-item/edit.js +2 -1
  817. package/build-module/list-item/edit.js.map +1 -1
  818. package/build-module/list-item/edit.native.js +2 -1
  819. package/build-module/list-item/edit.native.js.map +1 -1
  820. package/build-module/list-item/save.js +2 -1
  821. package/build-module/list-item/save.js.map +1 -1
  822. package/build-module/{private-apis.js → lock-unlock.js} +1 -1
  823. package/build-module/lock-unlock.js.map +1 -0
  824. package/build-module/loginout/edit.js +4 -3
  825. package/build-module/loginout/edit.js.map +1 -1
  826. package/build-module/loginout/index.js +0 -1
  827. package/build-module/loginout/index.js.map +1 -1
  828. package/build-module/media-text/deprecated.js +43 -33
  829. package/build-module/media-text/deprecated.js.map +1 -1
  830. package/build-module/media-text/edit.js +6 -3
  831. package/build-module/media-text/edit.js.map +1 -1
  832. package/build-module/media-text/media-container.js +8 -6
  833. package/build-module/media-text/media-container.js.map +1 -1
  834. package/build-module/media-text/media-container.native.js +8 -7
  835. package/build-module/media-text/media-container.native.js.map +1 -1
  836. package/build-module/media-text/save.js +17 -13
  837. package/build-module/media-text/save.js.map +1 -1
  838. package/build-module/missing/edit.js +4 -3
  839. package/build-module/missing/edit.js.map +1 -1
  840. package/build-module/more/edit.js +2 -1
  841. package/build-module/more/edit.js.map +1 -1
  842. package/build-module/navigation/constants.js +6 -0
  843. package/build-module/navigation/constants.js.map +1 -1
  844. package/build-module/navigation/deprecated.js +1 -1
  845. package/build-module/navigation/deprecated.js.map +1 -1
  846. package/build-module/navigation/edit/index.js +34 -21
  847. package/build-module/navigation/edit/index.js.map +1 -1
  848. package/build-module/navigation/edit/inner-blocks.js +2 -1
  849. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  850. package/build-module/navigation/edit/leaf-more-menu.js +5 -6
  851. package/build-module/navigation/edit/leaf-more-menu.js.map +1 -1
  852. package/build-module/navigation/edit/menu-inspector-controls.js +12 -16
  853. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  854. package/build-module/navigation/edit/navigation-menu-selector.js +15 -7
  855. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  856. package/build-module/navigation/edit/responsive-wrapper.js +2 -1
  857. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  858. package/build-module/navigation/edit/unsaved-inner-blocks.js +4 -6
  859. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  860. package/build-module/navigation/index.js +2 -3
  861. package/build-module/navigation/index.js.map +1 -1
  862. package/build-module/navigation/use-navigation-menu.js +8 -7
  863. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  864. package/build-module/navigation/view-modal.js +58 -0
  865. package/build-module/navigation/view-modal.js.map +1 -0
  866. package/build-module/navigation/view.js +59 -0
  867. package/build-module/navigation/view.js.map +1 -0
  868. package/build-module/navigation-link/edit.js +4 -2
  869. package/build-module/navigation-link/edit.js.map +1 -1
  870. package/build-module/navigation-submenu/edit.js +4 -2
  871. package/build-module/navigation-submenu/edit.js.map +1 -1
  872. package/build-module/nextpage/edit.js +2 -1
  873. package/build-module/nextpage/edit.js.map +1 -1
  874. package/build-module/page-list/edit.js +12 -6
  875. package/build-module/page-list/edit.js.map +1 -1
  876. package/build-module/page-list/index.js +0 -1
  877. package/build-module/page-list/index.js.map +1 -1
  878. package/build-module/page-list-item/edit.js +2 -1
  879. package/build-module/page-list-item/edit.js.map +1 -1
  880. package/build-module/paragraph/deprecated.js +5 -4
  881. package/build-module/paragraph/deprecated.js.map +1 -1
  882. package/build-module/paragraph/edit.js +4 -5
  883. package/build-module/paragraph/edit.js.map +1 -1
  884. package/build-module/paragraph/save.js +5 -4
  885. package/build-module/paragraph/save.js.map +1 -1
  886. package/build-module/pattern/edit.js +8 -33
  887. package/build-module/pattern/edit.js.map +1 -1
  888. package/build-module/pattern/index.js +4 -11
  889. package/build-module/pattern/index.js.map +1 -1
  890. package/build-module/post-author/edit.js +4 -2
  891. package/build-module/post-author/edit.js.map +1 -1
  892. package/build-module/post-author/index.js +0 -1
  893. package/build-module/post-author/index.js.map +1 -1
  894. package/build-module/post-author-biography/edit.js +2 -3
  895. package/build-module/post-author-biography/edit.js.map +1 -1
  896. package/build-module/post-author-biography/index.js +0 -1
  897. package/build-module/post-author-biography/index.js.map +1 -1
  898. package/build-module/post-author-name/edit.js +2 -1
  899. package/build-module/post-author-name/edit.js.map +1 -1
  900. package/build-module/post-author-name/index.js +0 -1
  901. package/build-module/post-author-name/index.js.map +1 -1
  902. package/build-module/post-comment/edit.js +4 -2
  903. package/build-module/post-comment/edit.js.map +1 -1
  904. package/build-module/post-comment/save.js +2 -1
  905. package/build-module/post-comment/save.js.map +1 -1
  906. package/build-module/post-comments-count/edit.js +2 -3
  907. package/build-module/post-comments-count/edit.js.map +1 -1
  908. package/build-module/post-comments-count/index.js +0 -1
  909. package/build-module/post-comments-count/index.js.map +1 -1
  910. package/build-module/post-comments-form/edit.js +2 -1
  911. package/build-module/post-comments-form/edit.js.map +1 -1
  912. package/build-module/post-comments-form/index.js +0 -1
  913. package/build-module/post-comments-form/index.js.map +1 -1
  914. package/build-module/post-comments-link/edit.js +2 -1
  915. package/build-module/post-comments-link/edit.js.map +1 -1
  916. package/build-module/post-comments-link/index.js +0 -1
  917. package/build-module/post-comments-link/index.js.map +1 -1
  918. package/build-module/post-content/edit.js +11 -7
  919. package/build-module/post-content/edit.js.map +1 -1
  920. package/build-module/post-content/index.js +1 -2
  921. package/build-module/post-content/index.js.map +1 -1
  922. package/build-module/post-date/edit.js +2 -1
  923. package/build-module/post-date/edit.js.map +1 -1
  924. package/build-module/post-date/index.js +0 -1
  925. package/build-module/post-date/index.js.map +1 -1
  926. package/build-module/post-excerpt/edit.js +6 -3
  927. package/build-module/post-excerpt/edit.js.map +1 -1
  928. package/build-module/post-excerpt/index.js +0 -1
  929. package/build-module/post-excerpt/index.js.map +1 -1
  930. package/build-module/post-featured-image/edit.js +4 -2
  931. package/build-module/post-featured-image/edit.js.map +1 -1
  932. package/build-module/post-featured-image/index.js +0 -1
  933. package/build-module/post-featured-image/index.js.map +1 -1
  934. package/build-module/post-featured-image/overlay.js +4 -4
  935. package/build-module/post-featured-image/overlay.js.map +1 -1
  936. package/build-module/post-navigation-link/edit.js +2 -1
  937. package/build-module/post-navigation-link/edit.js.map +1 -1
  938. package/build-module/post-navigation-link/index.js +0 -1
  939. package/build-module/post-navigation-link/index.js.map +1 -1
  940. package/build-module/post-template/edit.js +14 -8
  941. package/build-module/post-template/edit.js.map +1 -1
  942. package/build-module/post-template/index.js +1 -2
  943. package/build-module/post-template/index.js.map +1 -1
  944. package/build-module/post-terms/edit.js +4 -8
  945. package/build-module/post-terms/edit.js.map +1 -1
  946. package/build-module/post-terms/hooks.js +9 -5
  947. package/build-module/post-terms/hooks.js.map +1 -1
  948. package/build-module/post-terms/index.js +0 -1
  949. package/build-module/post-terms/index.js.map +1 -1
  950. package/build-module/post-time-to-read/edit.js +2 -1
  951. package/build-module/post-time-to-read/edit.js.map +1 -1
  952. package/build-module/post-time-to-read/init.js +6 -0
  953. package/build-module/post-time-to-read/init.js.map +1 -0
  954. package/build-module/post-title/edit.js +15 -13
  955. package/build-module/post-title/edit.js.map +1 -1
  956. package/build-module/post-title/index.js +0 -1
  957. package/build-module/post-title/index.js.map +1 -1
  958. package/build-module/preformatted/edit.js +4 -5
  959. package/build-module/preformatted/edit.js.map +1 -1
  960. package/build-module/preformatted/edit.native.js +2 -1
  961. package/build-module/preformatted/edit.native.js.map +1 -1
  962. package/build-module/preformatted/save.js +2 -1
  963. package/build-module/preformatted/save.js.map +1 -1
  964. package/build-module/pullquote/deprecated.js +10 -8
  965. package/build-module/pullquote/deprecated.js.map +1 -1
  966. package/build-module/pullquote/edit.js +2 -1
  967. package/build-module/pullquote/edit.js.map +1 -1
  968. package/build-module/pullquote/edit.native.js +2 -1
  969. package/build-module/pullquote/edit.native.js.map +1 -1
  970. package/build-module/pullquote/save.js +5 -4
  971. package/build-module/pullquote/save.js.map +1 -1
  972. package/build-module/query/deprecated.js +15 -9
  973. package/build-module/query/deprecated.js.map +1 -1
  974. package/build-module/query/edit/index.js +2 -3
  975. package/build-module/query/edit/index.js.map +1 -1
  976. package/build-module/query/edit/inspector-controls/index.js +3 -2
  977. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  978. package/build-module/query/edit/query-content.js +19 -6
  979. package/build-module/query/edit/query-content.js.map +1 -1
  980. package/build-module/query/edit/query-placeholder.js +4 -2
  981. package/build-module/query/edit/query-placeholder.js.map +1 -1
  982. package/build-module/query/index.js +1 -2
  983. package/build-module/query/index.js.map +1 -1
  984. package/build-module/query/save.js +2 -1
  985. package/build-module/query/save.js.map +1 -1
  986. package/build-module/query/utils.js +1 -2
  987. package/build-module/query/utils.js.map +1 -1
  988. package/build-module/query-no-results/edit.js +2 -1
  989. package/build-module/query-no-results/edit.js.map +1 -1
  990. package/build-module/query-no-results/index.js +0 -1
  991. package/build-module/query-no-results/index.js.map +1 -1
  992. package/build-module/query-pagination/deprecated.js +2 -1
  993. package/build-module/query-pagination/deprecated.js.map +1 -1
  994. package/build-module/query-pagination/edit.js +2 -1
  995. package/build-module/query-pagination/edit.js.map +1 -1
  996. package/build-module/query-pagination/index.js +1 -2
  997. package/build-module/query-pagination/index.js.map +1 -1
  998. package/build-module/query-pagination-next/edit.js +4 -4
  999. package/build-module/query-pagination-next/edit.js.map +1 -1
  1000. package/build-module/query-pagination-next/index.js +0 -1
  1001. package/build-module/query-pagination-next/index.js.map +1 -1
  1002. package/build-module/query-pagination-numbers/edit.js +2 -1
  1003. package/build-module/query-pagination-numbers/edit.js.map +1 -1
  1004. package/build-module/query-pagination-numbers/index.js +1 -2
  1005. package/build-module/query-pagination-numbers/index.js.map +1 -1
  1006. package/build-module/query-pagination-previous/edit.js +4 -4
  1007. package/build-module/query-pagination-previous/edit.js.map +1 -1
  1008. package/build-module/query-pagination-previous/index.js +0 -1
  1009. package/build-module/query-pagination-previous/index.js.map +1 -1
  1010. package/build-module/query-title/edit.js +8 -10
  1011. package/build-module/query-title/edit.js.map +1 -1
  1012. package/build-module/query-title/index.js +0 -1
  1013. package/build-module/query-title/index.js.map +1 -1
  1014. package/build-module/quote/deprecated.js +4 -3
  1015. package/build-module/quote/deprecated.js.map +1 -1
  1016. package/build-module/quote/edit.js +7 -6
  1017. package/build-module/quote/edit.js.map +1 -1
  1018. package/build-module/quote/save.js +4 -3
  1019. package/build-module/quote/save.js.map +1 -1
  1020. package/build-module/read-more/edit.js +4 -4
  1021. package/build-module/read-more/edit.js.map +1 -1
  1022. package/build-module/read-more/index.js +0 -1
  1023. package/build-module/read-more/index.js.map +1 -1
  1024. package/build-module/rss/edit.js +4 -2
  1025. package/build-module/rss/edit.js.map +1 -1
  1026. package/build-module/rss/index.js +0 -1
  1027. package/build-module/rss/index.js.map +1 -1
  1028. package/build-module/search/edit.js +4 -3
  1029. package/build-module/search/edit.js.map +1 -1
  1030. package/build-module/search/edit.native.js +6 -7
  1031. package/build-module/search/edit.native.js.map +1 -1
  1032. package/build-module/search/index.js +0 -1
  1033. package/build-module/search/index.js.map +1 -1
  1034. package/build-module/separator/deprecated.js +5 -4
  1035. package/build-module/separator/deprecated.js.map +1 -1
  1036. package/build-module/separator/edit.js +5 -4
  1037. package/build-module/separator/edit.js.map +1 -1
  1038. package/build-module/separator/save.js +5 -4
  1039. package/build-module/separator/save.js.map +1 -1
  1040. package/build-module/shortcode/edit.js +4 -3
  1041. package/build-module/shortcode/edit.js.map +1 -1
  1042. package/build-module/site-logo/edit.js +10 -9
  1043. package/build-module/site-logo/edit.js.map +1 -1
  1044. package/build-module/site-logo/index.js +0 -1
  1045. package/build-module/site-logo/index.js.map +1 -1
  1046. package/build-module/site-tagline/edit.js +5 -4
  1047. package/build-module/site-tagline/edit.js.map +1 -1
  1048. package/build-module/site-tagline/icon.js +1 -4
  1049. package/build-module/site-tagline/icon.js.map +1 -1
  1050. package/build-module/site-tagline/index.js +0 -1
  1051. package/build-module/site-tagline/index.js.map +1 -1
  1052. package/build-module/site-title/edit/index.js +9 -10
  1053. package/build-module/site-title/edit/index.js.map +1 -1
  1054. package/build-module/site-title/index.js +0 -1
  1055. package/build-module/site-title/index.js.map +1 -1
  1056. package/build-module/social-link/edit.js +2 -1
  1057. package/build-module/social-link/edit.js.map +1 -1
  1058. package/build-module/social-link/index.js +0 -1
  1059. package/build-module/social-link/index.js.map +1 -1
  1060. package/build-module/social-links/deprecated.js +5 -4
  1061. package/build-module/social-links/deprecated.js.map +1 -1
  1062. package/build-module/social-links/edit.js +6 -5
  1063. package/build-module/social-links/edit.js.map +1 -1
  1064. package/build-module/social-links/index.js +1 -1
  1065. package/build-module/social-links/save.js +2 -1
  1066. package/build-module/social-links/save.js.map +1 -1
  1067. package/build-module/spacer/deprecated.js +8 -7
  1068. package/build-module/spacer/deprecated.js.map +1 -1
  1069. package/build-module/spacer/edit.js +10 -9
  1070. package/build-module/spacer/edit.js.map +1 -1
  1071. package/build-module/spacer/edit.native.js +4 -4
  1072. package/build-module/spacer/edit.native.js.map +1 -1
  1073. package/build-module/spacer/save.js +21 -11
  1074. package/build-module/spacer/save.js.map +1 -1
  1075. package/build-module/spacer/save.native.js +8 -7
  1076. package/build-module/spacer/save.native.js.map +1 -1
  1077. package/build-module/table/deprecated.js +4 -2
  1078. package/build-module/table/deprecated.js.map +1 -1
  1079. package/build-module/table/edit.js +6 -4
  1080. package/build-module/table/edit.js.map +1 -1
  1081. package/build-module/table/save.js +2 -1
  1082. package/build-module/table/save.js.map +1 -1
  1083. package/build-module/table-of-contents/edit.js +4 -2
  1084. package/build-module/table-of-contents/edit.js.map +1 -1
  1085. package/build-module/table-of-contents/save.js +2 -1
  1086. package/build-module/table-of-contents/save.js.map +1 -1
  1087. package/build-module/tag-cloud/edit.js +2 -1
  1088. package/build-module/tag-cloud/edit.js.map +1 -1
  1089. package/build-module/tag-cloud/index.js +0 -1
  1090. package/build-module/tag-cloud/index.js.map +1 -1
  1091. package/build-module/template-part/edit/index.js +8 -4
  1092. package/build-module/template-part/edit/index.js.map +1 -1
  1093. package/build-module/template-part/edit/inner-blocks.js +3 -2
  1094. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  1095. package/build-module/template-part/index.js +0 -1
  1096. package/build-module/template-part/index.js.map +1 -1
  1097. package/build-module/term-description/edit.js +2 -1
  1098. package/build-module/term-description/edit.js.map +1 -1
  1099. package/build-module/term-description/index.js +0 -1
  1100. package/build-module/term-description/index.js.map +1 -1
  1101. package/build-module/text-columns/edit.js +4 -3
  1102. package/build-module/text-columns/edit.js.map +1 -1
  1103. package/build-module/text-columns/save.js +4 -3
  1104. package/build-module/text-columns/save.js.map +1 -1
  1105. package/build-module/utils/interactivity/directives.js +4 -4
  1106. package/build-module/utils/interactivity/directives.js.map +1 -1
  1107. package/build-module/utils/interactivity/index.js +1 -3
  1108. package/build-module/utils/interactivity/index.js.map +1 -1
  1109. package/build-module/utils/migrate-font-family.js +1 -1
  1110. package/build-module/utils/migrate-font-family.js.map +1 -1
  1111. package/build-module/verse/deprecated.js +4 -3
  1112. package/build-module/verse/deprecated.js.map +1 -1
  1113. package/build-module/verse/edit.js +4 -5
  1114. package/build-module/verse/edit.js.map +1 -1
  1115. package/build-module/verse/save.js +4 -3
  1116. package/build-module/verse/save.js.map +1 -1
  1117. package/build-module/video/deprecated.js +2 -1
  1118. package/build-module/video/deprecated.js.map +1 -1
  1119. package/build-module/video/edit.js +4 -2
  1120. package/build-module/video/edit.js.map +1 -1
  1121. package/build-module/video/edit.native.js +8 -7
  1122. package/build-module/video/edit.native.js.map +1 -1
  1123. package/build-module/video/save.js +2 -1
  1124. package/build-module/video/save.js.map +1 -1
  1125. package/build-module/video/tracks.js +4 -4
  1126. package/build-module/video/tracks.js.map +1 -1
  1127. package/build-style/avatar/style-rtl.css +1 -0
  1128. package/build-style/avatar/style.css +1 -0
  1129. package/build-style/editor-rtl.css +0 -17
  1130. package/build-style/editor.css +0 -17
  1131. package/build-style/footnotes/style-rtl.css +106 -0
  1132. package/build-style/footnotes/style.css +106 -0
  1133. package/build-style/image/style-rtl.css +71 -11
  1134. package/build-style/image/style.css +71 -11
  1135. package/build-style/navigation/editor-rtl.css +0 -17
  1136. package/build-style/navigation/editor.css +0 -17
  1137. package/build-style/style-rtl.css +91 -12
  1138. package/build-style/style.css +91 -12
  1139. package/package.json +33 -32
  1140. package/src/archives/block.json +0 -1
  1141. package/src/avatar/block.json +1 -2
  1142. package/src/avatar/style.scss +1 -0
  1143. package/src/block/block.json +1 -1
  1144. package/src/block/edit.js +1 -0
  1145. package/src/block/test/__snapshots__/transforms.native.js.snap +2 -2
  1146. package/src/block/test/edit.native.js +5 -7
  1147. package/src/block/test/transforms.native.js +1 -1
  1148. package/src/buttons/block.json +1 -1
  1149. package/src/buttons/edit.js +2 -2
  1150. package/src/buttons/edit.native.js +7 -6
  1151. package/src/buttons/test/__snapshots__/edit.native.js.snap +6 -0
  1152. package/src/buttons/test/edit.native.js +30 -2
  1153. package/src/calendar/block.json +0 -1
  1154. package/src/categories/block.json +0 -1
  1155. package/src/column/block.json +1 -1
  1156. package/src/columns/block.json +1 -1
  1157. package/src/columns/test/edit.native.js +36 -32
  1158. package/src/comment-author-avatar/block.json +0 -1
  1159. package/src/comment-author-name/block.json +0 -1
  1160. package/src/comment-content/block.json +0 -1
  1161. package/src/comment-date/block.json +0 -1
  1162. package/src/comment-edit-link/block.json +0 -1
  1163. package/src/comment-reply-link/block.json +0 -1
  1164. package/src/comment-template/block.json +0 -1
  1165. package/src/comments/block.json +0 -1
  1166. package/src/comments-pagination/block.json +1 -2
  1167. package/src/comments-pagination-next/block.json +0 -1
  1168. package/src/comments-pagination-numbers/block.json +0 -1
  1169. package/src/comments-pagination-previous/block.json +0 -1
  1170. package/src/comments-title/edit.js +2 -6
  1171. package/src/cover/block.json +1 -1
  1172. package/src/cover/edit/resizable-cover-popover.js +1 -1
  1173. package/src/cover/test/edit.native.js +45 -31
  1174. package/src/cover/transforms.js +1 -1
  1175. package/src/details/block.json +1 -1
  1176. package/src/details/edit.js +12 -9
  1177. package/src/details/init.js +6 -0
  1178. package/src/embed/test/index.native.js +38 -44
  1179. package/src/file/block.json +1 -1
  1180. package/src/file/index.php +18 -1
  1181. package/src/file/view.js +9 -0
  1182. package/src/footnotes/block.json +18 -0
  1183. package/src/footnotes/edit.js +52 -0
  1184. package/src/footnotes/format.js +112 -0
  1185. package/src/footnotes/index.js +29 -0
  1186. package/src/footnotes/index.php +78 -0
  1187. package/src/footnotes/style.scss +18 -0
  1188. package/src/gallery/block.json +1 -1
  1189. package/src/gallery/edit.js +4 -1
  1190. package/src/gallery/gallery.native.js +1 -1
  1191. package/src/gallery/test/__snapshots__/index.native.js.snap +6 -0
  1192. package/src/gallery/test/index.native.js +23 -1
  1193. package/src/group/block.json +1 -1
  1194. package/src/group/deprecated.js +1 -1
  1195. package/src/group/test/edit.native.js +2 -4
  1196. package/src/heading/edit.js +2 -2
  1197. package/src/home-link/block.json +0 -1
  1198. package/src/image/block.json +6 -0
  1199. package/src/image/edit.js +1 -5
  1200. package/src/image/image.js +152 -72
  1201. package/src/image/interactivity.js +155 -13
  1202. package/src/image/save.js +7 -1
  1203. package/src/image/style.scss +79 -9
  1204. package/src/image/test/edit.native.js +3 -13
  1205. package/src/image/utils.js +16 -0
  1206. package/src/index.js +2 -0
  1207. package/src/latest-comments/block.json +0 -1
  1208. package/src/latest-posts/block.json +0 -1
  1209. package/src/latest-posts/edit.js +17 -9
  1210. package/src/latest-posts/index.php +8 -0
  1211. package/src/list/ordered-list-settings.js +20 -2
  1212. package/src/list/test/edit.native.js +5 -0
  1213. package/src/loginout/block.json +0 -1
  1214. package/src/media-text/edit.js +1 -1
  1215. package/src/navigation/block.json +2 -3
  1216. package/src/navigation/constants.js +11 -0
  1217. package/src/navigation/deprecated.js +1 -1
  1218. package/src/navigation/edit/index.js +15 -6
  1219. package/src/navigation/edit/leaf-more-menu.js +1 -2
  1220. package/src/navigation/edit/menu-inspector-controls.js +24 -26
  1221. package/src/navigation/edit/navigation-menu-selector.js +17 -7
  1222. package/src/navigation/edit/unsaved-inner-blocks.js +6 -6
  1223. package/src/navigation/editor.scss +0 -24
  1224. package/src/navigation/index.php +85 -70
  1225. package/src/navigation/test/use-navigation-menu.js +15 -3
  1226. package/src/navigation/use-navigation-menu.js +11 -8
  1227. package/src/navigation/view-modal.js +78 -0
  1228. package/src/navigation/view.js +74 -0
  1229. package/src/page-list/block.json +0 -1
  1230. package/src/paragraph/test/__snapshots__/edit.native.js.snap +39 -0
  1231. package/src/paragraph/test/edit.native.js +3 -3
  1232. package/src/pattern/block.json +1 -5
  1233. package/src/pattern/edit.js +14 -40
  1234. package/src/pattern/index.js +4 -5
  1235. package/src/pattern/index.php +1 -13
  1236. package/src/post-author/block.json +0 -1
  1237. package/src/post-author/edit.js +3 -3
  1238. package/src/post-author-biography/block.json +0 -1
  1239. package/src/post-author-name/block.json +0 -1
  1240. package/src/post-comments-count/block.json +0 -1
  1241. package/src/post-comments-form/block.json +0 -1
  1242. package/src/post-comments-link/block.json +0 -1
  1243. package/src/post-content/block.json +1 -2
  1244. package/src/post-date/block.json +0 -1
  1245. package/src/post-excerpt/block.json +0 -1
  1246. package/src/post-featured-image/block.json +0 -1
  1247. package/src/post-navigation-link/block.json +0 -1
  1248. package/src/post-template/block.json +1 -2
  1249. package/src/post-template/edit.js +4 -1
  1250. package/src/post-template/index.php +5 -0
  1251. package/src/post-terms/block.json +0 -1
  1252. package/src/post-terms/edit.js +8 -7
  1253. package/src/post-terms/hooks.js +3 -3
  1254. package/src/post-time-to-read/init.js +6 -0
  1255. package/src/post-title/block.json +0 -1
  1256. package/src/post-title/edit.js +4 -4
  1257. package/src/post-title/index.php +1 -1
  1258. package/src/preformatted/test/edit.native.js +1 -13
  1259. package/src/query/block.json +1 -2
  1260. package/src/query/deprecated.js +7 -5
  1261. package/src/query/edit/inspector-controls/index.js +1 -1
  1262. package/src/query/edit/query-content.js +13 -4
  1263. package/src/query-no-results/block.json +0 -1
  1264. package/src/query-pagination/block.json +1 -2
  1265. package/src/query-pagination-next/block.json +0 -1
  1266. package/src/query-pagination-numbers/block.json +1 -2
  1267. package/src/query-pagination-previous/block.json +0 -1
  1268. package/src/query-title/block.json +0 -1
  1269. package/src/query-title/edit.js +2 -6
  1270. package/src/read-more/block.json +0 -1
  1271. package/src/rss/block.json +0 -1
  1272. package/src/search/block.json +0 -1
  1273. package/src/search/edit.js +3 -3
  1274. package/src/site-logo/block.json +0 -1
  1275. package/src/site-tagline/block.json +0 -1
  1276. package/src/site-tagline/icon.js +1 -2
  1277. package/src/site-title/block.json +0 -1
  1278. package/src/site-title/edit/index.js +5 -6
  1279. package/src/social-link/block.json +0 -1
  1280. package/src/social-links/block.json +1 -1
  1281. package/src/spacer/save.js +7 -2
  1282. package/src/spacer/test/index.native.js +33 -29
  1283. package/src/style.scss +1 -0
  1284. package/src/tag-cloud/block.json +0 -1
  1285. package/src/template-part/block.json +0 -1
  1286. package/src/template-part/edit/inner-blocks.js +1 -1
  1287. package/src/template-part/index.php +18 -11
  1288. package/src/term-description/block.json +0 -1
  1289. package/src/utils/interactivity/index.js +0 -2
  1290. package/src/utils/migrate-font-family.js +1 -1
  1291. package/build/heading/heading-level-dropdown.js +0 -81
  1292. package/build/heading/heading-level-dropdown.js.map +0 -1
  1293. package/build/heading/heading-level-dropdown.native.js +0 -72
  1294. package/build/heading/heading-level-dropdown.native.js.map +0 -1
  1295. package/build/pattern/v1/edit.js +0 -56
  1296. package/build/pattern/v1/edit.js.map +0 -1
  1297. package/build/private-apis.js.map +0 -1
  1298. package/build/site-title/edit/level-icon.js +0 -40
  1299. package/build/site-title/edit/level-icon.js.map +0 -1
  1300. package/build/site-title/edit/level-toolbar.js +0 -51
  1301. package/build/site-title/edit/level-toolbar.js.map +0 -1
  1302. package/build-module/heading/heading-level-dropdown.js +0 -69
  1303. package/build-module/heading/heading-level-dropdown.js.map +0 -1
  1304. package/build-module/heading/heading-level-dropdown.native.js +0 -60
  1305. package/build-module/heading/heading-level-dropdown.native.js.map +0 -1
  1306. package/build-module/pattern/v1/edit.js +0 -47
  1307. package/build-module/pattern/v1/edit.js.map +0 -1
  1308. package/build-module/private-apis.js.map +0 -1
  1309. package/build-module/site-title/edit/level-icon.js +0 -31
  1310. package/build-module/site-title/edit/level-icon.js.map +0 -1
  1311. package/build-module/site-title/edit/level-toolbar.js +0 -39
  1312. package/build-module/site-title/edit/level-toolbar.js.map +0 -1
  1313. package/src/heading/heading-level-dropdown.js +0 -69
  1314. package/src/heading/heading-level-dropdown.native.js +0 -63
  1315. package/src/pattern/v1/edit.js +0 -57
  1316. package/src/site-title/edit/level-icon.js +0 -28
  1317. package/src/site-title/edit/level-toolbar.js +0 -34
  1318. /package/src/{private-apis.js → lock-unlock.js} +0 -0
@@ -62,7 +62,8 @@ function TSection({
62
62
  ...props
63
63
  }) {
64
64
  const TagName = `t${name}`;
65
- return (0, _element.createElement)(TagName, props);
65
+ return (0, _element.createElement)(TagName, { ...props
66
+ });
66
67
  }
67
68
 
68
69
  function TableEdit({
@@ -405,9 +406,10 @@ function TableEdit({
405
406
  placeholder: placeholder[name]
406
407
  }))))));
407
408
  const isEmpty = !sections.length;
408
- return (0, _element.createElement)("figure", (0, _blockEditor.useBlockProps)({
409
- ref: tableRef
410
- }), !isEmpty && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockControls, {
409
+ return (0, _element.createElement)("figure", { ...(0, _blockEditor.useBlockProps)({
410
+ ref: tableRef
411
+ })
412
+ }, !isEmpty && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockControls, {
411
413
  group: "block"
412
414
  }, (0, _element.createElement)(_blockEditor.AlignmentControl, {
413
415
  label: (0, _i18n.__)('Change column alignment'),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/table/edit.js"],"names":["ALIGNMENT_CONTROLS","icon","alignLeft","title","align","alignCenter","alignRight","cellAriaLabel","head","body","foot","placeholder","TSection","name","props","TagName","TableEdit","attributes","setAttributes","insertBlocksAfter","isSelected","hasFixedLayout","caption","initialRowCount","setInitialRowCount","initialColumnCount","setInitialColumnCount","selectedCell","setSelectedCell","colorProps","borderProps","tableRef","hasTableCreated","setHasTableCreated","onChangeInitialColumnCount","count","onChangeInitialRowCount","onCreateTable","event","preventDefault","rowCount","parseInt","columnCount","onChangeFixedLayout","onChange","content","cellAttributes","onChangeColumnAlignment","columnSelection","type","columnIndex","newAttributes","getCellAlignment","onToggleHeaderSection","onToggleFooterSection","onInsertRow","delta","sectionName","rowIndex","newRowIndex","onInsertRowBefore","onInsertRowAfter","onDeleteRow","onInsertColumn","newColumnIndex","onInsertColumnBefore","onInsertColumnAfter","onDeleteColumn","current","querySelector","focus","sections","filter","tableControls","tableRowBefore","isDisabled","onClick","tableRowAfter","tableRowDelete","tableColumnBefore","tableColumnAfter","tableColumnDelete","renderedSections","map","cells","tag","CellTag","scope","colspan","rowspan","undefined","isEmpty","length","ref","nextAlign","table","className","style","border","value"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AAWA;;AACA;;AASA;;AAaA;;AAKA;;AAhDA;AACA;AACA;;AAGA;AACA;AACA;;AAsCA;AACA;AACA;AAaA,MAAMA,kBAAkB,GAAG,CAC1B;AACCC,EAAAA,IAAI,EAAEC,gBADP;AAECC,EAAAA,KAAK,EAAE,cAAI,mBAAJ,CAFR;AAGCC,EAAAA,KAAK,EAAE;AAHR,CAD0B,EAM1B;AACCH,EAAAA,IAAI,EAAEI,kBADP;AAECF,EAAAA,KAAK,EAAE,cAAI,qBAAJ,CAFR;AAGCC,EAAAA,KAAK,EAAE;AAHR,CAN0B,EAW1B;AACCH,EAAAA,IAAI,EAAEK,iBADP;AAECH,EAAAA,KAAK,EAAE,cAAI,oBAAJ,CAFR;AAGCC,EAAAA,KAAK,EAAE;AAHR,CAX0B,CAA3B;AAkBA,MAAMG,aAAa,GAAG;AACrBC,EAAAA,IAAI,EAAE,cAAI,kBAAJ,CADe;AAErBC,EAAAA,IAAI,EAAE,cAAI,gBAAJ,CAFe;AAGrBC,EAAAA,IAAI,EAAE,cAAI,kBAAJ;AAHe,CAAtB;AAMA,MAAMC,WAAW,GAAG;AACnBH,EAAAA,IAAI,EAAE,cAAI,cAAJ,CADa;AAEnBE,EAAAA,IAAI,EAAE,cAAI,cAAJ;AAFa,CAApB;;AAKA,SAASE,QAAT,CAAmB;AAAEC,EAAAA,IAAF;AAAQ,KAAGC;AAAX,CAAnB,EAAwC;AACvC,QAAMC,OAAO,GAAI,IAAIF,IAAM,EAA3B;AACA,SAAO,4BAAC,OAAD,EAAcC,KAAd,CAAP;AACA;;AAED,SAASE,SAAT,CAAoB;AACnBC,EAAAA,UADmB;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EAAC;AAPX,IAJD,EAaC,4BAAC,uBAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,KAAK,EAAG,cAAI,WAAJ,CAHT;AAIC,IAAA,KAAK,EAAGX,eAJT;AAKC,IAAA,QAAQ,EAAGa,uBALZ;AAMC,IAAA,GAAG,EAAC,GANL;AAOC,IAAA,SAAS,EAAC;AAPX,IAbD,EAsBC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,kCADX;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,IAAI,EAAC;AAHN,KAKG,cAAI,cAAJ,CALH,CAtBD,CALD,CA7FF,CADD;AAqIA;;eAEcpB,S","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tRichText,\n\tBlockIcon,\n\tAlignmentControl,\n\tuseBlockProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tPanelBody,\n\tPlaceholder,\n\tTextControl,\n\tToggleControl,\n\tToolbarDropdownMenu,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n} from '@wordpress/components';\nimport {\n\talignLeft,\n\talignRight,\n\talignCenter,\n\tblockTable as icon,\n\ttableColumnAfter,\n\ttableColumnBefore,\n\ttableColumnDelete,\n\ttableRowAfter,\n\ttableRowBefore,\n\ttableRowDelete,\n\ttable,\n} from '@wordpress/icons';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcreateTable,\n\tupdateSelectedCell,\n\tgetCellAttribute,\n\tinsertRow,\n\tdeleteRow,\n\tinsertColumn,\n\tdeleteColumn,\n\ttoggleSection,\n\tisEmptyTableSection,\n} from './state';\n\nconst ALIGNMENT_CONTROLS = [\n\t{\n\t\ticon: alignLeft,\n\t\ttitle: __( 'Align column left' ),\n\t\talign: 'left',\n\t},\n\t{\n\t\ticon: alignCenter,\n\t\ttitle: __( 'Align column center' ),\n\t\talign: 'center',\n\t},\n\t{\n\t\ticon: alignRight,\n\t\ttitle: __( 'Align column right' ),\n\t\talign: 'right',\n\t},\n];\n\nconst cellAriaLabel = {\n\thead: __( 'Header cell text' ),\n\tbody: __( 'Body cell text' ),\n\tfoot: __( 'Footer cell text' ),\n};\n\nconst placeholder = {\n\thead: __( 'Header label' ),\n\tfoot: __( 'Footer label' ),\n};\n\nfunction TSection( { name, ...props } ) {\n\tconst TagName = `t${ name }`;\n\treturn <TagName { ...props } />;\n}\n\nfunction TableEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tisSelected,\n} ) {\n\tconst { hasFixedLayout, caption, head, foot } = attributes;\n\tconst [ initialRowCount, setInitialRowCount ] = useState( 2 );\n\tconst [ initialColumnCount, setInitialColumnCount ] = useState( 2 );\n\tconst [ selectedCell, setSelectedCell ] = useState();\n\n\tconst colorProps = useColorProps( attributes );\n\tconst borderProps = useBorderProps( attributes );\n\n\tconst tableRef = useRef();\n\tconst [ hasTableCreated, setHasTableCreated ] = useState( false );\n\n\t/**\n\t * Updates the initial column count used for table creation.\n\t *\n\t * @param {number} count New initial column count.\n\t */\n\tfunction onChangeInitialColumnCount( count ) {\n\t\tsetInitialColumnCount( count );\n\t}\n\n\t/**\n\t * Updates the initial row count used for table creation.\n\t *\n\t * @param {number} count New initial row count.\n\t */\n\tfunction onChangeInitialRowCount( count ) {\n\t\tsetInitialRowCount( count );\n\t}\n\n\t/**\n\t * Creates a table based on dimensions in local state.\n\t *\n\t * @param {Object} event Form submit event.\n\t */\n\tfunction onCreateTable( event ) {\n\t\tevent.preventDefault();\n\n\t\tsetAttributes(\n\t\t\tcreateTable( {\n\t\t\t\trowCount: parseInt( initialRowCount, 10 ) || 2,\n\t\t\t\tcolumnCount: parseInt( initialColumnCount, 10 ) || 2,\n\t\t\t} )\n\t\t);\n\t\tsetHasTableCreated( true );\n\t}\n\n\t/**\n\t * Toggles whether the table has a fixed layout or not.\n\t */\n\tfunction onChangeFixedLayout() {\n\t\tsetAttributes( { hasFixedLayout: ! hasFixedLayout } );\n\t}\n\n\t/**\n\t * Changes the content of the currently selected cell.\n\t *\n\t * @param {Array} content A RichText content value.\n\t */\n\tfunction onChange( content ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes(\n\t\t\tupdateSelectedCell(\n\t\t\t\tattributes,\n\t\t\t\tselectedCell,\n\t\t\t\t( cellAttributes ) => ( {\n\t\t\t\t\t...cellAttributes,\n\t\t\t\t\tcontent,\n\t\t\t\t} )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Align text within the a column.\n\t *\n\t * @param {string} align The new alignment to apply to the column.\n\t */\n\tfunction onChangeColumnAlignment( align ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Convert the cell selection to a column selection so that alignment\n\t\t// is applied to the entire column.\n\t\tconst columnSelection = {\n\t\t\ttype: 'column',\n\t\t\tcolumnIndex: selectedCell.columnIndex,\n\t\t};\n\n\t\tconst newAttributes = updateSelectedCell(\n\t\t\tattributes,\n\t\t\tcolumnSelection,\n\t\t\t( cellAttributes ) => ( {\n\t\t\t\t...cellAttributes,\n\t\t\t\talign,\n\t\t\t} )\n\t\t);\n\t\tsetAttributes( newAttributes );\n\t}\n\n\t/**\n\t * Get the alignment of the currently selected cell.\n\t *\n\t * @return {string | undefined} The new alignment to apply to the column.\n\t */\n\tfunction getCellAlignment() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn getCellAttribute( attributes, selectedCell, 'align' );\n\t}\n\n\t/**\n\t * Add or remove a `head` table section.\n\t */\n\tfunction onToggleHeaderSection() {\n\t\tsetAttributes( toggleSection( attributes, 'head' ) );\n\t}\n\n\t/**\n\t * Add or remove a `foot` table section.\n\t */\n\tfunction onToggleFooterSection() {\n\t\tsetAttributes( toggleSection( attributes, 'foot' ) );\n\t}\n\n\t/**\n\t * Inserts a row at the currently selected row index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected row index at which to insert.\n\t */\n\tfunction onInsertRow( delta ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\t\tconst newRowIndex = rowIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertRow( attributes, {\n\t\t\t\tsectionName,\n\t\t\t\trowIndex: newRowIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new row.\n\t\tsetSelectedCell( {\n\t\t\tsectionName,\n\t\t\trowIndex: newRowIndex,\n\t\t\tcolumnIndex: 0,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a row before the currently selected row.\n\t */\n\tfunction onInsertRowBefore() {\n\t\tonInsertRow( 0 );\n\t}\n\n\t/**\n\t * Inserts a row after the currently selected row.\n\t */\n\tfunction onInsertRowAfter() {\n\t\tonInsertRow( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected row.\n\t */\n\tfunction onDeleteRow() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes( deleteRow( attributes, { sectionName, rowIndex } ) );\n\t}\n\n\t/**\n\t * Inserts a column at the currently selected column index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected column index at which to insert.\n\t */\n\tfunction onInsertColumn( delta = 0 ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { columnIndex } = selectedCell;\n\t\tconst newColumnIndex = columnIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertColumn( attributes, {\n\t\t\t\tcolumnIndex: newColumnIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new column.\n\t\tsetSelectedCell( {\n\t\t\trowIndex: 0,\n\t\t\tcolumnIndex: newColumnIndex,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a column before the currently selected column.\n\t */\n\tfunction onInsertColumnBefore() {\n\t\tonInsertColumn( 0 );\n\t}\n\n\t/**\n\t * Inserts a column after the currently selected column.\n\t */\n\tfunction onInsertColumnAfter() {\n\t\tonInsertColumn( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected column.\n\t */\n\tfunction onDeleteColumn() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, columnIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes(\n\t\t\tdeleteColumn( attributes, { sectionName, columnIndex } )\n\t\t);\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetSelectedCell();\n\t\t}\n\t}, [ isSelected ] );\n\n\tuseEffect( () => {\n\t\tif ( hasTableCreated ) {\n\t\t\ttableRef?.current\n\t\t\t\t?.querySelector( 'td[contentEditable=\"true\"]' )\n\t\t\t\t?.focus();\n\t\t\tsetHasTableCreated( false );\n\t\t}\n\t}, [ hasTableCreated ] );\n\n\tconst sections = [ 'head', 'body', 'foot' ].filter(\n\t\t( name ) => ! isEmptyTableSection( attributes[ name ] )\n\t);\n\n\tconst tableControls = [\n\t\t{\n\t\t\ticon: tableRowBefore,\n\t\t\ttitle: __( 'Insert row before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowAfter,\n\t\t\ttitle: __( 'Insert row after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowDelete,\n\t\t\ttitle: __( 'Delete row' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteRow,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnBefore,\n\t\t\ttitle: __( 'Insert column before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnAfter,\n\t\t\ttitle: __( 'Insert column after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnDelete,\n\t\t\ttitle: __( 'Delete column' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteColumn,\n\t\t},\n\t];\n\n\tconst renderedSections = sections.map( ( name ) => (\n\t\t<TSection name={ name } key={ name }>\n\t\t\t{ attributes[ name ].map( ( { cells }, rowIndex ) => (\n\t\t\t\t<tr key={ rowIndex }>\n\t\t\t\t\t{ cells.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\t\ttag: CellTag,\n\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\talign,\n\t\t\t\t\t\t\t\tcolspan,\n\t\t\t\t\t\t\t\trowspan,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcolumnIndex\n\t\t\t\t\t\t) => (\n\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\ttagName={ CellTag }\n\t\t\t\t\t\t\t\tkey={ columnIndex }\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'wp-block-table__cell-content'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tscope={ CellTag === 'th' ? scope : undefined }\n\t\t\t\t\t\t\t\tcolSpan={ colspan }\n\t\t\t\t\t\t\t\trowSpan={ rowspan }\n\t\t\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ () => {\n\t\t\t\t\t\t\t\t\tsetSelectedCell( {\n\t\t\t\t\t\t\t\t\t\tsectionName: name,\n\t\t\t\t\t\t\t\t\t\trowIndex,\n\t\t\t\t\t\t\t\t\t\tcolumnIndex,\n\t\t\t\t\t\t\t\t\t\ttype: 'cell',\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\taria-label={ cellAriaLabel[ name ] }\n\t\t\t\t\t\t\t\tplaceholder={ placeholder[ name ] }\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</tr>\n\t\t\t) ) }\n\t\t</TSection>\n\t) );\n\n\tconst isEmpty = ! sections.length;\n\n\treturn (\n\t\t<figure { ...useBlockProps( { ref: tableRef } ) }>\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\t\tlabel={ __( 'Change column alignment' ) }\n\t\t\t\t\t\t\talignmentControls={ ALIGNMENT_CONTROLS }\n\t\t\t\t\t\t\tvalue={ getCellAlignment() }\n\t\t\t\t\t\t\tonChange={ ( nextAlign ) =>\n\t\t\t\t\t\t\t\tonChangeColumnAlignment( nextAlign )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\t\thasArrowIndicator\n\t\t\t\t\t\t\ticon={ table }\n\t\t\t\t\t\t\tlabel={ __( 'Edit table' ) }\n\t\t\t\t\t\t\tcontrols={ tableControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\t\tclassName=\"blocks-table-settings\"\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Fixed width table cells' ) }\n\t\t\t\t\t\tchecked={ !! hasFixedLayout }\n\t\t\t\t\t\tonChange={ onChangeFixedLayout }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Header section' ) }\n\t\t\t\t\t\t\t\tchecked={ !! ( head && head.length ) }\n\t\t\t\t\t\t\t\tonChange={ onToggleHeaderSection }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Footer section' ) }\n\t\t\t\t\t\t\t\tchecked={ !! ( foot && foot.length ) }\n\t\t\t\t\t\t\t\tonChange={ onToggleFooterSection }\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</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<table\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\tcolorProps.className,\n\t\t\t\t\t\tborderProps.className,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-fixed-layout': hasFixedLayout,\n\t\t\t\t\t\t\t// This is required in the editor only to overcome\n\t\t\t\t\t\t\t// the fact the editor rewrites individual border\n\t\t\t\t\t\t\t// widths into a shorthand format.\n\t\t\t\t\t\t\t'has-individual-borders': hasSplitBorders(\n\t\t\t\t\t\t\t\tattributes?.style?.border\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\tstyle={ { ...colorProps.style, ...borderProps.style } }\n\t\t\t\t>\n\t\t\t\t\t{ renderedSections }\n\t\t\t\t</table>\n\t\t\t) }\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"caption\"\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tclassName={ __experimentalGetElementClassName( 'caption' ) }\n\t\t\t\t\taria-label={ __( 'Table caption text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add caption' ) }\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { caption: value } )\n\t\t\t\t\t}\n\t\t\t\t\t// Deselect the selected table cell when the caption is focused.\n\t\t\t\t\tonFocus={ () => setSelectedCell() }\n\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isEmpty && (\n\t\t\t\t<Placeholder\n\t\t\t\t\tlabel={ __( 'Table' ) }\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\t\t\tinstructions={ __( 'Insert a table for sharing data.' ) }\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tclassName=\"blocks-table__placeholder-form\"\n\t\t\t\t\t\tonSubmit={ onCreateTable }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Column count' ) }\n\t\t\t\t\t\t\tvalue={ initialColumnCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialColumnCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Row count' ) }\n\t\t\t\t\t\t\tvalue={ initialRowCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialRowCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-button\"\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create Table' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n\nexport default TableEdit;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/table/edit.js"],"names":["ALIGNMENT_CONTROLS","icon","alignLeft","title","align","alignCenter","alignRight","cellAriaLabel","head","body","foot","placeholder","TSection","name","props","TagName","TableEdit","attributes","setAttributes","insertBlocksAfter","isSelected","hasFixedLayout","caption","initialRowCount","setInitialRowCount","initialColumnCount","setInitialColumnCount","selectedCell","setSelectedCell","colorProps","borderProps","tableRef","hasTableCreated","setHasTableCreated","onChangeInitialColumnCount","count","onChangeInitialRowCount","onCreateTable","event","preventDefault","rowCount","parseInt","columnCount","onChangeFixedLayout","onChange","content","cellAttributes","onChangeColumnAlignment","columnSelection","type","columnIndex","newAttributes","getCellAlignment","onToggleHeaderSection","onToggleFooterSection","onInsertRow","delta","sectionName","rowIndex","newRowIndex","onInsertRowBefore","onInsertRowAfter","onDeleteRow","onInsertColumn","newColumnIndex","onInsertColumnBefore","onInsertColumnAfter","onDeleteColumn","current","querySelector","focus","sections","filter","tableControls","tableRowBefore","isDisabled","onClick","tableRowAfter","tableRowDelete","tableColumnBefore","tableColumnAfter","tableColumnDelete","renderedSections","map","cells","tag","CellTag","scope","colspan","rowspan","undefined","isEmpty","length","ref","nextAlign","table","className","style","border","value"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AAWA;;AACA;;AASA;;AAaA;;AAKA;;AAhDA;AACA;AACA;;AAGA;AACA;AACA;;AAsCA;AACA;AACA;AAaA,MAAMA,kBAAkB,GAAG,CAC1B;AACCC,EAAAA,IAAI,EAAEC,gBADP;AAECC,EAAAA,KAAK,EAAE,cAAI,mBAAJ,CAFR;AAGCC,EAAAA,KAAK,EAAE;AAHR,CAD0B,EAM1B;AACCH,EAAAA,IAAI,EAAEI,kBADP;AAECF,EAAAA,KAAK,EAAE,cAAI,qBAAJ,CAFR;AAGCC,EAAAA,KAAK,EAAE;AAHR,CAN0B,EAW1B;AACCH,EAAAA,IAAI,EAAEK,iBADP;AAECH,EAAAA,KAAK,EAAE,cAAI,oBAAJ,CAFR;AAGCC,EAAAA,KAAK,EAAE;AAHR,CAX0B,CAA3B;AAkBA,MAAMG,aAAa,GAAG;AACrBC,EAAAA,IAAI,EAAE,cAAI,kBAAJ,CADe;AAErBC,EAAAA,IAAI,EAAE,cAAI,gBAAJ,CAFe;AAGrBC,EAAAA,IAAI,EAAE,cAAI,kBAAJ;AAHe,CAAtB;AAMA,MAAMC,WAAW,GAAG;AACnBH,EAAAA,IAAI,EAAE,cAAI,cAAJ,CADa;AAEnBE,EAAAA,IAAI,EAAE,cAAI,cAAJ;AAFa,CAApB;;AAKA,SAASE,QAAT,CAAmB;AAAEC,EAAAA,IAAF;AAAQ,KAAGC;AAAX,CAAnB,EAAwC;AACvC,QAAMC,OAAO,GAAI,IAAIF,IAAM,EAA3B;AACA,SAAO,4BAAC,OAAD,OAAcC;AAAd,IAAP;AACA;;AAED,SAASE,SAAT,CAAoB;AACnBC,EAAAA,UADmB;AAEnBC,EAAAA,aAFmB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C,4BAAC,uBAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,KAAK,EAAG,cAAI,WAAJ,CAHT;AAIC,IAAA,KAAK,EAAGX,eAJT;AAKC,IAAA,QAAQ,EAAGa,uBALZ;AAMC,IAAA,GAAG,EAAC,GANL;AAOC,IAAA,SAAS,EAAC;AAPX,IAbD,EAsBC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,kCADX;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,IAAI,EAAC;AAHN,KAKG,cAAI,cAAJ,CALH,CAtBD,CALD,CA7FF,CADD;AAqIA;;eAEcpB,S","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tRichText,\n\tBlockIcon,\n\tAlignmentControl,\n\tuseBlockProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tPanelBody,\n\tPlaceholder,\n\tTextControl,\n\tToggleControl,\n\tToolbarDropdownMenu,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n} from '@wordpress/components';\nimport {\n\talignLeft,\n\talignRight,\n\talignCenter,\n\tblockTable as icon,\n\ttableColumnAfter,\n\ttableColumnBefore,\n\ttableColumnDelete,\n\ttableRowAfter,\n\ttableRowBefore,\n\ttableRowDelete,\n\ttable,\n} from '@wordpress/icons';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcreateTable,\n\tupdateSelectedCell,\n\tgetCellAttribute,\n\tinsertRow,\n\tdeleteRow,\n\tinsertColumn,\n\tdeleteColumn,\n\ttoggleSection,\n\tisEmptyTableSection,\n} from './state';\n\nconst ALIGNMENT_CONTROLS = [\n\t{\n\t\ticon: alignLeft,\n\t\ttitle: __( 'Align column left' ),\n\t\talign: 'left',\n\t},\n\t{\n\t\ticon: alignCenter,\n\t\ttitle: __( 'Align column center' ),\n\t\talign: 'center',\n\t},\n\t{\n\t\ticon: alignRight,\n\t\ttitle: __( 'Align column right' ),\n\t\talign: 'right',\n\t},\n];\n\nconst cellAriaLabel = {\n\thead: __( 'Header cell text' ),\n\tbody: __( 'Body cell text' ),\n\tfoot: __( 'Footer cell text' ),\n};\n\nconst placeholder = {\n\thead: __( 'Header label' ),\n\tfoot: __( 'Footer label' ),\n};\n\nfunction TSection( { name, ...props } ) {\n\tconst TagName = `t${ name }`;\n\treturn <TagName { ...props } />;\n}\n\nfunction TableEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tisSelected,\n} ) {\n\tconst { hasFixedLayout, caption, head, foot } = attributes;\n\tconst [ initialRowCount, setInitialRowCount ] = useState( 2 );\n\tconst [ initialColumnCount, setInitialColumnCount ] = useState( 2 );\n\tconst [ selectedCell, setSelectedCell ] = useState();\n\n\tconst colorProps = useColorProps( attributes );\n\tconst borderProps = useBorderProps( attributes );\n\n\tconst tableRef = useRef();\n\tconst [ hasTableCreated, setHasTableCreated ] = useState( false );\n\n\t/**\n\t * Updates the initial column count used for table creation.\n\t *\n\t * @param {number} count New initial column count.\n\t */\n\tfunction onChangeInitialColumnCount( count ) {\n\t\tsetInitialColumnCount( count );\n\t}\n\n\t/**\n\t * Updates the initial row count used for table creation.\n\t *\n\t * @param {number} count New initial row count.\n\t */\n\tfunction onChangeInitialRowCount( count ) {\n\t\tsetInitialRowCount( count );\n\t}\n\n\t/**\n\t * Creates a table based on dimensions in local state.\n\t *\n\t * @param {Object} event Form submit event.\n\t */\n\tfunction onCreateTable( event ) {\n\t\tevent.preventDefault();\n\n\t\tsetAttributes(\n\t\t\tcreateTable( {\n\t\t\t\trowCount: parseInt( initialRowCount, 10 ) || 2,\n\t\t\t\tcolumnCount: parseInt( initialColumnCount, 10 ) || 2,\n\t\t\t} )\n\t\t);\n\t\tsetHasTableCreated( true );\n\t}\n\n\t/**\n\t * Toggles whether the table has a fixed layout or not.\n\t */\n\tfunction onChangeFixedLayout() {\n\t\tsetAttributes( { hasFixedLayout: ! hasFixedLayout } );\n\t}\n\n\t/**\n\t * Changes the content of the currently selected cell.\n\t *\n\t * @param {Array} content A RichText content value.\n\t */\n\tfunction onChange( content ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes(\n\t\t\tupdateSelectedCell(\n\t\t\t\tattributes,\n\t\t\t\tselectedCell,\n\t\t\t\t( cellAttributes ) => ( {\n\t\t\t\t\t...cellAttributes,\n\t\t\t\t\tcontent,\n\t\t\t\t} )\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Align text within the a column.\n\t *\n\t * @param {string} align The new alignment to apply to the column.\n\t */\n\tfunction onChangeColumnAlignment( align ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Convert the cell selection to a column selection so that alignment\n\t\t// is applied to the entire column.\n\t\tconst columnSelection = {\n\t\t\ttype: 'column',\n\t\t\tcolumnIndex: selectedCell.columnIndex,\n\t\t};\n\n\t\tconst newAttributes = updateSelectedCell(\n\t\t\tattributes,\n\t\t\tcolumnSelection,\n\t\t\t( cellAttributes ) => ( {\n\t\t\t\t...cellAttributes,\n\t\t\t\talign,\n\t\t\t} )\n\t\t);\n\t\tsetAttributes( newAttributes );\n\t}\n\n\t/**\n\t * Get the alignment of the currently selected cell.\n\t *\n\t * @return {string | undefined} The new alignment to apply to the column.\n\t */\n\tfunction getCellAlignment() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn getCellAttribute( attributes, selectedCell, 'align' );\n\t}\n\n\t/**\n\t * Add or remove a `head` table section.\n\t */\n\tfunction onToggleHeaderSection() {\n\t\tsetAttributes( toggleSection( attributes, 'head' ) );\n\t}\n\n\t/**\n\t * Add or remove a `foot` table section.\n\t */\n\tfunction onToggleFooterSection() {\n\t\tsetAttributes( toggleSection( attributes, 'foot' ) );\n\t}\n\n\t/**\n\t * Inserts a row at the currently selected row index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected row index at which to insert.\n\t */\n\tfunction onInsertRow( delta ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\t\tconst newRowIndex = rowIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertRow( attributes, {\n\t\t\t\tsectionName,\n\t\t\t\trowIndex: newRowIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new row.\n\t\tsetSelectedCell( {\n\t\t\tsectionName,\n\t\t\trowIndex: newRowIndex,\n\t\t\tcolumnIndex: 0,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a row before the currently selected row.\n\t */\n\tfunction onInsertRowBefore() {\n\t\tonInsertRow( 0 );\n\t}\n\n\t/**\n\t * Inserts a row after the currently selected row.\n\t */\n\tfunction onInsertRowAfter() {\n\t\tonInsertRow( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected row.\n\t */\n\tfunction onDeleteRow() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, rowIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes( deleteRow( attributes, { sectionName, rowIndex } ) );\n\t}\n\n\t/**\n\t * Inserts a column at the currently selected column index, plus `delta`.\n\t *\n\t * @param {number} delta Offset for selected column index at which to insert.\n\t */\n\tfunction onInsertColumn( delta = 0 ) {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { columnIndex } = selectedCell;\n\t\tconst newColumnIndex = columnIndex + delta;\n\n\t\tsetAttributes(\n\t\t\tinsertColumn( attributes, {\n\t\t\t\tcolumnIndex: newColumnIndex,\n\t\t\t} )\n\t\t);\n\t\t// Select the first cell of the new column.\n\t\tsetSelectedCell( {\n\t\t\trowIndex: 0,\n\t\t\tcolumnIndex: newColumnIndex,\n\t\t\ttype: 'cell',\n\t\t} );\n\t}\n\n\t/**\n\t * Inserts a column before the currently selected column.\n\t */\n\tfunction onInsertColumnBefore() {\n\t\tonInsertColumn( 0 );\n\t}\n\n\t/**\n\t * Inserts a column after the currently selected column.\n\t */\n\tfunction onInsertColumnAfter() {\n\t\tonInsertColumn( 1 );\n\t}\n\n\t/**\n\t * Deletes the currently selected column.\n\t */\n\tfunction onDeleteColumn() {\n\t\tif ( ! selectedCell ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { sectionName, columnIndex } = selectedCell;\n\n\t\tsetSelectedCell();\n\t\tsetAttributes(\n\t\t\tdeleteColumn( attributes, { sectionName, columnIndex } )\n\t\t);\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetSelectedCell();\n\t\t}\n\t}, [ isSelected ] );\n\n\tuseEffect( () => {\n\t\tif ( hasTableCreated ) {\n\t\t\ttableRef?.current\n\t\t\t\t?.querySelector( 'td[contentEditable=\"true\"]' )\n\t\t\t\t?.focus();\n\t\t\tsetHasTableCreated( false );\n\t\t}\n\t}, [ hasTableCreated ] );\n\n\tconst sections = [ 'head', 'body', 'foot' ].filter(\n\t\t( name ) => ! isEmptyTableSection( attributes[ name ] )\n\t);\n\n\tconst tableControls = [\n\t\t{\n\t\t\ticon: tableRowBefore,\n\t\t\ttitle: __( 'Insert row before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowAfter,\n\t\t\ttitle: __( 'Insert row after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertRowAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableRowDelete,\n\t\t\ttitle: __( 'Delete row' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteRow,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnBefore,\n\t\t\ttitle: __( 'Insert column before' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnBefore,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnAfter,\n\t\t\ttitle: __( 'Insert column after' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onInsertColumnAfter,\n\t\t},\n\t\t{\n\t\t\ticon: tableColumnDelete,\n\t\t\ttitle: __( 'Delete column' ),\n\t\t\tisDisabled: ! selectedCell,\n\t\t\tonClick: onDeleteColumn,\n\t\t},\n\t];\n\n\tconst renderedSections = sections.map( ( name ) => (\n\t\t<TSection name={ name } key={ name }>\n\t\t\t{ attributes[ name ].map( ( { cells }, rowIndex ) => (\n\t\t\t\t<tr key={ rowIndex }>\n\t\t\t\t\t{ cells.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\t\ttag: CellTag,\n\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\talign,\n\t\t\t\t\t\t\t\tcolspan,\n\t\t\t\t\t\t\t\trowspan,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcolumnIndex\n\t\t\t\t\t\t) => (\n\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\ttagName={ CellTag }\n\t\t\t\t\t\t\t\tkey={ columnIndex }\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'wp-block-table__cell-content'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tscope={ CellTag === 'th' ? scope : undefined }\n\t\t\t\t\t\t\t\tcolSpan={ colspan }\n\t\t\t\t\t\t\t\trowSpan={ rowspan }\n\t\t\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ () => {\n\t\t\t\t\t\t\t\t\tsetSelectedCell( {\n\t\t\t\t\t\t\t\t\t\tsectionName: name,\n\t\t\t\t\t\t\t\t\t\trowIndex,\n\t\t\t\t\t\t\t\t\t\tcolumnIndex,\n\t\t\t\t\t\t\t\t\t\ttype: 'cell',\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\taria-label={ cellAriaLabel[ name ] }\n\t\t\t\t\t\t\t\tplaceholder={ placeholder[ name ] }\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</tr>\n\t\t\t) ) }\n\t\t</TSection>\n\t) );\n\n\tconst isEmpty = ! sections.length;\n\n\treturn (\n\t\t<figure { ...useBlockProps( { ref: tableRef } ) }>\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\t\tlabel={ __( 'Change column alignment' ) }\n\t\t\t\t\t\t\talignmentControls={ ALIGNMENT_CONTROLS }\n\t\t\t\t\t\t\tvalue={ getCellAlignment() }\n\t\t\t\t\t\t\tonChange={ ( nextAlign ) =>\n\t\t\t\t\t\t\t\tonChangeColumnAlignment( nextAlign )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\t\thasArrowIndicator\n\t\t\t\t\t\t\ticon={ table }\n\t\t\t\t\t\t\tlabel={ __( 'Edit table' ) }\n\t\t\t\t\t\t\tcontrols={ tableControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\t\tclassName=\"blocks-table-settings\"\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Fixed width table cells' ) }\n\t\t\t\t\t\tchecked={ !! hasFixedLayout }\n\t\t\t\t\t\tonChange={ onChangeFixedLayout }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Header section' ) }\n\t\t\t\t\t\t\t\tchecked={ !! ( head && head.length ) }\n\t\t\t\t\t\t\t\tonChange={ onToggleHeaderSection }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Footer section' ) }\n\t\t\t\t\t\t\t\tchecked={ !! ( foot && foot.length ) }\n\t\t\t\t\t\t\t\tonChange={ onToggleFooterSection }\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</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<table\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\tcolorProps.className,\n\t\t\t\t\t\tborderProps.className,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-fixed-layout': hasFixedLayout,\n\t\t\t\t\t\t\t// This is required in the editor only to overcome\n\t\t\t\t\t\t\t// the fact the editor rewrites individual border\n\t\t\t\t\t\t\t// widths into a shorthand format.\n\t\t\t\t\t\t\t'has-individual-borders': hasSplitBorders(\n\t\t\t\t\t\t\t\tattributes?.style?.border\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\tstyle={ { ...colorProps.style, ...borderProps.style } }\n\t\t\t\t>\n\t\t\t\t\t{ renderedSections }\n\t\t\t\t</table>\n\t\t\t) }\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"caption\"\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tclassName={ __experimentalGetElementClassName( 'caption' ) }\n\t\t\t\t\taria-label={ __( 'Table caption text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add caption' ) }\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { caption: value } )\n\t\t\t\t\t}\n\t\t\t\t\t// Deselect the selected table cell when the caption is focused.\n\t\t\t\t\tonFocus={ () => setSelectedCell() }\n\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isEmpty && (\n\t\t\t\t<Placeholder\n\t\t\t\t\tlabel={ __( 'Table' ) }\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\t\t\tinstructions={ __( 'Insert a table for sharing data.' ) }\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tclassName=\"blocks-table__placeholder-form\"\n\t\t\t\t\t\tonSubmit={ onCreateTable }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Column count' ) }\n\t\t\t\t\t\t\tvalue={ initialColumnCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialColumnCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tlabel={ __( 'Row count' ) }\n\t\t\t\t\t\t\tvalue={ initialRowCount }\n\t\t\t\t\t\t\tonChange={ onChangeInitialRowCount }\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"blocks-table__placeholder-button\"\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create Table' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n\nexport default TableEdit;\n"]}
@@ -80,7 +80,8 @@ function save({
80
80
  }))));
81
81
  };
82
82
 
83
- return (0, _element.createElement)("figure", _blockEditor.useBlockProps.save(), (0, _element.createElement)("table", {
83
+ return (0, _element.createElement)("figure", { ..._blockEditor.useBlockProps.save()
84
+ }, (0, _element.createElement)("table", {
84
85
  className: classes === '' ? undefined : classes,
85
86
  style: { ...colorProps.style,
86
87
  ...borderProps.style
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/table/save.js"],"names":["save","attributes","hasFixedLayout","head","body","foot","caption","isEmpty","length","colorProps","borderProps","classes","className","hasCaption","RichText","Section","type","rows","Tag","map","cells","rowIndex","content","tag","scope","align","colspan","rowspan","cellIndex","cellClasses","undefined","useBlockProps","style"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AASe,SAASA,IAAT,CAAe;AAAEC,EAAAA;AAAF,CAAf,EAAgC;AAC9C,QAAM;AAAEC,IAAAA,cAAF;A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A,WADQ,GAERC,SAJL;AAMC,sBAAaL,KANd;AAOC,QAAA,OAAO,EAAGF,GAPX;AAQC,QAAA,KAAK,EAAGD,OART;AASC,QAAA,GAAG,EAAGM,SATP;AAUC,QAAA,KAAK,EACJL,GAAG,KAAK,IAAR,GAAeC,KAAf,GAAuBM,SAXzB;AAaC,QAAA,OAAO,EAAGJ,OAbX;AAcC,QAAA,OAAO,EAAGC;AAdX,QADD;AAkBA,KAlCA,CADH,CADC,CADH,CADD;AA4CA,GAnDD;;AAqDA,SACC,sCAAaI,2BAAc/B,IAAd,EAAb,EACC;AACC,IAAA,SAAS,EAAGW,OAAO,KAAK,EAAZ,GAAiBmB,SAAjB,GAA6BnB,OAD1C;AAEC,IAAA,KAAK,EAAG,EAAE,GAAGF,UAAU,CAACuB,KAAhB;AAAuB,SAAGtB,WAAW,CAACsB;AAAtC;AAFT,KAIC,4BAAC,OAAD;AAAS,IAAA,IAAI,EAAC,MAAd;AAAqB,IAAA,IAAI,EAAG7B;AAA5B,IAJD,EAKC,4BAAC,OAAD;AAAS,IAAA,IAAI,EAAC,MAAd;AAAqB,IAAA,IAAI,EAAGC;AAA5B,IALD,EAMC,4BAAC,OAAD;AAAS,IAAA,IAAI,EAAC,MAAd;AAAqB,IAAA,IAAI,EAAGC;AAA5B,IAND,CADD,EASGQ,UAAU,IACX,4BAAC,qBAAD,CAAU,OAAV;AACC,IAAA,OAAO,EAAC,YADT;AAEC,IAAA,KAAK,EAAGP,OAFT;AAGC,IAAA,SAAS,EAAG,oDAAmC,SAAnC;AAHb,IAVF,CADD;AAmBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,\n\t__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { hasFixedLayout, head, body, foot, caption } = attributes;\n\tconst isEmpty = ! head.length && ! body.length && ! foot.length;\n\n\tif ( isEmpty ) {\n\t\treturn null;\n\t}\n\n\tconst colorProps = getColorClassesAndStyles( attributes );\n\tconst borderProps = getBorderClassesAndStyles( attributes );\n\n\tconst classes = classnames( colorProps.className, borderProps.className, {\n\t\t'has-fixed-layout': hasFixedLayout,\n\t} );\n\n\tconst hasCaption = ! RichText.isEmpty( caption );\n\n\tconst Section = ( { type, rows } ) => {\n\t\tif ( ! rows.length ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst Tag = `t${ type }`;\n\n\t\treturn (\n\t\t\t<Tag>\n\t\t\t\t{ rows.map( ( { cells }, rowIndex ) => (\n\t\t\t\t\t<tr key={ rowIndex }>\n\t\t\t\t\t\t{ cells.map(\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\t\t\ttag,\n\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\talign,\n\t\t\t\t\t\t\t\t\tcolspan,\n\t\t\t\t\t\t\t\t\trowspan,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcellIndex\n\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\tconst cellClasses = classnames( {\n\t\t\t\t\t\t\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<RichText.Content\n\t\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t\tcellClasses\n\t\t\t\t\t\t\t\t\t\t\t\t? cellClasses\n\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdata-align={ align }\n\t\t\t\t\t\t\t\t\t\ttagName={ tag }\n\t\t\t\t\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\t\t\t\t\tkey={ cellIndex }\n\t\t\t\t\t\t\t\t\t\tscope={\n\t\t\t\t\t\t\t\t\t\t\ttag === 'th' ? scope : undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tcolSpan={ colspan }\n\t\t\t\t\t\t\t\t\t\trowSpan={ rowspan }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</tr>\n\t\t\t\t) ) }\n\t\t\t</Tag>\n\t\t);\n\t};\n\n\treturn (\n\t\t<figure { ...useBlockProps.save() }>\n\t\t\t<table\n\t\t\t\tclassName={ classes === '' ? undefined : classes }\n\t\t\t\tstyle={ { ...colorProps.style, ...borderProps.style } }\n\t\t\t>\n\t\t\t\t<Section type=\"head\" rows={ head } />\n\t\t\t\t<Section type=\"body\" rows={ body } />\n\t\t\t\t<Section type=\"foot\" rows={ foot } />\n\t\t\t</table>\n\t\t\t{ hasCaption && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t\tclassName={ __experimentalGetElementClassName( 'caption' ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/table/save.js"],"names":["save","attributes","hasFixedLayout","head","body","foot","caption","isEmpty","length","colorProps","borderProps","classes","className","hasCaption","RichText","Section","type","rows","Tag","map","cells","rowIndex","content","tag","scope","align","colspan","rowspan","cellIndex","cellClasses","undefined","useBlockProps","style"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AASe,SAASA,IAAT,CAAe;AAAEC,EAAAA;AAAF,CAAf,EAAgC;AAC9C,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,IAAlB;AAAwBC,IAAAA,IAAxB;AAA8BC,I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AO,EAAGF,GAPX;AAQC,QAAA,KAAK,EAAGD,OART;AASC,QAAA,GAAG,EAAGM,SATP;AAUC,QAAA,KAAK,EACJL,GAAG,KAAK,IAAR,GAAeC,KAAf,GAAuBM,SAXzB;AAaC,QAAA,OAAO,EAAGJ,OAbX;AAcC,QAAA,OAAO,EAAGC;AAdX,QADD;AAkBA,KAlCA,CADH,CADC,CADH,CADD;AA4CA,GAnDD;;AAqDA,SACC,2CAAaI,2BAAc/B,IAAd;AAAb,KACC;AACC,IAAA,SAAS,EAAGW,OAAO,KAAK,EAAZ,GAAiBmB,SAAjB,GAA6BnB,OAD1C;AAEC,IAAA,KAAK,EAAG,EAAE,GAAGF,UAAU,CAACuB,KAAhB;AAAuB,SAAGtB,WAAW,CAACsB;AAAtC;AAFT,KAIC,4BAAC,OAAD;AAAS,IAAA,IAAI,EAAC,MAAd;AAAqB,IAAA,IAAI,EAAG7B;AAA5B,IAJD,EAKC,4BAAC,OAAD;AAAS,IAAA,IAAI,EAAC,MAAd;AAAqB,IAAA,IAAI,EAAGC;AAA5B,IALD,EAMC,4BAAC,OAAD;AAAS,IAAA,IAAI,EAAC,MAAd;AAAqB,IAAA,IAAI,EAAGC;AAA5B,IAND,CADD,EASGQ,UAAU,IACX,4BAAC,qBAAD,CAAU,OAAV;AACC,IAAA,OAAO,EAAC,YADT;AAEC,IAAA,KAAK,EAAGP,OAFT;AAGC,IAAA,SAAS,EAAG,oDAAmC,SAAnC;AAHb,IAVF,CADD;AAmBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,\n\t__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { hasFixedLayout, head, body, foot, caption } = attributes;\n\tconst isEmpty = ! head.length && ! body.length && ! foot.length;\n\n\tif ( isEmpty ) {\n\t\treturn null;\n\t}\n\n\tconst colorProps = getColorClassesAndStyles( attributes );\n\tconst borderProps = getBorderClassesAndStyles( attributes );\n\n\tconst classes = classnames( colorProps.className, borderProps.className, {\n\t\t'has-fixed-layout': hasFixedLayout,\n\t} );\n\n\tconst hasCaption = ! RichText.isEmpty( caption );\n\n\tconst Section = ( { type, rows } ) => {\n\t\tif ( ! rows.length ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst Tag = `t${ type }`;\n\n\t\treturn (\n\t\t\t<Tag>\n\t\t\t\t{ rows.map( ( { cells }, rowIndex ) => (\n\t\t\t\t\t<tr key={ rowIndex }>\n\t\t\t\t\t\t{ cells.map(\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t\t\t\ttag,\n\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\talign,\n\t\t\t\t\t\t\t\t\tcolspan,\n\t\t\t\t\t\t\t\t\trowspan,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcellIndex\n\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\tconst cellClasses = classnames( {\n\t\t\t\t\t\t\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<RichText.Content\n\t\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t\tcellClasses\n\t\t\t\t\t\t\t\t\t\t\t\t? cellClasses\n\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdata-align={ align }\n\t\t\t\t\t\t\t\t\t\ttagName={ tag }\n\t\t\t\t\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\t\t\t\t\tkey={ cellIndex }\n\t\t\t\t\t\t\t\t\t\tscope={\n\t\t\t\t\t\t\t\t\t\t\ttag === 'th' ? scope : undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tcolSpan={ colspan }\n\t\t\t\t\t\t\t\t\t\trowSpan={ rowspan }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</tr>\n\t\t\t\t) ) }\n\t\t\t</Tag>\n\t\t);\n\t};\n\n\treturn (\n\t\t<figure { ...useBlockProps.save() }>\n\t\t\t<table\n\t\t\t\tclassName={ classes === '' ? undefined : classes }\n\t\t\t\tstyle={ { ...colorProps.style, ...borderProps.style } }\n\t\t\t>\n\t\t\t\t<Section type=\"head\" rows={ head } />\n\t\t\t\t<Section type=\"body\" rows={ body } />\n\t\t\t\t<Section type=\"foot\" rows={ foot } />\n\t\t\t</table>\n\t\t\t{ hasCaption && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t\tclassName={ __experimentalGetElementClassName( 'caption' ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n"]}
@@ -230,7 +230,8 @@ function TableOfContentsEdit({
230
230
  // "Convert to static list" option is useless to the placeholder state.
231
231
 
232
232
  if (headings.length === 0) {
233
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("div", blockProps, (0, _element.createElement)(_components.Placeholder, {
233
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("div", { ...blockProps
234
+ }, (0, _element.createElement)(_components.Placeholder, {
234
235
  icon: (0, _element.createElement)(_blockEditor.BlockIcon, {
235
236
  icon: _icon.default
236
237
  }),
@@ -239,7 +240,8 @@ function TableOfContentsEdit({
239
240
  })), inspectorControls);
240
241
  }
241
242
 
242
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("nav", blockProps, (0, _element.createElement)("ol", {
243
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("nav", { ...blockProps
244
+ }, (0, _element.createElement)("ol", {
243
245
  inert: "true"
244
246
  }, (0, _element.createElement)(_list.default, {
245
247
  nestedHeadingList: headingTree
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/table-of-contents/edit.js"],"names":["TableOfContentsEdit","attributes","headings","onlyIncludeCurrentPage","clientId","setAttributes","blockProps","canInsertList","select","getBlockRootClientId","canInsertBlockType","blockEditorStore","rootClientId","__unstableMarkNextChangeAsNotPersistent","replaceBlocks","latestHeadings","getBlockAttributes","getBlockName","getClientIdsWithDescendants","__experimentalGetGlobalBlocksByName","getGlobalBlocksByName","editorSelectors","pageBreakClientIds","isPaginated","length","allBlockClientIds","tocPage","tocIndex","indexOf","blockIndex","blockClientId","entries","_latestHeadings","headingPage","permalink","getPermalink","headingPageLink","page","blockName","headingAttributes","canBeLinked","anchor","push","content","replace","level","link","headingTree","toolbarControls","ordered","values","inspectorControls","value","icon"],"mappings":";;;;;;;;;AAyBA;;AAtBA;;AAKA;;AAOA;;AACA;;AAOA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AAlCA;AACA;AACA;;AAGA;AACA;AACA;;AAsBA;AACA;AACA;;AAKA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,mBAAT,CAA8B;AAC5CC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,QAAQ,GAAG,EAAb;AAAiBC,IAAAA;AAAjB,GADgC;AAE5CC,EAAAA,QAF4C;AAG5CC,EAAAA;AAH4C,CAA9B,EAIX;AACH,QAAMC,UAAU,GAAG,iCAAnB;AAEA,QAAMC,aAAa,GAAG,qBACnBC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLF,MAAM,CAAEG,kBAAF,CADP;AAEA,UAAMC,YAAY,GAAGH,oBAAo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X;AAIC,IAAA,QAAQ,EAAKiD,KAAF,IACV/C,aAAa,CAAE;AAAEF,MAAAA,sBAAsB,EAAEiD;AAA1B,KAAF,CALf;AAOC,IAAA,IAAI,EACHjD,sBAAsB,GACnB,cACA,2EADA,CADmB,GAInB,cACA,mFADA;AAZL,IADD,CADD,CADD,CAnMG,CA2NH;AACA;AACA;;AACA,MAAKD,QAAQ,CAACsB,MAAT,KAAoB,CAAzB,EAA6B;AAC5B,WACC,qDACC,mCAAUlB,UAAV,EACC,4BAAC,uBAAD;AACC,MAAA,IAAI,EAAG,4BAAC,sBAAD;AAAW,QAAA,IAAI,EAAG+C;AAAlB,QADR;AAEC,MAAA,KAAK,EAAG,cAAI,mBAAJ,CAFT;AAGC,MAAA,YAAY,EAAG,cACd,4GADc;AAHhB,MADD,CADD,EAUGF,iBAVH,CADD;AAcA;;AAED,SACC,qDACC,mCAAU7C,UAAV,EACC;AAAI,IAAA,KAAK,EAAC;AAAV,KACC,4BAAC,aAAD;AAAqB,IAAA,iBAAiB,EAAGyC;AAAzC,IADD,CADD,CADD,EAMGC,eANH,EAOGG,iBAPH,CADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tPanelBody,\n\tPlaceholder,\n\tToggleControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { renderToString, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs, removeQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport icon from './icon';\nimport TableOfContentsList from './list';\nimport { linearToNestedHeadingList } from './utils';\n\n/** @typedef {import('./utils').HeadingData} HeadingData */\n\n/**\n * Table of Contents block edit component.\n *\n * @param {Object} props The props.\n * @param {Object} props.attributes The block attributes.\n * @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post.\n * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated).\n * @param {string} props.clientId\n * @param {(attributes: Object) => void} props.setAttributes\n *\n * @return {WPComponent} The component.\n */\nexport default function TableOfContentsEdit( {\n\tattributes: { headings = [], onlyIncludeCurrentPage },\n\tclientId,\n\tsetAttributes,\n} ) {\n\tconst blockProps = useBlockProps();\n\n\tconst canInsertList = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\treturn canInsertBlockType( 'core/list', rootClientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, replaceBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\t/**\n\t * The latest heading data, or null if the new data deeply equals the saved\n\t * headings attribute.\n\t *\n\t * Since useSelect forces a re-render when its return value is shallowly\n\t * inequal to its prior call, we would be re-rendering this block every time\n\t * the stores change, even if the latest headings were deeply equal to the\n\t * ones saved in the block attributes.\n\t *\n\t * By returning null when they're equal, we reduce that to 2 renders: one\n\t * when there are new latest headings (and so it returns them), and one when\n\t * they haven't changed (so it returns null). As long as the latest heading\n\t * data remains the same, further calls of the useSelect callback will\n\t * continue to return null, thus preventing any forced re-renders.\n\t */\n\tconst latestHeadings = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetClientIdsWithDescendants,\n\t\t\t\t__experimentalGetGlobalBlocksByName: getGlobalBlocksByName,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\t// FIXME: @wordpress/block-library should not depend on @wordpress/editor.\n\t\t\t// Blocks can be loaded into a *non-post* block editor, so to avoid\n\t\t\t// declaring @wordpress/editor as a dependency, we must access its\n\t\t\t// store by string. When the store is not available, editorSelectors\n\t\t\t// will be null, and the block's saved markup will lack permalinks.\n\t\t\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\t\t\tconst editorSelectors = select( 'core/editor' );\n\n\t\t\tconst pageBreakClientIds = getGlobalBlocksByName( 'core/nextpage' );\n\n\t\t\tconst isPaginated = pageBreakClientIds.length !== 0;\n\n\t\t\t// Get the client ids of all blocks in the editor.\n\t\t\tconst allBlockClientIds = getClientIdsWithDescendants();\n\n\t\t\t// If onlyIncludeCurrentPage is true, calculate the page (of a paginated post) this block is part of, so we know which headings to include; otherwise, skip the calculation.\n\t\t\tlet tocPage = 1;\n\n\t\t\tif ( isPaginated && onlyIncludeCurrentPage ) {\n\t\t\t\t// We can't use getBlockIndex because it only returns the index\n\t\t\t\t// relative to sibling blocks.\n\t\t\t\tconst tocIndex = allBlockClientIds.indexOf( clientId );\n\n\t\t\t\tfor ( const [\n\t\t\t\t\tblockIndex,\n\t\t\t\t\tblockClientId,\n\t\t\t\t] of allBlockClientIds.entries() ) {\n\t\t\t\t\t// If we've reached blocks after the Table of Contents, we've\n\t\t\t\t\t// finished calculating which page the block is on.\n\t\t\t\t\tif ( blockIndex >= tocIndex ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ( getBlockName( blockClientId ) === 'core/nextpage' ) {\n\t\t\t\t\t\ttocPage++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst _latestHeadings = [];\n\n\t\t\t/** The page (of a paginated post) a heading will be part of. */\n\t\t\tlet headingPage = 1;\n\n\t\t\t/**\n\t\t\t * A permalink to the current post. If the core/editor store is\n\t\t\t * unavailable, this variable will be null.\n\t\t\t */\n\t\t\tconst permalink = editorSelectors?.getPermalink() ?? null;\n\n\t\t\tlet headingPageLink = null;\n\n\t\t\t// If the core/editor store is available, we can add permalinks to the\n\t\t\t// generated table of contents.\n\t\t\tif ( typeof permalink === 'string' ) {\n\t\t\t\theadingPageLink = isPaginated\n\t\t\t\t\t? addQueryArgs( permalink, { page: headingPage } )\n\t\t\t\t\t: permalink;\n\t\t\t}\n\n\t\t\tfor ( const blockClientId of allBlockClientIds ) {\n\t\t\t\tconst blockName = getBlockName( blockClientId );\n\t\t\t\tif ( blockName === 'core/nextpage' ) {\n\t\t\t\t\theadingPage++;\n\n\t\t\t\t\t// If we're only including headings from the current page (of\n\t\t\t\t\t// a paginated post), then exit the loop if we've reached the\n\t\t\t\t\t// pages after the one with the Table of Contents block.\n\t\t\t\t\tif ( onlyIncludeCurrentPage && headingPage > tocPage ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( typeof permalink === 'string' ) {\n\t\t\t\t\t\theadingPageLink = addQueryArgs(\n\t\t\t\t\t\t\tremoveQueryArgs( permalink, [ 'page' ] ),\n\t\t\t\t\t\t\t{ page: headingPage }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If we're including all headings or we've reached headings on\n\t\t\t\t// the same page as the Table of Contents block, add them to the\n\t\t\t\t// list.\n\t\t\t\telse if (\n\t\t\t\t\t! onlyIncludeCurrentPage ||\n\t\t\t\t\theadingPage === tocPage\n\t\t\t\t) {\n\t\t\t\t\tif ( blockName === 'core/heading' ) {\n\t\t\t\t\t\tconst headingAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( blockClientId );\n\n\t\t\t\t\t\tconst canBeLinked =\n\t\t\t\t\t\t\ttypeof headingPageLink === 'string' &&\n\t\t\t\t\t\t\ttypeof headingAttributes.anchor === 'string' &&\n\t\t\t\t\t\t\theadingAttributes.anchor !== '';\n\n\t\t\t\t\t\t_latestHeadings.push( {\n\t\t\t\t\t\t\t// Convert line breaks to spaces, and get rid of HTML tags in the headings.\n\t\t\t\t\t\t\tcontent: stripHTML(\n\t\t\t\t\t\t\t\theadingAttributes.content.replace(\n\t\t\t\t\t\t\t\t\t/(<br *\\/?>)+/g,\n\t\t\t\t\t\t\t\t\t' '\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tlevel: headingAttributes.level,\n\t\t\t\t\t\t\tlink: canBeLinked\n\t\t\t\t\t\t\t\t? `${ headingPageLink }#${ headingAttributes.anchor }`\n\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( fastDeepEqual( headings, _latestHeadings ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn _latestHeadings;\n\t\t},\n\t\t[ clientId, onlyIncludeCurrentPage, headings ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( latestHeadings !== null ) {\n\t\t\t// This is required to keep undo working and not create 2 undo steps\n\t\t\t// for each heading change.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { headings: latestHeadings } );\n\t\t}\n\t}, [ latestHeadings ] );\n\n\tconst headingTree = linearToNestedHeadingList( headings );\n\n\tconst toolbarControls = canInsertList && (\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlock( 'core/list', {\n\t\t\t\t\t\t\t\tordered: true,\n\t\t\t\t\t\t\t\tvalues: renderToString(\n\t\t\t\t\t\t\t\t\t<TableOfContentsList\n\t\t\t\t\t\t\t\t\t\tnestedHeadingList={ headingTree }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Convert to static list' ) }\n\t\t\t\t</ToolbarButton>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Only include current page' ) }\n\t\t\t\t\tchecked={ onlyIncludeCurrentPage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { onlyIncludeCurrentPage: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={\n\t\t\t\t\t\tonlyIncludeCurrentPage\n\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t'Only including headings from the current page (if the post is paginated).'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t'Toggle to only include headings from the current page (if the post is paginated).'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\t// If there are no headings or the only heading is empty.\n\t// Note that the toolbar controls are intentionally omitted since the\n\t// \"Convert to static list\" option is useless to the placeholder state.\n\tif ( headings.length === 0 ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\tlabel={ __( 'Table of Contents' ) }\n\t\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t\t'Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{ inspectorControls }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<nav { ...blockProps }>\n\t\t\t\t<ol inert=\"true\">\n\t\t\t\t\t<TableOfContentsList nestedHeadingList={ headingTree } />\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t\t{ toolbarControls }\n\t\t\t{ inspectorControls }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/table-of-contents/edit.js"],"names":["TableOfContentsEdit","attributes","headings","onlyIncludeCurrentPage","clientId","setAttributes","blockProps","canInsertList","select","getBlockRootClientId","canInsertBlockType","blockEditorStore","rootClientId","__unstableMarkNextChangeAsNotPersistent","replaceBlocks","latestHeadings","getBlockAttributes","getBlockName","getClientIdsWithDescendants","__experimentalGetGlobalBlocksByName","getGlobalBlocksByName","editorSelectors","pageBreakClientIds","isPaginated","length","allBlockClientIds","tocPage","tocIndex","indexOf","blockIndex","blockClientId","entries","_latestHeadings","headingPage","permalink","getPermalink","headingPageLink","page","blockName","headingAttributes","canBeLinked","anchor","push","content","replace","level","link","headingTree","toolbarControls","ordered","values","inspectorControls","value","icon"],"mappings":";;;;;;;;;AAyBA;;AAtBA;;AAKA;;AAOA;;AACA;;AAOA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AAlCA;AACA;AACA;;AAGA;AACA;AACA;;AAsBA;AACA;AACA;;AAKA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,mBAAT,CAA8B;AAC5CC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,QAAQ,GAAG,EAAb;AAAiBC,IAAAA;AAAjB,GADgC;AAE5CC,EAAAA,QAF4C;AAG5CC,EAAAA;AAH4C,CAA9B,EAIX;AACH,QAAMC,UAAU,GAAG,iCAAnB;AAEA,QAAMC,aAAa,GAAG,qBACnBC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLF,MAAM,CAAEG,kBAAF,CADP;AAEA,UAAMC,YAAY,GAAGH,oBAAoB,CAAEL,QAAF,CAAzC;AAEA,WAAOM,kBAAkB,CAAE,WAAF,EAAeE,YAAf,CAAzB;AACA,GAPoB,EAQrB,CAAER,QAA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AOC,IAAA,IAAI,EACHjD,sBAAsB,GACnB,cACA,2EADA,CADmB,GAInB,cACA,mFADA;AAZL,IADD,CADD,CADD,CAnMG,CA2NH;AACA;AACA;;AACA,MAAKD,QAAQ,CAACsB,MAAT,KAAoB,CAAzB,EAA6B;AAC5B,WACC,qDACC,wCAAUlB;AAAV,OACC,4BAAC,uBAAD;AACC,MAAA,IAAI,EAAG,4BAAC,sBAAD;AAAW,QAAA,IAAI,EAAG+C;AAAlB,QADR;AAEC,MAAA,KAAK,EAAG,cAAI,mBAAJ,CAFT;AAGC,MAAA,YAAY,EAAG,cACd,4GADc;AAHhB,MADD,CADD,EAUGF,iBAVH,CADD;AAcA;;AAED,SACC,qDACC,wCAAU7C;AAAV,KACC;AAAI,IAAA,KAAK,EAAC;AAAV,KACC,4BAAC,aAAD;AAAqB,IAAA,iBAAiB,EAAGyC;AAAzC,IADD,CADD,CADD,EAMGC,eANH,EAOGG,iBAPH,CADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tPanelBody,\n\tPlaceholder,\n\tToggleControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { renderToString, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs, removeQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport icon from './icon';\nimport TableOfContentsList from './list';\nimport { linearToNestedHeadingList } from './utils';\n\n/** @typedef {import('./utils').HeadingData} HeadingData */\n\n/**\n * Table of Contents block edit component.\n *\n * @param {Object} props The props.\n * @param {Object} props.attributes The block attributes.\n * @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post.\n * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated).\n * @param {string} props.clientId\n * @param {(attributes: Object) => void} props.setAttributes\n *\n * @return {WPComponent} The component.\n */\nexport default function TableOfContentsEdit( {\n\tattributes: { headings = [], onlyIncludeCurrentPage },\n\tclientId,\n\tsetAttributes,\n} ) {\n\tconst blockProps = useBlockProps();\n\n\tconst canInsertList = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\treturn canInsertBlockType( 'core/list', rootClientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, replaceBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\t/**\n\t * The latest heading data, or null if the new data deeply equals the saved\n\t * headings attribute.\n\t *\n\t * Since useSelect forces a re-render when its return value is shallowly\n\t * inequal to its prior call, we would be re-rendering this block every time\n\t * the stores change, even if the latest headings were deeply equal to the\n\t * ones saved in the block attributes.\n\t *\n\t * By returning null when they're equal, we reduce that to 2 renders: one\n\t * when there are new latest headings (and so it returns them), and one when\n\t * they haven't changed (so it returns null). As long as the latest heading\n\t * data remains the same, further calls of the useSelect callback will\n\t * continue to return null, thus preventing any forced re-renders.\n\t */\n\tconst latestHeadings = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetClientIdsWithDescendants,\n\t\t\t\t__experimentalGetGlobalBlocksByName: getGlobalBlocksByName,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\t// FIXME: @wordpress/block-library should not depend on @wordpress/editor.\n\t\t\t// Blocks can be loaded into a *non-post* block editor, so to avoid\n\t\t\t// declaring @wordpress/editor as a dependency, we must access its\n\t\t\t// store by string. When the store is not available, editorSelectors\n\t\t\t// will be null, and the block's saved markup will lack permalinks.\n\t\t\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\t\t\tconst editorSelectors = select( 'core/editor' );\n\n\t\t\tconst pageBreakClientIds = getGlobalBlocksByName( 'core/nextpage' );\n\n\t\t\tconst isPaginated = pageBreakClientIds.length !== 0;\n\n\t\t\t// Get the client ids of all blocks in the editor.\n\t\t\tconst allBlockClientIds = getClientIdsWithDescendants();\n\n\t\t\t// If onlyIncludeCurrentPage is true, calculate the page (of a paginated post) this block is part of, so we know which headings to include; otherwise, skip the calculation.\n\t\t\tlet tocPage = 1;\n\n\t\t\tif ( isPaginated && onlyIncludeCurrentPage ) {\n\t\t\t\t// We can't use getBlockIndex because it only returns the index\n\t\t\t\t// relative to sibling blocks.\n\t\t\t\tconst tocIndex = allBlockClientIds.indexOf( clientId );\n\n\t\t\t\tfor ( const [\n\t\t\t\t\tblockIndex,\n\t\t\t\t\tblockClientId,\n\t\t\t\t] of allBlockClientIds.entries() ) {\n\t\t\t\t\t// If we've reached blocks after the Table of Contents, we've\n\t\t\t\t\t// finished calculating which page the block is on.\n\t\t\t\t\tif ( blockIndex >= tocIndex ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ( getBlockName( blockClientId ) === 'core/nextpage' ) {\n\t\t\t\t\t\ttocPage++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst _latestHeadings = [];\n\n\t\t\t/** The page (of a paginated post) a heading will be part of. */\n\t\t\tlet headingPage = 1;\n\n\t\t\t/**\n\t\t\t * A permalink to the current post. If the core/editor store is\n\t\t\t * unavailable, this variable will be null.\n\t\t\t */\n\t\t\tconst permalink = editorSelectors?.getPermalink() ?? null;\n\n\t\t\tlet headingPageLink = null;\n\n\t\t\t// If the core/editor store is available, we can add permalinks to the\n\t\t\t// generated table of contents.\n\t\t\tif ( typeof permalink === 'string' ) {\n\t\t\t\theadingPageLink = isPaginated\n\t\t\t\t\t? addQueryArgs( permalink, { page: headingPage } )\n\t\t\t\t\t: permalink;\n\t\t\t}\n\n\t\t\tfor ( const blockClientId of allBlockClientIds ) {\n\t\t\t\tconst blockName = getBlockName( blockClientId );\n\t\t\t\tif ( blockName === 'core/nextpage' ) {\n\t\t\t\t\theadingPage++;\n\n\t\t\t\t\t// If we're only including headings from the current page (of\n\t\t\t\t\t// a paginated post), then exit the loop if we've reached the\n\t\t\t\t\t// pages after the one with the Table of Contents block.\n\t\t\t\t\tif ( onlyIncludeCurrentPage && headingPage > tocPage ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( typeof permalink === 'string' ) {\n\t\t\t\t\t\theadingPageLink = addQueryArgs(\n\t\t\t\t\t\t\tremoveQueryArgs( permalink, [ 'page' ] ),\n\t\t\t\t\t\t\t{ page: headingPage }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If we're including all headings or we've reached headings on\n\t\t\t\t// the same page as the Table of Contents block, add them to the\n\t\t\t\t// list.\n\t\t\t\telse if (\n\t\t\t\t\t! onlyIncludeCurrentPage ||\n\t\t\t\t\theadingPage === tocPage\n\t\t\t\t) {\n\t\t\t\t\tif ( blockName === 'core/heading' ) {\n\t\t\t\t\t\tconst headingAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( blockClientId );\n\n\t\t\t\t\t\tconst canBeLinked =\n\t\t\t\t\t\t\ttypeof headingPageLink === 'string' &&\n\t\t\t\t\t\t\ttypeof headingAttributes.anchor === 'string' &&\n\t\t\t\t\t\t\theadingAttributes.anchor !== '';\n\n\t\t\t\t\t\t_latestHeadings.push( {\n\t\t\t\t\t\t\t// Convert line breaks to spaces, and get rid of HTML tags in the headings.\n\t\t\t\t\t\t\tcontent: stripHTML(\n\t\t\t\t\t\t\t\theadingAttributes.content.replace(\n\t\t\t\t\t\t\t\t\t/(<br *\\/?>)+/g,\n\t\t\t\t\t\t\t\t\t' '\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tlevel: headingAttributes.level,\n\t\t\t\t\t\t\tlink: canBeLinked\n\t\t\t\t\t\t\t\t? `${ headingPageLink }#${ headingAttributes.anchor }`\n\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( fastDeepEqual( headings, _latestHeadings ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn _latestHeadings;\n\t\t},\n\t\t[ clientId, onlyIncludeCurrentPage, headings ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( latestHeadings !== null ) {\n\t\t\t// This is required to keep undo working and not create 2 undo steps\n\t\t\t// for each heading change.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { headings: latestHeadings } );\n\t\t}\n\t}, [ latestHeadings ] );\n\n\tconst headingTree = linearToNestedHeadingList( headings );\n\n\tconst toolbarControls = canInsertList && (\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlock( 'core/list', {\n\t\t\t\t\t\t\t\tordered: true,\n\t\t\t\t\t\t\t\tvalues: renderToString(\n\t\t\t\t\t\t\t\t\t<TableOfContentsList\n\t\t\t\t\t\t\t\t\t\tnestedHeadingList={ headingTree }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Convert to static list' ) }\n\t\t\t\t</ToolbarButton>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Only include current page' ) }\n\t\t\t\t\tchecked={ onlyIncludeCurrentPage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { onlyIncludeCurrentPage: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={\n\t\t\t\t\t\tonlyIncludeCurrentPage\n\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t'Only including headings from the current page (if the post is paginated).'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t'Toggle to only include headings from the current page (if the post is paginated).'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\t// If there are no headings or the only heading is empty.\n\t// Note that the toolbar controls are intentionally omitted since the\n\t// \"Convert to static list\" option is useless to the placeholder state.\n\tif ( headings.length === 0 ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\tlabel={ __( 'Table of Contents' ) }\n\t\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t\t'Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{ inspectorControls }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<nav { ...blockProps }>\n\t\t\t\t<ol inert=\"true\">\n\t\t\t\t\t<TableOfContentsList nestedHeadingList={ headingTree } />\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t\t{ toolbarControls }\n\t\t\t{ inspectorControls }\n\t\t</>\n\t);\n}\n"]}
@@ -31,7 +31,8 @@ function save({
31
31
  return null;
32
32
  }
33
33
 
34
- return (0, _element.createElement)("nav", _blockEditor.useBlockProps.save(), (0, _element.createElement)("ol", null, (0, _element.createElement)(_list.default, {
34
+ return (0, _element.createElement)("nav", { ..._blockEditor.useBlockProps.save()
35
+ }, (0, _element.createElement)("ol", null, (0, _element.createElement)(_list.default, {
35
36
  nestedHeadingList: (0, _utils.linearToNestedHeadingList)(headings)
36
37
  })));
37
38
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/table-of-contents/save.js"],"names":["save","attributes","headings","length","useBlockProps"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIe,SAASA,IAAT,CAAe;AAAEC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,QAAQ,GAAG;AAAb;AAAd,CAAf,EAAmD;AACjE,MAAKA,QAAQ,CAACC,MAAT,KAAoB,CAAzB,EAA6B;AAC5B,WAAO,IAAP;AACA;;AACD,SACC,mCAAUC,2BAAcJ,IAAd,EAAV,EACC,wCACC,4BAAC,aAAD;AACC,IAAA,iBAAiB,EAAG,sCAA2BE,QAA3B;AADrB,IADD,CADD,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsList from './list';\nimport { linearToNestedHeadingList } from './utils';\n\nexport default function save( { attributes: { headings = [] } } ) {\n\tif ( headings.length === 0 ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<nav { ...useBlockProps.save() }>\n\t\t\t<ol>\n\t\t\t\t<TableOfContentsList\n\t\t\t\t\tnestedHeadingList={ linearToNestedHeadingList( headings ) }\n\t\t\t\t/>\n\t\t\t</ol>\n\t\t</nav>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/table-of-contents/save.js"],"names":["save","attributes","headings","length","useBlockProps"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIe,SAASA,IAAT,CAAe;AAAEC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,QAAQ,GAAG;AAAb;AAAd,CAAf,EAAmD;AACjE,MAAKA,QAAQ,CAACC,MAAT,KAAoB,CAAzB,EAA6B;AAC5B,WAAO,IAAP;AACA;;AACD,SACC,wCAAUC,2BAAcJ,IAAd;AAAV,KACC,wCACC,4BAAC,aAAD;AACC,IAAA,iBAAiB,EAAG,sCAA2BE,QAA3B;AADrB,IADD,CADD,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsList from './list';\nimport { linearToNestedHeadingList } from './utils';\n\nexport default function save( { attributes: { headings = [] } } ) {\n\tif ( headings.length === 0 ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<nav { ...useBlockProps.save() }>\n\t\t\t<ol>\n\t\t\t\t<TableOfContentsList\n\t\t\t\t\tnestedHeadingList={ linearToNestedHeadingList( headings ) }\n\t\t\t\t/>\n\t\t\t</ol>\n\t\t</nav>\n\t);\n}\n"]}
@@ -148,7 +148,8 @@ function TagCloudEdit({
148
148
  min: MIN_FONT_SIZE,
149
149
  max: MAX_FONT_SIZE
150
150
  })))));
151
- return (0, _element.createElement)(_element.Fragment, null, inspectorControls, (0, _element.createElement)("div", (0, _blockEditor.useBlockProps)(), (0, _element.createElement)(_components.Disabled, null, (0, _element.createElement)(_serverSideRender.default, {
151
+ return (0, _element.createElement)(_element.Fragment, null, inspectorControls, (0, _element.createElement)("div", { ...(0, _blockEditor.useBlockProps)()
152
+ }, (0, _element.createElement)(_components.Disabled, null, (0, _element.createElement)(_serverSideRender.default, {
152
153
  skipBlockSupportAttributes: true,
153
154
  block: "core/tag-cloud",
154
155
  attributes: attributes
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/tag-cloud/edit.js"],"names":["MIN_TAGS","MAX_TAGS","MIN_FONT_SIZE","MAX_FONT_SIZE","TagCloudEdit","attributes","setAttributes","taxonomies","taxonomy","showTagCounts","numberOfTags","smallestFontSize","largestFontSize","units","availableUnits","getTaxonomyOptions","selectOption","label","value","disabled","taxonomyOptions","filter","tax","show_cloud","map","item","slug","name","onFontSizeChange","fontSizeLabel","newValue","quantity","newUnit","Number","isFinite","updateObj","Object","entries","forEach","attribute","currentValue","currentQuantity","currentUnit","inspectorControls","selectedTaxonomy","select","coreStore","getTaxonomies","per_page"],"mappings":";;;;;;;;;;;AAGA;;AAYA;;AACA;;AACA;;AAKA;;AACA;;AAvBA;AACA;AACA;;AAuBA;AACA;AACA;AACA;AACA;AACA,MAAMA,QAAQ,GAAG,CAAjB;AAEA;AACA;AACA;AACA;AACA;;AACA,MAAMC,QAAQ,GAAG,GAAjB;AAEA,MAAMC,aAAa,GAAG,GAAtB;AACA,MAAMC,aAAa,GAAG,GAAtB;;AAEA,SAASC,YAAT,CAAuB;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,aAAd;AAA6BC,EAAAA;AAA7B,CAAvB,EAAmE;AAClE,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,aAFK;AAGLC,IAAAA,YAHK;AAILC,IAAAA,gBAJK;AAKLC,IAAAA;AALK,MAMFP,UANJ;AAQA,QAAMQ,KAAK,GAAG,8CAAgB;AAC7BC,IAAAA,cAAc,EAAE,6BAAY,eAAZ,KAAiC,CAChD,GADgD,EAEhD,IAFgD,EAGhD,IAHgD,EAIhD,KAJgD;AADpB,GAAhB,CAAd;;AASA,QAAMC,kBAAkB,GAAG,MAAM;AAChC,UAAMC,YAAY,GAAG;AACpBC,MAAAA,KAAK,EAAE,cAAI,YAAJ,CADa;AAEpBC,MAAAA,KAAK,EAAE,EAFa;AAGpBC,MAAAA,QAAQ,EAAE;AAHU,KAArB;AAKA,UAAMC,eAAe,GAAG,CAAEb,UAAF,aAAEA,UAAF,cAAEA,UAAF,GAAgB,EAAhB,EACtBc,MADsB,CACZC,GAA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Q,EAAKM,KAAF,IAAa;AACvBU,MAAAA,gBAAgB,CAAE,iBAAF,EAAqBV,KAArB,CAAhB;AACA,KALF;AAMC,IAAA,KAAK,EAAGL,KANT;AAOC,IAAA,GAAG,EAAGX,aAPP;AAQC,IAAA,GAAG,EAAGC;AARP,IADD,CAbD,CA7BD,CADD,CADD;AA6DA,SACC,qDACGwC,iBADH,EAEC,mCAAU,iCAAV,EACC,4BAAC,oBAAD,QACC,4BAAC,yBAAD;AACC,IAAA,0BAA0B,MAD3B;AAEC,IAAA,KAAK,EAAC,gBAFP;AAGC,IAAA,UAAU,EAAGtC;AAHd,IADD,CADD,CAFD,CADD;AAcA;;eAEc,sBAAcwC,MAAF,IAAc;AACxC,SAAO;AACNtC,IAAAA,UAAU,EAAEsC,MAAM,CAAEC,eAAF,CAAN,CAAoBC,aAApB,CAAmC;AAAEC,MAAAA,QAAQ,EAAE,CAAC;AAAb,KAAnC;AADN,GAAP;AAGA,CAJc,EAIV5C,YAJU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFlex,\n\tFlexItem,\n\tPanelBody,\n\tToggleControl,\n\tSelectControl,\n\tRangeControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\tDisabled,\n} from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseSetting,\n} from '@wordpress/block-editor';\nimport ServerSideRender from '@wordpress/server-side-render';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Minimum number of tags a user can show using this block.\n *\n * @type {number}\n */\nconst MIN_TAGS = 1;\n\n/**\n * Maximum number of tags a user can show using this block.\n *\n * @type {number}\n */\nconst MAX_TAGS = 100;\n\nconst MIN_FONT_SIZE = 0.1;\nconst MAX_FONT_SIZE = 100;\n\nfunction TagCloudEdit( { attributes, setAttributes, taxonomies } ) {\n\tconst {\n\t\ttaxonomy,\n\t\tshowTagCounts,\n\t\tnumberOfTags,\n\t\tsmallestFontSize,\n\t\tlargestFontSize,\n\t} = attributes;\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useSetting( 'spacing.units' ) || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t],\n\t} );\n\n\tconst getTaxonomyOptions = () => {\n\t\tconst selectOption = {\n\t\t\tlabel: __( '- Select -' ),\n\t\t\tvalue: '',\n\t\t\tdisabled: true,\n\t\t};\n\t\tconst taxonomyOptions = ( taxonomies ?? [] )\n\t\t\t.filter( ( tax ) => !! tax.show_cloud )\n\t\t\t.map( ( item ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: item.slug,\n\t\t\t\t\tlabel: item.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\treturn [ selectOption, ...taxonomyOptions ];\n\t};\n\n\tconst onFontSizeChange = ( fontSizeLabel, newValue ) => {\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst [ quantity, newUnit ] =\n\t\t\tparseQuantityAndUnitFromRawValue( newValue );\n\t\tif ( ! Number.isFinite( quantity ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst updateObj = { [ fontSizeLabel ]: newValue };\n\t\t// We need to keep in sync the `unit` changes to both `smallestFontSize`\n\t\t// and `largestFontSize` attributes.\n\t\tObject.entries( {\n\t\t\tsmallestFontSize,\n\t\t\tlargestFontSize,\n\t\t} ).forEach( ( [ attribute, currentValue ] ) => {\n\t\t\tconst [ currentQuantity, currentUnit ] =\n\t\t\t\tparseQuantityAndUnitFromRawValue( currentValue );\n\t\t\t// Only add an update if the other font size attribute has a different unit.\n\t\t\tif ( attribute !== fontSizeLabel && currentUnit !== newUnit ) {\n\t\t\t\tupdateObj[ attribute ] = `${ currentQuantity }${ newUnit }`;\n\t\t\t}\n\t\t} );\n\t\tsetAttributes( updateObj );\n\t};\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\t\t\toptions={ getTaxonomyOptions() }\n\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\tonChange={ ( selectedTaxonomy ) =>\n\t\t\t\t\t\tsetAttributes( { taxonomy: selectedTaxonomy } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Show post counts' ) }\n\t\t\t\t\tchecked={ showTagCounts }\n\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\tsetAttributes( { showTagCounts: ! showTagCounts } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<RangeControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Number of tags' ) }\n\t\t\t\t\tvalue={ numberOfTags }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { numberOfTags: value } )\n\t\t\t\t\t}\n\t\t\t\t\tmin={ MIN_TAGS }\n\t\t\t\t\tmax={ MAX_TAGS }\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Smallest size' ) }\n\t\t\t\t\t\t\tvalue={ smallestFontSize }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tonFontSizeChange( 'smallestFontSize', value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tmin={ MIN_FONT_SIZE }\n\t\t\t\t\t\t\tmax={ MAX_FONT_SIZE }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Largest size' ) }\n\t\t\t\t\t\t\tvalue={ largestFontSize }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tonFontSizeChange( 'largestFontSize', value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tmin={ MIN_FONT_SIZE }\n\t\t\t\t\t\t\tmax={ MAX_FONT_SIZE }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ inspectorControls }\n\t\t\t<div { ...useBlockProps() }>\n\t\t\t\t<Disabled>\n\t\t\t\t\t<ServerSideRender\n\t\t\t\t\t\tskipBlockSupportAttributes\n\t\t\t\t\t\tblock=\"core/tag-cloud\"\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t/>\n\t\t\t\t</Disabled>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\treturn {\n\t\ttaxonomies: select( coreStore ).getTaxonomies( { per_page: -1 } ),\n\t};\n} )( TagCloudEdit );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/tag-cloud/edit.js"],"names":["MIN_TAGS","MAX_TAGS","MIN_FONT_SIZE","MAX_FONT_SIZE","TagCloudEdit","attributes","setAttributes","taxonomies","taxonomy","showTagCounts","numberOfTags","smallestFontSize","largestFontSize","units","availableUnits","getTaxonomyOptions","selectOption","label","value","disabled","taxonomyOptions","filter","tax","show_cloud","map","item","slug","name","onFontSizeChange","fontSizeLabel","newValue","quantity","newUnit","Number","isFinite","updateObj","Object","entries","forEach","attribute","currentValue","currentQuantity","currentUnit","inspectorControls","selectedTaxonomy","select","coreStore","getTaxonomies","per_page"],"mappings":";;;;;;;;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EC,IAAA,KAAK,EAAC,gBAFP;AAGC,IAAA,UAAU,EAAGtC;AAHd,IADD,CADD,CAFD,CADD;AAcA;;eAEc,sBAAcwC,MAAF,IAAc;AACxC,SAAO;AACNtC,IAAAA,UAAU,EAAEsC,MAAM,CAAEC,eAAF,CAAN,CAAoBC,aAApB,CAAmC;AAAEC,MAAAA,QAAQ,EAAE,CAAC;AAAb,KAAnC;AADN,GAAP;AAGA,CAJc,EAIV5C,YAJU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFlex,\n\tFlexItem,\n\tPanelBody,\n\tToggleControl,\n\tSelectControl,\n\tRangeControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\tDisabled,\n} from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseSetting,\n} from '@wordpress/block-editor';\nimport ServerSideRender from '@wordpress/server-side-render';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Minimum number of tags a user can show using this block.\n *\n * @type {number}\n */\nconst MIN_TAGS = 1;\n\n/**\n * Maximum number of tags a user can show using this block.\n *\n * @type {number}\n */\nconst MAX_TAGS = 100;\n\nconst MIN_FONT_SIZE = 0.1;\nconst MAX_FONT_SIZE = 100;\n\nfunction TagCloudEdit( { attributes, setAttributes, taxonomies } ) {\n\tconst {\n\t\ttaxonomy,\n\t\tshowTagCounts,\n\t\tnumberOfTags,\n\t\tsmallestFontSize,\n\t\tlargestFontSize,\n\t} = attributes;\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useSetting( 'spacing.units' ) || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t],\n\t} );\n\n\tconst getTaxonomyOptions = () => {\n\t\tconst selectOption = {\n\t\t\tlabel: __( '- Select -' ),\n\t\t\tvalue: '',\n\t\t\tdisabled: true,\n\t\t};\n\t\tconst taxonomyOptions = ( taxonomies ?? [] )\n\t\t\t.filter( ( tax ) => !! tax.show_cloud )\n\t\t\t.map( ( item ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: item.slug,\n\t\t\t\t\tlabel: item.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\treturn [ selectOption, ...taxonomyOptions ];\n\t};\n\n\tconst onFontSizeChange = ( fontSizeLabel, newValue ) => {\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst [ quantity, newUnit ] =\n\t\t\tparseQuantityAndUnitFromRawValue( newValue );\n\t\tif ( ! Number.isFinite( quantity ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst updateObj = { [ fontSizeLabel ]: newValue };\n\t\t// We need to keep in sync the `unit` changes to both `smallestFontSize`\n\t\t// and `largestFontSize` attributes.\n\t\tObject.entries( {\n\t\t\tsmallestFontSize,\n\t\t\tlargestFontSize,\n\t\t} ).forEach( ( [ attribute, currentValue ] ) => {\n\t\t\tconst [ currentQuantity, currentUnit ] =\n\t\t\t\tparseQuantityAndUnitFromRawValue( currentValue );\n\t\t\t// Only add an update if the other font size attribute has a different unit.\n\t\t\tif ( attribute !== fontSizeLabel && currentUnit !== newUnit ) {\n\t\t\t\tupdateObj[ attribute ] = `${ currentQuantity }${ newUnit }`;\n\t\t\t}\n\t\t} );\n\t\tsetAttributes( updateObj );\n\t};\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\t\t\toptions={ getTaxonomyOptions() }\n\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\tonChange={ ( selectedTaxonomy ) =>\n\t\t\t\t\t\tsetAttributes( { taxonomy: selectedTaxonomy } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Show post counts' ) }\n\t\t\t\t\tchecked={ showTagCounts }\n\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\tsetAttributes( { showTagCounts: ! showTagCounts } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<RangeControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Number of tags' ) }\n\t\t\t\t\tvalue={ numberOfTags }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { numberOfTags: value } )\n\t\t\t\t\t}\n\t\t\t\t\tmin={ MIN_TAGS }\n\t\t\t\t\tmax={ MAX_TAGS }\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Smallest size' ) }\n\t\t\t\t\t\t\tvalue={ smallestFontSize }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tonFontSizeChange( 'smallestFontSize', value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tmin={ MIN_FONT_SIZE }\n\t\t\t\t\t\t\tmax={ MAX_FONT_SIZE }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Largest size' ) }\n\t\t\t\t\t\t\tvalue={ largestFontSize }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tonFontSizeChange( 'largestFontSize', value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tmin={ MIN_FONT_SIZE }\n\t\t\t\t\t\t\tmax={ MAX_FONT_SIZE }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ inspectorControls }\n\t\t\t<div { ...useBlockProps() }>\n\t\t\t\t<Disabled>\n\t\t\t\t\t<ServerSideRender\n\t\t\t\t\t\tskipBlockSupportAttributes\n\t\t\t\t\t\tblock=\"core/tag-cloud\"\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t/>\n\t\t\t\t</Disabled>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\treturn {\n\t\ttaxonomies: select( coreStore ).getTaxonomies( { per_page: -1 } ),\n\t};\n} )( TagCloudEdit );\n"]}
@@ -64,7 +64,6 @@ const metadata = {
64
64
  }],
65
65
  supports: {
66
66
  html: false,
67
- anchor: true,
68
67
  align: true,
69
68
  spacing: {
70
69
  margin: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/tag-cloud/index.js"],"names":["name","metadata","settings","icon","example","edit","transforms","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,UADuB;AAEvBC,EAAAA,OAAO,EAAE,EAFc;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA;AAJuB,CAAjB;;;AAOA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEP,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { tag as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport transforms from './transforms';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {},\n\tedit,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/tag-cloud/index.js"],"names":["name","metadata","settings","icon","example","edit","transforms","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,UADuB;AAEvBC,EAAAA,OAAO,EAAE,EAFc;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA;AAJuB,CAAjB;;;AAOA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEP,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { tag as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport transforms from './transforms';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {},\n\tedit,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
@@ -98,13 +98,15 @@ function TemplatePartEdit({
98
98
  // A new template part is automatically created if we have any inner blocks but no entity.
99
99
 
100
100
  if (innerBlocks.length === 0 && (slug && !theme || slug && isMissing)) {
101
- return (0, _element.createElement)(TagName, blockProps, (0, _element.createElement)(_blockEditor.Warning, null, (0, _i18n.sprintf)(
101
+ return (0, _element.createElement)(TagName, { ...blockProps
102
+ }, (0, _element.createElement)(_blockEditor.Warning, null, (0, _i18n.sprintf)(
102
103
  /* translators: %s: Template part slug */
103
104
  (0, _i18n.__)('Template part has been deleted or is unavailable: %s'), slug)));
104
105
  }
105
106
 
106
107
  if (isEntityAvailable && hasAlreadyRendered) {
107
- return (0, _element.createElement)(TagName, blockProps, (0, _element.createElement)(_blockEditor.Warning, null, (0, _i18n.__)('Block cannot be rendered inside itself.')));
108
+ return (0, _element.createElement)(TagName, { ...blockProps
109
+ }, (0, _element.createElement)(_blockEditor.Warning, null, (0, _i18n.__)('Block cannot be rendered inside itself.')));
108
110
  }
109
111
 
110
112
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.__experimentalRecursionProvider, {
@@ -116,7 +118,8 @@ function TemplatePartEdit({
116
118
  templatePartId: templatePartId,
117
119
  defaultWrapper: areaObject.tagName,
118
120
  hasInnerBlocks: innerBlocks.length > 0
119
- }), isPlaceholder && (0, _element.createElement)(TagName, blockProps, (0, _element.createElement)(_placeholder.default, {
121
+ }), isPlaceholder && (0, _element.createElement)(TagName, { ...blockProps
122
+ }, (0, _element.createElement)(_placeholder.default, {
120
123
  area: attributes.area,
121
124
  templatePartId: templatePartId,
122
125
  clientId: clientId,
@@ -137,7 +140,8 @@ function TemplatePartEdit({
137
140
  postId: templatePartId,
138
141
  hasInnerBlocks: innerBlocks.length > 0,
139
142
  layout: layout
140
- }), !isPlaceholder && !isResolved && (0, _element.createElement)(TagName, blockProps, (0, _element.createElement)(_components.Spinner, null))), isTemplatePartSelectionOpen && (0, _element.createElement)(_components.Modal, {
143
+ }), !isPlaceholder && !isResolved && (0, _element.createElement)(TagName, { ...blockProps
144
+ }, (0, _element.createElement)(_components.Spinner, null))), isTemplatePartSelectionOpen && (0, _element.createElement)(_components.Modal, {
141
145
  overlayClassName: "block-editor-template-part__selection-modal",
142
146
  title: (0, _i18n.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
143
147
  (0, _i18n.__)('Choose a %s'), areaObject.label.toLowerCase()),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/index.js"],"names":["TemplatePartEdit","attributes","setAttributes","clientId","isSelected","slug","theme","tagName","layout","templatePartId","hasAlreadyRendered","isTemplatePartSelectionOpen","setIsTemplatePartSelectionOpen","isResolved","innerBlocks","isMissing","area","select","getEditedEntityRecord","hasFinishedResolution","coreStore","getBlocks","blockEditorStore","getEntityArgs","entityRecord","_area","hasResolvedEntity","Object","keys","length","templateParts","blockPatterns","hasReplacements","areaObject","blockProps","isPlaceholder","isEntityAvailable","TagName","canReplace","BlockTitle","label","toLowerCase"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AACA;;AASA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA1BA;AACA;AACA;;AAgBA;AACA;AACA;AAYe,SAASA,gBAAT,CAA2B;AACzCC,EAAAA,UADyC;AAEzCC,EAAAA,aAFyC;AAGzCC,EAAAA,QAHyC;AAIzCC,EAAAA;AAJyC,CAA3B,EAKX;AACH,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeC,IAAAA,OAAf;AAAwBC,IAAAA,MAAM,GAAG;AAAjC,MAAwCP,UAA9C;AACA,QAAMQ,cAAc,GAAG,gDAAsBH,KAAtB,EAA6BD,IAA7B,CAAvB;AACA,QAAMK,kBAAkB,GAAG,gDAAiBD,cAAjB,CAA3B;AACA,QAAM,CAAEE,2BAAF,EAA+BC,8BAA/B,IACL,uBAAU,KAAV,CADD,CAJG,CAOH;AACA;AACA;;AACA,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,WAAd;AAA2BC,IAAAA,SAA3B;AAAsCC,IAAAA;AAAtC,MAA+C,qBAClDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,qBAAF;AAAyBC,MAA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MACD,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACf1B,MAAAA,8BAA8B,CAAE,IAAF,CAA9B;AACA;AAHF,KAKG,uCACD,cAAI,wBAAJ,CADC,EAED;AACC2B,IAAAA,UAAU,EACT,4BAAC,uBAAD;AACC,MAAA,QAAQ,EAAGpC,QADZ;AAEC,MAAA,aAAa,EAAG;AAFjB;AAFF,GAFC,CALH,CAFF,CAvBF,EA6CGiC,iBAAiB,IAClB,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAGC,OADX;AAEC,IAAA,UAAU,EAAGH,UAFd;AAGC,IAAA,MAAM,EAAGzB,cAHV;AAIC,IAAA,cAAc,EAAGK,WAAW,CAACe,MAAZ,GAAqB,CAJvC;AAKC,IAAA,MAAM,EAAGrB;AALV,IA9CF,EAsDG,CAAE2B,aAAF,IAAmB,CAAEtB,UAArB,IACD,4BAAC,OAAD,EAAcqB,UAAd,EACC,4BAAC,mBAAD,OADD,CAvDF,CADD,EA6DGvB,2BAA2B,IAC5B,4BAAC,iBAAD;AACC,IAAA,gBAAgB,EAAC,6CADlB;AAEC,IAAA,KAAK,EAAG,oBACP;AACA,kBAAI,aAAJ,CAFO,EAGPsB,UAAU,CAACO,KAAX,CAAiBC,WAAjB,EAHO,CAFT;AAOC,IAAA,cAAc,EAAG,MAChB7B,8BAA8B,CAAE,KAAF,CARhC;AAUC,IAAA,YAAY,EAAG;AAVhB,KAYC,4BAAC,uBAAD;AACC,IAAA,cAAc,EAAGH,cADlB;AAEC,IAAA,QAAQ,EAAGN,QAFZ;AAGC,IAAA,IAAI,EAAGa,IAHR;AAIC,IAAA,aAAa,EAAGd,aAJjB;AAKC,IAAA,OAAO,EAAG,MACTU,8BAA8B,CAAE,KAAF;AANhC,IAZD,CA9DF,CADD;AAwFA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tBlockSettingsMenuControls,\n\tBlockTitle,\n\tuseBlockProps,\n\tWarning,\n\tstore as blockEditorStore,\n\t__experimentalRecursionProvider as RecursionProvider,\n\t__experimentalUseHasRecursion as useHasRecursion,\n} from '@wordpress/block-editor';\nimport { Spinner, Modal, MenuItem } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartPlaceholder from './placeholder';\nimport TemplatePartSelectionModal from './selection-modal';\nimport { TemplatePartAdvancedControls } from './advanced-controls';\nimport TemplatePartInnerBlocks from './inner-blocks';\nimport { createTemplatePartId } from './utils/create-template-part-id';\nimport {\n\tuseAlternativeBlockPatterns,\n\tuseAlternativeTemplateParts,\n\tuseTemplatePartArea,\n} from './utils/hooks';\n\nexport default function TemplatePartEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tisSelected,\n} ) {\n\tconst { slug, theme, tagName, layout = {} } = attributes;\n\tconst templatePartId = createTemplatePartId( theme, slug );\n\tconst hasAlreadyRendered = useHasRecursion( templatePartId );\n\tconst [ isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen ] =\n\t\tuseState( false );\n\n\t// Set the postId block attribute if it did not exist,\n\t// but wait until the inner blocks have loaded to allow\n\t// new edits to trigger this.\n\tconst { isResolved, innerBlocks, isMissing, area } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getBlocks } = select( blockEditorStore );\n\n\t\t\tconst getEntityArgs = [\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\ttemplatePartId,\n\t\t\t];\n\t\t\tconst entityRecord = templatePartId\n\t\t\t\t? getEditedEntityRecord( ...getEntityArgs )\n\t\t\t\t: null;\n\t\t\tconst _area = entityRecord?.area || attributes.area;\n\t\t\tconst hasResolvedEntity = templatePartId\n\t\t\t\t? hasFinishedResolution(\n\t\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t\tgetEntityArgs\n\t\t\t\t )\n\t\t\t\t: false;\n\n\t\t\treturn {\n\t\t\t\tinnerBlocks: getBlocks( clientId ),\n\t\t\t\tisResolved: hasResolvedEntity,\n\t\t\t\tisMissing:\n\t\t\t\t\thasResolvedEntity &&\n\t\t\t\t\t( ! entityRecord ||\n\t\t\t\t\t\tObject.keys( entityRecord ).length === 0 ),\n\t\t\t\tarea: _area,\n\t\t\t};\n\t\t},\n\t\t[ templatePartId, clientId ]\n\t);\n\tconst { templateParts } = useAlternativeTemplateParts(\n\t\tarea,\n\t\ttemplatePartId\n\t);\n\tconst blockPatterns = useAlternativeBlockPatterns( area, clientId );\n\tconst hasReplacements = !! templateParts.length || !! blockPatterns.length;\n\tconst areaObject = useTemplatePartArea( area );\n\tconst blockProps = useBlockProps();\n\tconst isPlaceholder = ! slug;\n\tconst isEntityAvailable = ! isPlaceholder && ! isMissing && isResolved;\n\tconst TagName = tagName || areaObject.tagName;\n\n\t// The `isSelected` check ensures the `BlockSettingsMenuControls` fill\n\t// doesn't render multiple times. The block controls has similar internal check.\n\tconst canReplace =\n\t\tisSelected &&\n\t\tisEntityAvailable &&\n\t\thasReplacements &&\n\t\t( area === 'header' || area === 'footer' );\n\n\t// We don't want to render a missing state if we have any inner blocks.\n\t// A new template part is automatically created if we have any inner blocks but no entity.\n\tif (\n\t\tinnerBlocks.length === 0 &&\n\t\t( ( slug && ! theme ) || ( slug && isMissing ) )\n\t) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %s: Template part slug */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Template part has been deleted or is unavailable: %s'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tslug\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\tif ( isEntityAvailable && hasAlreadyRendered ) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<RecursionProvider uniqueId={ templatePartId }>\n\t\t\t\t<TemplatePartAdvancedControls\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisEntityAvailable={ isEntityAvailable }\n\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\tdefaultWrapper={ areaObject.tagName }\n\t\t\t\t\thasInnerBlocks={ innerBlocks.length > 0 }\n\t\t\t\t/>\n\t\t\t\t{ isPlaceholder && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<TemplatePartPlaceholder\n\t\t\t\t\t\t\tarea={ attributes.area }\n\t\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tonOpenSelectionModal={ () =>\n\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t\t{ canReplace && (\n\t\t\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( 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\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__( 'Replace <BlockTitle />' ),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tBlockTitle: (\n\t\t\t\t\t\t\t\t\t\t\t<BlockTitle\n\t\t\t\t\t\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t\t\t\t\t\tmaximumLength={ 25 }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</BlockSettingsMenuControls>\n\t\t\t\t) }\n\t\t\t\t{ isEntityAvailable && (\n\t\t\t\t\t<TemplatePartInnerBlocks\n\t\t\t\t\t\ttagName={ TagName }\n\t\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\t\tpostId={ templatePartId }\n\t\t\t\t\t\thasInnerBlocks={ innerBlocks.length > 0 }\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! isPlaceholder && ! isResolved && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t</RecursionProvider>\n\t\t\t{ isTemplatePartSelectionOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\toverlayClassName=\"block-editor-template-part__selection-modal\"\n\t\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t__( 'Choose a %s' ),\n\t\t\t\t\t\tareaObject.label.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t\tonRequestClose={ () =>\n\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t}\n\t\t\t\t\tisFullScreen={ true }\n\t\t\t\t>\n\t\t\t\t\t<TemplatePartSelectionModal\n\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tonClose={ () =>\n\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/index.js"],"names":["TemplatePartEdit","attributes","setAttributes","clientId","isSelected","slug","theme","tagName","layout","templatePartId","hasAlreadyRendered","isTemplatePartSelectionOpen","setIsTemplatePartSelectionOpen","isResolved","innerBlocks","isMissing","area","select","getEditedEntityRecord","hasFinishedResolution","coreStore","getBlocks","blockEditorStore","getEntityArgs","entityRecord","_area","hasResolvedEntity","Object","keys","length","templateParts","blockPatterns","hasReplacements","areaObject","blockProps","isPlaceholder","isEntityAvailable","TagName","canReplace","BlockTitle","label","toLowerCase"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AACA;;AASA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA1BA;AACA;AACA;;AAgBA;AACA;AACA;AAYe,SAASA,gBAAT,CAA2B;AACzCC,EAAAA,UADyC;AAEzCC,EAAAA,aAFyC;AAGzCC,EAAAA,QAHyC;AAIzCC,EAAAA;AAJyC,CAA3B,EAKX;AACH,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeC,IAAAA,OAAf;AAAwBC,IAAAA,MAAM,GAAG;AAAjC,MAAwCP,UAA9C;AACA,QAAMQ,cAAc,GAAG,gDAAsBH,KAAtB,EAA6BD,IAA7B,CAAvB;AACA,QAAMK,kBAAkB,GAAG,gDAAiBD,cAAjB,CAA3B;AACA,QAAM,CAAEE,2BAAF,EAA+BC,8BAA/B,IACL,uBAAU,KAAV,CADD,CAJG,CAOH;AACA;AACA;;AACA,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,WAAd;AAA2BC,IAAAA,SAA3B;AAAsCC,IAAAA;AAAtC,MAA+C,qBAClDC,MAAF,IAAc;AACb,UAAM;AAAEC,M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,IACX,4BAAC,sCAAD,QACG,MACD,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACf1B,MAAAA,8BAA8B,CAAE,IAAF,CAA9B;AACA;AAHF,KAKG,uCACD,cAAI,wBAAJ,CADC,EAED;AACC2B,IAAAA,UAAU,EACT,4BAAC,uBAAD;AACC,MAAA,QAAQ,EAAGpC,QADZ;AAEC,MAAA,aAAa,EAAG;AAFjB;AAFF,GAFC,CALH,CAFF,CAvBF,EA6CGiC,iBAAiB,IAClB,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAGC,OADX;AAEC,IAAA,UAAU,EAAGH,UAFd;AAGC,IAAA,MAAM,EAAGzB,cAHV;AAIC,IAAA,cAAc,EAAGK,WAAW,CAACe,MAAZ,GAAqB,CAJvC;AAKC,IAAA,MAAM,EAAGrB;AALV,IA9CF,EAsDG,CAAE2B,aAAF,IAAmB,CAAEtB,UAArB,IACD,4BAAC,OAAD,OAAcqB;AAAd,KACC,4BAAC,mBAAD,OADD,CAvDF,CADD,EA6DGvB,2BAA2B,IAC5B,4BAAC,iBAAD;AACC,IAAA,gBAAgB,EAAC,6CADlB;AAEC,IAAA,KAAK,EAAG,oBACP;AACA,kBAAI,aAAJ,CAFO,EAGPsB,UAAU,CAACO,KAAX,CAAiBC,WAAjB,EAHO,CAFT;AAOC,IAAA,cAAc,EAAG,MAChB7B,8BAA8B,CAAE,KAAF,CARhC;AAUC,IAAA,YAAY,EAAG;AAVhB,KAYC,4BAAC,uBAAD;AACC,IAAA,cAAc,EAAGH,cADlB;AAEC,IAAA,QAAQ,EAAGN,QAFZ;AAGC,IAAA,IAAI,EAAGa,IAHR;AAIC,IAAA,aAAa,EAAGd,aAJjB;AAKC,IAAA,OAAO,EAAG,MACTU,8BAA8B,CAAE,KAAF;AANhC,IAZD,CA9DF,CADD;AAwFA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tBlockSettingsMenuControls,\n\tBlockTitle,\n\tuseBlockProps,\n\tWarning,\n\tstore as blockEditorStore,\n\t__experimentalRecursionProvider as RecursionProvider,\n\t__experimentalUseHasRecursion as useHasRecursion,\n} from '@wordpress/block-editor';\nimport { Spinner, Modal, MenuItem } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartPlaceholder from './placeholder';\nimport TemplatePartSelectionModal from './selection-modal';\nimport { TemplatePartAdvancedControls } from './advanced-controls';\nimport TemplatePartInnerBlocks from './inner-blocks';\nimport { createTemplatePartId } from './utils/create-template-part-id';\nimport {\n\tuseAlternativeBlockPatterns,\n\tuseAlternativeTemplateParts,\n\tuseTemplatePartArea,\n} from './utils/hooks';\n\nexport default function TemplatePartEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tisSelected,\n} ) {\n\tconst { slug, theme, tagName, layout = {} } = attributes;\n\tconst templatePartId = createTemplatePartId( theme, slug );\n\tconst hasAlreadyRendered = useHasRecursion( templatePartId );\n\tconst [ isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen ] =\n\t\tuseState( false );\n\n\t// Set the postId block attribute if it did not exist,\n\t// but wait until the inner blocks have loaded to allow\n\t// new edits to trigger this.\n\tconst { isResolved, innerBlocks, isMissing, area } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getBlocks } = select( blockEditorStore );\n\n\t\t\tconst getEntityArgs = [\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\ttemplatePartId,\n\t\t\t];\n\t\t\tconst entityRecord = templatePartId\n\t\t\t\t? getEditedEntityRecord( ...getEntityArgs )\n\t\t\t\t: null;\n\t\t\tconst _area = entityRecord?.area || attributes.area;\n\t\t\tconst hasResolvedEntity = templatePartId\n\t\t\t\t? hasFinishedResolution(\n\t\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t\tgetEntityArgs\n\t\t\t\t )\n\t\t\t\t: false;\n\n\t\t\treturn {\n\t\t\t\tinnerBlocks: getBlocks( clientId ),\n\t\t\t\tisResolved: hasResolvedEntity,\n\t\t\t\tisMissing:\n\t\t\t\t\thasResolvedEntity &&\n\t\t\t\t\t( ! entityRecord ||\n\t\t\t\t\t\tObject.keys( entityRecord ).length === 0 ),\n\t\t\t\tarea: _area,\n\t\t\t};\n\t\t},\n\t\t[ templatePartId, clientId ]\n\t);\n\tconst { templateParts } = useAlternativeTemplateParts(\n\t\tarea,\n\t\ttemplatePartId\n\t);\n\tconst blockPatterns = useAlternativeBlockPatterns( area, clientId );\n\tconst hasReplacements = !! templateParts.length || !! blockPatterns.length;\n\tconst areaObject = useTemplatePartArea( area );\n\tconst blockProps = useBlockProps();\n\tconst isPlaceholder = ! slug;\n\tconst isEntityAvailable = ! isPlaceholder && ! isMissing && isResolved;\n\tconst TagName = tagName || areaObject.tagName;\n\n\t// The `isSelected` check ensures the `BlockSettingsMenuControls` fill\n\t// doesn't render multiple times. The block controls has similar internal check.\n\tconst canReplace =\n\t\tisSelected &&\n\t\tisEntityAvailable &&\n\t\thasReplacements &&\n\t\t( area === 'header' || area === 'footer' );\n\n\t// We don't want to render a missing state if we have any inner blocks.\n\t// A new template part is automatically created if we have any inner blocks but no entity.\n\tif (\n\t\tinnerBlocks.length === 0 &&\n\t\t( ( slug && ! theme ) || ( slug && isMissing ) )\n\t) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %s: Template part slug */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Template part has been deleted or is unavailable: %s'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tslug\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\tif ( isEntityAvailable && hasAlreadyRendered ) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<RecursionProvider uniqueId={ templatePartId }>\n\t\t\t\t<TemplatePartAdvancedControls\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisEntityAvailable={ isEntityAvailable }\n\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\tdefaultWrapper={ areaObject.tagName }\n\t\t\t\t\thasInnerBlocks={ innerBlocks.length > 0 }\n\t\t\t\t/>\n\t\t\t\t{ isPlaceholder && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<TemplatePartPlaceholder\n\t\t\t\t\t\t\tarea={ attributes.area }\n\t\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tonOpenSelectionModal={ () =>\n\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t\t{ canReplace && (\n\t\t\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( 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\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__( 'Replace <BlockTitle />' ),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tBlockTitle: (\n\t\t\t\t\t\t\t\t\t\t\t<BlockTitle\n\t\t\t\t\t\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t\t\t\t\t\tmaximumLength={ 25 }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</BlockSettingsMenuControls>\n\t\t\t\t) }\n\t\t\t\t{ isEntityAvailable && (\n\t\t\t\t\t<TemplatePartInnerBlocks\n\t\t\t\t\t\ttagName={ TagName }\n\t\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\t\tpostId={ templatePartId }\n\t\t\t\t\t\thasInnerBlocks={ innerBlocks.length > 0 }\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! isPlaceholder && ! isResolved && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t</RecursionProvider>\n\t\t\t{ isTemplatePartSelectionOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\toverlayClassName=\"block-editor-template-part__selection-modal\"\n\t\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t__( 'Choose a %s' ),\n\t\t\t\t\t\tareaObject.label.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t\tonRequestClose={ () =>\n\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t}\n\t\t\t\t\tisFullScreen={ true }\n\t\t\t\t>\n\t\t\t\t\t<TemplatePartSelectionModal\n\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tonClose={ () =>\n\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -39,8 +39,9 @@ function TemplatePartInnerBlocks({
39
39
  onInput,
40
40
  onChange,
41
41
  renderAppender: hasInnerBlocks ? undefined : _blockEditor.InnerBlocks.ButtonBlockAppender,
42
- __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
42
+ layout: themeSupportsLayout ? usedLayout : undefined
43
+ });
44
+ return (0, _element.createElement)(TagName, { ...innerBlocksProps
43
45
  });
44
- return (0, _element.createElement)(TagName, innerBlocksProps);
45
46
  }
46
47
  //# sourceMappingURL=inner-blocks.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/inner-blocks.js"],"names":["TemplatePartInnerBlocks","postId","id","hasInnerBlocks","layout","tagName","TagName","blockProps","themeSupportsLayout","select","getSettings","blockEditorStore","supportsLayout","defaultLayout","usedLayout","inherit","blocks","onInput","onChange","innerBlocksProps","value","renderAppender","undefined","InnerBlocks","ButtonBlockAppender","__experimentalLayout"],"mappings":";;;;;;;;;AAGA;;AACA;;AAMA;;AAVA;AACA;AACA;AAUe,SAASA,uBAAT,CAAkC;AAChDC,EAAAA,MAAM,EAAEC,EADwC;AAEhDC,EAAAA,cAFgD;AAGhDC,EAAAA,MAHgD;AAIhDC,EAAAA,OAAO,EAAEC,OAJuC;AAKhDC,EAAAA;AALgD,CAAlC,EAMX;AACH,QAAMC,mBAAmB,GAAG,qBAAaC,MAAF,IAAc;AACpD,UAAM;AAAEC,MAAAA;AAAF,QAAkBD,MAAM,CAAEE,kBAAF,CAA9B;AACA,WAAOD,WAAW,IAAIE,cAAtB;AACA,GAH2B,EAGzB,EAHyB,CAA5B;AAIA,QAAMC,aAAa,GAAG,6BAAY,QAAZ,KAA0B,EAAhD;AACA,QAAMC,UAAU,GAAG,CAAC,CAAEV,MAAH,IAAaA,MAAM,CAACW,OAApB,GAA8BF,aAA9B,GAA8CT,MAAjE;AAEA,QAAM,CAAEY,MAAF,EAAUC,OAAV,EAAmBC,QAAnB,IAAgC,oCACrC,UADqC,EAErC,kBAFqC,EAGrC;AAAEhB,IAAAA;AAAF,GAHqC,CAAtC;AAMA,QAAMiB,gBAAgB,GAAG,sCAAqBZ,UAArB,EAAiC;AACzDa,IAAAA,KAAK,EAAEJ,MADkD;AAEzDC,IAAAA,OAFyD;AAGzDC,IAAAA,QAHyD;AAIzDG,IAAAA,cAAc,EAAElB,cAAc,GAC3BmB,SAD2B,GAE3BC,yBAAYC,mBAN0C;AAOzDC,IAAAA,oBAAoB,EAAEjB,mBAAmB,GAAGM,UAAH,GAAgBQ;AAPA,GAAjC,CAAzB;AAUA,SAAO,4BAAC,OAAD,EAAcH,gBAAd,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tuseSetting,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function TemplatePartInnerBlocks( {\n\tpostId: id,\n\thasInnerBlocks,\n\tlayout,\n\ttagName: TagName,\n\tblockProps,\n} ) {\n\tconst themeSupportsLayout = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings()?.supportsLayout;\n\t}, [] );\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst usedLayout = !! layout && layout.inherit ? defaultLayout : layout;\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\t'wp_template_part',\n\t\t{ id }\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tvalue: blocks,\n\t\tonInput,\n\t\tonChange,\n\t\trenderAppender: hasInnerBlocks\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t\t__experimentalLayout: themeSupportsLayout ? usedLayout : undefined,\n\t} );\n\n\treturn <TagName { ...innerBlocksProps } />;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/inner-blocks.js"],"names":["TemplatePartInnerBlocks","postId","id","hasInnerBlocks","layout","tagName","TagName","blockProps","themeSupportsLayout","select","getSettings","blockEditorStore","supportsLayout","defaultLayout","usedLayout","inherit","blocks","onInput","onChange","innerBlocksProps","value","renderAppender","undefined","InnerBlocks","ButtonBlockAppender"],"mappings":";;;;;;;;;AAGA;;AACA;;AAMA;;AAVA;AACA;AACA;AAUe,SAASA,uBAAT,CAAkC;AAChDC,EAAAA,MAAM,EAAEC,EADwC;AAEhDC,EAAAA,cAFgD;AAGhDC,EAAAA,MAHgD;AAIhDC,EAAAA,OAAO,EAAEC,OAJuC;AAKhDC,EAAAA;AALgD,CAAlC,EAMX;AACH,QAAMC,mBAAmB,GAAG,qBAAaC,MAAF,IAAc;AACpD,UAAM;AAAEC,MAAAA;AAAF,QAAkBD,MAAM,CAAEE,kBAAF,CAA9B;AACA,WAAOD,WAAW,IAAIE,cAAtB;AACA,GAH2B,EAGzB,EAHyB,CAA5B;AAIA,QAAMC,aAAa,GAAG,6BAAY,QAAZ,KAA0B,EAAhD;AACA,QAAMC,UAAU,GAAG,CAAC,CAAEV,MAAH,IAAaA,MAAM,CAACW,OAApB,GAA8BF,aAA9B,GAA8CT,MAAjE;AAEA,QAAM,CAAEY,MAAF,EAAUC,OAAV,EAAmBC,QAAnB,IAAgC,oCACrC,UADqC,EAErC,kBAFqC,EAGrC;AAAEhB,IAAAA;AAAF,GAHqC,CAAtC;AAMA,QAAMiB,gBAAgB,GAAG,sCAAqBZ,UAArB,EAAiC;AACzDa,IAAAA,KAAK,EAAEJ,MADkD;AAEzDC,IAAAA,OAFyD;AAGzDC,IAAAA,QAHyD;AAIzDG,IAAAA,cAAc,EAAElB,cAAc,GAC3BmB,SAD2B,GAE3BC,yBAAYC,mBAN0C;AAOzDpB,IAAAA,MAAM,EAAEI,mBAAmB,GAAGM,UAAH,GAAgBQ;AAPc,GAAjC,CAAzB;AAUA,SAAO,4BAAC,OAAD,OAAcH;AAAd,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tuseSetting,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function TemplatePartInnerBlocks( {\n\tpostId: id,\n\thasInnerBlocks,\n\tlayout,\n\ttagName: TagName,\n\tblockProps,\n} ) {\n\tconst themeSupportsLayout = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings()?.supportsLayout;\n\t}, [] );\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst usedLayout = !! layout && layout.inherit ? defaultLayout : layout;\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\t'wp_template_part',\n\t\t{ id }\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tvalue: blocks,\n\t\tonInput,\n\t\tonChange,\n\t\trenderAppender: hasInnerBlocks\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t\tlayout: themeSupportsLayout ? usedLayout : undefined,\n\t} );\n\n\treturn <TagName { ...innerBlocksProps } />;\n}\n"]}
@@ -59,7 +59,6 @@ const metadata = {
59
59
  }
60
60
  },
61
61
  supports: {
62
- anchor: true,
63
62
  align: true,
64
63
  html: false,
65
64
  reusable: false
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/template-part/index.js"],"names":["name","metadata","settings","icon","symbolFilled","__experimentalLabel","slug","theme","entity","coreDataStore","getEntityRecord","title","rendered","edit","init","enhanceTemplatePartVariations","DISALLOWED_PARENTS","canInsert","blockType","rootClientId","getBlock","getBlockParentsByBlockName","disallowedParentType","hasDisallowedParent","length"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAEA;;AACA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAEC,mBADiB;AAEvBC,EAAAA,mBAAmB,EAAE,CAAE;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAF,KAAuB;AAC3C;AACA;AACA,QAAK,CAAED,IAAP,EAAc;AACb;AACA;;AAED,UAAME,MAAM,GAAG,kBAAQC,eAAR,EAAwBC,eAAxB,CACd,UADc,EAEd,kBAFc,EAGdH,KAAK,GAAG,IAAR,GAAeD,IAHD,CAAf;;AAKA,QAAK,CAAEE,MAAP,EAAgB;AACf;AACA;;AAED,WACC,kCAAgBA,MAAM,CAACG,KAAP,EAAcC,QAA9B,KACA,6BAAaJ,MAAM,CAACF,IAApB,CAFD;AAIA,GAtBsB;AAuBvBO,EAAAA,IAAI,EAAJA;AAvBuB,CAAjB;;;AA0BA,MAAMC,IAAI,GAAG,MAAM;AACzB,wBACC,0BADD,EAEC,oBAFD,EAGCC,yCAHD,EADyB,CAOzB;;AACA,QAAMC,kBAAkB,GAAG,CAAE,oBAAF,EAAwB,mBAAxB,CAA3B;AACA,wBACC,0CADD,EAEC,sCAFD,EAGC,CACCC,SADD,EAECC,SAFD,EAGCC,YAHD,EAIC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAJD,KAKK;AACJ,QAAKH,SAAS,CAAClB,IAAV,KAAmB,oBAAxB,EAA+C;AAC9C,aAAOiB,SAAP;AACA;;AAED,SAAM,MAAMK,oBAAZ,IAAoCN,kBAApC,EAAyD;AACxD,YAAMO,mBAAmB,GACxBH,QAAQ,CAAED,YAAF,CAAR,EAA0BnB,IAA1B,KAAmCsB,oBAAnC,IACAD,0BAA0B,CACzBF,YADyB,EAEzBG,oBAFyB,CAA1B,CAGEE,MALH;;AAMA,UAAKD,mBAAL,EAA2B;AAC1B,eAAO,KAAP;AACA;AACD;;AACD,WAAO,IAAP;AACA,GAzBF;AA4BA,SAAO,wBAAW;AAAEvB,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,GAAX,CAAP;AACA,CAtCM","sourcesContent":["/**\n * External dependencies\n */\nimport { capitalCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport { symbolFilled } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport { enhanceTemplatePartVariations } from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: symbolFilled,\n\t__experimentalLabel: ( { slug, theme } ) => {\n\t\t// Attempt to find entity title if block is a template part.\n\t\t// Require slug to request, otherwise entity is uncreated and will throw 404.\n\t\tif ( ! slug ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst entity = select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\ttheme + '//' + slug\n\t\t);\n\t\tif ( ! entity ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\tdecodeEntities( entity.title?.rendered ) ||\n\t\t\tcapitalCase( entity.slug )\n\t\t);\n\t},\n\tedit,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/template-part',\n\t\tenhanceTemplatePartVariations\n\t);\n\n\t// Prevent adding template parts inside post templates.\n\tconst DISALLOWED_PARENTS = [ 'core/post-template', 'core/post-content' ];\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromPostTemplates',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlock, getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif ( blockType.name !== 'core/template-part' ) {\n\t\t\t\treturn canInsert;\n\t\t\t}\n\n\t\t\tfor ( const disallowedParentType of DISALLOWED_PARENTS ) {\n\t\t\t\tconst hasDisallowedParent =\n\t\t\t\t\tgetBlock( rootClientId )?.name === disallowedParentType ||\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\tdisallowedParentType\n\t\t\t\t\t).length;\n\t\t\t\tif ( hasDisallowedParent ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/template-part/index.js"],"names":["name","metadata","settings","icon","symbolFilled","__experimentalLabel","slug","theme","entity","coreDataStore","getEntityRecord","title","rendered","edit","init","enhanceTemplatePartVariations","DISALLOWED_PARENTS","canInsert","blockType","rootClientId","getBlock","getBlockParentsByBlockName","disallowedParentType","hasDisallowedParent","length"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAEA;;AACA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAEC,mBADiB;AAEvBC,EAAAA,mBAAmB,EAAE,CAAE;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAF,KAAuB;AAC3C;AACA;AACA,QAAK,CAAED,IAAP,EAAc;AACb;AACA;;AAED,UAAME,MAAM,GAAG,kBAAQC,eAAR,EAAwBC,eAAxB,CACd,UADc,EAEd,kBAFc,EAGdH,KAAK,GAAG,IAAR,GAAeD,IAHD,CAAf;;AAKA,QAAK,CAAEE,MAAP,EAAgB;AACf;AACA;;AAED,WACC,kCAAgBA,MAAM,CAACG,KAAP,EAAcC,QAA9B,KACA,6BAAaJ,MAAM,CAACF,IAApB,CAFD;AAIA,GAtBsB;AAuBvBO,EAAAA,IAAI,EAAJA;AAvBuB,CAAjB;;;AA0BA,MAAMC,IAAI,GAAG,MAAM;AACzB,wBACC,0BADD,EAEC,oBAFD,EAGCC,yCAHD,EADyB,CAOzB;;AACA,QAAMC,kBAAkB,GAAG,CAAE,oBAAF,EAAwB,mBAAxB,CAA3B;AACA,wBACC,0CADD,EAEC,sCAFD,EAGC,CACCC,SADD,EAECC,SAFD,EAGCC,YAHD,EAIC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAJD,KAKK;AACJ,QAAKH,SAAS,CAAClB,IAAV,KAAmB,oBAAxB,EAA+C;AAC9C,aAAOiB,SAAP;AACA;;AAED,SAAM,MAAMK,oBAAZ,IAAoCN,kBAApC,EAAyD;AACxD,YAAMO,mBAAmB,GACxBH,QAAQ,CAAED,YAAF,CAAR,EAA0BnB,IAA1B,KAAmCsB,oBAAnC,IACAD,0BAA0B,CACzBF,YADyB,EAEzBG,oBAFyB,CAA1B,CAGEE,MALH;;AAMA,UAAKD,mBAAL,EAA2B;AAC1B,eAAO,KAAP;AACA;AACD;;AACD,WAAO,IAAP;AACA,GAzBF;AA4BA,SAAO,wBAAW;AAAEvB,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,GAAX,CAAP;AACA,CAtCM","sourcesContent":["/**\n * External dependencies\n */\nimport { capitalCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport { symbolFilled } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport { enhanceTemplatePartVariations } from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: symbolFilled,\n\t__experimentalLabel: ( { slug, theme } ) => {\n\t\t// Attempt to find entity title if block is a template part.\n\t\t// Require slug to request, otherwise entity is uncreated and will throw 404.\n\t\tif ( ! slug ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst entity = select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\ttheme + '//' + slug\n\t\t);\n\t\tif ( ! entity ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\tdecodeEntities( entity.title?.rendered ) ||\n\t\t\tcapitalCase( entity.slug )\n\t\t);\n\t},\n\tedit,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/template-part',\n\t\tenhanceTemplatePartVariations\n\t);\n\n\t// Prevent adding template parts inside post templates.\n\tconst DISALLOWED_PARENTS = [ 'core/post-template', 'core/post-content' ];\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromPostTemplates',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlock, getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif ( blockType.name !== 'core/template-part' ) {\n\t\t\t\treturn canInsert;\n\t\t\t}\n\n\t\t\tfor ( const disallowedParentType of DISALLOWED_PARENTS ) {\n\t\t\t\tconst hasDisallowedParent =\n\t\t\t\t\tgetBlock( rootClientId )?.name === disallowedParentType ||\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\tdisallowedParentType\n\t\t\t\t\t).length;\n\t\t\t\tif ( hasDisallowedParent ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"]}
@@ -45,7 +45,8 @@ function TermDescriptionEdit({
45
45
  textAlign: nextAlign
46
46
  });
47
47
  }
48
- })), (0, _element.createElement)("div", blockProps, (0, _element.createElement)("div", {
48
+ })), (0, _element.createElement)("div", { ...blockProps
49
+ }, (0, _element.createElement)("div", {
49
50
  className: "wp-block-term-description__placeholder"
50
51
  }, (0, _element.createElement)("span", null, (0, _i18n.__)('Term Description')))));
51
52
  }