@wordpress/edit-site 5.2.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/add-new-template/add-custom-generic-template-modal.js +8 -10
  3. package/build/components/add-new-template/add-custom-generic-template-modal.js.map +1 -1
  4. package/build/components/add-new-template/add-custom-template-modal.js +0 -1
  5. package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
  6. package/build/components/add-new-template/new-template-part.js +9 -32
  7. package/build/components/add-new-template/new-template-part.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +5 -4
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/add-new-template/utils.js +1 -9
  11. package/build/components/add-new-template/utils.js.map +1 -1
  12. package/build/components/app/index.js +2 -7
  13. package/build/components/app/index.js.map +1 -1
  14. package/build/components/block-editor/editor-canvas.js +13 -2
  15. package/build/components/block-editor/editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/index.js +16 -14
  17. package/build/components/block-editor/index.js.map +1 -1
  18. package/build/components/block-editor/inserter-media-categories.js +237 -0
  19. package/build/components/block-editor/inserter-media-categories.js.map +1 -0
  20. package/build/components/canvas-spinner/index.js +20 -0
  21. package/build/components/canvas-spinner/index.js.map +1 -0
  22. package/build/components/create-template-part-modal/index.js +4 -2
  23. package/build/components/create-template-part-modal/index.js.map +1 -1
  24. package/build/components/editor/index.js +9 -5
  25. package/build/components/editor/index.js.map +1 -1
  26. package/build/components/error-boundary/index.js +2 -12
  27. package/build/components/error-boundary/index.js.map +1 -1
  28. package/build/components/error-boundary/warning.js +5 -28
  29. package/build/components/error-boundary/warning.js.map +1 -1
  30. package/build/components/global-styles/block-preview-panel.js +2 -2
  31. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  32. package/build/components/global-styles/border-panel.js +17 -9
  33. package/build/components/global-styles/border-panel.js.map +1 -1
  34. package/build/components/global-styles/color-palette-panel.js +13 -7
  35. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  36. package/build/components/global-styles/context-menu.js +39 -4
  37. package/build/components/global-styles/context-menu.js.map +1 -1
  38. package/build/components/global-styles/custom-css.js +65 -14
  39. package/build/components/global-styles/custom-css.js.map +1 -1
  40. package/build/components/global-styles/dimensions-panel.js +49 -31
  41. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  42. package/build/components/global-styles/global-styles-provider.js +13 -3
  43. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  44. package/build/components/global-styles/gradients-palette-panel.js +17 -11
  45. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  46. package/build/components/global-styles/hooks.js +21 -142
  47. package/build/components/global-styles/hooks.js.map +1 -1
  48. package/build/components/global-styles/index.js +0 -28
  49. package/build/components/global-styles/index.js.map +1 -1
  50. package/build/components/global-styles/palette.js +11 -4
  51. package/build/components/global-styles/palette.js.map +1 -1
  52. package/build/components/global-styles/preview.js +18 -15
  53. package/build/components/global-styles/preview.js.map +1 -1
  54. package/build/components/global-styles/screen-background-color.js +27 -13
  55. package/build/components/global-styles/screen-background-color.js.map +1 -1
  56. package/build/components/global-styles/screen-border.js +10 -4
  57. package/build/components/global-styles/screen-border.js.map +1 -1
  58. package/build/components/global-styles/screen-button-color.js +16 -9
  59. package/build/components/global-styles/screen-button-color.js.map +1 -1
  60. package/build/components/global-styles/screen-colors.js +43 -34
  61. package/build/components/global-styles/screen-colors.js.map +1 -1
  62. package/build/components/global-styles/screen-css.js +20 -8
  63. package/build/components/global-styles/screen-css.js.map +1 -1
  64. package/build/components/global-styles/screen-heading-color.js +23 -16
  65. package/build/components/global-styles/screen-heading-color.js.map +1 -1
  66. package/build/components/global-styles/screen-layout.js +3 -3
  67. package/build/components/global-styles/screen-layout.js.map +1 -1
  68. package/build/components/global-styles/screen-link-color.js +18 -11
  69. package/build/components/global-styles/screen-link-color.js.map +1 -1
  70. package/build/components/global-styles/screen-root.js +25 -9
  71. package/build/components/global-styles/screen-root.js.map +1 -1
  72. package/build/components/global-styles/screen-style-variations.js +8 -4
  73. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  74. package/build/components/global-styles/screen-text-color.js +14 -7
  75. package/build/components/global-styles/screen-text-color.js.map +1 -1
  76. package/build/components/global-styles/screen-typography.js +18 -12
  77. package/build/components/global-styles/screen-typography.js.map +1 -1
  78. package/build/components/global-styles/shadow-panel.js +196 -0
  79. package/build/components/global-styles/shadow-panel.js.map +1 -0
  80. package/build/components/global-styles/typography-panel.js +43 -29
  81. package/build/components/global-styles/typography-panel.js.map +1 -1
  82. package/build/components/global-styles/typography-preview.js +19 -9
  83. package/build/components/global-styles/typography-preview.js.map +1 -1
  84. package/build/components/global-styles/ui.js +104 -34
  85. package/build/components/global-styles/ui.js.map +1 -1
  86. package/build/components/global-styles/utils.js +5 -334
  87. package/build/components/global-styles/utils.js.map +1 -1
  88. package/build/components/global-styles-renderer/index.js +7 -5
  89. package/build/components/global-styles-renderer/index.js.map +1 -1
  90. package/build/components/header-edit-mode/document-actions/index.js +2 -2
  91. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  92. package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
  93. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  94. package/build/components/layout/index.js +11 -11
  95. package/build/components/layout/index.js.map +1 -1
  96. package/build/components/list/actions/rename-menu-item.js +8 -11
  97. package/build/components/list/actions/rename-menu-item.js.map +1 -1
  98. package/build/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +9 -6
  99. package/build/components/navigation-inspector/index.js.map +1 -0
  100. package/build/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +14 -14
  101. package/build/components/navigation-inspector/navigation-menu.js.map +1 -0
  102. package/build/components/sidebar/index.js +3 -1
  103. package/build/components/sidebar/index.js.map +1 -1
  104. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +3 -18
  105. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  106. package/build/components/sidebar-edit-mode/index.js +1 -14
  107. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  108. package/build/components/sidebar-navigation-screen/index.js +3 -2
  109. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  110. package/build/components/sidebar-navigation-screen-main/index.js +23 -1
  111. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  112. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +52 -0
  113. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -0
  114. package/build/components/sidebar-navigation-screen-templates/index.js +3 -8
  115. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  116. package/build/components/site-hub/index.js +11 -10
  117. package/build/components/site-hub/index.js.map +1 -1
  118. package/build/components/site-icon/index.js +1 -1
  119. package/build/components/site-icon/index.js.map +1 -1
  120. package/build/components/style-book/index.js +7 -4
  121. package/build/components/style-book/index.js.map +1 -1
  122. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +6 -4
  123. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  124. package/build/components/template-part-converter/convert-to-template-part.js +5 -9
  125. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  126. package/build/experiments.js +19 -0
  127. package/build/experiments.js.map +1 -0
  128. package/build/hooks/push-changes-to-global-styles/index.js +65 -6
  129. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  130. package/build/index.js +53 -60
  131. package/build/index.js.map +1 -1
  132. package/build/store/actions.js +1 -27
  133. package/build/store/actions.js.map +1 -1
  134. package/build/store/index.js +8 -0
  135. package/build/store/index.js.map +1 -1
  136. package/build/store/private-actions.js +40 -0
  137. package/build/store/private-actions.js.map +1 -0
  138. package/build/store/private-selectors.js +18 -0
  139. package/build/store/private-selectors.js.map +1 -0
  140. package/build/store/selectors.js +7 -40
  141. package/build/store/selectors.js.map +1 -1
  142. package/build/store/utils.js +77 -0
  143. package/build/store/utils.js.map +1 -0
  144. package/build/utils/template-part-create.js +71 -0
  145. package/build/utils/template-part-create.js.map +1 -0
  146. package/build-module/components/add-new-template/add-custom-generic-template-modal.js +9 -11
  147. package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +1 -1
  148. package/build-module/components/add-new-template/add-custom-template-modal.js +0 -1
  149. package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
  150. package/build-module/components/add-new-template/new-template-part.js +8 -31
  151. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  152. package/build-module/components/add-new-template/new-template.js +4 -4
  153. package/build-module/components/add-new-template/new-template.js.map +1 -1
  154. package/build-module/components/add-new-template/utils.js +0 -5
  155. package/build-module/components/add-new-template/utils.js.map +1 -1
  156. package/build-module/components/app/index.js +2 -7
  157. package/build-module/components/app/index.js.map +1 -1
  158. package/build-module/components/block-editor/editor-canvas.js +13 -3
  159. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  160. package/build-module/components/block-editor/index.js +17 -15
  161. package/build-module/components/block-editor/index.js.map +1 -1
  162. package/build-module/components/block-editor/inserter-media-categories.js +225 -0
  163. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -0
  164. package/build-module/components/canvas-spinner/index.js +12 -0
  165. package/build-module/components/canvas-spinner/index.js.map +1 -0
  166. package/build-module/components/create-template-part-modal/index.js +5 -3
  167. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  168. package/build-module/components/editor/index.js +7 -5
  169. package/build-module/components/editor/index.js.map +1 -1
  170. package/build-module/components/error-boundary/index.js +2 -12
  171. package/build-module/components/error-boundary/index.js.map +1 -1
  172. package/build-module/components/error-boundary/warning.js +5 -28
  173. package/build-module/components/error-boundary/warning.js.map +1 -1
  174. package/build-module/components/global-styles/block-preview-panel.js +2 -2
  175. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  176. package/build-module/components/global-styles/border-panel.js +17 -11
  177. package/build-module/components/global-styles/border-panel.js.map +1 -1
  178. package/build-module/components/global-styles/color-palette-panel.js +11 -7
  179. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  180. package/build-module/components/global-styles/context-menu.js +40 -8
  181. package/build-module/components/global-styles/context-menu.js.map +1 -1
  182. package/build-module/components/global-styles/custom-css.js +61 -15
  183. package/build-module/components/global-styles/custom-css.js.map +1 -1
  184. package/build-module/components/global-styles/dimensions-panel.js +49 -32
  185. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  186. package/build-module/components/global-styles/global-styles-provider.js +7 -2
  187. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  188. package/build-module/components/global-styles/gradients-palette-panel.js +15 -11
  189. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  190. package/build-module/components/global-styles/hooks.js +23 -134
  191. package/build-module/components/global-styles/hooks.js.map +1 -1
  192. package/build-module/components/global-styles/index.js +0 -2
  193. package/build-module/components/global-styles/index.js.map +1 -1
  194. package/build-module/components/global-styles/palette.js +10 -5
  195. package/build-module/components/global-styles/palette.js.map +1 -1
  196. package/build-module/components/global-styles/preview.js +18 -14
  197. package/build-module/components/global-styles/preview.js.map +1 -1
  198. package/build-module/components/global-styles/screen-background-color.js +26 -15
  199. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  200. package/build-module/components/global-styles/screen-border.js +10 -5
  201. package/build-module/components/global-styles/screen-border.js.map +1 -1
  202. package/build-module/components/global-styles/screen-button-color.js +16 -11
  203. package/build-module/components/global-styles/screen-button-color.js.map +1 -1
  204. package/build-module/components/global-styles/screen-colors.js +43 -37
  205. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  206. package/build-module/components/global-styles/screen-css.js +21 -9
  207. package/build-module/components/global-styles/screen-css.js.map +1 -1
  208. package/build-module/components/global-styles/screen-heading-color.js +23 -18
  209. package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
  210. package/build-module/components/global-styles/screen-layout.js +4 -4
  211. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  212. package/build-module/components/global-styles/screen-link-color.js +18 -13
  213. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  214. package/build-module/components/global-styles/screen-root.js +23 -9
  215. package/build-module/components/global-styles/screen-root.js.map +1 -1
  216. package/build-module/components/global-styles/screen-style-variations.js +5 -2
  217. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  218. package/build-module/components/global-styles/screen-text-color.js +14 -9
  219. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  220. package/build-module/components/global-styles/screen-typography.js +16 -12
  221. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  222. package/build-module/components/global-styles/shadow-panel.js +177 -0
  223. package/build-module/components/global-styles/shadow-panel.js.map +1 -0
  224. package/build-module/components/global-styles/typography-panel.js +43 -31
  225. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  226. package/build-module/components/global-styles/typography-preview.js +17 -9
  227. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  228. package/build-module/components/global-styles/ui.js +98 -35
  229. package/build-module/components/global-styles/ui.js.map +1 -1
  230. package/build-module/components/global-styles/utils.js +4 -319
  231. package/build-module/components/global-styles/utils.js.map +1 -1
  232. package/build-module/components/global-styles-renderer/index.js +5 -5
  233. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  234. package/build-module/components/header-edit-mode/document-actions/index.js +2 -2
  235. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  236. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
  237. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  238. package/build-module/components/layout/index.js +10 -11
  239. package/build-module/components/layout/index.js.map +1 -1
  240. package/build-module/components/list/actions/rename-menu-item.js +9 -12
  241. package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
  242. package/build-module/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +9 -6
  243. package/build-module/components/navigation-inspector/index.js.map +1 -0
  244. package/build-module/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +14 -15
  245. package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -0
  246. package/build-module/components/sidebar/index.js +2 -1
  247. package/build-module/components/sidebar/index.js.map +1 -1
  248. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +6 -21
  249. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  250. package/build-module/components/sidebar-edit-mode/index.js +1 -13
  251. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  252. package/build-module/components/sidebar-navigation-screen/index.js +3 -2
  253. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  254. package/build-module/components/sidebar-navigation-screen-main/index.js +22 -2
  255. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  256. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +40 -0
  257. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -0
  258. package/build-module/components/sidebar-navigation-screen-templates/index.js +4 -9
  259. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  260. package/build-module/components/site-hub/index.js +10 -10
  261. package/build-module/components/site-hub/index.js.map +1 -1
  262. package/build-module/components/site-icon/index.js +1 -1
  263. package/build-module/components/site-icon/index.js.map +1 -1
  264. package/build-module/components/style-book/index.js +8 -5
  265. package/build-module/components/style-book/index.js.map +1 -1
  266. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -4
  267. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  268. package/build-module/components/template-part-converter/convert-to-template-part.js +5 -9
  269. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  270. package/build-module/experiments.js +9 -0
  271. package/build-module/experiments.js.map +1 -0
  272. package/build-module/hooks/push-changes-to-global-styles/index.js +62 -3
  273. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  274. package/build-module/index.js +52 -60
  275. package/build-module/index.js.map +1 -1
  276. package/build-module/store/actions.js +0 -23
  277. package/build-module/store/actions.js.map +1 -1
  278. package/build-module/store/index.js +5 -0
  279. package/build-module/store/index.js.map +1 -1
  280. package/build-module/store/private-actions.js +29 -0
  281. package/build-module/store/private-actions.js.map +1 -0
  282. package/build-module/store/private-selectors.js +11 -0
  283. package/build-module/store/private-selectors.js.map +1 -0
  284. package/build-module/store/selectors.js +6 -37
  285. package/build-module/store/selectors.js.map +1 -1
  286. package/build-module/store/utils.js +66 -0
  287. package/build-module/store/utils.js.map +1 -0
  288. package/build-module/utils/template-part-create.js +53 -0
  289. package/build-module/utils/template-part-create.js.map +1 -0
  290. package/build-style/style-rtl.css +314 -216
  291. package/build-style/style.css +314 -216
  292. package/package.json +32 -30
  293. package/src/components/add-new-template/add-custom-generic-template-modal.js +20 -28
  294. package/src/components/add-new-template/add-custom-template-modal.js +0 -1
  295. package/src/components/add-new-template/new-template-part.js +14 -34
  296. package/src/components/add-new-template/new-template.js +5 -3
  297. package/src/components/add-new-template/style.scss +0 -4
  298. package/src/components/add-new-template/utils.js +0 -14
  299. package/src/components/app/index.js +2 -2
  300. package/src/components/block-editor/editor-canvas.js +12 -2
  301. package/src/components/block-editor/index.js +16 -28
  302. package/src/components/block-editor/inserter-media-categories.js +247 -0
  303. package/src/components/block-editor/style.scss +20 -7
  304. package/src/components/canvas-spinner/index.js +12 -0
  305. package/src/components/canvas-spinner/style.scss +7 -0
  306. package/src/components/create-template-part-modal/index.js +75 -67
  307. package/src/components/create-template-part-modal/style.scss +0 -10
  308. package/src/components/editor/index.js +8 -5
  309. package/src/components/error-boundary/index.js +2 -10
  310. package/src/components/error-boundary/warning.js +6 -35
  311. package/src/components/global-styles/README.md +1 -75
  312. package/src/components/global-styles/block-preview-panel.js +2 -2
  313. package/src/components/global-styles/border-panel.js +19 -17
  314. package/src/components/global-styles/color-palette-panel.js +10 -7
  315. package/src/components/global-styles/context-menu.js +114 -44
  316. package/src/components/global-styles/custom-css.js +76 -19
  317. package/src/components/global-styles/dimensions-panel.js +46 -36
  318. package/src/components/global-styles/global-styles-provider.js +6 -2
  319. package/src/components/global-styles/gradients-palette-panel.js +17 -11
  320. package/src/components/global-styles/hooks.js +31 -155
  321. package/src/components/global-styles/index.js +0 -2
  322. package/src/components/global-styles/palette.js +9 -5
  323. package/src/components/global-styles/preview.js +19 -13
  324. package/src/components/global-styles/screen-background-color.js +37 -21
  325. package/src/components/global-styles/screen-border.js +10 -5
  326. package/src/components/global-styles/screen-button-color.js +21 -19
  327. package/src/components/global-styles/screen-colors.js +48 -65
  328. package/src/components/global-styles/screen-css.js +30 -14
  329. package/src/components/global-styles/screen-heading-color.js +32 -27
  330. package/src/components/global-styles/screen-layout.js +4 -7
  331. package/src/components/global-styles/screen-link-color.js +26 -26
  332. package/src/components/global-styles/screen-root.js +24 -9
  333. package/src/components/global-styles/screen-style-variations.js +7 -2
  334. package/src/components/global-styles/screen-text-color.js +15 -19
  335. package/src/components/global-styles/screen-typography.js +27 -12
  336. package/src/components/global-styles/shadow-panel.js +174 -0
  337. package/src/components/global-styles/style.scss +85 -1
  338. package/src/components/global-styles/typography-panel.js +60 -48
  339. package/src/components/global-styles/typography-preview.js +28 -9
  340. package/src/components/global-styles/ui.js +97 -53
  341. package/src/components/global-styles/utils.js +4 -371
  342. package/src/components/global-styles-renderer/index.js +3 -4
  343. package/src/components/header-edit-mode/document-actions/index.js +1 -1
  344. package/src/components/keyboard-shortcut-help-modal/index.js +0 -1
  345. package/src/components/layout/index.js +12 -4
  346. package/src/components/layout/style.scss +4 -5
  347. package/src/components/list/actions/rename-menu-item.js +14 -23
  348. package/src/components/list/style.scss +0 -4
  349. package/src/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +2 -2
  350. package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +10 -12
  351. package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/style.scss +0 -17
  352. package/src/components/sidebar/index.js +2 -0
  353. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +8 -32
  354. package/src/components/sidebar-edit-mode/index.js +0 -11
  355. package/src/components/sidebar-edit-mode/settings-header/style.scss +8 -0
  356. package/src/components/sidebar-navigation-item/style.scss +28 -3
  357. package/src/components/sidebar-navigation-screen/index.js +4 -3
  358. package/src/components/sidebar-navigation-screen/style.scss +2 -0
  359. package/src/components/sidebar-navigation-screen-main/index.js +23 -1
  360. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +45 -0
  361. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +12 -0
  362. package/src/components/sidebar-navigation-screen-templates/index.js +12 -19
  363. package/src/components/site-hub/index.js +8 -10
  364. package/src/components/site-hub/style.scss +7 -1
  365. package/src/components/site-icon/index.js +1 -1
  366. package/src/components/site-icon/style.scss +2 -2
  367. package/src/components/style-book/index.js +10 -5
  368. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -3
  369. package/src/components/template-part-converter/convert-to-template-part.js +12 -10
  370. package/src/experiments.js +10 -0
  371. package/src/hooks/push-changes-to-global-styles/index.js +63 -5
  372. package/src/index.js +51 -59
  373. package/src/store/actions.js +0 -24
  374. package/src/store/index.js +5 -0
  375. package/src/store/private-actions.js +29 -0
  376. package/src/store/private-selectors.js +10 -0
  377. package/src/store/selectors.js +6 -37
  378. package/src/store/test/utils.js +181 -0
  379. package/src/store/utils.js +69 -0
  380. package/src/style.scss +4 -2
  381. package/src/utils/template-part-create.js +62 -0
  382. package/src/utils/test/template-part-create.js +63 -0
  383. package/build/components/global-styles/context.js +0 -22
  384. package/build/components/global-styles/context.js.map +0 -1
  385. package/build/components/global-styles/typography-utils.js +0 -92
  386. package/build/components/global-styles/typography-utils.js.map +0 -1
  387. package/build/components/global-styles/use-global-styles-output.js +0 -943
  388. package/build/components/global-styles/use-global-styles-output.js.map +0 -1
  389. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -42
  390. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/index.js.map +0 -1
  391. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +0 -1
  392. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +0 -1
  393. package/build-module/components/global-styles/context.js +0 -12
  394. package/build-module/components/global-styles/context.js.map +0 -1
  395. package/build-module/components/global-styles/typography-utils.js +0 -84
  396. package/build-module/components/global-styles/typography-utils.js.map +0 -1
  397. package/build-module/components/global-styles/use-global-styles-output.js +0 -901
  398. package/build-module/components/global-styles/use-global-styles-output.js.map +0 -1
  399. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -28
  400. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/index.js.map +0 -1
  401. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +0 -1
  402. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +0 -1
  403. package/src/components/global-styles/context.js +0 -15
  404. package/src/components/global-styles/test/typography-utils.js +0 -393
  405. package/src/components/global-styles/test/use-global-styles-output.js +0 -814
  406. package/src/components/global-styles/test/utils.js +0 -206
  407. package/src/components/global-styles/typography-utils.js +0 -87
  408. package/src/components/global-styles/use-global-styles-output.js +0 -1059
  409. package/src/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -37
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAKA,SAASA,cAAT,GAA0B;AACzB;AAEA,SACC,qDACC,4BAAC,oCAAD,OADD,EAEC,4BAAC,yCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IAFD,EAGC,4BAAC,yCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IAHD,CADD;AAOA;;AAED,SAASC,OAAT,GAAmB;AAClB,SACC,4BAAC,2CAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAC;AAFb,KAIC,4BAAC,cAAD,OAJD,CADD;AAQA;;eAEc,mBAAMA,OAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport useSyncSidebarPathWithURL from '../sync-state-with-url/use-sync-sidebar-path-with-url';\n\nfunction SidebarScreens() {\n\tuseSyncSidebarPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreenMain />\n\t\t\t<SidebarNavigationScreenTemplates postType=\"wp_template\" />\n\t\t\t<SidebarNavigationScreenTemplates postType=\"wp_template_part\" />\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<SidebarScreens />\n\t\t</NavigatorProvider>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;;AAIA;AACA;AACA;AAMA,SAASA,cAAT,GAA0B;AACzB;AAEA,SACC,qDACC,4BAAC,oCAAD,OADD,EAEC,4BAAC,+CAAD,OAFD,EAGC,4BAAC,yCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IAHD,EAIC,4BAAC,yCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IAJD,CADD;AAQA;;AAED,SAASC,OAAT,GAAmB;AAClB,SACC,4BAAC,2CAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAC;AAFb,KAIC,4BAAC,cAAD,OAJD,CADD;AAQA;;eAEc,mBAAMA,OAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport useSyncSidebarPathWithURL from '../sync-state-with-url/use-sync-sidebar-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\n\nfunction SidebarScreens() {\n\tuseSyncSidebarPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreenMain />\n\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t<SidebarNavigationScreenTemplates postType=\"wp_template\" />\n\t\t\t<SidebarNavigationScreenTemplates postType=\"wp_template_part\" />\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<SidebarScreens />\n\t\t</NavigatorProvider>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
@@ -17,14 +17,14 @@ var _icons = require("@wordpress/icons");
17
17
 
18
18
  var _data = require("@wordpress/data");
19
19
 
20
- var _preferences = require("@wordpress/preferences");
21
-
22
20
  var _defaultSidebar = _interopRequireDefault(require("./default-sidebar"));
23
21
 
24
22
  var _globalStyles = require("../global-styles");
25
23
 
26
24
  var _store = require("../../store");
27
25
 
26
+ var _ui = require("../global-styles/ui");
27
+
28
28
  /**
29
29
  * WordPress dependencies
30
30
  */
@@ -33,10 +33,6 @@ var _store = require("../../store");
33
33
  * Internal dependencies
34
34
  */
35
35
  function GlobalStylesSidebar() {
36
- const [canReset, onReset] = (0, _globalStyles.useGlobalStylesReset)();
37
- const {
38
- toggle
39
- } = (0, _data.useDispatch)(_preferences.store);
40
36
  const [isStyleBookOpened, setIsStyleBookOpened] = (0, _element.useState)(false);
41
37
  const editorMode = (0, _data.useSelect)(select => select(_store.store).getEditorMode(), []);
42
38
  (0, _element.useEffect)(() => {
@@ -59,18 +55,7 @@ function GlobalStylesSidebar() {
59
55
  onClick: () => {
60
56
  setIsStyleBookOpened(!isStyleBookOpened);
61
57
  }
62
- })), (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_components.DropdownMenu, {
63
- icon: _icons.moreVertical,
64
- label: (0, _i18n.__)('More Styles actions'),
65
- controls: [{
66
- title: (0, _i18n.__)('Reset to defaults'),
67
- onClick: onReset,
68
- isDisabled: !canReset
69
- }, {
70
- title: (0, _i18n.__)('Welcome Guide'),
71
- onClick: () => toggle('core/edit-site', 'welcomeGuideStyles')
72
- }]
73
- })))
58
+ })), (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_ui.GlobalStylesMenuSlot, null)))
74
59
  }, (0, _element.createElement)(_globalStyles.GlobalStylesUI, {
75
60
  isStyleBookOpened: isStyleBookOpened,
76
61
  onCloseStyleBook: () => setIsStyleBookOpened(false)
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"names":["GlobalStylesSidebar","canReset","onReset","toggle","preferencesStore","isStyleBookOpened","setIsStyleBookOpened","editorMode","select","editSiteStore","getEditorMode","styles","seen","moreVertical","title","onClick","isDisabled"],"mappings":";;;;;;;;;AAcA;;AAXA;;AAOA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AArBA;AACA;AACA;;AAcA;AACA;AACA;AAKe,SAASA,mBAAT,GAA+B;AAC7C,QAAM,CAAEC,QAAF,EAAYC,OAAZ,IAAwB,yCAA9B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAa,uBAAaC,kBAAb,CAAnB;AACA,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8C,u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AAI,eAAJ,CADR;AAECC,QAAAA,OAAO,EAAE,MACRZ,MAAM,CACL,gBADK,EAEL,oBAFK;AAHR,OANU;AAHZ,MADD,CAnBD;AARF,KAmDC,4BAAC,4BAAD;AACC,IAAA,iBAAiB,EAAGE,iBADrB;AAEC,IAAA,gBAAgB,EAAG,MAAMC,oBAAoB,CAAE,KAAF;AAF9C,IAnDD,CADD;AA0DA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tDropdownMenu,\n\tFlexItem,\n\tFlexBlock,\n\tFlex,\n\tButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, moreVertical, seen } from '@wordpress/icons';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI, useGlobalStylesReset } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\n\nexport default function GlobalStylesSidebar() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );\n\tconst editorMode = useSelect(\n\t\t( select ) => select( editSiteStore ).getEditorMode(),\n\t\t[]\n\t);\n\tuseEffect( () => {\n\t\tif ( editorMode !== 'visual' ) {\n\t\t\tsetIsStyleBookOpened( false );\n\t\t}\n\t}, [ editorMode ] );\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles sidebar' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisStyleBookOpened\n\t\t\t\t\t\t\t\t\t? __( 'Close Style Book' )\n\t\t\t\t\t\t\t\t\t: __( 'Open Style Book' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\tdisabled={ editorMode !== 'visual' }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetIsStyleBookOpened( ! isStyleBookOpened );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'More Styles actions' ) }\n\t\t\t\t\t\t\tcontrols={ [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle: __( 'Reset to defaults' ),\n\t\t\t\t\t\t\t\t\tonClick: onReset,\n\t\t\t\t\t\t\t\t\tisDisabled: ! canReset,\n\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\ttitle: __( 'Welcome Guide' ),\n\t\t\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\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</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI\n\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\tonCloseStyleBook={ () => setIsStyleBookOpened( false ) }\n\t\t\t/>\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"names":["GlobalStylesSidebar","isStyleBookOpened","setIsStyleBookOpened","editorMode","select","editSiteStore","getEditorMode","styles","seen"],"mappings":";;;;;;;;;AAQA;;AALA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAQA;AACA;AACA;AAMe,SAASA,mBAAT,GAA+B;AAC7C,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8C,uBAAU,KAAV,CAApD;AACA,QAAMC,UAAU,GAAG,qBAChBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,aAAxB,EADI,EAElB,EAFkB,CAAnB;AAKA,0BAAW,MAAM;AAChB,QAAKH,UAAU,KAAK,QAApB,EAA+B;AAC9BD,MAAAA,oBAAoB,CAAE,KAAF,CAApB;AACA;AACD,GAJD,EAIG,CAAEC,UAAF,CAJH;AAKA,SACC,4BAAC,uBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,UAAU,EAAC,yBAFZ;AAGC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAHT;AAIC,IAAA,IAAI,EAAGI,aAJR;AAKC,IAAA,UAAU,EAAG,cAAI,sBAAJ,CALd;AAMC,IAAA,cAAc,EAAC,wCANhB;AAOC,IAAA,MAAM,EACL,4BAAC,gBAAD,QACC,4BAAC,qBAAD,QACC,4CAAU,cAAI,QAAJ,CAAV,CADD,CADD,EAIC,4BAAC,oBAAD,QACC,4BAAC,kBAAD;AACC,MAAA,IAAI,EAAGC,WADR;AAEC,MAAA,KAAK,EACJP,iBAAiB,GACd,cAAI,kBAAJ,CADc,GAEd,cAAI,iBAAJ,CALL;AAOC,MAAA,SAAS,EAAGA,iBAPb;AAQC,MAAA,QAAQ,EAAGE,UAAU,KAAK,QAR3B;AASC,MAAA,OAAO,EAAG,MAAM;AACfD,QAAAA,oBAAoB,CAAE,CAAED,iBAAJ,CAApB;AACA;AAXF,MADD,CAJD,EAmBC,4BAAC,oBAAD,QACC,4BAAC,wBAAD,OADD,CAnBD;AARF,KAiCC,4BAAC,4BAAD;AACC,IAAA,iBAAiB,EAAGA,iBADrB;AAEC,IAAA,gBAAgB,EAAG,MAAMC,oBAAoB,CAAE,KAAF;AAF9C,IAjCD,CADD;AAwCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { FlexItem, FlexBlock, Flex, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\n\nexport default function GlobalStylesSidebar() {\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );\n\tconst editorMode = useSelect(\n\t\t( select ) => select( editSiteStore ).getEditorMode(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( editorMode !== 'visual' ) {\n\t\t\tsetIsStyleBookOpened( false );\n\t\t}\n\t}, [ editorMode ] );\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles sidebar' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tisStyleBookOpened\n\t\t\t\t\t\t\t\t\t? __( 'Close Style Book' )\n\t\t\t\t\t\t\t\t\t: __( 'Open Style Book' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\tdisabled={ editorMode !== 'visual' }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetIsStyleBookOpened( ! isStyleBookOpened );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<GlobalStylesMenuSlot />\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI\n\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\tonCloseStyleBook={ () => setIsStyleBookOpened( false ) }\n\t\t\t/>\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
@@ -26,8 +26,6 @@ var _defaultSidebar = _interopRequireDefault(require("./default-sidebar"));
26
26
 
27
27
  var _globalStylesSidebar = _interopRequireDefault(require("./global-styles-sidebar"));
28
28
 
29
- var _navigationMenuSidebar = _interopRequireDefault(require("./navigation-menu-sidebar"));
30
-
31
29
  var _constants = require("../../store/constants");
32
30
 
33
31
  var _settingsHeader = _interopRequireDefault(require("./settings-header"));
@@ -53,8 +51,6 @@ const SidebarInspectorFill = InspectorFill;
53
51
  exports.SidebarInspectorFill = SidebarInspectorFill;
54
52
 
55
53
  function SidebarComplementaryAreaFills() {
56
- var _window;
57
-
58
54
  const {
59
55
  sidebar,
60
56
  isEditorSidebarOpened,
@@ -89,15 +85,6 @@ function SidebarComplementaryAreaFills() {
89
85
 
90
86
  if (!isEditorSidebarOpened) {
91
87
  sidebarName = hasBlockSelection ? _constants2.SIDEBAR_BLOCK : _constants2.SIDEBAR_TEMPLATE;
92
- } // Conditionally include NavMenu sidebar in Plugin only.
93
- // Optimise for dead code elimination.
94
- // See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.
95
-
96
-
97
- let MaybeNavigationMenuSidebar = _element.Fragment;
98
-
99
- if (((_window = window) === null || _window === void 0 ? void 0 : _window.__experimentalEnableOffCanvasNavigationEditor) === true) {
100
- MaybeNavigationMenuSidebar = _navigationMenuSidebar.default;
101
88
  }
102
89
 
103
90
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_defaultSidebar.default, {
@@ -111,6 +98,6 @@ function SidebarComplementaryAreaFills() {
111
98
  headerClassName: "edit-site-sidebar-edit-mode__panel-tabs"
112
99
  }, sidebarName === _constants2.SIDEBAR_TEMPLATE && (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_templateCard.default, null)), sidebarName === _constants2.SIDEBAR_BLOCK && (0, _element.createElement)(InspectorSlot, {
113
100
  bubblesVirtually: true
114
- })), supportsGlobalStyles && (0, _element.createElement)(_globalStylesSidebar.default, null), (0, _element.createElement)(MaybeNavigationMenuSidebar, null));
101
+ })), supportsGlobalStyles && (0, _element.createElement)(_globalStylesSidebar.default, null));
115
102
  }
116
103
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","supportsGlobalStyles","select","_sidebar","interfaceStore","getActiveComplementaryArea","STORE_NAME","_isEditorSidebarOpened","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","includes","settings","editSiteStore","getSettings","blockEditorStore","getBlockSelectionStart","supportsTemplatePartsMode","enableComplementaryArea","sidebarName","MaybeNavigationMenuSidebar","Fragment","window","__experimentalEnableOffCanvasNavigationEditor","N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AcE,yBAAd,CAAvB;AACA,KAFD,MAEO;AACNS,MAAAA,uBAAuB,CAAEX,qBAAF,EAAcG,4BAAd,CAAvB;AACA;AACD,GAPD,EAOG,CAAET,iBAAF,EAAqBD,qBAArB,CAPH;AASA,MAAImB,WAAW,GAAGpB,OAAlB;;AACA,MAAK,CAAEC,qBAAP,EAA+B;AAC9BmB,IAAAA,WAAW,GAAGlB,iBAAiB,GAAGQ,yBAAH,GAAmBC,4BAAlD;AACA,GApC8C,CAsC/C;AACA;AACA;;;AACA,MAAIU,0BAA0B,GAAGC,iBAAjC;;AAEA,MAAK,YAAAC,MAAM,UAAN,0CAAQC,6CAAR,MAA0D,IAA/D,EAAsE;AACrEH,IAAAA,0BAA0B,GAAGI,8BAA7B;AACA;;AAED,SACC,qDACC,4BAAC,uBAAD;AACC,IAAA,UAAU,EAAGL,WADd;AAEC,IAAA,KAAK,EAAG,cAAI,UAAJ,CAFT;AAGC,IAAA,IAAI,EAAG,qBAAUM,iBAAV,GAAuBC,kBAH/B;AAIC,IAAA,UAAU,EAAG,cAAI,wBAAJ,CAJd;AAKC,IAAA,MAAM,EAAG,4BAAC,uBAAD;AAAgB,MAAA,WAAW,EAAGP;AAA9B,MALV;AAMC,IAAA,eAAe,EAAC;AANjB,KAQGA,WAAW,KAAKT,4BAAhB,IACD,4BAAC,qBAAD,QACC,4BAAC,qBAAD,OADD,CATF,EAaGS,WAAW,KAAKV,yBAAhB,IACD,4BAAC,aAAD;AAAe,IAAA,gBAAgB;AAA/B,IAdF,CADD,EAkBGP,oBAAoB,IAAI,4BAAC,4BAAD,OAlB3B,EAmBC,4BAAC,0BAAD,OAnBD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { useEffect, Fragment } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport NavigationMenuSidebar from './navigation-menu-sidebar';\nimport { STORE_NAME } from '../../store/constants';\nimport SettingsHeader from './settings-header';\nimport TemplateCard from './template-card';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';\nimport { store as editSiteStore } from '../../store';\n\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nexport function SidebarComplementaryAreaFills() {\n\tconst {\n\t\tsidebar,\n\t\tisEditorSidebarOpened,\n\t\thasBlockSelection,\n\t\tsupportsGlobalStyles,\n\t} = useSelect( ( select ) => {\n\t\tconst _sidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( STORE_NAME );\n\t\tconst _isEditorSidebarOpened = [\n\t\t\tSIDEBAR_BLOCK,\n\t\t\tSIDEBAR_TEMPLATE,\n\t\t].includes( _sidebar );\n\t\tconst settings = select( editSiteStore ).getSettings();\n\t\treturn {\n\t\t\tsidebar: _sidebar,\n\t\t\tisEditorSidebarOpened: _isEditorSidebarOpened,\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tsupportsGlobalStyles: ! settings?.supportsTemplatePartsMode,\n\t\t};\n\t}, [] );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\tif ( ! isEditorSidebarOpened ) return;\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened ] );\n\n\tlet sidebarName = sidebar;\n\tif ( ! isEditorSidebarOpened ) {\n\t\tsidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;\n\t}\n\n\t// Conditionally include NavMenu sidebar in Plugin only.\n\t// Optimise for dead code elimination.\n\t// See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.\n\tlet MaybeNavigationMenuSidebar = Fragment;\n\n\tif ( window?.__experimentalEnableOffCanvasNavigationEditor === true ) {\n\t\tMaybeNavigationMenuSidebar = NavigationMenuSidebar;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ sidebarName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\t\tcloseLabel={ __( 'Close settings sidebar' ) }\n\t\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\t\theaderClassName=\"edit-site-sidebar-edit-mode__panel-tabs\"\n\t\t\t>\n\t\t\t\t{ sidebarName === SIDEBAR_TEMPLATE && (\n\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t<TemplateCard />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t\t{ sidebarName === SIDEBAR_BLOCK && (\n\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t) }\n\t\t\t</DefaultSidebar>\n\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t\t<MaybeNavigationMenuSidebar />\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","supportsGlobalStyles","select","_sidebar","interfaceStore","getActiveComplementaryArea","STORE_NAME","_isEditorSidebarOpened","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","includes","settings","editSiteStore","getSettings","blockEditorStore","getBlockSelectionStart","supportsTemplatePartsMode","enableComplementaryArea","sidebarName","drawerLeft","drawerRight"],"mappings":";;;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AASA;AACA;AACA;AASA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,aAAR;AAAuBC,EAAAA,IAAI,EAAEC;AAA7B,IAA+C,gCACpD,0BADoD,CAArD;AAGO,MAAMC,oBAAoB,GAAGD,aAA7B;;;AAEA,SAASE,6BAAT,GAAyC;AAC/C,QAAM;AACLC,IAAAA,OADK;AAELC,IAAAA,qBAFK;AAGLC,IAAAA,iBAHK;AAILC,IAAAA;AAJK,MAKF,qBAAaC,MAAF,IAAc;AAC5B,UAAMC,QAAQ,GACbD,MAAM,CAAEE,gBAAF,CAAN,CAAyBC,0BAAzB,CAAqDC,qBAArD,CADD;;AAEA,UAAMC,sBAAsB,GAAG,CAC9BC,yBAD8B,EAE9BC,4BAF8B,EAG7BC,QAH6B,CAGnBP,QAHmB,CAA/B;;AAIA,UAAMQ,QAAQ,GAAGT,MAAM,CAAEU,YAAF,CAAN,CAAwBC,WAAxB,EAAjB;AACA,WAAO;AACNf,MAAAA,OAAO,EAAEK,QADH;AAENJ,MAAAA,qBAAqB,EAAEQ,sBAFjB;AAGNP,MAAAA,iBAAiB,EAChB,CAAC,CAAEE,MAAM,CAAEY,kBAAF,CAAN,CAA2BC,sBAA3B,EAJE;AAKNd,MAAAA,oBAAoB,EAAE,EAAEU,QAAF,aAAEA,QAAF,eAAEA,QAAQ,CAAEK,yBAAZ;AALhB,KAAP;AAOA,GAfG,EAeD,EAfC,CALJ;AAqBA,QAAM;AAAEC,IAAAA;AAAF,MAA8B,uBAAab,gBAAb,CAApC;AAEA,0BAAW,MAAM;AAChB,QAAK,CAAEL,qBAAP,EAA+B;;AAC/B,QAAKC,iBAAL,EAAyB;AACxBiB,MAAAA,uBAAuB,CAAEX,qBAAF,EAAcE,yBAAd,CAAvB;AACA,KAFD,MAEO;AACNS,MAAAA,uBAAuB,CAAEX,qBAAF,EAAcG,4BAAd,CAAvB;AACA;AACD,GAPD,EAOG,CAAET,iBAAF,EAAqBD,qBAArB,CAPH;AASA,MAAImB,WAAW,GAAGpB,OAAlB;;AACA,MAAK,CAAEC,qBAAP,EAA+B;AAC9BmB,IAAAA,WAAW,GAAGlB,iBAAiB,GAAGQ,yBAAH,GAAmBC,4BAAlD;AACA;;AAED,SACC,qDACC,4BAAC,uBAAD;AACC,IAAA,UAAU,EAAGS,WADd;AAEC,IAAA,KAAK,EAAG,cAAI,UAAJ,CAFT;AAGC,IAAA,IAAI,EAAG,qBAAUC,iBAAV,GAAuBC,kBAH/B;AAIC,IAAA,UAAU,EAAG,cAAI,wBAAJ,CAJd;AAKC,IAAA,MAAM,EAAG,4BAAC,uBAAD;AAAgB,MAAA,WAAW,EAAGF;AAA9B,MALV;AAMC,IAAA,eAAe,EAAC;AANjB,KAQGA,WAAW,KAAKT,4BAAhB,IACD,4BAAC,qBAAD,QACC,4BAAC,qBAAD,OADD,CATF,EAaGS,WAAW,KAAKV,yBAAhB,IACD,4BAAC,aAAD;AAAe,IAAA,gBAAgB;AAA/B,IAdF,CADD,EAkBGP,oBAAoB,IAAI,4BAAC,4BAAD,OAlB3B,CADD;AAsBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { useEffect, Fragment } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport { STORE_NAME } from '../../store/constants';\nimport SettingsHeader from './settings-header';\nimport TemplateCard from './template-card';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';\nimport { store as editSiteStore } from '../../store';\n\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nexport function SidebarComplementaryAreaFills() {\n\tconst {\n\t\tsidebar,\n\t\tisEditorSidebarOpened,\n\t\thasBlockSelection,\n\t\tsupportsGlobalStyles,\n\t} = useSelect( ( select ) => {\n\t\tconst _sidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( STORE_NAME );\n\t\tconst _isEditorSidebarOpened = [\n\t\t\tSIDEBAR_BLOCK,\n\t\t\tSIDEBAR_TEMPLATE,\n\t\t].includes( _sidebar );\n\t\tconst settings = select( editSiteStore ).getSettings();\n\t\treturn {\n\t\t\tsidebar: _sidebar,\n\t\t\tisEditorSidebarOpened: _isEditorSidebarOpened,\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tsupportsGlobalStyles: ! settings?.supportsTemplatePartsMode,\n\t\t};\n\t}, [] );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\tif ( ! isEditorSidebarOpened ) return;\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened ] );\n\n\tlet sidebarName = sidebar;\n\tif ( ! isEditorSidebarOpened ) {\n\t\tsidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ sidebarName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\t\tcloseLabel={ __( 'Close settings sidebar' ) }\n\t\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\t\theaderClassName=\"edit-site-sidebar-edit-mode__panel-tabs\"\n\t\t\t>\n\t\t\t\t{ sidebarName === SIDEBAR_TEMPLATE && (\n\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t<TemplateCard />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t\t{ sidebarName === SIDEBAR_BLOCK && (\n\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t) }\n\t\t\t</DefaultSidebar>\n\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t</>\n\t);\n}\n"]}
@@ -21,6 +21,7 @@ function SidebarNavigationScreen(_ref) {
21
21
  path,
22
22
  parentTitle,
23
23
  title,
24
+ actions,
24
25
  content
25
26
  } = _ref;
26
27
  return (0, _element.createElement)(_components.__experimentalNavigatorScreen, {
@@ -40,9 +41,9 @@ function SidebarNavigationScreen(_ref) {
40
41
  (0, _i18n.__)('Navigate to the previous view: %s'), parentTitle)
41
42
  }) : (0, _element.createElement)("div", {
42
43
  className: "edit-site-sidebar-navigation-screen__icon-placeholder"
43
- }), (0, _element.createElement)("div", {
44
+ }), (0, _element.createElement)("h2", {
44
45
  className: "edit-site-sidebar-navigation-screen__title"
45
- }, title)), (0, _element.createElement)("nav", {
46
+ }, title), actions), (0, _element.createElement)("nav", {
46
47
  className: "edit-site-sidebar-navigation-screen__content"
47
48
  }, content)));
48
49
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","path","parentTitle","title","content","chevronRight","chevronLeft"],"mappings":";;;;;;;;;AAGA;;AAMA;;AACA;;AAVA;AACA;AACA;AAUe,SAASA,uBAAT,OAKX;AAAA,MAL6C;AAChDC,IAAAA,IADgD;AAEhDC,IAAAA,WAFgD;AAGhDC,IAAAA,KAHgD;AAIhDC,IAAAA;AAJgD,GAK7C;AACH,SACC,4BAAC,yCAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,IAAI,EAAGH;AAFR,KAIC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gCAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,OAAO,EAAC,YAFT;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGC,WAAW,GACZ,4BAAC,6CAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAG,qBAAUG,mBAAV,GAAyBC,kBAFjC;AAGC,kBAAa;AACZ;AACA,kBAAI,mCAAJ,CAFY,EAGZJ,WAHY;AAHd,IADY,GAWZ;AAAK,IAAA,SAAS,EAAC;AAAf,IAhBF,EAmBC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGC,KADH,CAnBD,CADD,EAyBC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGC,OADH,CAzBD,CAJD,CADD;AAoCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalNavigatorBackButton as NavigatorBackButton,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\n\nexport default function SidebarNavigationScreen( {\n\tpath,\n\tparentTitle,\n\ttitle,\n\tcontent,\n} ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName=\"edit-site-sidebar-navigation-screen\"\n\t\t\tpath={ path }\n\t\t>\n\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ parentTitle ? (\n\t\t\t\t\t\t<NavigatorBackButton\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__back\"\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: previous page. */\n\t\t\t\t\t\t\t\t__( 'Navigate to the previous view: %s' ),\n\t\t\t\t\t\t\t\tparentTitle\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__icon-placeholder\" />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</div>\n\t\t\t\t</HStack>\n\n\t\t\t\t<nav className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ content }\n\t\t\t\t</nav>\n\t\t\t</VStack>\n\t\t</NavigatorScreen>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","path","parentTitle","title","actions","content","chevronRight","chevronLeft"],"mappings":";;;;;;;;;AAGA;;AAMA;;AACA;;AAVA;AACA;AACA;AAUe,SAASA,uBAAT,OAMX;AAAA,MAN6C;AAChDC,IAAAA,IADgD;AAEhDC,IAAAA,WAFgD;AAGhDC,IAAAA,KAHgD;AAIhDC,IAAAA,OAJgD;AAKhDC,IAAAA;AALgD,GAM7C;AACH,SACC,4BAAC,yCAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,IAAI,EAAGJ;AAFR,KAIC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gCAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,OAAO,EAAC,YAFT;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGC,WAAW,GACZ,4BAAC,6CAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAG,qBAAUI,mBAAV,GAAyBC,kBAFjC;AAGC,kBAAa;AACZ;AACA,kBAAI,mCAAJ,CAFY,EAGZL,WAHY;AAHd,IADY,GAWZ;AAAK,IAAA,SAAS,EAAC;AAAf,IAhBF,EAkBC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGC,KADH,CAlBD,EAqBGC,OArBH,CADD,EAyBC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGC,OADH,CAzBD,CAJD,CADD;AAoCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalNavigatorBackButton as NavigatorBackButton,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\n\nexport default function SidebarNavigationScreen( {\n\tpath,\n\tparentTitle,\n\ttitle,\n\tactions,\n\tcontent,\n} ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName=\"edit-site-sidebar-navigation-screen\"\n\t\t\tpath={ path }\n\t\t>\n\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ parentTitle ? (\n\t\t\t\t\t\t<NavigatorBackButton\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__back\"\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: previous page. */\n\t\t\t\t\t\t\t\t__( 'Navigate to the previous view: %s' ),\n\t\t\t\t\t\t\t\tparentTitle\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__icon-placeholder\" />\n\t\t\t\t\t) }\n\t\t\t\t\t<h2 className=\"edit-site-sidebar-navigation-screen__title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</h2>\n\t\t\t\t\t{ actions }\n\t\t\t\t</HStack>\n\n\t\t\t\t<nav className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ content }\n\t\t\t\t</nav>\n\t\t\t</VStack>\n\t\t</NavigatorScreen>\n\t);\n}\n"]}
@@ -15,6 +15,10 @@ var _i18n = require("@wordpress/i18n");
15
15
 
16
16
  var _icons = require("@wordpress/icons");
17
17
 
18
+ var _data = require("@wordpress/data");
19
+
20
+ var _coreData = require("@wordpress/core-data");
21
+
18
22
  var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
19
23
 
20
24
  var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
@@ -27,10 +31,28 @@ var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigati
27
31
  * Internal dependencies
28
32
  */
29
33
  function SidebarNavigationScreenMain() {
34
+ const {
35
+ navigationMenus
36
+ } = (0, _data.useSelect)(select => {
37
+ const {
38
+ getEntityRecords
39
+ } = select(_coreData.store);
40
+ return {
41
+ navigationMenus: getEntityRecords('postType', 'wp_navigation', {
42
+ per_page: -1,
43
+ status: 'publish'
44
+ })
45
+ };
46
+ });
30
47
  return (0, _element.createElement)(_sidebarNavigationScreen.default, {
31
48
  path: "/",
32
49
  title: (0, _i18n.__)('Design'),
33
- content: (0, _element.createElement)(_components.__experimentalItemGroup, null, (0, _element.createElement)(_components.__experimentalNavigatorButton, {
50
+ content: (0, _element.createElement)(_components.__experimentalItemGroup, null, !!navigationMenus && navigationMenus.length > 0 && (0, _element.createElement)(_components.__experimentalNavigatorButton, {
51
+ as: _sidebarNavigationItem.default,
52
+ path: "/navigation",
53
+ withChevron: true,
54
+ icon: _icons.navigation
55
+ }, (0, _i18n.__)('Navigation')), (0, _element.createElement)(_components.__experimentalNavigatorButton, {
34
56
  as: _sidebarNavigationItem.default,
35
57
  path: "/templates",
36
58
  withChevron: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["SidebarNavigationScreenMain","SidebarNavigationItem","layout","symbolFilled"],"mappings":";;;;;;;;;;;AAGA;;AAIA;;AACA;;AAKA;;AACA;;AAdA;AACA;AACA;;AAQA;AACA;AACA;AAIe,SAASA,2BAAT,GAAuC;AACrD,SACC,4BAAC,gCAAD;AACC,IAAA,IAAI,EAAC,GADN;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAFT;AAGC,IAAA,OAAO,EACN,4BAAC,mCAAD,QACC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGC,8BADN;AAEC,MAAA,IAAI,EAAC,YAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGC;AAJR,OAMG,cAAI,WAAJ,CANH,CADD,EASC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGD,8BADN;AAEC,MAAA,IAAI,EAAC,iBAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGE;AAJR,OAMG,cAAI,gBAAJ,CANH,CATD;AAJF,IADD;AA0BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalNavigatorButton as NavigatorButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbolFilled } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenMain() {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath=\"/\"\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tcontent={\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/templates\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/template-parts\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ symbolFilled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template Parts' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t</ItemGroup>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["SidebarNavigationScreenMain","navigationMenus","select","getEntityRecords","coreStore","per_page","status","length","SidebarNavigationItem","navigation","layout","symbolFilled"],"mappings":";;;;;;;;;;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIe,SAASA,2BAAT,GAAuC;AACrD,QAAM;AAAEC,IAAAA;AAAF,MAAsB,qBAAaC,MAAF,IAAc;AACpD,UAAM;AAAEC,MAAAA;AAAF,QAAuBD,MAAM,CAAEE,eAAF,CAAnC;AACA,WAAO;AACNH,MAAAA,eAAe,EAAEE,gBAAgB,CAAE,UAAF,EAAc,eAAd,EAA+B;AAC/DE,QAAAA,QAAQ,EAAE,CAAC,CADoD;AAE/DC,QAAAA,MAAM,EAAE;AAFuD,OAA/B;AAD3B,KAAP;AAMA,GAR2B,CAA5B;AAUA,SACC,4BAAC,gCAAD;AACC,IAAA,IAAI,EAAC,GADN;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAFT;AAGC,IAAA,OAAO,EACN,4BAAC,mCAAD,QACG,CAAC,CAAEL,eAAH,IAAsBA,eAAe,CAACM,MAAhB,GAAyB,CAA/C,IACD,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGC,8BADN;AAEC,MAAA,IAAI,EAAC,aAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGC;AAJR,OAMG,cAAI,YAAJ,CANH,CAFF,EAWC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGD,8BADN;AAEC,MAAA,IAAI,EAAC,YAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGE;AAJR,OAMG,cAAI,WAAJ,CANH,CAXD,EAmBC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGF,8BADN;AAEC,MAAA,IAAI,EAAC,iBAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGG;AAJR,OAMG,cAAI,gBAAJ,CANH,CAnBD;AAJF,IADD;AAoCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalNavigatorButton as NavigatorButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbolFilled, navigation } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { navigationMenus } = useSelect( ( select ) => {\n\t\tconst { getEntityRecords } = select( coreStore );\n\t\treturn {\n\t\t\tnavigationMenus: getEntityRecords( 'postType', 'wp_navigation', {\n\t\t\t\tper_page: -1,\n\t\t\t\tstatus: 'publish',\n\t\t\t} ),\n\t\t};\n\t} );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath=\"/\"\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tcontent={\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{ !! navigationMenus && navigationMenus.length > 0 && (\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/navigation\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/templates\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/template-parts\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ symbolFilled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template Parts' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t</ItemGroup>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = SidebarNavigationScreenNavigationMenus;
9
+
10
+ var _element = require("@wordpress/element");
11
+
12
+ var _i18n = require("@wordpress/i18n");
13
+
14
+ var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
15
+
16
+ var _navigationInspector = _interopRequireDefault(require("../navigation-inspector"));
17
+
18
+ var _routes = require("../routes");
19
+
20
+ /**
21
+ * WordPress dependencies
22
+ */
23
+
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+ function SidebarNavigationScreenNavigationMenus() {
28
+ const history = (0, _routes.useHistory)();
29
+ const onSelect = (0, _element.useCallback)(selectedBlock => {
30
+ const {
31
+ attributes
32
+ } = selectedBlock;
33
+
34
+ if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
35
+ history.push({
36
+ postType: attributes.type,
37
+ postId: attributes.id
38
+ });
39
+ }
40
+ }, [history]);
41
+ return (0, _element.createElement)(_sidebarNavigationScreen.default, {
42
+ path: "/navigation",
43
+ parentTitle: (0, _i18n.__)('Design'),
44
+ title: (0, _i18n.__)('Navigation'),
45
+ content: (0, _element.createElement)("div", {
46
+ className: "edit-site-sidebar-navigation-screen-navigation-menus"
47
+ }, (0, _element.createElement)(_navigationInspector.default, {
48
+ onSelect: onSelect
49
+ }))
50
+ });
51
+ }
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"names":["SidebarNavigationScreenNavigationMenus","history","onSelect","selectedBlock","attributes","kind","id","type","push","postType","postId"],"mappings":";;;;;;;;;AAIA;;AADA;;AAMA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAKe,SAASA,sCAAT,GAAkD;AAChE,QAAMC,OAAO,GAAG,yBAAhB;AACA,QAAMC,QAAQ,GAAG,0BACdC,aAAF,IAAqB;AACpB,UAAM;AAAEC,MAAAA;AAAF,QAAiBD,aAAvB;;AACA,QACCC,UAAU,CAACC,IAAX,KAAoB,WAApB,IACAD,UAAU,CAACE,EADX,IAEAF,UAAU,CAACG,IAFX,IAGAN,OAJD,EAKE;AACDA,MAAAA,OAAO,CAACO,IAAR,CAAc;AACbC,QAAAA,QAAQ,EAAEL,UAAU,CAACG,IADR;AAEbG,QAAAA,MAAM,EAAEN,UAAU,CAACE;AAFN,OAAd;AAIA;AACD,GAde,EAehB,CAAEL,OAAF,CAfgB,CAAjB;AAiBA,SACC,4BAAC,gCAAD;AACC,IAAA,IAAI,EAAC,aADN;AAEC,IAAA,WAAW,EAAG,cAAI,QAAJ,CAFf;AAGC,IAAA,KAAK,EAAG,cAAI,YAAJ,CAHT;AAIC,IAAA,OAAO,EACN;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,4BAAD;AAAqB,MAAA,QAAQ,EAAGC;AAAhC,MADD;AALF,IADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport NavigationInspector from '../navigation-inspector';\nimport { useHistory } from '../routes';\n\nexport default function SidebarNavigationScreenNavigationMenus() {\n\tconst history = useHistory();\n\tconst onSelect = useCallback(\n\t\t( selectedBlock ) => {\n\t\t\tconst { attributes } = selectedBlock;\n\t\t\tif (\n\t\t\t\tattributes.kind === 'post-type' &&\n\t\t\t\tattributes.id &&\n\t\t\t\tattributes.type &&\n\t\t\t\thistory\n\t\t\t) {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostType: attributes.type,\n\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history ]\n\t);\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath=\"/navigation\"\n\t\t\tparentTitle={ __( 'Design' ) }\n\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\tcontent={\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen-navigation-menus\">\n\t\t\t\t\t<NavigationInspector onSelect={ onSelect } />\n\t\t\t\t</div>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
@@ -140,18 +140,13 @@ function SidebarNavigationScreenTemplates(_ref3) {
140
140
  return (0, _element.createElement)(_sidebarNavigationScreen.default, {
141
141
  path: config[postType].path,
142
142
  parentTitle: (0, _i18n.__)('Design'),
143
- title: (0, _element.createElement)(_components.__experimentalHStack, {
144
- justify: "space-between"
145
- }, (0, _element.createElement)("div", {
146
- style: {
147
- flexShrink: 0
148
- }
149
- }, config[postType].labels.title), !isMobileViewport && (0, _element.createElement)(_addNewTemplate.default, {
143
+ title: config[postType].labels.title,
144
+ actions: !isMobileViewport && (0, _element.createElement)(_addNewTemplate.default, {
150
145
  templateType: postType,
151
146
  toggleProps: {
152
147
  className: 'edit-site-sidebar-navigation-screen-templates__add-button'
153
148
  }
154
- })),
149
+ }),
155
150
  content: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.__experimentalItemGroup, null, items.map((item, index) => (0, _element.createElement)(Item, {
156
151
  item: item,
157
152
  key: index
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates/index.js"],"names":["omit","object","keys","Object","fromEntries","entries","filter","key","includes","Item","item","linkInfo","params","props","config","wp_template","path","labels","title","loading","notFound","manage","wp_template_part","SidebarNavigationScreenTemplates","postType","isMobileViewport","editedPostId","editedPostType","select","getEditedPostType","getEditedPostId","editSiteStore","records","templates","isResolving","isLoading","per_page","items","children","map","template","postId","id","rendered","slug","undefined","flexShrink","className","index"],"mappings":";;;;;;;;;;;;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AArBA;AACA;AACA;;AAWA;AACA;AACA;AAQA,SAASA,IAAT,CAAeC,MAAf,EAAuBC,IAAvB,EAA8B;AAC7B,SAAOC,MAAM,CAACC,WAAP,CACND,MAAM,CAACE,OAAP,CAAgBJ,MAAhB,EAAyBK,MAAzB,CAAiC;AAAA,QAAE,CAAEC,GAAF,CAAF;AAAA,WAAe,CAAEL,IAAI,CAACM,QAAL,CAAeD,GAAf,CAAjB;AAAA,GAAjC,CADM,CAAP;AAGA;;AAED,MAAME,IAAI,GAAG,SAAgB;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AAC5B,QAAMC,QAAQ,GAAG,mBAASD,IAAI,CA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GI;AAhBqC,OAAlB;AAAA,KAAhB,CAAR;AAkBA;;AAED,SACC,4BAAC,gCAAD;AACC,IAAA,IAAI,EAAG/B,MAAM,CAAEU,QAAF,CAAN,CAAmBR,IAD3B;AAEC,IAAA,WAAW,EAAG,cAAI,QAAJ,CAFf;AAGC,IAAA,KAAK,EACJ,4BAAC,gCAAD;AAAQ,MAAA,OAAO,EAAC;AAAhB,OACC;AAAK,MAAA,KAAK,EAAG;AAAE8B,QAAAA,UAAU,EAAE;AAAd;AAAb,OACGhC,MAAM,CAAEU,QAAF,CAAN,CAAmBP,MAAnB,CAA0BC,KAD7B,CADD,EAIG,CAAEO,gBAAF,IACD,4BAAC,uBAAD;AACC,MAAA,YAAY,EAAGD,QADhB;AAEC,MAAA,WAAW,EAAG;AACbuB,QAAAA,SAAS,EACR;AAFY;AAFf,MALF,CAJF;AAmBC,IAAA,OAAO,EACN,qDACC,4BAAC,mCAAD,QACGV,KAAK,CAACE,GAAN,CAAW,CAAE7B,IAAF,EAAQsC,KAAR,KACZ,4BAAC,IAAD;AAAM,MAAA,IAAI,EAAGtC,IAAb;AAAoB,MAAA,GAAG,EAAGsC;AAA1B,MADC,CADH,EAKC,4BAAC,8BAAD;AACC,MAAA,SAAS,EAAC;AADX,OAEM,mBAAS;AACbxB,MAAAA,QADa;AAEbiB,MAAAA,MAAM,EAAEI;AAFK,KAAT,CAFN;AAMC,sBACCjC,MAAM,CAACY,QAAP,KAAoBA,QAApB,IAAgC,CAAEZ,MAAM,CAAC6B,MAAzC,GACG,MADH,GAEGI,SATL;AAWC,MAAA,QAAQ,EAAG/B,MAAM,CAAEU,QAAF,CAAN,CAAmBP,MAAnB,CAA0BI;AAXtC,OALD,CADD;AApBF,IADD;AA6CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useLocation } from '../routes';\nimport { store as editSiteStore } from '../../store';\nimport AddNewTemplate from '../add-new-template';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst Item = ( { item } ) => {\n\tconst linkInfo = useLink( item.params );\n\tconst props = item.params\n\t\t? { ...omit( item, 'params' ), ...linkInfo }\n\t\t: item;\n\treturn <SidebarNavigationItem { ...props } />;\n};\n\nconst config = {\n\twp_template: {\n\t\tpath: '/templates',\n\t\tlabels: {\n\t\t\ttitle: __( 'Templates' ),\n\t\t\tloading: __( 'Loading templates' ),\n\t\t\tnotFound: __( 'No templates found' ),\n\t\t\tmanage: __( 'Manage all templates' ),\n\t\t},\n\t},\n\twp_template_part: {\n\t\tpath: '/template-parts',\n\t\tlabels: {\n\t\t\ttitle: __( 'Template parts' ),\n\t\t\tloading: __( 'Loading template parts' ),\n\t\t\tnotFound: __( 'No template parts found' ),\n\t\t\tmanage: __( 'Manage all template parts' ),\n\t\t},\n\t},\n};\n\nexport default function SidebarNavigationScreenTemplates( {\n\tpostType = 'wp_template',\n} ) {\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\t// Ideally the URL params would be enough.\n\t// Loading the editor should ideally redirect to the home page\n\t// instead of fetching the edited entity here.\n\tconst { editedPostId, editedPostType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = select( editSiteStore );\n\t\treturn {\n\t\t\teditedPostId: getEditedPostId(),\n\t\t\teditedPostType: getEditedPostType(),\n\t\t};\n\t}, [] );\n\n\tconst { records: templates, isResolving: isLoading } = useEntityRecords(\n\t\t'postType',\n\t\tpostType,\n\t\t{\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\n\tlet items = [];\n\tif ( isLoading ) {\n\t\titems = [\n\t\t\t{\n\t\t\t\tchildren: config[ postType ].labels.loading,\n\t\t\t},\n\t\t];\n\t} else if ( ! templates && ! isLoading ) {\n\t\titems = [\n\t\t\t{\n\t\t\t\tchildren: config[ postType ].labels.notFound,\n\t\t\t},\n\t\t];\n\t} else {\n\t\titems = templates?.map( ( template ) => ( {\n\t\t\tparams: {\n\t\t\t\tpostType,\n\t\t\t\tpostId: template.id,\n\t\t\t},\n\t\t\tchildren: decodeEntities(\n\t\t\t\ttemplate.title?.rendered || template.slug\n\t\t\t),\n\t\t\t'aria-current':\n\t\t\t\t( params.postType === postType &&\n\t\t\t\t\tparams.postId === template.id ) ||\n\t\t\t\t// This is a special case for the home page.\n\t\t\t\t( editedPostId === template.id &&\n\t\t\t\t\teditedPostType === postType &&\n\t\t\t\t\t!! params.postId )\n\t\t\t\t\t? 'page'\n\t\t\t\t\t: undefined,\n\t\t} ) );\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath={ config[ postType ].path }\n\t\t\tparentTitle={ __( 'Design' ) }\n\t\t\ttitle={\n\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t<div style={ { flexShrink: 0 } }>\n\t\t\t\t\t\t{ config[ postType ].labels.title }\n\t\t\t\t\t</div>\n\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t<AddNewTemplate\n\t\t\t\t\t\t\ttemplateType={ postType }\n\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t\t'edit-site-sidebar-navigation-screen-templates__add-button',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t\t<Item item={ item } key={ index } />\n\t\t\t\t\t\t) ) }\n\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-templates__see-all\"\n\t\t\t\t\t\t\t{ ...useLink( {\n\t\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\t\tpostId: undefined,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\taria-current={\n\t\t\t\t\t\t\t\tparams.postType === postType && ! params.postId\n\t\t\t\t\t\t\t\t\t? 'page'\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchildren={ config[ postType ].labels.manage }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates/index.js"],"names":["omit","object","keys","Object","fromEntries","entries","filter","key","includes","Item","item","linkInfo","params","props","config","wp_template","path","labels","title","loading","notFound","manage","wp_template_part","SidebarNavigationScreenTemplates","postType","isMobileViewport","editedPostId","editedPostType","select","getEditedPostType","getEditedPostId","editSiteStore","records","templates","isResolving","isLoading","per_page","items","children","map","template","postId","id","rendered","slug","undefined","className","index"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAQA;AACA;AACA;AAQA,SAASA,IAAT,CAAeC,MAAf,EAAuBC,IAAvB,EAA8B;AAC7B,SAAOC,MAAM,CAACC,WAAP,CACND,MAAM,CAACE,OAAP,CAAgBJ,MAAhB,EAAyBK,MAAzB,CAAiC;AAAA,QAAE,CAAEC,GAAF,CAAF;AAAA,WAAe,CAAEL,IAAI,CAACM,QAAL,CAAeD,GAAf,CAAj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CAACE,EAD5B,IAEA;AACEhB,QAAAA,YAAY,KAAKc,QAAQ,CAACE,EAA1B,IACDf,cAAc,KAAKH,QADlB,IAED,CAAC,CAAEZ,MAAM,CAAC6B,MALX,GAMG,MANH,GAOGI;AAhBqC,OAAlB;AAAA,KAAhB,CAAR;AAkBA;;AAED,SACC,4BAAC,gCAAD;AACC,IAAA,IAAI,EAAG/B,MAAM,CAAEU,QAAF,CAAN,CAAmBR,IAD3B;AAEC,IAAA,WAAW,EAAG,cAAI,QAAJ,CAFf;AAGC,IAAA,KAAK,EAAGF,MAAM,CAAEU,QAAF,CAAN,CAAmBP,MAAnB,CAA0BC,KAHnC;AAIC,IAAA,OAAO,EACN,CAAEO,gBAAF,IACC,4BAAC,uBAAD;AACC,MAAA,YAAY,EAAGD,QADhB;AAEC,MAAA,WAAW,EAAG;AACbsB,QAAAA,SAAS,EACR;AAFY;AAFf,MANH;AAeC,IAAA,OAAO,EACN,qDACC,4BAAC,mCAAD,QACGT,KAAK,CAACE,GAAN,CAAW,CAAE7B,IAAF,EAAQqC,KAAR,KACZ,4BAAC,IAAD;AAAM,MAAA,IAAI,EAAGrC,IAAb;AAAoB,MAAA,GAAG,EAAGqC;AAA1B,MADC,CADH,EAKC,4BAAC,8BAAD;AACC,MAAA,SAAS,EAAC;AADX,OAEM,mBAAS;AACbvB,MAAAA,QADa;AAEbiB,MAAAA,MAAM,EAAEI;AAFK,KAAT,CAFN;AAMC,sBACCjC,MAAM,CAACY,QAAP,KAAoBA,QAApB,IAAgC,CAAEZ,MAAM,CAAC6B,MAAzC,GACG,MADH,GAEGI,SATL;AAWC,MAAA,QAAQ,EAAG/B,MAAM,CAAEU,QAAF,CAAN,CAAmBP,MAAnB,CAA0BI;AAXtC,OALD,CADD;AAhBF,IADD;AAyCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useLocation } from '../routes';\nimport { store as editSiteStore } from '../../store';\nimport AddNewTemplate from '../add-new-template';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst Item = ( { item } ) => {\n\tconst linkInfo = useLink( item.params );\n\tconst props = item.params\n\t\t? { ...omit( item, 'params' ), ...linkInfo }\n\t\t: item;\n\treturn <SidebarNavigationItem { ...props } />;\n};\n\nconst config = {\n\twp_template: {\n\t\tpath: '/templates',\n\t\tlabels: {\n\t\t\ttitle: __( 'Templates' ),\n\t\t\tloading: __( 'Loading templates' ),\n\t\t\tnotFound: __( 'No templates found' ),\n\t\t\tmanage: __( 'Manage all templates' ),\n\t\t},\n\t},\n\twp_template_part: {\n\t\tpath: '/template-parts',\n\t\tlabels: {\n\t\t\ttitle: __( 'Template parts' ),\n\t\t\tloading: __( 'Loading template parts' ),\n\t\t\tnotFound: __( 'No template parts found' ),\n\t\t\tmanage: __( 'Manage all template parts' ),\n\t\t},\n\t},\n};\n\nexport default function SidebarNavigationScreenTemplates( {\n\tpostType = 'wp_template',\n} ) {\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\t// Ideally the URL params would be enough.\n\t// Loading the editor should ideally redirect to the home page\n\t// instead of fetching the edited entity here.\n\tconst { editedPostId, editedPostType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = select( editSiteStore );\n\t\treturn {\n\t\t\teditedPostId: getEditedPostId(),\n\t\t\teditedPostType: getEditedPostType(),\n\t\t};\n\t}, [] );\n\n\tconst { records: templates, isResolving: isLoading } = useEntityRecords(\n\t\t'postType',\n\t\tpostType,\n\t\t{\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\n\tlet items = [];\n\tif ( isLoading ) {\n\t\titems = [\n\t\t\t{\n\t\t\t\tchildren: config[ postType ].labels.loading,\n\t\t\t},\n\t\t];\n\t} else if ( ! templates && ! isLoading ) {\n\t\titems = [\n\t\t\t{\n\t\t\t\tchildren: config[ postType ].labels.notFound,\n\t\t\t},\n\t\t];\n\t} else {\n\t\titems = templates?.map( ( template ) => ( {\n\t\t\tparams: {\n\t\t\t\tpostType,\n\t\t\t\tpostId: template.id,\n\t\t\t},\n\t\t\tchildren: decodeEntities(\n\t\t\t\ttemplate.title?.rendered || template.slug\n\t\t\t),\n\t\t\t'aria-current':\n\t\t\t\t( params.postType === postType &&\n\t\t\t\t\tparams.postId === template.id ) ||\n\t\t\t\t// This is a special case for the home page.\n\t\t\t\t( editedPostId === template.id &&\n\t\t\t\t\teditedPostType === postType &&\n\t\t\t\t\t!! params.postId )\n\t\t\t\t\t? 'page'\n\t\t\t\t\t: undefined,\n\t\t} ) );\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tpath={ config[ postType ].path }\n\t\t\tparentTitle={ __( 'Design' ) }\n\t\t\ttitle={ config[ postType ].labels.title }\n\t\t\tactions={\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<AddNewTemplate\n\t\t\t\t\t\ttemplateType={ postType }\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t'edit-site-sidebar-navigation-screen-templates__add-button',\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t\t<Item item={ item } key={ index } />\n\t\t\t\t\t\t) ) }\n\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-templates__see-all\"\n\t\t\t\t\t\t\t{ ...useLink( {\n\t\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\t\tpostId: undefined,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\taria-current={\n\t\t\t\t\t\t\t\tparams.postType === postType && ! params.postId\n\t\t\t\t\t\t\t\t\t? 'page'\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchildren={ config[ postType ].labels.manage }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
@@ -35,6 +35,8 @@ var _siteIcon = _interopRequireDefault(require("../site-icon"));
35
35
 
36
36
  var _useEditedEntityRecord = _interopRequireDefault(require("../use-edited-entity-record"));
37
37
 
38
+ var _experiments = require("../../experiments");
39
+
38
40
  /**
39
41
  * External dependencies
40
42
  */
@@ -65,12 +67,12 @@ const SiteHub = (0, _element.forwardRef)((_ref, ref) => {
65
67
  } = (0, _data.useSelect)(select => {
66
68
  select(_store.store).getEditedPostType();
67
69
  const {
68
- __unstableGetCanvasMode,
70
+ getCanvasMode,
69
71
  getSettings,
70
72
  getEditedPostType
71
- } = select(_store.store);
73
+ } = (0, _experiments.unlock)(select(_store.store));
72
74
  return {
73
- canvasMode: __unstableGetCanvasMode(),
75
+ canvasMode: getCanvasMode(),
74
76
  dashboardLink: getSettings().__experimentalDashboardLink,
75
77
  entityConfig: select(_coreData.store).getEntityConfig('postType', getEditedPostType())
76
78
  };
@@ -78,8 +80,8 @@ const SiteHub = (0, _element.forwardRef)((_ref, ref) => {
78
80
  const disableMotion = (0, _compose.useReducedMotion)();
79
81
  const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
80
82
  const {
81
- __unstableSetCanvasMode
82
- } = (0, _data.useDispatch)(_store.store);
83
+ setCanvasMode
84
+ } = (0, _experiments.unlock)((0, _data.useDispatch)(_store.store));
83
85
  const {
84
86
  clearSelectedBlock
85
87
  } = (0, _data.useDispatch)(_blockEditor.store);
@@ -94,8 +96,7 @@ const SiteHub = (0, _element.forwardRef)((_ref, ref) => {
94
96
  onClick: () => {
95
97
  clearSelectedBlock();
96
98
  setIsMobileCanvasVisible(false);
97
-
98
- __unstableSetCanvasMode('view');
99
+ setCanvasMode('view');
99
100
  }
100
101
  };
101
102
  const {
@@ -113,7 +114,8 @@ const SiteHub = (0, _element.forwardRef)((_ref, ref) => {
113
114
  }
114
115
  }), (0, _element.createElement)(_components.__experimentalHStack, {
115
116
  justify: "flex-start",
116
- className: "edit-site-site-hub__text-content"
117
+ className: "edit-site-site-hub__text-content",
118
+ spacing: "0"
117
119
  }, (0, _element.createElement)(_components.__unstableMotion.div, {
118
120
  className: "edit-site-site-hub__view-mode-toggle-container",
119
121
  layout: true,
@@ -134,9 +136,8 @@ const SiteHub = (0, _element.forwardRef)((_ref, ref) => {
134
136
  className: "edit-site-site-hub__post-type"
135
137
  }, entityConfig === null || entityConfig === void 0 ? void 0 : entityConfig.label))), showEditButton && (0, _element.createElement)(_components.Button, {
136
138
  className: "edit-site-site-hub__edit-button",
137
- label: (0, _i18n.__)('Open the editor'),
138
139
  onClick: () => {
139
- __unstableSetCanvasMode('edit');
140
+ setCanvasMode('edit');
140
141
  },
141
142
  variant: "primary"
142
143
  }, (0, _i18n.__)('Edit')), isMobileViewport && !isMobileCanvasVisible && (0, _element.createElement)(_components.Button, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"names":["HUB_ANIMATION_DURATION","SiteHub","ref","isMobileCanvasVisible","setIsMobileCanvasVisible","props","params","isListPage","isEditorPage","canvasMode","dashboardLink","entityConfig","select","editSiteStore","getEditedPostType","__unstableGetCanvasMode","getSettings","__experimentalDashboardLink","coreStore","getEntityConfig","disableMotion","isMobileViewport","__unstableSetCanvasMode","clearSelectedBlock","blockEditorStore","showEditButton","isBackToDashboardButton","showLabels","siteIconButtonProps","href","label","onClick","getTitle","className","type","duration","ease"],"mappings":";;;;;;;;;AAmBA;;;;AAhBA;;AAKA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AA5BA;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;AAOA,MAAMA,sBAAsB,GAAG,GAA/B;AAEA,MAAMC,OAAO,GAAG,yBACf,OAAiEC,GAAjE,KAA0E;AAAA,MAAxE;AAAEC,IAAAA,qBAAF;AAAyBC,IAAAA,wBAAzB;AAAmD,OAAGC;AAAtD,GAAwE;AACzE,QAAM;AAAEC,IAAAA;AAAF,MAAa,0BAAnB;AACA,QAAMC,UAAU,GAAG,4BAAeD,MAAf,CAAnB;AACA,QAAME,YAAY,GAAG,CAAED,UAAvB;AACA,QAAM;AAAEE,IAAAA,UAAF;AAAcC,IAAAA,aAAd;AAA6BC,IAAAA;AAA7B,MAA8C,qBACjDC,MAAF,IAAc;AACbA,IAAAA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,iBAAxB;AACA,UAAM;AACLC,MAAAA,uBADK;AAELC,MAAAA,WAFK;AAGLF,MAAAA;AAHK,QAIFF,MAAM,CAAEC,YAAF,CAJV;AAKA,WAAO;AACNJ,MAAAA,UAAU,EAAEM,uBAAuB,EAD7B;AAENL,MAAAA,aAAa,EAAEM,WAAW,GAAGC,2BAFvB;AAGNN,MAAAA,YAAY,EAAEC,MAAM,CAAEM,eAAF,CAAN,CAAoBC,eAApB,CACb,UADa,EAEbL,iBAAiB,EAFJ;AAHR,KAAP;AAQA,GAhBkD,EAiBnD,EAjBmD,CAApD;AAmBA,QAAMM,aAAa,GAAG,gCAAtB;AACA,QAAMC,gBAAgB,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAzB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAA8B,uBAAaT,YAAb,CAApC;AACA,QAAM;AAAEU,IAAAA;AAAF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F,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EAAEf,aAAa,GACpB,CADoB,GAEpBpB,sBAJS;AAKZoC,MAAAA,IAAI,EAAE;AALM;AAHd,KAWC,4BAAC,kBAAD,6BACMR,mBADN;AAEC,IAAA,SAAS,EAAC;AAFX,MAIC,4BAAC,iBAAD;AAAU,IAAA,SAAS,EAAC;AAApB,IAJD,CAXD,CAJD,EAuBGD,UAAU,IACX,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGK,QAAQ,EADX,CADD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGrB,YADH,aACGA,YADH,uBACGA,YAAY,CAAEmB,KADjB,CAJD,CAxBF,CAdD,EAiDGL,cAAc,IACf,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CAFT;AAGC,IAAA,OAAO,EAAG,MAAM;AACfH,MAAAA,uBAAuB,CAAE,MAAF,CAAvB;AACA,KALF;AAMC,IAAA,OAAO,EAAC;AANT,KAQG,cAAI,MAAJ,CARH,CAlDF,EA8DGD,gBAAgB,IAAI,CAAElB,qBAAtB,IACD,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAG,MAAMC,wBAAwB,CAAE,IAAF,CADzC;AAEC,IAAA,OAAO,EAAC;AAFT,KAIG,cAAI,aAAJ,CAJH,CA/DF,CADD;AAyEA,CA7Hc,CAAhB;eAgIeH,O","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useReducedMotion, useViewportMatch } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { useLocation } from '../routes';\nimport getIsListPage from '../../utils/get-is-list-page';\nimport SiteIcon from '../site-icon';\nimport useEditedEntityRecord from '../use-edited-entity-record';\n\nconst HUB_ANIMATION_DURATION = 0.3;\n\nconst SiteHub = forwardRef(\n\t( { isMobileCanvasVisible, setIsMobileCanvasVisible, ...props }, ref ) => {\n\t\tconst { params } = useLocation();\n\t\tconst isListPage = getIsListPage( params );\n\t\tconst isEditorPage = ! isListPage;\n\t\tconst { canvasMode, dashboardLink, entityConfig } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tselect( editSiteStore ).getEditedPostType();\n\t\t\t\tconst {\n\t\t\t\t\t__unstableGetCanvasMode,\n\t\t\t\t\tgetSettings,\n\t\t\t\t\tgetEditedPostType,\n\t\t\t\t} = select( editSiteStore );\n\t\t\t\treturn {\n\t\t\t\t\tcanvasMode: __unstableGetCanvasMode(),\n\t\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\t\tentityConfig: select( coreStore ).getEntityConfig(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tgetEditedPostType()\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst disableMotion = useReducedMotion();\n\t\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\t\tconst { __unstableSetCanvasMode } = useDispatch( editSiteStore );\n\t\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\t\tconst showEditButton =\n\t\t\t( isEditorPage && canvasMode === 'view' && ! isMobileViewport ) ||\n\t\t\t( isMobileViewport &&\n\t\t\t\tcanvasMode === 'view' &&\n\t\t\t\tisMobileCanvasVisible );\n\t\tconst isBackToDashboardButton =\n\t\t\t( ! isMobileViewport && canvasMode === 'view' ) ||\n\t\t\t( isMobileViewport && ! isMobileCanvasVisible );\n\t\tconst showLabels = canvasMode !== 'edit';\n\t\tconst siteIconButtonProps = isBackToDashboardButton\n\t\t\t? {\n\t\t\t\t\thref: dashboardLink || 'index.php',\n\t\t\t\t\t'aria-label': __( 'Go back to the dashboard' ),\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tlabel: __( 'Open Navigation Sidebar' ),\n\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\t\tsetIsMobileCanvasVisible( false );\n\t\t\t\t\t\t__unstableSetCanvasMode( 'view' );\n\t\t\t\t\t},\n\t\t\t };\n\t\tconst { getTitle } = useEditedEntityRecord();\n\n\t\treturn (\n\t\t\t<motion.div\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...props }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-site-hub',\n\t\t\t\t\tprops.className\n\t\t\t\t) }\n\t\t\t\tlayout\n\t\t\t\ttransition={ {\n\t\t\t\t\ttype: 'tween',\n\t\t\t\t\tduration: disableMotion ? 0 : HUB_ANIMATION_DURATION,\n\t\t\t\t\tease: 'easeOut',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-site-hub__text-content\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"edit-site-site-hub__view-mode-toggle-container\"\n\t\t\t\t\t\tlayout\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: HUB_ANIMATION_DURATION,\n\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t{ ...siteIconButtonProps }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</motion.div>\n\n\t\t\t\t\t{ showLabels && (\n\t\t\t\t\t\t<VStack spacing={ 0 }>\n\t\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t\t{ getTitle() }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"edit-site-site-hub__post-type\">\n\t\t\t\t\t\t\t\t{ entityConfig?.label }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\n\t\t\t\t{ showEditButton && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-site-hub__edit-button\"\n\t\t\t\t\t\tlabel={ __( 'Open the editor' ) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t__unstableSetCanvasMode( 'edit' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\n\t\t\t\t{ isMobileViewport && ! isMobileCanvasVisible && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ () => setIsMobileCanvasVisible( true ) }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'View Editor' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t);\n\t}\n);\n\nexport default SiteHub;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"names":["HUB_ANIMATION_DURATION","SiteHub","ref","isMobileCanvasVisible","setIsMobileCanvasVisible","props","params","isListPage","isEditorPage","canvasMode","dashboardLink","entityConfig","select","editSiteStore","getEditedPostType","getCanvasMode","getSettings","__experimentalDashboardLink","coreStore","getEntityConfig","disableMotion","isMobileViewport","setCanvasMode","clearSelectedBlock","blockEditorStore","showEditButton","isBackToDashboardButton","showLabels","siteIconButtonProps","href","label","onClick","getTitle","className","type","duration","ease"],"mappings":";;;;;;;;;AAmBA;;;;AAhBA;;AAKA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA7BA;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;AAQA,MAAMA,sBAAsB,GAAG,GAA/B;AAEA,MAAMC,OAAO,GAAG,yBACf,OAAiEC,GAAjE,KAA0E;AAAA,MAAxE;AAAEC,IAAAA,qBAAF;AAAyBC,IAAAA,wBAAzB;AAAmD,OAAGC;AAAtD,GAAwE;AACzE,QAAM;AAAEC,IAAAA;AAAF,MAAa,0BAAnB;AACA,QAAMC,UAAU,GAAG,4BAAeD,MAAf,CAAnB;AACA,QAAME,YAAY,GAAG,CAAED,UAAvB;AACA,QAAM;AAAEE,IAAAA,UAAF;AAAcC,IAAAA,aAAd;AAA6BC,IAAAA;AAA7B,MAA8C,qBACjDC,MAAF,IAAc;AACbA,IAAAA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,iBAAxB;AACA,UAAM;AAAEC,MAAAA,aAAF;AAAiBC,MAAAA,WAAjB;AAA8BF,MAAAA;AAA9B,QACL,yBAAQF,MAAM,CAAEC,YAAF,CAAd,CADD;AAEA,WAAO;AACNJ,MAAAA,UAAU,EAAEM,aAAa,EADnB;AAENL,MAAAA,aAAa,EAAEM,WAAW,GAAGC,2BAFvB;AAGNN,MAAAA,YAAY,EAAEC,MAAM,CAAEM,eAAF,CAAN,CAAoBC,eAApB,CACb,UADa,EAEbL,iBAAiB,EAFJ;AAHR,KAAP;AAQA,GAbkD,EAcnD,EAdmD,CAApD;AAgBA,QAAMM,aAAa,GAAG,gCAAtB;AACA,QAAMC,gBAAgB,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAzB;AAC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O,EAAC;AAHT,KAKC,4BAAC,4BAAD,CAAQ,GAAR;AACC,IAAA,SAAS,EAAC,gDADX;AAEC,IAAA,MAAM,MAFP;AAGC,IAAA,UAAU,EAAG;AACZF,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EAAEf,aAAa,GACpB,CADoB,GAEpBpB,sBAJS;AAKZoC,MAAAA,IAAI,EAAE;AALM;AAHd,KAWC,4BAAC,kBAAD,6BACMR,mBADN;AAEC,IAAA,SAAS,EAAC;AAFX,MAIC,4BAAC,iBAAD;AAAU,IAAA,SAAS,EAAC;AAApB,IAJD,CAXD,CALD,EAwBGD,UAAU,IACX,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGK,QAAQ,EADX,CADD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGrB,YADH,aACGA,YADH,uBACGA,YAAY,CAAEmB,KADjB,CAJD,CAzBF,CAdD,EAkDGL,cAAc,IACf,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,OAAO,EAAG,MAAM;AACfH,MAAAA,aAAa,CAAE,MAAF,CAAb;AACA,KAJF;AAKC,IAAA,OAAO,EAAC;AALT,KAOG,cAAI,MAAJ,CAPH,CAnDF,EA8DGD,gBAAgB,IAAI,CAAElB,qBAAtB,IACD,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAG,MAAMC,wBAAwB,CAAE,IAAF,CADzC;AAEC,IAAA,OAAO,EAAC;AAFT,KAIG,cAAI,aAAJ,CAJH,CA/DF,CADD;AAyEA,CA1Hc,CAAhB;eA6HeH,O","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useReducedMotion, useViewportMatch } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { useLocation } from '../routes';\nimport getIsListPage from '../../utils/get-is-list-page';\nimport SiteIcon from '../site-icon';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { unlock } from '../../experiments';\n\nconst HUB_ANIMATION_DURATION = 0.3;\n\nconst SiteHub = forwardRef(\n\t( { isMobileCanvasVisible, setIsMobileCanvasVisible, ...props }, ref ) => {\n\t\tconst { params } = useLocation();\n\t\tconst isListPage = getIsListPage( params );\n\t\tconst isEditorPage = ! isListPage;\n\t\tconst { canvasMode, dashboardLink, entityConfig } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tselect( editSiteStore ).getEditedPostType();\n\t\t\t\tconst { getCanvasMode, getSettings, getEditedPostType } =\n\t\t\t\t\tunlock( select( editSiteStore ) );\n\t\t\t\treturn {\n\t\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\t\tentityConfig: select( coreStore ).getEntityConfig(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tgetEditedPostType()\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst disableMotion = useReducedMotion();\n\t\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\t\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\t\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\t\tconst showEditButton =\n\t\t\t( isEditorPage && canvasMode === 'view' && ! isMobileViewport ) ||\n\t\t\t( isMobileViewport &&\n\t\t\t\tcanvasMode === 'view' &&\n\t\t\t\tisMobileCanvasVisible );\n\t\tconst isBackToDashboardButton =\n\t\t\t( ! isMobileViewport && canvasMode === 'view' ) ||\n\t\t\t( isMobileViewport && ! isMobileCanvasVisible );\n\t\tconst showLabels = canvasMode !== 'edit';\n\t\tconst siteIconButtonProps = isBackToDashboardButton\n\t\t\t? {\n\t\t\t\t\thref: dashboardLink || 'index.php',\n\t\t\t\t\t'aria-label': __( 'Go back to the dashboard' ),\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tlabel: __( 'Open Navigation Sidebar' ),\n\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\t\tsetIsMobileCanvasVisible( false );\n\t\t\t\t\t\tsetCanvasMode( 'view' );\n\t\t\t\t\t},\n\t\t\t };\n\t\tconst { getTitle } = useEditedEntityRecord();\n\n\t\treturn (\n\t\t\t<motion.div\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...props }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-site-hub',\n\t\t\t\t\tprops.className\n\t\t\t\t) }\n\t\t\t\tlayout\n\t\t\t\ttransition={ {\n\t\t\t\t\ttype: 'tween',\n\t\t\t\t\tduration: disableMotion ? 0 : HUB_ANIMATION_DURATION,\n\t\t\t\t\tease: 'easeOut',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-site-hub__text-content\"\n\t\t\t\t\tspacing=\"0\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"edit-site-site-hub__view-mode-toggle-container\"\n\t\t\t\t\t\tlayout\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: HUB_ANIMATION_DURATION,\n\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t{ ...siteIconButtonProps }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</motion.div>\n\n\t\t\t\t\t{ showLabels && (\n\t\t\t\t\t\t<VStack spacing={ 0 }>\n\t\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t\t{ getTitle() }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"edit-site-site-hub__post-type\">\n\t\t\t\t\t\t\t\t{ entityConfig?.label }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\n\t\t\t\t{ showEditButton && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-site-hub__edit-button\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\n\t\t\t\t{ isMobileViewport && ! isMobileCanvasVisible && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ () => setIsMobileCanvasVisible( true ) }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'View Editor' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t);\n\t}\n);\n\nexport default SiteHub;\n"]}
@@ -57,7 +57,7 @@ function SiteIcon(_ref) {
57
57
  src: siteIconUrl
58
58
  }) : (0, _element.createElement)(_components.Icon, {
59
59
  className: "edit-site-site-icon__icon",
60
- size: "36px",
60
+ size: "32px",
61
61
  icon: _icons.wordpress
62
62
  });
63
63
  return (0, _element.createElement)("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/site-icon/index.js"],"names":["SiteIcon","className","isRequestingSite","siteIconUrl","select","getEntityRecord","isResolving","coreDataStore","siteData","undefined","site_icon_url","icon","wordpress"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;AAOA,SAASA,QAAT,OAAmC;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAClC,QAAM;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MAAoC,qBAAaC,MAAF,IAAc;AAClE,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QAAmCF,MAAM,CAAEG,eAAF,CAA/C;AACA,UAAMC,QAAQ,GACbH,eAAe,CAAE,MAAF,EAAU,gBAAV,EAA4BI,SAA5B,CAAf,IAA0D,EAD3D;AAGA,WAAO;AACNP,MAAAA,gBAAgB,EAAEI,WAAW,CAAE,MAAF,EAAU,iBAAV,EAA6B,CACzD,MADyD,EAEzD,gBAFyD,EAGzDG,SAHyD,CAA7B,CADvB;AAMNN,MAAAA,WAAW,EAAEK,QAAQ,CAACE;AANhB,KAAP;AAQA,GAbyC,EAavC,EAbuC,CAA1C;;AAeA,MAAKR,gBAAgB,IAAI,CAAEC,WAA3B,EAAyC;AACxC,WAAO,IAAP;AACA;;AAED,QAAMQ,IAAI,GAAGR,WAAW,GACvB;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,GAAG,EAAG,cAAI,WAAJ,CAFP;AAGC,IAAA,GAAG,EAAGA;AAHP,IADuB,GAOvB,4BAAC,gBAAD;AACC,IAAA,SAAS,EAAC,2BADX;AAEC,IAAA,IAAI,EAAC,MAFN;AAGC,IAAA,IAAI,EAAGS;AAHR,IAPD;AAcA,SACC;AAAK,IAAA,SAAS,EAAG,yBAAYX,SAAZ,EAAuB,qBAAvB;AAAjB,KACGU,IADH,CADD;AAKA;;eAEcX,Q","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Icon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\nfunction SiteIcon( { className } ) {\n\tconst { isRequestingSite, siteIconUrl } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, isResolving } = select( coreDataStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\tisRequestingSite: isResolving( 'core', 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tif ( isRequestingSite && ! siteIconUrl ) {\n\t\treturn null;\n\t}\n\n\tconst icon = siteIconUrl ? (\n\t\t<img\n\t\t\tclassName=\"edit-site-site-icon__image\"\n\t\t\talt={ __( 'Site Icon' ) }\n\t\t\tsrc={ siteIconUrl }\n\t\t/>\n\t) : (\n\t\t<Icon\n\t\t\tclassName=\"edit-site-site-icon__icon\"\n\t\t\tsize=\"36px\"\n\t\t\ticon={ wordpress }\n\t\t/>\n\t);\n\n\treturn (\n\t\t<div className={ classnames( className, 'edit-site-site-icon' ) }>\n\t\t\t{ icon }\n\t\t</div>\n\t);\n}\n\nexport default SiteIcon;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/site-icon/index.js"],"names":["SiteIcon","className","isRequestingSite","siteIconUrl","select","getEntityRecord","isResolving","coreDataStore","siteData","undefined","site_icon_url","icon","wordpress"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;AAOA,SAASA,QAAT,OAAmC;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAClC,QAAM;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MAAoC,qBAAaC,MAAF,IAAc;AAClE,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QAAmCF,MAAM,CAAEG,eAAF,CAA/C;AACA,UAAMC,QAAQ,GACbH,eAAe,CAAE,MAAF,EAAU,gBAAV,EAA4BI,SAA5B,CAAf,IAA0D,EAD3D;AAGA,WAAO;AACNP,MAAAA,gBAAgB,EAAEI,WAAW,CAAE,MAAF,EAAU,iBAAV,EAA6B,CACzD,MADyD,EAEzD,gBAFyD,EAGzDG,SAHyD,CAA7B,CADvB;AAMNN,MAAAA,WAAW,EAAEK,QAAQ,CAACE;AANhB,KAAP;AAQA,GAbyC,EAavC,EAbuC,CAA1C;;AAeA,MAAKR,gBAAgB,IAAI,CAAEC,WAA3B,EAAyC;AACxC,WAAO,IAAP;AACA;;AAED,QAAMQ,IAAI,GAAGR,WAAW,GACvB;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,GAAG,EAAG,cAAI,WAAJ,CAFP;AAGC,IAAA,GAAG,EAAGA;AAHP,IADuB,GAOvB,4BAAC,gBAAD;AACC,IAAA,SAAS,EAAC,2BADX;AAEC,IAAA,IAAI,EAAC,MAFN;AAGC,IAAA,IAAI,EAAGS;AAHR,IAPD;AAcA,SACC;AAAK,IAAA,SAAS,EAAG,yBAAYX,SAAZ,EAAuB,qBAAvB;AAAjB,KACGU,IADH,CADD;AAKA;;eAEcX,Q","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Icon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\nfunction SiteIcon( { className } ) {\n\tconst { isRequestingSite, siteIconUrl } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, isResolving } = select( coreDataStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\tisRequestingSite: isResolving( 'core', 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tif ( isRequestingSite && ! siteIconUrl ) {\n\t\treturn null;\n\t}\n\n\tconst icon = siteIconUrl ? (\n\t\t<img\n\t\t\tclassName=\"edit-site-site-icon__image\"\n\t\t\talt={ __( 'Site Icon' ) }\n\t\t\tsrc={ siteIconUrl }\n\t\t/>\n\t) : (\n\t\t<Icon\n\t\t\tclassName=\"edit-site-site-icon__icon\"\n\t\t\tsize=\"32px\"\n\t\t\ticon={ wordpress }\n\t\t/>\n\t);\n\n\treturn (\n\t\t<div className={ classnames( className, 'edit-site-site-icon' ) }>\n\t\t\t{ icon }\n\t\t</div>\n\t);\n}\n\nexport default SiteIcon;\n"]}
@@ -24,7 +24,7 @@ var _icons = require("@wordpress/icons");
24
24
 
25
25
  var _compose = require("@wordpress/compose");
26
26
 
27
- var _globalStyles = require("../global-styles");
27
+ var _experiments = require("../../experiments");
28
28
 
29
29
  /**
30
30
  * External dependencies
@@ -37,6 +37,9 @@ var _globalStyles = require("../global-styles");
37
37
  /**
38
38
  * Internal dependencies
39
39
  */
40
+ const {
41
+ useGlobalStyle
42
+ } = (0, _experiments.unlock)(_blockEditor.experiments);
40
43
  const SLOT_FILL_NAME = 'EditSiteStyleBook';
41
44
  const {
42
45
  Slot: StyleBookSlot,
@@ -83,8 +86,8 @@ function StyleBook(_ref) {
83
86
  onClose
84
87
  } = _ref;
85
88
  const [resizeObserver, sizes] = (0, _compose.useResizeObserver)();
86
- const [textColor] = (0, _globalStyles.useStyle)('color.text');
87
- const [backgroundColor] = (0, _globalStyles.useStyle)('color.background');
89
+ const [textColor] = useGlobalStyle('color.text');
90
+ const [backgroundColor] = useGlobalStyle('color.background');
88
91
  const examples = (0, _element.useMemo)(getExamples, []);
89
92
  const tabs = (0, _element.useMemo)(() => (0, _blocks.getCategories)().filter(category => examples.some(example => example.category === category.slug)).map(category => ({
90
93
  name: category.slug,
@@ -156,7 +159,7 @@ const Example = (0, _element.memo)(_ref3 => {
156
159
  }, (0, _element.createElement)(_blockEditor.BlockPreview, {
157
160
  blocks: blocks,
158
161
  viewportWidth: 0,
159
- __experimentalStyles: [{
162
+ additionalStyles: [{
160
163
  css: '.wp-block:first-child { margin-top: 0; }' + '.wp-block:last-child { margin-bottom: 0; }'
161
164
  }]
162
165
  })));