@wordpress/edit-site 5.30.0 → 5.32.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 (470) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/block-editor/editor-canvas.js +24 -4
  3. package/build/components/block-editor/editor-canvas.js.map +1 -1
  4. package/build/components/block-editor/site-editor-canvas.js +15 -4
  5. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  6. package/build/components/block-editor/use-site-editor-settings.js +1 -1
  7. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  8. package/build/components/editor/index.js +12 -3
  9. package/build/components/editor/index.js.map +1 -1
  10. package/build/components/editor-canvas-container/index.js +1 -2
  11. package/build/components/editor-canvas-container/index.js.map +1 -1
  12. package/build/components/global-styles/background-panel.js +38 -0
  13. package/build/components/global-styles/background-panel.js.map +1 -0
  14. package/build/components/global-styles/color-palette-panel.js +0 -9
  15. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  16. package/build/components/global-styles/font-families.js +1 -1
  17. package/build/components/global-styles/font-families.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/context.js +53 -17
  19. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/font-collection.js +4 -3
  21. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +3 -2
  23. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  25. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/upload-fonts.js +44 -10
  27. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/utils/index.js +22 -4
  29. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +3 -0
  31. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  32. package/build/components/global-styles/header.js +1 -1
  33. package/build/components/global-styles/header.js.map +1 -1
  34. package/build/components/global-styles/hooks.js +50 -1
  35. package/build/components/global-styles/hooks.js.map +1 -1
  36. package/build/components/global-styles/palette.js +3 -1
  37. package/build/components/global-styles/palette.js.map +1 -1
  38. package/build/components/global-styles/preview-colors.js +2 -2
  39. package/build/components/global-styles/preview-colors.js.map +1 -1
  40. package/build/components/global-styles/preview-iframe.js +0 -1
  41. package/build/components/global-styles/preview-iframe.js.map +1 -1
  42. package/build/components/global-styles/preview-styles.js +2 -2
  43. package/build/components/global-styles/preview-styles.js.map +1 -1
  44. package/build/components/global-styles/root-menu.js +8 -2
  45. package/build/components/global-styles/root-menu.js.map +1 -1
  46. package/build/components/global-styles/screen-background.js +34 -0
  47. package/build/components/global-styles/screen-background.js.map +1 -0
  48. package/build/components/global-styles/screen-color-palette.js +2 -2
  49. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  50. package/build/components/global-styles/screen-colors.js +5 -10
  51. package/build/components/global-styles/screen-colors.js.map +1 -1
  52. package/build/components/global-styles/screen-style-variations.js +3 -37
  53. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  54. package/build/components/global-styles/screen-typography.js +6 -11
  55. package/build/components/global-styles/screen-typography.js.map +1 -1
  56. package/build/components/global-styles/style-variations-container.js +5 -2
  57. package/build/components/global-styles/style-variations-container.js.map +1 -1
  58. package/build/components/global-styles/typography-elements.js +3 -1
  59. package/build/components/global-styles/typography-elements.js.map +1 -1
  60. package/build/components/global-styles/{preview-typography.js → typography-example.js} +4 -2
  61. package/build/components/global-styles/typography-example.js.map +1 -0
  62. package/build/components/global-styles/typography-preview.js +3 -1
  63. package/build/components/global-styles/typography-preview.js.map +1 -1
  64. package/build/components/global-styles/ui.js +4 -1
  65. package/build/components/global-styles/ui.js.map +1 -1
  66. package/build/components/global-styles/utils.js +1 -1
  67. package/build/components/global-styles/utils.js.map +1 -1
  68. package/build/components/global-styles/variations/variations-color.js +13 -7
  69. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  70. package/build/components/global-styles/variations/variations-typography.js +34 -37
  71. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  72. package/build/components/header-edit-mode/index.js +2 -1
  73. package/build/components/header-edit-mode/index.js.map +1 -1
  74. package/build/components/keyboard-shortcut-help-modal/config.js +6 -0
  75. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  76. package/build/components/keyboard-shortcut-help-modal/index.js +3 -0
  77. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  78. package/build/components/keyboard-shortcuts/global.js +17 -3
  79. package/build/components/keyboard-shortcuts/global.js.map +1 -1
  80. package/build/components/layout/animation.js +129 -0
  81. package/build/components/layout/animation.js.map +1 -0
  82. package/build/components/layout/index.js +9 -17
  83. package/build/components/layout/index.js.map +1 -1
  84. package/build/components/layout/router.js +22 -22
  85. package/build/components/layout/router.js.map +1 -1
  86. package/build/components/page-pages/index.js +24 -27
  87. package/build/components/page-pages/index.js.map +1 -1
  88. package/build/components/page-patterns/delete-category-menu-item.js +6 -1
  89. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  90. package/build/components/page-patterns/index.js +19 -32
  91. package/build/components/page-patterns/index.js.map +1 -1
  92. package/build/components/page-patterns/search-items.js +16 -58
  93. package/build/components/page-patterns/search-items.js.map +1 -1
  94. package/build/components/page-patterns/use-patterns.js +9 -9
  95. package/build/components/page-patterns/use-patterns.js.map +1 -1
  96. package/build/components/page-templates-template-parts/actions.js +54 -41
  97. package/build/components/page-templates-template-parts/actions.js.map +1 -1
  98. package/build/components/page-templates-template-parts/index.js +31 -69
  99. package/build/components/page-templates-template-parts/index.js.map +1 -1
  100. package/build/components/plugin-template-setting-panel/index.js +12 -1
  101. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  102. package/build/components/save-button/index.js +45 -16
  103. package/build/components/save-button/index.js.map +1 -1
  104. package/build/components/save-hub/index.js +8 -112
  105. package/build/components/save-hub/index.js.map +1 -1
  106. package/build/components/save-panel/index.js +14 -9
  107. package/build/components/save-panel/index.js.map +1 -1
  108. package/build/components/sidebar/index.js +3 -8
  109. package/build/components/sidebar/index.js.map +1 -1
  110. package/build/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
  111. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  112. package/build/components/sidebar-dataviews/dataview-item.js +2 -2
  113. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  114. package/build/components/sidebar-dataviews/default-views.js +3 -3
  115. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  116. package/build/components/sidebar-dataviews/index.js +5 -4
  117. package/build/components/sidebar-dataviews/index.js.map +1 -1
  118. package/build/components/sidebar-edit-mode/index.js +1 -2
  119. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  120. package/build/components/sidebar-edit-mode/page-panels/index.js +7 -17
  121. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  122. package/build/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  123. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  124. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +3 -1
  125. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  126. package/build/components/sidebar-edit-mode/template-panel/index.js +32 -18
  127. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  128. package/build/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  129. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  130. package/build/components/sidebar-navigation-screen-global-styles/index.js +18 -1
  131. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  132. package/build/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +4 -5
  133. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
  134. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
  135. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  136. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  137. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  138. package/build/components/sidebar-navigation-screen-patterns/index.js +1 -5
  139. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  140. package/build/components/sidebar-navigation-screen-template/index.js +5 -1
  141. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  142. package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  143. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  144. package/build/components/style-book/index.js +1 -1
  145. package/build/components/style-book/index.js.map +1 -1
  146. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -3
  147. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  148. package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -11
  149. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  150. package/build/components/template-actions/index.js +44 -27
  151. package/build/components/template-actions/index.js.map +1 -1
  152. package/build/components/welcome-guide/editor.js +11 -2
  153. package/build/components/welcome-guide/editor.js.map +1 -1
  154. package/build/hooks/index.js +0 -1
  155. package/build/hooks/index.js.map +1 -1
  156. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +15 -2
  157. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  158. package/build/store/selectors.js +1 -9
  159. package/build/store/selectors.js.map +1 -1
  160. package/build/utils/constants.js +5 -3
  161. package/build/utils/constants.js.map +1 -1
  162. package/build/utils/get-is-list-page.js +1 -1
  163. package/build/utils/get-is-list-page.js.map +1 -1
  164. package/build/utils/math.js +98 -0
  165. package/build/utils/math.js.map +1 -0
  166. package/build-module/components/block-editor/editor-canvas.js +24 -4
  167. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  168. package/build-module/components/block-editor/site-editor-canvas.js +15 -4
  169. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  170. package/build-module/components/block-editor/use-site-editor-settings.js +1 -1
  171. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  172. package/build-module/components/editor/index.js +13 -4
  173. package/build-module/components/editor/index.js.map +1 -1
  174. package/build-module/components/editor-canvas-container/index.js +1 -2
  175. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  176. package/build-module/components/global-styles/background-panel.js +31 -0
  177. package/build-module/components/global-styles/background-panel.js.map +1 -0
  178. package/build-module/components/global-styles/color-palette-panel.js +0 -8
  179. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  180. package/build-module/components/global-styles/font-families.js +1 -1
  181. package/build-module/components/global-styles/font-families.js.map +1 -1
  182. package/build-module/components/global-styles/font-library-modal/context.js +54 -18
  183. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  184. package/build-module/components/global-styles/font-library-modal/font-collection.js +4 -3
  185. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  186. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +4 -3
  187. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  188. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  189. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  190. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +44 -10
  191. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  192. package/build-module/components/global-styles/font-library-modal/utils/index.js +22 -4
  193. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  194. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +3 -0
  195. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  196. package/build-module/components/global-styles/header.js +1 -1
  197. package/build-module/components/global-styles/header.js.map +1 -1
  198. package/build-module/components/global-styles/hooks.js +48 -1
  199. package/build-module/components/global-styles/hooks.js.map +1 -1
  200. package/build-module/components/global-styles/palette.js +3 -1
  201. package/build-module/components/global-styles/palette.js.map +1 -1
  202. package/build-module/components/global-styles/preview-colors.js +2 -2
  203. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  204. package/build-module/components/global-styles/preview-iframe.js +0 -1
  205. package/build-module/components/global-styles/preview-iframe.js.map +1 -1
  206. package/build-module/components/global-styles/preview-styles.js +2 -2
  207. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  208. package/build-module/components/global-styles/root-menu.js +9 -3
  209. package/build-module/components/global-styles/root-menu.js.map +1 -1
  210. package/build-module/components/global-styles/screen-background.js +26 -0
  211. package/build-module/components/global-styles/screen-background.js.map +1 -0
  212. package/build-module/components/global-styles/screen-color-palette.js +2 -2
  213. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  214. package/build-module/components/global-styles/screen-colors.js +5 -10
  215. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  216. package/build-module/components/global-styles/screen-style-variations.js +4 -38
  217. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  218. package/build-module/components/global-styles/screen-typography.js +6 -11
  219. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  220. package/build-module/components/global-styles/style-variations-container.js +5 -2
  221. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  222. package/build-module/components/global-styles/typography-elements.js +3 -1
  223. package/build-module/components/global-styles/typography-elements.js.map +1 -1
  224. package/build-module/components/global-styles/{preview-typography.js → typography-example.js} +4 -2
  225. package/build-module/components/global-styles/typography-example.js.map +1 -0
  226. package/build-module/components/global-styles/typography-preview.js +3 -1
  227. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  228. package/build-module/components/global-styles/ui.js +4 -1
  229. package/build-module/components/global-styles/ui.js.map +1 -1
  230. package/build-module/components/global-styles/utils.js +1 -1
  231. package/build-module/components/global-styles/utils.js.map +1 -1
  232. package/build-module/components/global-styles/variations/variations-color.js +13 -7
  233. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  234. package/build-module/components/global-styles/variations/variations-typography.js +35 -38
  235. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  236. package/build-module/components/header-edit-mode/index.js +2 -1
  237. package/build-module/components/header-edit-mode/index.js.map +1 -1
  238. package/build-module/components/keyboard-shortcut-help-modal/config.js +6 -0
  239. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  240. package/build-module/components/keyboard-shortcut-help-modal/index.js +3 -0
  241. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  242. package/build-module/components/keyboard-shortcuts/global.js +17 -3
  243. package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
  244. package/build-module/components/layout/animation.js +122 -0
  245. package/build-module/components/layout/animation.js.map +1 -0
  246. package/build-module/components/layout/index.js +9 -17
  247. package/build-module/components/layout/index.js.map +1 -1
  248. package/build-module/components/layout/router.js +22 -22
  249. package/build-module/components/layout/router.js.map +1 -1
  250. package/build-module/components/page-pages/index.js +25 -28
  251. package/build-module/components/page-pages/index.js.map +1 -1
  252. package/build-module/components/page-patterns/delete-category-menu-item.js +6 -1
  253. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  254. package/build-module/components/page-patterns/index.js +21 -34
  255. package/build-module/components/page-patterns/index.js.map +1 -1
  256. package/build-module/components/page-patterns/search-items.js +14 -55
  257. package/build-module/components/page-patterns/search-items.js.map +1 -1
  258. package/build-module/components/page-patterns/use-patterns.js +9 -9
  259. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  260. package/build-module/components/page-templates-template-parts/actions.js +54 -40
  261. package/build-module/components/page-templates-template-parts/actions.js.map +1 -1
  262. package/build-module/components/page-templates-template-parts/index.js +34 -72
  263. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  264. package/build-module/components/plugin-template-setting-panel/index.js +12 -1
  265. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  266. package/build-module/components/save-button/index.js +46 -17
  267. package/build-module/components/save-button/index.js.map +1 -1
  268. package/build-module/components/save-hub/index.js +10 -114
  269. package/build-module/components/save-hub/index.js.map +1 -1
  270. package/build-module/components/save-panel/index.js +14 -9
  271. package/build-module/components/save-panel/index.js.map +1 -1
  272. package/build-module/components/sidebar/index.js +3 -8
  273. package/build-module/components/sidebar/index.js.map +1 -1
  274. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
  275. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  276. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
  277. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  278. package/build-module/components/sidebar-dataviews/default-views.js +4 -4
  279. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  280. package/build-module/components/sidebar-dataviews/index.js +5 -4
  281. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  282. package/build-module/components/sidebar-edit-mode/index.js +1 -2
  283. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  284. package/build-module/components/sidebar-edit-mode/page-panels/index.js +10 -20
  285. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  286. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
  287. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  288. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -2
  289. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  290. package/build-module/components/sidebar-edit-mode/template-panel/index.js +33 -19
  291. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  292. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +5 -1
  293. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  294. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +19 -2
  295. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  296. package/build-module/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +3 -4
  297. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
  298. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
  299. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  300. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
  301. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  302. package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -5
  303. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  304. package/build-module/components/sidebar-navigation-screen-template/index.js +5 -1
  305. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  306. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  307. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  308. package/build-module/components/style-book/index.js +1 -1
  309. package/build-module/components/style-book/index.js.map +1 -1
  310. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -3
  311. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  312. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -11
  313. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  314. package/build-module/components/template-actions/index.js +44 -27
  315. package/build-module/components/template-actions/index.js.map +1 -1
  316. package/build-module/components/welcome-guide/editor.js +11 -2
  317. package/build-module/components/welcome-guide/editor.js.map +1 -1
  318. package/build-module/hooks/index.js +0 -1
  319. package/build-module/hooks/index.js.map +1 -1
  320. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +15 -2
  321. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  322. package/build-module/store/selectors.js +1 -9
  323. package/build-module/store/selectors.js.map +1 -1
  324. package/build-module/utils/constants.js +4 -2
  325. package/build-module/utils/constants.js.map +1 -1
  326. package/build-module/utils/get-is-list-page.js +1 -1
  327. package/build-module/utils/get-is-list-page.js.map +1 -1
  328. package/build-module/utils/math.js +92 -0
  329. package/build-module/utils/math.js.map +1 -0
  330. package/build-style/style-rtl.css +146 -130
  331. package/build-style/style.css +146 -130
  332. package/package.json +44 -44
  333. package/src/components/block-editor/editor-canvas.js +34 -9
  334. package/src/components/block-editor/site-editor-canvas.js +10 -7
  335. package/src/components/block-editor/use-site-editor-settings.js +0 -2
  336. package/src/components/editor/index.js +11 -4
  337. package/src/components/editor-canvas-container/index.js +0 -1
  338. package/src/components/global-styles/background-panel.js +34 -0
  339. package/src/components/global-styles/color-palette-panel.js +0 -11
  340. package/src/components/global-styles/font-families.js +1 -1
  341. package/src/components/global-styles/font-library-modal/context.js +77 -31
  342. package/src/components/global-styles/font-library-modal/font-collection.js +4 -3
  343. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +9 -2
  344. package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  345. package/src/components/global-styles/font-library-modal/style.scss +15 -6
  346. package/src/components/global-styles/font-library-modal/upload-fonts.js +53 -8
  347. package/src/components/global-styles/font-library-modal/utils/index.js +21 -8
  348. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +4 -0
  349. package/src/components/global-styles/header.js +1 -1
  350. package/src/components/global-styles/hooks.js +68 -1
  351. package/src/components/global-styles/palette.js +3 -1
  352. package/src/components/global-styles/preview-colors.js +2 -2
  353. package/src/components/global-styles/preview-iframe.js +0 -1
  354. package/src/components/global-styles/preview-styles.js +2 -2
  355. package/src/components/global-styles/root-menu.js +12 -1
  356. package/src/components/global-styles/screen-background.js +29 -0
  357. package/src/components/global-styles/screen-color-palette.js +2 -2
  358. package/src/components/global-styles/screen-colors.js +4 -15
  359. package/src/components/global-styles/screen-style-variations.js +4 -36
  360. package/src/components/global-styles/screen-typography.js +6 -20
  361. package/src/components/global-styles/style-variations-container.js +2 -1
  362. package/src/components/global-styles/style.scss +15 -10
  363. package/src/components/global-styles/typography-elements.js +5 -1
  364. package/src/components/global-styles/{preview-typography.js → typography-example.js} +3 -1
  365. package/src/components/global-styles/typography-preview.js +3 -1
  366. package/src/components/global-styles/ui.js +5 -0
  367. package/src/components/global-styles/utils.js +1 -1
  368. package/src/components/global-styles/variations/style.scss +32 -23
  369. package/src/components/global-styles/variations/variations-color.js +12 -6
  370. package/src/components/global-styles/variations/variations-typography.js +41 -60
  371. package/src/components/header-edit-mode/index.js +1 -0
  372. package/src/components/header-edit-mode/style.scss +28 -17
  373. package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
  374. package/src/components/keyboard-shortcut-help-modal/index.js +4 -0
  375. package/src/components/keyboard-shortcuts/global.js +16 -4
  376. package/src/components/layout/animation.js +122 -0
  377. package/src/components/layout/index.js +12 -27
  378. package/src/components/layout/router.js +26 -25
  379. package/src/components/layout/style.scss +2 -0
  380. package/src/components/page-pages/index.js +33 -54
  381. package/src/components/page-patterns/delete-category-menu-item.js +7 -0
  382. package/src/components/page-patterns/index.js +22 -31
  383. package/src/components/page-patterns/search-items.js +13 -58
  384. package/src/components/page-patterns/use-patterns.js +17 -10
  385. package/src/components/page-templates-template-parts/actions.js +106 -91
  386. package/src/components/page-templates-template-parts/index.js +41 -93
  387. package/src/components/page-templates-template-parts/style.scss +5 -0
  388. package/src/components/plugin-template-setting-panel/index.js +14 -1
  389. package/src/components/save-button/index.js +55 -26
  390. package/src/components/save-hub/index.js +20 -164
  391. package/src/components/save-panel/index.js +24 -17
  392. package/src/components/sidebar/index.js +2 -8
  393. package/src/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
  394. package/src/components/sidebar-dataviews/dataview-item.js +2 -2
  395. package/src/components/sidebar-dataviews/default-views.js +12 -4
  396. package/src/components/sidebar-dataviews/index.js +5 -4
  397. package/src/components/sidebar-edit-mode/index.js +0 -2
  398. package/src/components/sidebar-edit-mode/page-panels/index.js +31 -62
  399. package/src/components/sidebar-edit-mode/page-panels/page-content.js +10 -10
  400. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
  401. package/src/components/sidebar-edit-mode/template-panel/index.js +33 -24
  402. package/src/components/sidebar-edit-mode/template-panel/style.scss +1 -29
  403. package/src/components/sidebar-navigation-screen/style.scss +21 -9
  404. package/src/components/sidebar-navigation-screen-details-footer/index.js +6 -2
  405. package/src/components/sidebar-navigation-screen-global-styles/index.js +29 -2
  406. package/src/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +2 -3
  407. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +11 -9
  408. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +6 -3
  409. package/src/components/sidebar-navigation-screen-patterns/index.js +0 -7
  410. package/src/components/sidebar-navigation-screen-template/index.js +6 -1
  411. package/src/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  412. package/src/components/style-book/index.js +1 -3
  413. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -3
  414. package/src/components/sync-state-with-url/use-sync-path-with-url.js +3 -19
  415. package/src/components/template-actions/index.js +63 -46
  416. package/src/components/welcome-guide/editor.js +9 -6
  417. package/src/hooks/index.js +0 -1
  418. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +21 -4
  419. package/src/store/selectors.js +3 -15
  420. package/src/style.scss +0 -2
  421. package/src/utils/constants.js +4 -2
  422. package/src/utils/get-is-list-page.js +1 -1
  423. package/src/utils/math.js +93 -0
  424. package/build/components/actions/index.js +0 -321
  425. package/build/components/actions/index.js.map +0 -1
  426. package/build/components/global-styles/preview-typography.js.map +0 -1
  427. package/build/components/sidebar-edit-mode/sidebar-card/index.js +0 -42
  428. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  429. package/build/components/sidebar-edit-mode/template-panel/template-actions.js +0 -50
  430. package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
  431. package/build/components/sidebar-edit-mode/template-panel/template-areas.js +0 -70
  432. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  433. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
  434. package/build/components/sidebar-navigation-screen-pages/index.js +0 -175
  435. package/build/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  436. package/build/components/sidebar-navigation-screen-templates/index.js +0 -132
  437. package/build/components/sidebar-navigation-screen-templates/index.js.map +0 -1
  438. package/build/hooks/template-part-edit.js +0 -82
  439. package/build/hooks/template-part-edit.js.map +0 -1
  440. package/build/store/utils.js +0 -71
  441. package/build/store/utils.js.map +0 -1
  442. package/build-module/components/actions/index.js +0 -310
  443. package/build-module/components/actions/index.js.map +0 -1
  444. package/build-module/components/global-styles/preview-typography.js.map +0 -1
  445. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +0 -34
  446. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
  447. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +0 -42
  448. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
  449. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +0 -63
  450. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
  451. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
  452. package/build-module/components/sidebar-navigation-screen-pages/index.js +0 -167
  453. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +0 -1
  454. package/build-module/components/sidebar-navigation-screen-templates/index.js +0 -124
  455. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +0 -1
  456. package/build-module/hooks/template-part-edit.js +0 -75
  457. package/build-module/hooks/template-part-edit.js.map +0 -1
  458. package/build-module/store/utils.js +0 -64
  459. package/build-module/store/utils.js.map +0 -1
  460. package/src/components/actions/index.js +0 -411
  461. package/src/components/sidebar-edit-mode/sidebar-card/index.js +0 -34
  462. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +0 -37
  463. package/src/components/sidebar-edit-mode/template-panel/template-actions.js +0 -49
  464. package/src/components/sidebar-edit-mode/template-panel/template-areas.js +0 -86
  465. package/src/components/sidebar-navigation-screen-pages/index.js +0 -238
  466. package/src/components/sidebar-navigation-screen-templates/index.js +0 -156
  467. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -9
  468. package/src/hooks/template-part-edit.js +0 -89
  469. package/src/store/test/utils.js +0 -191
  470. package/src/store/utils.js +0 -69
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.32.0 (2024-04-03)
6
+
7
+ ## 5.31.0 (2024-03-21)
8
+
5
9
  ## 5.30.0 (2024-03-06)
6
10
 
7
11
  ## 5.29.0 (2024-02-21)
@@ -16,6 +16,7 @@ var _editor = require("@wordpress/editor");
16
16
  var _lockUnlock = require("../../lock-unlock");
17
17
  var _store = require("../../store");
18
18
  var _constants = require("../../utils/constants");
19
+ var _math = require("../../utils/math");
19
20
  /**
20
21
  * External dependencies
21
22
  */
@@ -35,16 +36,19 @@ function EditorCanvas({
35
36
  enableResizing,
36
37
  settings,
37
38
  children,
39
+ onClick,
38
40
  ...props
39
41
  }) {
40
42
  const {
41
43
  hasBlocks,
42
44
  isFocusMode,
43
45
  templateType,
44
- canvasMode
46
+ canvasMode,
47
+ isZoomOutMode
45
48
  } = (0, _data.useSelect)(select => {
46
49
  const {
47
- getBlockCount
50
+ getBlockCount,
51
+ __unstableGetEditorMode
48
52
  } = select(_blockEditor.store);
49
53
  const {
50
54
  getEditedPostType,
@@ -54,6 +58,7 @@ function EditorCanvas({
54
58
  return {
55
59
  templateType: _templateType,
56
60
  isFocusMode: _constants.FOCUSABLE_ENTITIES.includes(_templateType),
61
+ isZoomOutMode: __unstableGetEditorMode() === 'zoom-out',
57
62
  canvasMode: getCanvasMode(),
58
63
  hasBlocks: !!getBlockCount()
59
64
  };
@@ -86,7 +91,13 @@ function EditorCanvas({
86
91
  setCanvasMode('edit');
87
92
  }
88
93
  },
89
- onClick: () => setCanvasMode('edit'),
94
+ onClick: () => {
95
+ if (!!onClick) {
96
+ onClick();
97
+ } else {
98
+ setCanvasMode('edit');
99
+ }
100
+ },
90
101
  readonly: true
91
102
  };
92
103
  const isTemplateTypeNavigation = templateType === _constants.NAVIGATION_POST_TYPE;
@@ -104,6 +115,14 @@ function EditorCanvas({
104
115
  // which isn't a requirement in auto resize mode.
105
116
  enableResizing ? 'min-height:0!important;' : ''}}body{position:relative; ${canvasMode === 'view' ? 'cursor: pointer; min-height: 100vh;' : ''}}}`
106
117
  }], [settings.styles, enableResizing, canvasMode]);
118
+ const frameSize = isZoomOutMode ? 20 : undefined;
119
+ const scale = isZoomOutMode ? contentWidth => (0, _math.computeIFrameScale)({
120
+ width: 1000,
121
+ scale: 0.45
122
+ }, {
123
+ width: 400,
124
+ scale: 0.9
125
+ }, contentWidth) : undefined;
107
126
  return (0, _react.createElement)(EditorCanvasRoot, {
108
127
  className: (0, _classnames.default)('edit-site-editor-canvas__block-list', {
109
128
  'is-navigation-block': isTemplateTypeNavigation
@@ -111,7 +130,8 @@ function EditorCanvas({
111
130
  renderAppender: showBlockAppender,
112
131
  styles: styles,
113
132
  iframeProps: {
114
- shouldZoom: true,
133
+ scale,
134
+ frameSize,
115
135
  className: (0, _classnames.default)('edit-site-visual-editor__editor-canvas', {
116
136
  'is-focused': isFocused && canvasMode === 'view'
117
137
  }),
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_blockEditor","_data","_keycodes","_element","_i18n","_editor","_lockUnlock","_store","_constants","EditorCanvas","EditorCanvasRoot","unlock","editorPrivateApis","enableResizing","settings","children","props","hasBlocks","isFocusMode","templateType","canvasMode","useSelect","select","getBlockCount","blockEditorStore","getEditedPostType","getCanvasMode","editSiteStore","_templateType","FOCUSABLE_ENTITIES","includes","setCanvasMode","useDispatch","isFocused","setIsFocused","useState","useEffect","viewModeIframeProps","__","title","role","tabIndex","onFocus","onBlur","onKeyDown","event","keyCode","ENTER","SPACE","preventDefault","onClick","readonly","isTemplateTypeNavigation","NAVIGATION_POST_TYPE","isNavigationFocusMode","showBlockAppender","undefined","styles","useMemo","css","_react","createElement","className","classnames","renderAppender","iframeProps","shouldZoom","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/block-editor/editor-canvas.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tFOCUSABLE_ENTITIES,\n\tNAVIGATION_POST_TYPE,\n} from '../../utils/constants';\n\nconst { EditorCanvas: EditorCanvasRoot } = unlock( editorPrivateApis );\n\nfunction EditorCanvas( { enableResizing, settings, children, ...props } ) {\n\tconst { hasBlocks, isFocusMode, templateType, canvasMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockCount } = select( blockEditorStore );\n\t\t\tconst { getEditedPostType, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst _templateType = getEditedPostType();\n\n\t\t\treturn {\n\t\t\t\ttemplateType: _templateType,\n\t\t\t\tisFocusMode: FOCUSABLE_ENTITIES.includes( _templateType ),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\thasBlocks: !! getBlockCount(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tuseEffect( () => {\n\t\tif ( canvasMode === 'edit' ) {\n\t\t\tsetIsFocused( false );\n\t\t}\n\t}, [ canvasMode ] );\n\n\t// In view mode, make the canvas iframe be perceived and behave as a button\n\t// to switch to edit mode, with a meaningful label and no title attribute.\n\tconst viewModeIframeProps = {\n\t\t'aria-label': __( 'Edit' ),\n\t\ttitle: null,\n\t\trole: 'button',\n\t\ttabIndex: 0,\n\t\tonFocus: () => setIsFocused( true ),\n\t\tonBlur: () => setIsFocused( false ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tconst { keyCode } = event;\n\t\t\tif ( keyCode === ENTER || keyCode === SPACE ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t}\n\t\t},\n\t\tonClick: () => setCanvasMode( 'edit' ),\n\t\treadonly: true,\n\t};\n\tconst isTemplateTypeNavigation = templateType === NAVIGATION_POST_TYPE;\n\tconst isNavigationFocusMode = isTemplateTypeNavigation && isFocusMode;\n\t// Hide the appender when:\n\t// - In navigation focus mode (should only allow the root Nav block).\n\t// - In view mode (i.e. not editing).\n\tconst showBlockAppender =\n\t\t( isNavigationFocusMode && hasBlocks ) || canvasMode === 'view'\n\t\t\t? false\n\t\t\t: undefined;\n\n\tconst styles = useMemo(\n\t\t() => [\n\t\t\t...settings.styles,\n\t\t\t{\n\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\n\t\t\t\tcss: `.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing ? 'min-height:0!important;' : ''\n\t\t\t\t}}body{position:relative; ${\n\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t? 'cursor: pointer; min-height: 100vh;'\n\t\t\t\t\t\t: ''\n\t\t\t\t}}}`,\n\t\t\t},\n\t\t],\n\t\t[ settings.styles, enableResizing, canvasMode ]\n\t);\n\n\treturn (\n\t\t<EditorCanvasRoot\n\t\t\tclassName={ classnames( 'edit-site-editor-canvas__block-list', {\n\t\t\t\t'is-navigation-block': isTemplateTypeNavigation,\n\t\t\t} ) }\n\t\t\trenderAppender={ showBlockAppender }\n\t\t\tstyles={ styles }\n\t\t\tiframeProps={ {\n\t\t\t\tshouldZoom: true,\n\t\t\t\tclassName: classnames(\n\t\t\t\t\t'edit-site-visual-editor__editor-canvas',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-focused': isFocused && canvasMode === 'view',\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t\t...props,\n\t\t\t\t...( canvasMode === 'view' ? viewModeIframeProps : {} ),\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</EditorCanvasRoot>\n\t);\n}\n\nexport default EditorCanvas;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAQA,MAAM;EAAEU,YAAY,EAAEC;AAAiB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEtE,SAASH,YAAYA,CAAE;EAAEI,cAAc;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAG;EACzE,MAAM;IAAEC,SAAS;IAAEC,WAAW;IAAEC,YAAY;IAAEC;EAAW,CAAC,GAAG,IAAAC,eAAS,EACnEC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAc,CAAC,GAAGD,MAAM,CA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Editor","_data","_keycodes","_element","_i18n","_editor","_lockUnlock","_store","_constants","_math","EditorCanvas","EditorCanvasRoot","unlock","editorPrivateApis","enableResizing","settings","children","onClick","props","hasBlocks","isFocusMode","templateType","canvasMode","isZoomOutMode","useSelect","select","getBlockCount","__unstableGetEditorMode","blockEditorStore","getEditedPostType","getCanvasMode","editSiteStore","_templateType","FOCUSABLE_ENTITIES","includes","setCanvasMode","useDispatch","isFocused","setIsFocused","useState","useEffect","viewModeIframeProps","__","title","role","tabIndex","onFocus","onBlur","onKeyDown","event","keyCode","ENTER","SPACE","preventDefault","readonly","isTemplateTypeNavigation","NAVIGATION_POST_TYPE","isNavigationFocusMode","showBlockAppender","undefined","styles","useMemo","css","frameSize","scale","contentWidth","computeIFrameScale","width","_react","createElement","className","classnames","renderAppender","iframeProps","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/block-editor/editor-canvas.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tFOCUSABLE_ENTITIES,\n\tNAVIGATION_POST_TYPE,\n} from '../../utils/constants';\nimport { computeIFrameScale } from '../../utils/math';\n\nconst { EditorCanvas: EditorCanvasRoot } = unlock( editorPrivateApis );\n\nfunction EditorCanvas( {\n\tenableResizing,\n\tsettings,\n\tchildren,\n\tonClick,\n\t...props\n} ) {\n\tconst { hasBlocks, isFocusMode, templateType, canvasMode, isZoomOutMode } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getBlockCount, __unstableGetEditorMode } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getEditedPostType, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst _templateType = getEditedPostType();\n\n\t\t\treturn {\n\t\t\t\ttemplateType: _templateType,\n\t\t\t\tisFocusMode: FOCUSABLE_ENTITIES.includes( _templateType ),\n\t\t\t\tisZoomOutMode: __unstableGetEditorMode() === 'zoom-out',\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\thasBlocks: !! getBlockCount(),\n\t\t\t};\n\t\t}, [] );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tuseEffect( () => {\n\t\tif ( canvasMode === 'edit' ) {\n\t\t\tsetIsFocused( false );\n\t\t}\n\t}, [ canvasMode ] );\n\n\t// In view mode, make the canvas iframe be perceived and behave as a button\n\t// to switch to edit mode, with a meaningful label and no title attribute.\n\tconst viewModeIframeProps = {\n\t\t'aria-label': __( 'Edit' ),\n\t\ttitle: null,\n\t\trole: 'button',\n\t\ttabIndex: 0,\n\t\tonFocus: () => setIsFocused( true ),\n\t\tonBlur: () => setIsFocused( false ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tconst { keyCode } = event;\n\t\t\tif ( keyCode === ENTER || keyCode === SPACE ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t}\n\t\t},\n\t\tonClick: () => {\n\t\t\tif ( !! onClick ) {\n\t\t\t\tonClick();\n\t\t\t} else {\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t}\n\t\t},\n\t\treadonly: true,\n\t};\n\tconst isTemplateTypeNavigation = templateType === NAVIGATION_POST_TYPE;\n\tconst isNavigationFocusMode = isTemplateTypeNavigation && isFocusMode;\n\t// Hide the appender when:\n\t// - In navigation focus mode (should only allow the root Nav block).\n\t// - In view mode (i.e. not editing).\n\tconst showBlockAppender =\n\t\t( isNavigationFocusMode && hasBlocks ) || canvasMode === 'view'\n\t\t\t? false\n\t\t\t: undefined;\n\n\tconst styles = useMemo(\n\t\t() => [\n\t\t\t...settings.styles,\n\t\t\t{\n\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\n\t\t\t\tcss: `.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing ? 'min-height:0!important;' : ''\n\t\t\t\t}}body{position:relative; ${\n\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t? 'cursor: pointer; min-height: 100vh;'\n\t\t\t\t\t\t: ''\n\t\t\t\t}}}`,\n\t\t\t},\n\t\t],\n\t\t[ settings.styles, enableResizing, canvasMode ]\n\t);\n\n\tconst frameSize = isZoomOutMode ? 20 : undefined;\n\n\tconst scale = isZoomOutMode\n\t\t? ( contentWidth ) =>\n\t\t\t\tcomputeIFrameScale(\n\t\t\t\t\t{ width: 1000, scale: 0.45 },\n\t\t\t\t\t{ width: 400, scale: 0.9 },\n\t\t\t\t\tcontentWidth\n\t\t\t\t)\n\t\t: undefined;\n\n\treturn (\n\t\t<EditorCanvasRoot\n\t\t\tclassName={ classnames( 'edit-site-editor-canvas__block-list', {\n\t\t\t\t'is-navigation-block': isTemplateTypeNavigation,\n\t\t\t} ) }\n\t\t\trenderAppender={ showBlockAppender }\n\t\t\tstyles={ styles }\n\t\t\tiframeProps={ {\n\t\t\t\tscale,\n\t\t\t\tframeSize,\n\t\t\t\tclassName: classnames(\n\t\t\t\t\t'edit-site-visual-editor__editor-canvas',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-focused': isFocused && canvasMode === 'view',\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t\t...props,\n\t\t\t\t...( canvasMode === 'view' ? viewModeIframeProps : {} ),\n\t\t\t} }\n\t\t>\n\t\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QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclE,YAAY"}
@@ -9,6 +9,7 @@ var _react = require("react");
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _data = require("@wordpress/data");
11
11
  var _compose = require("@wordpress/compose");
12
+ var _blockEditor = require("@wordpress/block-editor");
12
13
  var _resizableEditor = _interopRequireDefault(require("./resizable-editor"));
13
14
  var _editorCanvas = _interopRequireDefault(require("./editor-canvas"));
14
15
  var _editorCanvasContainer = _interopRequireDefault(require("../editor-canvas-container"));
@@ -32,22 +33,29 @@ var _router = require("@wordpress/router");
32
33
  const {
33
34
  useLocation
34
35
  } = (0, _lockUnlock.unlock)(_router.privateApis);
35
- function SiteEditorCanvas() {
36
+ function SiteEditorCanvas({
37
+ onClick
38
+ }) {
36
39
  const location = useLocation();
37
40
  const {
38
41
  templateType,
39
42
  isFocusableEntity,
40
- isViewMode
43
+ isViewMode,
44
+ isZoomOutMode
41
45
  } = (0, _data.useSelect)(select => {
42
46
  const {
43
47
  getEditedPostType,
44
48
  getCanvasMode
45
49
  } = (0, _lockUnlock.unlock)(select(_store.store));
50
+ const {
51
+ __unstableGetEditorMode
52
+ } = select(_blockEditor.store);
46
53
  const _templateType = getEditedPostType();
47
54
  return {
48
55
  templateType: _templateType,
49
56
  isFocusableEntity: _constants.FOCUSABLE_ENTITIES.includes(_templateType),
50
- isViewMode: getCanvasMode() === 'view'
57
+ isViewMode: getCanvasMode() === 'view',
58
+ isZoomOutMode: __unstableGetEditorMode() === 'zoom-out'
51
59
  };
52
60
  }, []);
53
61
  const isFocusMode = location.params.focusMode || isFocusableEntity;
@@ -57,6 +65,8 @@ function SiteEditorCanvas() {
57
65
  const enableResizing = isFocusMode && !isViewMode &&
58
66
  // Disable resizing in mobile viewport.
59
67
  !isMobileViewport &&
68
+ // Dsiable resizing in zoomed-out mode.
69
+ !isZoomOutMode &&
60
70
  // Disable resizing when editing a template in focus mode.
61
71
  templateType !== _constants.TEMPLATE_POST_TYPE;
62
72
  const isTemplateTypeNavigation = templateType === _constants.NAVIGATION_POST_TYPE;
@@ -74,7 +84,8 @@ function SiteEditorCanvas() {
74
84
  height: sizes.height && !forceFullHeight ? sizes.height : '100%'
75
85
  }, (0, _react.createElement)(_editorCanvas.default, {
76
86
  enableResizing: enableResizing,
77
- settings: settings
87
+ settings: settings,
88
+ onClick: onClick
78
89
  }, resizeObserver))));
79
90
  }
80
91
  //# sourceMappingURL=site-editor-canvas.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_compose","_resizableEditor","_editorCanvas","_editorCanvasContainer","_useSiteEditorSettings","_store","_constants","_lockUnlock","_router","useLocation","unlock","routerPrivateApis","SiteEditorCanvas","location","templateType","isFocusableEntity","isViewMode","useSelect","select","getEditedPostType","getCanvasMode","editSiteStore","_templateType","FOCUSABLE_ENTITIES","includes","isFocusMode","params","focusMode","resizeObserver","sizes","useResizeObserver","settings","useSiteEditorSettings","isMobileViewport","useViewportMatch","enableResizing","TEMPLATE_POST_TYPE","isTemplateTypeNavigation","NAVIGATION_POST_TYPE","isNavigationFocusMode","forceFullHeight","_react","createElement","default","Slot","editorCanvasView","className","classnames","height"],"sources":["@wordpress/edit-site/src/components/block-editor/site-editor-canvas.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch, useResizeObserver } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport ResizableEditor from './resizable-editor';\nimport EditorCanvas from './editor-canvas';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport useSiteEditorSettings from './use-site-editor-settings';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tFOCUSABLE_ENTITIES,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SiteEditorCanvas() {\n\tconst location = useLocation();\n\tconst { templateType, isFocusableEntity, isViewMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostType, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\tconst _templateType = getEditedPostType();\n\n\t\t\treturn {\n\t\t\t\ttemplateType: _templateType,\n\t\t\t\tisFocusableEntity: FOCUSABLE_ENTITIES.includes( _templateType ),\n\t\t\t\tisViewMode: getCanvasMode() === 'view',\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst isFocusMode = location.params.focusMode || isFocusableEntity;\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\n\tconst settings = useSiteEditorSettings();\n\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst enableResizing =\n\t\tisFocusMode &&\n\t\t! isViewMode &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Disable resizing when editing a template in focus mode.\n\t\ttemplateType !== TEMPLATE_POST_TYPE;\n\n\tconst isTemplateTypeNavigation = templateType === NAVIGATION_POST_TYPE;\n\tconst isNavigationFocusMode = isTemplateTypeNavigation && isFocusMode;\n\tconst forceFullHeight = isNavigationFocusMode;\n\n\treturn (\n\t\t<EditorCanvasContainer.Slot>\n\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t<div className=\"edit-site-visual-editor is-focus-mode\">\n\t\t\t\t\t\t{ editorCanvasView }\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames( 'edit-site-visual-editor', {\n\t\t\t\t\t\t\t'is-focus-mode': isFocusMode || !! editorCanvasView,\n\t\t\t\t\t\t\t'is-view-mode': isViewMode,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ResizableEditor\n\t\t\t\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\t\t\t\theight={\n\t\t\t\t\t\t\t\tsizes.height && ! forceFullHeight\n\t\t\t\t\t\t\t\t\t? sizes.height\n\t\t\t\t\t\t\t\t\t: '100%'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EditorCanvas\n\t\t\t\t\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ resizeObserver }\n\t\t\t\t\t\t\t</EditorCanvas>\n\t\t\t\t\t\t</ResizableEditor>\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t</EditorCanvasContainer.Slot>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,gBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,sBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,sBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAxBA;AACA;AACA;;AAEA;AACA;AACA;;AAIA;AACA;AACA;;AAcA,MAAM;EAAEW;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAMC,QAAQ,GAAGJ,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEK,YAAY;IAAEC,iBAAiB;IAAEC;EAAW,CAAC,GAAG,IAAAC,eAAS,EAC9DC,MAAM,IAAM;IACb,MAAM;MAAEC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jB,CAAE;EAAG,GAEL,IAAAyB,MAAA,CAAAC,aAAA,EAACzC,gBAAA,CAAA0C,OAAe;IACfR,cAAc,EAAGA,cAAgB;IACjCa,MAAM,EACLnB,KAAK,CAACmB,MAAM,IAAI,CAAER,eAAe,GAC9BX,KAAK,CAACmB,MAAM,GACZ;EACH,GAED,IAAAP,MAAA,CAAAC,aAAA,EAACxC,aAAA,CAAAyC,OAAY;IACZR,cAAc,EAAGA,cAAgB;IACjCJ,QAAQ,EAAGA;EAAU,GAEnBH,cACW,CACE,CACb,CAGoB,CAAC;AAE/B"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_compose","_blockEditor","_resizableEditor","_editorCanvas","_editorCanvasContainer","_useSiteEditorSettings","_store","_constants","_lockUnlock","_router","useLocation","unlock","routerPrivateApis","SiteEditorCanvas","onClick","location","templateType","isFocusableEntity","isViewMode","isZoomOutMode","useSelect","select","getEditedPostType","getCanvasMode","editSiteStore","__unstableGetEditorMode","blockEditorStore","_templateType","FOCUSABLE_ENTITIES","includes","isFocusMode","params","focusMode","resizeObserver","sizes","useResizeObserver","settings","useSiteEditorSettings","isMobileViewport","useViewportMatch","enableResizing","TEMPLATE_POST_TYPE","isTemplateTypeNavigation","NAVIGATION_POST_TYPE","isNavigationFocusMode","forceFullHeight","_react","createElement","default","Slot","editorCanvasView","className","classnames","height"],"sources":["@wordpress/edit-site/src/components/block-editor/site-editor-canvas.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch, useResizeObserver } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ResizableEditor from './resizable-editor';\nimport EditorCanvas from './editor-canvas';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport useSiteEditorSettings from './use-site-editor-settings';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tFOCUSABLE_ENTITIES,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SiteEditorCanvas( { onClick } ) {\n\tconst location = useLocation();\n\tconst { templateType, isFocusableEntity, isViewMode, isZoomOutMode } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getEditedPostType, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\t\tconst _templateType = getEditedPostType();\n\n\t\t\treturn {\n\t\t\t\ttemplateType: _templateType,\n\t\t\t\tisFocusableEntity: FOCUSABLE_ENTITIES.includes( _templateType ),\n\t\t\t\tisViewMode: getCanvasMode() === 'view',\n\t\t\t\tisZoomOutMode: __unstableGetEditorMode() === 'zoom-out',\n\t\t\t};\n\t\t}, [] );\n\tconst isFocusMode = location.params.focusMode || isFocusableEntity;\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\n\tconst settings = useSiteEditorSettings();\n\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst enableResizing =\n\t\tisFocusMode &&\n\t\t! isViewMode &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Dsiable resizing in zoomed-out mode.\n\t\t! isZoomOutMode &&\n\t\t// Disable resizing when editing a template in focus mode.\n\t\ttemplateType !== TEMPLATE_POST_TYPE;\n\n\tconst isTemplateTypeNavigation = templateType === NAVIGATION_POST_TYPE;\n\tconst isNavigationFocusMode = isTemplateTypeNavigation && isFocusMode;\n\tconst forceFullHeight = isNavigationFocusMode;\n\n\treturn (\n\t\t<EditorCanvasContainer.Slot>\n\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t<div className=\"edit-site-visual-editor is-focus-mode\">\n\t\t\t\t\t\t{ editorCanvasView }\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames( 'edit-site-visual-editor', {\n\t\t\t\t\t\t\t'is-focus-mode': isFocusMode || !! editorCanvasView,\n\t\t\t\t\t\t\t'is-view-mode': isViewMode,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ResizableEditor\n\t\t\t\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\t\t\t\theight={\n\t\t\t\t\t\t\t\tsizes.height && ! forceFullHeight\n\t\t\t\t\t\t\t\t\t? sizes.height\n\t\t\t\t\t\t\t\t\t: '100%'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EditorCanvas\n\t\t\t\t\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ resizeObserver }\n\t\t\t\t\t\t\t</EditorCanvas>\n\t\t\t\t\t\t</ResizableEditor>\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t</EditorCanvasContainer.Slot>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,sBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,sBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAKA,IAAAU,WAAA,GAAAV,OAAA;AACA,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AY,KAAKyB,6BAAkB;EAEpC,MAAMC,wBAAwB,GAAG1B,YAAY,KAAK2B,+BAAoB;EACtE,MAAMC,qBAAqB,GAAGF,wBAAwB,IAAIZ,WAAW;EACrE,MAAMe,eAAe,GAAGD,qBAAqB;EAE7C,OACC,IAAAE,MAAA,CAAAC,aAAA,EAAC3C,sBAAA,CAAA4C,OAAqB,CAACC,IAAI,QACxB,CAAE,CAAEC,gBAAgB,CAAE,KACvBA,gBAAgB,GACf,IAAAJ,MAAA,CAAAC,aAAA;IAAKI,SAAS,EAAC;EAAuC,GACnDD,gBACE,CAAC,GAEN,IAAAJ,MAAA,CAAAC,aAAA;IACCI,SAAS,EAAG,IAAAC,mBAAU,EAAE,yBAAyB,EAAE;MAClD,eAAe,EAAEtB,WAAW,IAAI,CAAC,CAAEoB,gBAAgB;MACnD,cAAc,EAAEhC;IACjB,CAAE;EAAG,GAEL,IAAA4B,MAAA,CAAAC,aAAA,EAAC7C,gBAAA,CAAA8C,OAAe;IACfR,cAAc,EAAGA,cAAgB;IACjCa,MAAM,EACLnB,KAAK,CAACmB,MAAM,IAAI,CAAER,eAAe,GAC9BX,KAAK,CAACmB,MAAM,GACZ;EACH,GAED,IAAAP,MAAA,CAAAC,aAAA,EAAC5C,aAAA,CAAA6C,OAAY;IACZR,cAAc,EAAGA,cAAgB;IACjCJ,QAAQ,EAAGA,QAAU;IACrBtB,OAAO,EAAGA;EAAS,GAEjBmB,cACW,CACE,CACb,CAGoB,CAAC;AAE/B"}
@@ -103,7 +103,7 @@ function useNavigateToPreviousEntityRecord() {
103
103
  const history = useHistory();
104
104
  const goBack = (0, _element.useMemo)(() => {
105
105
  const isFocusMode = location.params.focusMode || location.params.postId && _constants.FOCUSABLE_ENTITIES.includes(location.params.postType);
106
- const didComeFromEditorCanvas = previousLocation?.params.postId && previousLocation?.params.postType && previousLocation?.params.canvas === 'edit';
106
+ const didComeFromEditorCanvas = previousLocation?.params.canvas === 'edit';
107
107
  const showBackButton = isFocusMode && didComeFromEditorCanvas;
108
108
  return showBackButton ? () => history.back() : undefined;
109
109
  // Disable reason: previousLocation changes when the component updates for any reason, not
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_element","_coreData","_editor","_router","_compose","_store","_lockUnlock","_useNavigateToEntityRecord","_interopRequireDefault","_constants","useBlockEditorSettings","unlock","editorPrivateApis","useLocation","useHistory","routerPrivateApis","useArchiveLabel","templateSlug","taxonomyMatches","match","taxonomy","term","isAuthor","authorSlug","authorMatches","useSelect","select","getEntityRecords","getTaxonomy","getAuthors","coreStore","archiveTypeLabel","archiveNameLabel","labels","singular_name","records","slug","per_page","name","authorRecords","useNavigateToPreviousEntityRecord","location","previousLocation","usePrevious","history","goBack","useMemo","isFocusMode","params","focusMode","postId","FOCUSABLE_ENTITIES","includes","postType","didComeFromEditorCanvas","canvas","showBackButton","back","undefined","useSpecificEditorSettings","onNavigateToEntityRecord","useNavigateToEntityRecord","canvasMode","settings","postWithTemplate","getEditedPostType","getEditedPostId","getEditedPostContext","getCanvasMode","getSettings","editSiteStore","getEditedEntityRecord","usedPostType","usedPostId","_record","_context","archiveLabels","defaultRenderingMode","onNavigateToPreviousEntityRecord","defaultEditorSettings","richEditingEnabled","supportsTemplateMode","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel","__unstableIsPreviewMode","useSiteEditorSettings"],"sources":["@wordpress/edit-site/src/components/block-editor/use-site-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useNavigateToEntityRecord from './use-navigate-to-entity-record';\nimport { FOCUSABLE_ENTITIES } from '../../utils/constants';\n\nconst { useBlockEditorSettings } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nfunction useArchiveLabel( templateSlug ) {\n\tconst taxonomyMatches = templateSlug?.match(\n\t\t/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/\n\t);\n\tlet taxonomy;\n\tlet term;\n\tlet isAuthor = false;\n\tlet authorSlug;\n\tif ( taxonomyMatches ) {\n\t\t// If is for a all taxonomies of a type\n\t\tif ( taxonomyMatches[ 1 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 2 ]\n\t\t\t\t? taxonomyMatches[ 2 ]\n\t\t\t\t: taxonomyMatches[ 1 ];\n\t\t}\n\t\t// If is for a all taxonomies of a type\n\t\telse if ( taxonomyMatches[ 3 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 6 ]\n\t\t\t\t? taxonomyMatches[ 6 ]\n\t\t\t\t: taxonomyMatches[ 4 ];\n\t\t\tterm = taxonomyMatches[ 7 ];\n\t\t}\n\t\ttaxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;\n\n\t\t//getTaxonomy( 'category' );\n\t\t//wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );\n\t} else {\n\t\tconst authorMatches = templateSlug?.match( /^(author)$|^author-(.+)$/ );\n\t\tif ( authorMatches ) {\n\t\t\tisAuthor = true;\n\t\t\tif ( authorMatches[ 2 ] ) {\n\t\t\t\tauthorSlug = authorMatches[ 2 ];\n\t\t\t}\n\t\t}\n\t}\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getTaxonomy, getAuthors } =\n\t\t\t\tselect( coreStore );\n\t\t\tlet archiveTypeLabel;\n\t\t\tlet archiveNameLabel;\n\t\t\tif ( taxonomy ) {\n\t\t\t\tarchiveTypeLabel =\n\t\t\t\t\tgetTaxonomy( taxonomy )?.labels?.singular_name;\n\t\t\t}\n\t\t\tif ( term ) {\n\t\t\t\tconst records = getEntityRecords( 'taxonomy', taxonomy, {\n\t\t\t\t\tslug: term,\n\t\t\t\t\tper_page: 1,\n\t\t\t\t} );\n\t\t\t\tif ( records && records[ 0 ] ) {\n\t\t\t\t\tarchiveNameLabel = records[ 0 ].name;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( isAuthor ) {\n\t\t\t\tarchiveTypeLabel = 'Author';\n\t\t\t\tif ( authorSlug ) {\n\t\t\t\t\tconst authorRecords = getAuthors( { slug: authorSlug } );\n\t\t\t\t\tif ( authorRecords && authorRecords[ 0 ] ) {\n\t\t\t\t\t\tarchiveNameLabel = authorRecords[ 0 ].name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tarchiveTypeLabel,\n\t\t\t\tarchiveNameLabel,\n\t\t\t};\n\t\t},\n\t\t[ authorSlug, isAuthor, taxonomy, term ]\n\t);\n}\n\nfunction useNavigateToPreviousEntityRecord() {\n\tconst location = useLocation();\n\tconst previousLocation = usePrevious( location );\n\tconst history = useHistory();\n\tconst goBack = useMemo( () => {\n\t\tconst isFocusMode =\n\t\t\tlocation.params.focusMode ||\n\t\t\t( location.params.postId &&\n\t\t\t\tFOCUSABLE_ENTITIES.includes( location.params.postType ) );\n\t\tconst didComeFromEditorCanvas =\n\t\t\tpreviousLocation?.params.postId &&\n\t\t\tpreviousLocation?.params.postType &&\n\t\t\tpreviousLocation?.params.canvas === 'edit';\n\t\tconst showBackButton = isFocusMode && didComeFromEditorCanvas;\n\t\treturn showBackButton ? () => history.back() : undefined;\n\t\t// Disable reason: previousLocation changes when the component updates for any reason, not\n\t\t// just when location changes. Until this is fixed we can't add it to deps. See\n\t\t// https://github.com/WordPress/gutenberg/pull/58710#discussion_r1479219465.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ location, history ] );\n\treturn goBack;\n}\n\nexport function useSpecificEditorSettings() {\n\tconst onNavigateToEntityRecord = useNavigateToEntityRecord();\n\tconst { templateSlug, canvasMode, settings, postWithTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostType,\n\t\t\t\tgetEditedPostId,\n\t\t\t\tgetEditedPostContext,\n\t\t\t\tgetCanvasMode,\n\t\t\t\tgetSettings,\n\t\t\t} = unlock( select( editSiteStore ) );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst usedPostType = getEditedPostType();\n\t\t\tconst usedPostId = getEditedPostId();\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tusedPostType,\n\t\t\t\tusedPostId\n\t\t\t);\n\t\t\tconst _context = getEditedPostContext();\n\t\t\treturn {\n\t\t\t\ttemplateSlug: _record.slug,\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tsettings: getSettings(),\n\t\t\t\tpostWithTemplate: _context?.postId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst archiveLabels = useArchiveLabel( templateSlug );\n\tconst defaultRenderingMode = postWithTemplate\n\t\t? 'template-locked'\n\t\t: 'post-only';\n\tconst onNavigateToPreviousEntityRecord =\n\t\tuseNavigateToPreviousEntityRecord();\n\tconst defaultEditorSettings = useMemo( () => {\n\t\treturn {\n\t\t\t...settings,\n\n\t\t\trichEditingEnabled: true,\n\t\t\tsupportsTemplateMode: true,\n\t\t\tfocusMode: canvasMode !== 'view',\n\t\t\tdefaultRenderingMode,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\t// I wonder if they should be set in the post editor too\n\t\t\t__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,\n\t\t\t__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel,\n\t\t\t__unstableIsPreviewMode: canvasMode === 'view',\n\t\t};\n\t}, [\n\t\tsettings,\n\t\tcanvasMode,\n\t\tdefaultRenderingMode,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t\tarchiveLabels.archiveTypeLabel,\n\t\tarchiveLabels.archiveNameLabel,\n\t] );\n\n\treturn defaultEditorSettings;\n}\n\nexport default function useSiteEditorSettings() {\n\tconst defaultEditorSettings = useSpecificEditorSettings();\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst usedPostType = getEditedPostType();\n\t\tconst usedPostId = getEditedPostId();\n\t\treturn {\n\t\t\tpostType: usedPostType,\n\t\t\tpostId: usedPostId,\n\t\t};\n\t}, [] );\n\treturn useBlockEditorSettings( defaultEditorSettings, postType, postId );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,0BAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAhBA;AACA;AACA;;AAQA;AACA;AACA;;AAMA,MAAM;EAAEW;AAAuB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAC9D,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAH,kBAAM,EAAEI,mBAAkB,CAAC;AAE/D,SAASC,eAAeA,CAAEC,YAAY,EAAG;EACxC,MAAMC,eAAe,GAAGD,YAAY,EAAEE,KAAK,CAC1C,8EACD,CAAC;EACD,IAAIC,QAAQ;EACZ,IAAIC,IAAI;EACR,IAAIC,QAAQ,GAAG,KAAK;EACpB,IAAIC,UAAU;EACd,IAAKL,eAAe,EAAG;IACtB;IACA,IAAKA,eAAe,CAAE,CAAC,CAAE,EAAG;MAC3B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ACAI,mCAAmC,EAAEN,aAAa,CAAC7C,gBAAgB;MACnEoD,mCAAmC,EAAEP,aAAa,CAAC5C,gBAAgB;MACnEoD,uBAAuB,EAAEtB,UAAU,KAAK;IACzC,CAAC;EACF,CAAC,EAAE,CACFC,QAAQ,EACRD,UAAU,EACVe,oBAAoB,EACpBjB,wBAAwB,EACxBkB,gCAAgC,EAChCF,aAAa,CAAC7C,gBAAgB,EAC9B6C,aAAa,CAAC5C,gBAAgB,CAC7B,CAAC;EAEH,OAAO+C,qBAAqB;AAC7B;AAEe,SAASM,qBAAqBA,CAAA,EAAG;EAC/C,MAAMN,qBAAqB,GAAGpB,yBAAyB,CAAC,CAAC;EACzD,MAAM;IAAEN,QAAQ;IAAEH;EAAO,CAAC,GAAG,IAAAzB,eAAS,EAAIC,MAAM,IAAM;IACrD,MAAM;MAAEuC,iBAAiB;MAAEC;IAAgB,CAAC,GAAG,IAAAvD,kBAAM,EACpDe,MAAM,CAAE4C,YAAc,CACvB,CAAC;IACD,MAAME,YAAY,GAAGP,iBAAiB,CAAC,CAAC;IACxC,MAAMQ,UAAU,GAAGP,eAAe,CAAC,CAAC;IACpC,OAAO;MACNb,QAAQ,EAAEmB,YAAY;MACtBtB,MAAM,EAAEuB;IACT,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OAAO/D,sBAAsB,CAAEqE,qBAAqB,EAAE1B,QAAQ,EAAEH,MAAO,CAAC;AACzE"}
1
+ {"version":3,"names":["_data","require","_element","_coreData","_editor","_router","_compose","_store","_lockUnlock","_useNavigateToEntityRecord","_interopRequireDefault","_constants","useBlockEditorSettings","unlock","editorPrivateApis","useLocation","useHistory","routerPrivateApis","useArchiveLabel","templateSlug","taxonomyMatches","match","taxonomy","term","isAuthor","authorSlug","authorMatches","useSelect","select","getEntityRecords","getTaxonomy","getAuthors","coreStore","archiveTypeLabel","archiveNameLabel","labels","singular_name","records","slug","per_page","name","authorRecords","useNavigateToPreviousEntityRecord","location","previousLocation","usePrevious","history","goBack","useMemo","isFocusMode","params","focusMode","postId","FOCUSABLE_ENTITIES","includes","postType","didComeFromEditorCanvas","canvas","showBackButton","back","undefined","useSpecificEditorSettings","onNavigateToEntityRecord","useNavigateToEntityRecord","canvasMode","settings","postWithTemplate","getEditedPostType","getEditedPostId","getEditedPostContext","getCanvasMode","getSettings","editSiteStore","getEditedEntityRecord","usedPostType","usedPostId","_record","_context","archiveLabels","defaultRenderingMode","onNavigateToPreviousEntityRecord","defaultEditorSettings","richEditingEnabled","supportsTemplateMode","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel","__unstableIsPreviewMode","useSiteEditorSettings"],"sources":["@wordpress/edit-site/src/components/block-editor/use-site-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useNavigateToEntityRecord from './use-navigate-to-entity-record';\nimport { FOCUSABLE_ENTITIES } from '../../utils/constants';\n\nconst { useBlockEditorSettings } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nfunction useArchiveLabel( templateSlug ) {\n\tconst taxonomyMatches = templateSlug?.match(\n\t\t/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/\n\t);\n\tlet taxonomy;\n\tlet term;\n\tlet isAuthor = false;\n\tlet authorSlug;\n\tif ( taxonomyMatches ) {\n\t\t// If is for a all taxonomies of a type\n\t\tif ( taxonomyMatches[ 1 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 2 ]\n\t\t\t\t? taxonomyMatches[ 2 ]\n\t\t\t\t: taxonomyMatches[ 1 ];\n\t\t}\n\t\t// If is for a all taxonomies of a type\n\t\telse if ( taxonomyMatches[ 3 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 6 ]\n\t\t\t\t? taxonomyMatches[ 6 ]\n\t\t\t\t: taxonomyMatches[ 4 ];\n\t\t\tterm = taxonomyMatches[ 7 ];\n\t\t}\n\t\ttaxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;\n\n\t\t//getTaxonomy( 'category' );\n\t\t//wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );\n\t} else {\n\t\tconst authorMatches = templateSlug?.match( /^(author)$|^author-(.+)$/ );\n\t\tif ( authorMatches ) {\n\t\t\tisAuthor = true;\n\t\t\tif ( authorMatches[ 2 ] ) {\n\t\t\t\tauthorSlug = authorMatches[ 2 ];\n\t\t\t}\n\t\t}\n\t}\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getTaxonomy, getAuthors } =\n\t\t\t\tselect( coreStore );\n\t\t\tlet archiveTypeLabel;\n\t\t\tlet archiveNameLabel;\n\t\t\tif ( taxonomy ) {\n\t\t\t\tarchiveTypeLabel =\n\t\t\t\t\tgetTaxonomy( taxonomy )?.labels?.singular_name;\n\t\t\t}\n\t\t\tif ( term ) {\n\t\t\t\tconst records = getEntityRecords( 'taxonomy', taxonomy, {\n\t\t\t\t\tslug: term,\n\t\t\t\t\tper_page: 1,\n\t\t\t\t} );\n\t\t\t\tif ( records && records[ 0 ] ) {\n\t\t\t\t\tarchiveNameLabel = records[ 0 ].name;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( isAuthor ) {\n\t\t\t\tarchiveTypeLabel = 'Author';\n\t\t\t\tif ( authorSlug ) {\n\t\t\t\t\tconst authorRecords = getAuthors( { slug: authorSlug } );\n\t\t\t\t\tif ( authorRecords && authorRecords[ 0 ] ) {\n\t\t\t\t\t\tarchiveNameLabel = authorRecords[ 0 ].name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tarchiveTypeLabel,\n\t\t\t\tarchiveNameLabel,\n\t\t\t};\n\t\t},\n\t\t[ authorSlug, isAuthor, taxonomy, term ]\n\t);\n}\n\nfunction useNavigateToPreviousEntityRecord() {\n\tconst location = useLocation();\n\tconst previousLocation = usePrevious( location );\n\tconst history = useHistory();\n\tconst goBack = useMemo( () => {\n\t\tconst isFocusMode =\n\t\t\tlocation.params.focusMode ||\n\t\t\t( location.params.postId &&\n\t\t\t\tFOCUSABLE_ENTITIES.includes( location.params.postType ) );\n\t\tconst didComeFromEditorCanvas =\n\t\t\tpreviousLocation?.params.canvas === 'edit';\n\t\tconst showBackButton = isFocusMode && didComeFromEditorCanvas;\n\t\treturn showBackButton ? () => history.back() : undefined;\n\t\t// Disable reason: previousLocation changes when the component updates for any reason, not\n\t\t// just when location changes. Until this is fixed we can't add it to deps. See\n\t\t// https://github.com/WordPress/gutenberg/pull/58710#discussion_r1479219465.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ location, history ] );\n\treturn goBack;\n}\n\nexport function useSpecificEditorSettings() {\n\tconst onNavigateToEntityRecord = useNavigateToEntityRecord();\n\tconst { templateSlug, canvasMode, settings, postWithTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostType,\n\t\t\t\tgetEditedPostId,\n\t\t\t\tgetEditedPostContext,\n\t\t\t\tgetCanvasMode,\n\t\t\t\tgetSettings,\n\t\t\t} = unlock( select( editSiteStore ) );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst usedPostType = getEditedPostType();\n\t\t\tconst usedPostId = getEditedPostId();\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tusedPostType,\n\t\t\t\tusedPostId\n\t\t\t);\n\t\t\tconst _context = getEditedPostContext();\n\t\t\treturn {\n\t\t\t\ttemplateSlug: _record.slug,\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tsettings: getSettings(),\n\t\t\t\tpostWithTemplate: _context?.postId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst archiveLabels = useArchiveLabel( templateSlug );\n\tconst defaultRenderingMode = postWithTemplate\n\t\t? 'template-locked'\n\t\t: 'post-only';\n\tconst onNavigateToPreviousEntityRecord =\n\t\tuseNavigateToPreviousEntityRecord();\n\tconst defaultEditorSettings = useMemo( () => {\n\t\treturn {\n\t\t\t...settings,\n\n\t\t\trichEditingEnabled: true,\n\t\t\tsupportsTemplateMode: true,\n\t\t\tfocusMode: canvasMode !== 'view',\n\t\t\tdefaultRenderingMode,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\t// I wonder if they should be set in the post editor too\n\t\t\t__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,\n\t\t\t__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel,\n\t\t\t__unstableIsPreviewMode: canvasMode === 'view',\n\t\t};\n\t}, [\n\t\tsettings,\n\t\tcanvasMode,\n\t\tdefaultRenderingMode,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t\tarchiveLabels.archiveTypeLabel,\n\t\tarchiveLabels.archiveNameLabel,\n\t] );\n\n\treturn defaultEditorSettings;\n}\n\nexport default function useSiteEditorSettings() {\n\tconst defaultEditorSettings = useSpecificEditorSettings();\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst usedPostType = getEditedPostType();\n\t\tconst usedPostId = getEditedPostId();\n\t\treturn {\n\t\t\tpostType: usedPostType,\n\t\t\tpostId: usedPostId,\n\t\t};\n\t}, [] );\n\treturn useBlockEditorSettings( defaultEditorSettings, postType, postId );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA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,EACpDe,MAAM,CAAE4C,YAAc,CACvB,CAAC;IACD,MAAME,YAAY,GAAGP,iBAAiB,CAAC,CAAC;IACxC,MAAMQ,UAAU,GAAGP,eAAe,CAAC,CAAC;IACpC,OAAO;MACNb,QAAQ,EAAEmB,YAAY;MACtBtB,MAAM,EAAEuB;IACT,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OAAO/D,sBAAsB,CAAEqE,qBAAqB,EAAE1B,QAAQ,EAAEH,MAAO,CAAC;AACzE"}
@@ -60,7 +60,8 @@ const interfaceLabels = {
60
60
  footer: (0, _i18n.__)('Editor footer')
61
61
  };
62
62
  function Editor({
63
- isLoading
63
+ isLoading,
64
+ onClick
64
65
  }) {
65
66
  const {
66
67
  record: editedPost,
@@ -146,6 +147,9 @@ function Editor({
146
147
  // action in <URLQueryController> from double-announcing.
147
148
  (0, _useTitle.default)(hasLoadedPost && title);
148
149
  const loadingProgressId = (0, _compose.useInstanceId)(_canvasLoader.default, 'edit-site-editor__loading-progress');
150
+ const {
151
+ closeGeneralSidebar
152
+ } = (0, _data.useDispatch)(_store.store);
149
153
  const settings = (0, _useSiteEditorSettings.useSpecificEditorSettings)();
150
154
  const isReady = !isLoading && (postWithTemplate && !!contextPost && !!editedPost || !postWithTemplate && !!editedPost);
151
155
  return (0, _react.createElement)(_react.Fragment, null, !isReady ? (0, _react.createElement)(_canvasLoader.default, {
@@ -167,8 +171,13 @@ function Editor({
167
171
  notices: (0, _react.createElement)(_editor.EditorSnackbars, null),
168
172
  content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_globalStylesRenderer.GlobalStylesRenderer, null), isEditMode && (0, _react.createElement)(_editor.EditorNotices, null), showVisualEditor && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_templatePartConverter.default, null), (0, _react.createElement)(_sidebarEditMode.SidebarInspectorFill, null, (0, _react.createElement)(_blockEditor.BlockInspector, null)), !isLargeViewport && (0, _react.createElement)(_blockEditor.BlockToolbar, {
169
173
  hideDragHandle: true
170
- }), (0, _react.createElement)(_siteEditorCanvas.default, null), (0, _react.createElement)(_patternModal.default, null)), editorMode === 'text' && isEditMode && (0, _react.createElement)(_codeEditor.default, null), isEditMode && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_editMode.default, null), (0, _react.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _react.createElement)(_editor.EditorKeyboardShortcuts, null))),
171
- secondarySidebar: isEditMode && (shouldShowInserter && (0, _react.createElement)(InserterSidebar, null) || shouldShowListView && (0, _react.createElement)(ListViewSidebar, null)),
174
+ }), (0, _react.createElement)(_siteEditorCanvas.default, {
175
+ onClick: onClick
176
+ }), (0, _react.createElement)(_patternModal.default, null)), editorMode === 'text' && isEditMode && (0, _react.createElement)(_codeEditor.default, null), isEditMode && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_editMode.default, null), (0, _react.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _react.createElement)(_editor.EditorKeyboardShortcuts, null))),
177
+ secondarySidebar: isEditMode && (shouldShowInserter && (0, _react.createElement)(InserterSidebar, {
178
+ closeGeneralSidebar: closeGeneralSidebar,
179
+ isRightSidebarOpen: isRightSidebarOpen
180
+ }) || shouldShowListView && (0, _react.createElement)(ListViewSidebar, null)),
172
181
  sidebar: !isDistractionFree && isEditMode && isRightSidebarOpen && !isDistractionFree && (0, _react.createElement)(_interface.ComplementaryArea.Slot, {
173
182
  scope: "core/edit-site"
174
183
  }),
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_compose","_preferences","_blockEditor","_interface","_editor","_i18n","_coreData","_sidebarEditMode","_codeEditor","_editMode","_welcomeGuide","_startTemplateOptions","_store","_globalStylesRenderer","_useTitle","_canvasLoader","_lockUnlock","_useEditedEntityRecord","_patternModal","_constants","_siteEditorCanvas","_templatePartConverter","_useSiteEditorSettings","ExperimentalEditorProvider","EditorProvider","InserterSidebar","ListViewSidebar","unlock","editorPrivateApis","interfaceLabels","body","__","sidebar","actions","footer","Editor","isLoading","record","editedPost","getTitle","isLoaded","hasLoadedPost","useEditedEntityRecord","type","editedPostType","isLargeViewport","useViewportMatch","context","contextPost","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","isDistractionFree","showIconLabels","showBlockBreadcrumbs","postTypeLabel","useSelect","select","get","preferencesStore","getEditedPostContext","getCanvasMode","editSiteStore","__unstableGetEditorMode","blockEditorStore","getActiveComplementaryArea","interfaceStore","getEntityRecord","coreDataStore","isInserterOpened","isListViewOpened","getPostTypeLabel","getEditorMode","editorStore","_context","postId","postType","undefined","name","isViewMode","isEditMode","showVisualEditor","shouldShowBlockBreadcrumbs","shouldShowInserter","shouldShowListView","secondarySidebarLabel","postWithTemplate","title","_POST_TYPE_LABELS$edi","sprintf","POST_TYPE_LABELS","TEMPLATE_POST_TYPE","useTitle","loadingProgressId","useInstanceId","CanvasLoader","settings","useSpecificEditorSettings","isReady","_react","createElement","Fragment","default","id","Notice","status","isDismissible","post","__unstableTemplate","useSubRegistry","SidebarComplementaryAreaFills","InterfaceSkeleton","enableRegionNavigation","className","classnames","notices","EditorSnackbars","content","GlobalStylesRenderer","EditorNotices","SidebarInspectorFill","BlockInspector","BlockToolbar","hideDragHandle","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","secondarySidebar","ComplementaryArea","Slot","scope","BlockBreadcrumb","rootLabelText","labels"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Notice } from '@wordpress/components';\nimport { useInstanceId, useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n\tBlockInspector,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorNotices,\n\tEditorSnackbars,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarComplementaryAreaFills,\n\tSidebarInspectorFill,\n} from '../sidebar-edit-mode';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcutsEditMode from '../keyboard-shortcuts/edit-mode';\nimport WelcomeGuide from '../welcome-guide';\nimport StartTemplateOptions from '../start-template-options';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport PatternModal from '../pattern-modal';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport SiteEditorCanvas from '../block-editor/site-editor-canvas';\nimport TemplatePartConverter from '../template-part-converter';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\n\nconst {\n\tExperimentalEditorProvider: EditorProvider,\n\tInserterSidebar,\n\tListViewSidebar,\n} = unlock( editorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function Editor( { isLoading } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\n\tconst { type: editedPostType } = editedPost;\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tcontext,\n\t\tcontextPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t\tshowIconLabels,\n\t\tshowBlockBreadcrumbs,\n\t\tpostTypeLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditedPostContext, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tgetPostTypeLabel,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\t\tconst _context = getEditedPostContext();\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tcontext: _context,\n\t\t\tcontextPost: _context?.postId\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t_context.postType,\n\t\t\t\t\t\t_context.postId\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tpostTypeLabel: getPostTypeLabel(),\n\t\t};\n\t}, [] );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst shouldShowBlockBreadcrumbs =\n\t\t! isDistractionFree &&\n\t\tshowBlockBreadcrumbs &&\n\t\tisEditMode &&\n\t\tshowVisualEditor &&\n\t\tblockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst postWithTemplate = !! context?.postId;\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s' ),\n\t\t\tgetTitle(),\n\t\t\tPOST_TYPE_LABELS[ editedPostType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( hasLoadedPost && title );\n\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst settings = useSpecificEditorSettings();\n\tconst isReady =\n\t\t! isLoading &&\n\t\t( ( postWithTemplate && !! contextPost && !! editedPost ) ||\n\t\t\t( ! postWithTemplate && !! editedPost ) );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ postWithTemplate ? contextPost : editedPost }\n\t\t\t\t\t__unstableTemplate={\n\t\t\t\t\t\tpostWithTemplate ? editedPost : undefined\n\t\t\t\t\t}\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t{ isEditMode && <StartTemplateOptions /> }\n\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t{ showVisualEditor && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<TemplatePartConverter />\n\t\t\t\t\t\t\t\t\t\t<SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t\t\t\t\t\t</SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SiteEditorCanvas />\n\t\t\t\t\t\t\t\t\t\t<PatternModal />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ editorMode === 'text' && isEditMode && (\n\t\t\t\t\t\t\t\t\t<CodeEditor />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<KeyboardShortcutsEditMode />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsecondarySidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t( ( shouldShowInserter && <InserterSidebar /> ) ||\n\t\t\t\t\t\t\t\t( shouldShowListView && <ListViewSidebar /> ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\tisRightSidebarOpen &&\n\t\t\t\t\t\t\t! isDistractionFree && (\n\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfooter={\n\t\t\t\t\t\t\tshouldShowBlockBreadcrumbs && (\n\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\trootLabelText={ postTypeLabel }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabels={ {\n\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</EditorProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;A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AG1G,eAAe;MAClBoG,gBAAgB,EAAEzC;IACnB;EAAG,CACH,CACc,CAEhB,CAAC;AAEL"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_compose","_preferences","_blockEditor","_interface","_editor","_i18n","_coreData","_sidebarEditMode","_codeEditor","_editMode","_welcomeGuide","_startTemplateOptions","_store","_globalStylesRenderer","_useTitle","_canvasLoader","_lockUnlock","_useEditedEntityRecord","_patternModal","_constants","_siteEditorCanvas","_templatePartConverter","_useSiteEditorSettings","ExperimentalEditorProvider","EditorProvider","InserterSidebar","ListViewSidebar","unlock","editorPrivateApis","interfaceLabels","body","__","sidebar","actions","footer","Editor","isLoading","onClick","record","editedPost","getTitle","isLoaded","hasLoadedPost","useEditedEntityRecord","type","editedPostType","isLargeViewport","useViewportMatch","context","contextPost","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","isDistractionFree","showIconLabels","showBlockBreadcrumbs","postTypeLabel","useSelect","select","get","preferencesStore","getEditedPostContext","getCanvasMode","editSiteStore","__unstableGetEditorMode","blockEditorStore","getActiveComplementaryArea","interfaceStore","getEntityRecord","coreDataStore","isInserterOpened","isListViewOpened","getPostTypeLabel","getEditorMode","editorStore","_context","postId","postType","undefined","name","isViewMode","isEditMode","showVisualEditor","shouldShowBlockBreadcrumbs","shouldShowInserter","shouldShowListView","secondarySidebarLabel","postWithTemplate","title","_POST_TYPE_LABELS$edi","sprintf","POST_TYPE_LABELS","TEMPLATE_POST_TYPE","useTitle","loadingProgressId","useInstanceId","CanvasLoader","closeGeneralSidebar","useDispatch","settings","useSpecificEditorSettings","isReady","_react","createElement","Fragment","default","id","Notice","status","isDismissible","post","__unstableTemplate","useSubRegistry","SidebarComplementaryAreaFills","InterfaceSkeleton","enableRegionNavigation","className","classnames","notices","EditorSnackbars","content","GlobalStylesRenderer","EditorNotices","SidebarInspectorFill","BlockInspector","BlockToolbar","hideDragHandle","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","secondarySidebar","ComplementaryArea","Slot","scope","BlockBreadcrumb","rootLabelText","labels"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Notice } from '@wordpress/components';\nimport { useInstanceId, useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n\tBlockInspector,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorNotices,\n\tEditorSnackbars,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarComplementaryAreaFills,\n\tSidebarInspectorFill,\n} from '../sidebar-edit-mode';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcutsEditMode from '../keyboard-shortcuts/edit-mode';\nimport WelcomeGuide from '../welcome-guide';\nimport StartTemplateOptions from '../start-template-options';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport PatternModal from '../pattern-modal';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport SiteEditorCanvas from '../block-editor/site-editor-canvas';\nimport TemplatePartConverter from '../template-part-converter';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\n\nconst {\n\tExperimentalEditorProvider: EditorProvider,\n\tInserterSidebar,\n\tListViewSidebar,\n} = unlock( editorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function Editor( { isLoading, onClick } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\n\tconst { type: editedPostType } = editedPost;\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tcontext,\n\t\tcontextPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t\tshowIconLabels,\n\t\tshowBlockBreadcrumbs,\n\t\tpostTypeLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditedPostContext, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tgetPostTypeLabel,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\t\tconst _context = getEditedPostContext();\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tcontext: _context,\n\t\t\tcontextPost: _context?.postId\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t_context.postType,\n\t\t\t\t\t\t_context.postId\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tpostTypeLabel: getPostTypeLabel(),\n\t\t};\n\t}, [] );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst shouldShowBlockBreadcrumbs =\n\t\t! isDistractionFree &&\n\t\tshowBlockBreadcrumbs &&\n\t\tisEditMode &&\n\t\tshowVisualEditor &&\n\t\tblockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst postWithTemplate = !! context?.postId;\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s' ),\n\t\t\tgetTitle(),\n\t\t\tPOST_TYPE_LABELS[ editedPostType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( hasLoadedPost && title );\n\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst { closeGeneralSidebar } = useDispatch( editSiteStore );\n\n\tconst settings = useSpecificEditorSettings();\n\tconst isReady =\n\t\t! isLoading &&\n\t\t( ( postWithTemplate && !! contextPost && !! editedPost ) ||\n\t\t\t( ! postWithTemplate && !! editedPost ) );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ postWithTemplate ? contextPost : editedPost }\n\t\t\t\t\t__unstableTemplate={\n\t\t\t\t\t\tpostWithTemplate ? editedPost : undefined\n\t\t\t\t\t}\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t{ isEditMode && <StartTemplateOptions /> }\n\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t{ showVisualEditor && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<TemplatePartConverter />\n\t\t\t\t\t\t\t\t\t\t<SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t\t\t\t\t\t</SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SiteEditorCanvas onClick={ onClick } />\n\t\t\t\t\t\t\t\t\t\t<PatternModal />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ editorMode === 'text' && isEditMode && (\n\t\t\t\t\t\t\t\t\t<CodeEditor />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<KeyboardShortcutsEditMode />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsecondarySidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t( ( shouldShowInserter && (\n\t\t\t\t\t\t\t\t<InserterSidebar\n\t\t\t\t\t\t\t\t\tcloseGeneralSidebar={ closeGeneralSidebar }\n\t\t\t\t\t\t\t\t\tisRightSidebarOpen={ isRightSidebarOpen }\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( shouldShowListView && <ListViewSidebar /> ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\tisRightSidebarOpen &&\n\t\t\t\t\t\t\t! isDistractionFree && (\n\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfooter={\n\t\t\t\t\t\t\tshouldShowBlockBreadcrumbs && (\n\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\trootLabelText={ postTypeLabel }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabels={ {\n\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</EditorProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAMA,IAAAM,UAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAP,OAAA;AAQA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAKA,IAAAU,gBAAA,GAAAV,OAAA;AAIA,IAAAW,WAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,SAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,aAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,qBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,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AAC,aAAA,EAACjG,SAAA,CAAAmG,OAAyB,MAAE,CAAC,EAC7B,IAAAH,MAAA,CAAAC,aAAA,EAACtG,OAAA,CAAA8H,+BAA+B,MAAE,CAAC,EACnC,IAAAzB,MAAA,CAAAC,aAAA,EAACtG,OAAA,CAAA+H,uBAAuB,MAAE,CACzB,CAEF,CACF;IACDC,gBAAgB,EACfhD,UAAU,KACNG,kBAAkB,IACrB,IAAAkB,MAAA,CAAAC,aAAA,EAACjF,eAAe;MACf2E,mBAAmB,EAAGA,mBAAqB;MAC3C/C,kBAAkB,EAAGA;IAAoB,CACzC,CACD,IACEmC,kBAAkB,IAAI,IAAAiB,MAAA,CAAAC,aAAA,EAAChF,eAAe,MAAE,CAAG,CAC9C;IACDM,OAAO,EACN,CAAEwB,iBAAiB,IACnB4B,UAAU,IACV/B,kBAAkB,IAClB,CAAEG,iBAAiB,IAClB,IAAAiD,MAAA,CAAAC,aAAA,EAACvG,UAAA,CAAAkI,iBAAiB,CAACC,IAAI;MAACC,KAAK,EAAC;IAAgB,CAAE,CAEjD;IACDrG,MAAM,EACLoD,0BAA0B,IACzB,IAAAmB,MAAA,CAAAC,aAAA,EAACxG,YAAA,CAAAsI,eAAe;MACfC,aAAa,EAAG9E;IAAe,CAC/B,CAEF;IACD+E,MAAM,EAAG;MACR,GAAG7G,eAAe;MAClBuG,gBAAgB,EAAE3C;IACnB;EAAG,CACH,CACc,CAEhB,CAAC;AAEL"}
@@ -118,8 +118,7 @@ function EditorCanvasContainer({
118
118
  className: "edit-site-editor-canvas-container__close-button",
119
119
  icon: _icons.closeSmall,
120
120
  label: closeButtonLabel || (0, _i18n.__)('Close'),
121
- onClick: onCloseContainer,
122
- showTooltip: false
121
+ onClick: onCloseContainer
123
122
  }), childrenWithProps)));
124
123
  }
125
124
  function useHasEditorCanvasContainer() {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_components","_keycodes","_i18n","_data","_icons","_compose","_preferences","_editor","_lockUnlock","_store","_resizableEditor","_interopRequireDefault","getEditorCanvasContainerTitle","view","__","createPrivateSlotFill","unlock","componentsPrivateApis","SLOT_FILL_NAME","privateKey","Slot","EditorCanvasContainerSlot","Fill","EditorCanvasContainerFill","EditorCanvasContainer","children","closeButtonLabel","onClose","enableResizing","editorCanvasContainerView","showListViewByDefault","useSelect","select","_editorCanvasContainerView","editSiteStore","getEditorCanvasContainerView","_showListViewByDefault","preferencesStore","get","isClosed","setIsClosed","useState","setEditorCanvasContainerView","useDispatch","setIsListViewOpened","editorStore","focusOnMountRef","useFocusOnMount","sectionFocusReturnRef","useFocusReturn","onCloseContainer","undefined","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","childrenWithProps","Array","isArray","Children","map","child","index","cloneElement","ref","title","shouldShowCloseButton","_react","createElement","default","className","onKeyDown","Button","icon","closeSmall","label","onClick","showTooltip","useHasEditorCanvasContainer","fills","useSlotFills","length","_default","exports"],"sources":["@wordpress/edit-site/src/components/editor-canvas-container/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useState } from '@wordpress/element';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n\t__experimentalUseSlotFills as useSlotFills,\n} from '@wordpress/components';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { closeSmall } from '@wordpress/icons';\nimport { useFocusOnMount, useFocusReturn } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport ResizableEditor from '../block-editor/resizable-editor';\n\n/**\n * Returns a translated string for the title of the editor canvas container.\n *\n * @param {string} view Editor canvas container view.\n *\n * @return {string} Translated string corresponding to value of view. Default is ''.\n */\nfunction getEditorCanvasContainerTitle( view ) {\n\tswitch ( view ) {\n\t\tcase 'style-book':\n\t\t\treturn __( 'Style Book' );\n\t\tcase 'global-styles-revisions':\n\t\tcase 'global-styles-revisions:style-book':\n\t\t\treturn __( 'Style Revisions' );\n\t\tdefault:\n\t\t\treturn '';\n\t}\n}\n\n// Creates a private slot fill.\nconst { createPrivateSlotFill } = unlock( componentsPrivateApis );\nconst SLOT_FILL_NAME = 'EditSiteEditorCanvasContainerSlot';\nconst {\n\tprivateKey,\n\tSlot: EditorCanvasContainerSlot,\n\tFill: EditorCanvasContainerFill,\n} = createPrivateSlotFill( SLOT_FILL_NAME );\n\nfunction EditorCanvasContainer( {\n\tchildren,\n\tcloseButtonLabel,\n\tonClose,\n\tenableResizing = false,\n} ) {\n\tconst { editorCanvasContainerView, showListViewByDefault } = useSelect(\n\t\t( select ) => {\n\t\t\tconst _editorCanvasContainerView = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView();\n\n\t\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showListViewByDefault'\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\teditorCanvasContainerView: _editorCanvasContainerView,\n\t\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst sectionFocusReturnRef = useFocusReturn();\n\n\tfunction onCloseContainer() {\n\t\tsetIsListViewOpened( showListViewByDefault );\n\t\tsetEditorCanvasContainerView( undefined );\n\t\tsetIsClosed( true );\n\t\tif ( typeof onClose === 'function' ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tonCloseContainer();\n\t\t}\n\t}\n\n\tconst childrenWithProps = Array.isArray( children )\n\t\t? Children.map( children, ( child, index ) =>\n\t\t\t\tindex === 0\n\t\t\t\t\t? cloneElement( child, {\n\t\t\t\t\t\t\tref: sectionFocusReturnRef,\n\t\t\t\t\t } )\n\t\t\t\t\t: child\n\t\t )\n\t\t: cloneElement( children, {\n\t\t\t\tref: sectionFocusReturnRef,\n\t\t } );\n\n\tif ( isClosed ) {\n\t\treturn null;\n\t}\n\n\tconst title = getEditorCanvasContainerTitle( editorCanvasContainerView );\n\tconst shouldShowCloseButton = onClose || closeButtonLabel;\n\n\treturn (\n\t\t<EditorCanvasContainerFill>\n\t\t\t<ResizableEditor enableResizing={ enableResizing }>\n\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t\t<section\n\t\t\t\t\tclassName=\"edit-site-editor-canvas-container\"\n\t\t\t\t\tref={ shouldShowCloseButton ? focusOnMountRef : null }\n\t\t\t\t\tonKeyDown={ closeOnEscape }\n\t\t\t\t\taria-label={ title }\n\t\t\t\t>\n\t\t\t\t\t{ shouldShowCloseButton && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-editor-canvas-container__close-button\"\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\tlabel={ closeButtonLabel || __( 'Close' ) }\n\t\t\t\t\t\t\tonClick={ onCloseContainer }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ childrenWithProps }\n\t\t\t\t</section>\n\t\t\t</ResizableEditor>\n\t\t</EditorCanvasContainerFill>\n\t);\n}\nfunction useHasEditorCanvasContainer() {\n\tconst fills = useSlotFills( privateKey );\n\treturn !! fills?.length;\n}\n\nEditorCanvasContainer.Slot = EditorCanvasContainerSlot;\nexport default EditorCanvasContainer;\nexport { useHasEditorCanvasContainer, getEditorCanvasContainerTitle };\n"],"mappings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;IACrBG,GAAG,EAAElB;EACL,CAAE,CAAC,GACHe,KACH,CAAC,GACD,IAAAE,qBAAY,EAAExC,QAAQ,EAAE;IACxByC,GAAG,EAAElB;EACL,CAAE,CAAC;EAEN,IAAKT,QAAQ,EAAG;IACf,OAAO,IAAI;EACZ;EAEA,MAAM4B,KAAK,GAAGvD,6BAA6B,CAAEiB,yBAA0B,CAAC;EACxE,MAAMuC,qBAAqB,GAAGzC,OAAO,IAAID,gBAAgB;EAEzD,OACC,IAAA2C,MAAA,CAAAC,aAAA,EAAC/C,yBAAyB,QACzB,IAAA8C,MAAA,CAAAC,aAAA,EAAC5D,gBAAA,CAAA6D,OAAe;IAAC3C,cAAc,EAAGA;EAAgB,GAEjD,IAAAyC,MAAA,CAAAC,aAAA;IACCE,SAAS,EAAC,mCAAmC;IAC7CN,GAAG,EAAGE,qBAAqB,GAAGtB,eAAe,GAAG,IAAM;IACtD2B,SAAS,EAAGrB,aAAe;IAC3B,cAAae;EAAO,GAElBC,qBAAqB,IACtB,IAAAC,MAAA,CAAAC,aAAA,EAACtE,WAAA,CAAA0E,MAAM;IACNF,SAAS,EAAC,iDAAiD;IAC3DG,IAAI,EAAGC,iBAAY;IACnBC,KAAK,EAAGnD,gBAAgB,IAAI,IAAAZ,QAAE,EAAE,OAAQ,CAAG;IAC3CgE,OAAO,EAAG5B,gBAAkB;IAC5B6B,WAAW,EAAG;EAAO,CACrB,CACD,EACCrB,iBACM,CACO,CACS,CAAC;AAE9B;AACA,SAASsB,2BAA2BA,CAAA,EAAG;EACtC,MAAMC,KAAK,GAAG,IAAAC,sCAAY,EAAE/D,UAAW,CAAC;EACxC,OAAO,CAAC,CAAE8D,KAAK,EAAEE,MAAM;AACxB;AAEA3D,qBAAqB,CAACJ,IAAI,GAAGC,yBAAyB;AAAC,IAAA+D,QAAA,GAAAC,OAAA,CAAAd,OAAA,GACxC/C,qBAAqB"}
1
+ {"version":3,"names":["_element","require","_components","_keycodes","_i18n","_data","_icons","_compose","_preferences","_editor","_lockUnlock","_store","_resizableEditor","_interopRequireDefault","getEditorCanvasContainerTitle","view","__","createPrivateSlotFill","unlock","componentsPrivateApis","SLOT_FILL_NAME","privateKey","Slot","EditorCanvasContainerSlot","Fill","EditorCanvasContainerFill","EditorCanvasContainer","children","closeButtonLabel","onClose","enableResizing","editorCanvasContainerView","showListViewByDefault","useSelect","select","_editorCanvasContainerView","editSiteStore","getEditorCanvasContainerView","_showListViewByDefault","preferencesStore","get","isClosed","setIsClosed","useState","setEditorCanvasContainerView","useDispatch","setIsListViewOpened","editorStore","focusOnMountRef","useFocusOnMount","sectionFocusReturnRef","useFocusReturn","onCloseContainer","undefined","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","childrenWithProps","Array","isArray","Children","map","child","index","cloneElement","ref","title","shouldShowCloseButton","_react","createElement","default","className","onKeyDown","Button","icon","closeSmall","label","onClick","useHasEditorCanvasContainer","fills","useSlotFills","length","_default","exports"],"sources":["@wordpress/edit-site/src/components/editor-canvas-container/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useState } from '@wordpress/element';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n\t__experimentalUseSlotFills as useSlotFills,\n} from '@wordpress/components';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { closeSmall } from '@wordpress/icons';\nimport { useFocusOnMount, useFocusReturn } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport ResizableEditor from '../block-editor/resizable-editor';\n\n/**\n * Returns a translated string for the title of the editor canvas container.\n *\n * @param {string} view Editor canvas container view.\n *\n * @return {string} Translated string corresponding to value of view. Default is ''.\n */\nfunction getEditorCanvasContainerTitle( view ) {\n\tswitch ( view ) {\n\t\tcase 'style-book':\n\t\t\treturn __( 'Style Book' );\n\t\tcase 'global-styles-revisions':\n\t\tcase 'global-styles-revisions:style-book':\n\t\t\treturn __( 'Style Revisions' );\n\t\tdefault:\n\t\t\treturn '';\n\t}\n}\n\n// Creates a private slot fill.\nconst { createPrivateSlotFill } = unlock( componentsPrivateApis );\nconst SLOT_FILL_NAME = 'EditSiteEditorCanvasContainerSlot';\nconst {\n\tprivateKey,\n\tSlot: EditorCanvasContainerSlot,\n\tFill: EditorCanvasContainerFill,\n} = createPrivateSlotFill( SLOT_FILL_NAME );\n\nfunction EditorCanvasContainer( {\n\tchildren,\n\tcloseButtonLabel,\n\tonClose,\n\tenableResizing = false,\n} ) {\n\tconst { editorCanvasContainerView, showListViewByDefault } = useSelect(\n\t\t( select ) => {\n\t\t\tconst _editorCanvasContainerView = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView();\n\n\t\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showListViewByDefault'\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\teditorCanvasContainerView: _editorCanvasContainerView,\n\t\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst sectionFocusReturnRef = useFocusReturn();\n\n\tfunction onCloseContainer() {\n\t\tsetIsListViewOpened( showListViewByDefault );\n\t\tsetEditorCanvasContainerView( undefined );\n\t\tsetIsClosed( true );\n\t\tif ( typeof onClose === 'function' ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tonCloseContainer();\n\t\t}\n\t}\n\n\tconst childrenWithProps = Array.isArray( children )\n\t\t? Children.map( children, ( child, index ) =>\n\t\t\t\tindex === 0\n\t\t\t\t\t? cloneElement( child, {\n\t\t\t\t\t\t\tref: sectionFocusReturnRef,\n\t\t\t\t\t } )\n\t\t\t\t\t: child\n\t\t )\n\t\t: cloneElement( children, {\n\t\t\t\tref: sectionFocusReturnRef,\n\t\t } );\n\n\tif ( isClosed ) {\n\t\treturn null;\n\t}\n\n\tconst title = getEditorCanvasContainerTitle( editorCanvasContainerView );\n\tconst shouldShowCloseButton = onClose || closeButtonLabel;\n\n\treturn (\n\t\t<EditorCanvasContainerFill>\n\t\t\t<ResizableEditor enableResizing={ enableResizing }>\n\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t\t<section\n\t\t\t\t\tclassName=\"edit-site-editor-canvas-container\"\n\t\t\t\t\tref={ shouldShowCloseButton ? focusOnMountRef : null }\n\t\t\t\t\tonKeyDown={ closeOnEscape }\n\t\t\t\t\taria-label={ title }\n\t\t\t\t>\n\t\t\t\t\t{ shouldShowCloseButton && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-editor-canvas-container__close-button\"\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\tlabel={ closeButtonLabel || __( 'Close' ) }\n\t\t\t\t\t\t\tonClick={ onCloseContainer }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ childrenWithProps }\n\t\t\t\t</section>\n\t\t\t</ResizableEditor>\n\t\t</EditorCanvasContainerFill>\n\t);\n}\nfunction useHasEditorCanvasContainer() {\n\tconst fills = useSlotFills( privateKey );\n\treturn !! fills?.length;\n}\n\nEditorCanvasContainer.Slot = EditorCanvasContainerSlot;\nexport default EditorCanvasContainer;\nexport { useHasEditorCanvasContainer, getEditorCanvasContainerTitle };\n"],"mappings":";;;;;;;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groundPanel;
7
+ var _react = require("react");
8
+ var _blockEditor = require("@wordpress/block-editor");
9
+ var _lockUnlock = require("../../lock-unlock");
10
+ /**
11
+ * WordPress dependencies
12
+ */
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+
18
+ const {
19
+ useGlobalStyle,
20
+ useGlobalSetting,
21
+ BackgroundPanel: StylesBackgroundPanel
22
+ } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
23
+ function BackgroundPanel() {
24
+ const [style] = useGlobalStyle('', undefined, 'user', {
25
+ shouldDecodeEncode: false
26
+ });
27
+ const [inheritedStyle, setStyle] = useGlobalStyle('', undefined, 'all', {
28
+ shouldDecodeEncode: false
29
+ });
30
+ const [settings] = useGlobalSetting('');
31
+ return (0, _react.createElement)(StylesBackgroundPanel, {
32
+ inheritedValue: inheritedStyle,
33
+ value: style,
34
+ onChange: setStyle,
35
+ settings: settings
36
+ });
37
+ }
38
+ //# sourceMappingURL=background-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_blockEditor","require","_lockUnlock","useGlobalStyle","useGlobalSetting","BackgroundPanel","StylesBackgroundPanel","unlock","blockEditorPrivateApis","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","settings","_react","createElement","inheritedValue","value","onChange"],"sources":["@wordpress/edit-site/src/components/global-styles/background-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tBackgroundPanel: StylesBackgroundPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function BackgroundPanel() {\n\tconst [ style ] = useGlobalStyle( '', undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( '', undefined, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ settings ] = useGlobalSetting( '' );\n\n\treturn (\n\t\t<StylesBackgroundPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EACLE,cAAc;EACdC,gBAAgB;EAChBC,eAAe,EAAEC;AAClB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAErB,SAASH,eAAeA,CAAA,EAAG;EACzC,MAAM,CAAEI,KAAK,CAAE,GAAGN,cAAc,CAAE,EAAE,EAAEO,SAAS,EAAE,MAAM,EAAE;IACxDC,kBAAkB,EAAE;EACrB,CAAE,CAAC;EACH,MAAM,CAAEC,cAAc,EAAEC,QAAQ,CAAE,GAAGV,cAAc,CAAE,EAAE,EAAEO,SAAS,EAAE,KAAK,EAAE;IAC1EC,kBAAkB,EAAE;EACrB,CAAE,CAAC;EACH,MAAM,CAAEG,QAAQ,CAAE,GAAGV,gBAAgB,CAAE,EAAG,CAAC;EAE3C,OACC,IAAAW,MAAA,CAAAC,aAAA,EAACV,qBAAqB;IACrBW,cAAc,EAAGL,cAAgB;IACjCM,KAAK,EAAGT,KAAO;IACfU,QAAQ,EAAGN,QAAU;IACrBC,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ"}
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -11,8 +10,6 @@ var _components = require("@wordpress/components");
11
10
  var _i18n = require("@wordpress/i18n");
12
11
  var _blockEditor = require("@wordpress/block-editor");
13
12
  var _lockUnlock = require("../../lock-unlock");
14
- var _variationsColor = _interopRequireDefault(require("./variations/variations-color"));
15
- var _useThemeStyleVariationsByProperty = require("../../hooks/use-theme-style-variations/use-theme-style-variations-by-property");
16
13
  /**
17
14
  * WordPress dependencies
18
15
  */
@@ -37,10 +34,6 @@ function ColorPalettePanel({
37
34
  const [baseDefaultColors] = useGlobalSetting('color.palette.default', name, 'base');
38
35
  const [customColors, setCustomColors] = useGlobalSetting('color.palette.custom', name);
39
36
  const [defaultPaletteEnabled] = useGlobalSetting('color.defaultPalette', name);
40
- const colorVariations = (0, _useThemeStyleVariationsByProperty.useCurrentMergeThemeStyleVariationsWithUserConfig)({
41
- property: 'color',
42
- filter: variation => variation?.settings?.color && Object.keys(variation?.settings?.color).length
43
- });
44
37
  const isMobileViewport = (0, _compose.useViewportMatch)('small', '<');
45
38
  const popoverProps = isMobileViewport ? mobilePopoverProps : undefined;
46
39
  return (0, _react.createElement)(_components.__experimentalVStack, {
@@ -62,8 +55,6 @@ function ColorPalettePanel({
62
55
  paletteLabel: (0, _i18n.__)('Default'),
63
56
  paletteLabelHeadingLevel: 3,
64
57
  popoverProps: popoverProps
65
- }), !!colorVariations.length && (0, _react.createElement)(_variationsColor.default, {
66
- variations: colorVariations
67
58
  }), (0, _react.createElement)(_components.__experimentalPaletteEdit, {
68
59
  colors: customColors,
69
60
  onChange: setCustomColors,