@wordpress/edit-site 5.12.0 → 5.12.1

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 (883) 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 +6 -8
  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 +49 -5
  35. package/build/components/create-template-part-modal/index.js.map +1 -1
  36. package/build/components/editor/index.js +23 -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 +90 -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 +6 -8
  93. package/build/components/header-edit-mode/index.js.map +1 -1
  94. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -7
  95. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  96. package/build/components/header-edit-mode/undo-redo/redo.js +2 -6
  97. package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  98. package/build/components/header-edit-mode/undo-redo/undo.js +2 -6
  99. package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  100. package/build/components/keyboard-shortcut-help-modal/index.js +2 -1
  101. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  102. package/build/components/keyboard-shortcuts/edit-mode.js +7 -2
  103. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  104. package/build/components/keyboard-shortcuts/index.js +7 -2
  105. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  106. package/build/components/keyboard-shortcuts/register.js +1 -1
  107. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  108. package/build/components/layout/hooks.js +21 -0
  109. package/build/components/layout/hooks.js.map +1 -1
  110. package/build/components/layout/index.js +40 -22
  111. package/build/components/layout/index.js.map +1 -1
  112. package/build/components/list/index.js +2 -2
  113. package/build/components/list/index.js.map +1 -1
  114. package/build/components/page/header.js +41 -0
  115. package/build/components/page/header.js.map +1 -0
  116. package/build/components/page/index.js +49 -0
  117. package/build/components/page/index.js.map +1 -0
  118. package/build/components/page-content-focus-manager/back-to-page-notification.js +67 -0
  119. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  120. package/build/components/page-content-focus-manager/constants.js +9 -0
  121. package/build/components/page-content-focus-manager/constants.js.map +1 -0
  122. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +60 -0
  123. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  124. package/build/components/page-content-focus-manager/edit-template-notification.js +121 -0
  125. package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  126. package/build/components/page-content-focus-manager/index.js +37 -0
  127. package/build/components/page-content-focus-manager/index.js.map +1 -0
  128. package/build/components/page-library/grid-item.js +165 -0
  129. package/build/components/page-library/grid-item.js.map +1 -0
  130. package/build/components/page-library/grid.js +49 -0
  131. package/build/components/page-library/grid.js.map +1 -0
  132. package/build/components/page-library/index.js +61 -0
  133. package/build/components/page-library/index.js.map +1 -0
  134. package/build/components/page-library/no-patterns.js +20 -0
  135. package/build/components/page-library/no-patterns.js.map +1 -0
  136. package/build/components/page-library/patterns-list.js +108 -0
  137. package/build/components/page-library/patterns-list.js.map +1 -0
  138. package/build/components/page-library/search-items.js +172 -0
  139. package/build/components/page-library/search-items.js.map +1 -0
  140. package/build/components/page-library/use-library-settings.js +53 -0
  141. package/build/components/page-library/use-library-settings.js.map +1 -0
  142. package/build/components/page-library/use-patterns.js +194 -0
  143. package/build/components/page-library/use-patterns.js.map +1 -0
  144. package/build/components/page-library/utils.js +30 -0
  145. package/build/components/page-library/utils.js.map +1 -0
  146. package/build/components/page-main/index.js +46 -0
  147. package/build/components/page-main/index.js.map +1 -0
  148. package/build/components/page-templates/index.js +101 -0
  149. package/build/components/page-templates/index.js.map +1 -0
  150. package/build/components/preferences-modal/enable-feature.js +4 -7
  151. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  152. package/build/components/resizable-frame/index.js +6 -4
  153. package/build/components/resizable-frame/index.js.map +1 -1
  154. package/build/components/revisions/index.js +2 -2
  155. package/build/components/revisions/index.js.map +1 -1
  156. package/build/components/routes/link.js +7 -10
  157. package/build/components/routes/link.js.map +1 -1
  158. package/build/components/routes/use-title.js +2 -2
  159. package/build/components/routes/use-title.js.map +1 -1
  160. package/build/components/save-button/index.js +15 -11
  161. package/build/components/save-button/index.js.map +1 -1
  162. package/build/components/save-hub/index.js +2 -2
  163. package/build/components/save-hub/index.js.map +1 -1
  164. package/build/components/save-panel/index.js +5 -7
  165. package/build/components/save-panel/index.js.map +1 -1
  166. package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
  167. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  168. package/build/components/secondary-sidebar/list-view-sidebar.js +47 -10
  169. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  170. package/build/components/sidebar/index.js +12 -8
  171. package/build/components/sidebar/index.js.map +1 -1
  172. package/build/components/sidebar-button/index.js +2 -4
  173. package/build/components/sidebar-button/index.js.map +1 -1
  174. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +22 -8
  175. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  176. package/build/components/sidebar-edit-mode/index.js +5 -5
  177. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  178. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +84 -0
  179. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  180. package/build/components/sidebar-edit-mode/page-panels/index.js +51 -38
  181. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  182. package/build/components/sidebar-edit-mode/page-panels/page-content.js +35 -0
  183. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  184. package/build/components/sidebar-edit-mode/page-panels/page-status.js +192 -0
  185. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  186. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +45 -0
  187. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  188. package/build/components/sidebar-edit-mode/page-panels/publish-date.js +98 -0
  189. package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  190. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -7
  191. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  192. package/build/components/sidebar-edit-mode/settings-header/index.js +19 -6
  193. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  194. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +2 -2
  195. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  196. package/build/components/sidebar-edit-mode/template-panel/index.js +10 -6
  197. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  198. package/build/components/sidebar-navigation-item/index.js +11 -7
  199. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  200. package/build/components/sidebar-navigation-screen/index.js +18 -7
  201. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  202. package/build/components/sidebar-navigation-screen-details-footer/index.js +36 -0
  203. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  204. package/build/components/sidebar-navigation-screen-details-panel/index.js +58 -0
  205. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  206. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +22 -0
  207. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  208. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +35 -0
  209. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  210. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +22 -0
  211. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  212. package/build/components/sidebar-navigation-screen-global-styles/index.js +13 -13
  213. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  214. package/build/components/sidebar-navigation-screen-library/category-item.js +48 -0
  215. package/build/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  216. package/build/components/sidebar-navigation-screen-library/index.js +112 -0
  217. package/build/components/sidebar-navigation-screen-library/index.js.map +1 -0
  218. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +36 -0
  219. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  220. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js +76 -0
  221. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  222. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +41 -0
  223. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  224. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js +40 -0
  225. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  226. package/build/components/sidebar-navigation-screen-main/index.js +12 -13
  227. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  228. package/build/components/sidebar-navigation-screen-navigation-item/index.js +2 -2
  229. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  230. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +42 -0
  231. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  232. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +41 -0
  233. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  234. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +47 -92
  235. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  236. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +84 -0
  237. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  238. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +71 -0
  239. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  240. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +54 -0
  241. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  242. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +49 -0
  243. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  244. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +163 -0
  245. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  246. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  247. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  248. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +46 -7
  249. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  250. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +57 -10
  251. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  252. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +21 -50
  253. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  254. package/build/components/sidebar-navigation-screen-page/index.js +14 -34
  255. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  256. package/build/components/sidebar-navigation-screen-page/page-details.js +29 -27
  257. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  258. package/build/components/sidebar-navigation-screen-page/status-label.js +8 -7
  259. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  260. package/build/components/sidebar-navigation-screen-pages/index.js +9 -8
  261. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  262. package/build/components/sidebar-navigation-screen-pattern/index.js +66 -0
  263. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  264. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +41 -0
  265. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  266. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +33 -0
  267. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  268. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +40 -0
  269. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  270. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +47 -0
  271. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  272. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +82 -0
  273. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  274. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +80 -0
  275. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  276. package/build/components/sidebar-navigation-screen-template/home-template-details.js +212 -0
  277. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  278. package/build/components/sidebar-navigation-screen-template/index.js +21 -7
  279. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  280. package/build/components/sidebar-navigation-screen-templates/index.js +11 -11
  281. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  282. package/build/components/site-hub/index.js +10 -12
  283. package/build/components/site-hub/index.js.map +1 -1
  284. package/build/components/style-book/index.js +10 -11
  285. package/build/components/style-book/index.js.map +1 -1
  286. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -4
  287. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  288. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -4
  289. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  290. package/build/components/sync-state-with-url/use-sync-path-with-url.js +12 -2
  291. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  292. package/build/components/table/index.js +29 -0
  293. package/build/components/table/index.js.map +1 -0
  294. package/build/components/template-part-converter/convert-to-template-part.js +3 -21
  295. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  296. package/build/components/welcome-guide/editor.js +1 -1
  297. package/build/components/welcome-guide/editor.js.map +1 -1
  298. package/build/components/welcome-guide/styles.js +4 -3
  299. package/build/components/welcome-guide/styles.js.map +1 -1
  300. package/build/hooks/commands/use-common-commands.js +190 -0
  301. package/build/hooks/commands/use-common-commands.js.map +1 -0
  302. package/build/hooks/commands/use-edit-mode-commands.js +67 -23
  303. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  304. package/build/hooks/index.js +2 -0
  305. package/build/hooks/index.js.map +1 -1
  306. package/build/hooks/navigation-menu-edit.js +95 -0
  307. package/build/hooks/navigation-menu-edit.js.map +1 -0
  308. package/build/hooks/push-changes-to-global-styles/index.js +5 -3
  309. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  310. package/build/hooks/template-part-edit.js +6 -9
  311. package/build/hooks/template-part-edit.js.map +1 -1
  312. package/build/{private-apis.js → lock-unlock.js} +1 -1
  313. package/build/lock-unlock.js.map +1 -0
  314. package/build/store/actions.js +45 -9
  315. package/build/store/actions.js.map +1 -1
  316. package/build/store/index.js +3 -3
  317. package/build/store/index.js.map +1 -1
  318. package/build/store/reducer.js +7 -6
  319. package/build/store/reducer.js.map +1 -1
  320. package/build/store/selectors.js +40 -16
  321. package/build/store/selectors.js.map +1 -1
  322. package/build/utils/get-is-list-page.js +12 -5
  323. package/build/utils/get-is-list-page.js.map +1 -1
  324. package/build/utils/is-previewing-theme.js +2 -2
  325. package/build/utils/is-previewing-theme.js.map +1 -1
  326. package/build/utils/use-activate-theme.js +3 -3
  327. package/build/utils/use-activate-theme.js.map +1 -1
  328. package/build/utils/use-debounced-input.js +26 -0
  329. package/build/utils/use-debounced-input.js.map +1 -0
  330. package/build-module/components/add-new-pattern/index.js +82 -0
  331. package/build-module/components/add-new-pattern/index.js.map +1 -0
  332. package/build-module/components/add-new-template/add-custom-template-modal-content.js +7 -20
  333. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  334. package/build-module/components/add-new-template/index.js +2 -8
  335. package/build-module/components/add-new-template/index.js.map +1 -1
  336. package/build-module/components/add-new-template/new-template.js +4 -5
  337. package/build-module/components/add-new-template/new-template.js.map +1 -1
  338. package/build-module/components/app/index.js +1 -1
  339. package/build-module/components/app/index.js.map +1 -1
  340. package/build-module/components/block-editor/back-button.js +4 -2
  341. package/build-module/components/block-editor/back-button.js.map +1 -1
  342. package/build-module/components/block-editor/constants.js +2 -0
  343. package/build-module/components/block-editor/constants.js.map +1 -0
  344. package/build-module/components/block-editor/editor-canvas.js +6 -5
  345. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  346. package/build-module/components/block-editor/get-block-editor-provider.js +31 -0
  347. package/build-module/components/block-editor/get-block-editor-provider.js.map +1 -0
  348. package/build-module/components/block-editor/index.js +9 -127
  349. package/build-module/components/block-editor/index.js.map +1 -1
  350. package/build-module/components/block-editor/providers/default-block-editor-provider.js +42 -0
  351. package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
  352. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js +102 -0
  353. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
  354. package/build-module/components/block-editor/site-editor-canvas.js +115 -0
  355. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -0
  356. package/build-module/components/block-editor/use-site-editor-settings.js +67 -0
  357. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -0
  358. package/build-module/components/canvas-spinner/index.js +15 -1
  359. package/build-module/components/canvas-spinner/index.js.map +1 -1
  360. package/build-module/components/create-pattern-modal/index.js +113 -0
  361. package/build-module/components/create-pattern-modal/index.js.map +1 -0
  362. package/build-module/components/create-template-part-modal/index.js +46 -6
  363. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  364. package/build-module/components/editor/index.js +23 -13
  365. package/build-module/components/editor/index.js.map +1 -1
  366. package/build-module/components/editor-canvas-container/index.js +19 -2
  367. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  368. package/build-module/components/global-styles/color-indicator-wrapper.js +4 -4
  369. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  370. package/build-module/components/global-styles/color-palette-panel.js +1 -1
  371. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  372. package/build-module/components/global-styles/dimensions-panel.js +1 -1
  373. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  374. package/build-module/components/global-styles/global-styles-provider.js +10 -15
  375. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  376. package/build-module/components/global-styles/gradients-palette-panel.js +1 -1
  377. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  378. package/build-module/components/global-styles/hooks.js +1 -1
  379. package/build-module/components/global-styles/hooks.js.map +1 -1
  380. package/build-module/components/global-styles/icon-with-current-color.js +4 -4
  381. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  382. package/build-module/components/global-styles/navigation-button.js +10 -8
  383. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  384. package/build-module/components/global-styles/palette.js +2 -2
  385. package/build-module/components/global-styles/palette.js.map +1 -1
  386. package/build-module/components/global-styles/preview.js +1 -1
  387. package/build-module/components/global-styles/preview.js.map +1 -1
  388. package/build-module/components/global-styles/root-menu.js +1 -1
  389. package/build-module/components/global-styles/root-menu.js.map +1 -1
  390. package/build-module/components/global-styles/screen-block-list.js +1 -1
  391. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  392. package/build-module/components/global-styles/screen-block.js +1 -1
  393. package/build-module/components/global-styles/screen-block.js.map +1 -1
  394. package/build-module/components/global-styles/screen-colors.js +1 -1
  395. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  396. package/build-module/components/global-styles/screen-css.js +1 -1
  397. package/build-module/components/global-styles/screen-css.js.map +1 -1
  398. package/build-module/components/global-styles/screen-layout.js +1 -1
  399. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  400. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  401. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  402. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
  403. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  404. package/build-module/components/global-styles/screen-root.js +1 -1
  405. package/build-module/components/global-styles/screen-root.js.map +1 -1
  406. package/build-module/components/global-styles/screen-typography.js +1 -1
  407. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  408. package/build-module/components/global-styles/style-variations-container.js +11 -3
  409. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  410. package/build-module/components/global-styles/typography-panel.js +1 -1
  411. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  412. package/build-module/components/global-styles/typography-preview.js +1 -1
  413. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  414. package/build-module/components/global-styles/ui.js +89 -35
  415. package/build-module/components/global-styles/ui.js.map +1 -1
  416. package/build-module/components/global-styles-renderer/index.js +1 -1
  417. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  418. package/build-module/components/header-edit-mode/document-actions/index.js +55 -22
  419. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  420. package/build-module/components/header-edit-mode/index.js +4 -6
  421. package/build-module/components/header-edit-mode/index.js.map +1 -1
  422. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -4
  423. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  424. package/build-module/components/header-edit-mode/undo-redo/redo.js +2 -3
  425. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  426. package/build-module/components/header-edit-mode/undo-redo/undo.js +2 -3
  427. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  428. package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -1
  429. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  430. package/build-module/components/keyboard-shortcuts/edit-mode.js +7 -2
  431. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  432. package/build-module/components/keyboard-shortcuts/index.js +7 -2
  433. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  434. package/build-module/components/keyboard-shortcuts/register.js +1 -1
  435. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  436. package/build-module/components/layout/hooks.js +21 -0
  437. package/build-module/components/layout/hooks.js.map +1 -1
  438. package/build-module/components/layout/index.js +33 -16
  439. package/build-module/components/layout/index.js.map +1 -1
  440. package/build-module/components/list/index.js +1 -1
  441. package/build-module/components/list/index.js.map +1 -1
  442. package/build-module/components/page/header.js +33 -0
  443. package/build-module/components/page/header.js.map +1 -0
  444. package/build-module/components/page/index.js +37 -0
  445. package/build-module/components/page/index.js.map +1 -0
  446. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +53 -0
  447. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
  448. package/build-module/components/page-content-focus-manager/constants.js +2 -0
  449. package/build-module/components/page-content-focus-manager/constants.js.map +1 -0
  450. 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
  451. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
  452. package/build-module/components/page-content-focus-manager/edit-template-notification.js +110 -0
  453. package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
  454. package/build-module/components/page-content-focus-manager/index.js +23 -0
  455. package/build-module/components/page-content-focus-manager/index.js.map +1 -0
  456. package/build-module/components/page-library/grid-item.js +145 -0
  457. package/build-module/components/page-library/grid-item.js.map +1 -0
  458. package/build-module/components/page-library/grid.js +38 -0
  459. package/build-module/components/page-library/grid.js.map +1 -0
  460. package/build-module/components/page-library/index.js +43 -0
  461. package/build-module/components/page-library/index.js.map +1 -0
  462. package/build-module/components/page-library/no-patterns.js +12 -0
  463. package/build-module/components/page-library/no-patterns.js.map +1 -0
  464. package/build-module/components/page-library/patterns-list.js +87 -0
  465. package/build-module/components/page-library/patterns-list.js.map +1 -0
  466. package/build-module/components/page-library/search-items.js +156 -0
  467. package/build-module/components/page-library/search-items.js.map +1 -0
  468. package/build-module/components/page-library/use-library-settings.js +40 -0
  469. package/build-module/components/page-library/use-library-settings.js.map +1 -0
  470. package/build-module/components/page-library/use-patterns.js +176 -0
  471. package/build-module/components/page-library/use-patterns.js.map +1 -0
  472. package/build-module/components/page-library/utils.js +13 -0
  473. package/build-module/components/page-library/utils.js.map +1 -0
  474. package/build-module/components/page-main/index.js +32 -0
  475. package/build-module/components/page-main/index.js.map +1 -0
  476. package/build-module/components/page-templates/index.js +80 -0
  477. package/build-module/components/page-templates/index.js.map +1 -0
  478. package/build-module/components/preferences-modal/enable-feature.js +4 -4
  479. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  480. package/build-module/components/resizable-frame/index.js +5 -3
  481. package/build-module/components/resizable-frame/index.js.map +1 -1
  482. package/build-module/components/revisions/index.js +1 -1
  483. package/build-module/components/revisions/index.js.map +1 -1
  484. package/build-module/components/routes/link.js +6 -6
  485. package/build-module/components/routes/link.js.map +1 -1
  486. package/build-module/components/routes/use-title.js +1 -1
  487. package/build-module/components/routes/use-title.js.map +1 -1
  488. package/build-module/components/save-button/index.js +15 -11
  489. package/build-module/components/save-button/index.js.map +1 -1
  490. package/build-module/components/save-hub/index.js +1 -1
  491. package/build-module/components/save-hub/index.js.map +1 -1
  492. package/build-module/components/save-panel/index.js +3 -4
  493. package/build-module/components/save-panel/index.js.map +1 -1
  494. package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
  495. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  496. package/build-module/components/secondary-sidebar/list-view-sidebar.js +44 -10
  497. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  498. package/build-module/components/sidebar/index.js +10 -7
  499. package/build-module/components/sidebar/index.js.map +1 -1
  500. package/build-module/components/sidebar-button/index.js +2 -3
  501. package/build-module/components/sidebar-button/index.js.map +1 -1
  502. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +19 -6
  503. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  504. package/build-module/components/sidebar-edit-mode/index.js +5 -5
  505. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  506. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +71 -0
  507. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
  508. package/build-module/components/sidebar-edit-mode/page-panels/index.js +51 -40
  509. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  510. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +23 -0
  511. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
  512. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +176 -0
  513. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
  514. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +33 -0
  515. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
  516. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +85 -0
  517. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
  518. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -4
  519. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  520. package/build-module/components/sidebar-edit-mode/settings-header/index.js +20 -7
  521. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  522. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  523. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  524. package/build-module/components/sidebar-edit-mode/template-panel/index.js +9 -6
  525. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  526. package/build-module/components/sidebar-navigation-item/index.js +11 -7
  527. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  528. package/build-module/components/sidebar-navigation-screen/index.js +18 -7
  529. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  530. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +27 -0
  531. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
  532. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +30 -0
  533. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
  534. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  535. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
  536. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +24 -0
  537. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
  538. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  539. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
  540. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +9 -8
  541. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  542. package/build-module/components/sidebar-navigation-screen-library/category-item.js +37 -0
  543. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
  544. package/build-module/components/sidebar-navigation-screen-library/index.js +87 -0
  545. package/build-module/components/sidebar-navigation-screen-library/index.js.map +1 -0
  546. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +25 -0
  547. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
  548. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js +61 -0
  549. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
  550. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +34 -0
  551. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
  552. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js +27 -0
  553. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
  554. package/build-module/components/sidebar-navigation-screen-main/index.js +13 -13
  555. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  556. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  557. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  558. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +33 -0
  559. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
  560. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +26 -0
  561. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
  562. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +45 -90
  563. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  564. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +70 -0
  565. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
  566. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +58 -0
  567. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
  568. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +46 -0
  569. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
  570. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +35 -0
  571. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
  572. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +151 -0
  573. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
  574. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  575. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  576. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +45 -7
  577. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  578. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +55 -7
  579. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  580. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +22 -50
  581. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  582. package/build-module/components/sidebar-navigation-screen-page/index.js +14 -34
  583. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  584. package/build-module/components/sidebar-navigation-screen-page/page-details.js +28 -28
  585. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  586. package/build-module/components/sidebar-navigation-screen-page/status-label.js +9 -8
  587. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  588. package/build-module/components/sidebar-navigation-screen-pages/index.js +8 -6
  589. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  590. package/build-module/components/sidebar-navigation-screen-pattern/index.js +46 -0
  591. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
  592. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  593. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
  594. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +22 -0
  595. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
  596. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +27 -0
  597. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
  598. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +34 -0
  599. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
  600. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  601. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
  602. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +64 -0
  603. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
  604. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +192 -0
  605. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
  606. package/build-module/components/sidebar-navigation-screen-template/index.js +18 -6
  607. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  608. package/build-module/components/sidebar-navigation-screen-templates/index.js +11 -10
  609. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  610. package/build-module/components/site-hub/index.js +8 -9
  611. package/build-module/components/site-hub/index.js.map +1 -1
  612. package/build-module/components/style-book/index.js +9 -9
  613. package/build-module/components/style-book/index.js.map +1 -1
  614. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +13 -3
  615. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  616. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  617. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  618. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
  619. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  620. package/build-module/components/table/index.js +21 -0
  621. package/build-module/components/table/index.js.map +1 -0
  622. package/build-module/components/template-part-converter/convert-to-template-part.js +4 -20
  623. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  624. package/build-module/components/welcome-guide/editor.js +1 -1
  625. package/build-module/components/welcome-guide/editor.js.map +1 -1
  626. package/build-module/components/welcome-guide/styles.js +5 -3
  627. package/build-module/components/welcome-guide/styles.js.map +1 -1
  628. package/build-module/hooks/commands/use-common-commands.js +172 -0
  629. package/build-module/hooks/commands/use-common-commands.js.map +1 -0
  630. package/build-module/hooks/commands/use-edit-mode-commands.js +68 -24
  631. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  632. package/build-module/hooks/index.js +1 -0
  633. package/build-module/hooks/index.js.map +1 -1
  634. package/build-module/hooks/navigation-menu-edit.js +77 -0
  635. package/build-module/hooks/navigation-menu-edit.js.map +1 -0
  636. package/build-module/hooks/push-changes-to-global-styles/index.js +4 -2
  637. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  638. package/build-module/hooks/template-part-edit.js +5 -5
  639. package/build-module/hooks/template-part-edit.js.map +1 -1
  640. package/build-module/{private-apis.js → lock-unlock.js} +1 -1
  641. package/build-module/lock-unlock.js.map +1 -0
  642. package/build-module/store/actions.js +39 -7
  643. package/build-module/store/actions.js.map +1 -1
  644. package/build-module/store/index.js +1 -1
  645. package/build-module/store/index.js.map +1 -1
  646. package/build-module/store/reducer.js +6 -5
  647. package/build-module/store/reducer.js.map +1 -1
  648. package/build-module/store/selectors.js +35 -14
  649. package/build-module/store/selectors.js.map +1 -1
  650. package/build-module/utils/get-is-list-page.js +12 -5
  651. package/build-module/utils/get-is-list-page.js.map +1 -1
  652. package/build-module/utils/is-previewing-theme.js +2 -2
  653. package/build-module/utils/is-previewing-theme.js.map +1 -1
  654. package/build-module/utils/use-activate-theme.js +2 -2
  655. package/build-module/utils/use-activate-theme.js.map +1 -1
  656. package/build-module/utils/use-debounced-input.js +17 -0
  657. package/build-module/utils/use-debounced-input.js.map +1 -0
  658. package/build-style/style-rtl.css +323 -29
  659. package/build-style/style.css +323 -29
  660. package/package.json +44 -40
  661. package/src/components/add-new-pattern/index.js +94 -0
  662. package/src/components/add-new-template/add-custom-template-modal-content.js +1 -13
  663. package/src/components/add-new-template/index.js +0 -3
  664. package/src/components/add-new-template/new-template.js +1 -2
  665. package/src/components/app/index.js +1 -1
  666. package/src/components/block-editor/back-button.js +5 -2
  667. package/src/components/block-editor/constants.js +1 -0
  668. package/src/components/block-editor/editor-canvas.js +1 -1
  669. package/src/components/block-editor/get-block-editor-provider.js +29 -0
  670. package/src/components/block-editor/index.js +15 -199
  671. package/src/components/block-editor/providers/default-block-editor-provider.js +44 -0
  672. package/src/components/block-editor/providers/navigation-block-editor-provider.js +114 -0
  673. package/src/components/block-editor/site-editor-canvas.js +155 -0
  674. package/src/components/block-editor/style.scss +6 -0
  675. package/src/components/block-editor/use-site-editor-settings.js +91 -0
  676. package/src/components/canvas-spinner/index.js +11 -1
  677. package/src/components/create-pattern-modal/index.js +134 -0
  678. package/src/components/create-pattern-modal/style.scss +3 -0
  679. package/src/components/create-template-part-modal/index.js +63 -3
  680. package/src/components/editor/index.js +24 -15
  681. package/src/components/editor-canvas-container/index.js +21 -4
  682. package/src/components/global-styles/color-palette-panel.js +1 -1
  683. package/src/components/global-styles/dimensions-panel.js +1 -1
  684. package/src/components/global-styles/global-styles-provider.js +10 -14
  685. package/src/components/global-styles/gradients-palette-panel.js +1 -1
  686. package/src/components/global-styles/hooks.js +1 -1
  687. package/src/components/global-styles/palette.js +2 -2
  688. package/src/components/global-styles/preview.js +1 -1
  689. package/src/components/global-styles/root-menu.js +1 -1
  690. package/src/components/global-styles/screen-block-list.js +1 -1
  691. package/src/components/global-styles/screen-block.js +1 -1
  692. package/src/components/global-styles/screen-colors.js +1 -1
  693. package/src/components/global-styles/screen-css.js +1 -1
  694. package/src/components/global-styles/screen-layout.js +1 -1
  695. package/src/components/global-styles/screen-revisions/index.js +1 -1
  696. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
  697. package/src/components/global-styles/screen-root.js +1 -1
  698. package/src/components/global-styles/screen-typography.js +1 -1
  699. package/src/components/global-styles/stories/index.js +1 -1
  700. package/src/components/global-styles/style-variations-container.js +13 -3
  701. package/src/components/global-styles/style.scss +11 -0
  702. package/src/components/global-styles/typography-panel.js +1 -1
  703. package/src/components/global-styles/typography-preview.js +1 -1
  704. package/src/components/global-styles/ui.js +105 -46
  705. package/src/components/global-styles-renderer/index.js +1 -1
  706. package/src/components/header-edit-mode/document-actions/index.js +51 -26
  707. package/src/components/header-edit-mode/document-actions/style.scss +9 -5
  708. package/src/components/header-edit-mode/index.js +4 -4
  709. package/src/components/keyboard-shortcuts/edit-mode.js +5 -1
  710. package/src/components/keyboard-shortcuts/index.js +5 -1
  711. package/src/components/keyboard-shortcuts/register.js +1 -1
  712. package/src/components/layout/hooks.js +21 -0
  713. package/src/components/layout/index.js +92 -64
  714. package/src/components/layout/style.scss +7 -0
  715. package/src/components/list/index.js +1 -1
  716. package/src/components/page/header.js +38 -0
  717. package/src/components/page/index.js +38 -0
  718. package/src/components/page/style.scss +38 -0
  719. package/src/components/page-content-focus-manager/back-to-page-notification.js +65 -0
  720. package/src/components/{page-content-lock → page-content-focus-manager}/constants.js +1 -1
  721. package/src/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +15 -7
  722. package/src/components/page-content-focus-manager/edit-template-notification.js +108 -0
  723. package/src/components/page-content-focus-manager/index.js +26 -0
  724. package/src/components/page-library/grid-item.js +179 -0
  725. package/src/components/page-library/grid.js +39 -0
  726. package/src/components/page-library/index.js +39 -0
  727. package/src/components/page-library/no-patterns.js +12 -0
  728. package/src/components/page-library/patterns-list.js +114 -0
  729. package/src/components/page-library/search-items.js +171 -0
  730. package/src/components/page-library/style.scss +105 -0
  731. package/src/components/page-library/use-library-settings.js +51 -0
  732. package/src/components/page-library/use-patterns.js +238 -0
  733. package/src/components/page-library/utils.js +21 -0
  734. package/src/components/page-main/index.js +27 -0
  735. package/src/components/page-templates/index.js +104 -0
  736. package/src/components/resizable-frame/index.js +3 -1
  737. package/src/components/revisions/index.js +1 -1
  738. package/src/components/routes/link.js +2 -2
  739. package/src/components/routes/use-title.js +1 -1
  740. package/src/components/save-button/index.js +14 -11
  741. package/src/components/save-hub/index.js +1 -1
  742. package/src/components/save-panel/index.js +1 -1
  743. package/src/components/secondary-sidebar/list-view-sidebar.js +53 -6
  744. package/src/components/sidebar/index.js +11 -7
  745. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -29
  746. package/src/components/sidebar-edit-mode/index.js +5 -5
  747. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +69 -0
  748. package/src/components/sidebar-edit-mode/page-panels/index.js +53 -53
  749. package/src/components/sidebar-edit-mode/page-panels/page-content.js +27 -0
  750. package/src/components/sidebar-edit-mode/page-panels/page-status.js +233 -0
  751. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +35 -0
  752. package/src/components/sidebar-edit-mode/page-panels/publish-date.js +94 -0
  753. package/src/components/sidebar-edit-mode/page-panels/style.scss +31 -0
  754. package/src/components/sidebar-edit-mode/settings-header/index.js +18 -9
  755. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  756. package/src/components/sidebar-edit-mode/template-panel/index.js +9 -6
  757. package/src/components/sidebar-navigation-item/index.js +6 -2
  758. package/src/components/sidebar-navigation-item/style.scss +7 -0
  759. package/src/components/sidebar-navigation-screen/index.js +19 -7
  760. package/src/components/sidebar-navigation-screen/style.scss +28 -8
  761. package/src/components/sidebar-navigation-screen-details-footer/index.js +45 -0
  762. package/src/components/sidebar-navigation-screen-details-footer/style.scss +5 -0
  763. package/src/components/sidebar-navigation-screen-details-panel/index.js +40 -0
  764. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
  765. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +29 -0
  766. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
  767. package/src/components/sidebar-navigation-screen-details-panel/style.scss +25 -0
  768. package/src/components/sidebar-navigation-screen-global-styles/index.js +9 -3
  769. package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -3
  770. package/src/components/sidebar-navigation-screen-library/category-item.js +43 -0
  771. package/src/components/sidebar-navigation-screen-library/index.js +136 -0
  772. package/src/components/sidebar-navigation-screen-library/style.scss +7 -0
  773. package/src/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +32 -0
  774. package/src/components/sidebar-navigation-screen-library/use-pattern-categories.js +64 -0
  775. package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +33 -0
  776. package/src/components/sidebar-navigation-screen-library/use-theme-patterns.js +44 -0
  777. package/src/components/sidebar-navigation-screen-main/index.js +11 -14
  778. package/src/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  779. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +45 -0
  780. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +24 -0
  781. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +50 -96
  782. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +89 -0
  783. package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +51 -0
  784. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +51 -0
  785. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +39 -0
  786. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +15 -0
  787. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +175 -0
  788. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  789. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +43 -7
  790. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +61 -2
  791. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +25 -47
  792. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +4 -0
  793. package/src/components/sidebar-navigation-screen-page/index.js +19 -58
  794. package/src/components/sidebar-navigation-screen-page/page-details.js +42 -39
  795. package/src/components/sidebar-navigation-screen-page/status-label.js +23 -19
  796. package/src/components/sidebar-navigation-screen-page/style.scss +1 -18
  797. package/src/components/sidebar-navigation-screen-pages/index.js +30 -29
  798. package/src/components/sidebar-navigation-screen-pattern/index.js +44 -0
  799. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
  800. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +21 -0
  801. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +30 -0
  802. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +33 -0
  803. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
  804. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +86 -0
  805. package/src/components/sidebar-navigation-screen-template/home-template-details.js +230 -0
  806. package/src/components/sidebar-navigation-screen-template/index.js +19 -5
  807. package/src/components/sidebar-navigation-screen-template/style.scss +23 -0
  808. package/src/components/sidebar-navigation-screen-templates/index.js +18 -25
  809. package/src/components/site-hub/index.js +13 -9
  810. package/src/components/style-book/index.js +1 -1
  811. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -3
  812. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
  813. package/src/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
  814. package/src/components/table/index.js +33 -0
  815. package/src/components/table/style.scss +37 -0
  816. package/src/components/template-part-converter/convert-to-template-part.js +4 -27
  817. package/src/components/welcome-guide/editor.js +1 -1
  818. package/src/components/welcome-guide/styles.js +5 -3
  819. package/src/hooks/commands/use-common-commands.js +167 -0
  820. package/src/hooks/commands/use-edit-mode-commands.js +61 -25
  821. package/src/hooks/index.js +1 -0
  822. package/src/hooks/navigation-menu-edit.js +95 -0
  823. package/src/hooks/push-changes-to-global-styles/index.js +1 -1
  824. package/src/hooks/template-part-edit.js +1 -1
  825. package/src/store/actions.js +40 -8
  826. package/src/store/index.js +1 -1
  827. package/src/store/reducer.js +6 -5
  828. package/src/store/selectors.js +34 -9
  829. package/src/store/test/actions.js +8 -8
  830. package/src/store/test/reducer.js +11 -11
  831. package/src/store/test/selectors.js +8 -8
  832. package/src/style.scss +12 -2
  833. package/src/utils/get-is-list-page.js +16 -4
  834. package/src/utils/is-previewing-theme.js +4 -2
  835. package/src/utils/use-activate-theme.js +3 -2
  836. package/src/utils/use-debounced-input.js +17 -0
  837. package/build/components/add-new-template/new-template-part.js +0 -113
  838. package/build/components/add-new-template/new-template-part.js.map +0 -1
  839. package/build/components/page-content-lock/constants.js +0 -9
  840. package/build/components/page-content-lock/constants.js.map +0 -1
  841. package/build/components/page-content-lock/index.js +0 -29
  842. package/build/components/page-content-lock/index.js.map +0 -1
  843. package/build/components/page-content-lock/use-disable-non-content-blocks.js +0 -49
  844. package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
  845. package/build/components/page-content-lock/use-page-content-lock-notifications.js +0 -112
  846. package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
  847. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -79
  848. package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
  849. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -52
  850. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  851. package/build/components/sidebar-navigation-screen-template-part/index.js +0 -105
  852. package/build/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
  853. package/build/components/sidebar-navigation-subtitle/index.js +0 -17
  854. package/build/components/sidebar-navigation-subtitle/index.js.map +0 -1
  855. package/build/private-apis.js.map +0 -1
  856. package/build-module/components/add-new-template/new-template-part.js +0 -93
  857. package/build-module/components/add-new-template/new-template-part.js.map +0 -1
  858. package/build-module/components/page-content-lock/constants.js +0 -2
  859. package/build-module/components/page-content-lock/constants.js.map +0 -1
  860. package/build-module/components/page-content-lock/index.js +0 -14
  861. package/build-module/components/page-content-lock/index.js.map +0 -1
  862. package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
  863. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +0 -98
  864. package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
  865. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -67
  866. package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
  867. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -39
  868. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
  869. package/build-module/components/sidebar-navigation-screen-template-part/index.js +0 -86
  870. package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
  871. package/build-module/components/sidebar-navigation-subtitle/index.js +0 -9
  872. package/build-module/components/sidebar-navigation-subtitle/index.js.map +0 -1
  873. package/build-module/private-apis.js.map +0 -1
  874. package/src/components/add-new-template/new-template-part.js +0 -109
  875. package/src/components/page-content-lock/index.js +0 -14
  876. package/src/components/page-content-lock/use-page-content-lock-notifications.js +0 -128
  877. package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -77
  878. package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -47
  879. package/src/components/sidebar-navigation-screen-template-part/index.js +0 -103
  880. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -4
  881. package/src/components/sidebar-navigation-subtitle/index.js +0 -5
  882. package/src/components/sidebar-navigation-subtitle/style.scss +0 -7
  883. /package/src/{private-apis.js → lock-unlock.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"names":["classnames","__experimentalItem","Item","__experimentalHStack","HStack","FlexBlock","chevronRightSmall","Icon","SidebarNavigationItem","className","icon","withChevron","children","props","fill"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,kBAAkB,IAAIC,IADvB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,SAHD,QAIO,uBAJP;AAKA,SAASC,iBAAT,EAA4BC,IAA5B,QAAwC,kBAAxC;AAEA,eAAe,SAASC,qBAAT,CAAgC;AAC9CC,EAAAA,SAD8C;AAE9CC,EAAAA,IAF8C;AAG9CC,EAAAA,WAAW,GAAG,KAHgC;AAI9CC,EAAAA,QAJ8C;AAK9C,KAAGC;AAL2C,CAAhC,EAMX;AACH,SACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAGb,UAAU,CACrB,mCADqB,EAErBS,SAFqB;AADvB,KAKMI,KALN,GAOC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACGH,IAAI,IACL,cAAC,IAAD;AACC,IAAA,KAAK,EAAG;AAAEI,MAAAA,IAAI,EAAE;AAAR,KADT;AAEC,IAAA,IAAI,EAAGJ,IAFR;AAGC,IAAA,IAAI,EAAG;AAHR,IAFF,EAQC,cAAC,SAAD,QAAaE,QAAb,CARD,EASGD,WAAW,IACZ,cAAC,IAAD;AACC,IAAA,IAAI,EAAGL,iBADR;AAEC,IAAA,SAAS,EAAC,wDAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAVF,CAPD,CADD;AA2BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { chevronRightSmall, Icon } from '@wordpress/icons';\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tchildren,\n\t...props\n} ) {\n\treturn (\n\t\t<Item\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</Item>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"names":["classnames","__experimentalItem","Item","__experimentalHStack","HStack","FlexBlock","isRTL","chevronRightSmall","chevronLeftSmall","Icon","SidebarNavigationItem","className","icon","withChevron","suffix","children","props","fill"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,kBAAkB,IAAIC,IADvB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,SAHD,QAIO,uBAJP;AAKA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASC,iBAAT,EAA4BC,gBAA5B,EAA8CC,IAA9C,QAA0D,kBAA1D;AAEA,eAAe,SAASC,qBAAT,CAAgC;AAC9CC,EAAAA,SAD8C;AAE9CC,EAAAA,IAF8C;AAG9CC,EAAAA,WAAW,GAAG,KAHgC;AAI9CC,EAAAA,MAJ8C;AAK9CC,EAAAA,QAL8C;AAM9C,KAAGC;AAN2C,CAAhC,EAOX;AACH,SACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAGhB,UAAU,CACrB,mCADqB,EAErB;AAAE,qBAAe,CAAEa,WAAF,IAAiBC;AAAlC,KAFqB,EAGrBH,SAHqB,CADvB;AAAA,OAMMK;AANN,KAQC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACGJ,IAAI,IACL,cAAC,IAAD;AACC,IAAA,KAAK,EAAG;AAAEK,MAAAA,IAAI,EAAE;AAAR,KADT;AAEC,IAAA,IAAI,EAAGL,IAFR;AAGC,IAAA,IAAI,EAAG;AAHR,IAFF,EAQC,cAAC,SAAD,QAAaG,QAAb,CARD,EASGF,WAAW,IACZ,cAAC,IAAD;AACC,IAAA,IAAI,EAAGP,KAAK,KAAKE,gBAAL,GAAwBD,iBADrC;AAEC,IAAA,SAAS,EAAC,wDAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAVF,EAgBG,CAAEM,WAAF,IAAiBC,MAhBpB,CARD,CADD;AA6BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tsuffix,\n\tchildren,\n\t...props\n} ) {\n\treturn (\n\t\t<Item\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\t{ 'with-suffix': ! withChevron && suffix },\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! withChevron && suffix }\n\t\t\t</HStack>\n\t\t</Item>\n\t);\n}\n"]}
@@ -3,7 +3,7 @@ import { createElement, Fragment } from "@wordpress/element";
3
3
  /**
4
4
  * WordPress dependencies
5
5
  */
6
- import { __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalNavigatorToParentButton as NavigatorToParentButton, __experimentalHeading as Heading } from '@wordpress/components';
6
+ import { __experimentalHStack as HStack, __experimentalHeading as Heading, __experimentalNavigatorToParentButton as NavigatorToParentButton, __experimentalUseNavigator as useNavigator, __experimentalVStack as VStack } from '@wordpress/components';
7
7
  import { isRTL, __, sprintf } from '@wordpress/i18n';
8
8
  import { chevronRight, chevronLeft } from '@wordpress/icons';
9
9
  import { store as coreStore } from '@wordpress/core-data';
@@ -13,7 +13,7 @@ import { useSelect } from '@wordpress/data';
13
13
  */
14
14
 
15
15
  import { store as editSiteStore } from '../../store';
16
- import { unlock } from '../../private-apis';
16
+ import { unlock } from '../../lock-unlock';
17
17
  import SidebarButton from '../sidebar-button';
18
18
  import { isPreviewingTheme, currentlyPreviewingTheme } from '../../utils/is-previewing-theme';
19
19
  export default function SidebarNavigationScreen({
@@ -23,7 +23,8 @@ export default function SidebarNavigationScreen({
23
23
  meta,
24
24
  content,
25
25
  footer,
26
- description
26
+ description,
27
+ backPath
27
28
  }) {
28
29
  const {
29
30
  dashboardLink
@@ -38,7 +39,11 @@ export default function SidebarNavigationScreen({
38
39
  const {
39
40
  getTheme
40
41
  } = useSelect(coreStore);
42
+ const {
43
+ goTo
44
+ } = useNavigator();
41
45
  const theme = getTheme(currentlyPreviewingTheme());
46
+ const icon = isRTL() ? chevronRight : chevronLeft;
42
47
  return createElement(Fragment, null, createElement(VStack, {
43
48
  className: "edit-site-sidebar-navigation-screen__main",
44
49
  spacing: 0,
@@ -47,18 +52,24 @@ export default function SidebarNavigationScreen({
47
52
  spacing: 4,
48
53
  alignment: "flex-start",
49
54
  className: "edit-site-sidebar-navigation-screen__title-icon"
50
- }, !isRoot ? createElement(NavigatorToParentButton, {
55
+ }, !isRoot && !backPath && createElement(NavigatorToParentButton, {
51
56
  as: SidebarButton,
52
57
  icon: isRTL() ? chevronRight : chevronLeft,
58
+ "aria-label": __('Back')
59
+ }), !isRoot && backPath && createElement(SidebarButton, {
60
+ onClick: () => goTo(backPath, {
61
+ isBack: true
62
+ }),
63
+ icon: icon,
53
64
  label: __('Back')
54
- }) : createElement(SidebarButton, {
55
- icon: isRTL() ? chevronRight : chevronLeft,
65
+ }), isRoot && createElement(SidebarButton, {
66
+ icon: icon,
56
67
  label: !isPreviewingTheme() ? __('Go back to the Dashboard') : __('Go back to the theme showcase'),
57
68
  href: !isPreviewingTheme() ? dashboardLink || 'index.php' : 'themes.php'
58
69
  }), createElement(Heading, {
59
70
  className: "edit-site-sidebar-navigation-screen__title",
60
71
  color: 'white',
61
- level: 2,
72
+ level: 1,
62
73
  size: 20
63
74
  }, !isPreviewingTheme() ? title : sprintf('Previewing %1$s: %2$s', theme?.name?.rendered, title)), actions && createElement("div", {
64
75
  className: "edit-site-sidebar-navigation-screen__actions"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalNavigatorToParentButton","NavigatorToParentButton","__experimentalHeading","Heading","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","dashboardLink","select","getSettings","__experimentalDashboardLink","getTheme","theme","name","rendered"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,qCAAqC,IAAIC,uBAH1C,EAICC,qBAAqB,IAAIC,OAJ1B,QAKO,uBALP;AAMA,SAASC,KAAT,EAAgBC,EAAhB,EAAoBC,OAApB,QAAmC,iBAAnC;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,kBAA1C;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,SACCC,iBADD,EAECC,wBAFD,QAGO,iCAHP;AAKA,eAAe,SAASC,uBAAT,CAAkC;AAChDC,EAAAA,MADgD;AAEhDC,EAAAA,KAFgD;AAGhDC,EAAAA,OAHgD;AAIhDC,EAAAA,IAJgD;AAKhDC,EAAAA,OALgD;AAMhDC,EAAAA,MANgD;AAOhDC,EAAAA;AAPgD,CAAlC,EAQX;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoBd,SAAS,CAAIe,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAkBd,MAAM,CAAEa,MAAM,CAAEd,aAAF,CAAR,CAA9B;AACA,WAAO;AACNa,MAAAA,aAAa,EAAEE,WAAW,GAAGC;AADvB,KAAP;AAGA,GALkC,EAKhC,EALgC,CAAnC;AAMA,QAAM;AAAEC,IAAAA;AAAF,MAAelB,SAAS,CAAED,SAAF,CAA9B;AACA,QAAMoB,KAAK,GAAGD,QAAQ,CAAEb,wBAAwB,EAA1B,CAAtB;AAEA,SACC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AQ,IAAA,SAAS,EAAC;AAAlB,KACGA,MADH,CAtEF,CADD;AA6EA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n} ) {\n\tconst { dashboardLink } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t};\n\t}, [] );\n\tconst { getTheme } = useSelect( coreStore );\n\tconst theme = getTheme( currentlyPreviewingTheme() );\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__main\"\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot ? (\n\t\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\t\tas={ SidebarButton }\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t! isPreviewingTheme()\n\t\t\t\t\t\t\t\t\t? __( 'Go back to the Dashboard' )\n\t\t\t\t\t\t\t\t\t: __( 'Go back to the theme showcase' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t! isPreviewingTheme()\n\t\t\t\t\t\t\t\t\t? dashboardLink || 'index.php'\n\t\t\t\t\t\t\t\t\t: 'themes.php'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ 'white' }\n\t\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t'Previewing %1$s: %2$s',\n\t\t\t\t\t\t\t\t\ttheme?.name?.rendered,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["__experimentalHStack","HStack","__experimentalHeading","Heading","__experimentalNavigatorToParentButton","NavigatorToParentButton","__experimentalUseNavigator","useNavigator","__experimentalVStack","VStack","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","dashboardLink","select","getSettings","__experimentalDashboardLink","getTheme","goTo","theme","icon","isBack","name","rendered"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,qBAAqB,IAAIC,OAF1B,EAGCC,qCAAqC,IAAIC,uBAH1C,EAICC,0BAA0B,IAAIC,YAJ/B,EAKCC,oBAAoB,IAAIC,MALzB,QAMO,uBANP;AAOA,SAASC,KAAT,EAAgBC,EAAhB,EAAoBC,OAApB,QAAmC,iBAAnC;AACA,SAASC,YAAT,EAAuBC,WAAvB,QAA0C,kBAA1C;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,SACCC,iBADD,EAECC,wBAFD,QAGO,iCAHP;A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;AAAES,MAAAA,MAAM,EAAE;AAAV,KAAZ,CADrB;AAEC,IAAA,IAAI,EAAGD,IAFR;AAGC,IAAA,KAAK,EAAG5B,EAAE,CAAE,MAAF;AAHX,IAbF,EAmBGa,MAAM,IACP,cAAC,aAAD;AACC,IAAA,IAAI,EAAGe,IADR;AAEC,IAAA,KAAK,EACJ,CAAElB,iBAAiB,EAAnB,GACGV,EAAE,CAAE,0BAAF,CADL,GAEGA,EAAE,CAAE,+BAAF,CALP;AAOC,IAAA,IAAI,EACH,CAAEU,iBAAiB,EAAnB,GACGW,aAAa,IAAI,WADpB,GAEG;AAVL,IApBF,EAkCC,cAAC,OAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,KAAK,EAAG,OAFT;AAGC,IAAA,KAAK,EAAG,CAHT;AAIC,IAAA,IAAI,EAAG;AAJR,KAMG,CAAEX,iBAAiB,EAAnB,GACCI,KADD,GAECb,OAAO,CACP,uBADO,EAEP0B,KAAK,EAAEG,IAAP,EAAaC,QAFN,EAGPjB,KAHO,CARX,CAlCD,EAgDGC,OAAO,IACR;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,OADH,CAjDF,CALD,EA2DGC,IAAI,IACL,8BACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,IADH,CADD,CA5DF,EAmEC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGG,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CAFF,EAMGF,OANH,CAnED,CADD,EA6EGC,MAAM,IACP;AAAQ,IAAA,SAAS,EAAC;AAAlB,KACGA,MADH,CA9EF,CADD;AAqFA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath,\n} ) {\n\tconst { dashboardLink } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t};\n\t}, [] );\n\tconst { getTheme } = useSelect( coreStore );\n\tconst { goTo } = useNavigator();\n\tconst theme = getTheme( currentlyPreviewingTheme() );\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__main\"\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && ! backPath && (\n\t\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\t\tas={ SidebarButton }\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\taria-label={ __( 'Back' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isRoot && backPath && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => goTo( backPath, { isBack: true } ) }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t! isPreviewingTheme()\n\t\t\t\t\t\t\t\t\t? __( 'Go back to the Dashboard' )\n\t\t\t\t\t\t\t\t\t: __( 'Go back to the theme showcase' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t! isPreviewingTheme()\n\t\t\t\t\t\t\t\t\t? dashboardLink || 'index.php'\n\t\t\t\t\t\t\t\t\t: 'themes.php'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ 'white' }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t'Previewing %1$s: %2$s',\n\t\t\t\t\t\t\t\t\ttheme?.name?.rendered,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { createElement, Fragment } from "@wordpress/element";
2
+
3
+ /**
4
+ * WordPress dependencies
5
+ */
6
+ import { __, sprintf } from '@wordpress/i18n';
7
+ import { humanTimeDiff } from '@wordpress/date';
8
+ import { createInterpolateElement } from '@wordpress/element';
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+
13
+ import { SidebarNavigationScreenDetailsPanelRow, SidebarNavigationScreenDetailsPanelLabel, SidebarNavigationScreenDetailsPanelValue } from '../sidebar-navigation-screen-details-panel';
14
+ export default function SidebarNavigationScreenDetailsFooter({
15
+ lastModifiedDateTime
16
+ }) {
17
+ return createElement(Fragment, null, lastModifiedDateTime && createElement(SidebarNavigationScreenDetailsPanelRow, {
18
+ className: "edit-site-sidebar-navigation-screen-details-footer"
19
+ }, createElement(SidebarNavigationScreenDetailsPanelLabel, null, __('Last modified')), createElement(SidebarNavigationScreenDetailsPanelValue, null, createInterpolateElement(sprintf(
20
+ /* translators: %s: is the relative time when the post was last modified. */
21
+ __('<time>%s</time>'), humanTimeDiff(lastModifiedDateTime)), {
22
+ time: createElement("time", {
23
+ dateTime: lastModifiedDateTime
24
+ })
25
+ }))));
26
+ }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js"],"names":["__","sprintf","humanTimeDiff","createInterpolateElement","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","SidebarNavigationScreenDetailsFooter","lastModifiedDateTime","time"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,SACCC,sCADD,EAECC,wCAFD,EAGCC,wCAHD,QAIO,4CAJP;AAMA,eAAe,SAASC,oCAAT,CAA+C;AAC7DC,EAAAA;AAD6D,CAA/C,EAEX;AACH,SACC,8BACGA,oBAAoB,IACrB,cAAC,sCAAD;AAAwC,IAAA,SAAS,EAAC;AAAlD,KACC,cAAC,wCAAD,QACGR,EAAE,CAAE,eAAF,CADL,CADD,EAIC,cAAC,wCAAD,QACGG,wBAAwB,CACzBF,OAAO;AACN;AACAD,EAAAA,EAAE,CAAE,iBAAF,CAFI,EAGNE,aAAa,CAAEM,oBAAF,CAHP,CADkB,EAMzB;AACCC,IAAAA,IAAI,EACH;AAAM,MAAA,QAAQ,EAAGD;AAAjB;AAFF,GANyB,CAD3B,CAJD,CAFF,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\n\nexport default function SidebarNavigationScreenDetailsFooter( {\n\tlastModifiedDateTime,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t{ lastModifiedDateTime && (\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow className=\"edit-site-sidebar-navigation-screen-details-footer\">\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ __( 'Last modified' ) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was last modified. */\n\t\t\t\t\t\t\t\t__( '<time>%s</time>' ),\n\t\t\t\t\t\t\t\thumanTimeDiff( lastModifiedDateTime )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttime: (\n\t\t\t\t\t\t\t\t\t<time dateTime={ lastModifiedDateTime } />\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * WordPress dependencies
5
+ */
6
+ import { __experimentalVStack as VStack, __experimentalHeading as Heading } from '@wordpress/components';
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+
11
+ import SidebarNavigationScreenDetailsPanelLabel from './sidebar-navigation-screen-details-panel-label';
12
+ import SidebarNavigationScreenDetailsPanelRow from './sidebar-navigation-screen-details-panel-row';
13
+ import SidebarNavigationScreenDetailsPanelValue from './sidebar-navigation-screen-details-panel-value';
14
+
15
+ function SidebarNavigationScreenDetailsPanel({
16
+ title,
17
+ children,
18
+ spacing
19
+ }) {
20
+ return createElement(VStack, {
21
+ className: "edit-site-sidebar-navigation-details-screen-panel",
22
+ spacing: spacing
23
+ }, title && createElement(Heading, {
24
+ className: "edit-site-sidebar-navigation-details-screen-panel__heading",
25
+ level: 2
26
+ }, title), children);
27
+ }
28
+
29
+ export { SidebarNavigationScreenDetailsPanel, SidebarNavigationScreenDetailsPanelRow, SidebarNavigationScreenDetailsPanelLabel, SidebarNavigationScreenDetailsPanelValue };
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-panel/index.js"],"names":["__experimentalVStack","VStack","__experimentalHeading","Heading","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelValue","SidebarNavigationScreenDetailsPanel","title","children","spacing"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,qBAAqB,IAAIC,OAF1B,QAGO,uBAHP;AAKA;AACA;AACA;;AACA,OAAOC,wCAAP,MAAqD,iDAArD;AACA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,wCAAP,MAAqD,iDAArD;;AAEA,SAASC,mCAAT,CAA8C;AAAEC,EAAAA,KAAF;AAASC,EAAAA,QAAT;AAAmBC,EAAAA;AAAnB,CAA9C,EAA6E;AAC5E,SACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,mDADX;AAEC,IAAA,OAAO,EAAGA;AAFX,KAIGF,KAAK,IACN,cAAC,OAAD;AACC,IAAA,SAAS,EAAC,4DADX;AAEC,IAAA,KAAK,EAAG;AAFT,KAIGA,KAJH,CALF,EAYGC,QAZH,CADD;AAgBA;;AAED,SACCF,mCADD,EAECF,sCAFD,EAGCD,wCAHD,EAICE,wCAJD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenDetailsPanelLabel from './sidebar-navigation-screen-details-panel-label';\nimport SidebarNavigationScreenDetailsPanelRow from './sidebar-navigation-screen-details-panel-row';\nimport SidebarNavigationScreenDetailsPanelValue from './sidebar-navigation-screen-details-panel-value';\n\nfunction SidebarNavigationScreenDetailsPanel( { title, children, spacing } ) {\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"edit-site-sidebar-navigation-details-screen-panel\"\n\t\t\tspacing={ spacing }\n\t\t>\n\t\t\t{ title && (\n\t\t\t\t<Heading\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-details-screen-panel__heading\"\n\t\t\t\t\tlevel={ 2 }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\t\t\t) }\n\t\t\t{ children }\n\t\t</VStack>\n\t);\n}\n\nexport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n};\n"]}
@@ -0,0 +1,14 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * WordPress dependencies
5
+ */
6
+ import { __experimentalText as Text } from '@wordpress/components';
7
+ export default function SidebarNavigationScreenDetailsPanelLabel({
8
+ children
9
+ }) {
10
+ return createElement(Text, {
11
+ className: "edit-site-sidebar-navigation-details-screen-panel__label"
12
+ }, children);
13
+ }
14
+ //# sourceMappingURL=sidebar-navigation-screen-details-panel-label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js"],"names":["__experimentalText","Text","SidebarNavigationScreenDetailsPanelLabel","children"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,kBAAkB,IAAIC,IAA/B,QAA2C,uBAA3C;AAEA,eAAe,SAASC,wCAAT,CAAmD;AACjEC,EAAAA;AADiE,CAAnD,EAEX;AACH,SACC,cAAC,IAAD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGA,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\n\nexport default function SidebarNavigationScreenDetailsPanelLabel( {\n\tchildren,\n} ) {\n\treturn (\n\t\t<Text className=\"edit-site-sidebar-navigation-details-screen-panel__label\">\n\t\t\t{ children }\n\t\t</Text>\n\t);\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import classnames from 'classnames';
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+
11
+ import { __experimentalHStack as HStack } from '@wordpress/components';
12
+ export default function SidebarNavigationScreenDetailsPanelRow({
13
+ label,
14
+ children,
15
+ className
16
+ }) {
17
+ return createElement(HStack, {
18
+ key: label,
19
+ spacing: 5,
20
+ alignment: "left",
21
+ className: classnames('edit-site-sidebar-navigation-details-screen-panel__row', className)
22
+ }, children);
23
+ }
24
+ //# sourceMappingURL=sidebar-navigation-screen-details-panel-row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js"],"names":["classnames","__experimentalHStack","HStack","SidebarNavigationScreenDetailsPanelRow","label","children","className"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,oBAAoB,IAAIC,MAAjC,QAA+C,uBAA/C;AAEA,eAAe,SAASC,sCAAT,CAAiD;AAC/DC,EAAAA,KAD+D;AAE/DC,EAAAA,QAF+D;AAG/DC,EAAAA;AAH+D,CAAjD,EAIX;AACH,SACC,cAAC,MAAD;AACC,IAAA,GAAG,EAAGF,KADP;AAEC,IAAA,OAAO,EAAG,CAFX;AAGC,IAAA,SAAS,EAAC,MAHX;AAIC,IAAA,SAAS,EAAGJ,UAAU,CACrB,wDADqB,EAErBM,SAFqB;AAJvB,KASGD,QATH,CADD;AAaA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack } from '@wordpress/components';\n\nexport default function SidebarNavigationScreenDetailsPanelRow( {\n\tlabel,\n\tchildren,\n\tclassName,\n} ) {\n\treturn (\n\t\t<HStack\n\t\t\tkey={ label }\n\t\t\tspacing={ 5 }\n\t\t\talignment=\"left\"\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-details-screen-panel__row',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</HStack>\n\t);\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * WordPress dependencies
5
+ */
6
+ import { __experimentalText as Text } from '@wordpress/components';
7
+ export default function SidebarNavigationScreenDetailsPanelValue({
8
+ children
9
+ }) {
10
+ return createElement(Text, {
11
+ className: "edit-site-sidebar-navigation-details-screen-panel__value"
12
+ }, children);
13
+ }
14
+ //# sourceMappingURL=sidebar-navigation-screen-details-panel-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js"],"names":["__experimentalText","Text","SidebarNavigationScreenDetailsPanelValue","children"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,kBAAkB,IAAIC,IAA/B,QAA2C,uBAA3C;AAEA,eAAe,SAASC,wCAAT,CAAmD;AACjEC,EAAAA;AADiE,CAAnD,EAEX;AACH,SACC,cAAC,IAAD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGA,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\n\nexport default function SidebarNavigationScreenDetailsPanelValue( {\n\tchildren,\n} ) {\n\treturn (\n\t\t<Text className=\"edit-site-sidebar-navigation-details-screen-panel__value\">\n\t\t\t{ children }\n\t\t</Text>\n\t);\n}\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement, Fragment } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -19,7 +18,7 @@ import { useCallback } from '@wordpress/element';
19
18
 
20
19
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
21
20
  import StyleVariationsContainer from '../global-styles/style-variations-container';
22
- import { unlock } from '../../private-apis';
21
+ import { unlock } from '../../lock-unlock';
23
22
  import { store as editSiteStore } from '../../store';
24
23
  import SidebarButton from '../sidebar-button';
25
24
  import SidebarNavigationItem from '../sidebar-navigation-item';
@@ -38,20 +37,20 @@ export function SidebarNavigationItemGlobalStyles(props) {
38
37
  const hasGlobalStyleVariations = useSelect(select => !!select(coreStore).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []);
39
38
 
40
39
  if (hasGlobalStyleVariations) {
41
- return createElement(NavigatorButton, _extends({}, props, {
40
+ return createElement(NavigatorButton, { ...props,
42
41
  as: SidebarNavigationItem,
43
42
  path: "/wp_global_styles"
44
- }));
43
+ });
45
44
  }
46
45
 
47
- return createElement(SidebarNavigationItem, _extends({}, props, {
46
+ return createElement(SidebarNavigationItem, { ...props,
48
47
  onClick: () => {
49
48
  // switch to edit mode.
50
49
  setCanvasMode('edit'); // open global styles sidebar.
51
50
 
52
51
  openGeneralSidebar('edit-site/global-styles');
53
52
  }
54
- }));
53
+ });
55
54
  }
56
55
 
57
56
  function SidebarNavigationScreenGlobalStylesContent() {
@@ -134,7 +133,8 @@ function SidebarNavigationScreenGlobalStylesFooter({
134
133
 
135
134
  export default function SidebarNavigationScreenGlobalStyles() {
136
135
  const {
137
- openGeneralSidebar
136
+ openGeneralSidebar,
137
+ setIsListViewOpened
138
138
  } = useDispatch(editSiteStore);
139
139
  const isMobileViewport = useViewportMatch('medium', '<');
140
140
  const {
@@ -149,7 +149,8 @@ export default function SidebarNavigationScreenGlobalStyles() {
149
149
  // the Style Book is not prematurely closed.
150
150
 
151
151
  setEditorCanvasContainerView('style-book');
152
- }, [openGlobalStyles, setEditorCanvasContainerView]);
152
+ setIsListViewOpened(false);
153
+ }, [openGlobalStyles, setEditorCanvasContainerView, setIsListViewOpened]);
153
154
  const openRevisions = useCallback(async () => {
154
155
  await openGlobalStyles(); // Open the global styles revisions once the canvas mode is set to edit,
155
156
  // and the global styles sidebar is open. The global styles UI is responsible
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"names":["__","backup","edit","seen","useSelect","useDispatch","store","coreStore","Icon","__experimentalNavigatorButton","NavigatorButton","__experimentalVStack","HStack","VStack","useViewportMatch","BlockEditorProvider","humanTimeDiff","useCallback","SidebarNavigationScreen","StyleVariationsContainer","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","noop","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","setCanvasMode","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","SidebarNavigationScreenGlobalStylesContent","storedSettings","getSettings","SidebarNavigationScreenGlobalStylesFooter","onClickRevisions","revisions","isLoading","revisionsCount","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","hasRevisions","modified","fill","SidebarNavigationScreenGlobalStyles","isMobileViewport","setEditorCanvasContainerView","isStyleBookOpened","getEditorCanvasContainerView","openGlobalStyles","Promise","all","openStyleBook","openRevisions"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,IAAjB,EAAuBC,IAAvB,QAAmC,kBAAnC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SACCC,IADD,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,oBAAoB,IAAIC,MAHzB,EAICD,oBAAoB,IAAIE,MAJzB,QAKO,uBALP;AAMA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,mBAAT,QAAoC,yBAApC;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,WAAT,QAA4B,oBAA5B;AAEA;AACA;AACA;;AACA,OA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F,CADD;AAiDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { backup, edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon,\n\t__experimentalNavigatorButton as NavigatorButton,\n\t__experimentalVStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\n\nconst noop = () => {};\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<NavigatorButton\n\t\t\t\t{ ...props }\n\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\tpath=\"/wp_global_styles\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// switch to edit mode.\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t// open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings( false ),\n\t\t};\n\t}, [] );\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<StyleVariationsContainer />\n\t\t</BlockEditorProvider>\n\t);\n}\n\nfunction SidebarNavigationScreenGlobalStylesFooter( { onClickRevisions } ) {\n\tconst { revisions, isLoading } = useGlobalStylesRevisions();\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\n\tconst hasRevisions = revisionsCount >= 2;\n\tconst modified = revisions?.[ 0 ]?.modified;\n\n\tif ( ! hasRevisions || isLoading || ! modified ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack className=\"edit-site-sidebar-navigation-screen-global-styles__footer\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-global-styles__revisions\"\n\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\tonClick={ onClickRevisions }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tas=\"span\"\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tspacing={ 5 }\n\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\tjustify=\"space-between\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-global-styles__revisions__label\">\n\t\t\t\t\t\t{ __( 'Last modified' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<time dateTime={ modified }>\n\t\t\t\t\t\t\t{ humanTimeDiff( modified ) }\n\t\t\t\t\t\t</time>\n\t\t\t\t\t</span>\n\t\t\t\t\t<Icon icon={ backup } style={ { fill: 'currentcolor' } } />\n\t\t\t\t</HStack>\n\t\t\t</SidebarNavigationItem>\n\t\t</VStack>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tconst isStyleBookOpened = useSelect(\n\t\t( select ) =>\n\t\t\t'style-book' ===\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\n\tconst openGlobalStyles = useCallback(\n\t\tasync () =>\n\t\t\tPromise.all( [\n\t\t\t\tsetCanvasMode( 'edit' ),\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t\t] ),\n\t\t[ setCanvasMode, openGeneralSidebar ]\n\t);\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\t<SidebarNavigationScreenGlobalStylesFooter\n\t\t\t\t\t\tonClickRevisions={ openRevisions }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isStyleBookOpened && ! isMobileViewport && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"names":["__","backup","edit","seen","useSelect","useDispatch","store","coreStore","Icon","__experimentalNavigatorButton","NavigatorButton","__experimentalVStack","HStack","VStack","useViewportMatch","BlockEditorProvider","humanTimeDiff","useCallback","SidebarNavigationScreen","StyleVariationsContainer","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","noop","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","setCanvasMode","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","SidebarNavigationScreenGlobalStylesContent","storedSettings","getSettings","SidebarNavigationScreenGlobalStylesFooter","onClickRevisions","revisions","isLoading","revisionsCount","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","hasRevisions","modified","fill","SidebarNavigationScreenGlobalStyles","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isStyleBookOpened","getEditorCanvasContainerView","openGlobalStyles","Promise","all","openStyleBook","openRevisions"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,IAAjB,EAAuBC,IAAvB,QAAmC,kBAAnC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SACCC,IADD,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,oBAAoB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M2D,gBAAgB;AAH7C,MAfD;AAZF,IADD,EAoCGF,iBAAiB,IAAI,CAAEF,gBAAvB,IACD,cAAC,SAAD;AACC,IAAA,cAAc,EAAG,KADlB;AAEC,IAAA,UAAU,EAAG,MAAM,KAFpB;AAGC,IAAA,OAAO,EAAGO,aAHX;AAIC,IAAA,QAAQ,EAAGA,aAJZ;AAKC,IAAA,eAAe,EAAG,KALnB;AAMC,IAAA,QAAQ,EAAG;AANZ,IArCF,CADD;AAiDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { backup, edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon,\n\t__experimentalNavigatorButton as NavigatorButton,\n\t__experimentalVStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\n\nconst noop = () => {};\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<NavigatorButton\n\t\t\t\t{ ...props }\n\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\tpath=\"/wp_global_styles\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// switch to edit mode.\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t// open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings( false ),\n\t\t};\n\t}, [] );\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<StyleVariationsContainer />\n\t\t</BlockEditorProvider>\n\t);\n}\n\nfunction SidebarNavigationScreenGlobalStylesFooter( { onClickRevisions } ) {\n\tconst { revisions, isLoading } = useGlobalStylesRevisions();\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\n\tconst hasRevisions = revisionsCount >= 2;\n\tconst modified = revisions?.[ 0 ]?.modified;\n\n\tif ( ! hasRevisions || isLoading || ! modified ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack className=\"edit-site-sidebar-navigation-screen-global-styles__footer\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-global-styles__revisions\"\n\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\tonClick={ onClickRevisions }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tas=\"span\"\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tspacing={ 5 }\n\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\tjustify=\"space-between\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-global-styles__revisions__label\">\n\t\t\t\t\t\t{ __( 'Last modified' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<time dateTime={ modified }>\n\t\t\t\t\t\t\t{ humanTimeDiff( modified ) }\n\t\t\t\t\t\t</time>\n\t\t\t\t\t</span>\n\t\t\t\t\t<Icon icon={ backup } style={ { fill: 'currentcolor' } } />\n\t\t\t\t</HStack>\n\t\t\t</SidebarNavigationItem>\n\t\t</VStack>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst { openGeneralSidebar, setIsListViewOpened } =\n\t\tuseDispatch( editSiteStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tconst isStyleBookOpened = useSelect(\n\t\t( select ) =>\n\t\t\t'style-book' ===\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\n\tconst openGlobalStyles = useCallback(\n\t\tasync () =>\n\t\t\tPromise.all( [\n\t\t\t\tsetCanvasMode( 'edit' ),\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t\t] ),\n\t\t[ setCanvasMode, openGeneralSidebar ]\n\t);\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\t<SidebarNavigationScreenGlobalStylesFooter\n\t\t\t\t\t\tonClickRevisions={ openRevisions }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isStyleBookOpened && ! isMobileViewport && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * Internal dependencies
5
+ */
6
+ import SidebarNavigationItem from '../sidebar-navigation-item';
7
+ import { useLink } from '../routes/link';
8
+ export default function CategoryItem({
9
+ count,
10
+ icon,
11
+ id,
12
+ isActive,
13
+ label,
14
+ type
15
+ }) {
16
+ const linkInfo = useLink({
17
+ path: '/library',
18
+ categoryType: type,
19
+ categoryId: id
20
+ }, {
21
+ // Keep a record of where we came from in state so we can
22
+ // use the browser's back button to go back to the library.
23
+ // See the implementation of the back button in patterns-list.
24
+ backPath: '/library'
25
+ });
26
+
27
+ if (!count) {
28
+ return;
29
+ }
30
+
31
+ return createElement(SidebarNavigationItem, { ...linkInfo,
32
+ icon: icon,
33
+ suffix: createElement("span", null, count),
34
+ className: isActive ? 'is-active-category' : undefined
35
+ }, label);
36
+ }
37
+ //# sourceMappingURL=category-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-library/category-item.js"],"names":["SidebarNavigationItem","useLink","CategoryItem","count","icon","id","isActive","label","type","linkInfo","path","categoryType","categoryId","backPath","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,qBAAP,MAAkC,4BAAlC;AACA,SAASC,OAAT,QAAwB,gBAAxB;AAEA,eAAe,SAASC,YAAT,CAAuB;AACrCC,EAAAA,KADqC;AAErCC,EAAAA,IAFqC;AAGrCC,EAAAA,EAHqC;AAIrCC,EAAAA,QAJqC;AAKrCC,EAAAA,KALqC;AAMrCC,EAAAA;AANqC,CAAvB,EAOX;AACH,QAAMC,QAAQ,GAAGR,OAAO,CACvB;AACCS,IAAAA,IAAI,EAAE,UADP;AAECC,IAAAA,YAAY,EAAEH,IAFf;AAGCI,IAAAA,UAAU,EAAEP;AAHb,GADuB,EAMvB;AACC;AACA;AACA;AACAQ,IAAAA,QAAQ,EAAE;AAJX,GANuB,CAAxB;;AAcA,MAAK,CAAEV,KAAP,EAAe;AACd;AACA;;AAED,SACC,cAAC,qBAAD,OACMM,QADN;AAEC,IAAA,IAAI,EAAGL,IAFR;AAGC,IAAA,MAAM,EAAG,4BAAQD,KAAR,CAHV;AAIC,IAAA,SAAS,EAAGG,QAAQ,GAAG,oBAAH,GAA0BQ;AAJ/C,KAMGP,KANH,CADD;AAUA","sourcesContent":["/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useLink } from '../routes/link';\n\nexport default function CategoryItem( {\n\tcount,\n\ticon,\n\tid,\n\tisActive,\n\tlabel,\n\ttype,\n} ) {\n\tconst linkInfo = useLink(\n\t\t{\n\t\t\tpath: '/library',\n\t\t\tcategoryType: type,\n\t\t\tcategoryId: id,\n\t\t},\n\t\t{\n\t\t\t// Keep a record of where we came from in state so we can\n\t\t\t// use the browser's back button to go back to the library.\n\t\t\t// See the implementation of the back button in patterns-list.\n\t\t\tbackPath: '/library',\n\t\t}\n\t);\n\n\tif ( ! count ) {\n\t\treturn;\n\t}\n\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...linkInfo }\n\t\t\ticon={ icon }\n\t\t\tsuffix={ <span>{ count }</span> }\n\t\t\tclassName={ isActive ? 'is-active-category' : undefined }\n\t\t>\n\t\t\t{ label }\n\t\t</SidebarNavigationItem>\n\t);\n}\n"]}
@@ -0,0 +1,87 @@
1
+ import { createElement, Fragment } from "@wordpress/element";
2
+
3
+ /**
4
+ * WordPress dependencies
5
+ */
6
+ import { __experimentalItemGroup as ItemGroup, __experimentalItem as Item } from '@wordpress/components';
7
+ import { useViewportMatch } from '@wordpress/compose';
8
+ import { useSelect } from '@wordpress/data';
9
+ import { getTemplatePartIcon } from '@wordpress/editor';
10
+ import { __ } from '@wordpress/i18n';
11
+ import { getQueryArgs } from '@wordpress/url';
12
+ import { file } from '@wordpress/icons';
13
+ /**
14
+ * Internal dependencies
15
+ */
16
+
17
+ import AddNewPattern from '../add-new-pattern';
18
+ import SidebarNavigationItem from '../sidebar-navigation-item';
19
+ import SidebarNavigationScreen from '../sidebar-navigation-screen';
20
+ import CategoryItem from './category-item';
21
+ import { DEFAULT_CATEGORY, DEFAULT_TYPE } from '../page-library/utils';
22
+ import { store as editSiteStore } from '../../store';
23
+ import usePatternCategories from './use-pattern-categories';
24
+ import useTemplatePartAreas from './use-template-part-areas';
25
+ const templatePartAreaLabels = {
26
+ header: __('Headers'),
27
+ footer: __('Footers'),
28
+ sidebar: __('Sidebar'),
29
+ uncategorized: __('Uncategorized')
30
+ };
31
+ export default function SidebarNavigationScreenLibrary() {
32
+ const isMobileViewport = useViewportMatch('medium', '<');
33
+ const {
34
+ categoryType,
35
+ categoryId
36
+ } = getQueryArgs(window.location.href);
37
+ const currentCategory = categoryId || DEFAULT_CATEGORY;
38
+ const currentType = categoryType || DEFAULT_TYPE;
39
+ const {
40
+ templatePartAreas,
41
+ hasTemplateParts,
42
+ isLoading
43
+ } = useTemplatePartAreas();
44
+ const {
45
+ patternCategories,
46
+ hasPatterns
47
+ } = usePatternCategories();
48
+ const isTemplatePartsMode = useSelect(select => {
49
+ const settings = select(editSiteStore).getSettings();
50
+ return !!settings.supportsTemplatePartsMode;
51
+ }, []);
52
+ return createElement(SidebarNavigationScreen, {
53
+ isRoot: isTemplatePartsMode,
54
+ title: __('Library'),
55
+ description: __('Manage what patterns are available when editing your site.'),
56
+ actions: createElement(AddNewPattern, null),
57
+ footer: createElement(ItemGroup, null, !isMobileViewport && createElement(SidebarNavigationItem, {
58
+ as: "a",
59
+ href: "edit.php?post_type=wp_block",
60
+ withChevron: true
61
+ }, __('Manage all custom patterns'))),
62
+ content: createElement(Fragment, null, isLoading && __('Loading library'), !isLoading && createElement(Fragment, null, !hasTemplateParts && !hasPatterns && createElement(ItemGroup, {
63
+ className: "edit-site-sidebar-navigation-screen-library__group"
64
+ }, createElement(Item, null, __('No template parts or patterns found'))), hasTemplateParts && createElement(ItemGroup, {
65
+ className: "edit-site-sidebar-navigation-screen-library__group"
66
+ }, Object.entries(templatePartAreas).map(([area, parts]) => createElement(CategoryItem, {
67
+ key: area,
68
+ count: parts.length,
69
+ icon: getTemplatePartIcon(area),
70
+ label: templatePartAreaLabels[area],
71
+ id: area,
72
+ type: "wp_template_part",
73
+ isActive: currentCategory === area && currentType === 'wp_template_part'
74
+ }))), hasPatterns && createElement(ItemGroup, {
75
+ className: "edit-site-sidebar-navigation-screen-library__group"
76
+ }, patternCategories.map(category => createElement(CategoryItem, {
77
+ key: category.name,
78
+ count: category.count,
79
+ label: category.label,
80
+ icon: file,
81
+ id: category.name,
82
+ type: "pattern",
83
+ isActive: currentCategory === `${category.name}` && currentType === 'pattern'
84
+ })))))
85
+ });
86
+ }
87
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-library/index.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","useViewportMatch","useSelect","getTemplatePartIcon","__","getQueryArgs","file","AddNewPattern","SidebarNavigationItem","SidebarNavigationScreen","CategoryItem","DEFAULT_CATEGORY","DEFAULT_TYPE","store","editSiteStore","usePatternCategories","useTemplatePartAreas","templatePartAreaLabels","header","footer","sidebar","uncategorized","SidebarNavigationScreenLibrary","isMobileViewport","categoryType","categoryId","window","location","href","currentCategory","currentType","templatePartAreas","hasTemplateParts","isLoading","patternCategories","hasPatterns","isTemplatePartsMode","select","settings","getSettings","supportsTemplatePartsMode","Object","entries","map","area","parts","length","category","name","count","label"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,kBAAkB,IAAIC,IAFvB,QAGO,uBAHP;AAIA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,mBAAT,QAAoC,mBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,IAAT,QAAqB,kBAArB;AAEA;AACA;AACA;;AACA,OAAOC,aAAP,MAA0B,oBAA1B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,SAASC,gBAAT,EAA2BC,YAA3B,QAA+C,uBAA/C;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AAEA,MAAMC,sBAAsB,GAAG;AAC9BC,EAAAA,MAAM,EAAEd,EAAE,CAAE,SAAF,CADoB;AAE9Be,EAAAA,MAAM,EAAEf,EAAE,CAAE,SAAF,CAFoB;AAG9BgB,EAAAA,OAAO,EAAEhB,EAAE,CAAE,SAAF,CAHmB;AAI9BiB,EAAAA,aAAa,EAAEjB,EAAE,CAAE,eAAF;AAJa,CAA/B;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sB,CAAEG,WAAxB,IACD,cAAC,SAAD;AAAW,MAAA,SAAS,EAAC;AAArB,OACC,cAAC,IAAD,QACG/B,EAAE,CACH,qCADG,CADL,CADD,CAFF,EAUG4B,gBAAgB,IACjB,cAAC,SAAD;AAAW,MAAA,SAAS,EAAC;AAArB,OACGS,MAAM,CAACC,OAAP,CAAgBX,iBAAhB,EAAoCY,GAApC,CACD,CAAE,CAAEC,IAAF,EAAQC,KAAR,CAAF,KACC,cAAC,YAAD;AACC,MAAA,GAAG,EAAGD,IADP;AAEC,MAAA,KAAK,EAAGC,KAAK,CAACC,MAFf;AAGC,MAAA,IAAI,EAAG3C,mBAAmB,CACzByC,IADyB,CAH3B;AAMC,MAAA,KAAK,EACJ3B,sBAAsB,CACrB2B,IADqB,CAPxB;AAWC,MAAA,EAAE,EAAGA,IAXN;AAYC,MAAA,IAAI,EAAC,kBAZN;AAaC,MAAA,QAAQ,EACPf,eAAe,KAAKe,IAApB,IACAd,WAAW,KACV;AAhBH,MAFA,CADH,CAXF,EAqCGK,WAAW,IACZ,cAAC,SAAD;AAAW,MAAA,SAAS,EAAC;AAArB,OACGD,iBAAiB,CAACS,GAAlB,CAAyBI,QAAF,IACxB,cAAC,YAAD;AACC,MAAA,GAAG,EAAGA,QAAQ,CAACC,IADhB;AAEC,MAAA,KAAK,EAAGD,QAAQ,CAACE,KAFlB;AAGC,MAAA,KAAK,EAAGF,QAAQ,CAACG,KAHlB;AAIC,MAAA,IAAI,EAAG5C,IAJR;AAKC,MAAA,EAAE,EAAGyC,QAAQ,CAACC,IALf;AAMC,MAAA,IAAI,EAAC,SANN;AAOC,MAAA,QAAQ,EACPnB,eAAe,KACb,GAAGkB,QAAQ,CAACC,IAAM,EADpB,IAEAlB,WAAW,KAAK;AAVlB,MADC,CADH,CAtCF,CAHF;AArBF,IADD;AAuFA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { getQueryArgs } from '@wordpress/url';\nimport { file } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport AddNewPattern from '../add-new-pattern';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport CategoryItem from './category-item';\nimport { DEFAULT_CATEGORY, DEFAULT_TYPE } from '../page-library/utils';\nimport { store as editSiteStore } from '../../store';\nimport usePatternCategories from './use-pattern-categories';\nimport useTemplatePartAreas from './use-template-part-areas';\n\nconst templatePartAreaLabels = {\n\theader: __( 'Headers' ),\n\tfooter: __( 'Footers' ),\n\tsidebar: __( 'Sidebar' ),\n\tuncategorized: __( 'Uncategorized' ),\n};\n\nexport default function SidebarNavigationScreenLibrary() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { categoryType, categoryId } = getQueryArgs( window.location.href );\n\tconst currentCategory = categoryId || DEFAULT_CATEGORY;\n\tconst currentType = categoryType || DEFAULT_TYPE;\n\n\tconst { templatePartAreas, hasTemplateParts, isLoading } =\n\t\tuseTemplatePartAreas();\n\tconst { patternCategories, hasPatterns } = usePatternCategories();\n\n\tconst isTemplatePartsMode = useSelect( ( select ) => {\n\t\tconst settings = select( editSiteStore ).getSettings();\n\t\treturn !! settings.supportsTemplatePartsMode;\n\t}, [] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot={ isTemplatePartsMode }\n\t\t\ttitle={ __( 'Library' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing your site.'\n\t\t\t) }\n\t\t\tactions={ <AddNewPattern /> }\n\t\t\tfooter={\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tas=\"a\"\n\t\t\t\t\t\t\thref=\"edit.php?post_type=wp_block\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Manage all custom patterns' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t) }\n\t\t\t\t</ItemGroup>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading library' ) }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! hasTemplateParts && ! hasPatterns && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-library__group\">\n\t\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'No template parts or patterns found'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ hasTemplateParts && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-library__group\">\n\t\t\t\t\t\t\t\t\t{ Object.entries( templatePartAreas ).map(\n\t\t\t\t\t\t\t\t\t\t( [ area, parts ] ) => (\n\t\t\t\t\t\t\t\t\t\t\t<CategoryItem\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ area }\n\t\t\t\t\t\t\t\t\t\t\t\tcount={ parts.length }\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ getTemplatePartIcon(\n\t\t\t\t\t\t\t\t\t\t\t\t\tarea\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\t\t\ttemplatePartAreaLabels[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarea\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tid={ area }\n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"wp_template_part\"\n\t\t\t\t\t\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t\t\t\t\t\tcurrentCategory === area &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tcurrentType ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'wp_template_part'\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ hasPatterns && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-library__group\">\n\t\t\t\t\t\t\t\t\t{ patternCategories.map( ( category ) => (\n\t\t\t\t\t\t\t\t\t\t<CategoryItem\n\t\t\t\t\t\t\t\t\t\t\tkey={ category.name }\n\t\t\t\t\t\t\t\t\t\t\tcount={ category.count }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ category.label }\n\t\t\t\t\t\t\t\t\t\t\ticon={ file }\n\t\t\t\t\t\t\t\t\t\t\tid={ category.name }\n\t\t\t\t\t\t\t\t\t\t\ttype=\"pattern\"\n\t\t\t\t\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t\t\t\t\tcurrentCategory ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t`${ category.name }` &&\n\t\t\t\t\t\t\t\t\t\t\t\tcurrentType === 'pattern'\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store as coreStore } from '@wordpress/core-data';
5
+ import { useSelect } from '@wordpress/data';
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+
10
+ import { unlock } from '../../lock-unlock';
11
+ import { store as editSiteStore } from '../../store';
12
+ export default function useDefaultPatternCategories() {
13
+ const blockPatternCategories = useSelect(select => {
14
+ var _settings$__experimen;
15
+
16
+ const {
17
+ getSettings
18
+ } = unlock(select(editSiteStore));
19
+ const settings = getSettings();
20
+ return (_settings$__experimen = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatternCategories;
21
+ });
22
+ const restBlockPatternCategories = useSelect(select => select(coreStore).getBlockPatternCategories());
23
+ return [...(blockPatternCategories || []), ...(restBlockPatternCategories || [])];
24
+ }
25
+ //# sourceMappingURL=use-default-pattern-categories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-library/use-default-pattern-categories.js"],"names":["store","coreStore","useSelect","unlock","editSiteStore","useDefaultPatternCategories","blockPatternCategories","select","getSettings","settings","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","restBlockPatternCategories","getBlockPatternCategories"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,SAASH,KAAK,IAAII,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,2BAAT,GAAuC;AACrD,QAAMC,sBAAsB,GAAGJ,SAAS,CAAIK,MAAF,IAAc;AAAA;;AACvD,UAAM;AAAEC,MAAAA;AAAF,QAAkBL,MAAM,CAAEI,MAAM,CAAEH,aAAF,CAAR,CAA9B;AACA,UAAMK,QAAQ,GAAGD,WAAW,EAA5B;AAEA,oCACCC,QAAQ,CAACC,8CADV,yEAECD,QAAQ,CAACE,oCAFV;AAIA,GARuC,CAAxC;AAUA,QAAMC,0BAA0B,GAAGV,SAAS,CAAIK,MAAF,IAC7CA,MAAM,CAAEN,SAAF,CAAN,CAAoBY,yBAApB,EAD2C,CAA5C;AAIA,SAAO,CACN,IAAKP,sBAAsB,IAAI,EAA/B,CADM,EAEN,IAAKM,0BAA0B,IAAI,EAAnC,CAFM,CAAP;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nexport default function useDefaultPatternCategories() {\n\tconst blockPatternCategories = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\tconst settings = getSettings();\n\n\t\treturn (\n\t\t\tsettings.__experimentalAdditionalBlockPatternCategories ??\n\t\t\tsettings.__experimentalBlockPatternCategories\n\t\t);\n\t} );\n\n\tconst restBlockPatternCategories = useSelect( ( select ) =>\n\t\tselect( coreStore ).getBlockPatternCategories()\n\t);\n\n\treturn [\n\t\t...( blockPatternCategories || [] ),\n\t\t...( restBlockPatternCategories || [] ),\n\t];\n}\n"]}