@wordpress/edit-site 5.26.0 → 5.27.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 (330) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/actions/index.js +139 -36
  3. package/build/components/actions/index.js.map +1 -1
  4. package/build/components/editor-canvas-container/index.js +1 -1
  5. package/build/components/editor-canvas-container/index.js.map +1 -1
  6. package/build/components/global-styles/font-families.js +3 -2
  7. package/build/components/global-styles/font-families.js.map +1 -1
  8. package/build/components/global-styles/font-family-item.js +3 -4
  9. package/build/components/global-styles/font-family-item.js.map +1 -1
  10. package/build/components/global-styles/font-library-modal/context.js +80 -41
  11. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  12. package/build/components/global-styles/font-library-modal/font-collection.js +49 -22
  13. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  14. package/build/components/global-styles/font-library-modal/fonts-grid.js +4 -1
  15. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/index.js +4 -4
  17. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/installed-fonts.js +16 -8
  19. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/library-font-card.js +1 -1
  21. package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  23. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/local-fonts.js +13 -4
  25. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/resolvers.js +49 -20
  27. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +17 -2
  29. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/utils/index.js +103 -17
  31. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +4 -3
  33. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  34. package/build/components/global-styles/screen-typography.js +4 -1
  35. package/build/components/global-styles/screen-typography.js.map +1 -1
  36. package/build/components/layout/hooks.js +6 -5
  37. package/build/components/layout/hooks.js.map +1 -1
  38. package/build/components/layout/index.js +19 -28
  39. package/build/components/layout/index.js.map +1 -1
  40. package/build/components/layout/router.js +135 -0
  41. package/build/components/layout/router.js.map +1 -0
  42. package/build/components/page-pages/index.js +92 -69
  43. package/build/components/page-pages/index.js.map +1 -1
  44. package/build/components/page-patterns/dataviews-pattern-actions.js +11 -6
  45. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  46. package/build/components/page-patterns/index.js +295 -15
  47. package/build/components/page-patterns/index.js.map +1 -1
  48. package/build/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +51 -23
  49. package/build/components/page-templates-template-parts/actions.js.map +1 -0
  50. package/build/components/page-templates-template-parts/add-new-template-part.js.map +1 -0
  51. package/build/components/page-templates-template-parts/index.js +395 -0
  52. package/build/components/page-templates-template-parts/index.js.map +1 -0
  53. package/build/components/preferences-modal/index.js +9 -134
  54. package/build/components/preferences-modal/index.js.map +1 -1
  55. package/build/components/revisions/index.js +1 -1
  56. package/build/components/revisions/index.js.map +1 -1
  57. package/build/components/save-button/index.js +4 -2
  58. package/build/components/save-button/index.js.map +1 -1
  59. package/build/components/save-panel/index.js +6 -5
  60. package/build/components/save-panel/index.js.map +1 -1
  61. package/build/components/sidebar/index.js +3 -1
  62. package/build/components/sidebar/index.js.map +1 -1
  63. package/build/components/sidebar-dataviews/dataview-item.js +3 -1
  64. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  65. package/build/components/sidebar-dataviews/default-views.js +4 -2
  66. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  67. package/build/components/sidebar-dataviews/index.js +2 -2
  68. package/build/components/sidebar-dataviews/index.js.map +1 -1
  69. package/build/components/sidebar-navigation-screen/index.js +8 -7
  70. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  71. package/build/components/sidebar-navigation-screen-pages/index.js +2 -10
  72. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  73. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +26 -3
  74. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -1
  75. package/build/components/sidebar-navigation-screen-templates/index.js +63 -8
  76. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  77. package/build/components/sidebar-navigation-screen-templates-browse/content.js +76 -0
  78. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -0
  79. package/build/components/sidebar-navigation-screen-templates-browse/index.js +9 -2
  80. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  81. package/build/components/site-hub/index.js +3 -1
  82. package/build/components/site-hub/index.js.map +1 -1
  83. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +47 -12
  84. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  85. package/build/components/sync-state-with-url/use-sync-path-with-url.js +25 -2
  86. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  87. package/build/hooks/commands/use-edit-mode-commands.js +33 -5
  88. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  89. package/build/hooks/push-changes-to-global-styles/index.js +13 -6
  90. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  91. package/build/hooks/template-part-edit.js +7 -6
  92. package/build/hooks/template-part-edit.js.map +1 -1
  93. package/build/index.js +1 -1
  94. package/build/index.js.map +1 -1
  95. package/build/store/actions.js +11 -29
  96. package/build/store/actions.js.map +1 -1
  97. package/build/store/private-actions.js +85 -1
  98. package/build/store/private-actions.js.map +1 -1
  99. package/build/store/selectors.js +2 -2
  100. package/build/store/selectors.js.map +1 -1
  101. package/build/utils/get-is-list-page.js +1 -1
  102. package/build/utils/get-is-list-page.js.map +1 -1
  103. package/build/utils/use-actual-current-theme.js +32 -0
  104. package/build/utils/use-actual-current-theme.js.map +1 -0
  105. package/build-module/components/actions/index.js +139 -36
  106. package/build-module/components/actions/index.js.map +1 -1
  107. package/build-module/components/editor-canvas-container/index.js +1 -1
  108. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  109. package/build-module/components/global-styles/font-families.js +3 -2
  110. package/build-module/components/global-styles/font-families.js.map +1 -1
  111. package/build-module/components/global-styles/font-family-item.js +4 -5
  112. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  113. package/build-module/components/global-styles/font-library-modal/context.js +82 -42
  114. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  115. package/build-module/components/global-styles/font-library-modal/font-collection.js +49 -22
  116. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  117. package/build-module/components/global-styles/font-library-modal/fonts-grid.js +4 -1
  118. package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
  119. package/build-module/components/global-styles/font-library-modal/index.js +4 -4
  120. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  121. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +16 -8
  122. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  123. package/build-module/components/global-styles/font-library-modal/library-font-card.js +1 -1
  124. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  125. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  126. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  127. package/build-module/components/global-styles/font-library-modal/local-fonts.js +13 -4
  128. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  129. package/build-module/components/global-styles/font-library-modal/resolvers.js +45 -18
  130. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  131. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +17 -2
  132. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  133. package/build-module/components/global-styles/font-library-modal/utils/index.js +99 -16
  134. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  135. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +4 -3
  136. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  137. package/build-module/components/global-styles/screen-typography.js +4 -1
  138. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  139. package/build-module/components/layout/hooks.js +6 -5
  140. package/build-module/components/layout/hooks.js.map +1 -1
  141. package/build-module/components/layout/index.js +19 -28
  142. package/build-module/components/layout/index.js.map +1 -1
  143. package/build-module/components/layout/router.js +127 -0
  144. package/build-module/components/layout/router.js.map +1 -0
  145. package/build-module/components/page-pages/index.js +91 -70
  146. package/build-module/components/page-pages/index.js.map +1 -1
  147. package/build-module/components/page-patterns/dataviews-pattern-actions.js +11 -6
  148. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  149. package/build-module/components/page-patterns/index.js +296 -16
  150. package/build-module/components/page-patterns/index.js.map +1 -1
  151. package/build-module/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +52 -24
  152. package/build-module/components/page-templates-template-parts/actions.js.map +1 -0
  153. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +1 -0
  154. package/build-module/components/page-templates-template-parts/index.js +385 -0
  155. package/build-module/components/page-templates-template-parts/index.js.map +1 -0
  156. package/build-module/components/preferences-modal/index.js +12 -136
  157. package/build-module/components/preferences-modal/index.js.map +1 -1
  158. package/build-module/components/revisions/index.js +1 -1
  159. package/build-module/components/revisions/index.js.map +1 -1
  160. package/build-module/components/save-button/index.js +4 -2
  161. package/build-module/components/save-button/index.js.map +1 -1
  162. package/build-module/components/save-panel/index.js +7 -6
  163. package/build-module/components/save-panel/index.js.map +1 -1
  164. package/build-module/components/sidebar/index.js +3 -1
  165. package/build-module/components/sidebar/index.js.map +1 -1
  166. package/build-module/components/sidebar-dataviews/dataview-item.js +3 -1
  167. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  168. package/build-module/components/sidebar-dataviews/default-views.js +4 -2
  169. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  170. package/build-module/components/sidebar-dataviews/index.js +2 -2
  171. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  172. package/build-module/components/sidebar-navigation-screen/index.js +8 -7
  173. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  174. package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -10
  175. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  176. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +27 -4
  177. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -1
  178. package/build-module/components/sidebar-navigation-screen-templates/index.js +64 -9
  179. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  180. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +68 -0
  181. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -0
  182. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +9 -2
  183. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  184. package/build-module/components/site-hub/index.js +3 -1
  185. package/build-module/components/site-hub/index.js.map +1 -1
  186. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +47 -11
  187. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  188. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +25 -2
  189. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  190. package/build-module/hooks/commands/use-edit-mode-commands.js +33 -5
  191. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  192. package/build-module/hooks/push-changes-to-global-styles/index.js +13 -6
  193. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  194. package/build-module/hooks/template-part-edit.js +7 -6
  195. package/build-module/hooks/template-part-edit.js.map +1 -1
  196. package/build-module/index.js +1 -1
  197. package/build-module/index.js.map +1 -1
  198. package/build-module/store/actions.js +13 -30
  199. package/build-module/store/actions.js.map +1 -1
  200. package/build-module/store/private-actions.js +83 -0
  201. package/build-module/store/private-actions.js.map +1 -1
  202. package/build-module/store/selectors.js +2 -2
  203. package/build-module/store/selectors.js.map +1 -1
  204. package/build-module/utils/get-is-list-page.js +1 -1
  205. package/build-module/utils/get-is-list-page.js.map +1 -1
  206. package/build-module/utils/use-actual-current-theme.js +24 -0
  207. package/build-module/utils/use-actual-current-theme.js.map +1 -0
  208. package/build-style/style-rtl.css +302 -188
  209. package/build-style/style.css +302 -188
  210. package/package.json +42 -42
  211. package/src/components/actions/index.js +236 -84
  212. package/src/components/editor-canvas-container/index.js +1 -1
  213. package/src/components/global-styles/font-families.js +14 -8
  214. package/src/components/global-styles/font-family-item.js +7 -4
  215. package/src/components/global-styles/font-library-modal/context.js +156 -50
  216. package/src/components/global-styles/font-library-modal/font-collection.js +56 -21
  217. package/src/components/global-styles/font-library-modal/fonts-grid.js +6 -2
  218. package/src/components/global-styles/font-library-modal/index.js +4 -4
  219. package/src/components/global-styles/font-library-modal/installed-fonts.js +18 -8
  220. package/src/components/global-styles/font-library-modal/library-font-card.js +2 -1
  221. package/src/components/global-styles/font-library-modal/library-font-variant.js +10 -9
  222. package/src/components/global-styles/font-library-modal/local-fonts.js +14 -4
  223. package/src/components/global-styles/font-library-modal/resolvers.js +50 -17
  224. package/src/components/global-styles/font-library-modal/style.scss +1 -0
  225. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +19 -2
  226. package/src/components/global-styles/font-library-modal/utils/index.js +136 -29
  227. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +7 -3
  228. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +40 -10
  229. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +5 -5
  230. package/src/components/global-styles/screen-typography.js +9 -3
  231. package/src/components/global-styles/style.scss +4 -0
  232. package/src/components/header-edit-mode/style.scss +15 -5
  233. package/src/components/layout/hooks.js +6 -5
  234. package/src/components/layout/index.js +80 -96
  235. package/src/components/layout/router.js +121 -0
  236. package/src/components/layout/style.scss +13 -16
  237. package/src/components/page/style.scss +1 -8
  238. package/src/components/page-pages/index.js +142 -148
  239. package/src/components/page-pages/style.scss +41 -2
  240. package/src/components/page-patterns/dataviews-pattern-actions.js +11 -6
  241. package/src/components/page-patterns/index.js +392 -14
  242. package/src/components/page-patterns/style.scss +36 -2
  243. package/src/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +90 -37
  244. package/src/components/{page-templates → page-templates-template-parts}/index.js +198 -169
  245. package/src/components/page-templates-template-parts/style.scss +44 -0
  246. package/src/components/preferences-modal/index.js +8 -211
  247. package/src/components/revisions/index.js +1 -1
  248. package/src/components/save-button/index.js +7 -4
  249. package/src/components/save-panel/index.js +13 -12
  250. package/src/components/sidebar/index.js +4 -5
  251. package/src/components/sidebar-dataviews/dataview-item.js +2 -1
  252. package/src/components/sidebar-dataviews/default-views.js +4 -2
  253. package/src/components/sidebar-dataviews/index.js +8 -6
  254. package/src/components/sidebar-navigation-item/style.scss +1 -1
  255. package/src/components/sidebar-navigation-screen/index.js +19 -10
  256. package/src/components/sidebar-navigation-screen-pages/index.js +2 -10
  257. package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +32 -6
  258. package/src/components/sidebar-navigation-screen-templates/index.js +85 -28
  259. package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
  260. package/src/components/sidebar-navigation-screen-templates-browse/content.js +73 -0
  261. package/src/components/sidebar-navigation-screen-templates-browse/index.js +10 -1
  262. package/src/components/site-hub/index.js +4 -1
  263. package/src/components/site-hub/style.scss +1 -12
  264. package/src/components/site-icon/style.scss +1 -1
  265. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +40 -10
  266. package/src/components/sync-state-with-url/use-sync-path-with-url.js +32 -0
  267. package/src/hooks/commands/use-edit-mode-commands.js +50 -3
  268. package/src/hooks/push-changes-to-global-styles/index.js +29 -23
  269. package/src/hooks/template-part-edit.js +12 -12
  270. package/src/index.js +1 -1
  271. package/src/store/actions.js +17 -51
  272. package/src/store/private-actions.js +133 -0
  273. package/src/store/selectors.js +2 -4
  274. package/src/style.scss +2 -1
  275. package/src/utils/get-is-list-page.js +3 -2
  276. package/src/utils/use-actual-current-theme.js +27 -0
  277. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -58
  278. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +0 -1
  279. package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -71
  280. package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +0 -1
  281. package/build/components/page-main/index.js +0 -44
  282. package/build/components/page-main/index.js.map +0 -1
  283. package/build/components/page-patterns/dataviews-patterns.js +0 -307
  284. package/build/components/page-patterns/dataviews-patterns.js.map +0 -1
  285. package/build/components/page-template-parts/add-new-template-part.js.map +0 -1
  286. package/build/components/page-template-parts/index.js +0 -81
  287. package/build/components/page-template-parts/index.js.map +0 -1
  288. package/build/components/page-templates/index.js +0 -352
  289. package/build/components/page-templates/index.js.map +0 -1
  290. package/build/components/page-templates/template-actions.js.map +0 -1
  291. package/build/components/post-preview/index.js +0 -29
  292. package/build/components/post-preview/index.js.map +0 -1
  293. package/build/components/preferences-modal/enable-feature.js +0 -36
  294. package/build/components/preferences-modal/enable-feature.js.map +0 -1
  295. package/build/components/preferences-modal/enable-panel-option.js +0 -33
  296. package/build/components/preferences-modal/enable-panel-option.js.map +0 -1
  297. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -52
  298. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +0 -1
  299. package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -63
  300. package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +0 -1
  301. package/build-module/components/page-main/index.js +0 -36
  302. package/build-module/components/page-main/index.js.map +0 -1
  303. package/build-module/components/page-patterns/dataviews-patterns.js +0 -299
  304. package/build-module/components/page-patterns/dataviews-patterns.js.map +0 -1
  305. package/build-module/components/page-template-parts/add-new-template-part.js.map +0 -1
  306. package/build-module/components/page-template-parts/index.js +0 -73
  307. package/build-module/components/page-template-parts/index.js.map +0 -1
  308. package/build-module/components/page-templates/index.js +0 -344
  309. package/build-module/components/page-templates/index.js.map +0 -1
  310. package/build-module/components/page-templates/template-actions.js.map +0 -1
  311. package/build-module/components/post-preview/index.js +0 -21
  312. package/build-module/components/post-preview/index.js.map +0 -1
  313. package/build-module/components/preferences-modal/enable-feature.js +0 -29
  314. package/build-module/components/preferences-modal/enable-feature.js.map +0 -1
  315. package/build-module/components/preferences-modal/enable-panel-option.js +0 -26
  316. package/build-module/components/preferences-modal/enable-panel-option.js.map +0 -1
  317. package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -58
  318. package/src/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -62
  319. package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +0 -271
  320. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +0 -58
  321. package/src/components/page-main/index.js +0 -38
  322. package/src/components/page-patterns/dataviews-patterns.js +0 -380
  323. package/src/components/page-template-parts/index.js +0 -99
  324. package/src/components/page-templates/style.scss +0 -13
  325. package/src/components/post-preview/index.js +0 -16
  326. package/src/components/preferences-modal/enable-feature.js +0 -31
  327. package/src/components/preferences-modal/enable-panel-option.js +0 -23
  328. /package/build/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
  329. /package/build-module/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
  330. /package/src/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useSelect","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","__unstableUseNavigateRegions","useNavigateRegions","useReducedMotion","useViewportMatch","useResizeObserver","__","useState","NavigableRegion","store","keyboardShortcutsStore","CommandMenu","privateApis","commandsPrivateApis","preferencesStore","blockEditorPrivateApis","useBlockCommands","blockEditorStore","routerPrivateApis","coreCommandsPrivateApis","Sidebar","Editor","ErrorBoundary","editSiteStore","getIsListPage","Header","useInitEditedEntityFromURL","SiteHub","ResizableFrame","useSyncCanvasModeWithURL","unlock","SavePanel","KeyboardShortcutsRegister","KeyboardShortcutsGlobal","useCommonCommands","useEditModeCommands","PageMain","useIsSiteEditorLoading","useCommands","useCommandContext","useLocation","useGlobalStyle","ANIMATION_DURATION","Layout","params","isMobileViewport","isListPage","isEditorPage","isDistractionFree","hasFixedToolbar","hasBlockSelected","canvasMode","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","getCanvasMode","get","getBlockSelectionStart","isEditing","navigateRegionsProps","previous","next","disableMotion","showSidebar","showCanvas","isFullCanvas","canvasResizer","canvasSize","fullResizer","isEditorLoading","isResizableFrameOversized","setIsResizableFrameOversized","headerAnimationState","commandContext","backgroundColor","gradientValue","createElement","Fragment","ref","className","div","variants","opacity","transition","type","delay","delayChildren","isDistractionFreeHovering","view","edit","whileHover","undefined","animate","isTransparent","initial","key","ariaLabel","as","y","exit","duration","ease","width","scale","layout","isReady","isFullWidth","defaultSize","height","isOversized","setIsOversized","innerContentStyle","background","isLoading"],"sources":["@wordpress/edit-site/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockCommands,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Sidebar from '../sidebar';\nimport Editor from '../editor';\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport getIsListPage from '../../utils/get-is-list-page';\nimport Header from '../header-edit-mode';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport SiteHub from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../lock-unlock';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useCommonCommands } from '../../hooks/commands/use-common-commands';\nimport { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';\nimport PageMain from '../page-main';\nimport { useIsSiteEditorLoading } from './hooks';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst ANIMATION_DURATION = 0.5;\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tuseEditModeCommands();\n\tuseCommonCommands();\n\tuseBlockCommands();\n\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isListPage = getIsListPage( params, isMobileViewport );\n\tconst isEditorPage = ! isListPage;\n\n\tconst {\n\t\tisDistractionFree,\n\t\thasFixedToolbar,\n\t\thasBlockSelected,\n\t\tcanvasMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\tkeyboardShortcutsStore\n\t\t);\n\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/next-region'\n\t\t\t),\n\t\t\thasFixedToolbar: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasBlockSelected:\n\t\t\t\tselect( blockEditorStore ).getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\tconst isEditing = canvasMode === 'edit';\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst showSidebar =\n\t\t( isMobileViewport && canvasMode === 'view' && ! isListPage ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isEditorPage && isEditing ) ||\n\t\t! isMobileViewport ||\n\t\t! isEditorPage;\n\tconst isFullCanvas =\n\t\t( isMobileViewport && isListPage ) || ( isEditorPage && isEditing );\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\n\t// This determines which animation variant should apply to the header.\n\t// There is also a `isDistractionFreeHovering` state that gets priority\n\t// when hovering the `edit-site-layout__header-container` in distraction\n\t// free mode. It's set via framer and trickles down to all the children\n\t// so they can use this variant state too.\n\t//\n\t// TODO: The issue with this is we want to have the hover state stick when hovering\n\t// a popover opened via the header. We'll probably need to lift this state to\n\t// handle it ourselves. Also, focusWithin the header needs to be handled.\n\tlet headerAnimationState;\n\n\tif ( canvasMode === 'view' ) {\n\t\t// We need 'view' to always take priority so 'isDistractionFree'\n\t\t// doesn't bleed over into the view (sidebar) state\n\t\theaderAnimationState = 'view';\n\t} else if ( isDistractionFree ) {\n\t\theaderAnimationState = 'isDistractionFree';\n\t} else {\n\t\theaderAnimationState = canvasMode; // edit, view, init\n\t}\n\n\t// Sets the right context for the command palette\n\tlet commandContext = 'site-editor';\n\n\tif ( canvasMode === 'edit' && isEditorPage ) {\n\t\tcommandContext = 'site-editor-edit';\n\t}\n\tif ( hasBlockSelected ) {\n\t\tcommandContext = 'block-selection-edit';\n\t}\n\tuseCommandContext( commandContext );\n\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommandMenu />\n\t\t\t<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-distraction-free': isDistractionFree && isEditing,\n\t\t\t\t\t\t'is-full-canvas': isFullCanvas,\n\t\t\t\t\t\t'is-edit-mode': isEditing,\n\t\t\t\t\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t\t\t\t\t'is-block-toolbar-visible': hasBlockSelected,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-layout__header-container\"\n\t\t\t\t\tvariants={ {\n\t\t\t\t\t\tisDistractionFree: {\n\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tdelay: 0.8,\n\t\t\t\t\t\t\t\tdelayChildren: 0.8,\n\t\t\t\t\t\t\t}, // How long to wait before the header exits\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tdelay: 0.2,\n\t\t\t\t\t\t\t\tdelayChildren: 0.2,\n\t\t\t\t\t\t\t}, // How long to wait before the header shows\n\t\t\t\t\t\t},\n\t\t\t\t\t\tview: { opacity: 1 },\n\t\t\t\t\t\tedit: { opacity: 1 },\n\t\t\t\t\t} }\n\t\t\t\t\twhileHover={\n\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t? 'isDistractionFreeHovering'\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tanimate={ headerAnimationState }\n\t\t\t\t>\n\t\t\t\t\t<SiteHub\n\t\t\t\t\t\tisTransparent={ isResizableFrameOversized }\n\t\t\t\t\t\tclassName=\"edit-site-layout__hub\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ isEditorPage && isEditing && (\n\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\tkey=\"header\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__header\"\n\t\t\t\t\t\t\t\tariaLabel={ __( 'Editor top bar' ) }\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\t\t\tisDistractionFree: { opacity: 0, y: 0 },\n\t\t\t\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tview: { opacity: 1, y: '-100%' },\n\t\t\t\t\t\t\t\t\tedit: { opacity: 1, y: 0 },\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\topacity: isDistractionFree ? 1 : 0,\n\t\t\t\t\t\t\t\t\ty: isDistractionFree ? 0 : '-100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration: disableMotion ? 0 : 0.2,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Header />\n\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\t\t\t\t</motion.div>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t\tThe NavigableRegion must always be rendered and not use\n\t\t\t\t\t\t`inert` otherwise `useNavigateRegions` will fail.\n\t\t\t\t\t*/ }\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar-region\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t{ showSidebar && (\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\tdisableMotion || isMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t</NavigableRegion>\n\n\t\t\t\t\t<SavePanel />\n\n\t\t\t\t\t{ showCanvas && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ isListPage && <PageMain /> }\n\t\t\t\t\t\t\t{ isEditorPage && (\n\t\t\t\t\t\t\t\t<div className=\"edit-site-layout__canvas-container\">\n\t\t\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\t\t\t\t\tisEditorPage &&\n\t\t\t\t\t\t\t\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscale: 1.005,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\t\t\t\tlayout=\"position\"\n\t\t\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\t\t\tisReady={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t! isEditorLoading\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tisFullWidth={ isEditing }\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Editor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLoading={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisEditorLoading\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t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SAAS,EACR5C;EACA,CACD,CACc,CACF,CACJ,CAET,CAEL,CAEC,CACD,CACJ,CAAC;AAEL"}
1
+ {"version":3,"names":["classnames","useSelect","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","__unstableUseNavigateRegions","useNavigateRegions","useReducedMotion","useViewportMatch","useResizeObserver","__","useState","NavigableRegion","store","keyboardShortcutsStore","CommandMenu","privateApis","commandsPrivateApis","preferencesStore","blockEditorPrivateApis","useBlockCommands","blockEditorStore","coreCommandsPrivateApis","Sidebar","ErrorBoundary","editSiteStore","Header","useInitEditedEntityFromURL","SiteHub","ResizableFrame","useSyncCanvasModeWithURL","unlock","SavePanel","KeyboardShortcutsRegister","KeyboardShortcutsGlobal","useCommonCommands","useEditModeCommands","useIsSiteEditorLoading","useLayoutAreas","useCommands","useCommandContext","useGlobalStyle","ANIMATION_DURATION","Layout","isMobileViewport","isDistractionFree","hasFixedToolbar","hasBlockSelected","canvasMode","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","getCanvasMode","get","getBlockSelectionStart","navigateRegionsProps","previous","next","disableMotion","canvasResizer","canvasSize","fullResizer","isEditorLoading","isResizableFrameOversized","setIsResizableFrameOversized","areas","widths","headerAnimationState","commandContext","backgroundColor","gradientValue","createElement","Fragment","ref","className","div","variants","opacity","transition","type","delay","delayChildren","isDistractionFreeHovering","view","edit","whileHover","undefined","animate","isTransparent","initial","key","ariaLabel","as","y","exit","duration","ease","content","style","maxWidth","preview","width","scale","layout","isReady","isFullWidth","defaultSize","height","isOversized","setIsOversized","innerContentStyle","background"],"sources":["@wordpress/edit-site/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockCommands,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Sidebar from '../sidebar';\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport Header from '../header-edit-mode';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport SiteHub from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../lock-unlock';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useCommonCommands } from '../../hooks/commands/use-common-commands';\nimport { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';\nimport { useIsSiteEditorLoading } from './hooks';\nimport useLayoutAreas from './router';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst ANIMATION_DURATION = 0.5;\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tuseEditModeCommands();\n\tuseCommonCommands();\n\tuseBlockCommands();\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tconst {\n\t\tisDistractionFree,\n\t\thasFixedToolbar,\n\t\thasBlockSelected,\n\t\tcanvasMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\tkeyboardShortcutsStore\n\t\t);\n\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/next-region'\n\t\t\t),\n\t\t\thasFixedToolbar: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasBlockSelected:\n\t\t\t\tselect( blockEditorStore ).getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\tconst { areas, widths } = useLayoutAreas();\n\n\t// This determines which animation variant should apply to the header.\n\t// There is also a `isDistractionFreeHovering` state that gets priority\n\t// when hovering the `edit-site-layout__header-container` in distraction\n\t// free mode. It's set via framer and trickles down to all the children\n\t// so they can use this variant state too.\n\t//\n\t// TODO: The issue with this is we want to have the hover state stick when hovering\n\t// a popover opened via the header. We'll probably need to lift this state to\n\t// handle it ourselves. Also, focusWithin the header needs to be handled.\n\tlet headerAnimationState;\n\n\tif ( canvasMode === 'view' ) {\n\t\t// We need 'view' to always take priority so 'isDistractionFree'\n\t\t// doesn't bleed over into the view (sidebar) state\n\t\theaderAnimationState = 'view';\n\t} else if ( isDistractionFree ) {\n\t\theaderAnimationState = 'isDistractionFree';\n\t} else {\n\t\theaderAnimationState = canvasMode; // edit, view, init\n\t}\n\n\t// Sets the right context for the command palette\n\tlet commandContext = 'site-editor';\n\n\tif ( canvasMode === 'edit' ) {\n\t\tcommandContext = 'site-editor-edit';\n\t}\n\tif ( hasBlockSelected ) {\n\t\tcommandContext = 'block-selection-edit';\n\t}\n\tuseCommandContext( commandContext );\n\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommandMenu />\n\t\t\t<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-distraction-free':\n\t\t\t\t\t\t\tisDistractionFree && canvasMode === 'edit',\n\t\t\t\t\t\t'is-full-canvas': canvasMode === 'edit',\n\t\t\t\t\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t\t\t\t\t'is-block-toolbar-visible': hasBlockSelected,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-layout__header-container\"\n\t\t\t\t\tvariants={ {\n\t\t\t\t\t\tisDistractionFree: {\n\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tdelay: 0.8,\n\t\t\t\t\t\t\t\tdelayChildren: 0.8,\n\t\t\t\t\t\t\t}, // How long to wait before the header exits\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tdelay: 0.2,\n\t\t\t\t\t\t\t\tdelayChildren: 0.2,\n\t\t\t\t\t\t\t}, // How long to wait before the header shows\n\t\t\t\t\t\t},\n\t\t\t\t\t\tview: { opacity: 1 },\n\t\t\t\t\t\tedit: { opacity: 1 },\n\t\t\t\t\t} }\n\t\t\t\t\twhileHover={\n\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t? 'isDistractionFreeHovering'\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tanimate={ headerAnimationState }\n\t\t\t\t>\n\t\t\t\t\t<SiteHub\n\t\t\t\t\t\tisTransparent={ isResizableFrameOversized }\n\t\t\t\t\t\tclassName=\"edit-site-layout__hub\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ canvasMode === 'edit' && (\n\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\tkey=\"header\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__header\"\n\t\t\t\t\t\t\t\tariaLabel={ __( 'Editor top bar' ) }\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\t\t\tisDistractionFree: { opacity: 0, y: 0 },\n\t\t\t\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tview: { opacity: 1, y: '-100%' },\n\t\t\t\t\t\t\t\t\tedit: { opacity: 1, y: 0 },\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\topacity: isDistractionFree ? 1 : 0,\n\t\t\t\t\t\t\t\t\ty: isDistractionFree ? 0 : '-100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration: disableMotion ? 0 : 0.2,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Header />\n\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\t\t\t\t</motion.div>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t\tThe NavigableRegion must always be rendered and not use\n\t\t\t\t\t\t`inert` otherwise `useNavigateRegions` will fail.\n\t\t\t\t\t*/ }\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar-region\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t{ canvasMode === 'view' && (\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\tdisableMotion || isMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t</NavigableRegion>\n\n\t\t\t\t\t<SavePanel />\n\n\t\t\t\t\t{ areas.content && canvasMode !== 'edit' && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmaxWidth: widths?.content,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ areas.content }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ areas.preview && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__canvas-container\">\n\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t\tscale: 1.005,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\t\tlayout=\"position\"\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\tisReady={ ! isEditorLoading }\n\t\t\t\t\t\t\t\t\t\t\tisFullWidth={\n\t\t\t\t\t\t\t\t\t\t\t\tcanvasMode === 'edit'\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t</ResizableFrame>\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,EAC5CC,4BAA4B,IAAIC,kBAAkB,QAC5C,uBAAuB;AAC9B,SACCC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,QACX,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;AAC/E,SACCC,WAAW,EACXC,WAAW,IAAIC,mBAAmB,QAC5B,qBAAqB;AAC5B,SAASJ,KAAK,IAAI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,QAAQ,EAAEjC,MAAM,EAAE+B;IACnB;EAAG,GAEDhC,KAAK,CAACgC,OACJ,CACL,EAEChC,KAAK,CAACmC,OAAO,IACd7B,aAAA;IAAKG,SAAS,EAAC;EAAoC,GAChDf,aAAa,EACb,CAAC,CAAEC,UAAU,CAACyC,KAAK,IACpB9B,aAAA,CAACtE,MAAM,CAAC0E,GAAG;IACVU,UAAU,EACTtC,UAAU,KAAK,MAAM,GAClB;MACAuD,KAAK,EAAE,KAAK;MACZxB,UAAU,EAAE;QACXiB,QAAQ,EAAErC,aAAa,GACpB,CAAC,GACD,GAAG;QACNsC,IAAI,EAAE;MACP;IACA,CAAC,GACD,CAAC,CACJ;IACDP,OAAO,EAAG,KAAO;IACjBc,MAAM,EAAC,UAAU;IACjB7B,SAAS,EAAG5E,UAAU,CACrB,0BAA0B,EAC1B;MACC,kBAAkB,EACjBiE;IACF,CACD,CAAG;IACHe,UAAU,EAAG;MACZC,IAAI,EAAE,OAAO;MACbgB,QAAQ,EAAErC,aAAa,GACpB,CAAC,GACDjB,kBAAkB;MACrBuD,IAAI,EAAE;IACP;EAAG,GAEHzB,aAAA,CAAChD,aAAa,QACbgD,aAAA,CAAC3C,cAAc;IACd4E,OAAO,EAAG,CAAE1C,eAAiB;IAC7B2C,WAAW,EACV1D,UAAU,KAAK,MACf;IACD2D,WAAW,EAAG;MACbL,KAAK,EACJzC,UAAU,CAACyC,KAAK,GAChB,EAAE,CAAC;MACJM,MAAM,EAAE/C,UAAU,CAAC+C;IACpB,CAAG;IACHC,WAAW,EACV7C,yBACA;IACD8C,cAAc,EACb7C,4BACA;IACD8C,iBAAiB,EAAG;MACnBC,UAAU,EACTzC,aAAa,aAAbA,aAAa,cAAbA,aAAa,GACbD;IACF;EAAG,GAEDJ,KAAK,CAACmC,OACO,CACF,CACJ,CAET,CAEF,CACD,CACJ,CAAC;AAEL"}
@@ -0,0 +1,127 @@
1
+ import { createElement } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { unlock } from '../../lock-unlock';
11
+ import { useIsSiteEditorLoading } from './hooks';
12
+ import Editor from '../editor';
13
+ import PagePages from '../page-pages';
14
+ import PagePatterns from '../page-patterns';
15
+ import PageTemplatesTemplateParts from '../page-templates-template-parts';
16
+ import { TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE } from '../../utils/constants';
17
+ const {
18
+ useLocation
19
+ } = unlock(routerPrivateApis);
20
+ export default function useLayoutAreas() {
21
+ const isSiteEditorLoading = useIsSiteEditorLoading();
22
+ const {
23
+ params
24
+ } = useLocation();
25
+ const {
26
+ postType,
27
+ postId,
28
+ path,
29
+ layout,
30
+ isCustom
31
+ } = params !== null && params !== void 0 ? params : {};
32
+ // Regular page
33
+ if (path === '/page') {
34
+ return {
35
+ areas: {
36
+ content: undefined,
37
+ preview: createElement(Editor, {
38
+ isLoading: isSiteEditorLoading
39
+ })
40
+ },
41
+ widths: {
42
+ content: undefined
43
+ }
44
+ };
45
+ }
46
+
47
+ // List layout is still experimental.
48
+ // Extracted it here out of the conditionals so it doesn't unintentionally becomes stable.
49
+ const isListLayout = isCustom !== 'true' && layout === 'list' && window?.__experimentalAdminViews;
50
+ if (path === '/pages') {
51
+ return {
52
+ areas: {
53
+ content: createElement(PagePages, null),
54
+ preview: isListLayout && createElement(Editor, {
55
+ isLoading: isSiteEditorLoading
56
+ })
57
+ },
58
+ widths: {
59
+ content: isListLayout ? 380 : undefined
60
+ }
61
+ };
62
+ }
63
+
64
+ // Regular other post types
65
+ if (postType && postId) {
66
+ return {
67
+ areas: {
68
+ preview: createElement(Editor, {
69
+ isLoading: isSiteEditorLoading
70
+ })
71
+ }
72
+ };
73
+ }
74
+
75
+ // Templates
76
+ if (path === '/wp_template/all') {
77
+ return {
78
+ areas: {
79
+ content: createElement(PageTemplatesTemplateParts, {
80
+ postType: TEMPLATE_POST_TYPE
81
+ }),
82
+ preview: isListLayout && createElement(Editor, {
83
+ isLoading: isSiteEditorLoading
84
+ })
85
+ },
86
+ widths: {
87
+ content: isListLayout ? 380 : undefined
88
+ }
89
+ };
90
+ }
91
+
92
+ // Template parts
93
+ if (path === '/wp_template_part/all') {
94
+ return {
95
+ areas: {
96
+ content: createElement(PageTemplatesTemplateParts, {
97
+ postType: TEMPLATE_PART_POST_TYPE
98
+ }),
99
+ preview: isListLayout && createElement(Editor, {
100
+ isLoading: isSiteEditorLoading
101
+ })
102
+ },
103
+ widths: {
104
+ content: isListLayout ? 380 : undefined
105
+ }
106
+ };
107
+ }
108
+
109
+ // Patterns
110
+ if (path === '/patterns') {
111
+ return {
112
+ areas: {
113
+ content: createElement(PagePatterns, null)
114
+ }
115
+ };
116
+ }
117
+
118
+ // Fallback shows the home page preview
119
+ return {
120
+ areas: {
121
+ preview: createElement(Editor, {
122
+ isLoading: isSiteEditorLoading
123
+ })
124
+ }
125
+ };
126
+ }
127
+ //# sourceMappingURL=router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["privateApis","routerPrivateApis","unlock","useIsSiteEditorLoading","Editor","PagePages","PagePatterns","PageTemplatesTemplateParts","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","useLocation","useLayoutAreas","isSiteEditorLoading","params","postType","postId","path","layout","isCustom","areas","content","undefined","preview","createElement","isLoading","widths","isListLayout","window","__experimentalAdminViews"],"sources":["@wordpress/edit-site/src/components/layout/router.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { useIsSiteEditorLoading } from './hooks';\nimport Editor from '../editor';\nimport PagePages from '../page-pages';\nimport PagePatterns from '../page-patterns';\nimport PageTemplatesTemplateParts from '../page-templates-template-parts';\n\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function useLayoutAreas() {\n\tconst isSiteEditorLoading = useIsSiteEditorLoading();\n\tconst { params } = useLocation();\n\tconst { postType, postId, path, layout, isCustom } = params ?? {};\n\t// Regular page\n\tif ( path === '/page' ) {\n\t\treturn {\n\t\t\tareas: {\n\t\t\t\tcontent: undefined,\n\t\t\t\tpreview: <Editor isLoading={ isSiteEditorLoading } />,\n\t\t\t},\n\t\t\twidths: {\n\t\t\t\tcontent: undefined,\n\t\t\t},\n\t\t};\n\t}\n\n\t// List layout is still experimental.\n\t// Extracted it here out of the conditionals so it doesn't unintentionally becomes stable.\n\tconst isListLayout =\n\t\tisCustom !== 'true' &&\n\t\tlayout === 'list' &&\n\t\twindow?.__experimentalAdminViews;\n\n\tif ( path === '/pages' ) {\n\t\treturn {\n\t\t\tareas: {\n\t\t\t\tcontent: <PagePages />,\n\t\t\t\tpreview: isListLayout && (\n\t\t\t\t\t<Editor isLoading={ isSiteEditorLoading } />\n\t\t\t\t),\n\t\t\t},\n\t\t\twidths: {\n\t\t\t\tcontent: isListLayout ? 380 : undefined,\n\t\t\t},\n\t\t};\n\t}\n\n\t// Regular other post types\n\tif ( postType && postId ) {\n\t\treturn {\n\t\t\tareas: {\n\t\t\t\tpreview: <Editor isLoading={ isSiteEditorLoading } />,\n\t\t\t},\n\t\t};\n\t}\n\n\t// Templates\n\tif ( path === '/wp_template/all' ) {\n\t\treturn {\n\t\t\tareas: {\n\t\t\t\tcontent: (\n\t\t\t\t\t<PageTemplatesTemplateParts\n\t\t\t\t\t\tpostType={ TEMPLATE_POST_TYPE }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tpreview: isListLayout && (\n\t\t\t\t\t<Editor isLoading={ isSiteEditorLoading } />\n\t\t\t\t),\n\t\t\t},\n\t\t\twidths: {\n\t\t\t\tcontent: isListLayout ? 380 : undefined,\n\t\t\t},\n\t\t};\n\t}\n\n\t// Template parts\n\tif ( path === '/wp_template_part/all' ) {\n\t\treturn {\n\t\t\tareas: {\n\t\t\t\tcontent: (\n\t\t\t\t\t<PageTemplatesTemplateParts\n\t\t\t\t\t\tpostType={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tpreview: isListLayout && (\n\t\t\t\t\t<Editor isLoading={ isSiteEditorLoading } />\n\t\t\t\t),\n\t\t\t},\n\t\t\twidths: {\n\t\t\t\tcontent: isListLayout ? 380 : undefined,\n\t\t\t},\n\t\t};\n\t}\n\n\t// Patterns\n\tif ( path === '/patterns' ) {\n\t\treturn {\n\t\t\tareas: {\n\t\t\t\tcontent: <PagePatterns />,\n\t\t\t},\n\t\t};\n\t}\n\n\t// Fallback shows the home page preview\n\treturn {\n\t\tareas: { preview: <Editor isLoading={ isSiteEditorLoading } /> },\n\t};\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,sBAAsB,QAAQ,SAAS;AAChD,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,0BAA0B,MAAM,kCAAkC;AAEzE,SACCC,kBAAkB,EAClBC,uBAAuB,QACjB,uBAAuB;AAE9B,MAAM;EAAEC;AAAY,CAAC,GAAGR,MAAM,CAAED,iBAAkB,CAAC;AAEnD,eAAe,SAASU,cAAcA,CAAA,EAAG;EACxC,MAAMC,mBAAmB,GAAGT,sBAAsB,CAAC,CAAC;EACpD,MAAM;IAAEU;EAAO,CAAC,GAAGH,WAAW,CAAC,CAAC;EAChC,MAAM;IAAEI,QAAQ;IAAEC,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC;EAAS,CAAC,GAAGL,MAAM,aAANA,MAAM,cAANA,MAAM,GAAI,CAAC,CAAC;EACjE;EACA,IAAKG,IAAI,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,OAAO,EACNG,aAAA,CAAChB,0BAA0B;UAC1BO,QAAQ,EAAGL;QAAyB,CACpC,CACD;QACDa,OAAO,EAAEI,YAAY,IACpBH,aAAA,CAACnB,MAAM;UAACoB,SAAS,EAAGZ;QAAqB,CAAE;MAE7C,CAAC;MACDa,MAAM,EAAE;QACPL,OAAO,EAAEM,YAAY,GAAG,GAAG,GAAGL;MAC/B;IACD,CAAC;EACF;;EAEA;EACA,IAAKL,IAAI,KAAK,WAAW,EAAG;IAC3B,OAAO;MACNG,KAAK,EAAE;QACNC,OAAO,EAAEG,aAAA,CAACjB,YAAY,MAAE;MACzB;IACD,CAAC;EACF;;EAEA;EACA,OAAO;IACNa,KAAK,EAAE;MAAEG,OAAO,EAAEC,aAAA,CAACnB,MAAM;QAACoB,SAAS,EAAGZ;MAAqB,CAAE;IAAE;EAChE,CAAC;AACF"}
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { __experimentalView as View, __experimentalVStack as VStack, Button } from '@wordpress/components';
5
+ import { Button } from '@wordpress/components';
6
6
  import { __ } from '@wordpress/i18n';
7
7
  import { useEntityRecords, store as coreStore } from '@wordpress/core-data';
8
8
  import { decodeEntities } from '@wordpress/html-entities';
@@ -11,17 +11,15 @@ import { dateI18n, getDate, getSettings } from '@wordpress/date';
11
11
  import { privateApis as routerPrivateApis } from '@wordpress/router';
12
12
  import { useSelect, useDispatch } from '@wordpress/data';
13
13
  import { DataViews } from '@wordpress/dataviews';
14
- import { ENTER, SPACE } from '@wordpress/keycodes';
15
14
 
16
15
  /**
17
16
  * Internal dependencies
18
17
  */
19
18
  import Page from '../page';
20
- import Link from '../routes/link';
19
+ import { default as Link, useLink } from '../routes/link';
21
20
  import { DEFAULT_VIEWS, DEFAULT_CONFIG_PER_VIEW_TYPE } from '../sidebar-dataviews/default-views';
22
21
  import { ENUMERATION_TYPE, LAYOUT_GRID, LAYOUT_TABLE, LAYOUT_LIST, OPERATOR_IN, OPERATOR_NOT_IN } from '../../utils/constants';
23
22
  import { trashPostAction, usePermanentlyDeletePostAction, useRestorePostAction, postRevisionsAction, viewPostAction, useEditPostAction } from '../actions';
24
- import PostPreview from '../post-preview';
25
23
  import AddNewPageModal from '../add-new-page';
26
24
  import Media from '../media';
27
25
  import { unlock } from '../../lock-unlock';
@@ -30,16 +28,29 @@ const {
30
28
  useHistory
31
29
  } = unlock(routerPrivateApis);
32
30
  const EMPTY_ARRAY = [];
33
- function useView(type) {
31
+ const SUPPORTED_LAYOUTS = window?.__experimentalAdminViews ? [LAYOUT_GRID, LAYOUT_TABLE, LAYOUT_LIST] : [LAYOUT_GRID, LAYOUT_TABLE];
32
+ function useView(postType) {
34
33
  const {
35
- params: {
36
- activeView = 'all',
37
- isCustom = 'false'
38
- }
34
+ params
39
35
  } = useLocation();
40
- const selectedDefaultView = isCustom === 'false' && DEFAULT_VIEWS[type].find(({
41
- slug
42
- }) => slug === activeView)?.view;
36
+ const {
37
+ activeView = 'all',
38
+ isCustom = 'false',
39
+ layout
40
+ } = params;
41
+ const history = useHistory();
42
+ const selectedDefaultView = useMemo(() => {
43
+ const defaultView = isCustom === 'false' && DEFAULT_VIEWS[postType].find(({
44
+ slug
45
+ }) => slug === activeView)?.view;
46
+ if (isCustom === 'false' && layout) {
47
+ return {
48
+ ...defaultView,
49
+ type: layout
50
+ };
51
+ }
52
+ return defaultView;
53
+ }, [isCustom, activeView, layout, postType]);
43
54
  const [view, setView] = useState(selectedDefaultView);
44
55
  useEffect(() => {
45
56
  if (selectedDefaultView) {
@@ -60,20 +71,38 @@ function useView(type) {
60
71
  editEntityRecord
61
72
  } = useDispatch(coreStore);
62
73
  const customView = useMemo(() => {
63
- return editedViewRecord?.content && JSON.parse(editedViewRecord?.content);
74
+ const storedView = editedViewRecord?.content && JSON.parse(editedViewRecord?.content);
75
+ if (!storedView) {
76
+ return storedView;
77
+ }
78
+ return {
79
+ ...storedView,
80
+ layout: {
81
+ ...(DEFAULT_CONFIG_PER_VIEW_TYPE[storedView?.type] || {})
82
+ }
83
+ };
64
84
  }, [editedViewRecord?.content]);
65
85
  const setCustomView = useCallback(viewToSet => {
66
86
  editEntityRecord('postType', 'wp_dataviews', editedViewRecord?.id, {
67
87
  content: JSON.stringify(viewToSet)
68
88
  });
69
89
  }, [editEntityRecord, editedViewRecord?.id]);
90
+ const setDefaultViewAndUpdateUrl = useCallback(viewToSet => {
91
+ if (viewToSet.type !== view?.type) {
92
+ history.push({
93
+ ...params,
94
+ layout: viewToSet.type
95
+ });
96
+ }
97
+ setView(viewToSet);
98
+ }, [params, view?.type, history]);
70
99
  if (isCustom === 'false') {
71
- return [view, setView];
100
+ return [view, setDefaultViewAndUpdateUrl];
72
101
  } else if (isCustom === 'true' && customView) {
73
102
  return [customView, setCustomView];
74
103
  }
75
104
  // Loading state where no the view was not found on custom views or default views.
76
- return [DEFAULT_VIEWS[type][0].view, setView];
105
+ return [DEFAULT_VIEWS[postType][0].view, setDefaultViewAndUpdateUrl];
77
106
  }
78
107
 
79
108
  // See https://github.com/WordPress/gutenberg/issues/55886
@@ -99,20 +128,51 @@ const STATUSES = [{
99
128
  }];
100
129
  const DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.
101
130
 
131
+ function FeaturedImage({
132
+ item,
133
+ viewType
134
+ }) {
135
+ const {
136
+ onClick
137
+ } = useLink({
138
+ postId: item.id,
139
+ postType: item.type,
140
+ canvas: 'edit'
141
+ });
142
+ const hasMedia = !!item.featured_media;
143
+ return createElement("span", {
144
+ className: {
145
+ 'edit-site-page-pages__media-wrapper': viewType === LAYOUT_TABLE
146
+ }
147
+ }, createElement("button", {
148
+ className: "page-pages-preview-field__button",
149
+ type: "button",
150
+ onClick: onClick,
151
+ "aria-label": item.title?.rendered || __('(no title)')
152
+ }, hasMedia && createElement(Media, {
153
+ className: "edit-site-page-pages__featured-image",
154
+ id: item.featured_media,
155
+ size: viewType === LAYOUT_GRID ? ['large', 'full', 'medium', 'thumbnail'] : ['thumbnail', 'medium', 'large', 'full']
156
+ })));
157
+ }
102
158
  export default function PagePages() {
103
159
  const postType = 'page';
104
160
  const [view, setView] = useView(postType);
105
- const [pageId, setPageId] = useState(null);
106
161
  const history = useHistory();
107
- const onSelectionChange = useCallback(items => setPageId(items?.length === 1 ? items[0].id : null), [setPageId]);
108
- const onDetailsChange = useCallback(items => {
109
- if (!!postType && items?.length === 1) {
162
+ const {
163
+ params
164
+ } = useLocation();
165
+ const {
166
+ isCustom = 'false'
167
+ } = params;
168
+ const onSelectionChange = useCallback(items => {
169
+ if (isCustom === 'false' && view?.type === LAYOUT_LIST) {
110
170
  history.push({
111
- postId: items[0].id,
112
- postType
171
+ ...params,
172
+ postId: items.length === 1 ? items[0].id : undefined
113
173
  });
114
174
  }
115
- }, [history, postType]);
175
+ }, [history, params, view?.type, isCustom]);
116
176
  const queryArgs = useMemo(() => {
117
177
  const filters = {};
118
178
  view.filters.forEach(filter => {
@@ -162,11 +222,10 @@ export default function PagePages() {
162
222
  }) => item.featured_media,
163
223
  render: ({
164
224
  item
165
- }) => !!item.featured_media ? createElement(Media, {
166
- className: "edit-site-page-pages__featured-image",
167
- id: item.featured_media,
168
- size: view.type === LAYOUT_GRID ? ['large', 'full', 'medium', 'thumbnail'] : ['thumbnail', 'medium', 'large', 'full']
169
- }) : null,
225
+ }) => createElement(FeaturedImage, {
226
+ item: item,
227
+ viewType: view.type
228
+ }),
170
229
  enableSorting: false
171
230
  }, {
172
231
  header: __('Title'),
@@ -177,18 +236,13 @@ export default function PagePages() {
177
236
  render: ({
178
237
  item
179
238
  }) => {
180
- return createElement(VStack, {
181
- spacing: 1
182
- }, createElement(View, {
183
- as: "span",
184
- className: "dataviews-view-grid__title-field"
185
- }, [LAYOUT_TABLE, LAYOUT_GRID].includes(view.type) ? createElement(Link, {
239
+ return [LAYOUT_TABLE, LAYOUT_GRID].includes(view.type) ? createElement(Link, {
186
240
  params: {
187
241
  postId: item.id,
188
242
  postType: item.type,
189
243
  canvas: 'edit'
190
244
  }
191
- }, decodeEntities(item.title?.rendered) || __('(no title)')) : decodeEntities(item.title?.rendered) || __('(no title)')));
245
+ }, decodeEntities(item.title?.rendered) || __('(no title)')) : decodeEntities(item.title?.rendered) || __('(no title)');
192
246
  },
193
247
  maxWidth: 400,
194
248
  enableHiding: false
@@ -275,8 +329,7 @@ export default function PagePages() {
275
329
  }, [history]);
276
330
 
277
331
  // TODO: we need to handle properly `data={ data || EMPTY_ARRAY }` for when `isLoading`.
278
- return createElement(Fragment, null, createElement(Page, {
279
- className: view.type === LAYOUT_LIST ? 'edit-site-page-pages-list-view' : null,
332
+ return createElement(Page, {
280
333
  title: __('Pages'),
281
334
  actions: createElement(Fragment, null, createElement(Button, {
282
335
  variant: "primary",
@@ -294,39 +347,7 @@ export default function PagePages() {
294
347
  view: view,
295
348
  onChangeView: onChangeView,
296
349
  onSelectionChange: onSelectionChange,
297
- onDetailsChange: onDetailsChange
298
- })), view.type === LAYOUT_LIST && createElement(Page, null, createElement("div", {
299
- className: "edit-site-page-pages-preview",
300
- tabIndex: 0,
301
- role: "button",
302
- onKeyDown: event => {
303
- const {
304
- keyCode
305
- } = event;
306
- if (keyCode === ENTER || keyCode === SPACE) {
307
- history.push({
308
- postId: pageId,
309
- postType,
310
- canvas: 'edit'
311
- });
312
- }
313
- },
314
- onClick: () => history.push({
315
- postId: pageId,
316
- postType,
317
- canvas: 'edit'
318
- })
319
- }, pageId !== null ? createElement(PostPreview, {
320
- postId: pageId,
321
- postType: postType
322
- }) : createElement("div", {
323
- style: {
324
- display: 'flex',
325
- flexDirection: 'column',
326
- justifyContent: 'center',
327
- textAlign: 'center',
328
- height: '100%'
329
- }
330
- }, createElement("p", null, __('Select a page to preview'))))));
350
+ supportedLayouts: SUPPORTED_LAYOUTS
351
+ }));
331
352
  }
332
353
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalView","View","__experimentalVStack","VStack","Button","__","useEntityRecords","store","coreStore","decodeEntities","useState","useMemo","useCallback","useEffect","dateI18n","getDate","getSettings","privateApis","routerPrivateApis","useSelect","useDispatch","DataViews","ENTER","SPACE","Page","Link","DEFAULT_VIEWS","DEFAULT_CONFIG_PER_VIEW_TYPE","ENUMERATION_TYPE","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","OPERATOR_IN","OPERATOR_NOT_IN","trashPostAction","usePermanentlyDeletePostAction","useRestorePostAction","postRevisionsAction","viewPostAction","useEditPostAction","PostPreview","AddNewPageModal","Media","unlock","useLocation","useHistory","EMPTY_ARRAY","useView","type","params","activeView","isCustom","selectedDefaultView","find","slug","view","setView","editedViewRecord","select","getEditedEntityRecord","dataviewRecord","Number","editEntityRecord","customView","content","JSON","parse","setCustomView","viewToSet","id","stringify","STATUSES","value","label","DEFAULT_STATUSES","PagePages","postType","pageId","setPageId","history","onSelectionChange","items","length","onDetailsChange","push","postId","queryArgs","filters","forEach","filter","field","operator","status","author","author_exclude","per_page","perPage","page","_embed","order","sort","direction","orderby","search","records","pages","isResolving","isLoadingPages","totalItems","totalPages","authors","isLoadingAuthors","paginationInfo","fields","header","getValue","item","featured_media","render","createElement","className","size","enableSorting","title","rendered","spacing","as","includes","canvas","maxWidth","enableHiding","_embedded","name","elements","map","_STATUSES$find$label","filterBy","operators","date","formattedDate","formats","datetimeAbbreviated","permanentlyDeletePostAction","restorePostAction","editPostAction","actions","onChangeView","newView","layout","showAddPageModal","setShowAddPageModal","openModal","closeModal","handleNewPage","Fragment","variant","onClick","onSave","onClose","data","isLoading","tabIndex","role","onKeyDown","event","keyCode","style","display","flexDirection","justifyContent","textAlign","height"],"sources":["@wordpress/edit-site/src/components/page-pages/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalView as View,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { dateI18n, getDate, getSettings } from '@wordpress/date';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { DataViews } from '@wordpress/dataviews';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport Link from '../routes/link';\nimport {\n\tDEFAULT_VIEWS,\n\tDEFAULT_CONFIG_PER_VIEW_TYPE,\n} from '../sidebar-dataviews/default-views';\nimport {\n\tENUMERATION_TYPE,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n\tOPERATOR_IN,\n\tOPERATOR_NOT_IN,\n} from '../../utils/constants';\n\nimport {\n\ttrashPostAction,\n\tusePermanentlyDeletePostAction,\n\tuseRestorePostAction,\n\tpostRevisionsAction,\n\tviewPostAction,\n\tuseEditPostAction,\n} from '../actions';\nimport PostPreview from '../post-preview';\nimport AddNewPageModal from '../add-new-page';\nimport Media from '../media';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nfunction useView( type ) {\n\tconst {\n\t\tparams: { activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tconst selectedDefaultView =\n\t\tisCustom === 'false' &&\n\t\tDEFAULT_VIEWS[ type ].find( ( { slug } ) => slug === activeView )?.view;\n\tconst [ view, setView ] = useState( selectedDefaultView );\n\n\tuseEffect( () => {\n\t\tif ( selectedDefaultView ) {\n\t\t\tsetView( selectedDefaultView );\n\t\t}\n\t}, [ selectedDefaultView ] );\n\tconst editedViewRecord = useSelect(\n\t\t( select ) => {\n\t\t\tif ( isCustom !== 'true' ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst dataviewRecord = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\tNumber( activeView )\n\t\t\t);\n\t\t\treturn dataviewRecord;\n\t\t},\n\t\t[ activeView, isCustom ]\n\t);\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst customView = useMemo( () => {\n\t\treturn (\n\t\t\teditedViewRecord?.content && JSON.parse( editedViewRecord?.content )\n\t\t);\n\t}, [ editedViewRecord?.content ] );\n\tconst setCustomView = useCallback(\n\t\t( viewToSet ) => {\n\t\t\teditEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\teditedViewRecord?.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: JSON.stringify( viewToSet ),\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t\t[ editEntityRecord, editedViewRecord?.id ]\n\t);\n\n\tif ( isCustom === 'false' ) {\n\t\treturn [ view, setView ];\n\t} else if ( isCustom === 'true' && customView ) {\n\t\treturn [ customView, setCustomView ];\n\t}\n\t// Loading state where no the view was not found on custom views or default views.\n\treturn [ DEFAULT_VIEWS[ type ][ 0 ].view, setView ];\n}\n\n// See https://github.com/WordPress/gutenberg/issues/55886\n// We do not support custom statutes at the moment.\nconst STATUSES = [\n\t{ value: 'draft', label: __( 'Draft' ) },\n\t{ value: 'future', label: __( 'Scheduled' ) },\n\t{ value: 'pending', label: __( 'Pending Review' ) },\n\t{ value: 'private', label: __( 'Private' ) },\n\t{ value: 'publish', label: __( 'Published' ) },\n\t{ value: 'trash', label: __( 'Trash' ) },\n];\nconst DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.\n\nexport default function PagePages() {\n\tconst postType = 'page';\n\tconst [ view, setView ] = useView( postType );\n\tconst [ pageId, setPageId ] = useState( null );\n\tconst history = useHistory();\n\n\tconst onSelectionChange = useCallback(\n\t\t( items ) => setPageId( items?.length === 1 ? items[ 0 ].id : null ),\n\t\t[ setPageId ]\n\t);\n\n\tconst onDetailsChange = useCallback(\n\t\t( items ) => {\n\t\t\tif ( !! postType && items?.length === 1 ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostId: items[ 0 ].id,\n\t\t\t\t\tpostType,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history, postType ]\n\t);\n\n\tconst queryArgs = useMemo( () => {\n\t\tconst filters = {};\n\t\tview.filters.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IN\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IN\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_NOT_IN\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\t\t// We want to provide a different default item for the status filter\n\t\t// than the REST API provides.\n\t\tif ( ! filters.status || filters.status === '' ) {\n\t\t\tfilters.status = DEFAULT_STATUSES;\n\t\t}\n\n\t\treturn {\n\t\t\tper_page: view.perPage,\n\t\t\tpage: view.page,\n\t\t\t_embed: 'author',\n\t\t\torder: view.sort?.direction,\n\t\t\torderby: view.sort?.field,\n\t\t\tsearch: view.search,\n\t\t\t...filters,\n\t\t};\n\t}, [ view ] );\n\tconst {\n\t\trecords: pages,\n\t\tisResolving: isLoadingPages,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecords( 'postType', postType, queryArgs );\n\n\tconst { records: authors, isResolving: isLoadingAuthors } =\n\t\tuseEntityRecords( 'root', 'user' );\n\n\tconst paginationInfo = useMemo(\n\t\t() => ( {\n\t\t\ttotalItems,\n\t\t\ttotalPages,\n\t\t} ),\n\t\t[ totalItems, totalPages ]\n\t);\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: 'featured-image',\n\t\t\t\theader: __( 'Featured Image' ),\n\t\t\t\tgetValue: ( { item } ) => item.featured_media,\n\t\t\t\trender: ( { item } ) =>\n\t\t\t\t\t!! item.featured_media ? (\n\t\t\t\t\t\t<Media\n\t\t\t\t\t\t\tclassName=\"edit-site-page-pages__featured-image\"\n\t\t\t\t\t\t\tid={ item.featured_media }\n\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\tview.type === LAYOUT_GRID\n\t\t\t\t\t\t\t\t\t? [ 'large', 'full', 'medium', 'thumbnail' ]\n\t\t\t\t\t\t\t\t\t: [ 'thumbnail', 'medium', 'large', 'full' ]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null,\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Title' ),\n\t\t\t\tid: 'title',\n\t\t\t\tgetValue: ( { item } ) => item.title?.rendered,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tas=\"span\"\n\t\t\t\t\t\t\t\tclassName=\"dataviews-view-grid__title-field\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ [ LAYOUT_TABLE, LAYOUT_GRID ].includes(\n\t\t\t\t\t\t\t\t\tview.type\n\t\t\t\t\t\t\t\t) ? (\n\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\tparams={ {\n\t\t\t\t\t\t\t\t\t\t\tpostId: item.id,\n\t\t\t\t\t\t\t\t\t\t\tpostType: item.type,\n\t\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\titem.title?.rendered\n\t\t\t\t\t\t\t\t\t\t) || __( '(no title)' ) }\n\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tdecodeEntities( item.title?.rendered ) ||\n\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tmaxWidth: 400,\n\t\t\t\tenableHiding: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Author' ),\n\t\t\t\tid: 'author',\n\t\t\t\tgetValue: ( { item } ) => item._embedded?.author[ 0 ]?.name,\n\t\t\t\ttype: ENUMERATION_TYPE,\n\t\t\t\telements:\n\t\t\t\t\tauthors?.map( ( { id, name } ) => ( {\n\t\t\t\t\t\tvalue: id,\n\t\t\t\t\t\tlabel: name,\n\t\t\t\t\t} ) ) || [],\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Status' ),\n\t\t\t\tid: 'status',\n\t\t\t\tgetValue: ( { item } ) =>\n\t\t\t\t\tSTATUSES.find( ( { value } ) => value === item.status )\n\t\t\t\t\t\t?.label ?? item.status,\n\t\t\t\ttype: ENUMERATION_TYPE,\n\t\t\t\telements: STATUSES,\n\t\t\t\tenableSorting: false,\n\t\t\t\tfilterBy: {\n\t\t\t\t\toperators: [ OPERATOR_IN ],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Date' ),\n\t\t\t\tid: 'date',\n\t\t\t\tgetValue: ( { item } ) => item.date,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\tconst formattedDate = dateI18n(\n\t\t\t\t\t\tgetSettings().formats.datetimeAbbreviated,\n\t\t\t\t\t\tgetDate( item.date )\n\t\t\t\t\t);\n\t\t\t\t\treturn <time>{ formattedDate }</time>;\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t[ authors, view.type ]\n\t);\n\n\tconst permanentlyDeletePostAction = usePermanentlyDeletePostAction();\n\tconst restorePostAction = useRestorePostAction();\n\tconst editPostAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [\n\t\t\tviewPostAction,\n\t\t\ttrashPostAction,\n\t\t\trestorePostAction,\n\t\t\tpermanentlyDeletePostAction,\n\t\t\teditPostAction,\n\t\t\tpostRevisionsAction,\n\t\t],\n\t\t[ permanentlyDeletePostAction, restorePostAction, editPostAction ]\n\t);\n\tconst onChangeView = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type !== view.type ) {\n\t\t\t\tnewView = {\n\t\t\t\t\t...newView,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...DEFAULT_CONFIG_PER_VIEW_TYPE[ newView.type ],\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tsetView( newView );\n\t\t},\n\t\t[ view.type, setView ]\n\t);\n\n\tconst [ showAddPageModal, setShowAddPageModal ] = useState( false );\n\tconst openModal = useCallback( () => {\n\t\tif ( ! showAddPageModal ) {\n\t\t\tsetShowAddPageModal( true );\n\t\t}\n\t}, [ showAddPageModal ] );\n\tconst closeModal = useCallback( () => {\n\t\tif ( showAddPageModal ) {\n\t\t\tsetShowAddPageModal( false );\n\t\t}\n\t}, [ showAddPageModal ] );\n\tconst handleNewPage = useCallback(\n\t\t( { type, id } ) => {\n\t\t\thistory.push( {\n\t\t\t\tpostId: id,\n\t\t\t\tpostType: type,\n\t\t\t\tcanvas: 'edit',\n\t\t\t} );\n\t\t\tcloseModal();\n\t\t},\n\t\t[ history ]\n\t);\n\n\t// TODO: we need to handle properly `data={ data || EMPTY_ARRAY }` for when `isLoading`.\n\treturn (\n\t\t<>\n\t\t\t<Page\n\t\t\t\tclassName={\n\t\t\t\t\tview.type === LAYOUT_LIST\n\t\t\t\t\t\t? 'edit-site-page-pages-list-view'\n\t\t\t\t\t\t: null\n\t\t\t\t}\n\t\t\t\ttitle={ __( 'Pages' ) }\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button variant=\"primary\" onClick={ openModal }>\n\t\t\t\t\t\t\t{ __( 'Add new page' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ showAddPageModal && (\n\t\t\t\t\t\t\t<AddNewPageModal\n\t\t\t\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\t\t\t\tonClose={ closeModal }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<DataViews\n\t\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tactions={ actions }\n\t\t\t\t\tdata={ pages || EMPTY_ARRAY }\n\t\t\t\t\tisLoading={ isLoadingPages || isLoadingAuthors }\n\t\t\t\t\tview={ view }\n\t\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\t\tonSelectionChange={ onSelectionChange }\n\t\t\t\t\tonDetailsChange={ onDetailsChange }\n\t\t\t\t/>\n\t\t\t</Page>\n\t\t\t{ view.type === LAYOUT_LIST && (\n\t\t\t\t<Page>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-site-page-pages-preview\"\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\tconst { keyCode } = event;\n\t\t\t\t\t\t\tif ( keyCode === ENTER || keyCode === SPACE ) {\n\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\tpostId: pageId,\n\t\t\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\tpostId: pageId,\n\t\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ pageId !== null ? (\n\t\t\t\t\t\t\t<PostPreview\n\t\t\t\t\t\t\t\tpostId={ pageId }\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<p>{ __( 'Select a page to preview' ) }</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t</Page>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,QACA,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC3E,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,EAAEC,SAAS,QAAQ,oBAAoB;AAC9E,SAASC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,QAAQ,iBAAiB;AAChE,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,KAAK,EAAEC,KAAK,QAAQ,qBAAqB;;AAElD;AACA;AACA;AACA,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AAE;IACT;EAAG,GAEHpD,aAAA,YAAKlH,EAAE,CAAE,0BAA2B,CAAM,CACtC,CAEF,CACA,CAEN,CAAC;AAEL"}
1
+ {"version":3,"names":["Button","__","useEntityRecords","store","coreStore","decodeEntities","useState","useMemo","useCallback","useEffect","dateI18n","getDate","getSettings","privateApis","routerPrivateApis","useSelect","useDispatch","DataViews","Page","default","Link","useLink","DEFAULT_VIEWS","DEFAULT_CONFIG_PER_VIEW_TYPE","ENUMERATION_TYPE","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","OPERATOR_IN","OPERATOR_NOT_IN","trashPostAction","usePermanentlyDeletePostAction","useRestorePostAction","postRevisionsAction","viewPostAction","useEditPostAction","AddNewPageModal","Media","unlock","useLocation","useHistory","EMPTY_ARRAY","SUPPORTED_LAYOUTS","window","__experimentalAdminViews","useView","postType","params","activeView","isCustom","layout","history","selectedDefaultView","defaultView","find","slug","view","type","setView","editedViewRecord","select","getEditedEntityRecord","dataviewRecord","Number","editEntityRecord","customView","storedView","content","JSON","parse","setCustomView","viewToSet","id","stringify","setDefaultViewAndUpdateUrl","push","STATUSES","value","label","DEFAULT_STATUSES","FeaturedImage","item","viewType","onClick","postId","canvas","hasMedia","featured_media","createElement","className","title","rendered","size","PagePages","onSelectionChange","items","length","undefined","queryArgs","filters","forEach","filter","field","operator","status","author","author_exclude","per_page","perPage","page","_embed","order","sort","direction","orderby","search","records","pages","isResolving","isLoadingPages","totalItems","totalPages","authors","isLoadingAuthors","paginationInfo","fields","header","getValue","render","enableSorting","includes","maxWidth","enableHiding","_embedded","name","elements","map","_STATUSES$find$label","filterBy","operators","date","formattedDate","formats","datetimeAbbreviated","permanentlyDeletePostAction","restorePostAction","editPostAction","actions","onChangeView","newView","showAddPageModal","setShowAddPageModal","openModal","closeModal","handleNewPage","Fragment","variant","onSave","onClose","data","isLoading","supportedLayouts"],"sources":["@wordpress/edit-site/src/components/page-pages/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { dateI18n, getDate, getSettings } from '@wordpress/date';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { DataViews } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport { default as Link, useLink } from '../routes/link';\nimport {\n\tDEFAULT_VIEWS,\n\tDEFAULT_CONFIG_PER_VIEW_TYPE,\n} from '../sidebar-dataviews/default-views';\nimport {\n\tENUMERATION_TYPE,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n\tOPERATOR_IN,\n\tOPERATOR_NOT_IN,\n} from '../../utils/constants';\n\nimport {\n\ttrashPostAction,\n\tusePermanentlyDeletePostAction,\n\tuseRestorePostAction,\n\tpostRevisionsAction,\n\tviewPostAction,\n\tuseEditPostAction,\n} from '../actions';\nimport AddNewPageModal from '../add-new-page';\nimport Media from '../media';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\nconst SUPPORTED_LAYOUTS = window?.__experimentalAdminViews\n\t? [ LAYOUT_GRID, LAYOUT_TABLE, LAYOUT_LIST ]\n\t: [ LAYOUT_GRID, LAYOUT_TABLE ];\n\nfunction useView( postType ) {\n\tconst { params } = useLocation();\n\tconst { activeView = 'all', isCustom = 'false', layout } = params;\n\tconst history = useHistory();\n\tconst selectedDefaultView = useMemo( () => {\n\t\tconst defaultView =\n\t\t\tisCustom === 'false' &&\n\t\t\tDEFAULT_VIEWS[ postType ].find(\n\t\t\t\t( { slug } ) => slug === activeView\n\t\t\t)?.view;\n\t\tif ( isCustom === 'false' && layout ) {\n\t\t\treturn {\n\t\t\t\t...defaultView,\n\t\t\t\ttype: layout,\n\t\t\t};\n\t\t}\n\t\treturn defaultView;\n\t}, [ isCustom, activeView, layout, postType ] );\n\tconst [ view, setView ] = useState( selectedDefaultView );\n\n\tuseEffect( () => {\n\t\tif ( selectedDefaultView ) {\n\t\t\tsetView( selectedDefaultView );\n\t\t}\n\t}, [ selectedDefaultView ] );\n\tconst editedViewRecord = useSelect(\n\t\t( select ) => {\n\t\t\tif ( isCustom !== 'true' ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst dataviewRecord = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\tNumber( activeView )\n\t\t\t);\n\t\t\treturn dataviewRecord;\n\t\t},\n\t\t[ activeView, isCustom ]\n\t);\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst customView = useMemo( () => {\n\t\tconst storedView =\n\t\t\teditedViewRecord?.content &&\n\t\t\tJSON.parse( editedViewRecord?.content );\n\t\tif ( ! storedView ) {\n\t\t\treturn storedView;\n\t\t}\n\n\t\treturn {\n\t\t\t...storedView,\n\t\t\tlayout: {\n\t\t\t\t...( DEFAULT_CONFIG_PER_VIEW_TYPE[ storedView?.type ] || {} ),\n\t\t\t},\n\t\t};\n\t}, [ editedViewRecord?.content ] );\n\n\tconst setCustomView = useCallback(\n\t\t( viewToSet ) => {\n\t\t\teditEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\teditedViewRecord?.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: JSON.stringify( viewToSet ),\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t\t[ editEntityRecord, editedViewRecord?.id ]\n\t);\n\n\tconst setDefaultViewAndUpdateUrl = useCallback(\n\t\t( viewToSet ) => {\n\t\t\tif ( viewToSet.type !== view?.type ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\t...params,\n\t\t\t\t\tlayout: viewToSet.type,\n\t\t\t\t} );\n\t\t\t}\n\t\t\tsetView( viewToSet );\n\t\t},\n\t\t[ params, view?.type, history ]\n\t);\n\n\tif ( isCustom === 'false' ) {\n\t\treturn [ view, setDefaultViewAndUpdateUrl ];\n\t} else if ( isCustom === 'true' && customView ) {\n\t\treturn [ customView, setCustomView ];\n\t}\n\t// Loading state where no the view was not found on custom views or default views.\n\treturn [ DEFAULT_VIEWS[ postType ][ 0 ].view, setDefaultViewAndUpdateUrl ];\n}\n\n// See https://github.com/WordPress/gutenberg/issues/55886\n// We do not support custom statutes at the moment.\nconst STATUSES = [\n\t{ value: 'draft', label: __( 'Draft' ) },\n\t{ value: 'future', label: __( 'Scheduled' ) },\n\t{ value: 'pending', label: __( 'Pending Review' ) },\n\t{ value: 'private', label: __( 'Private' ) },\n\t{ value: 'publish', label: __( 'Published' ) },\n\t{ value: 'trash', label: __( 'Trash' ) },\n];\nconst DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.\n\nfunction FeaturedImage( { item, viewType } ) {\n\tconst { onClick } = useLink( {\n\t\tpostId: item.id,\n\t\tpostType: item.type,\n\t\tcanvas: 'edit',\n\t} );\n\tconst hasMedia = !! item.featured_media;\n\treturn (\n\t\t<span\n\t\t\tclassName={ {\n\t\t\t\t'edit-site-page-pages__media-wrapper':\n\t\t\t\t\tviewType === LAYOUT_TABLE,\n\t\t\t} }\n\t\t>\n\t\t\t<button\n\t\t\t\tclassName=\"page-pages-preview-field__button\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={ onClick }\n\t\t\t\taria-label={ item.title?.rendered || __( '(no title)' ) }\n\t\t\t>\n\t\t\t\t{ hasMedia && (\n\t\t\t\t\t<Media\n\t\t\t\t\t\tclassName=\"edit-site-page-pages__featured-image\"\n\t\t\t\t\t\tid={ item.featured_media }\n\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\tviewType === LAYOUT_GRID\n\t\t\t\t\t\t\t\t? [ 'large', 'full', 'medium', 'thumbnail' ]\n\t\t\t\t\t\t\t\t: [ 'thumbnail', 'medium', 'large', 'full' ]\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</button>\n\t\t</span>\n\t);\n}\n\nexport default function PagePages() {\n\tconst postType = 'page';\n\tconst [ view, setView ] = useView( postType );\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst { isCustom = 'false' } = params;\n\n\tconst onSelectionChange = useCallback(\n\t\t( items ) => {\n\t\t\tif ( isCustom === 'false' && view?.type === LAYOUT_LIST ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\t...params,\n\t\t\t\t\tpostId: items.length === 1 ? items[ 0 ].id : undefined,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history, params, view?.type, isCustom ]\n\t);\n\n\tconst queryArgs = useMemo( () => {\n\t\tconst filters = {};\n\t\tview.filters.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IN\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IN\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_NOT_IN\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\t\t// We want to provide a different default item for the status filter\n\t\t// than the REST API provides.\n\t\tif ( ! filters.status || filters.status === '' ) {\n\t\t\tfilters.status = DEFAULT_STATUSES;\n\t\t}\n\n\t\treturn {\n\t\t\tper_page: view.perPage,\n\t\t\tpage: view.page,\n\t\t\t_embed: 'author',\n\t\t\torder: view.sort?.direction,\n\t\t\torderby: view.sort?.field,\n\t\t\tsearch: view.search,\n\t\t\t...filters,\n\t\t};\n\t}, [ view ] );\n\tconst {\n\t\trecords: pages,\n\t\tisResolving: isLoadingPages,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecords( 'postType', postType, queryArgs );\n\n\tconst { records: authors, isResolving: isLoadingAuthors } =\n\t\tuseEntityRecords( 'root', 'user' );\n\n\tconst paginationInfo = useMemo(\n\t\t() => ( {\n\t\t\ttotalItems,\n\t\t\ttotalPages,\n\t\t} ),\n\t\t[ totalItems, totalPages ]\n\t);\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: 'featured-image',\n\t\t\t\theader: __( 'Featured Image' ),\n\t\t\t\tgetValue: ( { item } ) => item.featured_media,\n\t\t\t\trender: ( { item } ) => (\n\t\t\t\t\t<FeaturedImage item={ item } viewType={ view.type } />\n\t\t\t\t),\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Title' ),\n\t\t\t\tid: 'title',\n\t\t\t\tgetValue: ( { item } ) => item.title?.rendered,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn [ LAYOUT_TABLE, LAYOUT_GRID ].includes(\n\t\t\t\t\t\tview.type\n\t\t\t\t\t) ? (\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\tparams={ {\n\t\t\t\t\t\t\t\tpostId: item.id,\n\t\t\t\t\t\t\t\tpostType: item.type,\n\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ decodeEntities( item.title?.rendered ) ||\n\t\t\t\t\t\t\t\t__( '(no title)' ) }\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tdecodeEntities( item.title?.rendered ) ||\n\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tmaxWidth: 400,\n\t\t\t\tenableHiding: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Author' ),\n\t\t\t\tid: 'author',\n\t\t\t\tgetValue: ( { item } ) => item._embedded?.author[ 0 ]?.name,\n\t\t\t\ttype: ENUMERATION_TYPE,\n\t\t\t\telements:\n\t\t\t\t\tauthors?.map( ( { id, name } ) => ( {\n\t\t\t\t\t\tvalue: id,\n\t\t\t\t\t\tlabel: name,\n\t\t\t\t\t} ) ) || [],\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Status' ),\n\t\t\t\tid: 'status',\n\t\t\t\tgetValue: ( { item } ) =>\n\t\t\t\t\tSTATUSES.find( ( { value } ) => value === item.status )\n\t\t\t\t\t\t?.label ?? item.status,\n\t\t\t\ttype: ENUMERATION_TYPE,\n\t\t\t\telements: STATUSES,\n\t\t\t\tenableSorting: false,\n\t\t\t\tfilterBy: {\n\t\t\t\t\toperators: [ OPERATOR_IN ],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Date' ),\n\t\t\t\tid: 'date',\n\t\t\t\tgetValue: ( { item } ) => item.date,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\tconst formattedDate = dateI18n(\n\t\t\t\t\t\tgetSettings().formats.datetimeAbbreviated,\n\t\t\t\t\t\tgetDate( item.date )\n\t\t\t\t\t);\n\t\t\t\t\treturn <time>{ formattedDate }</time>;\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t[ authors, view.type ]\n\t);\n\n\tconst permanentlyDeletePostAction = usePermanentlyDeletePostAction();\n\tconst restorePostAction = useRestorePostAction();\n\tconst editPostAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [\n\t\t\tviewPostAction,\n\t\t\ttrashPostAction,\n\t\t\trestorePostAction,\n\t\t\tpermanentlyDeletePostAction,\n\t\t\teditPostAction,\n\t\t\tpostRevisionsAction,\n\t\t],\n\t\t[ permanentlyDeletePostAction, restorePostAction, editPostAction ]\n\t);\n\tconst onChangeView = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type !== view.type ) {\n\t\t\t\tnewView = {\n\t\t\t\t\t...newView,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...DEFAULT_CONFIG_PER_VIEW_TYPE[ newView.type ],\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tsetView( newView );\n\t\t},\n\t\t[ view.type, setView ]\n\t);\n\n\tconst [ showAddPageModal, setShowAddPageModal ] = useState( false );\n\tconst openModal = useCallback( () => {\n\t\tif ( ! showAddPageModal ) {\n\t\t\tsetShowAddPageModal( true );\n\t\t}\n\t}, [ showAddPageModal ] );\n\tconst closeModal = useCallback( () => {\n\t\tif ( showAddPageModal ) {\n\t\t\tsetShowAddPageModal( false );\n\t\t}\n\t}, [ showAddPageModal ] );\n\tconst handleNewPage = useCallback(\n\t\t( { type, id } ) => {\n\t\t\thistory.push( {\n\t\t\t\tpostId: id,\n\t\t\t\tpostType: type,\n\t\t\t\tcanvas: 'edit',\n\t\t\t} );\n\t\t\tcloseModal();\n\t\t},\n\t\t[ history ]\n\t);\n\n\t// TODO: we need to handle properly `data={ data || EMPTY_ARRAY }` for when `isLoading`.\n\treturn (\n\t\t<Page\n\t\t\ttitle={ __( 'Pages' ) }\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<Button variant=\"primary\" onClick={ openModal }>\n\t\t\t\t\t\t{ __( 'Add new page' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t{ showAddPageModal && (\n\t\t\t\t\t\t<AddNewPageModal\n\t\t\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\t\t\tonClose={ closeModal }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t}\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ pages || EMPTY_ARRAY }\n\t\t\t\tisLoading={ isLoadingPages || isLoadingAuthors }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ onChangeView }\n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