@wordpress/edit-site 5.34.0 → 5.35.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 (371) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/build/components/add-new-template/index.js +2 -2
  3. package/build/components/add-new-template/index.js.map +1 -1
  4. package/build/components/app/index.js +4 -2
  5. package/build/components/app/index.js.map +1 -1
  6. package/build/components/block-editor/editor-canvas.js +4 -18
  7. package/build/components/block-editor/editor-canvas.js.map +1 -1
  8. package/build/components/block-editor/site-editor-canvas.js +2 -2
  9. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  10. package/build/components/dataviews-actions/index.js +46 -0
  11. package/build/components/dataviews-actions/index.js.map +1 -0
  12. package/build/components/editor/index.js +68 -12
  13. package/build/components/editor/index.js.map +1 -1
  14. package/build/components/global-styles/background-panel.js +13 -1
  15. package/build/components/global-styles/background-panel.js.map +1 -1
  16. package/build/components/global-styles/color-indicator-wrapper.js +2 -2
  17. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  18. package/build/components/global-styles/color-palette-panel.js +5 -2
  19. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  20. package/build/components/global-styles/gradients-palette-panel.js +1 -2
  21. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  22. package/build/components/global-styles/hooks.js +5 -2
  23. package/build/components/global-styles/hooks.js.map +1 -1
  24. package/build/components/global-styles/icon-with-current-color.js +2 -2
  25. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  26. package/build/components/global-styles/preset-colors.js +29 -0
  27. package/build/components/global-styles/preset-colors.js.map +1 -0
  28. package/build/components/global-styles/preview-colors.js +3 -7
  29. package/build/components/global-styles/preview-colors.js.map +1 -1
  30. package/build/components/global-styles/screen-color-palette.js +5 -5
  31. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  32. package/build/components/global-styles/screen-colors.js +1 -4
  33. package/build/components/global-styles/screen-colors.js.map +1 -1
  34. package/build/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  35. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  36. package/build/components/global-styles/typography-example.js +5 -2
  37. package/build/components/global-styles/typography-example.js.map +1 -1
  38. package/build/components/global-styles/ui.js +4 -1
  39. package/build/components/global-styles/ui.js.map +1 -1
  40. package/build/components/global-styles/variations/variation.js +12 -6
  41. package/build/components/global-styles/variations/variation.js.map +1 -1
  42. package/build/components/global-styles/variations/variations-color.js +5 -5
  43. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  44. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  45. package/build/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
  46. package/build/components/global-styles-sidebar/index.js.map +1 -0
  47. package/build/components/header-edit-mode/index.js +20 -120
  48. package/build/components/header-edit-mode/index.js.map +1 -1
  49. package/build/components/layout/index.js +3 -6
  50. package/build/components/layout/index.js.map +1 -1
  51. package/build/components/layout/router.js +69 -14
  52. package/build/components/layout/router.js.map +1 -1
  53. package/build/components/page/index.js +2 -2
  54. package/build/components/page/index.js.map +1 -1
  55. package/build/components/page-pages/index.js +4 -15
  56. package/build/components/page-pages/index.js.map +1 -1
  57. package/build/components/page-patterns/dataviews-pattern-actions.js +4 -80
  58. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  59. package/build/components/page-patterns/index.js +9 -20
  60. package/build/components/page-patterns/index.js.map +1 -1
  61. package/build/components/page-templates/index.js +6 -14
  62. package/build/components/page-templates/index.js.map +1 -1
  63. package/build/components/pagination/index.js +2 -2
  64. package/build/components/pagination/index.js.map +1 -1
  65. package/build/components/resizable-frame/index.js +11 -3
  66. package/build/components/resizable-frame/index.js.map +1 -1
  67. package/build/components/revisions/index.js +5 -2
  68. package/build/components/revisions/index.js.map +1 -1
  69. package/build/components/save-panel/index.js +4 -4
  70. package/build/components/save-panel/index.js.map +1 -1
  71. package/build/components/sidebar/index.js +61 -31
  72. package/build/components/sidebar/index.js.map +1 -1
  73. package/build/components/sidebar-button/index.js +2 -2
  74. package/build/components/sidebar-button/index.js.map +1 -1
  75. package/build/components/sidebar-dataviews/dataview-item.js +2 -2
  76. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  77. package/build/components/sidebar-navigation-item/index.js +5 -3
  78. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  79. package/build/components/sidebar-navigation-screen/index.js +6 -32
  80. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  81. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  82. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  83. package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -1
  84. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  85. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
  86. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  87. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
  88. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  89. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  90. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  91. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
  92. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  93. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
  94. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  95. package/build/components/sidebar-navigation-screen-page/status-label.js +2 -2
  96. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  97. package/build/components/sidebar-navigation-screen-pattern/index.js +4 -9
  98. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  99. package/build/components/sidebar-navigation-screen-patterns/index.js +4 -14
  100. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  101. package/build/components/sidebar-navigation-screen-template/index.js +4 -1
  102. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  103. package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -1
  104. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  105. package/build/components/site-hub/index.js +3 -3
  106. package/build/components/site-hub/index.js.map +1 -1
  107. package/build/components/site-icon/index.js +2 -2
  108. package/build/components/site-icon/index.js.map +1 -1
  109. package/build/components/style-book/index.js +10 -7
  110. package/build/components/style-book/index.js.map +1 -1
  111. package/build/components/template-part-converter/index.js +18 -1
  112. package/build/components/template-part-converter/index.js.map +1 -1
  113. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -2
  114. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  115. package/build/utils/get-is-list-page.js +1 -1
  116. package/build/utils/get-is-list-page.js.map +1 -1
  117. package/build/utils/use-activate-theme.js +9 -6
  118. package/build/utils/use-activate-theme.js.map +1 -1
  119. package/build-module/components/add-new-template/index.js +2 -2
  120. package/build-module/components/add-new-template/index.js.map +1 -1
  121. package/build-module/components/app/index.js +4 -2
  122. package/build-module/components/app/index.js.map +1 -1
  123. package/build-module/components/block-editor/editor-canvas.js +4 -18
  124. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  125. package/build-module/components/block-editor/site-editor-canvas.js +2 -2
  126. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  127. package/build-module/components/dataviews-actions/index.js +38 -0
  128. package/build-module/components/dataviews-actions/index.js.map +1 -0
  129. package/build-module/components/editor/index.js +69 -13
  130. package/build-module/components/editor/index.js.map +1 -1
  131. package/build-module/components/global-styles/background-panel.js +12 -1
  132. package/build-module/components/global-styles/background-panel.js.map +1 -1
  133. package/build-module/components/global-styles/color-indicator-wrapper.js +2 -2
  134. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  135. package/build-module/components/global-styles/color-palette-panel.js +4 -2
  136. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  137. package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
  138. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  139. package/build-module/components/global-styles/hooks.js +4 -1
  140. package/build-module/components/global-styles/hooks.js.map +1 -1
  141. package/build-module/components/global-styles/icon-with-current-color.js +2 -2
  142. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  143. package/build-module/components/global-styles/preset-colors.js +22 -0
  144. package/build-module/components/global-styles/preset-colors.js.map +1 -0
  145. package/build-module/components/global-styles/preview-colors.js +3 -7
  146. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  147. package/build-module/components/global-styles/screen-color-palette.js +5 -5
  148. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  149. package/build-module/components/global-styles/screen-colors.js +1 -4
  150. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  151. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  152. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  153. package/build-module/components/global-styles/typography-example.js +4 -1
  154. package/build-module/components/global-styles/typography-example.js.map +1 -1
  155. package/build-module/components/global-styles/ui.js +4 -1
  156. package/build-module/components/global-styles/ui.js.map +1 -1
  157. package/build-module/components/global-styles/variations/variation.js +11 -5
  158. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  159. package/build-module/components/global-styles/variations/variations-color.js +6 -6
  160. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  161. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  162. package/build-module/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
  163. package/build-module/components/global-styles-sidebar/index.js.map +1 -0
  164. package/build-module/components/header-edit-mode/index.js +20 -120
  165. package/build-module/components/header-edit-mode/index.js.map +1 -1
  166. package/build-module/components/layout/index.js +3 -6
  167. package/build-module/components/layout/index.js.map +1 -1
  168. package/build-module/components/layout/router.js +69 -15
  169. package/build-module/components/layout/router.js.map +1 -1
  170. package/build-module/components/page/index.js +2 -2
  171. package/build-module/components/page/index.js.map +1 -1
  172. package/build-module/components/page-pages/index.js +4 -15
  173. package/build-module/components/page-pages/index.js.map +1 -1
  174. package/build-module/components/page-patterns/dataviews-pattern-actions.js +4 -80
  175. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  176. package/build-module/components/page-patterns/index.js +10 -21
  177. package/build-module/components/page-patterns/index.js.map +1 -1
  178. package/build-module/components/page-templates/index.js +6 -14
  179. package/build-module/components/page-templates/index.js.map +1 -1
  180. package/build-module/components/pagination/index.js +2 -2
  181. package/build-module/components/pagination/index.js.map +1 -1
  182. package/build-module/components/resizable-frame/index.js +12 -4
  183. package/build-module/components/resizable-frame/index.js.map +1 -1
  184. package/build-module/components/revisions/index.js +4 -1
  185. package/build-module/components/revisions/index.js.map +1 -1
  186. package/build-module/components/save-panel/index.js +4 -4
  187. package/build-module/components/save-panel/index.js.map +1 -1
  188. package/build-module/components/sidebar/index.js +62 -32
  189. package/build-module/components/sidebar/index.js.map +1 -1
  190. package/build-module/components/sidebar-button/index.js +2 -2
  191. package/build-module/components/sidebar-button/index.js.map +1 -1
  192. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
  193. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  194. package/build-module/components/sidebar-navigation-item/index.js +5 -3
  195. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  196. package/build-module/components/sidebar-navigation-screen/index.js +6 -32
  197. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  198. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  199. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  200. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +4 -1
  201. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  202. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
  203. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  204. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
  205. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  206. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  207. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  208. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
  209. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  210. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
  211. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  212. package/build-module/components/sidebar-navigation-screen-page/status-label.js +2 -2
  213. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  214. package/build-module/components/sidebar-navigation-screen-pattern/index.js +4 -9
  215. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  216. package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -14
  217. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  218. package/build-module/components/sidebar-navigation-screen-template/index.js +4 -1
  219. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  220. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -1
  221. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  222. package/build-module/components/site-hub/index.js +3 -3
  223. package/build-module/components/site-hub/index.js.map +1 -1
  224. package/build-module/components/site-icon/index.js +2 -2
  225. package/build-module/components/site-icon/index.js.map +1 -1
  226. package/build-module/components/style-book/index.js +9 -6
  227. package/build-module/components/style-book/index.js.map +1 -1
  228. package/build-module/components/template-part-converter/index.js +18 -1
  229. package/build-module/components/template-part-converter/index.js.map +1 -1
  230. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +4 -1
  231. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  232. package/build-module/utils/get-is-list-page.js +1 -1
  233. package/build-module/utils/get-is-list-page.js.map +1 -1
  234. package/build-module/utils/use-activate-theme.js +9 -6
  235. package/build-module/utils/use-activate-theme.js.map +1 -1
  236. package/build-style/style-rtl.css +144 -374
  237. package/build-style/style.css +144 -374
  238. package/package.json +43 -45
  239. package/src/components/add-new-template/index.js +2 -2
  240. package/src/components/app/index.js +5 -2
  241. package/src/components/block-editor/editor-canvas.js +6 -26
  242. package/src/components/block-editor/site-editor-canvas.js +2 -2
  243. package/src/components/block-editor/style.scss +2 -2
  244. package/src/components/dataviews-actions/index.js +38 -0
  245. package/src/components/editor/index.js +76 -16
  246. package/src/components/editor/style.scss +0 -4
  247. package/src/components/global-styles/background-panel.js +17 -2
  248. package/src/components/global-styles/color-indicator-wrapper.js +2 -2
  249. package/src/components/global-styles/color-palette-panel.js +3 -4
  250. package/src/components/global-styles/gradients-palette-panel.js +1 -4
  251. package/src/components/global-styles/hooks.js +2 -1
  252. package/src/components/global-styles/icon-with-current-color.js +2 -2
  253. package/src/components/global-styles/preset-colors.js +18 -0
  254. package/src/components/global-styles/preview-colors.js +4 -7
  255. package/src/components/global-styles/screen-color-palette.js +4 -4
  256. package/src/components/global-styles/screen-colors.js +0 -2
  257. package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  258. package/src/components/global-styles/stories/index.story.js +2 -1
  259. package/src/components/global-styles/typography-example.js +2 -1
  260. package/src/components/global-styles/ui.js +5 -1
  261. package/src/components/global-styles/variations/style.scss +15 -31
  262. package/src/components/global-styles/variations/variation.js +13 -10
  263. package/src/components/global-styles/variations/variations-color.js +5 -8
  264. package/src/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +7 -2
  265. package/src/components/{sidebar-edit-mode → global-styles-sidebar}/style.scss +0 -11
  266. package/src/components/header-edit-mode/index.js +25 -164
  267. package/src/components/header-edit-mode/style.scss +1 -199
  268. package/src/components/layout/index.js +3 -8
  269. package/src/components/layout/router.js +65 -15
  270. package/src/components/layout/style.scss +2 -1
  271. package/src/components/page/index.js +2 -2
  272. package/src/components/page-pages/index.js +8 -38
  273. package/src/components/page-pages/style.scss +0 -11
  274. package/src/components/page-patterns/dataviews-pattern-actions.js +3 -92
  275. package/src/components/page-patterns/index.js +16 -35
  276. package/src/components/page-templates/index.js +10 -29
  277. package/src/components/pagination/index.js +2 -2
  278. package/src/components/resizable-frame/index.js +16 -4
  279. package/src/components/revisions/index.js +2 -1
  280. package/src/components/save-panel/index.js +4 -4
  281. package/src/components/sidebar/index.js +61 -37
  282. package/src/components/sidebar-button/index.js +2 -5
  283. package/src/components/sidebar-dataviews/dataview-item.js +4 -7
  284. package/src/components/sidebar-navigation-item/index.js +3 -3
  285. package/src/components/sidebar-navigation-screen/index.js +7 -31
  286. package/src/components/sidebar-navigation-screen/style.scss +11 -9
  287. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  288. package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -1
  289. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
  290. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +18 -1
  291. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  292. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +8 -4
  293. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +0 -10
  294. package/src/components/sidebar-navigation-screen-page/status-label.js +2 -2
  295. package/src/components/sidebar-navigation-screen-pattern/index.js +2 -8
  296. package/src/components/sidebar-navigation-screen-patterns/index.js +2 -13
  297. package/src/components/sidebar-navigation-screen-template/index.js +2 -1
  298. package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -1
  299. package/src/components/site-hub/index.js +3 -3
  300. package/src/components/site-icon/index.js +2 -2
  301. package/src/components/style-book/index.js +7 -6
  302. package/src/components/template-part-converter/index.js +16 -3
  303. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
  304. package/src/style.scss +1 -11
  305. package/src/utils/get-is-list-page.js +1 -3
  306. package/src/utils/use-activate-theme.js +4 -4
  307. package/build/components/global-styles/global-styles-provider.js +0 -129
  308. package/build/components/global-styles/global-styles-provider.js.map +0 -1
  309. package/build/components/header-edit-mode/document-tools/index.js +0 -68
  310. package/build/components/header-edit-mode/document-tools/index.js.map +0 -1
  311. package/build/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  312. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  313. package/build/components/sidebar-edit-mode/index.js +0 -147
  314. package/build/components/sidebar-edit-mode/index.js.map +0 -1
  315. package/build/components/sidebar-edit-mode/page-panels/index.js +0 -129
  316. package/build/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  317. package/build/components/sidebar-edit-mode/page-panels/page-content.js +0 -34
  318. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  319. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +0 -46
  320. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  321. package/build/components/sidebar-edit-mode/settings-header/index.js +0 -42
  322. package/build/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  323. package/build/components/sidebar-edit-mode/template-panel/hooks.js +0 -86
  324. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  325. package/build/components/sidebar-edit-mode/template-panel/index.js +0 -127
  326. package/build/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  327. package/build/components/start-template-options/index.js +0 -191
  328. package/build/components/start-template-options/index.js.map +0 -1
  329. package/build/utils/math.js +0 -98
  330. package/build/utils/math.js.map +0 -1
  331. package/build-module/components/global-styles/global-styles-provider.js +0 -120
  332. package/build-module/components/global-styles/global-styles-provider.js.map +0 -1
  333. package/build-module/components/header-edit-mode/document-tools/index.js +0 -61
  334. package/build-module/components/header-edit-mode/document-tools/index.js.map +0 -1
  335. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  336. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  337. package/build-module/components/sidebar-edit-mode/index.js +0 -138
  338. package/build-module/components/sidebar-edit-mode/index.js.map +0 -1
  339. package/build-module/components/sidebar-edit-mode/page-panels/index.js +0 -121
  340. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  341. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +0 -27
  342. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  343. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -39
  344. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  345. package/build-module/components/sidebar-edit-mode/settings-header/index.js +0 -35
  346. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  347. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +0 -79
  348. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  349. package/build-module/components/sidebar-edit-mode/template-panel/index.js +0 -119
  350. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  351. package/build-module/components/start-template-options/index.js +0 -184
  352. package/build-module/components/start-template-options/index.js.map +0 -1
  353. package/build-module/utils/math.js +0 -92
  354. package/build-module/utils/math.js.map +0 -1
  355. package/src/components/global-styles/global-styles-provider.js +0 -162
  356. package/src/components/header-edit-mode/document-tools/index.js +0 -68
  357. package/src/components/sidebar-edit-mode/index.js +0 -173
  358. package/src/components/sidebar-edit-mode/page-panels/index.js +0 -133
  359. package/src/components/sidebar-edit-mode/page-panels/page-content.js +0 -29
  360. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +0 -61
  361. package/src/components/sidebar-edit-mode/settings-header/index.js +0 -43
  362. package/src/components/sidebar-edit-mode/settings-header/style.scss +0 -14
  363. package/src/components/sidebar-edit-mode/template-panel/hooks.js +0 -114
  364. package/src/components/sidebar-edit-mode/template-panel/index.js +0 -134
  365. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -16
  366. package/src/components/start-template-options/index.js +0 -231
  367. package/src/components/start-template-options/style.scss +0 -55
  368. package/src/utils/math.js +0 -93
  369. /package/build/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  370. /package/build-module/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  371. /package/src/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
@@ -13,12 +13,12 @@ import { store as editorStore, privateApis as editorPrivateApis } from '@wordpre
13
13
  /**
14
14
  * Internal dependencies
15
15
  */
16
- import DefaultSidebar from './default-sidebar';
17
16
  import { GlobalStylesUI } from '../global-styles';
18
17
  import { store as editSiteStore } from '../../store';
19
18
  import { GlobalStylesMenuSlot } from '../global-styles/ui';
20
19
  import { unlock } from '../../lock-unlock';
21
20
  import { store as coreStore } from '@wordpress/core-data';
21
+ import DefaultSidebar from './default-sidebar';
22
22
  const {
23
23
  interfaceStore
24
24
  } = unlock(editorPrivateApis);
@@ -110,7 +110,8 @@ export default function GlobalStylesSidebar() {
110
110
  closeLabel: __('Close Styles'),
111
111
  panelClassName: "edit-site-global-styles-sidebar__panel",
112
112
  header: createElement(Flex, {
113
- className: "edit-site-global-styles-sidebar__header"
113
+ className: "edit-site-global-styles-sidebar__header",
114
+ gap: 1
114
115
  }, createElement(FlexBlock, {
115
116
  style: {
116
117
  minWidth: 'min-content'
@@ -122,14 +123,16 @@ export default function GlobalStylesSidebar() {
122
123
  label: __('Style Book'),
123
124
  isPressed: isStyleBookOpened || isRevisionsStyleBookOpened,
124
125
  disabled: shouldClearCanvasContainerView,
125
- onClick: toggleStyleBook
126
+ onClick: toggleStyleBook,
127
+ size: "compact"
126
128
  })), createElement(FlexItem, null, createElement(Button, {
127
129
  label: __('Revisions'),
128
130
  icon: backup,
129
131
  onClick: toggleRevisions,
130
132
  disabled: !hasRevisions,
131
- isPressed: isRevisionsOpened || isRevisionsStyleBookOpened
133
+ isPressed: isRevisionsOpened || isRevisionsStyleBookOpened,
134
+ size: "compact"
132
135
  })), createElement(GlobalStylesMenuSlot, null))
133
136
  }, createElement(GlobalStylesUI, null));
134
137
  }
135
- //# sourceMappingURL=global-styles-sidebar.js.map
138
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FlexItem","FlexBlock","Flex","Button","__experimentalUseNavigator","useNavigator","__","styles","seen","backup","useSelect","useDispatch","useEffect","store","preferencesStore","editorStore","privateApis","editorPrivateApis","GlobalStylesUI","editSiteStore","GlobalStylesMenuSlot","unlock","coreStore","DefaultSidebar","interfaceStore","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","hasRevisions","isRevisionsOpened","isRevisionsStyleBookOpened","select","getActiveComplementaryArea","getEditorCanvasContainerView","getCanvasMode","canvasContainerView","_isVisualEditorMode","getEditorMode","_isEditCanvasMode","_showListViewByDefault","get","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","setEditorCanvasContainerView","setIsListViewOpened","goTo","toggleRevisions","toggleStyleBook","createElement","className","identifier","title","icon","closeLabel","panelClassName","header","gap","style","minWidth","label","isPressed","disabled","onClick","size"],"sources":["@wordpress/edit-site/src/components/global-styles-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFlexItem,\n\tFlexBlock,\n\tFlex,\n\tButton,\n\t__experimentalUseNavigator as useNavigator,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen, backup } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\nimport { unlock } from '../../lock-unlock';\nimport { store as coreStore } from '@wordpress/core-data';\nimport DefaultSidebar from './default-sidebar';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function GlobalStylesSidebar() {\n\tconst {\n\t\tshouldClearCanvasContainerView,\n\t\tisStyleBookOpened,\n\t\tshowListViewByDefault,\n\t\thasRevisions,\n\t\tisRevisionsOpened,\n\t\tisRevisionsStyleBookOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEditorCanvasContainerView, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst canvasContainerView = getEditorCanvasContainerView();\n\t\tconst _isVisualEditorMode =\n\t\t\t'visual' === select( editorStore ).getEditorMode();\n\t\tconst _isEditCanvasMode = 'edit' === getCanvasMode();\n\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showListViewByDefault'\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === canvasContainerView,\n\t\t\tshouldClearCanvasContainerView:\n\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\tgetActiveComplementaryArea( 'core' ) ||\n\t\t\t\t! _isVisualEditorMode ||\n\t\t\t\t! _isEditCanvasMode,\n\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\thasRevisions:\n\t\t\t\t!! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count,\n\t\t\tisRevisionsStyleBookOpened:\n\t\t\t\t'global-styles-revisions:style-book' === canvasContainerView,\n\t\t\tisRevisionsOpened:\n\t\t\t\t'global-styles-revisions' === canvasContainerView,\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldClearCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ shouldClearCanvasContainerView ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst { goTo } = useNavigator();\n\n\tconst toggleRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t\treturn;\n\t\t}\n\t\tgoTo( '/revisions' );\n\n\t\tif ( isStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t} else {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t}\n\t};\n\tconst toggleStyleBook = () => {\n\t\tif ( isRevisionsOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\treturn;\n\t\t}\n\t\tsetIsListViewOpened( isStyleBookOpened && showListViewByDefault );\n\t\tsetEditorCanvasContainerView(\n\t\t\tisStyleBookOpened ? undefined : 'style-book'\n\t\t);\n\t};\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"edit-site-global-styles-sidebar__header\"\n\t\t\t\t\tgap={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<FlexBlock style={ { minWidth: 'min-content' } }>\n\t\t\t\t\t\t<h2 className=\"edit-site-global-styles-sidebar__header-title\">\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisStyleBookOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ shouldClearCanvasContainerView }\n\t\t\t\t\t\t\tonClick={ toggleStyleBook }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t\t\tonClick={ toggleRevisions }\n\t\t\t\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisRevisionsOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<GlobalStylesMenuSlot />\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\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,CACM,CAAC,EACZgD,aAAA,CAACtD,QAAQ,QACRsD,aAAA,CAACnD,MAAM;MACNuD,IAAI,EAAGlD,IAAM;MACbyD,KAAK,EAAG3D,EAAE,CAAE,YAAa,CAAG;MAC5B4D,SAAS,EACRvC,iBAAiB,IAAII,0BACrB;MACDoC,QAAQ,EAAGzC,8BAAgC;MAC3C0C,OAAO,EAAGf,eAAiB;MAC3BgB,IAAI,EAAC;IAAS,CACd,CACQ,CAAC,EACXf,aAAA,CAACtD,QAAQ,QACRsD,aAAA,CAACnD,MAAM;MACN8D,KAAK,EAAG3D,EAAE,CAAE,WAAY,CAAG;MAC3BoD,IAAI,EAAGjD,MAAQ;MACf2D,OAAO,EAAGhB,eAAiB;MAC3Be,QAAQ,EAAG,CAAEtC,YAAc;MAC3BqC,SAAS,EACRpC,iBAAiB,IAAIC,0BACrB;MACDsC,IAAI,EAAC;IAAS,CACd,CACQ,CAAC,EACXf,aAAA,CAAClC,oBAAoB,MAAE,CAClB;EACN,GAEDkC,aAAA,CAACpC,cAAc,MAAE,CACF,CAAC;AAEnB","ignoreList":[]}
@@ -1,142 +1,42 @@
1
1
  import { createElement } from "react";
2
- /**
3
- * External dependencies
4
- */
5
- import classnames from 'classnames';
6
-
7
2
  /**
8
3
  * WordPress dependencies
9
4
  */
10
- import { useViewportMatch, useReducedMotion } from '@wordpress/compose';
11
- import { store as blockEditorStore } from '@wordpress/block-editor';
5
+ import { privateApis as editorPrivateApis } from '@wordpress/editor';
12
6
  import { useSelect } from '@wordpress/data';
13
- import { useState } from '@wordpress/element';
14
- import { __unstableMotion as motion } from '@wordpress/components';
15
- import { store as preferencesStore } from '@wordpress/preferences';
16
- import { DocumentBar, PostSavedState, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
17
7
 
18
8
  /**
19
9
  * Internal dependencies
20
10
  */
21
- import SiteEditorMoreMenuItems from './more-menu';
22
- import SaveButton from '../save-button';
23
- import DocumentTools from './document-tools';
24
- import { store as editSiteStore } from '../../store';
25
- import { getEditorCanvasContainerTitle, useHasEditorCanvasContainer } from '../editor-canvas-container';
11
+ import SiteEditorMoreMenu from './more-menu';
26
12
  import { unlock } from '../../lock-unlock';
27
- import { FOCUSABLE_ENTITIES } from '../../utils/constants';
13
+ import SaveButton from '../save-button';
28
14
  import { isPreviewingTheme } from '../../utils/is-previewing-theme';
15
+ import { getEditorCanvasContainerTitle, useHasEditorCanvasContainer } from '../editor-canvas-container';
16
+ import { store as editSiteStore } from '../../store';
29
17
  const {
30
- CollapsableBlockToolbar,
31
- MoreMenu,
32
- PostViewLink,
33
- PreviewDropdown,
34
- PinnedItems,
35
- PostPublishButtonOrToggle
18
+ Header: EditorHeader
36
19
  } = unlock(editorPrivateApis);
37
- export default function HeaderEditMode({
20
+ function Header({
38
21
  setEntitiesSavedStatesCallback
39
22
  }) {
23
+ const _isPreviewingTheme = isPreviewingTheme();
24
+ const hasDefaultEditorCanvasView = !useHasEditorCanvasContainer();
40
25
  const {
41
- templateType,
42
- isDistractionFree,
43
- blockEditorMode,
44
- showIconLabels,
45
- editorCanvasView,
46
- isFixedToolbar,
47
- isPublishSidebarOpened
26
+ editorCanvasView
48
27
  } = useSelect(select => {
49
- const {
50
- getEditedPostType
51
- } = select(editSiteStore);
52
- const {
53
- __unstableGetEditorMode
54
- } = select(blockEditorStore);
55
- const {
56
- get: getPreference
57
- } = select(preferencesStore);
58
- const {
59
- getDeviceType
60
- } = select(editorStore);
61
28
  return {
62
- deviceType: getDeviceType(),
63
- templateType: getEditedPostType(),
64
- blockEditorMode: __unstableGetEditorMode(),
65
- showIconLabels: getPreference('core', 'showIconLabels'),
66
- editorCanvasView: unlock(select(editSiteStore)).getEditorCanvasContainerView(),
67
- isDistractionFree: getPreference('core', 'distractionFree'),
68
- isFixedToolbar: getPreference('core', 'fixedToolbar'),
69
- isPublishSidebarOpened: select(editorStore).isPublishSidebarOpened()
29
+ editorCanvasView: unlock(select(editSiteStore)).getEditorCanvasContainerView()
70
30
  };
71
31
  }, []);
72
- const isLargeViewport = useViewportMatch('medium');
73
- const showTopToolbar = isLargeViewport && isFixedToolbar && blockEditorMode !== 'zoom-out';
74
- const disableMotion = useReducedMotion();
75
- const hasDefaultEditorCanvasView = !useHasEditorCanvasContainer();
76
- const isFocusMode = FOCUSABLE_ENTITIES.includes(templateType);
77
- const isZoomedOutView = blockEditorMode === 'zoom-out';
78
- const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = useState(true);
79
- const toolbarVariants = {
80
- isDistractionFree: {
81
- y: '-50px'
82
- },
83
- isDistractionFreeHovering: {
84
- y: 0
85
- },
86
- view: {
87
- y: 0
88
- },
89
- edit: {
90
- y: 0
91
- }
92
- };
93
- const toolbarTransition = {
94
- type: 'tween',
95
- duration: disableMotion ? 0 : 0.2,
96
- ease: 'easeOut'
97
- };
98
- const _isPreviewingTheme = isPreviewingTheme();
99
- return createElement("div", {
100
- className: classnames('edit-site-header-edit-mode', {
101
- 'show-icon-labels': showIconLabels,
102
- 'show-block-toolbar': !isBlockToolsCollapsed && showTopToolbar
103
- })
104
- }, hasDefaultEditorCanvasView && createElement(motion.div, {
105
- className: "edit-site-header-edit-mode__start",
106
- variants: toolbarVariants,
107
- transition: toolbarTransition
108
- }, createElement(DocumentTools, {
109
- blockEditorMode: blockEditorMode,
110
- isDistractionFree: isDistractionFree
111
- }), showTopToolbar && createElement(CollapsableBlockToolbar, {
112
- isCollapsed: isBlockToolsCollapsed,
113
- onToggle: setIsBlockToolsCollapsed
114
- })), !isDistractionFree && createElement("div", {
115
- className: "edit-site-header-edit-mode__center"
116
- }, !hasDefaultEditorCanvasView ? getEditorCanvasContainerTitle(editorCanvasView) : createElement(DocumentBar, null)), createElement("div", {
117
- className: "edit-site-header-edit-mode__end"
118
- }, createElement(motion.div, {
119
- className: "edit-site-header-edit-mode__actions",
120
- variants: toolbarVariants,
121
- transition: toolbarTransition
122
- }, isLargeViewport && createElement("div", {
123
- className: classnames('edit-site-header-edit-mode__preview-options', {
124
- 'is-zoomed-out': isZoomedOutView
125
- })
126
- }, createElement(PreviewDropdown, {
127
- disabled: isFocusMode || !hasDefaultEditorCanvasView
128
- })), createElement(PostViewLink, null), !_isPreviewingTheme && !isPublishSidebarOpened &&
129
- // This button isn't completely hidden by the publish sidebar.
130
- // We can't hide the whole toolbar when the publish sidebar is open because
131
- // we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
132
- // We track that DOM node to return focus to the PostPublishButtonOrToggle
133
- // when the publish sidebar has been closed.
134
- createElement(PostSavedState, null), !_isPreviewingTheme && createElement(PostPublishButtonOrToggle, {
135
- setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
136
- }), _isPreviewingTheme && createElement(SaveButton, {
137
- size: "compact"
138
- }), !isDistractionFree && createElement(PinnedItems.Slot, {
139
- scope: "core"
140
- }), createElement(MoreMenu, null), createElement(SiteEditorMoreMenuItems, null))));
32
+ return createElement(EditorHeader, {
33
+ setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback,
34
+ customSaveButton: _isPreviewingTheme && createElement(SaveButton, {
35
+ size: "compact"
36
+ }),
37
+ forceDisableBlockTools: !hasDefaultEditorCanvasView,
38
+ title: !hasDefaultEditorCanvasView ? getEditorCanvasContainerTitle(editorCanvasView) : undefined
39
+ }, createElement(SiteEditorMoreMenu, null));
141
40
  }
41
+ export default Header;
142
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useViewportMatch","useReducedMotion","store","blockEditorStore","useSelect","useState","__unstableMotion","motion","preferencesStore","DocumentBar","PostSavedState","editorStore","privateApis","editorPrivateApis","SiteEditorMoreMenuItems","SaveButton","DocumentTools","editSiteStore","getEditorCanvasContainerTitle","useHasEditorCanvasContainer","unlock","FOCUSABLE_ENTITIES","isPreviewingTheme","CollapsableBlockToolbar","MoreMenu","PostViewLink","PreviewDropdown","PinnedItems","PostPublishButtonOrToggle","HeaderEditMode","setEntitiesSavedStatesCallback","templateType","isDistractionFree","blockEditorMode","showIconLabels","editorCanvasView","isFixedToolbar","isPublishSidebarOpened","select","getEditedPostType","__unstableGetEditorMode","get","getPreference","getDeviceType","deviceType","getEditorCanvasContainerView","isLargeViewport","showTopToolbar","disableMotion","hasDefaultEditorCanvasView","isFocusMode","includes","isZoomedOutView","isBlockToolsCollapsed","setIsBlockToolsCollapsed","toolbarVariants","y","isDistractionFreeHovering","view","edit","toolbarTransition","type","duration","ease","_isPreviewingTheme","createElement","className","div","variants","transition","isCollapsed","onToggle","disabled","size","Slot","scope"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch, useReducedMotion } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tDocumentBar,\n\tPostSavedState,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport SiteEditorMoreMenuItems from './more-menu';\nimport SaveButton from '../save-button';\nimport DocumentTools from './document-tools';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tgetEditorCanvasContainerTitle,\n\tuseHasEditorCanvasContainer,\n} from '../editor-canvas-container';\nimport { unlock } from '../../lock-unlock';\nimport { FOCUSABLE_ENTITIES } from '../../utils/constants';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst {\n\tCollapsableBlockToolbar,\n\tMoreMenu,\n\tPostViewLink,\n\tPreviewDropdown,\n\tPinnedItems,\n\tPostPublishButtonOrToggle,\n} = unlock( editorPrivateApis );\n\nexport default function HeaderEditMode( { setEntitiesSavedStatesCallback } ) {\n\tconst {\n\t\ttemplateType,\n\t\tisDistractionFree,\n\t\tblockEditorMode,\n\t\tshowIconLabels,\n\t\teditorCanvasView,\n\t\tisFixedToolbar,\n\t\tisPublishSidebarOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostType } = select( editSiteStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getDeviceType } = select( editorStore );\n\n\t\treturn {\n\t\t\tdeviceType: getDeviceType(),\n\t\t\ttemplateType: getEditedPostType(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t\teditorCanvasView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tisDistractionFree: getPreference( 'core', 'distractionFree' ),\n\t\t\tisFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst showTopToolbar =\n\t\tisLargeViewport && isFixedToolbar && blockEditorMode !== 'zoom-out';\n\tconst disableMotion = useReducedMotion();\n\n\tconst hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();\n\n\tconst isFocusMode = FOCUSABLE_ENTITIES.includes( templateType );\n\n\tconst isZoomedOutView = blockEditorMode === 'zoom-out';\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tconst toolbarVariants = {\n\t\tisDistractionFree: { y: '-50px' },\n\t\tisDistractionFreeHovering: { y: 0 },\n\t\tview: { y: 0 },\n\t\tedit: { y: 0 },\n\t};\n\n\tconst toolbarTransition = {\n\t\ttype: 'tween',\n\t\tduration: disableMotion ? 0 : 0.2,\n\t\tease: 'easeOut',\n\t};\n\n\tconst _isPreviewingTheme = isPreviewingTheme();\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-header-edit-mode', {\n\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t'show-block-toolbar': ! isBlockToolsCollapsed && showTopToolbar,\n\t\t\t} ) }\n\t\t>\n\t\t\t{ hasDefaultEditorCanvasView && (\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-header-edit-mode__start\"\n\t\t\t\t\tvariants={ toolbarVariants }\n\t\t\t\t\ttransition={ toolbarTransition }\n\t\t\t\t>\n\t\t\t\t\t<DocumentTools\n\t\t\t\t\t\tblockEditorMode={ blockEditorMode }\n\t\t\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\t\t/>\n\t\t\t\t\t{ showTopToolbar && (\n\t\t\t\t\t\t<CollapsableBlockToolbar\n\t\t\t\t\t\t\tisCollapsed={ isBlockToolsCollapsed }\n\t\t\t\t\t\t\tonToggle={ setIsBlockToolsCollapsed }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</motion.div>\n\t\t\t) }\n\n\t\t\t{ ! isDistractionFree && (\n\t\t\t\t<div className=\"edit-site-header-edit-mode__center\">\n\t\t\t\t\t{ ! hasDefaultEditorCanvasView ? (\n\t\t\t\t\t\tgetEditorCanvasContainerTitle( editorCanvasView )\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DocumentBar />\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t<div className=\"edit-site-header-edit-mode__end\">\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-header-edit-mode__actions\"\n\t\t\t\t\tvariants={ toolbarVariants }\n\t\t\t\t\ttransition={ toolbarTransition }\n\t\t\t\t>\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-header-edit-mode__preview-options',\n\t\t\t\t\t\t\t\t{ 'is-zoomed-out': isZoomedOutView }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreviewDropdown\n\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\tisFocusMode || ! hasDefaultEditorCanvasView\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<PostViewLink />\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO: For now we conditionally render the Save/Publish buttons based on\n\t\t\t\t\t\t// some specific site editor extra handling. Examples are when we're previewing\n\t\t\t\t\t\t// a theme, handling of global styles changes or when we're in 'view' mode,\n\t\t\t\t\t\t// which opens the save panel in a Modal.\n\t\t\t\t\t }\n\t\t\t\t\t{ ! _isPreviewingTheme && ! isPublishSidebarOpened && (\n\t\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t\t<PostSavedState />\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! _isPreviewingTheme && (\n\t\t\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\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{ _isPreviewingTheme && <SaveButton size=\"compact\" /> }\n\t\t\t\t\t{ ! isDistractionFree && <PinnedItems.Slot scope=\"core\" /> }\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t\t<SiteEditorMoreMenuItems />\n\t\t\t\t</motion.div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,gBAAgB,EAA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f8C,QAAQ,EACPtB,WAAW,IAAI,CAAED;EACjB,CACD,CACG,CACL,EACDgB,aAAA,CAACxC,YAAY,MAAE,CAAC,EAOd,CAAEuC,kBAAkB,IAAI,CAAE3B,sBAAsB;EACjD;EACA;EACA;EACA;EACA;EACA4B,aAAA,CAACvD,cAAc,MAAE,CACjB,EACC,CAAEsD,kBAAkB,IACrBC,aAAA,CAACrC,yBAAyB;IACzBE,8BAA8B,EAC7BA;EACA,CACD,CACD,EACCkC,kBAAkB,IAAIC,aAAA,CAAClD,UAAU;IAAC0D,IAAI,EAAC;EAAS,CAAE,CAAC,EACnD,CAAEzC,iBAAiB,IAAIiC,aAAA,CAACtC,WAAW,CAAC+C,IAAI;IAACC,KAAK,EAAC;EAAM,CAAE,CAAC,EAC1DV,aAAA,CAACzC,QAAQ,MAAE,CAAC,EACZyC,aAAA,CAACnD,uBAAuB,MAAE,CACf,CACR,CACD,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["privateApis","editorPrivateApis","useSelect","SiteEditorMoreMenu","unlock","SaveButton","isPreviewingTheme","getEditorCanvasContainerTitle","useHasEditorCanvasContainer","store","editSiteStore","Header","EditorHeader","setEntitiesSavedStatesCallback","_isPreviewingTheme","hasDefaultEditorCanvasView","editorCanvasView","select","getEditorCanvasContainerView","createElement","customSaveButton","size","forceDisableBlockTools","title","undefined"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport SiteEditorMoreMenu from './more-menu';\nimport { unlock } from '../../lock-unlock';\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport {\n\tgetEditorCanvasContainerTitle,\n\tuseHasEditorCanvasContainer,\n} from '../editor-canvas-container';\nimport { store as editSiteStore } from '../../store';\n\nconst { Header: EditorHeader } = unlock( editorPrivateApis );\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst _isPreviewingTheme = isPreviewingTheme();\n\tconst hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();\n\tconst { editorCanvasView } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\teditorCanvasView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<EditorHeader\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t\tcustomSaveButton={\n\t\t\t\t_isPreviewingTheme && <SaveButton size=\"compact\" />\n\t\t\t}\n\t\t\tforceDisableBlockTools={ ! hasDefaultEditorCanvasView }\n\t\t\ttitle={\n\t\t\t\t! hasDefaultEditorCanvasView\n\t\t\t\t\t? getEditorCanvasContainerTitle( editorCanvasView )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t>\n\t\t\t<SiteEditorMoreMenu />\n\t\t</EditorHeader>\n\t);\n}\n\nexport default Header;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,aAAa;AAC5C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,iBAAiB,QAAQ,iCAAiC;AACnE,SACCC,6BAA6B,EAC7BC,2BAA2B,QACrB,4BAA4B;AACnC,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AAEpD,MAAM;EAAEC,MAAM,EAAEC;AAAa,CAAC,GAAGR,MAAM,CAAEH,iBAAkB,CAAC;AAE5D,SAASU,MAAMA,CAAE;EAAEE;AAA+B,CAAC,EAAG;EACrD,MAAMC,kBAAkB,GAAGR,iBAAiB,CAAC,CAAC;EAC9C,MAAMS,0BAA0B,GAAG,CAAEP,2BAA2B,CAAC,CAAC;EAClE,MAAM;IAAEQ;EAAiB,CAAC,GAAGd,SAAS,CAAIe,MAAM,IAAM;IACrD,OAAO;MACND,gBAAgB,EAAEZ,MAAM,CACvBa,MAAM,CAAEP,aAAc,CACvB,CAAC,CAACQ,4BAA4B,CAAC;IAChC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACCC,aAAA,CAACP,YAAY;IACZC,8BAA8B,EAAGA,8BAAgC;IACjEO,gBAAgB,EACfN,kBAAkB,IAAIK,aAAA,CAACd,UAAU;MAACgB,IAAI,EAAC;IAAS,CAAE,CAClD;IACDC,sBAAsB,EAAG,CAAEP,0BAA4B;IACvDQ,KAAK,EACJ,CAAER,0BAA0B,GACzBR,6BAA6B,CAAES,gBAAiB,CAAC,GACjDQ;EACH,GAEDL,aAAA,CAAChB,kBAAkB,MAAE,CACR,CAAC;AAEjB;AAEA,eAAeQ,MAAM","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -62,7 +62,6 @@ export default function Layout() {
62
62
  const isMobileViewport = useViewportMatch('medium', '<');
63
63
  const {
64
64
  isDistractionFree,
65
- isZoomOutMode,
66
65
  hasFixedToolbar,
67
66
  hasBlockSelected,
68
67
  canvasMode,
@@ -83,7 +82,6 @@ export default function Layout() {
83
82
  hasFixedToolbar: select(preferencesStore).get('core', 'fixedToolbar'),
84
83
  isDistractionFree: select(preferencesStore).get('core', 'distractionFree'),
85
84
  hasBlockBreadcrumbs: select(preferencesStore).get('core', 'showBlockBreadcrumbs'),
86
- isZoomOutMode: select(blockEditorStore).__unstableGetEditorMode() === 'zoom-out',
87
85
  hasBlockSelected: select(blockEditorStore).getBlockSelectionStart()
88
86
  };
89
87
  }, []);
@@ -146,12 +144,11 @@ export default function Layout() {
146
144
  return createElement(Fragment, null, createElement(CommandMenu, null), createElement(KeyboardShortcutsRegister, null), createElement(KeyboardShortcutsGlobal, null), fullResizer, createElement("div", {
147
145
  ...navigateRegionsProps,
148
146
  ref: navigateRegionsProps.ref,
149
- className: classnames('edit-site-layout', navigateRegionsProps.className, {
147
+ className: clsx('edit-site-layout', navigateRegionsProps.className, {
150
148
  'is-distraction-free': isDistractionFree && canvasMode === 'edit',
151
149
  'is-full-canvas': canvasMode === 'edit',
152
150
  'has-fixed-toolbar': hasFixedToolbar,
153
151
  'is-block-toolbar-visible': hasBlockSelected,
154
- 'is-zoom-out': isZoomOutMode,
155
152
  'has-block-breadcrumbs': hasBlockBreadcrumbs && !isDistractionFree && canvasMode === 'edit'
156
153
  })
157
154
  }, createElement(motion.div, {
@@ -220,7 +217,7 @@ export default function Layout() {
220
217
  }, areas.content), !isMobileViewport && areas.preview && createElement("div", {
221
218
  className: "edit-site-layout__canvas-container"
222
219
  }, canvasResizer, !!canvasSize.width && createElement("div", {
223
- className: classnames('edit-site-layout__canvas', {
220
+ className: clsx('edit-site-layout__canvas', {
224
221
  'is-right-aligned': isResizableFrameOversized
225
222
  }),
226
223
  ref: animationRef
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useSelect","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","__unstableUseNavigateRegions","useNavigateRegions","useReducedMotion","useViewportMatch","useResizeObserver","__","useState","store","keyboardShortcutsStore","CommandMenu","privateApis","commandsPrivateApis","preferencesStore","blockEditorPrivateApis","blockEditorStore","coreCommandsPrivateApis","editorPrivateApis","ErrorBoundary","editSiteStore","useInitEditedEntityFromURL","SiteHub","ResizableFrame","useSyncCanvasModeWithURL","unlock","SavePanel","KeyboardShortcutsRegister","KeyboardShortcutsGlobal","useCommonCommands","useEditModeCommands","useIsSiteEditorLoading","useLayoutAreas","useMovingAnimation","SidebarContent","SaveHub","useCommands","useCommandContext","useGlobalStyle","NavigableRegion","ANIMATION_DURATION","Layout","isMobileViewport","isDistractionFree","isZoomOutMode","hasFixedToolbar","hasBlockSelected","canvasMode","previousShortcut","nextShortcut","hasBlockBreadcrumbs","select","getAllShortcutKeyCombinations","getCanvasMode","get","__unstableGetEditorMode","getBlockSelectionStart","navigateRegionsProps","previous","next","disableMotion","canvasResizer","canvasSize","fullResizer","isEditorLoading","isResizableFrameOversized","setIsResizableFrameOversized","key","routeKey","areas","widths","animationRef","triggerAnimationOnChange","headerAnimationState","commandContext","backgroundColor","gradientValue","createElement","Fragment","ref","className","div","variants","opacity","transition","type","delay","delayChildren","isDistractionFreeHovering","view","edit","whileHover","undefined","animate","isTransparent","mobile","ariaLabel","initial","exit","duration","ease","sidebar","content","style","maxWidth","preview","width","isReady","isFullWidth","defaultSize","height","isOversized","setIsOversized","innerContentStyle","background"],"sources":["@wordpress/edit-site/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport SiteHub from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../lock-unlock';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useCommonCommands } from '../../hooks/commands/use-common-commands';\nimport { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';\nimport { useIsSiteEditorLoading } from './hooks';\nimport useLayoutAreas from './router';\nimport useMovingAnimation from './animation';\nimport SidebarContent from '../sidebar';\nimport SaveHub from '../save-hub';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\nconst { NavigableRegion } = unlock( editorPrivateApis );\n\nconst ANIMATION_DURATION = 0.3;\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tuseEditModeCommands();\n\tuseCommonCommands();\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tconst {\n\t\tisDistractionFree,\n\t\tisZoomOutMode,\n\t\thasFixedToolbar,\n\t\thasBlockSelected,\n\t\tcanvasMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockBreadcrumbs,\n\t} = useSelect( ( select ) => {\n\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\tkeyboardShortcutsStore\n\t\t);\n\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/editor/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/editor/next-region'\n\t\t\t),\n\t\t\thasFixedToolbar: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasBlockBreadcrumbs: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\tisZoomOutMode:\n\t\t\t\tselect( blockEditorStore ).__unstableGetEditorMode() ===\n\t\t\t\t'zoom-out',\n\t\t\thasBlockSelected:\n\t\t\t\tselect( blockEditorStore ).getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\tconst { key: routeKey, areas, widths } = useLayoutAreas();\n\tconst animationRef = useMovingAnimation( {\n\t\ttriggerAnimationOnChange: canvasMode + '__' + routeKey,\n\t} );\n\n\t// This determines which animation variant should apply to the header.\n\t// There is also a `isDistractionFreeHovering` state that gets priority\n\t// when hovering the `edit-site-layout__header-container` in distraction\n\t// free mode. It's set via framer and trickles down to all the children\n\t// so they can use this variant state too.\n\t//\n\t// TODO: The issue with this is we want to have the hover state stick when hovering\n\t// a popover opened via the header. We'll probably need to lift this state to\n\t// handle it ourselves. Also, focusWithin the header needs to be handled.\n\tlet headerAnimationState;\n\n\tif ( canvasMode === 'view' ) {\n\t\t// We need 'view' to always take priority so 'isDistractionFree'\n\t\t// doesn't bleed over into the view (sidebar) state\n\t\theaderAnimationState = 'view';\n\t} else if ( isDistractionFree ) {\n\t\theaderAnimationState = 'isDistractionFree';\n\t} else {\n\t\theaderAnimationState = canvasMode; // edit, view, init\n\t}\n\n\t// Sets the right context for the command palette\n\tlet commandContext = 'site-editor';\n\n\tif ( canvasMode === 'edit' ) {\n\t\tcommandContext = 'site-editor-edit';\n\t}\n\tif ( hasBlockSelected ) {\n\t\tcommandContext = 'block-selection-edit';\n\t}\n\tuseCommandContext( commandContext );\n\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommandMenu />\n\t\t\t<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-distraction-free':\n\t\t\t\t\t\t\tisDistractionFree && canvasMode === 'edit',\n\t\t\t\t\t\t'is-full-canvas': canvasMode === 'edit',\n\t\t\t\t\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t\t\t\t\t'is-block-toolbar-visible': hasBlockSelected,\n\t\t\t\t\t\t'is-zoom-out': isZoomOutMode,\n\t\t\t\t\t\t'has-block-breadcrumbs':\n\t\t\t\t\t\t\thasBlockBreadcrumbs &&\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tcanvasMode === 'edit',\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-layout__header-container\"\n\t\t\t\t\tvariants={ {\n\t\t\t\t\t\tisDistractionFree: {\n\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tdelay: 0.8,\n\t\t\t\t\t\t\t\tdelayChildren: 0.8,\n\t\t\t\t\t\t\t}, // How long to wait before the header exits\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tdelay: 0.2,\n\t\t\t\t\t\t\t\tdelayChildren: 0.2,\n\t\t\t\t\t\t\t}, // How long to wait before the header shows\n\t\t\t\t\t\t},\n\t\t\t\t\t\tview: { opacity: 1 },\n\t\t\t\t\t\tedit: { opacity: 1 },\n\t\t\t\t\t} }\n\t\t\t\t\twhileHover={\n\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t? 'isDistractionFreeHovering'\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tanimate={ headerAnimationState }\n\t\t\t\t>\n\t\t\t\t\t<SiteHub\n\t\t\t\t\t\tisTransparent={ isResizableFrameOversized }\n\t\t\t\t\t\tclassName=\"edit-site-layout__hub\"\n\t\t\t\t\t/>\n\t\t\t\t</motion.div>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t\tThe NavigableRegion must always be rendered and not use\n\t\t\t\t\t\t`inert` otherwise `useNavigateRegions` will fail.\n\t\t\t\t\t*/ }\n\t\t\t\t\t{ ( ! isMobileViewport || ! areas.mobile ) && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar-region\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ canvasMode === 'view' && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<SidebarContent routeKey={ routeKey }>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.sidebar }\n\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isMobileViewport && areas.mobile && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__mobile\">\n\t\t\t\t\t\t\t{ areas.mobile }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport &&\n\t\t\t\t\t\tareas.content &&\n\t\t\t\t\t\tcanvasMode !== 'edit' && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tmaxWidth: widths?.content,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ areas.content }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.preview && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__canvas-container\">\n\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tref={ animationRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\tisReady={ ! isEditorLoading }\n\t\t\t\t\t\t\t\t\t\t\tisFullWidth={\n\t\t\t\t\t\t\t\t\t\t\t\tcanvasMode === 'edit'\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\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\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t</ResizableFrame>\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\n\t\t\t\t<SavePanel />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,EAC5CC,4BAA4B,IAAIC,kBAAkB,QAC5C,uBAAuB;AAC9B,SACCC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,QACX,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;AAC/E,SACCC,WAAW,EACXC,WAAW,IAAIC,mBAAmB,QAC5B,qBAAqB;AAC5B,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;AAClE,SACCF,WAAW,IAAIG,sBAAsB,EACrCN,KAAK,IAAIO,gBAAgB,QACnB,yBAAyB;AAChC,SAASJ,WAAW,IAAIK,uBAAuB,QAAQ,0BAA0B;AACjF,SA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,GAAG,EAAGR;EAAc,GAEpBM,aAAA,CAAC1D,aAAa,QACb0D,aAAA,CAACtD,cAAc;IACdoF,OAAO,EAAG,CAAE3C,eAAiB;IAC7B4C,WAAW,EACV7D,UAAU,KAAK,MACf;IACD8D,WAAW,EAAG;MACbH,KAAK,EACJ5C,UAAU,CAAC4C,KAAK,GAChB,EAAE,CAAC;MACJI,MAAM,EAAEhD,UAAU,CAACgD;IACpB,CAAG;IACHC,WAAW,EACV9C,yBACA;IACD+C,cAAc,EACb9C,4BACA;IACD+C,iBAAiB,EAAG;MACnBC,UAAU,EACTtC,aAAa,aAAbA,aAAa,cAAbA,aAAa,GACbD;IACF;EAAG,GAEDN,KAAK,CAACoC,OACO,CACF,CACX,CAEF,CAEF,CAAC,EAEN5B,aAAA,CAACnD,SAAS,MAAE,CACR,CACJ,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useSelect","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","__unstableUseNavigateRegions","useNavigateRegions","useReducedMotion","useViewportMatch","useResizeObserver","__","useState","store","keyboardShortcutsStore","CommandMenu","privateApis","commandsPrivateApis","preferencesStore","blockEditorPrivateApis","blockEditorStore","coreCommandsPrivateApis","editorPrivateApis","ErrorBoundary","editSiteStore","useInitEditedEntityFromURL","SiteHub","ResizableFrame","useSyncCanvasModeWithURL","unlock","SavePanel","KeyboardShortcutsRegister","KeyboardShortcutsGlobal","useCommonCommands","useEditModeCommands","useIsSiteEditorLoading","useLayoutAreas","useMovingAnimation","SidebarContent","SaveHub","useCommands","useCommandContext","useGlobalStyle","NavigableRegion","ANIMATION_DURATION","Layout","isMobileViewport","isDistractionFree","hasFixedToolbar","hasBlockSelected","canvasMode","previousShortcut","nextShortcut","hasBlockBreadcrumbs","select","getAllShortcutKeyCombinations","getCanvasMode","get","getBlockSelectionStart","navigateRegionsProps","previous","next","disableMotion","canvasResizer","canvasSize","fullResizer","isEditorLoading","isResizableFrameOversized","setIsResizableFrameOversized","key","routeKey","areas","widths","animationRef","triggerAnimationOnChange","headerAnimationState","commandContext","backgroundColor","gradientValue","createElement","Fragment","ref","className","div","variants","opacity","transition","type","delay","delayChildren","isDistractionFreeHovering","view","edit","whileHover","undefined","animate","isTransparent","mobile","ariaLabel","initial","exit","duration","ease","sidebar","content","style","maxWidth","preview","width","isReady","isFullWidth","defaultSize","height","isOversized","setIsOversized","innerContentStyle","background"],"sources":["@wordpress/edit-site/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport SiteHub from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../lock-unlock';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useCommonCommands } from '../../hooks/commands/use-common-commands';\nimport { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';\nimport { useIsSiteEditorLoading } from './hooks';\nimport useLayoutAreas from './router';\nimport useMovingAnimation from './animation';\nimport SidebarContent from '../sidebar';\nimport SaveHub from '../save-hub';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\nconst { NavigableRegion } = unlock( editorPrivateApis );\n\nconst ANIMATION_DURATION = 0.3;\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tuseEditModeCommands();\n\tuseCommonCommands();\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tconst {\n\t\tisDistractionFree,\n\t\thasFixedToolbar,\n\t\thasBlockSelected,\n\t\tcanvasMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockBreadcrumbs,\n\t} = useSelect( ( select ) => {\n\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\tkeyboardShortcutsStore\n\t\t);\n\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/editor/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/editor/next-region'\n\t\t\t),\n\t\t\thasFixedToolbar: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasBlockBreadcrumbs: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\thasBlockSelected:\n\t\t\t\tselect( blockEditorStore ).getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\tconst { key: routeKey, areas, widths } = useLayoutAreas();\n\tconst animationRef = useMovingAnimation( {\n\t\ttriggerAnimationOnChange: canvasMode + '__' + routeKey,\n\t} );\n\n\t// This determines which animation variant should apply to the header.\n\t// There is also a `isDistractionFreeHovering` state that gets priority\n\t// when hovering the `edit-site-layout__header-container` in distraction\n\t// free mode. It's set via framer and trickles down to all the children\n\t// so they can use this variant state too.\n\t//\n\t// TODO: The issue with this is we want to have the hover state stick when hovering\n\t// a popover opened via the header. We'll probably need to lift this state to\n\t// handle it ourselves. Also, focusWithin the header needs to be handled.\n\tlet headerAnimationState;\n\n\tif ( canvasMode === 'view' ) {\n\t\t// We need 'view' to always take priority so 'isDistractionFree'\n\t\t// doesn't bleed over into the view (sidebar) state\n\t\theaderAnimationState = 'view';\n\t} else if ( isDistractionFree ) {\n\t\theaderAnimationState = 'isDistractionFree';\n\t} else {\n\t\theaderAnimationState = canvasMode; // edit, view, init\n\t}\n\n\t// Sets the right context for the command palette\n\tlet commandContext = 'site-editor';\n\n\tif ( canvasMode === 'edit' ) {\n\t\tcommandContext = 'site-editor-edit';\n\t}\n\tif ( hasBlockSelected ) {\n\t\tcommandContext = 'block-selection-edit';\n\t}\n\tuseCommandContext( commandContext );\n\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommandMenu />\n\t\t\t<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-distraction-free':\n\t\t\t\t\t\t\tisDistractionFree && canvasMode === 'edit',\n\t\t\t\t\t\t'is-full-canvas': canvasMode === 'edit',\n\t\t\t\t\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t\t\t\t\t'is-block-toolbar-visible': hasBlockSelected,\n\t\t\t\t\t\t'has-block-breadcrumbs':\n\t\t\t\t\t\t\thasBlockBreadcrumbs &&\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tcanvasMode === 'edit',\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-layout__header-container\"\n\t\t\t\t\tvariants={ {\n\t\t\t\t\t\tisDistractionFree: {\n\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tdelay: 0.8,\n\t\t\t\t\t\t\t\tdelayChildren: 0.8,\n\t\t\t\t\t\t\t}, // How long to wait before the header exits\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tdelay: 0.2,\n\t\t\t\t\t\t\t\tdelayChildren: 0.2,\n\t\t\t\t\t\t\t}, // How long to wait before the header shows\n\t\t\t\t\t\t},\n\t\t\t\t\t\tview: { opacity: 1 },\n\t\t\t\t\t\tedit: { opacity: 1 },\n\t\t\t\t\t} }\n\t\t\t\t\twhileHover={\n\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t? 'isDistractionFreeHovering'\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tanimate={ headerAnimationState }\n\t\t\t\t>\n\t\t\t\t\t<SiteHub\n\t\t\t\t\t\tisTransparent={ isResizableFrameOversized }\n\t\t\t\t\t\tclassName=\"edit-site-layout__hub\"\n\t\t\t\t\t/>\n\t\t\t\t</motion.div>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t\tThe NavigableRegion must always be rendered and not use\n\t\t\t\t\t\t`inert` otherwise `useNavigateRegions` will fail.\n\t\t\t\t\t*/ }\n\t\t\t\t\t{ ( ! isMobileViewport || ! areas.mobile ) && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar-region\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ canvasMode === 'view' && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<SidebarContent routeKey={ routeKey }>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.sidebar }\n\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isMobileViewport && areas.mobile && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__mobile\">\n\t\t\t\t\t\t\t{ areas.mobile }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport &&\n\t\t\t\t\t\tareas.content &&\n\t\t\t\t\t\tcanvasMode !== 'edit' && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tmaxWidth: widths?.content,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ areas.content }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.preview && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__canvas-container\">\n\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tref={ animationRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\tisReady={ ! isEditorLoading }\n\t\t\t\t\t\t\t\t\t\t\tisFullWidth={\n\t\t\t\t\t\t\t\t\t\t\t\tcanvasMode === 'edit'\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\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\t\t{ areas.preview }\n\t\t\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AA,CAACjD,SAAS,MAAE,CACR,CACJ,CAAC;AAEL","ignoreList":[]}
@@ -4,7 +4,7 @@ import { createElement } from "react";
4
4
  */
5
5
  import { privateApis as routerPrivateApis } from '@wordpress/router';
6
6
  import { __ } from '@wordpress/i18n';
7
-
7
+ import { useEffect } from '@wordpress/element';
8
8
  /**
9
9
  * Internal dependencies
10
10
  */
@@ -42,7 +42,16 @@ export default function useLayoutAreas() {
42
42
  layout,
43
43
  isCustom,
44
44
  canvas
45
- } = params !== null && params !== void 0 ? params : {};
45
+ } = params;
46
+ useEffect(() => {
47
+ // `/wp_template_part/all` path is no longer used and redirects to
48
+ // Patterns page for backward compatibility.
49
+ if (path === '/wp_template_part/all') {
50
+ history.replace({
51
+ path: '/patterns'
52
+ });
53
+ }
54
+ }, [history, path]);
46
55
 
47
56
  // Note: Since "sidebar" is not yet supported here,
48
57
  // returning undefined from "mobile" means show the sidebar.
@@ -55,6 +64,7 @@ export default function useLayoutAreas() {
55
64
  areas: {
56
65
  sidebar: createElement(SidebarNavigationScreen, {
57
66
  title: __('Manage pages'),
67
+ backPath: {},
58
68
  content: createElement(DataViewsSidebarContent, null)
59
69
  }),
60
70
  content: createElement(PagePages, null),
@@ -80,13 +90,32 @@ export default function useLayoutAreas() {
80
90
  if (postType && postId) {
81
91
  let sidebar;
82
92
  if (postType === 'wp_template_part' || postType === 'wp_block') {
83
- sidebar = createElement(SidebarNavigationScreenPattern, null);
93
+ sidebar = createElement(SidebarNavigationScreenPattern, {
94
+ backPath: {
95
+ path: '/patterns',
96
+ categoryId: params.categoryId,
97
+ categoryType: params.categoryType
98
+ }
99
+ });
84
100
  } else if (postType === 'wp_template') {
85
- sidebar = createElement(SidebarNavigationScreenTemplate, null);
101
+ sidebar = createElement(SidebarNavigationScreenTemplate, {
102
+ backPath: {
103
+ path: '/wp_template'
104
+ }
105
+ });
86
106
  } else if (postType === 'page') {
87
- sidebar = createElement(SidebarNavigationScreenPage, null);
107
+ sidebar = createElement(SidebarNavigationScreenPage, {
108
+ backPath: {
109
+ path: '/page',
110
+ postId
111
+ }
112
+ });
88
113
  } else {
89
- sidebar = createElement(SidebarNavigationScreenNavigationMenu, null);
114
+ sidebar = createElement(SidebarNavigationScreenNavigationMenu, {
115
+ backPath: {
116
+ path: '/navigation'
117
+ }
118
+ });
90
119
  }
91
120
  return {
92
121
  key: 'page',
@@ -108,7 +137,9 @@ export default function useLayoutAreas() {
108
137
  return {
109
138
  key: 'templates-list',
110
139
  areas: {
111
- sidebar: createElement(SidebarNavigationScreenTemplatesBrowse, null),
140
+ sidebar: createElement(SidebarNavigationScreenTemplatesBrowse, {
141
+ backPath: {}
142
+ }),
112
143
  content: createElement(PageTemplates, null),
113
144
  preview: isListLayout && createElement(Editor, {
114
145
  isLoading: isSiteEditorLoading
@@ -121,15 +152,16 @@ export default function useLayoutAreas() {
121
152
  };
122
153
  }
123
154
 
124
- /* Patterns and Template Parts
125
- * `/wp_template_part/all` path is no longer used, but uses Patterns page screens for
126
- * backwards compatibility.
127
- */
155
+ // Patterns
156
+ // `/wp_template_part/all` path is no longer used and redirects to
157
+ // Patterns page for backward compatibility.
128
158
  if (path === '/patterns' || path === '/wp_template_part/all') {
129
159
  return {
130
160
  key: 'patterns',
131
161
  areas: {
132
- sidebar: createElement(SidebarNavigationScreenPatterns, null),
162
+ sidebar: createElement(SidebarNavigationScreenPatterns, {
163
+ backPath: {}
164
+ }),
133
165
  content: createElement(PagePatterns, null),
134
166
  mobile: createElement(PagePatterns, null)
135
167
  }
@@ -141,7 +173,9 @@ export default function useLayoutAreas() {
141
173
  return {
142
174
  key: 'styles',
143
175
  areas: {
144
- sidebar: createElement(SidebarNavigationScreenGlobalStyles, null),
176
+ sidebar: createElement(SidebarNavigationScreenGlobalStyles, {
177
+ backPath: {}
178
+ }),
145
179
  preview: createElement(Editor, {
146
180
  isLoading: isSiteEditorLoading
147
181
  }),
@@ -154,10 +188,30 @@ export default function useLayoutAreas() {
154
188
 
155
189
  // Navigation
156
190
  if (path === '/navigation') {
191
+ if (postId) {
192
+ return {
193
+ key: 'navigation',
194
+ areas: {
195
+ sidebar: createElement(SidebarNavigationScreenNavigationMenu, {
196
+ backPath: {
197
+ path: '/navigation'
198
+ }
199
+ }),
200
+ preview: createElement(Editor, {
201
+ isLoading: isSiteEditorLoading
202
+ }),
203
+ mobile: canvas === 'edit' && createElement(Editor, {
204
+ isLoading: isSiteEditorLoading
205
+ })
206
+ }
207
+ };
208
+ }
157
209
  return {
158
- key: 'styles',
210
+ key: 'navigation',
159
211
  areas: {
160
- sidebar: createElement(SidebarNavigationScreenNavigationMenus, null),
212
+ sidebar: createElement(SidebarNavigationScreenNavigationMenus, {
213
+ backPath: {}
214
+ }),
161
215
  preview: createElement(Editor, {
162
216
  isLoading: isSiteEditorLoading
163
217
  }),