@wordpress/edit-site 5.33.0 → 5.34.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 (272) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-page/index.js +3 -0
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +8 -7
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.js +3 -1
  9. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  10. package/build/components/block-editor/resize-handle.js +20 -5
  11. package/build/components/block-editor/resize-handle.js.map +1 -1
  12. package/build/components/create-template-part-modal/index.js +3 -0
  13. package/build/components/create-template-part-modal/index.js.map +1 -1
  14. package/build/components/editor/index.js +28 -5
  15. package/build/components/editor/index.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/context.js +9 -3
  17. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/font-collection.js +7 -2
  19. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/installed-fonts.js +22 -20
  21. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  23. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  24. package/build/components/global-styles/style-variations-container.js +8 -2
  25. package/build/components/global-styles/style-variations-container.js.map +1 -1
  26. package/build/components/header-edit-mode/index.js +33 -49
  27. package/build/components/header-edit-mode/index.js.map +1 -1
  28. package/build/components/header-edit-mode/more-menu/index.js +3 -97
  29. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  30. package/build/components/keyboard-shortcuts/register.js +0 -49
  31. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  32. package/build/components/layout/index.js +7 -4
  33. package/build/components/layout/index.js.map +1 -1
  34. package/build/components/layout/router.js +9 -38
  35. package/build/components/layout/router.js.map +1 -1
  36. package/build/components/page-pages/index.js +4 -3
  37. package/build/components/page-pages/index.js.map +1 -1
  38. package/build/components/page-patterns/dataviews-pattern-actions.js +11 -7
  39. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  40. package/build/components/page-patterns/header.js +3 -1
  41. package/build/components/page-patterns/header.js.map +1 -1
  42. package/build/components/page-patterns/index.js +20 -49
  43. package/build/components/page-patterns/index.js.map +1 -1
  44. package/build/components/page-patterns/use-patterns.js +1 -0
  45. package/build/components/page-patterns/use-patterns.js.map +1 -1
  46. package/build/components/page-templates/hooks.js.map +1 -0
  47. package/build/components/{page-templates-template-parts → page-templates}/index.js +67 -80
  48. package/build/components/page-templates/index.js.map +1 -0
  49. package/build/components/pattern-modal/duplicate.js +7 -5
  50. package/build/components/pattern-modal/duplicate.js.map +1 -1
  51. package/build/components/plugin-template-setting-panel/index.js +9 -0
  52. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  53. package/build/components/resizable-frame/index.js +9 -6
  54. package/build/components/resizable-frame/index.js.map +1 -1
  55. package/build/components/sidebar-edit-mode/index.js +3 -2
  56. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  57. package/build/components/sidebar-edit-mode/page-panels/index.js +40 -9
  58. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  59. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +24 -17
  60. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  61. package/build/components/sidebar-edit-mode/template-panel/index.js +2 -5
  62. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  63. package/build/components/sidebar-navigation-screen-page/index.js +39 -8
  64. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  65. package/build/components/sidebar-navigation-screen-pattern/index.js +6 -13
  66. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  67. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  68. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  69. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  70. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  71. package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  72. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  73. package/build/components/sidebar-navigation-screen-patterns/index.js +34 -28
  74. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  75. package/build/components/sidebar-navigation-screen-template/index.js +1 -1
  76. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  77. package/build/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  78. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  79. package/build/components/sidebar-navigation-screen-templates-browse/index.js +5 -35
  80. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  81. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
  82. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  83. package/build/components/template-actions/index.js +1 -1
  84. package/build/components/template-actions/index.js.map +1 -1
  85. package/build/deprecated.js +55 -0
  86. package/build/deprecated.js.map +1 -0
  87. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +35 -4
  88. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  89. package/build/index.js +18 -18
  90. package/build/index.js.map +1 -1
  91. package/build/utils/constants.js +1 -2
  92. package/build/utils/constants.js.map +1 -1
  93. package/build-module/components/add-new-page/index.js +3 -0
  94. package/build-module/components/add-new-page/index.js.map +1 -1
  95. package/build-module/components/add-new-pattern/index.js +8 -7
  96. package/build-module/components/add-new-pattern/index.js.map +1 -1
  97. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  98. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  99. package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -1
  100. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  101. package/build-module/components/block-editor/resize-handle.js +21 -6
  102. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  103. package/build-module/components/create-template-part-modal/index.js +3 -0
  104. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  105. package/build-module/components/editor/index.js +28 -5
  106. package/build-module/components/editor/index.js.map +1 -1
  107. package/build-module/components/global-styles/font-library-modal/context.js +9 -3
  108. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  109. package/build-module/components/global-styles/font-library-modal/font-collection.js +7 -2
  110. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  111. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +22 -20
  112. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  113. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  114. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  115. package/build-module/components/global-styles/style-variations-container.js +8 -2
  116. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  117. package/build-module/components/header-edit-mode/index.js +39 -55
  118. package/build-module/components/header-edit-mode/index.js.map +1 -1
  119. package/build-module/components/header-edit-mode/more-menu/index.js +5 -99
  120. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  121. package/build-module/components/keyboard-shortcuts/register.js +0 -49
  122. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  123. package/build-module/components/layout/index.js +7 -4
  124. package/build-module/components/layout/index.js.map +1 -1
  125. package/build-module/components/layout/router.js +9 -38
  126. package/build-module/components/layout/router.js.map +1 -1
  127. package/build-module/components/page-pages/index.js +5 -4
  128. package/build-module/components/page-pages/index.js.map +1 -1
  129. package/build-module/components/page-patterns/dataviews-pattern-actions.js +11 -7
  130. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  131. package/build-module/components/page-patterns/header.js +3 -1
  132. package/build-module/components/page-patterns/header.js.map +1 -1
  133. package/build-module/components/page-patterns/index.js +22 -51
  134. package/build-module/components/page-patterns/index.js.map +1 -1
  135. package/build-module/components/page-patterns/use-patterns.js +1 -0
  136. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  137. package/build-module/components/page-templates/hooks.js.map +1 -0
  138. package/build-module/components/{page-templates-template-parts → page-templates}/index.js +67 -80
  139. package/build-module/components/page-templates/index.js.map +1 -0
  140. package/build-module/components/pattern-modal/duplicate.js +7 -5
  141. package/build-module/components/pattern-modal/duplicate.js.map +1 -1
  142. package/build-module/components/plugin-template-setting-panel/index.js +8 -0
  143. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  144. package/build-module/components/resizable-frame/index.js +9 -6
  145. package/build-module/components/resizable-frame/index.js.map +1 -1
  146. package/build-module/components/sidebar-edit-mode/index.js +4 -3
  147. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  148. package/build-module/components/sidebar-edit-mode/page-panels/index.js +43 -12
  149. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  150. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +25 -17
  151. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  152. package/build-module/components/sidebar-edit-mode/template-panel/index.js +3 -6
  153. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  154. package/build-module/components/sidebar-navigation-screen-page/index.js +40 -9
  155. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  156. package/build-module/components/sidebar-navigation-screen-pattern/index.js +6 -13
  157. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  158. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  159. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  160. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  161. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  162. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  163. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  164. package/build-module/components/sidebar-navigation-screen-patterns/index.js +35 -29
  165. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  166. package/build-module/components/sidebar-navigation-screen-template/index.js +1 -1
  167. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  168. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  169. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  170. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +5 -35
  171. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  172. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
  173. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  174. package/build-module/components/template-actions/index.js +1 -1
  175. package/build-module/components/template-actions/index.js.map +1 -1
  176. package/build-module/deprecated.js +45 -0
  177. package/build-module/deprecated.js.map +1 -0
  178. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +34 -4
  179. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  180. package/build-module/index.js +2 -4
  181. package/build-module/index.js.map +1 -1
  182. package/build-module/utils/constants.js +0 -1
  183. package/build-module/utils/constants.js.map +1 -1
  184. package/build-style/style-rtl.css +79 -125
  185. package/build-style/style.css +79 -125
  186. package/package.json +42 -42
  187. package/src/components/add-new-page/index.js +7 -1
  188. package/src/components/add-new-pattern/index.js +15 -12
  189. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  190. package/src/components/add-new-template/add-custom-template-modal-content.js +3 -1
  191. package/src/components/block-editor/resize-handle.js +30 -11
  192. package/src/components/block-editor/style.scss +10 -15
  193. package/src/components/create-template-part-modal/index.js +3 -0
  194. package/src/components/editor/index.js +42 -3
  195. package/src/components/editor/style.scss +6 -1
  196. package/src/components/global-styles/font-library-modal/context.js +9 -3
  197. package/src/components/global-styles/font-library-modal/font-collection.js +31 -12
  198. package/src/components/global-styles/font-library-modal/installed-fonts.js +82 -54
  199. package/src/components/global-styles/font-library-modal/style.scss +17 -0
  200. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  201. package/src/components/global-styles/style-variations-container.js +11 -2
  202. package/src/components/header-edit-mode/index.js +56 -76
  203. package/src/components/header-edit-mode/more-menu/index.js +8 -145
  204. package/src/components/header-edit-mode/style.scss +13 -85
  205. package/src/components/keyboard-shortcuts/register.js +0 -58
  206. package/src/components/layout/index.js +11 -2
  207. package/src/components/layout/router.js +9 -49
  208. package/src/components/page-pages/index.js +14 -4
  209. package/src/components/page-pages/style.scss +11 -0
  210. package/src/components/page-patterns/dataviews-pattern-actions.js +8 -9
  211. package/src/components/page-patterns/header.js +3 -1
  212. package/src/components/page-patterns/index.js +17 -76
  213. package/src/components/page-patterns/style.scss +14 -1
  214. package/src/components/page-patterns/use-patterns.js +1 -0
  215. package/src/components/{page-templates-template-parts → page-templates}/index.js +23 -46
  216. package/src/components/{page-templates-template-parts → page-templates}/style.scss +2 -2
  217. package/src/components/pattern-modal/duplicate.js +4 -3
  218. package/src/components/plugin-template-setting-panel/index.js +8 -0
  219. package/src/components/resizable-frame/index.js +4 -3
  220. package/src/components/sidebar-edit-mode/index.js +13 -2
  221. package/src/components/sidebar-edit-mode/page-panels/index.js +49 -21
  222. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +31 -19
  223. package/src/components/sidebar-edit-mode/template-panel/index.js +2 -12
  224. package/src/components/sidebar-navigation-screen-page/index.js +48 -9
  225. package/src/components/sidebar-navigation-screen-pattern/index.js +6 -11
  226. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  227. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  228. package/src/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
  229. package/src/components/sidebar-navigation-screen-patterns/index.js +30 -38
  230. package/src/components/sidebar-navigation-screen-template/index.js +1 -1
  231. package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  232. package/src/components/sidebar-navigation-screen-templates-browse/index.js +7 -39
  233. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -4
  234. package/src/components/template-actions/index.js +1 -1
  235. package/src/deprecated.js +42 -0
  236. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +69 -16
  237. package/src/index.js +2 -9
  238. package/src/style.scss +1 -5
  239. package/src/utils/constants.js +1 -1
  240. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -59
  241. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  242. package/build/components/header-edit-mode/tools-more-menu-group/index.js +0 -23
  243. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  244. package/build/components/keyboard-shortcuts/edit-mode.js +0 -56
  245. package/build/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  246. package/build/components/page-templates-template-parts/add-new-template-part.js +0 -65
  247. package/build/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  248. package/build/components/page-templates-template-parts/hooks.js.map +0 -1
  249. package/build/components/page-templates-template-parts/index.js.map +0 -1
  250. package/build/components/sidebar-edit-mode/page-panels/page-status.js +0 -188
  251. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  252. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -52
  253. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  254. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  255. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  256. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -49
  257. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  258. package/build-module/components/page-templates-template-parts/add-new-template-part.js +0 -57
  259. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  260. package/build-module/components/page-templates-template-parts/hooks.js.map +0 -1
  261. package/build-module/components/page-templates-template-parts/index.js.map +0 -1
  262. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +0 -180
  263. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  264. package/src/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -51
  265. package/src/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  266. package/src/components/keyboard-shortcuts/edit-mode.js +0 -59
  267. package/src/components/page-templates-template-parts/add-new-template-part.js +0 -62
  268. package/src/components/sidebar-edit-mode/page-panels/page-status.js +0 -249
  269. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -34
  270. /package/build/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  271. /package/build-module/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  272. /package/src/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
@@ -22,7 +22,6 @@ import {
22
22
  DEFAULT_CONFIG_PER_VIEW_TYPE,
23
23
  } from '../sidebar-dataviews/default-views';
24
24
  import {
25
- ENUMERATION_TYPE,
26
25
  LAYOUT_GRID,
27
26
  LAYOUT_TABLE,
28
27
  LAYOUT_LIST,
@@ -189,7 +188,7 @@ function FeaturedImage( { item, viewType } ) {
189
188
  );
190
189
  }
191
190
 
192
- const PAGE_ACTIONS = [
191
+ let PAGE_ACTIONS = [
193
192
  'edit-post',
194
193
  'view-post',
195
194
  'restore',
@@ -199,6 +198,19 @@ const PAGE_ACTIONS = [
199
198
  'move-to-trash',
200
199
  ];
201
200
 
201
+ if ( process.env.IS_GUTENBERG_PLUGIN ) {
202
+ PAGE_ACTIONS = [
203
+ 'edit-post',
204
+ 'view-post',
205
+ 'restore',
206
+ 'permanently-delete',
207
+ 'view-post-revisions',
208
+ 'duplicate-post',
209
+ 'rename-post',
210
+ 'move-to-trash',
211
+ ];
212
+ }
213
+
202
214
  export default function PagePages() {
203
215
  const postType = 'page';
204
216
  const [ view, setView ] = useView( postType );
@@ -316,7 +328,6 @@ export default function PagePages() {
316
328
  header: __( 'Author' ),
317
329
  id: 'author',
318
330
  getValue: ( { item } ) => item._embedded?.author[ 0 ]?.name,
319
- type: ENUMERATION_TYPE,
320
331
  elements:
321
332
  authors?.map( ( { id, name } ) => ( {
322
333
  value: id,
@@ -329,7 +340,6 @@ export default function PagePages() {
329
340
  getValue: ( { item } ) =>
330
341
  STATUSES.find( ( { value } ) => value === item.status )
331
342
  ?.label ?? item.status,
332
- type: ENUMERATION_TYPE,
333
343
  elements: STATUSES,
334
344
  enableSorting: false,
335
345
  filterBy: {
@@ -50,4 +50,15 @@
50
50
  // Windows High Contrast mode will show this outline, but not the box-shadow.
51
51
  outline: 2px solid transparent;
52
52
  }
53
+
54
+ // Make the button targetable for clicks
55
+ &::after {
56
+ content: "";
57
+ height: 100%;
58
+ left: 0;
59
+ position: absolute;
60
+ top: 0;
61
+ width: 100%;
62
+ z-index: 1;
63
+ }
53
64
  }
@@ -7,7 +7,6 @@ import { downloadZip } from 'client-zip';
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
- import { getQueryArgs } from '@wordpress/url';
11
10
  import { downloadBlob } from '@wordpress/blob';
12
11
  import { __, _x, sprintf } from '@wordpress/i18n';
13
12
  import {
@@ -39,7 +38,7 @@ import {
39
38
  } from '../../utils/constants';
40
39
  import { CreateTemplatePartModalContents } from '../create-template-part-modal';
41
40
 
42
- const { useHistory } = unlock( routerPrivateApis );
41
+ const { useHistory, useLocation } = unlock( routerPrivateApis );
43
42
  const { CreatePatternModalContents, useDuplicatePatternProps } =
44
43
  unlock( patternsPrivateApis );
45
44
 
@@ -365,9 +364,9 @@ export const duplicatePatternAction = {
365
364
  modalHeader: _x( 'Duplicate pattern', 'action label' ),
366
365
  RenderModal: ( { items, closeModal } ) => {
367
366
  const [ item ] = items;
368
- const { categoryId = PATTERN_DEFAULT_CATEGORY } = getQueryArgs(
369
- window.location.href
370
- );
367
+ const {
368
+ params: { categoryId = PATTERN_DEFAULT_CATEGORY },
369
+ } = useLocation();
371
370
  const isThemePattern = item.type === PATTERN_TYPES.theme;
372
371
  const history = useHistory();
373
372
  function onPatternSuccess( { pattern } ) {
@@ -401,11 +400,11 @@ export const duplicateTemplatePartAction = {
401
400
  RenderModal: ( { items, closeModal } ) => {
402
401
  const [ item ] = items;
403
402
  const { createSuccessNotice } = useDispatch( noticesStore );
404
- const { categoryId = PATTERN_DEFAULT_CATEGORY } = getQueryArgs(
405
- window.location.href
406
- );
403
+ const {
404
+ params: { categoryId = PATTERN_DEFAULT_CATEGORY },
405
+ } = useLocation();
407
406
  const history = useHistory();
408
- async function onTemplatePartSuccess( templatePart ) {
407
+ function onTemplatePartSuccess( templatePart ) {
409
408
  createSuccessNotice(
410
409
  sprintf(
411
410
  // translators: %s: The new template part's title e.g. 'Call to action (copy)'.
@@ -52,7 +52,9 @@ export default function PatternsHeader( {
52
52
  description = patternCategory?.description;
53
53
  }
54
54
 
55
- if ( ! title ) return null;
55
+ if ( ! title ) {
56
+ return null;
57
+ }
56
58
 
57
59
  return (
58
60
  <VStack className="edit-site-patterns__section-header">
@@ -12,7 +12,6 @@ import {
12
12
  Tooltip,
13
13
  Flex,
14
14
  } from '@wordpress/components';
15
- import { getQueryArgs } from '@wordpress/url';
16
15
  import { __, _x } from '@wordpress/i18n';
17
16
  import {
18
17
  useState,
@@ -26,14 +25,7 @@ import {
26
25
  privateApis as blockEditorPrivateApis,
27
26
  } from '@wordpress/block-editor';
28
27
  import { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';
29
- import {
30
- Icon,
31
- header,
32
- footer,
33
- symbolFilled as uncategorized,
34
- symbol,
35
- lockSmall,
36
- } from '@wordpress/icons';
28
+ import { Icon, lockSmall } from '@wordpress/icons';
37
29
  import { usePrevious } from '@wordpress/compose';
38
30
  import { useEntityRecords } from '@wordpress/core-data';
39
31
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
@@ -52,7 +44,6 @@ import {
52
44
  TEMPLATE_PART_POST_TYPE,
53
45
  PATTERN_SYNC_TYPES,
54
46
  PATTERN_DEFAULT_CATEGORY,
55
- ENUMERATION_TYPE,
56
47
  OPERATOR_IS,
57
48
  } from '../../utils/constants';
58
49
  import {
@@ -68,15 +59,14 @@ import { unlock } from '../../lock-unlock';
68
59
  import usePatterns from './use-patterns';
69
60
  import PatternsHeader from './header';
70
61
  import { useLink } from '../routes/link';
71
- import { useAddedBy } from '../page-templates-template-parts/hooks';
62
+ import { useAddedBy } from '../page-templates/hooks';
72
63
 
73
64
  const { ExperimentalBlockEditorProvider, useGlobalStyle } = unlock(
74
65
  blockEditorPrivateApis
75
66
  );
76
67
  const { usePostActions } = unlock( editorPrivateApis );
77
- const { useHistory } = unlock( routerPrivateApis );
68
+ const { useHistory, useLocation } = unlock( routerPrivateApis );
78
69
 
79
- const templatePartIcons = { header, footer, uncategorized };
80
70
  const EMPTY_ARRAY = [];
81
71
  const defaultConfigPerViewType = {
82
72
  [ LAYOUT_TABLE ]: {
@@ -93,7 +83,7 @@ const DEFAULT_VIEW = {
93
83
  search: '',
94
84
  page: 1,
95
85
  perPage: 20,
96
- hiddenFields: [ 'sync-status' ],
86
+ hiddenFields: [],
97
87
  layout: {
98
88
  ...defaultConfigPerViewType[ LAYOUT_GRID ],
99
89
  },
@@ -119,16 +109,14 @@ const SYNC_FILTERS = [
119
109
  ];
120
110
 
121
111
  function PreviewWrapper( { item, onClick, ariaDescribedBy, children } ) {
122
- if ( item.type === PATTERN_TYPES.theme ) {
123
- return children;
124
- }
125
112
  return (
126
113
  <button
127
114
  className="page-patterns-preview-field__button"
128
115
  type="button"
129
- onClick={ onClick }
116
+ onClick={ item.type !== PATTERN_TYPES.theme ? onClick : undefined }
130
117
  aria-label={ item.title }
131
118
  aria-describedby={ ariaDescribedBy }
119
+ aria-disabled={ item.type === PATTERN_TYPES.theme }
132
120
  >
133
121
  { children }
134
122
  </button>
@@ -138,21 +126,8 @@ function PreviewWrapper( { item, onClick, ariaDescribedBy, children } ) {
138
126
  function Preview( { item, categoryId, viewType } ) {
139
127
  const descriptionId = useId();
140
128
  const isUserPattern = item.type === PATTERN_TYPES.user;
141
- const isNonUserPattern = item.type === PATTERN_TYPES.theme;
142
129
  const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;
143
130
  const isEmpty = ! item.blocks?.length;
144
- // Only custom patterns or custom template parts can be renamed or deleted.
145
- const isCustomPattern =
146
- isUserPattern || ( isTemplatePart && item.isCustom );
147
- const ariaDescriptions = [];
148
- if ( isCustomPattern ) {
149
- // User patterns don't have descriptions, but can be edited and deleted, so include some help text.
150
- ariaDescriptions.push(
151
- __( 'Press Enter to edit, or Delete to delete the pattern.' )
152
- );
153
- } else if ( item.description ) {
154
- ariaDescriptions.push( item.description );
155
- }
156
131
 
157
132
  const [ backgroundColor ] = useGlobalStyle( 'color.background' );
158
133
  const { onClick } = useLink( {
@@ -171,16 +146,7 @@ function Preview( { item, categoryId, viewType } ) {
171
146
  <PreviewWrapper
172
147
  item={ item }
173
148
  onClick={ onClick }
174
- ariaDescribedBy={
175
- ariaDescriptions.length
176
- ? ariaDescriptions
177
- .map(
178
- ( _, index ) =>
179
- `${ descriptionId }-${ index }`
180
- )
181
- .join( ' ' )
182
- : undefined
183
- }
149
+ ariaDescribedBy={ item.description ? descriptionId : undefined }
184
150
  >
185
151
  { isEmpty && isTemplatePart && __( 'Empty template part' ) }
186
152
  { isEmpty && ! isTemplatePart && __( 'Empty pattern' ) }
@@ -193,16 +159,11 @@ function Preview( { item, categoryId, viewType } ) {
193
159
  </Async>
194
160
  ) }
195
161
  </PreviewWrapper>
196
- { ! isNonUserPattern &&
197
- ariaDescriptions.map( ( ariaDescription, index ) => (
198
- <div
199
- key={ index }
200
- hidden
201
- id={ `${ descriptionId }-${ index }` }
202
- >
203
- { ariaDescription }
204
- </div>
205
- ) ) }
162
+ { item.description && (
163
+ <div hidden id={ descriptionId }>
164
+ { item.description }
165
+ </div>
166
+ ) }
206
167
  </div>
207
168
  );
208
169
  }
@@ -242,9 +203,7 @@ function Author( { item, viewType } ) {
242
203
 
243
204
  function Title( { item, categoryId } ) {
244
205
  const isUserPattern = item.type === PATTERN_TYPES.user;
245
- const isNonUserPattern = item.type === PATTERN_TYPES.theme;
246
206
  const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;
247
- let itemIcon;
248
207
  const { onClick } = useLink( {
249
208
  postType: item.type,
250
209
  postId: isUserPattern ? item.id : item.name,
@@ -252,12 +211,6 @@ function Title( { item, categoryId } ) {
252
211
  categoryType: isTemplatePart ? item.type : PATTERN_TYPES.theme,
253
212
  canvas: 'edit',
254
213
  } );
255
- if ( ! isUserPattern && templatePartIcons[ categoryId ] ) {
256
- itemIcon = templatePartIcons[ categoryId ];
257
- } else {
258
- itemIcon =
259
- item.syncStatus === PATTERN_SYNC_TYPES.full ? symbol : undefined;
260
- }
261
214
  return (
262
215
  <HStack alignment="center" justify="flex-start" spacing={ 2 }>
263
216
  <Flex
@@ -280,19 +233,6 @@ function Title( { item, categoryId } ) {
280
233
  </Button>
281
234
  ) }
282
235
  </Flex>
283
- { itemIcon && ! isNonUserPattern && (
284
- <Tooltip
285
- placement="top"
286
- text={ __(
287
- 'Editing this pattern will also update anywhere it is used'
288
- ) }
289
- >
290
- <Icon
291
- className="edit-site-patterns__pattern-icon"
292
- icon={ itemIcon }
293
- />
294
- </Tooltip>
295
- ) }
296
236
  { item.type === PATTERN_TYPES.theme && (
297
237
  <Tooltip
298
238
  placement="top"
@@ -310,9 +250,11 @@ function Title( { item, categoryId } ) {
310
250
  }
311
251
 
312
252
  export default function DataviewsPatterns() {
313
- const { categoryType, categoryId = PATTERN_DEFAULT_CATEGORY } =
314
- getQueryArgs( window.location.href );
253
+ const {
254
+ params: { categoryType, categoryId: categoryIdFromURL },
255
+ } = useLocation();
315
256
  const type = categoryType || PATTERN_TYPES.theme;
257
+ const categoryId = categoryIdFromURL || PATTERN_DEFAULT_CATEGORY;
316
258
  const [ view, setView ] = useState( DEFAULT_VIEW );
317
259
  const isUncategorizedThemePatterns =
318
260
  type === PATTERN_TYPES.theme && categoryId === 'uncategorized';
@@ -360,6 +302,7 @@ export default function DataviewsPatterns() {
360
302
  ),
361
303
  enableSorting: false,
362
304
  enableHiding: false,
305
+ width: '1%',
363
306
  },
364
307
  {
365
308
  header: __( 'Title' ),
@@ -392,7 +335,6 @@ export default function DataviewsPatterns() {
392
335
  </span>
393
336
  );
394
337
  },
395
- type: ENUMERATION_TYPE,
396
338
  elements: SYNC_FILTERS,
397
339
  filterBy: {
398
340
  operators: [ OPERATOR_IS ],
@@ -408,7 +350,6 @@ export default function DataviewsPatterns() {
408
350
  render: ( { item } ) => {
409
351
  return <Author viewType={ view.type } item={ item } />;
410
352
  },
411
- type: ENUMERATION_TYPE,
412
353
  elements: authors,
413
354
  filterBy: {
414
355
  isPrimary: true,
@@ -51,11 +51,20 @@
51
51
 
52
52
  &.is-viewtype-grid {
53
53
  .block-editor-block-preview__container {
54
- height: 100%;
55
54
  border-radius: 3px 3px 0 0;
56
55
  }
57
56
  }
58
57
 
58
+ &.is-viewtype-table {
59
+ width: 96px;
60
+ flex-grow: 0;
61
+ border-radius: 2px;
62
+
63
+ .page-patterns-preview-field__button {
64
+ border-radius: 2px;
65
+ }
66
+ }
67
+
59
68
  .page-patterns-preview-field__button {
60
69
  box-shadow: none;
61
70
  border: none;
@@ -72,6 +81,10 @@
72
81
  // Windows High Contrast mode will show this outline, but not the box-shadow.
73
82
  outline: 2px solid transparent;
74
83
  }
84
+
85
+ &[aria-disabled="true"] {
86
+ cursor: default;
87
+ }
75
88
  }
76
89
  }
77
90
 
@@ -223,6 +223,7 @@ const convertPatternPostToItem = ( patternPost, categories ) => ( {
223
223
  syncStatus: patternPost.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full,
224
224
  title: patternPost.title.raw,
225
225
  type: patternPost.type,
226
+ description: patternPost.excerpt.raw,
226
227
  patternPost,
227
228
  } );
228
229
 
@@ -35,7 +35,6 @@ import AddNewTemplate from '../add-new-template';
35
35
  import { useAddedBy } from './hooks';
36
36
  import {
37
37
  TEMPLATE_POST_TYPE,
38
- ENUMERATION_TYPE,
39
38
  OPERATOR_IS_ANY,
40
39
  LAYOUT_GRID,
41
40
  LAYOUT_TABLE,
@@ -44,7 +43,6 @@ import {
44
43
 
45
44
  import usePatternSettings from '../page-patterns/use-pattern-settings';
46
45
  import { unlock } from '../../lock-unlock';
47
- import AddNewTemplatePart from './add-new-template-part';
48
46
 
49
47
  const { usePostActions } = unlock( editorPrivateApis );
50
48
 
@@ -175,10 +173,7 @@ function Preview( { item, viewType } ) {
175
173
  onClick={ onClick }
176
174
  aria-label={ item.title?.rendered || item.title }
177
175
  >
178
- { isEmpty &&
179
- ( item.type === TEMPLATE_POST_TYPE
180
- ? __( 'Empty template' )
181
- : __( 'Empty template part' ) ) }
176
+ { isEmpty && __( 'Empty template' ) }
182
177
  { ! isEmpty && (
183
178
  <Async>
184
179
  <BlockPreview blocks={ blocks } />
@@ -199,7 +194,7 @@ const TEMPLATE_ACTIONS = [
199
194
  'delete-template',
200
195
  ];
201
196
 
202
- export default function PageTemplatesTemplateParts( { postType } ) {
197
+ export default function PageTemplates() {
203
198
  const { params } = useLocation();
204
199
  const { activeView = 'all', layout } = params;
205
200
  const defaultView = useMemo( () => {
@@ -239,7 +234,7 @@ export default function PageTemplatesTemplateParts( { postType } ) {
239
234
 
240
235
  const { records, isResolving: isLoadingData } = useEntityRecords(
241
236
  'postType',
242
- postType,
237
+ TEMPLATE_POST_TYPE,
243
238
  {
244
239
  per_page: -1,
245
240
  }
@@ -271,8 +266,8 @@ export default function PageTemplatesTemplateParts( { postType } ) {
271
266
  } ) );
272
267
  }, [ records ] );
273
268
 
274
- const fields = useMemo( () => {
275
- const _fields = [
269
+ const fields = useMemo(
270
+ () => [
276
271
  {
277
272
  header: __( 'Preview' ),
278
273
  id: 'preview',
@@ -284,10 +279,7 @@ export default function PageTemplatesTemplateParts( { postType } ) {
284
279
  enableSorting: false,
285
280
  },
286
281
  {
287
- header:
288
- postType === TEMPLATE_POST_TYPE
289
- ? __( 'Template' )
290
- : __( 'Template Part' ),
282
+ header: __( 'Template' ),
291
283
  id: 'title',
292
284
  getValue: ( { item } ) => item.title?.rendered,
293
285
  render: ( { item } ) => (
@@ -297,9 +289,7 @@ export default function PageTemplatesTemplateParts( { postType } ) {
297
289
  enableHiding: false,
298
290
  enableGlobalSearch: true,
299
291
  },
300
- ];
301
- if ( postType === TEMPLATE_POST_TYPE ) {
302
- _fields.push( {
292
+ {
303
293
  header: __( 'Description' ),
304
294
  id: 'description',
305
295
  render: ( { item } ) => {
@@ -324,23 +314,20 @@ export default function PageTemplatesTemplateParts( { postType } ) {
324
314
  minWidth: 320,
325
315
  enableSorting: false,
326
316
  enableGlobalSearch: true,
327
- } );
328
- }
329
- // TODO: The plan is to support fields reordering, which would require an API like `order` or something
330
- // similar. With the aforementioned API we wouldn't need to construct the fields array like this.
331
- _fields.push( {
332
- header: __( 'Author' ),
333
- id: 'author',
334
- getValue: ( { item } ) => item.author_text,
335
- render: ( { item } ) => {
336
- return <AuthorField viewType={ view.type } item={ item } />;
337
317
  },
338
- type: ENUMERATION_TYPE,
339
- elements: authors,
340
- width: '1%',
341
- } );
342
- return _fields;
343
- }, [ postType, authors, view.type ] );
318
+ {
319
+ header: __( 'Author' ),
320
+ id: 'author',
321
+ getValue: ( { item } ) => item.author_text,
322
+ render: ( { item } ) => {
323
+ return <AuthorField viewType={ view.type } item={ item } />;
324
+ },
325
+ elements: authors,
326
+ width: '1%',
327
+ },
328
+ ],
329
+ [ authors, view.type ]
330
+ );
344
331
 
345
332
  const { data, paginationInfo } = useMemo( () => {
346
333
  return filterSortAndPaginate( records, view, fields );
@@ -385,19 +372,9 @@ export default function PageTemplatesTemplateParts( { postType } ) {
385
372
 
386
373
  return (
387
374
  <Page
388
- className="edit-site-page-template-template-parts-dataviews"
389
- title={
390
- postType === TEMPLATE_POST_TYPE
391
- ? __( 'Templates' )
392
- : __( 'Template Parts' )
393
- }
394
- actions={
395
- postType === TEMPLATE_POST_TYPE ? (
396
- <AddNewTemplate />
397
- ) : (
398
- <AddNewTemplatePart />
399
- )
400
- }
375
+ className="edit-site-page-templates"
376
+ title={ __( 'Templates' ) }
377
+ actions={ <AddNewTemplate /> }
401
378
  >
402
379
  <DataViews
403
380
  paginationInfo={ paginationInfo }
@@ -30,7 +30,7 @@
30
30
 
31
31
  &.is-viewtype-grid {
32
32
  .block-editor-block-preview__container {
33
- height: auto;
33
+ height: 100%;
34
34
  }
35
35
 
36
36
  .page-templates-preview-field__button {
@@ -59,7 +59,7 @@
59
59
  white-space: normal;
60
60
  }
61
61
 
62
- .edit-site-page-template-template-parts-dataviews {
62
+ .edit-site-page-templates {
63
63
  .dataviews-pagination {
64
64
  z-index: z-index(".edit-site-templates__dataviews-list-pagination");
65
65
  }
@@ -4,7 +4,6 @@
4
4
  import { useDispatch, useSelect } from '@wordpress/data';
5
5
  import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
6
6
  import { privateApis as routerPrivateApis } from '@wordpress/router';
7
- import { getQueryArgs } from '@wordpress/url';
8
7
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
9
8
 
10
9
  /**
@@ -16,12 +15,14 @@ import { unlock } from '../../lock-unlock';
16
15
  import useEditedEntityRecord from '../use-edited-entity-record';
17
16
 
18
17
  const { DuplicatePatternModal } = unlock( patternsPrivateApis );
19
- const { useHistory } = unlock( routerPrivateApis );
18
+ const { useHistory, useLocation } = unlock( routerPrivateApis );
20
19
  const { interfaceStore } = unlock( editorPrivateApis );
21
20
 
22
21
  export default function PatternDuplicateModal() {
23
22
  const { record } = useEditedEntityRecord();
24
- const { categoryType, categoryId } = getQueryArgs( window.location.href );
23
+ const {
24
+ params: { categoryType, categoryId },
25
+ } = useLocation();
25
26
  const { closeModal } = useDispatch( interfaceStore );
26
27
  const history = useHistory();
27
28
 
@@ -8,10 +8,16 @@
8
8
  import { store as editorStore } from '@wordpress/editor';
9
9
  import { useSelect } from '@wordpress/data';
10
10
  import { createSlotFill } from '@wordpress/components';
11
+ import deprecated from '@wordpress/deprecated';
11
12
 
12
13
  const { Fill, Slot } = createSlotFill( 'PluginTemplateSettingPanel' );
13
14
 
14
15
  const PluginTemplateSettingPanel = ( { children } ) => {
16
+ deprecated( 'wp.editSite.PluginTemplateSettingPanel', {
17
+ since: '6.6',
18
+ version: '6.8',
19
+ alternative: 'wp.editor.PluginDocumentSettingPanel',
20
+ } );
15
21
  const isCurrentEntityTemplate = useSelect(
16
22
  ( select ) =>
17
23
  select( editorStore ).getCurrentPostType() === 'wp_template',
@@ -29,6 +35,8 @@ PluginTemplateSettingPanel.Slot = Slot;
29
35
  * Renders items in the Template Sidebar below the main information
30
36
  * like the Template Card.
31
37
  *
38
+ * @deprecated since 6.6. Use `wp.editor.PluginDocumentSettingPanel` instead.
39
+ *
32
40
  * @example
33
41
  * ```jsx
34
42
  * // Using ESNext syntax
@@ -203,11 +203,11 @@ function ResizableFrame( {
203
203
  },
204
204
  visible: {
205
205
  opacity: 1,
206
- left: -16,
206
+ left: -14, // Account for the handle's width.
207
207
  },
208
208
  active: {
209
209
  opacity: 1,
210
- left: -16,
210
+ left: -14, // Account for the handle's width.
211
211
  scaleY: 1.3,
212
212
  },
213
213
  };
@@ -226,8 +226,9 @@ function ResizableFrame( {
226
226
  variants={ frameAnimationVariants }
227
227
  animate={ isFullWidth ? 'fullWidth' : 'default' }
228
228
  onAnimationComplete={ ( definition ) => {
229
- if ( definition === 'fullWidth' )
229
+ if ( definition === 'fullWidth' ) {
230
230
  setFrameSize( { width: '100%', height: '100%' } );
231
+ }
231
232
  } }
232
233
  transition={ FRAME_TRANSITION }
233
234
  size={ frameSize }
@@ -11,7 +11,13 @@ import { useCallback, useContext, useEffect, useRef } from '@wordpress/element';
11
11
  import { useSelect, useDispatch } from '@wordpress/data';
12
12
  import { store as blockEditorStore } from '@wordpress/block-editor';
13
13
  import { store as coreStore } from '@wordpress/core-data';
14
- import { privateApis as editorPrivateApis } from '@wordpress/editor';
14
+ import {
15
+ PageAttributesPanel,
16
+ PostDiscussionPanel,
17
+ PostLastRevisionPanel,
18
+ PostTaxonomiesPanel,
19
+ privateApis as editorPrivateApis,
20
+ } from '@wordpress/editor';
15
21
 
16
22
  /**
17
23
  * Internal dependencies
@@ -25,7 +31,7 @@ import { store as editSiteStore } from '../../store';
25
31
  import { unlock } from '../../lock-unlock';
26
32
 
27
33
  const { Tabs } = unlock( componentsPrivateApis );
28
- const { interfaceStore, useAutoSwitchEditorSidebars } =
34
+ const { interfaceStore, useAutoSwitchEditorSidebars, PatternOverridesPanel } =
29
35
  unlock( editorPrivateApis );
30
36
  const { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(
31
37
  'EditSiteSidebarInspector'
@@ -91,6 +97,11 @@ const FillContents = ( { tabName, isEditingPage, supportsGlobalStyles } ) => {
91
97
  focusable={ false }
92
98
  >
93
99
  { isEditingPage ? <PagePanels /> : <TemplatePanel /> }
100
+ <PostLastRevisionPanel />
101
+ <PostTaxonomiesPanel />
102
+ <PostDiscussionPanel />
103
+ <PageAttributesPanel />
104
+ <PatternOverridesPanel />
94
105
  </Tabs.TabPanel>
95
106
  <Tabs.TabPanel tabId="edit-post/block" focusable={ false }>
96
107
  <InspectorSlot bubblesVirtually />