@wordpress/block-library 8.3.4 → 8.3.6

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 (317) hide show
  1. package/build/archives/index.js +0 -1
  2. package/build/archives/index.js.map +1 -1
  3. package/build/avatar/index.js +0 -1
  4. package/build/avatar/index.js.map +1 -1
  5. package/build/calendar/index.js +0 -1
  6. package/build/calendar/index.js.map +1 -1
  7. package/build/categories/index.js +0 -1
  8. package/build/categories/index.js.map +1 -1
  9. package/build/comment-author-avatar/index.js +0 -1
  10. package/build/comment-author-avatar/index.js.map +1 -1
  11. package/build/comment-author-name/index.js +0 -1
  12. package/build/comment-author-name/index.js.map +1 -1
  13. package/build/comment-content/index.js +0 -1
  14. package/build/comment-content/index.js.map +1 -1
  15. package/build/comment-date/index.js +0 -1
  16. package/build/comment-date/index.js.map +1 -1
  17. package/build/comment-edit-link/index.js +0 -1
  18. package/build/comment-edit-link/index.js.map +1 -1
  19. package/build/comment-reply-link/index.js +0 -1
  20. package/build/comment-reply-link/index.js.map +1 -1
  21. package/build/comment-template/index.js +0 -1
  22. package/build/comment-template/index.js.map +1 -1
  23. package/build/comments/index.js +1 -2
  24. package/build/comments/index.js.map +1 -1
  25. package/build/comments-pagination/index.js +0 -1
  26. package/build/comments-pagination/index.js.map +1 -1
  27. package/build/comments-pagination-next/index.js +0 -1
  28. package/build/comments-pagination-next/index.js.map +1 -1
  29. package/build/comments-pagination-numbers/index.js +0 -1
  30. package/build/comments-pagination-numbers/index.js.map +1 -1
  31. package/build/comments-pagination-previous/index.js +0 -1
  32. package/build/comments-pagination-previous/index.js.map +1 -1
  33. package/build/home-link/index.js +0 -1
  34. package/build/home-link/index.js.map +1 -1
  35. package/build/latest-comments/index.js +0 -1
  36. package/build/latest-comments/index.js.map +1 -1
  37. package/build/latest-posts/deprecated.js +0 -1
  38. package/build/latest-posts/deprecated.js.map +1 -1
  39. package/build/latest-posts/index.js +0 -1
  40. package/build/latest-posts/index.js.map +1 -1
  41. package/build/loginout/index.js +0 -1
  42. package/build/loginout/index.js.map +1 -1
  43. package/build/navigation/edit/menu-inspector-controls.js +3 -4
  44. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  45. package/build/navigation/index.js +0 -1
  46. package/build/navigation/index.js.map +1 -1
  47. package/build/navigation-link/edit.js +9 -10
  48. package/build/navigation-link/edit.js.map +1 -1
  49. package/build/navigation-submenu/edit.js +4 -0
  50. package/build/navigation-submenu/edit.js.map +1 -1
  51. package/build/page-list/index.js +0 -1
  52. package/build/page-list/index.js.map +1 -1
  53. package/build/post-author/index.js +0 -1
  54. package/build/post-author/index.js.map +1 -1
  55. package/build/post-author-biography/index.js +0 -1
  56. package/build/post-author-biography/index.js.map +1 -1
  57. package/build/post-author-name/index.js +0 -1
  58. package/build/post-author-name/index.js.map +1 -1
  59. package/build/post-comments-count/index.js +0 -1
  60. package/build/post-comments-count/index.js.map +1 -1
  61. package/build/post-comments-form/index.js +0 -1
  62. package/build/post-comments-form/index.js.map +1 -1
  63. package/build/post-comments-link/index.js +0 -1
  64. package/build/post-comments-link/index.js.map +1 -1
  65. package/build/post-content/index.js +0 -1
  66. package/build/post-content/index.js.map +1 -1
  67. package/build/post-date/index.js +0 -1
  68. package/build/post-date/index.js.map +1 -1
  69. package/build/post-excerpt/index.js +0 -1
  70. package/build/post-excerpt/index.js.map +1 -1
  71. package/build/post-featured-image/index.js +0 -1
  72. package/build/post-featured-image/index.js.map +1 -1
  73. package/build/post-navigation-link/index.js +0 -1
  74. package/build/post-navigation-link/index.js.map +1 -1
  75. package/build/post-template/index.js +0 -1
  76. package/build/post-template/index.js.map +1 -1
  77. package/build/post-terms/index.js +0 -1
  78. package/build/post-terms/index.js.map +1 -1
  79. package/build/post-title/index.js +0 -1
  80. package/build/post-title/index.js.map +1 -1
  81. package/build/query/index.js +0 -1
  82. package/build/query/index.js.map +1 -1
  83. package/build/query/utils.js +0 -1
  84. package/build/query/utils.js.map +1 -1
  85. package/build/query-no-results/index.js +0 -1
  86. package/build/query-no-results/index.js.map +1 -1
  87. package/build/query-pagination/index.js +0 -1
  88. package/build/query-pagination/index.js.map +1 -1
  89. package/build/query-pagination-next/index.js +0 -1
  90. package/build/query-pagination-next/index.js.map +1 -1
  91. package/build/query-pagination-numbers/index.js +0 -1
  92. package/build/query-pagination-numbers/index.js.map +1 -1
  93. package/build/query-pagination-previous/index.js +0 -1
  94. package/build/query-pagination-previous/index.js.map +1 -1
  95. package/build/query-title/index.js +0 -1
  96. package/build/query-title/index.js.map +1 -1
  97. package/build/read-more/index.js +0 -1
  98. package/build/read-more/index.js.map +1 -1
  99. package/build/rss/index.js +0 -1
  100. package/build/rss/index.js.map +1 -1
  101. package/build/search/index.js +0 -1
  102. package/build/search/index.js.map +1 -1
  103. package/build/site-logo/index.js +0 -1
  104. package/build/site-logo/index.js.map +1 -1
  105. package/build/site-tagline/index.js +1 -1
  106. package/build/site-title/index.js +0 -1
  107. package/build/site-title/index.js.map +1 -1
  108. package/build/social-link/index.js +0 -1
  109. package/build/social-link/index.js.map +1 -1
  110. package/build/social-links/edit.js +2 -1
  111. package/build/social-links/edit.js.map +1 -1
  112. package/build/tag-cloud/index.js +0 -1
  113. package/build/tag-cloud/index.js.map +1 -1
  114. package/build/template-part/edit/import-controls.js +29 -6
  115. package/build/template-part/edit/import-controls.js.map +1 -1
  116. package/build/template-part/index.js +0 -1
  117. package/build/template-part/index.js.map +1 -1
  118. package/build/term-description/index.js +0 -1
  119. package/build/term-description/index.js.map +1 -1
  120. package/build-module/archives/index.js +0 -1
  121. package/build-module/archives/index.js.map +1 -1
  122. package/build-module/avatar/index.js +0 -1
  123. package/build-module/avatar/index.js.map +1 -1
  124. package/build-module/calendar/index.js +0 -1
  125. package/build-module/calendar/index.js.map +1 -1
  126. package/build-module/categories/index.js +0 -1
  127. package/build-module/categories/index.js.map +1 -1
  128. package/build-module/comment-author-avatar/index.js +0 -1
  129. package/build-module/comment-author-avatar/index.js.map +1 -1
  130. package/build-module/comment-author-name/index.js +0 -1
  131. package/build-module/comment-author-name/index.js.map +1 -1
  132. package/build-module/comment-content/index.js +0 -1
  133. package/build-module/comment-content/index.js.map +1 -1
  134. package/build-module/comment-date/index.js +0 -1
  135. package/build-module/comment-date/index.js.map +1 -1
  136. package/build-module/comment-edit-link/index.js +0 -1
  137. package/build-module/comment-edit-link/index.js.map +1 -1
  138. package/build-module/comment-reply-link/index.js +0 -1
  139. package/build-module/comment-reply-link/index.js.map +1 -1
  140. package/build-module/comment-template/index.js +0 -1
  141. package/build-module/comment-template/index.js.map +1 -1
  142. package/build-module/comments/index.js +1 -2
  143. package/build-module/comments/index.js.map +1 -1
  144. package/build-module/comments-pagination/index.js +0 -1
  145. package/build-module/comments-pagination/index.js.map +1 -1
  146. package/build-module/comments-pagination-next/index.js +0 -1
  147. package/build-module/comments-pagination-next/index.js.map +1 -1
  148. package/build-module/comments-pagination-numbers/index.js +0 -1
  149. package/build-module/comments-pagination-numbers/index.js.map +1 -1
  150. package/build-module/comments-pagination-previous/index.js +0 -1
  151. package/build-module/comments-pagination-previous/index.js.map +1 -1
  152. package/build-module/home-link/index.js +0 -1
  153. package/build-module/home-link/index.js.map +1 -1
  154. package/build-module/latest-comments/index.js +0 -1
  155. package/build-module/latest-comments/index.js.map +1 -1
  156. package/build-module/latest-posts/deprecated.js +0 -1
  157. package/build-module/latest-posts/deprecated.js.map +1 -1
  158. package/build-module/latest-posts/index.js +0 -1
  159. package/build-module/latest-posts/index.js.map +1 -1
  160. package/build-module/loginout/index.js +0 -1
  161. package/build-module/loginout/index.js.map +1 -1
  162. package/build-module/navigation/edit/menu-inspector-controls.js +2 -2
  163. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  164. package/build-module/navigation/index.js +0 -1
  165. package/build-module/navigation/index.js.map +1 -1
  166. package/build-module/navigation-link/edit.js +9 -10
  167. package/build-module/navigation-link/edit.js.map +1 -1
  168. package/build-module/navigation-submenu/edit.js +4 -0
  169. package/build-module/navigation-submenu/edit.js.map +1 -1
  170. package/build-module/page-list/index.js +0 -1
  171. package/build-module/page-list/index.js.map +1 -1
  172. package/build-module/post-author/index.js +0 -1
  173. package/build-module/post-author/index.js.map +1 -1
  174. package/build-module/post-author-biography/index.js +0 -1
  175. package/build-module/post-author-biography/index.js.map +1 -1
  176. package/build-module/post-author-name/index.js +0 -1
  177. package/build-module/post-author-name/index.js.map +1 -1
  178. package/build-module/post-comments-count/index.js +0 -1
  179. package/build-module/post-comments-count/index.js.map +1 -1
  180. package/build-module/post-comments-form/index.js +0 -1
  181. package/build-module/post-comments-form/index.js.map +1 -1
  182. package/build-module/post-comments-link/index.js +0 -1
  183. package/build-module/post-comments-link/index.js.map +1 -1
  184. package/build-module/post-content/index.js +0 -1
  185. package/build-module/post-content/index.js.map +1 -1
  186. package/build-module/post-date/index.js +0 -1
  187. package/build-module/post-date/index.js.map +1 -1
  188. package/build-module/post-excerpt/index.js +0 -1
  189. package/build-module/post-excerpt/index.js.map +1 -1
  190. package/build-module/post-featured-image/index.js +0 -1
  191. package/build-module/post-featured-image/index.js.map +1 -1
  192. package/build-module/post-navigation-link/index.js +0 -1
  193. package/build-module/post-navigation-link/index.js.map +1 -1
  194. package/build-module/post-template/index.js +0 -1
  195. package/build-module/post-template/index.js.map +1 -1
  196. package/build-module/post-terms/index.js +0 -1
  197. package/build-module/post-terms/index.js.map +1 -1
  198. package/build-module/post-title/index.js +0 -1
  199. package/build-module/post-title/index.js.map +1 -1
  200. package/build-module/query/index.js +0 -1
  201. package/build-module/query/index.js.map +1 -1
  202. package/build-module/query/utils.js +0 -1
  203. package/build-module/query/utils.js.map +1 -1
  204. package/build-module/query-no-results/index.js +0 -1
  205. package/build-module/query-no-results/index.js.map +1 -1
  206. package/build-module/query-pagination/index.js +0 -1
  207. package/build-module/query-pagination/index.js.map +1 -1
  208. package/build-module/query-pagination-next/index.js +0 -1
  209. package/build-module/query-pagination-next/index.js.map +1 -1
  210. package/build-module/query-pagination-numbers/index.js +0 -1
  211. package/build-module/query-pagination-numbers/index.js.map +1 -1
  212. package/build-module/query-pagination-previous/index.js +0 -1
  213. package/build-module/query-pagination-previous/index.js.map +1 -1
  214. package/build-module/query-title/index.js +0 -1
  215. package/build-module/query-title/index.js.map +1 -1
  216. package/build-module/read-more/index.js +0 -1
  217. package/build-module/read-more/index.js.map +1 -1
  218. package/build-module/rss/index.js +0 -1
  219. package/build-module/rss/index.js.map +1 -1
  220. package/build-module/search/index.js +0 -1
  221. package/build-module/search/index.js.map +1 -1
  222. package/build-module/site-logo/index.js +0 -1
  223. package/build-module/site-logo/index.js.map +1 -1
  224. package/build-module/site-tagline/index.js +1 -1
  225. package/build-module/site-title/index.js +0 -1
  226. package/build-module/site-title/index.js.map +1 -1
  227. package/build-module/social-link/index.js +0 -1
  228. package/build-module/social-link/index.js.map +1 -1
  229. package/build-module/social-links/edit.js +2 -1
  230. package/build-module/social-links/edit.js.map +1 -1
  231. package/build-module/tag-cloud/index.js +0 -1
  232. package/build-module/tag-cloud/index.js.map +1 -1
  233. package/build-module/template-part/edit/import-controls.js +28 -6
  234. package/build-module/template-part/edit/import-controls.js.map +1 -1
  235. package/build-module/template-part/index.js +0 -1
  236. package/build-module/template-part/index.js.map +1 -1
  237. package/build-module/term-description/index.js +0 -1
  238. package/build-module/term-description/index.js.map +1 -1
  239. package/build-style/editor-rtl.css +3 -2
  240. package/build-style/editor.css +3 -2
  241. package/build-style/query/editor-rtl.css +1 -0
  242. package/build-style/query/editor.css +1 -0
  243. package/build-style/quote/style-rtl.css +5 -5
  244. package/build-style/quote/style.css +5 -5
  245. package/build-style/site-logo/editor-rtl.css +2 -2
  246. package/build-style/site-logo/editor.css +2 -2
  247. package/build-style/style-rtl.css +5 -5
  248. package/build-style/style.css +5 -5
  249. package/package.json +16 -16
  250. package/src/archives/block.json +0 -1
  251. package/src/avatar/block.json +0 -1
  252. package/src/calendar/block.json +0 -1
  253. package/src/categories/block.json +0 -1
  254. package/src/comment-author-avatar/block.json +0 -1
  255. package/src/comment-author-name/block.json +0 -1
  256. package/src/comment-content/block.json +0 -1
  257. package/src/comment-date/block.json +0 -1
  258. package/src/comment-edit-link/block.json +0 -1
  259. package/src/comment-reply-link/block.json +0 -1
  260. package/src/comment-template/block.json +0 -1
  261. package/src/comments/block.json +1 -2
  262. package/src/comments-pagination/block.json +0 -1
  263. package/src/comments-pagination-next/block.json +0 -1
  264. package/src/comments-pagination-numbers/block.json +0 -1
  265. package/src/comments-pagination-previous/block.json +0 -1
  266. package/src/home-link/block.json +0 -1
  267. package/src/latest-comments/block.json +0 -1
  268. package/src/latest-posts/block.json +0 -1
  269. package/src/loginout/block.json +0 -1
  270. package/src/navigation/block.json +0 -1
  271. package/src/navigation/edit/menu-inspector-controls.js +1 -3
  272. package/src/navigation-link/edit.js +8 -10
  273. package/src/navigation-submenu/edit.js +3 -0
  274. package/src/page-list/block.json +0 -1
  275. package/src/post-author/block.json +0 -1
  276. package/src/post-author-biography/block.json +0 -1
  277. package/src/post-author-name/block.json +0 -1
  278. package/src/post-comments-count/block.json +0 -1
  279. package/src/post-comments-form/block.json +0 -1
  280. package/src/post-comments-link/block.json +0 -1
  281. package/src/post-content/block.json +0 -1
  282. package/src/post-date/block.json +0 -1
  283. package/src/post-excerpt/block.json +0 -1
  284. package/src/post-featured-image/block.json +0 -1
  285. package/src/post-navigation-link/block.json +0 -1
  286. package/src/post-template/block.json +0 -1
  287. package/src/post-terms/block.json +0 -1
  288. package/src/post-title/block.json +0 -1
  289. package/src/query/block.json +0 -1
  290. package/src/query/editor.scss +1 -0
  291. package/src/query-no-results/block.json +0 -1
  292. package/src/query-pagination/block.json +0 -1
  293. package/src/query-pagination-next/block.json +0 -1
  294. package/src/query-pagination-numbers/block.json +0 -1
  295. package/src/query-pagination-previous/block.json +0 -1
  296. package/src/query-title/block.json +0 -1
  297. package/src/quote/style.scss +2 -2
  298. package/src/read-more/block.json +0 -1
  299. package/src/rss/block.json +0 -1
  300. package/src/search/block.json +0 -1
  301. package/src/site-logo/block.json +0 -1
  302. package/src/site-logo/editor.scss +3 -3
  303. package/src/site-tagline/block.json +1 -1
  304. package/src/site-title/block.json +0 -1
  305. package/src/social-link/block.json +0 -1
  306. package/src/social-links/edit.js +1 -0
  307. package/src/tag-cloud/block.json +0 -1
  308. package/src/template-part/block.json +0 -1
  309. package/src/template-part/edit/import-controls.js +24 -5
  310. package/src/template-part/index.php +1 -1
  311. package/src/term-description/block.json +0 -1
  312. package/tsconfig.tsbuildinfo +1 -1
  313. package/build/navigation/leaf-more-menu.js +0 -95
  314. package/build/navigation/leaf-more-menu.js.map +0 -1
  315. package/build-module/navigation/leaf-more-menu.js +0 -76
  316. package/build-module/navigation/leaf-more-menu.js.map +0 -1
  317. package/src/navigation/leaf-more-menu.js +0 -93
@@ -16,6 +16,10 @@ import { store as noticesStore } from '@wordpress/notices';
16
16
 
17
17
  import { useCreateTemplatePartFromBlocks } from './utils/hooks';
18
18
  import { transformWidgetToBlock } from './utils/transformers';
19
+ const SIDEBARS_QUERY = {
20
+ per_page: -1,
21
+ _fields: 'id,name,description,status,widgets'
22
+ };
19
23
  export function TemplatePartImportControls(_ref) {
20
24
  let {
21
25
  area,
@@ -24,11 +28,18 @@ export function TemplatePartImportControls(_ref) {
24
28
  const [selectedSidebar, setSelectedSidebar] = useState('');
25
29
  const [isBusy, setIsBusy] = useState(false);
26
30
  const registry = useRegistry();
27
- const sidebars = useSelect(select => {
28
- return select(coreStore).getSidebars({
29
- per_page: -1,
30
- _fields: 'id,name,description,status,widgets'
31
- });
31
+ const {
32
+ sidebars,
33
+ hasResolved
34
+ } = useSelect(select => {
35
+ const {
36
+ getSidebars,
37
+ hasFinishedResolution
38
+ } = select(coreStore);
39
+ return {
40
+ sidebars: getSidebars(SIDEBARS_QUERY),
41
+ hasResolved: hasFinishedResolution('getSidebars', [SIDEBARS_QUERY])
42
+ };
32
43
  }, []);
33
44
  const {
34
45
  createErrorNotice
@@ -50,7 +61,18 @@ export function TemplatePartImportControls(_ref) {
50
61
  value: '',
51
62
  label: __('Select widget area')
52
63
  }, ...sidebarOptions];
53
- }, [sidebars]);
64
+ }, [sidebars]); // Render an empty node while data is loading to avoid SlotFill re-positioning bug.
65
+ // See: https://github.com/WordPress/gutenberg/issues/15641.
66
+
67
+ if (!hasResolved) {
68
+ return createElement(Spacer, {
69
+ marginBottom: "0"
70
+ });
71
+ }
72
+
73
+ if (hasResolved && !options.length) {
74
+ return null;
75
+ }
54
76
 
55
77
  async function createFromWidgets(event) {
56
78
  event.preventDefault();
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/import-controls.js"],"names":["__","sprintf","useMemo","useState","useDispatch","useSelect","useRegistry","Button","FlexBlock","FlexItem","SelectControl","__experimentalHStack","HStack","__experimentalSpacer","Spacer","switchToBlockType","getPossibleBlockTransformations","store","coreStore","noticesStore","useCreateTemplatePartFromBlocks","transformWidgetToBlock","TemplatePartImportControls","area","setAttributes","selectedSidebar","setSelectedSidebar","isBusy","setIsBusy","registry","sidebars","select","getSidebars","per_page","_fields","createErrorNotice","createFromBlocks","options","sidebarOptions","filter","widgetArea","id","widgets","length","map","value","label","name","createFromWidgets","event","preventDefault","sidebar","find","getWidgets","resolveSelect","_embed","skippedWidgets","Set","blocks","flatMap","widget","block","transforms","item","hasWildCardFrom","from","includes","hasWildCardTo","to","add","id_base","size","Array","join","type","marginBottom","marginTop"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,OAAT,EAAkBC,QAAlB,QAAkC,oBAAlC;AACA,SAASC,WAAT,EAAsBC,SAAtB,EAAiCC,WAAjC,QAAoD,iBAApD;AACA,SACCC,MADD,EAECC,SAFD,EAGCC,QAHD,EAICC,aAJD,EAKCC,oBAAoB,IAAIC,MALzB,EAMCC,oBAAoB,IAAIC,MANzB,QAOO,uBAPP;AAQA,SACCC,iBADD,EAECC,+BAFD,QAGO,mBAHP;AAIA,SAASC,KAAK,IAAIC,S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,IAAA,YAAY,EAAC;AAArB,KACC,cAAC,MAAD;AAAQ,IAAA,EAAE,EAAC,MAAX;AAAkB,IAAA,QAAQ,EAAGoB;AAA7B,KACC,cAAC,SAAD,QACC,cAAC,aAAD;AACC,IAAA,KAAK,EAAGhD,EAAE,CAAE,oBAAF,CADX;AAEC,IAAA,KAAK,EAAGyB,eAFT;AAGC,IAAA,OAAO,EAAGY,OAHX;AAIC,IAAA,QAAQ,EAAKQ,KAAF,IAAanB,kBAAkB,CAAEmB,KAAF,CAJ3C;AAKC,IAAA,QAAQ,EAAG,CAAER,OAAO,CAACM,MALtB;AAMC,IAAA,qBAAqB,MANtB;AAOC,IAAA,uBAAuB;AAPxB,IADD,CADD,EAYC,cAAC,QAAD;AACC,IAAA,KAAK,EAAG;AACPgC,MAAAA,YAAY,EAAE,KADP;AAEPC,MAAAA,SAAS,EAAE;AAFJ;AADT,KAMC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,MAAM,EAAGjD,MAHV;AAIC,qBAAgBA,MAAM,IAAI,CAAEF;AAJ7B,KAMGzB,EAAE,CAAE,QAAF,CANL,CAND,CAZD,CADD,CADD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport {\n\tButton,\n\tFlexBlock,\n\tFlexItem,\n\tSelectControl,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport {\n\tswitchToBlockType,\n\tgetPossibleBlockTransformations,\n} from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { useCreateTemplatePartFromBlocks } from './utils/hooks';\nimport { transformWidgetToBlock } from './utils/transformers';\n\nexport function TemplatePartImportControls( { area, setAttributes } ) {\n\tconst [ selectedSidebar, setSelectedSidebar ] = useState( '' );\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\n\tconst registry = useRegistry();\n\tconst sidebars = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getSidebars( {\n\t\t\tper_page: -1,\n\t\t\t_fields: 'id,name,description,status,widgets',\n\t\t} );\n\t}, [] );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst createFromBlocks = useCreateTemplatePartFromBlocks(\n\t\tarea,\n\t\tsetAttributes\n\t);\n\n\tconst options = useMemo( () => {\n\t\tconst sidebarOptions = ( sidebars ?? [] )\n\t\t\t.filter(\n\t\t\t\t( widgetArea ) =>\n\t\t\t\t\twidgetArea.id !== 'wp_inactive_widgets' &&\n\t\t\t\t\twidgetArea.widgets.length > 0\n\t\t\t)\n\t\t\t.map( ( widgetArea ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: widgetArea.id,\n\t\t\t\t\tlabel: widgetArea.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\tif ( ! sidebarOptions.length ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{ value: '', label: __( 'Select widget area' ) },\n\t\t\t...sidebarOptions,\n\t\t];\n\t}, [ sidebars ] );\n\n\tasync function createFromWidgets( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isBusy || ! selectedSidebar ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsBusy( true );\n\n\t\tconst sidebar = options.find(\n\t\t\t( { value } ) => value === selectedSidebar\n\t\t);\n\t\tconst { getWidgets } = registry.resolveSelect( coreStore );\n\n\t\t// The widgets API always returns a successful response.\n\t\tconst widgets = await getWidgets( {\n\t\t\tsidebar: sidebar.value,\n\t\t\t_embed: 'about',\n\t\t} );\n\n\t\tconst skippedWidgets = new Set();\n\t\tconst blocks = widgets.flatMap( ( widget ) => {\n\t\t\tconst block = transformWidgetToBlock( widget );\n\n\t\t\tif ( block.name !== 'core/legacy-widget' ) {\n\t\t\t\treturn block;\n\t\t\t}\n\n\t\t\tconst transforms = getPossibleBlockTransformations( [\n\t\t\t\tblock,\n\t\t\t] ).filter( ( item ) => {\n\t\t\t\t// The block without any transformations can't be a wildcard.\n\t\t\t\tif ( ! item.transforms ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tconst hasWildCardFrom = item.transforms?.from?.find(\n\t\t\t\t\t( from ) => from.blocks && from.blocks.includes( '*' )\n\t\t\t\t);\n\t\t\t\tconst hasWildCardTo = item.transforms?.to?.find(\n\t\t\t\t\t( to ) => to.blocks && to.blocks.includes( '*' )\n\t\t\t\t);\n\n\t\t\t\treturn ! hasWildCardFrom && ! hasWildCardTo;\n\t\t\t} );\n\n\t\t\t// Skip the block if we have no matching transformations.\n\t\t\tif ( ! transforms.length ) {\n\t\t\t\tskippedWidgets.add( widget.id_base );\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\t// Try transforming the Legacy Widget into a first matching block.\n\t\t\treturn switchToBlockType( block, transforms[ 0 ].name );\n\t\t} );\n\n\t\tawait createFromBlocks(\n\t\t\tblocks,\n\t\t\t/* translators: %s: name of the widget area */\n\t\t\tsprintf( __( 'Widget area: %s' ), sidebar.label )\n\t\t);\n\n\t\tif ( skippedWidgets.size ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: the list of widgets */\n\t\t\t\t\t__( 'Unable to import the following widgets: %s.' ),\n\t\t\t\t\tArray.from( skippedWidgets ).join( ', ' )\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tsetIsBusy( false );\n\t}\n\n\treturn (\n\t\t<Spacer marginBottom=\"4\">\n\t\t\t<HStack as=\"form\" onSubmit={ createFromWidgets }>\n\t\t\t\t<FlexBlock>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Import widget area' ) }\n\t\t\t\t\t\tvalue={ selectedSidebar }\n\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\tonChange={ ( value ) => setSelectedSidebar( value ) }\n\t\t\t\t\t\tdisabled={ ! options.length }\n\t\t\t\t\t\t__next36pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t/>\n\t\t\t\t</FlexBlock>\n\t\t\t\t<FlexItem\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tmarginBottom: '8px',\n\t\t\t\t\t\tmarginTop: 'auto',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\taria-disabled={ isBusy || ! selectedSidebar }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Import' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\t\t</Spacer>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/template-part/edit/import-controls.js"],"names":["__","sprintf","useMemo","useState","useDispatch","useSelect","useRegistry","Button","FlexBlock","FlexItem","SelectControl","__experimentalHStack","HStack","__experimentalSpacer","Spacer","switchToBlockType","getPossibleBlockTransformations","store","coreStore","noticesStore","useCreateTemplatePartFromBlocks","transformWidgetToBlock","SIDEBARS_QUERY","per_page","_fields","TemplatePartImportControls","area","setAttributes","selectedSidebar","setSelectedSidebar","isBusy","setIsBusy","registry","sidebars","hasResolved","select","getSidebars","hasFinishedResolution","createErrorNotice","createFromBlocks","options","sidebarOptions","filter","widgetArea","id","widgets","length","map","value","label","name","createFromWidgets","event","preventDefault","sidebar","find","getWidgets","resolveSelect","_embed","skippedWidgets","Set","blocks","flatMap","widget","block","transforms","item","hasWildCardFrom","from","includes","hasWildCardTo","to","add","id_base","size","Array","join","type","marginBottom","marginTop"],"mappings":";;AAAA;AACA;AACA;AACA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,QAAD;AACC,IAAA,KAAK,EAAG;AACPgC,MAAAA,YAAY,EAAE,KADP;AAEPC,MAAAA,SAAS,EAAE;AAFJ;AADT,KAMC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,MAAM,EAAGjD,MAHV;AAIC,qBAAgBA,MAAM,IAAI,CAAEF;AAJ7B,KAMG5B,EAAE,CAAE,QAAF,CANL,CAND,CAZD,CADD,CADD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport {\n\tButton,\n\tFlexBlock,\n\tFlexItem,\n\tSelectControl,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport {\n\tswitchToBlockType,\n\tgetPossibleBlockTransformations,\n} from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { useCreateTemplatePartFromBlocks } from './utils/hooks';\nimport { transformWidgetToBlock } from './utils/transformers';\n\nconst SIDEBARS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,description,status,widgets',\n};\n\nexport function TemplatePartImportControls( { area, setAttributes } ) {\n\tconst [ selectedSidebar, setSelectedSidebar ] = useState( '' );\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\n\tconst registry = useRegistry();\n\tconst { sidebars, hasResolved } = useSelect( ( select ) => {\n\t\tconst { getSidebars, hasFinishedResolution } = select( coreStore );\n\n\t\treturn {\n\t\t\tsidebars: getSidebars( SIDEBARS_QUERY ),\n\t\t\thasResolved: hasFinishedResolution( 'getSidebars', [\n\t\t\t\tSIDEBARS_QUERY,\n\t\t\t] ),\n\t\t};\n\t}, [] );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst createFromBlocks = useCreateTemplatePartFromBlocks(\n\t\tarea,\n\t\tsetAttributes\n\t);\n\n\tconst options = useMemo( () => {\n\t\tconst sidebarOptions = ( sidebars ?? [] )\n\t\t\t.filter(\n\t\t\t\t( widgetArea ) =>\n\t\t\t\t\twidgetArea.id !== 'wp_inactive_widgets' &&\n\t\t\t\t\twidgetArea.widgets.length > 0\n\t\t\t)\n\t\t\t.map( ( widgetArea ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: widgetArea.id,\n\t\t\t\t\tlabel: widgetArea.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\tif ( ! sidebarOptions.length ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{ value: '', label: __( 'Select widget area' ) },\n\t\t\t...sidebarOptions,\n\t\t];\n\t}, [ sidebars ] );\n\n\t// Render an empty node while data is loading to avoid SlotFill re-positioning bug.\n\t// See: https://github.com/WordPress/gutenberg/issues/15641.\n\tif ( ! hasResolved ) {\n\t\treturn <Spacer marginBottom=\"0\" />;\n\t}\n\n\tif ( hasResolved && ! options.length ) {\n\t\treturn null;\n\t}\n\n\tasync function createFromWidgets( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isBusy || ! selectedSidebar ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsBusy( true );\n\n\t\tconst sidebar = options.find(\n\t\t\t( { value } ) => value === selectedSidebar\n\t\t);\n\t\tconst { getWidgets } = registry.resolveSelect( coreStore );\n\n\t\t// The widgets API always returns a successful response.\n\t\tconst widgets = await getWidgets( {\n\t\t\tsidebar: sidebar.value,\n\t\t\t_embed: 'about',\n\t\t} );\n\n\t\tconst skippedWidgets = new Set();\n\t\tconst blocks = widgets.flatMap( ( widget ) => {\n\t\t\tconst block = transformWidgetToBlock( widget );\n\n\t\t\tif ( block.name !== 'core/legacy-widget' ) {\n\t\t\t\treturn block;\n\t\t\t}\n\n\t\t\tconst transforms = getPossibleBlockTransformations( [\n\t\t\t\tblock,\n\t\t\t] ).filter( ( item ) => {\n\t\t\t\t// The block without any transformations can't be a wildcard.\n\t\t\t\tif ( ! item.transforms ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tconst hasWildCardFrom = item.transforms?.from?.find(\n\t\t\t\t\t( from ) => from.blocks && from.blocks.includes( '*' )\n\t\t\t\t);\n\t\t\t\tconst hasWildCardTo = item.transforms?.to?.find(\n\t\t\t\t\t( to ) => to.blocks && to.blocks.includes( '*' )\n\t\t\t\t);\n\n\t\t\t\treturn ! hasWildCardFrom && ! hasWildCardTo;\n\t\t\t} );\n\n\t\t\t// Skip the block if we have no matching transformations.\n\t\t\tif ( ! transforms.length ) {\n\t\t\t\tskippedWidgets.add( widget.id_base );\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\t// Try transforming the Legacy Widget into a first matching block.\n\t\t\treturn switchToBlockType( block, transforms[ 0 ].name );\n\t\t} );\n\n\t\tawait createFromBlocks(\n\t\t\tblocks,\n\t\t\t/* translators: %s: name of the widget area */\n\t\t\tsprintf( __( 'Widget area: %s' ), sidebar.label )\n\t\t);\n\n\t\tif ( skippedWidgets.size ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: the list of widgets */\n\t\t\t\t\t__( 'Unable to import the following widgets: %s.' ),\n\t\t\t\t\tArray.from( skippedWidgets ).join( ', ' )\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tsetIsBusy( false );\n\t}\n\n\treturn (\n\t\t<Spacer marginBottom=\"4\">\n\t\t\t<HStack as=\"form\" onSubmit={ createFromWidgets }>\n\t\t\t\t<FlexBlock>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Import widget area' ) }\n\t\t\t\t\t\tvalue={ selectedSidebar }\n\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\tonChange={ ( value ) => setSelectedSidebar( value ) }\n\t\t\t\t\t\tdisabled={ ! options.length }\n\t\t\t\t\t\t__next36pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t/>\n\t\t\t\t</FlexBlock>\n\t\t\t\t<FlexItem\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tmarginBottom: '8px',\n\t\t\t\t\t\tmarginTop: 'auto',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\taria-disabled={ isBusy || ! selectedSidebar }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Import' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\t\t</Spacer>\n\t);\n}\n"]}
@@ -39,7 +39,6 @@ const metadata = {
39
39
  }
40
40
  },
41
41
  supports: {
42
- anchor: true,
43
42
  align: true,
44
43
  html: false,
45
44
  reusable: false
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/template-part/index.js"],"names":["capitalCase","store","coreDataStore","select","symbolFilled","addFilter","decodeEntities","initBlock","edit","enhanceTemplatePartVariations","name","metadata","settings","icon","__experimentalLabel","slug","theme","entity","getEntityRecord","title","rendered","init","DISALLOWED_PARENTS","canInsert","blockType","rootClientId","getBlock","getBlockParentsByBlockName","disallowedParentType","hasDisallowedParent","length"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,aAA5B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,MAAT,QAAuB,iBAAvB;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;;;;;;;;;;;;;;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AAAH,QAAQ,CAAED,YAAF,CAAR,wDAA0Bf,IAA1B,MAAmCkB,oBAAnC,IACAD,0BAA0B,CACzBF,YADyB,EAEzBG,oBAFyB,CAA1B,CAGEE,MALH;;AAMA,UAAKD,mBAAL,EAA2B;AAC1B,eAAO,KAAP;AACA;AACD;;AACD,WAAO,IAAP;AACA,GAzBO,CAAT;AA4BA,SAAOtB,SAAS,CAAE;AAAEG,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,GAAF,CAAhB;AACA,CAtCM","sourcesContent":["/**\n * External dependencies\n */\nimport { capitalCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport { symbolFilled } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport { enhanceTemplatePartVariations } from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: symbolFilled,\n\t__experimentalLabel: ( { slug, theme } ) => {\n\t\t// Attempt to find entity title if block is a template part.\n\t\t// Require slug to request, otherwise entity is uncreated and will throw 404.\n\t\tif ( ! slug ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst entity = select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\ttheme + '//' + slug\n\t\t);\n\t\tif ( ! entity ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\tdecodeEntities( entity.title?.rendered ) ||\n\t\t\tcapitalCase( entity.slug )\n\t\t);\n\t},\n\tedit,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/template-part',\n\t\tenhanceTemplatePartVariations\n\t);\n\n\t// Prevent adding template parts inside post templates.\n\tconst DISALLOWED_PARENTS = [ 'core/post-template', 'core/post-content' ];\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromPostTemplates',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlock, getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif ( blockType.name !== 'core/template-part' ) {\n\t\t\t\treturn canInsert;\n\t\t\t}\n\n\t\t\tfor ( const disallowedParentType of DISALLOWED_PARENTS ) {\n\t\t\t\tconst hasDisallowedParent =\n\t\t\t\t\tgetBlock( rootClientId )?.name === disallowedParentType ||\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\tdisallowedParentType\n\t\t\t\t\t).length;\n\t\t\t\tif ( hasDisallowedParent ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/template-part/index.js"],"names":["capitalCase","store","coreDataStore","select","symbolFilled","addFilter","decodeEntities","initBlock","edit","enhanceTemplatePartVariations","name","metadata","settings","icon","__experimentalLabel","slug","theme","entity","getEntityRecord","title","rendered","init","DISALLOWED_PARENTS","canInsert","blockType","rootClientId","getBlock","getBlockParentsByBlockName","disallowedParentType","hasDisallowedParent","length"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,aAA5B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,MAAT,QAAuB,iBAAvB;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,M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f,IAA1B,MAAmCkB,oBAAnC,IACAD,0BAA0B,CACzBF,YADyB,EAEzBG,oBAFyB,CAA1B,CAGEE,MALH;;AAMA,UAAKD,mBAAL,EAA2B;AAC1B,eAAO,KAAP;AACA;AACD;;AACD,WAAO,IAAP;AACA,GAzBO,CAAT;AA4BA,SAAOtB,SAAS,CAAE;AAAEG,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,GAAF,CAAhB;AACA,CAtCM","sourcesContent":["/**\n * External dependencies\n */\nimport { capitalCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport { symbolFilled } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport { enhanceTemplatePartVariations } from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: symbolFilled,\n\t__experimentalLabel: ( { slug, theme } ) => {\n\t\t// Attempt to find entity title if block is a template part.\n\t\t// Require slug to request, otherwise entity is uncreated and will throw 404.\n\t\tif ( ! slug ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst entity = select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\ttheme + '//' + slug\n\t\t);\n\t\tif ( ! entity ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\tdecodeEntities( entity.title?.rendered ) ||\n\t\t\tcapitalCase( entity.slug )\n\t\t);\n\t},\n\tedit,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/template-part',\n\t\tenhanceTemplatePartVariations\n\t);\n\n\t// Prevent adding template parts inside post templates.\n\tconst DISALLOWED_PARENTS = [ 'core/post-template', 'core/post-content' ];\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromPostTemplates',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlock, getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif ( blockType.name !== 'core/template-part' ) {\n\t\t\t\treturn canInsert;\n\t\t\t}\n\n\t\t\tfor ( const disallowedParentType of DISALLOWED_PARENTS ) {\n\t\t\t\tconst hasDisallowedParent =\n\t\t\t\t\tgetBlock( rootClientId )?.name === disallowedParentType ||\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\tdisallowedParentType\n\t\t\t\t\t).length;\n\t\t\t\tif ( hasDisallowedParent ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"]}
@@ -21,7 +21,6 @@ const metadata = {
21
21
  }
22
22
  },
23
23
  supports: {
24
- anchor: true,
25
24
  align: ["wide", "full"],
26
25
  html: false,
27
26
  color: {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/term-description/index.js"],"names":["termDescription","icon","initBlock","edit","name","metadata","settings","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,IAAIC,IAA5B,QAAwC,kBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBL,EAAAA,IADuB;AAEvBE,EAAAA;AAFuB,CAAjB;AAKP,OAAO,MAAMI,IAAI,GAAG,MAAML,SAAS,CAAE;AAAEE,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAF,CAA5B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { termDescription as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/term-description/index.js"],"names":["termDescription","icon","initBlock","edit","name","metadata","settings","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,IAAIC,IAA5B,QAAwC,kBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBL,EAAAA,IADuB;AAEvBE,EAAAA;AAFuB,CAAjB;AAKP,OAAO,MAAMI,IAAI,GAAG,MAAML,SAAS,CAAE;AAAEE,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAF,CAA5B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { termDescription as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
@@ -2323,8 +2323,8 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2323
2323
  }
2324
2324
 
2325
2325
  .wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder {
2326
- height: 120px;
2327
- width: 120px;
2326
+ height: 60px;
2327
+ width: 60px;
2328
2328
  }
2329
2329
  .wp-block-site-logo.wp-block-site-logo > div,
2330
2330
  .wp-block-site-logo.wp-block-site-logo .components-resizable-box__container {
@@ -2769,6 +2769,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2769
2769
  position: sticky;
2770
2770
  top: 0;
2771
2771
  padding: 16px 0;
2772
+ margin-bottom: 2px;
2772
2773
  z-index: 2;
2773
2774
  }
2774
2775
 
@@ -2331,8 +2331,8 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2331
2331
  }
2332
2332
 
2333
2333
  .wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder {
2334
- height: 120px;
2335
- width: 120px;
2334
+ height: 60px;
2335
+ width: 60px;
2336
2336
  }
2337
2337
  .wp-block-site-logo.wp-block-site-logo > div,
2338
2338
  .wp-block-site-logo.wp-block-site-logo .components-resizable-box__container {
@@ -2777,6 +2777,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2777
2777
  position: sticky;
2778
2778
  top: 0;
2779
2779
  padding: 16px 0;
2780
+ margin-bottom: 2px;
2780
2781
  z-index: 2;
2781
2782
  }
2782
2783
 
@@ -127,6 +127,7 @@
127
127
  position: sticky;
128
128
  top: 0;
129
129
  padding: 16px 0;
130
+ margin-bottom: 2px;
130
131
  z-index: 2;
131
132
  }
132
133
 
@@ -127,6 +127,7 @@
127
127
  position: sticky;
128
128
  top: 0;
129
129
  padding: 16px 0;
130
+ margin-bottom: 2px;
130
131
  z-index: 2;
131
132
  }
132
133
 
@@ -90,18 +90,18 @@
90
90
  box-sizing: border-box;
91
91
  overflow-wrap: break-word;
92
92
  }
93
- .wp-block-quote.is-style-large:not(.is-style-plain), .wp-block-quote.is-large:not(.is-style-plain) {
93
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)), .wp-block-quote.is-large:where(:not(.is-style-plain)) {
94
94
  margin-bottom: 1em;
95
95
  padding: 0 1em;
96
96
  }
97
- .wp-block-quote.is-style-large:not(.is-style-plain) p, .wp-block-quote.is-large:not(.is-style-plain) p {
97
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) p, .wp-block-quote.is-large:where(:not(.is-style-plain)) p {
98
98
  font-size: 1.5em;
99
99
  font-style: italic;
100
100
  line-height: 1.6;
101
101
  }
102
- .wp-block-quote.is-style-large:not(.is-style-plain) cite,
103
- .wp-block-quote.is-style-large:not(.is-style-plain) footer, .wp-block-quote.is-large:not(.is-style-plain) cite,
104
- .wp-block-quote.is-large:not(.is-style-plain) footer {
102
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,
103
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer, .wp-block-quote.is-large:where(:not(.is-style-plain)) cite,
104
+ .wp-block-quote.is-large:where(:not(.is-style-plain)) footer {
105
105
  font-size: 1.125em;
106
106
  text-align: left;
107
107
  }
@@ -90,18 +90,18 @@
90
90
  box-sizing: border-box;
91
91
  overflow-wrap: break-word;
92
92
  }
93
- .wp-block-quote.is-style-large:not(.is-style-plain), .wp-block-quote.is-large:not(.is-style-plain) {
93
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)), .wp-block-quote.is-large:where(:not(.is-style-plain)) {
94
94
  margin-bottom: 1em;
95
95
  padding: 0 1em;
96
96
  }
97
- .wp-block-quote.is-style-large:not(.is-style-plain) p, .wp-block-quote.is-large:not(.is-style-plain) p {
97
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) p, .wp-block-quote.is-large:where(:not(.is-style-plain)) p {
98
98
  font-size: 1.5em;
99
99
  font-style: italic;
100
100
  line-height: 1.6;
101
101
  }
102
- .wp-block-quote.is-style-large:not(.is-style-plain) cite,
103
- .wp-block-quote.is-style-large:not(.is-style-plain) footer, .wp-block-quote.is-large:not(.is-style-plain) cite,
104
- .wp-block-quote.is-large:not(.is-style-plain) footer {
102
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,
103
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer, .wp-block-quote.is-large:where(:not(.is-style-plain)) cite,
104
+ .wp-block-quote.is-large:where(:not(.is-style-plain)) footer {
105
105
  font-size: 1.125em;
106
106
  text-align: right;
107
107
  }
@@ -112,8 +112,8 @@
112
112
  }
113
113
 
114
114
  .wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder {
115
- height: 120px;
116
- width: 120px;
115
+ height: 60px;
116
+ width: 60px;
117
117
  }
118
118
  .wp-block-site-logo.wp-block-site-logo > div,
119
119
  .wp-block-site-logo.wp-block-site-logo .components-resizable-box__container {
@@ -112,8 +112,8 @@
112
112
  }
113
113
 
114
114
  .wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder {
115
- height: 120px;
116
- width: 120px;
115
+ height: 60px;
116
+ width: 60px;
117
117
  }
118
118
  .wp-block-site-logo.wp-block-site-logo > div,
119
119
  .wp-block-site-logo.wp-block-site-logo .components-resizable-box__container {
@@ -2685,18 +2685,18 @@ p.has-background {
2685
2685
  box-sizing: border-box;
2686
2686
  overflow-wrap: break-word;
2687
2687
  }
2688
- .wp-block-quote.is-style-large:not(.is-style-plain), .wp-block-quote.is-large:not(.is-style-plain) {
2688
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)), .wp-block-quote.is-large:where(:not(.is-style-plain)) {
2689
2689
  margin-bottom: 1em;
2690
2690
  padding: 0 1em;
2691
2691
  }
2692
- .wp-block-quote.is-style-large:not(.is-style-plain) p, .wp-block-quote.is-large:not(.is-style-plain) p {
2692
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) p, .wp-block-quote.is-large:where(:not(.is-style-plain)) p {
2693
2693
  font-size: 1.5em;
2694
2694
  font-style: italic;
2695
2695
  line-height: 1.6;
2696
2696
  }
2697
- .wp-block-quote.is-style-large:not(.is-style-plain) cite,
2698
- .wp-block-quote.is-style-large:not(.is-style-plain) footer, .wp-block-quote.is-large:not(.is-style-plain) cite,
2699
- .wp-block-quote.is-large:not(.is-style-plain) footer {
2697
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,
2698
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer, .wp-block-quote.is-large:where(:not(.is-style-plain)) cite,
2699
+ .wp-block-quote.is-large:where(:not(.is-style-plain)) footer {
2700
2700
  font-size: 1.125em;
2701
2701
  text-align: left;
2702
2702
  }
@@ -2715,18 +2715,18 @@ p.has-background {
2715
2715
  box-sizing: border-box;
2716
2716
  overflow-wrap: break-word;
2717
2717
  }
2718
- .wp-block-quote.is-style-large:not(.is-style-plain), .wp-block-quote.is-large:not(.is-style-plain) {
2718
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)), .wp-block-quote.is-large:where(:not(.is-style-plain)) {
2719
2719
  margin-bottom: 1em;
2720
2720
  padding: 0 1em;
2721
2721
  }
2722
- .wp-block-quote.is-style-large:not(.is-style-plain) p, .wp-block-quote.is-large:not(.is-style-plain) p {
2722
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) p, .wp-block-quote.is-large:where(:not(.is-style-plain)) p {
2723
2723
  font-size: 1.5em;
2724
2724
  font-style: italic;
2725
2725
  line-height: 1.6;
2726
2726
  }
2727
- .wp-block-quote.is-style-large:not(.is-style-plain) cite,
2728
- .wp-block-quote.is-style-large:not(.is-style-plain) footer, .wp-block-quote.is-large:not(.is-style-plain) cite,
2729
- .wp-block-quote.is-large:not(.is-style-plain) footer {
2727
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,
2728
+ .wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer, .wp-block-quote.is-large:where(:not(.is-style-plain)) cite,
2729
+ .wp-block-quote.is-large:where(:not(.is-style-plain)) footer {
2730
2730
  font-size: 1.125em;
2731
2731
  text-align: right;
2732
2732
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "8.3.4",
3
+ "version": "8.3.6",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -35,30 +35,30 @@
35
35
  "@wordpress/api-fetch": "^6.23.1",
36
36
  "@wordpress/autop": "^3.26.1",
37
37
  "@wordpress/blob": "^3.26.1",
38
- "@wordpress/block-editor": "^11.3.4",
39
- "@wordpress/blocks": "^12.3.2",
40
- "@wordpress/components": "^23.3.3",
41
- "@wordpress/compose": "^6.3.2",
42
- "@wordpress/core-data": "^6.3.2",
43
- "@wordpress/data": "^8.3.2",
38
+ "@wordpress/block-editor": "^11.3.6",
39
+ "@wordpress/blocks": "^12.3.3",
40
+ "@wordpress/components": "^23.3.5",
41
+ "@wordpress/compose": "^6.3.3",
42
+ "@wordpress/core-data": "^6.3.3",
43
+ "@wordpress/data": "^8.3.3",
44
44
  "@wordpress/date": "^4.26.2",
45
45
  "@wordpress/deprecated": "^3.26.1",
46
46
  "@wordpress/dom": "^3.26.1",
47
- "@wordpress/element": "^5.3.1",
47
+ "@wordpress/element": "^5.3.2",
48
48
  "@wordpress/escape-html": "^2.26.1",
49
49
  "@wordpress/hooks": "^3.26.1",
50
50
  "@wordpress/html-entities": "^3.26.1",
51
51
  "@wordpress/i18n": "^4.26.1",
52
- "@wordpress/icons": "^9.17.1",
52
+ "@wordpress/icons": "^9.17.2",
53
53
  "@wordpress/keycodes": "^3.26.2",
54
- "@wordpress/notices": "^3.26.2",
55
- "@wordpress/primitives": "^3.24.1",
54
+ "@wordpress/notices": "^3.26.3",
55
+ "@wordpress/primitives": "^3.24.2",
56
56
  "@wordpress/private-apis": "^0.8.1",
57
- "@wordpress/reusable-blocks": "^4.3.4",
58
- "@wordpress/rich-text": "^6.3.2",
59
- "@wordpress/server-side-render": "^4.3.3",
57
+ "@wordpress/reusable-blocks": "^4.3.6",
58
+ "@wordpress/rich-text": "^6.3.3",
59
+ "@wordpress/server-side-render": "^4.3.5",
60
60
  "@wordpress/url": "^3.27.1",
61
- "@wordpress/viewport": "^5.3.2",
61
+ "@wordpress/viewport": "^5.3.3",
62
62
  "change-case": "^4.1.2",
63
63
  "classnames": "^2.3.1",
64
64
  "colord": "^2.7.0",
@@ -77,5 +77,5 @@
77
77
  "publishConfig": {
78
78
  "access": "public"
79
79
  },
80
- "gitHead": "ccabeeffe1fe117c3934ec7705c15d52857d9a87"
80
+ "gitHead": "35f10c183655e9196d4ea12b8fa499a8ecbb7b6a"
81
81
  }
@@ -26,7 +26,6 @@
26
26
  },
27
27
  "supports": {
28
28
  "align": true,
29
- "anchor": true,
30
29
  "html": false,
31
30
  "spacing": {
32
31
  "margin": true,
@@ -25,7 +25,6 @@
25
25
  },
26
26
  "usesContext": [ "postType", "postId", "commentId" ],
27
27
  "supports": {
28
- "anchor": true,
29
28
  "html": false,
30
29
  "align": true,
31
30
  "alignWide": false,
@@ -17,7 +17,6 @@
17
17
  },
18
18
  "supports": {
19
19
  "align": true,
20
- "anchor": true,
21
20
  "color": {
22
21
  "link": true,
23
22
  "__experimentalSkipSerialization": [ "text", "background" ],
@@ -30,7 +30,6 @@
30
30
  },
31
31
  "supports": {
32
32
  "align": true,
33
- "anchor": true,
34
33
  "html": false,
35
34
  "spacing": {
36
35
  "margin": true,
@@ -20,7 +20,6 @@
20
20
  },
21
21
  "usesContext": [ "commentId" ],
22
22
  "supports": {
23
- "anchor": true,
24
23
  "html": false,
25
24
  "inserter": false,
26
25
  "__experimentalBorder": {
@@ -22,7 +22,6 @@
22
22
  },
23
23
  "usesContext": [ "commentId" ],
24
24
  "supports": {
25
- "anchor": true,
26
25
  "html": false,
27
26
  "spacing": {
28
27
  "margin": true,
@@ -14,7 +14,6 @@
14
14
  }
15
15
  },
16
16
  "supports": {
17
- "anchor": true,
18
17
  "color": {
19
18
  "gradients": true,
20
19
  "link": true,
@@ -18,7 +18,6 @@
18
18
  },
19
19
  "usesContext": [ "commentId" ],
20
20
  "supports": {
21
- "anchor": true,
22
21
  "html": false,
23
22
  "color": {
24
23
  "gradients": true,
@@ -18,7 +18,6 @@
18
18
  }
19
19
  },
20
20
  "supports": {
21
- "anchor": true,
22
21
  "html": false,
23
22
  "color": {
24
23
  "link": true,
@@ -14,7 +14,6 @@
14
14
  }
15
15
  },
16
16
  "supports": {
17
- "anchor": true,
18
17
  "color": {
19
18
  "gradients": true,
20
19
  "link": true,
@@ -10,7 +10,6 @@
10
10
  "usesContext": [ "postId" ],
11
11
  "supports": {
12
12
  "align": true,
13
- "anchor": true,
14
13
  "html": false,
15
14
  "reusable": false,
16
15
  "spacing": {
@@ -18,8 +18,6 @@
18
18
  },
19
19
  "supports": {
20
20
  "align": [ "wide", "full" ],
21
- "anchor": true,
22
- "html": false,
23
21
  "color": {
24
22
  "gradients": true,
25
23
  "link": true,
@@ -29,6 +27,7 @@
29
27
  "link": true
30
28
  }
31
29
  },
30
+ "html": false,
32
31
  "spacing": {
33
32
  "margin": true,
34
33
  "padding": true
@@ -17,7 +17,6 @@
17
17
  "comments/paginationArrow": "paginationArrow"
18
18
  },
19
19
  "supports": {
20
- "anchor": true,
21
20
  "align": true,
22
21
  "reusable": false,
23
22
  "html": false,
@@ -14,7 +14,6 @@
14
14
  },
15
15
  "usesContext": [ "postId", "comments/paginationArrow" ],
16
16
  "supports": {
17
- "anchor": true,
18
17
  "reusable": false,
19
18
  "html": false,
20
19
  "color": {
@@ -9,7 +9,6 @@
9
9
  "textdomain": "default",
10
10
  "usesContext": [ "postId" ],
11
11
  "supports": {
12
- "anchor": true,
13
12
  "reusable": false,
14
13
  "html": false,
15
14
  "color": {
@@ -14,7 +14,6 @@
14
14
  },
15
15
  "usesContext": [ "postId", "comments/paginationArrow" ],
16
16
  "supports": {
17
- "anchor": true,
18
17
  "reusable": false,
19
18
  "html": false,
20
19
  "color": {
@@ -22,7 +22,6 @@
22
22
  "style"
23
23
  ],
24
24
  "supports": {
25
- "anchor": true,
26
25
  "reusable": false,
27
26
  "html": false,
28
27
  "typography": {
@@ -29,7 +29,6 @@
29
29
  },
30
30
  "supports": {
31
31
  "align": true,
32
- "anchor": true,
33
32
  "html": false,
34
33
  "spacing": {
35
34
  "margin": true,
@@ -84,7 +84,6 @@
84
84
  },
85
85
  "supports": {
86
86
  "align": true,
87
- "anchor": true,
88
87
  "html": false,
89
88
  "color": {
90
89
  "gradients": true,
@@ -18,7 +18,6 @@
18
18
  }
19
19
  },
20
20
  "supports": {
21
- "anchor": true,
22
21
  "className": true,
23
22
  "typography": {
24
23
  "fontSize": false
@@ -92,7 +92,6 @@
92
92
  },
93
93
  "supports": {
94
94
  "align": [ "wide", "full" ],
95
- "anchor": true,
96
95
  "html": false,
97
96
  "inserter": true,
98
97
  "typography": {
@@ -19,7 +19,6 @@ import { __, sprintf } from '@wordpress/i18n';
19
19
  * Internal dependencies
20
20
  */
21
21
  import NavigationMenuSelector from './navigation-menu-selector';
22
- import { LeafMoreMenu } from '../leaf-more-menu';
23
22
  import { unlock } from '../../private-apis';
24
23
  import DeletedNavigationWarning from './deleted-navigation-warning';
25
24
  import useNavigationMenu from '../use-navigation-menu';
@@ -34,8 +33,7 @@ const MainContent = ( {
34
33
  isNavigationMenuMissing,
35
34
  onCreateNew,
36
35
  } ) => {
37
- const { OffCanvasEditor } = unlock( blockEditorPrivateApis );
38
-
36
+ const { OffCanvasEditor, LeafMoreMenu } = unlock( blockEditorPrivateApis );
39
37
  // Provide a hierarchy of clientIds for the given Navigation block (clientId).
40
38
  // This is required else the list view will display the entire block tree.
41
39
  const clientIdsTree = useSelect(