@wordpress/block-library 9.44.0 → 9.45.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 (367) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/accordion/edit.cjs +0 -2
  3. package/build/accordion/edit.cjs.map +2 -2
  4. package/build/accordion-item/block.json +1 -0
  5. package/build/button/constants.cjs +1 -1
  6. package/build/button/constants.cjs.map +1 -1
  7. package/build/categories/edit.cjs +5 -1
  8. package/build/categories/edit.cjs.map +2 -2
  9. package/build/embed/edit.cjs +38 -34
  10. package/build/embed/edit.cjs.map +3 -3
  11. package/build/embed/transforms.cjs +3 -1
  12. package/build/embed/transforms.cjs.map +2 -2
  13. package/build/embed/util.cjs +13 -2
  14. package/build/embed/util.cjs.map +2 -2
  15. package/build/form/block.json +1 -1
  16. package/build/form-input/block.json +1 -1
  17. package/build/form-submission-notification/block.json +1 -1
  18. package/build/form-submit-button/block.json +1 -1
  19. package/build/group/block.json +2 -1
  20. package/build/image/constants.cjs +1 -1
  21. package/build/image/constants.cjs.map +2 -2
  22. package/build/image/edit.cjs +2 -4
  23. package/build/image/edit.cjs.map +2 -2
  24. package/build/image/image.cjs +49 -19
  25. package/build/image/image.cjs.map +3 -3
  26. package/build/index.cjs +4 -4
  27. package/build/index.cjs.map +2 -2
  28. package/build/latest-posts/edit.cjs +1 -1
  29. package/build/latest-posts/edit.cjs.map +1 -1
  30. package/build/math/edit.cjs +2 -2
  31. package/build/math/edit.cjs.map +2 -2
  32. package/build/navigation/edit/accessible-description.cjs +2 -2
  33. package/build/navigation/edit/accessible-description.cjs.map +2 -2
  34. package/build/navigation/edit/overlay-template-part-selector.cjs.map +2 -2
  35. package/build/navigation-link/edit.cjs +2 -1
  36. package/build/navigation-link/edit.cjs.map +2 -2
  37. package/build/navigation-link/link-ui/dialog-wrapper.cjs +2 -1
  38. package/build/navigation-link/link-ui/dialog-wrapper.cjs.map +2 -2
  39. package/build/navigation-link/link-ui/index.cjs +2 -1
  40. package/build/navigation-link/link-ui/index.cjs.map +2 -2
  41. package/build/paragraph/use-enter.cjs +12 -23
  42. package/build/paragraph/use-enter.cjs.map +2 -2
  43. package/build/post-author/edit.cjs.map +3 -3
  44. package/build/post-comments-form/edit.cjs +2 -2
  45. package/build/post-comments-form/edit.cjs.map +2 -2
  46. package/build/post-featured-image/edit.cjs +2 -5
  47. package/build/post-featured-image/edit.cjs.map +2 -2
  48. package/build/post-template/edit.cjs +8 -2
  49. package/build/post-template/edit.cjs.map +2 -2
  50. package/build/pullquote/block.json +1 -4
  51. package/build/query/edit/inspector-controls/author-control.cjs +1 -1
  52. package/build/query/edit/inspector-controls/author-control.cjs.map +2 -2
  53. package/build/query/edit/inspector-controls/format-controls.cjs +1 -1
  54. package/build/query/edit/inspector-controls/format-controls.cjs.map +2 -2
  55. package/build/query/edit/inspector-controls/parent-control.cjs +1 -1
  56. package/build/query/edit/inspector-controls/parent-control.cjs.map +2 -2
  57. package/build/query/edit/inspector-controls/taxonomy-controls.cjs +1 -1
  58. package/build/query/edit/inspector-controls/taxonomy-controls.cjs.map +2 -2
  59. package/build/site-logo/edit.cjs +34 -20
  60. package/build/site-logo/edit.cjs.map +2 -2
  61. package/build/tab/block.json +23 -23
  62. package/build/tab/controls.cjs +5 -48
  63. package/build/tab/controls.cjs.map +3 -3
  64. package/build/tab/edit.cjs +76 -92
  65. package/build/tab/edit.cjs.map +3 -3
  66. package/build/tab/save.cjs +3 -3
  67. package/build/tab/save.cjs.map +2 -2
  68. package/{src/tabs-menu → build/tab-list}/block.json +4 -4
  69. package/build/{tabs-menu → tab-list}/edit.cjs +9 -14
  70. package/build/tab-list/edit.cjs.map +7 -0
  71. package/build/{tabs-menu → tab-list}/index.cjs +5 -5
  72. package/build/tab-list/index.cjs.map +7 -0
  73. package/build/{tabs-menu → tab-list}/save.cjs +1 -1
  74. package/build/{tabs-menu → tab-list}/save.cjs.map +1 -1
  75. package/build/{tab → tab-panel}/add-tab-toolbar-control.cjs +16 -16
  76. package/build/tab-panel/add-tab-toolbar-control.cjs.map +7 -0
  77. package/build/tab-panel/block.json +27 -37
  78. package/build/tab-panel/controls.cjs +89 -0
  79. package/build/tab-panel/controls.cjs.map +7 -0
  80. package/build/tab-panel/edit.cjs +88 -18
  81. package/build/tab-panel/edit.cjs.map +3 -3
  82. package/build/tab-panel/index.cjs +1 -1
  83. package/build/tab-panel/index.cjs.map +1 -1
  84. package/build/{tab → tab-panel}/init.cjs +1 -1
  85. package/build/{tab → tab-panel}/init.cjs.map +1 -1
  86. package/build/{tab → tab-panel}/remove-tab-toolbar-control.cjs +16 -16
  87. package/build/tab-panel/remove-tab-toolbar-control.cjs.map +7 -0
  88. package/build/tab-panel/save.cjs +4 -2
  89. package/build/tab-panel/save.cjs.map +2 -2
  90. package/build/tab-panels/block.json +66 -0
  91. package/build/{tabs-menu-item/controls.cjs → tab-panels/edit.cjs} +25 -11
  92. package/build/tab-panels/edit.cjs.map +7 -0
  93. package/build/{tabs-menu-item → tab-panels}/index.cjs +5 -5
  94. package/build/{tabs-menu → tab-panels}/index.cjs.map +2 -2
  95. package/build/{tabs-menu-item → tab-panels}/save.cjs +4 -6
  96. package/build/tab-panels/save.cjs.map +7 -0
  97. package/build/tabs/block.json +1 -2
  98. package/build/tabs/controls.cjs +2 -2
  99. package/build/tabs/controls.cjs.map +1 -1
  100. package/build/tabs/edit.cjs +29 -100
  101. package/build/tabs/edit.cjs.map +3 -3
  102. package/build/tabs/index.cjs +5 -5
  103. package/build/tabs/index.cjs.map +1 -1
  104. package/build/tabs/use-tab-list-sync.cjs +190 -0
  105. package/build/tabs/use-tab-list-sync.cjs.map +7 -0
  106. package/build/terms-query/edit/inspector-controls/include-control.cjs +1 -1
  107. package/build/terms-query/edit/inspector-controls/include-control.cjs.map +2 -2
  108. package/build/video/tracks-editor.cjs +2 -2
  109. package/build/video/tracks-editor.cjs.map +2 -2
  110. package/build-module/accordion/edit.mjs +0 -2
  111. package/build-module/accordion/edit.mjs.map +2 -2
  112. package/build-module/accordion-item/block.json +1 -0
  113. package/build-module/button/constants.mjs +1 -1
  114. package/build-module/button/constants.mjs.map +1 -1
  115. package/build-module/categories/edit.mjs +5 -2
  116. package/build-module/categories/edit.mjs.map +2 -2
  117. package/build-module/embed/edit.mjs +45 -36
  118. package/build-module/embed/edit.mjs.map +2 -2
  119. package/build-module/embed/transforms.mjs +8 -2
  120. package/build-module/embed/transforms.mjs.map +2 -2
  121. package/build-module/embed/util.mjs +11 -1
  122. package/build-module/embed/util.mjs.map +2 -2
  123. package/build-module/form/block.json +1 -1
  124. package/build-module/form-input/block.json +1 -1
  125. package/build-module/form-submission-notification/block.json +1 -1
  126. package/build-module/form-submit-button/block.json +1 -1
  127. package/build-module/group/block.json +2 -1
  128. package/build-module/image/constants.mjs +1 -1
  129. package/build-module/image/constants.mjs.map +2 -2
  130. package/build-module/image/edit.mjs +2 -4
  131. package/build-module/image/edit.mjs.map +2 -2
  132. package/build-module/image/image.mjs +49 -19
  133. package/build-module/image/image.mjs.map +3 -3
  134. package/build-module/index.mjs +4 -4
  135. package/build-module/index.mjs.map +2 -2
  136. package/build-module/latest-posts/edit.mjs +1 -1
  137. package/build-module/latest-posts/edit.mjs.map +1 -1
  138. package/build-module/math/edit.mjs +2 -2
  139. package/build-module/math/edit.mjs.map +2 -2
  140. package/build-module/navigation/edit/accessible-description.mjs +1 -1
  141. package/build-module/navigation/edit/accessible-description.mjs.map +1 -1
  142. package/build-module/navigation/edit/overlay-template-part-selector.mjs +2 -2
  143. package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +1 -1
  144. package/build-module/navigation-link/edit.mjs +2 -5
  145. package/build-module/navigation-link/edit.mjs.map +2 -2
  146. package/build-module/navigation-link/link-ui/dialog-wrapper.mjs +2 -1
  147. package/build-module/navigation-link/link-ui/dialog-wrapper.mjs.map +2 -2
  148. package/build-module/navigation-link/link-ui/index.mjs +1 -1
  149. package/build-module/navigation-link/link-ui/index.mjs.map +2 -2
  150. package/build-module/paragraph/use-enter.mjs +13 -23
  151. package/build-module/paragraph/use-enter.mjs.map +2 -2
  152. package/build-module/post-author/edit.mjs +2 -2
  153. package/build-module/post-author/edit.mjs.map +2 -2
  154. package/build-module/post-comments-form/edit.mjs +1 -1
  155. package/build-module/post-comments-form/edit.mjs.map +2 -2
  156. package/build-module/post-featured-image/edit.mjs +2 -5
  157. package/build-module/post-featured-image/edit.mjs.map +2 -2
  158. package/build-module/post-template/edit.mjs +8 -2
  159. package/build-module/post-template/edit.mjs.map +2 -2
  160. package/build-module/pullquote/block.json +1 -4
  161. package/build-module/query/edit/inspector-controls/author-control.mjs +1 -1
  162. package/build-module/query/edit/inspector-controls/author-control.mjs.map +2 -2
  163. package/build-module/query/edit/inspector-controls/format-controls.mjs +1 -1
  164. package/build-module/query/edit/inspector-controls/format-controls.mjs.map +2 -2
  165. package/build-module/query/edit/inspector-controls/parent-control.mjs +1 -1
  166. package/build-module/query/edit/inspector-controls/parent-control.mjs.map +2 -2
  167. package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs +1 -1
  168. package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs.map +2 -2
  169. package/build-module/site-logo/edit.mjs +34 -20
  170. package/build-module/site-logo/edit.mjs.map +2 -2
  171. package/build-module/tab/block.json +23 -23
  172. package/build-module/tab/controls.mjs +7 -57
  173. package/build-module/tab/controls.mjs.map +2 -2
  174. package/build-module/tab/edit.mjs +80 -96
  175. package/build-module/tab/edit.mjs.map +3 -3
  176. package/build-module/tab/save.mjs +4 -4
  177. package/build-module/tab/save.mjs.map +2 -2
  178. package/build-module/{tabs-menu → tab-list}/block.json +4 -4
  179. package/build-module/{tabs-menu → tab-list}/edit.mjs +9 -14
  180. package/build-module/tab-list/edit.mjs.map +7 -0
  181. package/build-module/{tabs-menu → tab-list}/index.mjs +2 -2
  182. package/build-module/tab-list/index.mjs.map +7 -0
  183. package/build-module/{tabs-menu → tab-list}/save.mjs +1 -1
  184. package/build-module/{tabs-menu → tab-list}/save.mjs.map +1 -1
  185. package/build-module/{tab → tab-panel}/add-tab-toolbar-control.mjs +16 -16
  186. package/build-module/tab-panel/add-tab-toolbar-control.mjs.map +7 -0
  187. package/build-module/tab-panel/block.json +27 -37
  188. package/build-module/tab-panel/controls.mjs +65 -0
  189. package/build-module/tab-panel/controls.mjs.map +7 -0
  190. package/build-module/tab-panel/edit.mjs +90 -20
  191. package/build-module/tab-panel/edit.mjs.map +2 -2
  192. package/build-module/tab-panel/index.mjs +1 -1
  193. package/build-module/tab-panel/index.mjs.map +1 -1
  194. package/build-module/{tab → tab-panel}/init.mjs +1 -1
  195. package/build-module/{tab → tab-panel}/init.mjs.map +1 -1
  196. package/build-module/{tab → tab-panel}/remove-tab-toolbar-control.mjs +16 -16
  197. package/build-module/tab-panel/remove-tab-toolbar-control.mjs.map +7 -0
  198. package/build-module/tab-panel/save.mjs +4 -2
  199. package/build-module/tab-panel/save.mjs.map +2 -2
  200. package/build-module/tab-panels/block.json +66 -0
  201. package/build-module/tab-panels/edit.mjs +33 -0
  202. package/build-module/tab-panels/edit.mjs.map +7 -0
  203. package/build-module/{tabs-menu-item → tab-panels}/index.mjs +2 -2
  204. package/build-module/{tabs-menu → tab-panels}/index.mjs.map +2 -2
  205. package/build-module/tab-panels/save.mjs +12 -0
  206. package/build-module/tab-panels/save.mjs.map +7 -0
  207. package/build-module/tabs/block.json +1 -2
  208. package/build-module/tabs/controls.mjs +2 -2
  209. package/build-module/tabs/controls.mjs.map +1 -1
  210. package/build-module/tabs/edit.mjs +31 -102
  211. package/build-module/tabs/edit.mjs.map +2 -2
  212. package/build-module/tabs/index.mjs +5 -5
  213. package/build-module/tabs/index.mjs.map +1 -1
  214. package/build-module/tabs/use-tab-list-sync.mjs +169 -0
  215. package/build-module/tabs/use-tab-list-sync.mjs.map +7 -0
  216. package/build-module/terms-query/edit/inspector-controls/include-control.mjs +1 -1
  217. package/build-module/terms-query/edit/inspector-controls/include-control.mjs.map +2 -2
  218. package/build-module/video/tracks-editor.mjs +2 -2
  219. package/build-module/video/tracks-editor.mjs.map +2 -2
  220. package/build-style/classic-rtl.css +14 -0
  221. package/build-style/classic.css +14 -0
  222. package/build-style/editor-rtl.css +9 -5
  223. package/build-style/editor.css +9 -5
  224. package/build-style/latest-comments/style-rtl.css +4 -4
  225. package/build-style/latest-comments/style.css +4 -4
  226. package/build-style/post-template/style-rtl.css +1 -1
  227. package/build-style/post-template/style.css +1 -1
  228. package/build-style/style-rtl.css +45 -48
  229. package/build-style/style.css +45 -48
  230. package/build-style/tab/editor-rtl.css +11 -0
  231. package/build-style/tab/editor.css +11 -0
  232. package/build-style/tab/style-rtl.css +29 -16
  233. package/build-style/tab/style.css +29 -16
  234. package/build-style/tab-list/editor-rtl.css +6 -0
  235. package/build-style/tab-list/editor.css +6 -0
  236. package/build-style/tab-panel/style-rtl.css +17 -1
  237. package/build-style/tab-panel/style.css +17 -1
  238. package/build-style/tab-panels/style-rtl.css +4 -0
  239. package/build-style/tab-panels/style.css +4 -0
  240. package/build-style/tabs/style-rtl.css +0 -3
  241. package/build-style/tabs/style.css +0 -3
  242. package/build-style/video/editor-rtl.css +4 -0
  243. package/build-style/video/editor.css +4 -0
  244. package/package.json +39 -38
  245. package/src/accordion/edit.js +0 -2
  246. package/src/accordion-item/block.json +1 -0
  247. package/src/block/test/edit.native.js +1 -1
  248. package/src/button/constants.js +1 -1
  249. package/src/button/test/get-updated-link-attributes.js +6 -10
  250. package/src/categories/edit.js +3 -2
  251. package/src/classic.scss +25 -0
  252. package/src/editor.scss +2 -2
  253. package/src/embed/edit.js +61 -52
  254. package/src/embed/edit.native.js +71 -57
  255. package/src/embed/transforms.js +8 -2
  256. package/src/embed/util.js +17 -0
  257. package/src/form/block.json +1 -1
  258. package/src/form-input/block.json +1 -1
  259. package/src/form-submission-notification/block.json +1 -1
  260. package/src/form-submit-button/block.json +1 -1
  261. package/src/group/block.json +2 -1
  262. package/src/image/constants.js +1 -1
  263. package/src/image/edit.js +5 -3
  264. package/src/image/edit.native.js +3 -3
  265. package/src/image/image.js +63 -27
  266. package/src/image/test/edit.native.js +2 -2
  267. package/src/index.js +4 -4
  268. package/src/latest-comments/style.scss +7 -7
  269. package/src/latest-posts/edit.js +1 -1
  270. package/src/latest-posts/index.php +1 -1
  271. package/src/math/edit.js +3 -3
  272. package/src/navigation/edit/accessible-description.js +1 -1
  273. package/src/navigation/edit/overlay-template-part-selector.js +3 -3
  274. package/src/navigation/edit/test/overlay-template-part-selector.js +1 -0
  275. package/src/navigation-link/edit.js +2 -5
  276. package/src/navigation-link/link-ui/dialog-wrapper.js +2 -1
  277. package/src/navigation-link/link-ui/index.js +1 -1
  278. package/src/paragraph/use-enter.js +18 -24
  279. package/src/post-author/edit.js +3 -5
  280. package/src/post-comments-form/edit.js +1 -1
  281. package/src/post-featured-image/edit.js +2 -9
  282. package/src/post-template/edit.js +7 -1
  283. package/src/post-template/index.php +3 -0
  284. package/src/post-template/style.scss +2 -2
  285. package/src/pullquote/block.json +1 -4
  286. package/src/query/edit/inspector-controls/author-control.js +1 -1
  287. package/src/query/edit/inspector-controls/format-controls.js +1 -1
  288. package/src/query/edit/inspector-controls/parent-control.js +1 -1
  289. package/src/query/edit/inspector-controls/taxonomy-controls.js +1 -1
  290. package/src/site-logo/edit.js +40 -20
  291. package/src/style.scss +1 -1
  292. package/src/tab/block.json +23 -23
  293. package/src/tab/controls.js +6 -52
  294. package/src/tab/edit.js +94 -123
  295. package/src/{tabs-menu-item → tab}/editor.scss +3 -3
  296. package/src/tab/index.php +32 -51
  297. package/src/tab/save.js +4 -4
  298. package/src/tab/style.scss +34 -17
  299. package/{build/tabs-menu → src/tab-list}/block.json +4 -4
  300. package/src/{tabs-menu → tab-list}/edit.js +9 -18
  301. package/src/{tabs-menu → tab-list}/editor.scss +2 -2
  302. package/src/{tabs-menu → tab-list}/index.js +1 -1
  303. package/src/tab-list/index.php +80 -0
  304. package/src/{tab → tab-panel}/add-tab-toolbar-control.js +19 -19
  305. package/src/tab-panel/block.json +27 -37
  306. package/src/tab-panel/controls.js +65 -0
  307. package/src/tab-panel/edit.js +121 -20
  308. package/src/tab-panel/index.js +1 -1
  309. package/src/tab-panel/index.php +88 -0
  310. package/src/{tab → tab-panel}/remove-tab-toolbar-control.js +20 -19
  311. package/src/tab-panel/save.js +4 -2
  312. package/src/tab-panel/style.scss +20 -1
  313. package/src/tab-panels/block.json +66 -0
  314. package/src/tab-panels/edit.js +42 -0
  315. package/src/{tabs-menu-item → tab-panels}/index.js +1 -1
  316. package/src/tab-panels/save.js +11 -0
  317. package/src/tab-panels/style.scss +4 -0
  318. package/src/tabs/block.json +1 -2
  319. package/src/tabs/controls.js +2 -2
  320. package/src/tabs/edit.js +32 -150
  321. package/src/tabs/index.js +5 -5
  322. package/src/tabs/index.php +5 -5
  323. package/src/tabs/style.scss +0 -3
  324. package/src/tabs/use-tab-list-sync.js +237 -0
  325. package/src/terms-query/edit/inspector-controls/include-control.js +1 -1
  326. package/src/video/editor.scss +5 -0
  327. package/src/video/tracks-editor.js +2 -2
  328. package/build/tab/add-tab-toolbar-control.cjs.map +0 -7
  329. package/build/tab/remove-tab-toolbar-control.cjs.map +0 -7
  330. package/build/tab/slug-from-label.cjs +0 -37
  331. package/build/tab/slug-from-label.cjs.map +0 -7
  332. package/build/tabs-menu/edit.cjs.map +0 -7
  333. package/build/tabs-menu-item/block.json +0 -59
  334. package/build/tabs-menu-item/controls.cjs.map +0 -7
  335. package/build/tabs-menu-item/edit.cjs +0 -144
  336. package/build/tabs-menu-item/edit.cjs.map +0 -7
  337. package/build/tabs-menu-item/index.cjs.map +0 -7
  338. package/build/tabs-menu-item/save.cjs.map +0 -7
  339. package/build-module/tab/add-tab-toolbar-control.mjs.map +0 -7
  340. package/build-module/tab/remove-tab-toolbar-control.mjs.map +0 -7
  341. package/build-module/tab/slug-from-label.mjs +0 -16
  342. package/build-module/tab/slug-from-label.mjs.map +0 -7
  343. package/build-module/tabs-menu/edit.mjs.map +0 -7
  344. package/build-module/tabs-menu-item/block.json +0 -59
  345. package/build-module/tabs-menu-item/controls.mjs +0 -15
  346. package/build-module/tabs-menu-item/controls.mjs.map +0 -7
  347. package/build-module/tabs-menu-item/edit.mjs +0 -117
  348. package/build-module/tabs-menu-item/edit.mjs.map +0 -7
  349. package/build-module/tabs-menu-item/index.mjs.map +0 -7
  350. package/build-module/tabs-menu-item/save.mjs +0 -14
  351. package/build-module/tabs-menu-item/save.mjs.map +0 -7
  352. package/build-style/tabs-menu/editor-rtl.css +0 -6
  353. package/build-style/tabs-menu/editor.css +0 -6
  354. package/build-style/tabs-menu-item/editor-rtl.css +0 -11
  355. package/build-style/tabs-menu-item/editor.css +0 -11
  356. package/build-style/tabs-menu-item/style-rtl.css +0 -33
  357. package/build-style/tabs-menu-item/style.css +0 -33
  358. package/src/tab/slug-from-label.js +0 -26
  359. package/src/tabs-menu/index.php +0 -80
  360. package/src/tabs-menu-item/block.json +0 -59
  361. package/src/tabs-menu-item/controls.js +0 -19
  362. package/src/tabs-menu-item/edit.js +0 -150
  363. package/src/tabs-menu-item/index.php +0 -70
  364. package/src/tabs-menu-item/save.js +0 -13
  365. package/src/tabs-menu-item/style.scss +0 -40
  366. /package/src/{tabs-menu → tab-list}/save.js +0 -0
  367. /package/src/{tab → tab-panel}/init.js +0 -0
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
3
+ "__experimental": true,
4
+ "apiVersion": 3,
5
+ "name": "core/tab-panels",
6
+ "title": "Tab Panels",
7
+ "description": "Container for tab panel content in a tabbed interface.",
8
+ "category": "design",
9
+ "textdomain": "default",
10
+ "parent": [ "core/tabs" ],
11
+ "allowedBlocks": [ "core/tab-panel" ],
12
+ "attributes": {},
13
+ "supports": {
14
+ "anchor": false,
15
+ "html": false,
16
+ "reusable": false,
17
+ "visibility": false,
18
+ "lock": false,
19
+ "dimensions": {
20
+ "aspectRatio": false,
21
+ "height": false,
22
+ "minHeight": false,
23
+ "width": false
24
+ },
25
+ "color": {
26
+ "background": true,
27
+ "text": true,
28
+ "heading": true,
29
+ "link": true,
30
+ "__experimentalDefaultControls": {
31
+ "background": true,
32
+ "text": true
33
+ }
34
+ },
35
+ "spacing": {
36
+ "blockGap": false,
37
+ "padding": true,
38
+ "margin": true
39
+ },
40
+ "typography": {
41
+ "fontSize": true,
42
+ "__experimentalFontFamily": true
43
+ },
44
+ "layout": {
45
+ "default": {
46
+ "type": "flex",
47
+ "flexWrap": "nowrap",
48
+ "justifyContent": "stretch",
49
+ "orientation": "vertical"
50
+ },
51
+ "allowSwitching": false,
52
+ "allowVerticalAlignment": false,
53
+ "allowOrientation": false,
54
+ "allowJustification": true,
55
+ "allowSizingOnChildren": false
56
+ },
57
+ "__experimentalBorder": {
58
+ "radius": true,
59
+ "color": true,
60
+ "width": true,
61
+ "style": true
62
+ }
63
+ },
64
+ "editorScript": "file:./index.js",
65
+ "style": "file:./style-index.css"
66
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ useBlockProps,
6
+ useInnerBlocksProps,
7
+ store as blockEditorStore,
8
+ } from '@wordpress/block-editor';
9
+ import { useSelect } from '@wordpress/data';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import AddTabToolbarControl from '../tab-panel/add-tab-toolbar-control';
15
+ import RemoveTabToolbarControl from '../tab-panel/remove-tab-toolbar-control';
16
+
17
+ const TAB_PANELS_TEMPLATE = [ [ 'core/tab-panel', {} ] ];
18
+
19
+ export default function Edit( { clientId } ) {
20
+ const blockProps = useBlockProps();
21
+
22
+ const innerBlocksProps = useInnerBlocksProps( blockProps, {
23
+ template: TAB_PANELS_TEMPLATE,
24
+ templateLock: false,
25
+ renderAppender: false, // Appender handled by individual tab blocks
26
+ } );
27
+
28
+ // Get the parent tabs block clientId
29
+ const tabsClientId = useSelect(
30
+ ( select ) =>
31
+ select( blockEditorStore ).getBlockRootClientId( clientId ),
32
+ [ clientId ]
33
+ );
34
+
35
+ return (
36
+ <>
37
+ <AddTabToolbarControl tabsClientId={ tabsClientId } />
38
+ <RemoveTabToolbarControl tabsClientId={ tabsClientId } />
39
+ <div { ...innerBlocksProps } />
40
+ </>
41
+ );
42
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { tabsMenuItem as icon } from '@wordpress/icons';
4
+ import { contents as icon } from '@wordpress/icons';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -0,0 +1,11 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
5
+
6
+ export default function save() {
7
+ const blockProps = useBlockProps.save();
8
+ const innerBlocksProps = useInnerBlocksProps.save( blockProps );
9
+
10
+ return <div { ...innerBlocksProps } />;
11
+ }
@@ -0,0 +1,4 @@
1
+ .wp-block-tab-panels {
2
+ flex-grow: 1;
3
+ min-width: 0;
4
+ }
@@ -5,10 +5,9 @@
5
5
  "name": "core/tabs",
6
6
  "title": "Tabs",
7
7
  "description": "Display content in a tabbed interface to help users navigate detailed content with ease.",
8
- "version": "1.0.0",
9
8
  "category": "design",
10
9
  "textdomain": "default",
11
- "allowedBlocks": [ "core/tabs-menu", "core/tab-panel" ],
10
+ "allowedBlocks": [ "core/tab-list", "core/tab-panels" ],
12
11
  "attributes": {
13
12
  "activeTabIndex": {
14
13
  "type": "number",
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import AddTabToolbarControl from '../tab/add-tab-toolbar-control';
5
- import RemoveTabToolbarControl from '../tab/remove-tab-toolbar-control';
4
+ import AddTabToolbarControl from '../tab-panel/add-tab-toolbar-control';
5
+ import RemoveTabToolbarControl from '../tab-panel/remove-tab-toolbar-control';
6
6
 
7
7
  export default function Controls( { clientId } ) {
8
8
  return (
package/src/tabs/edit.js CHANGED
@@ -7,47 +7,40 @@ import {
7
7
  BlockContextProvider,
8
8
  store as blockEditorStore,
9
9
  } from '@wordpress/block-editor';
10
- import { useSelect, useDispatch } from '@wordpress/data';
11
- import { useMemo, useEffect, useRef } from '@wordpress/element';
10
+ import { useSelect } from '@wordpress/data';
11
+ import { useMemo, useEffect } from '@wordpress/element';
12
12
  import { __ } from '@wordpress/i18n';
13
13
 
14
14
  /**
15
15
  * Internal dependencies
16
16
  */
17
17
  import Controls from './controls';
18
+ import useTabListSync from './use-tab-list-sync';
18
19
 
19
20
  const EMPTY_ARRAY = [];
20
21
 
21
22
  const TABS_TEMPLATE = [
22
23
  [
23
- 'core/tabs-menu',
24
- {
25
- lock: {
26
- remove: true,
27
- },
28
- },
24
+ 'core/tab-list',
25
+ {},
29
26
  [
30
- [ 'core/tabs-menu-item', {} ],
31
- [ 'core/tabs-menu-item', {} ],
27
+ [ 'core/tab', {} ],
28
+ [ 'core/tab', {} ],
32
29
  ],
33
30
  ],
34
31
  [
35
- 'core/tab-panel',
36
- {
37
- lock: {
38
- remove: true,
39
- },
40
- },
32
+ 'core/tab-panels',
33
+ {},
41
34
  [
42
35
  [
43
- 'core/tab',
36
+ 'core/tab-panel',
44
37
  {
45
38
  label: __( 'Tab' ),
46
39
  },
47
40
  [ [ 'core/paragraph' ] ],
48
41
  ],
49
42
  [
50
- 'core/tab',
43
+ 'core/tab-panel',
51
44
  {
52
45
  label: __( 'Tab' ),
53
46
  },
@@ -57,12 +50,7 @@ const TABS_TEMPLATE = [
57
50
  ],
58
51
  ];
59
52
 
60
- function Edit( {
61
- clientId,
62
- attributes,
63
- setAttributes,
64
- __unstableLayoutClassNames: layoutClassNames,
65
- } ) {
53
+ function Edit( { clientId, attributes, setAttributes } ) {
66
54
  const { anchor, activeTabIndex, editorActiveTabIndex } = attributes;
67
55
 
68
56
  /**
@@ -75,132 +63,34 @@ function Edit( {
75
63
  }
76
64
  }, [] ); // eslint-disable-line react-hooks/exhaustive-deps
77
65
 
78
- const { removeBlock, replaceInnerBlocks } = useDispatch( blockEditorStore );
79
-
80
- const { tabs, tabPanelClientId, menuItems } = useSelect(
66
+ const { tabPanels, tabPanelsClientId, tabs, tabListClientId } = useSelect(
81
67
  ( select ) => {
82
68
  const { getBlocks } = select( blockEditorStore );
83
69
  const innerBlocks = getBlocks( clientId );
84
70
 
85
- const tabPanel = innerBlocks.find(
86
- ( block ) => block.name === 'core/tab-panel'
71
+ const tabPanelBlocks = innerBlocks.find(
72
+ ( block ) => block.name === 'core/tab-panels'
87
73
  );
88
- const tabsMenu = innerBlocks.find(
89
- ( block ) => block.name === 'core/tabs-menu'
74
+ const tabList = innerBlocks.find(
75
+ ( block ) => block.name === 'core/tab-list'
90
76
  );
91
77
 
92
78
  return {
93
- tabs: tabPanel?.innerBlocks ?? EMPTY_ARRAY,
94
- tabPanelClientId: tabPanel?.clientId ?? null,
95
- menuItems: tabsMenu?.innerBlocks ?? EMPTY_ARRAY,
79
+ tabPanels: tabPanelBlocks?.innerBlocks ?? EMPTY_ARRAY,
80
+ tabPanelsClientId: tabPanelBlocks?.clientId ?? null,
81
+ tabs: tabList?.innerBlocks ?? EMPTY_ARRAY,
82
+ tabListClientId: tabList?.clientId ?? null,
96
83
  };
97
84
  },
98
85
  [ clientId ]
99
86
  );
100
87
 
101
- /**
102
- * Keep tabs and menu items in sync when either is deleted directly (e.g.
103
- * via the Backspace key or List View).
104
- *
105
- * TODO: This effect only handles deletions. The two lists can get out of
106
- * sync in other cases: if a user pastes a core/tab block into the tab-panel
107
- * (or duplicates one), no corresponding tabs-menu-item is created; if a
108
- * user drags and drops a tabs-menu-item, the tab panel is not copied with
109
- * it. We should extend this effect to handle insertions, detecting when
110
- * tabs.length > menuItems.length and inserting the missing menu
111
- * item(s) at the correct index.
112
- */
113
- const prevSyncStateRef = useRef( null );
114
- useEffect( () => {
115
- const currentTabs = tabs.map( ( tab ) => ( {
116
- clientId: tab.clientId,
117
- } ) );
118
-
119
- if ( prevSyncStateRef.current === null ) {
120
- prevSyncStateRef.current = {
121
- tabs: currentTabs,
122
- menuItems: [ ...menuItems ],
123
- };
124
- return;
125
- }
126
-
127
- const { tabs: prevTabs, menuItems: prevMenuItems } =
128
- prevSyncStateRef.current;
129
-
130
- const tabsRemoved = currentTabs.length < prevTabs.length;
131
- const menuItemsRemoved = menuItems.length < prevMenuItems.length;
132
- const menuItemsReordered =
133
- ! tabsRemoved &&
134
- ! menuItemsRemoved &&
135
- menuItems.length === prevMenuItems.length &&
136
- menuItems.some(
137
- ( m, i ) => m.clientId !== prevMenuItems[ i ]?.clientId
138
- );
139
-
140
- // Update snapshot to the current state.
141
- // Snapshot is updated eagerly; post-removal mutations keep it consistent
142
- // so the next effect invocation sees a stable baseline.
143
- prevSyncStateRef.current = {
144
- tabs: currentTabs,
145
- menuItems: [ ...menuItems ],
146
- };
147
-
148
- // When menu items are reordered, move the corresponding tab content
149
- // blocks to match the new order.
150
- if ( menuItemsReordered && tabPanelClientId ) {
151
- const reorderedTabs = menuItems
152
- .map( ( menuItem ) => {
153
- const oldIndex = prevMenuItems.findIndex(
154
- ( pm ) => pm.clientId === menuItem.clientId
155
- );
156
- return oldIndex !== -1 ? tabs[ oldIndex ] : null;
157
- } )
158
- .filter( Boolean );
159
- if ( reorderedTabs.length === tabs.length ) {
160
- replaceInnerBlocks( tabPanelClientId, reorderedTabs, false );
161
- }
162
- return;
163
- }
164
-
165
- // Lists are in sync, nothing changed, or toolbar already removed both.
166
- if (
167
- ( ! tabsRemoved && ! menuItemsRemoved ) ||
168
- ( tabsRemoved && menuItemsRemoved )
169
- ) {
170
- return;
171
- }
172
-
173
- const currentTabIds = new Set( currentTabs.map( ( t ) => t.clientId ) );
174
- const currentMenuItemIds = new Set(
175
- menuItems.map( ( m ) => m.clientId )
176
- );
177
-
178
- if ( tabsRemoved ) {
179
- // Remove the menu item at the same position.
180
- const removedIndex = prevTabs.findIndex(
181
- ( t ) => ! currentTabIds.has( t.clientId )
182
- );
183
- if ( removedIndex >= 0 && menuItems[ removedIndex ] ) {
184
- removeBlock( menuItems[ removedIndex ].clientId, false );
185
- prevSyncStateRef.current.menuItems =
186
- prevSyncStateRef.current.menuItems.filter(
187
- ( _, i ) => i !== removedIndex
188
- );
189
- }
190
- } else {
191
- // Remove the tab at the same position.
192
- const removedIndex = prevMenuItems.findIndex(
193
- ( m ) => ! currentMenuItemIds.has( m.clientId )
194
- );
195
- if ( removedIndex >= 0 && tabs[ removedIndex ] ) {
196
- removeBlock( tabs[ removedIndex ].clientId, false );
197
- prevSyncStateRef.current.tabs =
198
- prevSyncStateRef.current.tabs.filter(
199
- ( _, i ) => i !== removedIndex
200
- );
201
- }
202
- }
203
- }, [ tabs, tabPanelClientId, menuItems, removeBlock, replaceInnerBlocks ] );
88
+ useTabListSync( {
89
+ tabPanels,
90
+ tabs,
91
+ tabPanelsClientId,
92
+ tabListClientId,
93
+ } );
204
94
 
205
95
  /**
206
96
  * Memoize context value to prevent unnecessary re-renders.
@@ -209,9 +99,9 @@ function Edit( {
209
99
  /**
210
100
  * Compute tabs list from innerblocks to provide via context.
211
101
  * This traverses the tab-panel block to find all tab blocks
212
- * and extracts their label and anchor for the tabs-menu to consume.
102
+ * and extracts their label and anchor for the tab-list to consume.
213
103
  */
214
- const tabList = tabs.map( ( tab, index ) => ( {
104
+ const tabList = tabPanels.map( ( tab, index ) => ( {
215
105
  id: tab.attributes.anchor || `tab-${ index }`,
216
106
  label: tab.attributes.label || '',
217
107
  clientId: tab.clientId,
@@ -224,22 +114,14 @@ function Edit( {
224
114
  'core/tabs-activeTabIndex': activeTabIndex,
225
115
  'core/tabs-editorActiveTabIndex': editorActiveTabIndex,
226
116
  };
227
- }, [ tabs, anchor, activeTabIndex, editorActiveTabIndex ] );
117
+ }, [ tabPanels, anchor, activeTabIndex, editorActiveTabIndex ] );
228
118
 
229
- /**
230
- * Block props for the tabs container.
231
- */
232
- const blockProps = useBlockProps( {
233
- className: layoutClassNames,
234
- } );
119
+ const blockProps = useBlockProps();
235
120
 
236
- /**
237
- * Innerblocks props for the tabs container.
238
- */
239
121
  const innerBlockProps = useInnerBlocksProps( blockProps, {
240
122
  __experimentalCaptureToolbars: true,
241
123
  template: TABS_TEMPLATE,
242
- templateLock: false,
124
+ templateLock: 'all',
243
125
  renderAppender: false,
244
126
  } );
245
127
 
package/src/tabs/index.js CHANGED
@@ -21,22 +21,22 @@ export const settings = {
21
21
  example: {
22
22
  innerBlocks: [
23
23
  {
24
- name: 'core/tabs-menu',
24
+ name: 'core/tab-list',
25
25
  innerBlocks: [
26
26
  {
27
- name: 'core/tabs-menu-item',
27
+ name: 'core/tab',
28
28
  attributes: { anchor: 'tab-1-button' },
29
29
  },
30
30
  {
31
- name: 'core/tabs-menu-item',
31
+ name: 'core/tab',
32
32
  attributes: { anchor: 'tab-2-button' },
33
33
  },
34
34
  ],
35
35
  },
36
36
  {
37
- name: 'core/tab-panel',
37
+ name: 'core/tab-panels',
38
38
  innerBlocks: [ 1, 2 ].map( ( index ) => ( {
39
- name: 'core/tab',
39
+ name: 'core/tab-panel',
40
40
  attributes: {
41
41
  anchor: `tab-${ index }`,
42
42
  label: sprintf(
@@ -20,10 +20,10 @@ function block_core_tabs_generate_tabs_list( array $innerblocks = array(), strin
20
20
 
21
21
  // Find tab-panel block
22
22
  foreach ( $innerblocks as $inner_block ) {
23
- if ( 'core/tab-panel' === ( $inner_block['blockName'] ?? '' ) ) {
23
+ if ( 'core/tab-panels' === ( $inner_block['blockName'] ?? '' ) ) {
24
24
  $tab_index = 0;
25
25
  foreach ( $inner_block['innerBlocks'] ?? array() as $tab_block ) {
26
- if ( 'core/tab' === ( $tab_block['blockName'] ?? '' ) ) {
26
+ if ( 'core/tab-panel' === ( $tab_block['blockName'] ?? '' ) ) {
27
27
  $attrs = $tab_block['attrs'] ?? array();
28
28
  $tab_label = $attrs['label'] ?? '';
29
29
 
@@ -49,7 +49,7 @@ function block_core_tabs_generate_tabs_list( array $innerblocks = array(), strin
49
49
  }
50
50
 
51
51
  /**
52
- * Filter to provide tabs list context to core/tabs and core/tabs-menu blocks.
52
+ * Filter to provide tabs list context to core/tabs and core/tab-list blocks.
53
53
  * It is more performant to do this here, once, rather than in the tabs render and tabs context filters.
54
54
  * In this way core/tabs is both a provider and a consumer of the core/tabs-list context.
55
55
  *
@@ -103,9 +103,9 @@ function block_core_tabs_render_block_callback( array $attributes, string $conte
103
103
  $tag_processor->next_tag( array( 'class_name' => 'wp-block-tabs' ) );
104
104
  $tag_processor->set_attribute( 'data-wp-interactive', 'core/tabs/private' );
105
105
 
106
- // Inspect inside the tabs-menu to see if its vertical or not.
106
+ // Inspect inside the tab-list to see if its vertical or not.
107
107
  $tag_processor->set_bookmark( 'core/tabs_wrapper' );
108
- while ( $tag_processor->next_tag( array( 'class_name' => 'wp-block-tabs-menu' ) ) ) {
108
+ while ( $tag_processor->next_tag( array( 'class_name' => 'wp-block-tabs-list' ) ) ) {
109
109
  if ( $tag_processor->has_class( 'is-vertical' ) ) {
110
110
  $is_vertical = true;
111
111
  break;
@@ -1,6 +1,3 @@
1
1
  .wp-block-tabs {
2
2
  box-sizing: border-box;
3
- .wp-block-tabs__title {
4
- display: none;
5
- }
6
3
  }