@wordpress/edit-site 7.3.0 → 7.4.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 (450) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/build/components/add-new-pattern/index.cjs +1 -1
  3. package/build/components/add-new-pattern/index.cjs.map +1 -1
  4. package/build/components/add-new-post/index.cjs +1 -1
  5. package/build/components/add-new-post/index.cjs.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs +1 -1
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs.map +1 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.cjs +4 -2
  9. package/build/components/add-new-template/add-custom-template-modal-content.cjs.map +3 -3
  10. package/build/components/add-new-template/index.cjs +7 -5
  11. package/build/components/add-new-template/index.cjs.map +3 -3
  12. package/build/components/add-new-template/utils.cjs +84 -9
  13. package/build/components/add-new-template/utils.cjs.map +2 -2
  14. package/build/components/app/index.cjs +1 -1
  15. package/build/components/app/index.cjs.map +1 -1
  16. package/build/components/canvas-loader/index.cjs +1 -1
  17. package/build/components/canvas-loader/index.cjs.map +1 -1
  18. package/build/components/dataviews-actions/index.cjs +2 -55
  19. package/build/components/dataviews-actions/index.cjs.map +3 -3
  20. package/build/components/editor/index.cjs +1 -1
  21. package/build/components/editor/index.cjs.map +1 -1
  22. package/build/components/editor/site-preview.cjs +1 -1
  23. package/build/components/editor/site-preview.cjs.map +1 -1
  24. package/build/components/editor/use-adapt-editor-to-canvas.cjs +0 -11
  25. package/build/components/editor/use-adapt-editor-to-canvas.cjs.map +3 -3
  26. package/build/components/layout/index.cjs +3 -3
  27. package/build/components/layout/index.cjs.map +3 -3
  28. package/build/components/media/index.cjs +1 -1
  29. package/build/components/media/index.cjs.map +1 -1
  30. package/build/components/more-menu/index.cjs +1 -1
  31. package/build/components/more-menu/index.cjs.map +1 -1
  32. package/build/components/more-menu/welcome-guide-menu-item.cjs +11 -3
  33. package/build/components/more-menu/welcome-guide-menu-item.cjs.map +4 -4
  34. package/build/components/page-patterns/actions.cjs +1 -1
  35. package/build/components/page-patterns/actions.cjs.map +1 -1
  36. package/build/components/page-patterns/delete-category-menu-item.cjs +1 -1
  37. package/build/components/page-patterns/delete-category-menu-item.cjs.map +1 -1
  38. package/build/components/page-patterns/fields.cjs +1 -1
  39. package/build/components/page-patterns/fields.cjs.map +1 -1
  40. package/build/components/page-patterns/index.cjs +1 -1
  41. package/build/components/page-patterns/index.cjs.map +1 -1
  42. package/build/components/page-patterns/rename-category-menu-item.cjs +1 -1
  43. package/build/components/page-patterns/rename-category-menu-item.cjs.map +1 -1
  44. package/build/components/page-templates/fields.cjs +3 -127
  45. package/build/components/page-templates/fields.cjs.map +4 -4
  46. package/build/components/page-templates/index.cjs +47 -231
  47. package/build/components/page-templates/index.cjs.map +4 -4
  48. package/build/components/pagination/index.cjs +1 -1
  49. package/build/components/pagination/index.cjs.map +1 -1
  50. package/build/components/plugin-template-setting-panel/index.cjs +1 -1
  51. package/build/components/plugin-template-setting-panel/index.cjs.map +1 -1
  52. package/build/components/post-list/index.cjs +8 -18
  53. package/build/components/post-list/index.cjs.map +3 -3
  54. package/build/components/post-list/quick-edit-modal.cjs +1 -1
  55. package/build/components/post-list/quick-edit-modal.cjs.map +1 -1
  56. package/build/components/resizable-frame/index.cjs +1 -1
  57. package/build/components/resizable-frame/index.cjs.map +1 -1
  58. package/build/components/save-button/index.cjs +1 -1
  59. package/build/components/save-button/index.cjs.map +1 -1
  60. package/build/components/save-hub/index.cjs +1 -1
  61. package/build/components/save-hub/index.cjs.map +1 -1
  62. package/build/components/save-panel/index.cjs +1 -1
  63. package/build/components/save-panel/index.cjs.map +1 -1
  64. package/build/components/sidebar/index.cjs +1 -1
  65. package/build/components/sidebar/index.cjs.map +1 -1
  66. package/build/components/sidebar-button/index.cjs +1 -1
  67. package/build/components/sidebar-button/index.cjs.map +1 -1
  68. package/build/components/sidebar-dataviews/index.cjs +1 -1
  69. package/build/components/sidebar-dataviews/index.cjs.map +1 -1
  70. package/build/components/sidebar-global-styles/index.cjs +3 -3
  71. package/build/components/sidebar-global-styles/index.cjs.map +3 -3
  72. package/build/components/sidebar-identity/index.cjs +18 -23
  73. package/build/components/sidebar-identity/index.cjs.map +3 -3
  74. package/build/components/sidebar-navigation-item/index.cjs +2 -9
  75. package/build/components/sidebar-navigation-item/index.cjs.map +3 -3
  76. package/build/components/sidebar-navigation-screen/index.cjs +1 -1
  77. package/build/components/sidebar-navigation-screen/index.cjs.map +1 -1
  78. package/build/components/sidebar-navigation-screen-details-footer/index.cjs +1 -1
  79. package/build/components/sidebar-navigation-screen-details-footer/index.cjs.map +1 -1
  80. package/build/components/sidebar-navigation-screen-global-styles/content.cjs +1 -1
  81. package/build/components/sidebar-navigation-screen-global-styles/content.cjs.map +1 -1
  82. package/build/components/sidebar-navigation-screen-global-styles/index.cjs +1 -1
  83. package/build/components/sidebar-navigation-screen-global-styles/index.cjs.map +1 -1
  84. package/build/components/sidebar-navigation-screen-identity/index.cjs +1 -1
  85. package/build/components/sidebar-navigation-screen-identity/index.cjs.map +1 -1
  86. package/build/components/sidebar-navigation-screen-main/index.cjs +1 -1
  87. package/build/components/sidebar-navigation-screen-main/index.cjs.map +1 -1
  88. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.cjs +1 -1
  89. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.cjs.map +1 -1
  90. package/build/components/sidebar-navigation-screen-navigation-menu/index.cjs +1 -1
  91. package/build/components/sidebar-navigation-screen-navigation-menu/index.cjs.map +1 -1
  92. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.cjs +1 -1
  93. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.cjs.map +1 -1
  94. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.cjs +1 -1
  95. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.cjs.map +1 -1
  96. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs +1 -1
  97. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs.map +1 -1
  98. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.cjs +1 -1
  99. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.cjs.map +1 -1
  100. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.cjs.map +1 -1
  101. package/build/components/sidebar-navigation-screen-navigation-menus/index.cjs +1 -1
  102. package/build/components/sidebar-navigation-screen-navigation-menus/index.cjs.map +2 -2
  103. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.cjs +1 -1
  104. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.cjs.map +1 -1
  105. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.cjs +1 -1
  106. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.cjs.map +2 -2
  107. package/build/components/sidebar-navigation-screen-patterns/category-item.cjs +1 -1
  108. package/build/components/sidebar-navigation-screen-patterns/category-item.cjs.map +1 -1
  109. package/build/components/sidebar-navigation-screen-patterns/index.cjs +1 -1
  110. package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +1 -1
  111. package/build/components/sidebar-navigation-screen-templates-browse/content.cjs +35 -73
  112. package/build/components/sidebar-navigation-screen-templates-browse/content.cjs.map +4 -4
  113. package/build/components/sidebar-navigation-screen-templates-browse/index.cjs +2 -3
  114. package/build/components/sidebar-navigation-screen-templates-browse/index.cjs.map +4 -4
  115. package/build/components/sidebar-navigation-screen-unsupported/index.cjs +1 -1
  116. package/build/components/sidebar-navigation-screen-unsupported/index.cjs.map +1 -1
  117. package/build/components/site-editor-routes/home.cjs +1 -1
  118. package/build/components/site-editor-routes/home.cjs.map +1 -1
  119. package/build/components/site-editor-routes/identity.cjs +1 -1
  120. package/build/components/site-editor-routes/identity.cjs.map +1 -1
  121. package/build/components/site-editor-routes/navigation-item.cjs +1 -1
  122. package/build/components/site-editor-routes/navigation-item.cjs.map +1 -1
  123. package/build/components/site-editor-routes/navigation.cjs +1 -1
  124. package/build/components/site-editor-routes/navigation.cjs.map +1 -1
  125. package/build/components/site-editor-routes/notfound.cjs +1 -1
  126. package/build/components/site-editor-routes/notfound.cjs.map +1 -1
  127. package/build/components/site-editor-routes/page-item.cjs +1 -1
  128. package/build/components/site-editor-routes/page-item.cjs.map +1 -1
  129. package/build/components/site-editor-routes/pages.cjs +1 -1
  130. package/build/components/site-editor-routes/pages.cjs.map +1 -1
  131. package/build/components/site-editor-routes/pattern-item.cjs +1 -1
  132. package/build/components/site-editor-routes/pattern-item.cjs.map +1 -1
  133. package/build/components/site-editor-routes/patterns.cjs +1 -1
  134. package/build/components/site-editor-routes/patterns.cjs.map +1 -1
  135. package/build/components/site-editor-routes/stylebook.cjs +1 -1
  136. package/build/components/site-editor-routes/stylebook.cjs.map +1 -1
  137. package/build/components/site-editor-routes/styles.cjs +1 -1
  138. package/build/components/site-editor-routes/styles.cjs.map +1 -1
  139. package/build/components/site-editor-routes/template-item.cjs +1 -1
  140. package/build/components/site-editor-routes/template-item.cjs.map +1 -1
  141. package/build/components/site-editor-routes/template-part-item.cjs +1 -1
  142. package/build/components/site-editor-routes/template-part-item.cjs.map +1 -1
  143. package/build/components/site-editor-routes/templates.cjs +3 -5
  144. package/build/components/site-editor-routes/templates.cjs.map +4 -4
  145. package/build/components/site-hub/index.cjs +1 -1
  146. package/build/components/site-hub/index.cjs.map +1 -1
  147. package/build/components/welcome-guide/editor.cjs +1 -1
  148. package/build/components/welcome-guide/editor.cjs.map +1 -1
  149. package/build/components/welcome-guide/image.cjs +1 -1
  150. package/build/components/welcome-guide/image.cjs.map +1 -1
  151. package/build/components/welcome-guide/index.cjs +1 -1
  152. package/build/components/welcome-guide/index.cjs.map +1 -1
  153. package/build/components/welcome-guide/page.cjs +1 -1
  154. package/build/components/welcome-guide/page.cjs.map +1 -1
  155. package/build/components/welcome-guide/template.cjs +1 -1
  156. package/build/components/welcome-guide/template.cjs.map +1 -1
  157. package/build/deprecated.cjs +1 -1
  158. package/build/deprecated.cjs.map +1 -1
  159. package/build/index.cjs +1 -2
  160. package/build/index.cjs.map +3 -3
  161. package/build-module/components/add-new-pattern/index.mjs +1 -1
  162. package/build-module/components/add-new-pattern/index.mjs.map +1 -1
  163. package/build-module/components/add-new-post/index.mjs +1 -1
  164. package/build-module/components/add-new-post/index.mjs.map +1 -1
  165. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs +1 -1
  166. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs.map +1 -1
  167. package/build-module/components/add-new-template/add-custom-template-modal-content.mjs +4 -2
  168. package/build-module/components/add-new-template/add-custom-template-modal-content.mjs.map +3 -3
  169. package/build-module/components/add-new-template/index.mjs +8 -5
  170. package/build-module/components/add-new-template/index.mjs.map +3 -3
  171. package/build-module/components/add-new-template/utils.mjs +84 -9
  172. package/build-module/components/add-new-template/utils.mjs.map +2 -2
  173. package/build-module/components/app/index.mjs +1 -1
  174. package/build-module/components/app/index.mjs.map +1 -1
  175. package/build-module/components/canvas-loader/index.mjs +1 -1
  176. package/build-module/components/canvas-loader/index.mjs.map +1 -1
  177. package/build-module/components/dataviews-actions/index.mjs +1 -53
  178. package/build-module/components/dataviews-actions/index.mjs.map +2 -2
  179. package/build-module/components/editor/index.mjs +1 -1
  180. package/build-module/components/editor/index.mjs.map +1 -1
  181. package/build-module/components/editor/site-preview.mjs +1 -1
  182. package/build-module/components/editor/site-preview.mjs.map +1 -1
  183. package/build-module/components/editor/use-adapt-editor-to-canvas.mjs +0 -11
  184. package/build-module/components/editor/use-adapt-editor-to-canvas.mjs.map +2 -2
  185. package/build-module/components/layout/index.mjs +3 -3
  186. package/build-module/components/layout/index.mjs.map +3 -3
  187. package/build-module/components/media/index.mjs +1 -1
  188. package/build-module/components/media/index.mjs.map +1 -1
  189. package/build-module/components/more-menu/index.mjs +1 -1
  190. package/build-module/components/more-menu/index.mjs.map +1 -1
  191. package/build-module/components/more-menu/welcome-guide-menu-item.mjs +11 -3
  192. package/build-module/components/more-menu/welcome-guide-menu-item.mjs.map +3 -3
  193. package/build-module/components/page-patterns/actions.mjs +1 -1
  194. package/build-module/components/page-patterns/actions.mjs.map +1 -1
  195. package/build-module/components/page-patterns/delete-category-menu-item.mjs +1 -1
  196. package/build-module/components/page-patterns/delete-category-menu-item.mjs.map +1 -1
  197. package/build-module/components/page-patterns/fields.mjs +1 -1
  198. package/build-module/components/page-patterns/fields.mjs.map +1 -1
  199. package/build-module/components/page-patterns/index.mjs +1 -1
  200. package/build-module/components/page-patterns/index.mjs.map +1 -1
  201. package/build-module/components/page-patterns/rename-category-menu-item.mjs +1 -1
  202. package/build-module/components/page-patterns/rename-category-menu-item.mjs.map +1 -1
  203. package/build-module/components/page-templates/fields.mjs +4 -130
  204. package/build-module/components/page-templates/fields.mjs.map +4 -4
  205. package/build-module/components/page-templates/index.mjs +53 -254
  206. package/build-module/components/page-templates/index.mjs.map +3 -3
  207. package/build-module/components/pagination/index.mjs +1 -1
  208. package/build-module/components/pagination/index.mjs.map +1 -1
  209. package/build-module/components/plugin-template-setting-panel/index.mjs +1 -1
  210. package/build-module/components/plugin-template-setting-panel/index.mjs.map +1 -1
  211. package/build-module/components/post-list/index.mjs +9 -19
  212. package/build-module/components/post-list/index.mjs.map +3 -3
  213. package/build-module/components/post-list/quick-edit-modal.mjs +1 -1
  214. package/build-module/components/post-list/quick-edit-modal.mjs.map +1 -1
  215. package/build-module/components/resizable-frame/index.mjs +1 -1
  216. package/build-module/components/resizable-frame/index.mjs.map +1 -1
  217. package/build-module/components/save-button/index.mjs +1 -1
  218. package/build-module/components/save-button/index.mjs.map +1 -1
  219. package/build-module/components/save-hub/index.mjs +1 -1
  220. package/build-module/components/save-hub/index.mjs.map +1 -1
  221. package/build-module/components/save-panel/index.mjs +1 -1
  222. package/build-module/components/save-panel/index.mjs.map +1 -1
  223. package/build-module/components/sidebar/index.mjs +1 -1
  224. package/build-module/components/sidebar/index.mjs.map +1 -1
  225. package/build-module/components/sidebar-button/index.mjs +1 -1
  226. package/build-module/components/sidebar-button/index.mjs.map +1 -1
  227. package/build-module/components/sidebar-dataviews/index.mjs +1 -1
  228. package/build-module/components/sidebar-dataviews/index.mjs.map +1 -1
  229. package/build-module/components/sidebar-global-styles/index.mjs +3 -3
  230. package/build-module/components/sidebar-global-styles/index.mjs.map +3 -3
  231. package/build-module/components/sidebar-identity/index.mjs +18 -23
  232. package/build-module/components/sidebar-identity/index.mjs.map +3 -3
  233. package/build-module/components/sidebar-navigation-item/index.mjs +2 -9
  234. package/build-module/components/sidebar-navigation-item/index.mjs.map +3 -3
  235. package/build-module/components/sidebar-navigation-screen/index.mjs +1 -1
  236. package/build-module/components/sidebar-navigation-screen/index.mjs.map +1 -1
  237. package/build-module/components/sidebar-navigation-screen-details-footer/index.mjs +1 -1
  238. package/build-module/components/sidebar-navigation-screen-details-footer/index.mjs.map +1 -1
  239. package/build-module/components/sidebar-navigation-screen-global-styles/content.mjs +1 -1
  240. package/build-module/components/sidebar-navigation-screen-global-styles/content.mjs.map +1 -1
  241. package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs +1 -1
  242. package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs.map +1 -1
  243. package/build-module/components/sidebar-navigation-screen-identity/index.mjs +1 -1
  244. package/build-module/components/sidebar-navigation-screen-identity/index.mjs.map +1 -1
  245. package/build-module/components/sidebar-navigation-screen-main/index.mjs +1 -1
  246. package/build-module/components/sidebar-navigation-screen-main/index.mjs.map +1 -1
  247. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.mjs +1 -1
  248. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.mjs.map +1 -1
  249. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.mjs +1 -1
  250. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.mjs.map +1 -1
  251. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.mjs +1 -1
  252. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.mjs.map +1 -1
  253. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.mjs +1 -1
  254. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.mjs.map +1 -1
  255. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs +1 -1
  256. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs.map +1 -1
  257. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.mjs +1 -1
  258. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.mjs.map +1 -1
  259. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.mjs.map +1 -1
  260. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.mjs +1 -1
  261. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.mjs.map +2 -2
  262. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.mjs +1 -1
  263. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.mjs.map +1 -1
  264. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.mjs +1 -1
  265. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.mjs.map +2 -2
  266. package/build-module/components/sidebar-navigation-screen-patterns/category-item.mjs +1 -1
  267. package/build-module/components/sidebar-navigation-screen-patterns/category-item.mjs.map +1 -1
  268. package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +1 -1
  269. package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +1 -1
  270. package/build-module/components/sidebar-navigation-screen-templates-browse/content.mjs +43 -76
  271. package/build-module/components/sidebar-navigation-screen-templates-browse/content.mjs.map +3 -3
  272. package/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs +2 -3
  273. package/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs.map +3 -3
  274. package/build-module/components/sidebar-navigation-screen-unsupported/index.mjs +1 -1
  275. package/build-module/components/sidebar-navigation-screen-unsupported/index.mjs.map +1 -1
  276. package/build-module/components/site-editor-routes/home.mjs +1 -1
  277. package/build-module/components/site-editor-routes/home.mjs.map +1 -1
  278. package/build-module/components/site-editor-routes/identity.mjs +1 -1
  279. package/build-module/components/site-editor-routes/identity.mjs.map +1 -1
  280. package/build-module/components/site-editor-routes/navigation-item.mjs +1 -1
  281. package/build-module/components/site-editor-routes/navigation-item.mjs.map +1 -1
  282. package/build-module/components/site-editor-routes/navigation.mjs +1 -1
  283. package/build-module/components/site-editor-routes/navigation.mjs.map +1 -1
  284. package/build-module/components/site-editor-routes/notfound.mjs +1 -1
  285. package/build-module/components/site-editor-routes/notfound.mjs.map +1 -1
  286. package/build-module/components/site-editor-routes/page-item.mjs +1 -1
  287. package/build-module/components/site-editor-routes/page-item.mjs.map +1 -1
  288. package/build-module/components/site-editor-routes/pages.mjs +1 -1
  289. package/build-module/components/site-editor-routes/pages.mjs.map +1 -1
  290. package/build-module/components/site-editor-routes/pattern-item.mjs +1 -1
  291. package/build-module/components/site-editor-routes/pattern-item.mjs.map +1 -1
  292. package/build-module/components/site-editor-routes/patterns.mjs +1 -1
  293. package/build-module/components/site-editor-routes/patterns.mjs.map +1 -1
  294. package/build-module/components/site-editor-routes/stylebook.mjs +1 -1
  295. package/build-module/components/site-editor-routes/stylebook.mjs.map +1 -1
  296. package/build-module/components/site-editor-routes/styles.mjs +1 -1
  297. package/build-module/components/site-editor-routes/styles.mjs.map +1 -1
  298. package/build-module/components/site-editor-routes/template-item.mjs +1 -1
  299. package/build-module/components/site-editor-routes/template-item.mjs.map +1 -1
  300. package/build-module/components/site-editor-routes/template-part-item.mjs +1 -1
  301. package/build-module/components/site-editor-routes/template-part-item.mjs.map +1 -1
  302. package/build-module/components/site-editor-routes/templates.mjs +3 -5
  303. package/build-module/components/site-editor-routes/templates.mjs.map +3 -3
  304. package/build-module/components/site-hub/index.mjs +1 -1
  305. package/build-module/components/site-hub/index.mjs.map +1 -1
  306. package/build-module/components/welcome-guide/editor.mjs +1 -1
  307. package/build-module/components/welcome-guide/editor.mjs.map +1 -1
  308. package/build-module/components/welcome-guide/image.mjs +1 -1
  309. package/build-module/components/welcome-guide/image.mjs.map +1 -1
  310. package/build-module/components/welcome-guide/index.mjs +1 -1
  311. package/build-module/components/welcome-guide/index.mjs.map +1 -1
  312. package/build-module/components/welcome-guide/page.mjs +1 -1
  313. package/build-module/components/welcome-guide/page.mjs.map +1 -1
  314. package/build-module/components/welcome-guide/template.mjs +1 -1
  315. package/build-module/components/welcome-guide/template.mjs.map +1 -1
  316. package/build-module/deprecated.mjs +1 -1
  317. package/build-module/deprecated.mjs.map +1 -1
  318. package/build-module/index.mjs +1 -2
  319. package/build-module/index.mjs.map +3 -3
  320. package/build-style/style-rtl.css +38 -81
  321. package/build-style/style.css +38 -81
  322. package/package.json +42 -52
  323. package/src/components/add-new-template/style.scss +8 -21
  324. package/src/components/add-new-template/utils.js +118 -9
  325. package/src/components/dataviews-actions/index.js +0 -61
  326. package/src/components/editor/use-adapt-editor-to-canvas.js +0 -21
  327. package/src/components/layout/{index.js → index.jsx} +5 -2
  328. package/src/components/more-menu/{welcome-guide-menu-item.js → welcome-guide-menu-item.jsx} +8 -3
  329. package/src/components/page-templates/fields.jsx +51 -0
  330. package/src/components/page-templates/{index-legacy.js → index.jsx} +1 -1
  331. package/src/components/post-list/{index.js → index.jsx} +7 -20
  332. package/src/components/sidebar-global-styles/{index.js → index.jsx} +7 -5
  333. package/src/components/sidebar-global-styles/style.scss +6 -0
  334. package/src/components/sidebar-identity/{index.js → index.jsx} +23 -19
  335. package/src/components/sidebar-identity/style.scss +7 -0
  336. package/src/components/sidebar-navigation-item/{index.js → index.jsx} +1 -7
  337. package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +1 -1
  338. package/src/components/sidebar-navigation-screen-navigation-menus/{index.js → index.jsx} +1 -1
  339. package/src/components/sidebar-navigation-screen-navigation-menus/{navigation-menu-content.js → navigation-menu-content.jsx} +1 -1
  340. package/src/components/sidebar-navigation-screen-templates-browse/{index.js → index.jsx} +1 -8
  341. package/src/components/site-editor-routes/{templates.js → templates.jsx} +2 -19
  342. package/src/components/welcome-guide/style.scss +1 -1
  343. package/src/{index.js → index.jsx} +0 -1
  344. package/src/style.scss +1 -1
  345. package/src/utils/test/get-filtered-template-parts.js +1 -0
  346. package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs +0 -107
  347. package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs.map +0 -7
  348. package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs +0 -327
  349. package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs.map +0 -7
  350. package/build/components/add-new-template-legacy/index.cjs +0 -390
  351. package/build/components/add-new-template-legacy/index.cjs.map +0 -7
  352. package/build/components/add-new-template-legacy/utils.cjs +0 -623
  353. package/build/components/add-new-template-legacy/utils.cjs.map +0 -7
  354. package/build/components/page-templates/hooks.cjs +0 -94
  355. package/build/components/page-templates/hooks.cjs.map +0 -7
  356. package/build/components/page-templates/index-legacy.cjs +0 -167
  357. package/build/components/page-templates/index-legacy.cjs.map +0 -7
  358. package/build/components/page-templates/view-utils.cjs +0 -79
  359. package/build/components/page-templates/view-utils.cjs.map +0 -7
  360. package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs +0 -78
  361. package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs.map +0 -7
  362. package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs +0 -91
  363. package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs.map +0 -7
  364. package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs +0 -315
  365. package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs.map +0 -7
  366. package/build-module/components/add-new-template-legacy/index.mjs +0 -391
  367. package/build-module/components/add-new-template-legacy/index.mjs.map +0 -7
  368. package/build-module/components/add-new-template-legacy/utils.mjs +0 -592
  369. package/build-module/components/add-new-template-legacy/utils.mjs.map +0 -7
  370. package/build-module/components/page-templates/hooks.mjs +0 -74
  371. package/build-module/components/page-templates/hooks.mjs.map +0 -7
  372. package/build-module/components/page-templates/index-legacy.mjs +0 -136
  373. package/build-module/components/page-templates/index-legacy.mjs.map +0 -7
  374. package/build-module/components/page-templates/view-utils.mjs +0 -52
  375. package/build-module/components/page-templates/view-utils.mjs.map +0 -7
  376. package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs +0 -52
  377. package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs.map +0 -7
  378. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +0 -85
  379. package/src/components/add-new-template/add-custom-template-modal-content.js +0 -304
  380. package/src/components/add-new-template/index.js +0 -435
  381. package/src/components/add-new-template-legacy/utils.js +0 -757
  382. package/src/components/page-templates/fields.js +0 -195
  383. package/src/components/page-templates/hooks.js +0 -93
  384. package/src/components/page-templates/index.js +0 -369
  385. package/src/components/page-templates/view-utils.js +0 -50
  386. package/src/components/sidebar-navigation-screen-templates-browse/content.js +0 -87
  387. package/src/components/sidebar-navigation-screen-templates-browse/style.scss +0 -6
  388. /package/src/components/add-new-pattern/{index.js → index.jsx} +0 -0
  389. /package/src/components/add-new-post/{index.js → index.jsx} +0 -0
  390. /package/src/components/{add-new-template-legacy/add-custom-generic-template-modal-content.js → add-new-template/add-custom-generic-template-modal-content.jsx} +0 -0
  391. /package/src/components/{add-new-template-legacy/add-custom-template-modal-content.js → add-new-template/add-custom-template-modal-content.jsx} +0 -0
  392. /package/src/components/{add-new-template-legacy/index.js → add-new-template/index.jsx} +0 -0
  393. /package/src/components/app/{index.js → index.jsx} +0 -0
  394. /package/src/components/canvas-loader/{index.js → index.jsx} +0 -0
  395. /package/src/components/editor/{index.js → index.jsx} +0 -0
  396. /package/src/components/editor/{site-preview.js → site-preview.jsx} +0 -0
  397. /package/src/components/media/{index.js → index.jsx} +0 -0
  398. /package/src/components/more-menu/{index.js → index.jsx} +0 -0
  399. /package/src/components/page-patterns/{actions.js → actions.jsx} +0 -0
  400. /package/src/components/page-patterns/{delete-category-menu-item.js → delete-category-menu-item.jsx} +0 -0
  401. /package/src/components/page-patterns/{fields.js → fields.jsx} +0 -0
  402. /package/src/components/page-patterns/{index.js → index.jsx} +0 -0
  403. /package/src/components/page-patterns/{rename-category-menu-item.js → rename-category-menu-item.jsx} +0 -0
  404. /package/src/components/pagination/{index.js → index.jsx} +0 -0
  405. /package/src/components/plugin-template-setting-panel/{index.js → index.jsx} +0 -0
  406. /package/src/components/post-list/{quick-edit-modal.js → quick-edit-modal.jsx} +0 -0
  407. /package/src/components/resizable-frame/{index.js → index.jsx} +0 -0
  408. /package/src/components/save-button/{index.js → index.jsx} +0 -0
  409. /package/src/components/save-hub/{index.js → index.jsx} +0 -0
  410. /package/src/components/save-panel/{index.js → index.jsx} +0 -0
  411. /package/src/components/sidebar/{index.js → index.jsx} +0 -0
  412. /package/src/components/sidebar-button/{index.js → index.jsx} +0 -0
  413. /package/src/components/sidebar-dataviews/{index.js → index.jsx} +0 -0
  414. /package/src/components/sidebar-navigation-screen/{index.js → index.jsx} +0 -0
  415. /package/src/components/sidebar-navigation-screen-details-footer/{index.js → index.jsx} +0 -0
  416. /package/src/components/sidebar-navigation-screen-global-styles/{content.js → content.jsx} +0 -0
  417. /package/src/components/sidebar-navigation-screen-global-styles/{index.js → index.jsx} +0 -0
  418. /package/src/components/sidebar-navigation-screen-identity/{index.js → index.jsx} +0 -0
  419. /package/src/components/sidebar-navigation-screen-main/{index.js → index.jsx} +0 -0
  420. /package/src/components/sidebar-navigation-screen-navigation-menu/{delete-confirm-dialog.js → delete-confirm-dialog.jsx} +0 -0
  421. /package/src/components/sidebar-navigation-screen-navigation-menu/{index.js → index.jsx} +0 -0
  422. /package/src/components/sidebar-navigation-screen-navigation-menu/{more-menu.js → more-menu.jsx} +0 -0
  423. /package/src/components/sidebar-navigation-screen-navigation-menu/{navigation-menu-editor.js → navigation-menu-editor.jsx} +0 -0
  424. /package/src/components/sidebar-navigation-screen-navigation-menu/{rename-modal.js → rename-modal.jsx} +0 -0
  425. /package/src/components/sidebar-navigation-screen-navigation-menu/{single-navigation-menu.js → single-navigation-menu.jsx} +0 -0
  426. /package/src/components/sidebar-navigation-screen-navigation-menus/{leaf-more-menu.js → leaf-more-menu.jsx} +0 -0
  427. /package/src/components/sidebar-navigation-screen-patterns/{category-item.js → category-item.jsx} +0 -0
  428. /package/src/components/sidebar-navigation-screen-patterns/{index.js → index.jsx} +0 -0
  429. /package/src/components/sidebar-navigation-screen-templates-browse/{content-legacy.js → content.jsx} +0 -0
  430. /package/src/components/sidebar-navigation-screen-unsupported/{index.js → index.jsx} +0 -0
  431. /package/src/components/site-editor-routes/{home.js → home.jsx} +0 -0
  432. /package/src/components/site-editor-routes/{identity.js → identity.jsx} +0 -0
  433. /package/src/components/site-editor-routes/{navigation-item.js → navigation-item.jsx} +0 -0
  434. /package/src/components/site-editor-routes/{navigation.js → navigation.jsx} +0 -0
  435. /package/src/components/site-editor-routes/{notfound.js → notfound.jsx} +0 -0
  436. /package/src/components/site-editor-routes/{page-item.js → page-item.jsx} +0 -0
  437. /package/src/components/site-editor-routes/{pages.js → pages.jsx} +0 -0
  438. /package/src/components/site-editor-routes/{pattern-item.js → pattern-item.jsx} +0 -0
  439. /package/src/components/site-editor-routes/{patterns.js → patterns.jsx} +0 -0
  440. /package/src/components/site-editor-routes/{stylebook.js → stylebook.jsx} +0 -0
  441. /package/src/components/site-editor-routes/{styles.js → styles.jsx} +0 -0
  442. /package/src/components/site-editor-routes/{template-item.js → template-item.jsx} +0 -0
  443. /package/src/components/site-editor-routes/{template-part-item.js → template-part-item.jsx} +0 -0
  444. /package/src/components/site-hub/{index.js → index.jsx} +0 -0
  445. /package/src/components/welcome-guide/{editor.js → editor.jsx} +0 -0
  446. /package/src/components/welcome-guide/{image.js → image.jsx} +0 -0
  447. /package/src/components/welcome-guide/{index.js → index.jsx} +0 -0
  448. /package/src/components/welcome-guide/{page.js → page.jsx} +0 -0
  449. /package/src/components/welcome-guide/{template.js → template.jsx} +0 -0
  450. /package/src/{deprecated.js → deprecated.jsx} +0 -0
@@ -197,6 +197,7 @@ export function usePostTypeArchiveMenuItems() {
197
197
 
198
198
  export const usePostTypeMenuItems = ( onClickMenuItem ) => {
199
199
  const publicPostTypes = usePublicPostTypes();
200
+ const existingTemplates = useExistingTemplates();
200
201
  const defaultTemplateTypes = useDefaultTemplateTypes();
201
202
  // We need to keep track of naming conflicts. If a conflict
202
203
  // occurs, we need to add slug.
@@ -236,6 +237,9 @@ export const usePostTypeMenuItems = ( onClickMenuItem ) => {
236
237
  [ publicPostTypes ]
237
238
  );
238
239
  const postTypesInfo = useEntitiesInfo( 'postType', templatePrefixes );
240
+ const existingTemplateSlugs = ( existingTemplates || [] ).map(
241
+ ( { slug } ) => slug
242
+ );
239
243
  const menuItems = ( publicPostTypes || [] ).reduce(
240
244
  ( accumulator, postType ) => {
241
245
  const { slug, labels, icon } = postType;
@@ -246,6 +250,8 @@ export const usePostTypeMenuItems = ( onClickMenuItem ) => {
246
250
  const defaultTemplateType = defaultTemplateTypes?.find(
247
251
  ( { slug: _slug } ) => _slug === generalTemplateSlug
248
252
  );
253
+ const hasGeneralTemplate =
254
+ existingTemplateSlugs?.includes( generalTemplateSlug );
249
255
  const _needsUniqueIdentifier = needsUniqueIdentifier( postType );
250
256
  let menuItemTitle =
251
257
  labels.template_name ||
@@ -326,12 +332,14 @@ export const usePostTypeMenuItems = ( onClickMenuItem ) => {
326
332
  },
327
333
  },
328
334
  labels,
335
+ hasGeneralTemplate,
329
336
  template,
330
337
  } );
331
338
  };
332
339
  }
333
- // We don't need to add the menu item if there are no entities.
334
- if ( hasEntities ) {
340
+ // We don't need to add the menu item if there are no
341
+ // entities and the general template exists.
342
+ if ( ! hasGeneralTemplate || hasEntities ) {
335
343
  accumulator.push( menuItem );
336
344
  }
337
345
  return accumulator;
@@ -564,11 +572,7 @@ export function useAuthorMenuItem( onClickMenuItem ) {
564
572
  suggestion.slug
565
573
  );
566
574
  return {
567
- title: sprintf(
568
- // translators: %s: Name of the author e.g: "Admin".
569
- __( 'Author: %s' ),
570
- suggestion.name
571
- ),
575
+ title: templateSlug,
572
576
  slug: templateSlug,
573
577
  templatePrefix: 'author',
574
578
  };
@@ -590,6 +594,91 @@ export function useAuthorMenuItem( onClickMenuItem ) {
590
594
  }
591
595
  }
592
596
 
597
+ /**
598
+ * Helper hook that filters all the existing templates by the given
599
+ * object with the entity's slug as key and the template prefix as value.
600
+ *
601
+ * Example:
602
+ * `existingTemplates` is: [ { slug: 'tag-apple' }, { slug: 'page-about' }, { slug: 'tag' } ]
603
+ * `templatePrefixes` is: { post_tag: 'tag' }
604
+ * It will return: { post_tag: ['apple'] }
605
+ *
606
+ * Note: We append the `-` to the given template prefix in this function for our checks.
607
+ *
608
+ * @param {Record<string,string>} templatePrefixes An object with the entity's slug as key and the template prefix as value.
609
+ * @return {Record<string,string[]>} An object with the entity's slug as key and an array with the existing template slugs as value.
610
+ */
611
+ const useExistingTemplateSlugs = ( templatePrefixes ) => {
612
+ const existingTemplates = useExistingTemplates();
613
+ const existingSlugs = useMemo( () => {
614
+ return Object.entries( templatePrefixes || {} ).reduce(
615
+ ( accumulator, [ slug, prefix ] ) => {
616
+ const slugsWithTemplates = ( existingTemplates || [] ).reduce(
617
+ ( _accumulator, existingTemplate ) => {
618
+ const _prefix = `${ prefix }-`;
619
+ if ( existingTemplate.slug.startsWith( _prefix ) ) {
620
+ _accumulator.push(
621
+ existingTemplate.slug.substring(
622
+ _prefix.length
623
+ )
624
+ );
625
+ }
626
+ return _accumulator;
627
+ },
628
+ []
629
+ );
630
+ if ( slugsWithTemplates.length ) {
631
+ accumulator[ slug ] = slugsWithTemplates;
632
+ }
633
+ return accumulator;
634
+ },
635
+ {}
636
+ );
637
+ }, [ templatePrefixes, existingTemplates ] );
638
+ return existingSlugs;
639
+ };
640
+
641
+ /**
642
+ * Helper hook that finds the existing records with an associated template,
643
+ * as they need to be excluded from the template suggestions.
644
+ *
645
+ * @param {string} entityName The entity's name.
646
+ * @param {Record<string,string>} templatePrefixes An object with the entity's slug as key and the template prefix as value.
647
+ * @param {Record<string,Object>} additionalQueryParameters An object with the entity's slug as key and additional query parameters as value.
648
+ * @return {Record<string,EntitiesInfo>} An object with the entity's slug as key and the existing records as value.
649
+ */
650
+ const useTemplatesToExclude = (
651
+ entityName,
652
+ templatePrefixes,
653
+ additionalQueryParameters = {}
654
+ ) => {
655
+ const slugsToExcludePerEntity =
656
+ useExistingTemplateSlugs( templatePrefixes );
657
+ const recordsToExcludePerEntity = useSelect(
658
+ ( select ) => {
659
+ return Object.entries( slugsToExcludePerEntity || {} ).reduce(
660
+ ( accumulator, [ slug, slugsWithTemplates ] ) => {
661
+ const entitiesWithTemplates = select(
662
+ coreStore
663
+ ).getEntityRecords( entityName, slug, {
664
+ _fields: 'id',
665
+ context: 'view',
666
+ slug: slugsWithTemplates,
667
+ ...additionalQueryParameters[ slug ],
668
+ } );
669
+ if ( entitiesWithTemplates?.length ) {
670
+ accumulator[ slug ] = entitiesWithTemplates;
671
+ }
672
+ return accumulator;
673
+ },
674
+ {}
675
+ );
676
+ },
677
+ [ slugsToExcludePerEntity ]
678
+ );
679
+ return recordsToExcludePerEntity;
680
+ };
681
+
593
682
  /**
594
683
  * Helper hook that returns information about an entity having
595
684
  * records that we can create a specific template for.
@@ -610,10 +699,19 @@ const useEntitiesInfo = (
610
699
  templatePrefixes,
611
700
  additionalQueryParameters = EMPTY_OBJECT
612
701
  ) => {
702
+ const recordsToExcludePerEntity = useTemplatesToExclude(
703
+ entityName,
704
+ templatePrefixes,
705
+ additionalQueryParameters
706
+ );
613
707
  const entitiesHasRecords = useSelect(
614
708
  ( select ) => {
615
709
  return Object.keys( templatePrefixes || {} ).reduce(
616
710
  ( accumulator, slug ) => {
711
+ const existingEntitiesIds =
712
+ recordsToExcludePerEntity?.[ slug ]?.map(
713
+ ( { id } ) => id
714
+ ) || [];
617
715
  const records = select( coreStore ).getEntityRecords(
618
716
  entityName,
619
717
  slug,
@@ -621,6 +719,7 @@ const useEntitiesInfo = (
621
719
  per_page: 1,
622
720
  _fields: 'id',
623
721
  context: 'view',
722
+ exclude: existingEntitiesIds,
624
723
  ...additionalQueryParameters[ slug ],
625
724
  }
626
725
  );
@@ -631,18 +730,28 @@ const useEntitiesInfo = (
631
730
  {}
632
731
  );
633
732
  },
634
- [ templatePrefixes, entityName, additionalQueryParameters ]
733
+ [
734
+ templatePrefixes,
735
+ recordsToExcludePerEntity,
736
+ entityName,
737
+ additionalQueryParameters,
738
+ ]
635
739
  );
636
740
  const entitiesInfo = useMemo( () => {
637
741
  return Object.keys( templatePrefixes || {} ).reduce(
638
742
  ( accumulator, slug ) => {
743
+ const existingEntitiesIds =
744
+ recordsToExcludePerEntity?.[ slug ]?.map(
745
+ ( { id } ) => id
746
+ ) || [];
639
747
  accumulator[ slug ] = {
640
748
  hasEntities: entitiesHasRecords[ slug ],
749
+ existingEntitiesIds,
641
750
  };
642
751
  return accumulator;
643
752
  },
644
753
  {}
645
754
  );
646
- }, [ templatePrefixes, entitiesHasRecords ] );
755
+ }, [ templatePrefixes, recordsToExcludePerEntity, entitiesHasRecords ] );
647
756
  return entitiesInfo;
648
757
  };
@@ -2,73 +2,12 @@ import { __ } from '@wordpress/i18n';
2
2
  import { pencil, drawerRight } from '@wordpress/icons';
3
3
  import { useMemo } from '@wordpress/element';
4
4
  import { privateApis as routerPrivateApis } from '@wordpress/router';
5
- import { useDispatch, useSelect } from '@wordpress/data';
6
- import { store as coreStore } from '@wordpress/core-data';
7
5
  import { addQueryArgs } from '@wordpress/url';
8
6
  import { PATTERN_TYPES } from '../../utils/constants';
9
7
  import { unlock } from '../../lock-unlock';
10
8
 
11
9
  const { useLocation, useHistory } = unlock( routerPrivateApis );
12
10
 
13
- export const useSetActiveTemplateAction = () => {
14
- const activeTheme = useSelect( ( select ) =>
15
- select( coreStore ).getCurrentTheme()
16
- );
17
- const { getEntityRecord } = useSelect( coreStore );
18
- const { editEntityRecord, saveEditedEntityRecord } =
19
- useDispatch( coreStore );
20
- return useMemo(
21
- () => ( {
22
- id: 'set-active-template',
23
- label( items ) {
24
- return items.some( ( item ) => item._isActive )
25
- ? __( 'Deactivate' )
26
- : __( 'Activate' );
27
- },
28
- isPrimary: true,
29
- icon: pencil,
30
- isEligible( item ) {
31
- if ( item.theme !== activeTheme.stylesheet ) {
32
- return false;
33
- }
34
-
35
- // If it's not a created template but a registered template,
36
- // only allow activating (so when it's inactive).
37
- if ( typeof item.id !== 'number' ) {
38
- return item._isActive === false;
39
- }
40
-
41
- return true;
42
- },
43
- async callback( items ) {
44
- const deactivate = items.some( ( item ) => item._isActive );
45
- // current active templates
46
- const activeTemplates = {
47
- ...( ( await getEntityRecord( 'root', 'site' )
48
- .active_templates ) ?? {} ),
49
- };
50
- for ( const item of items ) {
51
- if ( deactivate ) {
52
- delete activeTemplates[ item.slug ];
53
- } else {
54
- activeTemplates[ item.slug ] = item.id;
55
- }
56
- }
57
- await editEntityRecord( 'root', 'site', undefined, {
58
- active_templates: activeTemplates,
59
- } );
60
- await saveEditedEntityRecord( 'root', 'site' );
61
- },
62
- } ),
63
- [
64
- editEntityRecord,
65
- saveEditedEntityRecord,
66
- getEntityRecord,
67
- activeTheme,
68
- ]
69
- );
70
- };
71
-
72
11
  export const useEditPostAction = () => {
73
12
  const history = useHistory();
74
13
  return useMemo(
@@ -2,7 +2,6 @@ import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
2
2
  import { store as blockEditorStore } from '@wordpress/block-editor';
3
3
  import { store as editorStore } from '@wordpress/editor';
4
4
  import { useLayoutEffect } from '@wordpress/element';
5
- import { store as preferencesStore } from '@wordpress/preferences';
6
5
  import { DEFAULT_DEVICE_TYPE } from '../block-editor/viewport';
7
6
 
8
7
  export function useAdaptEditorToCanvas( canvas ) {
@@ -11,15 +10,11 @@ export function useAdaptEditorToCanvas( canvas ) {
11
10
  editPost,
12
11
  setDeviceType,
13
12
  closePublishSidebar,
14
- setIsListViewOpened,
15
13
  setIsInserterOpened,
16
14
  } = useDispatch( editorStore );
17
- const { get: getPreference } = useSelect( preferencesStore );
18
15
  const { getCurrentPost } = useSelect( editorStore );
19
16
  const registry = useRegistry();
20
17
  useLayoutEffect( () => {
21
- const isMediumOrBigger =
22
- window.matchMedia( '(min-width: 782px)' ).matches;
23
18
  registry.batch( () => {
24
19
  clearSelectedBlock();
25
20
  if ( getCurrentPost()?.type ) {
@@ -28,20 +23,6 @@ export function useAdaptEditorToCanvas( canvas ) {
28
23
  setDeviceType( DEFAULT_DEVICE_TYPE );
29
24
  closePublishSidebar();
30
25
  setIsInserterOpened( false );
31
-
32
- // Check if the block list view should be open by default.
33
- // If `distractionFree` mode is enabled, the block list view should not be open.
34
- // This behavior is disabled for small viewports.
35
- if (
36
- isMediumOrBigger &&
37
- canvas === 'edit' &&
38
- getPreference( 'core', 'showListViewByDefault' ) &&
39
- ! getPreference( 'core', 'distractionFree' )
40
- ) {
41
- setIsListViewOpened( true );
42
- } else {
43
- setIsListViewOpened( false );
44
- }
45
26
  } );
46
27
  }, [
47
28
  canvas,
@@ -51,8 +32,6 @@ export function useAdaptEditorToCanvas( canvas ) {
51
32
  setDeviceType,
52
33
  closePublishSidebar,
53
34
  setIsInserterOpened,
54
- setIsListViewOpened,
55
- getPreference,
56
35
  getCurrentPost,
57
36
  ] );
58
37
  }
@@ -41,7 +41,8 @@ const { useLocation } = unlock( routerPrivateApis );
41
41
  const { useStyle, UploadProgressSnackbar } = unlock( editorPrivateApis );
42
42
 
43
43
  const ANIMATION_DURATION = 0.3;
44
- const CONTENT_COLOR = { background: '#ffffff' };
44
+ // Reset to the default background color.
45
+ const CONTENT_COLOR = { background: '#fcfcfc' };
45
46
 
46
47
  function Layout() {
47
48
  const { query, name: routeKey, areas, widths } = useLocation();
@@ -321,7 +322,9 @@ export default function LayoutWithGlobalStylesProvider( props ) {
321
322
  } }
322
323
  >
323
324
  <ThemeProvider color={ themeColors }>
324
- <Layout { ...props } />
325
+ <ErrorBoundary>
326
+ <Layout { ...props } />
327
+ </ErrorBoundary>
325
328
  </ThemeProvider>
326
329
  </ThemeProvider>
327
330
  </Tooltip.Provider>
@@ -1,14 +1,19 @@
1
1
  import { __ } from '@wordpress/i18n';
2
2
  import { useDispatch } from '@wordpress/data';
3
- import { MenuItem } from '@wordpress/components';
3
+ import { privateApis as editorPrivateApis } from '@wordpress/editor';
4
4
  import { store as preferencesStore } from '@wordpress/preferences';
5
+ import { unlock } from '../../lock-unlock';
6
+
7
+ const { MoreMenuItem } = unlock( editorPrivateApis );
5
8
 
6
9
  export default function WelcomeGuideMenuItem() {
7
10
  const { toggle } = useDispatch( preferencesStore );
8
11
 
9
12
  return (
10
- <MenuItem onClick={ () => toggle( 'core/edit-site', 'welcomeGuide' ) }>
13
+ <MoreMenuItem
14
+ onClick={ () => toggle( 'core/edit-site', 'welcomeGuide' ) }
15
+ >
11
16
  { __( 'Welcome Guide' ) }
12
- </MenuItem>
17
+ </MoreMenuItem>
13
18
  );
14
19
  }
@@ -0,0 +1,51 @@
1
+ import { __ } from '@wordpress/i18n';
2
+ import { useMemo } from '@wordpress/element';
3
+ import { parse } from '@wordpress/blocks';
4
+ import { BlockPreview } from '@wordpress/block-editor';
5
+ import {
6
+ EditorProvider,
7
+ privateApis as editorPrivateApis,
8
+ } from '@wordpress/editor';
9
+ import usePatternSettings from '../page-patterns/use-pattern-settings';
10
+ import { unlock } from '../../lock-unlock';
11
+
12
+ const { useStyle } = unlock( editorPrivateApis );
13
+
14
+ function PreviewField( { item } ) {
15
+ const settings = usePatternSettings();
16
+ const backgroundColor = useStyle( 'color.background' ) ?? 'white';
17
+ const blocks = useMemo( () => {
18
+ return parse( item.content.raw );
19
+ }, [ item.content.raw ] );
20
+
21
+ const isEmpty = ! blocks?.length;
22
+ // Wrap everything in a block editor provider to ensure 'styles' that are needed
23
+ // for the previews are synced between the site editor store and the block editor store.
24
+ // Additionally we need to have the `__experimentalBlockPatterns` setting in order to
25
+ // render patterns inside the previews.
26
+ // TODO: Same approach is used in the patterns list and it becomes obvious that some of
27
+ // the block editor settings are needed in context where we don't have the block editor.
28
+ // Explore how we can solve this in a better way.
29
+ return (
30
+ <EditorProvider post={ item } settings={ settings }>
31
+ <div
32
+ className="page-templates-preview-field"
33
+ style={ { backgroundColor } }
34
+ >
35
+ { isEmpty && __( 'Empty template' ) }
36
+ { ! isEmpty && (
37
+ <BlockPreview.Async>
38
+ <BlockPreview blocks={ blocks } />
39
+ </BlockPreview.Async>
40
+ ) }
41
+ </div>
42
+ </EditorProvider>
43
+ );
44
+ }
45
+
46
+ export const previewField = {
47
+ label: __( 'Preview' ),
48
+ id: 'preview',
49
+ render: PreviewField,
50
+ enableSorting: false,
51
+ };
@@ -8,7 +8,7 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
8
8
  import { addQueryArgs } from '@wordpress/url';
9
9
  import { useEvent } from '@wordpress/compose';
10
10
  import { useView, useViewConfig } from '@wordpress/views';
11
- import AddNewTemplate from '../add-new-template-legacy';
11
+ import AddNewTemplate from '../add-new-template';
12
12
  import { TEMPLATE_POST_TYPE } from '../../utils/constants';
13
13
  import { unlock } from '../../lock-unlock';
14
14
  import { useEditPostAction } from '../dataviews-actions';
@@ -7,7 +7,7 @@ import {
7
7
  import { useState, useMemo, useCallback, useEffect } from '@wordpress/element';
8
8
  import { privateApis as routerPrivateApis } from '@wordpress/router';
9
9
  import { useSelect } from '@wordpress/data';
10
- import { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';
10
+ import { DataViews } from '@wordpress/dataviews';
11
11
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
12
12
  import { useEvent, usePrevious } from '@wordpress/compose';
13
13
  import { addQueryArgs } from '@wordpress/url';
@@ -176,27 +176,14 @@ export default function PostList( { postType } ) {
176
176
  const { notesCount, isLoading: isLoadingNotesCount } =
177
177
  useNotesCount( postIds );
178
178
 
179
- // The REST API sort the authors by ID, but we want to sort them by name.
180
- const data = useMemo( () => {
181
- let processedRecords = records;
182
-
183
- if ( view?.sort?.field === 'author' ) {
184
- processedRecords = filterSortAndPaginate(
185
- records,
186
- { sort: { ...view.sort } },
187
- fields
188
- ).data;
189
- }
190
-
191
- if ( processedRecords ) {
192
- return processedRecords.map( ( record ) => ( {
179
+ const data = useMemo(
180
+ () =>
181
+ records?.map( ( record ) => ( {
193
182
  ...record,
194
183
  notesCount: notesCount[ record.id ] ?? 0,
195
- } ) );
196
- }
197
-
198
- return processedRecords;
199
- }, [ records, fields, view?.sort, notesCount ] );
184
+ } ) ),
185
+ [ records, notesCount ]
186
+ );
200
187
 
201
188
  const ids = data?.map( ( record ) => getItemId( record ) ) ?? [];
202
189
  const prevIds = usePrevious( ids ) ?? [];
@@ -98,11 +98,13 @@ export default function SidebarGlobalStyles() {
98
98
  title={ __( 'Styles' ) }
99
99
  headingLevel={ 2 }
100
100
  >
101
- <GlobalStylesUIWrapper
102
- path={ section }
103
- onPathChange={ onChangeSection }
104
- settings={ settings }
105
- />
101
+ <div className="edit-site-styles__content">
102
+ <GlobalStylesUIWrapper
103
+ path={ section }
104
+ onPathChange={ onChangeSection }
105
+ settings={ settings }
106
+ />
107
+ </div>
106
108
  </Page>
107
109
  );
108
110
  }
@@ -31,6 +31,12 @@
31
31
  }
32
32
  }
33
33
 
34
+ .edit-site-styles__content {
35
+ flex-grow: 1;
36
+ min-height: 0;
37
+ background-color: var(--wpds-color-background-surface-neutral-strong);
38
+ }
39
+
34
40
  // Show button text labels when preference is enabled.
35
41
  .show-icon-labels {
36
42
  .edit-site-styles__header-actions {
@@ -5,6 +5,11 @@ import { store as coreStore } from '@wordpress/core-data';
5
5
  import { DataForm } from '@wordpress/dataviews';
6
6
  import { MediaEdit } from '@wordpress/fields';
7
7
  import { decodeEntities } from '@wordpress/html-entities';
8
+ import { useViewConfig } from '@wordpress/views';
9
+
10
+ // The screen only renders a form, so it requests the `form` of the entity
11
+ // view configuration alone.
12
+ const VIEW_CONFIG_FIELDS = [ 'form' ];
8
13
 
9
14
  const fields = [
10
15
  {
@@ -53,14 +58,6 @@ const fields = [
53
58
  },
54
59
  ];
55
60
 
56
- const form = {
57
- layout: {
58
- type: 'regular',
59
- labelPosition: 'top',
60
- },
61
- fields: [ 'title', 'description', 'site_logo', 'site_icon' ],
62
- };
63
-
64
61
  export default function SidebarIdentity() {
65
62
  const data = useSelect(
66
63
  ( select ) =>
@@ -68,23 +65,30 @@ export default function SidebarIdentity() {
68
65
  []
69
66
  );
70
67
  const { editEntityRecord } = useDispatch( coreStore );
68
+ const { form } = useViewConfig( {
69
+ kind: 'root',
70
+ name: 'site',
71
+ fields: VIEW_CONFIG_FIELDS,
72
+ } );
71
73
 
72
74
  const onChange = ( edits ) => {
73
75
  editEntityRecord( 'root', 'site', undefined, edits );
74
76
  };
75
77
 
78
+ if ( ! form ) {
79
+ return null;
80
+ }
81
+
76
82
  return (
77
- <Page
78
- title={ _x( 'Identity', 'site identity' ) }
79
- headingLevel={ 2 }
80
- hasPadding
81
- >
82
- <DataForm
83
- data={ data }
84
- fields={ fields }
85
- form={ form }
86
- onChange={ onChange }
87
- />
83
+ <Page title={ _x( 'Identity', 'site identity' ) } headingLevel={ 2 }>
84
+ <div className="edit-site-sidebar-identity__form">
85
+ <DataForm
86
+ data={ data }
87
+ fields={ fields }
88
+ form={ form }
89
+ onChange={ onChange }
90
+ />
91
+ </div>
88
92
  </Page>
89
93
  );
90
94
  }
@@ -0,0 +1,7 @@
1
+ .edit-site-sidebar-identity__form {
2
+ flex-grow: 1;
3
+ min-height: 0;
4
+ overflow: auto;
5
+ background-color: var(--wpds-color-background-surface-neutral-strong);
6
+ padding: var(--wpds-dimension-padding-lg) var(--wpds-dimension-padding-2xl);
7
+ }
@@ -65,13 +65,7 @@ function SidebarNavigationItemContent( {
65
65
  { ...props }
66
66
  >
67
67
  <Stack direction="row" align="center" justify="start" gap="sm">
68
- { icon && (
69
- <Icon
70
- style={ { fill: 'currentcolor' } }
71
- icon={ icon }
72
- size={ 24 }
73
- />
74
- ) }
68
+ { icon && <Icon icon={ icon } size={ 24 } /> }
75
69
  <FlexBlock>{ children }</FlexBlock>
76
70
  { withChevron && (
77
71
  <Icon
@@ -1,7 +1,7 @@
1
1
  import { __, _x, sprintf } from '@wordpress/i18n';
2
2
  import { decodeEntities } from '@wordpress/html-entities';
3
3
 
4
- // Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
4
+ // Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.jsx.
5
5
  export default function buildNavigationLabel( title, id, status ) {
6
6
  if ( ! title?.rendered ) {
7
7
  /* translators: %s: the index of the menu in the list of menus. */
@@ -15,7 +15,7 @@ import useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-m
15
15
  import { unlock } from '../../lock-unlock';
16
16
  import { NAVIGATION_POST_TYPE } from '../../utils/constants';
17
17
 
18
- // Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
18
+ // Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.jsx.
19
19
  function buildMenuLabel( title, id, status ) {
20
20
  if ( ! title ) {
21
21
  /* translators: %s: the index of the menu in the list of menus. */
@@ -14,7 +14,7 @@ import LeafMoreMenu from './leaf-more-menu';
14
14
  const { PrivateListView } = unlock( blockEditorPrivateApis );
15
15
  const { NavigationLinkUI } = unlock( blockLibraryPrivateApis );
16
16
 
17
- // Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js.
17
+ // Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.jsx.
18
18
  const MAX_PAGE_COUNT = 100;
19
19
  const PAGES_QUERY = [
20
20
  'postType',
@@ -1,7 +1,6 @@
1
1
  import { __ } from '@wordpress/i18n';
2
2
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
3
3
  import DataviewsTemplatesSidebarContent from './content';
4
- import DataviewsTemplatesSidebarContentLegacy from './content-legacy';
5
4
 
6
5
  export default function SidebarNavigationScreenTemplatesBrowse( { backPath } ) {
7
6
  return (
@@ -11,13 +10,7 @@ export default function SidebarNavigationScreenTemplatesBrowse( { backPath } ) {
11
10
  'Manage the templates that define the structure of your pages, or reset any customizations made to those supplied by your theme.'
12
11
  ) }
13
12
  backPath={ backPath }
14
- content={
15
- window?.__experimentalTemplateActivate ? (
16
- <DataviewsTemplatesSidebarContent />
17
- ) : (
18
- <DataviewsTemplatesSidebarContentLegacy />
19
- )
20
- }
13
+ content={ <DataviewsTemplatesSidebarContent /> }
21
14
  />
22
15
  );
23
16
  }