@wordpress/block-library 7.11.0 → 7.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (817) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/build/archives/edit.js +7 -0
  3. package/build/archives/edit.js.map +1 -1
  4. package/build/archives/index.js +9 -1
  5. package/build/archives/index.js.map +1 -1
  6. package/build/audio/index.js +4 -0
  7. package/build/audio/index.js.map +1 -1
  8. package/build/block/edit.js +4 -2
  9. package/build/block/edit.js.map +1 -1
  10. package/build/block/edit.native.js +4 -2
  11. package/build/block/edit.native.js.map +1 -1
  12. package/build/button/deprecated.js +14 -5
  13. package/build/button/deprecated.js.map +1 -1
  14. package/build/button/index.js +1 -1
  15. package/build/calendar/edit.js +12 -5
  16. package/build/calendar/edit.js.map +1 -1
  17. package/build/categories/edit.js +3 -1
  18. package/build/categories/edit.js.map +1 -1
  19. package/build/categories/index.js +14 -1
  20. package/build/categories/index.js.map +1 -1
  21. package/build/code/index.js +4 -2
  22. package/build/code/index.js.map +1 -1
  23. package/build/column/index.js +13 -0
  24. package/build/column/index.js.map +1 -1
  25. package/build/columns/deprecated.js +16 -5
  26. package/build/columns/deprecated.js.map +1 -1
  27. package/build/columns/edit.js +6 -2
  28. package/build/columns/edit.js.map +1 -1
  29. package/build/columns/edit.native.js +8 -3
  30. package/build/columns/edit.native.js.map +1 -1
  31. package/build/columns/index.js +13 -0
  32. package/build/columns/index.js.map +1 -1
  33. package/build/comment-author-name/index.js +5 -1
  34. package/build/comment-author-name/index.js.map +1 -1
  35. package/build/comment-content/index.js +5 -1
  36. package/build/comment-content/index.js.map +1 -1
  37. package/build/comment-date/index.js +1 -0
  38. package/build/comment-date/index.js.map +1 -1
  39. package/build/comment-edit-link/index.js +5 -1
  40. package/build/comment-edit-link/index.js.map +1 -1
  41. package/build/comment-reply-link/index.js +5 -1
  42. package/build/comment-reply-link/index.js.map +1 -1
  43. package/build/comment-template/index.js +14 -1
  44. package/build/comment-template/index.js.map +1 -1
  45. package/build/comments/index.js +13 -0
  46. package/build/comments/index.js.map +1 -1
  47. package/build/comments-pagination/index.js +13 -0
  48. package/build/comments-pagination/index.js.map +1 -1
  49. package/build/comments-pagination-next/index.js +4 -2
  50. package/build/comments-pagination-next/index.js.map +1 -1
  51. package/build/comments-pagination-numbers/edit.js +5 -1
  52. package/build/comments-pagination-numbers/edit.js.map +1 -1
  53. package/build/comments-pagination-numbers/index.js +14 -1
  54. package/build/comments-pagination-numbers/index.js.map +1 -1
  55. package/build/comments-pagination-previous/index.js +4 -2
  56. package/build/comments-pagination-previous/index.js.map +1 -1
  57. package/build/comments-title/deprecated.js +4 -2
  58. package/build/comments-title/deprecated.js.map +1 -1
  59. package/build/comments-title/index.js +4 -2
  60. package/build/comments-title/index.js.map +1 -1
  61. package/build/cover/deprecated.js +20 -5
  62. package/build/cover/deprecated.js.map +1 -1
  63. package/build/cover/edit/resizable-cover.js +6 -0
  64. package/build/cover/edit/resizable-cover.js.map +1 -1
  65. package/build/cover/index.js +13 -0
  66. package/build/cover/index.js.map +1 -1
  67. package/build/cover/shared.js +1 -1
  68. package/build/cover/shared.js.map +1 -1
  69. package/build/embed/icons.js +1 -1
  70. package/build/embed/icons.js.map +1 -1
  71. package/build/gallery/deprecated.js +6 -1
  72. package/build/gallery/deprecated.js.map +1 -1
  73. package/build/gallery/edit.js +15 -2
  74. package/build/gallery/edit.js.map +1 -1
  75. package/build/gallery/index.js +5 -0
  76. package/build/gallery/index.js.map +1 -1
  77. package/build/gallery/transforms.js +20 -7
  78. package/build/gallery/transforms.js.map +1 -1
  79. package/build/gallery/utils.js +7 -6
  80. package/build/gallery/utils.js.map +1 -1
  81. package/build/group/deprecated.js +108 -12
  82. package/build/group/deprecated.js.map +1 -1
  83. package/build/group/edit.js +23 -1
  84. package/build/group/edit.js.map +1 -1
  85. package/build/group/index.js +10 -2
  86. package/build/group/index.js.map +1 -1
  87. package/build/group/transforms.js +5 -0
  88. package/build/group/transforms.js.map +1 -1
  89. package/build/group/variations.js +8 -8
  90. package/build/group/variations.js.map +1 -1
  91. package/build/heading/deprecated.js +5 -3
  92. package/build/heading/deprecated.js.map +1 -1
  93. package/build/heading/index.js +3 -1
  94. package/build/heading/index.js.map +1 -1
  95. package/build/heading/transforms.js +3 -1
  96. package/build/heading/transforms.js.map +1 -1
  97. package/build/home-link/edit.js +8 -4
  98. package/build/home-link/edit.js.map +1 -1
  99. package/build/image/edit.js +13 -1
  100. package/build/image/edit.js.map +1 -1
  101. package/build/image/index.js +13 -7
  102. package/build/image/index.js.map +1 -1
  103. package/build/index.native.js +23 -7
  104. package/build/index.native.js.map +1 -1
  105. package/build/list/index.js +10 -0
  106. package/build/list/index.js.map +1 -1
  107. package/build/list/v2/edit.js +16 -5
  108. package/build/list/v2/edit.js.map +1 -1
  109. package/build/list/v2/tag-name.js +31 -0
  110. package/build/list/v2/tag-name.js.map +1 -0
  111. package/build/list/v2/tag-name.native.js +32 -0
  112. package/build/list/v2/tag-name.native.js.map +1 -0
  113. package/build/list/v2/transforms.js +1 -11
  114. package/build/list/v2/transforms.js.map +1 -1
  115. package/build/list-item/edit.js +4 -1
  116. package/build/list-item/edit.js.map +1 -1
  117. package/build/list-item/edit.native.js +158 -0
  118. package/build/list-item/edit.native.js.map +1 -0
  119. package/build/list-item/hooks/index.js +8 -0
  120. package/build/list-item/hooks/index.js.map +1 -1
  121. package/build/list-item/hooks/use-copy.js +42 -0
  122. package/build/list-item/hooks/use-copy.js.map +1 -0
  123. package/build/list-item/icons.native.js +53 -0
  124. package/build/list-item/icons.native.js.map +1 -0
  125. package/build/list-item/list-style-type.native.js +139 -0
  126. package/build/list-item/list-style-type.native.js.map +1 -0
  127. package/build/list-item/utils.js +4 -0
  128. package/build/list-item/utils.js.map +1 -1
  129. package/build/media-text/deprecated.js +193 -67
  130. package/build/media-text/deprecated.js.map +1 -1
  131. package/build/media-text/edit.js +2 -1
  132. package/build/media-text/edit.js.map +1 -1
  133. package/build/media-text/index.js +17 -0
  134. package/build/media-text/index.js.map +1 -1
  135. package/build/media-text/media-container.js +1 -1
  136. package/build/media-text/media-container.js.map +1 -1
  137. package/build/navigation/deprecated.js +6 -1
  138. package/build/navigation/deprecated.js.map +1 -1
  139. package/build/navigation/edit/index.js +180 -154
  140. package/build/navigation/edit/index.js.map +1 -1
  141. package/build/navigation/edit/navigation-menu-selector.js +11 -14
  142. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  143. package/build/navigation/edit/placeholder/index.js +4 -2
  144. package/build/navigation/edit/placeholder/index.js.map +1 -1
  145. package/build/navigation/edit/responsive-wrapper.js +13 -3
  146. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  147. package/build/navigation/edit/unsaved-inner-blocks.js +2 -1
  148. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  149. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -7
  150. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  151. package/build/navigation/edit/use-create-navigation-menu.js +5 -1
  152. package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
  153. package/build/navigation/edit/use-inner-blocks.js +43 -0
  154. package/build/navigation/edit/use-inner-blocks.js.map +1 -0
  155. package/build/navigation/edit/utils.js +28 -0
  156. package/build/navigation/edit/utils.js.map +1 -0
  157. package/build/navigation/index.js +1 -0
  158. package/build/navigation/index.js.map +1 -1
  159. package/build/navigation/menu-items-to-blocks.js +1 -7
  160. package/build/navigation/menu-items-to-blocks.js.map +1 -1
  161. package/build/navigation/use-navigation-menu.js +15 -10
  162. package/build/navigation/use-navigation-menu.js.map +1 -1
  163. package/build/navigation-link/edit.js +6 -8
  164. package/build/navigation-link/edit.js.map +1 -1
  165. package/build/navigation-submenu/edit.js +4 -6
  166. package/build/navigation-submenu/edit.js.map +1 -1
  167. package/build/page-list/edit.js +7 -3
  168. package/build/page-list/edit.js.map +1 -1
  169. package/build/paragraph/deprecated.js +18 -10
  170. package/build/paragraph/deprecated.js.map +1 -1
  171. package/build/paragraph/edit.js +1 -0
  172. package/build/paragraph/edit.js.map +1 -1
  173. package/build/paragraph/index.js +7 -0
  174. package/build/paragraph/index.js.map +1 -1
  175. package/build/paragraph/transforms.js +7 -0
  176. package/build/paragraph/transforms.js.map +1 -1
  177. package/build/post-author/edit.js +5 -2
  178. package/build/post-author/edit.js.map +1 -1
  179. package/build/post-author/index.js +4 -2
  180. package/build/post-author/index.js.map +1 -1
  181. package/build/post-author-biography/edit.js +7 -1
  182. package/build/post-author-biography/edit.js.map +1 -1
  183. package/build/post-author-biography/index.js +1 -0
  184. package/build/post-author-biography/index.js.map +1 -1
  185. package/build/post-author-name/index.js +5 -1
  186. package/build/post-author-name/index.js.map +1 -1
  187. package/build/post-comments-count/edit.js +11 -1
  188. package/build/post-comments-count/edit.js.map +1 -1
  189. package/build/post-comments-count/index.js +4 -1
  190. package/build/post-comments-count/index.js.map +1 -1
  191. package/build/post-comments-link/index.js +4 -2
  192. package/build/post-comments-link/index.js.map +1 -1
  193. package/build/post-content/edit.js +4 -2
  194. package/build/post-content/edit.js.map +1 -1
  195. package/build/post-date/edit.js +9 -2
  196. package/build/post-date/edit.js.map +1 -1
  197. package/build/post-date/index.js +9 -0
  198. package/build/post-date/index.js.map +1 -1
  199. package/build/post-featured-image/edit.js +43 -14
  200. package/build/post-featured-image/edit.js.map +1 -1
  201. package/build/post-featured-image/index.js +21 -0
  202. package/build/post-featured-image/index.js.map +1 -1
  203. package/build/post-navigation-link/index.js +3 -2
  204. package/build/post-navigation-link/index.js.map +1 -1
  205. package/build/post-template/edit.js +8 -4
  206. package/build/post-template/edit.js.map +1 -1
  207. package/build/post-template/index.js +14 -1
  208. package/build/post-template/index.js.map +1 -1
  209. package/build/post-terms/index.js +5 -3
  210. package/build/post-terms/index.js.map +1 -1
  211. package/build/post-title/index.js +2 -1
  212. package/build/post-title/index.js.map +1 -1
  213. package/build/preformatted/index.js +4 -2
  214. package/build/preformatted/index.js.map +1 -1
  215. package/build/pullquote/deprecated.js +135 -25
  216. package/build/pullquote/deprecated.js.map +1 -1
  217. package/build/pullquote/edit.js +1 -1
  218. package/build/pullquote/edit.js.map +1 -1
  219. package/build/pullquote/edit.native.js +0 -1
  220. package/build/pullquote/edit.native.js.map +1 -1
  221. package/build/pullquote/index.js +13 -6
  222. package/build/pullquote/index.js.map +1 -1
  223. package/build/pullquote/save.js +2 -2
  224. package/build/pullquote/save.js.map +1 -1
  225. package/build/pullquote/transforms.js +14 -33
  226. package/build/pullquote/transforms.js.map +1 -1
  227. package/build/query/deprecated.js +10 -9
  228. package/build/query/deprecated.js.map +1 -1
  229. package/build/query/edit/index.js +19 -8
  230. package/build/query/edit/index.js.map +1 -1
  231. package/build/query/edit/inspector-controls/index.js +42 -9
  232. package/build/query/edit/inspector-controls/index.js.map +1 -1
  233. package/build/query/edit/inspector-controls/taxonomy-controls.js +22 -14
  234. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  235. package/build/query/edit/query-placeholder.js +6 -1
  236. package/build/query/edit/query-placeholder.js.map +1 -1
  237. package/build/query/utils.js +35 -9
  238. package/build/query/utils.js.map +1 -1
  239. package/build/query-no-results/edit.js +1 -1
  240. package/build/query-no-results/edit.js.map +1 -1
  241. package/build/query-title/edit.js +30 -8
  242. package/build/query-title/edit.js.map +1 -1
  243. package/build/query-title/index.js +11 -2
  244. package/build/query-title/index.js.map +1 -1
  245. package/build/query-title/variations.js +10 -0
  246. package/build/query-title/variations.js.map +1 -1
  247. package/build/quote/deprecated.js +13 -6
  248. package/build/quote/deprecated.js.map +1 -1
  249. package/build/quote/transforms.js +24 -39
  250. package/build/quote/transforms.js.map +1 -1
  251. package/build/separator/deprecated.js +3 -4
  252. package/build/separator/deprecated.js.map +1 -1
  253. package/build/separator/edit.js +1 -1
  254. package/build/separator/edit.js.map +1 -1
  255. package/build/separator/index.js +1 -0
  256. package/build/separator/index.js.map +1 -1
  257. package/build/social-link/icons/reddit.js +1 -1
  258. package/build/social-link/icons/reddit.js.map +1 -1
  259. package/build/social-links/edit.js +44 -9
  260. package/build/social-links/edit.js.map +1 -1
  261. package/build/social-links/index.js +9 -0
  262. package/build/social-links/index.js.map +1 -1
  263. package/build/spacer/index.js +7 -1
  264. package/build/spacer/index.js.map +1 -1
  265. package/build/table/index.js +4 -0
  266. package/build/table/index.js.map +1 -1
  267. package/build/table/state.js +9 -3
  268. package/build/table/state.js.map +1 -1
  269. package/build/table-of-contents/index.js +24 -1
  270. package/build/table-of-contents/index.js.map +1 -1
  271. package/build/tag-cloud/index.js +5 -1
  272. package/build/tag-cloud/index.js.map +1 -1
  273. package/build/template-part/edit/index.js +4 -2
  274. package/build/template-part/edit/index.js.map +1 -1
  275. package/build/template-part/index.js +2 -2
  276. package/build/template-part/index.js.map +1 -1
  277. package/build/term-description/index.js +4 -0
  278. package/build/term-description/index.js.map +1 -1
  279. package/build/text-columns/edit.js +3 -1
  280. package/build/text-columns/edit.js.map +1 -1
  281. package/build/text-columns/save.js +3 -1
  282. package/build/text-columns/save.js.map +1 -1
  283. package/build/verse/index.js +1 -0
  284. package/build/verse/index.js.map +1 -1
  285. package/build/video/index.js +4 -0
  286. package/build/video/index.js.map +1 -1
  287. package/build-module/archives/edit.js +7 -0
  288. package/build-module/archives/edit.js.map +1 -1
  289. package/build-module/archives/index.js +9 -1
  290. package/build-module/archives/index.js.map +1 -1
  291. package/build-module/audio/index.js +4 -0
  292. package/build-module/audio/index.js.map +1 -1
  293. package/build-module/block/edit.js +5 -3
  294. package/build-module/block/edit.js.map +1 -1
  295. package/build-module/block/edit.native.js +5 -3
  296. package/build-module/block/edit.native.js.map +1 -1
  297. package/build-module/button/deprecated.js +14 -4
  298. package/build-module/button/deprecated.js.map +1 -1
  299. package/build-module/button/index.js +1 -1
  300. package/build-module/calendar/edit.js +12 -4
  301. package/build-module/calendar/edit.js.map +1 -1
  302. package/build-module/categories/edit.js +4 -2
  303. package/build-module/categories/edit.js.map +1 -1
  304. package/build-module/categories/index.js +14 -1
  305. package/build-module/categories/index.js.map +1 -1
  306. package/build-module/code/index.js +4 -2
  307. package/build-module/code/index.js.map +1 -1
  308. package/build-module/column/index.js +13 -0
  309. package/build-module/column/index.js.map +1 -1
  310. package/build-module/columns/deprecated.js +16 -4
  311. package/build-module/columns/deprecated.js.map +1 -1
  312. package/build-module/columns/edit.js +7 -3
  313. package/build-module/columns/edit.js.map +1 -1
  314. package/build-module/columns/edit.native.js +9 -4
  315. package/build-module/columns/edit.native.js.map +1 -1
  316. package/build-module/columns/index.js +13 -0
  317. package/build-module/columns/index.js.map +1 -1
  318. package/build-module/comment-author-name/index.js +5 -1
  319. package/build-module/comment-author-name/index.js.map +1 -1
  320. package/build-module/comment-content/index.js +5 -1
  321. package/build-module/comment-content/index.js.map +1 -1
  322. package/build-module/comment-date/index.js +1 -0
  323. package/build-module/comment-date/index.js.map +1 -1
  324. package/build-module/comment-edit-link/index.js +5 -1
  325. package/build-module/comment-edit-link/index.js.map +1 -1
  326. package/build-module/comment-reply-link/index.js +5 -1
  327. package/build-module/comment-reply-link/index.js.map +1 -1
  328. package/build-module/comment-template/index.js +14 -1
  329. package/build-module/comment-template/index.js.map +1 -1
  330. package/build-module/comments/index.js +13 -0
  331. package/build-module/comments/index.js.map +1 -1
  332. package/build-module/comments-pagination/index.js +13 -0
  333. package/build-module/comments-pagination/index.js.map +1 -1
  334. package/build-module/comments-pagination-next/index.js +4 -2
  335. package/build-module/comments-pagination-next/index.js.map +1 -1
  336. package/build-module/comments-pagination-numbers/edit.js +5 -1
  337. package/build-module/comments-pagination-numbers/edit.js.map +1 -1
  338. package/build-module/comments-pagination-numbers/index.js +14 -1
  339. package/build-module/comments-pagination-numbers/index.js.map +1 -1
  340. package/build-module/comments-pagination-previous/index.js +4 -2
  341. package/build-module/comments-pagination-previous/index.js.map +1 -1
  342. package/build-module/comments-title/deprecated.js +4 -2
  343. package/build-module/comments-title/deprecated.js.map +1 -1
  344. package/build-module/comments-title/index.js +4 -2
  345. package/build-module/comments-title/index.js.map +1 -1
  346. package/build-module/cover/deprecated.js +20 -4
  347. package/build-module/cover/deprecated.js.map +1 -1
  348. package/build-module/cover/edit/resizable-cover.js +6 -0
  349. package/build-module/cover/edit/resizable-cover.js.map +1 -1
  350. package/build-module/cover/index.js +13 -0
  351. package/build-module/cover/index.js.map +1 -1
  352. package/build-module/cover/shared.js +1 -1
  353. package/build-module/cover/shared.js.map +1 -1
  354. package/build-module/embed/icons.js +1 -1
  355. package/build-module/embed/icons.js.map +1 -1
  356. package/build-module/gallery/deprecated.js +7 -2
  357. package/build-module/gallery/deprecated.js.map +1 -1
  358. package/build-module/gallery/edit.js +15 -2
  359. package/build-module/gallery/edit.js.map +1 -1
  360. package/build-module/gallery/index.js +5 -0
  361. package/build-module/gallery/index.js.map +1 -1
  362. package/build-module/gallery/transforms.js +20 -7
  363. package/build-module/gallery/transforms.js.map +1 -1
  364. package/build-module/gallery/utils.js +7 -6
  365. package/build-module/gallery/utils.js.map +1 -1
  366. package/build-module/group/deprecated.js +109 -12
  367. package/build-module/group/deprecated.js.map +1 -1
  368. package/build-module/group/edit.js +25 -2
  369. package/build-module/group/edit.js.map +1 -1
  370. package/build-module/group/index.js +10 -2
  371. package/build-module/group/index.js.map +1 -1
  372. package/build-module/group/transforms.js +5 -0
  373. package/build-module/group/transforms.js.map +1 -1
  374. package/build-module/group/variations.js +8 -8
  375. package/build-module/group/variations.js.map +1 -1
  376. package/build-module/heading/deprecated.js +5 -2
  377. package/build-module/heading/deprecated.js.map +1 -1
  378. package/build-module/heading/index.js +3 -1
  379. package/build-module/heading/index.js.map +1 -1
  380. package/build-module/heading/transforms.js +3 -1
  381. package/build-module/heading/transforms.js.map +1 -1
  382. package/build-module/home-link/edit.js +10 -6
  383. package/build-module/home-link/edit.js.map +1 -1
  384. package/build-module/image/edit.js +14 -2
  385. package/build-module/image/edit.js.map +1 -1
  386. package/build-module/image/index.js +13 -7
  387. package/build-module/image/index.js.map +1 -1
  388. package/build-module/index.native.js +22 -6
  389. package/build-module/index.native.js.map +1 -1
  390. package/build-module/list/index.js +5 -1
  391. package/build-module/list/index.js.map +1 -1
  392. package/build-module/list/v2/edit.js +15 -5
  393. package/build-module/list/v2/edit.js.map +1 -1
  394. package/build-module/list/v2/tag-name.js +21 -0
  395. package/build-module/list/v2/tag-name.js.map +1 -0
  396. package/build-module/list/v2/tag-name.native.js +21 -0
  397. package/build-module/list/v2/tag-name.native.js.map +1 -0
  398. package/build-module/list/v2/transforms.js +1 -10
  399. package/build-module/list/v2/transforms.js.map +1 -1
  400. package/build-module/list-item/edit.js +5 -5
  401. package/build-module/list-item/edit.js.map +1 -1
  402. package/build-module/list-item/edit.native.js +141 -0
  403. package/build-module/list-item/edit.native.js.map +1 -0
  404. package/build-module/list-item/hooks/index.js +1 -0
  405. package/build-module/list-item/hooks/index.js.map +1 -1
  406. package/build-module/list-item/hooks/use-copy.js +32 -0
  407. package/build-module/list-item/hooks/use-copy.js.map +1 -0
  408. package/build-module/list-item/icons.native.js +37 -0
  409. package/build-module/list-item/icons.native.js.map +1 -0
  410. package/build-module/list-item/list-style-type.native.js +126 -0
  411. package/build-module/list-item/list-style-type.native.js.map +1 -0
  412. package/build-module/list-item/utils.js +4 -0
  413. package/build-module/list-item/utils.js.map +1 -1
  414. package/build-module/media-text/deprecated.js +195 -67
  415. package/build-module/media-text/deprecated.js.map +1 -1
  416. package/build-module/media-text/edit.js +2 -1
  417. package/build-module/media-text/edit.js.map +1 -1
  418. package/build-module/media-text/index.js +17 -0
  419. package/build-module/media-text/index.js.map +1 -1
  420. package/build-module/media-text/media-container.js +1 -1
  421. package/build-module/media-text/media-container.js.map +1 -1
  422. package/build-module/navigation/deprecated.js +7 -2
  423. package/build-module/navigation/deprecated.js.map +1 -1
  424. package/build-module/navigation/edit/index.js +178 -154
  425. package/build-module/navigation/edit/index.js.map +1 -1
  426. package/build-module/navigation/edit/navigation-menu-selector.js +12 -15
  427. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  428. package/build-module/navigation/edit/placeholder/index.js +4 -2
  429. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  430. package/build-module/navigation/edit/responsive-wrapper.js +12 -3
  431. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  432. package/build-module/navigation/edit/unsaved-inner-blocks.js +2 -1
  433. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  434. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -7
  435. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  436. package/build-module/navigation/edit/use-create-navigation-menu.js +5 -1
  437. package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
  438. package/build-module/navigation/edit/use-inner-blocks.js +33 -0
  439. package/build-module/navigation/edit/use-inner-blocks.js.map +1 -0
  440. package/build-module/navigation/edit/utils.js +21 -0
  441. package/build-module/navigation/edit/utils.js.map +1 -0
  442. package/build-module/navigation/index.js +1 -0
  443. package/build-module/navigation/index.js.map +1 -1
  444. package/build-module/navigation/menu-items-to-blocks.js +1 -6
  445. package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
  446. package/build-module/navigation/use-navigation-menu.js +15 -10
  447. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  448. package/build-module/navigation-link/edit.js +7 -9
  449. package/build-module/navigation-link/edit.js.map +1 -1
  450. package/build-module/navigation-submenu/edit.js +5 -7
  451. package/build-module/navigation-submenu/edit.js.map +1 -1
  452. package/build-module/page-list/edit.js +7 -2
  453. package/build-module/page-list/edit.js.map +1 -1
  454. package/build-module/paragraph/deprecated.js +18 -9
  455. package/build-module/paragraph/deprecated.js.map +1 -1
  456. package/build-module/paragraph/edit.js +1 -0
  457. package/build-module/paragraph/edit.js.map +1 -1
  458. package/build-module/paragraph/index.js +7 -0
  459. package/build-module/paragraph/index.js.map +1 -1
  460. package/build-module/paragraph/transforms.js +7 -0
  461. package/build-module/paragraph/transforms.js.map +1 -1
  462. package/build-module/post-author/edit.js +5 -2
  463. package/build-module/post-author/edit.js.map +1 -1
  464. package/build-module/post-author/index.js +4 -2
  465. package/build-module/post-author/index.js.map +1 -1
  466. package/build-module/post-author-biography/edit.js +6 -1
  467. package/build-module/post-author-biography/edit.js.map +1 -1
  468. package/build-module/post-author-biography/index.js +1 -0
  469. package/build-module/post-author-biography/index.js.map +1 -1
  470. package/build-module/post-author-name/index.js +5 -1
  471. package/build-module/post-author-name/index.js.map +1 -1
  472. package/build-module/post-comments-count/edit.js +10 -1
  473. package/build-module/post-comments-count/edit.js.map +1 -1
  474. package/build-module/post-comments-count/index.js +4 -1
  475. package/build-module/post-comments-count/index.js.map +1 -1
  476. package/build-module/post-comments-link/index.js +4 -2
  477. package/build-module/post-comments-link/index.js.map +1 -1
  478. package/build-module/post-content/edit.js +5 -3
  479. package/build-module/post-content/edit.js.map +1 -1
  480. package/build-module/post-date/edit.js +9 -2
  481. package/build-module/post-date/edit.js.map +1 -1
  482. package/build-module/post-date/index.js +9 -0
  483. package/build-module/post-date/index.js.map +1 -1
  484. package/build-module/post-featured-image/edit.js +45 -16
  485. package/build-module/post-featured-image/edit.js.map +1 -1
  486. package/build-module/post-featured-image/index.js +21 -0
  487. package/build-module/post-featured-image/index.js.map +1 -1
  488. package/build-module/post-navigation-link/index.js +3 -2
  489. package/build-module/post-navigation-link/index.js.map +1 -1
  490. package/build-module/post-template/edit.js +8 -4
  491. package/build-module/post-template/edit.js.map +1 -1
  492. package/build-module/post-template/index.js +14 -1
  493. package/build-module/post-template/index.js.map +1 -1
  494. package/build-module/post-terms/index.js +5 -3
  495. package/build-module/post-terms/index.js.map +1 -1
  496. package/build-module/post-title/index.js +2 -1
  497. package/build-module/post-title/index.js.map +1 -1
  498. package/build-module/preformatted/index.js +4 -2
  499. package/build-module/preformatted/index.js.map +1 -1
  500. package/build-module/pullquote/deprecated.js +134 -25
  501. package/build-module/pullquote/deprecated.js.map +1 -1
  502. package/build-module/pullquote/edit.js +1 -1
  503. package/build-module/pullquote/edit.js.map +1 -1
  504. package/build-module/pullquote/edit.native.js +0 -1
  505. package/build-module/pullquote/edit.native.js.map +1 -1
  506. package/build-module/pullquote/index.js +13 -6
  507. package/build-module/pullquote/index.js.map +1 -1
  508. package/build-module/pullquote/save.js +2 -2
  509. package/build-module/pullquote/save.js.map +1 -1
  510. package/build-module/pullquote/transforms.js +15 -34
  511. package/build-module/pullquote/transforms.js.map +1 -1
  512. package/build-module/query/deprecated.js +10 -8
  513. package/build-module/query/deprecated.js.map +1 -1
  514. package/build-module/query/edit/index.js +23 -12
  515. package/build-module/query/edit/index.js.map +1 -1
  516. package/build-module/query/edit/inspector-controls/index.js +42 -9
  517. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  518. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +17 -12
  519. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  520. package/build-module/query/edit/query-placeholder.js +6 -1
  521. package/build-module/query/edit/query-placeholder.js.map +1 -1
  522. package/build-module/query/utils.js +32 -7
  523. package/build-module/query/utils.js.map +1 -1
  524. package/build-module/query-no-results/edit.js +1 -1
  525. package/build-module/query-no-results/edit.js.map +1 -1
  526. package/build-module/query-title/edit.js +30 -9
  527. package/build-module/query-title/edit.js.map +1 -1
  528. package/build-module/query-title/index.js +11 -2
  529. package/build-module/query-title/index.js.map +1 -1
  530. package/build-module/query-title/variations.js +10 -0
  531. package/build-module/query-title/variations.js.map +1 -1
  532. package/build-module/quote/deprecated.js +13 -5
  533. package/build-module/quote/deprecated.js.map +1 -1
  534. package/build-module/quote/transforms.js +25 -40
  535. package/build-module/quote/transforms.js.map +1 -1
  536. package/build-module/separator/deprecated.js +3 -3
  537. package/build-module/separator/deprecated.js.map +1 -1
  538. package/build-module/separator/edit.js +1 -1
  539. package/build-module/separator/edit.js.map +1 -1
  540. package/build-module/separator/index.js +1 -0
  541. package/build-module/separator/index.js.map +1 -1
  542. package/build-module/social-link/icons/reddit.js +1 -1
  543. package/build-module/social-link/icons/reddit.js.map +1 -1
  544. package/build-module/social-links/edit.js +46 -12
  545. package/build-module/social-links/edit.js.map +1 -1
  546. package/build-module/social-links/index.js +9 -0
  547. package/build-module/social-links/index.js.map +1 -1
  548. package/build-module/spacer/index.js +7 -1
  549. package/build-module/spacer/index.js.map +1 -1
  550. package/build-module/table/index.js +4 -0
  551. package/build-module/table/index.js.map +1 -1
  552. package/build-module/table/state.js +10 -4
  553. package/build-module/table/state.js.map +1 -1
  554. package/build-module/table-of-contents/index.js +24 -1
  555. package/build-module/table-of-contents/index.js.map +1 -1
  556. package/build-module/tag-cloud/index.js +5 -1
  557. package/build-module/tag-cloud/index.js.map +1 -1
  558. package/build-module/template-part/edit/index.js +5 -3
  559. package/build-module/template-part/edit/index.js.map +1 -1
  560. package/build-module/template-part/index.js +2 -2
  561. package/build-module/template-part/index.js.map +1 -1
  562. package/build-module/term-description/index.js +4 -0
  563. package/build-module/term-description/index.js.map +1 -1
  564. package/build-module/text-columns/edit.js +4 -2
  565. package/build-module/text-columns/edit.js.map +1 -1
  566. package/build-module/text-columns/save.js +4 -2
  567. package/build-module/text-columns/save.js.map +1 -1
  568. package/build-module/verse/index.js +1 -0
  569. package/build-module/verse/index.js.map +1 -1
  570. package/build-module/video/index.js +4 -0
  571. package/build-module/video/index.js.map +1 -1
  572. package/build-style/audio/style-rtl.css +3 -0
  573. package/build-style/audio/style.css +3 -0
  574. package/build-style/button/style-rtl.css +6 -6
  575. package/build-style/button/style.css +6 -6
  576. package/build-style/editor-rtl.css +115 -122
  577. package/build-style/editor.css +115 -122
  578. package/build-style/group/editor-rtl.css +27 -8
  579. package/build-style/group/editor.css +27 -8
  580. package/build-style/image/editor-rtl.css +21 -2
  581. package/build-style/image/editor.css +21 -2
  582. package/build-style/latest-posts/editor-rtl.css +3 -0
  583. package/build-style/latest-posts/editor.css +3 -0
  584. package/build-style/media-text/style-rtl.css +1 -0
  585. package/build-style/media-text/style.css +1 -0
  586. package/build-style/navigation/editor-rtl.css +8 -4
  587. package/build-style/navigation/editor.css +8 -4
  588. package/build-style/navigation/style-rtl.css +17 -19
  589. package/build-style/navigation/style.css +17 -19
  590. package/build-style/paragraph/editor-rtl.css +1 -1
  591. package/build-style/paragraph/editor.css +1 -1
  592. package/build-style/post-date/style-rtl.css +79 -0
  593. package/build-style/post-date/style.css +79 -0
  594. package/build-style/post-featured-image/editor-rtl.css +45 -43
  595. package/build-style/post-featured-image/editor.css +45 -43
  596. package/build-style/post-featured-image/style-rtl.css +1 -0
  597. package/build-style/post-featured-image/style.css +1 -0
  598. package/build-style/post-title/style-rtl.css +1 -0
  599. package/build-style/post-title/style.css +1 -0
  600. package/build-style/pullquote/editor-rtl.css +0 -12
  601. package/build-style/pullquote/editor.css +0 -12
  602. package/build-style/pullquote/style-rtl.css +1 -8
  603. package/build-style/pullquote/style.css +1 -8
  604. package/build-style/query/editor-rtl.css +7 -0
  605. package/build-style/query/editor.css +7 -0
  606. package/build-style/query-pagination/style-rtl.css +6 -0
  607. package/build-style/query-pagination/style.css +6 -0
  608. package/build-style/query-title/style-rtl.css +79 -0
  609. package/build-style/query-title/style.css +79 -0
  610. package/build-style/search/style-rtl.css +2 -0
  611. package/build-style/search/style.css +2 -0
  612. package/build-style/site-logo/editor-rtl.css +3 -52
  613. package/build-style/site-logo/editor.css +3 -52
  614. package/build-style/social-links/style-rtl.css +2 -2
  615. package/build-style/social-links/style.css +2 -2
  616. package/build-style/style-rtl.css +52 -35
  617. package/build-style/style.css +52 -35
  618. package/build-style/tag-cloud/style-rtl.css +1 -0
  619. package/build-style/tag-cloud/style.css +1 -0
  620. package/build-style/video/style-rtl.css +3 -0
  621. package/build-style/video/style.css +3 -0
  622. package/package.json +30 -30
  623. package/src/archives/block.json +9 -1
  624. package/src/archives/edit.js +12 -1
  625. package/src/archives/index.php +5 -3
  626. package/src/audio/block.json +4 -0
  627. package/src/audio/style.scss +2 -0
  628. package/src/audio/test/__snapshots__/edit.native.js.snap +16 -2
  629. package/src/block/edit.js +4 -4
  630. package/src/block/edit.native.js +4 -4
  631. package/src/button/block.json +1 -1
  632. package/src/button/deprecated.js +21 -22
  633. package/src/button/style.scss +6 -6
  634. package/src/calendar/edit.js +11 -4
  635. package/src/calendar/index.php +2 -2
  636. package/src/categories/block.json +14 -1
  637. package/src/categories/edit.js +2 -2
  638. package/src/code/block.json +4 -2
  639. package/src/column/block.json +13 -0
  640. package/src/columns/block.json +13 -0
  641. package/src/columns/deprecated.js +10 -4
  642. package/src/columns/edit.js +7 -3
  643. package/src/columns/edit.native.js +10 -4
  644. package/src/comment-author-name/block.json +5 -1
  645. package/src/comment-content/block.json +5 -1
  646. package/src/comment-date/block.json +1 -0
  647. package/src/comment-edit-link/block.json +5 -1
  648. package/src/comment-reply-link/block.json +5 -1
  649. package/src/comment-template/block.json +14 -1
  650. package/src/comments/block.json +13 -0
  651. package/src/comments/index.php +6 -5
  652. package/src/comments-pagination/block.json +13 -0
  653. package/src/comments-pagination-next/block.json +4 -2
  654. package/src/comments-pagination-numbers/block.json +14 -1
  655. package/src/comments-pagination-numbers/edit.js +12 -3
  656. package/src/comments-pagination-previous/block.json +4 -2
  657. package/src/comments-title/block.json +4 -2
  658. package/src/cover/block.json +13 -0
  659. package/src/cover/deprecated.js +11 -4
  660. package/src/cover/edit/resizable-cover.js +6 -0
  661. package/src/cover/index.php +2 -2
  662. package/src/cover/shared.js +2 -1
  663. package/src/embed/icons.js +1 -1
  664. package/src/file/test/__snapshots__/edit.native.js.snap +32 -4
  665. package/src/gallery/block.json +5 -0
  666. package/src/gallery/deprecated.js +4 -2
  667. package/src/gallery/edit.js +22 -2
  668. package/src/gallery/transforms.js +18 -5
  669. package/src/gallery/utils.js +11 -7
  670. package/src/group/block.json +10 -2
  671. package/src/group/deprecated.js +89 -2
  672. package/src/group/edit.js +15 -2
  673. package/src/group/editor.scss +28 -3
  674. package/src/group/transforms.js +7 -0
  675. package/src/group/variations.js +4 -3
  676. package/src/heading/block.json +3 -1
  677. package/src/heading/deprecated.js +4 -2
  678. package/src/home-link/edit.js +19 -20
  679. package/src/home-link/index.php +8 -17
  680. package/src/image/block.json +13 -7
  681. package/src/image/edit.js +19 -1
  682. package/src/image/editor.scss +39 -3
  683. package/src/image/index.php +1 -1
  684. package/src/image/test/edit.native.js +6 -10
  685. package/src/index.native.js +30 -12
  686. package/src/latest-posts/editor.scss +5 -0
  687. package/src/list/block.json +4 -0
  688. package/src/list/index.js +1 -1
  689. package/src/list/test/__snapshots__/edit.native.js.snap +133 -0
  690. package/src/list/test/edit.native.js +511 -7
  691. package/src/list/v2/edit.js +12 -4
  692. package/src/list/v2/tag-name.js +13 -0
  693. package/src/list/v2/tag-name.native.js +12 -0
  694. package/src/list/v2/transforms.js +1 -9
  695. package/src/list-item/edit.js +3 -2
  696. package/src/list-item/edit.native.js +148 -0
  697. package/src/list-item/hooks/index.js +1 -0
  698. package/src/list-item/hooks/use-copy.js +36 -0
  699. package/src/list-item/icons.native.js +34 -0
  700. package/src/list-item/list-style-type.native.js +146 -0
  701. package/src/list-item/style.native.scss +49 -0
  702. package/src/media-text/block.json +17 -0
  703. package/src/media-text/deprecated.js +564 -417
  704. package/src/media-text/edit.js +1 -0
  705. package/src/media-text/media-container.js +3 -1
  706. package/src/media-text/style.scss +2 -0
  707. package/src/media-text/test/media-container.js +24 -0
  708. package/src/navigation/block.json +1 -0
  709. package/src/navigation/deprecated.js +4 -2
  710. package/src/navigation/edit/index.js +234 -237
  711. package/src/navigation/edit/navigation-menu-selector.js +12 -26
  712. package/src/navigation/edit/placeholder/index.js +4 -2
  713. package/src/navigation/edit/responsive-wrapper.js +24 -3
  714. package/src/navigation/edit/unsaved-inner-blocks.js +3 -1
  715. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +31 -37
  716. package/src/navigation/edit/use-create-navigation-menu.js +4 -0
  717. package/src/navigation/edit/use-inner-blocks.js +39 -0
  718. package/src/navigation/edit/utils.js +30 -0
  719. package/src/navigation/editor.scss +3 -2
  720. package/src/navigation/index.php +17 -16
  721. package/src/navigation/menu-items-to-blocks.js +3 -6
  722. package/src/navigation/style.scss +13 -22
  723. package/src/navigation/test/use-navigation-menu.js +18 -1
  724. package/src/navigation/use-navigation-menu.js +20 -13
  725. package/src/navigation-link/edit.js +9 -13
  726. package/src/navigation-link/index.php +1 -1
  727. package/src/navigation-submenu/edit.js +9 -13
  728. package/src/navigation-submenu/index.php +1 -1
  729. package/src/page-list/edit.js +6 -2
  730. package/src/page-list/index.php +4 -4
  731. package/src/paragraph/block.json +7 -0
  732. package/src/paragraph/deprecated.js +33 -35
  733. package/src/paragraph/edit.js +1 -0
  734. package/src/paragraph/editor.scss +5 -3
  735. package/src/post-author/block.json +4 -2
  736. package/src/post-author/edit.js +6 -3
  737. package/src/post-author-biography/block.json +1 -0
  738. package/src/post-author-biography/edit.js +4 -1
  739. package/src/post-author-name/block.json +5 -1
  740. package/src/post-comments-count/block.json +4 -1
  741. package/src/post-comments-count/edit.js +10 -2
  742. package/src/post-comments-link/block.json +4 -2
  743. package/src/post-content/edit.js +4 -4
  744. package/src/post-date/block.json +9 -0
  745. package/src/post-date/edit.js +12 -2
  746. package/src/post-date/index.php +10 -2
  747. package/src/post-date/style.scss +4 -0
  748. package/src/post-featured-image/block.json +21 -0
  749. package/src/post-featured-image/edit.js +66 -14
  750. package/src/post-featured-image/editor.scss +44 -53
  751. package/src/post-featured-image/index.php +64 -5
  752. package/src/post-featured-image/style.scss +1 -0
  753. package/src/post-navigation-link/block.json +3 -2
  754. package/src/post-template/block.json +15 -1
  755. package/src/post-template/edit.js +6 -1
  756. package/src/post-template/index.php +7 -4
  757. package/src/post-terms/block.json +5 -3
  758. package/src/post-title/block.json +2 -1
  759. package/src/post-title/index.php +2 -1
  760. package/src/post-title/style.scss +2 -0
  761. package/src/preformatted/block.json +4 -2
  762. package/src/preformatted/test/__snapshots__/edit.native.js.snap +16 -2
  763. package/src/pullquote/block.json +11 -4
  764. package/src/pullquote/deprecated.js +490 -412
  765. package/src/pullquote/edit.js +1 -1
  766. package/src/pullquote/edit.native.js +0 -1
  767. package/src/pullquote/editor.scss +0 -16
  768. package/src/pullquote/index.js +1 -3
  769. package/src/pullquote/save.js +1 -1
  770. package/src/pullquote/style.scss +0 -11
  771. package/src/pullquote/transforms.js +17 -33
  772. package/src/query/deprecated.js +4 -9
  773. package/src/query/edit/index.js +28 -15
  774. package/src/query/edit/inspector-controls/index.js +129 -65
  775. package/src/query/edit/inspector-controls/taxonomy-controls.js +18 -11
  776. package/src/query/edit/query-placeholder.js +17 -2
  777. package/src/query/editor.scss +9 -0
  778. package/src/query/utils.js +29 -7
  779. package/src/query-no-results/edit.js +1 -1
  780. package/src/query-pagination/style.scss +14 -0
  781. package/src/query-title/block.json +11 -2
  782. package/src/query-title/edit.js +51 -7
  783. package/src/query-title/index.php +28 -2
  784. package/src/query-title/style.scss +4 -0
  785. package/src/query-title/variations.js +13 -0
  786. package/src/quote/deprecated.js +6 -5
  787. package/src/quote/transforms.js +6 -24
  788. package/src/search/index.php +1 -1
  789. package/src/search/style.scss +2 -0
  790. package/src/search/test/__snapshots__/edit.native.js.snap +56 -7
  791. package/src/separator/block.json +1 -0
  792. package/src/separator/deprecated.js +2 -3
  793. package/src/separator/edit.js +1 -1
  794. package/src/separator/test/edit.js +5 -3
  795. package/src/site-logo/editor.scss +8 -66
  796. package/src/site-title/index.php +8 -9
  797. package/src/social-link/icons/reddit.js +1 -1
  798. package/src/social-link/index.php +2 -2
  799. package/src/social-link/socials-with-bg.scss +1 -1
  800. package/src/social-link/socials-without-bg.scss +1 -1
  801. package/src/social-links/block.json +9 -0
  802. package/src/social-links/edit.js +48 -19
  803. package/src/spacer/block.json +7 -1
  804. package/src/style.scss +2 -0
  805. package/src/table/block.json +4 -0
  806. package/src/table/state.js +21 -19
  807. package/src/table-of-contents/block.json +24 -1
  808. package/src/tag-cloud/block.json +5 -1
  809. package/src/tag-cloud/style.scss +1 -0
  810. package/src/template-part/edit/index.js +4 -4
  811. package/src/template-part/index.js +3 -2
  812. package/src/term-description/block.json +4 -0
  813. package/src/text-columns/edit.js +2 -2
  814. package/src/text-columns/save.js +2 -2
  815. package/src/verse/block.json +1 -0
  816. package/src/video/block.json +4 -0
  817. package/src/video/style.scss +2 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/quote/transforms.js"],"names":["transforms","from","type","blocks","transform","value","citation","anchor","fontSize","style","source","selector","query","content","map","innerBlocks","prefix","schema","blockquote","children","node","HTML","innerHTML","mode","isMultiBlock","isMatch","some","name","__experimentalConvert","block","attributes","to","every","join"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAOA,MAAMA,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,MAAM,EAAE,CAAE,gBAAF,CAFT;AAGCC,IAAAA,SAAS,EAAE,QAAoD;AAAA,UAAlD;AAAEC,QAAAA,KAAF;AAASC,QAAAA,QAAT;AAAmBC,QAAAA,MAAnB;AAA2BC,QAAAA,QAA3B;AAAqCC,QAAAA;AAArC,OAAkD;AAC9D,aAAO,yBACN,YADM,EAEN;AACCH,QAAAA,QADD;AAECC,QAAAA,MAFD;AAGCC,QAAAA,QAHD;AAICC,QAAAA;AAJD,OAFM,EAQN,sCAA0BJ,KAA1B,EAAiC;AAChCH,QAAAA,IAAI,EAAE,OAD0B;AAEhCQ,QAAAA,MAAM,EAAE,OAFwB;AAGhCC,QAAAA,QAAQ,EAAE,GAHsB;AAIhCC,QAAAA,KAAK,EAAE;AACNC,UAAAA,OAAO,EAAE;AACRX,YAAAA,IAAI,EAAE,QADE;AAERQ,YAAAA,MAAM,EAAE;AAFA;AADH;AAJyB,OAAjC,EAUII,GAVJ,CAUS;AAAA,YAAE;AAAED,UAAAA;AAAF,SAAF;AAAA,eACR,yBAAa,gBAAb,EAA+B;AAAEA,UAAAA;AAAF,SAA/B,CADQ;AAAA,OAVT,CARM,CAAP;AAsBA;AA1BF,GADK,EA6BL;AACCX,IAAAA,IAAI,EAAE,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AAAF,OAFD,EAGCD,QAAQ,GACL,CACA,GAAGS,WADH,EAEA,yBAAa,gBAAb,EAA+B;AAC9BF,QAAAA,OAAO,EAAEP;AADqB,OAA/B,CAFA,CADK,GAOLS,WAVJ,CADU;AAAA;AAHZ,GA3BG,EA4CH;AACCb,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,MAAM,EAAE,CAAE,GAAF,CAFT;AAGCC,IAAAA,SAAS,EAAE,SAAgBW,WAAhB;AAAA,UAAE;AAAET,QAAAA;AAAF,OAAF;AAAA,aACVA,QAAQ,GACL,CACA,GAAGS,WADH,EAEA,yBAAa,gBAAb,EAA+B;AAC9BF,QAAAA,OAAO,EAAEP;AADqB,OAA/B,CAFA,CADK,GAOLS,WARO;AAAA;AAHZ,GA5CG;AAzFc,CAAnB;eAqJef,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateBlock,\n\tparseWithAttributeSchema,\n\trawHandler,\n} from '@wordpress/blocks';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/pullquote' ],\n\t\t\ttransform: ( { value, citation, anchor, fontSize, style } ) => {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/quote',\n\t\t\t\t\t{\n\t\t\t\t\t\tcitation,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t\tfontSize,\n\t\t\t\t\t\tstyle,\n\t\t\t\t\t},\n\t\t\t\t\tparseWithAttributeSchema( value, {\n\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\tsource: 'query',\n\t\t\t\t\t\tselector: 'p',\n\t\t\t\t\t\tquery: {\n\t\t\t\t\t\t\tcontent: {\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tsource: 'html',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t} ).map( ( { content } ) =>\n\t\t\t\t\t\tcreateBlock( 'core/paragraph', { content } )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/group' ],\n\t\t\ttransform: ( { anchor }, innerBlocks ) =>\n\t\t\t\tcreateBlock( 'core/quote', { anchor }, innerBlocks ),\n\t\t},\n\t\t{\n\t\t\ttype: 'prefix',\n\t\t\tprefix: '>',\n\t\t\ttransform: ( content ) =>\n\t\t\t\tcreateBlock( 'core/quote', {}, [\n\t\t\t\t\tcreateBlock( 'core/paragraph', { content } ),\n\t\t\t\t] ),\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tschema: () => ( {\n\t\t\t\tblockquote: {\n\t\t\t\t\tchildren: '*',\n\t\t\t\t},\n\t\t\t} ),\n\t\t\tselector: 'blockquote',\n\t\t\ttransform: ( node ) => {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/quote',\n\t\t\t\t\t// Don't try to parse any `cite` out of this content.\n\t\t\t\t\t// * There may be more than one cite.\n\t\t\t\t\t// * There may be more attribution text than just the cite.\n\t\t\t\t\t// * If the cite is nested in the quoted text, it's wrong to\n\t\t\t\t\t// remove it.\n\t\t\t\t\t{},\n\t\t\t\t\trawHandler( {\n\t\t\t\t\t\tHTML: node.innerHTML,\n\t\t\t\t\t\tmode: 'BLOCKS',\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ '*' ],\n\t\t\tisMatch: ( {}, blocks ) => {\n\t\t\t\treturn ! blocks.some( ( { name } ) => name === 'core/quote' );\n\t\t\t},\n\t\t\t__experimentalConvert: ( blocks ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/quote',\n\t\t\t\t\t{},\n\t\t\t\t\tblocks.map( ( block ) =>\n\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\tblock.name,\n\t\t\t\t\t\t\tblock.attributes,\n\t\t\t\t\t\t\tblock.innerBlocks\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/pullquote' ],\n\t\t\tisMatch: ( {}, block ) => {\n\t\t\t\treturn block.innerBlocks.every(\n\t\t\t\t\t( { name } ) => name === 'core/paragraph'\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform: (\n\t\t\t\t{ citation, anchor, fontSize, style },\n\t\t\t\tinnerBlocks\n\t\t\t) => {\n\t\t\t\tconst value = innerBlocks\n\t\t\t\t\t.map(\n\t\t\t\t\t\t( { attributes } ) => `<p>${ attributes.content }</p>`\n\t\t\t\t\t)\n\t\t\t\t\t.join( '' );\n\t\t\t\treturn createBlock( 'core/pullquote', {\n\t\t\t\t\tvalue,\n\t\t\t\t\tcitation,\n\t\t\t\t\tanchor,\n\t\t\t\t\tfontSize,\n\t\t\t\t\tstyle,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/group' ],\n\t\t\ttransform: ( { citation, anchor }, innerBlocks ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{ anchor },\n\t\t\t\t\tcitation\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t...innerBlocks,\n\t\t\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\t\t\tcontent: citation,\n\t\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: innerBlocks\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ '*' ],\n\t\t\ttransform: ( { citation }, innerBlocks ) =>\n\t\t\t\tcitation\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t...innerBlocks,\n\t\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\t\tcontent: citation,\n\t\t\t\t\t\t\t} ),\n\t\t\t\t\t ]\n\t\t\t\t\t: innerBlocks,\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/quote/transforms.js"],"names":["transforms","from","type","blocks","transform","value","citation","anchor","fontSize","style","content","innerBlocks","prefix","schema","blockquote","children","selector","node","handler","HTML","innerHTML","mode","isMultiBlock","isMatch","some","name","__experimentalConvert","map","block","attributes","to","every","join"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,MAAM,EAAE,CAAE,gBAAF,CAFT;AAGCC,IAAAA,SAAS,EAAE,QAAoD;AAAA,UAAlD;AAAEC,QAAAA,KAAF;AAASC,QAAAA,QAAT;AAAmBC,QAAAA,MAAnB;AAA2BC,QAAAA,QAA3B;AAAqCC,QAAAA;AAArC,OAAkD;AAC9D,aAAO,yBACN,YADM,EAEN;AACCH,QAAAA,QADD;AAECC,QAAAA,MAFD;AAGCC,QAAAA,QAHD;AAICC,QAAAA;AAJD,OAFM,EAQN,yBAAa,gBAAb,EAA+B;AAAEC,QAAAA,OAAO,EAAEL;AAAX,OAA/B,CARM,CAAP;AAUA;AAdF,GADK,EAiBL;AACCH,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,MAAM,EAAE,CAAE,YAAF,CAFT;AAGCC,IAAAA,SAAS,EAAE,QAAcO,WAAd;AAAA,UAAE;AAAEJ,QAAAA;AAAF,OAAF;AAAA,aACV,yBAAa,YAAb,EAA2B;AAAEA,QAAAA;AAAF,OAA3B,EAAuCI,WAAvC,CADU;AAAA;AAHZ,GAjBK,EAuBL;AACCT,IAAAA,IAAI,EAAE,QADP;AAECU,IAAAA,MAAM,EAAE,GAFT;AAGCR,IAAAA,SAAS,EAAIM,OAAF,IACV,yBAAa,YAAb,EAA2B,EAA3B,EAA+B,CAC9B,yB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,GACL,CACA,GAAGK,WADH,EAEA,yBAAa,gBAAb,EAA+B;AAC9BD,QAAAA,OAAO,EAAEJ;AADqB,OAA/B,CAFA,CADK,GAOLK,WARO;AAAA;AAHZ,GA1CG;AA7Ec,CAAnB;eAuIeX,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/pullquote' ],\n\t\t\ttransform: ( { value, citation, anchor, fontSize, style } ) => {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/quote',\n\t\t\t\t\t{\n\t\t\t\t\t\tcitation,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t\tfontSize,\n\t\t\t\t\t\tstyle,\n\t\t\t\t\t},\n\t\t\t\t\tcreateBlock( 'core/paragraph', { content: value } )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/group' ],\n\t\t\ttransform: ( { anchor }, innerBlocks ) =>\n\t\t\t\tcreateBlock( 'core/quote', { anchor }, innerBlocks ),\n\t\t},\n\t\t{\n\t\t\ttype: 'prefix',\n\t\t\tprefix: '>',\n\t\t\ttransform: ( content ) =>\n\t\t\t\tcreateBlock( 'core/quote', {}, [\n\t\t\t\t\tcreateBlock( 'core/paragraph', { content } ),\n\t\t\t\t] ),\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tschema: () => ( {\n\t\t\t\tblockquote: {\n\t\t\t\t\tchildren: '*',\n\t\t\t\t},\n\t\t\t} ),\n\t\t\tselector: 'blockquote',\n\t\t\ttransform: ( node, handler ) => {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/quote',\n\t\t\t\t\t// Don't try to parse any `cite` out of this content.\n\t\t\t\t\t// * There may be more than one cite.\n\t\t\t\t\t// * There may be more attribution text than just the cite.\n\t\t\t\t\t// * If the cite is nested in the quoted text, it's wrong to\n\t\t\t\t\t// remove it.\n\t\t\t\t\t{},\n\t\t\t\t\thandler( {\n\t\t\t\t\t\tHTML: node.innerHTML,\n\t\t\t\t\t\tmode: 'BLOCKS',\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ '*' ],\n\t\t\tisMatch: ( {}, blocks ) => {\n\t\t\t\treturn ! blocks.some( ( { name } ) => name === 'core/quote' );\n\t\t\t},\n\t\t\t__experimentalConvert: ( blocks ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/quote',\n\t\t\t\t\t{},\n\t\t\t\t\tblocks.map( ( block ) =>\n\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\tblock.name,\n\t\t\t\t\t\t\tblock.attributes,\n\t\t\t\t\t\t\tblock.innerBlocks\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/pullquote' ],\n\t\t\tisMatch: ( {}, block ) => {\n\t\t\t\treturn block.innerBlocks.every(\n\t\t\t\t\t( { name } ) => name === 'core/paragraph'\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform: (\n\t\t\t\t{ citation, anchor, fontSize, style },\n\t\t\t\tinnerBlocks\n\t\t\t) => {\n\t\t\t\tconst value = innerBlocks\n\t\t\t\t\t.map( ( { attributes } ) => `${ attributes.content }` )\n\t\t\t\t\t.join( '<br>' );\n\t\t\t\treturn createBlock( 'core/pullquote', {\n\t\t\t\t\tvalue,\n\t\t\t\t\tcitation,\n\t\t\t\t\tanchor,\n\t\t\t\t\tfontSize,\n\t\t\t\t\tstyle,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/group' ],\n\t\t\ttransform: ( { citation, anchor }, innerBlocks ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{ anchor },\n\t\t\t\t\tcitation\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t...innerBlocks,\n\t\t\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\t\t\tcontent: citation,\n\t\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: innerBlocks\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ '*' ],\n\t\t\ttransform: ( { citation }, innerBlocks ) =>\n\t\t\t\tcitation\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t...innerBlocks,\n\t\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\t\tcontent: citation,\n\t\t\t\t\t\t\t} ),\n\t\t\t\t\t ]\n\t\t\t\t\t: innerBlocks,\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
- var _lodash = require("lodash");
15
-
16
14
  var _blockEditor = require("@wordpress/block-editor");
17
15
 
18
16
  /**
@@ -64,9 +62,10 @@ const v1 = {
64
62
  migrate(attributes) {
65
63
  const {
66
64
  color,
67
- customColor
65
+ customColor,
66
+ ...restAttributes
68
67
  } = attributes;
69
- return { ...(0, _lodash.omit)(attributes, ['color', 'customColor']),
68
+ return { ...restAttributes,
70
69
  backgroundColor: color ? color : undefined,
71
70
  opacity: 'css',
72
71
  style: customColor ? {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/separator/deprecated.js"],"names":["v1","attributes","color","type","customColor","save","backgroundClass","colorClass","className","style","backgroundColor","undefined","useBlockProps","migrate","opacity","background"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,EAAE,GA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AAA,UAAU,EAAEX;AAAd;AAAT,OADe,GAEfO;AANG,KAAP;AAQA;;AA1CS,CAAX;eA6Ce,CAAEX,EAAF,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { getColorClassName, useBlockProps } from '@wordpress/block-editor';\n\nconst v1 = {\n\tattributes: {\n\t\tcolor: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tcustomColor: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { color, customColor } = attributes;\n\n\t\t// the hr support changing color using border-color, since border-color\n\t\t// is not yet supported in the color palette, we use background-color\n\t\tconst backgroundClass = getColorClassName( 'background-color', color );\n\t\t// the dots styles uses text for the dots, to change those dots color is\n\t\t// using color, not backgroundColor\n\t\tconst colorClass = getColorClassName( 'color', color );\n\n\t\tconst className = classnames( {\n\t\t\t'has-text-color has-background': color || customColor,\n\t\t\t[ backgroundClass ]: backgroundClass,\n\t\t\t[ colorClass ]: colorClass,\n\t\t} );\n\n\t\tconst style = {\n\t\t\tbackgroundColor: backgroundClass ? undefined : customColor,\n\t\t\tcolor: colorClass ? undefined : customColor,\n\t\t};\n\n\t\treturn <hr { ...useBlockProps.save( { className, style } ) } />;\n\t},\n\tmigrate( attributes ) {\n\t\tconst { color, customColor } = attributes;\n\t\treturn {\n\t\t\t...omit( attributes, [ 'color', 'customColor' ] ),\n\t\t\tbackgroundColor: color ? color : undefined,\n\t\t\topacity: 'css',\n\t\t\tstyle: customColor\n\t\t\t\t? { color: { background: customColor } }\n\t\t\t\t: undefined,\n\t\t};\n\t},\n};\n\nexport default [ v1 ];\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/separator/deprecated.js"],"names":["v1","attributes","color","type","customColor","save","backgroundClass","colorClass","className","style","backgroundColor","undefined","useBlockProps","migrate","restAttributes","opacity","background"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;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EAAE;AAAEc,UAAAA,UAAU,EAAEZ;AAAd;AAAT,OADe,GAEfO;AANG,KAAP;AAQA;;AA1CS,CAAX;eA6Ce,CAAEX,EAAF,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getColorClassName, useBlockProps } from '@wordpress/block-editor';\n\nconst v1 = {\n\tattributes: {\n\t\tcolor: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tcustomColor: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { color, customColor } = attributes;\n\n\t\t// the hr support changing color using border-color, since border-color\n\t\t// is not yet supported in the color palette, we use background-color\n\t\tconst backgroundClass = getColorClassName( 'background-color', color );\n\t\t// the dots styles uses text for the dots, to change those dots color is\n\t\t// using color, not backgroundColor\n\t\tconst colorClass = getColorClassName( 'color', color );\n\n\t\tconst className = classnames( {\n\t\t\t'has-text-color has-background': color || customColor,\n\t\t\t[ backgroundClass ]: backgroundClass,\n\t\t\t[ colorClass ]: colorClass,\n\t\t} );\n\n\t\tconst style = {\n\t\t\tbackgroundColor: backgroundClass ? undefined : customColor,\n\t\t\tcolor: colorClass ? undefined : customColor,\n\t\t};\n\n\t\treturn <hr { ...useBlockProps.save( { className, style } ) } />;\n\t},\n\tmigrate( attributes ) {\n\t\tconst { color, customColor, ...restAttributes } = attributes;\n\t\treturn {\n\t\t\t...restAttributes,\n\t\t\tbackgroundColor: color ? color : undefined,\n\t\t\topacity: 'css',\n\t\t\tstyle: customColor\n\t\t\t\t? { color: { background: customColor } }\n\t\t\t\t: undefined,\n\t\t};\n\t},\n};\n\nexport default [ v1 ];\n"]}
@@ -52,7 +52,7 @@ function SeparatorEdit(_ref) {
52
52
  [colorClass]: colorClass,
53
53
  'has-css-opacity': opacity === 'css',
54
54
  'has-alpha-channel-opacity': opacity === 'alpha-channel'
55
- }, colorProps.classname);
55
+ }, colorProps.className);
56
56
  const styles = {
57
57
  color: currentColor,
58
58
  backgroundColor: currentColor
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/separator/edit.js"],"names":["SeparatorEdit","attributes","setAttributes","backgroundColor","opacity","style","colorProps","currentColor","hasCustomColor","color","background","colorClass","className","classname","styles","undefined"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AASA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAGe,SAASA,aAAT,OAAwD;AAAA;;AAAA,MAAhC;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,GAAgC;AACtE,QAAM;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA,OAAnB;AAA4BC,IAAAA;AAA5B,MAAsCJ,UAA5C;AACA,QAAMK,UAAU,GAAG,8CAAeL,UAAf,CAAnB;AACA,QAAMM,YAAY,GAAGD,UAAH,aAAGA,UAAH,4CAAGA,UAAU,CAAED,KAAf,sDAAG,kBAAmBF,eAAxC;AACA,QAAMK,cAAc,GAAG,CAAC,EAAEH,KAAF,aAAEA,KAAF,+BAAEA,KAAK,CAAEI,KAAT,yCAAE,aAAcC,UAAhB,CAAxB;AAEA,qCAAsBN,OAAtB,EAA+BG,YAA/B,EAA6CL,aAA7C,EANsE,CAQtE;AACA;;AACA,QAAMS,UAAU,GAAG,oCAAmB,OAAnB,EAA4BR,eAA5B,CAAnB;AAEA,QAAMS,SAAS,GAAG,yBACjB;AACC,sBAAkBT,eAAe,IAAII,YADtC;AAEC,KAAEI,UAAF,GAAgBA,UAFjB;AAGC,uBAAmBP,OAAO,KAAK,KAHhC;AAIC,iCAA6BA,OAAO,KAAK;AAJ1C,GADiB,EAOjBE,UAAU,CAACO,SAPM,CAAlB;AAUA,QAAMC,MAAM,GAAG;AACdL,IAAAA,KAAK,EAAEF,YADO;AAEdJ,IAAAA,eAAe,EAAEI;AAFH,GAAf;AAKA,SACC,qDACC,4BAAC,0BAAD,EACM,gCAAe;AACnBK,IAAAA,SADmB;AAEnBP,IAAAA,KAAK,EAAEG,cAAc,GAAGM,MAAH,GAAYC;AAFd,GAAf,CADN,CADD,CADD;AAUA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { HorizontalRule } from '@wordpress/components';\nimport {\n\tuseBlockProps,\n\tgetColorClassName,\n\t__experimentalUseColorProps as useColorProps,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport useDeprecatedOpacity from './use-deprecated-opacity';\n\nexport default function SeparatorEdit( { attributes, setAttributes } ) {\n\tconst { backgroundColor, opacity, style } = attributes;\n\tconst colorProps = useColorProps( attributes );\n\tconst currentColor = colorProps?.style?.backgroundColor;\n\tconst hasCustomColor = !! style?.color?.background;\n\n\tuseDeprecatedOpacity( opacity, currentColor, setAttributes );\n\n\t// The dots styles uses text for the dots, to change those dots color is\n\t// using color, not backgroundColor.\n\tconst colorClass = getColorClassName( 'color', backgroundColor );\n\n\tconst className = classnames(\n\t\t{\n\t\t\t'has-text-color': backgroundColor || currentColor,\n\t\t\t[ colorClass ]: colorClass,\n\t\t\t'has-css-opacity': opacity === 'css',\n\t\t\t'has-alpha-channel-opacity': opacity === 'alpha-channel',\n\t\t},\n\t\tcolorProps.classname\n\t);\n\n\tconst styles = {\n\t\tcolor: currentColor,\n\t\tbackgroundColor: currentColor,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<HorizontalRule\n\t\t\t\t{ ...useBlockProps( {\n\t\t\t\t\tclassName,\n\t\t\t\t\tstyle: hasCustomColor ? styles : undefined,\n\t\t\t\t} ) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/separator/edit.js"],"names":["SeparatorEdit","attributes","setAttributes","backgroundColor","opacity","style","colorProps","currentColor","hasCustomColor","color","background","colorClass","className","styles","undefined"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AASA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAGe,SAASA,aAAT,OAAwD;AAAA;;AAAA,MAAhC;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,GAAgC;AACtE,QAAM;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA,OAAnB;AAA4BC,IAAAA;AAA5B,MAAsCJ,UAA5C;AACA,QAAMK,UAAU,GAAG,8CAAeL,UAAf,CAAnB;AACA,QAAMM,YAAY,GAAGD,UAAH,aAAGA,UAAH,4CAAGA,UAAU,CAAED,KAAf,sDAAG,kBAAmBF,eAAxC;AACA,QAAMK,cAAc,GAAG,CAAC,EAAEH,KAAF,aAAEA,KAAF,+BAAEA,KAAK,CAAEI,KAAT,yCAAE,aAAcC,UAAhB,CAAxB;AAEA,qCAAsBN,OAAtB,EAA+BG,YAA/B,EAA6CL,aAA7C,EANsE,CAQtE;AACA;;AACA,QAAMS,UAAU,GAAG,oCAAmB,OAAnB,EAA4BR,eAA5B,CAAnB;AAEA,QAAMS,SAAS,GAAG,yBACjB;AACC,sBAAkBT,eAAe,IAAII,YADtC;AAEC,KAAEI,UAAF,GAAgBA,UAFjB;AAGC,uBAAmBP,OAAO,KAAK,KAHhC;AAIC,iCAA6BA,OAAO,KAAK;AAJ1C,GADiB,EAOjBE,UAAU,CAACM,SAPM,CAAlB;AAUA,QAAMC,MAAM,GAAG;AACdJ,IAAAA,KAAK,EAAEF,YADO;AAEdJ,IAAAA,eAAe,EAAEI;AAFH,GAAf;AAKA,SACC,qDACC,4BAAC,0BAAD,EACM,gCAAe;AACnBK,IAAAA,SADmB;AAEnBP,IAAAA,KAAK,EAAEG,cAAc,GAAGK,MAAH,GAAYC;AAFd,GAAf,CADN,CADD,CADD;AAUA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { HorizontalRule } from '@wordpress/components';\nimport {\n\tuseBlockProps,\n\tgetColorClassName,\n\t__experimentalUseColorProps as useColorProps,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport useDeprecatedOpacity from './use-deprecated-opacity';\n\nexport default function SeparatorEdit( { attributes, setAttributes } ) {\n\tconst { backgroundColor, opacity, style } = attributes;\n\tconst colorProps = useColorProps( attributes );\n\tconst currentColor = colorProps?.style?.backgroundColor;\n\tconst hasCustomColor = !! style?.color?.background;\n\n\tuseDeprecatedOpacity( opacity, currentColor, setAttributes );\n\n\t// The dots styles uses text for the dots, to change those dots color is\n\t// using color, not backgroundColor.\n\tconst colorClass = getColorClassName( 'color', backgroundColor );\n\n\tconst className = classnames(\n\t\t{\n\t\t\t'has-text-color': backgroundColor || currentColor,\n\t\t\t[ colorClass ]: colorClass,\n\t\t\t'has-css-opacity': opacity === 'css',\n\t\t\t'has-alpha-channel-opacity': opacity === 'alpha-channel',\n\t\t},\n\t\tcolorProps.className\n\t);\n\n\tconst styles = {\n\t\tcolor: currentColor,\n\t\tbackgroundColor: currentColor,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<HorizontalRule\n\t\t\t\t{ ...useBlockProps( {\n\t\t\t\t\tclassName,\n\t\t\t\t\tstyle: hasCustomColor ? styles : undefined,\n\t\t\t\t} ) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"]}
@@ -43,6 +43,7 @@ const metadata = {
43
43
  anchor: true,
44
44
  align: ["center", "wide", "full"],
45
45
  color: {
46
+ enableContrastChecker: false,
46
47
  __experimentalSkipSerialization: true,
47
48
  gradients: true,
48
49
  background: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/separator/index.js"],"names":["name","metadata","settings","icon","example","attributes","customColor","className","transforms","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,gBADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,WAAW,EAAE,SADF;AAEXC,MAAAA,SAAS,EAAE;AAFA;AADJ,GAFc;AAQvBC,EAAAA,UAAU,EAAVA,mBARuB;AASvBC,EAAAA,IAAI,EAAJA,aATuB;AAUvBC,EAAAA,IAAI,EAAJA,aAVuB;AAWvBC,EAAAA,UAAU,EAAVA;AAXuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { separator as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcustomColor: '#065174',\n\t\t\tclassName: 'is-style-wide',\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/separator/index.js"],"names":["name","metadata","settings","icon","example","attributes","customColor","className","transforms","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,gBADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,WAAW,EAAE,SADF;AAEXC,MAAAA,SAAS,EAAE;AAFA;AADJ,GAFc;AAQvBC,EAAAA,UAAU,EAAVA,mBARuB;AASvBC,EAAAA,IAAI,EAAJA,aATuB;AAUvBC,EAAAA,IAAI,EAAJA,aAVuB;AAWvBC,EAAAA,UAAU,EAAVA;AAXuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { separator as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcustomColor: '#065174',\n\t\t\tclassName: 'is-style-wide',\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
@@ -18,7 +18,7 @@ const RedditIcon = () => (0, _element.createElement)(_primitives.SVG, {
18
18
  viewBox: "0 0 24 24",
19
19
  version: "1.1"
20
20
  }, (0, _element.createElement)(_primitives.Path, {
21
- d: "M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z"
21
+ d: "M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z"
22
22
  }));
23
23
 
24
24
  exports.RedditIcon = RedditIcon;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/social-link/icons/reddit.js"],"names":["RedditIcon"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,UAAU,GAAG,MACzB,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,IAAX;AAAgB,EAAA,MAAM,EAAC,IAAvB;AAA4B,EAAA,OAAO,EAAC,WAApC;AAAgD,EAAA,OAAO,EAAC;AAAxD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\n\nexport const RedditIcon = () => (\n\t<SVG width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\">\n\t\t<Path d=\"M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z\" />\n\t</SVG>\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/social-link/icons/reddit.js"],"names":["RedditIcon"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,UAAU,GAAG,MACzB,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,IAAX;AAAgB,EAAA,MAAM,EAAC,IAAvB;AAA4B,EAAA,OAAO,EAAC,WAApC;AAAgD,EAAA,OAAO,EAAC;AAAxD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\n\nexport const RedditIcon = () => (\n\t<SVG width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\">\n\t\t<Path d=\"M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z\" />\n\t</SVG>\n);\n"]}
@@ -10,6 +10,8 @@ exports.default = void 0;
10
10
 
11
11
  var _element = require("@wordpress/element");
12
12
 
13
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
+
13
15
  var _classnames = _interopRequireDefault(require("classnames"));
14
16
 
15
17
  var _blocks = require("@wordpress/blocks");
@@ -53,6 +55,7 @@ function SocialLinksEdit(props) {
53
55
  var _attributes$className;
54
56
 
55
57
  const {
58
+ clientId,
56
59
  name,
57
60
  attributes,
58
61
  iconBackgroundColor,
@@ -110,6 +113,7 @@ function SocialLinksEdit(props) {
110
113
  // themes and named colors in palette do not match.
111
114
 
112
115
  const className = (0, _classnames.default)(size, {
116
+ 'has-visible-labels': showLabels,
113
117
  'has-icon-color': iconColor.color || iconColorValue,
114
118
  'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue
115
119
  });
@@ -136,7 +140,13 @@ function SocialLinksEdit(props) {
136
140
  iconColorValue: colorValue
137
141
  });
138
142
  },
139
- label: (0, _i18n.__)('Icon color')
143
+ label: (0, _i18n.__)('Icon color'),
144
+ resetAllFilter: () => {
145
+ setIconColor(undefined);
146
+ setAttributes({
147
+ iconColorValue: undefined
148
+ });
149
+ }
140
150
  }];
141
151
 
142
152
  if (!logosOnly) {
@@ -150,10 +160,17 @@ function SocialLinksEdit(props) {
150
160
  iconBackgroundColorValue: colorValue
151
161
  });
152
162
  },
153
- label: (0, _i18n.__)('Icon background')
163
+ label: (0, _i18n.__)('Icon background'),
164
+ resetAllFilter: () => {
165
+ setIconBackgroundColor(undefined);
166
+ setAttributes({
167
+ iconBackgroundColorValue: undefined
168
+ });
169
+ }
154
170
  });
155
171
  }
156
172
 
173
+ const colorGradientSettings = (0, _blockEditor.__experimentalUseMultipleOriginColorsAndGradients)();
157
174
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockControls, {
158
175
  group: "other"
159
176
  }, (0, _element.createElement)(_components.ToolbarDropdownMenu, {
@@ -193,16 +210,34 @@ function SocialLinksEdit(props) {
193
210
  onChange: () => setAttributes({
194
211
  showLabels: !showLabels
195
212
  })
196
- })), (0, _element.createElement)(_blockEditor.PanelColorSettings, {
197
- __experimentalHasMultipleOrigins: true,
198
- __experimentalIsRenderedInSidebar: true,
199
- title: (0, _i18n.__)('Color'),
200
- colorSettings: colorSettings
201
- }, !logosOnly && (0, _element.createElement)(_blockEditor.ContrastChecker, {
213
+ }))), (0, _element.createElement)(_blockEditor.InspectorControls, {
214
+ __experimentalGroup: "color"
215
+ }, colorSettings.map(_ref2 => {
216
+ let {
217
+ onChange,
218
+ label,
219
+ value,
220
+ resetAllFilter
221
+ } = _ref2;
222
+ return (0, _element.createElement)(_blockEditor.__experimentalColorGradientSettingsDropdown, (0, _extends2.default)({
223
+ key: `social-links-color-${label}`,
224
+ __experimentalHasMultipleOrigins: true,
225
+ __experimentalIsRenderedInSidebar: true,
226
+ settings: [{
227
+ colorValue: value,
228
+ label,
229
+ onColorChange: onChange,
230
+ isShownByDefault: true,
231
+ resetAllFilter,
232
+ enableAlpha: true
233
+ }],
234
+ panelId: clientId
235
+ }, colorGradientSettings));
236
+ }), !logosOnly && (0, _element.createElement)(_blockEditor.ContrastChecker, {
202
237
  textColor: iconColorValue,
203
238
  backgroundColor: iconBackgroundColorValue,
204
239
  isLargeText: false
205
- }))), (0, _element.createElement)("ul", innerBlocksProps));
240
+ })), (0, _element.createElement)("ul", innerBlocksProps));
206
241
  }
207
242
 
208
243
  const iconColorAttributes = {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/social-links/edit.js"],"names":["ALLOWED_BLOCKS","sizeOptions","name","value","getDefaultBlockLayout","blockTypeOrName","layoutBlockSupportConfig","default","SocialLinksEdit","props","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","layout","usedLayout","logosOnly","className","includes","backgroundBackup","current","undefined","SocialPlaceholder","SelectedSocialPlaceholder","color","blockProps","innerBlocksProps","allowedBlocks","placeholder","templateLock","__experimentalAppenderTagName","__experimentalLayout","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","push","onClose","map","entry","check","textColor","backgroundColor","iconColorAttributes"],"mappings":";;;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AASA;;AAOA;;AACA;;AA3BA;AACA;AACA;;AAGA;AACA;AACA;AAsBA,MAAMA,cAAc,GAAG,CAAE,kBAAF,CAAvB;AAEA,MAAMC,WAAW,GAAG,CACnB;AAAEC,EAAAA,IAAI,EAAE,cAAI,OAAJ,CAAR;AAAuBC,EAAAA,KAAK,EAAE;AAA9B,CADmB,EAEnB;AAAED,EAAAA,IAAI,EAAE,cAAI,QAAJ,CAAR;AAAwBC,EAAAA,KAAK,EAAE;AAA/B,CAFmB,EAGnB;AAAED,EAAAA,IAAI,EAAE,cAAI,OAAJ,CAAR;AAAuBC,EAAAA,KAAK,EAAE;AAA9B,CAHmB,EAInB;AAAED,EAAAA,IAAI,EAAE,cAAI,MAAJ,CAAR;AAAsBC,EAAAA,KAAK,EAAE;AAA7B,CAJmB,CAApB;;AAOA,MAAMC,qBAAqB,GAAKC,eAAF,IAAuB;AACpD,QAAMC,wBAAwB,GAAG,6BAChCD,eADgC,EAEhC,sBAFgC,CAAjC;AAIA,SAAOC,wBAAP,aAAOA,wBAAP,uBAAOA,wBAAwB,CAAEC,OAAjC;AACA,CAND;;AAQO,SAASC,eAAT,CAA0BC,KAA1B,EAAkC;AAAA;;AACxC,QAAM;AACLP,IAAAA,IADK;AAELQ,IAAAA,UAFK;AAGLC,IAAAA,mBAHK;AAILC,IAAAA,SAJK;AAKLC,IAAAA,UALK;AAMLC,IAAAA,aANK;AAOLC,IAAAA,sBAPK;AAQLC,IAAAA;AARK,MASFP,KATJ;AAWA,QAAM;AACLQ,IAAAA,wBADK;AAELC,IAAAA,yBAFK;AAGLC,IAAAA,c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AA,QAAQ,EAAG,MACVP,aAAa,CAAE;AAAEO,MAAAA,UAAU,EAAE,CAAEA;AAAhB,KAAF;AAJf,IARD,CADD,EAiBC,4BAAC,+BAAD;AACC,IAAA,gCAAgC,MADjC;AAEC,IAAA,iCAAiC,MAFlC;AAGC,IAAA,KAAK,EAAG,cAAI,OAAJ,CAHT;AAIC,IAAA,aAAa,EAAGsB;AAJjB,KAMG,CAAElB,SAAF,IACD,4BAAC,4BAAD;AAEE2B,IAAAA,SAAS,EAAEjC,cAFb;AAGEkC,IAAAA,eAAe,EAAEpC,wBAHnB;AAKC,IAAA,WAAW,EAAG;AALf,IAPF,CAjBD,CAtCD,EAwEC,kCAASkB,gBAAT,CAxED,CADD;AA4EA;;AAED,MAAMmB,mBAAmB,GAAG;AAC3B1C,EAAAA,SAAS,EAAE,YADgB;AAE3BD,EAAAA,mBAAmB,EAAE;AAFM,CAA5B;;eAKe,6BAAY2C,mBAAZ,EAAmC9C,eAAnC,C","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { Fragment, useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\tPanelColorSettings,\n\twithColors,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\n\nconst ALLOWED_BLOCKS = [ 'core/social-link' ];\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nconst getDefaultBlockLayout = ( blockTypeOrName ) => {\n\tconst layoutBlockSupportConfig = getBlockSupport(\n\t\tblockTypeOrName,\n\t\t'__experimentalLayout'\n\t);\n\treturn layoutBlockSupportConfig?.default;\n};\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tname,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t\tlayout,\n\t} = attributes;\n\tconst usedLayout = layout || getDefaultBlockLayout( name );\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackup = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackup.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackup.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\tconst SelectedSocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-prompt\">\n\t\t\t{ __( 'Click plus to add' ) }\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = classNames( size, {\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\tplaceholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\t__experimentalAppenderTagName: 'li',\n\t\t__experimentalLayout: usedLayout,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\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\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Show labels' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelColorSettings\n\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\ttitle={ __( 'Color' ) }\n\t\t\t\t\tcolorSettings={ colorSettings }\n\t\t\t\t>\n\t\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelColorSettings>\n\t\t\t</InspectorControls>\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</Fragment>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/social-links/edit.js"],"names":["ALLOWED_BLOCKS","sizeOptions","name","value","getDefaultBlockLayout","blockTypeOrName","layoutBlockSupportConfig","default","SocialLinksEdit","props","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","layout","usedLayout","logosOnly","className","includes","backgroundBackup","current","undefined","SocialPlaceholder","SelectedSocialPlaceholder","color","blockProps","innerBlocksProps","allowedBlocks","placeholder","templateLock","__experimentalAppenderTagName","__experimentalLayout","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","onClose","map","entry","check","onColorChange","isShownByDefault","enableAlpha","textColor","backgroundColor","iconColorAttributes"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AAUA;;AAOA;;AACA;;AA5BA;AACA;AACA;;AAGA;AACA;AACA;AAuBA,MAAMA,cAAc,GAAG,CAAE,kBAAF,CAAvB;AAEA,MAAMC,WAAW,GAAG,CACnB;AAAEC,EAAAA,IAAI,EAAE,cAAI,OAAJ,CAAR;AAAuBC,EAAAA,KAAK,EAAE;AAA9B,CADmB,EAEnB;AAAED,EAAAA,IAAI,EAAE,cAAI,QAAJ,CAAR;AAAwBC,EAAAA,KAAK,EAAE;AAA/B,CAFmB,EAGnB;AAAED,EAAAA,IAAI,EAAE,cAAI,OAAJ,CAAR;AAAuBC,EAAAA,KAAK,EAAE;AAA9B,CAHmB,EAInB;AAAED,EAAAA,IAAI,EAAE,cAAI,MAAJ,CAAR;AAAsBC,EAAAA,KAAK,EAAE;AAA7B,CAJmB,CAApB;;AAOA,MAAMC,qBAAqB,GAAKC,eAAF,IAAuB;AACpD,QAAMC,wBAAwB,GAAG,6BAChCD,eADgC,EAEhC,sBAFgC,CAAjC;AAIA,SAAOC,wBAAP,aAAOA,wBAAP,uBAAOA,wBAAwB,CAAEC,OAAjC;AACA,CAND;;AAQO,SAASC,eAAT,CAA0BC,KAA1B,EAAkC;AAAA;;AACxC,QAAM;AACLC,IAAAA,QADK;AAELR,IAAAA,IAFK;AAGLS,IAAAA,UAHK;AAILC,IAAAA,mBAJK;AAKLC,IAAAA,SALK;AAMLC,IAAAA,UANK;AAOLC,IAAAA,aAPK;AAQLC,IAAAA,sBARK;AASLC,IAAAA;AATK,MAUFR,KAVJ;AAYA,QAAM;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AEzC,wBAHnB;AAKC,IAAA,WAAW,EAAG;AALf,IAvBF,CAxDD,EAwFC,kCAASkB,gBAAT,CAxFD,CADD;AA4FA;;AAED,MAAMwB,mBAAmB,GAAG;AAC3B/C,EAAAA,SAAS,EAAE,YADgB;AAE3BD,EAAAA,mBAAmB,EAAE;AAFM,CAA5B;;eAKe,6BAAYgD,mBAAZ,EAAmCpD,eAAnC,C","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\n\nconst ALLOWED_BLOCKS = [ 'core/social-link' ];\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nconst getDefaultBlockLayout = ( blockTypeOrName ) => {\n\tconst layoutBlockSupportConfig = getBlockSupport(\n\t\tblockTypeOrName,\n\t\t'__experimentalLayout'\n\t);\n\treturn layoutBlockSupportConfig?.default;\n};\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tname,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t\tlayout,\n\t} = attributes;\n\tconst usedLayout = layout || getDefaultBlockLayout( name );\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackup = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackup.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackup.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\tconst SelectedSocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-prompt\">\n\t\t\t{ __( 'Click plus to add' ) }\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = classNames( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\tplaceholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\t__experimentalAppenderTagName: 'li',\n\t\t__experimentalLayout: usedLayout,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\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\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Show labels' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\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<InspectorControls __experimentalGroup=\"color\">\n\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\tenableAlpha: 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\tpanelId={ clientId }\n\t\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t) }\n\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"]}
@@ -80,6 +80,15 @@ const metadata = {
80
80
  type: "flex"
81
81
  }
82
82
  },
83
+ color: {
84
+ enableContrastChecker: false,
85
+ background: true,
86
+ gradients: true,
87
+ text: false,
88
+ __experimentalDefaultControls: {
89
+ background: false
90
+ }
91
+ },
83
92
  spacing: {
84
93
  blockGap: ["horizontal", "vertical"],
85
94
  margin: ["top", "bottom"],
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/social-links/index.js"],"names":["name","metadata","settings","example","innerBlocks","attributes","service","url","icon","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,WAAW,EAAE,CACZ;AACCJ,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,WADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KADY,EAQZ;AACCP,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,UADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KARY,EAeZ;AACCP,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,SADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KAfY;AADL,GADc;AA0BvBC,EAAAA,IAAI,EAAJA,YA1BuB;AA2BvBC,EAAAA,IAAI,EAAJA,aA3BuB;AA4BvBC,EAAAA,IAAI,EAAJA,aA5BuB;AA6BvBC,EAAAA,UAAU,EAAVA;AA7BuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { share as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\texample: {\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'wordpress',\n\t\t\t\t\turl: 'https://wordpress.org',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'facebook',\n\t\t\t\t\turl: 'https://www.facebook.com/WordPress/',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'twitter',\n\t\t\t\t\turl: 'https://twitter.com/WordPress',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/social-links/index.js"],"names":["name","metadata","settings","example","innerBlocks","attributes","service","url","icon","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,WAAW,EAAE,CACZ;AACCJ,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,WADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KADY,EAQZ;AACCP,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,UADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KARY,EAeZ;AACCP,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,SADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KAfY;AADL,GADc;AA0BvBC,EAAAA,IAAI,EAAJA,YA1BuB;AA2BvBC,EAAAA,IAAI,EAAJA,aA3BuB;AA4BvBC,EAAAA,IAAI,EAAJA,aA5BuB;AA6BvBC,EAAAA,UAAU,EAAVA;AA7BuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { share as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\texample: {\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'wordpress',\n\t\t\t\t\turl: 'https://wordpress.org',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'facebook',\n\t\t\t\t\turl: 'https://www.facebook.com/WordPress/',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'twitter',\n\t\t\t\t\turl: 'https://twitter.com/WordPress',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
@@ -41,7 +41,13 @@ const metadata = {
41
41
  },
42
42
  usesContext: ["orientation"],
43
43
  supports: {
44
- anchor: true
44
+ anchor: true,
45
+ spacing: {
46
+ margin: ["top", "bottom"],
47
+ __experimentalDefaultControls: {
48
+ margin: true
49
+ }
50
+ }
45
51
  },
46
52
  editorStyle: "wp-block-spacer-editor",
47
53
  style: "wp-block-spacer"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/spacer/index.js"],"names":["name","metadata","settings","icon","edit","save","deprecated"],"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,qBADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA;AAJuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { resizeCornerNE as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/spacer/index.js"],"names":["name","metadata","settings","icon","edit","save","deprecated"],"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,qBADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA;AAJuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { resizeCornerNE as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
@@ -162,6 +162,10 @@ const metadata = {
162
162
  text: true
163
163
  }
164
164
  },
165
+ spacing: {
166
+ margin: true,
167
+ padding: true
168
+ },
165
169
  typography: {
166
170
  fontSize: true,
167
171
  lineHeight: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/table/index.js"],"names":["name","metadata","settings","icon","example","attributes","head","cells","content","tag","body","transforms","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,iBADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,IAAI,EAAE,CACL;AACCC,QAAAA,KAAK,EAAE,CACN;AACCC,UAAAA,OAAO,EAAE,cAAI,SAAJ,CADV;AAECC,UAAAA,GAAG,EAAE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\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { blockTable as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\thead: [\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Version' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Jazz Musician' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Release Date' ),\n\t\t\t\t\t\t\ttag: 'th',\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\tbody: [\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.2',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Jaco Pastorius',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'May 7, 2019' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.1',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Betty Carter',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'February 21, 2019' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.0',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Bebo Valdés',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'December 6, 2018' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/table/index.js"],"names":["name","metadata","settings","icon","example","attributes","head","cells","content","tag","body","transforms","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,iBADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,IAAI,EAAE,CACL;AACCC,QAAAA,KAAK,EAAE,CACN;AACCC,UAAAA,OAAO,EAAE,cAAI,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,EAAVA;AA7EuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { blockTable as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\thead: [\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Version' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Jazz Musician' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Release Date' ),\n\t\t\t\t\t\t\ttag: 'th',\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\tbody: [\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.2',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Jaco Pastorius',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'May 7, 2019' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.1',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Betty Carter',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'February 21, 2019' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.0',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Bebo Valdés',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'December 6, 2018' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
@@ -38,8 +38,12 @@ function createTable(_ref) {
38
38
  columnCount
39
39
  } = _ref;
40
40
  return {
41
- body: (0, _lodash.times)(rowCount, () => ({
42
- cells: (0, _lodash.times)(columnCount, () => ({
41
+ body: Array.from({
42
+ length: rowCount
43
+ }).map(() => ({
44
+ cells: Array.from({
45
+ length: columnCount
46
+ }).map(() => ({
43
47
  content: '',
44
48
  tag: 'td'
45
49
  }))
@@ -187,7 +191,9 @@ function insertRow(state, _ref2) {
187
191
 
188
192
  return {
189
193
  [sectionName]: [...state[sectionName].slice(0, rowIndex), {
190
- cells: (0, _lodash.times)(cellCount, index => {
194
+ cells: Array.from({
195
+ length: cellCount
196
+ }).map((_, index) => {
191
197
  const firstCellInColumn = (0, _lodash.get)(firstRow, ['cells', index], {});
192
198
  const inheritedAttributes = (0, _lodash.pick)(firstCellInColumn, INHERITED_COLUMN_ATTRIBUTES);
193
199
  return { ...inheritedAttributes,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/table/state.js"],"names":["INHERITED_COLUMN_ATTRIBUTES","createTable","rowCount","columnCount","body","cells","content","tag","getFirstRow","state","isEmptyTableSection","head","foot","getCellAttribute","cellLocation","attributeName","sectionName","rowIndex","columnIndex","updateSelectedCell","selection","updateCell","tableSections","selectionSectionName","selectionRowIndex","section","map","row","cellAttributes","isCellSelected","type","insertRow","firstRow","cellCount","undefined","slice","index","firstCellInColumn","inheritedAttributes","deleteRow","filter","insertColumn","isEmptyRow","length","deleteColumn","cell","toggleSection"],"mappings":";;;;;;;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,2BAA2B,GAAG,CAAE,OAAF,CAApC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,WAAT,OAAkD;AAAA,MAA5B;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAA4B;AACxD,SAAO;AACNC,IAAAA,IAAI,EAAE,mBAAOF,QAAP,EAAiB,OAAQ;AAC9BG,MAAAA,KAAK,EAAE,mBAAOF,WAAP,EAAoB,OAAQ;AAClCG,QAAAA,OAAO,EAAE,EADyB;AAElCC,QAAAA,GAAG,EAAE;AAF6B,OAAR,CAApB;AADuB,KAAR,CAAjB;AADA,GAAP;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,WAAT,CAAsBC,KAAtB,EAA8B;AACpC,MAAK,CAAEC,mBAAmB,CAAED,KAAK,CAACE,IAAR,CAA1B,EAA2C;AAC1C,WAAOF,KAAK,CAACE,IAAN,CAAY,CAAZ,CAAP;AACA;;AACD,MAAK,CAAED,mBAAmB,CAAED,KAAK,CAACL,IAAR,CAA1B,EAA2C;AAC1C,WAAOK,KAAK,CAACL,IAAN,CAAY,CAAZ,CAAP;AACA;;AACD,MAAK,CAAEM,mBAAmB,CAAED,KAAK,CAACG,IAAR,CAA1B,EAA2C;AAC1C,WAAOH,KAAK,CAACG,IAAN,CAAY,CAAZ,CAAP;AACA;AACD;AAED;AACA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,IAAWA,GAAG,CAACtB,KAAJ,CAAUsC,MATxB,CAAP;AAUA,GAhBM,CAAP;AAiBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASG,aAAT,CAAwBrC,KAAxB,EAA+BO,WAA/B,EAA6C;AACnD;AACA,MAAK,CAAEN,mBAAmB,CAAED,KAAK,CAAEO,WAAF,CAAP,CAA1B,EAAqD;AACpD,WAAO;AAAE,OAAEA,WAAF,GAAiB;AAAnB,KAAP;AACA,GAJkD,CAMnD;;;AACA,QAAMb,WAAW,GAAG,iBAAKM,KAAL,EAAY,CAAE,MAAF,EAAU,CAAV,EAAa,OAAb,EAAsB,QAAtB,CAAZ,EAA8C,CAA9C,CAApB,CAPmD,CASnD;;AACA,SAAOsB,SAAS,CAAEtB,KAAF,EAAS;AAAEO,IAAAA,WAAF;AAAeC,IAAAA,QAAQ,EAAE,CAAzB;AAA4Bd,IAAAA;AAA5B,GAAT,CAAhB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASO,mBAAT,CAA8Be,OAA9B,EAAwC;AAC9C,SAAO,CAAEA,OAAF,IAAa,CAAEA,OAAO,CAACkB,MAAvB,IAAiC,mBAAOlB,OAAP,EAAgBiB,UAAhB,CAAxC;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASA,UAAT,CAAqBf,GAArB,EAA2B;AACjC,SAAO,EAAIA,GAAG,CAACtB,KAAJ,IAAasB,GAAG,CAACtB,KAAJ,CAAUsC,MAA3B,CAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { times, get, mapValues, every, pick } from 'lodash';\n\nconst INHERITED_COLUMN_ATTRIBUTES = [ 'align' ];\n\n/**\n * Creates a table state.\n *\n * @param {Object} options\n * @param {number} options.rowCount Row count for the table to create.\n * @param {number} options.columnCount Column count for the table to create.\n *\n * @return {Object} New table state.\n */\nexport function createTable( { rowCount, columnCount } ) {\n\treturn {\n\t\tbody: times( rowCount, () => ( {\n\t\t\tcells: times( columnCount, () => ( {\n\t\t\t\tcontent: '',\n\t\t\t\ttag: 'td',\n\t\t\t} ) ),\n\t\t} ) ),\n\t};\n}\n\n/**\n * Returns the first row in the table.\n *\n * @param {Object} state Current table state.\n *\n * @return {Object} The first table row.\n */\nexport function getFirstRow( state ) {\n\tif ( ! isEmptyTableSection( state.head ) ) {\n\t\treturn state.head[ 0 ];\n\t}\n\tif ( ! isEmptyTableSection( state.body ) ) {\n\t\treturn state.body[ 0 ];\n\t}\n\tif ( ! isEmptyTableSection( state.foot ) ) {\n\t\treturn state.foot[ 0 ];\n\t}\n}\n\n/**\n * Gets an attribute for a cell.\n *\n * @param {Object} state Current table state.\n * @param {Object} cellLocation The location of the cell\n * @param {string} attributeName The name of the attribute to get the value of.\n *\n * @return {*} The attribute value.\n */\nexport function getCellAttribute( state, cellLocation, attributeName ) {\n\tconst { sectionName, rowIndex, columnIndex } = cellLocation;\n\treturn get( state, [\n\t\tsectionName,\n\t\trowIndex,\n\t\t'cells',\n\t\tcolumnIndex,\n\t\tattributeName,\n\t] );\n}\n\n/**\n * Returns updated cell attributes after applying the `updateCell` function to the selection.\n *\n * @param {Object} state The block attributes.\n * @param {Object} selection The selection of cells to update.\n * @param {Function} updateCell A function to update the selected cell attributes.\n *\n * @return {Object} New table state including the updated cells.\n */\nexport function updateSelectedCell( state, selection, updateCell ) {\n\tif ( ! selection ) {\n\t\treturn state;\n\t}\n\n\tconst tableSections = pick( state, [ 'head', 'body', 'foot' ] );\n\tconst { sectionName: selectionSectionName, rowIndex: selectionRowIndex } =\n\t\tselection;\n\n\treturn mapValues( tableSections, ( section, sectionName ) => {\n\t\tif ( selectionSectionName && selectionSectionName !== sectionName ) {\n\t\t\treturn section;\n\t\t}\n\n\t\treturn section.map( ( row, rowIndex ) => {\n\t\t\tif ( selectionRowIndex && selectionRowIndex !== rowIndex ) {\n\t\t\t\treturn row;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcells: row.cells.map( ( cellAttributes, columnIndex ) => {\n\t\t\t\t\tconst cellLocation = {\n\t\t\t\t\t\tsectionName,\n\t\t\t\t\t\tcolumnIndex,\n\t\t\t\t\t\trowIndex,\n\t\t\t\t\t};\n\n\t\t\t\t\tif ( ! isCellSelected( cellLocation, selection ) ) {\n\t\t\t\t\t\treturn cellAttributes;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn updateCell( cellAttributes );\n\t\t\t\t} ),\n\t\t\t};\n\t\t} );\n\t} );\n}\n\n/**\n * Returns whether the cell at `cellLocation` is included in the selection `selection`.\n *\n * @param {Object} cellLocation An object containing cell location properties.\n * @param {Object} selection An object containing selection properties.\n *\n * @return {boolean} True if the cell is selected, false otherwise.\n */\nexport function isCellSelected( cellLocation, selection ) {\n\tif ( ! cellLocation || ! selection ) {\n\t\treturn false;\n\t}\n\n\tswitch ( selection.type ) {\n\t\tcase 'column':\n\t\t\treturn (\n\t\t\t\tselection.type === 'column' &&\n\t\t\t\tcellLocation.columnIndex === selection.columnIndex\n\t\t\t);\n\t\tcase 'cell':\n\t\t\treturn (\n\t\t\t\tselection.type === 'cell' &&\n\t\t\t\tcellLocation.sectionName === selection.sectionName &&\n\t\t\t\tcellLocation.columnIndex === selection.columnIndex &&\n\t\t\t\tcellLocation.rowIndex === selection.rowIndex\n\t\t\t);\n\t}\n}\n\n/**\n * Inserts a row in the table state.\n *\n * @param {Object} state Current table state.\n * @param {Object} options\n * @param {string} options.sectionName Section in which to insert the row.\n * @param {number} options.rowIndex Row index at which to insert the row.\n * @param {number} options.columnCount Column count for the table to create.\n *\n * @return {Object} New table state.\n */\nexport function insertRow( state, { sectionName, rowIndex, columnCount } ) {\n\tconst firstRow = getFirstRow( state );\n\tconst cellCount =\n\t\tcolumnCount === undefined\n\t\t\t? get( firstRow, [ 'cells', 'length' ] )\n\t\t\t: columnCount;\n\n\t// Bail early if the function cannot determine how many cells to add.\n\tif ( ! cellCount ) {\n\t\treturn state;\n\t}\n\n\treturn {\n\t\t[ sectionName ]: [\n\t\t\t...state[ sectionName ].slice( 0, rowIndex ),\n\t\t\t{\n\t\t\t\tcells: times( cellCount, ( index ) => {\n\t\t\t\t\tconst firstCellInColumn = get(\n\t\t\t\t\t\tfirstRow,\n\t\t\t\t\t\t[ 'cells', index ],\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t\tconst inheritedAttributes = pick(\n\t\t\t\t\t\tfirstCellInColumn,\n\t\t\t\t\t\tINHERITED_COLUMN_ATTRIBUTES\n\t\t\t\t\t);\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...inheritedAttributes,\n\t\t\t\t\t\tcontent: '',\n\t\t\t\t\t\ttag: sectionName === 'head' ? 'th' : 'td',\n\t\t\t\t\t};\n\t\t\t\t} ),\n\t\t\t},\n\t\t\t...state[ sectionName ].slice( rowIndex ),\n\t\t],\n\t};\n}\n\n/**\n * Deletes a row from the table state.\n *\n * @param {Object} state Current table state.\n * @param {Object} options\n * @param {string} options.sectionName Section in which to delete the row.\n * @param {number} options.rowIndex Row index to delete.\n *\n * @return {Object} New table state.\n */\nexport function deleteRow( state, { sectionName, rowIndex } ) {\n\treturn {\n\t\t[ sectionName ]: state[ sectionName ].filter(\n\t\t\t( row, index ) => index !== rowIndex\n\t\t),\n\t};\n}\n\n/**\n * Inserts a column in the table state.\n *\n * @param {Object} state Current table state.\n * @param {Object} options\n * @param {number} options.columnIndex Column index at which to insert the column.\n *\n * @return {Object} New table state.\n */\nexport function insertColumn( state, { columnIndex } ) {\n\tconst tableSections = pick( state, [ 'head', 'body', 'foot' ] );\n\n\treturn mapValues( tableSections, ( section, sectionName ) => {\n\t\t// Bail early if the table section is empty.\n\t\tif ( isEmptyTableSection( section ) ) {\n\t\t\treturn section;\n\t\t}\n\n\t\treturn section.map( ( row ) => {\n\t\t\t// Bail early if the row is empty or it's an attempt to insert past\n\t\t\t// the last possible index of the array.\n\t\t\tif ( isEmptyRow( row ) || row.cells.length < columnIndex ) {\n\t\t\t\treturn row;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcells: [\n\t\t\t\t\t...row.cells.slice( 0, columnIndex ),\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: '',\n\t\t\t\t\t\ttag: sectionName === 'head' ? 'th' : 'td',\n\t\t\t\t\t},\n\t\t\t\t\t...row.cells.slice( columnIndex ),\n\t\t\t\t],\n\t\t\t};\n\t\t} );\n\t} );\n}\n\n/**\n * Deletes a column from the table state.\n *\n * @param {Object} state Current table state.\n * @param {Object} options\n * @param {number} options.columnIndex Column index to delete.\n *\n * @return {Object} New table state.\n */\nexport function deleteColumn( state, { columnIndex } ) {\n\tconst tableSections = pick( state, [ 'head', 'body', 'foot' ] );\n\n\treturn mapValues( tableSections, ( section ) => {\n\t\t// Bail early if the table section is empty.\n\t\tif ( isEmptyTableSection( section ) ) {\n\t\t\treturn section;\n\t\t}\n\n\t\treturn section\n\t\t\t.map( ( row ) => ( {\n\t\t\t\tcells:\n\t\t\t\t\trow.cells.length >= columnIndex\n\t\t\t\t\t\t? row.cells.filter(\n\t\t\t\t\t\t\t\t( cell, index ) => index !== columnIndex\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: row.cells,\n\t\t\t} ) )\n\t\t\t.filter( ( row ) => row.cells.length );\n\t} );\n}\n\n/**\n * Toggles the existance of a section.\n *\n * @param {Object} state Current table state.\n * @param {string} sectionName Name of the section to toggle.\n *\n * @return {Object} New table state.\n */\nexport function toggleSection( state, sectionName ) {\n\t// Section exists, replace it with an empty row to remove it.\n\tif ( ! isEmptyTableSection( state[ sectionName ] ) ) {\n\t\treturn { [ sectionName ]: [] };\n\t}\n\n\t// Get the length of the first row of the body to use when creating the header.\n\tconst columnCount = get( state, [ 'body', 0, 'cells', 'length' ], 1 );\n\n\t// Section doesn't exist, insert an empty row to create the section.\n\treturn insertRow( state, { sectionName, rowIndex: 0, columnCount } );\n}\n\n/**\n * Determines whether a table section is empty.\n *\n * @param {Object} section Table section state.\n *\n * @return {boolean} True if the table section is empty, false otherwise.\n */\nexport function isEmptyTableSection( section ) {\n\treturn ! section || ! section.length || every( section, isEmptyRow );\n}\n\n/**\n * Determines whether a table row is empty.\n *\n * @param {Object} row Table row state.\n *\n * @return {boolean} True if the table section is empty, false otherwise.\n */\nexport function isEmptyRow( row ) {\n\treturn ! ( row.cells && row.cells.length );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/table/state.js"],"names":["INHERITED_COLUMN_ATTRIBUTES","createTable","rowCount","columnCount","body","Array","from","length","map","cells","content","tag","getFirstRow","state","isEmptyTableSection","head","foot","getCellAttribute","cellLocation","attributeName","sectionName","rowIndex","columnIndex","updateSelectedCell","selection","updateCell","tableSections","selectionSectionName","selectionRowIndex","section","row","cellAttributes","isCellSelected","type","insertRow","firstRow","cellCount","undefined","slice","_","index","firstCellInColumn","inheritedAttributes","deleteRow","filter","insertColumn","isEmptyRow","deleteColumn","cell","toggleSection"],"mappings":";;;;;;;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,2BAA2B,GAAG,CAAE,OAAF,CAApC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,WAAT,OAAkD;AAAA,MAA5B;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAA4B;AACxD,SAAO;AACNC,IAAAA,IAAI,EAAEC,KAAK,CAACC,IAAN,CAAY;AAAEC,MAAAA,MAAM,EAAEL;AAAV,KAAZ,EAAmCM,GAAnC,CAAwC,OAAQ;AACrDC,MAAAA,KAAK,EAAEJ,KAAK,CAACC,IAAN,CAAY;AAAEC,QAAAA,MAAM,EAAEJ;AAAV,OAAZ,EAAsCK,GAAtC,CAA2C,OAAQ;AACzDE,QAAAA,OAAO,EAAE,EADgD;AAEzDC,QAAAA,GAAG,EAAE;AAFoD,OAAR,CAA3C;AAD8C,KAAR,CAAxC;AADA,GAAP;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,WAAT,CAAsBC,K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AOsB,OAAP,EAAgBiB,UAAhB,CAAxC;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASA,UAAT,CAAqBhB,GAArB,EAA2B;AACjC,SAAO,EAAIA,GAAG,CAACrB,KAAJ,IAAaqB,GAAG,CAACrB,KAAJ,CAAUF,MAA3B,CAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get, mapValues, every, pick } from 'lodash';\n\nconst INHERITED_COLUMN_ATTRIBUTES = [ 'align' ];\n\n/**\n * Creates a table state.\n *\n * @param {Object} options\n * @param {number} options.rowCount Row count for the table to create.\n * @param {number} options.columnCount Column count for the table to create.\n *\n * @return {Object} New table state.\n */\nexport function createTable( { rowCount, columnCount } ) {\n\treturn {\n\t\tbody: Array.from( { length: rowCount } ).map( () => ( {\n\t\t\tcells: Array.from( { length: columnCount } ).map( () => ( {\n\t\t\t\tcontent: '',\n\t\t\t\ttag: 'td',\n\t\t\t} ) ),\n\t\t} ) ),\n\t};\n}\n\n/**\n * Returns the first row in the table.\n *\n * @param {Object} state Current table state.\n *\n * @return {Object} The first table row.\n */\nexport function getFirstRow( state ) {\n\tif ( ! isEmptyTableSection( state.head ) ) {\n\t\treturn state.head[ 0 ];\n\t}\n\tif ( ! isEmptyTableSection( state.body ) ) {\n\t\treturn state.body[ 0 ];\n\t}\n\tif ( ! isEmptyTableSection( state.foot ) ) {\n\t\treturn state.foot[ 0 ];\n\t}\n}\n\n/**\n * Gets an attribute for a cell.\n *\n * @param {Object} state Current table state.\n * @param {Object} cellLocation The location of the cell\n * @param {string} attributeName The name of the attribute to get the value of.\n *\n * @return {*} The attribute value.\n */\nexport function getCellAttribute( state, cellLocation, attributeName ) {\n\tconst { sectionName, rowIndex, columnIndex } = cellLocation;\n\treturn get( state, [\n\t\tsectionName,\n\t\trowIndex,\n\t\t'cells',\n\t\tcolumnIndex,\n\t\tattributeName,\n\t] );\n}\n\n/**\n * Returns updated cell attributes after applying the `updateCell` function to the selection.\n *\n * @param {Object} state The block attributes.\n * @param {Object} selection The selection of cells to update.\n * @param {Function} updateCell A function to update the selected cell attributes.\n *\n * @return {Object} New table state including the updated cells.\n */\nexport function updateSelectedCell( state, selection, updateCell ) {\n\tif ( ! selection ) {\n\t\treturn state;\n\t}\n\n\tconst tableSections = pick( state, [ 'head', 'body', 'foot' ] );\n\tconst { sectionName: selectionSectionName, rowIndex: selectionRowIndex } =\n\t\tselection;\n\n\treturn mapValues( tableSections, ( section, sectionName ) => {\n\t\tif ( selectionSectionName && selectionSectionName !== sectionName ) {\n\t\t\treturn section;\n\t\t}\n\n\t\treturn section.map( ( row, rowIndex ) => {\n\t\t\tif ( selectionRowIndex && selectionRowIndex !== rowIndex ) {\n\t\t\t\treturn row;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcells: row.cells.map( ( cellAttributes, columnIndex ) => {\n\t\t\t\t\tconst cellLocation = {\n\t\t\t\t\t\tsectionName,\n\t\t\t\t\t\tcolumnIndex,\n\t\t\t\t\t\trowIndex,\n\t\t\t\t\t};\n\n\t\t\t\t\tif ( ! isCellSelected( cellLocation, selection ) ) {\n\t\t\t\t\t\treturn cellAttributes;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn updateCell( cellAttributes );\n\t\t\t\t} ),\n\t\t\t};\n\t\t} );\n\t} );\n}\n\n/**\n * Returns whether the cell at `cellLocation` is included in the selection `selection`.\n *\n * @param {Object} cellLocation An object containing cell location properties.\n * @param {Object} selection An object containing selection properties.\n *\n * @return {boolean} True if the cell is selected, false otherwise.\n */\nexport function isCellSelected( cellLocation, selection ) {\n\tif ( ! cellLocation || ! selection ) {\n\t\treturn false;\n\t}\n\n\tswitch ( selection.type ) {\n\t\tcase 'column':\n\t\t\treturn (\n\t\t\t\tselection.type === 'column' &&\n\t\t\t\tcellLocation.columnIndex === selection.columnIndex\n\t\t\t);\n\t\tcase 'cell':\n\t\t\treturn (\n\t\t\t\tselection.type === 'cell' &&\n\t\t\t\tcellLocation.sectionName === selection.sectionName &&\n\t\t\t\tcellLocation.columnIndex === selection.columnIndex &&\n\t\t\t\tcellLocation.rowIndex === selection.rowIndex\n\t\t\t);\n\t}\n}\n\n/**\n * Inserts a row in the table state.\n *\n * @param {Object} state Current table state.\n * @param {Object} options\n * @param {string} options.sectionName Section in which to insert the row.\n * @param {number} options.rowIndex Row index at which to insert the row.\n * @param {number} options.columnCount Column count for the table to create.\n *\n * @return {Object} New table state.\n */\nexport function insertRow( state, { sectionName, rowIndex, columnCount } ) {\n\tconst firstRow = getFirstRow( state );\n\tconst cellCount =\n\t\tcolumnCount === undefined\n\t\t\t? get( firstRow, [ 'cells', 'length' ] )\n\t\t\t: columnCount;\n\n\t// Bail early if the function cannot determine how many cells to add.\n\tif ( ! cellCount ) {\n\t\treturn state;\n\t}\n\n\treturn {\n\t\t[ sectionName ]: [\n\t\t\t...state[ sectionName ].slice( 0, rowIndex ),\n\t\t\t{\n\t\t\t\tcells: Array.from( { length: cellCount } ).map(\n\t\t\t\t\t( _, index ) => {\n\t\t\t\t\t\tconst firstCellInColumn = get(\n\t\t\t\t\t\t\tfirstRow,\n\t\t\t\t\t\t\t[ 'cells', index ],\n\t\t\t\t\t\t\t{}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst inheritedAttributes = pick(\n\t\t\t\t\t\t\tfirstCellInColumn,\n\t\t\t\t\t\t\tINHERITED_COLUMN_ATTRIBUTES\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...inheritedAttributes,\n\t\t\t\t\t\t\tcontent: '',\n\t\t\t\t\t\t\ttag: sectionName === 'head' ? 'th' : 'td',\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...state[ sectionName ].slice( rowIndex ),\n\t\t],\n\t};\n}\n\n/**\n * Deletes a row from the table state.\n *\n * @param {Object} state Current table state.\n * @param {Object} options\n * @param {string} options.sectionName Section in which to delete the row.\n * @param {number} options.rowIndex Row index to delete.\n *\n * @return {Object} New table state.\n */\nexport function deleteRow( state, { sectionName, rowIndex } ) {\n\treturn {\n\t\t[ sectionName ]: state[ sectionName ].filter(\n\t\t\t( row, index ) => index !== rowIndex\n\t\t),\n\t};\n}\n\n/**\n * Inserts a column in the table state.\n *\n * @param {Object} state Current table state.\n * @param {Object} options\n * @param {number} options.columnIndex Column index at which to insert the column.\n *\n * @return {Object} New table state.\n */\nexport function insertColumn( state, { columnIndex } ) {\n\tconst tableSections = pick( state, [ 'head', 'body', 'foot' ] );\n\n\treturn mapValues( tableSections, ( section, sectionName ) => {\n\t\t// Bail early if the table section is empty.\n\t\tif ( isEmptyTableSection( section ) ) {\n\t\t\treturn section;\n\t\t}\n\n\t\treturn section.map( ( row ) => {\n\t\t\t// Bail early if the row is empty or it's an attempt to insert past\n\t\t\t// the last possible index of the array.\n\t\t\tif ( isEmptyRow( row ) || row.cells.length < columnIndex ) {\n\t\t\t\treturn row;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcells: [\n\t\t\t\t\t...row.cells.slice( 0, columnIndex ),\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: '',\n\t\t\t\t\t\ttag: sectionName === 'head' ? 'th' : 'td',\n\t\t\t\t\t},\n\t\t\t\t\t...row.cells.slice( columnIndex ),\n\t\t\t\t],\n\t\t\t};\n\t\t} );\n\t} );\n}\n\n/**\n * Deletes a column from the table state.\n *\n * @param {Object} state Current table state.\n * @param {Object} options\n * @param {number} options.columnIndex Column index to delete.\n *\n * @return {Object} New table state.\n */\nexport function deleteColumn( state, { columnIndex } ) {\n\tconst tableSections = pick( state, [ 'head', 'body', 'foot' ] );\n\n\treturn mapValues( tableSections, ( section ) => {\n\t\t// Bail early if the table section is empty.\n\t\tif ( isEmptyTableSection( section ) ) {\n\t\t\treturn section;\n\t\t}\n\n\t\treturn section\n\t\t\t.map( ( row ) => ( {\n\t\t\t\tcells:\n\t\t\t\t\trow.cells.length >= columnIndex\n\t\t\t\t\t\t? row.cells.filter(\n\t\t\t\t\t\t\t\t( cell, index ) => index !== columnIndex\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: row.cells,\n\t\t\t} ) )\n\t\t\t.filter( ( row ) => row.cells.length );\n\t} );\n}\n\n/**\n * Toggles the existance of a section.\n *\n * @param {Object} state Current table state.\n * @param {string} sectionName Name of the section to toggle.\n *\n * @return {Object} New table state.\n */\nexport function toggleSection( state, sectionName ) {\n\t// Section exists, replace it with an empty row to remove it.\n\tif ( ! isEmptyTableSection( state[ sectionName ] ) ) {\n\t\treturn { [ sectionName ]: [] };\n\t}\n\n\t// Get the length of the first row of the body to use when creating the header.\n\tconst columnCount = get( state, [ 'body', 0, 'cells', 'length' ], 1 );\n\n\t// Section doesn't exist, insert an empty row to create the section.\n\treturn insertRow( state, { sectionName, rowIndex: 0, columnCount } );\n}\n\n/**\n * Determines whether a table section is empty.\n *\n * @param {Object} section Table section state.\n *\n * @return {boolean} True if the table section is empty, false otherwise.\n */\nexport function isEmptyTableSection( section ) {\n\treturn ! section || ! section.length || every( section, isEmptyRow );\n}\n\n/**\n * Determines whether a table row is empty.\n *\n * @param {Object} row Table row state.\n *\n * @return {boolean} True if the table section is empty, false otherwise.\n */\nexport function isEmptyRow( row ) {\n\treturn ! ( row.cells && row.cells.length );\n}\n"]}
@@ -39,7 +39,30 @@ const metadata = {
39
39
  }
40
40
  },
41
41
  supports: {
42
- html: false
42
+ html: false,
43
+ color: {
44
+ text: true,
45
+ background: true,
46
+ gradients: true,
47
+ link: true
48
+ },
49
+ spacing: {
50
+ margin: true,
51
+ padding: true
52
+ },
53
+ typography: {
54
+ fontSize: true,
55
+ lineHeight: true,
56
+ __experimentalFontFamily: true,
57
+ __experimentalFontWeight: true,
58
+ __experimentalFontStyle: true,
59
+ __experimentalTextTransform: true,
60
+ __experimentalTextDecoration: true,
61
+ __experimentalLetterSpacing: true,
62
+ __experimentalDefaultControls: {
63
+ fontSize: true
64
+ }
65
+ }
43
66
  },
44
67
  example: {}
45
68
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/table-of-contents/index.js"],"names":["name","metadata","settings","icon","edit","save"],"mappings":";;;;;;;;;AAIA;;AACA;;AACA;;AANA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,aADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB","sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport icon from './icon';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/table-of-contents/index.js"],"names":["name","metadata","settings","icon","edit","save"],"mappings":";;;;;;;;;AAIA;;AACA;;AACA;;AANA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,aADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB","sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport icon from './icon';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n"]}
@@ -62,7 +62,11 @@ const metadata = {
62
62
  }],
63
63
  supports: {
64
64
  html: false,
65
- align: true
65
+ align: true,
66
+ spacing: {
67
+ margin: true,
68
+ padding: true
69
+ }
66
70
  },
67
71
  editorStyle: "wp-block-tag-cloud-editor"
68
72
  };