@wordpress/edit-site 6.13.1-next.cd6172eb0.0 → 6.14.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 (441) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +1 -0
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-post/index.js +1 -1
  5. package/build/components/add-new-post/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-template-modal-content.js +1 -0
  7. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/index.js +1 -0
  9. package/build/components/add-new-template/index.js.map +1 -1
  10. package/build/components/add-new-template/utils.js +1 -0
  11. package/build/components/add-new-template/utils.js.map +1 -1
  12. package/build/components/editor-canvas-container/index.js +1 -0
  13. package/build/components/editor-canvas-container/index.js.map +1 -1
  14. package/build/components/global-styles/font-families.js +1 -0
  15. package/build/components/global-styles/font-families.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/context.js +1 -0
  17. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/font-collection.js +1 -0
  19. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/font-demo.js +1 -0
  21. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/index.js +1 -0
  23. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  25. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/library-font-details.js +1 -0
  27. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/upload-fonts.js +1 -0
  29. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +1 -0
  31. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +1 -0
  33. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  34. package/build/components/global-styles/font-library-modal/utils/index.js +1 -0
  35. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  36. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +1 -0
  37. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  38. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +1 -0
  39. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  40. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +1 -0
  41. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  42. package/build/components/global-styles/font-sizes/font-size.js +1 -0
  43. package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
  44. package/build/components/global-styles/font-sizes/font-sizes.js +1 -0
  45. package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  46. package/build/components/global-styles/highlighted-colors.js +1 -0
  47. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  48. package/build/components/global-styles/hooks.js +1 -0
  49. package/build/components/global-styles/hooks.js.map +1 -1
  50. package/build/components/global-styles/palette.js +1 -0
  51. package/build/components/global-styles/palette.js.map +1 -1
  52. package/build/components/global-styles/preset-colors.js +1 -0
  53. package/build/components/global-styles/preset-colors.js.map +1 -1
  54. package/build/components/global-styles/preview-colors.js +2 -2
  55. package/build/components/global-styles/preview-colors.js.map +1 -1
  56. package/build/components/global-styles/preview-styles.js +3 -2
  57. package/build/components/global-styles/preview-styles.js.map +1 -1
  58. package/build/components/global-styles/preview-typography.js +2 -2
  59. package/build/components/global-styles/preview-typography.js.map +1 -1
  60. package/build/components/global-styles/{preview-iframe.js → preview-wrapper.js} +11 -29
  61. package/build/components/global-styles/preview-wrapper.js.map +1 -0
  62. package/build/components/global-styles/screen-block-list.js +1 -0
  63. package/build/components/global-styles/screen-block-list.js.map +1 -1
  64. package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -0
  65. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  66. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  67. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  68. package/build/components/global-styles/shadow-utils.js +1 -0
  69. package/build/components/global-styles/shadow-utils.js.map +1 -1
  70. package/build/components/global-styles/shadows-edit-panel.js +15 -21
  71. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  72. package/build/components/global-styles/shadows-panel.js +1 -0
  73. package/build/components/global-styles/shadows-panel.js.map +1 -1
  74. package/build/components/global-styles/style-variations-container.js +1 -0
  75. package/build/components/global-styles/style-variations-container.js.map +1 -1
  76. package/build/components/global-styles/typeset.js +1 -0
  77. package/build/components/global-styles/typeset.js.map +1 -1
  78. package/build/components/global-styles/typography-example.js +8 -1
  79. package/build/components/global-styles/typography-example.js.map +1 -1
  80. package/build/components/global-styles/ui.js +1 -0
  81. package/build/components/global-styles/ui.js.map +1 -1
  82. package/build/components/global-styles/utils.js +1 -0
  83. package/build/components/global-styles/utils.js.map +1 -1
  84. package/build/components/global-styles/variations/variations-color.js +1 -0
  85. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  86. package/build/components/global-styles/variations/variations-panel.js +1 -0
  87. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  88. package/build/components/global-styles/variations/variations-typography.js +1 -0
  89. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  90. package/build/components/global-styles-renderer/index.js +1 -0
  91. package/build/components/global-styles-renderer/index.js.map +1 -1
  92. package/build/components/layout/index.js +14 -7
  93. package/build/components/layout/index.js.map +1 -1
  94. package/build/components/maybe-editor/index.js +65 -0
  95. package/build/components/maybe-editor/index.js.map +1 -0
  96. package/build/components/media/index.js +1 -0
  97. package/build/components/media/index.js.map +1 -1
  98. package/build/components/page-patterns/fields.js +2 -47
  99. package/build/components/page-patterns/fields.js.map +1 -1
  100. package/build/components/page-patterns/header.js +1 -0
  101. package/build/components/page-patterns/header.js.map +1 -1
  102. package/build/components/page-patterns/index.js +18 -14
  103. package/build/components/page-patterns/index.js.map +1 -1
  104. package/build/components/page-patterns/search-items.js +1 -0
  105. package/build/components/page-patterns/search-items.js.map +1 -1
  106. package/build/components/page-patterns/use-pattern-settings.js +1 -0
  107. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  108. package/build/components/page-patterns/use-patterns.js +1 -0
  109. package/build/components/page-patterns/use-patterns.js.map +1 -1
  110. package/build/components/page-templates/fields.js +2 -21
  111. package/build/components/page-templates/fields.js.map +1 -1
  112. package/build/components/page-templates/index.js +38 -41
  113. package/build/components/page-templates/index.js.map +1 -1
  114. package/build/components/post-edit/index.js +16 -8
  115. package/build/components/post-edit/index.js.map +1 -1
  116. package/build/components/post-list/index.js +30 -19
  117. package/build/components/post-list/index.js.map +1 -1
  118. package/build/components/posts-app-routes/index.js +1 -0
  119. package/build/components/posts-app-routes/index.js.map +1 -1
  120. package/build/components/resizable-frame/index.js +9 -1
  121. package/build/components/resizable-frame/index.js.map +1 -1
  122. package/build/components/save-button/index.js +1 -0
  123. package/build/components/save-button/index.js.map +1 -1
  124. package/build/components/save-hub/index.js +1 -0
  125. package/build/components/save-hub/index.js.map +1 -1
  126. package/build/components/save-keyboard-shortcut/index.js +1 -0
  127. package/build/components/save-keyboard-shortcut/index.js.map +1 -1
  128. package/build/components/save-panel/index.js +1 -0
  129. package/build/components/save-panel/index.js.map +1 -1
  130. package/build/components/sidebar/index.js +1 -0
  131. package/build/components/sidebar/index.js.map +1 -1
  132. package/build/components/sidebar-dataviews/custom-dataviews-list.js +1 -0
  133. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  134. package/build/components/sidebar-dataviews/dataview-item.js +1 -0
  135. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  136. package/build/components/sidebar-dataviews/default-views.js +7 -24
  137. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  138. package/build/components/sidebar-dataviews/index.js +2 -0
  139. package/build/components/sidebar-dataviews/index.js.map +1 -1
  140. package/build/components/sidebar-global-styles-wrapper/index.js +1 -0
  141. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  142. package/build/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  143. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  144. package/build/components/sidebar-navigation-screen-main/index.js +37 -23
  145. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  146. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -0
  147. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  148. package/build/components/sidebar-navigation-screen-patterns/index.js +1 -4
  149. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  150. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -0
  151. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  152. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -0
  153. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  154. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -0
  155. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  156. package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -0
  157. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  158. package/build/components/site-editor-routes/home.js +4 -2
  159. package/build/components/site-editor-routes/home.js.map +1 -1
  160. package/build/components/site-editor-routes/index.js +3 -1
  161. package/build/components/site-editor-routes/index.js.map +1 -1
  162. package/build/components/site-editor-routes/stylebook.js +33 -0
  163. package/build/components/site-editor-routes/stylebook.js.map +1 -0
  164. package/build/components/site-editor-routes/template-item.js +3 -3
  165. package/build/components/site-editor-routes/template-item.js.map +1 -1
  166. package/build/components/site-editor-routes/template-part-item.js +3 -3
  167. package/build/components/site-editor-routes/template-part-item.js.map +1 -1
  168. package/build/components/style-book/categories.js +1 -0
  169. package/build/components/style-book/categories.js.map +1 -1
  170. package/build/components/style-book/color-examples.js +9 -3
  171. package/build/components/style-book/color-examples.js.map +1 -1
  172. package/build/components/style-book/constants.js +0 -1
  173. package/build/components/style-book/constants.js.map +1 -1
  174. package/build/components/style-book/duotone-examples.js +1 -0
  175. package/build/components/style-book/duotone-examples.js.map +1 -1
  176. package/build/components/style-book/examples.js +48 -30
  177. package/build/components/style-book/examples.js.map +1 -1
  178. package/build/components/style-book/index.js +103 -24
  179. package/build/components/style-book/index.js.map +1 -1
  180. package/build/components/style-book/types.js.map +1 -1
  181. package/build/index.js +1 -0
  182. package/build/index.js.map +1 -1
  183. package/build/posts.js +1 -0
  184. package/build/posts.js.map +1 -1
  185. package/build/store/reducer.js +1 -0
  186. package/build/store/reducer.js.map +1 -1
  187. package/build/utils/get-filtered-template-parts.js +1 -0
  188. package/build/utils/get-filtered-template-parts.js.map +1 -1
  189. package/build/utils/set-nested-value.js +1 -0
  190. package/build/utils/set-nested-value.js.map +1 -1
  191. package/build-module/components/add-new-pattern/index.js +1 -0
  192. package/build-module/components/add-new-pattern/index.js.map +1 -1
  193. package/build-module/components/add-new-post/index.js +1 -1
  194. package/build-module/components/add-new-post/index.js.map +1 -1
  195. package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -0
  196. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  197. package/build-module/components/add-new-template/index.js +1 -0
  198. package/build-module/components/add-new-template/index.js.map +1 -1
  199. package/build-module/components/add-new-template/utils.js +1 -0
  200. package/build-module/components/add-new-template/utils.js.map +1 -1
  201. package/build-module/components/editor-canvas-container/index.js +1 -0
  202. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  203. package/build-module/components/global-styles/font-families.js +1 -0
  204. package/build-module/components/global-styles/font-families.js.map +1 -1
  205. package/build-module/components/global-styles/font-library-modal/context.js +1 -0
  206. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  207. package/build-module/components/global-styles/font-library-modal/font-collection.js +1 -0
  208. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  209. package/build-module/components/global-styles/font-library-modal/font-demo.js +1 -0
  210. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  211. package/build-module/components/global-styles/font-library-modal/index.js +1 -0
  212. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  213. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  214. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  215. package/build-module/components/global-styles/font-library-modal/library-font-details.js +1 -0
  216. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  217. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +1 -0
  218. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  219. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +1 -0
  220. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  221. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +1 -0
  222. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  223. package/build-module/components/global-styles/font-library-modal/utils/index.js +1 -0
  224. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  225. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +1 -0
  226. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  227. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +1 -0
  228. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  229. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +1 -0
  230. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  231. package/build-module/components/global-styles/font-sizes/font-size.js +1 -0
  232. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
  233. package/build-module/components/global-styles/font-sizes/font-sizes.js +1 -0
  234. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  235. package/build-module/components/global-styles/highlighted-colors.js +1 -0
  236. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  237. package/build-module/components/global-styles/hooks.js +1 -0
  238. package/build-module/components/global-styles/hooks.js.map +1 -1
  239. package/build-module/components/global-styles/palette.js +1 -0
  240. package/build-module/components/global-styles/palette.js.map +1 -1
  241. package/build-module/components/global-styles/preset-colors.js +1 -0
  242. package/build-module/components/global-styles/preset-colors.js.map +1 -1
  243. package/build-module/components/global-styles/preview-colors.js +2 -2
  244. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  245. package/build-module/components/global-styles/preview-styles.js +3 -2
  246. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  247. package/build-module/components/global-styles/preview-typography.js +2 -2
  248. package/build-module/components/global-styles/preview-typography.js.map +1 -1
  249. package/build-module/components/global-styles/{preview-iframe.js → preview-wrapper.js} +13 -31
  250. package/build-module/components/global-styles/preview-wrapper.js.map +1 -0
  251. package/build-module/components/global-styles/screen-block-list.js +1 -0
  252. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  253. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -0
  254. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  255. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  256. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  257. package/build-module/components/global-styles/shadow-utils.js +1 -0
  258. package/build-module/components/global-styles/shadow-utils.js.map +1 -1
  259. package/build-module/components/global-styles/shadows-edit-panel.js +16 -22
  260. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  261. package/build-module/components/global-styles/shadows-panel.js +1 -0
  262. package/build-module/components/global-styles/shadows-panel.js.map +1 -1
  263. package/build-module/components/global-styles/style-variations-container.js +1 -0
  264. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  265. package/build-module/components/global-styles/typeset.js +1 -0
  266. package/build-module/components/global-styles/typeset.js.map +1 -1
  267. package/build-module/components/global-styles/typography-example.js +8 -1
  268. package/build-module/components/global-styles/typography-example.js.map +1 -1
  269. package/build-module/components/global-styles/ui.js +1 -0
  270. package/build-module/components/global-styles/ui.js.map +1 -1
  271. package/build-module/components/global-styles/utils.js +1 -0
  272. package/build-module/components/global-styles/utils.js.map +1 -1
  273. package/build-module/components/global-styles/variations/variations-color.js +1 -0
  274. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  275. package/build-module/components/global-styles/variations/variations-panel.js +1 -0
  276. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  277. package/build-module/components/global-styles/variations/variations-typography.js +1 -0
  278. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  279. package/build-module/components/global-styles-renderer/index.js +1 -0
  280. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  281. package/build-module/components/layout/index.js +14 -7
  282. package/build-module/components/layout/index.js.map +1 -1
  283. package/build-module/components/maybe-editor/index.js +59 -0
  284. package/build-module/components/maybe-editor/index.js.map +1 -0
  285. package/build-module/components/media/index.js +1 -0
  286. package/build-module/components/media/index.js.map +1 -1
  287. package/build-module/components/page-patterns/fields.js +3 -48
  288. package/build-module/components/page-patterns/fields.js.map +1 -1
  289. package/build-module/components/page-patterns/header.js +1 -0
  290. package/build-module/components/page-patterns/header.js.map +1 -1
  291. package/build-module/components/page-patterns/index.js +16 -12
  292. package/build-module/components/page-patterns/index.js.map +1 -1
  293. package/build-module/components/page-patterns/search-items.js +1 -0
  294. package/build-module/components/page-patterns/search-items.js.map +1 -1
  295. package/build-module/components/page-patterns/use-pattern-settings.js +1 -0
  296. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  297. package/build-module/components/page-patterns/use-patterns.js +1 -0
  298. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  299. package/build-module/components/page-templates/fields.js +1 -20
  300. package/build-module/components/page-templates/fields.js.map +1 -1
  301. package/build-module/components/page-templates/index.js +37 -40
  302. package/build-module/components/page-templates/index.js.map +1 -1
  303. package/build-module/components/post-edit/index.js +16 -8
  304. package/build-module/components/post-edit/index.js.map +1 -1
  305. package/build-module/components/post-list/index.js +31 -20
  306. package/build-module/components/post-list/index.js.map +1 -1
  307. package/build-module/components/posts-app-routes/index.js +1 -0
  308. package/build-module/components/posts-app-routes/index.js.map +1 -1
  309. package/build-module/components/resizable-frame/index.js +9 -1
  310. package/build-module/components/resizable-frame/index.js.map +1 -1
  311. package/build-module/components/save-button/index.js +1 -0
  312. package/build-module/components/save-button/index.js.map +1 -1
  313. package/build-module/components/save-hub/index.js +1 -0
  314. package/build-module/components/save-hub/index.js.map +1 -1
  315. package/build-module/components/save-keyboard-shortcut/index.js +1 -0
  316. package/build-module/components/save-keyboard-shortcut/index.js.map +1 -1
  317. package/build-module/components/save-panel/index.js +1 -0
  318. package/build-module/components/save-panel/index.js.map +1 -1
  319. package/build-module/components/sidebar/index.js +1 -0
  320. package/build-module/components/sidebar/index.js.map +1 -1
  321. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +1 -0
  322. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  323. package/build-module/components/sidebar-dataviews/dataview-item.js +1 -0
  324. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  325. package/build-module/components/sidebar-dataviews/default-views.js +7 -24
  326. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  327. package/build-module/components/sidebar-dataviews/index.js +2 -0
  328. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  329. package/build-module/components/sidebar-global-styles-wrapper/index.js +1 -0
  330. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  331. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  332. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  333. package/build-module/components/sidebar-navigation-screen-main/index.js +39 -25
  334. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  335. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -0
  336. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  337. package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -4
  338. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  339. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -0
  340. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  341. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -0
  342. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  343. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -0
  344. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  345. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +2 -0
  346. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  347. package/build-module/components/site-editor-routes/home.js +4 -2
  348. package/build-module/components/site-editor-routes/home.js.map +1 -1
  349. package/build-module/components/site-editor-routes/index.js +3 -1
  350. package/build-module/components/site-editor-routes/index.js.map +1 -1
  351. package/build-module/components/site-editor-routes/stylebook.js +25 -0
  352. package/build-module/components/site-editor-routes/stylebook.js.map +1 -0
  353. package/build-module/components/site-editor-routes/template-item.js +3 -3
  354. package/build-module/components/site-editor-routes/template-item.js.map +1 -1
  355. package/build-module/components/site-editor-routes/template-part-item.js +3 -3
  356. package/build-module/components/site-editor-routes/template-part-item.js.map +1 -1
  357. package/build-module/components/style-book/categories.js +1 -0
  358. package/build-module/components/style-book/categories.js.map +1 -1
  359. package/build-module/components/style-book/color-examples.js +9 -3
  360. package/build-module/components/style-book/color-examples.js.map +1 -1
  361. package/build-module/components/style-book/constants.js +0 -1
  362. package/build-module/components/style-book/constants.js.map +1 -1
  363. package/build-module/components/style-book/duotone-examples.js +1 -0
  364. package/build-module/components/style-book/duotone-examples.js.map +1 -1
  365. package/build-module/components/style-book/examples.js +48 -30
  366. package/build-module/components/style-book/examples.js.map +1 -1
  367. package/build-module/components/style-book/index.js +102 -26
  368. package/build-module/components/style-book/index.js.map +1 -1
  369. package/build-module/components/style-book/types.js.map +1 -1
  370. package/build-module/index.js +1 -0
  371. package/build-module/index.js.map +1 -1
  372. package/build-module/posts.js +1 -0
  373. package/build-module/posts.js.map +1 -1
  374. package/build-module/store/reducer.js +1 -0
  375. package/build-module/store/reducer.js.map +1 -1
  376. package/build-module/utils/get-filtered-template-parts.js +1 -0
  377. package/build-module/utils/get-filtered-template-parts.js.map +1 -1
  378. package/build-module/utils/set-nested-value.js +1 -0
  379. package/build-module/utils/set-nested-value.js.map +1 -1
  380. package/build-style/posts-rtl.css +92 -117
  381. package/build-style/posts.css +92 -117
  382. package/build-style/style-rtl.css +205 -195
  383. package/build-style/style.css +205 -195
  384. package/package.json +40 -40
  385. package/src/components/add-new-post/index.js +1 -1
  386. package/src/components/global-styles/preview-colors.js +3 -3
  387. package/src/components/global-styles/preview-styles.js +3 -3
  388. package/src/components/global-styles/preview-typography.js +3 -3
  389. package/src/components/global-styles/{preview-iframe.js → preview-wrapper.js} +9 -35
  390. package/src/components/global-styles/shadows-edit-panel.js +20 -21
  391. package/src/components/global-styles/style.scss +32 -18
  392. package/src/components/global-styles/typography-example.js +12 -1
  393. package/src/components/layout/index.js +8 -6
  394. package/src/components/maybe-editor/index.js +58 -0
  395. package/src/components/page-patterns/fields.js +2 -59
  396. package/src/components/page-patterns/index.js +23 -11
  397. package/src/components/page-patterns/style.scss +0 -28
  398. package/src/components/page-templates/fields.js +1 -18
  399. package/src/components/page-templates/index.js +38 -55
  400. package/src/components/post-edit/index.js +22 -18
  401. package/src/components/post-list/index.js +49 -43
  402. package/src/components/post-list/style.scss +0 -36
  403. package/src/components/resizable-frame/index.js +10 -1
  404. package/src/components/sidebar-dataviews/default-views.js +7 -24
  405. package/src/components/sidebar-dataviews/index.js +1 -1
  406. package/src/components/sidebar-dataviews/style.scss +5 -0
  407. package/src/components/sidebar-navigation-screen/style.scss +0 -5
  408. package/src/components/sidebar-navigation-screen-global-styles/content.js +7 -35
  409. package/src/components/sidebar-navigation-screen-main/index.js +66 -37
  410. package/src/components/sidebar-navigation-screen-main/style.scss +4 -0
  411. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  412. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +5 -0
  413. package/src/components/sidebar-navigation-screen-patterns/index.js +0 -7
  414. package/src/components/sidebar-navigation-screen-patterns/style.scss +2 -0
  415. package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
  416. package/src/components/sidebar-navigation-screen-templates-browse/style.scss +4 -0
  417. package/src/components/site-editor-routes/home.js +2 -2
  418. package/src/components/site-editor-routes/index.js +2 -0
  419. package/src/components/site-editor-routes/stylebook.js +28 -0
  420. package/src/components/site-editor-routes/template-item.js +3 -3
  421. package/src/components/site-editor-routes/template-part-item.js +3 -3
  422. package/src/components/style-book/color-examples.tsx +21 -3
  423. package/src/components/style-book/constants.ts +0 -1
  424. package/src/components/style-book/examples.tsx +55 -31
  425. package/src/components/style-book/index.js +145 -38
  426. package/src/components/style-book/style.scss +4 -0
  427. package/src/components/style-book/types.ts +1 -1
  428. package/src/style.scss +4 -1
  429. package/build/components/error-boundary/index.js +0 -47
  430. package/build/components/error-boundary/index.js.map +0 -1
  431. package/build/components/error-boundary/warning.js +0 -42
  432. package/build/components/error-boundary/warning.js.map +0 -1
  433. package/build/components/global-styles/preview-iframe.js.map +0 -1
  434. package/build-module/components/error-boundary/index.js +0 -38
  435. package/build-module/components/error-boundary/index.js.map +0 -1
  436. package/build-module/components/error-boundary/warning.js +0 -35
  437. package/build-module/components/error-boundary/warning.js.map +0 -1
  438. package/build-module/components/global-styles/preview-iframe.js.map +0 -1
  439. package/src/components/error-boundary/index.js +0 -44
  440. package/src/components/error-boundary/test/error-boundary.js +0 -40
  441. package/src/components/error-boundary/warning.js +0 -30
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -11,13 +12,15 @@ var _coreData = require("@wordpress/core-data");
11
12
  var _dataviews = require("@wordpress/dataviews");
12
13
  var _router = require("@wordpress/router");
13
14
  var _editor = require("@wordpress/editor");
15
+ var _fields = require("@wordpress/fields");
14
16
  var _url = require("@wordpress/url");
15
17
  var _page = _interopRequireDefault(require("../page"));
16
18
  var _addNewTemplate = _interopRequireDefault(require("../add-new-template"));
17
19
  var _constants = require("../../utils/constants");
18
20
  var _lockUnlock = require("../../lock-unlock");
19
21
  var _dataviewsActions = require("../dataviews-actions");
20
- var _fields = require("./fields");
22
+ var _fields2 = require("./fields");
23
+ var _compose = require("@wordpress/compose");
21
24
  var _jsxRuntime = require("react/jsx-runtime");
22
25
  /**
23
26
  * WordPress dependencies
@@ -40,23 +43,9 @@ const {
40
43
  const EMPTY_ARRAY = [];
41
44
  const defaultLayouts = {
42
45
  [_constants.LAYOUT_TABLE]: {
43
- fields: ['template', 'author'],
46
+ showMedia: false,
44
47
  layout: {
45
- primaryField: 'title',
46
- combinedFields: [{
47
- id: 'template',
48
- label: (0, _i18n.__)('Template'),
49
- children: ['title', 'description'],
50
- direction: 'vertical'
51
- }],
52
48
  styles: {
53
- template: {
54
- maxWidth: 400,
55
- minWidth: 320
56
- },
57
- preview: {
58
- width: '1%'
59
- },
60
49
  author: {
61
50
  width: '1%'
62
51
  }
@@ -64,18 +53,10 @@ const defaultLayouts = {
64
53
  }
65
54
  },
66
55
  [_constants.LAYOUT_GRID]: {
67
- fields: ['title', 'description', 'author'],
68
- layout: {
69
- mediaField: 'preview',
70
- primaryField: 'title',
71
- columnFields: ['description']
72
- }
56
+ showMedia: true
73
57
  },
74
58
  [_constants.LAYOUT_LIST]: {
75
- fields: ['title', 'description', 'author'],
76
- layout: {
77
- primaryField: 'title'
78
- }
59
+ showMedia: false
79
60
  }
80
61
  };
81
62
  const DEFAULT_VIEW = {
@@ -87,9 +68,12 @@ const DEFAULT_VIEW = {
87
68
  field: 'title',
88
69
  direction: 'asc'
89
70
  },
90
- fields: defaultLayouts[_constants.LAYOUT_GRID].fields,
91
- layout: defaultLayouts[_constants.LAYOUT_GRID].layout,
92
- filters: []
71
+ titleField: 'title',
72
+ descriptionField: 'description',
73
+ mediaField: 'preview',
74
+ fields: ['author'],
75
+ filters: [],
76
+ ...defaultLayouts[_constants.LAYOUT_GRID]
93
77
  };
94
78
  function PageTemplates() {
95
79
  const {
@@ -107,28 +91,35 @@ function PageTemplates() {
107
91
  return {
108
92
  ...DEFAULT_VIEW,
109
93
  type: usedType,
110
- layout: defaultLayouts[usedType].layout,
111
- fields: defaultLayouts[usedType].fields,
112
94
  filters: activeView !== 'all' ? [{
113
95
  field: 'author',
114
96
  operator: 'isAny',
115
97
  value: [activeView]
116
- }] : []
98
+ }] : [],
99
+ ...defaultLayouts[usedType]
117
100
  };
118
101
  }, [layout, activeView]);
119
102
  const [view, setView] = (0, _element.useState)(defaultView);
103
+
104
+ // Sync the layout from the URL to the view state.
105
+ (0, _element.useEffect)(() => {
106
+ setView(currentView => ({
107
+ ...currentView,
108
+ type: layout !== null && layout !== void 0 ? layout : DEFAULT_VIEW.type
109
+ }));
110
+ }, [setView, layout]);
111
+
112
+ // Sync the active view from the URL to the view state.
120
113
  (0, _element.useEffect)(() => {
121
- const usedType = layout !== null && layout !== void 0 ? layout : DEFAULT_VIEW.type;
122
114
  setView(currentView => ({
123
115
  ...currentView,
124
- type: usedType,
125
116
  filters: activeView !== 'all' ? [{
126
117
  field: 'author',
127
118
  operator: _constants.OPERATOR_IS_ANY,
128
119
  value: [activeView]
129
120
  }] : []
130
121
  }));
131
- }, [activeView, layout]);
122
+ }, [setView, activeView]);
132
123
  const {
133
124
  records,
134
125
  isResolving: isLoadingData
@@ -157,8 +148,8 @@ function PageTemplates() {
157
148
  label: author
158
149
  }));
159
150
  }, [records]);
160
- const fields = (0, _element.useMemo)(() => [_fields.previewField, _fields.titleField, _fields.descriptionField, {
161
- ..._fields.authorField,
151
+ const fields = (0, _element.useMemo)(() => [_fields2.previewField, _fields.templateTitleField, _fields2.descriptionField, {
152
+ ..._fields2.authorField,
162
153
  elements: authors
163
154
  }], [authors]);
164
155
  const {
@@ -173,14 +164,14 @@ function PageTemplates() {
173
164
  });
174
165
  const editAction = (0, _dataviewsActions.useEditPostAction)();
175
166
  const actions = (0, _element.useMemo)(() => [editAction, ...postTypeActions], [postTypeActions, editAction]);
176
- const onChangeView = (0, _element.useCallback)(newView => {
177
- if (newView.type !== view.type) {
167
+ const onChangeView = (0, _compose.useEvent)(newView => {
168
+ setView(newView);
169
+ if (newView.type !== layout) {
178
170
  history.navigate((0, _url.addQueryArgs)(path, {
179
171
  layout: newView.type
180
172
  }));
181
173
  }
182
- setView(newView);
183
- }, [view.type, setView, history, path]);
174
+ });
184
175
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_page.default, {
185
176
  className: "edit-site-page-templates",
186
177
  title: (0, _i18n.__)('Templates'),
@@ -194,6 +185,12 @@ function PageTemplates() {
194
185
  view: view,
195
186
  onChangeView: onChangeView,
196
187
  onChangeSelection: onChangeSelection,
188
+ isItemClickable: () => true,
189
+ onClickItem: ({
190
+ id
191
+ }) => {
192
+ history.navigate(`/wp_template/${id}?canvas=edit`);
193
+ },
197
194
  selection: selection,
198
195
  defaultLayouts: defaultLayouts
199
196
  }, activeView)
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","_coreData","_dataviews","_router","_editor","_url","_page","_interopRequireDefault","_addNewTemplate","_constants","_lockUnlock","_dataviewsActions","_fields","_jsxRuntime","usePostActions","unlock","editorPrivateApis","useHistory","useLocation","routerPrivateApis","useEntityRecordsWithPermissions","corePrivateApis","EMPTY_ARRAY","defaultLayouts","LAYOUT_TABLE","fields","layout","primaryField","combinedFields","id","label","__","children","direction","styles","template","maxWidth","minWidth","preview","width","author","LAYOUT_GRID","mediaField","columnFields","LAYOUT_LIST","DEFAULT_VIEW","type","search","page","perPage","sort","field","filters","PageTemplates","path","query","activeView","postId","selection","setSelection","useState","defaultView","useMemo","usedType","operator","value","view","setView","useEffect","currentView","OPERATOR_IS_ANY","records","isResolving","isLoadingData","TEMPLATE_POST_TYPE","per_page","history","onChangeSelection","useCallback","items","navigate","addQueryArgs","length","undefined","authors","authorsSet","Set","forEach","add","author_text","Array","from","map","previewField","titleField","descriptionField","authorField","elements","data","paginationInfo","filterSortAndPaginate","postTypeActions","postType","context","editAction","useEditPostAction","actions","onChangeView","newView","jsx","default","className","title","DataViews","isLoading"],"sources":["@wordpress/edit-site/src/components/page-templates/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as corePrivateApis } from '@wordpress/core-data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport AddNewTemplate from '../add-new-template';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tOPERATOR_IS_ANY,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\nimport {\n\tauthorField,\n\tdescriptionField,\n\tpreviewField,\n\ttitleField,\n} from './fields';\n\nconst { usePostActions } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( corePrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nconst defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tfields: [ 'template', 'author' ],\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tcombinedFields: [\n\t\t\t\t{\n\t\t\t\t\tid: 'template',\n\t\t\t\t\tlabel: __( 'Template' ),\n\t\t\t\t\tchildren: [ 'title', 'description' ],\n\t\t\t\t\tdirection: 'vertical',\n\t\t\t\t},\n\t\t\t],\n\t\t\tstyles: {\n\t\t\t\ttemplate: {\n\t\t\t\t\tmaxWidth: 400,\n\t\t\t\t\tminWidth: 320,\n\t\t\t\t},\n\t\t\t\tpreview: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t\tauthor: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tfields: [ 'title', 'description', 'author' ],\n\t\tlayout: {\n\t\t\tmediaField: 'preview',\n\t\t\tprimaryField: 'title',\n\t\t\tcolumnFields: [ 'description' ],\n\t\t},\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tfields: [ 'title', 'description', 'author' ],\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t},\n\t},\n};\n\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_GRID,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'title',\n\t\tdirection: 'asc',\n\t},\n\tfields: defaultLayouts[ LAYOUT_GRID ].fields,\n\tlayout: defaultLayouts[ LAYOUT_GRID ].layout,\n\tfilters: [],\n};\n\nexport default function PageTemplates() {\n\tconst { path, query } = useLocation();\n\tconst { activeView = 'all', layout, postId } = query;\n\tconst [ selection, setSelection ] = useState( [ postId ] );\n\n\tconst defaultView = useMemo( () => {\n\t\tconst usedType = layout ?? DEFAULT_VIEW.type;\n\t\treturn {\n\t\t\t...DEFAULT_VIEW,\n\t\t\ttype: usedType,\n\t\t\tlayout: defaultLayouts[ usedType ].layout,\n\t\t\tfields: defaultLayouts[ usedType ].fields,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: 'isAny',\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t};\n\t}, [ layout, activeView ] );\n\tconst [ view, setView ] = useState( defaultView );\n\tuseEffect( () => {\n\t\tconst usedType = layout ?? DEFAULT_VIEW.type;\n\t\tsetView( ( currentView ) => ( {\n\t\t\t...currentView,\n\t\t\ttype: usedType,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t} ) );\n\t}, [ activeView, layout ] );\n\n\tconst { records, isResolving: isLoadingData } =\n\t\tuseEntityRecordsWithPermissions( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\tconst history = useHistory();\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( view?.type === LAYOUT_LIST ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tpostId: items.length === 1 ? items[ 0 ] : undefined,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ history, path, view?.type ]\n\t);\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! records ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\trecords.forEach( ( template ) => {\n\t\t\tauthorsSet.add( template.author_text );\n\t\t} );\n\t\treturn Array.from( authorsSet ).map( ( author ) => ( {\n\t\t\tvalue: author,\n\t\t\tlabel: author,\n\t\t} ) );\n\t}, [ records ] );\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\tpreviewField,\n\t\t\ttitleField,\n\t\t\tdescriptionField,\n\t\t\t{\n\t\t\t\t...authorField,\n\t\t\t\telements: authors,\n\t\t\t},\n\t\t],\n\t\t[ authors ]\n\t);\n\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\treturn filterSortAndPaginate( records, view, fields );\n\t}, [ records, view, fields ] );\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType: TEMPLATE_POST_TYPE,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst onChangeView = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type !== view.type ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tlayout: 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, history, path ]\n\t);\n\n\treturn (\n\t\t<Page\n\t\t\tclassName=\"edit-site-page-templates\"\n\t\t\ttitle={ __( 'Templates' ) }\n\t\t\tactions={ <AddNewTemplate /> }\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data }\n\t\t\t\tisLoading={ isLoadingData }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tselection={ selection }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;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V3BiC,UAWN;EAAC,CACG,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","_coreData","_dataviews","_router","_editor","_fields","_url","_page","_interopRequireDefault","_addNewTemplate","_constants","_lockUnlock","_dataviewsActions","_fields2","_compose","_jsxRuntime","usePostActions","unlock","editorPrivateApis","useHistory","useLocation","routerPrivateApis","useEntityRecordsWithPermissions","corePrivateApis","EMPTY_ARRAY","defaultLayouts","LAYOUT_TABLE","showMedia","layout","styles","author","width","LAYOUT_GRID","LAYOUT_LIST","DEFAULT_VIEW","type","search","page","perPage","sort","field","direction","titleField","descriptionField","mediaField","fields","filters","PageTemplates","path","query","activeView","postId","selection","setSelection","useState","defaultView","useMemo","usedType","operator","value","view","setView","useEffect","currentView","OPERATOR_IS_ANY","records","isResolving","isLoadingData","TEMPLATE_POST_TYPE","per_page","history","onChangeSelection","useCallback","items","navigate","addQueryArgs","length","undefined","authors","authorsSet","Set","forEach","template","add","author_text","Array","from","map","label","previewField","templateTitleField","authorField","elements","data","paginationInfo","filterSortAndPaginate","postTypeActions","postType","context","editAction","useEditPostAction","actions","onChangeView","useEvent","newView","jsx","default","className","title","__","children","DataViews","isLoading","isItemClickable","onClickItem","id"],"sources":["@wordpress/edit-site/src/components/page-templates/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as corePrivateApis } from '@wordpress/core-data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { templateTitleField } from '@wordpress/fields';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport AddNewTemplate from '../add-new-template';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tOPERATOR_IS_ANY,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\nimport { authorField, descriptionField, previewField } from './fields';\nimport { useEvent } from '@wordpress/compose';\n\nconst { usePostActions } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( corePrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nconst defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tshowMedia: false,\n\t\tlayout: {\n\t\t\tstyles: {\n\t\t\t\tauthor: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tshowMedia: true,\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tshowMedia: false,\n\t},\n};\n\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_GRID,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'title',\n\t\tdirection: 'asc',\n\t},\n\ttitleField: 'title',\n\tdescriptionField: 'description',\n\tmediaField: 'preview',\n\tfields: [ 'author' ],\n\tfilters: [],\n\t...defaultLayouts[ LAYOUT_GRID ],\n};\n\nexport default function PageTemplates() {\n\tconst { path, query } = useLocation();\n\tconst { activeView = 'all', layout, postId } = query;\n\tconst [ selection, setSelection ] = useState( [ postId ] );\n\n\tconst defaultView = useMemo( () => {\n\t\tconst usedType = layout ?? DEFAULT_VIEW.type;\n\t\treturn {\n\t\t\t...DEFAULT_VIEW,\n\t\t\ttype: usedType,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: 'isAny',\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t\t...defaultLayouts[ usedType ],\n\t\t};\n\t}, [ layout, activeView ] );\n\tconst [ view, setView ] = useState( defaultView );\n\n\t// Sync the layout from the URL to the view state.\n\tuseEffect( () => {\n\t\tsetView( ( currentView ) => ( {\n\t\t\t...currentView,\n\t\t\ttype: layout ?? DEFAULT_VIEW.type,\n\t\t} ) );\n\t}, [ setView, layout ] );\n\n\t// Sync the active view from the URL to the view state.\n\tuseEffect( () => {\n\t\tsetView( ( currentView ) => ( {\n\t\t\t...currentView,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t} ) );\n\t}, [ setView, activeView ] );\n\n\tconst { records, isResolving: isLoadingData } =\n\t\tuseEntityRecordsWithPermissions( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\tconst history = useHistory();\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( view?.type === LAYOUT_LIST ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tpostId: items.length === 1 ? items[ 0 ] : undefined,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ history, path, view?.type ]\n\t);\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! records ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\trecords.forEach( ( template ) => {\n\t\t\tauthorsSet.add( template.author_text );\n\t\t} );\n\t\treturn Array.from( authorsSet ).map( ( author ) => ( {\n\t\t\tvalue: author,\n\t\t\tlabel: author,\n\t\t} ) );\n\t}, [ records ] );\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\tpreviewField,\n\t\t\ttemplateTitleField,\n\t\t\tdescriptionField,\n\t\t\t{\n\t\t\t\t...authorField,\n\t\t\t\telements: authors,\n\t\t\t},\n\t\t],\n\t\t[ authors ]\n\t);\n\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\treturn filterSortAndPaginate( records, view, fields );\n\t}, [ records, view, fields ] );\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType: TEMPLATE_POST_TYPE,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst onChangeView = useEvent( ( newView ) => {\n\t\tsetView( newView );\n\t\tif ( newView.type !== layout ) {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\tlayout: newView.type,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn (\n\t\t<Page\n\t\t\tclassName=\"edit-site-page-templates\"\n\t\t\ttitle={ __( 'Templates' ) }\n\t\t\tactions={ <AddNewTemplate /> }\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data }\n\t\t\t\tisLoading={ isLoadingData }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tisItemClickable={ () => true }\n\t\t\t\tonClickItem={ ( { id } ) => {\n\t\t\t\t\thistory.navigate( `/wp_template/${ id }?canvas=edit` );\n\t\t\t\t} }\n\t\t\t\tselection={ selection }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,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BAAY,EAAE3B,IAAI,EAAE;QACnBpB,MAAM,EAAE4E,OAAO,CAACrE;MACjB,CAAE,CACH,CAAC;IACF;EACD,CAAE,CAAC;EAEH,oBACC,IAAApB,WAAA,CAAA0F,GAAA,EAAClG,KAAA,CAAAmG,OAAI;IACJC,SAAS,EAAC,0BAA0B;IACpCC,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IAC3BR,OAAO,eAAG,IAAAtF,WAAA,CAAA0F,GAAA,EAAChG,eAAA,CAAAiG,OAAc,IAAE,CAAG;IAAAI,QAAA,eAE9B,IAAA/F,WAAA,CAAA0F,GAAA,EAACvG,UAAA,CAAA6G,SAAS;MAETjB,cAAc,EAAGA,cAAgB;MACjCjD,MAAM,EAAGA,MAAQ;MACjBwD,OAAO,EAAGA,OAAS;MACnBR,IAAI,EAAGA,IAAM;MACbmB,SAAS,EAAG7C,aAAe;MAC3BP,IAAI,EAAGA,IAAM;MACb0C,YAAY,EAAGA,YAAc;MAC7B/B,iBAAiB,EAAGA,iBAAmB;MACvC0C,eAAe,EAAGA,CAAA,KAAM,IAAM;MAC9BC,WAAW,EAAGA,CAAE;QAAEC;MAAG,CAAC,KAAM;QAC3B7C,OAAO,CAACI,QAAQ,CAAE,gBAAiByC,EAAE,cAAgB,CAAC;MACvD,CAAG;MACH/D,SAAS,EAAGA,SAAW;MACvB3B,cAAc,EAAGA;IAAgB,GAd3ByB,UAeN;EAAC,CACG,CAAC;AAET","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -31,8 +32,8 @@ var _jsxRuntime = require("react/jsx-runtime");
31
32
  */
32
33
 
33
34
  const {
34
- PostCardPanel,
35
- usePostFields
35
+ usePostFields,
36
+ PostCardPanel
36
37
  } = (0, _lockUnlock.unlock)(_editor.privateApis);
37
38
  const fieldsWithBulkEditSupport = ['title', 'status', 'date', 'author', 'comment_status'];
38
39
  function PostEditForm({
@@ -41,10 +42,17 @@ function PostEditForm({
41
42
  }) {
42
43
  const ids = (0, _element.useMemo)(() => postId.split(','), [postId]);
43
44
  const {
44
- record
45
+ record,
46
+ hasFinishedResolution
45
47
  } = (0, _data.useSelect)(select => {
48
+ const args = ['postType', postType, ids[0]];
49
+ const {
50
+ getEditedEntityRecord,
51
+ hasFinishedResolution: hasFinished
52
+ } = select(_coreData.store);
46
53
  return {
47
- record: ids.length === 1 ? select(_coreData.store).getEditedEntityRecord('postType', postType, ids[0]) : null
54
+ record: ids.length === 1 ? getEditedEntityRecord(...args) : null,
55
+ hasFinishedResolution: hasFinished('getEditedEntityRecord', args)
48
56
  };
49
57
  }, [postType, ids]);
50
58
  const [multiEdits, setMultiEdits] = (0, _element.useState)({});
@@ -70,7 +78,7 @@ function PostEditForm({
70
78
  fields: [{
71
79
  id: 'featured_media',
72
80
  layout: 'regular'
73
- }, 'title', {
81
+ }, {
74
82
  id: 'status',
75
83
  label: (0, _i18n.__)('Status & Visibility'),
76
84
  children: ['status', 'password']
@@ -129,10 +137,10 @@ function PostEditForm({
129
137
  }, [fields, settings]);
130
138
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
131
139
  spacing: 4,
132
- children: [ids.length === 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(PostCardPanel, {
140
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PostCardPanel, {
133
141
  postType: postType,
134
- postId: ids[0]
135
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataviews.DataForm, {
142
+ postId: ids
143
+ }), hasFinishedResolution && /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataviews.DataForm, {
136
144
  data: ids.length === 1 ? record : multiEdits,
137
145
  fields: fieldsWithDependency,
138
146
  form: form,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_dataviews","_data","_coreData","_components","_element","_editor","_page","_lockUnlock","_usePatternSettings","_blockEditor","_jsxRuntime","PostCardPanel","usePostFields","unlock","editorPrivateApis","fieldsWithBulkEditSupport","PostEditForm","postType","postId","ids","useMemo","split","record","useSelect","select","length","coreDataStore","getEditedEntityRecord","multiEdits","setMultiEdits","useState","editEntityRecord","useDispatch","fields","_fields","map","field","id","elements","filter","element","value","form","type","layout","label","__","children","labelPosition","includes","onChange","edits","status","Date","date","password","prev","useEffect","ExperimentalBlockEditorProvider","blockEditorPrivateApis","settings","usePatternSettings","fieldsWithDependency","Edit","data","jsx","jsxs","__experimentalVStack","spacing","DataForm","PostEdit","default","className","clsx"],"sources":["@wordpress/edit-site/src/components/post-edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { DataForm } from '@wordpress/dataviews';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\nimport usePatternSettings from '../page-patterns/use-pattern-settings';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\nconst { PostCardPanel, usePostFields } = unlock( editorPrivateApis );\n\nconst fieldsWithBulkEditSupport = [\n\t'title',\n\t'status',\n\t'date',\n\t'author',\n\t'comment_status',\n];\n\nfunction PostEditForm( { postType, postId } ) {\n\tconst ids = useMemo( () => postId.split( ',' ), [ postId ] );\n\tconst { record } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\trecord:\n\t\t\t\t\tids.length === 1\n\t\t\t\t\t\t? select( coreDataStore ).getEditedEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\t\tids[ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ postType, ids ]\n\t);\n\tconst [ multiEdits, setMultiEdits ] = useState( {} );\n\tconst { editEntityRecord } = useDispatch( coreDataStore );\n\tconst { fields: _fields } = usePostFields( { postType } );\n\tconst fields = useMemo(\n\t\t() =>\n\t\t\t_fields?.map( ( field ) => {\n\t\t\t\tif ( field.id === 'status' ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...field,\n\t\t\t\t\t\telements: field.elements.filter(\n\t\t\t\t\t\t\t( element ) => element.value !== 'trash'\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn field;\n\t\t\t} ),\n\t\t[ _fields ]\n\t);\n\n\tconst form = useMemo(\n\t\t() => ( {\n\t\t\ttype: 'panel',\n\t\t\tfields: [\n\t\t\t\t{\n\t\t\t\t\tid: 'featured_media',\n\t\t\t\t\tlayout: 'regular',\n\t\t\t\t},\n\t\t\t\t'title',\n\t\t\t\t{\n\t\t\t\t\tid: 'status',\n\t\t\t\t\tlabel: __( 'Status & Visibility' ),\n\t\t\t\t\tchildren: [ 'status', 'password' ],\n\t\t\t\t},\n\t\t\t\t'author',\n\t\t\t\t'date',\n\t\t\t\t'slug',\n\t\t\t\t'parent',\n\t\t\t\t'comment_status',\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Template' ),\n\t\t\t\t\tlabelPosition: 'side',\n\t\t\t\t\tid: 'template',\n\t\t\t\t\tlayout: 'regular',\n\t\t\t\t},\n\t\t\t].filter(\n\t\t\t\t( field ) =>\n\t\t\t\t\tids.length === 1 ||\n\t\t\t\t\tfieldsWithBulkEditSupport.includes( field )\n\t\t\t),\n\t\t} ),\n\t\t[ ids ]\n\t);\n\tconst onChange = ( edits ) => {\n\t\tfor ( const id of ids ) {\n\t\t\tif (\n\t\t\t\tedits.status &&\n\t\t\t\tedits.status !== 'future' &&\n\t\t\t\trecord?.status === 'future' &&\n\t\t\t\tnew Date( record.date ) > new Date()\n\t\t\t) {\n\t\t\t\tedits.date = null;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tedits.status &&\n\t\t\t\tedits.status === 'private' &&\n\t\t\t\trecord.password\n\t\t\t) {\n\t\t\t\tedits.password = '';\n\t\t\t}\n\t\t\teditEntityRecord( 'postType', postType, id, edits );\n\t\t\tif ( ids.length > 1 ) {\n\t\t\t\tsetMultiEdits( ( prev ) => ( {\n\t\t\t\t\t...prev,\n\t\t\t\t\t...edits,\n\t\t\t\t} ) );\n\t\t\t}\n\t\t}\n\t};\n\tuseEffect( () => {\n\t\tsetMultiEdits( {} );\n\t}, [ ids ] );\n\n\tconst { ExperimentalBlockEditorProvider } = unlock(\n\t\tblockEditorPrivateApis\n\t);\n\tconst settings = usePatternSettings();\n\n\t/**\n\t * The template field depends on the block editor settings.\n\t * This is a workaround to ensure that the block editor settings are available.\n\t * For more information, see: https://github.com/WordPress/gutenberg/issues/67521\n\t */\n\tconst fieldsWithDependency = useMemo( () => {\n\t\treturn fields.map( ( field ) => {\n\t\t\tif ( field.id === 'template' ) {\n\t\t\t\treturn {\n\t\t\t\t\t...field,\n\t\t\t\t\tEdit: ( data ) => (\n\t\t\t\t\t\t<ExperimentalBlockEditorProvider settings={ settings }>\n\t\t\t\t\t\t\t<field.Edit { ...data } />\n\t\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn field;\n\t\t} );\n\t}, [ fields, settings ] );\n\n\treturn (\n\t\t<VStack spacing={ 4 }>\n\t\t\t{ ids.length === 1 && (\n\t\t\t\t<PostCardPanel postType={ postType } postId={ ids[ 0 ] } />\n\t\t\t) }\n\t\t\t<DataForm\n\t\t\t\tdata={ ids.length === 1 ? record : multiEdits }\n\t\t\t\tfields={ fieldsWithDependency }\n\t\t\t\tform={ form }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n\nexport function PostEdit( { postType, postId } ) {\n\treturn (\n\t\t<Page\n\t\t\tclassName={ clsx( 'edit-site-post-edit', {\n\t\t\t\t'is-empty': ! postId,\n\t\t\t} ) }\n\t\t\tlabel={ __( 'Post Edit' ) }\n\t\t>\n\t\t\t{ postId && (\n\t\t\t\t<PostEditForm postType={ postType } postId={ postId } />\n\t\t\t) }\n\t\t\t{ ! postId && <p>{ __( 'Select a page to edit' ) }</p> }\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,KAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AAAgF,IAAAY,WAAA,GAAAZ,OAAA;AAtBhF;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAMA,MAAM;EAAEa,aAAa;EAAEC;AAAc,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpE,MAAMC,yBAAyB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,gBAAgB,CAChB;AAED,SAASC,YAAYA,CAAE;EAAEC,QAAQ;EAAEC;AAAO,CAAC,EAAG;EAC7C,MAAMC,GAAG,GAAG,IAAAC,gBAAO,EAAE,MAAMF,MAAM,CAACG,KAAK,CAAE,GAAI,CAAC,EAAE,CAAEH,MAAM,CAAG,CAAC;EAC5D,MAAM;IAAEI;EAAO,CAAC,GAAG,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D,KAAA,CAAAiE,OAAI;IACJC,SAAS,EAAG,IAAAC,aAAI,EAAE,qBAAqB,EAAE;MACxC,UAAU,EAAE,CAAEvD;IACf,CAAE,CAAG;IACL2B,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IAAAC,QAAA,GAEzB7B,MAAM,iBACP,IAAAR,WAAA,CAAAuD,GAAA,EAACjD,YAAY;MAACC,QAAQ,EAAGA,QAAU;MAACC,MAAM,EAAGA;IAAQ,CAAE,CACvD,EACC,CAAEA,MAAM,iBAAI,IAAAR,WAAA,CAAAuD,GAAA;MAAAlB,QAAA,EAAK,IAAAD,QAAE,EAAE,uBAAwB;IAAC,CAAK,CAAC;EAAA,CACjD,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_dataviews","_data","_coreData","_components","_element","_editor","_page","_lockUnlock","_usePatternSettings","_blockEditor","_jsxRuntime","usePostFields","PostCardPanel","unlock","editorPrivateApis","fieldsWithBulkEditSupport","PostEditForm","postType","postId","ids","useMemo","split","record","hasFinishedResolution","useSelect","select","args","getEditedEntityRecord","hasFinished","coreDataStore","length","multiEdits","setMultiEdits","useState","editEntityRecord","useDispatch","fields","_fields","map","field","id","elements","filter","element","value","form","type","layout","label","__","children","labelPosition","includes","onChange","edits","status","Date","date","password","prev","useEffect","ExperimentalBlockEditorProvider","blockEditorPrivateApis","settings","usePatternSettings","fieldsWithDependency","Edit","data","jsx","jsxs","__experimentalVStack","spacing","DataForm","PostEdit","default","className","clsx"],"sources":["@wordpress/edit-site/src/components/post-edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { DataForm } from '@wordpress/dataviews';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\nimport usePatternSettings from '../page-patterns/use-pattern-settings';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\nconst { usePostFields, PostCardPanel } = unlock( editorPrivateApis );\n\nconst fieldsWithBulkEditSupport = [\n\t'title',\n\t'status',\n\t'date',\n\t'author',\n\t'comment_status',\n];\n\nfunction PostEditForm( { postType, postId } ) {\n\tconst ids = useMemo( () => postId.split( ',' ), [ postId ] );\n\tconst { record, hasFinishedResolution } = useSelect(\n\t\t( select ) => {\n\t\t\tconst args = [ 'postType', postType, ids[ 0 ] ];\n\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\thasFinishedResolution: hasFinished,\n\t\t\t} = select( coreDataStore );\n\n\t\t\treturn {\n\t\t\t\trecord:\n\t\t\t\t\tids.length === 1 ? getEditedEntityRecord( ...args ) : null,\n\t\t\t\thasFinishedResolution: hasFinished(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\targs\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postType, ids ]\n\t);\n\tconst [ multiEdits, setMultiEdits ] = useState( {} );\n\tconst { editEntityRecord } = useDispatch( coreDataStore );\n\tconst { fields: _fields } = usePostFields( { postType } );\n\tconst fields = useMemo(\n\t\t() =>\n\t\t\t_fields?.map( ( field ) => {\n\t\t\t\tif ( field.id === 'status' ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...field,\n\t\t\t\t\t\telements: field.elements.filter(\n\t\t\t\t\t\t\t( element ) => element.value !== 'trash'\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn field;\n\t\t\t} ),\n\t\t[ _fields ]\n\t);\n\n\tconst form = useMemo(\n\t\t() => ( {\n\t\t\ttype: 'panel',\n\t\t\tfields: [\n\t\t\t\t{\n\t\t\t\t\tid: 'featured_media',\n\t\t\t\t\tlayout: 'regular',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: 'status',\n\t\t\t\t\tlabel: __( 'Status & Visibility' ),\n\t\t\t\t\tchildren: [ 'status', 'password' ],\n\t\t\t\t},\n\t\t\t\t'author',\n\t\t\t\t'date',\n\t\t\t\t'slug',\n\t\t\t\t'parent',\n\t\t\t\t'comment_status',\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Template' ),\n\t\t\t\t\tlabelPosition: 'side',\n\t\t\t\t\tid: 'template',\n\t\t\t\t\tlayout: 'regular',\n\t\t\t\t},\n\t\t\t].filter(\n\t\t\t\t( field ) =>\n\t\t\t\t\tids.length === 1 ||\n\t\t\t\t\tfieldsWithBulkEditSupport.includes( field )\n\t\t\t),\n\t\t} ),\n\t\t[ ids ]\n\t);\n\tconst onChange = ( edits ) => {\n\t\tfor ( const id of ids ) {\n\t\t\tif (\n\t\t\t\tedits.status &&\n\t\t\t\tedits.status !== 'future' &&\n\t\t\t\trecord?.status === 'future' &&\n\t\t\t\tnew Date( record.date ) > new Date()\n\t\t\t) {\n\t\t\t\tedits.date = null;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tedits.status &&\n\t\t\t\tedits.status === 'private' &&\n\t\t\t\trecord.password\n\t\t\t) {\n\t\t\t\tedits.password = '';\n\t\t\t}\n\t\t\teditEntityRecord( 'postType', postType, id, edits );\n\t\t\tif ( ids.length > 1 ) {\n\t\t\t\tsetMultiEdits( ( prev ) => ( {\n\t\t\t\t\t...prev,\n\t\t\t\t\t...edits,\n\t\t\t\t} ) );\n\t\t\t}\n\t\t}\n\t};\n\tuseEffect( () => {\n\t\tsetMultiEdits( {} );\n\t}, [ ids ] );\n\n\tconst { ExperimentalBlockEditorProvider } = unlock(\n\t\tblockEditorPrivateApis\n\t);\n\tconst settings = usePatternSettings();\n\n\t/**\n\t * The template field depends on the block editor settings.\n\t * This is a workaround to ensure that the block editor settings are available.\n\t * For more information, see: https://github.com/WordPress/gutenberg/issues/67521\n\t */\n\tconst fieldsWithDependency = useMemo( () => {\n\t\treturn fields.map( ( field ) => {\n\t\t\tif ( field.id === 'template' ) {\n\t\t\t\treturn {\n\t\t\t\t\t...field,\n\t\t\t\t\tEdit: ( data ) => (\n\t\t\t\t\t\t<ExperimentalBlockEditorProvider settings={ settings }>\n\t\t\t\t\t\t\t<field.Edit { ...data } />\n\t\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn field;\n\t\t} );\n\t}, [ fields, settings ] );\n\n\treturn (\n\t\t<VStack spacing={ 4 }>\n\t\t\t<PostCardPanel postType={ postType } postId={ ids } />\n\t\t\t{ hasFinishedResolution && (\n\t\t\t\t<DataForm\n\t\t\t\t\tdata={ ids.length === 1 ? record : multiEdits }\n\t\t\t\t\tfields={ fieldsWithDependency }\n\t\t\t\t\tform={ form }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport function PostEdit( { postType, postId } ) {\n\treturn (\n\t\t<Page\n\t\t\tclassName={ clsx( 'edit-site-post-edit', {\n\t\t\t\t'is-empty': ! postId,\n\t\t\t} ) }\n\t\t\tlabel={ __( 'Post Edit' ) }\n\t\t>\n\t\t\t{ postId && (\n\t\t\t\t<PostEditForm postType={ postType } postId={ postId } />\n\t\t\t) }\n\t\t\t{ ! postId && <p>{ __( 'Select a page to edit' ) }</p> }\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAA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AAC;EAAA,CACjD,CAAC;AAET","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -58,7 +59,7 @@ const getCustomView = editedEntityRecord => {
58
59
  }
59
60
  return {
60
61
  ...content,
61
- layout: _defaultViews.defaultLayouts[content.type]?.layout
62
+ ..._defaultViews.defaultLayouts[content.type]
62
63
  };
63
64
  };
64
65
 
@@ -116,34 +117,41 @@ function useView(postType) {
116
117
  type
117
118
  };
118
119
  });
119
- const setViewWithUrlUpdate = (0, _element.useCallback)(newView => {
120
- if (newView.type === _constants.LAYOUT_LIST && !layout) {
121
- // Skip updating the layout URL param if
122
- // it is not present and the newView.type is LAYOUT_LIST.
123
- } else if (newView.type !== layout) {
124
- history.navigate((0, _url.addQueryArgs)(path, {
125
- layout: newView.type
126
- }));
127
- }
120
+ const setViewWithUrlUpdate = (0, _compose.useEvent)(newView => {
128
121
  setView(newView);
129
122
  if (isCustom === 'true' && editedEntityRecord?.id) {
130
123
  editEntityRecord('postType', 'wp_dataviews', editedEntityRecord?.id, {
131
124
  content: JSON.stringify(newView)
132
125
  });
133
126
  }
134
- }, [history, isCustom, editEntityRecord, editedEntityRecord?.id, layout, path]);
127
+ const currentUrlLayout = layout !== null && layout !== void 0 ? layout : _constants.LAYOUT_LIST;
128
+ if (newView.type !== currentUrlLayout) {
129
+ history.navigate((0, _url.addQueryArgs)(path, {
130
+ layout: newView.type
131
+ }));
132
+ }
133
+ });
135
134
 
136
135
  // When layout URL param changes, update the view type
137
136
  // without affecting any other config.
137
+ const onUrlLayoutChange = (0, _compose.useEvent)(() => {
138
+ setView(prevView => {
139
+ const layoutToApply = layout !== null && layout !== void 0 ? layout : _constants.LAYOUT_LIST;
140
+ if (layoutToApply === prevView.type) {
141
+ return prevView;
142
+ }
143
+ return {
144
+ ...prevView,
145
+ type: layout !== null && layout !== void 0 ? layout : _constants.LAYOUT_LIST
146
+ };
147
+ });
148
+ });
138
149
  (0, _element.useEffect)(() => {
139
- setView(prevView => ({
140
- ...prevView,
141
- type: layout !== null && layout !== void 0 ? layout : _constants.LAYOUT_LIST
142
- }));
143
- }, [layout]);
150
+ onUrlLayoutChange();
151
+ }, [onUrlLayoutChange, layout]);
144
152
 
145
153
  // When activeView or isCustom URL parameters change, reset the view.
146
- (0, _element.useEffect)(() => {
154
+ const onUrlActiveViewChange = (0, _compose.useEvent)(() => {
147
155
  let newView;
148
156
  if (isCustom === 'true') {
149
157
  newView = getCustomView(editedEntityRecord);
@@ -157,8 +165,11 @@ function useView(postType) {
157
165
  type
158
166
  });
159
167
  }
160
- }, [activeView, isCustom, layout, defaultViews, editedEntityRecord]);
161
- return [view, setViewWithUrlUpdate, setViewWithUrlUpdate];
168
+ });
169
+ (0, _element.useEffect)(() => {
170
+ onUrlActiveViewChange();
171
+ }, [onUrlActiveViewChange, activeView, isCustom, defaultViews, editedEntityRecord]);
172
+ return [view, setViewWithUrlUpdate];
162
173
  }
163
174
  const DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.
164
175
 
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_coreData","_element","_router","_data","_dataviews","_editor","_i18n","_icons","_compose","_url","_page","_interopRequireDefault","_defaultViews","_constants","_addNewPost","_lockUnlock","_dataviewsActions","_jsxRuntime","usePostActions","usePostFields","unlock","editorPrivateApis","useLocation","useHistory","routerPrivateApis","useEntityRecordsWithPermissions","coreDataPrivateApis","EMPTY_ARRAY","getDefaultView","defaultViews","activeView","find","slug","view","getCustomView","editedEntityRecord","content","undefined","JSON","parse","layout","defaultLayouts","type","useView","postType","path","query","isCustom","history","useDefaultViews","editEntityRecord","useDispatch","coreStore","useSelect","select","getEditedEntityRecord","Number","setView","useState","initialView","_getCustomView","LAYOUT_LIST","_getDefaultView","setViewWithUrlUpdate","useCallback","newView","navigate","addQueryArgs","id","stringify","useEffect","prevView","DEFAULT_STATUSES","getItemId","item","toString","PostList","_postId$split","_data$map","_usePrevious","location","postId","quickEdit","selection","setSelection","split","onChangeSelection","items","_location$query$isCus","join","getActiveViewFilters","views","match","_found$filters","found","filters","isLoading","isLoadingFields","fields","_fields","useMemo","activeViewFilters","map","field","elements","includes","queryArgs","forEach","filter","operator","OPERATOR_IS_ANY","status","value","author","OPERATOR_IS_NONE","author_exclude","per_page","perPage","page","_embed","order","sort","direction","orderby","search","records","isResolving","isLoadingData","totalItems","totalPages","data","filterSortAndPaginate","ids","record","prevIds","usePrevious","deletedIds","postIdWasDeleted","paginationInfo","labels","canCreateRecord","getPostType","canUser","kind","name","postTypeActions","context","editAction","useEditPostAction","actions","showAddPostModal","setShowAddPostModal","openModal","closeModal","handleNewPage","jsx","default","title","add_new_item","jsxs","Fragment","children","Button","variant","onClick","__next40pxDefaultSize","onSave","onClose","DataViews","onChangeView","isItemClickable","onClickItem","header","window","__experimentalQuickEditDataViews","size","isPressed","icon","drawerRight","label","__"],"sources":["@wordpress/edit-site/src/components/post-list/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { drawerRight } from '@wordpress/icons';\nimport { usePrevious } from '@wordpress/compose';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport {\n\tuseDefaultViews,\n\tdefaultLayouts,\n} from '../sidebar-dataviews/default-views';\nimport {\n\tOPERATOR_IS_ANY,\n\tOPERATOR_IS_NONE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\n\nimport AddNewPostModal from '../add-new-post';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\n\nconst { usePostActions, usePostFields } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( coreDataPrivateApis );\nconst EMPTY_ARRAY = [];\n\nconst getDefaultView = ( defaultViews, activeView ) => {\n\treturn defaultViews.find( ( { slug } ) => slug === activeView )?.view;\n};\n\nconst getCustomView = ( editedEntityRecord ) => {\n\tif ( ! editedEntityRecord?.content ) {\n\t\treturn undefined;\n\t}\n\n\tconst content = JSON.parse( editedEntityRecord.content );\n\tif ( ! content ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\t...content,\n\t\tlayout: defaultLayouts[ content.type ]?.layout,\n\t};\n};\n\n/**\n * This function abstracts working with default & custom views by\n * providing a [ state, setState ] tuple based on the URL parameters.\n *\n * Consumers use the provided tuple to work with state\n * and don't have to deal with the specifics of default & custom views.\n *\n * @param {string} postType Post type to retrieve default views for.\n * @return {Array} The [ state, setState ] tuple.\n */\nfunction useView( postType ) {\n\tconst {\n\t\tpath,\n\t\tquery: { activeView = 'all', isCustom = 'false', layout },\n\t} = useLocation();\n\tconst history = useHistory();\n\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst editedEntityRecord = useSelect(\n\t\t( select ) => {\n\t\t\tif ( isCustom !== 'true' ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\treturn 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},\n\t\t[ activeView, isCustom ]\n\t);\n\tconst [ view, setView ] = useState( () => {\n\t\tlet initialView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tinitialView = getCustomView( editedEntityRecord ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t} else {\n\t\t\tinitialView = getDefaultView( defaultViews, activeView ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t}\n\n\t\tconst type = layout ?? initialView.type;\n\t\treturn {\n\t\t\t...initialView,\n\t\t\ttype,\n\t\t};\n\t} );\n\n\tconst setViewWithUrlUpdate = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type === LAYOUT_LIST && ! layout ) {\n\t\t\t\t// Skip updating the layout URL param if\n\t\t\t\t// it is not present and the newView.type is LAYOUT_LIST.\n\t\t\t} else if ( newView.type !== layout ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tlayout: newView.type,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tsetView( newView );\n\n\t\t\tif ( isCustom === 'true' && editedEntityRecord?.id ) {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\teditedEntityRecord?.id,\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: JSON.stringify( newView ),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thistory,\n\t\t\tisCustom,\n\t\t\teditEntityRecord,\n\t\t\teditedEntityRecord?.id,\n\t\t\tlayout,\n\t\t\tpath,\n\t\t]\n\t);\n\n\t// When layout URL param changes, update the view type\n\t// without affecting any other config.\n\tuseEffect( () => {\n\t\tsetView( ( prevView ) => ( {\n\t\t\t...prevView,\n\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t} ) );\n\t}, [ layout ] );\n\n\t// When activeView or isCustom URL parameters change, reset the view.\n\tuseEffect( () => {\n\t\tlet newView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tnewView = getCustomView( editedEntityRecord );\n\t\t} else {\n\t\t\tnewView = getDefaultView( defaultViews, activeView );\n\t\t}\n\n\t\tif ( newView ) {\n\t\t\tconst type = layout ?? newView.type;\n\t\t\tsetView( {\n\t\t\t\t...newView,\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\t}, [ activeView, isCustom, layout, defaultViews, editedEntityRecord ] );\n\n\treturn [ view, setViewWithUrlUpdate, setViewWithUrlUpdate ];\n}\n\nconst DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.\n\nfunction getItemId( item ) {\n\treturn item.id.toString();\n}\n\nexport default function PostList( { postType } ) {\n\tconst [ view, setView ] = useView( postType );\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst {\n\t\tpostId,\n\t\tquickEdit = false,\n\t\tisCustom,\n\t\tactiveView = 'all',\n\t} = location.query;\n\tconst [ selection, setSelection ] = useState( postId?.split( ',' ) ?? [] );\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( ( location.query.isCustom ?? 'false' ) === 'false' ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\t\tpostId: items.join( ',' ),\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ location.path, location.query.isCustom, history ]\n\t);\n\n\tconst getActiveViewFilters = ( views, match ) => {\n\t\tconst found = views.find( ( { slug } ) => slug === match );\n\t\treturn found?.filters ?? [];\n\t};\n\n\tconst { isLoading: isLoadingFields, fields: _fields } = usePostFields( {\n\t\tpostType,\n\t} );\n\tconst fields = useMemo( () => {\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t).map( ( { field } ) => field );\n\t\treturn _fields.map( ( field ) => ( {\n\t\t\t...field,\n\t\t\telements: activeViewFilters.includes( field.id )\n\t\t\t\t? []\n\t\t\t\t: field.elements,\n\t\t} ) );\n\t}, [ _fields, defaultViews, activeView ] );\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_IS_ANY\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_IS_ANY\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_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\n\t\t// The bundled views want data filtered without displaying the filter.\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t);\n\t\tactiveViewFilters.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\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_IS_ANY\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_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\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, activeView, defaultViews ] );\n\tconst {\n\t\trecords,\n\t\tisResolving: isLoadingData,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecordsWithPermissions( 'postType', postType, queryArgs );\n\n\t// The REST API sort the authors by ID, but we want to sort them by name.\n\tconst data = useMemo( () => {\n\t\tif ( ! isLoadingFields && view?.sort?.field === 'author' ) {\n\t\t\treturn filterSortAndPaginate(\n\t\t\t\trecords,\n\t\t\t\t{ sort: { ...view.sort } },\n\t\t\t\tfields\n\t\t\t).data;\n\t\t}\n\n\t\treturn records;\n\t}, [ records, fields, isLoadingFields, view?.sort ] );\n\n\tconst ids = data?.map( ( record ) => getItemId( record ) ) ?? [];\n\tconst prevIds = usePrevious( ids ) ?? [];\n\tconst deletedIds = prevIds.filter( ( id ) => ! ids.includes( id ) );\n\tconst postIdWasDeleted = deletedIds.includes( postId );\n\n\tuseEffect( () => {\n\t\tif ( postIdWasDeleted ) {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t}, [ history, postIdWasDeleted, location.path ] );\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 { labels, canCreateRecord } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType, canUser } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tlabels: getPostType( postType )?.labels,\n\t\t\t\tcanCreateRecord: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: postType,\n\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst [ showAddPostModal, setShowAddPostModal ] = useState( false );\n\n\tconst openModal = () => setShowAddPostModal( true );\n\tconst closeModal = () => setShowAddPostModal( false );\n\tconst handleNewPage = ( { type, id } ) => {\n\t\thistory.navigate( `/${ type }/${ id }?canvas=edit` );\n\t\tcloseModal();\n\t};\n\n\treturn (\n\t\t<Page\n\t\t\ttitle={ labels?.name }\n\t\t\tactions={\n\t\t\t\tlabels?.add_new_item &&\n\t\t\t\tcanCreateRecord && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tonClick={ openModal }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ labels.add_new_item }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ showAddPostModal && (\n\t\t\t\t\t\t\t<AddNewPostModal\n\t\t\t\t\t\t\t\tpostType={ postType }\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>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView + isCustom }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data || EMPTY_ARRAY }\n\t\t\t\tisLoading={ isLoadingData || isLoadingFields }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ setView }\n\t\t\t\tselection={ selection }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tisItemClickable={ ( item ) => item.status !== 'trash' }\n\t\t\t\tonClickItem={ ( { id } ) => {\n\t\t\t\t\thistory.navigate( `/${ postType }/${ id }?canvas=edit` );\n\t\t\t\t} }\n\t\t\t\tgetItemId={ getItemId }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\theader={\n\t\t\t\t\twindow.__experimentalQuickEditDataViews &&\n\t\t\t\t\tview.type !== LAYOUT_LIST &&\n\t\t\t\t\tpostType === 'page' && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tisPressed={ quickEdit }\n\t\t\t\t\t\t\ticon={ drawerRight }\n\t\t\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\t\t\t\t\t\tquickEdit: quickEdit ? undefined : true,\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} }\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</Page>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,IAAA,GAAAV,OAAA;AAKA,IAAAW,KAAA,GAAAC,sBAAA,CAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AAIA,IAAAc,UAAA,GAAAd,OAAA;AAMA,IAAAe,WAAA,GAAAH,sBAAA,CAAAZ,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AACA,IAAAiB,iBAAA,GAAAjB,OAAA;AAAyD,IAAAkB,WAAA,GAAAlB,OAAA;AAlCzD;AACA;AACA;;AAg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,IAAIvG,WAAa;MAC5BqE,SAAS,EAAG+B,aAAa,IAAI9B,eAAiB;MAC9ChE,IAAI,EAAGA,IAAM;MACbwI,YAAY,EAAGhH,OAAS;MACxB0B,SAAS,EAAGA,SAAW;MACvBG,iBAAiB,EAAGA,iBAAmB;MACvCoF,eAAe,EAAKhG,IAAI,IAAMA,IAAI,CAACqC,MAAM,KAAK,OAAS;MACvD4D,WAAW,EAAGA,CAAE;QAAEvG;MAAG,CAAC,KAAM;QAC3BpB,OAAO,CAACkB,QAAQ,CAAE,IAAKtB,QAAQ,IAAMwB,EAAE,cAAgB,CAAC;MACzD,CAAG;MACHK,SAAS,EAAGA,SAAW;MACvBhC,cAAc,EAAGA,4BAAgB;MACjCmI,MAAM,EACLC,MAAM,CAACC,gCAAgC,IACvC7I,IAAI,CAACS,IAAI,KAAKmB,sBAAW,IACzBjB,QAAQ,KAAK,MAAM,iBAClB,IAAA3B,WAAA,CAAA0I,GAAA,EAAC7J,WAAA,CAAAoK,MAAM;QACNa,IAAI,EAAC,SAAS;QACdC,SAAS,EAAG9F,SAAW;QACvB+F,IAAI,EAAGC,kBAAa;QACpBC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;QACzBhB,OAAO,EAAGA,CAAA,KAAM;UACfpH,OAAO,CAACkB,QAAQ,CACf,IAAAC,iBAAY,EAAEa,QAAQ,CAACnC,IAAI,EAAE;YAC5BqC,SAAS,EAAEA,SAAS,GAAG7C,SAAS,GAAG;UACpC,CAAE,CACH,CAAC;QACF;MAAG,CACH;IAEF,GAlCKP,UAAU,GAAGiB,QAmCnB;EAAC,CACG,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_coreData","_element","_router","_data","_dataviews","_editor","_i18n","_icons","_compose","_url","_page","_interopRequireDefault","_defaultViews","_constants","_addNewPost","_lockUnlock","_dataviewsActions","_jsxRuntime","usePostActions","usePostFields","unlock","editorPrivateApis","useLocation","useHistory","routerPrivateApis","useEntityRecordsWithPermissions","coreDataPrivateApis","EMPTY_ARRAY","getDefaultView","defaultViews","activeView","find","slug","view","getCustomView","editedEntityRecord","content","undefined","JSON","parse","defaultLayouts","type","useView","postType","path","query","isCustom","layout","history","useDefaultViews","editEntityRecord","useDispatch","coreStore","useSelect","select","getEditedEntityRecord","Number","setView","useState","initialView","_getCustomView","LAYOUT_LIST","_getDefaultView","setViewWithUrlUpdate","useEvent","newView","id","stringify","currentUrlLayout","navigate","addQueryArgs","onUrlLayoutChange","prevView","layoutToApply","useEffect","onUrlActiveViewChange","DEFAULT_STATUSES","getItemId","item","toString","PostList","_postId$split","_data$map","_usePrevious","location","postId","quickEdit","selection","setSelection","split","onChangeSelection","useCallback","items","_location$query$isCus","join","getActiveViewFilters","views","match","_found$filters","found","filters","isLoading","isLoadingFields","fields","_fields","useMemo","activeViewFilters","map","field","elements","includes","queryArgs","forEach","filter","operator","OPERATOR_IS_ANY","status","value","author","OPERATOR_IS_NONE","author_exclude","per_page","perPage","page","_embed","order","sort","direction","orderby","search","records","isResolving","isLoadingData","totalItems","totalPages","data","filterSortAndPaginate","ids","record","prevIds","usePrevious","deletedIds","postIdWasDeleted","paginationInfo","labels","canCreateRecord","getPostType","canUser","kind","name","postTypeActions","context","editAction","useEditPostAction","actions","showAddPostModal","setShowAddPostModal","openModal","closeModal","handleNewPage","jsx","default","title","add_new_item","jsxs","Fragment","children","Button","variant","onClick","__next40pxDefaultSize","onSave","onClose","DataViews","onChangeView","isItemClickable","onClickItem","header","window","__experimentalQuickEditDataViews","size","isPressed","icon","drawerRight","label","__"],"sources":["@wordpress/edit-site/src/components/post-list/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { drawerRight } from '@wordpress/icons';\nimport { useEvent, usePrevious } from '@wordpress/compose';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport {\n\tuseDefaultViews,\n\tdefaultLayouts,\n} from '../sidebar-dataviews/default-views';\nimport {\n\tOPERATOR_IS_ANY,\n\tOPERATOR_IS_NONE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\n\nimport AddNewPostModal from '../add-new-post';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\n\nconst { usePostActions, usePostFields } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( coreDataPrivateApis );\nconst EMPTY_ARRAY = [];\n\nconst getDefaultView = ( defaultViews, activeView ) => {\n\treturn defaultViews.find( ( { slug } ) => slug === activeView )?.view;\n};\n\nconst getCustomView = ( editedEntityRecord ) => {\n\tif ( ! editedEntityRecord?.content ) {\n\t\treturn undefined;\n\t}\n\n\tconst content = JSON.parse( editedEntityRecord.content );\n\tif ( ! content ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\t...content,\n\t\t...defaultLayouts[ content.type ],\n\t};\n};\n\n/**\n * This function abstracts working with default & custom views by\n * providing a [ state, setState ] tuple based on the URL parameters.\n *\n * Consumers use the provided tuple to work with state\n * and don't have to deal with the specifics of default & custom views.\n *\n * @param {string} postType Post type to retrieve default views for.\n * @return {Array} The [ state, setState ] tuple.\n */\nfunction useView( postType ) {\n\tconst {\n\t\tpath,\n\t\tquery: { activeView = 'all', isCustom = 'false', layout },\n\t} = useLocation();\n\tconst history = useHistory();\n\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst editedEntityRecord = useSelect(\n\t\t( select ) => {\n\t\t\tif ( isCustom !== 'true' ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\treturn 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},\n\t\t[ activeView, isCustom ]\n\t);\n\tconst [ view, setView ] = useState( () => {\n\t\tlet initialView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tinitialView = getCustomView( editedEntityRecord ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t} else {\n\t\t\tinitialView = getDefaultView( defaultViews, activeView ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t}\n\n\t\tconst type = layout ?? initialView.type;\n\t\treturn {\n\t\t\t...initialView,\n\t\t\ttype,\n\t\t};\n\t} );\n\n\tconst setViewWithUrlUpdate = useEvent( ( newView ) => {\n\t\tsetView( newView );\n\n\t\tif ( isCustom === 'true' && editedEntityRecord?.id ) {\n\t\t\teditEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\teditedEntityRecord?.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: JSON.stringify( newView ),\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tconst currentUrlLayout = layout ?? LAYOUT_LIST;\n\t\tif ( newView.type !== currentUrlLayout ) {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\tlayout: newView.type,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t} );\n\n\t// When layout URL param changes, update the view type\n\t// without affecting any other config.\n\tconst onUrlLayoutChange = useEvent( () => {\n\t\tsetView( ( prevView ) => {\n\t\t\tconst layoutToApply = layout ?? LAYOUT_LIST;\n\t\t\tif ( layoutToApply === prevView.type ) {\n\t\t\t\treturn prevView;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...prevView,\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t} );\n\t} );\n\tuseEffect( () => {\n\t\tonUrlLayoutChange();\n\t}, [ onUrlLayoutChange, layout ] );\n\n\t// When activeView or isCustom URL parameters change, reset the view.\n\tconst onUrlActiveViewChange = useEvent( () => {\n\t\tlet newView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tnewView = getCustomView( editedEntityRecord );\n\t\t} else {\n\t\t\tnewView = getDefaultView( defaultViews, activeView );\n\t\t}\n\n\t\tif ( newView ) {\n\t\t\tconst type = layout ?? newView.type;\n\t\t\tsetView( {\n\t\t\t\t...newView,\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\t} );\n\tuseEffect( () => {\n\t\tonUrlActiveViewChange();\n\t}, [\n\t\tonUrlActiveViewChange,\n\t\tactiveView,\n\t\tisCustom,\n\t\tdefaultViews,\n\t\teditedEntityRecord,\n\t] );\n\n\treturn [ view, setViewWithUrlUpdate ];\n}\n\nconst DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.\n\nfunction getItemId( item ) {\n\treturn item.id.toString();\n}\n\nexport default function PostList( { postType } ) {\n\tconst [ view, setView ] = useView( postType );\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst {\n\t\tpostId,\n\t\tquickEdit = false,\n\t\tisCustom,\n\t\tactiveView = 'all',\n\t} = location.query;\n\tconst [ selection, setSelection ] = useState( postId?.split( ',' ) ?? [] );\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( ( location.query.isCustom ?? 'false' ) === 'false' ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\t\tpostId: items.join( ',' ),\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ location.path, location.query.isCustom, history ]\n\t);\n\n\tconst getActiveViewFilters = ( views, match ) => {\n\t\tconst found = views.find( ( { slug } ) => slug === match );\n\t\treturn found?.filters ?? [];\n\t};\n\n\tconst { isLoading: isLoadingFields, fields: _fields } = usePostFields( {\n\t\tpostType,\n\t} );\n\tconst fields = useMemo( () => {\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t).map( ( { field } ) => field );\n\t\treturn _fields.map( ( field ) => ( {\n\t\t\t...field,\n\t\t\telements: activeViewFilters.includes( field.id )\n\t\t\t\t? []\n\t\t\t\t: field.elements,\n\t\t} ) );\n\t}, [ _fields, defaultViews, activeView ] );\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_IS_ANY\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_IS_ANY\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_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\n\t\t// The bundled views want data filtered without displaying the filter.\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t);\n\t\tactiveViewFilters.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\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_IS_ANY\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_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\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, activeView, defaultViews ] );\n\tconst {\n\t\trecords,\n\t\tisResolving: isLoadingData,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecordsWithPermissions( 'postType', postType, queryArgs );\n\n\t// The REST API sort the authors by ID, but we want to sort them by name.\n\tconst data = useMemo( () => {\n\t\tif ( ! isLoadingFields && view?.sort?.field === 'author' ) {\n\t\t\treturn filterSortAndPaginate(\n\t\t\t\trecords,\n\t\t\t\t{ sort: { ...view.sort } },\n\t\t\t\tfields\n\t\t\t).data;\n\t\t}\n\n\t\treturn records;\n\t}, [ records, fields, isLoadingFields, view?.sort ] );\n\n\tconst ids = data?.map( ( record ) => getItemId( record ) ) ?? [];\n\tconst prevIds = usePrevious( ids ) ?? [];\n\tconst deletedIds = prevIds.filter( ( id ) => ! ids.includes( id ) );\n\tconst postIdWasDeleted = deletedIds.includes( postId );\n\n\tuseEffect( () => {\n\t\tif ( postIdWasDeleted ) {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t}, [ history, postIdWasDeleted, location.path ] );\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 { labels, canCreateRecord } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType, canUser } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tlabels: getPostType( postType )?.labels,\n\t\t\t\tcanCreateRecord: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: postType,\n\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst [ showAddPostModal, setShowAddPostModal ] = useState( false );\n\n\tconst openModal = () => setShowAddPostModal( true );\n\tconst closeModal = () => setShowAddPostModal( false );\n\tconst handleNewPage = ( { type, id } ) => {\n\t\thistory.navigate( `/${ type }/${ id }?canvas=edit` );\n\t\tcloseModal();\n\t};\n\n\treturn (\n\t\t<Page\n\t\t\ttitle={ labels?.name }\n\t\t\tactions={\n\t\t\t\tlabels?.add_new_item &&\n\t\t\t\tcanCreateRecord && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tonClick={ openModal }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ labels.add_new_item }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ showAddPostModal && (\n\t\t\t\t\t\t\t<AddNewPostModal\n\t\t\t\t\t\t\t\tpostType={ postType }\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>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView + isCustom }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data || EMPTY_ARRAY }\n\t\t\t\tisLoading={ isLoadingData || isLoadingFields }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ setView }\n\t\t\t\tselection={ selection }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tisItemClickable={ ( item ) => item.status !== 'trash' }\n\t\t\t\tonClickItem={ ( { id } ) => {\n\t\t\t\t\thistory.navigate( `/${ postType }/${ id }?canvas=edit` );\n\t\t\t\t} }\n\t\t\t\tgetItemId={ getItemId }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\theader={\n\t\t\t\t\twindow.__experimentalQuickEditDataViews &&\n\t\t\t\t\tview.type !== LAYOUT_LIST &&\n\t\t\t\t\tpostType === 'page' && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tisPressed={ quickEdit }\n\t\t\t\t\t\t\ticon={ drawerRight }\n\t\t\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\t\t\t\t\t\tquickEdit: quickEdit ? undefined : true,\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} }\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</Page>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;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ClK,WAAA,CAAAyK,MAAM;QACNa,IAAI,EAAC,SAAS;QACdC,SAAS,EAAG/F,SAAW;QACvBgG,IAAI,EAAGC,kBAAa;QACpBC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;QACzBhB,OAAO,EAAGA,CAAA,KAAM;UACfzH,OAAO,CAACqB,QAAQ,CACf,IAAAC,iBAAY,EAAEc,QAAQ,CAACxC,IAAI,EAAE;YAC5B0C,SAAS,EAAEA,SAAS,GAAGjD,SAAS,GAAG;UACpC,CAAE,CACH,CAAC;QACF;MAAG,CACH;IAEF,GAlCKP,UAAU,GAAGgB,QAmCnB;EAAC,CACG,CAAC;AAET","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_element","_lockUnlock","_store","_posts","_postItem","routes","postItemRoute","postsRoute","useRegisterPostsAppRoutes","registry","useRegistry","registerRoute","unlock","useDispatch","siteEditorStore","useEffect","batch","forEach"],"sources":["@wordpress/edit-site/src/components/posts-app-routes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as siteEditorStore } from '../../store';\nimport { postsRoute } from './posts';\nimport { postItemRoute } from './post-item';\n\nconst routes = [ postItemRoute, postsRoute ];\n\nexport function useRegisterPostsAppRoutes() {\n\tconst registry = useRegistry();\n\tconst { registerRoute } = unlock( useDispatch( siteEditorStore ) );\n\tuseEffect( () => {\n\t\tregistry.batch( () => {\n\t\t\troutes.forEach( registerRoute );\n\t\t} );\n\t}, [ registry, registerRoute ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAIA;AACA;AACA;;AAMA,MAAMM,MAAM,GAAG,CAAEC,uBAAa,EAAEC,iBAAU,CAAE;AAErC,SAASC,yBAAyBA,CAAA,EAAG;EAC3C,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,iBAAW,EAAEC,YAAgB,CAAE,CAAC;EAClE,IAAAC,kBAAS,EAAE,MAAM;IAChBN,QAAQ,CAACO,KAAK,CAAE,MAAM;MACrBX,MAAM,CAACY,OAAO,CAAEN,aAAc,CAAC;IAChC,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEF,QAAQ,EAAEE,aAAa,CAAG,CAAC;AACjC","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_element","_lockUnlock","_store","_posts","_postItem","routes","postItemRoute","postsRoute","useRegisterPostsAppRoutes","registry","useRegistry","registerRoute","unlock","useDispatch","siteEditorStore","useEffect","batch","forEach"],"sources":["@wordpress/edit-site/src/components/posts-app-routes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as siteEditorStore } from '../../store';\nimport { postsRoute } from './posts';\nimport { postItemRoute } from './post-item';\n\nconst routes = [ postItemRoute, postsRoute ];\n\nexport function useRegisterPostsAppRoutes() {\n\tconst registry = useRegistry();\n\tconst { registerRoute } = unlock( useDispatch( siteEditorStore ) );\n\tuseEffect( () => {\n\t\tregistry.batch( () => {\n\t\t\troutes.forEach( registerRoute );\n\t\t} );\n\t}, [ registry, registerRoute ] );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAIA;AACA;AACA;;AAMA,MAAMM,MAAM,GAAG,CAAEC,uBAAa,EAAEC,iBAAU,CAAE;AAErC,SAASC,yBAAyBA,CAAA,EAAG;EAC3C,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,iBAAW,EAAEC,YAAgB,CAAE,CAAC;EAClE,IAAAC,kBAAS,EAAE,MAAM;IAChBN,QAAQ,CAACO,KAAK,CAAE,MAAM;MACrBX,MAAM,CAACY,OAAO,CAAEN,aAAc,CAAC;IAChC,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEF,QAAQ,EAAEE,aAAa,CAAG,CAAC;AACjC","ignoreList":[]}
@@ -11,6 +11,8 @@ var _components = require("@wordpress/components");
11
11
  var _compose = require("@wordpress/compose");
12
12
  var _i18n = require("@wordpress/i18n");
13
13
  var _router = require("@wordpress/router");
14
+ var _data = require("@wordpress/data");
15
+ var _coreData = require("@wordpress/core-data");
14
16
  var _lockUnlock = require("../../lock-unlock");
15
17
  var _url = require("@wordpress/url");
16
18
  var _jsxRuntime = require("react/jsx-runtime");
@@ -104,6 +106,12 @@ function ResizableFrame({
104
106
  const frameRef = (0, _element.useRef)(null);
105
107
  const resizableHandleHelpId = (0, _compose.useInstanceId)(ResizableFrame, 'edit-site-resizable-frame-handle-help');
106
108
  const defaultAspectRatio = defaultSize.width / defaultSize.height;
109
+ const isBlockTheme = (0, _data.useSelect)(select => {
110
+ const {
111
+ getCurrentTheme
112
+ } = select(_coreData.store);
113
+ return getCurrentTheme()?.is_block_theme;
114
+ }, []);
107
115
  const handleResizeStart = (_event, _direction, ref) => {
108
116
  // Remember the starting width so we don't have to get `ref.offsetWidth` on
109
117
  // every resize event thereafter, which will cause layout thrashing.
@@ -137,7 +145,7 @@ function ResizableFrame({
137
145
  }
138
146
  setIsOversized(false);
139
147
  const remainingWidth = ref.ownerDocument.documentElement.offsetWidth - ref.offsetWidth;
140
- if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD) {
148
+ if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD || !isBlockTheme) {
141
149
  // Reset the initial aspect ratio if the frame is resized slightly
142
150
  // above the sidebar but not far enough to trigger full screen.
143
151
  setFrameSize(INITIAL_FRAME_SIZE);