@wordpress/edit-site 6.2.0 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-pattern/index.js +8 -2
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/{add-new-page → add-new-post}/index.js +21 -17
  5. package/build/components/add-new-post/index.js.map +1 -0
  6. package/build/components/add-new-template/index.js +3 -1
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/block-editor/use-site-editor-settings.js +6 -85
  9. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  10. package/build/components/editor/index.js +21 -3
  11. package/build/components/editor/index.js.map +1 -1
  12. package/build/components/global-styles/background-panel.js +0 -5
  13. package/build/components/global-styles/background-panel.js.map +1 -1
  14. package/build/components/global-styles/block-preview-panel.js +14 -5
  15. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  16. package/build/components/global-styles/font-families.js +42 -23
  17. package/build/components/global-styles/font-families.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/font-collection.js +13 -30
  19. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/index.js +4 -4
  21. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/installed-fonts.js +60 -12
  23. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  24. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +39 -0
  25. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -0
  26. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +39 -0
  27. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +1 -0
  28. package/build/components/global-styles/font-sizes/font-size-preview.js +44 -0
  29. package/build/components/global-styles/font-sizes/font-size-preview.js.map +1 -0
  30. package/build/components/global-styles/font-sizes/font-size.js +213 -0
  31. package/build/components/global-styles/font-sizes/font-size.js.map +1 -0
  32. package/build/components/global-styles/font-sizes/font-sizes-count.js +50 -0
  33. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +1 -0
  34. package/build/components/global-styles/font-sizes/font-sizes.js +163 -0
  35. package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -0
  36. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +67 -0
  37. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +1 -0
  38. package/build/components/global-styles/hooks.js +0 -40
  39. package/build/components/global-styles/hooks.js.map +1 -1
  40. package/build/components/global-styles/preview-typography.js +47 -0
  41. package/build/components/global-styles/preview-typography.js.map +1 -0
  42. package/build/components/global-styles/screen-block.js +17 -1
  43. package/build/components/global-styles/screen-block.js.map +1 -1
  44. package/build/components/global-styles/screen-layout.js +5 -1
  45. package/build/components/global-styles/screen-layout.js.map +1 -1
  46. package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
  47. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  48. package/build/components/global-styles/screen-style-variations.js +2 -2
  49. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  50. package/build/components/global-styles/screen-typography.js +3 -2
  51. package/build/components/global-styles/screen-typography.js.map +1 -1
  52. package/build/components/global-styles/shadows-edit-panel.js +1 -2
  53. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  54. package/build/components/global-styles/size-control/index.js +85 -0
  55. package/build/components/global-styles/size-control/index.js.map +1 -0
  56. package/build/components/global-styles/style-variations-container.js +8 -5
  57. package/build/components/global-styles/style-variations-container.js.map +1 -1
  58. package/build/components/global-styles/typography-elements.js +0 -2
  59. package/build/components/global-styles/typography-elements.js.map +1 -1
  60. package/build/components/global-styles/ui.js +8 -0
  61. package/build/components/global-styles/ui.js.map +1 -1
  62. package/build/components/global-styles/variations/variation.js +4 -4
  63. package/build/components/global-styles/variations/variation.js.map +1 -1
  64. package/build/components/global-styles/variations/variations-color.js +4 -3
  65. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  66. package/build/components/global-styles/variations/variations-typography.js +15 -29
  67. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  68. package/build/components/global-styles-sidebar/index.js +2 -2
  69. package/build/components/global-styles-sidebar/index.js.map +1 -1
  70. package/build/components/layout/index.js +22 -8
  71. package/build/components/layout/index.js.map +1 -1
  72. package/build/components/layout/router.js +30 -43
  73. package/build/components/layout/router.js.map +1 -1
  74. package/build/components/page-patterns/header.js +1 -1
  75. package/build/components/page-patterns/header.js.map +1 -1
  76. package/build/components/page-patterns/index.js +65 -49
  77. package/build/components/page-patterns/index.js.map +1 -1
  78. package/build/components/page-patterns/search-items.js +29 -4
  79. package/build/components/page-patterns/search-items.js.map +1 -1
  80. package/build/components/page-patterns/use-patterns.js +22 -55
  81. package/build/components/page-patterns/use-patterns.js.map +1 -1
  82. package/build/components/page-templates/index.js +56 -50
  83. package/build/components/page-templates/index.js.map +1 -1
  84. package/build/components/pagination/index.js +4 -4
  85. package/build/components/pagination/index.js.map +1 -1
  86. package/build/components/post-edit/index.js +105 -0
  87. package/build/components/post-edit/index.js.map +1 -0
  88. package/build/components/post-fields/index.js +314 -0
  89. package/build/components/post-fields/index.js.map +1 -0
  90. package/build/components/post-list/index.js +281 -0
  91. package/build/components/post-list/index.js.map +1 -0
  92. package/build/components/posts-app/index.js +11 -17
  93. package/build/components/posts-app/index.js.map +1 -1
  94. package/build/components/posts-app/router.js +85 -0
  95. package/build/components/posts-app/router.js.map +1 -0
  96. package/build/components/revisions/index.js +10 -7
  97. package/build/components/revisions/index.js.map +1 -1
  98. package/build/components/save-panel/index.js +1 -1
  99. package/build/components/save-panel/index.js.map +1 -1
  100. package/build/components/sidebar-dataviews/add-new-view.js +4 -1
  101. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  102. package/build/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
  103. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  104. package/build/components/sidebar-dataviews/default-views.js +119 -93
  105. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  106. package/build/components/sidebar-dataviews/index.js +44 -2
  107. package/build/components/sidebar-dataviews/index.js.map +1 -1
  108. package/build/components/sidebar-navigation-screen-global-styles/content.js +64 -0
  109. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -0
  110. package/build/components/sidebar-navigation-screen-global-styles/index.js +2 -47
  111. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  112. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -2
  113. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  114. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +3 -2
  115. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  116. package/build/components/site-hub/index.js +81 -1
  117. package/build/components/site-hub/index.js.map +1 -1
  118. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -1
  119. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  120. package/build/hooks/push-changes-to-global-styles/index.js +2 -2
  121. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  122. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +65 -42
  123. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  124. package/build/index.js +10 -0
  125. package/build/index.js.map +1 -1
  126. package/build/posts.js +57 -2
  127. package/build/posts.js.map +1 -1
  128. package/build/store/private-actions.js +7 -2
  129. package/build/store/private-actions.js.map +1 -1
  130. package/build/store/selectors.js +34 -6
  131. package/build/store/selectors.js.map +1 -1
  132. package/build/utils/get-filtered-template-parts.js +64 -0
  133. package/build/utils/get-filtered-template-parts.js.map +1 -0
  134. package/build-module/components/add-new-pattern/index.js +8 -2
  135. package/build-module/components/add-new-pattern/index.js.map +1 -1
  136. package/build-module/components/{add-new-page → add-new-post}/index.js +21 -17
  137. package/build-module/components/add-new-post/index.js.map +1 -0
  138. package/build-module/components/add-new-template/index.js +3 -1
  139. package/build-module/components/add-new-template/index.js.map +1 -1
  140. package/build-module/components/block-editor/use-site-editor-settings.js +6 -85
  141. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  142. package/build-module/components/editor/index.js +21 -3
  143. package/build-module/components/editor/index.js.map +1 -1
  144. package/build-module/components/global-styles/background-panel.js +0 -5
  145. package/build-module/components/global-styles/background-panel.js.map +1 -1
  146. package/build-module/components/global-styles/block-preview-panel.js +14 -5
  147. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  148. package/build-module/components/global-styles/font-families.js +44 -25
  149. package/build-module/components/global-styles/font-families.js.map +1 -1
  150. package/build-module/components/global-styles/font-library-modal/font-collection.js +14 -31
  151. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  152. package/build-module/components/global-styles/font-library-modal/index.js +4 -4
  153. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  154. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +63 -15
  155. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  156. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +32 -0
  157. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -0
  158. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +32 -0
  159. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +1 -0
  160. package/build-module/components/global-styles/font-sizes/font-size-preview.js +37 -0
  161. package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +1 -0
  162. package/build-module/components/global-styles/font-sizes/font-size.js +207 -0
  163. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -0
  164. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +43 -0
  165. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +1 -0
  166. package/build-module/components/global-styles/font-sizes/font-sizes.js +157 -0
  167. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -0
  168. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +61 -0
  169. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +1 -0
  170. package/build-module/components/global-styles/hooks.js +0 -38
  171. package/build-module/components/global-styles/hooks.js.map +1 -1
  172. package/build-module/components/global-styles/preview-typography.js +39 -0
  173. package/build-module/components/global-styles/preview-typography.js.map +1 -0
  174. package/build-module/components/global-styles/screen-block.js +18 -1
  175. package/build-module/components/global-styles/screen-block.js.map +1 -1
  176. package/build-module/components/global-styles/screen-layout.js +5 -1
  177. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  178. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
  179. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  180. package/build-module/components/global-styles/screen-style-variations.js +2 -2
  181. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  182. package/build-module/components/global-styles/screen-typography.js +3 -2
  183. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  184. package/build-module/components/global-styles/shadows-edit-panel.js +1 -2
  185. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  186. package/build-module/components/global-styles/size-control/index.js +79 -0
  187. package/build-module/components/global-styles/size-control/index.js.map +1 -0
  188. package/build-module/components/global-styles/style-variations-container.js +9 -6
  189. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  190. package/build-module/components/global-styles/typography-elements.js +0 -2
  191. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  192. package/build-module/components/global-styles/ui.js +8 -0
  193. package/build-module/components/global-styles/ui.js.map +1 -1
  194. package/build-module/components/global-styles/variations/variation.js +5 -5
  195. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  196. package/build-module/components/global-styles/variations/variations-color.js +5 -4
  197. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  198. package/build-module/components/global-styles/variations/variations-typography.js +16 -30
  199. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  200. package/build-module/components/global-styles-sidebar/index.js +2 -2
  201. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  202. package/build-module/components/layout/index.js +20 -8
  203. package/build-module/components/layout/index.js.map +1 -1
  204. package/build-module/components/layout/router.js +30 -43
  205. package/build-module/components/layout/router.js.map +1 -1
  206. package/build-module/components/page-patterns/header.js +1 -1
  207. package/build-module/components/page-patterns/header.js.map +1 -1
  208. package/build-module/components/page-patterns/index.js +66 -50
  209. package/build-module/components/page-patterns/index.js.map +1 -1
  210. package/build-module/components/page-patterns/search-items.js +28 -4
  211. package/build-module/components/page-patterns/search-items.js.map +1 -1
  212. package/build-module/components/page-patterns/use-patterns.js +23 -56
  213. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  214. package/build-module/components/page-templates/index.js +58 -53
  215. package/build-module/components/page-templates/index.js.map +1 -1
  216. package/build-module/components/pagination/index.js +4 -4
  217. package/build-module/components/pagination/index.js.map +1 -1
  218. package/build-module/components/post-edit/index.js +98 -0
  219. package/build-module/components/post-edit/index.js.map +1 -0
  220. package/build-module/components/post-fields/index.js +306 -0
  221. package/build-module/components/post-fields/index.js.map +1 -0
  222. package/build-module/components/post-list/index.js +275 -0
  223. package/build-module/components/post-list/index.js.map +1 -0
  224. package/build-module/components/posts-app/index.js +11 -17
  225. package/build-module/components/posts-app/index.js.map +1 -1
  226. package/build-module/components/posts-app/router.js +77 -0
  227. package/build-module/components/posts-app/router.js.map +1 -0
  228. package/build-module/components/revisions/index.js +10 -7
  229. package/build-module/components/revisions/index.js.map +1 -1
  230. package/build-module/components/save-panel/index.js +1 -1
  231. package/build-module/components/save-panel/index.js.map +1 -1
  232. package/build-module/components/sidebar-dataviews/add-new-view.js +4 -1
  233. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  234. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
  235. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  236. package/build-module/components/sidebar-dataviews/default-views.js +117 -92
  237. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  238. package/build-module/components/sidebar-dataviews/index.js +47 -5
  239. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  240. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +57 -0
  241. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -0
  242. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +2 -47
  243. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  244. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -2
  245. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  246. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +3 -2
  247. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  248. package/build-module/components/site-hub/index.js +81 -1
  249. package/build-module/components/site-hub/index.js.map +1 -1
  250. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -1
  251. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  252. package/build-module/hooks/push-changes-to-global-styles/index.js +2 -2
  253. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  254. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +61 -38
  255. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  256. package/build-module/index.js +11 -2
  257. package/build-module/index.js.map +1 -1
  258. package/build-module/posts.js +57 -2
  259. package/build-module/posts.js.map +1 -1
  260. package/build-module/store/private-actions.js +7 -2
  261. package/build-module/store/private-actions.js.map +1 -1
  262. package/build-module/store/selectors.js +35 -7
  263. package/build-module/store/selectors.js.map +1 -1
  264. package/build-module/utils/get-filtered-template-parts.js +57 -0
  265. package/build-module/utils/get-filtered-template-parts.js.map +1 -0
  266. package/build-style/posts-rtl.css +668 -510
  267. package/build-style/posts.css +668 -510
  268. package/build-style/style-rtl.css +772 -702
  269. package/build-style/style.css +772 -702
  270. package/package.json +41 -41
  271. package/src/components/add-new-pattern/index.js +8 -2
  272. package/src/components/{add-new-page → add-new-post}/index.js +28 -22
  273. package/src/components/add-new-template/index.js +4 -1
  274. package/src/components/add-new-template/style.scss +4 -6
  275. package/src/components/block-editor/use-site-editor-settings.js +10 -101
  276. package/src/components/editor/index.js +21 -5
  277. package/src/components/global-styles/background-panel.js +0 -8
  278. package/src/components/global-styles/block-preview-panel.js +22 -9
  279. package/src/components/global-styles/font-families.js +66 -31
  280. package/src/components/global-styles/font-library-modal/font-collection.js +17 -32
  281. package/src/components/global-styles/font-library-modal/index.js +4 -2
  282. package/src/components/global-styles/font-library-modal/installed-fonts.js +94 -13
  283. package/src/components/global-styles/font-library-modal/style.scss +26 -10
  284. package/src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +43 -0
  285. package/src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +37 -0
  286. package/src/components/global-styles/font-sizes/font-size-preview.js +43 -0
  287. package/src/components/global-styles/font-sizes/font-size.js +250 -0
  288. package/src/components/global-styles/font-sizes/font-sizes-count.js +40 -0
  289. package/src/components/global-styles/font-sizes/font-sizes.js +263 -0
  290. package/src/components/global-styles/font-sizes/rename-font-size-dialog.js +70 -0
  291. package/src/components/global-styles/hooks.js +0 -41
  292. package/src/components/global-styles/preview-typography.js +39 -0
  293. package/src/components/global-styles/screen-block.js +20 -0
  294. package/src/components/global-styles/screen-layout.js +5 -1
  295. package/src/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
  296. package/src/components/global-styles/screen-style-variations.js +2 -2
  297. package/src/components/global-styles/screen-typography.js +3 -2
  298. package/src/components/global-styles/shadows-edit-panel.js +1 -2
  299. package/src/components/global-styles/size-control/index.js +86 -0
  300. package/src/components/global-styles/style-variations-container.js +14 -7
  301. package/src/components/global-styles/style.scss +13 -3
  302. package/src/components/global-styles/typography-elements.js +0 -4
  303. package/src/components/global-styles/ui.js +10 -0
  304. package/src/components/global-styles/variations/variation.js +5 -5
  305. package/src/components/global-styles/variations/variations-color.js +6 -4
  306. package/src/components/global-styles/variations/variations-typography.js +15 -33
  307. package/src/components/global-styles-sidebar/index.js +2 -2
  308. package/src/components/layout/index.js +24 -4
  309. package/src/components/layout/router.js +29 -37
  310. package/src/components/layout/style.scss +38 -8
  311. package/src/components/page-patterns/header.js +1 -1
  312. package/src/components/page-patterns/index.js +62 -64
  313. package/src/components/page-patterns/search-items.js +37 -3
  314. package/src/components/page-patterns/style.scss +1 -8
  315. package/src/components/page-patterns/use-patterns.js +43 -82
  316. package/src/components/page-templates/index.js +67 -64
  317. package/src/components/page-templates/style.scss +6 -9
  318. package/src/components/pagination/index.js +4 -4
  319. package/src/components/post-edit/index.js +96 -0
  320. package/src/components/post-edit/style.scss +9 -0
  321. package/src/components/post-fields/index.js +345 -0
  322. package/src/components/post-list/index.js +326 -0
  323. package/src/components/{page-pages → post-list}/style.scss +25 -8
  324. package/src/components/posts-app/index.js +9 -11
  325. package/src/components/posts-app/router.js +69 -0
  326. package/src/components/revisions/index.js +9 -1
  327. package/src/components/save-panel/index.js +1 -1
  328. package/src/components/sidebar/style.scss +6 -0
  329. package/src/components/sidebar-dataviews/add-new-view.js +2 -1
  330. package/src/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
  331. package/src/components/sidebar-dataviews/default-views.js +131 -106
  332. package/src/components/sidebar-dataviews/index.js +39 -4
  333. package/src/components/sidebar-navigation-screen-global-styles/content.js +55 -0
  334. package/src/components/sidebar-navigation-screen-global-styles/index.js +1 -54
  335. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +2 -1
  336. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +10 -2
  337. package/src/components/site-hub/index.js +84 -1
  338. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -2
  339. package/src/hooks/push-changes-to-global-styles/index.js +2 -2
  340. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +28 -24
  341. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +72 -47
  342. package/src/index.js +14 -1
  343. package/src/posts.js +63 -2
  344. package/src/posts.scss +9 -0
  345. package/src/store/private-actions.js +7 -3
  346. package/src/store/selectors.js +53 -14
  347. package/src/store/test/selectors.js +1 -26
  348. package/src/style.scss +2 -2
  349. package/src/utils/get-filtered-template-parts.js +61 -0
  350. package/src/utils/test/get-filtered-template-parts.js +127 -0
  351. package/build/components/add-new-page/index.js.map +0 -1
  352. package/build/components/global-styles/screen-background.js +0 -36
  353. package/build/components/global-styles/screen-background.js.map +0 -1
  354. package/build/components/page-pages/index.js +0 -473
  355. package/build/components/page-pages/index.js.map +0 -1
  356. package/build/components/table/index.js +0 -35
  357. package/build/components/table/index.js.map +0 -1
  358. package/build-module/components/add-new-page/index.js.map +0 -1
  359. package/build-module/components/global-styles/screen-background.js +0 -30
  360. package/build-module/components/global-styles/screen-background.js.map +0 -1
  361. package/build-module/components/page-pages/index.js +0 -465
  362. package/build-module/components/page-pages/index.js.map +0 -1
  363. package/build-module/components/table/index.js +0 -30
  364. package/build-module/components/table/index.js.map +0 -1
  365. package/src/components/global-styles/screen-background.js +0 -29
  366. package/src/components/page-pages/index.js +0 -564
  367. package/src/components/table/index.js +0 -33
  368. package/src/components/table/style.scss +0 -38
@@ -3,25 +3,42 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { trash, pages, drafts, published, scheduled, pending, notAllowed } from '@wordpress/icons';
6
+ import { useSelect } from '@wordpress/data';
7
+ import { store as coreStore } from '@wordpress/core-data';
8
+ import { useMemo } from '@wordpress/element';
6
9
 
7
10
  /**
8
11
  * Internal dependencies
9
12
  */
10
13
  import { LAYOUT_LIST, LAYOUT_TABLE, LAYOUT_GRID, OPERATOR_IS_ANY } from '../../utils/constants';
11
- export const DEFAULT_CONFIG_PER_VIEW_TYPE = {
14
+ export const defaultLayouts = {
12
15
  [LAYOUT_TABLE]: {
13
- primaryField: 'title'
16
+ layout: {
17
+ primaryField: 'title',
18
+ styles: {
19
+ 'featured-image': {
20
+ width: '1%'
21
+ },
22
+ title: {
23
+ maxWidth: 300
24
+ }
25
+ }
26
+ }
14
27
  },
15
28
  [LAYOUT_GRID]: {
16
- mediaField: 'featured-image',
17
- primaryField: 'title'
29
+ layout: {
30
+ mediaField: 'featured-image',
31
+ primaryField: 'title'
32
+ }
18
33
  },
19
34
  [LAYOUT_LIST]: {
20
- primaryField: 'title',
21
- mediaField: 'featured-image'
35
+ layout: {
36
+ primaryField: 'title',
37
+ mediaField: 'featured-image'
38
+ }
22
39
  }
23
40
  };
24
- const DEFAULT_PAGE_BASE = {
41
+ const DEFAULT_POST_BASE = {
25
42
  type: LAYOUT_LIST,
26
43
  search: '',
27
44
  filters: [],
@@ -31,91 +48,99 @@ const DEFAULT_PAGE_BASE = {
31
48
  field: 'date',
32
49
  direction: 'desc'
33
50
  },
34
- // All fields are visible by default, so it's
35
- // better to keep track of the hidden ones.
36
- hiddenFields: ['date', 'featured-image'],
37
- layout: {
38
- ...DEFAULT_CONFIG_PER_VIEW_TYPE[LAYOUT_LIST]
39
- }
51
+ fields: ['title', 'author', 'status'],
52
+ layout: defaultLayouts[LAYOUT_LIST].layout
40
53
  };
41
- export const DEFAULT_VIEWS = {
42
- page: [{
43
- title: __('All pages'),
44
- slug: 'all',
45
- icon: pages,
46
- view: DEFAULT_PAGE_BASE
47
- }, {
48
- title: __('Published'),
49
- slug: 'published',
50
- icon: published,
51
- view: {
52
- ...DEFAULT_PAGE_BASE,
53
- filters: [{
54
- field: 'status',
55
- operator: OPERATOR_IS_ANY,
56
- value: 'publish'
57
- }]
58
- }
59
- }, {
60
- title: __('Scheduled'),
61
- slug: 'future',
62
- icon: scheduled,
63
- view: {
64
- ...DEFAULT_PAGE_BASE,
65
- filters: [{
66
- field: 'status',
67
- operator: OPERATOR_IS_ANY,
68
- value: 'future'
69
- }]
70
- }
71
- }, {
72
- title: __('Drafts'),
73
- slug: 'drafts',
74
- icon: drafts,
75
- view: {
76
- ...DEFAULT_PAGE_BASE,
77
- filters: [{
78
- field: 'status',
79
- operator: OPERATOR_IS_ANY,
80
- value: 'draft'
54
+ export function useDefaultViews({
55
+ postType
56
+ }) {
57
+ const labels = useSelect(select => {
58
+ const {
59
+ getPostType
60
+ } = select(coreStore);
61
+ return getPostType(postType)?.labels;
62
+ }, [postType]);
63
+ return useMemo(() => {
64
+ return {
65
+ [postType]: [{
66
+ title: labels?.all_items || __('All items'),
67
+ slug: 'all',
68
+ icon: pages,
69
+ view: DEFAULT_POST_BASE
70
+ }, {
71
+ title: __('Published'),
72
+ slug: 'published',
73
+ icon: published,
74
+ view: {
75
+ ...DEFAULT_POST_BASE,
76
+ filters: [{
77
+ field: 'status',
78
+ operator: OPERATOR_IS_ANY,
79
+ value: 'publish'
80
+ }]
81
+ }
82
+ }, {
83
+ title: __('Scheduled'),
84
+ slug: 'future',
85
+ icon: scheduled,
86
+ view: {
87
+ ...DEFAULT_POST_BASE,
88
+ filters: [{
89
+ field: 'status',
90
+ operator: OPERATOR_IS_ANY,
91
+ value: 'future'
92
+ }]
93
+ }
94
+ }, {
95
+ title: __('Drafts'),
96
+ slug: 'drafts',
97
+ icon: drafts,
98
+ view: {
99
+ ...DEFAULT_POST_BASE,
100
+ filters: [{
101
+ field: 'status',
102
+ operator: OPERATOR_IS_ANY,
103
+ value: 'draft'
104
+ }]
105
+ }
106
+ }, {
107
+ title: __('Pending'),
108
+ slug: 'pending',
109
+ icon: pending,
110
+ view: {
111
+ ...DEFAULT_POST_BASE,
112
+ filters: [{
113
+ field: 'status',
114
+ operator: OPERATOR_IS_ANY,
115
+ value: 'pending'
116
+ }]
117
+ }
118
+ }, {
119
+ title: __('Private'),
120
+ slug: 'private',
121
+ icon: notAllowed,
122
+ view: {
123
+ ...DEFAULT_POST_BASE,
124
+ filters: [{
125
+ field: 'status',
126
+ operator: OPERATOR_IS_ANY,
127
+ value: 'private'
128
+ }]
129
+ }
130
+ }, {
131
+ title: __('Trash'),
132
+ slug: 'trash',
133
+ icon: trash,
134
+ view: {
135
+ ...DEFAULT_POST_BASE,
136
+ filters: [{
137
+ field: 'status',
138
+ operator: OPERATOR_IS_ANY,
139
+ value: 'trash'
140
+ }]
141
+ }
81
142
  }]
82
- }
83
- }, {
84
- title: __('Pending'),
85
- slug: 'pending',
86
- icon: pending,
87
- view: {
88
- ...DEFAULT_PAGE_BASE,
89
- filters: [{
90
- field: 'status',
91
- operator: OPERATOR_IS_ANY,
92
- value: 'pending'
93
- }]
94
- }
95
- }, {
96
- title: __('Private'),
97
- slug: 'private',
98
- icon: notAllowed,
99
- view: {
100
- ...DEFAULT_PAGE_BASE,
101
- filters: [{
102
- field: 'status',
103
- operator: OPERATOR_IS_ANY,
104
- value: 'private'
105
- }]
106
- }
107
- }, {
108
- title: __('Trash'),
109
- slug: 'trash',
110
- icon: trash,
111
- view: {
112
- ...DEFAULT_PAGE_BASE,
113
- filters: [{
114
- field: 'status',
115
- operator: OPERATOR_IS_ANY,
116
- value: 'trash'
117
- }]
118
- }
119
- }]
120
- };
143
+ };
144
+ }, [labels, postType]);
145
+ }
121
146
  //# sourceMappingURL=default-views.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","trash","pages","drafts","published","scheduled","pending","notAllowed","LAYOUT_LIST","LAYOUT_TABLE","LAYOUT_GRID","OPERATOR_IS_ANY","DEFAULT_CONFIG_PER_VIEW_TYPE","primaryField","mediaField","DEFAULT_PAGE_BASE","type","search","filters","page","perPage","sort","field","direction","hiddenFields","layout","DEFAULT_VIEWS","title","slug","icon","view","operator","value"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IS_ANY,\n} from '../../utils/constants';\n\nexport const DEFAULT_CONFIG_PER_VIEW_TYPE = {\n\t[ LAYOUT_TABLE ]: {\n\t\tprimaryField: 'title',\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tmediaField: 'featured-image',\n\t\tprimaryField: 'title',\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tprimaryField: 'title',\n\t\tmediaField: 'featured-image',\n\t},\n};\n\nconst DEFAULT_PAGE_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\t// All fields are visible by default, so it's\n\t// better to keep track of the hidden ones.\n\thiddenFields: [ 'date', 'featured-image' ],\n\tlayout: {\n\t\t...DEFAULT_CONFIG_PER_VIEW_TYPE[ LAYOUT_LIST ],\n\t},\n};\n\nexport const DEFAULT_VIEWS = {\n\tpage: [\n\t\t{\n\t\t\ttitle: __( 'All pages' ),\n\t\t\tslug: 'all',\n\t\t\ticon: pages,\n\t\t\tview: DEFAULT_PAGE_BASE,\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Published' ),\n\t\t\tslug: 'published',\n\t\t\ticon: published,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'publish',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Scheduled' ),\n\t\t\tslug: 'future',\n\t\t\ticon: scheduled,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'future',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Drafts' ),\n\t\t\tslug: 'drafts',\n\t\t\ticon: drafts,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'draft',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Pending' ),\n\t\t\tslug: 'pending',\n\t\t\ticon: pending,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'pending',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Private' ),\n\t\t\tslug: 'private',\n\t\t\ticon: notAllowed,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'private',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Trash' ),\n\t\t\tslug: 'trash',\n\t\t\ticon: trash,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'trash',\n\t\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B,EAAE,CAAE,OAAQ,CAAC;IACpB4B,IAAI,EAAE,OAAO;IACbC,IAAI,EAAE5B,KAAK;IACX6B,IAAI,EAAE;MACL,GAAGf,iBAAiB;MACpBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfS,QAAQ,EAAEpB,eAAe;QACzBqB,KAAK,EAAE;MACR,CAAC;IAEH;EACD,CAAC;AAEH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","trash","pages","drafts","published","scheduled","pending","notAllowed","useSelect","store","coreStore","useMemo","LAYOUT_LIST","LAYOUT_TABLE","LAYOUT_GRID","OPERATOR_IS_ANY","defaultLayouts","layout","primaryField","styles","width","title","maxWidth","mediaField","DEFAULT_POST_BASE","type","search","filters","page","perPage","sort","field","direction","fields","useDefaultViews","postType","labels","select","getPostType","all_items","slug","icon","view","operator","value"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IS_ANY,\n} from '../../utils/constants';\n\nexport const defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tstyles: {\n\t\t\t\t'featured-image': {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t\ttitle: {\n\t\t\t\t\tmaxWidth: 300,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tlayout: {\n\t\t\tmediaField: 'featured-image',\n\t\t\tprimaryField: 'title',\n\t\t},\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tmediaField: 'featured-image',\n\t\t},\n\t},\n};\n\nconst DEFAULT_POST_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\tfields: [ 'title', 'author', 'status' ],\n\tlayout: defaultLayouts[ LAYOUT_LIST ].layout,\n};\n\nexport function useDefaultViews( { postType } ) {\n\tconst labels = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType } = select( coreStore );\n\t\t\treturn getPostType( postType )?.labels;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn {\n\t\t\t[ postType ]: [\n\t\t\t\t{\n\t\t\t\t\ttitle: labels?.all_items || __( 'All items' ),\n\t\t\t\t\tslug: 'all',\n\t\t\t\t\ticon: pages,\n\t\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttitle: __( 'Published' ),\n\t\t\t\t\tslug: 'published',\n\t\t\t\t\ticon: published,\n\t\t\t\t\tview: {\n\t\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\t\tfilters: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: 'publish',\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\t{\n\t\t\t\t\ttitle: __( 'Scheduled' ),\n\t\t\t\t\tslug: 'future',\n\t\t\t\t\ticon: scheduled,\n\t\t\t\t\tview: {\n\t\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\t\tfilters: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: 'future',\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\t{\n\t\t\t\t\ttitle: __( 'Drafts' ),\n\t\t\t\t\tslug: 'drafts',\n\t\t\t\t\ticon: drafts,\n\t\t\t\t\tview: {\n\t\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\t\tfilters: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: 'draft',\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\t{\n\t\t\t\t\ttitle: __( 'Pending' ),\n\t\t\t\t\tslug: 'pending',\n\t\t\t\t\ticon: pending,\n\t\t\t\t\tview: {\n\t\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\t\tfilters: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: 'pending',\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\t{\n\t\t\t\t\ttitle: __( 'Private' ),\n\t\t\t\t\tslug: 'private',\n\t\t\t\t\ticon: notAllowed,\n\t\t\t\t\tview: {\n\t\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\t\tfilters: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: 'private',\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\t{\n\t\t\t\t\ttitle: __( 'Trash' ),\n\t\t\t\t\tslug: 'trash',\n\t\t\t\t\ticon: trash,\n\t\t\t\t\tview: {\n\t\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\t\tfilters: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: 'trash',\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}, [ labels, postType ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,SACCC,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,UAAU,QACJ,kBAAkB;AACzB,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,SACCC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,QACT,uBAAuB;AAE9B,OAAO,MAAMC,cAAc,GAAG;EAC7B,CAAEH,YAAY,GAAI;IACjBI,MAAM,EAAE;MACPC,YAAY,EAAE,OAAO;MACrBC,MAAM,EAAE;QACP,gBAAgB,EAAE;UACjBC,KAAK,EAAE;QACR,CAAC;QACDC,KAAK,EAAE;UACNC,QAAQ,EAAE;QACX;MACD;IACD;EACD,CAAC;EACD,CAAER,WAAW,GAAI;IAChBG,MAAM,EAAE;MACPM,UAAU,EAAE,gBAAgB;MAC5BL,YAAY,EAAE;IACf;EACD,CAAC;EACD,CAAEN,WAAW,GAAI;IAChBK,MAAM,EAAE;MACPC,YAAY,EAAE,OAAO;MACrBK,UAAU,EAAE;IACb;EACD;AACD,CAAC;AAED,MAAMC,i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CAAC,EAAE,CAAER,MAAM,EAAED,QAAQ,CAAG,CAAC;AAC1B","ignoreList":[]}
@@ -3,20 +3,58 @@
3
3
  */
4
4
  import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
5
5
  import { privateApis as routerPrivateApis } from '@wordpress/router';
6
+ import { useRef, useEffect } from '@wordpress/element';
7
+ import { usePrevious } from '@wordpress/compose';
8
+
6
9
  /**
7
10
  * Internal dependencies
8
11
  */
9
-
10
- import { DEFAULT_VIEWS } from './default-views';
12
+ import { useDefaultViews } from './default-views';
11
13
  import { unlock } from '../../lock-unlock';
12
- const {
13
- useLocation
14
- } = unlock(routerPrivateApis);
15
14
  import DataViewItem from './dataview-item';
16
15
  import CustomDataViewsList from './custom-dataviews-list';
17
16
  import { jsx as _jsx } from "react/jsx-runtime";
18
17
  import { Fragment as _Fragment } from "react/jsx-runtime";
19
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
+ const {
20
+ useLocation,
21
+ useHistory
22
+ } = unlock(routerPrivateApis);
23
+
24
+ /**
25
+ * Hook to switch to table layout when switching to the trash view.
26
+ * When going out of the trash view, it switches back to the previous layout if
27
+ * there was an automatic switch to table layout.
28
+ */
29
+ function useSwitchToTableOnTrash() {
30
+ const {
31
+ params: {
32
+ activeView,
33
+ layout,
34
+ ...restParams
35
+ }
36
+ } = useLocation();
37
+ const history = useHistory();
38
+ const viewToSwitchOutOfTrash = useRef(undefined);
39
+ const previousActiveView = usePrevious(activeView);
40
+ useEffect(() => {
41
+ if (activeView === 'trash' && previousActiveView !== 'trash') {
42
+ viewToSwitchOutOfTrash.current = layout || 'list';
43
+ history.push({
44
+ ...restParams,
45
+ layout: 'table',
46
+ activeView
47
+ });
48
+ } else if (previousActiveView === 'trash' && activeView !== 'trash' && viewToSwitchOutOfTrash.current) {
49
+ history.push({
50
+ ...restParams,
51
+ layout: viewToSwitchOutOfTrash.current,
52
+ activeView
53
+ });
54
+ viewToSwitchOutOfTrash.current = undefined;
55
+ }
56
+ }, [previousActiveView, activeView, layout, history, restParams]);
57
+ }
20
58
  export default function DataViewsSidebarContent() {
21
59
  const {
22
60
  params: {
@@ -25,6 +63,10 @@ export default function DataViewsSidebarContent() {
25
63
  isCustom = 'false'
26
64
  }
27
65
  } = useLocation();
66
+ useSwitchToTableOnTrash();
67
+ const DEFAULT_VIEWS = useDefaultViews({
68
+ postType
69
+ });
28
70
  if (!postType) {
29
71
  return null;
30
72
  }
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalItemGroup","ItemGroup","privateApis","routerPrivateApis","DEFAULT_VIEWS","unlock","useLocation","DataViewItem","CustomDataViewsList","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DataViewsSidebarContent","params","postType","activeView","isCustom","isCustomBoolean","children","map","dataview","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n/**\n * Internal dependencies\n */\n\nimport { DEFAULT_VIEWS } from './default-views';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nexport default function DataViewsSidebarContent() {\n\tconst {\n\t\tparams: { postType, activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ DEFAULT_VIEWS[ postType ].map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ItemGroup>\n\t\t\t{ window?.__experimentalCustomViews && (\n\t\t\t\t<CustomDataViewsList\n\t\t\t\t\tactiveView={ activeView }\n\t\t\t\t\ttype={ postType }\n\t\t\t\t\tisCustom\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAE5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE;AACA;AACA;;AAEA,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,MAAM;EAAEC;AAAY,CAAC,GAAGD,MAAM,CAAEF,iBAAkB,CAAC;AACnD,OAAOI,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,mBAAmB,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE1D,eAAe,SAASC,uBAAuBA,CAAA,EAAG;EACjD,MAAM;IACLC,MAAM,EAAE;MAAEC,QAAQ;MAAEC,UAAU,GAAG,KAAK;MAAEC,QAAQ,GAAG;IAAQ;EAC5D,CAAC,GAAGb,WAAW,CAAC,CAAC;EACjB,IAAK,CAAEW,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EACA,MAAMG,eAAe,GAAGD,QAAQ,KAAK,MAAM;EAE3C,oBACCL,KAAA,CAAAF,SAAA;IAAAS,QAAA,gBACCX,IAAA,CAACT,SAAS;MAAAoB,QAAA,EACPjB,aAAa,CAAEa,QAAQ,CAAE,CAACK,GAAG,CAAIC,QAAQ,IAAM;QAChD,oBACCb,IAAA,CAACH,YAAY;UAEZiB,IAAI,EAAGD,QAAQ,CAACC,IAAM;UACtBC,KAAK,EAAGF,QAAQ,CAACE,KAAO;UACxBC,IAAI,EAAGH,QAAQ,CAACG,IAAM;UACtBC,IAAI,EAAGJ,QAAQ,CAACK,IAAI,CAACD,IAAM;UAC3BE,QAAQ,EACP,CAAET,eAAe,IACjBG,QAAQ,CAACC,IAAI,KAAKN,UAClB;UACDC,QAAQ,EAAG;QAAO,GATZI,QAAQ,CAACC,IAUf,CAAC;MAEJ,CAAE;IAAC,CACO,CAAC,EACVM,MAAM,EAAEC,yBAAyB,iBAClCrB,IAAA,CAACF,mBAAmB;MACnBU,UAAU,EAAGA,UAAY;MACzBS,IAAI,EAAGV,QAAU;MACjBE,QAAQ;IAAA,CACR,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__experimentalItemGroup","ItemGroup","privateApis","routerPrivateApis","useRef","useEffect","usePrevious","useDefaultViews","unlock","DataViewItem","CustomDataViewsList","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useLocation","useHistory","useSwitchToTableOnTrash","params","activeView","layout","restParams","history","viewToSwitchOutOfTrash","undefined","previousActiveView","current","push","DataViewsSidebarContent","postType","isCustom","DEFAULT_VIEWS","isCustomBoolean","children","map","dataview","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\n/**\n * Hook to switch to table layout when switching to the trash view.\n * When going out of the trash view, it switches back to the previous layout if\n * there was an automatic switch to table layout.\n */\nfunction useSwitchToTableOnTrash() {\n\tconst {\n\t\tparams: { activeView, layout, ...restParams },\n\t} = useLocation();\n\tconst history = useHistory();\n\tconst viewToSwitchOutOfTrash = useRef( undefined );\n\tconst previousActiveView = usePrevious( activeView );\n\tuseEffect( () => {\n\t\tif ( activeView === 'trash' && previousActiveView !== 'trash' ) {\n\t\t\tviewToSwitchOutOfTrash.current = layout || 'list';\n\t\t\thistory.push( { ...restParams, layout: 'table', activeView } );\n\t\t} else if (\n\t\t\tpreviousActiveView === 'trash' &&\n\t\t\tactiveView !== 'trash' &&\n\t\t\tviewToSwitchOutOfTrash.current\n\t\t) {\n\t\t\thistory.push( {\n\t\t\t\t...restParams,\n\t\t\t\tlayout: viewToSwitchOutOfTrash.current,\n\t\t\t\tactiveView,\n\t\t\t} );\n\t\t\tviewToSwitchOutOfTrash.current = undefined;\n\t\t}\n\t}, [ previousActiveView, activeView, layout, history, restParams ] );\n}\n\nexport default function DataViewsSidebarContent() {\n\tconst {\n\t\tparams: { postType, activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tuseSwitchToTableOnTrash();\n\tconst DEFAULT_VIEWS = useDefaultViews( { postType } );\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ DEFAULT_VIEWS[ postType ].map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ItemGroup>\n\t\t\t{ window?.__experimentalCustomViews && (\n\t\t\t\t<CustomDataViewsList\n\t\t\t\t\tactiveView={ activeView }\n\t\t\t\t\ttype={ postType }\n\t\t\t\t\tisCustom\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,mBAAmB,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE1D,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAGV,MAAM,CAAEL,iBAAkB,CAAC;;AAE/D;AACA;AACA;AACA;AACA;AACA,SAASgB,uBAAuBA,CAAA,EAAG;EAClC,MAAM;IACLC,MAAM,EAAE;MAAEC,UAAU;MAAEC,MAAM;MAAE,GAAGC;IAAW;EAC7C,CAAC,GAAGN,WAAW,CAAC,CAAC;EACjB,MAAMO,OAAO,GAAGN,UAAU,CAAC,CAAC;EAC5B,MAAMO,sBAAsB,GAAGrB,MAAM,CAAEsB,SAAU,CAAC;EAClD,MAAMC,kBAAkB,GAAGrB,WAAW,CAAEe,UAAW,C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EAAGF,QAAQ,CAACE,KAAO;UACxBC,IAAI,EAAGH,QAAQ,CAACG,IAAM;UACtBC,IAAI,EAAGJ,QAAQ,CAACK,IAAI,CAACD,IAAM;UAC3BE,QAAQ,EACP,CAAET,eAAe,IACjBG,QAAQ,CAACC,IAAI,KAAKjB,UAClB;UACDW,QAAQ,EAAG;QAAO,GATZK,QAAQ,CAACC,IAUf,CAAC;MAEJ,CAAE;IAAC,CACO,CAAC,EACVM,MAAM,EAAEC,yBAAyB,iBAClCjC,IAAA,CAACF,mBAAmB;MACnBW,UAAU,EAAGA,UAAY;MACzBoB,IAAI,EAAGV,QAAU;MACjBC,QAAQ;IAAA,CACR,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { useSelect } from '@wordpress/data';
6
+ import { __experimentalVStack as VStack } from '@wordpress/components';
7
+ import { BlockEditorProvider } from '@wordpress/block-editor';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import StyleVariationsContainer from '../global-styles/style-variations-container';
13
+ import { unlock } from '../../lock-unlock';
14
+ import { store as editSiteStore } from '../../store';
15
+ import ColorVariations from '../global-styles/variations/variations-color';
16
+ import TypographyVariations from '../global-styles/variations/variations-typography';
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { jsxs as _jsxs } from "react/jsx-runtime";
19
+ const noop = () => {};
20
+ export default function SidebarNavigationScreenGlobalStylesContent() {
21
+ const {
22
+ storedSettings
23
+ } = useSelect(select => {
24
+ const {
25
+ getSettings
26
+ } = unlock(select(editSiteStore));
27
+ return {
28
+ storedSettings: getSettings()
29
+ };
30
+ }, []);
31
+ const gap = 3;
32
+
33
+ // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are
34
+ // loaded. This is necessary because the Iframe component waits until
35
+ // the block editor store's `__internalIsInitialized` is true before
36
+ // rendering the iframe. Without this, the iframe previews will not render
37
+ // in mobile viewport sizes, where the editor canvas is hidden.
38
+ return /*#__PURE__*/_jsx(BlockEditorProvider, {
39
+ settings: storedSettings,
40
+ onChange: noop,
41
+ onInput: noop,
42
+ children: /*#__PURE__*/_jsxs(VStack, {
43
+ spacing: 10,
44
+ className: "edit-site-global-styles-variation-container",
45
+ children: [/*#__PURE__*/_jsx(StyleVariationsContainer, {
46
+ gap: gap
47
+ }), /*#__PURE__*/_jsx(ColorVariations, {
48
+ title: __('Palettes'),
49
+ gap: gap
50
+ }), /*#__PURE__*/_jsx(TypographyVariations, {
51
+ title: __('Typography'),
52
+ gap: gap
53
+ })]
54
+ })
55
+ });
56
+ }
57
+ //# sourceMappingURL=content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__","useSelect","__experimentalVStack","VStack","BlockEditorProvider","StyleVariationsContainer","unlock","store","editSiteStore","ColorVariations","TypographyVariations","jsx","_jsx","jsxs","_jsxs","noop","SidebarNavigationScreenGlobalStylesContent","storedSettings","select","getSettings","gap","settings","onChange","onInput","children","spacing","className","title"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport ColorVariations from '../global-styles/variations/variations-color';\nimport TypographyVariations from '../global-styles/variations/variations-typography';\n\nconst noop = () => {};\n\nexport default function SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings(),\n\t\t};\n\t}, [] );\n\n\tconst gap = 3;\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<VStack\n\t\t\t\tspacing={ 10 }\n\t\t\t\tclassName=\"edit-site-global-styles-variation-container\"\n\t\t\t>\n\t\t\t\t<StyleVariationsContainer gap={ gap } />\n\t\t\t\t<ColorVariations title={ __( 'Palettes' ) } gap={ gap } />\n\t\t\t\t<TypographyVariations\n\t\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\t\tgap={ gap }\n\t\t\t\t/>\n\t\t\t</VStack>\n\t\t</BlockEditorProvider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,mBAAmB,QAAQ,yBAAyB;;AAE7D;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,6CAA6C;AAClF,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,OAAOC,eAAe,MAAM,8CAA8C;AAC1E,OAAOC,oBAAoB,MAAM,mDAAmD;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAErF,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,eAAe,SAASC,0CAA0CA,CAAA,EAAG;EACpE,MAAM;IAAEC;EAAe,CAAC,GAAGhB,SAAS,CAAIiB,MAAM,IAAM;IACnD,MAAM;MAAEC;IAAY,CAAC,GAAGb,MAAM,CAAEY,MAAM,CAAEV,aAAc,CAAE,CAAC;IAEzD,OAAO;MACNS,cAAc,EAAEE,WAAW,CAAC;IAC7B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,GAAG,GAAG,CAAC;;EAEb;EACA;EACA;EACA;EACA;EACA,oBACCR,IAAA,CAACR,mBAAmB;IACnBiB,QAAQ,EAAGJ,cAAgB;IAC3BK,QAAQ,EAAGP,IAAM;IACjBQ,OAAO,EAAGR,IAAM;IAAAS,QAAA,eAEhBV,KAAA,CAACX,MAAM;MACNsB,OAAO,EAAG,EAAI;MACdC,SAAS,EAAC,6CAA6C;MAAAF,QAAA,gBAEvDZ,IAAA,CAACP,wBAAwB;QAACe,GAAG,EAAGA;MAAK,CAAE,CAAC,eACxCR,IAAA,CAACH,eAAe;QAACkB,KAAK,EAAG3B,EAAE,CAAE,UAAW,CAAG;QAACoB,GAAG,EAAGA;MAAK,CAAE,CAAC,eAC1DR,IAAA,CAACF,oBAAoB;QACpBiB,KAAK,EAAG3B,EAAE,CAAE,YAAa,CAAG;QAC5BoB,GAAG,EAAGA;MAAK,CACX,CAAC;IAAA,CACK;EAAC,CACW,CAAC;AAExB","ignoreList":[]}
@@ -5,9 +5,7 @@ import { __ } from '@wordpress/i18n';
5
5
  import { edit, seen } from '@wordpress/icons';
6
6
  import { useSelect, useDispatch } from '@wordpress/data';
7
7
  import { store as coreStore } from '@wordpress/core-data';
8
- import { __experimentalVStack as VStack } from '@wordpress/components';
9
8
  import { useViewportMatch } from '@wordpress/compose';
10
- import { BlockEditorProvider } from '@wordpress/block-editor';
11
9
  import { useCallback } from '@wordpress/element';
12
10
  import { store as editorStore } from '@wordpress/editor';
13
11
  import { store as preferencesStore } from '@wordpress/preferences';
@@ -16,7 +14,6 @@ import { store as preferencesStore } from '@wordpress/preferences';
16
14
  * Internal dependencies
17
15
  */
18
16
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
19
- import StyleVariationsContainer from '../global-styles/style-variations-container';
20
17
  import { unlock } from '../../lock-unlock';
21
18
  import { store as editSiteStore } from '../../store';
22
19
  import SidebarButton from '../sidebar-button';
@@ -24,13 +21,10 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
24
21
  import StyleBook from '../style-book';
25
22
  import useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';
26
23
  import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
27
- import ColorVariations from '../global-styles/variations/variations-color';
28
- import TypographyVariations from '../global-styles/variations/variations-typography';
29
- import { useColorVariations, useTypographyVariations } from '../global-styles/hooks';
24
+ import SidebarNavigationScreenGlobalStylesContent from './content';
30
25
  import { jsx as _jsx } from "react/jsx-runtime";
31
- import { jsxs as _jsxs } from "react/jsx-runtime";
32
26
  import { Fragment as _Fragment } from "react/jsx-runtime";
33
- const noop = () => {};
27
+ import { jsxs as _jsxs } from "react/jsx-runtime";
34
28
  export function SidebarNavigationItemGlobalStyles(props) {
35
29
  const {
36
30
  openGeneralSidebar
@@ -58,45 +52,6 @@ export function SidebarNavigationItemGlobalStyles(props) {
58
52
  }
59
53
  });
60
54
  }
61
- function SidebarNavigationScreenGlobalStylesContent() {
62
- const {
63
- storedSettings
64
- } = useSelect(select => {
65
- const {
66
- getSettings
67
- } = unlock(select(editSiteStore));
68
- return {
69
- storedSettings: getSettings()
70
- };
71
- }, []);
72
- const colorVariations = useColorVariations();
73
- const typographyVariations = useTypographyVariations();
74
- const gap = 3;
75
-
76
- // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are
77
- // loaded. This is necessary because the Iframe component waits until
78
- // the block editor store's `__internalIsInitialized` is true before
79
- // rendering the iframe. Without this, the iframe previews will not render
80
- // in mobile viewport sizes, where the editor canvas is hidden.
81
- return /*#__PURE__*/_jsx(BlockEditorProvider, {
82
- settings: storedSettings,
83
- onChange: noop,
84
- onInput: noop,
85
- children: /*#__PURE__*/_jsxs(VStack, {
86
- spacing: 10,
87
- className: "edit-site-global-styles-variation-container",
88
- children: [/*#__PURE__*/_jsx(StyleVariationsContainer, {
89
- gap: gap
90
- }), colorVariations?.length && /*#__PURE__*/_jsx(ColorVariations, {
91
- title: __('Palettes'),
92
- gap: gap
93
- }), typographyVariations?.length && /*#__PURE__*/_jsx(TypographyVariations, {
94
- title: __('Typography'),
95
- gap: gap
96
- })]
97
- })
98
- });
99
- }
100
55
  export default function SidebarNavigationScreenGlobalStyles({
101
56
  backPath
102
57
  }) {
@@ -1 +1 @@
1
- {"version":3,"names":["__","edit","seen","useSelect","useDispatch","store","coreStore","__experimentalVStack","VStack","useViewportMatch","BlockEditorProvider","useCallback","editorStore","preferencesStore","SidebarNavigationScreen","StyleVariationsContainer","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","ColorVariations","TypographyVariations","useColorVariations","useTypographyVariations","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","noop","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","setCanvasMode","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","params","path","uid","onClick","SidebarNavigationScreenGlobalStylesContent","storedSettings","getSettings","colorVariations","typographyVariations","gap","settings","onChange","onInput","children","spacing","className","title","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","openGlobalStyles","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","description","content","footer","record","actions","icon","label","isPressed","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\nimport { useCallback } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport ColorVariations from '../global-styles/variations/variations-color';\nimport TypographyVariations from '../global-styles/variations/variations-typography';\nimport {\n\tuseColorVariations,\n\tuseTypographyVariations,\n} from '../global-styles/hooks';\n\nconst noop = () => {};\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// Switch to edit mode.\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t// Open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings(),\n\t\t};\n\t}, [] );\n\n\tconst colorVariations = useColorVariations();\n\tconst typographyVariations = useTypographyVariations();\n\tconst gap = 3;\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<VStack\n\t\t\t\tspacing={ 10 }\n\t\t\t\tclassName=\"edit-site-global-styles-variation-container\"\n\t\t\t>\n\t\t\t\t<StyleVariationsContainer gap={ gap } />\n\t\t\t\t{ colorVariations?.length && (\n\t\t\t\t\t<ColorVariations title={ __( 'Palettes' ) } gap={ gap } />\n\t\t\t\t) }\n\t\t\t\t{ typographyVariations?.length && (\n\t\t\t\t\t<TypographyVariations\n\t\t\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\t\t\tgap={ gap }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</BlockEditorProvider>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles( { backPath } ) {\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isViewMode, isStyleBookOpened, revisionsCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCanvasMode, getEditorCanvasContainerView } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn {\n\t\t\t\tisViewMode: 'view' === getCanvasMode(),\n\t\t\t\tisStyleBookOpened:\n\t\t\t\t\t'style-book' === getEditorCanvasContainerView(),\n\t\t\t\trevisionsCount:\n\t\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ??\n\t\t\t\t\t0,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\tsetCanvasMode( 'edit' ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ setCanvasMode, openGeneralSidebar, setPreference ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\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\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isStyleBookOpened && ! isMobileViewport && isViewMode && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASN,KAAK,IAAIO,WAAW,QAAQ,mBAAmB;AACxD,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,wBAAwB,MAAM,6CAA6C;AAClF,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASX,KAAK,IAAIY,aAAa,QAAQ,aAAa;AACpD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,wBAAwB,MAAM,+D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AA,KACTqB,4BAA4B,CAC3B,CAAEE,iBAAiB,GAChB,YAAY,GACZS,SACJ,CACA;UACDqB,SAAS,EAAG9B;QAAmB,CAC/B,CACD,eACDxC,IAAA,CAACV,aAAa;UACb8E,IAAI,EAAG/F,IAAM;UACbgG,KAAK,EAAGjG,EAAE,CAAE,aAAc,CAAG;UAC7B6C,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAMqC,gBAAgB,CAAC;QAAG,CAChD,CAAC;MAAA,CACD;IACF,CACD,CAAC,EACAd,iBAAiB,IAAI,CAAEH,gBAAgB,IAAIE,UAAU,iBACtDvC,IAAA,CAACR,SAAS;MACT+E,cAAc,EAAG,KAAO;MACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;MAC1BvD,OAAO,EAAGwC,aAAe;MACzBgB,QAAQ,EAAGhB,aAAe;MAC1BiB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","edit","seen","useSelect","useDispatch","store","coreStore","useViewportMatch","useCallback","editorStore","preferencesStore","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenGlobalStylesContent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","setCanvasMode","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","params","path","uid","onClick","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","openGlobalStyles","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","children","title","description","content","footer","record","actions","icon","label","isPressed","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport SidebarNavigationScreenGlobalStylesContent from './content';\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// Switch to edit mode.\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t// Open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles( { backPath } ) {\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isViewMode, isStyleBookOpened, revisionsCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCanvasMode, getEditorCanvasContainerView } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn {\n\t\t\t\tisViewMode: 'view' === getCanvasMode(),\n\t\t\t\tisStyleBookOpened:\n\t\t\t\t\t'style-book' === getEditorCanvasContainerView(),\n\t\t\t\trevisionsCount:\n\t\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ??\n\t\t\t\t\t0,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\tsetCanvasMode( 'edit' ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ setCanvasMode, openGeneralSidebar, setPreference ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\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\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isStyleBookOpened && ! isMobileViewport && isViewMode && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASH,KAAK,IAAII,WAAW,QAAQ,mBAAmB;AACxD,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8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AAC,CAAI;QAC3BH,OAAO,EAAG4B;MAAe,CACzB,CAEF;MACDW,OAAO,eACNnD,KAAA,CAAAF,SAAA;QAAA+C,QAAA,GACG,CAAE1B,gBAAgB,iBACnBvB,IAAA,CAACP,aAAa;UACb+D,IAAI,EAAG3E,IAAM;UACb4E,KAAK,EAAG9E,EAAE,CAAE,YAAa,CAAG;UAC5BqC,OAAO,EAAGA,CAAA,KACTQ,4BAA4B,CAC3B,CAAEE,iBAAiB,GAChB,YAAY,GACZS,SACJ,CACA;UACDuB,SAAS,EAAGhC;QAAmB,CAC/B,CACD,eACD1B,IAAA,CAACP,aAAa;UACb+D,IAAI,EAAG5E,IAAM;UACb6E,KAAK,EAAG9E,EAAE,CAAE,aAAc,CAAG;UAC7BqC,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAMwB,gBAAgB,CAAC;QAAG,CAChD,CAAC;MAAA,CACD;IACF,CACD,CAAC,EACAd,iBAAiB,IAAI,CAAEH,gBAAgB,IAAIE,UAAU,iBACtDzB,IAAA,CAACL,SAAS;MACTgE,cAAc,EAAG,KAAO;MACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;MAC1B5C,OAAO,EAAG2B,aAAe;MACzBkB,QAAQ,EAAGlB,aAAe;MAC1BmB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -29,7 +29,8 @@ export default function RenameModal({
29
29
  __next40pxDefaultSize: true,
30
30
  value: editedMenuTitle,
31
31
  placeholder: __('Navigation title'),
32
- onChange: setEditedMenuTitle
32
+ onChange: setEditedMenuTitle,
33
+ label: __('Name')
33
34
  }), /*#__PURE__*/_jsxs(HStack, {
34
35
  justify: "right",
35
36
  children: [/*#__PURE__*/_jsx(Button, {
@@ -39,7 +40,7 @@ export default function RenameModal({
39
40
  children: __('Cancel')
40
41
  }), /*#__PURE__*/_jsx(Button, {
41
42
  __next40pxDefaultSize: true,
42
- __experimentalIsFocusable: true,
43
+ accessibleWhenDisabled: true,
43
44
  disabled: !isEditedMenuTitleValid,
44
45
  variant: "primary",
45
46
  type: "submit",