@wordpress/edit-site 5.13.0 → 5.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (470) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-page/index.js +1 -7
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +11 -11
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +2 -2
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +69 -14
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/block-editor/editor-canvas.js +1 -1
  11. package/build/components/block-editor/editor-canvas.js.map +1 -1
  12. package/build/components/block-editor/inserter-media-categories.js +1 -22
  13. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  14. package/build/components/block-editor/site-editor-canvas.js +29 -32
  15. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/use-site-editor-settings.js +9 -12
  17. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  18. package/build/components/canvas-spinner/index.js +1 -18
  19. package/build/components/canvas-spinner/index.js.map +1 -1
  20. package/build/components/create-pattern-modal/index.js +9 -9
  21. package/build/components/create-pattern-modal/index.js.map +1 -1
  22. package/build/components/create-template-part-modal/index.js +1 -1
  23. package/build/components/create-template-part-modal/index.js.map +1 -1
  24. package/build/components/editor/index.js +11 -1
  25. package/build/components/editor/index.js.map +1 -1
  26. package/build/components/global-styles/palette.js +1 -1
  27. package/build/components/global-styles/palette.js.map +1 -1
  28. package/build/components/global-styles/ui.js +7 -2
  29. package/build/components/global-styles/ui.js.map +1 -1
  30. package/build/components/header-edit-mode/document-actions/index.js +9 -1
  31. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  32. package/build/components/header-edit-mode/index.js +41 -10
  33. package/build/components/header-edit-mode/index.js.map +1 -1
  34. package/build/components/header-edit-mode/more-menu/index.js +47 -17
  35. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  36. package/build/components/keyboard-shortcut-help-modal/index.js +17 -4
  37. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  38. package/build/components/keyboard-shortcuts/edit-mode.js +32 -1
  39. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  40. package/build/components/keyboard-shortcuts/register.js +9 -0
  41. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  42. package/build/components/layout/index.js +103 -26
  43. package/build/components/layout/index.js.map +1 -1
  44. package/build/components/page/header.js +1 -1
  45. package/build/components/page/header.js.map +1 -1
  46. package/build/components/page/index.js +3 -1
  47. package/build/components/page/index.js.map +1 -1
  48. package/build/components/page-actions/delete-page-menu-item.js +2 -1
  49. package/build/components/page-actions/delete-page-menu-item.js.map +1 -1
  50. package/build/components/page-content-focus-manager/back-to-page-notification.js +9 -3
  51. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
  52. package/build/components/page-main/index.js +8 -4
  53. package/build/components/page-main/index.js.map +1 -1
  54. package/build/components/{page-library → page-patterns}/grid-item.js +61 -33
  55. package/build/components/page-patterns/grid-item.js.map +1 -0
  56. package/build/components/{page-library → page-patterns}/grid.js +1 -1
  57. package/build/components/page-patterns/grid.js.map +1 -0
  58. package/build/components/{page-library → page-patterns}/index.js +6 -6
  59. package/build/components/page-patterns/index.js.map +1 -0
  60. package/build/components/{page-library → page-patterns}/no-patterns.js +1 -1
  61. package/build/components/page-patterns/no-patterns.js.map +1 -0
  62. package/build/components/{page-library → page-patterns}/patterns-list.js +9 -7
  63. package/build/components/page-patterns/patterns-list.js.map +1 -0
  64. package/build/components/page-patterns/search-items.js.map +1 -0
  65. package/build/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +3 -3
  66. package/build/components/page-patterns/use-pattern-settings.js.map +1 -0
  67. package/build/components/{page-library → page-patterns}/use-patterns.js +12 -2
  68. package/build/components/page-patterns/use-patterns.js.map +1 -0
  69. package/build/components/{page-library → page-patterns}/utils.js +3 -3
  70. package/build/components/page-patterns/utils.js.map +1 -0
  71. package/build/components/page-template-parts/index.js +103 -0
  72. package/build/components/page-template-parts/index.js.map +1 -0
  73. package/build/components/page-templates/index.js +1 -0
  74. package/build/components/page-templates/index.js.map +1 -1
  75. package/build/components/preferences-modal/enable-feature.js +5 -1
  76. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  77. package/build/components/preferences-modal/index.js +43 -4
  78. package/build/components/preferences-modal/index.js.map +1 -1
  79. package/build/components/sidebar/index.js +6 -6
  80. package/build/components/sidebar/index.js.map +1 -1
  81. package/build/components/sidebar-edit-mode/index.js +4 -2
  82. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  83. package/build/components/sidebar-edit-mode/settings-header/index.js +7 -1
  84. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  85. package/build/components/sidebar-navigation-screen/index.js +7 -3
  86. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  87. package/build/components/sidebar-navigation-screen-global-styles/index.js +69 -5
  88. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  89. package/build/components/sidebar-navigation-screen-main/index.js +2 -2
  90. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  91. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +7 -16
  92. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  93. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -11
  94. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  95. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +6 -6
  96. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  97. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +10 -1
  98. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  99. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +9 -3
  100. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  101. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +5 -1
  102. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  103. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +29 -0
  104. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
  105. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +27 -4
  106. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  107. package/build/components/sidebar-navigation-screen-page/page-details.js +11 -4
  108. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  109. package/build/components/sidebar-navigation-screen-page/status-label.js +1 -1
  110. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  111. package/build/components/sidebar-navigation-screen-pages/index.js +1 -1
  112. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  113. package/build/components/sidebar-navigation-screen-pattern/index.js +13 -8
  114. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  115. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
  116. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  117. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +23 -0
  118. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  119. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  120. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
  121. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +55 -15
  122. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
  123. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
  124. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +30 -0
  125. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
  126. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +2 -20
  127. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
  128. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
  129. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
  130. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
  131. package/build/components/sidebar-navigation-screen-templates/index.js +11 -63
  132. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  133. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
  134. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  135. package/build/components/site-hub/index.js +1 -1
  136. package/build/components/site-hub/index.js.map +1 -1
  137. package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
  138. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  139. package/build/components/template-actions/index.js +22 -6
  140. package/build/components/template-actions/index.js.map +1 -1
  141. package/build/components/welcome-guide/editor.js +1 -1
  142. package/build/components/welcome-guide/editor.js.map +1 -1
  143. package/build/components/welcome-guide/index.js +5 -1
  144. package/build/components/welcome-guide/index.js.map +1 -1
  145. package/build/components/welcome-guide/page.js +70 -0
  146. package/build/components/welcome-guide/page.js.map +1 -0
  147. package/build/components/welcome-guide/styles.js +1 -1
  148. package/build/components/welcome-guide/styles.js.map +1 -1
  149. package/build/components/welcome-guide/template.js +71 -0
  150. package/build/components/welcome-guide/template.js.map +1 -0
  151. package/build/hooks/commands/use-common-commands.js +37 -0
  152. package/build/hooks/commands/use-common-commands.js.map +1 -1
  153. package/build/hooks/commands/use-edit-mode-commands.js +195 -44
  154. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  155. package/build/index.js +9 -0
  156. package/build/index.js.map +1 -1
  157. package/build/store/actions.js +5 -2
  158. package/build/store/actions.js.map +1 -1
  159. package/build/store/selectors.js +2 -1
  160. package/build/store/selectors.js.map +1 -1
  161. package/build/utils/get-is-list-page.js +2 -2
  162. package/build/utils/get-is-list-page.js.map +1 -1
  163. package/build/utils/template-part-create.js +2 -2
  164. package/build/utils/template-part-create.js.map +1 -1
  165. package/build-module/components/add-new-page/index.js +1 -6
  166. package/build-module/components/add-new-page/index.js.map +1 -1
  167. package/build-module/components/add-new-pattern/index.js +11 -11
  168. package/build-module/components/add-new-pattern/index.js.map +1 -1
  169. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  170. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  171. package/build-module/components/add-new-template/new-template.js +72 -17
  172. package/build-module/components/add-new-template/new-template.js.map +1 -1
  173. package/build-module/components/block-editor/editor-canvas.js +1 -1
  174. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  175. package/build-module/components/block-editor/inserter-media-categories.js +1 -22
  176. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  177. package/build-module/components/block-editor/site-editor-canvas.js +29 -32
  178. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  179. package/build-module/components/block-editor/use-site-editor-settings.js +9 -12
  180. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  181. package/build-module/components/canvas-spinner/index.js +1 -15
  182. package/build-module/components/canvas-spinner/index.js.map +1 -1
  183. package/build-module/components/create-pattern-modal/index.js +9 -9
  184. package/build-module/components/create-pattern-modal/index.js.map +1 -1
  185. package/build-module/components/create-template-part-modal/index.js +1 -1
  186. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  187. package/build-module/components/editor/index.js +11 -1
  188. package/build-module/components/editor/index.js.map +1 -1
  189. package/build-module/components/global-styles/palette.js +1 -1
  190. package/build-module/components/global-styles/palette.js.map +1 -1
  191. package/build-module/components/global-styles/ui.js +8 -3
  192. package/build-module/components/global-styles/ui.js.map +1 -1
  193. package/build-module/components/header-edit-mode/document-actions/index.js +10 -2
  194. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  195. package/build-module/components/header-edit-mode/index.js +43 -12
  196. package/build-module/components/header-edit-mode/index.js.map +1 -1
  197. package/build-module/components/header-edit-mode/more-menu/index.js +44 -20
  198. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  199. package/build-module/components/keyboard-shortcut-help-modal/index.js +15 -6
  200. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  201. package/build-module/components/keyboard-shortcuts/edit-mode.js +29 -1
  202. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  203. package/build-module/components/keyboard-shortcuts/register.js +9 -0
  204. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  205. package/build-module/components/layout/index.js +103 -26
  206. package/build-module/components/layout/index.js.map +1 -1
  207. package/build-module/components/page/header.js +1 -1
  208. package/build-module/components/page/header.js.map +1 -1
  209. package/build-module/components/page/index.js +2 -1
  210. package/build-module/components/page/index.js.map +1 -1
  211. package/build-module/components/page-actions/delete-page-menu-item.js +2 -1
  212. package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -1
  213. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +9 -3
  214. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
  215. package/build-module/components/page-main/index.js +6 -3
  216. package/build-module/components/page-main/index.js.map +1 -1
  217. package/build-module/components/{page-library → page-patterns}/grid-item.js +65 -35
  218. package/build-module/components/page-patterns/grid-item.js.map +1 -0
  219. package/build-module/components/{page-library → page-patterns}/grid.js +1 -1
  220. package/build-module/components/page-patterns/grid.js.map +1 -0
  221. package/build-module/components/{page-library → page-patterns}/index.js +5 -5
  222. package/build-module/components/page-patterns/index.js.map +1 -0
  223. package/build-module/components/{page-library → page-patterns}/no-patterns.js +1 -1
  224. package/build-module/components/page-patterns/no-patterns.js.map +1 -0
  225. package/build-module/components/{page-library → page-patterns}/patterns-list.js +9 -7
  226. package/build-module/components/page-patterns/patterns-list.js.map +1 -0
  227. package/build-module/components/page-patterns/search-items.js.map +1 -0
  228. package/build-module/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +2 -2
  229. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -0
  230. package/build-module/components/{page-library → page-patterns}/use-patterns.js +12 -2
  231. package/build-module/components/page-patterns/use-patterns.js.map +1 -0
  232. package/build-module/components/{page-library → page-patterns}/utils.js +3 -3
  233. package/build-module/components/page-patterns/utils.js.map +1 -0
  234. package/build-module/components/page-template-parts/index.js +82 -0
  235. package/build-module/components/page-template-parts/index.js.map +1 -0
  236. package/build-module/components/page-templates/index.js +1 -0
  237. package/build-module/components/page-templates/index.js.map +1 -1
  238. package/build-module/components/preferences-modal/enable-feature.js +5 -1
  239. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  240. package/build-module/components/preferences-modal/index.js +38 -5
  241. package/build-module/components/preferences-modal/index.js.map +1 -1
  242. package/build-module/components/sidebar/index.js +5 -5
  243. package/build-module/components/sidebar/index.js.map +1 -1
  244. package/build-module/components/sidebar-edit-mode/index.js +4 -2
  245. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  246. package/build-module/components/sidebar-edit-mode/settings-header/index.js +6 -1
  247. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  248. package/build-module/components/sidebar-navigation-screen/index.js +7 -3
  249. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  250. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +67 -5
  251. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  252. package/build-module/components/sidebar-navigation-screen-main/index.js +2 -2
  253. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  254. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +8 -17
  255. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  256. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -9
  257. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  258. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +5 -6
  259. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  260. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +11 -1
  261. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  262. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +8 -4
  263. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  264. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +5 -1
  265. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  266. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +20 -0
  267. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
  268. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +26 -6
  269. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  270. package/build-module/components/sidebar-navigation-screen-page/page-details.js +11 -4
  271. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  272. package/build-module/components/sidebar-navigation-screen-page/status-label.js +1 -1
  273. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  274. package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -2
  275. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  276. package/build-module/components/sidebar-navigation-screen-pattern/index.js +12 -7
  277. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  278. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
  279. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  280. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +21 -0
  281. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  282. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  283. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
  284. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +54 -16
  285. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
  286. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
  287. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +20 -0
  288. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
  289. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +2 -17
  290. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
  291. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
  292. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
  293. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
  294. package/build-module/components/sidebar-navigation-screen-templates/index.js +12 -62
  295. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  296. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
  297. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  298. package/build-module/components/site-hub/index.js +1 -1
  299. package/build-module/components/site-hub/index.js.map +1 -1
  300. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
  301. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  302. package/build-module/components/template-actions/index.js +24 -7
  303. package/build-module/components/template-actions/index.js.map +1 -1
  304. package/build-module/components/welcome-guide/editor.js +1 -1
  305. package/build-module/components/welcome-guide/editor.js.map +1 -1
  306. package/build-module/components/welcome-guide/index.js +3 -1
  307. package/build-module/components/welcome-guide/index.js.map +1 -1
  308. package/build-module/components/welcome-guide/page.js +59 -0
  309. package/build-module/components/welcome-guide/page.js.map +1 -0
  310. package/build-module/components/welcome-guide/styles.js +1 -1
  311. package/build-module/components/welcome-guide/styles.js.map +1 -1
  312. package/build-module/components/welcome-guide/template.js +60 -0
  313. package/build-module/components/welcome-guide/template.js.map +1 -0
  314. package/build-module/hooks/commands/use-common-commands.js +37 -1
  315. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  316. package/build-module/hooks/commands/use-edit-mode-commands.js +193 -46
  317. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  318. package/build-module/index.js +4 -0
  319. package/build-module/index.js.map +1 -1
  320. package/build-module/store/actions.js +5 -2
  321. package/build-module/store/actions.js.map +1 -1
  322. package/build-module/store/selectors.js +2 -1
  323. package/build-module/store/selectors.js.map +1 -1
  324. package/build-module/utils/get-is-list-page.js +2 -2
  325. package/build-module/utils/get-is-list-page.js.map +1 -1
  326. package/build-module/utils/template-part-create.js +1 -1
  327. package/build-module/utils/template-part-create.js.map +1 -1
  328. package/build-style/style-rtl.css +167 -51
  329. package/build-style/style.css +167 -51
  330. package/package.json +39 -39
  331. package/src/components/add-new-page/index.js +1 -6
  332. package/src/components/add-new-pattern/index.js +11 -13
  333. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  334. package/src/components/add-new-template/new-template.js +120 -24
  335. package/src/components/add-new-template/style.scss +30 -2
  336. package/src/components/block-editor/editor-canvas.js +3 -1
  337. package/src/components/block-editor/inserter-media-categories.js +1 -21
  338. package/src/components/block-editor/site-editor-canvas.js +7 -1
  339. package/src/components/block-editor/use-site-editor-settings.js +8 -12
  340. package/src/components/canvas-spinner/index.js +1 -11
  341. package/src/components/canvas-spinner/style.scss +4 -0
  342. package/src/components/create-pattern-modal/index.js +11 -12
  343. package/src/components/create-template-part-modal/index.js +1 -1
  344. package/src/components/editor/index.js +16 -1
  345. package/src/components/editor/style.scss +4 -0
  346. package/src/components/global-styles/palette.js +10 -9
  347. package/src/components/global-styles/stories/index.js +1 -0
  348. package/src/components/global-styles/ui.js +34 -24
  349. package/src/components/header-edit-mode/document-actions/index.js +9 -1
  350. package/src/components/header-edit-mode/document-actions/style.scss +8 -0
  351. package/src/components/header-edit-mode/index.js +112 -62
  352. package/src/components/header-edit-mode/more-menu/index.js +74 -30
  353. package/src/components/keyboard-shortcut-help-modal/index.js +21 -7
  354. package/src/components/keyboard-shortcuts/edit-mode.js +35 -2
  355. package/src/components/keyboard-shortcuts/register.js +10 -0
  356. package/src/components/layout/index.js +140 -76
  357. package/src/components/layout/style.scss +47 -1
  358. package/src/components/page/header.js +1 -1
  359. package/src/components/page/index.js +5 -1
  360. package/src/components/page-actions/delete-page-menu-item.js +1 -0
  361. package/src/components/page-content-focus-manager/back-to-page-notification.js +7 -2
  362. package/src/components/page-main/index.js +6 -3
  363. package/src/components/{page-library → page-patterns}/grid-item.js +83 -34
  364. package/src/components/{page-library → page-patterns}/grid.js +1 -1
  365. package/src/components/{page-library → page-patterns}/index.js +5 -5
  366. package/src/components/{page-library → page-patterns}/no-patterns.js +1 -1
  367. package/src/components/{page-library → page-patterns}/patterns-list.js +13 -9
  368. package/src/components/{page-library → page-patterns}/style.scss +19 -15
  369. package/src/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +1 -1
  370. package/src/components/{page-library → page-patterns}/use-patterns.js +11 -2
  371. package/src/components/{page-library → page-patterns}/utils.js +3 -3
  372. package/src/components/page-template-parts/index.js +105 -0
  373. package/src/components/page-templates/index.js +1 -1
  374. package/src/components/preferences-modal/enable-feature.js +5 -2
  375. package/src/components/preferences-modal/index.js +35 -4
  376. package/src/components/sidebar/index.js +6 -6
  377. package/src/components/sidebar-button/style.scss +1 -1
  378. package/src/components/sidebar-edit-mode/index.js +4 -2
  379. package/src/components/sidebar-edit-mode/settings-header/index.js +7 -2
  380. package/src/components/sidebar-navigation-item/style.scss +2 -1
  381. package/src/components/sidebar-navigation-screen/index.js +4 -2
  382. package/src/components/sidebar-navigation-screen/style.scss +7 -2
  383. package/src/components/sidebar-navigation-screen-details-panel/style.scss +1 -1
  384. package/src/components/sidebar-navigation-screen-global-styles/index.js +57 -17
  385. package/src/components/sidebar-navigation-screen-main/index.js +2 -2
  386. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +14 -35
  387. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +8 -11
  388. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +9 -8
  389. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +12 -1
  390. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +16 -7
  391. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -7
  392. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +5 -1
  393. package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +24 -0
  394. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +39 -8
  395. package/src/components/sidebar-navigation-screen-page/page-details.js +8 -3
  396. package/src/components/sidebar-navigation-screen-page/status-label.js +1 -1
  397. package/src/components/sidebar-navigation-screen-pages/index.js +2 -2
  398. package/src/components/sidebar-navigation-screen-pattern/index.js +13 -6
  399. package/src/components/sidebar-navigation-screen-pattern/style.scss +29 -0
  400. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
  401. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +43 -1
  402. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  403. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +75 -22
  404. package/src/components/sidebar-navigation-screen-patterns/style.scss +3 -0
  405. package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +23 -0
  406. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +1 -18
  407. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
  408. package/src/components/sidebar-navigation-screen-template/style.scss +15 -15
  409. package/src/components/sidebar-navigation-screen-templates/index.js +15 -82
  410. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -0
  411. package/src/components/site-hub/index.js +1 -1
  412. package/src/components/site-hub/style.scss +4 -3
  413. package/src/components/start-template-options/style.scss +0 -3
  414. package/src/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
  415. package/src/components/template-actions/index.js +38 -8
  416. package/src/components/welcome-guide/editor.js +1 -1
  417. package/src/components/welcome-guide/index.js +4 -0
  418. package/src/components/welcome-guide/page.js +75 -0
  419. package/src/components/welcome-guide/style.scss +15 -1
  420. package/src/components/welcome-guide/styles.js +1 -1
  421. package/src/components/welcome-guide/template.js +82 -0
  422. package/src/hooks/commands/use-common-commands.js +32 -1
  423. package/src/hooks/commands/use-edit-mode-commands.js +182 -38
  424. package/src/index.js +4 -0
  425. package/src/store/actions.js +8 -1
  426. package/src/store/selectors.js +5 -0
  427. package/src/store/test/selectors.js +2 -0
  428. package/src/style.scss +3 -2
  429. package/src/utils/get-is-list-page.js +4 -3
  430. package/src/utils/template-part-create.js +1 -1
  431. package/build/components/page-library/grid-item.js.map +0 -1
  432. package/build/components/page-library/grid.js.map +0 -1
  433. package/build/components/page-library/index.js.map +0 -1
  434. package/build/components/page-library/no-patterns.js.map +0 -1
  435. package/build/components/page-library/patterns-list.js.map +0 -1
  436. package/build/components/page-library/search-items.js.map +0 -1
  437. package/build/components/page-library/use-library-settings.js.map +0 -1
  438. package/build/components/page-library/use-patterns.js.map +0 -1
  439. package/build/components/page-library/utils.js.map +0 -1
  440. package/build/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
  441. package/build/components/sidebar-navigation-screen-library/index.js.map +0 -1
  442. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
  443. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
  444. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
  445. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
  446. package/build-module/components/page-library/grid-item.js.map +0 -1
  447. package/build-module/components/page-library/grid.js.map +0 -1
  448. package/build-module/components/page-library/index.js.map +0 -1
  449. package/build-module/components/page-library/no-patterns.js.map +0 -1
  450. package/build-module/components/page-library/patterns-list.js.map +0 -1
  451. package/build-module/components/page-library/search-items.js.map +0 -1
  452. package/build-module/components/page-library/use-library-settings.js.map +0 -1
  453. package/build-module/components/page-library/use-patterns.js.map +0 -1
  454. package/build-module/components/page-library/utils.js.map +0 -1
  455. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
  456. package/build-module/components/sidebar-navigation-screen-library/index.js.map +0 -1
  457. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
  458. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
  459. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
  460. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
  461. package/src/components/sidebar-navigation-screen-library/style.scss +0 -7
  462. /package/build/components/{page-library → page-patterns}/search-items.js +0 -0
  463. /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  464. /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
  465. /package/build-module/components/{page-library → page-patterns}/search-items.js +0 -0
  466. /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  467. /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
  468. /package/src/components/{page-library → page-patterns}/search-items.js +0 -0
  469. /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  470. /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["SLOT_FILL_NAME","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","toggle","preferencesStore","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","goTo","loadCustomCSS","moreVertical","onClose","RevisionsCountBadge","className","children","GlobalStylesRevisionsMenu","setIsListViewOpened","editSiteStore","revisionsCount","count","useGlobalStylesReset","blockEditorPrivateApis","canReset","onReset","setEditorCanvasContainerView","loadRevisions","hasRevisions","backup","GlobalStylesNavigationScreen","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","name","ContextScreens","blockStyleVariations","getBlockStyles","blocksStore","length","GlobalStylesStyleBook","navigator","path","location","encodeURIComponent","startsWith","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","blockEditorStore","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","GlobalStylesUI","blocks","block"],"mappings":";;;;;;;;;AA2BA;;AAxBA;;AAKA;;AASA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAhDA;AACA;AACA;;AAGA;AACA;AACA;;AAsBA;AACA;AACA;AAmBA,MAAMA,cAAc,GAAG,kBAAvB;AACA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,oBAAR;AAA8BC,EAAAA,IAAI,EAAEC;AAApC,IACL,gCAAgBJ,cAAhB,CADD;;;AAGA,SAASK,sBAAT,GAAkC;AACj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IAAA,OAAO,EAAC;AAAjC,IADD,CApCD,EAwCC,4BAAC,4BAAD;AAA8B,IAAA,IAAI,EAAC;AAAnC,KACC,4BAAC,qBAAD,OADD,CAxCD,EA4CC,4BAAC,4BAAD;AAA8B,IAAA,IAAI,EAAC;AAAnC,KACC,4BAAC,qBAAD,OADD,CA5CD,EAgDC,4BAAC,4BAAD;AAA8B,IAAA,IAAI,EAAC;AAAnC,KACC,4BAAC,kBAAD,OADD,CAhDD,EAoDC,4BAAC,4BAAD;AAA8B,IAAA,IAAI,EAAG;AAArC,KACC,4BAAC,wBAAD,OADD,CApDD,EAwDGE,MAAM,CAAC9B,GAAP,CAAc+B,KAAF,IACb,4BAAC,4BAAD;AACC,IAAA,GAAG,EAAG,gBAAgBA,KAAK,CAAC5B,IAD7B;AAEC,IAAA,IAAI,EAAG,aAAaU,kBAAkB,CAAEkB,KAAK,CAAC5B,IAAR;AAFvC,KAIC,4BAAC,oBAAD;AAAa,IAAA,IAAI,EAAG4B,KAAK,CAAC5B;AAA1B,IAJD,CADC,CAxDH,EAiEC,4BAAC,cAAD,OAjED,EAmEG2B,MAAM,CAAC9B,GAAP,CAAc+B,KAAF,IACb,4BAAC,cAAD;AACC,IAAA,GAAG,EAAG,mBAAmBA,KAAK,CAAC5B,IADhC;AAEC,IAAA,IAAI,EAAG4B,KAAK,CAAC5B,IAFd;AAGC,IAAA,UAAU,EAAG,aAAaU,kBAAkB,CAAEkB,KAAK,CAAC5B,IAAR;AAH7C,IADC,CAnEH,EA2EG,iBAAiBwB,yBAAjB,IACD,4BAAC,qBAAD,OA5EF,EA+EC,4BAAC,yBAAD,OA/ED,EAgFC,4BAAC,sBAAD,OAhFD,EAiFC,4BAAC,qBAAD,OAjFD,EAkFC,4BAAC,qCAAD,OAlFD,CADD;AAsFA;;eAEcE,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { backup, moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => goTo( '/css' );\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu icon={ moreVertical } label={ __( 'More' ) }>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction RevisionsCountBadge( { className, children } ) {\n\treturn (\n\t\t<span\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'edit-site-global-styles-sidebar__revisions-count-badge'\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</span>\n\t);\n}\nfunction GlobalStylesRevisionsMenu() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tgoTo( '/revisions' );\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t};\n\tconst hasRevisions = revisionsCount >= 2;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu icon={ backup } label={ __( 'Revisions' ) }>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t{ hasRevisions && (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ loadRevisions }\n\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t<RevisionsCountBadge>\n\t\t\t\t\t\t\t\t\t\t{ revisionsCount }\n\t\t\t\t\t\t\t\t\t</RevisionsCountBadge>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Revision history' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset to defaults' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tif ( editorCanvasContainerView === 'global-styles-revisions' ) {\n\t\t\t// Switching to the revisions container view should\n\t\t\t// redirect to the revisions screen.\n\t\t\tgoTo( '/revisions' );\n\t\t} else if (\n\t\t\t!! editorCanvasContainerView &&\n\t\t\tlocation?.path === '/revisions'\n\t\t) {\n\t\t\t// Switching to any container other than revisions should\n\t\t\t// redirect from the revisions screen to the root global styles screen.\n\t\t\tgoTo( '/' );\n\t\t} else if ( editorCanvasContainerView === 'global-styles-css' ) {\n\t\t\tgoTo( '/css' );\n\t\t}\n\n\t\t// location?.path is not a dependency because we don't want to track it.\n\t\t// Doing so will cause an infinite loop. We could abstract logic to avoid\n\t\t// having to disable the check later.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ editorCanvasContainerView, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ '/revisions' }>\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesRevisionsMenu />\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["SLOT_FILL_NAME","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","toggle","preferencesStore","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","goTo","loadCustomCSS","moreVertical","onClose","RevisionsCountBadge","className","children","GlobalStylesRevisionsMenu","setIsListViewOpened","editSiteStore","revisionsCount","count","useGlobalStylesReset","blockEditorPrivateApis","canReset","onReset","setEditorCanvasContainerView","loadRevisions","hasRevisions","backup","GlobalStylesNavigationScreen","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","name","ContextScreens","blockStyleVariations","getBlockStyles","blocksStore","length","GlobalStylesStyleBook","navigator","path","location","encodeURIComponent","startsWith","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","blockEditorStore","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","GlobalStylesUI","blocks","block"],"mappings":";;;;;;;;;AA4BA;;AAzBA;;AAKA;;AAUA;;AACA;;AACA;;AAI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,CAAc+B,KAAF,IACb,4BAAC,cAAD;AACC,IAAA,GAAG,EAAG,mBAAmBA,KAAK,CAAC5B,IADhC;AAEC,IAAA,IAAI,EAAG4B,KAAK,CAAC5B,IAFd;AAGC,IAAA,UAAU,EAAG,aAAaU,kBAAkB,CAAEkB,KAAK,CAAC5B,IAAR;AAH7C,IADC,CAnEH,EA2EG,iBAAiBwB,yBAAjB,IACD,4BAAC,qBAAD,OA5EF,EA+EC,4BAAC,yBAAD,OA/ED,EAgFC,4BAAC,sBAAD,OAhFD,EAiFC,4BAAC,qBAAD,OAjFD,EAkFC,4BAAC,qCAAD,OAlFD,CADD;AAsFA;;eAEcE,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tButton,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { backup, moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => goTo( '/css' );\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu icon={ moreVertical } label={ __( 'More' ) }>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction RevisionsCountBadge( { className, children } ) {\n\treturn (\n\t\t<span\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'edit-site-global-styles-sidebar__revisions-count-badge'\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</span>\n\t);\n}\nfunction GlobalStylesRevisionsMenu() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tgoTo( '/revisions' );\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t};\n\tconst hasRevisions = revisionsCount >= 2;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t{ canReset || hasRevisions ? (\n\t\t\t\t<DropdownMenu icon={ backup } label={ __( 'Revisions' ) }>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ hasRevisions && (\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ loadRevisions }\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t<RevisionsCountBadge>\n\t\t\t\t\t\t\t\t\t\t\t{ revisionsCount }\n\t\t\t\t\t\t\t\t\t\t</RevisionsCountBadge>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Revision history' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset to defaults' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\ticon={ backup }\n\t\t\t\t\tdisabled\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t/>\n\t\t\t) }\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tif ( editorCanvasContainerView === 'global-styles-revisions' ) {\n\t\t\t// Switching to the revisions container view should\n\t\t\t// redirect to the revisions screen.\n\t\t\tgoTo( '/revisions' );\n\t\t} else if (\n\t\t\t!! editorCanvasContainerView &&\n\t\t\tlocation?.path === '/revisions'\n\t\t) {\n\t\t\t// Switching to any container other than revisions should\n\t\t\t// redirect from the revisions screen to the root global styles screen.\n\t\t\tgoTo( '/' );\n\t\t} else if ( editorCanvasContainerView === 'global-styles-css' ) {\n\t\t\tgoTo( '/css' );\n\t\t}\n\n\t\t// location?.path is not a dependency because we don't want to track it.\n\t\t// Doing so will cause an infinite loop. We could abstract logic to avoid\n\t\t// having to disable the check later.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ editorCanvasContainerView, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ '/revisions' }>\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesRevisionsMenu />\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"]}
@@ -128,9 +128,17 @@ function TemplateDocumentActions({
128
128
  }
129
129
 
130
130
  const entityLabel = getEntityLabel(record.type);
131
+ let typeIcon = icon;
132
+
133
+ if (record.type === 'wp_navigation') {
134
+ typeIcon = _icons.navigation;
135
+ } else if (record.type === 'wp_block') {
136
+ typeIcon = _icons.symbol;
137
+ }
138
+
131
139
  return (0, _element.createElement)(BaseDocumentActions, {
132
140
  className: className,
133
- icon: record.type === 'wp_navigation' ? _icons.navigation : icon,
141
+ icon: typeIcon,
134
142
  onBack: onBack
135
143
  }, (0, _element.createElement)(_components.VisuallyHidden, {
136
144
  as: "span"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/header-edit-mode/document-actions/index.js"],"names":["DocumentActions","isPage","select","editSiteStore","PageDocumentActions","hasPageContentFocus","hasResolved","isFound","title","_hasPageContentFocus","getEditedPostContext","getEditedEntityRecord","hasFinishedResolution","coreStore","context","queryArgs","postType","postId","page","setHasPageContentFocus","hasEditedTemplate","setHasEditedTemplate","prevHasPageContentFocus","current","pageIcon","TemplateDocumentActions","className","onBack","isLoaded","record","getTitle","icon","entityLabel","getEntityLabel","type","navigationIcon","BaseDocumentActions","children","open","openCommandCenter","commandsStore","chevronLeftSmallIcon","event","stopPropagation","displayShortcut","primary","entityType","label"],"mappings":";;;;;;;;;AAwBA;;AArBA;;AAKA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AAKA;;AAEA;;AAKA;;AACA;;AA/BA;AACA;AACA;;AAGA;AACA;AACA;;AAoBA;AACA;AACA;AAIe,SAASA,eAAT,GAA2B;AACzC,QAAMC,MAAM,GAAG,qBAAaC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBF,MAAxB,EAAzB,CAAf;AACA,SAAOA,MAAM,GAAG,4BAAC,mBAAD,OAAH,GAA6B,4BAAC,uBAAD,OAA1C;AACA;;AAED,SAASG,mBAAT,GAA+B;AAC9B,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA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AAAEW,IAAAA,IAAI,EAAEC;AAAR,MAA8B,uBAAaC,eAAb,CAApC;AACA,SACC;AACC,IAAA,SAAS,EAAG,yBAAY,4BAAZ,EAA0Cd,SAA1C;AADb,KAGGC,MAAM,IACP,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,kCADX;AAEC,IAAA,IAAI,EAAGc,uBAFR;AAGC,IAAA,OAAO,EAAKC,KAAF,IAAa;AACtBA,MAAAA,KAAK,CAACC,eAAN;AACAhB,MAAAA,MAAM;AACN;AANF,KAQG,cAAI,MAAJ,CARH,CAJF,EAeC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,OAAO,EAAG,MAAMY,iBAAiB;AAFlC,KAIC,4BAAC,gCAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,OAAO,EAAG,CAFX;AAGC,IAAA,OAAO,EAAC;AAHT,KAKC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAGR;AAAlB,IALD,EAMC,4BAAC,8BAAD;AAAM,IAAA,IAAI,EAAC,MAAX;AAAkB,IAAA,EAAE,EAAC;AAArB,KACGM,QADH,CAND,CAJD,EAcC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGO,0BAAgBC,OAAhB,CAAyB,GAAzB,CADH,CAdD,CAfD,CADD;AAoCA;;AAED,SAASZ,cAAT,CAAyBa,UAAzB,EAAsC;AACrC,MAAIC,KAAK,GAAG,EAAZ;;AACA,UAASD,UAAT;AACC,SAAK,eAAL;AACCC,MAAAA,KAAK,GAAG,iBAAR;AACA;;AACD,SAAK,kBAAL;AACCA,MAAAA,KAAK,GAAG,eAAR;AACA;;AACD;AACCA,MAAAA,KAAK,GAAG,UAAR;AACA;AATF;;AAYA,SAAOA,KAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\tVisuallyHidden,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { store as commandsStore } from '@wordpress/commands';\nimport {\n\tchevronLeftSmall as chevronLeftSmallIcon,\n\tpage as pageIcon,\n\tnavigation as navigationIcon,\n} from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../../use-edited-entity-record';\nimport { store as editSiteStore } from '../../../store';\n\nexport default function DocumentActions() {\n\tconst isPage = useSelect( ( select ) => select( editSiteStore ).isPage() );\n\treturn isPage ? <PageDocumentActions /> : <TemplateDocumentActions />;\n}\n\nfunction PageDocumentActions() {\n\tconst { hasPageContentFocus, hasResolved, isFound, title } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasPageContentFocus: _hasPageContentFocus,\n\t\t\t\tgetEditedPostContext,\n\t\t\t} = select( editSiteStore );\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst context = getEditedPostContext();\n\t\t\tconst queryArgs = [ 'postType', context.postType, context.postId ];\n\t\t\tconst page = getEditedEntityRecord( ...queryArgs );\n\t\t\treturn {\n\t\t\t\thasPageContentFocus: _hasPageContentFocus(),\n\t\t\t\thasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t\tisFound: !! page,\n\t\t\t\ttitle: page?.title,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { setHasPageContentFocus } = useDispatch( editSiteStore );\n\n\tconst [ hasEditedTemplate, setHasEditedTemplate ] = useState( false );\n\tconst prevHasPageContentFocus = useRef( false );\n\tuseEffect( () => {\n\t\tif ( prevHasPageContentFocus.current && ! hasPageContentFocus ) {\n\t\t\tsetHasEditedTemplate( true );\n\t\t}\n\t\tprevHasPageContentFocus.current = hasPageContentFocus;\n\t}, [ hasPageContentFocus ] );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\tif ( ! isFound ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn hasPageContentFocus ? (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ classnames( 'is-page', {\n\t\t\t\t'is-animated': hasEditedTemplate,\n\t\t\t} ) }\n\t\t\ticon={ pageIcon }\n\t\t>\n\t\t\t{ title }\n\t\t</BaseDocumentActions>\n\t) : (\n\t\t<TemplateDocumentActions\n\t\t\tclassName=\"is-animated\"\n\t\t\tonBack={ () => setHasPageContentFocus( true ) }\n\t\t/>\n\t);\n}\n\nfunction TemplateDocumentActions( { className, onBack } ) {\n\tconst { isLoaded, record, getTitle, icon } = useEditedEntityRecord();\n\n\tif ( ! isLoaded ) {\n\t\treturn null;\n\t}\n\n\tif ( ! record ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst entityLabel = getEntityLabel( record.type );\n\n\treturn (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ className }\n\t\t\ticon={ record.type === 'wp_navigation' ? navigationIcon : icon }\n\t\t\tonBack={ onBack }\n\t\t>\n\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: %s: the entity being edited, like \"template\"*/\n\t\t\t\t\t__( 'Editing %s: ' ),\n\t\t\t\t\tentityLabel\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t\t{ getTitle() }\n\t\t</BaseDocumentActions>\n\t);\n}\n\nfunction BaseDocumentActions( { className, icon, children, onBack } ) {\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-document-actions', className ) }\n\t\t>\n\t\t\t{ onBack && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-document-actions__back\"\n\t\t\t\t\ticon={ chevronLeftSmallIcon }\n\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tonBack();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-document-actions__command\"\n\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tclassName=\"edit-site-document-actions__title\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</Text>\n\t\t\t\t</HStack>\n\t\t\t\t<span className=\"edit-site-document-actions__shortcut\">\n\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t</span>\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n\nfunction getEntityLabel( entityType ) {\n\tlet label = '';\n\tswitch ( entityType ) {\n\t\tcase 'wp_navigation':\n\t\t\tlabel = 'navigation menu';\n\t\t\tbreak;\n\t\tcase 'wp_template_part':\n\t\t\tlabel = 'template part';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tlabel = 'template';\n\t\t\tbreak;\n\t}\n\n\treturn label;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/header-edit-mode/document-actions/index.js"],"names":["DocumentActions","isPage","select","editSiteStore","PageDocumentActions","hasPageContentFocus","hasResolved","isFound","title","_hasPageContentFocus","getEditedPostContext","getEditedEntityRecord","hasFinishedResolution","coreStore","context","queryArgs","postType","postId","page","setHasPageContentFocus","hasEditedTemplate","setHasEditedTemplate","prevHasPageContentFocus","current","pageIcon","TemplateDocumentActions","className","onBack","isLoaded","record","getTitle","icon","entityLabel","getEntityLabel","type","typeIcon","navigationIcon","symbol","BaseDocumentActions","children","open","openCommandCenter","commandsStore","chevronLeftSmallIcon","event","stopPropagation","displayShortcut","primary","entityType","label"],"mappings":";;;;;;;;;AAyBA;;AAtBA;;AAKA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AAMA;;AAEA;;AAKA;;AACA;;AAhCA;AACA;AACA;;AAGA;AACA;AACA;;AAqBA;AACA;AACA;AAIe,SAASA,eAAT,GAA2B;AACzC,QAAMC,MAAM,GAAG,qBAAaC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBF,MAAxB,EAAzB,CAAf;AACA,SAAOA,MAAM,GAAG,4BAAC,mBAAD,OAAH,GAA6B,4BAAC,uBAAD,OAA1C;AACA;;AAED,SAASG,mBAAT,GAA+B;AAC9B,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA,WAAvB;AAAoCC,IAAAA,OAApC;AAA6CC,IAAAA;AAA7C,MAAuD,qBAC1DN,MAAF,IAAc;AACb,UAAM;AACLG,MAAAA,mBAAmB,EAAEI,oBADhB;AAELC,MAAAA;AAFK,QAGFR,MAAM,CAAEC,YAAF,CAHV;AAIA,UAAM;AAAEQ,MAAAA,qBAAF;AAAyBC,MAAAA;AAAzB,QACLV,MAAM,CAAEW,eAAF,CADP;AAEA,UAAMC,OAAO,GAAGJ,oBAAoB,EAApC;AACA,UAAMK,SAAS,GAAG,CAAE,UAAF,EAAcD,OAAO,CAACE,QAAtB,EAAgCF,OAAO,CAACG,MAAxC,CAAlB;AACA,UAAMC,IAAI,GAAGP,qBAAqB,CAAE,GAAGI,SAAL,CAAlC;AACA,WAAO;AACNV,MAAAA,mBAAmB,EAAEI,oBAAoB,EADnC;AAENH,MAAAA,WAAW,EAAEM,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,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,OAAO,EAAG,MAAMc,iBAAiB;AAFlC,KAIC,4BAAC,gCAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,OAAO,EAAG,CAFX;AAGC,IAAA,OAAO,EAAC;AAHT,KAKC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAGV;AAAlB,IALD,EAMC,4BAAC,8BAAD;AAAM,IAAA,IAAI,EAAC,MAAX;AAAkB,IAAA,EAAE,EAAC;AAArB,KACGQ,QADH,CAND,CAJD,EAcC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGO,0BAAgBC,OAAhB,CAAyB,GAAzB,CADH,CAdD,CAfD,CADD;AAoCA;;AAED,SAASd,cAAT,CAAyBe,UAAzB,EAAsC;AACrC,MAAIC,KAAK,GAAG,EAAZ;;AACA,UAASD,UAAT;AACC,SAAK,eAAL;AACCC,MAAAA,KAAK,GAAG,iBAAR;AACA;;AACD,SAAK,kBAAL;AACCA,MAAAA,KAAK,GAAG,eAAR;AACA;;AACD;AACCA,MAAAA,KAAK,GAAG,UAAR;AACA;AATF;;AAYA,SAAOA,KAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\tVisuallyHidden,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { store as commandsStore } from '@wordpress/commands';\nimport {\n\tchevronLeftSmall as chevronLeftSmallIcon,\n\tpage as pageIcon,\n\tnavigation as navigationIcon,\n\tsymbol,\n} from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../../use-edited-entity-record';\nimport { store as editSiteStore } from '../../../store';\n\nexport default function DocumentActions() {\n\tconst isPage = useSelect( ( select ) => select( editSiteStore ).isPage() );\n\treturn isPage ? <PageDocumentActions /> : <TemplateDocumentActions />;\n}\n\nfunction PageDocumentActions() {\n\tconst { hasPageContentFocus, hasResolved, isFound, title } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasPageContentFocus: _hasPageContentFocus,\n\t\t\t\tgetEditedPostContext,\n\t\t\t} = select( editSiteStore );\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst context = getEditedPostContext();\n\t\t\tconst queryArgs = [ 'postType', context.postType, context.postId ];\n\t\t\tconst page = getEditedEntityRecord( ...queryArgs );\n\t\t\treturn {\n\t\t\t\thasPageContentFocus: _hasPageContentFocus(),\n\t\t\t\thasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t\tisFound: !! page,\n\t\t\t\ttitle: page?.title,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { setHasPageContentFocus } = useDispatch( editSiteStore );\n\n\tconst [ hasEditedTemplate, setHasEditedTemplate ] = useState( false );\n\tconst prevHasPageContentFocus = useRef( false );\n\tuseEffect( () => {\n\t\tif ( prevHasPageContentFocus.current && ! hasPageContentFocus ) {\n\t\t\tsetHasEditedTemplate( true );\n\t\t}\n\t\tprevHasPageContentFocus.current = hasPageContentFocus;\n\t}, [ hasPageContentFocus ] );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\tif ( ! isFound ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn hasPageContentFocus ? (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ classnames( 'is-page', {\n\t\t\t\t'is-animated': hasEditedTemplate,\n\t\t\t} ) }\n\t\t\ticon={ pageIcon }\n\t\t>\n\t\t\t{ title }\n\t\t</BaseDocumentActions>\n\t) : (\n\t\t<TemplateDocumentActions\n\t\t\tclassName=\"is-animated\"\n\t\t\tonBack={ () => setHasPageContentFocus( true ) }\n\t\t/>\n\t);\n}\n\nfunction TemplateDocumentActions( { className, onBack } ) {\n\tconst { isLoaded, record, getTitle, icon } = useEditedEntityRecord();\n\n\tif ( ! isLoaded ) {\n\t\treturn null;\n\t}\n\n\tif ( ! record ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst entityLabel = getEntityLabel( record.type );\n\n\tlet typeIcon = icon;\n\tif ( record.type === 'wp_navigation' ) {\n\t\ttypeIcon = navigationIcon;\n\t} else if ( record.type === 'wp_block' ) {\n\t\ttypeIcon = symbol;\n\t}\n\n\treturn (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ className }\n\t\t\ticon={ typeIcon }\n\t\t\tonBack={ onBack }\n\t\t>\n\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: %s: the entity being edited, like \"template\"*/\n\t\t\t\t\t__( 'Editing %s: ' ),\n\t\t\t\t\tentityLabel\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t\t{ getTitle() }\n\t\t</BaseDocumentActions>\n\t);\n}\n\nfunction BaseDocumentActions( { className, icon, children, onBack } ) {\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-document-actions', className ) }\n\t\t>\n\t\t\t{ onBack && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-document-actions__back\"\n\t\t\t\t\ticon={ chevronLeftSmallIcon }\n\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tonBack();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-document-actions__command\"\n\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tclassName=\"edit-site-document-actions__title\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</Text>\n\t\t\t\t</HStack>\n\t\t\t\t<span className=\"edit-site-document-actions__shortcut\">\n\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t</span>\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n\nfunction getEntityLabel( entityType ) {\n\tlet label = '';\n\tswitch ( entityType ) {\n\t\tcase 'wp_navigation':\n\t\t\tlabel = 'navigation menu';\n\t\t\tbreak;\n\t\tcase 'wp_template_part':\n\t\t\tlabel = 'template part';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tlabel = 'template';\n\t\t\tbreak;\n\t}\n\n\treturn label;\n}\n"]}
@@ -75,6 +75,7 @@ function HeaderEditMode() {
75
75
  isListViewOpen,
76
76
  listViewShortcut,
77
77
  isVisualMode,
78
+ isDistractionFree,
78
79
  blockEditorMode,
79
80
  homeUrl,
80
81
  showIconLabels,
@@ -108,9 +109,14 @@ function HeaderEditMode() {
108
109
  blockEditorMode: __unstableGetEditorMode(),
109
110
  homeUrl: getUnstableBase()?.home,
110
111
  showIconLabels: select(_preferences.store).get('core/edit-site', 'showIconLabels'),
111
- editorCanvasView: (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView()
112
+ editorCanvasView: (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(),
113
+ isDistractionFree: select(_preferences.store).get('core/edit-site', 'distractionFree')
112
114
  };
113
115
  }, []);
116
+ const {
117
+ get: getPreference
118
+ } = (0, _data.useSelect)(_preferences.store);
119
+ const hasFixedToolbar = getPreference(_store.store.name, 'fixedToolbar');
114
120
  const {
115
121
  __experimentalSetPreviewDeviceType: setPreviewDeviceType,
116
122
  setIsInserterOpened,
@@ -119,6 +125,7 @@ function HeaderEditMode() {
119
125
  const {
120
126
  __unstableSetEditorMode
121
127
  } = (0, _data.useDispatch)(_blockEditor.store);
128
+ const disableMotion = (0, _compose.useReducedMotion)();
122
129
  const isLargeViewport = (0, _compose.useViewportMatch)('medium');
123
130
  const toggleInserter = (0, _element.useCallback)(() => {
124
131
  if (isInserterOpen) {
@@ -148,17 +155,39 @@ function HeaderEditMode() {
148
155
  const shortLabel = !isInserterOpen ? (0, _i18n.__)('Add') : (0, _i18n.__)('Close');
149
156
  const isZoomedOutViewExperimentEnabled = window?.__experimentalEnableZoomedOutView && isVisualMode;
150
157
  const isZoomedOutView = blockEditorMode === 'zoom-out';
158
+ const toolbarVariants = {
159
+ isDistractionFree: {
160
+ y: '-50px'
161
+ },
162
+ isDistractionFreeHovering: {
163
+ y: 0
164
+ },
165
+ view: {
166
+ y: 0
167
+ },
168
+ edit: {
169
+ y: 0
170
+ }
171
+ };
172
+ const toolbarTransition = {
173
+ type: 'tween',
174
+ duration: disableMotion ? 0 : 0.2,
175
+ ease: 'easeOut'
176
+ };
151
177
  return (0, _element.createElement)("div", {
152
178
  className: (0, _classnames.default)('edit-site-header-edit-mode', {
153
179
  'show-icon-labels': showIconLabels
154
180
  })
155
181
  }, hasDefaultEditorCanvasView && (0, _element.createElement)(_blockEditor.NavigableToolbar, {
182
+ as: _components.__unstableMotion.div,
156
183
  className: "edit-site-header-edit-mode__start",
157
184
  "aria-label": (0, _i18n.__)('Document tools'),
158
- shouldUseKeyboardFocusShortcut: !blockToolbarCanBeFocused
185
+ shouldUseKeyboardFocusShortcut: !blockToolbarCanBeFocused,
186
+ variants: toolbarVariants,
187
+ transition: toolbarTransition
159
188
  }, (0, _element.createElement)("div", {
160
189
  className: "edit-site-header-edit-mode__toolbar"
161
- }, (0, _element.createElement)(_components.ToolbarItem, {
190
+ }, !isDistractionFree && (0, _element.createElement)(_components.ToolbarItem, {
162
191
  ref: inserterButton,
163
192
  as: _components.Button,
164
193
  className: "edit-site-header-edit-mode__inserter-toggle",
@@ -170,7 +199,7 @@ function HeaderEditMode() {
170
199
  icon: _icons.plus,
171
200
  label: showIconLabels ? shortLabel : longLabel,
172
201
  showTooltip: !showIconLabels
173
- }), isLargeViewport && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.ToolbarItem, {
202
+ }), isLargeViewport && (0, _element.createElement)(_element.Fragment, null, !hasFixedToolbar && (0, _element.createElement)(_components.ToolbarItem, {
174
203
  as: _blockEditor.ToolSelector,
175
204
  showTooltip: !showIconLabels,
176
205
  variant: showIconLabels ? 'tertiary' : undefined,
@@ -183,7 +212,7 @@ function HeaderEditMode() {
183
212
  as: _redo.default,
184
213
  showTooltip: !showIconLabels,
185
214
  variant: showIconLabels ? 'tertiary' : undefined
186
- }), (0, _element.createElement)(_components.ToolbarItem, {
215
+ }), !isDistractionFree && (0, _element.createElement)(_components.ToolbarItem, {
187
216
  as: _components.Button,
188
217
  className: "edit-site-header-edit-mode__list-view-toggle",
189
218
  disabled: !isVisualMode || isZoomedOutView,
@@ -196,7 +225,7 @@ function HeaderEditMode() {
196
225
  shortcut: listViewShortcut,
197
226
  showTooltip: !showIconLabels,
198
227
  variant: showIconLabels ? 'tertiary' : undefined
199
- }), isZoomedOutViewExperimentEnabled && (0, _element.createElement)(_components.ToolbarItem, {
228
+ }), isZoomedOutViewExperimentEnabled && !isDistractionFree && !hasFixedToolbar && (0, _element.createElement)(_components.ToolbarItem, {
200
229
  as: _components.Button,
201
230
  className: "edit-site-header-edit-mode__zoom-out-view-toggle",
202
231
  icon: _icons.chevronUpDown,
@@ -209,12 +238,14 @@ function HeaderEditMode() {
209
238
 
210
239
  __unstableSetEditorMode(isZoomedOutView ? 'edit' : 'zoom-out');
211
240
  }
212
- })))), (0, _element.createElement)("div", {
241
+ })))), !isDistractionFree && (0, _element.createElement)("div", {
213
242
  className: "edit-site-header-edit-mode__center"
214
243
  }, !hasDefaultEditorCanvasView ? (0, _editorCanvasContainer.getEditorCanvasContainerTitle)(editorCanvasView) : (0, _element.createElement)(_documentActions.default, null)), (0, _element.createElement)("div", {
215
244
  className: "edit-site-header-edit-mode__end"
216
- }, (0, _element.createElement)("div", {
217
- className: "edit-site-header-edit-mode__actions"
245
+ }, (0, _element.createElement)(_components.__unstableMotion.div, {
246
+ className: "edit-site-header-edit-mode__actions",
247
+ variants: toolbarVariants,
248
+ transition: toolbarTransition
218
249
  }, !isFocusMode && hasDefaultEditorCanvasView && (0, _element.createElement)("div", {
219
250
  className: (0, _classnames.default)('edit-site-header-edit-mode__preview-options', {
220
251
  'is-zoomed-out': isZoomedOutView
@@ -231,7 +262,7 @@ function HeaderEditMode() {
231
262
  as: "span"
232
263
  },
233
264
  /* translators: accessibility text */
234
- (0, _i18n.__)('(opens in a new tab)')))))), (0, _element.createElement)(_saveButton.default, null), (0, _element.createElement)(_interface.PinnedItems.Slot, {
265
+ (0, _i18n.__)('(opens in a new tab)')))))), (0, _element.createElement)(_saveButton.default, null), !isDistractionFree && (0, _element.createElement)(_interface.PinnedItems.Slot, {
235
266
  scope: "core/edit-site"
236
267
  }), (0, _element.createElement)(_moreMenu.default, {
237
268
  showIconLabels: showIconLabels
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/header-edit-mode/index.js"],"names":["useShouldContextualToolbarShow","blockEditorPrivateApis","preventDefault","event","HeaderEditMode","inserterButton","deviceType","templateType","isInserterOpen","isListViewOpen","listViewShortcut","isVisualMode","blockEditorMode","homeUrl","showIconLabels","editorCanvasView","select","__experimentalGetPreviewDeviceType","getEditedPostType","isInserterOpened","isListViewOpened","getEditorMode","editSiteStore","getShortcutRepresentation","keyboardShortcutsStore","__unstableGetEditorMode","blockEditorStore","postType","getUnstableBase","coreStore","home","preferencesStore","get","getEditorCanvasContainerView","__experimentalSetPreviewDeviceType","setPreviewDeviceType","setIsInserterOpened","setIsListViewOpened","__unstableSetEditorMode","isLargeViewport","toggleInserter","current","focus","toggleListView","shouldShowContextualToolbar","canFocusHiddenToolbar","fixedToolbarCanBeFocused","blockToolbarCanBeFocused","hasDefaultEditorCanvasView","isFocusMode","longLabel","shortLabel","isZoomedOutViewExperimentEnabled","window","__experimentalEnableZoomedOutView","isZoomedOutView","Button","plus","ToolSelector","undefined","UndoButton","RedoButton","listView","chevronUpDown","external"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AA7CA;AACA;AACA;;AAGA;AACA;AACA;;AAyBA;AACA;AACA;AAaA,MAAM;AAAEA,EAAAA;AAAF,IAAqC,wBAAQC,wBAAR,CAA3C;;AAEA,MAAMC,cAAc,GAAKC,KAAF,IAAa;AACnCA,EAAAA,KAAK,CAACD,cAAN;AACA,CAFD;;AAIe,SAASE,cAAT,GAA0B;AACxC,QAAMC,cAAc,GAAG,sBAAvB;AACA,QAAM;AACLC,IAAAA,UADK;AAELC,IAAAA,YAFK;AAGLC,IAAAA,cAHK;AAILC,IAAAA,cAJK;AAKLC,IAAAA,gBALK;AAMLC,IAAAA,YANK;AAOLC,IAAAA,eAPK;AAQLC,IAAAA,OARK;AASLC,IAAAA,cATK;AAULC,IAAAA;AAVK,MAWF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AACLC,MAAAA,kCADK;AAELC,MAAAA,iBAFK;AAGLC,MAAAA,gBAHK;AAILC,MAAAA,gBAJK;AAKLC,MAAAA;AALK,QAMFL,MAAM,CAAEM,YAAF,CANV;AAOA,UAAM;AAAEC,MAAAA;AAAF,QAAgCP,MAAM,CAA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,CApGD,CADD;AA4IA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tToolSelector,\n\t__experimentalPreviewOptions as PreviewOptions,\n\tNavigableToolbar,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { _x, __ } from '@wordpress/i18n';\nimport { listView, plus, external, chevronUpDown } from '@wordpress/icons';\nimport {\n\tButton,\n\tToolbarItem,\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport MoreMenu from './more-menu';\nimport SaveButton from '../save-button';\nimport UndoButton from './undo-redo/undo';\nimport RedoButton from './undo-redo/redo';\nimport DocumentActions from './document-actions';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tgetEditorCanvasContainerTitle,\n\tuseHasEditorCanvasContainer,\n} from '../editor-canvas-container';\nimport { unlock } from '../../lock-unlock';\n\nconst { useShouldContextualToolbarShow } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nexport default function HeaderEditMode() {\n\tconst inserterButton = useRef();\n\tconst {\n\t\tdeviceType,\n\t\ttemplateType,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tisVisualMode,\n\t\tblockEditorMode,\n\t\thomeUrl,\n\t\tshowIconLabels,\n\t\teditorCanvasView,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\tgetEditedPostType,\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t} = select( editSiteStore );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\n\t\tconst postType = getEditedPostType();\n\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\n\t\treturn {\n\t\t\tdeviceType: __experimentalGetPreviewDeviceType(),\n\t\t\ttemplateType: postType,\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/edit-site/toggle-list-view'\n\t\t\t),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\teditorCanvasView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\t__experimentalSetPreviewDeviceType: setPreviewDeviceType,\n\t\tsetIsInserterOpened,\n\t\tsetIsListViewOpened,\n\t} = useDispatch( editSiteStore );\n\tconst { __unstableSetEditorMode } = useDispatch( blockEditorStore );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpen ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpen, setIsInserterOpened ] );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst {\n\t\tshouldShowContextualToolbar,\n\t\tcanFocusHiddenToolbar,\n\t\tfixedToolbarCanBeFocused,\n\t} = useShouldContextualToolbarShow();\n\t// If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.\n\t// There's a fixed block toolbar when the fixed toolbar option is enabled or when the browser width is less than the large viewport.\n\tconst blockToolbarCanBeFocused =\n\t\tshouldShowContextualToolbar ||\n\t\tcanFocusHiddenToolbar ||\n\t\tfixedToolbarCanBeFocused;\n\n\tconst hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();\n\n\tconst isFocusMode =\n\t\ttemplateType === 'wp_template_part' || templateType === 'wp_navigation';\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpen ? __( 'Add' ) : __( 'Close' );\n\n\tconst isZoomedOutViewExperimentEnabled =\n\t\twindow?.__experimentalEnableZoomedOutView && isVisualMode;\n\tconst isZoomedOutView = blockEditorMode === 'zoom-out';\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-header-edit-mode', {\n\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t} ) }\n\t\t>\n\t\t\t{ hasDefaultEditorCanvasView && (\n\t\t\t\t<NavigableToolbar\n\t\t\t\t\tclassName=\"edit-site-header-edit-mode__start\"\n\t\t\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\t\t\tshouldUseKeyboardFocusShortcut={\n\t\t\t\t\t\t! blockToolbarCanBeFocused\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"edit-site-header-edit-mode__toolbar\">\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__inserter-toggle\"\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\t\tdisabled={ ! isVisualMode }\n\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdisabled={ ! isVisualMode }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\tas={ UndoButton }\n\t\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\tas={ RedoButton }\n\t\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__list-view-toggle\"\n\t\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\t\t! isVisualMode || isZoomedOutView\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ isZoomedOutViewExperimentEnabled && (\n\t\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__zoom-out-view-toggle\"\n\t\t\t\t\t\t\t\t\t\ticon={ chevronUpDown }\n\t\t\t\t\t\t\t\t\t\tisPressed={ isZoomedOutView }\n\t\t\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Zoom-out View' ) }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetPreviewDeviceType( 'desktop' );\n\t\t\t\t\t\t\t\t\t\t\t__unstableSetEditorMode(\n\t\t\t\t\t\t\t\t\t\t\t\tisZoomedOutView\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'edit'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'zoom-out'\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\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</div>\n\t\t\t\t</NavigableToolbar>\n\t\t\t) }\n\n\t\t\t<div className=\"edit-site-header-edit-mode__center\">\n\t\t\t\t{ ! hasDefaultEditorCanvasView ? (\n\t\t\t\t\tgetEditorCanvasContainerTitle( editorCanvasView )\n\t\t\t\t) : (\n\t\t\t\t\t<DocumentActions />\n\t\t\t\t) }\n\t\t\t</div>\n\n\t\t\t<div className=\"edit-site-header-edit-mode__end\">\n\t\t\t\t<div className=\"edit-site-header-edit-mode__actions\">\n\t\t\t\t\t{ ! isFocusMode && hasDefaultEditorCanvasView && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-header-edit-mode__preview-options',\n\t\t\t\t\t\t\t\t{ 'is-zoomed-out': isZoomedOutView }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreviewOptions\n\t\t\t\t\t\t\t\tdeviceType={ deviceType }\n\t\t\t\t\t\t\t\tsetDeviceType={ setPreviewDeviceType }\n\t\t\t\t\t\t\t\tlabel={ __( 'View' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\t\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t</PreviewOptions>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<SaveButton />\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/header-edit-mode/index.js"],"names":["useShouldContextualToolbarShow","blockEditorPrivateApis","preventDefault","event","HeaderEditMode","inserterButton","deviceType","templateType","isInserterOpen","isListViewOpen","listViewShortcut","isVisualMode","isDistractionFree","blockEditorMode","homeUrl","showIconLabels","editorCanvasView","select","__experimentalGetPreviewDeviceType","getEditedPostType","isInserterOpened","isListViewOpened","getEditorMode","editSiteStore","getShortcutRepresentation","keyboardShortcutsStore","__unstableGetEditorMode","blockEditorStore","postType","getUnstableBase","coreStore","home","preferencesStore","get","getEditorCanvasContainerView","getPreference","hasFixedToolbar","name","__experimentalSetPreviewDeviceType","setPreviewDeviceType","setIsInserterOpened","setIsListViewOpened","__unstableSetEditorMode","disableMotion","isLargeViewport","toggleInserter","current","focus","toggleListView","shouldShowContextualToolbar","canFocusHiddenToolbar","fixedToolbarCanBeFocused","blockToolbarCanBeFocused","hasDefaultEditorCanvasView","isFocusMode","longLabel","shortLabel","isZoomedOutViewExperimentEnabled","window","__experimentalEnableZoomedOutView","isZoomedOutView","toolbarVariants","y","isDistractionFreeHovering","view","edit","toolbarTransition","type","duration","ease","motion","div","Button","plus","ToolSelector","undefined","UndoButton","RedoButton","listView","chevronUpDown","external"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AAKA;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W,EAEX;AAAE,uBAAiBO;AAAnB,KAFW;AADb,KAMC,4BAAC,yCAAD;AACC,IAAA,UAAU,EAAGtD,UADd;AAEC,IAAA,aAAa,EAAGiC,oBAFjB;AAGC,IAAA,KAAK,EAAG,cAAI,MAAJ;AAHT,KAKC,4BAAC,qBAAD,QACC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAGzB,OADR;AAEC,IAAA,MAAM,EAAC,QAFR;AAGC,IAAA,IAAI,EAAGkE;AAHR,KAKG,cAAI,WAAJ,CALH,EAMC,4BAAC,0BAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB;AAEE;AACA,gBAAI,sBAAJ,CAHF,CAND,CADD,CALD,CAND,CANF,EAmCC,4BAAC,mBAAD,OAnCD,EAoCG,CAAEpE,iBAAF,IACD,4BAAC,sBAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IArCF,EAuCC,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGG;AAA3B,IAvCD,CADD,CAzHD,CADD;AAuKA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useViewportMatch, useReducedMotion } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tToolSelector,\n\t__experimentalPreviewOptions as PreviewOptions,\n\tNavigableToolbar,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { _x, __ } from '@wordpress/i18n';\nimport { listView, plus, external, chevronUpDown } from '@wordpress/icons';\nimport {\n\t__unstableMotion as motion,\n\tButton,\n\tToolbarItem,\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport MoreMenu from './more-menu';\nimport SaveButton from '../save-button';\nimport UndoButton from './undo-redo/undo';\nimport RedoButton from './undo-redo/redo';\nimport DocumentActions from './document-actions';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tgetEditorCanvasContainerTitle,\n\tuseHasEditorCanvasContainer,\n} from '../editor-canvas-container';\nimport { unlock } from '../../lock-unlock';\n\nconst { useShouldContextualToolbarShow } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nexport default function HeaderEditMode() {\n\tconst inserterButton = useRef();\n\tconst {\n\t\tdeviceType,\n\t\ttemplateType,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tisVisualMode,\n\t\tisDistractionFree,\n\t\tblockEditorMode,\n\t\thomeUrl,\n\t\tshowIconLabels,\n\t\teditorCanvasView,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\tgetEditedPostType,\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t} = select( editSiteStore );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\n\t\tconst postType = getEditedPostType();\n\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\n\t\treturn {\n\t\t\tdeviceType: __experimentalGetPreviewDeviceType(),\n\t\t\ttemplateType: postType,\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/edit-site/toggle-list-view'\n\t\t\t),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\teditorCanvasView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\tconst hasFixedToolbar = getPreference( editSiteStore.name, 'fixedToolbar' );\n\n\tconst {\n\t\t__experimentalSetPreviewDeviceType: setPreviewDeviceType,\n\t\tsetIsInserterOpened,\n\t\tsetIsListViewOpened,\n\t} = useDispatch( editSiteStore );\n\tconst { __unstableSetEditorMode } = useDispatch( blockEditorStore );\n\tconst disableMotion = useReducedMotion();\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpen ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpen, setIsInserterOpened ] );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst {\n\t\tshouldShowContextualToolbar,\n\t\tcanFocusHiddenToolbar,\n\t\tfixedToolbarCanBeFocused,\n\t} = useShouldContextualToolbarShow();\n\t// If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.\n\t// There's a fixed block toolbar when the fixed toolbar option is enabled or when the browser width is less than the large viewport.\n\tconst blockToolbarCanBeFocused =\n\t\tshouldShowContextualToolbar ||\n\t\tcanFocusHiddenToolbar ||\n\t\tfixedToolbarCanBeFocused;\n\n\tconst hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();\n\n\tconst isFocusMode =\n\t\ttemplateType === 'wp_template_part' || templateType === 'wp_navigation';\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpen ? __( 'Add' ) : __( 'Close' );\n\n\tconst isZoomedOutViewExperimentEnabled =\n\t\twindow?.__experimentalEnableZoomedOutView && isVisualMode;\n\tconst isZoomedOutView = blockEditorMode === 'zoom-out';\n\n\tconst toolbarVariants = {\n\t\tisDistractionFree: { y: '-50px' },\n\t\tisDistractionFreeHovering: { y: 0 },\n\t\tview: { y: 0 },\n\t\tedit: { y: 0 },\n\t};\n\n\tconst toolbarTransition = {\n\t\ttype: 'tween',\n\t\tduration: disableMotion ? 0 : 0.2,\n\t\tease: 'easeOut',\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-header-edit-mode', {\n\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t} ) }\n\t\t>\n\t\t\t{ hasDefaultEditorCanvasView && (\n\t\t\t\t<NavigableToolbar\n\t\t\t\t\tas={ motion.div }\n\t\t\t\t\tclassName=\"edit-site-header-edit-mode__start\"\n\t\t\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\t\t\tshouldUseKeyboardFocusShortcut={\n\t\t\t\t\t\t! blockToolbarCanBeFocused\n\t\t\t\t\t}\n\t\t\t\t\tvariants={ toolbarVariants }\n\t\t\t\t\ttransition={ toolbarTransition }\n\t\t\t\t>\n\t\t\t\t\t<div className=\"edit-site-header-edit-mode__toolbar\">\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__inserter-toggle\"\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\t\t\tdisabled={ ! isVisualMode }\n\t\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? shortLabel : longLabel\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{ ! hasFixedToolbar && (\n\t\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\tshowIconLabels\n\t\t\t\t\t\t\t\t\t\t\t\t? 'tertiary'\n\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdisabled={ ! isVisualMode }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\tas={ UndoButton }\n\t\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\tas={ RedoButton }\n\t\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__list-view-toggle\"\n\t\t\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\t\t\t! isVisualMode || isZoomedOutView\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\tshowIconLabels\n\t\t\t\t\t\t\t\t\t\t\t\t? 'tertiary'\n\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isZoomedOutViewExperimentEnabled &&\n\t\t\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\t\t\t! hasFixedToolbar && (\n\t\t\t\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__zoom-out-view-toggle\"\n\t\t\t\t\t\t\t\t\t\t\ticon={ chevronUpDown }\n\t\t\t\t\t\t\t\t\t\t\tisPressed={ isZoomedOutView }\n\t\t\t\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Zoom-out View' ) }\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetPreviewDeviceType(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'desktop'\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t__unstableSetEditorMode(\n\t\t\t\t\t\t\t\t\t\t\t\t\tisZoomedOutView\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'edit'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'zoom-out'\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\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</div>\n\t\t\t\t</NavigableToolbar>\n\t\t\t) }\n\n\t\t\t{ ! isDistractionFree && (\n\t\t\t\t<div className=\"edit-site-header-edit-mode__center\">\n\t\t\t\t\t{ ! hasDefaultEditorCanvasView ? (\n\t\t\t\t\t\tgetEditorCanvasContainerTitle( editorCanvasView )\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DocumentActions />\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t<div className=\"edit-site-header-edit-mode__end\">\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-header-edit-mode__actions\"\n\t\t\t\t\tvariants={ toolbarVariants }\n\t\t\t\t\ttransition={ toolbarTransition }\n\t\t\t\t>\n\t\t\t\t\t{ ! isFocusMode && hasDefaultEditorCanvasView && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-header-edit-mode__preview-options',\n\t\t\t\t\t\t\t\t{ 'is-zoomed-out': isZoomedOutView }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreviewOptions\n\t\t\t\t\t\t\t\tdeviceType={ deviceType }\n\t\t\t\t\t\t\t\tsetDeviceType={ setPreviewDeviceType }\n\t\t\t\t\t\t\t\tlabel={ __( 'View' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\t\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t</PreviewOptions>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<SaveButton />\n\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t) }\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t</motion.div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
@@ -11,7 +11,7 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _i18n = require("@wordpress/i18n");
13
13
 
14
- var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
14
+ var _data = require("@wordpress/data");
15
15
 
16
16
  var _keycodes = require("@wordpress/keycodes");
17
17
 
@@ -23,9 +23,9 @@ var _interface = require("@wordpress/interface");
23
23
 
24
24
  var _preferences = require("@wordpress/preferences");
25
25
 
26
- var _keyboardShortcutHelpModal = _interopRequireDefault(require("../../keyboard-shortcut-help-modal"));
26
+ var _keyboardShortcutHelpModal = _interopRequireWildcard(require("../../keyboard-shortcut-help-modal"));
27
27
 
28
- var _preferencesModal = _interopRequireDefault(require("../../preferences-modal"));
28
+ var _preferencesModal = _interopRequireWildcard(require("../../preferences-modal"));
29
29
 
30
30
  var _toolsMoreMenuGroup = _interopRequireDefault(require("../tools-more-menu-group"));
31
31
 
@@ -37,6 +37,12 @@ var _copyContentMenuItem = _interopRequireDefault(require("./copy-content-menu-i
37
37
 
38
38
  var _modeSwitcher = _interopRequireDefault(require("../mode-switcher"));
39
39
 
40
+ var _store = require("../../../store");
41
+
42
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
43
+
44
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
45
+
40
46
  /**
41
47
  * WordPress dependencies
42
48
  */
@@ -47,9 +53,29 @@ var _modeSwitcher = _interopRequireDefault(require("../mode-switcher"));
47
53
  function MoreMenu({
48
54
  showIconLabels
49
55
  }) {
50
- const [isModalActive, toggleModal] = (0, _element.useReducer)(isActive => !isActive, false);
51
- const [isPreferencesModalActive, togglePreferencesModal] = (0, _element.useReducer)(isActive => !isActive, false);
52
- (0, _keyboardShortcuts.useShortcut)('core/edit-site/keyboard-shortcuts', toggleModal);
56
+ const registry = (0, _data.useRegistry)();
57
+ const isDistractionFree = (0, _data.useSelect)(select => select(_preferences.store).get('core/edit-site', 'distractionFree'), []);
58
+ const {
59
+ setIsInserterOpened,
60
+ setIsListViewOpened,
61
+ closeGeneralSidebar
62
+ } = (0, _data.useDispatch)(_store.store);
63
+ const {
64
+ openModal
65
+ } = (0, _data.useDispatch)(_interface.store);
66
+ const {
67
+ set: setPreference
68
+ } = (0, _data.useDispatch)(_preferences.store);
69
+
70
+ const toggleDistractionFree = () => {
71
+ registry.batch(() => {
72
+ setPreference('core/edit-site', 'fixedToolbar', false);
73
+ setIsInserterOpened(false);
74
+ setIsListViewOpened(false);
75
+ closeGeneralSidebar();
76
+ });
77
+ };
78
+
53
79
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_interface.MoreMenuDropdown, {
54
80
  toggleProps: {
55
81
  showTooltip: !showIconLabels,
@@ -64,6 +90,7 @@ function MoreMenu({
64
90
  }, (0, _element.createElement)(_preferences.PreferenceToggleMenuItem, {
65
91
  scope: "core/edit-site",
66
92
  name: "fixedToolbar",
93
+ disabled: isDistractionFree,
67
94
  label: (0, _i18n.__)('Top toolbar'),
68
95
  info: (0, _i18n.__)('Access all block and document tools in a single place'),
69
96
  messageActivated: (0, _i18n.__)('Top toolbar activated'),
@@ -75,17 +102,26 @@ function MoreMenu({
75
102
  info: (0, _i18n.__)('Focus on one block at a time'),
76
103
  messageActivated: (0, _i18n.__)('Spotlight mode activated'),
77
104
  messageDeactivated: (0, _i18n.__)('Spotlight mode deactivated')
78
- }), (0, _element.createElement)(_modeSwitcher.default, null), (0, _element.createElement)(_interface.ActionItem.Slot, {
105
+ }), (0, _element.createElement)(_preferences.PreferenceToggleMenuItem, {
106
+ scope: "core/edit-site",
107
+ name: "distractionFree",
108
+ onToggle: toggleDistractionFree,
109
+ label: (0, _i18n.__)('Distraction free'),
110
+ info: (0, _i18n.__)('Write with calmness'),
111
+ messageActivated: (0, _i18n.__)('Distraction free mode activated'),
112
+ messageDeactivated: (0, _i18n.__)('Distraction free mode deactivated'),
113
+ shortcut: _keycodes.displayShortcut.primaryShift('\\')
114
+ })), (0, _element.createElement)(_modeSwitcher.default, null), (0, _element.createElement)(_interface.ActionItem.Slot, {
79
115
  name: "core/edit-site/plugin-more-menu",
80
116
  label: (0, _i18n.__)('Plugins'),
81
117
  as: _components.MenuGroup,
82
118
  fillProps: {
83
119
  onClick: onClose
84
120
  }
85
- })), (0, _element.createElement)(_components.MenuGroup, {
121
+ }), (0, _element.createElement)(_components.MenuGroup, {
86
122
  label: (0, _i18n.__)('Tools')
87
123
  }, (0, _element.createElement)(_siteExport.default, null), (0, _element.createElement)(_components.MenuItem, {
88
- onClick: toggleModal,
124
+ onClick: () => openModal(_keyboardShortcutHelpModal.KEYBOARD_SHORTCUT_HELP_MODAL_NAME),
89
125
  shortcut: _keycodes.displayShortcut.access('h')
90
126
  }, (0, _i18n.__)('Keyboard shortcuts')), (0, _element.createElement)(_welcomeGuideMenuItem.default, null), (0, _element.createElement)(_copyContentMenuItem.default, null), (0, _element.createElement)(_components.MenuItem, {
91
127
  icon: _icons.external,
@@ -102,13 +138,7 @@ function MoreMenu({
102
138
  onClose
103
139
  }
104
140
  })), (0, _element.createElement)(_components.MenuGroup, null, (0, _element.createElement)(_components.MenuItem, {
105
- onClick: togglePreferencesModal
106
- }, (0, _i18n.__)('Preferences'))))), (0, _element.createElement)(_keyboardShortcutHelpModal.default, {
107
- isModalActive: isModalActive,
108
- toggleModal: toggleModal
109
- }), (0, _element.createElement)(_preferencesModal.default, {
110
- isModalActive: isPreferencesModalActive,
111
- toggleModal: togglePreferencesModal
112
- }));
141
+ onClick: () => openModal(_preferencesModal.PREFERENCES_MODAL_NAME)
142
+ }, (0, _i18n.__)('Preferences'))))), (0, _element.createElement)(_keyboardShortcutHelpModal.default, null), (0, _element.createElement)(_preferencesModal.default, null));
113
143
  }
114
144
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/header-edit-mode/more-menu/index.js"],"names":["MoreMenu","showIconLabels","isModalActive","toggleModal","isActive","isPreferencesModalActive","togglePreferencesModal","showTooltip","variant","onClose","MenuGroup","onClick","displayShortcut","access","external"],"mappings":";;;;;;;;;AAIA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AArBA;AACA;AACA;;AAUA;AACA;AACA;AASe,SAASA,QAAT,CAAmB;AAAEC,EAAAA;AAAF,CAAnB,EAAwC;AACtD,QAAM,CAAEC,aAAF,EAAiBC,WAAjB,IAAiC,yBACpCC,QAAF,IAAgB,CAAEA,QADoB,EAEtC,KAFsC,CAAvC;AAKA,QAAM,CAAEC,wBAAF,EAA4BC,sBAA5B,IAAuD,yBAC1DF,QAAF,IAAgB,CAAEA,QAD0C,EAE5D,KAF4D,CAA7D;AAKA,sCAAa,mCAAb,EAAkDD,WAAlD;AAEA,SACC,qDACC,4BAAC,2BAAD;AACC,IAAA,WAAW,EAAG;AACbI,MAAAA,WAAW,EAAE,CAAEN,cADF;AAEb,UAAKA,cAAc,IAAI;AAAEO,QAAAA,OAAO,EAAE;AAAX,OAAvB;AAFa;AADf,KAMG,CAAE;AAAEC,IAAAA;AAAF,GAAF,KACD,qDACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,MAAJ,EAAY,MAAZ;AAAnB,KACC,4BAAC,qCAAD;AACC,IAAA,KAAK,EAAC,gBADP;AAEC,IAAA,IAAI,EAAC,cAFN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nB;AAEE;AACA,gBAAI,sBAAJ,CAHF,CAVD,CAVD,EA2BC,4BAAC,2BAAD,CAAoB,IAApB;AACC,IAAA,SAAS,EAAG;AAAEL,MAAAA;AAAF;AADb,IA3BD,CApCD,EAmEC,4BAAC,qBAAD,QACC,4BAAC,oBAAD;AAAU,IAAA,OAAO,EAAGH;AAApB,KACG,cAAI,aAAJ,CADH,CADD,CAnED,CAPF,CADD,EAmFC,4BAAC,kCAAD;AACC,IAAA,aAAa,EAAGJ,aADjB;AAEC,IAAA,WAAW,EAAGC;AAFf,IAnFD,EAuFC,4BAAC,yBAAD;AACC,IAAA,aAAa,EAAGE,wBADjB;AAEC,IAAA,WAAW,EAAGC;AAFf,IAvFD,CADD;AA8FA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useReducer } from '@wordpress/element';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external } from '@wordpress/icons';\nimport { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { ActionItem, MoreMenuDropdown } from '@wordpress/interface';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../../keyboard-shortcut-help-modal';\nimport EditSitePreferencesModal from '../../preferences-modal';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport SiteExport from './site-export';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\n\nexport default function MoreMenu( { showIconLabels } ) {\n\tconst [ isModalActive, toggleModal ] = useReducer(\n\t\t( isActive ) => ! isActive,\n\t\tfalse\n\t);\n\n\tconst [ isPreferencesModalActive, togglePreferencesModal ] = useReducer(\n\t\t( isActive ) => ! isActive,\n\t\tfalse\n\t);\n\n\tuseShortcut( 'core/edit-site/keyboard-shortcuts', toggleModal );\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\t\tname=\"core/edit-site/plugin-more-menu\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<SiteExport />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ toggleModal }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/site-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem onClick={ togglePreferencesModal }>\n\t\t\t\t\t\t\t\t{ __( 'Preferences' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</MoreMenuDropdown>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isModalActive }\n\t\t\t\ttoggleModal={ toggleModal }\n\t\t\t/>\n\t\t\t<EditSitePreferencesModal\n\t\t\t\tisModalActive={ isPreferencesModalActive }\n\t\t\t\ttoggleModal={ togglePreferencesModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/header-edit-mode/more-menu/index.js"],"names":["MoreMenu","showIconLabels","registry","isDistractionFree","select","preferencesStore","get","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","siteEditorStore","openModal","interfaceStore","set","setPreference","toggleDistractionFree","batch","showTooltip","variant","onClose","displayShortcut","primaryShift","MenuGroup","onClick","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","access","external","PREFERENCES_MODAL_NAME"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAQA;;AAIA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAlCA;AACA;AACA;;AAgBA;AACA;AACA;AAgBe,SAASA,QAAT,CAAmB;AAAEC,EAAAA;AAAF,CAAnB,EAAwC;AACtD,QAAMC,QAAQ,GAAG,wBAAjB;AACA,QAAMC,iBAAiB,GAAG,qBACvBC,MAAF,IACCA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,GAA3B,CACC,gBADD,EAEC,iBAFD,CAFwB,EAMzB,EANyB,CAA1B;AASA,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA,mBAAvB;AAA4CC,IAAAA;AAA5C,MACL,uBAAaC,YAAb,CADD;AAEA,QAAM;AAAEC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CAdD,EA+BC,4BAAC,2BAAD,CAAoB,IAApB;AACC,IAAA,SAAS,EAAG;AAAEP,MAAAA;AAAF;AADb,IA/BD,CArDD,EAwFC,4BAAC,qBAAD,QACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MACTR,SAAS,CAAEgB,wCAAF;AAFX,KAKG,cAAI,aAAJ,CALH,CADD,CAxFD,CAPF,CADD,EA4GC,4BAAC,kCAAD,OA5GD,EA6GC,4BAAC,yBAAD,OA7GD,CADD;AAiHA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external } from '@wordpress/icons';\nimport { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';\nimport {\n\tActionItem,\n\tMoreMenuDropdown,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME,\n\tdefault as KeyboardShortcutHelpModal,\n} from '../../keyboard-shortcut-help-modal';\nimport {\n\tPREFERENCES_MODAL_NAME,\n\tdefault as EditSitePreferencesModal,\n} from '../../preferences-modal';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport SiteExport from './site-export';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\nimport { store as siteEditorStore } from '../../../store';\n\nexport default function MoreMenu( { showIconLabels } ) {\n\tconst registry = useRegistry();\n\tconst isDistractionFree = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( siteEditorStore );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tregistry.batch( () => {\n\t\t\tsetPreference( 'core/edit-site', 'fixedToolbar', false );\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t\tcloseGeneralSidebar();\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tdisabled={ isDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\t\t\t\t\tname=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift(\n\t\t\t\t\t\t\t\t\t'\\\\'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\tname=\"core/edit-site/plugin-more-menu\"\n\t\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<SiteExport />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal(\n\t\t\t\t\t\t\t\t\t\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/site-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( PREFERENCES_MODAL_NAME )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Preferences' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</MoreMenuDropdown>\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<EditSitePreferencesModal />\n\t\t</>\n\t);\n}\n"]}