@wordpress/block-library 7.10.0 → 7.12.2-next.d6164808d3.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 (1048) hide show
  1. package/CHANGELOG.md +11 -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/edit.js +2 -1
  15. package/build/button/edit.js.map +1 -1
  16. package/build/button/index.js +1 -1
  17. package/build/buttons/edit.js +1 -1
  18. package/build/buttons/edit.js.map +1 -1
  19. package/build/calendar/edit.js +12 -5
  20. package/build/calendar/edit.js.map +1 -1
  21. package/build/categories/edit.js +3 -1
  22. package/build/categories/edit.js.map +1 -1
  23. package/build/categories/index.js +14 -1
  24. package/build/categories/index.js.map +1 -1
  25. package/build/code/index.js +4 -2
  26. package/build/code/index.js.map +1 -1
  27. package/build/column/index.js +13 -0
  28. package/build/column/index.js.map +1 -1
  29. package/build/columns/deprecated.js +16 -5
  30. package/build/columns/deprecated.js.map +1 -1
  31. package/build/columns/edit.js +6 -2
  32. package/build/columns/edit.js.map +1 -1
  33. package/build/columns/edit.native.js +9 -4
  34. package/build/columns/edit.native.js.map +1 -1
  35. package/build/columns/index.js +13 -0
  36. package/build/columns/index.js.map +1 -1
  37. package/build/comment-author-name/index.js +5 -1
  38. package/build/comment-author-name/index.js.map +1 -1
  39. package/build/comment-content/index.js +5 -1
  40. package/build/comment-content/index.js.map +1 -1
  41. package/build/comment-date/index.js +1 -0
  42. package/build/comment-date/index.js.map +1 -1
  43. package/build/comment-edit-link/index.js +5 -1
  44. package/build/comment-edit-link/index.js.map +1 -1
  45. package/build/comment-reply-link/index.js +5 -1
  46. package/build/comment-reply-link/index.js.map +1 -1
  47. package/build/comment-template/index.js +14 -1
  48. package/build/comment-template/index.js.map +1 -1
  49. package/build/comments/edit/comments-legacy.js +73 -0
  50. package/build/comments/edit/comments-legacy.js.map +1 -0
  51. package/build/comments/{edit.js → edit/index.js} +17 -38
  52. package/build/comments/edit/index.js.map +1 -0
  53. package/build/comments/edit/placeholder.js +117 -0
  54. package/build/comments/edit/placeholder.js.map +1 -0
  55. package/build/comments/edit/template.js +39 -0
  56. package/build/comments/edit/template.js.map +1 -0
  57. package/build/comments/index.js +19 -1
  58. package/build/comments/index.js.map +1 -1
  59. package/build/comments/save.js +12 -4
  60. package/build/comments/save.js.map +1 -1
  61. package/build/comments-pagination/index.js +13 -0
  62. package/build/comments-pagination/index.js.map +1 -1
  63. package/build/comments-pagination-next/index.js +4 -2
  64. package/build/comments-pagination-next/index.js.map +1 -1
  65. package/build/comments-pagination-numbers/edit.js +5 -1
  66. package/build/comments-pagination-numbers/edit.js.map +1 -1
  67. package/build/comments-pagination-numbers/index.js +14 -1
  68. package/build/comments-pagination-numbers/index.js.map +1 -1
  69. package/build/comments-pagination-previous/index.js +4 -2
  70. package/build/comments-pagination-previous/index.js.map +1 -1
  71. package/build/comments-title/deprecated.js +4 -2
  72. package/build/comments-title/deprecated.js.map +1 -1
  73. package/build/comments-title/index.js +4 -2
  74. package/build/comments-title/index.js.map +1 -1
  75. package/build/cover/deprecated.js +20 -5
  76. package/build/cover/deprecated.js.map +1 -1
  77. package/build/cover/edit/resizable-cover.js +6 -0
  78. package/build/cover/edit/resizable-cover.js.map +1 -1
  79. package/build/cover/index.js +13 -0
  80. package/build/cover/index.js.map +1 -1
  81. package/build/cover/shared.js +1 -1
  82. package/build/cover/shared.js.map +1 -1
  83. package/build/cover/transforms.js +3 -2
  84. package/build/cover/transforms.js.map +1 -1
  85. package/build/embed/embed-placeholder.native.js +1 -3
  86. package/build/embed/embed-placeholder.native.js.map +1 -1
  87. package/build/embed/icons.js +1 -1
  88. package/build/embed/icons.js.map +1 -1
  89. package/build/gallery/deprecated.js +6 -1
  90. package/build/gallery/deprecated.js.map +1 -1
  91. package/build/gallery/edit.js +17 -4
  92. package/build/gallery/edit.js.map +1 -1
  93. package/build/gallery/index.js +5 -0
  94. package/build/gallery/index.js.map +1 -1
  95. package/build/gallery/transforms.js +20 -7
  96. package/build/gallery/transforms.js.map +1 -1
  97. package/build/gallery/use-get-media.native.js +59 -0
  98. package/build/gallery/use-get-media.native.js.map +1 -0
  99. package/build/gallery/utils.js +7 -6
  100. package/build/gallery/utils.js.map +1 -1
  101. package/build/group/deprecated.js +108 -12
  102. package/build/group/deprecated.js.map +1 -1
  103. package/build/group/edit.js +23 -1
  104. package/build/group/edit.js.map +1 -1
  105. package/build/group/index.js +11 -2
  106. package/build/group/index.js.map +1 -1
  107. package/build/group/transforms.js +5 -0
  108. package/build/group/transforms.js.map +1 -1
  109. package/build/group/variations.js +9 -9
  110. package/build/group/variations.js.map +1 -1
  111. package/build/heading/deprecated.js +5 -3
  112. package/build/heading/deprecated.js.map +1 -1
  113. package/build/heading/index.js +3 -1
  114. package/build/heading/index.js.map +1 -1
  115. package/build/heading/transforms.js +3 -1
  116. package/build/heading/transforms.js.map +1 -1
  117. package/build/home-link/edit.js +8 -4
  118. package/build/home-link/edit.js.map +1 -1
  119. package/build/image/deprecated.js +77 -9
  120. package/build/image/deprecated.js.map +1 -1
  121. package/build/image/edit.js +16 -2
  122. package/build/image/edit.js.map +1 -1
  123. package/build/image/edit.native.js +18 -8
  124. package/build/image/edit.native.js.map +1 -1
  125. package/build/image/image.js +27 -20
  126. package/build/image/image.js.map +1 -1
  127. package/build/image/index.js +20 -8
  128. package/build/image/index.js.map +1 -1
  129. package/build/image/save.js +8 -2
  130. package/build/image/save.js.map +1 -1
  131. package/build/index.js +1 -3
  132. package/build/index.js.map +1 -1
  133. package/build/index.native.js +16 -10
  134. package/build/index.native.js.map +1 -1
  135. package/build/list/index.js +6 -0
  136. package/build/list/index.js.map +1 -1
  137. package/build/list/transforms.js +4 -63
  138. package/build/list/transforms.js.map +1 -1
  139. package/build/list/v2/edit.js +16 -5
  140. package/build/list/v2/edit.js.map +1 -1
  141. package/build/list/v2/tag-name.js +31 -0
  142. package/build/list/v2/tag-name.js.map +1 -0
  143. package/build/list/v2/tag-name.native.js +32 -0
  144. package/build/list/v2/tag-name.native.js.map +1 -0
  145. package/build/list/v2/transforms.js +1 -38
  146. package/build/list/v2/transforms.js.map +1 -1
  147. package/build/list-item/edit.js +18 -10
  148. package/build/list-item/edit.js.map +1 -1
  149. package/build/list-item/edit.native.js +158 -0
  150. package/build/list-item/edit.native.js.map +1 -0
  151. package/build/list-item/hooks/index.js +12 -4
  152. package/build/list-item/hooks/index.js.map +1 -1
  153. package/build/list-item/hooks/use-copy.js +42 -0
  154. package/build/list-item/hooks/use-copy.js.map +1 -0
  155. package/build/list-item/hooks/use-merge.js +174 -0
  156. package/build/list-item/hooks/use-merge.js.map +1 -0
  157. package/build/list-item/hooks/use-outdent-list-item.js +86 -50
  158. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  159. package/build/list-item/icons.native.js +53 -0
  160. package/build/list-item/icons.native.js.map +1 -0
  161. package/build/list-item/list-style-type.native.js +139 -0
  162. package/build/list-item/list-style-type.native.js.map +1 -0
  163. package/build/list-item/utils.js +125 -1
  164. package/build/list-item/utils.js.map +1 -1
  165. package/build/media-text/deprecated.js +270 -17
  166. package/build/media-text/deprecated.js.map +1 -1
  167. package/build/media-text/edit.js +4 -3
  168. package/build/media-text/edit.js.map +1 -1
  169. package/build/media-text/index.js +13 -0
  170. package/build/media-text/index.js.map +1 -1
  171. package/build/media-text/media-container.js +1 -1
  172. package/build/media-text/media-container.js.map +1 -1
  173. package/build/media-text/save.js +13 -0
  174. package/build/media-text/save.js.map +1 -1
  175. package/build/more/save.js +1 -7
  176. package/build/more/save.js.map +1 -1
  177. package/build/navigation/deprecated.js +6 -1
  178. package/build/navigation/deprecated.js.map +1 -1
  179. package/build/navigation/edit/index.js +180 -154
  180. package/build/navigation/edit/index.js.map +1 -1
  181. package/build/navigation/edit/navigation-menu-selector.js +11 -14
  182. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  183. package/build/navigation/edit/placeholder/index.js +4 -2
  184. package/build/navigation/edit/placeholder/index.js.map +1 -1
  185. package/build/navigation/edit/responsive-wrapper.js +13 -3
  186. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  187. package/build/navigation/edit/unsaved-inner-blocks.js +2 -1
  188. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  189. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -7
  190. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  191. package/build/navigation/edit/use-create-navigation-menu.js +5 -1
  192. package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
  193. package/build/navigation/edit/use-inner-blocks.js +43 -0
  194. package/build/navigation/edit/use-inner-blocks.js.map +1 -0
  195. package/build/navigation/edit/utils.js +28 -0
  196. package/build/navigation/edit/utils.js.map +1 -0
  197. package/build/navigation/menu-items-to-blocks.js +1 -7
  198. package/build/navigation/menu-items-to-blocks.js.map +1 -1
  199. package/build/navigation/use-navigation-menu.js +15 -10
  200. package/build/navigation/use-navigation-menu.js.map +1 -1
  201. package/build/navigation-link/edit.js +11 -12
  202. package/build/navigation-link/edit.js.map +1 -1
  203. package/build/navigation-submenu/edit.js +6 -7
  204. package/build/navigation-submenu/edit.js.map +1 -1
  205. package/build/page-list/edit.js +15 -4
  206. package/build/page-list/edit.js.map +1 -1
  207. package/build/paragraph/deprecated.js +18 -10
  208. package/build/paragraph/deprecated.js.map +1 -1
  209. package/build/paragraph/edit.js +8 -11
  210. package/build/paragraph/edit.js.map +1 -1
  211. package/build/paragraph/index.js +5 -0
  212. package/build/paragraph/index.js.map +1 -1
  213. package/build/paragraph/transforms.js +5 -0
  214. package/build/paragraph/transforms.js.map +1 -1
  215. package/build/post-author/edit.js +5 -2
  216. package/build/post-author/edit.js.map +1 -1
  217. package/build/post-author/index.js +4 -2
  218. package/build/post-author/index.js.map +1 -1
  219. package/build/post-author-biography/edit.js +7 -1
  220. package/build/post-author-biography/edit.js.map +1 -1
  221. package/build/post-author-biography/index.js +1 -0
  222. package/build/post-author-biography/index.js.map +1 -1
  223. package/build/post-author-name/index.js +5 -1
  224. package/build/post-author-name/index.js.map +1 -1
  225. package/build/post-comments-count/edit.js +11 -1
  226. package/build/post-comments-count/edit.js.map +1 -1
  227. package/build/post-comments-count/index.js +4 -1
  228. package/build/post-comments-count/index.js.map +1 -1
  229. package/build/post-comments-form/edit.js +4 -45
  230. package/build/post-comments-form/edit.js.map +1 -1
  231. package/build/post-comments-form/form.js +47 -3
  232. package/build/post-comments-form/form.js.map +1 -1
  233. package/build/post-comments-link/index.js +4 -2
  234. package/build/post-comments-link/index.js.map +1 -1
  235. package/build/post-content/edit.js +4 -2
  236. package/build/post-content/edit.js.map +1 -1
  237. package/build/post-date/edit.js +9 -2
  238. package/build/post-date/edit.js.map +1 -1
  239. package/build/post-date/index.js +9 -0
  240. package/build/post-date/index.js.map +1 -1
  241. package/build/post-featured-image/edit.js +43 -14
  242. package/build/post-featured-image/edit.js.map +1 -1
  243. package/build/post-featured-image/index.js +21 -0
  244. package/build/post-featured-image/index.js.map +1 -1
  245. package/build/post-navigation-link/index.js +3 -2
  246. package/build/post-navigation-link/index.js.map +1 -1
  247. package/build/post-template/edit.js +8 -4
  248. package/build/post-template/edit.js.map +1 -1
  249. package/build/post-template/index.js +14 -1
  250. package/build/post-template/index.js.map +1 -1
  251. package/build/post-terms/edit.js +3 -2
  252. package/build/post-terms/edit.js.map +1 -1
  253. package/build/post-terms/index.js +5 -3
  254. package/build/post-terms/index.js.map +1 -1
  255. package/build/post-title/index.js +2 -1
  256. package/build/post-title/index.js.map +1 -1
  257. package/build/preformatted/index.js +4 -2
  258. package/build/preformatted/index.js.map +1 -1
  259. package/build/pullquote/deprecated.js +135 -25
  260. package/build/pullquote/deprecated.js.map +1 -1
  261. package/build/pullquote/edit.js +1 -1
  262. package/build/pullquote/edit.js.map +1 -1
  263. package/build/pullquote/edit.native.js +0 -1
  264. package/build/pullquote/edit.native.js.map +1 -1
  265. package/build/pullquote/index.js +13 -6
  266. package/build/pullquote/index.js.map +1 -1
  267. package/build/pullquote/save.js +2 -2
  268. package/build/pullquote/save.js.map +1 -1
  269. package/build/pullquote/transforms.js +14 -33
  270. package/build/pullquote/transforms.js.map +1 -1
  271. package/build/query/deprecated.js +10 -9
  272. package/build/query/deprecated.js.map +1 -1
  273. package/build/query/edit/index.js +19 -8
  274. package/build/query/edit/index.js.map +1 -1
  275. package/build/query/edit/inspector-controls/index.js +42 -9
  276. package/build/query/edit/inspector-controls/index.js.map +1 -1
  277. package/build/query/edit/inspector-controls/taxonomy-controls.js +22 -14
  278. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  279. package/build/query/edit/query-placeholder.js +6 -1
  280. package/build/query/edit/query-placeholder.js.map +1 -1
  281. package/build/query/utils.js +35 -9
  282. package/build/query/utils.js.map +1 -1
  283. package/build/query-no-results/edit.js +2 -2
  284. package/build/query-no-results/edit.js.map +1 -1
  285. package/build/query-pagination-next/edit.js +2 -1
  286. package/build/query-pagination-next/edit.js.map +1 -1
  287. package/build/query-pagination-previous/edit.js +2 -1
  288. package/build/query-pagination-previous/edit.js.map +1 -1
  289. package/build/query-title/edit.js +30 -8
  290. package/build/query-title/edit.js.map +1 -1
  291. package/build/query-title/index.js +11 -2
  292. package/build/query-title/index.js.map +1 -1
  293. package/build/query-title/variations.js +10 -0
  294. package/build/query-title/variations.js.map +1 -1
  295. package/build/quote/deprecated.js +176 -37
  296. package/build/quote/deprecated.js.map +1 -1
  297. package/build/quote/edit.js +76 -39
  298. package/build/quote/edit.js.map +1 -1
  299. package/build/quote/index.js +9 -45
  300. package/build/quote/index.js.map +1 -1
  301. package/build/quote/save.js +1 -5
  302. package/build/quote/save.js.map +1 -1
  303. package/build/quote/transforms.js +96 -159
  304. package/build/quote/transforms.js.map +1 -1
  305. package/build/separator/deprecated.js +3 -4
  306. package/build/separator/deprecated.js.map +1 -1
  307. package/build/separator/edit.js +1 -1
  308. package/build/separator/edit.js.map +1 -1
  309. package/build/separator/index.js +1 -0
  310. package/build/separator/index.js.map +1 -1
  311. package/build/social-link/icons/index.js +13 -0
  312. package/build/social-link/icons/index.js.map +1 -1
  313. package/build/social-link/icons/reddit.js +1 -1
  314. package/build/social-link/icons/reddit.js.map +1 -1
  315. package/build/social-link/icons/whatsapp.js +25 -0
  316. package/build/social-link/icons/whatsapp.js.map +1 -0
  317. package/build/social-link/variations.js +7 -0
  318. package/build/social-link/variations.js.map +1 -1
  319. package/build/social-links/edit.js +3 -1
  320. package/build/social-links/edit.js.map +1 -1
  321. package/build/spacer/index.js +7 -1
  322. package/build/spacer/index.js.map +1 -1
  323. package/build/table/index.js +4 -0
  324. package/build/table/index.js.map +1 -1
  325. package/build/table/state.js +9 -3
  326. package/build/table/state.js.map +1 -1
  327. package/build/table-of-contents/index.js +11 -1
  328. package/build/table-of-contents/index.js.map +1 -1
  329. package/build/tag-cloud/index.js +5 -1
  330. package/build/tag-cloud/index.js.map +1 -1
  331. package/build/template-part/edit/index.js +21 -10
  332. package/build/template-part/edit/index.js.map +1 -1
  333. package/build/template-part/edit/selection-modal.js +33 -13
  334. package/build/template-part/edit/selection-modal.js.map +1 -1
  335. package/build/template-part/edit/utils/search.js +94 -0
  336. package/build/template-part/edit/utils/search.js.map +1 -0
  337. package/build/template-part/index.js +2 -2
  338. package/build/template-part/index.js.map +1 -1
  339. package/build/term-description/index.js +4 -0
  340. package/build/term-description/index.js.map +1 -1
  341. package/build/text-columns/edit.js +3 -1
  342. package/build/text-columns/edit.js.map +1 -1
  343. package/build/text-columns/save.js +3 -1
  344. package/build/text-columns/save.js.map +1 -1
  345. package/build/verse/index.js +1 -0
  346. package/build/verse/index.js.map +1 -1
  347. package/build/video/index.js +4 -0
  348. package/build/video/index.js.map +1 -1
  349. package/build-module/archives/edit.js +7 -0
  350. package/build-module/archives/edit.js.map +1 -1
  351. package/build-module/archives/index.js +9 -1
  352. package/build-module/archives/index.js.map +1 -1
  353. package/build-module/audio/index.js +4 -0
  354. package/build-module/audio/index.js.map +1 -1
  355. package/build-module/block/edit.js +5 -3
  356. package/build-module/block/edit.js.map +1 -1
  357. package/build-module/block/edit.native.js +5 -3
  358. package/build-module/block/edit.native.js.map +1 -1
  359. package/build-module/button/deprecated.js +14 -4
  360. package/build-module/button/deprecated.js.map +1 -1
  361. package/build-module/button/edit.js +2 -1
  362. package/build-module/button/edit.js.map +1 -1
  363. package/build-module/button/index.js +1 -1
  364. package/build-module/buttons/edit.js +2 -2
  365. package/build-module/buttons/edit.js.map +1 -1
  366. package/build-module/calendar/edit.js +12 -4
  367. package/build-module/calendar/edit.js.map +1 -1
  368. package/build-module/categories/edit.js +4 -2
  369. package/build-module/categories/edit.js.map +1 -1
  370. package/build-module/categories/index.js +14 -1
  371. package/build-module/categories/index.js.map +1 -1
  372. package/build-module/code/index.js +4 -2
  373. package/build-module/code/index.js.map +1 -1
  374. package/build-module/column/index.js +13 -0
  375. package/build-module/column/index.js.map +1 -1
  376. package/build-module/columns/deprecated.js +16 -4
  377. package/build-module/columns/deprecated.js.map +1 -1
  378. package/build-module/columns/edit.js +7 -3
  379. package/build-module/columns/edit.js.map +1 -1
  380. package/build-module/columns/edit.native.js +10 -5
  381. package/build-module/columns/edit.native.js.map +1 -1
  382. package/build-module/columns/index.js +13 -0
  383. package/build-module/columns/index.js.map +1 -1
  384. package/build-module/comment-author-name/index.js +5 -1
  385. package/build-module/comment-author-name/index.js.map +1 -1
  386. package/build-module/comment-content/index.js +5 -1
  387. package/build-module/comment-content/index.js.map +1 -1
  388. package/build-module/comment-date/index.js +1 -0
  389. package/build-module/comment-date/index.js.map +1 -1
  390. package/build-module/comment-edit-link/index.js +5 -1
  391. package/build-module/comment-edit-link/index.js.map +1 -1
  392. package/build-module/comment-reply-link/index.js +5 -1
  393. package/build-module/comment-reply-link/index.js.map +1 -1
  394. package/build-module/comment-template/index.js +14 -1
  395. package/build-module/comment-template/index.js.map +1 -1
  396. package/build-module/comments/edit/comments-legacy.js +59 -0
  397. package/build-module/comments/edit/comments-legacy.js.map +1 -0
  398. package/build-module/comments/edit/index.js +37 -0
  399. package/build-module/comments/edit/index.js.map +1 -0
  400. package/build-module/comments/edit/placeholder.js +102 -0
  401. package/build-module/comments/edit/placeholder.js.map +1 -0
  402. package/build-module/comments/edit/template.js +32 -0
  403. package/build-module/comments/edit/template.js.map +1 -0
  404. package/build-module/comments/index.js +19 -1
  405. package/build-module/comments/index.js.map +1 -1
  406. package/build-module/comments/save.js +9 -4
  407. package/build-module/comments/save.js.map +1 -1
  408. package/build-module/comments-pagination/index.js +13 -0
  409. package/build-module/comments-pagination/index.js.map +1 -1
  410. package/build-module/comments-pagination-next/index.js +4 -2
  411. package/build-module/comments-pagination-next/index.js.map +1 -1
  412. package/build-module/comments-pagination-numbers/edit.js +5 -1
  413. package/build-module/comments-pagination-numbers/edit.js.map +1 -1
  414. package/build-module/comments-pagination-numbers/index.js +14 -1
  415. package/build-module/comments-pagination-numbers/index.js.map +1 -1
  416. package/build-module/comments-pagination-previous/index.js +4 -2
  417. package/build-module/comments-pagination-previous/index.js.map +1 -1
  418. package/build-module/comments-title/deprecated.js +4 -2
  419. package/build-module/comments-title/deprecated.js.map +1 -1
  420. package/build-module/comments-title/index.js +4 -2
  421. package/build-module/comments-title/index.js.map +1 -1
  422. package/build-module/cover/deprecated.js +20 -4
  423. package/build-module/cover/deprecated.js.map +1 -1
  424. package/build-module/cover/edit/resizable-cover.js +6 -0
  425. package/build-module/cover/edit/resizable-cover.js.map +1 -1
  426. package/build-module/cover/index.js +13 -0
  427. package/build-module/cover/index.js.map +1 -1
  428. package/build-module/cover/shared.js +1 -1
  429. package/build-module/cover/shared.js.map +1 -1
  430. package/build-module/cover/transforms.js +3 -2
  431. package/build-module/cover/transforms.js.map +1 -1
  432. package/build-module/embed/embed-placeholder.native.js +1 -2
  433. package/build-module/embed/embed-placeholder.native.js.map +1 -1
  434. package/build-module/embed/icons.js +1 -1
  435. package/build-module/embed/icons.js.map +1 -1
  436. package/build-module/gallery/deprecated.js +7 -2
  437. package/build-module/gallery/deprecated.js.map +1 -1
  438. package/build-module/gallery/edit.js +17 -4
  439. package/build-module/gallery/edit.js.map +1 -1
  440. package/build-module/gallery/index.js +5 -0
  441. package/build-module/gallery/index.js.map +1 -1
  442. package/build-module/gallery/transforms.js +20 -7
  443. package/build-module/gallery/transforms.js.map +1 -1
  444. package/build-module/gallery/use-get-media.native.js +50 -0
  445. package/build-module/gallery/use-get-media.native.js.map +1 -0
  446. package/build-module/gallery/utils.js +7 -6
  447. package/build-module/gallery/utils.js.map +1 -1
  448. package/build-module/group/deprecated.js +109 -12
  449. package/build-module/group/deprecated.js.map +1 -1
  450. package/build-module/group/edit.js +25 -2
  451. package/build-module/group/edit.js.map +1 -1
  452. package/build-module/group/index.js +11 -2
  453. package/build-module/group/index.js.map +1 -1
  454. package/build-module/group/transforms.js +5 -0
  455. package/build-module/group/transforms.js.map +1 -1
  456. package/build-module/group/variations.js +10 -10
  457. package/build-module/group/variations.js.map +1 -1
  458. package/build-module/heading/deprecated.js +5 -2
  459. package/build-module/heading/deprecated.js.map +1 -1
  460. package/build-module/heading/index.js +3 -1
  461. package/build-module/heading/index.js.map +1 -1
  462. package/build-module/heading/transforms.js +3 -1
  463. package/build-module/heading/transforms.js.map +1 -1
  464. package/build-module/home-link/edit.js +10 -6
  465. package/build-module/home-link/edit.js.map +1 -1
  466. package/build-module/image/deprecated.js +77 -9
  467. package/build-module/image/deprecated.js.map +1 -1
  468. package/build-module/image/edit.js +19 -5
  469. package/build-module/image/edit.js.map +1 -1
  470. package/build-module/image/edit.native.js +18 -8
  471. package/build-module/image/edit.native.js.map +1 -1
  472. package/build-module/image/image.js +29 -22
  473. package/build-module/image/image.js.map +1 -1
  474. package/build-module/image/index.js +20 -8
  475. package/build-module/image/index.js.map +1 -1
  476. package/build-module/image/save.js +9 -3
  477. package/build-module/image/save.js.map +1 -1
  478. package/build-module/index.js +1 -2
  479. package/build-module/index.js.map +1 -1
  480. package/build-module/index.native.js +15 -9
  481. package/build-module/index.native.js.map +1 -1
  482. package/build-module/list/index.js +1 -1
  483. package/build-module/list/index.js.map +1 -1
  484. package/build-module/list/transforms.js +4 -63
  485. package/build-module/list/transforms.js.map +1 -1
  486. package/build-module/list/v2/edit.js +15 -5
  487. package/build-module/list/v2/edit.js.map +1 -1
  488. package/build-module/list/v2/tag-name.js +21 -0
  489. package/build-module/list/v2/tag-name.js.map +1 -0
  490. package/build-module/list/v2/tag-name.native.js +21 -0
  491. package/build-module/list/v2/tag-name.native.js.map +1 -0
  492. package/build-module/list/v2/transforms.js +3 -39
  493. package/build-module/list/v2/transforms.js.map +1 -1
  494. package/build-module/list-item/edit.js +18 -14
  495. package/build-module/list-item/edit.js.map +1 -1
  496. package/build-module/list-item/edit.native.js +141 -0
  497. package/build-module/list-item/edit.native.js.map +1 -0
  498. package/build-module/list-item/hooks/index.js +2 -1
  499. package/build-module/list-item/hooks/index.js.map +1 -1
  500. package/build-module/list-item/hooks/use-copy.js +32 -0
  501. package/build-module/list-item/hooks/use-copy.js.map +1 -0
  502. package/build-module/list-item/hooks/use-merge.js +160 -0
  503. package/build-module/list-item/hooks/use-merge.js.map +1 -0
  504. package/build-module/list-item/hooks/use-outdent-list-item.js +82 -46
  505. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  506. package/build-module/list-item/icons.native.js +37 -0
  507. package/build-module/list-item/icons.native.js.map +1 -0
  508. package/build-module/list-item/list-style-type.native.js +126 -0
  509. package/build-module/list-item/list-style-type.native.js.map +1 -0
  510. package/build-module/list-item/utils.js +123 -2
  511. package/build-module/list-item/utils.js.map +1 -1
  512. package/build-module/media-text/deprecated.js +273 -19
  513. package/build-module/media-text/deprecated.js.map +1 -1
  514. package/build-module/media-text/edit.js +4 -3
  515. package/build-module/media-text/edit.js.map +1 -1
  516. package/build-module/media-text/index.js +13 -0
  517. package/build-module/media-text/index.js.map +1 -1
  518. package/build-module/media-text/media-container.js +1 -1
  519. package/build-module/media-text/media-container.js.map +1 -1
  520. package/build-module/media-text/save.js +13 -0
  521. package/build-module/media-text/save.js.map +1 -1
  522. package/build-module/more/save.js +1 -6
  523. package/build-module/more/save.js.map +1 -1
  524. package/build-module/navigation/deprecated.js +7 -2
  525. package/build-module/navigation/deprecated.js.map +1 -1
  526. package/build-module/navigation/edit/index.js +178 -154
  527. package/build-module/navigation/edit/index.js.map +1 -1
  528. package/build-module/navigation/edit/navigation-menu-selector.js +12 -15
  529. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  530. package/build-module/navigation/edit/placeholder/index.js +4 -2
  531. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  532. package/build-module/navigation/edit/responsive-wrapper.js +12 -3
  533. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  534. package/build-module/navigation/edit/unsaved-inner-blocks.js +2 -1
  535. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  536. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -7
  537. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  538. package/build-module/navigation/edit/use-create-navigation-menu.js +5 -1
  539. package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
  540. package/build-module/navigation/edit/use-inner-blocks.js +33 -0
  541. package/build-module/navigation/edit/use-inner-blocks.js.map +1 -0
  542. package/build-module/navigation/edit/utils.js +21 -0
  543. package/build-module/navigation/edit/utils.js.map +1 -0
  544. package/build-module/navigation/menu-items-to-blocks.js +1 -6
  545. package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
  546. package/build-module/navigation/use-navigation-menu.js +15 -10
  547. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  548. package/build-module/navigation-link/edit.js +12 -13
  549. package/build-module/navigation-link/edit.js.map +1 -1
  550. package/build-module/navigation-submenu/edit.js +7 -8
  551. package/build-module/navigation-submenu/edit.js.map +1 -1
  552. package/build-module/page-list/edit.js +15 -3
  553. package/build-module/page-list/edit.js.map +1 -1
  554. package/build-module/paragraph/deprecated.js +18 -9
  555. package/build-module/paragraph/deprecated.js.map +1 -1
  556. package/build-module/paragraph/edit.js +9 -12
  557. package/build-module/paragraph/edit.js.map +1 -1
  558. package/build-module/paragraph/index.js +5 -0
  559. package/build-module/paragraph/index.js.map +1 -1
  560. package/build-module/paragraph/transforms.js +5 -0
  561. package/build-module/paragraph/transforms.js.map +1 -1
  562. package/build-module/post-author/edit.js +5 -2
  563. package/build-module/post-author/edit.js.map +1 -1
  564. package/build-module/post-author/index.js +4 -2
  565. package/build-module/post-author/index.js.map +1 -1
  566. package/build-module/post-author-biography/edit.js +6 -1
  567. package/build-module/post-author-biography/edit.js.map +1 -1
  568. package/build-module/post-author-biography/index.js +1 -0
  569. package/build-module/post-author-biography/index.js.map +1 -1
  570. package/build-module/post-author-name/index.js +5 -1
  571. package/build-module/post-author-name/index.js.map +1 -1
  572. package/build-module/post-comments-count/edit.js +10 -1
  573. package/build-module/post-comments-count/edit.js.map +1 -1
  574. package/build-module/post-comments-count/index.js +4 -1
  575. package/build-module/post-comments-count/index.js.map +1 -1
  576. package/build-module/post-comments-form/edit.js +5 -42
  577. package/build-module/post-comments-form/edit.js.map +1 -1
  578. package/build-module/post-comments-form/form.js +46 -5
  579. package/build-module/post-comments-form/form.js.map +1 -1
  580. package/build-module/post-comments-link/index.js +4 -2
  581. package/build-module/post-comments-link/index.js.map +1 -1
  582. package/build-module/post-content/edit.js +5 -3
  583. package/build-module/post-content/edit.js.map +1 -1
  584. package/build-module/post-date/edit.js +9 -2
  585. package/build-module/post-date/edit.js.map +1 -1
  586. package/build-module/post-date/index.js +9 -0
  587. package/build-module/post-date/index.js.map +1 -1
  588. package/build-module/post-featured-image/edit.js +45 -16
  589. package/build-module/post-featured-image/edit.js.map +1 -1
  590. package/build-module/post-featured-image/index.js +21 -0
  591. package/build-module/post-featured-image/index.js.map +1 -1
  592. package/build-module/post-navigation-link/index.js +3 -2
  593. package/build-module/post-navigation-link/index.js.map +1 -1
  594. package/build-module/post-template/edit.js +8 -4
  595. package/build-module/post-template/edit.js.map +1 -1
  596. package/build-module/post-template/index.js +14 -1
  597. package/build-module/post-template/index.js.map +1 -1
  598. package/build-module/post-terms/edit.js +3 -2
  599. package/build-module/post-terms/edit.js.map +1 -1
  600. package/build-module/post-terms/index.js +5 -3
  601. package/build-module/post-terms/index.js.map +1 -1
  602. package/build-module/post-title/index.js +2 -1
  603. package/build-module/post-title/index.js.map +1 -1
  604. package/build-module/preformatted/index.js +4 -2
  605. package/build-module/preformatted/index.js.map +1 -1
  606. package/build-module/pullquote/deprecated.js +134 -25
  607. package/build-module/pullquote/deprecated.js.map +1 -1
  608. package/build-module/pullquote/edit.js +1 -1
  609. package/build-module/pullquote/edit.js.map +1 -1
  610. package/build-module/pullquote/edit.native.js +0 -1
  611. package/build-module/pullquote/edit.native.js.map +1 -1
  612. package/build-module/pullquote/index.js +13 -6
  613. package/build-module/pullquote/index.js.map +1 -1
  614. package/build-module/pullquote/save.js +2 -2
  615. package/build-module/pullquote/save.js.map +1 -1
  616. package/build-module/pullquote/transforms.js +15 -34
  617. package/build-module/pullquote/transforms.js.map +1 -1
  618. package/build-module/query/deprecated.js +10 -8
  619. package/build-module/query/deprecated.js.map +1 -1
  620. package/build-module/query/edit/index.js +23 -12
  621. package/build-module/query/edit/index.js.map +1 -1
  622. package/build-module/query/edit/inspector-controls/index.js +42 -9
  623. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  624. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +17 -12
  625. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  626. package/build-module/query/edit/query-placeholder.js +6 -1
  627. package/build-module/query/edit/query-placeholder.js.map +1 -1
  628. package/build-module/query/utils.js +32 -7
  629. package/build-module/query/utils.js.map +1 -1
  630. package/build-module/query-no-results/edit.js +3 -3
  631. package/build-module/query-no-results/edit.js.map +1 -1
  632. package/build-module/query-pagination-next/edit.js +2 -1
  633. package/build-module/query-pagination-next/edit.js.map +1 -1
  634. package/build-module/query-pagination-previous/edit.js +2 -1
  635. package/build-module/query-pagination-previous/edit.js.map +1 -1
  636. package/build-module/query-title/edit.js +30 -9
  637. package/build-module/query-title/edit.js.map +1 -1
  638. package/build-module/query-title/index.js +11 -2
  639. package/build-module/query-title/index.js.map +1 -1
  640. package/build-module/query-title/variations.js +10 -0
  641. package/build-module/query-title/variations.js.map +1 -1
  642. package/build-module/quote/deprecated.js +171 -37
  643. package/build-module/quote/deprecated.js.map +1 -1
  644. package/build-module/quote/edit.js +77 -43
  645. package/build-module/quote/edit.js.map +1 -1
  646. package/build-module/quote/index.js +9 -39
  647. package/build-module/quote/index.js.map +1 -1
  648. package/build-module/quote/save.js +4 -8
  649. package/build-module/quote/save.js.map +1 -1
  650. package/build-module/quote/transforms.js +96 -158
  651. package/build-module/quote/transforms.js.map +1 -1
  652. package/build-module/separator/deprecated.js +3 -3
  653. package/build-module/separator/deprecated.js.map +1 -1
  654. package/build-module/separator/edit.js +1 -1
  655. package/build-module/separator/edit.js.map +1 -1
  656. package/build-module/separator/index.js +1 -0
  657. package/build-module/separator/index.js.map +1 -1
  658. package/build-module/social-link/icons/index.js +1 -0
  659. package/build-module/social-link/icons/index.js.map +1 -1
  660. package/build-module/social-link/icons/reddit.js +1 -1
  661. package/build-module/social-link/icons/reddit.js.map +1 -1
  662. package/build-module/social-link/icons/whatsapp.js +15 -0
  663. package/build-module/social-link/icons/whatsapp.js.map +1 -0
  664. package/build-module/social-link/variations.js +8 -1
  665. package/build-module/social-link/variations.js.map +1 -1
  666. package/build-module/social-links/edit.js +3 -1
  667. package/build-module/social-links/edit.js.map +1 -1
  668. package/build-module/spacer/index.js +7 -1
  669. package/build-module/spacer/index.js.map +1 -1
  670. package/build-module/table/index.js +4 -0
  671. package/build-module/table/index.js.map +1 -1
  672. package/build-module/table/state.js +10 -4
  673. package/build-module/table/state.js.map +1 -1
  674. package/build-module/table-of-contents/index.js +11 -1
  675. package/build-module/table-of-contents/index.js.map +1 -1
  676. package/build-module/tag-cloud/index.js +5 -1
  677. package/build-module/tag-cloud/index.js.map +1 -1
  678. package/build-module/template-part/edit/index.js +24 -13
  679. package/build-module/template-part/edit/index.js.map +1 -1
  680. package/build-module/template-part/edit/selection-modal.js +33 -15
  681. package/build-module/template-part/edit/selection-modal.js.map +1 -1
  682. package/build-module/template-part/edit/utils/search.js +84 -0
  683. package/build-module/template-part/edit/utils/search.js.map +1 -0
  684. package/build-module/template-part/index.js +2 -2
  685. package/build-module/template-part/index.js.map +1 -1
  686. package/build-module/term-description/index.js +4 -0
  687. package/build-module/term-description/index.js.map +1 -1
  688. package/build-module/text-columns/edit.js +4 -2
  689. package/build-module/text-columns/edit.js.map +1 -1
  690. package/build-module/text-columns/save.js +4 -2
  691. package/build-module/text-columns/save.js.map +1 -1
  692. package/build-module/verse/index.js +1 -0
  693. package/build-module/verse/index.js.map +1 -1
  694. package/build-module/video/index.js +4 -0
  695. package/build-module/video/index.js.map +1 -1
  696. package/build-style/audio/style-rtl.css +3 -0
  697. package/build-style/audio/style.css +3 -0
  698. package/build-style/button/style-rtl.css +7 -7
  699. package/build-style/button/style.css +7 -7
  700. package/build-style/comments/editor-rtl.css +122 -0
  701. package/build-style/comments/editor.css +122 -0
  702. package/build-style/{post-comments → comments}/style-rtl.css +1 -0
  703. package/build-style/{post-comments → comments}/style.css +1 -0
  704. package/build-style/common-rtl.css +7 -0
  705. package/build-style/common.css +7 -0
  706. package/build-style/cover/style-rtl.css +2 -2
  707. package/build-style/cover/style.css +2 -2
  708. package/build-style/editor-elements-rtl.css +85 -0
  709. package/build-style/editor-elements.css +85 -0
  710. package/build-style/editor-rtl.css +266 -132
  711. package/build-style/editor.css +266 -132
  712. package/build-style/gallery/style-rtl.css +7 -2
  713. package/build-style/gallery/style.css +7 -2
  714. package/build-style/group/editor-rtl.css +27 -8
  715. package/build-style/group/editor.css +27 -8
  716. package/build-style/image/editor-rtl.css +25 -5
  717. package/build-style/image/editor.css +25 -5
  718. package/build-style/image/style-rtl.css +33 -3
  719. package/build-style/image/style.css +33 -3
  720. package/build-style/latest-posts/editor-rtl.css +3 -0
  721. package/build-style/latest-posts/editor.css +3 -0
  722. package/build-style/navigation/editor-rtl.css +8 -4
  723. package/build-style/navigation/editor.css +8 -4
  724. package/build-style/navigation/style-rtl.css +17 -19
  725. package/build-style/navigation/style.css +17 -19
  726. package/build-style/paragraph/editor-rtl.css +1 -1
  727. package/build-style/paragraph/editor.css +1 -1
  728. package/build-style/post-comments-form/style-rtl.css +0 -1
  729. package/build-style/post-comments-form/style.css +0 -1
  730. package/build-style/{post-comments/editor-rtl.css → post-date/style-rtl.css} +2 -2
  731. package/build-style/{post-comments/editor.css → post-date/style.css} +2 -2
  732. package/build-style/post-featured-image/editor-rtl.css +45 -43
  733. package/build-style/post-featured-image/editor.css +45 -43
  734. package/build-style/post-featured-image/style-rtl.css +1 -0
  735. package/build-style/post-featured-image/style.css +1 -0
  736. package/build-style/post-title/style-rtl.css +1 -0
  737. package/build-style/post-title/style.css +1 -0
  738. package/build-style/pullquote/editor-rtl.css +0 -12
  739. package/build-style/pullquote/editor.css +0 -12
  740. package/build-style/pullquote/style-rtl.css +1 -8
  741. package/build-style/pullquote/style.css +1 -8
  742. package/build-style/query/editor-rtl.css +7 -0
  743. package/build-style/query/editor.css +7 -0
  744. package/build-style/query-pagination/style-rtl.css +6 -0
  745. package/build-style/query-pagination/style.css +6 -0
  746. package/build-style/query-title/style-rtl.css +79 -0
  747. package/build-style/query-title/style.css +79 -0
  748. package/build-style/search/style-rtl.css +2 -0
  749. package/build-style/search/style.css +2 -0
  750. package/build-style/site-logo/editor-rtl.css +3 -52
  751. package/build-style/site-logo/editor.css +3 -52
  752. package/build-style/social-link/editor-rtl.css +1 -0
  753. package/build-style/social-link/editor.css +1 -0
  754. package/build-style/social-links/style-rtl.css +10 -2
  755. package/build-style/social-links/style.css +10 -2
  756. package/build-style/style-rtl.css +221 -162
  757. package/build-style/style.css +221 -162
  758. package/build-style/tag-cloud/style-rtl.css +1 -0
  759. package/build-style/tag-cloud/style.css +1 -0
  760. package/build-style/template-part/editor-rtl.css +14 -3
  761. package/build-style/template-part/editor.css +14 -3
  762. package/build-style/video/style-rtl.css +3 -0
  763. package/build-style/video/style.css +3 -0
  764. package/package.json +30 -30
  765. package/src/archives/block.json +9 -1
  766. package/src/archives/edit.js +12 -1
  767. package/src/archives/index.php +5 -3
  768. package/src/audio/block.json +4 -0
  769. package/src/audio/style.scss +2 -0
  770. package/src/audio/test/__snapshots__/edit.native.js.snap +16 -2
  771. package/src/block/edit.js +4 -4
  772. package/src/block/edit.native.js +4 -4
  773. package/src/button/block.json +1 -1
  774. package/src/button/deprecated.js +21 -22
  775. package/src/button/edit.js +1 -0
  776. package/src/button/style.scss +9 -7
  777. package/src/buttons/edit.js +1 -5
  778. package/src/calendar/edit.js +11 -4
  779. package/src/calendar/index.php +2 -2
  780. package/src/categories/block.json +14 -1
  781. package/src/categories/edit.js +2 -2
  782. package/src/code/block.json +4 -2
  783. package/src/column/block.json +13 -0
  784. package/src/columns/block.json +13 -0
  785. package/src/columns/deprecated.js +10 -4
  786. package/src/columns/edit.js +7 -3
  787. package/src/columns/edit.native.js +11 -5
  788. package/src/comment-author-name/block.json +5 -1
  789. package/src/comment-content/block.json +5 -1
  790. package/src/comment-date/block.json +1 -0
  791. package/src/comment-edit-link/block.json +5 -1
  792. package/src/comment-reply-link/block.json +5 -1
  793. package/src/comment-template/block.json +14 -1
  794. package/src/comments/block.json +19 -1
  795. package/src/comments/edit/comments-legacy.js +71 -0
  796. package/src/comments/edit/index.js +35 -0
  797. package/src/comments/edit/placeholder.js +124 -0
  798. package/src/comments/{edit.js → edit/template.js} +1 -28
  799. package/src/comments/editor.scss +9 -0
  800. package/src/comments/index.php +220 -0
  801. package/src/comments/save.js +8 -7
  802. package/src/{post-comments → comments}/style.scss +7 -0
  803. package/src/comments-pagination/block.json +13 -0
  804. package/src/comments-pagination-next/block.json +4 -2
  805. package/src/comments-pagination-numbers/block.json +14 -1
  806. package/src/comments-pagination-numbers/edit.js +12 -3
  807. package/src/comments-pagination-previous/block.json +4 -2
  808. package/src/comments-title/block.json +4 -2
  809. package/src/common.scss +2 -0
  810. package/src/cover/block.json +13 -0
  811. package/src/cover/deprecated.js +11 -4
  812. package/src/cover/edit/resizable-cover.js +6 -0
  813. package/src/cover/index.php +2 -2
  814. package/src/cover/shared.js +2 -1
  815. package/src/cover/style.scss +2 -2
  816. package/src/cover/transforms.js +2 -2
  817. package/src/editor-elements.scss +10 -0
  818. package/src/editor.scss +2 -1
  819. package/src/embed/embed-placeholder.native.js +2 -3
  820. package/src/embed/icons.js +1 -1
  821. package/src/file/test/__snapshots__/edit.native.js.snap +32 -4
  822. package/src/gallery/block.json +5 -0
  823. package/src/gallery/deprecated.js +4 -2
  824. package/src/gallery/edit.js +26 -4
  825. package/src/gallery/style.scss +10 -1
  826. package/src/gallery/transforms.js +18 -5
  827. package/src/gallery/use-get-media.native.js +44 -0
  828. package/src/gallery/utils.js +11 -7
  829. package/src/group/block.json +11 -2
  830. package/src/group/deprecated.js +89 -2
  831. package/src/group/edit.js +15 -2
  832. package/src/group/editor.scss +28 -3
  833. package/src/group/transforms.js +7 -0
  834. package/src/group/variations.js +6 -5
  835. package/src/heading/block.json +3 -1
  836. package/src/heading/deprecated.js +4 -2
  837. package/src/home-link/edit.js +19 -20
  838. package/src/home-link/index.php +8 -17
  839. package/src/image/block.json +20 -8
  840. package/src/image/deprecated.js +86 -0
  841. package/src/image/edit.js +25 -2
  842. package/src/image/edit.native.js +18 -7
  843. package/src/image/editor.scss +48 -7
  844. package/src/image/image.js +26 -16
  845. package/src/image/index.php +1 -1
  846. package/src/image/save.js +10 -1
  847. package/src/image/style.scss +39 -3
  848. package/src/image/test/edit.native.js +6 -10
  849. package/src/index.js +0 -2
  850. package/src/index.native.js +26 -17
  851. package/src/latest-posts/editor.scss +5 -0
  852. package/src/list/index.js +1 -1
  853. package/src/list/test/__snapshots__/edit.native.js.snap +133 -0
  854. package/src/list/test/edit.native.js +511 -7
  855. package/src/list/transforms.js +0 -47
  856. package/src/list/v2/edit.js +12 -4
  857. package/src/list/v2/tag-name.js +13 -0
  858. package/src/list/v2/tag-name.native.js +12 -0
  859. package/src/list/v2/transforms.js +3 -49
  860. package/src/list-item/edit.js +13 -14
  861. package/src/list-item/edit.native.js +148 -0
  862. package/src/list-item/hooks/index.js +2 -1
  863. package/src/list-item/hooks/use-copy.js +36 -0
  864. package/src/list-item/hooks/use-merge.js +141 -0
  865. package/src/list-item/hooks/use-outdent-list-item.js +72 -74
  866. package/src/list-item/icons.native.js +34 -0
  867. package/src/list-item/list-style-type.native.js +146 -0
  868. package/src/list-item/style.native.scss +49 -0
  869. package/src/list-item/utils.js +27 -3
  870. package/src/media-text/block.json +13 -0
  871. package/src/media-text/deprecated.js +584 -290
  872. package/src/media-text/edit.js +3 -1
  873. package/src/media-text/media-container.js +3 -1
  874. package/src/media-text/save.js +18 -0
  875. package/src/media-text/test/media-container.js +24 -0
  876. package/src/more/save.js +3 -6
  877. package/src/navigation/deprecated.js +4 -2
  878. package/src/navigation/edit/index.js +234 -237
  879. package/src/navigation/edit/navigation-menu-selector.js +12 -26
  880. package/src/navigation/edit/placeholder/index.js +4 -2
  881. package/src/navigation/edit/responsive-wrapper.js +24 -3
  882. package/src/navigation/edit/unsaved-inner-blocks.js +3 -1
  883. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +31 -37
  884. package/src/navigation/edit/use-create-navigation-menu.js +4 -0
  885. package/src/navigation/edit/use-inner-blocks.js +39 -0
  886. package/src/navigation/edit/utils.js +30 -0
  887. package/src/navigation/editor.scss +3 -2
  888. package/src/navigation/index.php +17 -16
  889. package/src/navigation/menu-items-to-blocks.js +3 -6
  890. package/src/navigation/style.scss +13 -22
  891. package/src/navigation/use-navigation-menu.js +20 -13
  892. package/src/navigation-link/edit.js +13 -16
  893. package/src/navigation-link/index.php +1 -1
  894. package/src/navigation-submenu/edit.js +10 -13
  895. package/src/navigation-submenu/index.php +1 -1
  896. package/src/page-list/edit.js +15 -2
  897. package/src/page-list/index.php +4 -4
  898. package/src/paragraph/block.json +5 -0
  899. package/src/paragraph/deprecated.js +33 -35
  900. package/src/paragraph/edit.js +9 -14
  901. package/src/paragraph/editor.scss +5 -3
  902. package/src/post-author/block.json +4 -2
  903. package/src/post-author/edit.js +6 -3
  904. package/src/post-author-biography/block.json +1 -0
  905. package/src/post-author-biography/edit.js +4 -1
  906. package/src/post-author-name/block.json +5 -1
  907. package/src/post-comments-count/block.json +4 -1
  908. package/src/post-comments-count/edit.js +10 -2
  909. package/src/post-comments-form/edit.js +2 -71
  910. package/src/post-comments-form/form.js +80 -5
  911. package/src/post-comments-form/index.php +1 -1
  912. package/src/post-comments-form/style.scss +0 -1
  913. package/src/post-comments-link/block.json +4 -2
  914. package/src/post-content/edit.js +4 -4
  915. package/src/post-date/block.json +9 -0
  916. package/src/post-date/edit.js +12 -2
  917. package/src/post-date/index.php +10 -2
  918. package/src/post-date/style.scss +4 -0
  919. package/src/post-featured-image/block.json +21 -0
  920. package/src/post-featured-image/edit.js +66 -14
  921. package/src/post-featured-image/editor.scss +44 -53
  922. package/src/post-featured-image/index.php +64 -5
  923. package/src/post-featured-image/style.scss +1 -0
  924. package/src/post-navigation-link/block.json +3 -2
  925. package/src/post-template/block.json +15 -1
  926. package/src/post-template/edit.js +6 -1
  927. package/src/post-template/index.php +7 -4
  928. package/src/post-terms/block.json +5 -3
  929. package/src/post-terms/edit.js +3 -2
  930. package/src/post-title/block.json +2 -1
  931. package/src/post-title/index.php +2 -1
  932. package/src/post-title/style.scss +2 -0
  933. package/src/preformatted/block.json +4 -2
  934. package/src/preformatted/test/__snapshots__/edit.native.js.snap +16 -2
  935. package/src/pullquote/block.json +11 -4
  936. package/src/pullquote/deprecated.js +490 -412
  937. package/src/pullquote/edit.js +1 -1
  938. package/src/pullquote/edit.native.js +0 -1
  939. package/src/pullquote/editor.scss +0 -16
  940. package/src/pullquote/index.js +1 -3
  941. package/src/pullquote/save.js +1 -1
  942. package/src/pullquote/style.scss +0 -11
  943. package/src/pullquote/transforms.js +17 -33
  944. package/src/query/deprecated.js +4 -9
  945. package/src/query/edit/index.js +28 -15
  946. package/src/query/edit/inspector-controls/index.js +129 -65
  947. package/src/query/edit/inspector-controls/taxonomy-controls.js +18 -11
  948. package/src/query/edit/query-placeholder.js +17 -2
  949. package/src/query/editor.scss +9 -0
  950. package/src/query/utils.js +29 -7
  951. package/src/query-no-results/edit.js +3 -6
  952. package/src/query-pagination/style.scss +14 -0
  953. package/src/query-pagination-next/edit.js +1 -0
  954. package/src/query-pagination-previous/edit.js +1 -0
  955. package/src/query-title/block.json +11 -2
  956. package/src/query-title/edit.js +51 -7
  957. package/src/query-title/index.php +28 -2
  958. package/src/query-title/style.scss +4 -0
  959. package/src/query-title/variations.js +13 -0
  960. package/src/quote/deprecated.js +215 -100
  961. package/src/quote/edit.js +77 -52
  962. package/src/quote/index.js +10 -33
  963. package/src/quote/save.js +5 -5
  964. package/src/quote/{v2/test → test}/migrate.js +2 -7
  965. package/src/quote/transforms.js +98 -146
  966. package/src/search/index.php +1 -1
  967. package/src/search/style.scss +2 -0
  968. package/src/search/test/__snapshots__/edit.native.js.snap +56 -7
  969. package/src/separator/block.json +1 -0
  970. package/src/separator/deprecated.js +2 -3
  971. package/src/separator/edit.js +1 -1
  972. package/src/separator/test/edit.js +5 -3
  973. package/src/site-logo/editor.scss +8 -66
  974. package/src/site-title/index.php +8 -9
  975. package/src/social-link/editor.scss +3 -0
  976. package/src/social-link/icons/index.js +1 -0
  977. package/src/social-link/icons/reddit.js +1 -1
  978. package/src/social-link/icons/whatsapp.js +10 -0
  979. package/src/social-link/index.php +6 -2
  980. package/src/social-link/socials-with-bg.scss +6 -1
  981. package/src/social-link/socials-without-bg.scss +6 -1
  982. package/src/social-link/variations.js +7 -0
  983. package/src/social-links/edit.js +2 -0
  984. package/src/spacer/block.json +7 -1
  985. package/src/style.scss +3 -2
  986. package/src/table/block.json +4 -0
  987. package/src/table/state.js +21 -19
  988. package/src/table-of-contents/block.json +11 -1
  989. package/src/tag-cloud/block.json +5 -1
  990. package/src/tag-cloud/style.scss +1 -0
  991. package/src/template-part/edit/index.js +40 -27
  992. package/src/template-part/edit/selection-modal.js +68 -40
  993. package/src/template-part/edit/utils/search.js +76 -0
  994. package/src/template-part/editor.scss +21 -9
  995. package/src/template-part/index.js +3 -2
  996. package/src/template-part/index.php +56 -2
  997. package/src/term-description/block.json +4 -0
  998. package/src/text-columns/edit.js +2 -2
  999. package/src/text-columns/save.js +2 -2
  1000. package/src/verse/block.json +1 -0
  1001. package/src/video/block.json +4 -0
  1002. package/src/video/style.scss +2 -0
  1003. package/build/comments/edit.js.map +0 -1
  1004. package/build/list-item/hooks/use-backspace.js +0 -59
  1005. package/build/list-item/hooks/use-backspace.js.map +0 -1
  1006. package/build/post-comments/edit.js +0 -184
  1007. package/build/post-comments/edit.js.map +0 -1
  1008. package/build/post-comments/index.js +0 -72
  1009. package/build/post-comments/index.js.map +0 -1
  1010. package/build/quote/v2/deprecated.js +0 -133
  1011. package/build/quote/v2/deprecated.js.map +0 -1
  1012. package/build/quote/v2/edit.js +0 -139
  1013. package/build/quote/v2/edit.js.map +0 -1
  1014. package/build/quote/v2/index.js +0 -49
  1015. package/build/quote/v2/index.js.map +0 -1
  1016. package/build/quote/v2/save.js +0 -43
  1017. package/build/quote/v2/save.js.map +0 -1
  1018. package/build/quote/v2/transforms.js +0 -156
  1019. package/build/quote/v2/transforms.js.map +0 -1
  1020. package/build-module/comments/edit.js +0 -59
  1021. package/build-module/comments/edit.js.map +0 -1
  1022. package/build-module/list-item/hooks/use-backspace.js +0 -44
  1023. package/build-module/list-item/hooks/use-backspace.js.map +0 -1
  1024. package/build-module/post-comments/edit.js +0 -171
  1025. package/build-module/post-comments/edit.js.map +0 -1
  1026. package/build-module/post-comments/index.js +0 -59
  1027. package/build-module/post-comments/index.js.map +0 -1
  1028. package/build-module/quote/v2/deprecated.js +0 -116
  1029. package/build-module/quote/v2/deprecated.js.map +0 -1
  1030. package/build-module/quote/v2/edit.js +0 -122
  1031. package/build-module/quote/v2/edit.js.map +0 -1
  1032. package/build-module/quote/v2/index.js +0 -33
  1033. package/build-module/quote/v2/index.js.map +0 -1
  1034. package/build-module/quote/v2/save.js +0 -30
  1035. package/build-module/quote/v2/save.js.map +0 -1
  1036. package/build-module/quote/v2/transforms.js +0 -147
  1037. package/build-module/quote/v2/transforms.js.map +0 -1
  1038. package/src/list-item/hooks/use-backspace.js +0 -51
  1039. package/src/post-comments/block.json +0 -45
  1040. package/src/post-comments/edit.js +0 -247
  1041. package/src/post-comments/editor.scss +0 -3
  1042. package/src/post-comments/index.js +0 -18
  1043. package/src/post-comments/index.php +0 -87
  1044. package/src/quote/v2/deprecated.js +0 -107
  1045. package/src/quote/v2/edit.js +0 -139
  1046. package/src/quote/v2/index.js +0 -36
  1047. package/src/quote/v2/save.js +0 -26
  1048. package/src/quote/v2/transforms.js +0 -155
@@ -0,0 +1,160 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useRegistry, useDispatch, useSelect } from '@wordpress/data';
5
+ import { store as blockEditorStore } from '@wordpress/block-editor';
6
+ import { getDefaultBlockName, switchToBlockType } from '@wordpress/blocks';
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+
11
+ import useOutdentListItem from './use-outdent-list-item';
12
+ const {
13
+ name: listItemName
14
+ } = {
15
+ $schema: "https://schemas.wp.org/trunk/block.json",
16
+ apiVersion: 2,
17
+ __experimental: "list-v2",
18
+ name: "core/list-item",
19
+ title: "List item",
20
+ category: "text",
21
+ parent: ["core/list"],
22
+ description: "Create a list item.",
23
+ textdomain: "default",
24
+ attributes: {
25
+ placeholder: {
26
+ type: "string"
27
+ },
28
+ content: {
29
+ type: "string",
30
+ source: "html",
31
+ selector: "li",
32
+ "default": "",
33
+ __experimentalRole: "content"
34
+ }
35
+ },
36
+ supports: {
37
+ className: false,
38
+ __experimentalSelector: "li"
39
+ }
40
+ };
41
+ export default function useMerge(clientId) {
42
+ const registry = useRegistry();
43
+ const {
44
+ getPreviousBlockClientId,
45
+ getNextBlockClientId,
46
+ getBlockOrder,
47
+ getBlockRootClientId,
48
+ getBlockName,
49
+ getBlock
50
+ } = useSelect(blockEditorStore);
51
+ const {
52
+ mergeBlocks,
53
+ moveBlocksToPosition,
54
+ replaceBlock,
55
+ selectBlock
56
+ } = useDispatch(blockEditorStore);
57
+ const [, outdentListItem] = useOutdentListItem(clientId);
58
+
59
+ function getTrailingId(id) {
60
+ const order = getBlockOrder(id);
61
+
62
+ if (!order.length) {
63
+ return id;
64
+ }
65
+
66
+ return getTrailingId(order[order.length - 1]);
67
+ }
68
+
69
+ function getParentListItemId(id) {
70
+ const listId = getBlockRootClientId(id);
71
+ const parentListItemId = getBlockRootClientId(listId);
72
+ if (!parentListItemId) return;
73
+ if (getBlockName(parentListItemId) !== listItemName) return;
74
+ return parentListItemId;
75
+ }
76
+ /**
77
+ * Return the next list item with respect to the given list item. If none,
78
+ * return the next list item of the parent list item if it exists.
79
+ *
80
+ * @param {string} id A list item client ID.
81
+ * @return {string?} The client ID of the next list item.
82
+ */
83
+
84
+
85
+ function _getNextId(id) {
86
+ const next = getNextBlockClientId(id);
87
+ if (next) return next;
88
+ const parentListItemId = getParentListItemId(id);
89
+ if (!parentListItemId) return;
90
+ return _getNextId(parentListItemId);
91
+ }
92
+ /**
93
+ * Given a client ID, return the client ID of the list item on the next
94
+ * line, regardless of indentation level.
95
+ *
96
+ * @param {string} id The client ID of the current list item.
97
+ * @return {string?} The client ID of the next list item.
98
+ */
99
+
100
+
101
+ function getNextId(id) {
102
+ const order = getBlockOrder(id); // If the list item does not have a nested list, return the next list
103
+ // item.
104
+
105
+ if (!order.length) {
106
+ return _getNextId(id);
107
+ } // Get the first list item in the nested list.
108
+
109
+
110
+ return getBlockOrder(order[0])[0];
111
+ }
112
+
113
+ function switchToDefaultBlockType(forward) {
114
+ const rootClientId = getBlockRootClientId(clientId);
115
+ const replacement = switchToBlockType(getBlock(rootClientId), getDefaultBlockName());
116
+ const indexToSelect = forward ? replacement.length - 1 : 0;
117
+ const initialPosition = forward ? -1 : 0;
118
+ registry.batch(() => {
119
+ replaceBlock(rootClientId, replacement);
120
+ selectBlock(replacement[indexToSelect].clientId, initialPosition);
121
+ });
122
+ }
123
+
124
+ return forward => {
125
+ if (forward) {
126
+ const nextBlockClientId = getNextId(clientId);
127
+
128
+ if (!nextBlockClientId) {
129
+ switchToDefaultBlockType(forward);
130
+ return;
131
+ }
132
+
133
+ if (getParentListItemId(nextBlockClientId)) {
134
+ outdentListItem(nextBlockClientId);
135
+ } else {
136
+ registry.batch(() => {
137
+ moveBlocksToPosition(getBlockOrder(nextBlockClientId), nextBlockClientId, getPreviousBlockClientId(nextBlockClientId));
138
+ mergeBlocks(clientId, nextBlockClientId);
139
+ });
140
+ }
141
+ } else {
142
+ // Merging is only done from the top level. For lowel levels, the
143
+ // list item is outdented instead.
144
+ const previousBlockClientId = getPreviousBlockClientId(clientId);
145
+
146
+ if (getParentListItemId(clientId)) {
147
+ outdentListItem(clientId);
148
+ } else if (previousBlockClientId) {
149
+ const trailingId = getTrailingId(previousBlockClientId);
150
+ registry.batch(() => {
151
+ moveBlocksToPosition(getBlockOrder(clientId), clientId, previousBlockClientId);
152
+ mergeBlocks(trailingId, clientId);
153
+ });
154
+ } else {
155
+ switchToDefaultBlockType(forward);
156
+ }
157
+ }
158
+ };
159
+ }
160
+ //# sourceMappingURL=use-merge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/list-item/hooks/use-merge.js"],"names":["useRegistry","useDispatch","useSelect","store","blockEditorStore","getDefaultBlockName","switchToBlockType","useOutdentListItem","useMerge","clientId","registry","getPreviousBlockClientId","getNextBlockClientId","getBlockOrder","getBlockRootClientId","getBlockName","getBlock","mergeBlocks","moveBlocksToPosition","replaceBlock","selectBlock","outdentListItem","getTrailingId","id","order","length","getParentListItemId","listId","parentListItemId","listItemName","_getNextId","next","getNextId","switchToDefaultBlockType","forward","rootClientId","replacement","indexToSelect","initialPosition","batch","nextBlockClientId","previousBlockClientId","trailingId"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,WAAtB,EAAmCC,SAAnC,QAAoD,iBAApD;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AACA,SAASC,mBAAT,EAA8BC,iBAA9B,QAAuD,mBAAvD;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,eAAe,SAASC,QAAT,CAAmBC,QAAnB,EAA8B;AAC5C,QAAMC,QAAQ,GAAGV,WAAW,EAA5B;AACA,QAAM;AACLW,IAAAA,wBADK;AAELC,IAAAA,oBAFK;AAGLC,IAAAA,aAHK;AAILC,IAAAA,oBAJK;AAKLC,IAAAA,YALK;AAMLC,IAAAA;AANK,MAOFd,SAAS,CAAEE,gBAAF,CAPb;AAQA,QAAM;AAAEa,IAAAA,WAAF;AAAeC,IAAAA,oBAAf;AAAqCC,IAAAA,YAArC;AAAmDC,IAAAA;AAAnD,MACLnB,WAAW,CAAEG,gBAAF,CADZ;AAEA,QAAM,GAAIiB,eAAJ,IAAwBd,kBAAkB,CAAEE,QAAF,CAAhD;;AAEA,WAASa,aAAT,CAAwBC,EAAxB,EAA6B;AAC5B,UAAMC,KAAK,GAAGX,aAAa,CAAEU,EAAF,CAA3B;;AAEA,QAAK,CAAEC,KAAK,CAACC,MAAb,EAAsB;AACrB,aAAOF,EAAP;AACA;;AAED,WAAOD,aAAa,CAAEE,KAAK,CAAEA,KAAK,CAACC,MA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mB,EAGnBgC,qBAHmB,CAApB;AAKAxB,UAAAA,WAAW,CAAEyB,UAAF,EAAcjC,QAAd,CAAX;AACA,SAPD;AAQA,OAVM,MAUA;AACNwB,QAAAA,wBAAwB,CAAEC,OAAF,CAAxB;AACA;AACD;AACD,GAzCD;AA0CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getDefaultBlockName, switchToBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport useOutdentListItem from './use-outdent-list-item';\n\nimport { name as listItemName } from '../block.json';\n\nexport default function useMerge( clientId ) {\n\tconst registry = useRegistry();\n\tconst {\n\t\tgetPreviousBlockClientId,\n\t\tgetNextBlockClientId,\n\t\tgetBlockOrder,\n\t\tgetBlockRootClientId,\n\t\tgetBlockName,\n\t\tgetBlock,\n\t} = useSelect( blockEditorStore );\n\tconst { mergeBlocks, moveBlocksToPosition, replaceBlock, selectBlock } =\n\t\tuseDispatch( blockEditorStore );\n\tconst [ , outdentListItem ] = useOutdentListItem( clientId );\n\n\tfunction getTrailingId( id ) {\n\t\tconst order = getBlockOrder( id );\n\n\t\tif ( ! order.length ) {\n\t\t\treturn id;\n\t\t}\n\n\t\treturn getTrailingId( order[ order.length - 1 ] );\n\t}\n\n\tfunction getParentListItemId( id ) {\n\t\tconst listId = getBlockRootClientId( id );\n\t\tconst parentListItemId = getBlockRootClientId( listId );\n\t\tif ( ! parentListItemId ) return;\n\t\tif ( getBlockName( parentListItemId ) !== listItemName ) return;\n\t\treturn parentListItemId;\n\t}\n\n\t/**\n\t * Return the next list item with respect to the given list item. If none,\n\t * return the next list item of the parent list item if it exists.\n\t *\n\t * @param {string} id A list item client ID.\n\t * @return {string?} The client ID of the next list item.\n\t */\n\tfunction _getNextId( id ) {\n\t\tconst next = getNextBlockClientId( id );\n\t\tif ( next ) return next;\n\t\tconst parentListItemId = getParentListItemId( id );\n\t\tif ( ! parentListItemId ) return;\n\t\treturn _getNextId( parentListItemId );\n\t}\n\n\t/**\n\t * Given a client ID, return the client ID of the list item on the next\n\t * line, regardless of indentation level.\n\t *\n\t * @param {string} id The client ID of the current list item.\n\t * @return {string?} The client ID of the next list item.\n\t */\n\tfunction getNextId( id ) {\n\t\tconst order = getBlockOrder( id );\n\n\t\t// If the list item does not have a nested list, return the next list\n\t\t// item.\n\t\tif ( ! order.length ) {\n\t\t\treturn _getNextId( id );\n\t\t}\n\n\t\t// Get the first list item in the nested list.\n\t\treturn getBlockOrder( order[ 0 ] )[ 0 ];\n\t}\n\n\tfunction switchToDefaultBlockType( forward ) {\n\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\tconst replacement = switchToBlockType(\n\t\t\tgetBlock( rootClientId ),\n\t\t\tgetDefaultBlockName()\n\t\t);\n\t\tconst indexToSelect = forward ? replacement.length - 1 : 0;\n\t\tconst initialPosition = forward ? -1 : 0;\n\t\tregistry.batch( () => {\n\t\t\treplaceBlock( rootClientId, replacement );\n\t\t\tselectBlock(\n\t\t\t\treplacement[ indexToSelect ].clientId,\n\t\t\t\tinitialPosition\n\t\t\t);\n\t\t} );\n\t}\n\n\treturn ( forward ) => {\n\t\tif ( forward ) {\n\t\t\tconst nextBlockClientId = getNextId( clientId );\n\n\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\tswitchToDefaultBlockType( forward );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( getParentListItemId( nextBlockClientId ) ) {\n\t\t\t\toutdentListItem( nextBlockClientId );\n\t\t\t} else {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\tgetBlockOrder( nextBlockClientId ),\n\t\t\t\t\t\tnextBlockClientId,\n\t\t\t\t\t\tgetPreviousBlockClientId( nextBlockClientId )\n\t\t\t\t\t);\n\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\t\t\t// Merging is only done from the top level. For lowel levels, the\n\t\t\t// list item is outdented instead.\n\t\t\tconst previousBlockClientId = getPreviousBlockClientId( clientId );\n\t\t\tif ( getParentListItemId( clientId ) ) {\n\t\t\t\toutdentListItem( clientId );\n\t\t\t} else if ( previousBlockClientId ) {\n\t\t\t\tconst trailingId = getTrailingId( previousBlockClientId );\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\tgetBlockOrder( clientId ),\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\tpreviousBlockClientId\n\t\t\t\t\t);\n\t\t\t\t\tmergeBlocks( trailingId, clientId );\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tswitchToDefaultBlockType( forward );\n\t\t\t}\n\t\t}\n\t};\n}\n"]}
@@ -1,21 +1,50 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { first, last } from 'lodash';
4
+ import { first, last, castArray } from 'lodash';
5
5
  /**
6
6
  * WordPress dependencies
7
7
  */
8
8
 
9
9
  import { useCallback } from '@wordpress/element';
10
- import { useSelect, useDispatch } from '@wordpress/data';
10
+ import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
11
11
  import { store as blockEditorStore } from '@wordpress/block-editor';
12
12
  import { cloneBlock } from '@wordpress/blocks';
13
13
  /**
14
14
  * Internal dependencies
15
15
  */
16
16
 
17
- import { createListItem } from '../utils';
17
+ const {
18
+ name: listItemName
19
+ } = {
20
+ $schema: "https://schemas.wp.org/trunk/block.json",
21
+ apiVersion: 2,
22
+ __experimental: "list-v2",
23
+ name: "core/list-item",
24
+ title: "List item",
25
+ category: "text",
26
+ parent: ["core/list"],
27
+ description: "Create a list item.",
28
+ textdomain: "default",
29
+ attributes: {
30
+ placeholder: {
31
+ type: "string"
32
+ },
33
+ content: {
34
+ type: "string",
35
+ source: "html",
36
+ selector: "li",
37
+ "default": "",
38
+ __experimentalRole: "content"
39
+ }
40
+ },
41
+ supports: {
42
+ className: false,
43
+ __experimentalSelector: "li"
44
+ }
45
+ };
18
46
  export default function useOutdentListItem(clientId) {
47
+ const registry = useRegistry();
19
48
  const {
20
49
  canOutdent
21
50
  } = useSelect(innerSelect => {
@@ -28,58 +57,65 @@ export default function useOutdentListItem(clientId) {
28
57
  };
29
58
  }, [clientId]);
30
59
  const {
31
- replaceBlocks,
32
- selectionChange,
33
- multiSelect
60
+ moveBlocksToPosition,
61
+ removeBlock,
62
+ insertBlock,
63
+ updateBlockListSettings
34
64
  } = useDispatch(blockEditorStore);
35
65
  const {
36
66
  getBlockRootClientId,
37
- getBlockAttributes,
38
- getBlock,
67
+ getBlockName,
68
+ getBlockOrder,
39
69
  getBlockIndex,
40
- getSelectionStart,
41
- getSelectionEnd,
42
- hasMultiSelection,
43
- getMultiSelectedBlockClientIds
70
+ getSelectedBlockClientIds,
71
+ getBlock,
72
+ getBlockListSettings
44
73
  } = useSelect(blockEditorStore);
45
- return [canOutdent, useCallback(() => {
46
- const _hasMultiSelection = hasMultiSelection();
47
74
 
48
- const clientIds = _hasMultiSelection ? getMultiSelectedBlockClientIds() : [clientId];
49
- const selectionStart = getSelectionStart();
50
- const selectionEnd = getSelectionEnd();
51
- const listParentId = getBlockRootClientId(clientId);
52
- const listAttributes = getBlockAttributes(listParentId);
53
- const listItemParentId = getBlockRootClientId(listParentId);
54
- const listItemParentAttributes = getBlockAttributes(listItemParentId);
55
- const firstIndex = getBlockIndex(first(clientIds));
56
- const lastIndex = getBlockIndex(last(clientIds));
57
- const siblingBlocks = getBlock(listParentId).innerBlocks;
58
- const previousSiblings = siblingBlocks.slice(0, firstIndex);
59
- const afterSiblings = siblingBlocks.slice(lastIndex + 1); // Create a new parent list item block with just the siblings
60
- // that existed before the first child item being outdent.
75
+ function getParentListItemId(id) {
76
+ const listId = getBlockRootClientId(id);
77
+ const parentListItemId = getBlockRootClientId(listId);
78
+ if (!parentListItemId) return;
79
+ if (getBlockName(parentListItemId) !== listItemName) return;
80
+ return parentListItemId;
81
+ }
61
82
 
62
- const newListItemParent = createListItem(listItemParentAttributes, listAttributes, previousSiblings);
63
- const lastBlock = getBlock(last(clientIds));
64
- const childList = lastBlock.innerBlocks[0];
65
- const childItems = (childList === null || childList === void 0 ? void 0 : childList.innerBlocks) || [];
66
- const hasChildItems = !!childItems.length;
67
- const newBlocksExcludingLast = clientIds.slice(0, -1).map(_clientId => cloneBlock(getBlock(_clientId))); // Create a new list item block whose attributes are equal to the
68
- // last block being outdent and whose children are the children that it had (if any)
69
- // followed by the siblings that existed after it.
83
+ return [canOutdent, useCallback(function () {
84
+ let clientIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getSelectedBlockClientIds();
85
+ clientIds = castArray(clientIds);
86
+ if (!clientIds.length) return;
87
+ const firstClientId = first(clientIds); // Can't outdent if it's not a list item.
70
88
 
71
- const newLastItem = createListItem(lastBlock.attributes, hasChildItems ? childList.attributes : listAttributes, [...childItems, ...afterSiblings]); // Replace the parent list item block, with a new block containing
72
- // the previous siblings before the first block being outdent,
73
- // followed by the blocks being outdent with the after siblings added
74
- // as children of the last block.
89
+ if (getBlockName(firstClientId) !== listItemName) return;
90
+ const parentListItemId = getParentListItemId(firstClientId); // Can't outdent if it's at the top level.
75
91
 
76
- replaceBlocks([listItemParentId], [newListItemParent, ...newBlocksExcludingLast, newLastItem]); // Restore the selection state.
92
+ if (!parentListItemId) return;
93
+ const parentListId = getBlockRootClientId(firstClientId);
94
+ const lastClientId = last(clientIds);
95
+ const order = getBlockOrder(parentListId);
96
+ const followingListItems = order.slice(getBlockIndex(lastClientId) + 1);
97
+ registry.batch(() => {
98
+ if (followingListItems.length) {
99
+ let nestedListId = first(getBlockOrder(firstClientId));
77
100
 
78
- if (!_hasMultiSelection) {
79
- selectionChange(newLastItem.clientId, selectionEnd.attributeKey, selectionEnd.clientId === selectionStart.clientId ? selectionStart.offset : selectionEnd.offset, selectionEnd.offset);
80
- } else {
81
- multiSelect(first(newBlocksExcludingLast).clientId, newLastItem.clientId);
82
- }
83
- }, [clientId])];
101
+ if (!nestedListId) {
102
+ const nestedListBlock = cloneBlock(getBlock(parentListId), {}, []);
103
+ nestedListId = nestedListBlock.clientId;
104
+ insertBlock(nestedListBlock, 0, firstClientId, false); // Immediately update the block list settings, otherwise
105
+ // blocks can't be moved here due to canInsert checks.
106
+
107
+ updateBlockListSettings(nestedListId, getBlockListSettings(parentListId));
108
+ }
109
+
110
+ moveBlocksToPosition(followingListItems, parentListId, nestedListId);
111
+ }
112
+
113
+ moveBlocksToPosition(clientIds, parentListId, getBlockRootClientId(parentListItemId), getBlockIndex(parentListItemId) + 1);
114
+
115
+ if (!getBlockOrder(parentListId).length) {
116
+ removeBlock(parentListId);
117
+ }
118
+ });
119
+ }, [])];
84
120
  }
85
121
  //# sourceMappingURL=use-outdent-list-item.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/list-item/hooks/use-outdent-list-item.js"],"names":["first","last","useCallback","useSelect","useDispatch","store","blockEditorStore","cloneBlock","createListItem","useOutdentListItem","clientId","canOutdent","innerSelect","getBlockRootClientId","grandParentId","replaceBlocks","selectionChange","multiSelect","getBlockAttributes","getBlock","getBlockIndex","getSelectionStart","getSelectionEnd","hasMultiSelection","getMultiSelectedBlockClientIds","_hasMultiSelection","clientIds","selectionStart","selectionEnd","listParentId","listAttributes","listItemParentId","listItemParentAttributes","firstIndex","lastIndex","siblingBlocks","innerBlocks","previousSiblings","slice","afterSiblings","newListItemParent","lastBlock","childList","childItems","hasChildItems","length","newBlocksExcludingLast","map","_clientId","newLastItem","attributes","attributeKey","offset"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAT,EAAgBC,IAAhB,QAA4B,QAA5B;AAEA;AACA;AACA;;AACA,SAASC,WAAT,QAA4B,oBAA5B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AACA,SAASC,UAAT,QAA2B,mBAA3B;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AF,CADY,EAEZ,CAAES,iBAAF,EAAqB,GAAGM,sBAAxB,EAAgDG,WAAhD,CAFY,CAAb,CAnDkB,CAwDlB;;AACA,QAAK,CAAExB,kBAAP,EAA4B;AAC3BT,MAAAA,eAAe,CACdiC,WAAW,CAACvC,QADE,EAEdkB,YAAY,CAACuB,YAFC,EAGdvB,YAAY,CAAClB,QAAb,KAA0BiB,cAAc,CAACjB,QAAzC,GACGiB,cAAc,CAACyB,MADlB,GAEGxB,YAAY,CAACwB,MALF,EAMdxB,YAAY,CAACwB,MANC,CAAf;AAQA,KATD,MASO;AACNnC,MAAAA,WAAW,CACVjB,KAAK,CAAE8C,sBAAF,CAAL,CAAgCpC,QADtB,EAEVuC,WAAW,CAACvC,QAFF,CAAX;AAIA;AACD,GAxEU,EAwER,CAAEA,QAAF,CAxEQ,CAFL,CAAP;AA4EA","sourcesContent":["/**\n * External dependencies\n */\nimport { first, last } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { cloneBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { createListItem } from '../utils';\n\nexport default function useOutdentListItem( clientId ) {\n\tconst { canOutdent } = useSelect(\n\t\t( innerSelect ) => {\n\t\t\tconst { getBlockRootClientId } = innerSelect( blockEditorStore );\n\t\t\tconst grandParentId = getBlockRootClientId(\n\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tcanOutdent: !! grandParentId,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { replaceBlocks, selectionChange, multiSelect } =\n\t\tuseDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlockRootClientId,\n\t\tgetBlockAttributes,\n\t\tgetBlock,\n\t\tgetBlockIndex,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\thasMultiSelection,\n\t\tgetMultiSelectedBlockClientIds,\n\t} = useSelect( blockEditorStore );\n\n\treturn [\n\t\tcanOutdent,\n\t\tuseCallback( () => {\n\t\t\tconst _hasMultiSelection = hasMultiSelection();\n\t\t\tconst clientIds = _hasMultiSelection\n\t\t\t\t? getMultiSelectedBlockClientIds()\n\t\t\t\t: [ clientId ];\n\n\t\t\tconst selectionStart = getSelectionStart();\n\t\t\tconst selectionEnd = getSelectionEnd();\n\n\t\t\tconst listParentId = getBlockRootClientId( clientId );\n\t\t\tconst listAttributes = getBlockAttributes( listParentId );\n\t\t\tconst listItemParentId = getBlockRootClientId( listParentId );\n\t\t\tconst listItemParentAttributes =\n\t\t\t\tgetBlockAttributes( listItemParentId );\n\n\t\t\tconst firstIndex = getBlockIndex( first( clientIds ) );\n\t\t\tconst lastIndex = getBlockIndex( last( clientIds ) );\n\t\t\tconst siblingBlocks = getBlock( listParentId ).innerBlocks;\n\t\t\tconst previousSiblings = siblingBlocks.slice( 0, firstIndex );\n\t\t\tconst afterSiblings = siblingBlocks.slice( lastIndex + 1 );\n\n\t\t\t// Create a new parent list item block with just the siblings\n\t\t\t// that existed before the first child item being outdent.\n\t\t\tconst newListItemParent = createListItem(\n\t\t\t\tlistItemParentAttributes,\n\t\t\t\tlistAttributes,\n\t\t\t\tpreviousSiblings\n\t\t\t);\n\n\t\t\tconst lastBlock = getBlock( last( clientIds ) );\n\t\t\tconst childList = lastBlock.innerBlocks[ 0 ];\n\t\t\tconst childItems = childList?.innerBlocks || [];\n\t\t\tconst hasChildItems = !! childItems.length;\n\n\t\t\tconst newBlocksExcludingLast = clientIds\n\t\t\t\t.slice( 0, -1 )\n\t\t\t\t.map( ( _clientId ) => cloneBlock( getBlock( _clientId ) ) );\n\n\t\t\t// Create a new list item block whose attributes are equal to the\n\t\t\t// last block being outdent and whose children are the children that it had (if any)\n\t\t\t// followed by the siblings that existed after it.\n\t\t\tconst newLastItem = createListItem(\n\t\t\t\tlastBlock.attributes,\n\t\t\t\thasChildItems ? childList.attributes : listAttributes,\n\t\t\t\t[ ...childItems, ...afterSiblings ]\n\t\t\t);\n\n\t\t\t// Replace the parent list item block, with a new block containing\n\t\t\t// the previous siblings before the first block being outdent,\n\t\t\t// followed by the blocks being outdent with the after siblings added\n\t\t\t// as children of the last block.\n\t\t\treplaceBlocks(\n\t\t\t\t[ listItemParentId ],\n\t\t\t\t[ newListItemParent, ...newBlocksExcludingLast, newLastItem ]\n\t\t\t);\n\n\t\t\t// Restore the selection state.\n\t\t\tif ( ! _hasMultiSelection ) {\n\t\t\t\tselectionChange(\n\t\t\t\t\tnewLastItem.clientId,\n\t\t\t\t\tselectionEnd.attributeKey,\n\t\t\t\t\tselectionEnd.clientId === selectionStart.clientId\n\t\t\t\t\t\t? selectionStart.offset\n\t\t\t\t\t\t: selectionEnd.offset,\n\t\t\t\t\tselectionEnd.offset\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmultiSelect(\n\t\t\t\t\tfirst( newBlocksExcludingLast ).clientId,\n\t\t\t\t\tnewLastItem.clientId\n\t\t\t\t);\n\t\t\t}\n\t\t}, [ clientId ] ),\n\t];\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/list-item/hooks/use-outdent-list-item.js"],"names":["first","last","castArray","useCallback","useSelect","useDispatch","useRegistry","store","blockEditorStore","cloneBlock","useOutdentListItem","clientId","registry","canOutdent","innerSelect","getBlockRootClientId","grandParentId","moveBlocksToPosition","removeBlock","insertBlock","updateBlockListSettings","getBlockName","getBlockOrder","getBlockIndex","getSelectedBlockClientIds","getBlock","getBlockListSettings","getParentListItemId","id","listId","parentListItemId","listItemName","clientIds","length","firstClientId","parentListId","lastClientId","order","followingListItems","slice","batch","nestedListId","nestedListBlock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAT,EAAgBC,IAAhB,EAAsBC,SAAtB,QAAuC,QAAvC;AAEA;AACA;AACA;;AACA,SAASC,WAAT,QAA4B,oBAA5B;AACA,SAASC,SAAT,EAAoBC,WAApB,EA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,EAGnBM,YAHmB,CAApB;AAKA;;AACDxB,MAAAA,oBAAoB,CACnBe,SADmB,EAEnBG,YAFmB,EAGnBpB,oBAAoB,CAAEe,gBAAF,CAHD,EAInBP,aAAa,CAAEO,gBAAF,CAAb,GAAoC,CAJjB,CAApB;;AAMA,UAAK,CAAER,aAAa,CAAEa,YAAF,CAAb,CAA8BF,MAArC,EAA8C;AAC7Cf,QAAAA,WAAW,CAAEiB,YAAF,CAAX;AACA;AACD,KAnCD;AAoCA,GA1DU,EA0DR,EA1DQ,CAFL,CAAP;AA8DA","sourcesContent":["/**\n * External dependencies\n */\nimport { first, last, castArray } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { cloneBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name as listItemName } from '../block.json';\n\nexport default function useOutdentListItem( clientId ) {\n\tconst registry = useRegistry();\n\tconst { canOutdent } = useSelect(\n\t\t( innerSelect ) => {\n\t\t\tconst { getBlockRootClientId } = innerSelect( blockEditorStore );\n\t\t\tconst grandParentId = getBlockRootClientId(\n\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tcanOutdent: !! grandParentId,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst {\n\t\tmoveBlocksToPosition,\n\t\tremoveBlock,\n\t\tinsertBlock,\n\t\tupdateBlockListSettings,\n\t} = useDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlockRootClientId,\n\t\tgetBlockName,\n\t\tgetBlockOrder,\n\t\tgetBlockIndex,\n\t\tgetSelectedBlockClientIds,\n\t\tgetBlock,\n\t\tgetBlockListSettings,\n\t} = useSelect( blockEditorStore );\n\n\tfunction getParentListItemId( id ) {\n\t\tconst listId = getBlockRootClientId( id );\n\t\tconst parentListItemId = getBlockRootClientId( listId );\n\t\tif ( ! parentListItemId ) return;\n\t\tif ( getBlockName( parentListItemId ) !== listItemName ) return;\n\t\treturn parentListItemId;\n\t}\n\n\treturn [\n\t\tcanOutdent,\n\t\tuseCallback( ( clientIds = getSelectedBlockClientIds() ) => {\n\t\t\tclientIds = castArray( clientIds );\n\n\t\t\tif ( ! clientIds.length ) return;\n\n\t\t\tconst firstClientId = first( clientIds );\n\n\t\t\t// Can't outdent if it's not a list item.\n\t\t\tif ( getBlockName( firstClientId ) !== listItemName ) return;\n\n\t\t\tconst parentListItemId = getParentListItemId( firstClientId );\n\n\t\t\t// Can't outdent if it's at the top level.\n\t\t\tif ( ! parentListItemId ) return;\n\n\t\t\tconst parentListId = getBlockRootClientId( firstClientId );\n\t\t\tconst lastClientId = last( clientIds );\n\t\t\tconst order = getBlockOrder( parentListId );\n\t\t\tconst followingListItems = order.slice(\n\t\t\t\tgetBlockIndex( lastClientId ) + 1\n\t\t\t);\n\n\t\t\tregistry.batch( () => {\n\t\t\t\tif ( followingListItems.length ) {\n\t\t\t\t\tlet nestedListId = first( getBlockOrder( firstClientId ) );\n\n\t\t\t\t\tif ( ! nestedListId ) {\n\t\t\t\t\t\tconst nestedListBlock = cloneBlock(\n\t\t\t\t\t\t\tgetBlock( parentListId ),\n\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t\t[]\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnestedListId = nestedListBlock.clientId;\n\t\t\t\t\t\tinsertBlock( nestedListBlock, 0, firstClientId, false );\n\t\t\t\t\t\t// Immediately update the block list settings, otherwise\n\t\t\t\t\t\t// blocks can't be moved here due to canInsert checks.\n\t\t\t\t\t\tupdateBlockListSettings(\n\t\t\t\t\t\t\tnestedListId,\n\t\t\t\t\t\t\tgetBlockListSettings( parentListId )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\tfollowingListItems,\n\t\t\t\t\t\tparentListId,\n\t\t\t\t\t\tnestedListId\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\tclientIds,\n\t\t\t\t\tparentListId,\n\t\t\t\t\tgetBlockRootClientId( parentListItemId ),\n\t\t\t\t\tgetBlockIndex( parentListItemId ) + 1\n\t\t\t\t);\n\t\t\t\tif ( ! getBlockOrder( parentListId ).length ) {\n\t\t\t\t\tremoveBlock( parentListId );\n\t\t\t\t}\n\t\t\t} );\n\t\t}, [] ),\n\t];\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * WordPress dependencies
5
+ */
6
+ import { SVG, Rect } from '@wordpress/components';
7
+ export const circle = (size, color) => createElement(SVG, {
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg"
10
+ }, createElement(Rect, {
11
+ width: size,
12
+ height: size,
13
+ rx: size / 2,
14
+ fill: color
15
+ }));
16
+ export const circleOutline = (size, color) => createElement(SVG, {
17
+ width: size,
18
+ height: size,
19
+ fill: "none",
20
+ xmlns: "http://www.w3.org/2000/svg"
21
+ }, createElement(Rect, {
22
+ x: "0.5",
23
+ y: "0.5",
24
+ width: size - 1,
25
+ height: size - 1,
26
+ rx: size / 2,
27
+ stroke: color
28
+ }));
29
+ export const square = (size, color) => createElement(SVG, {
30
+ fill: "none",
31
+ xmlns: "http://www.w3.org/2000/svg"
32
+ }, createElement(Rect, {
33
+ width: size,
34
+ height: size,
35
+ fill: color
36
+ }));
37
+ //# sourceMappingURL=icons.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/list-item/icons.native.js"],"names":["SVG","Rect","circle","size","color","circleOutline","square"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,IAAd,QAA0B,uBAA1B;AAEA,OAAO,MAAMC,MAAM,GAAG,CAAEC,IAAF,EAAQC,KAAR,KACrB,cAAC,GAAD;AAAK,EAAA,IAAI,EAAC,MAAV;AAAiB,EAAA,KAAK,EAAC;AAAvB,GACC,cAAC,IAAD;AAAM,EAAA,KAAK,EAAGD,IAAd;AAAqB,EAAA,MAAM,EAAGA,IAA9B;AAAqC,EAAA,EAAE,EAAGA,IAAI,GAAG,CAAjD;AAAqD,EAAA,IAAI,EAAGC;AAA5D,EADD,CADM;AAMP,OAAO,MAAMC,aAAa,GAAG,CAAEF,IAAF,EAAQC,KAAR,KAC5B,cAAC,GAAD;AACC,EAAA,KAAK,EAAGD,IADT;AAEC,EAAA,MAAM,EAAGA,IAFV;AAGC,EAAA,IAAI,EAAC,MAHN;AAIC,EAAA,KAAK,EAAC;AAJP,GAMC,cAAC,IAAD;AACC,EAAA,CAAC,EAAC,KADH;AAEC,EAAA,CAAC,EAAC,KAFH;AAGC,EAAA,KAAK,EAAGA,IAAI,GAAG,CAHhB;AAIC,EAAA,MAAM,EAAGA,IAAI,GAAG,CAJjB;AAKC,EAAA,EAAE,EAAGA,IAAI,GAAG,CALb;AAMC,EAAA,MAAM,EAAGC;AANV,EAND,CADM;AAkBP,OAAO,MAAME,MAAM,GAAG,CAAEH,IAAF,EAAQC,KAAR,KACrB,cAAC,GAAD;AAAK,EAAA,IAAI,EAAC,MAAV;AAAiB,EAAA,KAAK,EAAC;AAAvB,GACC,cAAC,IAAD;AAAM,EAAA,KAAK,EAAGD,IAAd;AAAqB,EAAA,MAAM,EAAGA,IAA9B;AAAqC,EAAA,IAAI,EAAGC;AAA5C,EADD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Rect } from '@wordpress/components';\n\nexport const circle = ( size, color ) => (\n\t<SVG fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<Rect width={ size } height={ size } rx={ size / 2 } fill={ color } />\n\t</SVG>\n);\n\nexport const circleOutline = ( size, color ) => (\n\t<SVG\n\t\twidth={ size }\n\t\theight={ size }\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<Rect\n\t\t\tx=\"0.5\"\n\t\t\ty=\"0.5\"\n\t\t\twidth={ size - 1 }\n\t\t\theight={ size - 1 }\n\t\t\trx={ size / 2 }\n\t\t\tstroke={ color }\n\t\t/>\n\t</SVG>\n);\n\nexport const square = ( size, color ) => (\n\t<SVG fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<Rect width={ size } height={ size } fill={ color } />\n\t</SVG>\n);\n"]}
@@ -0,0 +1,126 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import { View, Text } from 'react-native';
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+
11
+ import { Icon } from '@wordpress/components';
12
+ import { Platform } from '@wordpress/element';
13
+ import { usePreferredColorSchemeStyle } from '@wordpress/compose';
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+
18
+ import styles from './style.scss';
19
+ import { circle, circleOutline, square } from './icons';
20
+ const DEFAULT_ICON_SIZE = 6;
21
+
22
+ function getListNumberIndex(start, blockIndex, reversed, numberOfListItems) {
23
+ if (start) {
24
+ return reversed ? numberOfListItems - 1 + start - blockIndex : start + blockIndex;
25
+ }
26
+
27
+ if (reversed) {
28
+ return numberOfListItems - blockIndex;
29
+ }
30
+
31
+ return blockIndex + 1;
32
+ }
33
+
34
+ function OrderedList(_ref) {
35
+ let {
36
+ blockIndex,
37
+ color,
38
+ fontSize,
39
+ numberOfListItems,
40
+ reversed,
41
+ start,
42
+ style
43
+ } = _ref;
44
+ const orderedStyles = [styles['wp-block-list-item__list-item-container--ordered'], Platform.isIOS && styles['wp-block-list-item__list-item-ordered--default'], Platform.isIOS && (style === null || style === void 0 ? void 0 : style.fontSize) && styles['wp-block-list-item__list-item-ordered--custom']];
45
+ const numberStyle = [{
46
+ fontSize,
47
+ color
48
+ }];
49
+ const currentIndex = getListNumberIndex(start, blockIndex, reversed, numberOfListItems);
50
+ return createElement(View, {
51
+ style: orderedStyles
52
+ }, createElement(Text, {
53
+ style: numberStyle
54
+ }, currentIndex, "."));
55
+ }
56
+
57
+ function IconList(_ref2) {
58
+ let {
59
+ fontSize,
60
+ color,
61
+ defaultFontSize,
62
+ indentationLevel
63
+ } = _ref2;
64
+ const iconSize = parseInt(fontSize * DEFAULT_ICON_SIZE / defaultFontSize, 10);
65
+ let listIcon = circle(iconSize, color);
66
+
67
+ if (indentationLevel === 1) {
68
+ listIcon = circleOutline(iconSize, color);
69
+ } else if (indentationLevel > 1) {
70
+ listIcon = square(iconSize, color);
71
+ }
72
+
73
+ const listStyles = [styles['wp-block-list-item__list-item-container'], {
74
+ marginTop: fontSize / 2
75
+ }];
76
+ return createElement(View, {
77
+ style: listStyles
78
+ }, createElement(Icon, {
79
+ icon: listIcon,
80
+ size: iconSize
81
+ }));
82
+ }
83
+
84
+ export default function ListStyleType(_ref3) {
85
+ var _style$baseColors, _style$baseColors$typ, _style$baseColors2, _style$baseColors2$co;
86
+
87
+ let {
88
+ blockIndex,
89
+ indentationLevel,
90
+ numberOfListItems,
91
+ ordered,
92
+ reversed,
93
+ start,
94
+ style
95
+ } = _ref3;
96
+ let defaultFontSize = styles['wp-block-list-item__list-item--default'].fontSize;
97
+
98
+ if (style !== null && style !== void 0 && (_style$baseColors = style.baseColors) !== null && _style$baseColors !== void 0 && (_style$baseColors$typ = _style$baseColors.typography) !== null && _style$baseColors$typ !== void 0 && _style$baseColors$typ.fontSize) {
99
+ defaultFontSize = parseInt(style.baseColors.typography.fontSize, 10);
100
+ }
101
+
102
+ const fontSize = parseInt(style !== null && style !== void 0 && style.fontSize ? style.fontSize : defaultFontSize, 10);
103
+ const colorWithPreferredScheme = usePreferredColorSchemeStyle(styles['wp-block-list-item__list-item--default'], styles['wp-block-list-item__list-item--default--dark']);
104
+ const defaultColor = style !== null && style !== void 0 && (_style$baseColors2 = style.baseColors) !== null && _style$baseColors2 !== void 0 && (_style$baseColors2$co = _style$baseColors2.color) !== null && _style$baseColors2$co !== void 0 && _style$baseColors2$co.text ? style.baseColors.color.text : colorWithPreferredScheme.color;
105
+ const color = style !== null && style !== void 0 && style.color ? style.color : defaultColor;
106
+
107
+ if (ordered) {
108
+ return createElement(OrderedList, {
109
+ blockIndex: blockIndex,
110
+ color: color,
111
+ fontSize: fontSize,
112
+ numberOfListItems: numberOfListItems,
113
+ reversed: reversed,
114
+ start: start,
115
+ style: style
116
+ });
117
+ }
118
+
119
+ return createElement(IconList, {
120
+ color: color,
121
+ defaultFontSize: defaultFontSize,
122
+ fontSize: fontSize,
123
+ indentationLevel: indentationLevel
124
+ });
125
+ }
126
+ //# sourceMappingURL=list-style-type.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/list-item/list-style-type.native.js"],"names":["View","Text","Icon","Platform","usePreferredColorSchemeStyle","styles","circle","circleOutline","square","DEFAULT_ICON_SIZE","getListNumberIndex","start","blockIndex","reversed","numberOfListItems","OrderedList","color","fontSize","style","orderedStyles","isIOS","numberStyle","currentIndex","IconList","defaultFontSize","indentationLevel","iconSize","parseInt","listIcon","listStyles","marginTop","ListStyleType","ordered","baseColors","typography","colorWithPreferredScheme","defaultColor","text"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,4BAAT,QAA6C,oBAA7C;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,SAASC,MAAT,EAAiBC,aAAjB,EAAgCC,MAAhC,QAA8C,SAA9C;AAEA,MAAMC,iBAAiB,GAAG,CAA1B;;AAEA,SAASC,kBAAT,CAA6BC,KAA7B,EAAoCC,UAApC,EAAgDC,QAAhD,EAA0DC,iBAA1D,EAA8E;AAC7E,MAAKH,KAAL,EAAa;AACZ,WAAOE,QAAQ,GACZC,iBAAiB,GAAG,CAApB,GAAwBH,KAAxB,GAAgCC,UADpB,GAEZD,KAAK,G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AAE,8CAAF,CAFsD,CAA7D;AAKA,QAAM+B,YAAY,GAAGlB,KAAK,SAAL,IAAAA,KAAK,WAAL,0BAAAA,KAAK,CAAEe,UAAP,2FAAmBjB,KAAnB,wEAA0BqB,IAA1B,GAClBnB,KAAK,CAACe,UAAN,CAAiBjB,KAAjB,CAAuBqB,IADL,GAElBF,wBAAwB,CAACnB,KAF5B;AAGA,QAAMA,KAAK,GAAGE,KAAK,SAAL,IAAAA,KAAK,WAAL,IAAAA,KAAK,CAAEF,KAAP,GAAeE,KAAK,CAACF,KAArB,GAA6BoB,YAA3C;;AAEA,MAAKJ,OAAL,EAAe;AACd,WACC,cAAC,WAAD;AACC,MAAA,UAAU,EAAGpB,UADd;AAEC,MAAA,KAAK,EAAGI,KAFT;AAGC,MAAA,QAAQ,EAAGC,QAHZ;AAIC,MAAA,iBAAiB,EAAGH,iBAJrB;AAKC,MAAA,QAAQ,EAAGD,QALZ;AAMC,MAAA,KAAK,EAAGF,KANT;AAOC,MAAA,KAAK,EAAGO;AAPT,MADD;AAWA;;AAED,SACC,cAAC,QAAD;AACC,IAAA,KAAK,EAAGF,KADT;AAEC,IAAA,eAAe,EAAGQ,eAFnB;AAGC,IAAA,QAAQ,EAAGP,QAHZ;AAIC,IAAA,gBAAgB,EAAGQ;AAJpB,IADD;AAQA","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { Platform } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { circle, circleOutline, square } from './icons';\n\nconst DEFAULT_ICON_SIZE = 6;\n\nfunction getListNumberIndex( start, blockIndex, reversed, numberOfListItems ) {\n\tif ( start ) {\n\t\treturn reversed\n\t\t\t? numberOfListItems - 1 + start - blockIndex\n\t\t\t: start + blockIndex;\n\t}\n\n\tif ( reversed ) {\n\t\treturn numberOfListItems - blockIndex;\n\t}\n\n\treturn blockIndex + 1;\n}\n\nfunction OrderedList( {\n\tblockIndex,\n\tcolor,\n\tfontSize,\n\tnumberOfListItems,\n\treversed,\n\tstart,\n\tstyle,\n} ) {\n\tconst orderedStyles = [\n\t\tstyles[ 'wp-block-list-item__list-item-container--ordered' ],\n\t\tPlatform.isIOS &&\n\t\t\tstyles[ 'wp-block-list-item__list-item-ordered--default' ],\n\t\tPlatform.isIOS &&\n\t\t\tstyle?.fontSize &&\n\t\t\tstyles[ 'wp-block-list-item__list-item-ordered--custom' ],\n\t];\n\tconst numberStyle = [ { fontSize, color } ];\n\n\tconst currentIndex = getListNumberIndex(\n\t\tstart,\n\t\tblockIndex,\n\t\treversed,\n\t\tnumberOfListItems\n\t);\n\n\treturn (\n\t\t<View style={ orderedStyles }>\n\t\t\t<Text style={ numberStyle }>{ currentIndex }.</Text>\n\t\t</View>\n\t);\n}\n\nfunction IconList( { fontSize, color, defaultFontSize, indentationLevel } ) {\n\tconst iconSize = parseInt(\n\t\t( fontSize * DEFAULT_ICON_SIZE ) / defaultFontSize,\n\t\t10\n\t);\n\n\tlet listIcon = circle( iconSize, color );\n\tif ( indentationLevel === 1 ) {\n\t\tlistIcon = circleOutline( iconSize, color );\n\t} else if ( indentationLevel > 1 ) {\n\t\tlistIcon = square( iconSize, color );\n\t}\n\n\tconst listStyles = [\n\t\tstyles[ 'wp-block-list-item__list-item-container' ],\n\t\t{ marginTop: fontSize / 2 },\n\t];\n\n\treturn (\n\t\t<View style={ listStyles }>\n\t\t\t<Icon icon={ listIcon } size={ iconSize } />\n\t\t</View>\n\t);\n}\n\nexport default function ListStyleType( {\n\tblockIndex,\n\tindentationLevel,\n\tnumberOfListItems,\n\tordered,\n\treversed,\n\tstart,\n\tstyle,\n} ) {\n\tlet defaultFontSize =\n\t\tstyles[ 'wp-block-list-item__list-item--default' ].fontSize;\n\n\tif ( style?.baseColors?.typography?.fontSize ) {\n\t\tdefaultFontSize = parseInt( style.baseColors.typography.fontSize, 10 );\n\t}\n\n\tconst fontSize = parseInt(\n\t\tstyle?.fontSize ? style.fontSize : defaultFontSize,\n\t\t10\n\t);\n\n\tconst colorWithPreferredScheme = usePreferredColorSchemeStyle(\n\t\tstyles[ 'wp-block-list-item__list-item--default' ],\n\t\tstyles[ 'wp-block-list-item__list-item--default--dark' ]\n\t);\n\n\tconst defaultColor = style?.baseColors?.color?.text\n\t\t? style.baseColors.color.text\n\t\t: colorWithPreferredScheme.color;\n\tconst color = style?.color ? style.color : defaultColor;\n\n\tif ( ordered ) {\n\t\treturn (\n\t\t\t<OrderedList\n\t\t\t\tblockIndex={ blockIndex }\n\t\t\t\tcolor={ color }\n\t\t\t\tfontSize={ fontSize }\n\t\t\t\tnumberOfListItems={ numberOfListItems }\n\t\t\t\treversed={ reversed }\n\t\t\t\tstart={ start }\n\t\t\t\tstyle={ style }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<IconList\n\t\t\tcolor={ color }\n\t\t\tdefaultFontSize={ defaultFontSize }\n\t\t\tfontSize={ fontSize }\n\t\t\tindentationLevel={ indentationLevel }\n\t\t/>\n\t);\n}\n"]}