@wordpress/edit-site 5.13.0 → 5.15.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 (646) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js +2 -13
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +29 -15
  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/add-new-template/utils.js +10 -8
  11. package/build/components/add-new-template/utils.js.map +1 -1
  12. package/build/components/block-editor/constants.js +1 -1
  13. package/build/components/block-editor/constants.js.map +1 -1
  14. package/build/components/block-editor/editor-canvas.js +1 -1
  15. package/build/components/block-editor/editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/index.js +0 -4
  17. package/build/components/block-editor/index.js.map +1 -1
  18. package/build/components/block-editor/inserter-media-categories.js +1 -22
  19. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  20. package/build/components/block-editor/site-editor-canvas.js +29 -32
  21. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  22. package/build/components/block-editor/use-site-editor-settings.js +90 -19
  23. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  24. package/build/components/canvas-spinner/index.js +1 -18
  25. package/build/components/canvas-spinner/index.js.map +1 -1
  26. package/build/components/code-editor/index.js +60 -28
  27. package/build/components/code-editor/index.js.map +1 -1
  28. package/build/components/create-pattern-modal/index.js +15 -11
  29. package/build/components/create-pattern-modal/index.js.map +1 -1
  30. package/build/components/create-template-part-modal/index.js +1 -1
  31. package/build/components/create-template-part-modal/index.js.map +1 -1
  32. package/build/components/editor/index.js +11 -1
  33. package/build/components/editor/index.js.map +1 -1
  34. package/build/components/global-styles/palette.js +1 -1
  35. package/build/components/global-styles/palette.js.map +1 -1
  36. package/build/components/global-styles/ui.js +7 -2
  37. package/build/components/global-styles/ui.js.map +1 -1
  38. package/build/components/header-edit-mode/document-actions/index.js +9 -1
  39. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  40. package/build/components/header-edit-mode/index.js +49 -14
  41. package/build/components/header-edit-mode/index.js.map +1 -1
  42. package/build/components/header-edit-mode/more-menu/index.js +47 -17
  43. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  44. package/build/components/keyboard-shortcut-help-modal/index.js +17 -4
  45. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  46. package/build/components/keyboard-shortcuts/edit-mode.js +32 -1
  47. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  48. package/build/components/keyboard-shortcuts/register.js +9 -0
  49. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  50. package/build/components/layout/index.js +110 -28
  51. package/build/components/layout/index.js.map +1 -1
  52. package/build/components/page/header.js +1 -1
  53. package/build/components/page/header.js.map +1 -1
  54. package/build/components/page/index.js +3 -1
  55. package/build/components/page/index.js.map +1 -1
  56. package/build/components/page-actions/index.js +2 -2
  57. package/build/components/page-actions/index.js.map +1 -1
  58. package/build/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -15
  59. package/build/components/page-actions/trash-page-menu-item.js.map +1 -0
  60. package/build/components/page-content-focus-manager/back-to-page-notification.js +9 -3
  61. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
  62. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -5
  63. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  64. package/build/components/page-main/index.js +8 -4
  65. package/build/components/page-main/index.js.map +1 -1
  66. package/build/components/page-patterns/duplicate-menu-item.js +163 -0
  67. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -0
  68. package/build/components/page-patterns/grid-item.js +218 -0
  69. package/build/components/page-patterns/grid-item.js.map +1 -0
  70. package/build/components/{page-library → page-patterns}/grid.js +6 -19
  71. package/build/components/page-patterns/grid.js.map +1 -0
  72. package/build/components/page-patterns/header.js +69 -0
  73. package/build/components/page-patterns/header.js.map +1 -0
  74. package/build/components/{page-library → page-patterns}/index.js +9 -7
  75. package/build/components/page-patterns/index.js.map +1 -0
  76. package/build/components/{page-library → page-patterns}/no-patterns.js +1 -1
  77. package/build/components/page-patterns/no-patterns.js.map +1 -0
  78. package/build/components/page-patterns/pagination.js +63 -0
  79. package/build/components/page-patterns/pagination.js.map +1 -0
  80. package/build/components/page-patterns/patterns-list.js +175 -0
  81. package/build/components/page-patterns/patterns-list.js.map +1 -0
  82. package/build/components/page-patterns/rename-menu-item.js +109 -0
  83. package/build/components/page-patterns/rename-menu-item.js.map +1 -0
  84. package/build/components/page-patterns/search-items.js.map +1 -0
  85. package/build/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +3 -3
  86. package/build/components/page-patterns/use-pattern-settings.js.map +1 -0
  87. package/build/components/page-patterns/use-patterns.js +185 -0
  88. package/build/components/page-patterns/use-patterns.js.map +1 -0
  89. package/build/components/{page-library → page-patterns}/utils.js +3 -3
  90. package/build/components/page-patterns/utils.js.map +1 -0
  91. package/build/components/page-template-parts/add-new-template-part.js +74 -0
  92. package/build/components/page-template-parts/add-new-template-part.js.map +1 -0
  93. package/build/components/page-template-parts/index.js +82 -0
  94. package/build/components/page-template-parts/index.js.map +1 -0
  95. package/build/components/page-templates/index.js +1 -0
  96. package/build/components/page-templates/index.js.map +1 -1
  97. package/build/components/preferences-modal/enable-feature.js +5 -1
  98. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  99. package/build/components/preferences-modal/index.js +43 -4
  100. package/build/components/preferences-modal/index.js.map +1 -1
  101. package/build/components/resizable-frame/index.js +78 -36
  102. package/build/components/resizable-frame/index.js.map +1 -1
  103. package/build/components/save-panel/index.js +5 -5
  104. package/build/components/save-panel/index.js.map +1 -1
  105. package/build/components/sidebar/index.js +6 -6
  106. package/build/components/sidebar/index.js.map +1 -1
  107. package/build/components/sidebar-edit-mode/index.js +4 -2
  108. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  109. package/build/components/sidebar-edit-mode/page-panels/page-content.js +4 -3
  110. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  111. package/build/components/sidebar-edit-mode/page-panels/page-status.js +3 -8
  112. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  113. package/build/components/sidebar-edit-mode/settings-header/index.js +7 -1
  114. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  115. package/build/components/sidebar-navigation-screen/index.js +21 -11
  116. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  117. package/build/components/sidebar-navigation-screen-global-styles/index.js +69 -5
  118. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  119. package/build/components/sidebar-navigation-screen-main/index.js +5 -3
  120. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  121. package/build/components/sidebar-navigation-screen-main/template-part-hint.js +45 -0
  122. package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
  123. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +7 -16
  124. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  125. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -11
  126. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  127. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -10
  128. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  129. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  130. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  131. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +10 -1
  132. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  133. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +9 -3
  134. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  135. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +9 -4
  136. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  137. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +29 -0
  138. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
  139. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  140. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  141. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +27 -4
  142. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  143. package/build/components/sidebar-navigation-screen-page/index.js +2 -3
  144. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  145. package/build/components/sidebar-navigation-screen-page/page-details.js +11 -4
  146. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  147. package/build/components/sidebar-navigation-screen-page/status-label.js +2 -35
  148. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  149. package/build/components/sidebar-navigation-screen-pages/index.js +33 -25
  150. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  151. package/build/components/sidebar-navigation-screen-pattern/index.js +20 -13
  152. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  153. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
  154. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  155. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -2
  156. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  157. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +11 -3
  158. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  159. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +28 -2
  160. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  161. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  162. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
  163. package/build/components/sidebar-navigation-screen-patterns/index.js +173 -0
  164. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
  165. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
  166. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +34 -0
  167. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
  168. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +11 -19
  169. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
  170. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +52 -0
  171. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
  172. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +2 -2
  173. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
  174. package/build/components/sidebar-navigation-screen-templates/index.js +11 -63
  175. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  176. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
  177. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  178. package/build/components/site-hub/index.js +25 -12
  179. package/build/components/site-hub/index.js.map +1 -1
  180. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -5
  181. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  182. package/build/components/sync-state-with-url/use-sync-path-with-url.js +16 -13
  183. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  184. package/build/components/template-actions/index.js +25 -7
  185. package/build/components/template-actions/index.js.map +1 -1
  186. package/build/components/template-actions/rename-menu-item.js +12 -8
  187. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  188. package/build/components/use-edited-entity-record/index.js +6 -1
  189. package/build/components/use-edited-entity-record/index.js.map +1 -1
  190. package/build/components/welcome-guide/editor.js +1 -1
  191. package/build/components/welcome-guide/editor.js.map +1 -1
  192. package/build/components/welcome-guide/index.js +5 -1
  193. package/build/components/welcome-guide/index.js.map +1 -1
  194. package/build/components/welcome-guide/page.js +70 -0
  195. package/build/components/welcome-guide/page.js.map +1 -0
  196. package/build/components/welcome-guide/styles.js +1 -1
  197. package/build/components/welcome-guide/styles.js.map +1 -1
  198. package/build/components/welcome-guide/template.js +71 -0
  199. package/build/components/welcome-guide/template.js.map +1 -0
  200. package/build/hooks/commands/use-common-commands.js +115 -20
  201. package/build/hooks/commands/use-common-commands.js.map +1 -1
  202. package/build/hooks/commands/use-edit-mode-commands.js +195 -44
  203. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  204. package/build/hooks/push-changes-to-global-styles/index.js +56 -10
  205. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  206. package/build/index.js +9 -0
  207. package/build/index.js.map +1 -1
  208. package/build/store/actions.js +5 -2
  209. package/build/store/actions.js.map +1 -1
  210. package/build/store/private-actions.js +7 -1
  211. package/build/store/private-actions.js.map +1 -1
  212. package/build/store/selectors.js +2 -1
  213. package/build/store/selectors.js.map +1 -1
  214. package/build/utils/get-is-list-page.js +2 -2
  215. package/build/utils/get-is-list-page.js.map +1 -1
  216. package/build/utils/normalize-record-key.js +19 -0
  217. package/build/utils/normalize-record-key.js.map +1 -0
  218. package/build/utils/template-part-create.js +2 -2
  219. package/build/utils/template-part-create.js.map +1 -1
  220. package/build/utils/use-activate-theme.js +1 -1
  221. package/build/utils/use-activate-theme.js.map +1 -1
  222. package/build-module/components/add-new-page/index.js +2 -12
  223. package/build-module/components/add-new-page/index.js.map +1 -1
  224. package/build-module/components/add-new-pattern/index.js +28 -16
  225. package/build-module/components/add-new-pattern/index.js.map +1 -1
  226. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  227. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  228. package/build-module/components/add-new-template/new-template.js +72 -17
  229. package/build-module/components/add-new-template/new-template.js.map +1 -1
  230. package/build-module/components/add-new-template/utils.js +9 -6
  231. package/build-module/components/add-new-template/utils.js.map +1 -1
  232. package/build-module/components/block-editor/constants.js +1 -1
  233. package/build-module/components/block-editor/constants.js.map +1 -1
  234. package/build-module/components/block-editor/editor-canvas.js +1 -1
  235. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  236. package/build-module/components/block-editor/index.js +0 -4
  237. package/build-module/components/block-editor/index.js.map +1 -1
  238. package/build-module/components/block-editor/inserter-media-categories.js +1 -22
  239. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  240. package/build-module/components/block-editor/site-editor-canvas.js +29 -32
  241. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  242. package/build-module/components/block-editor/use-site-editor-settings.js +92 -20
  243. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  244. package/build-module/components/canvas-spinner/index.js +1 -15
  245. package/build-module/components/canvas-spinner/index.js.map +1 -1
  246. package/build-module/components/code-editor/index.js +62 -30
  247. package/build-module/components/code-editor/index.js.map +1 -1
  248. package/build-module/components/create-pattern-modal/index.js +14 -11
  249. package/build-module/components/create-pattern-modal/index.js.map +1 -1
  250. package/build-module/components/create-template-part-modal/index.js +1 -1
  251. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  252. package/build-module/components/editor/index.js +11 -1
  253. package/build-module/components/editor/index.js.map +1 -1
  254. package/build-module/components/global-styles/palette.js +1 -1
  255. package/build-module/components/global-styles/palette.js.map +1 -1
  256. package/build-module/components/global-styles/ui.js +8 -3
  257. package/build-module/components/global-styles/ui.js.map +1 -1
  258. package/build-module/components/header-edit-mode/document-actions/index.js +10 -2
  259. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  260. package/build-module/components/header-edit-mode/index.js +51 -16
  261. package/build-module/components/header-edit-mode/index.js.map +1 -1
  262. package/build-module/components/header-edit-mode/more-menu/index.js +44 -20
  263. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  264. package/build-module/components/keyboard-shortcut-help-modal/index.js +15 -6
  265. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  266. package/build-module/components/keyboard-shortcuts/edit-mode.js +29 -1
  267. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  268. package/build-module/components/keyboard-shortcuts/register.js +9 -0
  269. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  270. package/build-module/components/layout/index.js +110 -28
  271. package/build-module/components/layout/index.js.map +1 -1
  272. package/build-module/components/page/header.js +1 -1
  273. package/build-module/components/page/header.js.map +1 -1
  274. package/build-module/components/page/index.js +2 -1
  275. package/build-module/components/page/index.js.map +1 -1
  276. package/build-module/components/page-actions/index.js +2 -2
  277. package/build-module/components/page-actions/index.js.map +1 -1
  278. package/build-module/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -16
  279. package/build-module/components/page-actions/trash-page-menu-item.js.map +1 -0
  280. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +9 -3
  281. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
  282. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -3
  283. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  284. package/build-module/components/page-main/index.js +6 -3
  285. package/build-module/components/page-main/index.js.map +1 -1
  286. package/build-module/components/page-patterns/duplicate-menu-item.js +147 -0
  287. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -0
  288. package/build-module/components/page-patterns/grid-item.js +195 -0
  289. package/build-module/components/page-patterns/grid-item.js.map +1 -0
  290. package/build-module/components/page-patterns/grid.js +26 -0
  291. package/build-module/components/page-patterns/grid.js.map +1 -0
  292. package/build-module/components/page-patterns/header.js +54 -0
  293. package/build-module/components/page-patterns/header.js.map +1 -0
  294. package/build-module/components/{page-library → page-patterns}/index.js +8 -6
  295. package/build-module/components/page-patterns/index.js.map +1 -0
  296. package/build-module/components/{page-library → page-patterns}/no-patterns.js +1 -1
  297. package/build-module/components/page-patterns/no-patterns.js.map +1 -0
  298. package/build-module/components/page-patterns/pagination.js +54 -0
  299. package/build-module/components/page-patterns/pagination.js.map +1 -0
  300. package/build-module/components/page-patterns/patterns-list.js +152 -0
  301. package/build-module/components/page-patterns/patterns-list.js.map +1 -0
  302. package/build-module/components/page-patterns/rename-menu-item.js +97 -0
  303. package/build-module/components/page-patterns/rename-menu-item.js.map +1 -0
  304. package/build-module/components/page-patterns/search-items.js.map +1 -0
  305. package/build-module/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +2 -2
  306. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -0
  307. package/build-module/components/page-patterns/use-patterns.js +167 -0
  308. package/build-module/components/page-patterns/use-patterns.js.map +1 -0
  309. package/build-module/components/{page-library → page-patterns}/utils.js +3 -3
  310. package/build-module/components/page-patterns/utils.js.map +1 -0
  311. package/build-module/components/page-template-parts/add-new-template-part.js +58 -0
  312. package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -0
  313. package/build-module/components/page-template-parts/index.js +63 -0
  314. package/build-module/components/page-template-parts/index.js.map +1 -0
  315. package/build-module/components/page-templates/index.js +1 -0
  316. package/build-module/components/page-templates/index.js.map +1 -1
  317. package/build-module/components/preferences-modal/enable-feature.js +5 -1
  318. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  319. package/build-module/components/preferences-modal/index.js +38 -5
  320. package/build-module/components/preferences-modal/index.js.map +1 -1
  321. package/build-module/components/resizable-frame/index.js +79 -39
  322. package/build-module/components/resizable-frame/index.js.map +1 -1
  323. package/build-module/components/save-panel/index.js +5 -5
  324. package/build-module/components/save-panel/index.js.map +1 -1
  325. package/build-module/components/sidebar/index.js +5 -5
  326. package/build-module/components/sidebar/index.js.map +1 -1
  327. package/build-module/components/sidebar-edit-mode/index.js +4 -2
  328. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  329. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +5 -2
  330. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  331. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +3 -8
  332. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  333. package/build-module/components/sidebar-edit-mode/settings-header/index.js +6 -1
  334. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  335. package/build-module/components/sidebar-navigation-screen/index.js +22 -12
  336. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  337. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +67 -5
  338. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  339. package/build-module/components/sidebar-navigation-screen-main/index.js +5 -4
  340. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  341. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +33 -0
  342. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
  343. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +8 -17
  344. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  345. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -9
  346. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  347. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +9 -10
  348. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  349. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  350. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  351. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +11 -1
  352. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  353. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +8 -4
  354. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  355. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +9 -4
  356. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  357. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +20 -0
  358. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
  359. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  360. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  361. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +26 -6
  362. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  363. package/build-module/components/sidebar-navigation-screen-page/index.js +2 -3
  364. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  365. package/build-module/components/sidebar-navigation-screen-page/page-details.js +11 -4
  366. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  367. package/build-module/components/sidebar-navigation-screen-page/status-label.js +2 -33
  368. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  369. package/build-module/components/sidebar-navigation-screen-pages/index.js +34 -26
  370. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  371. package/build-module/components/sidebar-navigation-screen-pattern/index.js +18 -12
  372. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  373. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
  374. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  375. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -2
  376. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  377. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +11 -3
  378. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  379. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +25 -2
  380. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  381. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  382. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
  383. package/build-module/components/sidebar-navigation-screen-patterns/index.js +148 -0
  384. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
  385. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
  386. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +24 -0
  387. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
  388. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +11 -17
  389. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
  390. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +43 -0
  391. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
  392. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +2 -2
  393. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
  394. package/build-module/components/sidebar-navigation-screen-templates/index.js +12 -62
  395. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  396. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
  397. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  398. package/build-module/components/site-hub/index.js +25 -12
  399. package/build-module/components/site-hub/index.js.map +1 -1
  400. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +7 -5
  401. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  402. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +17 -13
  403. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  404. package/build-module/components/template-actions/index.js +26 -8
  405. package/build-module/components/template-actions/index.js.map +1 -1
  406. package/build-module/components/template-actions/rename-menu-item.js +11 -8
  407. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  408. package/build-module/components/use-edited-entity-record/index.js +3 -1
  409. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  410. package/build-module/components/welcome-guide/editor.js +1 -1
  411. package/build-module/components/welcome-guide/editor.js.map +1 -1
  412. package/build-module/components/welcome-guide/index.js +3 -1
  413. package/build-module/components/welcome-guide/index.js.map +1 -1
  414. package/build-module/components/welcome-guide/page.js +59 -0
  415. package/build-module/components/welcome-guide/page.js.map +1 -0
  416. package/build-module/components/welcome-guide/styles.js +1 -1
  417. package/build-module/components/welcome-guide/styles.js.map +1 -1
  418. package/build-module/components/welcome-guide/template.js +60 -0
  419. package/build-module/components/welcome-guide/template.js.map +1 -0
  420. package/build-module/hooks/commands/use-common-commands.js +111 -21
  421. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  422. package/build-module/hooks/commands/use-edit-mode-commands.js +193 -46
  423. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  424. package/build-module/hooks/push-changes-to-global-styles/index.js +57 -10
  425. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  426. package/build-module/index.js +4 -0
  427. package/build-module/index.js.map +1 -1
  428. package/build-module/store/actions.js +5 -2
  429. package/build-module/store/actions.js.map +1 -1
  430. package/build-module/store/private-actions.js +7 -1
  431. package/build-module/store/private-actions.js.map +1 -1
  432. package/build-module/store/selectors.js +2 -1
  433. package/build-module/store/selectors.js.map +1 -1
  434. package/build-module/utils/get-is-list-page.js +2 -2
  435. package/build-module/utils/get-is-list-page.js.map +1 -1
  436. package/build-module/utils/normalize-record-key.js +12 -0
  437. package/build-module/utils/normalize-record-key.js.map +1 -0
  438. package/build-module/utils/template-part-create.js +1 -1
  439. package/build-module/utils/template-part-create.js.map +1 -1
  440. package/build-module/utils/use-activate-theme.js +1 -1
  441. package/build-module/utils/use-activate-theme.js.map +1 -1
  442. package/build-style/style-rtl.css +383 -109
  443. package/build-style/style.css +383 -109
  444. package/package.json +39 -40
  445. package/src/components/add-new-page/index.js +1 -9
  446. package/src/components/add-new-pattern/index.js +30 -21
  447. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  448. package/src/components/add-new-template/new-template.js +120 -24
  449. package/src/components/add-new-template/style.scss +30 -2
  450. package/src/components/add-new-template/utils.js +9 -6
  451. package/src/components/block-editor/constants.js +5 -1
  452. package/src/components/block-editor/editor-canvas.js +3 -1
  453. package/src/components/block-editor/index.js +0 -4
  454. package/src/components/block-editor/inserter-media-categories.js +1 -21
  455. package/src/components/block-editor/site-editor-canvas.js +7 -1
  456. package/src/components/block-editor/use-site-editor-settings.js +100 -25
  457. package/src/components/canvas-spinner/index.js +1 -11
  458. package/src/components/canvas-spinner/style.scss +18 -0
  459. package/src/components/code-editor/index.js +51 -33
  460. package/src/components/create-pattern-modal/index.js +15 -13
  461. package/src/components/create-template-part-modal/index.js +1 -1
  462. package/src/components/editor/index.js +16 -1
  463. package/src/components/editor/style.scss +4 -0
  464. package/src/components/global-styles/palette.js +10 -9
  465. package/src/components/global-styles/stories/index.js +1 -0
  466. package/src/components/global-styles/ui.js +34 -24
  467. package/src/components/header-edit-mode/document-actions/index.js +9 -1
  468. package/src/components/header-edit-mode/document-actions/style.scss +12 -0
  469. package/src/components/header-edit-mode/index.js +136 -79
  470. package/src/components/header-edit-mode/more-menu/index.js +74 -30
  471. package/src/components/keyboard-shortcut-help-modal/index.js +21 -7
  472. package/src/components/keyboard-shortcuts/edit-mode.js +35 -2
  473. package/src/components/keyboard-shortcuts/register.js +10 -0
  474. package/src/components/layout/index.js +156 -78
  475. package/src/components/layout/style.scss +49 -2
  476. package/src/components/page/header.js +1 -1
  477. package/src/components/page/index.js +5 -1
  478. package/src/components/page-actions/index.js +2 -2
  479. package/src/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +9 -21
  480. package/src/components/page-content-focus-manager/back-to-page-notification.js +7 -2
  481. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +12 -3
  482. package/src/components/page-main/index.js +6 -3
  483. package/src/components/page-patterns/duplicate-menu-item.js +196 -0
  484. package/src/components/page-patterns/grid-item.js +284 -0
  485. package/src/components/page-patterns/grid.js +22 -0
  486. package/src/components/page-patterns/header.js +69 -0
  487. package/src/components/{page-library → page-patterns}/index.js +11 -6
  488. package/src/components/{page-library → page-patterns}/no-patterns.js +1 -1
  489. package/src/components/page-patterns/pagination.js +80 -0
  490. package/src/components/page-patterns/patterns-list.js +206 -0
  491. package/src/components/page-patterns/rename-menu-item.js +115 -0
  492. package/src/components/page-patterns/style.scss +219 -0
  493. package/src/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +1 -1
  494. package/src/components/page-patterns/use-patterns.js +177 -0
  495. package/src/components/{page-library → page-patterns}/utils.js +3 -3
  496. package/src/components/page-template-parts/add-new-template-part.js +57 -0
  497. package/src/components/page-template-parts/index.js +86 -0
  498. package/src/components/page-templates/index.js +1 -1
  499. package/src/components/preferences-modal/enable-feature.js +5 -2
  500. package/src/components/preferences-modal/index.js +35 -4
  501. package/src/components/resizable-frame/index.js +102 -34
  502. package/src/components/resizable-frame/style.scss +9 -9
  503. package/src/components/save-panel/index.js +10 -4
  504. package/src/components/sidebar/index.js +6 -6
  505. package/src/components/sidebar-button/style.scss +1 -1
  506. package/src/components/sidebar-edit-mode/index.js +4 -2
  507. package/src/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  508. package/src/components/sidebar-edit-mode/page-panels/page-status.js +2 -5
  509. package/src/components/sidebar-edit-mode/settings-header/index.js +7 -2
  510. package/src/components/sidebar-navigation-item/style.scss +7 -13
  511. package/src/components/sidebar-navigation-screen/index.js +18 -9
  512. package/src/components/sidebar-navigation-screen/style.scss +21 -2
  513. package/src/components/sidebar-navigation-screen-details-panel/style.scss +1 -1
  514. package/src/components/sidebar-navigation-screen-global-styles/index.js +57 -17
  515. package/src/components/sidebar-navigation-screen-main/index.js +44 -40
  516. package/src/components/sidebar-navigation-screen-main/template-part-hint.js +34 -0
  517. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +14 -35
  518. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +8 -11
  519. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +13 -11
  520. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  521. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +12 -1
  522. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +16 -7
  523. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -7
  524. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -6
  525. package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +24 -0
  526. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  527. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +39 -8
  528. package/src/components/sidebar-navigation-screen-page/index.js +3 -3
  529. package/src/components/sidebar-navigation-screen-page/page-details.js +8 -3
  530. package/src/components/sidebar-navigation-screen-page/status-label.js +2 -36
  531. package/src/components/sidebar-navigation-screen-pages/index.js +40 -30
  532. package/src/components/sidebar-navigation-screen-pattern/index.js +18 -8
  533. package/src/components/sidebar-navigation-screen-pattern/style.scss +29 -0
  534. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +3 -2
  535. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +2 -1
  536. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +12 -2
  537. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +48 -3
  538. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  539. package/src/components/sidebar-navigation-screen-patterns/index.js +194 -0
  540. package/src/components/sidebar-navigation-screen-patterns/style.scss +23 -0
  541. package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +24 -0
  542. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +9 -17
  543. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +55 -0
  544. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +3 -2
  545. package/src/components/sidebar-navigation-screen-template/style.scss +15 -15
  546. package/src/components/sidebar-navigation-screen-templates/index.js +15 -82
  547. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -0
  548. package/src/components/site-hub/index.js +46 -29
  549. package/src/components/site-hub/style.scss +17 -3
  550. package/src/components/start-template-options/style.scss +0 -3
  551. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
  552. package/src/components/sync-state-with-url/use-sync-path-with-url.js +73 -66
  553. package/src/components/template-actions/index.js +40 -9
  554. package/src/components/template-actions/rename-menu-item.js +17 -10
  555. package/src/components/use-edited-entity-record/index.js +6 -1
  556. package/src/components/welcome-guide/editor.js +1 -1
  557. package/src/components/welcome-guide/index.js +4 -0
  558. package/src/components/welcome-guide/page.js +75 -0
  559. package/src/components/welcome-guide/style.scss +15 -1
  560. package/src/components/welcome-guide/styles.js +1 -1
  561. package/src/components/welcome-guide/template.js +82 -0
  562. package/src/hooks/commands/use-common-commands.js +88 -24
  563. package/src/hooks/commands/use-edit-mode-commands.js +182 -38
  564. package/src/hooks/push-changes-to-global-styles/index.js +63 -9
  565. package/src/index.js +4 -0
  566. package/src/store/actions.js +8 -1
  567. package/src/store/private-actions.js +5 -1
  568. package/src/store/selectors.js +5 -0
  569. package/src/store/test/selectors.js +2 -0
  570. package/src/style.scss +13 -14
  571. package/src/utils/get-is-list-page.js +4 -3
  572. package/src/utils/normalize-record-key.js +11 -0
  573. package/src/utils/template-part-create.js +1 -1
  574. package/src/utils/use-activate-theme.js +1 -1
  575. package/build/components/code-editor/code-editor-text-area.js +0 -96
  576. package/build/components/code-editor/code-editor-text-area.js.map +0 -1
  577. package/build/components/keyboard-shortcuts/index.js +0 -148
  578. package/build/components/keyboard-shortcuts/index.js.map +0 -1
  579. package/build/components/page-actions/delete-page-menu-item.js.map +0 -1
  580. package/build/components/page-content-focus-manager/constants.js +0 -9
  581. package/build/components/page-content-focus-manager/constants.js.map +0 -1
  582. package/build/components/page-library/grid-item.js +0 -165
  583. package/build/components/page-library/grid-item.js.map +0 -1
  584. package/build/components/page-library/grid.js.map +0 -1
  585. package/build/components/page-library/index.js.map +0 -1
  586. package/build/components/page-library/no-patterns.js.map +0 -1
  587. package/build/components/page-library/patterns-list.js +0 -108
  588. package/build/components/page-library/patterns-list.js.map +0 -1
  589. package/build/components/page-library/search-items.js.map +0 -1
  590. package/build/components/page-library/use-library-settings.js.map +0 -1
  591. package/build/components/page-library/use-patterns.js +0 -194
  592. package/build/components/page-library/use-patterns.js.map +0 -1
  593. package/build/components/page-library/utils.js.map +0 -1
  594. package/build/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
  595. package/build/components/sidebar-navigation-screen-library/index.js +0 -112
  596. package/build/components/sidebar-navigation-screen-library/index.js.map +0 -1
  597. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
  598. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
  599. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -41
  600. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
  601. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
  602. package/build-module/components/code-editor/code-editor-text-area.js +0 -84
  603. package/build-module/components/code-editor/code-editor-text-area.js.map +0 -1
  604. package/build-module/components/keyboard-shortcuts/index.js +0 -132
  605. package/build-module/components/keyboard-shortcuts/index.js.map +0 -1
  606. package/build-module/components/page-actions/delete-page-menu-item.js.map +0 -1
  607. package/build-module/components/page-content-focus-manager/constants.js +0 -2
  608. package/build-module/components/page-content-focus-manager/constants.js.map +0 -1
  609. package/build-module/components/page-library/grid-item.js +0 -145
  610. package/build-module/components/page-library/grid-item.js.map +0 -1
  611. package/build-module/components/page-library/grid.js +0 -38
  612. package/build-module/components/page-library/grid.js.map +0 -1
  613. package/build-module/components/page-library/index.js.map +0 -1
  614. package/build-module/components/page-library/no-patterns.js.map +0 -1
  615. package/build-module/components/page-library/patterns-list.js +0 -87
  616. package/build-module/components/page-library/patterns-list.js.map +0 -1
  617. package/build-module/components/page-library/search-items.js.map +0 -1
  618. package/build-module/components/page-library/use-library-settings.js.map +0 -1
  619. package/build-module/components/page-library/use-patterns.js +0 -176
  620. package/build-module/components/page-library/use-patterns.js.map +0 -1
  621. package/build-module/components/page-library/utils.js.map +0 -1
  622. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
  623. package/build-module/components/sidebar-navigation-screen-library/index.js +0 -87
  624. package/build-module/components/sidebar-navigation-screen-library/index.js.map +0 -1
  625. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
  626. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
  627. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -34
  628. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
  629. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
  630. package/src/components/code-editor/code-editor-text-area.js +0 -84
  631. package/src/components/keyboard-shortcuts/index.js +0 -137
  632. package/src/components/page-content-focus-manager/constants.js +0 -5
  633. package/src/components/page-library/grid-item.js +0 -179
  634. package/src/components/page-library/grid.js +0 -39
  635. package/src/components/page-library/patterns-list.js +0 -114
  636. package/src/components/page-library/style.scss +0 -105
  637. package/src/components/page-library/use-patterns.js +0 -238
  638. package/src/components/sidebar-navigation-screen-library/index.js +0 -136
  639. package/src/components/sidebar-navigation-screen-library/style.scss +0 -7
  640. package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -33
  641. /package/build/components/{page-library → page-patterns}/search-items.js +0 -0
  642. /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  643. /package/build-module/components/{page-library → page-patterns}/search-items.js +0 -0
  644. /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  645. /package/src/components/{page-library → page-patterns}/search-items.js +0 -0
  646. /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/editor/index.js"],"names":["BlockRemovalWarningModal","blockEditorPrivateApis","interfaceLabels","body","sidebar","actions","footer","typeLabels","wp_template","wp_template_part","wp_block","Editor","isLoading","record","editedPost","getTitle","isLoaded","hasLoadedPost","id","editedPostId","type","editedPostType","context","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","showIconLabels","showBlockBreadcrumbs","hasPageContentFocus","select","getEditedPostContext","getEditorMode","getCanvasMode","isInserterOpened","isListViewOpened","_hasPageContentFocus","editSiteStore","__unstableGetEditorMode","blockEditorStore","getActiveComplementaryArea","interfaceStore","name","preferencesStore","get","setEditedPostContext","isViewMode","isEditMode","showVisualEditor","shouldShowBlockBreadcrumbs","shouldShowInserter","shouldShowListView","secondarySidebarLabel","blockContext","postType","postId","nonPostFields","queryContext","page","newQueryContext","title","secondarySidebar"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAMA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA5CA;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1DH;AAmEC,IAAA,MAAM,EAAG,EACR,GAAG7B,eADK;AAER6D,MAAAA,gBAAgB,EAAET;AAFV;AAnEV,IAHD,CALD,CADD,CAHD,CADD;AA0FA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Notice } from '@wordpress/components';\nimport { EntityProvider } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockContextProvider,\n\tBlockBreadcrumb,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { EditorNotices, EditorSnackbars } from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { SidebarComplementaryAreaFills } from '../sidebar-edit-mode';\nimport BlockEditor from '../block-editor';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcutsEditMode from '../keyboard-shortcuts/edit-mode';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport WelcomeGuide from '../welcome-guide';\nimport StartTemplateOptions from '../start-template-options';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasSpinner from '../canvas-spinner';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { SidebarFixedBottomSlot } from '../sidebar-edit-mode/sidebar-fixed-bottom';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nconst typeLabels = {\n\twp_template: __( 'Template Part' ),\n\twp_template_part: __( 'Template Part' ),\n\twp_block: __( 'Pattern' ),\n};\n\nexport default function Editor( { isLoading } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\n\tconst { id: editedPostId, type: editedPostType } = editedPost;\n\n\tconst {\n\t\tcontext,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tshowIconLabels,\n\t\tshowBlockBreadcrumbs,\n\t\thasPageContentFocus,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostContext,\n\t\t\tgetEditorMode,\n\t\t\tgetCanvasMode,\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\thasPageContentFocus: _hasPageContentFocus,\n\t\t} = unlock( select( editSiteStore ) );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tcontext: getEditedPostContext(),\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\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\tshowBlockBreadcrumbs: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\thasPageContentFocus: _hasPageContentFocus(),\n\t\t};\n\t}, [] );\n\tconst { setEditedPostContext } = useDispatch( editSiteStore );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst shouldShowBlockBreadcrumbs =\n\t\tshowBlockBreadcrumbs &&\n\t\tisEditMode &&\n\t\tshowVisualEditor &&\n\t\tblockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst blockContext = useMemo( () => {\n\t\tconst { postType, postId, ...nonPostFields } = context ?? {};\n\t\treturn {\n\t\t\t...( hasPageContentFocus ? context : nonPostFields ),\n\t\t\tqueryContext: [\n\t\t\t\tcontext?.queryContext || { page: 1 },\n\t\t\t\t( newQueryContext ) =>\n\t\t\t\t\tsetEditedPostContext( {\n\t\t\t\t\t\t...context,\n\t\t\t\t\t\tqueryContext: {\n\t\t\t\t\t\t\t...context?.queryContext,\n\t\t\t\t\t\t\t...newQueryContext,\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t],\n\t\t};\n\t}, [ hasPageContentFocus, context, setEditedPostContext ] );\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\tconst type = typeLabels[ editedPostType ] ?? __( 'Template' );\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail in browser tab. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s ‹ Editor' ),\n\t\t\tgetTitle(),\n\t\t\ttype\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( hasLoadedPost && title );\n\n\treturn (\n\t\t<>\n\t\t\t{ isLoading ? <CanvasSpinner /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ editedPostType }\n\t\t\t\t\tid={ editedPostId }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t\t{ isEditMode && <StartTemplateOptions /> }\n\t\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t\t\t'is-loading': isLoading,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t\t{ showVisualEditor && editedPost && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<BlockEditor />\n\t\t\t\t\t\t\t\t\t\t\t<BlockRemovalWarningModal />\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ editorMode === 'text' &&\n\t\t\t\t\t\t\t\t\t\teditedPost &&\n\t\t\t\t\t\t\t\t\t\tisEditMode && <CodeEditor /> }\n\t\t\t\t\t\t\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t\t\t\t\t<KeyboardShortcutsEditMode />\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\tsecondarySidebar={\n\t\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t\t( ( shouldShowInserter && (\n\t\t\t\t\t\t\t\t\t<InserterSidebar />\n\t\t\t\t\t\t\t\t) ) ||\n\t\t\t\t\t\t\t\t\t( shouldShowListView && (\n\t\t\t\t\t\t\t\t\t\t<ListViewSidebar />\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\tsidebar={\n\t\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t\tisRightSidebarOpen && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t\t\t\t<SidebarFixedBottomSlot />\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\tfooter={\n\t\t\t\t\t\t\t\tshouldShowBlockBreadcrumbs && (\n\t\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\t\trootLabelText={\n\t\t\t\t\t\t\t\t\t\t\thasPageContentFocus\n\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Page' )\n\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Template' )\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\tlabels={ {\n\t\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/editor/index.js"],"names":["BlockRemovalWarningModal","blockEditorPrivateApis","interfaceLabels","body","sidebar","actions","footer","typeLabels","wp_template","wp_template_part","wp_block","blockRemovalRules","Editor","isLoading","record","editedPost","getTitle","isLoaded","hasLoadedPost","id","editedPostId","type","editedPostType","context","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","showIconLabels","showBlockBreadcrumbs","hasPageContentFocus","select","getEditedPostContext","getEditorMode","getCanvasMode","isInserterOpened","isListViewOpened","_hasPageContentFocus","editSiteStore","__unstableGetEditorMode","blockEditorStore","getActiveComplementaryArea","interfaceStore","name","preferencesStore","get","setEditedPostContext","isViewMode","isEditMode","showVisualEditor","shouldShowBlockBreadcrumbs","shouldShowInserter","shouldShowListView","secondarySidebarLabel","blockContext","postType","postId","nonPostFields","queryContext","page","newQueryContext","title","secondarySidebar"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAMA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA5CA;AACA;AACA;;AAGA;AACA;AACA;;AAoBA;AACA;AACA;AAiBA,M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0CAAD,OAFD,CArDH;AA2DC,IAAA,MAAM,EACLyB,0BAA0B,IACzB,4BAAC,4BAAD;AACC,MAAA,aAAa,EACZpB,mBAAmB,GAChB,cAAI,MAAJ,CADgB,GAEhB,cAAI,UAAJ;AAJL,MA7DH;AAsEC,IAAA,MAAM,EAAG,EACR,GAAG9B,eADK;AAER8D,MAAAA,gBAAgB,EAAET;AAFV;AAtEV,IAHD,CALD,CADD,CAHD,CADD;AA6FA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Notice } from '@wordpress/components';\nimport { EntityProvider } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockContextProvider,\n\tBlockBreadcrumb,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { EditorNotices, EditorSnackbars } from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { SidebarComplementaryAreaFills } from '../sidebar-edit-mode';\nimport BlockEditor from '../block-editor';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcutsEditMode from '../keyboard-shortcuts/edit-mode';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport WelcomeGuide from '../welcome-guide';\nimport StartTemplateOptions from '../start-template-options';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasSpinner from '../canvas-spinner';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { SidebarFixedBottomSlot } from '../sidebar-edit-mode/sidebar-fixed-bottom';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nconst typeLabels = {\n\twp_template: __( 'Template Part' ),\n\twp_template_part: __( 'Template Part' ),\n\twp_block: __( 'Pattern' ),\n};\n\n// Prevent accidental removal of certain blocks, asking the user for\n// confirmation.\nconst blockRemovalRules = {\n\t'core/query': __( 'Query Loop displays a list of posts or pages.' ),\n\t'core/post-content': __(\n\t\t'Post Content displays the content of a post or page.'\n\t),\n\t'core/post-template': __(\n\t\t'Post Template displays each post or page in a Query Loop.'\n\t),\n};\n\nexport default function Editor( { isLoading } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\n\tconst { id: editedPostId, type: editedPostType } = editedPost;\n\n\tconst {\n\t\tcontext,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tshowIconLabels,\n\t\tshowBlockBreadcrumbs,\n\t\thasPageContentFocus,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostContext,\n\t\t\tgetEditorMode,\n\t\t\tgetCanvasMode,\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\thasPageContentFocus: _hasPageContentFocus,\n\t\t} = unlock( select( editSiteStore ) );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tcontext: getEditedPostContext(),\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\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\tshowBlockBreadcrumbs: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\thasPageContentFocus: _hasPageContentFocus(),\n\t\t};\n\t}, [] );\n\tconst { setEditedPostContext } = useDispatch( editSiteStore );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst shouldShowBlockBreadcrumbs =\n\t\tshowBlockBreadcrumbs &&\n\t\tisEditMode &&\n\t\tshowVisualEditor &&\n\t\tblockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst blockContext = useMemo( () => {\n\t\tconst { postType, postId, ...nonPostFields } = context ?? {};\n\t\treturn {\n\t\t\t...( hasPageContentFocus ? context : nonPostFields ),\n\t\t\tqueryContext: [\n\t\t\t\tcontext?.queryContext || { page: 1 },\n\t\t\t\t( newQueryContext ) =>\n\t\t\t\t\tsetEditedPostContext( {\n\t\t\t\t\t\t...context,\n\t\t\t\t\t\tqueryContext: {\n\t\t\t\t\t\t\t...context?.queryContext,\n\t\t\t\t\t\t\t...newQueryContext,\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t],\n\t\t};\n\t}, [ hasPageContentFocus, context, setEditedPostContext ] );\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\tconst type = typeLabels[ editedPostType ] ?? __( 'Template' );\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail in browser tab. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s ‹ Editor' ),\n\t\t\tgetTitle(),\n\t\t\ttype\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( hasLoadedPost && title );\n\n\treturn (\n\t\t<>\n\t\t\t{ isLoading ? <CanvasSpinner /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ editedPostType }\n\t\t\t\t\tid={ editedPostId }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t\t{ isEditMode && <StartTemplateOptions /> }\n\t\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\t\tisDistractionFree={ true }\n\t\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t\t\t'is-loading': isLoading,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t\t{ showVisualEditor && editedPost && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<BlockEditor />\n\t\t\t\t\t\t\t\t\t\t\t<BlockRemovalWarningModal\n\t\t\t\t\t\t\t\t\t\t\t\trules={ blockRemovalRules }\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\t{ editorMode === 'text' &&\n\t\t\t\t\t\t\t\t\t\teditedPost &&\n\t\t\t\t\t\t\t\t\t\tisEditMode && <CodeEditor /> }\n\t\t\t\t\t\t\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t\t\t\t\t<KeyboardShortcutsEditMode />\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\tsecondarySidebar={\n\t\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t\t( ( shouldShowInserter && (\n\t\t\t\t\t\t\t\t\t<InserterSidebar />\n\t\t\t\t\t\t\t\t) ) ||\n\t\t\t\t\t\t\t\t\t( shouldShowListView && (\n\t\t\t\t\t\t\t\t\t\t<ListViewSidebar />\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\tsidebar={\n\t\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t\tisRightSidebarOpen && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t\t\t\t<SidebarFixedBottomSlot />\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\tfooter={\n\t\t\t\t\t\t\t\tshouldShowBlockBreadcrumbs && (\n\t\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\t\trootLabelText={\n\t\t\t\t\t\t\t\t\t\t\thasPageContentFocus\n\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Page' )\n\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Template' )\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\tlabels={ {\n\t\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t</>\n\t);\n}\n"]}
@@ -72,7 +72,7 @@ function Palette({
72
72
  key: `${color}-${index}`
73
73
  }, (0, _element.createElement)(_components.ColorIndicator, {
74
74
  colorValue: color
75
- })))), (0, _element.createElement)(_components.FlexItem, null, paletteButtonText)))), themeColors?.length > 0 && (0, _element.createElement)(_components.Button, {
75
+ })))), (0, _element.createElement)(_components.FlexItem, null, paletteButtonText)))), window.__experimentalEnableColorRandomizer && themeColors?.length > 0 && (0, _element.createElement)(_components.Button, {
76
76
  variant: "secondary",
77
77
  icon: _icons.shuffle,
78
78
  onClick: randomizeThemeColors
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"names":["useGlobalSetting","blockEditorPrivateApis","EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","randomizeThemeColors","colors","screenPath","encodeURIComponent","paletteButtonText","length","slice","map","color","index","shuffle"],"mappings":";;;;;;;;;AAcA;;AAXA;;AASA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAxBA;AACA;AACA;;AAeA;AACA;AACA;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAuB,wBAAQC,wBAAR,CAA7B;AAEA,MAAMC,YAAY,GAAG,EAArB;;AAEA,SAASC,OAAT,CAAkB;AAAEC,EAAAA;AAAF,CAAlB,EAA6B;AAC5B,QAAM,CAAEC,YAAF,IAAmBL,gBAAgB,CAAE,sBAAF,CAAzC;AACA,QAAM,CAAEM,WAAF,IAAkBN,gBAAgB,CAAE,qBAAF,CAAxC;AACA,QAAM,CAAEO,aAAF,IAAoBP,gBAAgB,CAAE,uBAAF,CAA1C;AAEA,QAAM,CAAEQ,qBAAF,IAA4BR,gBAAgB,CACjD,sBADiD,EAEjDI,IAFiD,CAAlD;AAKA,QAAM,CAAEK,oBAAF,IAA2B,gCAAjC;AAEA,QAAMC,MAAM,GAAG,sBACd,MAAM,CACL,IAAKL,YAAY,IAAIH,YAArB,CADK,EAEL,IAAKI,WAAW,IAAIJ,YAApB,CAFK,EAGL,IAAKK,aAAa,IAAIC,qBAAjB,GACFD,aADE,GAEFL,YAFH,CAHK,CADQ,EAQd,CAAEG,YAAF,EAAgBC,WAAhB,EAA6BC,aAA7B,EAA4CC,qBAA5C,CARc,CAAf;AAWA,QAAMG,UAAU,GAAG,CAAEP,IAAF,GAChB,iBADgB,GAEhB,aAAaQ,kBAAkB,CAAER,IAAF,CAA/B,GAA0C,iBAF7C;AAGA,QAAMS,iBAAiB,GACtBH,MAAM,CAACI,MAAP,GAAgB,CAAh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n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tColorIndicator,\n\tButton,\n} from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { shuffle } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { useColorRandomizer } from './hooks';\nimport ColorIndicatorWrapper from './color-indicator-wrapper';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nconst EMPTY_COLORS = [];\n\nfunction Palette( { name } ) {\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ defaultColors ] = useGlobalSetting( 'color.palette.default' );\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\n\tconst [ randomizeThemeColors ] = useColorRandomizer();\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( customColors || EMPTY_COLORS ),\n\t\t\t...( themeColors || EMPTY_COLORS ),\n\t\t\t...( defaultColors && defaultPaletteEnabled\n\t\t\t\t? defaultColors\n\t\t\t\t: EMPTY_COLORS ),\n\t\t],\n\t\t[ customColors, themeColors, defaultColors, defaultPaletteEnabled ]\n\t);\n\n\tconst screenPath = ! name\n\t\t? '/colors/palette'\n\t\t: '/blocks/' + encodeURIComponent( name ) + '/colors/palette';\n\tconst paletteButtonText =\n\t\tcolors.length > 0\n\t\t\t? sprintf(\n\t\t\t\t\t// Translators: %d: Number of palette colors.\n\t\t\t\t\t_n( '%d color', '%d colors', colors.length ),\n\t\t\t\t\tcolors.length\n\t\t\t )\n\t\t\t: __( 'Add custom colors' );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Palette' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\tpath={ screenPath }\n\t\t\t\t\taria-label={ __( 'Color palettes' ) }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tdirection={\n\t\t\t\t\t\t\tcolors.length === 0 ? 'row-reverse' : 'row'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t{ colors\n\t\t\t\t\t\t\t\t.slice( 0, 5 )\n\t\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t\t<ColorIndicatorWrapper\n\t\t\t\t\t\t\t\t\t\tkey={ `${ color }-${ index }` }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t\t\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</ZStack>\n\t\t\t\t\t\t<FlexItem>{ paletteButtonText }</FlexItem>\n\t\t\t\t\t</HStack>\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t</ItemGroup>\n\t\t\t{ themeColors?.length > 0 && (\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\ticon={ shuffle }\n\t\t\t\t\tonClick={ randomizeThemeColors }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Randomize colors' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default Palette;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"names":["useGlobalSetting","blockEditorPrivateApis","EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","randomizeThemeColors","colors","screenPath","encodeURIComponent","paletteButtonText","length","slice","map","color","index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AAlB,KACC,4BAAC,iBAAD;AAAU,IAAA,KAAK,EAAG;AAAlB,KAAwB,cAAI,SAAJ,CAAxB,CADD,EAEC,4BAAC,mCAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAGH,UADR;AAEC,kBAAa,cAAI,gBAAJ;AAFd,KAIC,4BAAC,gCAAD;AACC,IAAA,SAAS,EACRD,MAAM,CAACI,MAAP,KAAkB,CAAlB,GAAsB,aAAtB,GAAsC;AAFxC,KAKC,4BAAC,gCAAD;AAAQ,IAAA,SAAS,EAAG,KAApB;AAA4B,IAAA,MAAM,EAAG,CAAC;AAAtC,KACGJ,MAAM,CACNK,KADA,CACO,CADP,EACU,CADV,EAEAC,GAFA,CAEK,CAAE;AAAEC,IAAAA;AAAF,GAAF,EAAaC,KAAb,KACL,4BAAC,8BAAD;AACC,IAAA,GAAG,EAAI,GAAGD,KAAO,IAAIC,KAAO;AAD7B,KAGC,4BAAC,0BAAD;AAAgB,IAAA,UAAU,EAAGD;AAA7B,IAHD,CAHA,CADH,CALD,EAgBC,4BAAC,oBAAD,QAAYJ,iBAAZ,CAhBD,CAJD,CADD,CAFD,EA2BGM,MAAM,CAACC,mCAAP,IACDd,WAAW,EAAEQ,MAAb,GAAsB,CADrB,IAEA,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,IAAI,EAAGO,cAFR;AAGC,IAAA,OAAO,EAAGZ;AAHX,KAKG,cAAI,kBAAJ,CALH,CA7BH,CADD;AAwCA;;eAEcN,O","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tColorIndicator,\n\tButton,\n} from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { shuffle } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { useColorRandomizer } from './hooks';\nimport ColorIndicatorWrapper from './color-indicator-wrapper';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nconst EMPTY_COLORS = [];\n\nfunction Palette( { name } ) {\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ defaultColors ] = useGlobalSetting( 'color.palette.default' );\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\n\tconst [ randomizeThemeColors ] = useColorRandomizer();\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( customColors || EMPTY_COLORS ),\n\t\t\t...( themeColors || EMPTY_COLORS ),\n\t\t\t...( defaultColors && defaultPaletteEnabled\n\t\t\t\t? defaultColors\n\t\t\t\t: EMPTY_COLORS ),\n\t\t],\n\t\t[ customColors, themeColors, defaultColors, defaultPaletteEnabled ]\n\t);\n\n\tconst screenPath = ! name\n\t\t? '/colors/palette'\n\t\t: '/blocks/' + encodeURIComponent( name ) + '/colors/palette';\n\tconst paletteButtonText =\n\t\tcolors.length > 0\n\t\t\t? sprintf(\n\t\t\t\t\t// Translators: %d: Number of palette colors.\n\t\t\t\t\t_n( '%d color', '%d colors', colors.length ),\n\t\t\t\t\tcolors.length\n\t\t\t )\n\t\t\t: __( 'Add custom colors' );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Palette' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\tpath={ screenPath }\n\t\t\t\t\taria-label={ __( 'Color palettes' ) }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tdirection={\n\t\t\t\t\t\t\tcolors.length === 0 ? 'row-reverse' : 'row'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t{ colors\n\t\t\t\t\t\t\t\t.slice( 0, 5 )\n\t\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t\t<ColorIndicatorWrapper\n\t\t\t\t\t\t\t\t\t\tkey={ `${ color }-${ index }` }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t\t\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</ZStack>\n\t\t\t\t\t\t<FlexItem>{ paletteButtonText }</FlexItem>\n\t\t\t\t\t</HStack>\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t</ItemGroup>\n\t\t\t{ window.__experimentalEnableColorRandomizer &&\n\t\t\t\tthemeColors?.length > 0 && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\ticon={ shuffle }\n\t\t\t\t\t\tonClick={ randomizeThemeColors }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Randomize colors' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default Palette;\n"]}
@@ -167,7 +167,7 @@ function GlobalStylesRevisionsMenu() {
167
167
  };
168
168
 
169
169
  const hasRevisions = revisionsCount >= 2;
170
- return (0, _element.createElement)(GlobalStylesMenuFill, null, (0, _element.createElement)(_components.DropdownMenu, {
170
+ return (0, _element.createElement)(GlobalStylesMenuFill, null, canReset || hasRevisions ? (0, _element.createElement)(_components.DropdownMenu, {
171
171
  icon: _icons.backup,
172
172
  label: (0, _i18n.__)('Revisions')
173
173
  }, ({
@@ -181,7 +181,12 @@ function GlobalStylesRevisionsMenu() {
181
181
  onClose();
182
182
  },
183
183
  disabled: !canReset
184
- }, (0, _i18n.__)('Reset to defaults')))));
184
+ }, (0, _i18n.__)('Reset to defaults')))) : (0, _element.createElement)(_components.Button, {
185
+ label: (0, _i18n.__)('Revisions'),
186
+ icon: _icons.backup,
187
+ disabled: true,
188
+ __experimentalIsFocusable: true
189
+ }));
185
190
  }
186
191
 
187
192
  function GlobalStylesNavigationScreen({
@@ -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;;AA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C,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;;AAIA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAjDA;AACA;AACA;;AAGA;AACA;AACA;;AAuBA;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;AACjC,QAAM;AAAEC,IAAAA;AAAF,MAAa,uBAAaC,kBAAb,CAAnB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAiB,qBAAaC,MAAF,IAAc;AAAA;;AAC/C,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QACLF,MAAM,CAAEG,eAAF,CADP;;AAGA,UAAMC,cAAc,GAAGF,sCAAsC,EAA7D;;AACA,UAAMG,YAAY,GAAGD,cAAc,GAChCH,eAAe,CAAE,MAAF,EAAU,cAAV,EAA0BG,cAA1B,CADiB,GAEhCE,SAFH;AAIA,WAAO;AACNP,MAAAA,UAAU,2BACT,CAAC,CAAEM,YAAY,EAAEE,MAAd,GAAwB,oBAAxB,CADM,yEAC4C;AAFhD,KAAP;AAIA,GAbsB,EAapB,EAboB,CAAvB;AAcA,QAAM;AAAEC,IAAAA;AAAF,MAAW,6CAAjB;;AACA,QAAMC,aAAa,GAAG,MAAMD,IAAI,CAAE,MAAF,CAAhC;;AAEA,SACC,4BAAC,oBAAD,QACC,4BAAC,wBAAD;AAAc,IAAA,IAAI,EAAGE,mBAAr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,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\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,M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A;;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,U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,SAAS,EAAC,kCADX;AAEC,IAAA,IAAI,EAAGgB,uBAFR;AAGC,IAAA,OAAO,EAAKC,KAAF,IAAa;AACtBA,MAAAA,KAAK,CAACC,eAAN;AACAlB,MAAAA,MAAM;AACN;AANF,KAQG,cAAI,MAAJ,CARH,CAJF,EAeC,4BAAC,kBAAD;AACC,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,10 +75,12 @@ function HeaderEditMode() {
75
75
  isListViewOpen,
76
76
  listViewShortcut,
77
77
  isVisualMode,
78
+ isDistractionFree,
78
79
  blockEditorMode,
79
80
  homeUrl,
80
81
  showIconLabels,
81
- editorCanvasView
82
+ editorCanvasView,
83
+ hasFixedToolbar
82
84
  } = (0, _data.useSelect)(select => {
83
85
  const {
84
86
  __experimentalGetPreviewDeviceType,
@@ -98,6 +100,9 @@ function HeaderEditMode() {
98
100
  getUnstableBase // Site index.
99
101
 
100
102
  } = select(_coreData.store);
103
+ const {
104
+ get: getPreference
105
+ } = select(_preferences.store);
101
106
  return {
102
107
  deviceType: __experimentalGetPreviewDeviceType(),
103
108
  templateType: postType,
@@ -107,8 +112,10 @@ function HeaderEditMode() {
107
112
  isVisualMode: getEditorMode() === 'visual',
108
113
  blockEditorMode: __unstableGetEditorMode(),
109
114
  homeUrl: getUnstableBase()?.home,
110
- showIconLabels: select(_preferences.store).get('core/edit-site', 'showIconLabels'),
111
- editorCanvasView: (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView()
115
+ showIconLabels: getPreference(_store.store.name, 'showIconLabels'),
116
+ editorCanvasView: (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(),
117
+ isDistractionFree: getPreference(_store.store.name, 'distractionFree'),
118
+ hasFixedToolbar: getPreference(_store.store.name, 'fixedToolbar')
112
119
  };
113
120
  }, []);
114
121
  const {
@@ -119,6 +126,7 @@ function HeaderEditMode() {
119
126
  const {
120
127
  __unstableSetEditorMode
121
128
  } = (0, _data.useDispatch)(_blockEditor.store);
129
+ const disableMotion = (0, _compose.useReducedMotion)();
122
130
  const isLargeViewport = (0, _compose.useViewportMatch)('medium');
123
131
  const toggleInserter = (0, _element.useCallback)(() => {
124
132
  if (isInserterOpen) {
@@ -148,17 +156,39 @@ function HeaderEditMode() {
148
156
  const shortLabel = !isInserterOpen ? (0, _i18n.__)('Add') : (0, _i18n.__)('Close');
149
157
  const isZoomedOutViewExperimentEnabled = window?.__experimentalEnableZoomedOutView && isVisualMode;
150
158
  const isZoomedOutView = blockEditorMode === 'zoom-out';
159
+ const toolbarVariants = {
160
+ isDistractionFree: {
161
+ y: '-50px'
162
+ },
163
+ isDistractionFreeHovering: {
164
+ y: 0
165
+ },
166
+ view: {
167
+ y: 0
168
+ },
169
+ edit: {
170
+ y: 0
171
+ }
172
+ };
173
+ const toolbarTransition = {
174
+ type: 'tween',
175
+ duration: disableMotion ? 0 : 0.2,
176
+ ease: 'easeOut'
177
+ };
151
178
  return (0, _element.createElement)("div", {
152
179
  className: (0, _classnames.default)('edit-site-header-edit-mode', {
153
180
  'show-icon-labels': showIconLabels
154
181
  })
155
182
  }, hasDefaultEditorCanvasView && (0, _element.createElement)(_blockEditor.NavigableToolbar, {
183
+ as: _components.__unstableMotion.div,
156
184
  className: "edit-site-header-edit-mode__start",
157
185
  "aria-label": (0, _i18n.__)('Document tools'),
158
- shouldUseKeyboardFocusShortcut: !blockToolbarCanBeFocused
186
+ shouldUseKeyboardFocusShortcut: !blockToolbarCanBeFocused,
187
+ variants: toolbarVariants,
188
+ transition: toolbarTransition
159
189
  }, (0, _element.createElement)("div", {
160
190
  className: "edit-site-header-edit-mode__toolbar"
161
- }, (0, _element.createElement)(_components.ToolbarItem, {
191
+ }, !isDistractionFree && (0, _element.createElement)(_components.ToolbarItem, {
162
192
  ref: inserterButton,
163
193
  as: _components.Button,
164
194
  className: "edit-site-header-edit-mode__inserter-toggle",
@@ -170,7 +200,7 @@ function HeaderEditMode() {
170
200
  icon: _icons.plus,
171
201
  label: showIconLabels ? shortLabel : longLabel,
172
202
  showTooltip: !showIconLabels
173
- }), isLargeViewport && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.ToolbarItem, {
203
+ }), isLargeViewport && (0, _element.createElement)(_element.Fragment, null, !hasFixedToolbar && (0, _element.createElement)(_components.ToolbarItem, {
174
204
  as: _blockEditor.ToolSelector,
175
205
  showTooltip: !showIconLabels,
176
206
  variant: showIconLabels ? 'tertiary' : undefined,
@@ -183,7 +213,7 @@ function HeaderEditMode() {
183
213
  as: _redo.default,
184
214
  showTooltip: !showIconLabels,
185
215
  variant: showIconLabels ? 'tertiary' : undefined
186
- }), (0, _element.createElement)(_components.ToolbarItem, {
216
+ }), !isDistractionFree && (0, _element.createElement)(_components.ToolbarItem, {
187
217
  as: _components.Button,
188
218
  className: "edit-site-header-edit-mode__list-view-toggle",
189
219
  disabled: !isVisualMode || isZoomedOutView,
@@ -196,7 +226,7 @@ function HeaderEditMode() {
196
226
  shortcut: listViewShortcut,
197
227
  showTooltip: !showIconLabels,
198
228
  variant: showIconLabels ? 'tertiary' : undefined
199
- }), isZoomedOutViewExperimentEnabled && (0, _element.createElement)(_components.ToolbarItem, {
229
+ }), isZoomedOutViewExperimentEnabled && !isDistractionFree && !hasFixedToolbar && (0, _element.createElement)(_components.ToolbarItem, {
200
230
  as: _components.Button,
201
231
  className: "edit-site-header-edit-mode__zoom-out-view-toggle",
202
232
  icon: _icons.chevronUpDown,
@@ -209,12 +239,14 @@ function HeaderEditMode() {
209
239
 
210
240
  __unstableSetEditorMode(isZoomedOutView ? 'edit' : 'zoom-out');
211
241
  }
212
- })))), (0, _element.createElement)("div", {
242
+ })))), !isDistractionFree && (0, _element.createElement)("div", {
213
243
  className: "edit-site-header-edit-mode__center"
214
244
  }, !hasDefaultEditorCanvasView ? (0, _editorCanvasContainer.getEditorCanvasContainerTitle)(editorCanvasView) : (0, _element.createElement)(_documentActions.default, null)), (0, _element.createElement)("div", {
215
245
  className: "edit-site-header-edit-mode__end"
216
- }, (0, _element.createElement)("div", {
217
- className: "edit-site-header-edit-mode__actions"
246
+ }, (0, _element.createElement)(_components.__unstableMotion.div, {
247
+ className: "edit-site-header-edit-mode__actions",
248
+ variants: toolbarVariants,
249
+ transition: toolbarTransition
218
250
  }, !isFocusMode && hasDefaultEditorCanvasView && (0, _element.createElement)("div", {
219
251
  className: (0, _classnames.default)('edit-site-header-edit-mode__preview-options', {
220
252
  'is-zoomed-out': isZoomedOutView
@@ -223,15 +255,18 @@ function HeaderEditMode() {
223
255
  deviceType: deviceType,
224
256
  setDeviceType: setPreviewDeviceType,
225
257
  label: (0, _i18n.__)('View')
226
- }, (0, _element.createElement)(_components.MenuGroup, null, (0, _element.createElement)(_components.MenuItem, {
258
+ }, ({
259
+ onClose
260
+ }) => (0, _element.createElement)(_components.MenuGroup, null, (0, _element.createElement)(_components.MenuItem, {
227
261
  href: homeUrl,
228
262
  target: "_blank",
229
- icon: _icons.external
263
+ icon: _icons.external,
264
+ onClick: onClose
230
265
  }, (0, _i18n.__)('View site'), (0, _element.createElement)(_components.VisuallyHidden, {
231
266
  as: "span"
232
267
  },
233
268
  /* translators: accessibility text */
234
- (0, _i18n.__)('(opens in a new tab)')))))), (0, _element.createElement)(_saveButton.default, null), (0, _element.createElement)(_interface.PinnedItems.Slot, {
269
+ (0, _i18n.__)('(opens in a new tab)')))))), (0, _element.createElement)(_saveButton.default, null), !isDistractionFree && (0, _element.createElement)(_interface.PinnedItems.Slot, {
235
270
  scope: "core/edit-site"
236
271
  }), (0, _element.createElement)(_moreMenu.default, {
237
272
  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;;AAL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jC,gBAA/B,CADC,GAGD,4BAAC,wBAAD,OAJF,CA5FD,EAoGC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,CAAEkC,WAAF,IAAiBD,0BAAjB,IACD;AACC,IAAA,SAAS,EAAG,yBACX,6CADW,EAEX;AAAE,uBAAiBO;AAAnB,KAFW;AADb,KAMC,4BAAC,yCAAD;AACC,IAAA,UAAU,EAAGjD,UADd;AAEC,IAAA,aAAa,EAAG6B,oBAFjB;AAGC,IAAA,KAAK,EAAG,cAAI,MAAJ;AAHT,KAKC,4BAAC,qBAAD,QACC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAGtB,OADR;AAEC,IAAA,MAAM,EAAC,QAFR;AAGC,IAAA,IAAI,EAAGmD;AAHR,KAKG,cAAI,WAAJ,CALH,EAMC,4BAAC,0BAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB;AAEE;AACA,gBAAI,sBAAJ,CAHF,CAND,CADD,CALD,CAND,CAFF,EA+BC,4BAAC,mBAAD,OA/BD,EAgCC,4BAAC,sBAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IAhCD,EAiCC,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGlD;AAA3B,IAjCD,CADD,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","hasFixedToolbar","select","__experimentalGetPreviewDeviceType","getEditedPostType","isInserterOpened","isListViewOpened","getEditorMode","editSiteStore","getShortcutRepresentation","keyboardShortcutsStore","__unstableGetEditorMode","blockEditorStore","postType","getUnstableBase","coreStore","get","getPreference","preferencesStore","home","name","getEditorCanvasContainerView","__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","onClose","external"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AA9CA;AACA;AACA;;AAGA;AACA;AACA;;AA0BA;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,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E,EAAC;AAAnB;AAEE;AACA,gBAAI,sBAAJ,CAHF,CAPD,CADD,CANF,CAND,CANF,EAsCC,4BAAC,mBAAD,OAtCD,EAuCG,CAAEpE,iBAAF,IACD,4BAAC,sBAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IAxCF,EA0CC,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGG;AAA3B,IA1CD,CADD,CAzHD,CADD;AA0KA","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\thasFixedToolbar,\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\tconst { get: getPreference } = select( preferencesStore );\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: getPreference(\n\t\t\t\teditSiteStore.name,\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: getPreference(\n\t\t\t\teditSiteStore.name,\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasFixedToolbar: getPreference(\n\t\t\t\teditSiteStore.name,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\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\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{ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\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\t{\n\t\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\t__( '(opens in a new tab)' )\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</VisuallyHidden>\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t) }\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"]}