@wordpress/edit-site 5.26.0 → 5.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/actions/index.js +139 -36
  3. package/build/components/actions/index.js.map +1 -1
  4. package/build/components/editor-canvas-container/index.js +1 -1
  5. package/build/components/editor-canvas-container/index.js.map +1 -1
  6. package/build/components/global-styles/font-families.js +3 -2
  7. package/build/components/global-styles/font-families.js.map +1 -1
  8. package/build/components/global-styles/font-family-item.js +3 -4
  9. package/build/components/global-styles/font-family-item.js.map +1 -1
  10. package/build/components/global-styles/font-library-modal/context.js +80 -41
  11. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  12. package/build/components/global-styles/font-library-modal/font-collection.js +49 -22
  13. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  14. package/build/components/global-styles/font-library-modal/fonts-grid.js +4 -1
  15. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/index.js +4 -4
  17. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/installed-fonts.js +16 -8
  19. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/library-font-card.js +1 -1
  21. package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  23. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/local-fonts.js +13 -4
  25. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/resolvers.js +49 -20
  27. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +17 -2
  29. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/utils/index.js +103 -17
  31. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +4 -3
  33. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  34. package/build/components/global-styles/screen-typography.js +4 -1
  35. package/build/components/global-styles/screen-typography.js.map +1 -1
  36. package/build/components/layout/hooks.js +6 -5
  37. package/build/components/layout/hooks.js.map +1 -1
  38. package/build/components/layout/index.js +19 -28
  39. package/build/components/layout/index.js.map +1 -1
  40. package/build/components/layout/router.js +135 -0
  41. package/build/components/layout/router.js.map +1 -0
  42. package/build/components/page-pages/index.js +92 -69
  43. package/build/components/page-pages/index.js.map +1 -1
  44. package/build/components/page-patterns/dataviews-pattern-actions.js +11 -6
  45. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  46. package/build/components/page-patterns/index.js +295 -15
  47. package/build/components/page-patterns/index.js.map +1 -1
  48. package/build/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +51 -23
  49. package/build/components/page-templates-template-parts/actions.js.map +1 -0
  50. package/build/components/page-templates-template-parts/add-new-template-part.js.map +1 -0
  51. package/build/components/page-templates-template-parts/index.js +395 -0
  52. package/build/components/page-templates-template-parts/index.js.map +1 -0
  53. package/build/components/preferences-modal/index.js +9 -134
  54. package/build/components/preferences-modal/index.js.map +1 -1
  55. package/build/components/revisions/index.js +1 -1
  56. package/build/components/revisions/index.js.map +1 -1
  57. package/build/components/save-button/index.js +4 -2
  58. package/build/components/save-button/index.js.map +1 -1
  59. package/build/components/save-panel/index.js +6 -5
  60. package/build/components/save-panel/index.js.map +1 -1
  61. package/build/components/sidebar/index.js +3 -1
  62. package/build/components/sidebar/index.js.map +1 -1
  63. package/build/components/sidebar-dataviews/dataview-item.js +3 -1
  64. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  65. package/build/components/sidebar-dataviews/default-views.js +4 -2
  66. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  67. package/build/components/sidebar-dataviews/index.js +2 -2
  68. package/build/components/sidebar-dataviews/index.js.map +1 -1
  69. package/build/components/sidebar-navigation-screen/index.js +8 -7
  70. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  71. package/build/components/sidebar-navigation-screen-pages/index.js +2 -10
  72. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  73. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +26 -3
  74. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -1
  75. package/build/components/sidebar-navigation-screen-templates/index.js +63 -8
  76. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  77. package/build/components/sidebar-navigation-screen-templates-browse/content.js +76 -0
  78. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -0
  79. package/build/components/sidebar-navigation-screen-templates-browse/index.js +9 -2
  80. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  81. package/build/components/site-hub/index.js +3 -1
  82. package/build/components/site-hub/index.js.map +1 -1
  83. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +47 -12
  84. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  85. package/build/components/sync-state-with-url/use-sync-path-with-url.js +25 -2
  86. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  87. package/build/hooks/commands/use-edit-mode-commands.js +33 -5
  88. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  89. package/build/hooks/push-changes-to-global-styles/index.js +13 -6
  90. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  91. package/build/hooks/template-part-edit.js +7 -6
  92. package/build/hooks/template-part-edit.js.map +1 -1
  93. package/build/index.js +1 -1
  94. package/build/index.js.map +1 -1
  95. package/build/store/actions.js +11 -29
  96. package/build/store/actions.js.map +1 -1
  97. package/build/store/private-actions.js +85 -1
  98. package/build/store/private-actions.js.map +1 -1
  99. package/build/store/selectors.js +2 -2
  100. package/build/store/selectors.js.map +1 -1
  101. package/build/utils/get-is-list-page.js +1 -1
  102. package/build/utils/get-is-list-page.js.map +1 -1
  103. package/build/utils/use-actual-current-theme.js +32 -0
  104. package/build/utils/use-actual-current-theme.js.map +1 -0
  105. package/build-module/components/actions/index.js +139 -36
  106. package/build-module/components/actions/index.js.map +1 -1
  107. package/build-module/components/editor-canvas-container/index.js +1 -1
  108. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  109. package/build-module/components/global-styles/font-families.js +3 -2
  110. package/build-module/components/global-styles/font-families.js.map +1 -1
  111. package/build-module/components/global-styles/font-family-item.js +4 -5
  112. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  113. package/build-module/components/global-styles/font-library-modal/context.js +82 -42
  114. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  115. package/build-module/components/global-styles/font-library-modal/font-collection.js +49 -22
  116. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  117. package/build-module/components/global-styles/font-library-modal/fonts-grid.js +4 -1
  118. package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
  119. package/build-module/components/global-styles/font-library-modal/index.js +4 -4
  120. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  121. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +16 -8
  122. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  123. package/build-module/components/global-styles/font-library-modal/library-font-card.js +1 -1
  124. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  125. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +2 -2
  126. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  127. package/build-module/components/global-styles/font-library-modal/local-fonts.js +13 -4
  128. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  129. package/build-module/components/global-styles/font-library-modal/resolvers.js +45 -18
  130. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  131. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +17 -2
  132. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  133. package/build-module/components/global-styles/font-library-modal/utils/index.js +99 -16
  134. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  135. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +4 -3
  136. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  137. package/build-module/components/global-styles/screen-typography.js +4 -1
  138. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  139. package/build-module/components/layout/hooks.js +6 -5
  140. package/build-module/components/layout/hooks.js.map +1 -1
  141. package/build-module/components/layout/index.js +19 -28
  142. package/build-module/components/layout/index.js.map +1 -1
  143. package/build-module/components/layout/router.js +127 -0
  144. package/build-module/components/layout/router.js.map +1 -0
  145. package/build-module/components/page-pages/index.js +91 -70
  146. package/build-module/components/page-pages/index.js.map +1 -1
  147. package/build-module/components/page-patterns/dataviews-pattern-actions.js +11 -6
  148. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  149. package/build-module/components/page-patterns/index.js +296 -16
  150. package/build-module/components/page-patterns/index.js.map +1 -1
  151. package/build-module/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +52 -24
  152. package/build-module/components/page-templates-template-parts/actions.js.map +1 -0
  153. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +1 -0
  154. package/build-module/components/page-templates-template-parts/index.js +385 -0
  155. package/build-module/components/page-templates-template-parts/index.js.map +1 -0
  156. package/build-module/components/preferences-modal/index.js +12 -136
  157. package/build-module/components/preferences-modal/index.js.map +1 -1
  158. package/build-module/components/revisions/index.js +1 -1
  159. package/build-module/components/revisions/index.js.map +1 -1
  160. package/build-module/components/save-button/index.js +4 -2
  161. package/build-module/components/save-button/index.js.map +1 -1
  162. package/build-module/components/save-panel/index.js +7 -6
  163. package/build-module/components/save-panel/index.js.map +1 -1
  164. package/build-module/components/sidebar/index.js +3 -1
  165. package/build-module/components/sidebar/index.js.map +1 -1
  166. package/build-module/components/sidebar-dataviews/dataview-item.js +3 -1
  167. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  168. package/build-module/components/sidebar-dataviews/default-views.js +4 -2
  169. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  170. package/build-module/components/sidebar-dataviews/index.js +2 -2
  171. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  172. package/build-module/components/sidebar-navigation-screen/index.js +8 -7
  173. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  174. package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -10
  175. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  176. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +27 -4
  177. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -1
  178. package/build-module/components/sidebar-navigation-screen-templates/index.js +64 -9
  179. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  180. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +68 -0
  181. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -0
  182. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +9 -2
  183. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  184. package/build-module/components/site-hub/index.js +3 -1
  185. package/build-module/components/site-hub/index.js.map +1 -1
  186. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +47 -11
  187. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  188. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +25 -2
  189. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  190. package/build-module/hooks/commands/use-edit-mode-commands.js +33 -5
  191. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  192. package/build-module/hooks/push-changes-to-global-styles/index.js +13 -6
  193. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  194. package/build-module/hooks/template-part-edit.js +7 -6
  195. package/build-module/hooks/template-part-edit.js.map +1 -1
  196. package/build-module/index.js +1 -1
  197. package/build-module/index.js.map +1 -1
  198. package/build-module/store/actions.js +13 -30
  199. package/build-module/store/actions.js.map +1 -1
  200. package/build-module/store/private-actions.js +83 -0
  201. package/build-module/store/private-actions.js.map +1 -1
  202. package/build-module/store/selectors.js +2 -2
  203. package/build-module/store/selectors.js.map +1 -1
  204. package/build-module/utils/get-is-list-page.js +1 -1
  205. package/build-module/utils/get-is-list-page.js.map +1 -1
  206. package/build-module/utils/use-actual-current-theme.js +24 -0
  207. package/build-module/utils/use-actual-current-theme.js.map +1 -0
  208. package/build-style/style-rtl.css +302 -188
  209. package/build-style/style.css +302 -188
  210. package/package.json +42 -42
  211. package/src/components/actions/index.js +236 -84
  212. package/src/components/editor-canvas-container/index.js +1 -1
  213. package/src/components/global-styles/font-families.js +14 -8
  214. package/src/components/global-styles/font-family-item.js +7 -4
  215. package/src/components/global-styles/font-library-modal/context.js +156 -50
  216. package/src/components/global-styles/font-library-modal/font-collection.js +56 -21
  217. package/src/components/global-styles/font-library-modal/fonts-grid.js +6 -2
  218. package/src/components/global-styles/font-library-modal/index.js +4 -4
  219. package/src/components/global-styles/font-library-modal/installed-fonts.js +18 -8
  220. package/src/components/global-styles/font-library-modal/library-font-card.js +2 -1
  221. package/src/components/global-styles/font-library-modal/library-font-variant.js +10 -9
  222. package/src/components/global-styles/font-library-modal/local-fonts.js +14 -4
  223. package/src/components/global-styles/font-library-modal/resolvers.js +50 -17
  224. package/src/components/global-styles/font-library-modal/style.scss +1 -0
  225. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +19 -2
  226. package/src/components/global-styles/font-library-modal/utils/index.js +136 -29
  227. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +7 -3
  228. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +40 -10
  229. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +5 -5
  230. package/src/components/global-styles/screen-typography.js +9 -3
  231. package/src/components/global-styles/style.scss +4 -0
  232. package/src/components/header-edit-mode/style.scss +15 -5
  233. package/src/components/layout/hooks.js +6 -5
  234. package/src/components/layout/index.js +80 -96
  235. package/src/components/layout/router.js +121 -0
  236. package/src/components/layout/style.scss +13 -16
  237. package/src/components/page/style.scss +1 -8
  238. package/src/components/page-pages/index.js +142 -148
  239. package/src/components/page-pages/style.scss +41 -2
  240. package/src/components/page-patterns/dataviews-pattern-actions.js +11 -6
  241. package/src/components/page-patterns/index.js +392 -14
  242. package/src/components/page-patterns/style.scss +36 -2
  243. package/src/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +90 -37
  244. package/src/components/{page-templates → page-templates-template-parts}/index.js +198 -169
  245. package/src/components/page-templates-template-parts/style.scss +44 -0
  246. package/src/components/preferences-modal/index.js +8 -211
  247. package/src/components/revisions/index.js +1 -1
  248. package/src/components/save-button/index.js +7 -4
  249. package/src/components/save-panel/index.js +13 -12
  250. package/src/components/sidebar/index.js +4 -5
  251. package/src/components/sidebar-dataviews/dataview-item.js +2 -1
  252. package/src/components/sidebar-dataviews/default-views.js +4 -2
  253. package/src/components/sidebar-dataviews/index.js +8 -6
  254. package/src/components/sidebar-navigation-item/style.scss +1 -1
  255. package/src/components/sidebar-navigation-screen/index.js +19 -10
  256. package/src/components/sidebar-navigation-screen-pages/index.js +2 -10
  257. package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +32 -6
  258. package/src/components/sidebar-navigation-screen-templates/index.js +85 -28
  259. package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
  260. package/src/components/sidebar-navigation-screen-templates-browse/content.js +73 -0
  261. package/src/components/sidebar-navigation-screen-templates-browse/index.js +10 -1
  262. package/src/components/site-hub/index.js +4 -1
  263. package/src/components/site-hub/style.scss +1 -12
  264. package/src/components/site-icon/style.scss +1 -1
  265. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +40 -10
  266. package/src/components/sync-state-with-url/use-sync-path-with-url.js +32 -0
  267. package/src/hooks/commands/use-edit-mode-commands.js +50 -3
  268. package/src/hooks/push-changes-to-global-styles/index.js +29 -23
  269. package/src/hooks/template-part-edit.js +12 -12
  270. package/src/index.js +1 -1
  271. package/src/store/actions.js +17 -51
  272. package/src/store/private-actions.js +133 -0
  273. package/src/store/selectors.js +2 -4
  274. package/src/style.scss +2 -1
  275. package/src/utils/get-is-list-page.js +3 -2
  276. package/src/utils/use-actual-current-theme.js +27 -0
  277. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -58
  278. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +0 -1
  279. package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -71
  280. package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +0 -1
  281. package/build/components/page-main/index.js +0 -44
  282. package/build/components/page-main/index.js.map +0 -1
  283. package/build/components/page-patterns/dataviews-patterns.js +0 -307
  284. package/build/components/page-patterns/dataviews-patterns.js.map +0 -1
  285. package/build/components/page-template-parts/add-new-template-part.js.map +0 -1
  286. package/build/components/page-template-parts/index.js +0 -81
  287. package/build/components/page-template-parts/index.js.map +0 -1
  288. package/build/components/page-templates/index.js +0 -352
  289. package/build/components/page-templates/index.js.map +0 -1
  290. package/build/components/page-templates/template-actions.js.map +0 -1
  291. package/build/components/post-preview/index.js +0 -29
  292. package/build/components/post-preview/index.js.map +0 -1
  293. package/build/components/preferences-modal/enable-feature.js +0 -36
  294. package/build/components/preferences-modal/enable-feature.js.map +0 -1
  295. package/build/components/preferences-modal/enable-panel-option.js +0 -33
  296. package/build/components/preferences-modal/enable-panel-option.js.map +0 -1
  297. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -52
  298. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +0 -1
  299. package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -63
  300. package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +0 -1
  301. package/build-module/components/page-main/index.js +0 -36
  302. package/build-module/components/page-main/index.js.map +0 -1
  303. package/build-module/components/page-patterns/dataviews-patterns.js +0 -299
  304. package/build-module/components/page-patterns/dataviews-patterns.js.map +0 -1
  305. package/build-module/components/page-template-parts/add-new-template-part.js.map +0 -1
  306. package/build-module/components/page-template-parts/index.js +0 -73
  307. package/build-module/components/page-template-parts/index.js.map +0 -1
  308. package/build-module/components/page-templates/index.js +0 -344
  309. package/build-module/components/page-templates/index.js.map +0 -1
  310. package/build-module/components/page-templates/template-actions.js.map +0 -1
  311. package/build-module/components/post-preview/index.js +0 -21
  312. package/build-module/components/post-preview/index.js.map +0 -1
  313. package/build-module/components/preferences-modal/enable-feature.js +0 -29
  314. package/build-module/components/preferences-modal/enable-feature.js.map +0 -1
  315. package/build-module/components/preferences-modal/enable-panel-option.js +0 -26
  316. package/build-module/components/preferences-modal/enable-panel-option.js.map +0 -1
  317. package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -58
  318. package/src/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -62
  319. package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +0 -271
  320. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +0 -58
  321. package/src/components/page-main/index.js +0 -38
  322. package/src/components/page-patterns/dataviews-patterns.js +0 -380
  323. package/src/components/page-template-parts/index.js +0 -99
  324. package/src/components/page-templates/style.scss +0 -13
  325. package/src/components/post-preview/index.js +0 -16
  326. package/src/components/preferences-modal/enable-feature.js +0 -31
  327. package/src/components/preferences-modal/enable-panel-option.js +0 -23
  328. /package/build/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
  329. /package/build-module/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
  330. /package/src/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
@@ -1,154 +1,30 @@
1
- import { createElement, Fragment } from "react";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { PreferencesModal, PreferencesModalTabs, PreferencesModalSection, store as interfaceStore } from '@wordpress/interface';
6
- import { __ } from '@wordpress/i18n';
7
- import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
8
- import { store as preferencesStore } from '@wordpress/preferences';
9
- import { PostTaxonomies, PostExcerptCheck, PageAttributesCheck, PostFeaturedImageCheck, PostTypeSupportCheck, store as editorStore } from '@wordpress/editor';
5
+ import { store as interfaceStore } from '@wordpress/interface';
6
+ import { useSelect, useDispatch } from '@wordpress/data';
7
+ import { privateApis as editorPrivateApis } from '@wordpress/editor';
10
8
 
11
9
  /**
12
10
  * Internal dependencies
13
11
  */
14
- import EnableFeature from './enable-feature';
15
- import EnablePanelOption from './enable-panel-option';
16
- import { store as editSiteStore } from '../../store';
12
+ import { unlock } from '../../lock-unlock';
13
+ const {
14
+ PreferencesModal
15
+ } = unlock(editorPrivateApis);
17
16
  export const PREFERENCES_MODAL_NAME = 'edit-site/preferences';
18
17
  export default function EditSitePreferencesModal() {
19
18
  const isModalActive = useSelect(select => select(interfaceStore).isModalActive(PREFERENCES_MODAL_NAME));
20
19
  const {
21
- closeModal,
22
- openModal
20
+ closeModal
23
21
  } = useDispatch(interfaceStore);
24
- const toggleModal = () => isModalActive ? closeModal() : openModal(PREFERENCES_MODAL_NAME);
25
- const registry = useRegistry();
26
- const {
27
- closeGeneralSidebar
28
- } = useDispatch(editSiteStore);
29
- const {
30
- setIsListViewOpened,
31
- setIsInserterOpened
32
- } = useDispatch(editorStore);
33
- const {
34
- set: setPreference
35
- } = useDispatch(preferencesStore);
36
- const toggleDistractionFree = () => {
37
- registry.batch(() => {
38
- setPreference('core', 'fixedToolbar', true);
39
- setIsInserterOpened(false);
40
- setIsListViewOpened(false);
41
- closeGeneralSidebar();
42
- });
43
- };
44
- const turnOffDistractionFree = () => {
45
- setPreference('core', 'distractionFree', false);
46
- };
47
- const sections = [{
48
- name: 'general',
49
- tabLabel: __('General'),
50
- content: createElement(Fragment, null, createElement(PreferencesModalSection, {
51
- title: __('Interface')
52
- }, createElement(EnableFeature, {
53
- scope: "core",
54
- featureName: "showListViewByDefault",
55
- help: __('Opens the block list view sidebar by default.'),
56
- label: __('Always open list view')
57
- }), createElement(EnableFeature, {
58
- scope: "core",
59
- featureName: "showBlockBreadcrumbs",
60
- help: __('Shows block breadcrumbs at the bottom of the editor.'),
61
- label: __('Display block breadcrumbs')
62
- }), createElement(EnableFeature, {
63
- scope: "core",
64
- featureName: "allowRightClickOverrides",
65
- help: __('Allows contextual list view menus via right-click, overriding browser defaults.'),
66
- label: __('Allow right-click contextual menus')
67
- })), createElement(PreferencesModalSection, {
68
- title: __('Document settings'),
69
- description: __('Select what settings are shown in the document panel.')
70
- }, createElement(PostTaxonomies, {
71
- taxonomyWrapper: (content, taxonomy) => createElement(EnablePanelOption, {
72
- label: taxonomy.labels.menu_name,
73
- panelName: `taxonomy-panel-${taxonomy.slug}`
74
- })
75
- }), createElement(PostFeaturedImageCheck, null, createElement(EnablePanelOption, {
76
- label: __('Featured image'),
77
- panelName: "featured-image"
78
- })), createElement(PostExcerptCheck, null, createElement(EnablePanelOption, {
79
- label: __('Excerpt'),
80
- panelName: "post-excerpt"
81
- })), createElement(PostTypeSupportCheck, {
82
- supportKeys: ['comments', 'trackbacks']
83
- }, createElement(EnablePanelOption, {
84
- label: __('Discussion'),
85
- panelName: "discussion-panel"
86
- })), createElement(PageAttributesCheck, null, createElement(EnablePanelOption, {
87
- label: __('Page attributes'),
88
- panelName: "page-attributes"
89
- }))))
90
- }, {
91
- name: 'appearance',
92
- tabLabel: __('Appearance'),
93
- content: createElement(PreferencesModalSection, {
94
- title: __('Appearance'),
95
- description: __('Customize the editor interface to suit your needs.')
96
- }, createElement(EnableFeature, {
97
- scope: "core",
98
- featureName: "fixedToolbar",
99
- onToggle: turnOffDistractionFree,
100
- help: __('Access all block and document tools in a single place.'),
101
- label: __('Top toolbar')
102
- }), createElement(EnableFeature, {
103
- scope: "core",
104
- featureName: "distractionFree",
105
- onToggle: toggleDistractionFree,
106
- help: __('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
107
- label: __('Distraction free')
108
- }), createElement(EnableFeature, {
109
- scope: "core",
110
- featureName: "focusMode",
111
- help: __('Highlights the current block and fades other content.'),
112
- label: __('Spotlight mode')
113
- }))
114
- }, {
115
- name: 'accessibility',
116
- tabLabel: __('Accessibility'),
117
- content: createElement(Fragment, null, createElement(PreferencesModalSection, {
118
- title: __('Navigation'),
119
- description: __('Optimize the editing experience for enhanced control.')
120
- }, createElement(EnableFeature, {
121
- scope: "core",
122
- featureName: "keepCaretInsideBlock",
123
- help: __('Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'),
124
- label: __('Contain text cursor inside block')
125
- })), createElement(PreferencesModalSection, {
126
- title: __('Interface')
127
- }, createElement(EnableFeature, {
128
- scope: "core",
129
- featureName: "showIconLabels",
130
- label: __('Show button text labels'),
131
- help: __('Show text instead of icons on buttons across the interface.')
132
- })))
133
- }, {
134
- name: 'blocks',
135
- tabLabel: __('Blocks'),
136
- content: createElement(Fragment, null, createElement(PreferencesModalSection, {
137
- title: __('Inserter')
138
- }, createElement(EnableFeature, {
139
- scope: "core",
140
- featureName: "mostUsedBlocks",
141
- help: __('Adds a category with the most frequently used blocks in the inserter.'),
142
- label: __('Show most used blocks')
143
- })))
144
- }];
145
22
  if (!isModalActive) {
146
23
  return null;
147
24
  }
148
25
  return createElement(PreferencesModal, {
149
- closeModal: toggleModal
150
- }, createElement(PreferencesModalTabs, {
151
- sections: sections
152
- }));
26
+ isActive: isModalActive,
27
+ onClose: closeModal
28
+ });
153
29
  }
154
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PreferencesModal","PreferencesModalTabs","PreferencesModalSection","store","interfaceStore","__","useSelect","useDispatch","useRegistry","preferencesStore","PostTaxonomies","PostExcerptCheck","PageAttributesCheck","PostFeaturedImageCheck","PostTypeSupportCheck","editorStore","EnableFeature","EnablePanelOption","editSiteStore","PREFERENCES_MODAL_NAME","EditSitePreferencesModal","isModalActive","select","closeModal","openModal","toggleModal","registry","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","batch","turnOffDistractionFree","sections","name","tabLabel","content","createElement","Fragment","title","scope","featureName","help","label","description","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","onToggle"],"sources":["@wordpress/edit-site/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport EnableFeature from './enable-feature';\nimport EnablePanelOption from './enable-panel-option';\nimport { store as editSiteStore } from '../../store';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-site/preferences';\n\nexport default function EditSitePreferencesModal() {\n\tconst isModalActive = useSelect( ( select ) =>\n\t\tselect( interfaceStore ).isModalActive( PREFERENCES_MODAL_NAME )\n\t);\n\tconst { closeModal, openModal } = useDispatch( interfaceStore );\n\tconst toggleModal = () =>\n\t\tisModalActive ? closeModal() : openModal( PREFERENCES_MODAL_NAME );\n\tconst registry = useRegistry();\n\tconst { closeGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst toggleDistractionFree = () => {\n\t\tregistry.batch( () => {\n\t\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t\tcloseGeneralSidebar();\n\t\t} );\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst sections = [\n\t\t{\n\t\t\tname: 'general',\n\t\t\ttabLabel: __( 'General' ),\n\t\t\tcontent: (\n\t\t\t\t<>\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Allows contextual list view menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Allow right-click contextual menus' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: 'appearance',\n\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\tcontent: (\n\t\t\t\t<PreferencesModalSection\n\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t/>\n\t\t\t\t</PreferencesModalSection>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: 'accessibility',\n\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\tcontent: (\n\t\t\t\t<>\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Contain text cursor inside block' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: 'blocks',\n\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\tcontent: (\n\t\t\t\t<>\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t];\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<PreferencesModal closeModal={ toggleModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,gBAAgB,EAChBC,oBAAoB,EACpBC,uBAAuB,EACvBC,KAAK,IAAIC,cAAc,QACjB,sBAAsB;AAC7B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AACrE,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,cAAc,EACdC,gBAAgB,EAChBC,mBAAmB,EACnBC,sBAAsB,EACtBC,oBAAoB,EACpBX,KAAK,IAAIY,WAAW,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASd,KAAK,IAAIe,aAAa,QAAQ,aAAa;AAEpD,OAAO,MAAMC,sBAAsB,GAAG,uBAAuB;AAE7D,eAAe,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,aAAa,GAAGf,SAAS,CAAIgB,MAAM,IACxCA,MAAM,CAAElB,cAAe,CAAC,CAACiB,aAAa,CAAEF,sBAAuB,CAChE,CAAC;EACD,MAAM;IAAEI,UAAU;IAAEC;EAAU,CAAC,GAAGjB,WAAW,CAAEH,cAAe,CAAC;EAC/D,MAAMqB,WAAW,GAAGA,CAAA,KACnBJ,aAAa,GAAGE,UAAU,CAAC,CAAC,GAAGC,SAAS,CAAEL,sBAAuB,CAAC;EACnE,MAAMO,QAAQ,GAAGlB,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEmB;EAAoB,CAAC,GAAGpB,WAAW,CAAEW,aAAc,CAAC;EAC5D,MAAM;IAAEU,mBAAmB;IAAEC;EAAoB,CAAC,GACjDtB,WAAW,CAAEQ,WAAY,CAAC;EAE3B,MAAM;IAAEe,GA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GxC,EAAE,CAAE,yBAA0B,CAAG;MACzCuC,IAAI,EAAGvC,EAAE,CACR,6DACD;IAAG,CACH,CACuB,CACxB;EAEJ,CAAC,EACD;IACC+B,IAAI,EAAE,QAAQ;IACdC,QAAQ,EAAEhC,EAAE,CAAE,QAAS,CAAC;IACxBiC,OAAO,EACNC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACrC,uBAAuB;MAACuC,KAAK,EAAGpC,EAAE,CAAE,UAAW;IAAG,GAClDkC,aAAA,CAACvB,aAAa;MACb0B,KAAK,EAAC,MAAM;MACZC,WAAW,EAAC,gBAAgB;MAC5BC,IAAI,EAAGvC,EAAE,CACR,uEACD,CAAG;MACHwC,KAAK,EAAGxC,EAAE,CAAE,uBAAwB;IAAG,CACvC,CACuB,CACxB;EAEJ,CAAC,CACD;EACD,IAAK,CAAEgB,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EACA,OACCkB,aAAA,CAACvC,gBAAgB;IAACuB,UAAU,EAAGE;EAAa,GAC3Cc,aAAA,CAACtC,oBAAoB;IAACkC,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
1
+ {"version":3,"names":["store","interfaceStore","useSelect","useDispatch","privateApis","editorPrivateApis","unlock","PreferencesModal","PREFERENCES_MODAL_NAME","EditSitePreferencesModal","isModalActive","select","closeModal","createElement","isActive","onClose"],"sources":["@wordpress/edit-site/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferencesModal } = unlock( editorPrivateApis );\n\nexport const PREFERENCES_MODAL_NAME = 'edit-site/preferences';\n\nexport default function EditSitePreferencesModal() {\n\tconst isModalActive = useSelect( ( select ) =>\n\t\tselect( interfaceStore ).isModalActive( PREFERENCES_MODAL_NAME )\n\t);\n\tconst { closeModal } = useDispatch( interfaceStore );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<PreferencesModal isActive={ isModalActive } onClose={ closeModal } />\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,cAAc,QAAQ,sBAAsB;AAC9D,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAiB,CAAC,GAAGD,MAAM,CAAED,iBAAkB,CAAC;AAExD,OAAO,MAAMG,sBAAsB,GAAG,uBAAuB;AAE7D,eAAe,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,aAAa,GAAGR,SAAS,CAAIS,MAAM,IACxCA,MAAM,CAAEV,cAAe,CAAC,CAACS,aAAa,CAAEF,sBAAuB,CAChE,CAAC;EACD,MAAM;IAAEI;EAAW,CAAC,GAAGT,WAAW,CAAEF,cAAe,CAAC;EAEpD,IAAK,CAAES,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EACA,OACCG,aAAA,CAACN,gBAAgB;IAACO,QAAQ,EAAGJ,aAAe;IAACK,OAAO,EAAGH;EAAY,CAAE,CAAC;AAExE"}
@@ -57,7 +57,7 @@ function Revisions({
57
57
  }), createElement("style", null,
58
58
  // Forming a "block formatting context" to prevent margin collapsing.
59
59
  // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
60
- `.is-root-container { display: flow-root; } body { position: relative; padding: 32px; }`), createElement(Disabled, {
60
+ `.is-root-container { display: flow-root; }`), createElement(Disabled, {
61
61
  className: "edit-site-revisions__example-preview__content"
62
62
  }, createElement(ExperimentalBlockEditorProvider, {
63
63
  value: renderedBlocksArray,
@@ -1 +1 @@
1
- {"version":3,"names":["Disabled","__","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","useSelect","useContext","useMemo","unlock","mergeBaseAndUserConfigs","EditorCanvasContainer","ExperimentalBlockEditorProvider","GlobalStylesContext","useGlobalStylesOutputWithConfig","isObjectEmpty","object","Object","keys","length","Revisions","userConfig","blocks","base","baseConfig","mergedConfig","renderedBlocksArray","Array","isArray","originalSettings","select","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles","createElement","title","closeButtonLabel","enableResizing","className","name","tabIndex","value","renderAppender"],"sources":["@wordpress/edit-site/src/components/revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\nimport { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction Revisions( { userConfig, blocks } ) {\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\tenableResizing={ true }\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tclassName=\"edit-site-revisions__iframe\"\n\t\t\t\tname=\"revisions\"\n\t\t\t\ttabIndex={ 0 }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t<style>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; } body { position: relative; padding: 32px; }`\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<Disabled className=\"edit-site-revisions__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t</Disabled>\n\t\t\t</Iframe>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nexport default Revisions;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB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CAAE7B,gBAAiB,CAAC,CAAC8B,WAAW,CAAC,CAAC,EACtD,EACD,CAAC;EACD,MAAMC,QAAQ,GAAGxB,OAAO,CACvB,OAAQ;IAAE,GAAGqB,gBAAgB;IAAEI,uBAAuB,EAAE;EAAK,CAAC,CAAE,EAChE,CAAEJ,gBAAgB,CACnB,CAAC;EAED,MAAM,CAAEK,YAAY,CAAE,GAAGpB,+BAA+B,CAAEW,YAAa,CAAC;EAExE,MAAMU,YAAY,GACjB,CAAEpB,aAAa,CAAEmB,YAAa,CAAC,IAAI,CAAEnB,aAAa,CAAEM,UAAW,CAAC,GAC7Da,YAAY,GACZF,QAAQ,CAACI,MAAM;EAEnB,OACCC,aAAA,CAAC1B,qBAAqB;IACrB2B,KAAK,EAAG1C,EAAE,CAAE,WAAY,CAAG;IAC3B2C,gBAAgB,EAAG3C,EAAE,CAAE,iBAAkB,CAAG;IAC5C4C,cAAc,EAAG;EAAM,GAEvBH,aAAA,CAAChC,MAAM;IACNoC,SAAS,EAAC,6BAA6B;IACvCC,IAAI,EAAC,WAAW;IAChBC,QAAQ,EAAG;EAAG,GAEdN,aAAA,CAAClC,YAAY;IAACiC,MAAM,EAAGD;EAAc,CAAE,CAAC,EACxCE,aAAA;EAEE;EACA;EACC,wFAEI,CAAC,EACRA,aAAA,CAAC1C,QAAQ;IAAC8C,SAAS,EAAC;EAA+C,GAClEJ,aAAA,CAACzB,+BAA+B;IAC/BgC,KAAK,EAAGlB,mBAAqB;IAC7BM,QAAQ,EAAGA;EAAU,GAErBK,aAAA,CAACxC,SAAS;IAACgD,cAAc,EAAG;EAAO,CAAE,CACL,CACxB,CACH,CACc,CAAC;AAE1B;AAEA,eAAezB,SAAS"}
1
+ {"version":3,"names":["Disabled","__","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","useSelect","useContext","useMemo","unlock","mergeBaseAndUserConfigs","EditorCanvasContainer","ExperimentalBlockEditorProvider","GlobalStylesContext","useGlobalStylesOutputWithConfig","isObjectEmpty","object","Object","keys","length","Revisions","userConfig","blocks","base","baseConfig","mergedConfig","renderedBlocksArray","Array","isArray","originalSettings","select","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles","createElement","title","closeButtonLabel","enableResizing","className","name","tabIndex","value","renderAppender"],"sources":["@wordpress/edit-site/src/components/revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\nimport { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction Revisions( { userConfig, blocks } ) {\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\tenableResizing={ true }\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tclassName=\"edit-site-revisions__iframe\"\n\t\t\t\tname=\"revisions\"\n\t\t\t\ttabIndex={ 0 }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t<style>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; }`\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<Disabled className=\"edit-site-revisions__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t</Disabled>\n\t\t\t</Iframe>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nexport default Revisions;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,SAAS,EACTC,WAAW,IAAIC,sBAAsB,EACrCC,KAAK,IAAIC,gBAAgB,EACzBC,sBAAsB,IAAIC,YAAY,EACtCC,gBAAgB,IAAIC,MAAM,QACpB,yBAAyB;AAChC,SAAS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EAAK,CAAC,CAAE,EAChE,CAAEJ,gBAAgB,CACnB,CAAC;EAED,MAAM,CAAEK,YAAY,CAAE,GAAGpB,+BAA+B,CAAEW,YAAa,CAAC;EAExE,MAAMU,YAAY,GACjB,CAAEpB,aAAa,CAAEmB,YAAa,CAAC,IAAI,CAAEnB,aAAa,CAAEM,UAAW,CAAC,GAC7Da,YAAY,GACZF,QAAQ,CAACI,MAAM;EAEnB,OACCC,aAAA,CAAC1B,qBAAqB;IACrB2B,KAAK,EAAG1C,EAAE,CAAE,WAAY,CAAG;IAC3B2C,gBAAgB,EAAG3C,EAAE,CAAE,iBAAkB,CAAG;IAC5C4C,cAAc,EAAG;EAAM,GAEvBH,aAAA,CAAChC,MAAM;IACNoC,SAAS,EAAC,6BAA6B;IACvCC,IAAI,EAAC,WAAW;IAChBC,QAAQ,EAAG;EAAG,GAEdN,aAAA,CAAClC,YAAY;IAACiC,MAAM,EAAGD;EAAc,CAAE,CAAC,EACxCE,aAAA;EAEE;EACA;EACC,4CAEI,CAAC,EACRA,aAAA,CAAC1C,QAAQ;IAAC8C,SAAS,EAAC;EAA+C,GAClEJ,aAAA,CAACzB,+BAA+B;IAC/BgC,KAAK,EAAGlB,mBAAqB;IAC7BM,QAAQ,EAAGA;EAAU,GAErBK,aAAA,CAACxC,SAAS;IAACgD,cAAc,EAAG;EAAO,CAAE,CACL,CACxB,CACH,CACc,CAAC;AAE1B;AAEA,eAAezB,SAAS"}
@@ -37,12 +37,14 @@ export default function SaveButton({
37
37
  isSaveViewOpened
38
38
  } = select(editSiteStore);
39
39
  const isActivatingTheme = isResolving('activateTheme');
40
- const previewingTheme = select(coreStore).getTheme(currentlyPreviewingTheme());
40
+ const currentlyPreviewingThemeId = currentlyPreviewingTheme();
41
41
  return {
42
42
  isDirty: dirtyEntityRecords.length > 0,
43
43
  isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)) || isActivatingTheme,
44
44
  isSaveViewOpen: isSaveViewOpened(),
45
- previewingThemeName: previewingTheme?.name?.rendered
45
+ // Do not call `getTheme` with null, it will cause a request to
46
+ // the server.
47
+ previewingThemeName: currentlyPreviewingThemeId ? select(coreStore).getTheme(currentlyPreviewingThemeId)?.name?.rendered : undefined
46
48
  };
47
49
  }, []);
48
50
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","Button","__","sprintf","store","coreStore","displayShortcut","editSiteStore","currentlyPreviewingTheme","isPreviewingTheme","SaveButton","className","variant","showTooltip","defaultLabel","icon","__next40pxDefaultSize","isDirty","isSaving","isSaveViewOpen","previewingThemeName","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isSaveViewOpened","isActivatingTheme","previewingTheme","getTheme","length","some","record","kind","name","key","rendered","setIsSaveViewOpened","activateSaveEnabled","disabled","getLabel","label","createElement","isBusy","onClick","undefined","shortcut","primary","size"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tdefaultLabel,\n\ticon,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { isDirty, isSaving, isSaveViewOpen, previewingThemeName } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst previewingTheme = select( coreStore ).getTheme(\n\t\t\t\tcurrentlyPreviewingTheme()\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tpreviewingThemeName: previewingTheme?.name?.rendered,\n\t\t\t};\n\t\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( isDirty ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t} else if ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t} else if ( defaultLabel ) {\n\t\t\treturn defaultLabel;\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : () => setIsSaveViewOpened( true ) }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,eAAe,QAAQ,qBAAqB;;AAErD;AACA;AACA;AACA,SAASF,KAAK,IAAIG,aAAa,QAAQ,aAAa;AACpD,SACCC,wBAAwB,EACxBC,iBAAiB,QACX,iCAAiC;AAExC,eAAe,SAASC,UAAUA,CAAE;EACnCC,SAAS,GAAG,+BAA+B;EAC3CC,OAAO,GAAG,SAAS;EACnBC,WAAW,GAAG,IAAI;EAClBC,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AE,CAAE,eAAgB,CAAC,EACrBkB,mBACD,CAAC;MACF,CAAC,MAAM,IAAKmB,QAAQ,EAAG;QACtB,OAAOrC,EAAE,CAAE,OAAQ,CAAC;MACrB,CAAC,MAAM,IAAKe,OAAO,EAAG;QACrB,OAAOd,OAAO,EACb;QACAD,EAAE,CAAE,oBAAqB,CAAC,EAC1BkB,mBACD,CAAC;MACF;MAEA,OAAOjB,OAAO,EACb;MACAD,EAAE,CAAE,aAAc,CAAC,EACnBkB,mBACD,CAAC;IACF;IAEA,IAAKF,QAAQ,EAAG;MACf,OAAOhB,EAAE,CAAE,QAAS,CAAC;IACtB,CAAC,MAAM,IAAKqC,QAAQ,EAAG;MACtB,OAAOrC,EAAE,CAAE,OAAQ,CAAC;IACrB,CAAC,MAAM,IAAKY,YAAY,EAAG;MAC1B,OAAOA,YAAY;IACpB;IACA,OAAOZ,EAAE,CAAE,MAAO,CAAC;EACpB,CAAC;EACD,MAAMuC,KAAK,GAAGD,QAAQ,CAAC,CAAC;EAExB,OACCE,aAAA,CAACzC,MAAM;IACNW,OAAO,EAAGA,OAAS;IACnBD,SAAS,EAAGA,SAAW;IACvB,iBAAgB4B,QAAU;IAC1B,iBAAgBpB,cAAgB;IAChCwB,MAAM,EAAGzB,QAAU;IACnB0B,OAAO,EAAGL,QAAQ,GAAGM,SAAS,GAAG,MAAMR,mBAAmB,CAAE,IAAK,CAAG;IACpEI,KAAK,EAAGA;IACR;AACH;AACA;AACA,OAHG;IAIAK,QAAQ,EAAGP,QAAQ,GAAGM,SAAS,GAAGvC,eAAe,CAACyC,OAAO,CAAE,GAAI;IAC/D;AACH;AACA;AACA;AACA;AACA,OALG;IAMAlC,WAAW,EAAGA,WAAa;IAC3BE,IAAI,EAAGA,IAAM;IACbC,qBAAqB,EAAGA,qBAAuB;IAC/CgC,IAAI,EAAC;EAAS,GAEZP,KACK,CAAC;AAEX"}
1
+ {"version":3,"names":["useSelect","useDispatch","Button","__","sprintf","store","coreStore","displayShortcut","editSiteStore","currentlyPreviewingTheme","isPreviewingTheme","SaveButton","className","variant","showTooltip","defaultLabel","icon","__next40pxDefaultSize","isDirty","isSaving","isSaveViewOpen","previewingThemeName","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","length","some","record","kind","name","key","getTheme","rendered","undefined","setIsSaveViewOpened","activateSaveEnabled","disabled","getLabel","label","createElement","isBusy","onClick","shortcut","primary","size"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tdefaultLabel,\n\ticon,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { isDirty, isSaving, isSaveViewOpen, previewingThemeName } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\n\t\t\treturn {\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( isDirty ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t} else if ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t} else if ( defaultLabel ) {\n\t\t\treturn defaultLabel;\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : () => setIsSaveViewOpened( true ) }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,eAAe,QAAQ,qBAAqB;;AAErD;AACA;AACA;AACA,SAASF,KAAK,IAAIG,aAAa,QAAQ,aAAa;AACpD,SACCC,wBAAwB,EACxBC,iBAAiB,QACX,iCAAiC;AAExC,eAAe,SAASC,UAAUA,CAAE;EACnCC,SAAS,GAAG,+BAA+B;EAC3CC,OAAO,GAAG,SAAS;EACnBC,WAAW,GAAG,IAAI;EAClBC,YAAY;EACZC,IAAI;EACJC,qBAAqB,GAAG;AACzB,CAAC,EAAG;EACH,MAAM;IAAEC,OAAO;IAAEC,QAAQ;IAAEC,cAAc;IAAEC;EAAoB,CAAC,GAC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B,OAAOtC,EAAE,CAAE,OAAQ,CAAC;MACrB,CAAC,MAAM,IAAKe,OAAO,EAAG;QACrB,OAAOd,OAAO,EACb;QACAD,EAAE,CAAE,oBAAqB,CAAC,EAC1BkB,mBACD,CAAC;MACF;MAEA,OAAOjB,OAAO,EACb;MACAD,EAAE,CAAE,aAAc,CAAC,EACnBkB,mBACD,CAAC;IACF;IAEA,IAAKF,QAAQ,EAAG;MACf,OAAOhB,EAAE,CAAE,QAAS,CAAC;IACtB,CAAC,MAAM,IAAKsC,QAAQ,EAAG;MACtB,OAAOtC,EAAE,CAAE,OAAQ,CAAC;IACrB,CAAC,MAAM,IAAKY,YAAY,EAAG;MAC1B,OAAOA,YAAY;IACpB;IACA,OAAOZ,EAAE,CAAE,MAAO,CAAC;EACpB,CAAC;EACD,MAAMwC,KAAK,GAAGD,QAAQ,CAAC,CAAC;EAExB,OACCE,aAAA,CAAC1C,MAAM;IACNW,OAAO,EAAGA,OAAS;IACnBD,SAAS,EAAGA,SAAW;IACvB,iBAAgB6B,QAAU;IAC1B,iBAAgBrB,cAAgB;IAChCyB,MAAM,EAAG1B,QAAU;IACnB2B,OAAO,EAAGL,QAAQ,GAAGH,SAAS,GAAG,MAAMC,mBAAmB,CAAE,IAAK,CAAG;IACpEI,KAAK,EAAGA;IACR;AACH;AACA;AACA,OAHG;IAIAI,QAAQ,EAAGN,QAAQ,GAAGH,SAAS,GAAG/B,eAAe,CAACyC,OAAO,CAAE,GAAI;IAC/D;AACH;AACA;AACA;AACA;AACA,OALG;IAMAlC,WAAW,EAAGA,WAAa;IAC3BE,IAAI,EAAGA,IAAM;IACbC,qBAAqB,EAAGA,qBAAuB;IAC/CgC,IAAI,EAAC;EAAS,GAEZN,KACK,CAAC;AAEX"}
@@ -20,13 +20,15 @@ import { store as coreStore } from '@wordpress/core-data';
20
20
  import { store as editSiteStore } from '../../store';
21
21
  import { unlock } from '../../lock-unlock';
22
22
  import { useActivateTheme } from '../../utils/use-activate-theme';
23
- import { currentlyPreviewingTheme, isPreviewingTheme } from '../../utils/is-previewing-theme';
23
+ import { useActualCurrentTheme } from '../../utils/use-actual-current-theme';
24
+ import { isPreviewingTheme } from '../../utils/is-previewing-theme';
24
25
  const {
25
26
  EntitiesSavedStatesExtensible
26
27
  } = unlock(privateApis);
27
28
  const EntitiesSavedStatesForPreview = ({
28
29
  onClose
29
30
  }) => {
31
+ var _currentTheme$name$re, _previewingTheme$name;
30
32
  const isDirtyProps = useEntitiesSavedStatesIsDirty();
31
33
  let activateSaveLabel;
32
34
  if (isDirtyProps.isDirty) {
@@ -34,11 +36,10 @@ const EntitiesSavedStatesForPreview = ({
34
36
  } else {
35
37
  activateSaveLabel = __('Activate');
36
38
  }
37
- const themeName = useSelect(select => {
38
- const theme = select(coreStore).getTheme(currentlyPreviewingTheme());
39
- return theme?.name?.rendered;
40
- }, []);
41
- const additionalPrompt = createElement("p", null, sprintf('Saving your changes will change your active theme to %s.', themeName));
39
+ const currentTheme = useActualCurrentTheme();
40
+ const previewingTheme = useSelect(select => select(coreStore).getCurrentTheme(), []);
41
+ const additionalPrompt = createElement("p", null, sprintf( /* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */
42
+ __('Saving your changes will change your active theme from %1$s to %2$s.'), (_currentTheme$name$re = currentTheme?.name?.rendered) !== null && _currentTheme$name$re !== void 0 ? _currentTheme$name$re : '...', (_previewingTheme$name = previewingTheme?.name?.rendered) !== null && _previewingTheme$name !== void 0 ? _previewingTheme$name : '...'));
42
43
  const activateTheme = useActivateTheme();
43
44
  const onSave = async values => {
44
45
  await activateTheme();
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","NavigableRegion","store","coreStore","editSiteStore","unlock","useActivateTheme","currentlyPreviewingTheme","isPreviewingTheme","EntitiesSavedStatesExtensible","EntitiesSavedStatesForPreview","onClose","isDirtyProps","activateSaveLabel","isDirty","themeName","select","theme","getTheme","name","rendered","additionalPrompt","createElement","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened","className","onRequestClose","__experimentalHideHeader","contentLabel","ariaLabel","variant","onClick"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst themeName = useSelect( ( select ) => {\n\t\tconst theme = select( coreStore ).getTheme(\n\t\t\tcurrentlyPreviewingTheme()\n\t\t);\n\n\t\treturn theme?.name?.rendered;\n\t}, [] );\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t'Saving your changes will change your active theme to %s.',\n\t\t\t\tthemeName\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn <EntitiesSavedStates close={ onClose } />;\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,KAAK,QAAQ,uBAAuB;AACrD,SACCC,mBAAmB,EACnBC,6BAA6B,EAC7BC,WAAW,QACL,mBAAmB;AAC1B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SACCC,wBAAwB,EACxBC,iBAAiB,QACX,iCAAiC;AAExC,MAAM;EAAEC;AAA8B,CAAC,GAAGJ,MAAM,CAAET,WAAY,CAAC;AAE/D,MAAMc,6BAA6B,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EACxD,MAAMC,YAAY,GAAGjB,6BAA6B,CAAC,CAAC;EACpD,IAAIkB,iBAAiB;EACrB,IAAKD,YAAY,CAACE,OAAO,EAAG;IAC3BD,iBAAiB,GAAGd,EAAE,CAAE,iBAAkB,CAAC;EAC5C,CAAC,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,EAAEE,gBAAgB,CAAC,CAAC;MAClCD,UAAU,EAAEE,aAAa,CAAC;IAC3B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAoB,CAAC,GAAGtC,WAAW,CAAEO,aAAc,CAAC;EAC5D,MAAMO,OAAO,GAAGA,CAAA,KAAMwB,mBAAmB,CAAE,KAAM,CAAC;EAElD,IAAKH,UAAU,KAAK,MAAM,EAAG;IAC5B,OAAOD,cAAc,GACpBT,aAAA,CAAC7B,KAAK;MACL2C,SAAS,EAAC,6BAA6B;MACvCC,cAAc,EAAG1B,OAAS;MAC1B2B,wBAAwB;MACxBC,YAAY,EAAGxC,EAAE,CAChB,0CACD;IAAG,GAEHuB,aAAA,CAACO,oBAAoB;MAAClB,OAAO,EAAGA;IAAS,CAAE,CACrC,CAAC,GACL,IAAI;EACT;EAEA,OACCW,aAAA,CAACrB,eAAe;IACfmC,SAAS,EAAG7C,UAAU,CAAE,2BAA2B,EAAE;MACpD,0BAA0B,EAAEwC;IAC7B,CAAE,CAAG;IACLS,SAAS,EAAGzC,EAAE,CAAE,YAAa;EAAG,GAE9BgC,cAAc,GACfT,aAAA,CAACO,oBAAoB;IAAClB,OAAO,EAAGA;EAAS,CAAE,CAAC,GAE5CW,aAAA;IAAKc,SAAS,EAAC;EAAqC,GACnDd,aAAA,CAAC9B,MAAM;IACNiD,OAAO,EAAC,WAAW;IACnBL,SAAS,EAAC,4CAA4C;IACtDM,OAAO,EAAGA,CAAA,KAAMP,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB;EAAO,GAErBpC,EAAE,CAAE,iBAAkB,CACjB,CACJ,CAEU,CAAC;AAEpB"}
1
+ {"version":3,"names":["classnames","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","NavigableRegion","store","coreStore","editSiteStore","unlock","useActivateTheme","useActualCurrentTheme","isPreviewingTheme","EntitiesSavedStatesExtensible","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","activateSaveLabel","isDirty","currentTheme","previewingTheme","select","getCurrentTheme","additionalPrompt","createElement","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened","className","onRequestClose","__experimentalHideHeader","contentLabel","ariaLabel","variant","onClick"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn <EntitiesSavedStates close={ onClose } />;\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,KAAK,QAAQ,uBAAuB;AACrD,SACCC,mBAAmB,EACnBC,6BAA6B,EAC7BC,WAAW,QACL,mBAAmB;AAC1B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,qBAAqB,QAAQ,sCAAsC;AAC5E,SAASC,iBAAiB,QAAQ,iCAAiC;AAEnE,MAAM;EAAEC;AAA8B,CAAC,GAAGJ,MAAM,CAAET,WAA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AC;EAAqC,GACnDhB,aAAA,CAAC9B,MAAM;IACNmD,OAAO,EAAC,WAAW;IACnBL,SAAS,EAAC,4CAA4C;IACtDM,OAAO,EAAGA,CAAA,KAAMP,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB;EAAO,GAErBtC,EAAE,CAAE,iBAAkB,CACjB,CACJ,CAEU,CAAC;AAEpB"}
@@ -53,7 +53,9 @@ function SidebarScreens() {
53
53
  path: "/wp_global_styles"
54
54
  }, createElement(SidebarNavigationScreenGlobalStyles, null)), createElement(SidebarScreenWrapper, {
55
55
  path: "/page"
56
- }, window?.__experimentalAdminViews ? createElement(SidebarNavigationScreenPagesDataViews, null) : createElement(SidebarNavigationScreenPages, null)), createElement(SidebarScreenWrapper, {
56
+ }, createElement(SidebarNavigationScreenPages, null)), createElement(SidebarScreenWrapper, {
57
+ path: "/pages"
58
+ }, createElement(SidebarNavigationScreenPagesDataViews, null)), createElement(SidebarScreenWrapper, {
57
59
  path: "/page/:postId"
58
60
  }, createElement(SidebarNavigationScreenPage, null)), createElement(SidebarScreenWrapper, {
59
61
  path: "/:postType(wp_template)"
@@ -1 +1 @@
1
- {"version":3,"names":["classNames","memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","SidebarNavigationScreenPatterns","SidebarNavigationScreenPattern","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreenPagesDataViews","SidebarNavigationScreenPage","useLocation","SidebarScreenWrapper","className","props","createElement","SidebarScreens","Fragment","path","window","__experimentalAdminViews","Sidebar","params","urlParams","initialPath","current"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';\nimport SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../lock-unlock';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreenPagesDataViews from '../sidebar-navigation-screen-pages-dataviews';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreenWrapper( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ classNames(\n\t\t\t\t'edit-site-sidebar__screen-wrapper',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarScreenWrapper path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page\">\n\t\t\t\t{ window?.__experimentalAdminViews ? (\n\t\t\t\t\t<SidebarNavigationScreenPagesDataViews />\n\t\t\t\t) : (\n\t\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t\t) }\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/patterns\">\n\t\t\t\t<SidebarNavigationScreenPatterns />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template|wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template_part|wp_block)/:postId\">\n\t\t\t\t<SidebarNavigationScreenPattern />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</SidebarScreenWrapper>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t<SaveHub />\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,IAAI,EAAEC,MAAM,QAAQ,oBAAoB;AACjD,SACCC,+BAA+B,IAAIC,iBAAiB,EACpDC,6BAA6B,IAAIC,eAAe,QAC1C,uBAAuB;AAC9B,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,2BAA2B,MAAM,mCAAmC;AAC3E,OAAOC,gCAAgC,MAAM,wCAAwC;AACrF,OAAOC,+BAA+B,MAAM,uCAAuC;AACnF,OAAOC,+BAA+B,MAAM,uCAAuC;AACnF,OAAOC,8BAA8B,MAAM,sCAAsC;AACjF,OAAOC,kBAAkB,IACxBC,cAAc,QACR,+CAA+C;AACtD,OAAOC,sCAAsC,MAAM,+CAA+C;AAClG,OAAOC,qCAAqC,MAAM,8CAA8C;AAChG,OAAOC,mCAAmC,MAAM,4CAA4C;AAC5F,OAAOC,sCAAsC,MAAM,+CAA+C;AAClG,OAAOC,OAAO,MAAM,aAAa;AACjC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,4BAA4B,MAAM,oCAAoC;AAC7E,OAAOC,qCAAqC,MAAM,8CAA8C;AAChG,OAAOC,2BAA2B,MAAM,mCAAmC;AAE3E,MAAM;EAAEC;AAAY,CAAC,GAAGJ,MAAM,CAAEb,iBAAkB,CAAC;AAEnD,SAASkB,oBAAoBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACxD,OACCC,aAAA,CAACvB,eAAe;IACfq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ACZ,CAAC,EACvBgB,aAAA,CAACH,oBAAoB;IAACM,IAAI,EAAC;EAAiC,GAC3DH,aAAA,CAAClB,+BAA+B,MAAE,CACb,CACrB,CAAC;AAEL;AAEA,SAASwB,OAAOA,CAAA,EAAG;EAClB,MAAM;IAAEC,MAAM,EAAEC;EAAU,CAAC,GAAGZ,WAAW,CAAC,CAAC;EAC3C,MAAMa,WAAW,GAAGpC,MAAM,CAAEa,cAAc,CAAEsB,SAAU,CAAE,CAAC;EAEzD,OACCR,aAAA,CAAAE,QAAA,QACCF,aAAA,CAACzB,iBAAiB;IACjBuB,SAAS,EAAC,4BAA4B;IACtCW,WAAW,EAAGA,WAAW,CAACC;EAAS,GAEnCV,aAAA,CAACC,cAAc,MAAE,CACC,CAAC,EACpBD,aAAA,CAACT,OAAO,MAAE,CACT,CAAC;AAEL;AAEA,eAAenB,IAAI,CAAEkC,OAAQ,CAAC"}
1
+ {"version":3,"names":["classNames","memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","SidebarNavigationScreenPatterns","SidebarNavigationScreenPattern","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreenPagesDataViews","SidebarNavigationScreenPage","useLocation","SidebarScreenWrapper","className","props","createElement","SidebarScreens","Fragment","path","Sidebar","params","urlParams","initialPath","current"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';\nimport SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../lock-unlock';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreenPagesDataViews from '../sidebar-navigation-screen-pages-dataviews';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreenWrapper( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ classNames(\n\t\t\t\t'edit-site-sidebar__screen-wrapper',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarScreenWrapper path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page\">\n\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/pages\">\n\t\t\t\t<SidebarNavigationScreenPagesDataViews />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/patterns\">\n\t\t\t\t<SidebarNavigationScreenPatterns />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template|wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template_part|wp_block)/:postId\">\n\t\t\t\t<SidebarNavigationScreenPattern />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</SidebarScreenWrapper>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</Navigat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,CAAA,EAAG;EAClB,MAAM;IAAEC,MAAM,EAAEC;EAAU,CAAC,GAAGV,WAAW,CAAC,CAAC;EAC3C,MAAMW,WAAW,GAAGlC,MAAM,CAAEa,cAAc,CAAEoB,SAAU,CAAE,CAAC;EAEzD,OACCN,aAAA,CAAAE,QAAA,QACCF,aAAA,CAACzB,iBAAiB;IACjBuB,SAAS,EAAC,4BAA4B;IACtCS,WAAW,EAAGA,WAAW,CAACC;EAAS,GAEnCR,aAAA,CAACC,cAAc,MAAE,CACC,CAAC,EACpBD,aAAA,CAACT,OAAO,MAAE,CACT,CAAC;AAEL;AAEA,eAAenB,IAAI,CAAEgC,OAAQ,CAAC"}
@@ -32,12 +32,14 @@ export default function DataViewItem({
32
32
  }) {
33
33
  const {
34
34
  params: {
35
- path
35
+ path,
36
+ layout
36
37
  }
37
38
  } = useLocation();
38
39
  const iconToUse = icon || VIEW_LAYOUTS.find(v => v.type === type).icon;
39
40
  const linkInfo = useLink({
40
41
  path,
42
+ layout,
41
43
  activeView: isCustom === 'true' ? customViewId : slug,
42
44
  isCustom
43
45
  });
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","privateApis","routerPrivateApis","__experimentalHStack","HStack","VIEW_LAYOUTS","useLink","SidebarNavigationItem","unlock","useLocation","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","params","path","iconToUse","find","v","linkInfo","activeView","createElement","justify","className","undefined"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/dataview-item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\tcustomViewId,\n\ttype,\n\ticon,\n\tisActive,\n\tisCustom,\n\tsuffix,\n} ) {\n\tconst {\n\t\tparams: { path },\n\t} = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tconst linkInfo = useLink( {\n\t\tpath,\n\t\tactiveView: isCustom === 'true' ? customViewId : slug,\n\t\tisCustom,\n\t} );\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-dataviews-dataview-item',\n\t\t\t\t{\n\t\t\t\t\t'is-selected': isActive,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\t{ ...linkInfo }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,YAAY,QAAQ,sBAAsB;;AAEnD;AACA;AACA;AACA,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,MAAM;EAAEC;AAAY,CAAC,GAAGD,MAAM,CAAEN,iBAAkB,CAAC;AAEnD,eAAe,SAASQ,YAAYA,CAAE;EACrCC,KAAK;EACLC,IAAI;EACJC,YAAY;EACZC,IAAI;EACJC,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,MAAM,EAAE;MAAEC;IAAK;EAChB,CAAC,GAAGX,WAAW,CAAC,CAAC;EAEjB,MAAMY,SAAS,GACdN,IAAI,IAAIV,YAAY,CAACiB,IAAI,CAAIC,CAAC,IAAMA,CAAC,CAACT,IAAI,KAAKA,IAAK,CAAC,CAACC,IAAI;EAE3D,MAAMS,QAAQ,GAAGlB,OAAO,CAAE;IACzBc,IAAI;IACJK,UAAU,EAAER,QAAQ,KAAK,MAAM,GAAGJ,YAAY,GAAGD,IAAI;IACrDK;EACD,CAAE,CAAC;EACH,OACCS,aAAA,CAACtB,MAAM;IACNuB,OAAO,EAAC,YAAY;IACpBC,SAAS,EAAG5B,UAAU,CACrB,2CAA2C,EAC3C;MACC,aAAa,EAAEgB;IAChB,CACD;EAAG,GAEHU,aAAA,CAACnB,qBAAqB;IACrBQ,IAAI,EAAGM,SAAW;IAAA,GACbG,QAAQ;IACb,gBAAeR,QAAQ,GAAG,MAAM,GAAGa;EAAW,GAE5ClB,KACoB,CAAC,EACtBO,MACK,CAAC;AAEX"}
1
+ {"version":3,"names":["classnames","privateApis","routerPrivateApis","__experimentalHStack","HStack","VIEW_LAYOUTS","useLink","SidebarNavigationItem","unlock","useLocation","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","params","path","layout","iconToUse","find","v","linkInfo","activeView","createElement","justify","className","undefined"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/dataview-item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\tcustomViewId,\n\ttype,\n\ticon,\n\tisActive,\n\tisCustom,\n\tsuffix,\n} ) {\n\tconst {\n\t\tparams: { path, layout },\n\t} = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tconst linkInfo = useLink( {\n\t\tpath,\n\t\tlayout,\n\t\tactiveView: isCustom === 'true' ? customViewId : slug,\n\t\tisCustom,\n\t} );\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-dataviews-dataview-item',\n\t\t\t\t{\n\t\t\t\t\t'is-selected': isActive,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\t{ ...linkInfo }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,YAAY,QAAQ,sBAAsB;;AAEnD;AACA;AACA;AACA,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,MAAM;EAAEC;AAAY,CAAC,GAAGD,MAAM,CAAEN,iBAAkB,CAAC;AAEnD,eAAe,SAASQ,YAAYA,CAAE;EACrCC,KAAK;EACLC,IAAI;EACJC,YAAY;EACZC,IAAI;EACJC,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,MAAM,EAAE;MAAEC,IAAI;MAAEC;IAAO;EACxB,CAAC,GAAGZ,WAAW,CAAC,CAAC;EAEjB,MAAMa,SAAS,GACdP,IAAI,IAAIV,YAAY,CAACkB,IAAI,CAAIC,CAAC,IAAMA,CAAC,CAACV,IAAI,KAAKA,IAAK,CAAC,CAACC,IAAI;EAE3D,MAAMU,QAAQ,GAAGnB,OAAO,CAAE;IACzBc,IAAI;IACJC,MAAM;IACNK,UAAU,EAAET,QAAQ,KAAK,MAAM,GAAGJ,YAAY,GAAGD,IAAI;IACrDK;EACD,CAAE,CAAC;EACH,OACCU,aAAA,CAACvB,MAAM;IACNwB,OAAO,EAAC,YAAY;IACpBC,SAAS,EAAG7B,UAAU,CACrB,2CAA2C,EAC3C;MACC,aAAa,EAAEgB;IAChB,CACD;EAAG,GAEHW,aAAA,CAACpB,qBAAqB;IACrBQ,IAAI,EAAGO,SAAW;IAAA,GACbG,QAAQ;IACb,gBAAeT,QAAQ,GAAG,MAAM,GAAGc;EAAW,GAE5CnB,KACoB,CAAC,EACtBO,MACK,CAAC;AAEX"}
@@ -9,7 +9,9 @@ import { trash } from '@wordpress/icons';
9
9
  */
10
10
  import { LAYOUT_LIST, LAYOUT_TABLE, LAYOUT_GRID, OPERATOR_IN } from '../../utils/constants';
11
11
  export const DEFAULT_CONFIG_PER_VIEW_TYPE = {
12
- [LAYOUT_TABLE]: {},
12
+ [LAYOUT_TABLE]: {
13
+ primaryField: 'title'
14
+ },
13
15
  [LAYOUT_GRID]: {
14
16
  mediaField: 'featured-image',
15
17
  primaryField: 'title'
@@ -20,7 +22,7 @@ export const DEFAULT_CONFIG_PER_VIEW_TYPE = {
20
22
  }
21
23
  };
22
24
  const DEFAULT_PAGE_BASE = {
23
- type: LAYOUT_LIST,
25
+ type: LAYOUT_TABLE,
24
26
  search: '',
25
27
  filters: [],
26
28
  page: 1,
@@ -1 +1 @@
1
- {"version":3,"names":["__","trash","LAYOUT_LIST","LAYOUT_TABLE","LAYOUT_GRID","OPERATOR_IN","DEFAULT_CONFIG_PER_VIEW_TYPE","mediaField","primaryField","DEFAULT_PAGE_BASE","type","search","filters","page","perPage","sort","field","direction","hiddenFields","layout","DEFAULT_VIEWS","title","slug","view","operator","value","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { trash } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IN,\n} from '../../utils/constants';\n\nexport const DEFAULT_CONFIG_PER_VIEW_TYPE = {\n\t[ LAYOUT_TABLE ]: {},\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' ),\n\t\t\tslug: 'all',\n\t\t\tview: DEFAULT_PAGE_BASE,\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Drafts' ),\n\t\t\tslug: 'drafts',\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{ field: 'status', operator: OPERATOR_IN, value: 'draft' },\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{ field: 'status', operator: OPERATOR_IN, value: 'trash' },\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,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,SACCC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,WAAW,QACL,uBAAuB;AAE9B,OAAO,MAAMC,4BAA4B,GAAG;EAC3C,CAAEH,YAAY,GAAI,CAAC,CAAC;EACpB,CAAEC,WAAW,GAAI;IAChBG,UAAU,EAAE,gBAAgB;IAC5BC,YAAY,EAAE;EACf,CAAC;EACD,CAAEN,WAAW,GAAI;IAChBM,YAAY,EAAE,OAAO;IACrBD,UAAU,EAAE;EACb;AACD,CAAC;AAED,MAAME,iBAAiB,GAAG;EACzBC,IAAI,EAAER,WAAW;EACjBS,MAAM,EAAE,EAAE;EACVC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE;IACLC,KAAK,EAAE,MAAM;IACbC,SAAS,EAAE;EACZ,CAAC;EACD;EACA;EACAC,YAAY,EAAE,CAAE,MAAM,EAAE,gBAAgB,CAAE;EAC1CC,MAAM,EAAE;IACP,GAAGb,4BAA4B,CAAEJ,WAAW;EAC7C;AACD,CAAC;AAED,OAAO,MAAMkB,aAAa,GAAG;EAC5BP,IAAI,EAAE,CACL;IACCQ,KAAK,EAAErB,EAAE,CAAE,KAAM,CAAC;IAClBsB,IAAI,EAAE,KAAK;IACXC,IAAI,EAAEd;EACP,CAAC,EACD;IACCY,KAAK,EAAErB,EAAE,CAAE,QAAS,CAAC;IACrBsB,IAAI,EAAE,QAAQ;IACdC,IAAI,EAAE;MACL,GAAGd,iBAAiB;MACpBG,OAAO,EAAE,CACR;QAAEI,KAAK,EAAE,QAAQ;QAAEQ,QAAQ,EAAEnB,WAAW;QAAEoB,KAAK,EAAE;MAAQ,CAAC;IAE5D;EACD,CAAC,EACD;IACCJ,KAAK,EAAErB,EAAE,CAAE,OAAQ,CAAC;IACpBsB,IAAI,EAAE,OAAO;IACbI,IAAI,EAAEzB,KAAK;IACXsB,IAAI,EAAE;MACL,GAAGd,iBAAiB;MACpBG,OAAO,EAAE,CACR;QAAEI,KAAK,EAAE,QAAQ;QAAEQ,QAAQ,EAAEnB,WAAW;QAAEoB,KAAK,EAAE;MAAQ,CAAC;IAE5D;EACD,CAAC;AAEH,CAAC"}
1
+ {"version":3,"names":["__","trash","LAYOUT_LIST","LAYOUT_TABLE","LAYOUT_GRID","OPERATOR_IN","DEFAULT_CONFIG_PER_VIEW_TYPE","primaryField","mediaField","DEFAULT_PAGE_BASE","type","search","filters","page","perPage","sort","field","direction","hiddenFields","layout","DEFAULT_VIEWS","title","slug","view","operator","value","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { trash } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IN,\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_TABLE,\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' ),\n\t\t\tslug: 'all',\n\t\t\tview: DEFAULT_PAGE_BASE,\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Drafts' ),\n\t\t\tslug: 'drafts',\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{ field: 'status', operator: OPERATOR_IN, value: 'draft' },\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{ field: 'status', operator: OPERATOR_IN, value: 'trash' },\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,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,SACCC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,WAAW,QACL,uBAAuB;AAE9B,OAAO,MAAMC,4BAA4B,GAAG;EAC3C,CAAEH,YAAY,GAAI;IACjBI,YAAY,EAAE;EACf,CAAC;EACD,CAAEH,WAAW,GAAI;IAChBI,UAAU,EAAE,gBAAgB;IAC5BD,YAAY,EAAE;EACf,CAAC;EACD,CAAEL,WAAW,GAAI;IAChBK,YAAY,EAAE,OAAO;IACrBC,UAAU,EAAE;EACb;AACD,CAAC;AAED,MAAMC,iBAAiB,GAAG;EACzBC,IAAI,EAAEP,YAAY;EAClBQ,MAAM,EAAE,EAAE;EACVC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE;IACLC,KAAK,EAAE,MAAM;IACbC,SAAS,EAAE;EACZ,CAAC;EACD;EACA;EACAC,YAAY,EAAE,CAAE,MAAM,EAAE,gBAAgB,CAAE;EAC1CC,MAAM,EAAE;IACP,GAAGb,4BAA4B,CAAEJ,WAAW;EAC7C;AACD,CAAC;AAED,OAAO,MAAMkB,aAAa,GAAG;EAC5BP,IAAI,EAAE,CACL;IACCQ,KAAK,EAAErB,EAAE,CAAE,KAAM,CAAC;IAClBsB,IAAI,EAAE,KAAK;IACXC,IAAI,EAAEd;EACP,CAAC,EACD;IACCY,KAAK,EAAErB,EAAE,CAAE,QAAS,CAAC;IACrBsB,IAAI,EAAE,QAAQ;IACdC,IAAI,EAAE;MACL,GAAGd,iBAAiB;MACpBG,OAAO,EAAE,CACR;QAAEI,KAAK,EAAE,QAAQ;QAAEQ,QAAQ,EAAEnB,WAAW;QAAEoB,KAAK,EAAE;MAAQ,CAAC;IAE5D;EACD,CAAC,EACD;IACCJ,KAAK,EAAErB,EAAE,CAAE,OAAQ,CAAC;IACpBsB,IAAI,EAAE,OAAO;IACbI,IAAI,EAAEzB,KAAK;IACXsB,IAAI,EAAE;MACL,GAAGd,iBAAiB;MACpBG,OAAO,EAAE,CACR;QAAEI,KAAK,EAAE,QAAQ;QAAEQ,QAAQ,EAAEnB,WAAW;QAAEoB,KAAK,EAAE;MAAQ,CAAC;IAE5D;EACD,CAAC;AAEH,CAAC"}
@@ -16,7 +16,7 @@ const {
16
16
  import DataViewItem from './dataview-item';
17
17
  import CustomDataViewsList from './custom-dataviews-list';
18
18
  const PATH_TO_TYPE = {
19
- '/page': 'page'
19
+ '/pages': 'page'
20
20
  };
21
21
  export default function DataViewsSidebarContent() {
22
22
  const {
@@ -40,7 +40,7 @@ export default function DataViewsSidebarContent() {
40
40
  isActive: isCustom === 'false' && dataview.slug === activeView,
41
41
  isCustom: "false"
42
42
  });
43
- })), createElement(CustomDataViewsList, {
43
+ })), window?.__experimentalAdminViews && createElement(CustomDataViewsList, {
44
44
  activeView: activeView,
45
45
  type: type,
46
46
  isCustom: "true"
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalItemGroup","ItemGroup","privateApis","routerPrivateApis","DEFAULT_VIEWS","unlock","useLocation","DataViewItem","CustomDataViewsList","PATH_TO_TYPE","DataViewsSidebarContent","params","path","activeView","isCustom","type","createElement","Fragment","map","dataview","key","slug","title","icon","view","isActive"],"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\nconst PATH_TO_TYPE = {\n\t'/page': 'page',\n};\n\nexport default function DataViewsSidebarContent() {\n\tconst {\n\t\tparams: { path, activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tif ( ! path || ! PATH_TO_TYPE[ path ] ) {\n\t\treturn null;\n\t}\n\tconst type = PATH_TO_TYPE[ path ];\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ DEFAULT_VIEWS[ type ].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\tisCustom === 'false' &&\n\t\t\t\t\t\t\t\tdataview.slug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,KAAO;MACxBC,IAAI,EAAGJ,QAAQ,CAACI,IAAM;MACtBR,IAAI,EAAGI,QAAQ,CAACK,IAAI,CAACT,IAAM;MAC3BU,QAAQ,EACPX,QAAQ,KAAK,OAAO,IACpBK,QAAQ,CAACE,IAAI,KAAKR,UAClB;MACDC,QAAQ,EAAC;IAAO,CAChB,CAAC;EAEJ,CAAE,CACQ,CAAC,EACZE,aAAA,CAACR,mBAAmB;IACnBK,UAAU,EAAGA,UAAY;IACzBE,IAAI,EAAGA,IAAM;IACbD,QAAQ,EAAC;EAAM,CACf,CACA,CAAC;AAEL"}
1
+ {"version":3,"names":["__experimentalItemGroup","ItemGroup","privateApis","routerPrivateApis","DEFAULT_VIEWS","unlock","useLocation","DataViewItem","CustomDataViewsList","PATH_TO_TYPE","DataViewsSidebarContent","params","path","activeView","isCustom","type","createElement","Fragment","map","dataview","key","slug","title","icon","view","isActive","window","__experimentalAdminViews"],"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\nconst PATH_TO_TYPE = {\n\t'/pages': 'page',\n};\n\nexport default function DataViewsSidebarContent() {\n\tconst {\n\t\tparams: { path, activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tif ( ! path || ! PATH_TO_TYPE[ path ] ) {\n\t\treturn null;\n\t}\n\tconst type = PATH_TO_TYPE[ path ];\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ DEFAULT_VIEWS[ type ].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\tisCustom === 'false' &&\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?.__experimentalAdminViews && (\n\t\t\t\t<CustomDataViewsList\n\t\t\t\t\tactiveView={ activeView }\n\t\t\t\t\ttype={ type }\n\t\t\t\t\tisCustom=\"true\"\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;AAEzD,MAAMC,YAAY,GAAG;EACpB,QAAQ,EAAE;AACX,CAAC;AAED,eAAe,SAASC,uBAAuBA,CAAA,EAAG;EACjD,MAAM;IACLC,MAAM,EAAE;MAAEC,IAAI;MAAEC,UAAU,GAAG,KAAK;MAAEC,QAAQ,GAAG;IAAQ;EACxD,CAAC,GAAGR,WAAW,CAAC,CAAC;EACjB,IAAK,CAAEM,IAAI,IAAI,CAAEH,YAAY,CAAEG,IAAI,CAAE,EAAG;IACvC,OAAO,IAAI;EACZ;EACA,MAAMG,IAAI,GAAGN,YAAY,CAAEG,IAAI,CAAE;EAEjC,OACCI,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACf,SAAS,QACPG,aAAa,CAAEW,IAAI,CAAE,CAACG,GAAG,CAAIC,QAAQ,IAAM;IAC5C,OACCH,aAAA,CAACT,YAAY;MACZa,GAAG,EAAGD,QAAQ,CAACE,IAAM;MACrBA,IAAI,EAAGF,QAAQ,CAACE,IAAM;MACtBC,KAAK,EAAGH,QAAQ,CAACG,KAAO;MACxBC,IAAI,EAAGJ,QAAQ,CAACI,IAAM;MACtBR,IAAI,EAAGI,QAAQ,CAACK,IAAI,CAACT,IAAM;MAC3BU,QAAQ,EACPX,QAAQ,KAAK,OAAO,IACpBK,QAAQ,CAACE,IAAI,KAAKR,UAClB;MACDC,QAAQ,EAAC;IAAO,CAChB,CAAC;EAEJ,CAAE,CACQ,CAAC,EACVY,MAAM,EAAEC,wBAAwB,IACjCX,aAAA,CAACR,mBAAmB;IACnBK,UAAU,EAAGA,UAAY;IACzBE,IAAI,EAAGA,IAAM;IACbD,QAAQ,EAAC;EAAM,CACf,CAED,CAAC;AAEL"}
@@ -36,22 +36,23 @@ export default function SidebarNavigationScreen({
36
36
  }) {
37
37
  const {
38
38
  dashboardLink,
39
- dashboardLinkText
39
+ dashboardLinkText,
40
+ previewingThemeName
40
41
  } = useSelect(select => {
41
42
  const {
42
43
  getSettings
43
44
  } = unlock(select(editSiteStore));
45
+ const currentlyPreviewingThemeId = currentlyPreviewingTheme();
44
46
  return {
45
47
  dashboardLink: getSettings().__experimentalDashboardLink,
46
- dashboardLinkText: getSettings().__experimentalDashboardLinkText
48
+ dashboardLinkText: getSettings().__experimentalDashboardLinkText,
49
+ // Do not call `getTheme` with null, it will cause a request to
50
+ // the server.
51
+ previewingThemeName: currentlyPreviewingThemeId ? select(coreStore).getTheme(currentlyPreviewingThemeId)?.name?.rendered : undefined
47
52
  };
48
53
  }, []);
49
- const {
50
- getTheme
51
- } = useSelect(coreStore);
52
54
  const location = useLocation();
53
55
  const navigator = useNavigator();
54
- const theme = getTheme(currentlyPreviewingTheme());
55
56
  const icon = isRTL() ? chevronRight : chevronLeft;
56
57
  return createElement(Fragment, null, createElement(VStack, {
57
58
  className: classnames('edit-site-sidebar-navigation-screen__main', {
@@ -86,7 +87,7 @@ export default function SidebarNavigationScreen({
86
87
  color: '#e0e0e0' /* $gray-200 */,
87
88
  level: 1,
88
89
  size: 20
89
- }, !isPreviewingTheme() ? title : sprintf('Previewing %1$s: %2$s', theme?.name?.rendered, title)), actions && createElement("div", {
90
+ }, !isPreviewingTheme() ? title : sprintf('Previewing %1$s: %2$s', previewingThemeName, title)), actions && createElement("div", {
90
91
  className: "edit-site-sidebar-navigation-screen__actions"
91
92
  }, actions)), meta && createElement(Fragment, null, createElement("div", {
92
93
  className: "edit-site-sidebar-navigation-screen__meta"