@wordpress/edit-site 5.12.0 → 5.12.2

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 (904) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/build/components/add-new-pattern/index.js +99 -0
  3. package/build/components/add-new-pattern/index.js.map +1 -0
  4. package/build/components/add-new-template/add-custom-template-modal-content.js +9 -23
  5. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  6. package/build/components/add-new-template/index.js +2 -10
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +75 -22
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/app/index.js +2 -2
  11. package/build/components/app/index.js.map +1 -1
  12. package/build/components/block-editor/back-button.js +5 -3
  13. package/build/components/block-editor/back-button.js.map +1 -1
  14. package/build/components/block-editor/constants.js +9 -0
  15. package/build/components/block-editor/constants.js.map +1 -0
  16. package/build/components/block-editor/editor-canvas.js +8 -8
  17. package/build/components/block-editor/editor-canvas.js.map +1 -1
  18. package/build/components/block-editor/get-block-editor-provider.js +42 -0
  19. package/build/components/block-editor/get-block-editor-provider.js.map +1 -0
  20. package/build/components/block-editor/index.js +6 -132
  21. package/build/components/block-editor/index.js.map +1 -1
  22. package/build/components/block-editor/providers/default-block-editor-provider.js +58 -0
  23. package/build/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  24. package/build/components/block-editor/providers/navigation-block-editor-provider.js +117 -0
  25. package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  26. package/build/components/block-editor/site-editor-canvas.js +137 -0
  27. package/build/components/block-editor/site-editor-canvas.js.map +1 -0
  28. package/build/components/block-editor/use-site-editor-settings.js +82 -0
  29. package/build/components/block-editor/use-site-editor-settings.js.map +1 -0
  30. package/build/components/canvas-spinner/index.js +18 -1
  31. package/build/components/canvas-spinner/index.js.map +1 -1
  32. package/build/components/create-pattern-modal/index.js +125 -0
  33. package/build/components/create-pattern-modal/index.js.map +1 -0
  34. package/build/components/create-template-part-modal/index.js +50 -6
  35. package/build/components/create-template-part-modal/index.js.map +1 -1
  36. package/build/components/editor/index.js +24 -13
  37. package/build/components/editor/index.js.map +1 -1
  38. package/build/components/editor-canvas-container/index.js +22 -4
  39. package/build/components/editor-canvas-container/index.js.map +1 -1
  40. package/build/components/global-styles/color-indicator-wrapper.js +4 -5
  41. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  42. package/build/components/global-styles/color-palette-panel.js +2 -2
  43. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  44. package/build/components/global-styles/dimensions-panel.js +2 -2
  45. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  46. package/build/components/global-styles/global-styles-provider.js +12 -16
  47. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  48. package/build/components/global-styles/gradients-palette-panel.js +2 -2
  49. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  50. package/build/components/global-styles/hooks.js +3 -3
  51. package/build/components/global-styles/hooks.js.map +1 -1
  52. package/build/components/global-styles/icon-with-current-color.js +4 -5
  53. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  54. package/build/components/global-styles/navigation-button.js +10 -11
  55. package/build/components/global-styles/navigation-button.js.map +1 -1
  56. package/build/components/global-styles/palette.js +3 -3
  57. package/build/components/global-styles/palette.js.map +1 -1
  58. package/build/components/global-styles/preview.js +2 -2
  59. package/build/components/global-styles/preview.js.map +1 -1
  60. package/build/components/global-styles/root-menu.js +2 -2
  61. package/build/components/global-styles/root-menu.js.map +1 -1
  62. package/build/components/global-styles/screen-block-list.js +2 -2
  63. package/build/components/global-styles/screen-block-list.js.map +1 -1
  64. package/build/components/global-styles/screen-block.js +2 -2
  65. package/build/components/global-styles/screen-block.js.map +1 -1
  66. package/build/components/global-styles/screen-colors.js +2 -2
  67. package/build/components/global-styles/screen-colors.js.map +1 -1
  68. package/build/components/global-styles/screen-css.js +2 -2
  69. package/build/components/global-styles/screen-css.js.map +1 -1
  70. package/build/components/global-styles/screen-layout.js +2 -2
  71. package/build/components/global-styles/screen-layout.js.map +1 -1
  72. package/build/components/global-styles/screen-revisions/index.js +4 -4
  73. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  74. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +2 -2
  75. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  76. package/build/components/global-styles/screen-root.js +2 -2
  77. package/build/components/global-styles/screen-root.js.map +1 -1
  78. package/build/components/global-styles/screen-typography.js +2 -2
  79. package/build/components/global-styles/screen-typography.js.map +1 -1
  80. package/build/components/global-styles/style-variations-container.js +11 -3
  81. package/build/components/global-styles/style-variations-container.js.map +1 -1
  82. package/build/components/global-styles/typography-panel.js +2 -2
  83. package/build/components/global-styles/typography-panel.js.map +1 -1
  84. package/build/components/global-styles/typography-preview.js +2 -2
  85. package/build/components/global-styles/typography-preview.js.map +1 -1
  86. package/build/components/global-styles/ui.js +95 -36
  87. package/build/components/global-styles/ui.js.map +1 -1
  88. package/build/components/global-styles-renderer/index.js +2 -2
  89. package/build/components/global-styles-renderer/index.js.map +1 -1
  90. package/build/components/header-edit-mode/document-actions/index.js +55 -22
  91. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  92. package/build/components/header-edit-mode/index.js +41 -16
  93. package/build/components/header-edit-mode/index.js.map +1 -1
  94. package/build/components/header-edit-mode/more-menu/index.js +36 -2
  95. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  96. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -7
  97. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  98. package/build/components/header-edit-mode/undo-redo/redo.js +2 -6
  99. package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  100. package/build/components/header-edit-mode/undo-redo/undo.js +2 -6
  101. package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  102. package/build/components/keyboard-shortcut-help-modal/index.js +2 -1
  103. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  104. package/build/components/keyboard-shortcuts/edit-mode.js +39 -3
  105. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  106. package/build/components/keyboard-shortcuts/index.js +7 -2
  107. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  108. package/build/components/keyboard-shortcuts/register.js +10 -1
  109. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  110. package/build/components/layout/hooks.js +21 -0
  111. package/build/components/layout/hooks.js.map +1 -1
  112. package/build/components/layout/index.js +126 -34
  113. package/build/components/layout/index.js.map +1 -1
  114. package/build/components/list/index.js +2 -2
  115. package/build/components/list/index.js.map +1 -1
  116. package/build/components/page/header.js +41 -0
  117. package/build/components/page/header.js.map +1 -0
  118. package/build/components/page/index.js +49 -0
  119. package/build/components/page/index.js.map +1 -0
  120. package/build/components/page-content-focus-manager/back-to-page-notification.js +73 -0
  121. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  122. package/build/components/page-content-focus-manager/constants.js +9 -0
  123. package/build/components/page-content-focus-manager/constants.js.map +1 -0
  124. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +60 -0
  125. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  126. package/build/components/page-content-focus-manager/edit-template-notification.js +121 -0
  127. package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  128. package/build/components/page-content-focus-manager/index.js +37 -0
  129. package/build/components/page-content-focus-manager/index.js.map +1 -0
  130. package/build/components/page-library/grid-item.js +169 -0
  131. package/build/components/page-library/grid-item.js.map +1 -0
  132. package/build/components/page-library/grid.js +49 -0
  133. package/build/components/page-library/grid.js.map +1 -0
  134. package/build/components/page-library/index.js +61 -0
  135. package/build/components/page-library/index.js.map +1 -0
  136. package/build/components/page-library/no-patterns.js +20 -0
  137. package/build/components/page-library/no-patterns.js.map +1 -0
  138. package/build/components/page-library/patterns-list.js +108 -0
  139. package/build/components/page-library/patterns-list.js.map +1 -0
  140. package/build/components/page-library/search-items.js +172 -0
  141. package/build/components/page-library/search-items.js.map +1 -0
  142. package/build/components/page-library/use-library-settings.js +53 -0
  143. package/build/components/page-library/use-library-settings.js.map +1 -0
  144. package/build/components/page-library/use-patterns.js +194 -0
  145. package/build/components/page-library/use-patterns.js.map +1 -0
  146. package/build/components/page-library/utils.js +30 -0
  147. package/build/components/page-library/utils.js.map +1 -0
  148. package/build/components/page-main/index.js +46 -0
  149. package/build/components/page-main/index.js.map +1 -0
  150. package/build/components/page-templates/index.js +101 -0
  151. package/build/components/page-templates/index.js.map +1 -0
  152. package/build/components/preferences-modal/enable-feature.js +9 -8
  153. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  154. package/build/components/preferences-modal/index.js +30 -0
  155. package/build/components/preferences-modal/index.js.map +1 -1
  156. package/build/components/resizable-frame/index.js +6 -4
  157. package/build/components/resizable-frame/index.js.map +1 -1
  158. package/build/components/revisions/index.js +2 -2
  159. package/build/components/revisions/index.js.map +1 -1
  160. package/build/components/routes/link.js +7 -10
  161. package/build/components/routes/link.js.map +1 -1
  162. package/build/components/routes/use-title.js +2 -2
  163. package/build/components/routes/use-title.js.map +1 -1
  164. package/build/components/save-button/index.js +15 -11
  165. package/build/components/save-button/index.js.map +1 -1
  166. package/build/components/save-hub/index.js +2 -2
  167. package/build/components/save-hub/index.js.map +1 -1
  168. package/build/components/save-panel/index.js +5 -7
  169. package/build/components/save-panel/index.js.map +1 -1
  170. package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
  171. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  172. package/build/components/secondary-sidebar/list-view-sidebar.js +47 -10
  173. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  174. package/build/components/sidebar/index.js +12 -8
  175. package/build/components/sidebar/index.js.map +1 -1
  176. package/build/components/sidebar-button/index.js +2 -4
  177. package/build/components/sidebar-button/index.js.map +1 -1
  178. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +22 -8
  179. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  180. package/build/components/sidebar-edit-mode/index.js +8 -6
  181. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  182. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +84 -0
  183. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  184. package/build/components/sidebar-edit-mode/page-panels/index.js +51 -38
  185. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  186. package/build/components/sidebar-edit-mode/page-panels/page-content.js +35 -0
  187. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  188. package/build/components/sidebar-edit-mode/page-panels/page-status.js +192 -0
  189. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  190. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +45 -0
  191. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  192. package/build/components/sidebar-edit-mode/page-panels/publish-date.js +98 -0
  193. package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  194. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -7
  195. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  196. package/build/components/sidebar-edit-mode/settings-header/index.js +19 -6
  197. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  198. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +2 -2
  199. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  200. package/build/components/sidebar-edit-mode/template-panel/index.js +10 -6
  201. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  202. package/build/components/sidebar-navigation-item/index.js +11 -7
  203. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  204. package/build/components/sidebar-navigation-screen/index.js +24 -9
  205. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  206. package/build/components/sidebar-navigation-screen-details-footer/index.js +36 -0
  207. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  208. package/build/components/sidebar-navigation-screen-details-panel/index.js +58 -0
  209. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  210. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +22 -0
  211. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  212. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +35 -0
  213. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  214. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +22 -0
  215. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  216. package/build/components/sidebar-navigation-screen-global-styles/index.js +28 -16
  217. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  218. package/build/components/sidebar-navigation-screen-library/category-item.js +48 -0
  219. package/build/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  220. package/build/components/sidebar-navigation-screen-library/index.js +112 -0
  221. package/build/components/sidebar-navigation-screen-library/index.js.map +1 -0
  222. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +36 -0
  223. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  224. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js +76 -0
  225. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  226. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +41 -0
  227. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  228. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js +40 -0
  229. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  230. package/build/components/sidebar-navigation-screen-main/index.js +12 -13
  231. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  232. package/build/components/sidebar-navigation-screen-navigation-item/index.js +2 -2
  233. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  234. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +42 -0
  235. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  236. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +41 -0
  237. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  238. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +47 -92
  239. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  240. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +84 -0
  241. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  242. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +71 -0
  243. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  244. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +63 -0
  245. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  246. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +49 -0
  247. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  248. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +167 -0
  249. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  250. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  251. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  252. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +58 -8
  253. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  254. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +57 -10
  255. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +21 -50
  257. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-page/index.js +14 -34
  259. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-page/page-details.js +29 -27
  261. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-page/status-label.js +8 -7
  263. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  264. package/build/components/sidebar-navigation-screen-pages/index.js +9 -8
  265. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  266. package/build/components/sidebar-navigation-screen-pattern/index.js +66 -0
  267. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  268. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +41 -0
  269. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  270. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +33 -0
  271. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  272. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +40 -0
  273. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  274. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +47 -0
  275. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  276. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +82 -0
  277. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  278. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +80 -0
  279. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  280. package/build/components/sidebar-navigation-screen-template/home-template-details.js +212 -0
  281. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  282. package/build/components/sidebar-navigation-screen-template/index.js +21 -7
  283. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  284. package/build/components/sidebar-navigation-screen-templates/index.js +11 -11
  285. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  286. package/build/components/site-hub/index.js +10 -12
  287. package/build/components/site-hub/index.js.map +1 -1
  288. package/build/components/style-book/index.js +10 -11
  289. package/build/components/style-book/index.js.map +1 -1
  290. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -4
  291. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  292. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -4
  293. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  294. package/build/components/sync-state-with-url/use-sync-path-with-url.js +12 -2
  295. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  296. package/build/components/table/index.js +29 -0
  297. package/build/components/table/index.js.map +1 -0
  298. package/build/components/template-part-converter/convert-to-template-part.js +3 -21
  299. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  300. package/build/components/welcome-guide/editor.js +1 -1
  301. package/build/components/welcome-guide/editor.js.map +1 -1
  302. package/build/components/welcome-guide/styles.js +4 -3
  303. package/build/components/welcome-guide/styles.js.map +1 -1
  304. package/build/hooks/commands/use-common-commands.js +212 -0
  305. package/build/hooks/commands/use-common-commands.js.map +1 -0
  306. package/build/hooks/commands/use-edit-mode-commands.js +196 -24
  307. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  308. package/build/hooks/index.js +2 -0
  309. package/build/hooks/index.js.map +1 -1
  310. package/build/hooks/navigation-menu-edit.js +95 -0
  311. package/build/hooks/navigation-menu-edit.js.map +1 -0
  312. package/build/hooks/push-changes-to-global-styles/index.js +5 -3
  313. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  314. package/build/hooks/template-part-edit.js +6 -9
  315. package/build/hooks/template-part-edit.js.map +1 -1
  316. package/build/index.js +1 -0
  317. package/build/index.js.map +1 -1
  318. package/build/{private-apis.js → lock-unlock.js} +1 -1
  319. package/build/lock-unlock.js.map +1 -0
  320. package/build/store/actions.js +45 -9
  321. package/build/store/actions.js.map +1 -1
  322. package/build/store/index.js +3 -3
  323. package/build/store/index.js.map +1 -1
  324. package/build/store/reducer.js +7 -6
  325. package/build/store/reducer.js.map +1 -1
  326. package/build/store/selectors.js +42 -17
  327. package/build/store/selectors.js.map +1 -1
  328. package/build/utils/get-is-list-page.js +12 -5
  329. package/build/utils/get-is-list-page.js.map +1 -1
  330. package/build/utils/is-previewing-theme.js +2 -2
  331. package/build/utils/is-previewing-theme.js.map +1 -1
  332. package/build/utils/use-activate-theme.js +3 -3
  333. package/build/utils/use-activate-theme.js.map +1 -1
  334. package/build/utils/use-debounced-input.js +26 -0
  335. package/build/utils/use-debounced-input.js.map +1 -0
  336. package/build-module/components/add-new-pattern/index.js +82 -0
  337. package/build-module/components/add-new-pattern/index.js.map +1 -0
  338. package/build-module/components/add-new-template/add-custom-template-modal-content.js +7 -20
  339. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  340. package/build-module/components/add-new-template/index.js +2 -8
  341. package/build-module/components/add-new-template/index.js.map +1 -1
  342. package/build-module/components/add-new-template/new-template.js +76 -22
  343. package/build-module/components/add-new-template/new-template.js.map +1 -1
  344. package/build-module/components/app/index.js +1 -1
  345. package/build-module/components/app/index.js.map +1 -1
  346. package/build-module/components/block-editor/back-button.js +4 -2
  347. package/build-module/components/block-editor/back-button.js.map +1 -1
  348. package/build-module/components/block-editor/constants.js +2 -0
  349. package/build-module/components/block-editor/constants.js.map +1 -0
  350. package/build-module/components/block-editor/editor-canvas.js +6 -5
  351. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  352. package/build-module/components/block-editor/get-block-editor-provider.js +31 -0
  353. package/build-module/components/block-editor/get-block-editor-provider.js.map +1 -0
  354. package/build-module/components/block-editor/index.js +9 -127
  355. package/build-module/components/block-editor/index.js.map +1 -1
  356. package/build-module/components/block-editor/providers/default-block-editor-provider.js +42 -0
  357. package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  358. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js +102 -0
  359. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  360. package/build-module/components/block-editor/site-editor-canvas.js +115 -0
  361. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -0
  362. package/build-module/components/block-editor/use-site-editor-settings.js +67 -0
  363. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -0
  364. package/build-module/components/canvas-spinner/index.js +15 -1
  365. package/build-module/components/canvas-spinner/index.js.map +1 -1
  366. package/build-module/components/create-pattern-modal/index.js +113 -0
  367. package/build-module/components/create-pattern-modal/index.js.map +1 -0
  368. package/build-module/components/create-template-part-modal/index.js +47 -7
  369. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  370. package/build-module/components/editor/index.js +24 -13
  371. package/build-module/components/editor/index.js.map +1 -1
  372. package/build-module/components/editor-canvas-container/index.js +19 -2
  373. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  374. package/build-module/components/global-styles/color-indicator-wrapper.js +4 -4
  375. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  376. package/build-module/components/global-styles/color-palette-panel.js +1 -1
  377. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  378. package/build-module/components/global-styles/dimensions-panel.js +1 -1
  379. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  380. package/build-module/components/global-styles/global-styles-provider.js +10 -15
  381. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  382. package/build-module/components/global-styles/gradients-palette-panel.js +1 -1
  383. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  384. package/build-module/components/global-styles/hooks.js +1 -1
  385. package/build-module/components/global-styles/hooks.js.map +1 -1
  386. package/build-module/components/global-styles/icon-with-current-color.js +4 -4
  387. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  388. package/build-module/components/global-styles/navigation-button.js +10 -8
  389. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  390. package/build-module/components/global-styles/palette.js +2 -2
  391. package/build-module/components/global-styles/palette.js.map +1 -1
  392. package/build-module/components/global-styles/preview.js +1 -1
  393. package/build-module/components/global-styles/preview.js.map +1 -1
  394. package/build-module/components/global-styles/root-menu.js +1 -1
  395. package/build-module/components/global-styles/root-menu.js.map +1 -1
  396. package/build-module/components/global-styles/screen-block-list.js +1 -1
  397. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  398. package/build-module/components/global-styles/screen-block.js +1 -1
  399. package/build-module/components/global-styles/screen-block.js.map +1 -1
  400. package/build-module/components/global-styles/screen-colors.js +1 -1
  401. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  402. package/build-module/components/global-styles/screen-css.js +1 -1
  403. package/build-module/components/global-styles/screen-css.js.map +1 -1
  404. package/build-module/components/global-styles/screen-layout.js +1 -1
  405. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  406. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  407. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  408. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
  409. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  410. package/build-module/components/global-styles/screen-root.js +1 -1
  411. package/build-module/components/global-styles/screen-root.js.map +1 -1
  412. package/build-module/components/global-styles/screen-typography.js +1 -1
  413. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  414. package/build-module/components/global-styles/style-variations-container.js +11 -3
  415. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  416. package/build-module/components/global-styles/typography-panel.js +1 -1
  417. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  418. package/build-module/components/global-styles/typography-preview.js +1 -1
  419. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  420. package/build-module/components/global-styles/ui.js +94 -35
  421. package/build-module/components/global-styles/ui.js.map +1 -1
  422. package/build-module/components/global-styles-renderer/index.js +1 -1
  423. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  424. package/build-module/components/header-edit-mode/document-actions/index.js +55 -22
  425. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  426. package/build-module/components/header-edit-mode/index.js +42 -17
  427. package/build-module/components/header-edit-mode/index.js.map +1 -1
  428. package/build-module/components/header-edit-mode/more-menu/index.js +35 -3
  429. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  430. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -4
  431. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  432. package/build-module/components/header-edit-mode/undo-redo/redo.js +2 -3
  433. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  434. package/build-module/components/header-edit-mode/undo-redo/undo.js +2 -3
  435. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  436. package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -1
  437. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  438. package/build-module/components/keyboard-shortcuts/edit-mode.js +36 -3
  439. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  440. package/build-module/components/keyboard-shortcuts/index.js +7 -2
  441. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  442. package/build-module/components/keyboard-shortcuts/register.js +10 -1
  443. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  444. package/build-module/components/layout/hooks.js +21 -0
  445. package/build-module/components/layout/hooks.js.map +1 -1
  446. package/build-module/components/layout/index.js +119 -28
  447. package/build-module/components/layout/index.js.map +1 -1
  448. package/build-module/components/list/index.js +1 -1
  449. package/build-module/components/list/index.js.map +1 -1
  450. package/build-module/components/page/header.js +33 -0
  451. package/build-module/components/page/header.js.map +1 -0
  452. package/build-module/components/page/index.js +37 -0
  453. package/build-module/components/page/index.js.map +1 -0
  454. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +59 -0
  455. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  456. package/build-module/components/page-content-focus-manager/constants.js +2 -0
  457. package/build-module/components/page-content-focus-manager/constants.js.map +1 -0
  458. package/build-module/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +18 -9
  459. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  460. package/build-module/components/page-content-focus-manager/edit-template-notification.js +110 -0
  461. package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  462. package/build-module/components/page-content-focus-manager/index.js +23 -0
  463. package/build-module/components/page-content-focus-manager/index.js.map +1 -0
  464. package/build-module/components/page-library/grid-item.js +149 -0
  465. package/build-module/components/page-library/grid-item.js.map +1 -0
  466. package/build-module/components/page-library/grid.js +38 -0
  467. package/build-module/components/page-library/grid.js.map +1 -0
  468. package/build-module/components/page-library/index.js +43 -0
  469. package/build-module/components/page-library/index.js.map +1 -0
  470. package/build-module/components/page-library/no-patterns.js +12 -0
  471. package/build-module/components/page-library/no-patterns.js.map +1 -0
  472. package/build-module/components/page-library/patterns-list.js +87 -0
  473. package/build-module/components/page-library/patterns-list.js.map +1 -0
  474. package/build-module/components/page-library/search-items.js +156 -0
  475. package/build-module/components/page-library/search-items.js.map +1 -0
  476. package/build-module/components/page-library/use-library-settings.js +40 -0
  477. package/build-module/components/page-library/use-library-settings.js.map +1 -0
  478. package/build-module/components/page-library/use-patterns.js +176 -0
  479. package/build-module/components/page-library/use-patterns.js.map +1 -0
  480. package/build-module/components/page-library/utils.js +13 -0
  481. package/build-module/components/page-library/utils.js.map +1 -0
  482. package/build-module/components/page-main/index.js +32 -0
  483. package/build-module/components/page-main/index.js.map +1 -0
  484. package/build-module/components/page-templates/index.js +80 -0
  485. package/build-module/components/page-templates/index.js.map +1 -0
  486. package/build-module/components/preferences-modal/enable-feature.js +9 -5
  487. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  488. package/build-module/components/preferences-modal/index.js +27 -0
  489. package/build-module/components/preferences-modal/index.js.map +1 -1
  490. package/build-module/components/resizable-frame/index.js +5 -3
  491. package/build-module/components/resizable-frame/index.js.map +1 -1
  492. package/build-module/components/revisions/index.js +1 -1
  493. package/build-module/components/revisions/index.js.map +1 -1
  494. package/build-module/components/routes/link.js +6 -6
  495. package/build-module/components/routes/link.js.map +1 -1
  496. package/build-module/components/routes/use-title.js +1 -1
  497. package/build-module/components/routes/use-title.js.map +1 -1
  498. package/build-module/components/save-button/index.js +15 -11
  499. package/build-module/components/save-button/index.js.map +1 -1
  500. package/build-module/components/save-hub/index.js +1 -1
  501. package/build-module/components/save-hub/index.js.map +1 -1
  502. package/build-module/components/save-panel/index.js +3 -4
  503. package/build-module/components/save-panel/index.js.map +1 -1
  504. package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
  505. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  506. package/build-module/components/secondary-sidebar/list-view-sidebar.js +44 -10
  507. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  508. package/build-module/components/sidebar/index.js +10 -7
  509. package/build-module/components/sidebar/index.js.map +1 -1
  510. package/build-module/components/sidebar-button/index.js +2 -3
  511. package/build-module/components/sidebar-button/index.js.map +1 -1
  512. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +19 -6
  513. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  514. package/build-module/components/sidebar-edit-mode/index.js +8 -6
  515. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  516. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +71 -0
  517. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  518. package/build-module/components/sidebar-edit-mode/page-panels/index.js +51 -40
  519. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  520. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +23 -0
  521. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  522. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +176 -0
  523. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  524. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +33 -0
  525. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  526. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +85 -0
  527. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  528. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -4
  529. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  530. package/build-module/components/sidebar-edit-mode/settings-header/index.js +20 -7
  531. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  532. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  533. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  534. package/build-module/components/sidebar-edit-mode/template-panel/index.js +9 -6
  535. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  536. package/build-module/components/sidebar-navigation-item/index.js +11 -7
  537. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  538. package/build-module/components/sidebar-navigation-screen/index.js +24 -9
  539. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  540. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +27 -0
  541. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  542. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +30 -0
  543. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  544. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  545. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  546. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +24 -0
  547. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  548. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  549. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  550. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +23 -11
  551. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  552. package/build-module/components/sidebar-navigation-screen-library/category-item.js +37 -0
  553. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  554. package/build-module/components/sidebar-navigation-screen-library/index.js +87 -0
  555. package/build-module/components/sidebar-navigation-screen-library/index.js.map +1 -0
  556. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +25 -0
  557. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  558. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js +61 -0
  559. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  560. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +34 -0
  561. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  562. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js +27 -0
  563. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  564. package/build-module/components/sidebar-navigation-screen-main/index.js +13 -13
  565. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  566. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  567. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  568. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +33 -0
  569. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  570. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +26 -0
  571. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  572. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +45 -90
  573. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  574. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +70 -0
  575. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  576. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +58 -0
  577. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  578. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +56 -0
  579. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  580. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +35 -0
  581. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  582. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +155 -0
  583. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  584. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  585. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  586. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +57 -9
  587. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  588. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +55 -7
  589. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  590. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +22 -50
  591. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  592. package/build-module/components/sidebar-navigation-screen-page/index.js +14 -34
  593. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  594. package/build-module/components/sidebar-navigation-screen-page/page-details.js +28 -28
  595. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  596. package/build-module/components/sidebar-navigation-screen-page/status-label.js +9 -8
  597. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  598. package/build-module/components/sidebar-navigation-screen-pages/index.js +8 -6
  599. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  600. package/build-module/components/sidebar-navigation-screen-pattern/index.js +46 -0
  601. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  602. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  603. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  604. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +22 -0
  605. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  606. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +27 -0
  607. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  608. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +34 -0
  609. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  610. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  611. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  612. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +64 -0
  613. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  614. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +192 -0
  615. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  616. package/build-module/components/sidebar-navigation-screen-template/index.js +18 -6
  617. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  618. package/build-module/components/sidebar-navigation-screen-templates/index.js +11 -10
  619. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  620. package/build-module/components/site-hub/index.js +8 -9
  621. package/build-module/components/site-hub/index.js.map +1 -1
  622. package/build-module/components/style-book/index.js +9 -9
  623. package/build-module/components/style-book/index.js.map +1 -1
  624. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +13 -3
  625. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  626. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  627. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  628. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
  629. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  630. package/build-module/components/table/index.js +21 -0
  631. package/build-module/components/table/index.js.map +1 -0
  632. package/build-module/components/template-part-converter/convert-to-template-part.js +4 -20
  633. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  634. package/build-module/components/welcome-guide/editor.js +1 -1
  635. package/build-module/components/welcome-guide/editor.js.map +1 -1
  636. package/build-module/components/welcome-guide/styles.js +5 -3
  637. package/build-module/components/welcome-guide/styles.js.map +1 -1
  638. package/build-module/hooks/commands/use-common-commands.js +194 -0
  639. package/build-module/hooks/commands/use-common-commands.js.map +1 -0
  640. package/build-module/hooks/commands/use-edit-mode-commands.js +196 -26
  641. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  642. package/build-module/hooks/index.js +1 -0
  643. package/build-module/hooks/index.js.map +1 -1
  644. package/build-module/hooks/navigation-menu-edit.js +77 -0
  645. package/build-module/hooks/navigation-menu-edit.js.map +1 -0
  646. package/build-module/hooks/push-changes-to-global-styles/index.js +4 -2
  647. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  648. package/build-module/hooks/template-part-edit.js +5 -5
  649. package/build-module/hooks/template-part-edit.js.map +1 -1
  650. package/build-module/index.js +1 -0
  651. package/build-module/index.js.map +1 -1
  652. package/build-module/{private-apis.js → lock-unlock.js} +1 -1
  653. package/build-module/lock-unlock.js.map +1 -0
  654. package/build-module/store/actions.js +39 -7
  655. package/build-module/store/actions.js.map +1 -1
  656. package/build-module/store/index.js +1 -1
  657. package/build-module/store/index.js.map +1 -1
  658. package/build-module/store/reducer.js +6 -5
  659. package/build-module/store/reducer.js.map +1 -1
  660. package/build-module/store/selectors.js +37 -15
  661. package/build-module/store/selectors.js.map +1 -1
  662. package/build-module/utils/get-is-list-page.js +12 -5
  663. package/build-module/utils/get-is-list-page.js.map +1 -1
  664. package/build-module/utils/is-previewing-theme.js +2 -2
  665. package/build-module/utils/is-previewing-theme.js.map +1 -1
  666. package/build-module/utils/use-activate-theme.js +2 -2
  667. package/build-module/utils/use-activate-theme.js.map +1 -1
  668. package/build-module/utils/use-debounced-input.js +17 -0
  669. package/build-module/utils/use-debounced-input.js.map +1 -0
  670. package/build-style/style-rtl.css +424 -38
  671. package/build-style/style.css +424 -38
  672. package/package.json +44 -40
  673. package/src/components/add-new-pattern/index.js +92 -0
  674. package/src/components/add-new-template/add-custom-template-modal-content.js +1 -13
  675. package/src/components/add-new-template/index.js +0 -3
  676. package/src/components/add-new-template/new-template.js +121 -26
  677. package/src/components/add-new-template/style.scss +30 -2
  678. package/src/components/app/index.js +1 -1
  679. package/src/components/block-editor/back-button.js +5 -2
  680. package/src/components/block-editor/constants.js +1 -0
  681. package/src/components/block-editor/editor-canvas.js +1 -1
  682. package/src/components/block-editor/get-block-editor-provider.js +29 -0
  683. package/src/components/block-editor/index.js +15 -199
  684. package/src/components/block-editor/providers/default-block-editor-provider.js +44 -0
  685. package/src/components/block-editor/providers/navigation-block-editor-provider.js +114 -0
  686. package/src/components/block-editor/site-editor-canvas.js +155 -0
  687. package/src/components/block-editor/style.scss +6 -0
  688. package/src/components/block-editor/use-site-editor-settings.js +91 -0
  689. package/src/components/canvas-spinner/index.js +11 -1
  690. package/src/components/create-pattern-modal/index.js +134 -0
  691. package/src/components/create-pattern-modal/style.scss +3 -0
  692. package/src/components/create-template-part-modal/index.js +64 -4
  693. package/src/components/editor/index.js +25 -15
  694. package/src/components/editor/style.scss +4 -0
  695. package/src/components/editor-canvas-container/index.js +21 -4
  696. package/src/components/global-styles/color-palette-panel.js +1 -1
  697. package/src/components/global-styles/dimensions-panel.js +1 -1
  698. package/src/components/global-styles/global-styles-provider.js +10 -14
  699. package/src/components/global-styles/gradients-palette-panel.js +1 -1
  700. package/src/components/global-styles/hooks.js +1 -1
  701. package/src/components/global-styles/palette.js +2 -2
  702. package/src/components/global-styles/preview.js +1 -1
  703. package/src/components/global-styles/root-menu.js +1 -1
  704. package/src/components/global-styles/screen-block-list.js +1 -1
  705. package/src/components/global-styles/screen-block.js +1 -1
  706. package/src/components/global-styles/screen-colors.js +1 -1
  707. package/src/components/global-styles/screen-css.js +1 -1
  708. package/src/components/global-styles/screen-layout.js +1 -1
  709. package/src/components/global-styles/screen-revisions/index.js +1 -1
  710. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
  711. package/src/components/global-styles/screen-root.js +1 -1
  712. package/src/components/global-styles/screen-typography.js +1 -1
  713. package/src/components/global-styles/stories/index.js +1 -1
  714. package/src/components/global-styles/style-variations-container.js +13 -3
  715. package/src/components/global-styles/style.scss +11 -0
  716. package/src/components/global-styles/typography-panel.js +1 -1
  717. package/src/components/global-styles/typography-preview.js +1 -1
  718. package/src/components/global-styles/ui.js +115 -46
  719. package/src/components/global-styles-renderer/index.js +1 -1
  720. package/src/components/header-edit-mode/document-actions/index.js +51 -26
  721. package/src/components/header-edit-mode/document-actions/style.scss +9 -5
  722. package/src/components/header-edit-mode/index.js +100 -58
  723. package/src/components/header-edit-mode/more-menu/index.js +52 -7
  724. package/src/components/keyboard-shortcuts/edit-mode.js +40 -3
  725. package/src/components/keyboard-shortcuts/index.js +5 -1
  726. package/src/components/keyboard-shortcuts/register.js +11 -1
  727. package/src/components/layout/hooks.js +21 -0
  728. package/src/components/layout/index.js +207 -110
  729. package/src/components/layout/style.scss +65 -1
  730. package/src/components/list/index.js +1 -1
  731. package/src/components/page/header.js +38 -0
  732. package/src/components/page/index.js +38 -0
  733. package/src/components/page/style.scss +38 -0
  734. package/src/components/page-content-focus-manager/back-to-page-notification.js +70 -0
  735. package/src/components/{page-content-lock → page-content-focus-manager}/constants.js +1 -1
  736. package/src/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +15 -7
  737. package/src/components/page-content-focus-manager/edit-template-notification.js +108 -0
  738. package/src/components/page-content-focus-manager/index.js +26 -0
  739. package/src/components/page-library/grid-item.js +179 -0
  740. package/src/components/page-library/grid.js +39 -0
  741. package/src/components/page-library/index.js +39 -0
  742. package/src/components/page-library/no-patterns.js +12 -0
  743. package/src/components/page-library/patterns-list.js +114 -0
  744. package/src/components/page-library/search-items.js +171 -0
  745. package/src/components/page-library/style.scss +105 -0
  746. package/src/components/page-library/use-library-settings.js +51 -0
  747. package/src/components/page-library/use-patterns.js +238 -0
  748. package/src/components/page-library/utils.js +21 -0
  749. package/src/components/page-main/index.js +27 -0
  750. package/src/components/page-templates/index.js +104 -0
  751. package/src/components/preferences-modal/enable-feature.js +5 -2
  752. package/src/components/preferences-modal/index.js +25 -0
  753. package/src/components/resizable-frame/index.js +3 -1
  754. package/src/components/revisions/index.js +1 -1
  755. package/src/components/routes/link.js +2 -2
  756. package/src/components/routes/use-title.js +1 -1
  757. package/src/components/save-button/index.js +14 -11
  758. package/src/components/save-hub/index.js +1 -1
  759. package/src/components/save-panel/index.js +1 -1
  760. package/src/components/secondary-sidebar/list-view-sidebar.js +53 -6
  761. package/src/components/sidebar/index.js +11 -7
  762. package/src/components/sidebar-button/style.scss +1 -1
  763. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -29
  764. package/src/components/sidebar-edit-mode/index.js +8 -6
  765. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +69 -0
  766. package/src/components/sidebar-edit-mode/page-panels/index.js +53 -53
  767. package/src/components/sidebar-edit-mode/page-panels/page-content.js +27 -0
  768. package/src/components/sidebar-edit-mode/page-panels/page-status.js +233 -0
  769. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +35 -0
  770. package/src/components/sidebar-edit-mode/page-panels/publish-date.js +94 -0
  771. package/src/components/sidebar-edit-mode/page-panels/style.scss +31 -0
  772. package/src/components/sidebar-edit-mode/settings-header/index.js +18 -9
  773. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  774. package/src/components/sidebar-edit-mode/template-panel/index.js +9 -6
  775. package/src/components/sidebar-navigation-item/index.js +6 -2
  776. package/src/components/sidebar-navigation-item/style.scss +8 -1
  777. package/src/components/sidebar-navigation-screen/index.js +22 -8
  778. package/src/components/sidebar-navigation-screen/style.scss +30 -9
  779. package/src/components/sidebar-navigation-screen-details-footer/index.js +45 -0
  780. package/src/components/sidebar-navigation-screen-details-footer/style.scss +5 -0
  781. package/src/components/sidebar-navigation-screen-details-panel/index.js +40 -0
  782. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  783. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +29 -0
  784. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  785. package/src/components/sidebar-navigation-screen-details-panel/style.scss +25 -0
  786. package/src/components/sidebar-navigation-screen-global-styles/index.js +24 -6
  787. package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -3
  788. package/src/components/sidebar-navigation-screen-library/category-item.js +43 -0
  789. package/src/components/sidebar-navigation-screen-library/index.js +136 -0
  790. package/src/components/sidebar-navigation-screen-library/style.scss +3 -0
  791. package/src/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +32 -0
  792. package/src/components/sidebar-navigation-screen-library/use-pattern-categories.js +64 -0
  793. package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +33 -0
  794. package/src/components/sidebar-navigation-screen-library/use-theme-patterns.js +44 -0
  795. package/src/components/sidebar-navigation-screen-main/index.js +11 -14
  796. package/src/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  797. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +45 -0
  798. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +24 -0
  799. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +50 -96
  800. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +89 -0
  801. package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +51 -0
  802. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +62 -0
  803. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +39 -0
  804. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +15 -0
  805. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +179 -0
  806. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  807. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +73 -14
  808. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +61 -2
  809. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +25 -47
  810. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +4 -0
  811. package/src/components/sidebar-navigation-screen-page/index.js +19 -58
  812. package/src/components/sidebar-navigation-screen-page/page-details.js +42 -39
  813. package/src/components/sidebar-navigation-screen-page/status-label.js +23 -19
  814. package/src/components/sidebar-navigation-screen-page/style.scss +1 -18
  815. package/src/components/sidebar-navigation-screen-pages/index.js +30 -29
  816. package/src/components/sidebar-navigation-screen-pattern/index.js +44 -0
  817. package/src/components/sidebar-navigation-screen-pattern/style.scss +25 -0
  818. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  819. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +21 -0
  820. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +30 -0
  821. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +33 -0
  822. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  823. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +86 -0
  824. package/src/components/sidebar-navigation-screen-template/home-template-details.js +230 -0
  825. package/src/components/sidebar-navigation-screen-template/index.js +19 -5
  826. package/src/components/sidebar-navigation-screen-template/style.scss +37 -14
  827. package/src/components/sidebar-navigation-screen-templates/index.js +18 -25
  828. package/src/components/site-hub/index.js +13 -9
  829. package/src/components/site-hub/style.scss +4 -3
  830. package/src/components/style-book/index.js +1 -1
  831. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -3
  832. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  833. package/src/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
  834. package/src/components/table/index.js +33 -0
  835. package/src/components/table/style.scss +37 -0
  836. package/src/components/template-part-converter/convert-to-template-part.js +4 -27
  837. package/src/components/welcome-guide/editor.js +1 -1
  838. package/src/components/welcome-guide/styles.js +5 -3
  839. package/src/hooks/commands/use-common-commands.js +186 -0
  840. package/src/hooks/commands/use-edit-mode-commands.js +183 -28
  841. package/src/hooks/index.js +1 -0
  842. package/src/hooks/navigation-menu-edit.js +95 -0
  843. package/src/hooks/push-changes-to-global-styles/index.js +1 -1
  844. package/src/hooks/template-part-edit.js +1 -1
  845. package/src/index.js +1 -0
  846. package/src/store/actions.js +40 -8
  847. package/src/store/index.js +1 -1
  848. package/src/store/reducer.js +6 -5
  849. package/src/store/selectors.js +39 -9
  850. package/src/store/test/actions.js +8 -8
  851. package/src/store/test/reducer.js +11 -11
  852. package/src/store/test/selectors.js +10 -8
  853. package/src/style.scss +13 -2
  854. package/src/utils/get-is-list-page.js +16 -4
  855. package/src/utils/is-previewing-theme.js +4 -2
  856. package/src/utils/use-activate-theme.js +3 -2
  857. package/src/utils/use-debounced-input.js +17 -0
  858. package/build/components/add-new-template/new-template-part.js +0 -113
  859. package/build/components/add-new-template/new-template-part.js.map +0 -1
  860. package/build/components/page-content-lock/constants.js +0 -9
  861. package/build/components/page-content-lock/constants.js.map +0 -1
  862. package/build/components/page-content-lock/index.js +0 -29
  863. package/build/components/page-content-lock/index.js.map +0 -1
  864. package/build/components/page-content-lock/use-disable-non-content-blocks.js +0 -49
  865. package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
  866. package/build/components/page-content-lock/use-page-content-lock-notifications.js +0 -112
  867. package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
  868. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -79
  869. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
  870. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -52
  871. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  872. package/build/components/sidebar-navigation-screen-template-part/index.js +0 -105
  873. package/build/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
  874. package/build/components/sidebar-navigation-subtitle/index.js +0 -17
  875. package/build/components/sidebar-navigation-subtitle/index.js.map +0 -1
  876. package/build/private-apis.js.map +0 -1
  877. package/build-module/components/add-new-template/new-template-part.js +0 -93
  878. package/build-module/components/add-new-template/new-template-part.js.map +0 -1
  879. package/build-module/components/page-content-lock/constants.js +0 -2
  880. package/build-module/components/page-content-lock/constants.js.map +0 -1
  881. package/build-module/components/page-content-lock/index.js +0 -14
  882. package/build-module/components/page-content-lock/index.js.map +0 -1
  883. package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
  884. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +0 -98
  885. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
  886. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -67
  887. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
  888. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -39
  889. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  890. package/build-module/components/sidebar-navigation-screen-template-part/index.js +0 -86
  891. package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
  892. package/build-module/components/sidebar-navigation-subtitle/index.js +0 -9
  893. package/build-module/components/sidebar-navigation-subtitle/index.js.map +0 -1
  894. package/build-module/private-apis.js.map +0 -1
  895. package/src/components/add-new-template/new-template-part.js +0 -109
  896. package/src/components/page-content-lock/index.js +0 -14
  897. package/src/components/page-content-lock/use-page-content-lock-notifications.js +0 -128
  898. package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -77
  899. package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -47
  900. package/src/components/sidebar-navigation-screen-template-part/index.js +0 -103
  901. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -4
  902. package/src/components/sidebar-navigation-subtitle/index.js +0 -5
  903. package/src/components/sidebar-navigation-subtitle/style.scss +0 -7
  904. /package/src/{private-apis.js → lock-unlock.js} +0 -0
@@ -9,7 +9,7 @@ exports.default = exports.GlobalStylesMenuSlot = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
14
  var _components = require("@wordpress/components");
15
15
 
@@ -51,7 +51,7 @@ var _screenCss = _interopRequireDefault(require("./screen-css"));
51
51
 
52
52
  var _screenRevisions = _interopRequireDefault(require("./screen-revisions"));
53
53
 
54
- var _privateApis = require("../../private-apis");
54
+ var _lockUnlock = require("../../lock-unlock");
55
55
 
56
56
  var _store = require("../../store");
57
57
 
@@ -59,6 +59,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
59
59
 
60
60
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
61
61
 
62
+ /**
63
+ * External dependencies
64
+ */
65
+
62
66
  /**
63
67
  * WordPress dependencies
64
68
  */
@@ -78,10 +82,60 @@ function GlobalStylesActionMenu() {
78
82
  toggle
79
83
  } = (0, _data.useDispatch)(_preferences.store);
80
84
  const {
81
- canEditCSS,
85
+ canEditCSS
86
+ } = (0, _data.useSelect)(select => {
87
+ var _globalStyles$_links$;
88
+
89
+ const {
90
+ getEntityRecord,
91
+ __experimentalGetCurrentGlobalStylesId
92
+ } = select(_coreData.store);
93
+
94
+ const globalStylesId = __experimentalGetCurrentGlobalStylesId();
95
+
96
+ const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
97
+ return {
98
+ canEditCSS: (_globalStyles$_links$ = !!globalStyles?._links?.['wp:action-edit-css']) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false
99
+ };
100
+ }, []);
101
+ const {
102
+ goTo
103
+ } = (0, _components.__experimentalUseNavigator)();
104
+
105
+ const loadCustomCSS = () => goTo('/css');
106
+
107
+ return (0, _element.createElement)(GlobalStylesMenuFill, null, (0, _element.createElement)(_components.DropdownMenu, {
108
+ icon: _icons.moreVertical,
109
+ label: (0, _i18n.__)('More')
110
+ }, ({
111
+ onClose
112
+ }) => (0, _element.createElement)(_components.MenuGroup, null, canEditCSS && (0, _element.createElement)(_components.MenuItem, {
113
+ onClick: loadCustomCSS
114
+ }, (0, _i18n.__)('Additional CSS')), (0, _element.createElement)(_components.MenuItem, {
115
+ onClick: () => {
116
+ toggle('core/edit-site', 'welcomeGuideStyles');
117
+ onClose();
118
+ }
119
+ }, (0, _i18n.__)('Welcome Guide')))));
120
+ }
121
+
122
+ function RevisionsCountBadge({
123
+ className,
124
+ children
125
+ }) {
126
+ return (0, _element.createElement)("span", {
127
+ className: (0, _classnames.default)(className, 'edit-site-global-styles-sidebar__revisions-count-badge')
128
+ }, children);
129
+ }
130
+
131
+ function GlobalStylesRevisionsMenu() {
132
+ const {
133
+ setIsListViewOpened
134
+ } = (0, _data.useDispatch)(_store.store);
135
+ const {
82
136
  revisionsCount
83
137
  } = (0, _data.useSelect)(select => {
84
- var _globalStyles$_links$, _globalStyles$_links$2;
138
+ var _globalStyles$_links$2;
85
139
 
86
140
  const {
87
141
  getEntityRecord,
@@ -92,48 +146,46 @@ function GlobalStylesActionMenu() {
92
146
 
93
147
  const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
94
148
  return {
95
- canEditCSS: (_globalStyles$_links$ = !!globalStyles?._links?.['wp:action-edit-css']) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false,
96
149
  revisionsCount: (_globalStyles$_links$2 = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$2 !== void 0 ? _globalStyles$_links$2 : 0
97
150
  };
98
151
  }, []);
99
152
  const {
100
153
  useGlobalStylesReset
101
- } = (0, _privateApis.unlock)(_blockEditor.privateApis);
154
+ } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
102
155
  const [canReset, onReset] = useGlobalStylesReset();
103
156
  const {
104
157
  goTo
105
158
  } = (0, _components.__experimentalUseNavigator)();
106
159
  const {
107
160
  setEditorCanvasContainerView
108
- } = (0, _privateApis.unlock)((0, _data.useDispatch)(_store.store));
109
-
110
- const loadCustomCSS = () => goTo('/css');
161
+ } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
111
162
 
112
163
  const loadRevisions = () => {
164
+ setIsListViewOpened(false);
113
165
  goTo('/revisions');
114
166
  setEditorCanvasContainerView('global-styles-revisions');
115
167
  };
116
168
 
117
169
  const hasRevisions = revisionsCount >= 2;
118
- return (0, _element.createElement)(GlobalStylesMenuFill, null, (0, _element.createElement)(_components.DropdownMenu, {
119
- icon: _icons.moreVertical,
120
- label: (0, _i18n.__)('Styles actions'),
121
- controls: [{
122
- title: (0, _i18n.__)('Reset to defaults'),
123
- onClick: onReset,
124
- isDisabled: !canReset
125
- }, {
126
- title: (0, _i18n.__)('Welcome Guide'),
127
- onClick: () => toggle('core/edit-site', 'welcomeGuideStyles')
128
- }, ...(canEditCSS ? [{
129
- title: (0, _i18n.__)('Additional CSS'),
130
- onClick: loadCustomCSS
131
- }] : []), ...(hasRevisions ? [{
132
- title: (0, _i18n.sprintf)(
133
- /* translators: %d: number of revisions */
134
- (0, _i18n._n)('%d Revision', '%d Revisions', revisionsCount), revisionsCount),
135
- onClick: loadRevisions
136
- }] : [])]
170
+ return (0, _element.createElement)(GlobalStylesMenuFill, null, canReset || hasRevisions ? (0, _element.createElement)(_components.DropdownMenu, {
171
+ icon: _icons.backup,
172
+ label: (0, _i18n.__)('Revisions')
173
+ }, ({
174
+ onClose
175
+ }) => (0, _element.createElement)(_components.MenuGroup, null, hasRevisions && (0, _element.createElement)(_components.MenuItem, {
176
+ onClick: loadRevisions,
177
+ icon: (0, _element.createElement)(RevisionsCountBadge, null, revisionsCount)
178
+ }, (0, _i18n.__)('Revision history')), (0, _element.createElement)(_components.MenuItem, {
179
+ onClick: () => {
180
+ onReset();
181
+ onClose();
182
+ },
183
+ disabled: !canReset
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
137
189
  }));
138
190
  }
139
191
 
@@ -141,9 +193,10 @@ function GlobalStylesNavigationScreen({
141
193
  className,
142
194
  ...props
143
195
  }) {
144
- return (0, _element.createElement)(_components.__experimentalNavigatorScreen, (0, _extends2.default)({
145
- className: ['edit-site-global-styles-sidebar__navigator-screen', className].filter(Boolean).join(' ')
146
- }, props));
196
+ return (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
197
+ className: ['edit-site-global-styles-sidebar__navigator-screen', className].filter(Boolean).join(' '),
198
+ ...props
199
+ });
147
200
  }
148
201
 
149
202
  function BlockStylesNavigationScreens({
@@ -243,7 +296,7 @@ function GlobalStylesEditorCanvasContainerLink() {
243
296
  goTo,
244
297
  location
245
298
  } = (0, _components.__experimentalUseNavigator)();
246
- const editorCanvasContainerView = (0, _data.useSelect)(select => (0, _privateApis.unlock)(select(_store.store)).getEditorCanvasContainerView(), []); // If the user switches the editor canvas container view, redirect
299
+ const editorCanvasContainerView = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(), []); // If the user switches the editor canvas container view, redirect
247
300
  // to the appropriate screen. This effectively allows deep linking to the
248
301
  // desired screens from outside the global styles navigation provider.
249
302
 
@@ -256,13 +309,19 @@ function GlobalStylesEditorCanvasContainerLink() {
256
309
  // Switching to any container other than revisions should
257
310
  // redirect from the revisions screen to the root global styles screen.
258
311
  goTo('/');
259
- }
260
- }, [editorCanvasContainerView, location?.path, goTo]);
312
+ } else if (editorCanvasContainerView === 'global-styles-css') {
313
+ goTo('/css');
314
+ } // location?.path is not a dependency because we don't want to track it.
315
+ // Doing so will cause an infinite loop. We could abstract logic to avoid
316
+ // having to disable the check later.
317
+ // eslint-disable-next-line react-hooks/exhaustive-deps
318
+
319
+ }, [editorCanvasContainerView, goTo]);
261
320
  }
262
321
 
263
322
  function GlobalStylesUI() {
264
323
  const blocks = (0, _blocks.getBlockTypes)();
265
- const editorCanvasContainerView = (0, _data.useSelect)(select => (0, _privateApis.unlock)(select(_store.store)).getEditorCanvasContainerView(), []);
324
+ const editorCanvasContainerView = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(), []);
266
325
  return (0, _element.createElement)(_components.__experimentalNavigatorProvider, {
267
326
  className: "edit-site-global-styles-sidebar__navigator-provider",
268
327
  initialPath: "/"
@@ -311,7 +370,7 @@ function GlobalStylesUI() {
311
370
  key: 'screens-block-' + block.name,
312
371
  name: block.name,
313
372
  parentMenu: '/blocks/' + encodeURIComponent(block.name)
314
- })), 'style-book' === editorCanvasContainerView && (0, _element.createElement)(GlobalStylesStyleBook, null), (0, _element.createElement)(GlobalStylesActionMenu, null), (0, _element.createElement)(GlobalStylesBlockLink, null), (0, _element.createElement)(GlobalStylesEditorCanvasContainerLink, null));
373
+ })), 'style-book' === editorCanvasContainerView && (0, _element.createElement)(GlobalStylesStyleBook, null), (0, _element.createElement)(GlobalStylesRevisionsMenu, null), (0, _element.createElement)(GlobalStylesActionMenu, null), (0, _element.createElement)(GlobalStylesBlockLink, null), (0, _element.createElement)(GlobalStylesEditorCanvasContainerLink, null));
315
374
  }
316
375
 
317
376
  var _default = GlobalStylesUI;
@@ -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","revisionsCount","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","count","useGlobalStylesReset","blockEditorPrivateApis","canReset","onReset","goTo","setEditorCanvasContainerView","editSiteStore","loadCustomCSS","loadRevisions","hasRevisions","moreVertical","title","onClick","isDisabled","GlobalStylesNavigationScreen","className","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":";;;;;;;;;AAoBA;;;;AAjBA;;AAOA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAzCA;AACA;AACA;;AAoBA;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,UAAF;AAAcC,IAAAA;AAAd,MAAiC,qBAAaC,MAAF,IAAc;AAAA;;AAC/D,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;AACNR,MAAAA,UAAU,2BACT,CAAC,CAAEO,YAAY,EAAEE,MAAd,GAAwB,oBAAxB,CADM,yEAC4C,KAFhD;AAGNR,MAAAA,cAAc,4BACbM,YAAY,EAAEE,MAAd,GAAwB,iBAAxB,IAA+C,CAA/C,GAAoDC,KADvC,2EACgD;AAJxD,KAAP;AAMA,GAfsC,EAepC,EAfoC,CAAvC;AAgBA,QAAM;AAAEC,IAAAA;AAAF,MAA2B,yBAAQC,wBAAR,CAAjC;AACA,QAAM,CAAEC,QA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AEC,IAAA,IAAI,EAAG,aAAaU,kBAAkB,CAAEkB,KAAK,CAAC5B,IAAR;AAFvC,KAIC,4BAAC,oBAAD;AAAa,IAAA,IAAI,EAAG4B,KAAK,CAAC5B;AAA1B,IAJD,CADC,CAxDH,EAiEC,4BAAC,cAAD,OAjED,EAmEG2B,MAAM,CAAC9B,GAAP,CAAc+B,KAAF,IACb,4BAAC,cAAD;AACC,IAAA,GAAG,EAAG,mBAAmBA,KAAK,CAAC5B,IADhC;AAEC,IAAA,IAAI,EAAG4B,KAAK,CAAC5B,IAFd;AAGC,IAAA,UAAU,EAAG,aAAaU,kBAAkB,CAAEkB,KAAK,CAAC5B,IAAR;AAH7C,IADC,CAnEH,EA2EG,iBAAiBwB,yBAAjB,IACD,4BAAC,qBAAD,OA5EF,EA+EC,4BAAC,sBAAD,OA/ED,EAgFC,4BAAC,qBAAD,OAhFD,EAiFC,4BAAC,qCAAD,OAjFD,CADD;AAqFA;;eAEcE,c","sourcesContent":["/**\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} 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 { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { 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 '../../private-apis';\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, 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\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\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 loadCustomCSS = () => goTo( '/css' );\n\tconst loadRevisions = () => {\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\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Styles actions' ) }\n\t\t\t\tcontrols={ [\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: __( 'Reset to defaults' ),\n\t\t\t\t\t\tonClick: onReset,\n\t\t\t\t\t\tisDisabled: ! canReset,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: __( 'Welcome Guide' ),\n\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideStyles' ),\n\t\t\t\t\t},\n\t\t\t\t\t...( canEditCSS\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Additional CSS' ),\n\t\t\t\t\t\t\t\t\tonClick: loadCustomCSS,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [] ),\n\t\t\t\t\t...( hasRevisions\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %d: number of revisions */\n\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t'%d Revision',\n\t\t\t\t\t\t\t\t\t\t\t'%d Revisions',\n\t\t\t\t\t\t\t\t\t\t\trevisionsCount\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\trevisionsCount\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tonClick: loadRevisions,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: [] ),\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}\n\t}, [ editorCanvasContainerView, location?.path, 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<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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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"]}
@@ -13,7 +13,7 @@ var _blockEditor = require("@wordpress/block-editor");
13
13
 
14
14
  var _store = require("../../store");
15
15
 
16
- var _privateApis = require("../../private-apis");
16
+ var _lockUnlock = require("../../lock-unlock");
17
17
 
18
18
  /**
19
19
  * WordPress dependencies
@@ -24,7 +24,7 @@ var _privateApis = require("../../private-apis");
24
24
  */
25
25
  const {
26
26
  useGlobalStylesOutput
27
- } = (0, _privateApis.unlock)(_blockEditor.privateApis);
27
+ } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
28
28
 
29
29
  function useGlobalStylesRenderer() {
30
30
  const [styles, settings] = useGlobalStylesOutput();
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles-renderer/index.js"],"names":["useGlobalStylesOutput","blockEditorPrivateApis","useGlobalStylesRenderer","styles","settings","getSettings","editSiteStore","updateSettings","currentStoreSettings","nonGlobalStyles","Object","values","filter","style","isGlobalStyles","__experimentalFeatures","GlobalStylesRenderer"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAA4B,yBAAQC,wBAAR,CAAlC;;AAEA,SAASC,uBAAT,GAAmC;AAClC,QAAM,CAAEC,MAAF,EAAUC,QAAV,IAAuBJ,qBAAqB,EAAlD;AACA,QAAM;AAAEK,IAAAA;AAAF,MAAkB,qBAAWC,YAAX,CAAxB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAqB,uBAAaD,YAAb,CAA3B;AAEA,0BAAW,MAAM;AAAA;;AAChB,QAAK,CAAEH,MAAF,IAAY,CAAEC,QAAnB,EAA8B;AAC7B;AACA;;AAED,UAAMI,oBAAoB,GAAGH,WAAW,EAAxC;AACA,UAAMI,eAAe,GAAGC,MAAM,CAACC,MAAP,0BACvBH,oBAAoB,CAACL,MADE,yEACQ,EADR,EAEtBS,MAFsB,CAEZC,KAAF,IAAa,CAAEA,KAAK,CAACC,cAFP,CAAxB;AAGAP,IAAAA,cAAc,CAAE,EACf,GAAGC,oBADY;AAEfL,MAAAA,MAAM,EAAE,CAAE,GAAGM,eAAL,EAAsB,GAAGN,MAAzB,CAFO;AAGfY,MAAAA,sBAAsB,EAAEX;AAHT,KAAF,CAAd;AAKA,GAdD,EAcG,CAAED,MAAF,EAAUC,QAAV,CAdH;AAeA;;AAEM,SAASY,oBAAT,GAAgC;AACtCd,EAAAA,uBAAuB;AAEvB,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStylesOutput } = unlock( blockEditorPrivateApis );\n\nfunction useGlobalStylesRenderer() {\n\tconst [ styles, settings ] = useGlobalStylesOutput();\n\tconst { getSettings } = useSelect( editSiteStore );\n\tconst { updateSettings } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( ! styles || ! settings ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentStoreSettings = getSettings();\n\t\tconst nonGlobalStyles = Object.values(\n\t\t\tcurrentStoreSettings.styles ?? []\n\t\t).filter( ( style ) => ! style.isGlobalStyles );\n\t\tupdateSettings( {\n\t\t\t...currentStoreSettings,\n\t\t\tstyles: [ ...nonGlobalStyles, ...styles ],\n\t\t\t__experimentalFeatures: settings,\n\t\t} );\n\t}, [ styles, settings ] );\n}\n\nexport function GlobalStylesRenderer() {\n\tuseGlobalStylesRenderer();\n\n\treturn null;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles-renderer/index.js"],"names":["useGlobalStylesOutput","blockEditorPrivateApis","useGlobalStylesRenderer","styles","settings","getSettings","editSiteStore","updateSettings","currentStoreSettings","nonGlobalStyles","Object","values","filter","style","isGlobalStyles","__experimentalFeatures","GlobalStylesRenderer"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAA4B,wBAAQC,wBAAR,CAAlC;;AAEA,SAASC,uBAAT,GAAmC;AAClC,QAAM,CAAEC,MAAF,EAAUC,QAAV,IAAuBJ,qBAAqB,EAAlD;AACA,QAAM;AAAEK,IAAAA;AAAF,MAAkB,qBAAWC,YAAX,CAAxB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAqB,uBAAaD,YAAb,CAA3B;AAEA,0BAAW,MAAM;AAAA;;AAChB,QAAK,CAAEH,MAAF,IAAY,CAAEC,QAAnB,EAA8B;AAC7B;AACA;;AAED,UAAMI,oBAAoB,GAAGH,WAAW,EAAxC;AACA,UAAMI,eAAe,GAAGC,MAAM,CAACC,MAAP,0BACvBH,oBAAoB,CAACL,MADE,yEACQ,EADR,EAEtBS,MAFsB,CAEZC,KAAF,IAAa,CAAEA,KAAK,CAACC,cAFP,CAAxB;AAGAP,IAAAA,cAAc,CAAE,EACf,GAAGC,oBADY;AAEfL,MAAAA,MAAM,EAAE,CAAE,GAAGM,eAAL,EAAsB,GAAGN,MAAzB,CAFO;AAGfY,MAAAA,sBAAsB,EAAEX;AAHT,KAAF,CAAd;AAKA,GAdD,EAcG,CAAED,MAAF,EAAUC,QAAV,CAdH;AAeA;;AAEM,SAASY,oBAAT,GAAgC;AACtCd,EAAAA,uBAAuB;AAEvB,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStylesOutput } = unlock( blockEditorPrivateApis );\n\nfunction useGlobalStylesRenderer() {\n\tconst [ styles, settings ] = useGlobalStylesOutput();\n\tconst { getSettings } = useSelect( editSiteStore );\n\tconst { updateSettings } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( ! styles || ! settings ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentStoreSettings = getSettings();\n\t\tconst nonGlobalStyles = Object.values(\n\t\t\tcurrentStoreSettings.styles ?? []\n\t\t).filter( ( style ) => ! style.isGlobalStyles );\n\t\tupdateSettings( {\n\t\t\t...currentStoreSettings,\n\t\t\tstyles: [ ...nonGlobalStyles, ...styles ],\n\t\t\t__experimentalFeatures: settings,\n\t\t} );\n\t}, [ styles, settings ] );\n}\n\nexport function GlobalStylesRenderer() {\n\tuseGlobalStylesRenderer();\n\n\treturn null;\n}\n"]}
@@ -23,10 +23,10 @@ var _commands = require("@wordpress/commands");
23
23
 
24
24
  var _icons = require("@wordpress/icons");
25
25
 
26
- var _coreData = require("@wordpress/core-data");
27
-
28
26
  var _keycodes = require("@wordpress/keycodes");
29
27
 
28
+ var _coreData = require("@wordpress/core-data");
29
+
30
30
  var _useEditedEntityRecord = _interopRequireDefault(require("../../use-edited-entity-record"));
31
31
 
32
32
  var _store = require("../../../store");
@@ -49,47 +49,60 @@ function DocumentActions() {
49
49
 
50
50
  function PageDocumentActions() {
51
51
  const {
52
- hasPageContentLock,
53
- context
54
- } = (0, _data.useSelect)(select => ({
55
- hasPageContentLock: select(_store.store).hasPageContentLock(),
56
- context: select(_store.store).getEditedPostContext()
57
- }), []);
58
- const {
52
+ hasPageContentFocus,
59
53
  hasResolved,
60
- editedRecord
61
- } = (0, _coreData.useEntityRecord)('postType', context.postType, context.postId);
54
+ isFound,
55
+ title
56
+ } = (0, _data.useSelect)(select => {
57
+ const {
58
+ hasPageContentFocus: _hasPageContentFocus,
59
+ getEditedPostContext
60
+ } = select(_store.store);
61
+ const {
62
+ getEditedEntityRecord,
63
+ hasFinishedResolution
64
+ } = select(_coreData.store);
65
+ const context = getEditedPostContext();
66
+ const queryArgs = ['postType', context.postType, context.postId];
67
+ const page = getEditedEntityRecord(...queryArgs);
68
+ return {
69
+ hasPageContentFocus: _hasPageContentFocus(),
70
+ hasResolved: hasFinishedResolution('getEditedEntityRecord', queryArgs),
71
+ isFound: !!page,
72
+ title: page?.title
73
+ };
74
+ }, []);
62
75
  const {
63
- setHasPageContentLock
76
+ setHasPageContentFocus
64
77
  } = (0, _data.useDispatch)(_store.store);
65
78
  const [hasEditedTemplate, setHasEditedTemplate] = (0, _element.useState)(false);
66
- const prevHasPageContentLock = (0, _element.useRef)(false);
79
+ const prevHasPageContentFocus = (0, _element.useRef)(false);
67
80
  (0, _element.useEffect)(() => {
68
- if (prevHasPageContentLock.current && !hasPageContentLock) {
81
+ if (prevHasPageContentFocus.current && !hasPageContentFocus) {
69
82
  setHasEditedTemplate(true);
70
83
  }
71
84
 
72
- prevHasPageContentLock.current = hasPageContentLock;
73
- }, [hasPageContentLock]);
85
+ prevHasPageContentFocus.current = hasPageContentFocus;
86
+ }, [hasPageContentFocus]);
74
87
 
75
88
  if (!hasResolved) {
76
89
  return null;
77
90
  }
78
91
 
79
- if (!editedRecord) {
92
+ if (!isFound) {
80
93
  return (0, _element.createElement)("div", {
81
94
  className: "edit-site-document-actions"
82
95
  }, (0, _i18n.__)('Document not found'));
83
96
  }
84
97
 
85
- return hasPageContentLock ? (0, _element.createElement)(BaseDocumentActions, {
98
+ return hasPageContentFocus ? (0, _element.createElement)(BaseDocumentActions, {
86
99
  className: (0, _classnames.default)('is-page', {
87
100
  'is-animated': hasEditedTemplate
88
101
  }),
89
102
  icon: _icons.page
90
- }, editedRecord.title) : (0, _element.createElement)(TemplateDocumentActions, {
103
+ }, title) : (0, _element.createElement)(TemplateDocumentActions, {
91
104
  className: "is-animated",
92
- onBack: () => setHasPageContentLock(true)
105
+ onBack: () => setHasPageContentFocus(true)
93
106
  });
94
107
  }
95
108
 
@@ -114,10 +127,10 @@ function TemplateDocumentActions({
114
127
  }, (0, _i18n.__)('Document not found'));
115
128
  }
116
129
 
117
- const entityLabel = record.type === 'wp_template_part' ? (0, _i18n.__)('template part') : (0, _i18n.__)('template');
130
+ const entityLabel = getEntityLabel(record.type);
118
131
  return (0, _element.createElement)(BaseDocumentActions, {
119
132
  className: className,
120
- icon: icon,
133
+ icon: record.type === 'wp_navigation' ? _icons.navigation : icon,
121
134
  onBack: onBack
122
135
  }, (0, _element.createElement)(_components.VisuallyHidden, {
123
136
  as: "span"
@@ -160,4 +173,24 @@ function BaseDocumentActions({
160
173
  className: "edit-site-document-actions__shortcut"
161
174
  }, _keycodes.displayShortcut.primary('k'))));
162
175
  }
176
+
177
+ function getEntityLabel(entityType) {
178
+ let label = '';
179
+
180
+ switch (entityType) {
181
+ case 'wp_navigation':
182
+ label = 'navigation menu';
183
+ break;
184
+
185
+ case 'wp_template_part':
186
+ label = 'template part';
187
+ break;
188
+
189
+ default:
190
+ label = 'template';
191
+ break;
192
+ }
193
+
194
+ return label;
195
+ }
163
196
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/header-edit-mode/document-actions/index.js"],"names":["DocumentActions","isPage","select","editSiteStore","PageDocumentActions","hasPageContentLock","context","getEditedPostContext","hasResolved","editedRecord","postType","postId","setHasPageContentLock","hasEditedTemplate","setHasEditedTemplate","prevHasPageContentLock","current","pageIcon","title","TemplateDocumentActions","className","onBack","isLoaded","record","getTitle","icon","entityLabel","type","BaseDocumentActions","children","open","openCommandCenter","commandsStore","chevronLeftSmallIcon","event","stopPropagation","displayShortcut","primary"],"mappings":";;;;;;;;;AAwBA;;AArBA;;AAKA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AAIA;;AACA;;AAMA;;AACA;;AA9BA;AACA;AACA;;AAGA;AACA;AACA;;AAmBA;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,kBAAF;AAAsBC,IAAAA;AAAtB,MAAkC,qBACrCJ,MAAF,KAAgB;AACfG,IAAAA,kBAAkB,EAAEH,MAAM,CAAEC,YAAF,CAAN,CAAwBE,kBAAxB,EADL;AAEfC,IAAAA,OAAO,EAAEJ,MAAM,CAAEC,YAAF,CAAN,CAAwBI,oBAAxB;AAFM,GAAhB,CADuC,EAKvC,EALuC,CAAxC;AAQA,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAgC,+BACrC,UADqC,EA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kB,IAAA,EAAE,EAAC;AAArB,KACGI,QADH,CAND,CAJD,EAcC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGO,0BAAgBC,OAAhB,CAAyB,GAAzB,CADH,CAdD,CAfD,CADD;AAoCA","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} from '@wordpress/icons';\nimport { useEntityRecord } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useState, useEffect, useRef } from '@wordpress/element';\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 { hasPageContentLock, context } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasPageContentLock: select( editSiteStore ).hasPageContentLock(),\n\t\t\tcontext: select( editSiteStore ).getEditedPostContext(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { hasResolved, editedRecord } = useEntityRecord(\n\t\t'postType',\n\t\tcontext.postType,\n\t\tcontext.postId\n\t);\n\n\tconst { setHasPageContentLock } = useDispatch( editSiteStore );\n\n\tconst [ hasEditedTemplate, setHasEditedTemplate ] = useState( false );\n\tconst prevHasPageContentLock = useRef( false );\n\tuseEffect( () => {\n\t\tif ( prevHasPageContentLock.current && ! hasPageContentLock ) {\n\t\t\tsetHasEditedTemplate( true );\n\t\t}\n\t\tprevHasPageContentLock.current = hasPageContentLock;\n\t}, [ hasPageContentLock ] );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\tif ( ! editedRecord ) {\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 hasPageContentLock ? (\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{ editedRecord.title }\n\t\t</BaseDocumentActions>\n\t) : (\n\t\t<TemplateDocumentActions\n\t\t\tclassName=\"is-animated\"\n\t\t\tonBack={ () => setHasPageContentLock( 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 =\n\t\trecord.type === 'wp_template_part'\n\t\t\t? __( 'template part' )\n\t\t\t: __( 'template' );\n\n\treturn (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ className }\n\t\t\ticon={ 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"]}
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":";;;;;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CADD;AAoCA;;AAED,SAASZ,cAAT,CAAyBa,UAAzB,EAAsC;AACrC,MAAIC,KAAK,GAAG,EAAZ;;AACA,UAASD,UAAT;AACC,SAAK,eAAL;AACCC,MAAAA,KAAK,GAAG,iBAAR;AACA;;AACD,SAAK,kBAAL;AACCA,MAAAA,KAAK,GAAG,eAAR;AACA;;AACD;AACCA,MAAAA,KAAK,GAAG,UAAR;AACA;AATF;;AAYA,SAAOA,KAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\tVisuallyHidden,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { store as commandsStore } from '@wordpress/commands';\nimport {\n\tchevronLeftSmall as chevronLeftSmallIcon,\n\tpage as pageIcon,\n\tnavigation as navigationIcon,\n} from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../../use-edited-entity-record';\nimport { store as editSiteStore } from '../../../store';\n\nexport default function DocumentActions() {\n\tconst isPage = useSelect( ( select ) => select( editSiteStore ).isPage() );\n\treturn isPage ? <PageDocumentActions /> : <TemplateDocumentActions />;\n}\n\nfunction PageDocumentActions() {\n\tconst { hasPageContentFocus, hasResolved, isFound, title } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasPageContentFocus: _hasPageContentFocus,\n\t\t\t\tgetEditedPostContext,\n\t\t\t} = select( editSiteStore );\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst context = getEditedPostContext();\n\t\t\tconst queryArgs = [ 'postType', context.postType, context.postId ];\n\t\t\tconst page = getEditedEntityRecord( ...queryArgs );\n\t\t\treturn {\n\t\t\t\thasPageContentFocus: _hasPageContentFocus(),\n\t\t\t\thasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t\tisFound: !! page,\n\t\t\t\ttitle: page?.title,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { setHasPageContentFocus } = useDispatch( editSiteStore );\n\n\tconst [ hasEditedTemplate, setHasEditedTemplate ] = useState( false );\n\tconst prevHasPageContentFocus = useRef( false );\n\tuseEffect( () => {\n\t\tif ( prevHasPageContentFocus.current && ! hasPageContentFocus ) {\n\t\t\tsetHasEditedTemplate( true );\n\t\t}\n\t\tprevHasPageContentFocus.current = hasPageContentFocus;\n\t}, [ hasPageContentFocus ] );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\tif ( ! isFound ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn hasPageContentFocus ? (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ classnames( 'is-page', {\n\t\t\t\t'is-animated': hasEditedTemplate,\n\t\t\t} ) }\n\t\t\ticon={ pageIcon }\n\t\t>\n\t\t\t{ title }\n\t\t</BaseDocumentActions>\n\t) : (\n\t\t<TemplateDocumentActions\n\t\t\tclassName=\"is-animated\"\n\t\t\tonBack={ () => setHasPageContentFocus( true ) }\n\t\t/>\n\t);\n}\n\nfunction TemplateDocumentActions( { className, onBack } ) {\n\tconst { isLoaded, record, getTitle, icon } = useEditedEntityRecord();\n\n\tif ( ! isLoaded ) {\n\t\treturn null;\n\t}\n\n\tif ( ! record ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-document-actions\">\n\t\t\t\t{ __( 'Document not found' ) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst entityLabel = getEntityLabel( record.type );\n\n\treturn (\n\t\t<BaseDocumentActions\n\t\t\tclassName={ className }\n\t\t\ticon={ record.type === 'wp_navigation' ? navigationIcon : icon }\n\t\t\tonBack={ onBack }\n\t\t>\n\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: %s: the entity being edited, like \"template\"*/\n\t\t\t\t\t__( 'Editing %s: ' ),\n\t\t\t\t\tentityLabel\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t\t{ getTitle() }\n\t\t</BaseDocumentActions>\n\t);\n}\n\nfunction BaseDocumentActions( { className, icon, children, onBack } ) {\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-document-actions', className ) }\n\t\t>\n\t\t\t{ onBack && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-document-actions__back\"\n\t\t\t\t\ticon={ chevronLeftSmallIcon }\n\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tonBack();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-document-actions__command\"\n\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tclassName=\"edit-site-document-actions__title\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</Text>\n\t\t\t\t</HStack>\n\t\t\t\t<span className=\"edit-site-document-actions__shortcut\">\n\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t</span>\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n\nfunction getEntityLabel( entityType ) {\n\tlet label = '';\n\tswitch ( entityType ) {\n\t\tcase 'wp_navigation':\n\t\t\tlabel = 'navigation menu';\n\t\t\tbreak;\n\t\tcase 'wp_template_part':\n\t\t\tlabel = 'template part';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tlabel = 'template';\n\t\t\tbreak;\n\t}\n\n\treturn label;\n}\n"]}