@wordpress/edit-site 5.13.0 → 5.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (646) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-page/index.js +2 -13
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +29 -15
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +2 -2
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +69 -14
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/add-new-template/utils.js +10 -8
  11. package/build/components/add-new-template/utils.js.map +1 -1
  12. package/build/components/block-editor/constants.js +1 -1
  13. package/build/components/block-editor/constants.js.map +1 -1
  14. package/build/components/block-editor/editor-canvas.js +1 -1
  15. package/build/components/block-editor/editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/index.js +0 -4
  17. package/build/components/block-editor/index.js.map +1 -1
  18. package/build/components/block-editor/inserter-media-categories.js +1 -22
  19. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  20. package/build/components/block-editor/site-editor-canvas.js +29 -32
  21. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  22. package/build/components/block-editor/use-site-editor-settings.js +90 -19
  23. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  24. package/build/components/canvas-spinner/index.js +1 -18
  25. package/build/components/canvas-spinner/index.js.map +1 -1
  26. package/build/components/code-editor/index.js +60 -28
  27. package/build/components/code-editor/index.js.map +1 -1
  28. package/build/components/create-pattern-modal/index.js +15 -11
  29. package/build/components/create-pattern-modal/index.js.map +1 -1
  30. package/build/components/create-template-part-modal/index.js +1 -1
  31. package/build/components/create-template-part-modal/index.js.map +1 -1
  32. package/build/components/editor/index.js +11 -1
  33. package/build/components/editor/index.js.map +1 -1
  34. package/build/components/global-styles/palette.js +1 -1
  35. package/build/components/global-styles/palette.js.map +1 -1
  36. package/build/components/global-styles/ui.js +7 -2
  37. package/build/components/global-styles/ui.js.map +1 -1
  38. package/build/components/header-edit-mode/document-actions/index.js +9 -1
  39. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  40. package/build/components/header-edit-mode/index.js +49 -14
  41. package/build/components/header-edit-mode/index.js.map +1 -1
  42. package/build/components/header-edit-mode/more-menu/index.js +47 -17
  43. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  44. package/build/components/keyboard-shortcut-help-modal/index.js +17 -4
  45. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  46. package/build/components/keyboard-shortcuts/edit-mode.js +32 -1
  47. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  48. package/build/components/keyboard-shortcuts/register.js +9 -0
  49. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  50. package/build/components/layout/index.js +110 -28
  51. package/build/components/layout/index.js.map +1 -1
  52. package/build/components/page/header.js +1 -1
  53. package/build/components/page/header.js.map +1 -1
  54. package/build/components/page/index.js +3 -1
  55. package/build/components/page/index.js.map +1 -1
  56. package/build/components/page-actions/index.js +2 -2
  57. package/build/components/page-actions/index.js.map +1 -1
  58. package/build/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -15
  59. package/build/components/page-actions/trash-page-menu-item.js.map +1 -0
  60. package/build/components/page-content-focus-manager/back-to-page-notification.js +9 -3
  61. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
  62. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -5
  63. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  64. package/build/components/page-main/index.js +8 -4
  65. package/build/components/page-main/index.js.map +1 -1
  66. package/build/components/page-patterns/duplicate-menu-item.js +163 -0
  67. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -0
  68. package/build/components/page-patterns/grid-item.js +218 -0
  69. package/build/components/page-patterns/grid-item.js.map +1 -0
  70. package/build/components/{page-library → page-patterns}/grid.js +6 -19
  71. package/build/components/page-patterns/grid.js.map +1 -0
  72. package/build/components/page-patterns/header.js +69 -0
  73. package/build/components/page-patterns/header.js.map +1 -0
  74. package/build/components/{page-library → page-patterns}/index.js +9 -7
  75. package/build/components/page-patterns/index.js.map +1 -0
  76. package/build/components/{page-library → page-patterns}/no-patterns.js +1 -1
  77. package/build/components/page-patterns/no-patterns.js.map +1 -0
  78. package/build/components/page-patterns/pagination.js +63 -0
  79. package/build/components/page-patterns/pagination.js.map +1 -0
  80. package/build/components/page-patterns/patterns-list.js +175 -0
  81. package/build/components/page-patterns/patterns-list.js.map +1 -0
  82. package/build/components/page-patterns/rename-menu-item.js +109 -0
  83. package/build/components/page-patterns/rename-menu-item.js.map +1 -0
  84. package/build/components/page-patterns/search-items.js.map +1 -0
  85. package/build/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +3 -3
  86. package/build/components/page-patterns/use-pattern-settings.js.map +1 -0
  87. package/build/components/page-patterns/use-patterns.js +185 -0
  88. package/build/components/page-patterns/use-patterns.js.map +1 -0
  89. package/build/components/{page-library → page-patterns}/utils.js +3 -3
  90. package/build/components/page-patterns/utils.js.map +1 -0
  91. package/build/components/page-template-parts/add-new-template-part.js +74 -0
  92. package/build/components/page-template-parts/add-new-template-part.js.map +1 -0
  93. package/build/components/page-template-parts/index.js +82 -0
  94. package/build/components/page-template-parts/index.js.map +1 -0
  95. package/build/components/page-templates/index.js +1 -0
  96. package/build/components/page-templates/index.js.map +1 -1
  97. package/build/components/preferences-modal/enable-feature.js +5 -1
  98. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  99. package/build/components/preferences-modal/index.js +43 -4
  100. package/build/components/preferences-modal/index.js.map +1 -1
  101. package/build/components/resizable-frame/index.js +78 -36
  102. package/build/components/resizable-frame/index.js.map +1 -1
  103. package/build/components/save-panel/index.js +5 -5
  104. package/build/components/save-panel/index.js.map +1 -1
  105. package/build/components/sidebar/index.js +6 -6
  106. package/build/components/sidebar/index.js.map +1 -1
  107. package/build/components/sidebar-edit-mode/index.js +4 -2
  108. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  109. package/build/components/sidebar-edit-mode/page-panels/page-content.js +4 -3
  110. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  111. package/build/components/sidebar-edit-mode/page-panels/page-status.js +3 -8
  112. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  113. package/build/components/sidebar-edit-mode/settings-header/index.js +7 -1
  114. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  115. package/build/components/sidebar-navigation-screen/index.js +21 -11
  116. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  117. package/build/components/sidebar-navigation-screen-global-styles/index.js +69 -5
  118. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  119. package/build/components/sidebar-navigation-screen-main/index.js +5 -3
  120. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  121. package/build/components/sidebar-navigation-screen-main/template-part-hint.js +45 -0
  122. package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
  123. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +7 -16
  124. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  125. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -11
  126. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  127. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -10
  128. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  129. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  130. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  131. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +10 -1
  132. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  133. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +9 -3
  134. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  135. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +9 -4
  136. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  137. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +29 -0
  138. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
  139. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  140. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  141. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +27 -4
  142. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  143. package/build/components/sidebar-navigation-screen-page/index.js +2 -3
  144. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  145. package/build/components/sidebar-navigation-screen-page/page-details.js +11 -4
  146. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  147. package/build/components/sidebar-navigation-screen-page/status-label.js +2 -35
  148. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  149. package/build/components/sidebar-navigation-screen-pages/index.js +33 -25
  150. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  151. package/build/components/sidebar-navigation-screen-pattern/index.js +20 -13
  152. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  153. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
  154. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  155. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -2
  156. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  157. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +11 -3
  158. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  159. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +28 -2
  160. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  161. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  162. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
  163. package/build/components/sidebar-navigation-screen-patterns/index.js +173 -0
  164. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
  165. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
  166. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +34 -0
  167. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
  168. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +11 -19
  169. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
  170. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +52 -0
  171. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
  172. package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +2 -2
  173. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
  174. package/build/components/sidebar-navigation-screen-templates/index.js +11 -63
  175. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  176. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
  177. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  178. package/build/components/site-hub/index.js +25 -12
  179. package/build/components/site-hub/index.js.map +1 -1
  180. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -5
  181. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  182. package/build/components/sync-state-with-url/use-sync-path-with-url.js +16 -13
  183. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  184. package/build/components/template-actions/index.js +25 -7
  185. package/build/components/template-actions/index.js.map +1 -1
  186. package/build/components/template-actions/rename-menu-item.js +12 -8
  187. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  188. package/build/components/use-edited-entity-record/index.js +6 -1
  189. package/build/components/use-edited-entity-record/index.js.map +1 -1
  190. package/build/components/welcome-guide/editor.js +1 -1
  191. package/build/components/welcome-guide/editor.js.map +1 -1
  192. package/build/components/welcome-guide/index.js +5 -1
  193. package/build/components/welcome-guide/index.js.map +1 -1
  194. package/build/components/welcome-guide/page.js +70 -0
  195. package/build/components/welcome-guide/page.js.map +1 -0
  196. package/build/components/welcome-guide/styles.js +1 -1
  197. package/build/components/welcome-guide/styles.js.map +1 -1
  198. package/build/components/welcome-guide/template.js +71 -0
  199. package/build/components/welcome-guide/template.js.map +1 -0
  200. package/build/hooks/commands/use-common-commands.js +115 -20
  201. package/build/hooks/commands/use-common-commands.js.map +1 -1
  202. package/build/hooks/commands/use-edit-mode-commands.js +195 -44
  203. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  204. package/build/hooks/push-changes-to-global-styles/index.js +56 -10
  205. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  206. package/build/index.js +9 -0
  207. package/build/index.js.map +1 -1
  208. package/build/store/actions.js +5 -2
  209. package/build/store/actions.js.map +1 -1
  210. package/build/store/private-actions.js +7 -1
  211. package/build/store/private-actions.js.map +1 -1
  212. package/build/store/selectors.js +2 -1
  213. package/build/store/selectors.js.map +1 -1
  214. package/build/utils/get-is-list-page.js +2 -2
  215. package/build/utils/get-is-list-page.js.map +1 -1
  216. package/build/utils/normalize-record-key.js +19 -0
  217. package/build/utils/normalize-record-key.js.map +1 -0
  218. package/build/utils/template-part-create.js +2 -2
  219. package/build/utils/template-part-create.js.map +1 -1
  220. package/build/utils/use-activate-theme.js +1 -1
  221. package/build/utils/use-activate-theme.js.map +1 -1
  222. package/build-module/components/add-new-page/index.js +2 -12
  223. package/build-module/components/add-new-page/index.js.map +1 -1
  224. package/build-module/components/add-new-pattern/index.js +28 -16
  225. package/build-module/components/add-new-pattern/index.js.map +1 -1
  226. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  227. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  228. package/build-module/components/add-new-template/new-template.js +72 -17
  229. package/build-module/components/add-new-template/new-template.js.map +1 -1
  230. package/build-module/components/add-new-template/utils.js +9 -6
  231. package/build-module/components/add-new-template/utils.js.map +1 -1
  232. package/build-module/components/block-editor/constants.js +1 -1
  233. package/build-module/components/block-editor/constants.js.map +1 -1
  234. package/build-module/components/block-editor/editor-canvas.js +1 -1
  235. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  236. package/build-module/components/block-editor/index.js +0 -4
  237. package/build-module/components/block-editor/index.js.map +1 -1
  238. package/build-module/components/block-editor/inserter-media-categories.js +1 -22
  239. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
  240. package/build-module/components/block-editor/site-editor-canvas.js +29 -32
  241. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  242. package/build-module/components/block-editor/use-site-editor-settings.js +92 -20
  243. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  244. package/build-module/components/canvas-spinner/index.js +1 -15
  245. package/build-module/components/canvas-spinner/index.js.map +1 -1
  246. package/build-module/components/code-editor/index.js +62 -30
  247. package/build-module/components/code-editor/index.js.map +1 -1
  248. package/build-module/components/create-pattern-modal/index.js +14 -11
  249. package/build-module/components/create-pattern-modal/index.js.map +1 -1
  250. package/build-module/components/create-template-part-modal/index.js +1 -1
  251. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  252. package/build-module/components/editor/index.js +11 -1
  253. package/build-module/components/editor/index.js.map +1 -1
  254. package/build-module/components/global-styles/palette.js +1 -1
  255. package/build-module/components/global-styles/palette.js.map +1 -1
  256. package/build-module/components/global-styles/ui.js +8 -3
  257. package/build-module/components/global-styles/ui.js.map +1 -1
  258. package/build-module/components/header-edit-mode/document-actions/index.js +10 -2
  259. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  260. package/build-module/components/header-edit-mode/index.js +51 -16
  261. package/build-module/components/header-edit-mode/index.js.map +1 -1
  262. package/build-module/components/header-edit-mode/more-menu/index.js +44 -20
  263. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  264. package/build-module/components/keyboard-shortcut-help-modal/index.js +15 -6
  265. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  266. package/build-module/components/keyboard-shortcuts/edit-mode.js +29 -1
  267. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  268. package/build-module/components/keyboard-shortcuts/register.js +9 -0
  269. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  270. package/build-module/components/layout/index.js +110 -28
  271. package/build-module/components/layout/index.js.map +1 -1
  272. package/build-module/components/page/header.js +1 -1
  273. package/build-module/components/page/header.js.map +1 -1
  274. package/build-module/components/page/index.js +2 -1
  275. package/build-module/components/page/index.js.map +1 -1
  276. package/build-module/components/page-actions/index.js +2 -2
  277. package/build-module/components/page-actions/index.js.map +1 -1
  278. package/build-module/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -16
  279. package/build-module/components/page-actions/trash-page-menu-item.js.map +1 -0
  280. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +9 -3
  281. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
  282. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -3
  283. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  284. package/build-module/components/page-main/index.js +6 -3
  285. package/build-module/components/page-main/index.js.map +1 -1
  286. package/build-module/components/page-patterns/duplicate-menu-item.js +147 -0
  287. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -0
  288. package/build-module/components/page-patterns/grid-item.js +195 -0
  289. package/build-module/components/page-patterns/grid-item.js.map +1 -0
  290. package/build-module/components/page-patterns/grid.js +26 -0
  291. package/build-module/components/page-patterns/grid.js.map +1 -0
  292. package/build-module/components/page-patterns/header.js +54 -0
  293. package/build-module/components/page-patterns/header.js.map +1 -0
  294. package/build-module/components/{page-library → page-patterns}/index.js +8 -6
  295. package/build-module/components/page-patterns/index.js.map +1 -0
  296. package/build-module/components/{page-library → page-patterns}/no-patterns.js +1 -1
  297. package/build-module/components/page-patterns/no-patterns.js.map +1 -0
  298. package/build-module/components/page-patterns/pagination.js +54 -0
  299. package/build-module/components/page-patterns/pagination.js.map +1 -0
  300. package/build-module/components/page-patterns/patterns-list.js +152 -0
  301. package/build-module/components/page-patterns/patterns-list.js.map +1 -0
  302. package/build-module/components/page-patterns/rename-menu-item.js +97 -0
  303. package/build-module/components/page-patterns/rename-menu-item.js.map +1 -0
  304. package/build-module/components/page-patterns/search-items.js.map +1 -0
  305. package/build-module/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +2 -2
  306. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -0
  307. package/build-module/components/page-patterns/use-patterns.js +167 -0
  308. package/build-module/components/page-patterns/use-patterns.js.map +1 -0
  309. package/build-module/components/{page-library → page-patterns}/utils.js +3 -3
  310. package/build-module/components/page-patterns/utils.js.map +1 -0
  311. package/build-module/components/page-template-parts/add-new-template-part.js +58 -0
  312. package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -0
  313. package/build-module/components/page-template-parts/index.js +63 -0
  314. package/build-module/components/page-template-parts/index.js.map +1 -0
  315. package/build-module/components/page-templates/index.js +1 -0
  316. package/build-module/components/page-templates/index.js.map +1 -1
  317. package/build-module/components/preferences-modal/enable-feature.js +5 -1
  318. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  319. package/build-module/components/preferences-modal/index.js +38 -5
  320. package/build-module/components/preferences-modal/index.js.map +1 -1
  321. package/build-module/components/resizable-frame/index.js +79 -39
  322. package/build-module/components/resizable-frame/index.js.map +1 -1
  323. package/build-module/components/save-panel/index.js +5 -5
  324. package/build-module/components/save-panel/index.js.map +1 -1
  325. package/build-module/components/sidebar/index.js +5 -5
  326. package/build-module/components/sidebar/index.js.map +1 -1
  327. package/build-module/components/sidebar-edit-mode/index.js +4 -2
  328. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  329. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +5 -2
  330. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  331. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +3 -8
  332. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  333. package/build-module/components/sidebar-edit-mode/settings-header/index.js +6 -1
  334. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  335. package/build-module/components/sidebar-navigation-screen/index.js +22 -12
  336. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  337. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +67 -5
  338. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  339. package/build-module/components/sidebar-navigation-screen-main/index.js +5 -4
  340. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  341. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +33 -0
  342. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
  343. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +8 -17
  344. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  345. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -9
  346. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  347. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +9 -10
  348. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  349. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  350. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  351. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +11 -1
  352. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  353. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +8 -4
  354. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  355. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +9 -4
  356. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  357. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +20 -0
  358. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
  359. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  360. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  361. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +26 -6
  362. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  363. package/build-module/components/sidebar-navigation-screen-page/index.js +2 -3
  364. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  365. package/build-module/components/sidebar-navigation-screen-page/page-details.js +11 -4
  366. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  367. package/build-module/components/sidebar-navigation-screen-page/status-label.js +2 -33
  368. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  369. package/build-module/components/sidebar-navigation-screen-pages/index.js +34 -26
  370. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  371. package/build-module/components/sidebar-navigation-screen-pattern/index.js +18 -12
  372. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  373. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
  374. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  375. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -2
  376. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  377. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +11 -3
  378. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  379. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +25 -2
  380. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  381. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  382. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
  383. package/build-module/components/sidebar-navigation-screen-patterns/index.js +148 -0
  384. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
  385. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
  386. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +24 -0
  387. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
  388. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +11 -17
  389. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
  390. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +43 -0
  391. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
  392. package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +2 -2
  393. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
  394. package/build-module/components/sidebar-navigation-screen-templates/index.js +12 -62
  395. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  396. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
  397. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  398. package/build-module/components/site-hub/index.js +25 -12
  399. package/build-module/components/site-hub/index.js.map +1 -1
  400. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +7 -5
  401. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  402. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +17 -13
  403. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  404. package/build-module/components/template-actions/index.js +26 -8
  405. package/build-module/components/template-actions/index.js.map +1 -1
  406. package/build-module/components/template-actions/rename-menu-item.js +11 -8
  407. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  408. package/build-module/components/use-edited-entity-record/index.js +3 -1
  409. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  410. package/build-module/components/welcome-guide/editor.js +1 -1
  411. package/build-module/components/welcome-guide/editor.js.map +1 -1
  412. package/build-module/components/welcome-guide/index.js +3 -1
  413. package/build-module/components/welcome-guide/index.js.map +1 -1
  414. package/build-module/components/welcome-guide/page.js +59 -0
  415. package/build-module/components/welcome-guide/page.js.map +1 -0
  416. package/build-module/components/welcome-guide/styles.js +1 -1
  417. package/build-module/components/welcome-guide/styles.js.map +1 -1
  418. package/build-module/components/welcome-guide/template.js +60 -0
  419. package/build-module/components/welcome-guide/template.js.map +1 -0
  420. package/build-module/hooks/commands/use-common-commands.js +111 -21
  421. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  422. package/build-module/hooks/commands/use-edit-mode-commands.js +193 -46
  423. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  424. package/build-module/hooks/push-changes-to-global-styles/index.js +57 -10
  425. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  426. package/build-module/index.js +4 -0
  427. package/build-module/index.js.map +1 -1
  428. package/build-module/store/actions.js +5 -2
  429. package/build-module/store/actions.js.map +1 -1
  430. package/build-module/store/private-actions.js +7 -1
  431. package/build-module/store/private-actions.js.map +1 -1
  432. package/build-module/store/selectors.js +2 -1
  433. package/build-module/store/selectors.js.map +1 -1
  434. package/build-module/utils/get-is-list-page.js +2 -2
  435. package/build-module/utils/get-is-list-page.js.map +1 -1
  436. package/build-module/utils/normalize-record-key.js +12 -0
  437. package/build-module/utils/normalize-record-key.js.map +1 -0
  438. package/build-module/utils/template-part-create.js +1 -1
  439. package/build-module/utils/template-part-create.js.map +1 -1
  440. package/build-module/utils/use-activate-theme.js +1 -1
  441. package/build-module/utils/use-activate-theme.js.map +1 -1
  442. package/build-style/style-rtl.css +383 -109
  443. package/build-style/style.css +383 -109
  444. package/package.json +39 -40
  445. package/src/components/add-new-page/index.js +1 -9
  446. package/src/components/add-new-pattern/index.js +30 -21
  447. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  448. package/src/components/add-new-template/new-template.js +120 -24
  449. package/src/components/add-new-template/style.scss +30 -2
  450. package/src/components/add-new-template/utils.js +9 -6
  451. package/src/components/block-editor/constants.js +5 -1
  452. package/src/components/block-editor/editor-canvas.js +3 -1
  453. package/src/components/block-editor/index.js +0 -4
  454. package/src/components/block-editor/inserter-media-categories.js +1 -21
  455. package/src/components/block-editor/site-editor-canvas.js +7 -1
  456. package/src/components/block-editor/use-site-editor-settings.js +100 -25
  457. package/src/components/canvas-spinner/index.js +1 -11
  458. package/src/components/canvas-spinner/style.scss +18 -0
  459. package/src/components/code-editor/index.js +51 -33
  460. package/src/components/create-pattern-modal/index.js +15 -13
  461. package/src/components/create-template-part-modal/index.js +1 -1
  462. package/src/components/editor/index.js +16 -1
  463. package/src/components/editor/style.scss +4 -0
  464. package/src/components/global-styles/palette.js +10 -9
  465. package/src/components/global-styles/stories/index.js +1 -0
  466. package/src/components/global-styles/ui.js +34 -24
  467. package/src/components/header-edit-mode/document-actions/index.js +9 -1
  468. package/src/components/header-edit-mode/document-actions/style.scss +12 -0
  469. package/src/components/header-edit-mode/index.js +136 -79
  470. package/src/components/header-edit-mode/more-menu/index.js +74 -30
  471. package/src/components/keyboard-shortcut-help-modal/index.js +21 -7
  472. package/src/components/keyboard-shortcuts/edit-mode.js +35 -2
  473. package/src/components/keyboard-shortcuts/register.js +10 -0
  474. package/src/components/layout/index.js +156 -78
  475. package/src/components/layout/style.scss +49 -2
  476. package/src/components/page/header.js +1 -1
  477. package/src/components/page/index.js +5 -1
  478. package/src/components/page-actions/index.js +2 -2
  479. package/src/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +9 -21
  480. package/src/components/page-content-focus-manager/back-to-page-notification.js +7 -2
  481. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +12 -3
  482. package/src/components/page-main/index.js +6 -3
  483. package/src/components/page-patterns/duplicate-menu-item.js +196 -0
  484. package/src/components/page-patterns/grid-item.js +284 -0
  485. package/src/components/page-patterns/grid.js +22 -0
  486. package/src/components/page-patterns/header.js +69 -0
  487. package/src/components/{page-library → page-patterns}/index.js +11 -6
  488. package/src/components/{page-library → page-patterns}/no-patterns.js +1 -1
  489. package/src/components/page-patterns/pagination.js +80 -0
  490. package/src/components/page-patterns/patterns-list.js +206 -0
  491. package/src/components/page-patterns/rename-menu-item.js +115 -0
  492. package/src/components/page-patterns/style.scss +219 -0
  493. package/src/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +1 -1
  494. package/src/components/page-patterns/use-patterns.js +177 -0
  495. package/src/components/{page-library → page-patterns}/utils.js +3 -3
  496. package/src/components/page-template-parts/add-new-template-part.js +57 -0
  497. package/src/components/page-template-parts/index.js +86 -0
  498. package/src/components/page-templates/index.js +1 -1
  499. package/src/components/preferences-modal/enable-feature.js +5 -2
  500. package/src/components/preferences-modal/index.js +35 -4
  501. package/src/components/resizable-frame/index.js +102 -34
  502. package/src/components/resizable-frame/style.scss +9 -9
  503. package/src/components/save-panel/index.js +10 -4
  504. package/src/components/sidebar/index.js +6 -6
  505. package/src/components/sidebar-button/style.scss +1 -1
  506. package/src/components/sidebar-edit-mode/index.js +4 -2
  507. package/src/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  508. package/src/components/sidebar-edit-mode/page-panels/page-status.js +2 -5
  509. package/src/components/sidebar-edit-mode/settings-header/index.js +7 -2
  510. package/src/components/sidebar-navigation-item/style.scss +7 -13
  511. package/src/components/sidebar-navigation-screen/index.js +18 -9
  512. package/src/components/sidebar-navigation-screen/style.scss +21 -2
  513. package/src/components/sidebar-navigation-screen-details-panel/style.scss +1 -1
  514. package/src/components/sidebar-navigation-screen-global-styles/index.js +57 -17
  515. package/src/components/sidebar-navigation-screen-main/index.js +44 -40
  516. package/src/components/sidebar-navigation-screen-main/template-part-hint.js +34 -0
  517. package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +14 -35
  518. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +8 -11
  519. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +13 -11
  520. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
  521. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +12 -1
  522. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +16 -7
  523. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -7
  524. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -6
  525. package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +24 -0
  526. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
  527. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +39 -8
  528. package/src/components/sidebar-navigation-screen-page/index.js +3 -3
  529. package/src/components/sidebar-navigation-screen-page/page-details.js +8 -3
  530. package/src/components/sidebar-navigation-screen-page/status-label.js +2 -36
  531. package/src/components/sidebar-navigation-screen-pages/index.js +40 -30
  532. package/src/components/sidebar-navigation-screen-pattern/index.js +18 -8
  533. package/src/components/sidebar-navigation-screen-pattern/style.scss +29 -0
  534. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +3 -2
  535. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +2 -1
  536. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +12 -2
  537. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +48 -3
  538. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
  539. package/src/components/sidebar-navigation-screen-patterns/index.js +194 -0
  540. package/src/components/sidebar-navigation-screen-patterns/style.scss +23 -0
  541. package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +24 -0
  542. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +9 -17
  543. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +55 -0
  544. package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +3 -2
  545. package/src/components/sidebar-navigation-screen-template/style.scss +15 -15
  546. package/src/components/sidebar-navigation-screen-templates/index.js +15 -82
  547. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -0
  548. package/src/components/site-hub/index.js +46 -29
  549. package/src/components/site-hub/style.scss +17 -3
  550. package/src/components/start-template-options/style.scss +0 -3
  551. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
  552. package/src/components/sync-state-with-url/use-sync-path-with-url.js +73 -66
  553. package/src/components/template-actions/index.js +40 -9
  554. package/src/components/template-actions/rename-menu-item.js +17 -10
  555. package/src/components/use-edited-entity-record/index.js +6 -1
  556. package/src/components/welcome-guide/editor.js +1 -1
  557. package/src/components/welcome-guide/index.js +4 -0
  558. package/src/components/welcome-guide/page.js +75 -0
  559. package/src/components/welcome-guide/style.scss +15 -1
  560. package/src/components/welcome-guide/styles.js +1 -1
  561. package/src/components/welcome-guide/template.js +82 -0
  562. package/src/hooks/commands/use-common-commands.js +88 -24
  563. package/src/hooks/commands/use-edit-mode-commands.js +182 -38
  564. package/src/hooks/push-changes-to-global-styles/index.js +63 -9
  565. package/src/index.js +4 -0
  566. package/src/store/actions.js +8 -1
  567. package/src/store/private-actions.js +5 -1
  568. package/src/store/selectors.js +5 -0
  569. package/src/store/test/selectors.js +2 -0
  570. package/src/style.scss +13 -14
  571. package/src/utils/get-is-list-page.js +4 -3
  572. package/src/utils/normalize-record-key.js +11 -0
  573. package/src/utils/template-part-create.js +1 -1
  574. package/src/utils/use-activate-theme.js +1 -1
  575. package/build/components/code-editor/code-editor-text-area.js +0 -96
  576. package/build/components/code-editor/code-editor-text-area.js.map +0 -1
  577. package/build/components/keyboard-shortcuts/index.js +0 -148
  578. package/build/components/keyboard-shortcuts/index.js.map +0 -1
  579. package/build/components/page-actions/delete-page-menu-item.js.map +0 -1
  580. package/build/components/page-content-focus-manager/constants.js +0 -9
  581. package/build/components/page-content-focus-manager/constants.js.map +0 -1
  582. package/build/components/page-library/grid-item.js +0 -165
  583. package/build/components/page-library/grid-item.js.map +0 -1
  584. package/build/components/page-library/grid.js.map +0 -1
  585. package/build/components/page-library/index.js.map +0 -1
  586. package/build/components/page-library/no-patterns.js.map +0 -1
  587. package/build/components/page-library/patterns-list.js +0 -108
  588. package/build/components/page-library/patterns-list.js.map +0 -1
  589. package/build/components/page-library/search-items.js.map +0 -1
  590. package/build/components/page-library/use-library-settings.js.map +0 -1
  591. package/build/components/page-library/use-patterns.js +0 -194
  592. package/build/components/page-library/use-patterns.js.map +0 -1
  593. package/build/components/page-library/utils.js.map +0 -1
  594. package/build/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
  595. package/build/components/sidebar-navigation-screen-library/index.js +0 -112
  596. package/build/components/sidebar-navigation-screen-library/index.js.map +0 -1
  597. package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
  598. package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
  599. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -41
  600. package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
  601. package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
  602. package/build-module/components/code-editor/code-editor-text-area.js +0 -84
  603. package/build-module/components/code-editor/code-editor-text-area.js.map +0 -1
  604. package/build-module/components/keyboard-shortcuts/index.js +0 -132
  605. package/build-module/components/keyboard-shortcuts/index.js.map +0 -1
  606. package/build-module/components/page-actions/delete-page-menu-item.js.map +0 -1
  607. package/build-module/components/page-content-focus-manager/constants.js +0 -2
  608. package/build-module/components/page-content-focus-manager/constants.js.map +0 -1
  609. package/build-module/components/page-library/grid-item.js +0 -145
  610. package/build-module/components/page-library/grid-item.js.map +0 -1
  611. package/build-module/components/page-library/grid.js +0 -38
  612. package/build-module/components/page-library/grid.js.map +0 -1
  613. package/build-module/components/page-library/index.js.map +0 -1
  614. package/build-module/components/page-library/no-patterns.js.map +0 -1
  615. package/build-module/components/page-library/patterns-list.js +0 -87
  616. package/build-module/components/page-library/patterns-list.js.map +0 -1
  617. package/build-module/components/page-library/search-items.js.map +0 -1
  618. package/build-module/components/page-library/use-library-settings.js.map +0 -1
  619. package/build-module/components/page-library/use-patterns.js +0 -176
  620. package/build-module/components/page-library/use-patterns.js.map +0 -1
  621. package/build-module/components/page-library/utils.js.map +0 -1
  622. package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
  623. package/build-module/components/sidebar-navigation-screen-library/index.js +0 -87
  624. package/build-module/components/sidebar-navigation-screen-library/index.js.map +0 -1
  625. package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
  626. package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
  627. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -34
  628. package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
  629. package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
  630. package/src/components/code-editor/code-editor-text-area.js +0 -84
  631. package/src/components/keyboard-shortcuts/index.js +0 -137
  632. package/src/components/page-content-focus-manager/constants.js +0 -5
  633. package/src/components/page-library/grid-item.js +0 -179
  634. package/src/components/page-library/grid.js +0 -39
  635. package/src/components/page-library/patterns-list.js +0 -114
  636. package/src/components/page-library/style.scss +0 -105
  637. package/src/components/page-library/use-patterns.js +0 -238
  638. package/src/components/sidebar-navigation-screen-library/index.js +0 -136
  639. package/src/components/sidebar-navigation-screen-library/style.scss +0 -7
  640. package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -33
  641. /package/build/components/{page-library → page-patterns}/search-items.js +0 -0
  642. /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  643. /package/build-module/components/{page-library → page-patterns}/search-items.js +0 -0
  644. /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
  645. /package/src/components/{page-library → page-patterns}/search-items.js +0 -0
  646. /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
@@ -58,11 +58,11 @@ const EntitiesSavedStatesForPreview = ({
58
58
  activateSaveLabel = (0, _i18n.__)('Activate');
59
59
  }
60
60
 
61
- const {
62
- getTheme
63
- } = (0, _data.useSelect)(_coreData.store);
64
- const theme = getTheme((0, _isPreviewingTheme.currentlyPreviewingTheme)());
65
- const additionalPrompt = (0, _element.createElement)("p", null, (0, _i18n.sprintf)('Saving your changes will change your active theme to %1$s.', theme?.name?.rendered));
61
+ const themeName = (0, _data.useSelect)(select => {
62
+ const theme = select(_coreData.store).getTheme((0, _isPreviewingTheme.currentlyPreviewingTheme)());
63
+ return theme?.name?.rendered;
64
+ }, []);
65
+ const additionalPrompt = (0, _element.createElement)("p", null, (0, _i18n.sprintf)('Saving your changes will change your active theme to %s.', themeName));
66
66
  const activateTheme = (0, _useActivateTheme.useActivateTheme)();
67
67
 
68
68
  const onSave = async values => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["EntitiesSavedStatesExtensible","privateApis","EntitiesSavedStatesForPreview","onClose","isDirtyProps","activateSaveLabel","isDirty","getTheme","coreStore","theme","additionalPrompt","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","editSiteStore","setIsSaveViewOpened"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAoC,wBAAQC,mBAAR,CAA1C;;AAEA,MAAMC,6BAA6B,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAmB;AACxD,QAAMC,YAAY,GAAG,4CAArB;AACA,MAAIC,iBAAJ;;AACA,MAAKD,YAAY,CAACE,OAAlB,EAA4B;AAC3BD,IAAAA,iBAAiB,GAAG,cAAI,iBAAJ,CAApB;AACA,GAFD,MAEO;AACNA,IAAAA,iBAAiB,GAAG,cAAI,UAAJ,CAApB;AACA;;AAED,QAAM;AAAEE,IAAAA;AAAF,MAAe,qBAAWC,eAAX,CAArB;AACA,QAAMC,KAAK,GAAGF,QAAQ,CAAE,kDAAF,CAAtB;AACA,QAAMG,gBAAgB,GACrB,uCACG,mBACD,6DADC,EAEDD,KAAK,EAAEE,IAAP,EAAaC,QAFZ,CADH,CADD;AASA,QAAMC,aAAa,GAAG,yCAAtB;;AACA,QAAMC,MAAM,GAAG,MAAQC,MAAR,IAAoB;AAClC,UAAMF,aAAa,EAAnB;AACA,WAAOE,MAAP;AACA,GAHD;;AAKA,SACC,4BAAC,6BAAD,IAEE,GAAGX,YAFL;AAGEM,IAAAA,gBAHF;AAIEM,IAAAA,KAAK,EAAEb,OAJT;AAKEW,IAAAA,MALF;AAMEG,IAAAA,WAAW,EAAE,IANf;AAOEC,IAAAA,SAAS,EAAEb;AAPb,IADD;AAYA,CAtCD;;AAwCA,MAAMc,oBAAoB,GAAG,CAAE;AAAEhB,EAAAA;AAAF,CAAF,KAAmB;AAC/C,MAAK,2CAAL,EAA2B;AAC1B,WAAO,4BAAC,6BAAD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AAS,EAAC,4CAFX;AAGC,IAAA,OAAO,EAAG,MAAMwB,mBAAmB,CAAE,IAAF,CAHpC;AAIC,qBAAgB;AAJjB,KAMG,cAAI,iBAAJ,CANH,CADD,CATF,CADD;AAuBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst { getTheme } = useSelect( coreStore );\n\tconst theme = getTheme( currentlyPreviewingTheme() );\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t'Saving your changes will change your active theme to %1$s.',\n\t\t\t\ttheme?.name?.rendered\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn <EntitiesSavedStates close={ onClose } />;\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["EntitiesSavedStatesExtensible","privateApis","EntitiesSavedStatesForPreview","onClose","isDirtyProps","activateSaveLabel","isDirty","themeName","select","theme","coreStore","getTheme","name","rendered","additionalPrompt","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","isSaveViewOpened","getCanvasMode","editSiteStore","setIsSaveViewOpened"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAoC,wBAAQC,mBAAR,CAA1C;;AAEA,MAAMC,6BAA6B,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAmB;AACxD,QAAMC,YAAY,GAAG,4CAArB;AACA,MAAIC,iBAAJ;;AACA,MAAKD,YAAY,CAACE,OAAlB,EAA4B;AAC3BD,IAAAA,iBAAiB,GAAG,cAAI,iBAAJ,CAApB;AACA,GAFD,MAEO;AACNA,IAAAA,iBAAiB,GAAG,cAAI,UAAJ,CAApB;AACA;;AAED,QAAME,SAAS,GAAG,qBAAaC,MAAF,IAAc;AAC1C,UAAMC,KAAK,GAAGD,MAAM,CAAEE,eAAF,CAAN,CAAoBC,QAApB,CACb,kDADa,CAAd;AAIA,WAAOF,KAAK,EAAEG,IAAP,EAAaC,QAApB;AACA,GANiB,EAMf,EANe,CAAlB;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D;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,cAAc,EAAGpB,OAFlB;AAGC,MAAA,wBAAwB,MAHzB;AAIC,MAAA,YAAY,EAAG,cACd,0CADc;AAJhB,OAQC,4BAAC,oBAAD;AAAsB,MAAA,OAAO,EAAGA;AAAhC,MARD,CADoB,GAWjB,IAXJ;AAYA;;AAED,SACC,4BAAC,0BAAD;AACC,IAAA,SAAS,EAAG,yBAAY,2BAAZ,EAAyC;AACpD,kCAA4BoB;AADwB,KAAzC,CADb;AAIC,IAAA,SAAS,EAAG,cAAI,YAAJ;AAJb,KAMGA,cAAc,GACf,4BAAC,oBAAD;AAAsB,IAAA,OAAO,EAAGpB;AAAhC,IADe,GAGf;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,OAAO,EAAG,MAAMyB,mBAAmB,CAAE,IAAF,CAHpC;AAIC,qBAAgB;AAJjB,KAMG,cAAI,iBAAJ,CANH,CADD,CATF,CADD;AAuBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst themeName = useSelect( ( select ) => {\n\t\tconst theme = select( coreStore ).getTheme(\n\t\t\tcurrentlyPreviewingTheme()\n\t\t);\n\n\t\treturn theme?.name?.rendered;\n\t}, [] );\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t'Saving your changes will change your active theme to %s.',\n\t\t\t\tthemeName\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn <EntitiesSavedStates close={ onClose } />;\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"]}
@@ -15,12 +15,12 @@ var _router = require("@wordpress/router");
15
15
 
16
16
  var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
17
17
 
18
- var _sidebarNavigationScreenLibrary = _interopRequireDefault(require("../sidebar-navigation-screen-library"));
19
-
20
18
  var _sidebarNavigationScreenTemplates = _interopRequireDefault(require("../sidebar-navigation-screen-templates"));
21
19
 
22
20
  var _sidebarNavigationScreenTemplate = _interopRequireDefault(require("../sidebar-navigation-screen-template"));
23
21
 
22
+ var _sidebarNavigationScreenPatterns = _interopRequireDefault(require("../sidebar-navigation-screen-patterns"));
23
+
24
24
  var _sidebarNavigationScreenPattern = _interopRequireDefault(require("../sidebar-navigation-screen-pattern"));
25
25
 
26
26
  var _useSyncPathWithUrl = _interopRequireWildcard(require("../sync-state-with-url/use-sync-path-with-url"));
@@ -73,12 +73,12 @@ function SidebarScreens() {
73
73
  }, (0, _element.createElement)(_sidebarNavigationScreenPage.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
74
74
  path: "/:postType(wp_template)"
75
75
  }, (0, _element.createElement)(_sidebarNavigationScreenTemplates.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
76
- path: "/library"
77
- }, (0, _element.createElement)(_sidebarNavigationScreenLibrary.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
76
+ path: "/patterns"
77
+ }, (0, _element.createElement)(_sidebarNavigationScreenPatterns.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
78
+ path: "/:postType(wp_template|wp_template_part)/all"
79
+ }, (0, _element.createElement)(_sidebarNavigationScreenTemplatesBrowse.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
78
80
  path: "/:postType(wp_template_part|wp_block)/:postId"
79
81
  }, (0, _element.createElement)(_sidebarNavigationScreenPattern.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
80
- path: "/:postType(wp_template)/all"
81
- }, (0, _element.createElement)(_sidebarNavigationScreenTemplatesBrowse.default, null)), (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
82
82
  path: "/:postType(wp_template)/:postId"
83
83
  }, (0, _element.createElement)(_sidebarNavigationScreenTemplate.default, null)));
84
84
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["useLocation","routerPrivateApis","SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;;;;;;;;AAGA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;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AAhB,CAAR,CAApB;AAEA,SACC,qDACC,4BAAC,2CAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAGC,WAAW,CAACC;AAF3B,KAIC,4BAAC,cAAD,OAJD,CADD,EAOC,4BAAC,gBAAD,OAPD,CADD;AAWA;;eAEc,mBAAMJ,OAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenLibrary from '../sidebar-navigation-screen-library';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../lock-unlock';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page\">\n\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/library\">\n\t\t\t\t<SidebarNavigationScreenLibrary />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template_part|wp_block)/:postId\">\n\t\t\t\t<SidebarNavigationScreenPattern />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</NavigatorScreen>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t<SaveHub />\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["useLocation","routerPrivateApis","SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;;;;;;;;AAGA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AA5BA;AACA;AACA;;AAQA;AACA;AACA;AAkBA,MAAM;AAAEA,EAAAA;AAAF,IAAkB,wBAAQC,mBAAR,CAAxB;;AAEA,SAASC,cAAT,GAA0B;AACzB;AAEA,SACC,qDACC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,oCAAD,OADD,CADD,EAIC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,+CAAD,OADD,CAJD,EAOC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,8CAAD,OADD,CAPD,EAUC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,4CAAD,OADD,CAVD,EAaC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,qCAAD,OADD,CAbD,EAgBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,oCAAD,OADD,CAhBD,EAmBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,yCAAD,OADD,CAnBD,EAsBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,wCAAD,OADD,CAtBD,EAyBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,+CAAD,OADD,CAzBD,EA4BC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,uCAAD,OADD,CA5BD,EA+BC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,wCAAD,OADD,CA/BD,CADD;AAqCA;;AAED,SAASC,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAAwBL,WAAW,EAAzC;AACA,QAAMM,WAAW,GAAG,qBAAQ,wCAAgBD,SAAhB,CAAR,CAApB;AAEA,SACC,qDACC,4BAAC,2CAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAGC,WAAW,CAACC;AAF3B,KAIC,4BAAC,cAAD,OAJD,CADD,EAOC,4BAAC,gBAAD,OAPD,CADD;AAWA;;eAEc,mBAAMJ,OAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';\nimport SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../lock-unlock';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page\">\n\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/patterns\">\n\t\t\t\t<SidebarNavigationScreenPatterns />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template_part|wp_block)/:postId\">\n\t\t\t\t<SidebarNavigationScreenPattern />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</NavigatorScreen>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t<SaveHub />\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
@@ -81,12 +81,14 @@ function SidebarComplementaryAreaFills() {
81
81
  (0, _element.useEffect)(() => {
82
82
  // Don't automatically switch tab when the sidebar is closed or when we
83
83
  // are focused on page content.
84
- if (!isEditorSidebarOpened || hasPageContentFocus) {
84
+ if (!isEditorSidebarOpened) {
85
85
  return;
86
86
  }
87
87
 
88
88
  if (hasBlockSelection) {
89
- enableComplementaryArea(_constants.STORE_NAME, _constants2.SIDEBAR_BLOCK);
89
+ if (!hasPageContentFocus) {
90
+ enableComplementaryArea(_constants.STORE_NAME, _constants2.SIDEBAR_BLOCK);
91
+ }
90
92
  } else {
91
93
  enableComplementaryArea(_constants.STORE_NAME, _constants2.SIDEBAR_TEMPLATE);
92
94
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","supportsGlobalStyles","hasPageContentFocus","select","_sidebar","interfaceStore","getActiveComplementaryArea","STORE_NAME","_isEditorSidebarOpened","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","includes","settings","editSiteStore","getSettings","blockEditorStore","getBlockSelectionStart","supportsTemplatePartsMode","enableComplementaryArea","sidebarName","drawerLeft","drawerRight"],"mappings":";;;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAtBA;AACA;AACA;;AASA;AACA;AACA;AAWA,MAAM;AAAEA,EAAAA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AXD,EAWG,CAAEV,iBAAF,EAAqBD,qBAArB,EAA4CG,mBAA5C,CAXH;AAaA,MAAIiB,WAAW,GAAGrB,OAAlB;;AACA,MAAK,CAAEC,qBAAP,EAA+B;AAC9BoB,IAAAA,WAAW,GAAGnB,iBAAiB,GAAGS,yBAAH,GAAmBC,4BAAlD;AACA;;AAED,SACC,qDACC,4BAAC,uBAAD;AACC,IAAA,UAAU,EAAGS,WADd;AAEC,IAAA,KAAK,EAAG,cAAI,UAAJ,CAFT;AAGC,IAAA,IAAI,EAAG,qBAAUC,iBAAV,GAAuBC,kBAH/B;AAIC,IAAA,UAAU,EAAG,cAAI,gBAAJ,CAJd;AAKC,IAAA,MAAM,EAAG,4BAAC,uBAAD;AAAgB,MAAA,WAAW,EAAGF;AAA9B,MALV;AAMC,IAAA,eAAe,EAAC;AANjB,KAQGA,WAAW,KAAKT,4BAAhB,IACD,qDACGR,mBAAmB,GACpB,4BAAC,mBAAD,OADoB,GAGpB,4BAAC,sBAAD,OAJF,EAMC,4BAAC,mCAAD,CAA4B,IAA5B,OAND,CATF,EAkBGiB,WAAW,KAAKV,yBAAhB,IACD,4BAAC,aAAD;AAAe,IAAA,gBAAgB;AAA/B,IAnBF,CADD,EAuBGR,oBAAoB,IAAI,4BAAC,4BAAD,OAvB3B,CADD;AA2BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport { STORE_NAME } from '../../store/constants';\nimport SettingsHeader from './settings-header';\nimport PagePanels from './page-panels';\nimport TemplatePanel from './template-panel';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';\nimport { store as editSiteStore } from '../../store';\n\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nexport function SidebarComplementaryAreaFills() {\n\tconst {\n\t\tsidebar,\n\t\tisEditorSidebarOpened,\n\t\thasBlockSelection,\n\t\tsupportsGlobalStyles,\n\t\thasPageContentFocus,\n\t} = useSelect( ( select ) => {\n\t\tconst _sidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( STORE_NAME );\n\t\tconst _isEditorSidebarOpened = [\n\t\t\tSIDEBAR_BLOCK,\n\t\t\tSIDEBAR_TEMPLATE,\n\t\t].includes( _sidebar );\n\t\tconst settings = select( editSiteStore ).getSettings();\n\t\treturn {\n\t\t\tsidebar: _sidebar,\n\t\t\tisEditorSidebarOpened: _isEditorSidebarOpened,\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tsupportsGlobalStyles: ! settings?.supportsTemplatePartsMode,\n\t\t\thasPageContentFocus: select( editSiteStore ).hasPageContentFocus(),\n\t\t};\n\t}, [] );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Don't automatically switch tab when the sidebar is closed or when we\n\t\t// are focused on page content.\n\t\tif ( ! isEditorSidebarOpened || hasPageContentFocus ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened, hasPageContentFocus ] );\n\n\tlet sidebarName = sidebar;\n\tif ( ! isEditorSidebarOpened ) {\n\t\tsidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ sidebarName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\t\theaderClassName=\"edit-site-sidebar-edit-mode__panel-tabs\"\n\t\t\t>\n\t\t\t\t{ sidebarName === SIDEBAR_TEMPLATE && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ hasPageContentFocus ? (\n\t\t\t\t\t\t\t<PagePanels />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<TemplatePanel />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ sidebarName === SIDEBAR_BLOCK && (\n\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t) }\n\t\t\t</DefaultSidebar>\n\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","supportsGlobalStyles","hasPageContentFocus","select","_sidebar","interfaceStore","getActiveComplementaryArea","STORE_NAME","_isEditorSidebarOpened","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","includes","settings","editSiteStore","getSettings","blockEditorStore","getBlockSelectionStart","supportsTemplatePartsMode","enableComplementaryArea","sidebarName","drawerLeft","drawerRight"],"mappings":";;;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA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AAd,CAAvB;AACA;AACD,KAJD,MAIO;AACNS,MAAAA,uBAAuB,CAAEX,qBAAF,EAAcG,4BAAd,CAAvB;AACA;AACD,GAbD,EAaG,CAAEV,iBAAF,EAAqBD,qBAArB,EAA4CG,mBAA5C,CAbH;AAeA,MAAIiB,WAAW,GAAGrB,OAAlB;;AACA,MAAK,CAAEC,qBAAP,EAA+B;AAC9BoB,IAAAA,WAAW,GAAGnB,iBAAiB,GAAGS,yBAAH,GAAmBC,4BAAlD;AACA;;AAED,SACC,qDACC,4BAAC,uBAAD;AACC,IAAA,UAAU,EAAGS,WADd;AAEC,IAAA,KAAK,EAAG,cAAI,UAAJ,CAFT;AAGC,IAAA,IAAI,EAAG,qBAAUC,iBAAV,GAAuBC,kBAH/B;AAIC,IAAA,UAAU,EAAG,cAAI,gBAAJ,CAJd;AAKC,IAAA,MAAM,EAAG,4BAAC,uBAAD;AAAgB,MAAA,WAAW,EAAGF;AAA9B,MALV;AAMC,IAAA,eAAe,EAAC;AANjB,KAQGA,WAAW,KAAKT,4BAAhB,IACD,qDACGR,mBAAmB,GACpB,4BAAC,mBAAD,OADoB,GAGpB,4BAAC,sBAAD,OAJF,EAMC,4BAAC,mCAAD,CAA4B,IAA5B,OAND,CATF,EAkBGiB,WAAW,KAAKV,yBAAhB,IACD,4BAAC,aAAD;AAAe,IAAA,gBAAgB;AAA/B,IAnBF,CADD,EAuBGR,oBAAoB,IAAI,4BAAC,4BAAD,OAvB3B,CADD;AA2BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport { STORE_NAME } from '../../store/constants';\nimport SettingsHeader from './settings-header';\nimport PagePanels from './page-panels';\nimport TemplatePanel from './template-panel';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';\nimport { store as editSiteStore } from '../../store';\n\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nexport function SidebarComplementaryAreaFills() {\n\tconst {\n\t\tsidebar,\n\t\tisEditorSidebarOpened,\n\t\thasBlockSelection,\n\t\tsupportsGlobalStyles,\n\t\thasPageContentFocus,\n\t} = useSelect( ( select ) => {\n\t\tconst _sidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( STORE_NAME );\n\t\tconst _isEditorSidebarOpened = [\n\t\t\tSIDEBAR_BLOCK,\n\t\t\tSIDEBAR_TEMPLATE,\n\t\t].includes( _sidebar );\n\t\tconst settings = select( editSiteStore ).getSettings();\n\t\treturn {\n\t\t\tsidebar: _sidebar,\n\t\t\tisEditorSidebarOpened: _isEditorSidebarOpened,\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tsupportsGlobalStyles: ! settings?.supportsTemplatePartsMode,\n\t\t\thasPageContentFocus: select( editSiteStore ).hasPageContentFocus(),\n\t\t};\n\t}, [] );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Don't automatically switch tab when the sidebar is closed or when we\n\t\t// are focused on page content.\n\t\tif ( ! isEditorSidebarOpened ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasBlockSelection ) {\n\t\t\tif ( ! hasPageContentFocus ) {\n\t\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t\t}\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened, hasPageContentFocus ] );\n\n\tlet sidebarName = sidebar;\n\tif ( ! isEditorSidebarOpened ) {\n\t\tsidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ sidebarName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\t\theaderClassName=\"edit-site-sidebar-edit-mode__panel-tabs\"\n\t\t\t>\n\t\t\t\t{ sidebarName === SIDEBAR_TEMPLATE && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ hasPageContentFocus ? (\n\t\t\t\t\t\t\t<PagePanels />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<TemplatePanel />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ sidebarName === SIDEBAR_BLOCK && (\n\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t) }\n\t\t\t</DefaultSidebar>\n\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t</>\n\t);\n}\n"]}
@@ -11,8 +11,6 @@ var _data = require("@wordpress/data");
11
11
 
12
12
  var _blockEditor = require("@wordpress/block-editor");
13
13
 
14
- var _constants = require("../../page-content-focus-manager/constants");
15
-
16
14
  var _lockUnlock = require("../../../lock-unlock");
17
15
 
18
16
  /**
@@ -27,7 +25,10 @@ const {
27
25
  } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
28
26
 
29
27
  function PageContent() {
30
- const clientIds = (0, _data.useSelect)(select => select(_blockEditor.store).__experimentalGetGlobalBlocksByName(_constants.PAGE_CONTENT_BLOCK_TYPES), []);
28
+ const clientIdsTree = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_blockEditor.store)).getEnabledClientIdsTree(), []);
29
+ const clientIds = (0, _element.useMemo)(() => clientIdsTree.map(({
30
+ clientId
31
+ }) => clientId), [clientIdsTree]);
31
32
  return (0, _element.createElement)(BlockQuickNavigation, {
32
33
  clientIds: clientIds
33
34
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-content.js"],"names":["BlockQuickNavigation","blockEditorPrivateApis","PageContent","clientIds","select","blockEditorStore","__experimentalGetGlobalBlocksByName","PAGE_CONTENT_BLOCK_TYPES"],"mappings":";;;;;;;;;AAGA;;AACA;;AAQA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAA2B,wBAAQC,wBAAR,CAAjC;;AAEe,SAASC,WAAT,GAAuB;AACrC,QAAMC,SAAS,GAAG,qBACfC,MAAF,IACCA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,mCAA3B,CACCC,mCADD,CAFgB,EAKjB,EALiB,CAAlB;AAOA,SAAO,4BAAC,oBAAD;AAAsB,IAAA,SAAS,EAAGJ;AAAlC,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { PAGE_CONTENT_BLOCK_TYPES } from '../../page-content-focus-manager/constants';\nimport { unlock } from '../../../lock-unlock';\n\nconst { BlockQuickNavigation } = unlock( blockEditorPrivateApis );\n\nexport default function PageContent() {\n\tconst clientIds = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\tPAGE_CONTENT_BLOCK_TYPES\n\t\t\t),\n\t\t[]\n\t);\n\treturn <BlockQuickNavigation clientIds={ clientIds } />;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-content.js"],"names":["BlockQuickNavigation","blockEditorPrivateApis","PageContent","clientIdsTree","select","blockEditorStore","getEnabledClientIdsTree","clientIds","map","clientId"],"mappings":";;;;;;;AAQA;;AALA;;AACA;;AASA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA;AAAF,IAA2B,wBAAQC,wBAAR,CAAjC;;AAEe,SAASC,WAAT,GAAuB;AACrC,QAAMC,aAAa,GAAG,qBACnBC,MAAF,IACC,wBAAQA,MAAM,CAAEC,kBAAF,CAAd,EAAqCC,uBAArC,EAFoB,EAGrB,EAHqB,CAAtB;AAKA,QAAMC,SAAS,GAAG,sBACjB,MAAMJ,aAAa,CAACK,GAAd,CAAmB,CAAE;AAAEC,IAAAA;AAAF,GAAF,KAAoBA,QAAvC,CADW,EAEjB,CAAEN,aAAF,CAFiB,CAAlB;AAIA,SAAO,4BAAC,oBAAD;AAAsB,IAAA,SAAS,EAAGI;AAAlC,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { BlockQuickNavigation } = unlock( blockEditorPrivateApis );\n\nexport default function PageContent() {\n\tconst clientIdsTree = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).getEnabledClientIdsTree(),\n\t\t[]\n\t);\n\tconst clientIds = useMemo(\n\t\t() => clientIdsTree.map( ( { clientId } ) => clientId ),\n\t\t[ clientIdsTree ]\n\t);\n\treturn <BlockQuickNavigation clientIds={ clientIds } />;\n}\n"]}
@@ -178,14 +178,9 @@ function PageStatus({
178
178
  onChange: value => saveStatus({
179
179
  password: value
180
180
  }),
181
- value: password
182
- /* eslint-disable jsx-a11y/no-autofocus */
183
- ,
184
- autoFocus: !password
185
- /* eslint-enable jsx-a11y/no-autofocus */
186
- ,
187
- placeholder: (0, _i18n.__)('Enter a secure password'),
188
- type: "password"
181
+ value: password,
182
+ placeholder: (0, _i18n.__)('Use a secure password'),
183
+ type: "text"
189
184
  })))))
190
185
  }));
191
186
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-status.js"],"names":["STATUS_OPTIONS","label","value","PageStatus","postType","postId","status","password","date","showPassword","setShowPassword","editEntityRecord","coreStore","createErrorNotice","noticesStore","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","saveStatus","newStatus","newPassword","newDate","error","errorMessage","message","code","type","handleTogglePassword","handleStatus","Date","setDate","getDate","onToggle","onClose"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAWA;;AACA;;AAEA;;AACA;;AACA;;AAIA;;AAvBA;AACA;AACA;;AAkBA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,CACtB;AACCC,EAAAA,KAAK,EACJ,qDACG,cAAI,OAAJ,CADH,EAEC,4BAAC,8BAAD;AAAM,IAAA,OAAO,EAAC;AAAd,KAAwB,cAAI,uBAAJ,CAAxB,CAFD,CAFF;AAOCC,EAAAA,KAAK,EAAE;AAPR,CADsB,EAUtB;AACCD,EAAAA,KAAK,EACJ,qDACG,cAAI,SAAJ,CADH,EAEC,4BAAC,8BAAD;AAAM,IAAA,OAAO,EAAC;AAAd,KACG,cAAI,uCAAJ,CADH,CAFD,CAFF;AASCC,EAAAA,KAAK,EAAE;AATR,CAVsB,EAqBtB;AACCD,EAAAA,KAAK,EACJ,qDACG,cAAI,SAAJ,CADH,EAEC,4BAAC,8BAAD;AAAM,IAAA,OAAO,EAAC;AAAd,KACG,cAAI,0CAAJ,CADH,CAFD,CAFF;AASCC,EAAAA,KAAK,EAAE;AATR,CAr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ADD,EASGA,MAAM,KAAK,SAAX,IACD,4BAAC,uBAAD;AACC,MAAA,EAAE,EAAI,mCADP;AAEC,MAAA,KAAK,EAAG,cAAI,UAAJ;AAFT,OAIC,4BAAC,yBAAD;AACC,MAAA,KAAK,EAAG,cACP,kCADO,CADT;AAIC,MAAA,OAAO,EAAGG,YAJX;AAKC,MAAA,QAAQ,EAAGoB;AALZ,MAJD,EAWGpB,YAAY,IACb,4BAAC,uBAAD;AACC,MAAA,QAAQ,EAAKP,KAAF,IACVkB,UAAU,CAAE;AACXb,QAAAA,QAAQ,EAAEL;AADC,OAAF,CAFZ;AAMC,MAAA,KAAK,EAAGK;AACR;AAPD;AAQC,MAAA,SAAS,EAAG,CAAEA;AACd;AATD;AAUC,MAAA,WAAW,EAAG,cACb,yBADa,CAVf;AAaC,MAAA,IAAI,EAAC;AAbN,MAZF,CAVF,CADD,CALD;AAjBF,IAJD,CADD;AA2EA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tBaseControl,\n\tToggleControl,\n\tDropdown,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n\tRadioControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n/**\n * Internal dependencies\n */\nimport StatusLabel from '../../sidebar-navigation-screen-page/status-label';\n\nconst STATUS_OPTIONS = [\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Draft' ) }\n\t\t\t\t<Text variant=\"muted\">{ __( 'Not ready to publish.' ) }</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'draft',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Pending' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Waiting for review before publishing.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'pending',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Private' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Only visible to site admins and editors.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'private',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Scheduled' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Publish automatically on a chosen date.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'future',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Published' ) }\n\t\t\t\t<Text variant=\"muted\">{ __( 'Visible to everyone.' ) }</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'publish',\n\t},\n];\n\nexport default function PageStatus( {\n\tpostType,\n\tpostId,\n\tstatus,\n\tpassword,\n\tdate,\n} ) {\n\tconst [ showPassword, setShowPassword ] = useState( !! password );\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Change status' ),\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst saveStatus = async ( {\n\t\tstatus: newStatus = status,\n\t\tpassword: newPassword = password,\n\t\tdate: newDate = date,\n\t} ) => {\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\t\tstatus: newStatus,\n\t\t\t\tdate: newDate,\n\t\t\t\tpassword: newPassword,\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while updating the status' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst handleTogglePassword = ( value ) => {\n\t\tsetShowPassword( value );\n\t\tif ( ! value ) {\n\t\t\tsaveStatus( { password: '' } );\n\t\t}\n\t};\n\n\tconst handleStatus = ( value ) => {\n\t\tlet newDate = date;\n\t\tlet newPassword = password;\n\t\tif ( value === 'publish' ) {\n\t\t\tif ( new Date( date ) > new Date() ) {\n\t\t\t\tnewDate = null;\n\t\t\t}\n\t\t} else if ( value === 'future' ) {\n\t\t\tif ( ! date || new Date( date ) < new Date() ) {\n\t\t\t\tnewDate = new Date();\n\t\t\t\tnewDate.setDate( newDate.getDate() + 7 );\n\t\t\t}\n\t\t} else if ( value === 'private' && password ) {\n\t\t\tsetShowPassword( false );\n\t\t\tnewPassword = '';\n\t\t}\n\t\tsaveStatus( {\n\t\t\tstatus: value,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<HStack className=\"edit-site-summary-field\">\n\t\t\t<Text className=\"edit-site-summary-field__label\">\n\t\t\t\t{ __( 'Status' ) }\n\t\t\t</Text>\n\t\t\t<Dropdown\n\t\t\t\tcontentClassName=\"edit-site-change-status__content\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tfocusOnMount\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-summary-field__trigger\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<StatusLabel\n\t\t\t\t\t\t\tstatus={ password ? 'protected' : status }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Status' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t<VStack spacing={ 5 }>\n\t\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-change-status__options\"\n\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Status' ) }\n\t\t\t\t\t\t\t\t\toptions={ STATUS_OPTIONS }\n\t\t\t\t\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\t\t\t\t\tselected={ status }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ status !== 'private' && (\n\t\t\t\t\t\t\t\t\t<BaseControl\n\t\t\t\t\t\t\t\t\t\tid={ `edit-site-change-status__password` }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Password' ) }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Hide this page behind a password'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tchecked={ showPassword }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ handleTogglePassword }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ showPassword && (\n\t\t\t\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\tsaveStatus( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpassword: value,\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\tvalue={ password }\n\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/no-autofocus */\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ ! password }\n\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/no-autofocus */\n\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Enter a secure password'\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\ttype=\"password\"\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</BaseControl>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-status.js"],"names":["STATUS_OPTIONS","label","value","PageStatus","postType","postId","status","password","date","showPassword","setShowPassword","editEntityRecord","coreStore","createErrorNotice","noticesStore","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","saveStatus","newStatus","newPassword","newDate","error","errorMessage","message","code","type","handleTogglePassword","handleStatus","Date","setDate","getDate","onToggle","onClose"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAWA;;AACA;;AAEA;;AACA;;AACA;;AAIA;;AAvBA;AACA;AACA;;AAkBA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,CACtB;AACCC,EAAAA,KAAK,EACJ,qDACG,cAAI,OAAJ,CADH,EAEC,4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Q,GAAG,WAAH,GAAiBD;AADnC,MALD,CANF;AAgBC,IAAA,aAAa,EAAG,CAAE;AAAE6B,MAAAA;AAAF,KAAF,KACf,qDACC,4BAAC,iDAAD;AACC,MAAA,KAAK,EAAG,cAAI,QAAJ,CADT;AAEC,MAAA,OAAO,EAAGA;AAFX,MADD,EAKC,0CACC,4BAAC,gCAAD;AAAQ,MAAA,OAAO,EAAG;AAAlB,OACC,4BAAC,wBAAD;AACC,MAAA,SAAS,EAAC,kCADX;AAEC,MAAA,mBAAmB,MAFpB;AAGC,MAAA,KAAK,EAAG,cAAI,QAAJ,CAHT;AAIC,MAAA,OAAO,EAAGnC,cAJX;AAKC,MAAA,QAAQ,EAAG8B,YALZ;AAMC,MAAA,QAAQ,EAAGxB;AANZ,MADD,EASGA,MAAM,KAAK,SAAX,IACD,4BAAC,uBAAD;AACC,MAAA,EAAE,EAAI,mCADP;AAEC,MAAA,KAAK,EAAG,cAAI,UAAJ;AAFT,OAIC,4BAAC,yBAAD;AACC,MAAA,KAAK,EAAG,cACP,kCADO,CADT;AAIC,MAAA,OAAO,EAAGG,YAJX;AAKC,MAAA,QAAQ,EAAGoB;AALZ,MAJD,EAWGpB,YAAY,IACb,4BAAC,uBAAD;AACC,MAAA,QAAQ,EAAKP,KAAF,IACVkB,UAAU,CAAE;AACXb,QAAAA,QAAQ,EAAEL;AADC,OAAF,CAFZ;AAMC,MAAA,KAAK,EAAGK,QANT;AAOC,MAAA,WAAW,EAAG,cACb,uBADa,CAPf;AAUC,MAAA,IAAI,EAAC;AAVN,MAZF,CAVF,CADD,CALD;AAjBF,IAJD,CADD;AAwEA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tBaseControl,\n\tToggleControl,\n\tDropdown,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n\tRadioControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n/**\n * Internal dependencies\n */\nimport StatusLabel from '../../sidebar-navigation-screen-page/status-label';\n\nconst STATUS_OPTIONS = [\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Draft' ) }\n\t\t\t\t<Text variant=\"muted\">{ __( 'Not ready to publish.' ) }</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'draft',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Pending' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Waiting for review before publishing.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'pending',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Private' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Only visible to site admins and editors.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'private',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Scheduled' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Publish automatically on a chosen date.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'future',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Published' ) }\n\t\t\t\t<Text variant=\"muted\">{ __( 'Visible to everyone.' ) }</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'publish',\n\t},\n];\n\nexport default function PageStatus( {\n\tpostType,\n\tpostId,\n\tstatus,\n\tpassword,\n\tdate,\n} ) {\n\tconst [ showPassword, setShowPassword ] = useState( !! password );\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Change status' ),\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst saveStatus = async ( {\n\t\tstatus: newStatus = status,\n\t\tpassword: newPassword = password,\n\t\tdate: newDate = date,\n\t} ) => {\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\t\tstatus: newStatus,\n\t\t\t\tdate: newDate,\n\t\t\t\tpassword: newPassword,\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while updating the status' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst handleTogglePassword = ( value ) => {\n\t\tsetShowPassword( value );\n\t\tif ( ! value ) {\n\t\t\tsaveStatus( { password: '' } );\n\t\t}\n\t};\n\n\tconst handleStatus = ( value ) => {\n\t\tlet newDate = date;\n\t\tlet newPassword = password;\n\t\tif ( value === 'publish' ) {\n\t\t\tif ( new Date( date ) > new Date() ) {\n\t\t\t\tnewDate = null;\n\t\t\t}\n\t\t} else if ( value === 'future' ) {\n\t\t\tif ( ! date || new Date( date ) < new Date() ) {\n\t\t\t\tnewDate = new Date();\n\t\t\t\tnewDate.setDate( newDate.getDate() + 7 );\n\t\t\t}\n\t\t} else if ( value === 'private' && password ) {\n\t\t\tsetShowPassword( false );\n\t\t\tnewPassword = '';\n\t\t}\n\t\tsaveStatus( {\n\t\t\tstatus: value,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<HStack className=\"edit-site-summary-field\">\n\t\t\t<Text className=\"edit-site-summary-field__label\">\n\t\t\t\t{ __( 'Status' ) }\n\t\t\t</Text>\n\t\t\t<Dropdown\n\t\t\t\tcontentClassName=\"edit-site-change-status__content\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tfocusOnMount\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-summary-field__trigger\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<StatusLabel\n\t\t\t\t\t\t\tstatus={ password ? 'protected' : status }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Status' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t<VStack spacing={ 5 }>\n\t\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-change-status__options\"\n\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Status' ) }\n\t\t\t\t\t\t\t\t\toptions={ STATUS_OPTIONS }\n\t\t\t\t\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\t\t\t\t\tselected={ status }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ status !== 'private' && (\n\t\t\t\t\t\t\t\t\t<BaseControl\n\t\t\t\t\t\t\t\t\t\tid={ `edit-site-change-status__password` }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Password' ) }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Hide this page behind a password'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tchecked={ showPassword }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ handleTogglePassword }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ showPassword && (\n\t\t\t\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\tsaveStatus( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpassword: value,\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\tvalue={ password }\n\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Use a secure password'\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\ttype=\"text\"\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</BaseControl>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"]}
@@ -36,6 +36,12 @@ var _store = require("../../../store");
36
36
  /**
37
37
  * Internal dependencies
38
38
  */
39
+ const entityLabels = {
40
+ wp_navigation: (0, _i18n.__)('Navigation'),
41
+ wp_block: (0, _i18n.__)('Pattern'),
42
+ wp_template: (0, _i18n.__)('Template')
43
+ };
44
+
39
45
  const SettingsHeader = ({
40
46
  sidebarName
41
47
  }) => {
@@ -52,7 +58,7 @@ const SettingsHeader = ({
52
58
  entityType: getEditedPostType()
53
59
  };
54
60
  });
55
- const entityLabel = entityType === 'wp_navigation' ? (0, _i18n.__)('Navigation') : (0, _i18n.__)('Template');
61
+ const entityLabel = entityLabels[entityType] || entityLabels.wp_template;
56
62
  const {
57
63
  enableComplementaryArea
58
64
  } = (0, _data.useDispatch)(_interface.store);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/settings-header/index.js"],"names":["SettingsHeader","sidebarName","hasPageContentFocus","entityType","select","getEditedPostType","_hasPageContentFocus","editSiteStore","entityLabel","enableComplementaryArea","interfaceStore","openTemplateSettings","STORE_NAME","SIDEBAR_TEMPLATE","openBlockSettings","SIDEBAR_BLOCK","templateAriaLabel"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAKA,MAAMA,cAAc,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAuB;AAC7C,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,MAAsC,qBAAaC,MAAF,IAAc;AACpE,UAAM;AAAEC,MAAAA,iBAAF;AAAqBH,MAAAA,mBAAmB,EAAEI;AAA1C,QACLF,MAAM,CAAEG,YAAF,CADP;AAGA,WAAO;AACNL,MAAAA,mBAAmB,EAAEI,oBAAoB,EADnC;AAENH,MAAAA,UAAU,EAAEE,iBAAiB;AAFvB,KAAP;AAIA,GAR2C,CAA5C;AAUA,QAAMG,WAAW,GAChBL,UAAU,KAAK,eAAf,GAAiC,cAAI,YAAJ,CAAjC,GAAsD,cAAI,UAAJ,CADvD;AAGA,QAAM;AAAEM,IAAAA;AAAF,MAA8B,uBAAaC,gBAAb,CAApC;;AACA,QAAMC,oBAAoB,GAAG,MAC5BF,uBAAuB,CAAEG,qBAAF,EAAcC,4BAAd,CADxB;;AAEA,QAAMC,iBAAiB,GAAG,MACzBL,uBAAuB,CAAEG,qBAAF,EAAcG,yBAAd,CADxB;;AAGA,MAAIC,iBAAJ;;AACA,MAAKd,mBAAL,EAA2B;AAC1Bc,IAAAA,iBAAiB,GAChBf,WAAW,KAAKY,4BAAhB,GACG;AACA,kBAAI,iBAAJ,CAFH,GAGG;AACA,kBAAI,MAAJ,CALJ;AAMA,GAPD,MAOO;AACNG,IAAAA,iBAAiB,GAChBf,WAAW,KAAKY,4BAAhB,GACG;AACA,uBAAS,cAAI,eAAJ,CAAT,EAAgCL,WAAhC,CAFH,GAGG;AACAA,IAAAA,WALJ;AAMA;AAED;;;AACA,SACC,wCACC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGG,oBADX;AAEC,IAAA,SAAS,EAAG,yBACX,wCADW,EAEX;AACC,mBAAaV,WAAW,KAAKY;AAD9B,KAFW,CAFb;AAQC,kBAAaG,iBARd;AASC,kBACCd,mBAAmB,GAAG,cAAI,MAAJ,CAAH,GAAkBM;AAVvC,KAaGN,mBAAmB,GAAG,cAAI,MAAJ,CAAH,GAAkBM,WAbxC,CADD,CADD,EAkBC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGM,iBADX;AAEC,IAAA,SAAS,EAAG,yBACX,wCADW,EAEX;AACC,mBAAab,WAAW,KAAKc;AAD9B,KAFW,CAFb;AAQC,kBACCd,WAAW,KAAKc,yBAAhB,GACG;AACA,kBAAI,kBAAJ,CAFH,GAGG;AACA,kBAAI,OAAJ,CAbL;AAeC,kBAAa,cAAI,OAAJ;AAfd,KAiBG,cAAI,OAAJ,CAjBH,CADD,CAlBD,CADD;AA0CA,CAhFD;;eAkFef,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../../../store/constants';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';\nimport { store as editSiteStore } from '../../../store';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { hasPageContentFocus, entityType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, hasPageContentFocus: _hasPageContentFocus } =\n\t\t\tselect( editSiteStore );\n\n\t\treturn {\n\t\t\thasPageContentFocus: _hasPageContentFocus(),\n\t\t\tentityType: getEditedPostType(),\n\t\t};\n\t} );\n\n\tconst entityLabel =\n\t\tentityType === 'wp_navigation' ? __( 'Navigation' ) : __( 'Template' );\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst openTemplateSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\tconst openBlockSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\n\tlet templateAriaLabel;\n\tif ( hasPageContentFocus ) {\n\t\ttemplateAriaLabel =\n\t\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t\t __( 'Page (selected)' )\n\t\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t\t __( 'Page' );\n\t} else {\n\t\ttemplateAriaLabel =\n\t\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t\t sprintf( __( '%s (selected)' ), entityLabel )\n\t\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t\t entityLabel;\n\t}\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openTemplateSettings }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-sidebar-edit-mode__panel-tab',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-active': sidebarName === SIDEBAR_TEMPLATE,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\tdata-label={\n\t\t\t\t\t\thasPageContentFocus ? __( 'Page' ) : entityLabel\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ hasPageContentFocus ? __( 'Page' ) : entityLabel }\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-sidebar-edit-mode__panel-tab',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-active': sidebarName === SIDEBAR_BLOCK,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\taria-label={\n\t\t\t\t\t\tsidebarName === SIDEBAR_BLOCK\n\t\t\t\t\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t\t\t\t\t __( 'Block (selected)' )\n\t\t\t\t\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t\t\t\t\t __( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Block' ) }\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/settings-header/index.js"],"names":["entityLabels","wp_navigation","wp_block","wp_template","SettingsHeader","sidebarName","hasPageContentFocus","entityType","select","getEditedPostType","_hasPageContentFocus","editSiteStore","entityLabel","enableComplementaryArea","interfaceStore","openTemplateSettings","STORE_NAME","SIDEBAR_TEMPLATE","openBlockSettings","SIDEBAR_BLO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,uBAAS,cAAI,eAAJ,CAAT,EAAgCL,WAAhC,CAFH,GAGG;AACAA,IAAAA,WALJ;AAMA;AAED;;;AACA,SACC,wCACC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGG,oBADX;AAEC,IAAA,SAAS,EAAG,yBACX,wCADW,EAEX;AACC,mBAAaV,WAAW,KAAKY;AAD9B,KAFW,CAFb;AAQC,kBAAaG,iBARd;AASC,kBACCd,mBAAmB,GAAG,cAAI,MAAJ,CAAH,GAAkBM;AAVvC,KAaGN,mBAAmB,GAAG,cAAI,MAAJ,CAAH,GAAkBM,WAbxC,CADD,CADD,EAkBC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGM,iBADX;AAEC,IAAA,SAAS,EAAG,yBACX,wCADW,EAEX;AACC,mBAAab,WAAW,KAAKc;AAD9B,KAFW,CAFb;AAQC,kBACCd,WAAW,KAAKc,yBAAhB,GACG;AACA,kBAAI,kBAAJ,CAFH,GAGG;AACA,kBAAI,OAAJ,CAbL;AAeC,kBAAa,cAAI,OAAJ;AAfd,KAiBG,cAAI,OAAJ,CAjBH,CADD,CAlBD,CADD;AA0CA,CA/ED;;eAiFef,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../../../store/constants';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';\nimport { store as editSiteStore } from '../../../store';\n\nconst entityLabels = {\n\twp_navigation: __( 'Navigation' ),\n\twp_block: __( 'Pattern' ),\n\twp_template: __( 'Template' ),\n};\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { hasPageContentFocus, entityType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, hasPageContentFocus: _hasPageContentFocus } =\n\t\t\tselect( editSiteStore );\n\n\t\treturn {\n\t\t\thasPageContentFocus: _hasPageContentFocus(),\n\t\t\tentityType: getEditedPostType(),\n\t\t};\n\t} );\n\n\tconst entityLabel = entityLabels[ entityType ] || entityLabels.wp_template;\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst openTemplateSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\tconst openBlockSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\n\tlet templateAriaLabel;\n\tif ( hasPageContentFocus ) {\n\t\ttemplateAriaLabel =\n\t\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t\t __( 'Page (selected)' )\n\t\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t\t __( 'Page' );\n\t} else {\n\t\ttemplateAriaLabel =\n\t\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t\t sprintf( __( '%s (selected)' ), entityLabel )\n\t\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t\t entityLabel;\n\t}\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openTemplateSettings }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-sidebar-edit-mode__panel-tab',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-active': sidebarName === SIDEBAR_TEMPLATE,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\tdata-label={\n\t\t\t\t\t\thasPageContentFocus ? __( 'Page' ) : entityLabel\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ hasPageContentFocus ? __( 'Page' ) : entityLabel }\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-sidebar-edit-mode__panel-tab',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-active': sidebarName === SIDEBAR_BLOCK,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\taria-label={\n\t\t\t\t\t\tsidebarName === SIDEBAR_BLOCK\n\t\t\t\t\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t\t\t\t\t __( 'Block (selected)' )\n\t\t\t\t\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t\t\t\t\t __( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Block' ) }\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"]}
@@ -57,9 +57,7 @@ function SidebarNavigationScreen({
57
57
  const {
58
58
  getTheme
59
59
  } = (0, _data.useSelect)(_coreData.store);
60
- const {
61
- goTo
62
- } = (0, _components.__experimentalUseNavigator)();
60
+ const navigator = (0, _components.__experimentalUseNavigator)();
63
61
  const theme = getTheme((0, _isPreviewingTheme.currentlyPreviewingTheme)());
64
62
  const icon = (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft;
65
63
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.__experimentalVStack, {
@@ -70,23 +68,35 @@ function SidebarNavigationScreen({
70
68
  spacing: 4,
71
69
  alignment: "flex-start",
72
70
  className: "edit-site-sidebar-navigation-screen__title-icon"
73
- }, !isRoot && !backPath && (0, _element.createElement)(_components.__experimentalNavigatorToParentButton, {
74
- as: _sidebarButton.default,
75
- icon: (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft,
76
- "aria-label": (0, _i18n.__)('Back')
71
+ }, !isRoot && !backPath && (0, _element.createElement)(_sidebarButton.default, {
72
+ onClick: () => {
73
+ if (navigator.location.isInitial) {
74
+ navigator.goToParent({
75
+ replace: true
76
+ });
77
+ } else {
78
+ navigator.goBack();
79
+ }
80
+ },
81
+ icon: icon,
82
+ label: (0, _i18n.__)('Back'),
83
+ showTooltip: false
77
84
  }), !isRoot && backPath && (0, _element.createElement)(_sidebarButton.default, {
78
- onClick: () => goTo(backPath, {
85
+ onClick: () => navigator.goTo(backPath, {
79
86
  isBack: true
80
87
  }),
81
88
  icon: icon,
82
- label: (0, _i18n.__)('Back')
89
+ label: (0, _i18n.__)('Back'),
90
+ showTooltip: false
83
91
  }), isRoot && (0, _element.createElement)(_sidebarButton.default, {
84
92
  icon: icon,
85
- label: !(0, _isPreviewingTheme.isPreviewingTheme)() ? (0, _i18n.__)('Go back to the Dashboard') : (0, _i18n.__)('Go back to the theme showcase'),
93
+ label: !(0, _isPreviewingTheme.isPreviewingTheme)() ? (0, _i18n.__)('Go to the Dashboard') : (0, _i18n.__)('Go back to the theme showcase'),
86
94
  href: !(0, _isPreviewingTheme.isPreviewingTheme)() ? dashboardLink || 'index.php' : 'themes.php'
87
95
  }), (0, _element.createElement)(_components.__experimentalHeading, {
88
96
  className: "edit-site-sidebar-navigation-screen__title",
89
- color: 'white',
97
+ color: '#e0e0e0'
98
+ /* $gray-200 */
99
+ ,
90
100
  level: 1,
91
101
  size: 20
92
102
  }, !(0, _isPreviewingTheme.isPreviewingTheme)() ? title : (0, _i18n.sprintf)('Previewing %1$s: %2$s', theme?.name?.rendered, title)), actions && (0, _element.createElement)("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","dashboardLink","select","getSettings","editSiteStore","__experimentalDashboardLink","getTheme","coreStore","goTo","theme","icon","chevronRight","chevronLeft","SidebarButton","isBack","name","rendered"],"mappings":";;;;;;;;;;;AAGA;;AAOA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AArBA;AACA;AACA;;AAaA;AACA;AACA;AASe,SAASA,uBAAT,CAAkC;AAChDC,EAAAA,MADgD;AAEhDC,EAAAA,KAFgD;AAGhDC,EAAAA,OAHgD;AAIhDC,EAAAA,IAJgD;AAKhDC,EAAAA,OALgD;AAMhDC,EAAAA,MANgD;AAOhDC,EAAAA,WAPgD;AAQhDC,EAAAA;AARgD,CAAlC,EASX;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoB,qBAAaC,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAkB,wBAAQD,MAAM,CAAEE,YAAF,CAAd,CAAxB;AACA,WAAO;AACNH,MAAAA,aAAa,EAAEE,WAAW,GAAGE;AADvB,KAAP;AAGA,GALyB,EAKvB,EALuB,CAA1B;AAMA,QAAM;AAAEC,IAAAA;AAAF,MAAe,qBAAWC,eAAX,CAArB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAW,6CAAjB;AACA,QAAMC,KAAK,GAAGH,QAAQ,CAAE,kDAAF,CAAtB;AACA,QAAMI,IAAI,GAAG,qBAAUC,mBAAV,GAAyBC,kBAAtC;AAEA,SACC,qDACC,4BAAC,gCAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,OAAO,EAAG,CAFX;AAGC,IAAA,OAAO,EAAC;AAHT,KAKC,4BAAC,gCAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAC,YAFX;AAGC,IAAA,SAAS,EAAC;AAHX,KAKG,CAAEnB,MAAF,IAAY,CAAEO,QAAd,IACD,4BAAC,iDAAD;AACC,IAAA,EAAE,EAAGa,sBADN;AAEC,IAAA,IAAI,EAAG,qBAAUF,mBAAV,GAAyBC,kBAFjC;AAGC,kBAAa,cAAI,MAAJ;AAHd,IANF,EAYG,CAAEnB,MAAF,IAAYO,QAAZ,IACD,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAG,MAAMQ,IAAI,CAAER,QAAF,EAAY;AAAEc,MAAAA,MAAM,EAAE;AAAV,KAAZ,CADrB;AAEC,IAAA,IAAI,EAAGJ,IAFR;AAGC,IAAA,KAAK,EAAG,cAAI,MAAJ;AAHT,IAbF,EAmBGjB,MAAM,IACP,4BAAC,sBAAD;AACC,IAAA,IAAI,EAAGiB,IADR;AAEC,IAAA,KAAK,EACJ,CAAE,2CAAF,GACG,cAAI,0BAAJ,CADH,GAEG,cAAI,+BAAJ,CALL;AAOC,IAAA,IAAI,EACH,CAAE,2CAAF,GACGT,aAAa,IAAI,WADpB,GAEG;AAVL,IApBF,EAkCC,4BAAC,iCAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,KAAK,EAAG,OAFT;AAGC,IAAA,KAAK,EAAG,CAHT;AAIC,IAAA,IAAI,EAAG;AAJR,KAMG,CAAE,2CAAF,GACCP,KADD,GAEC,mBACA,uBADA,EAEAe,KAAK,EAAEM,IAAP,EAAaC,QAFb,EAGAtB,KAHA,CARJ,CAlCD,EAgDGC,OAAO,IACR;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,OADH,CAjDF,CALD,EA2DGC,IAAI,IACL,qDACC;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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","dashboardLink","select","getSettings","editSiteStore","__experimentalDashboardLink","getTheme","coreStore","navigator","theme","icon","chevronRight","chevronLeft","location","isInitial","goToParent","replace","goBack","goTo","isBack","name","rendered"],"mappings":";;;;;;;;;;;AAGA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAYA;AACA;AACA;AASe,SAASA,uBAAT,CAAkC;AAChDC,EAAAA,MADgD;AAEhDC,EAAAA,KAFgD;AAGhDC,EAAAA,OAHgD;AAIhDC,EAAAA,IAJgD;AAKhDC,EAAAA,OALgD;AAMhDC,EAAAA,MANgD;AAOhDC,EAAAA,WAPgD;AAQhDC,EAAAA;AARgD,CAAlC,EASX;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoB,qBAAaC,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAkB,wBAAQD,MAAM,CAAEE,YAAF,CAAd,CAAxB;AACA,WAAO;AACNH,MAAAA,aAAa,EAAEE,WAAW,GAAGE;AADvB,KAAP;AAGA,GALyB,EAKvB,EALuB,CAA1B;AAMA,QAAM;AAAEC,IAA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AAOC,IAAA,IAAI,EACH,CAAE,2CAAF,GACGT,aAAa,IAAI,WADpB,GAEG;AAVL,IA9BF,EA4CC,4BAAC,iCAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,KAAK,EAAG;AAAU;AAFnB;AAGC,IAAA,KAAK,EAAG,CAHT;AAIC,IAAA,IAAI,EAAG;AAJR,KAMG,CAAE,2CAAF,GACCP,KADD,GAEC,mBACA,uBADA,EAEAe,KAAK,EAAEW,IAAP,EAAaC,QAFb,EAGA3B,KAHA,CARJ,CA5CD,EA0DGC,OAAO,IACR;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,OADH,CA3DF,CALD,EAqEGC,IAAI,IACL,qDACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,IADH,CADD,CAtEF,EA6EC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGG,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CAFF,EAMGF,OANH,CA7ED,CADD,EAuFGC,MAAM,IACP;AAAQ,IAAA,SAAS,EAAC;AAAlB,KACGA,MADH,CAxFF,CADD;AA+FA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\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 navigator = 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<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( navigator.location.isInitial ) {\n\t\t\t\t\t\t\t\t\tnavigator.goToParent( { replace: true } );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnavigator.goBack();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\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\tshowTooltip={ false }\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={ () =>\n\t\t\t\t\t\t\t\tnavigator.goTo( backPath, { isBack: true } )\n\t\t\t\t\t\t\t}\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\tshowTooltip={ false }\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 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={ '#e0e0e0' /* $gray-200 */ }\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"]}
@@ -26,6 +26,10 @@ var _blockEditor = require("@wordpress/block-editor");
26
26
 
27
27
  var _date = require("@wordpress/date");
28
28
 
29
+ var _notices = require("@wordpress/notices");
30
+
31
+ var _preferences = require("@wordpress/preferences");
32
+
29
33
  var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
30
34
 
31
35
  var _styleVariationsContainer = _interopRequireDefault(require("../global-styles/style-variations-container"));
@@ -58,6 +62,28 @@ function SidebarNavigationItemGlobalStyles(props) {
58
62
  const {
59
63
  setCanvasMode
60
64
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
65
+ const {
66
+ createNotice
67
+ } = (0, _data.useDispatch)(_notices.store);
68
+ const {
69
+ set: setPreference
70
+ } = (0, _data.useDispatch)(_preferences.store);
71
+ const {
72
+ get: getPrefference
73
+ } = (0, _data.useSelect)(_preferences.store);
74
+ const turnOffDistractionFreeMode = (0, _element.useCallback)(() => {
75
+ const isDistractionFree = getPrefference(_store.store.name, 'distractionFree');
76
+
77
+ if (!isDistractionFree) {
78
+ return;
79
+ }
80
+
81
+ setPreference(_store.store.name, 'distractionFree', false);
82
+ createNotice('info', (0, _i18n.__)('Distraction free mode turned off'), {
83
+ isDismissible: true,
84
+ type: 'snackbar'
85
+ });
86
+ }, [createNotice, setPreference, getPrefference]);
61
87
  const hasGlobalStyleVariations = (0, _data.useSelect)(select => !!select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []);
62
88
 
63
89
  if (hasGlobalStyleVariations) {
@@ -69,8 +95,9 @@ function SidebarNavigationItemGlobalStyles(props) {
69
95
 
70
96
  return (0, _element.createElement)(_sidebarNavigationItem.default, { ...props,
71
97
  onClick: () => {
72
- // switch to edit mode.
73
- setCanvasMode('edit'); // open global styles sidebar.
98
+ turnOffDistractionFreeMode(); // Switch to edit mode.
99
+
100
+ setCanvasMode('edit'); // Open global styles sidebar.
74
101
 
75
102
  openGeneralSidebar('edit-site/global-styles');
76
103
  }
@@ -165,8 +192,45 @@ function SidebarNavigationScreenGlobalStyles() {
165
192
  setCanvasMode,
166
193
  setEditorCanvasContainerView
167
194
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
168
- const isStyleBookOpened = (0, _data.useSelect)(select => 'style-book' === (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(), []);
169
- const openGlobalStyles = (0, _element.useCallback)(async () => Promise.all([setCanvasMode('edit'), openGeneralSidebar('edit-site/global-styles')]), [setCanvasMode, openGeneralSidebar]);
195
+ const {
196
+ createNotice
197
+ } = (0, _data.useDispatch)(_notices.store);
198
+ const {
199
+ set: setPreference
200
+ } = (0, _data.useDispatch)(_preferences.store);
201
+ const {
202
+ get: getPrefference
203
+ } = (0, _data.useSelect)(_preferences.store);
204
+ const {
205
+ isViewMode,
206
+ isStyleBookOpened
207
+ } = (0, _data.useSelect)(select => {
208
+ const {
209
+ getCanvasMode,
210
+ getEditorCanvasContainerView
211
+ } = (0, _lockUnlock.unlock)(select(_store.store));
212
+ return {
213
+ isViewMode: 'view' === getCanvasMode(),
214
+ isStyleBookOpened: 'style-book' === getEditorCanvasContainerView()
215
+ };
216
+ }, []);
217
+ const turnOffDistractionFreeMode = (0, _element.useCallback)(() => {
218
+ const isDistractionFree = getPrefference(_store.store.name, 'distractionFree');
219
+
220
+ if (!isDistractionFree) {
221
+ return;
222
+ }
223
+
224
+ setPreference(_store.store.name, 'distractionFree', false);
225
+ createNotice('info', (0, _i18n.__)('Distraction free mode turned off'), {
226
+ isDismissible: true,
227
+ type: 'snackbar'
228
+ });
229
+ }, [createNotice, setPreference, getPrefference]);
230
+ const openGlobalStyles = (0, _element.useCallback)(async () => {
231
+ turnOffDistractionFreeMode();
232
+ return Promise.all([setCanvasMode('edit'), openGeneralSidebar('edit-site/global-styles')]);
233
+ }, [setCanvasMode, openGeneralSidebar, turnOffDistractionFreeMode]);
170
234
  const openStyleBook = (0, _element.useCallback)(async () => {
171
235
  await openGlobalStyles(); // Open the Style Book once the canvas mode is set to edit,
172
236
  // and the global styles sidebar is open. This ensures that
@@ -200,7 +264,7 @@ function SidebarNavigationScreenGlobalStyles() {
200
264
  label: (0, _i18n.__)('Edit styles'),
201
265
  onClick: async () => await openGlobalStyles()
202
266
  }))
203
- }), isStyleBookOpened && !isMobileViewport && (0, _element.createElement)(_styleBook.default, {
267
+ }), isStyleBookOpened && !isMobileViewport && isViewMode && (0, _element.createElement)(_styleBook.default, {
204
268
  enableResizing: false,
205
269
  isSelected: () => false,
206
270
  onClick: openStyleBook,