@wordpress/edit-site 5.9.0 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (545) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +7 -22
  3. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
  4. package/build/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +32 -27
  5. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
  6. package/build/components/add-new-template/new-template-part.js +8 -2
  7. package/build/components/add-new-template/new-template-part.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +104 -68
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/app/index.js +8 -2
  11. package/build/components/app/index.js.map +1 -1
  12. package/build/components/block-editor/back-button.js +10 -3
  13. package/build/components/block-editor/back-button.js.map +1 -1
  14. package/build/components/block-editor/editor-canvas.js +39 -6
  15. package/build/components/block-editor/editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/index.js +1 -3
  17. package/build/components/block-editor/index.js.map +1 -1
  18. package/build/components/create-template-part-modal/index.js +6 -7
  19. package/build/components/create-template-part-modal/index.js.map +1 -1
  20. package/build/components/editor/index.js +20 -11
  21. package/build/components/editor/index.js.map +1 -1
  22. package/build/components/editor-canvas-container/index.js +27 -6
  23. package/build/components/editor-canvas-container/index.js.map +1 -1
  24. package/build/components/global-styles/block-preview-panel.js +1 -1
  25. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  26. package/build/components/global-styles/color-palette-panel.js +14 -3
  27. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  28. package/build/components/global-styles/dimensions-panel.js +17 -18
  29. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  30. package/build/components/global-styles/gradients-palette-panel.js +14 -3
  31. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  32. package/build/components/global-styles/root-menu.js +61 -0
  33. package/build/components/global-styles/root-menu.js.map +1 -0
  34. package/build/components/global-styles/screen-block-list.js +3 -1
  35. package/build/components/global-styles/screen-block-list.js.map +1 -1
  36. package/build/components/global-styles/screen-block.js +235 -7
  37. package/build/components/global-styles/screen-block.js.map +1 -1
  38. package/build/components/global-styles/screen-colors.js +9 -26
  39. package/build/components/global-styles/screen-colors.js.map +1 -1
  40. package/build/components/global-styles/screen-css.js +20 -15
  41. package/build/components/global-styles/screen-css.js.map +1 -1
  42. package/build/components/global-styles/screen-layout.js +4 -17
  43. package/build/components/global-styles/screen-layout.js.map +1 -1
  44. package/build/components/global-styles/screen-revisions/index.js +141 -0
  45. package/build/components/global-styles/screen-revisions/index.js.map +1 -0
  46. package/build/components/global-styles/screen-revisions/revisions-buttons.js +130 -0
  47. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
  48. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +121 -0
  49. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
  50. package/build/components/global-styles/screen-root.js +6 -6
  51. package/build/components/global-styles/screen-root.js.map +1 -1
  52. package/build/components/global-styles/screen-typography-element.js +0 -3
  53. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  54. package/build/components/global-styles/screen-typography.js +11 -39
  55. package/build/components/global-styles/screen-typography.js.map +1 -1
  56. package/build/components/global-styles/style-variations-container.js +9 -18
  57. package/build/components/global-styles/style-variations-container.js.map +1 -1
  58. package/build/components/global-styles/typography-panel.js +7 -11
  59. package/build/components/global-styles/typography-panel.js.map +1 -1
  60. package/build/components/global-styles/ui.js +70 -117
  61. package/build/components/global-styles/ui.js.map +1 -1
  62. package/build/components/global-styles/variations-panel.js +4 -28
  63. package/build/components/global-styles/variations-panel.js.map +1 -1
  64. package/build/components/header-edit-mode/document-actions/index.js +28 -103
  65. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  66. package/build/components/header-edit-mode/index.js +15 -2
  67. package/build/components/header-edit-mode/index.js.map +1 -1
  68. package/build/components/keyboard-shortcuts/register.js +1 -1
  69. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  70. package/build/components/layout/hooks.js +54 -0
  71. package/build/components/layout/hooks.js.map +1 -0
  72. package/build/components/layout/index.js +57 -104
  73. package/build/components/layout/index.js.map +1 -1
  74. package/build/components/list/actions/index.js +5 -2
  75. package/build/components/list/actions/index.js.map +1 -1
  76. package/build/components/list/index.js +9 -3
  77. package/build/components/list/index.js.map +1 -1
  78. package/build/components/list/table.js +1 -1
  79. package/build/components/list/table.js.map +1 -1
  80. package/build/components/plugin-template-setting-panel/index.js +44 -0
  81. package/build/components/plugin-template-setting-panel/index.js.map +1 -0
  82. package/build/components/resizable-frame/index.js +242 -0
  83. package/build/components/resizable-frame/index.js.map +1 -0
  84. package/build/components/revisions/index.js +96 -0
  85. package/build/components/revisions/index.js.map +1 -0
  86. package/build/components/routes/link.js +17 -2
  87. package/build/components/routes/link.js.map +1 -1
  88. package/build/components/routes/use-title.js +8 -2
  89. package/build/components/routes/use-title.js.map +1 -1
  90. package/build/components/save-button/index.js +31 -6
  91. package/build/components/save-button/index.js.map +1 -1
  92. package/build/components/save-hub/index.js +14 -31
  93. package/build/components/save-hub/index.js.map +1 -1
  94. package/build/components/save-panel/index.js +20 -7
  95. package/build/components/save-panel/index.js.map +1 -1
  96. package/build/components/secondary-sidebar/list-view-sidebar.js +6 -10
  97. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  98. package/build/components/sidebar/index.js +19 -5
  99. package/build/components/sidebar/index.js.map +1 -1
  100. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +9 -3
  101. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  102. package/build/components/sidebar-edit-mode/index.js +9 -2
  103. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  104. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +40 -0
  105. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
  106. package/build/components/sidebar-edit-mode/template-card/index.js +1 -8
  107. package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
  108. package/build/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +2 -2
  109. package/build/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
  110. package/build/components/sidebar-navigation-item/index.js +5 -7
  111. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  112. package/build/components/sidebar-navigation-screen/index.js +14 -4
  113. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  114. package/build/components/sidebar-navigation-screen-global-styles/index.js +75 -11
  115. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  116. package/build/components/sidebar-navigation-screen-main/index.js +31 -23
  117. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  118. package/build/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  119. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  120. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +162 -0
  121. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
  122. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +17 -0
  123. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
  124. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +55 -93
  125. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  126. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +87 -0
  127. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
  128. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -71
  129. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  130. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +53 -0
  131. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
  132. package/build/components/sidebar-navigation-screen-page/index.js +67 -0
  133. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -0
  134. package/build/components/sidebar-navigation-screen-pages/index.js +74 -0
  135. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -0
  136. package/build/components/sidebar-navigation-screen-templates/index.js +39 -12
  137. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  138. package/build/components/sidebar-navigation-subtitle/index.js +18 -0
  139. package/build/components/sidebar-navigation-subtitle/index.js.map +1 -0
  140. package/build/components/site-hub/index.js +34 -6
  141. package/build/components/site-hub/index.js.map +1 -1
  142. package/build/components/start-template-options/index.js +12 -16
  143. package/build/components/start-template-options/index.js.map +1 -1
  144. package/build/components/style-book/index.js +93 -19
  145. package/build/components/style-book/index.js.map +1 -1
  146. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
  147. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  148. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +9 -4
  149. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  150. package/build/components/sync-state-with-url/use-sync-path-with-url.js +17 -3
  151. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  152. package/build/components/use-edited-entity-record/index.js +8 -4
  153. package/build/components/use-edited-entity-record/index.js.map +1 -1
  154. package/build/hooks/commands/use-edit-mode-commands.js +105 -0
  155. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -0
  156. package/build/hooks/template-part-edit.js +8 -2
  157. package/build/hooks/template-part-edit.js.map +1 -1
  158. package/build/index.js +8 -0
  159. package/build/index.js.map +1 -1
  160. package/build/store/actions.js +5 -3
  161. package/build/store/actions.js.map +1 -1
  162. package/build/utils/is-previewing-theme.js +27 -0
  163. package/build/utils/is-previewing-theme.js.map +1 -0
  164. package/build/utils/use-activate-theme.js +46 -0
  165. package/build/utils/use-activate-theme.js.map +1 -0
  166. package/build-module/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +8 -20
  167. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
  168. package/build-module/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +34 -28
  169. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
  170. package/build-module/components/add-new-template/new-template-part.js +5 -1
  171. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  172. package/build-module/components/add-new-template/new-template.js +102 -68
  173. package/build-module/components/add-new-template/new-template.js.map +1 -1
  174. package/build-module/components/app/index.js +6 -2
  175. package/build-module/components/app/index.js.map +1 -1
  176. package/build-module/components/block-editor/back-button.js +6 -1
  177. package/build-module/components/block-editor/back-button.js.map +1 -1
  178. package/build-module/components/block-editor/editor-canvas.js +37 -6
  179. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  180. package/build-module/components/block-editor/index.js +1 -3
  181. package/build-module/components/block-editor/index.js.map +1 -1
  182. package/build-module/components/create-template-part-modal/index.js +7 -8
  183. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  184. package/build-module/components/editor/index.js +18 -11
  185. package/build-module/components/editor/index.js.map +1 -1
  186. package/build-module/components/editor-canvas-container/index.js +27 -8
  187. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  188. package/build-module/components/global-styles/block-preview-panel.js +1 -1
  189. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  190. package/build-module/components/global-styles/color-palette-panel.js +13 -3
  191. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  192. package/build-module/components/global-styles/dimensions-panel.js +17 -18
  193. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  194. package/build-module/components/global-styles/gradients-palette-panel.js +13 -3
  195. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  196. package/build-module/components/global-styles/root-menu.js +47 -0
  197. package/build-module/components/global-styles/root-menu.js.map +1 -0
  198. package/build-module/components/global-styles/screen-block-list.js +4 -2
  199. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  200. package/build-module/components/global-styles/screen-block.js +229 -7
  201. package/build-module/components/global-styles/screen-block.js.map +1 -1
  202. package/build-module/components/global-styles/screen-colors.js +9 -25
  203. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  204. package/build-module/components/global-styles/screen-css.js +20 -15
  205. package/build-module/components/global-styles/screen-css.js.map +1 -1
  206. package/build-module/components/global-styles/screen-layout.js +4 -16
  207. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  208. package/build-module/components/global-styles/screen-revisions/index.js +121 -0
  209. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -0
  210. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +118 -0
  211. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
  212. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +107 -0
  213. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
  214. package/build-module/components/global-styles/screen-root.js +6 -6
  215. package/build-module/components/global-styles/screen-root.js.map +1 -1
  216. package/build-module/components/global-styles/screen-typography-element.js +0 -3
  217. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  218. package/build-module/components/global-styles/screen-typography.js +11 -37
  219. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  220. package/build-module/components/global-styles/style-variations-container.js +10 -18
  221. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  222. package/build-module/components/global-styles/typography-panel.js +7 -11
  223. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  224. package/build-module/components/global-styles/ui.js +71 -115
  225. package/build-module/components/global-styles/ui.js.map +1 -1
  226. package/build-module/components/global-styles/variations-panel.js +3 -22
  227. package/build-module/components/global-styles/variations-panel.js.map +1 -1
  228. package/build-module/components/header-edit-mode/document-actions/index.js +31 -107
  229. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  230. package/build-module/components/header-edit-mode/index.js +16 -4
  231. package/build-module/components/header-edit-mode/index.js.map +1 -1
  232. package/build-module/components/keyboard-shortcuts/register.js +1 -1
  233. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  234. package/build-module/components/layout/hooks.js +41 -0
  235. package/build-module/components/layout/hooks.js.map +1 -0
  236. package/build-module/components/layout/index.js +53 -102
  237. package/build-module/components/layout/index.js.map +1 -1
  238. package/build-module/components/list/actions/index.js +6 -3
  239. package/build-module/components/list/actions/index.js.map +1 -1
  240. package/build-module/components/list/index.js +5 -1
  241. package/build-module/components/list/index.js.map +1 -1
  242. package/build-module/components/list/table.js +1 -1
  243. package/build-module/components/list/table.js.map +1 -1
  244. package/build-module/components/plugin-template-setting-panel/index.js +35 -0
  245. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -0
  246. package/build-module/components/resizable-frame/index.js +228 -0
  247. package/build-module/components/resizable-frame/index.js.map +1 -0
  248. package/build-module/components/revisions/index.js +78 -0
  249. package/build-module/components/revisions/index.js.map +1 -0
  250. package/build-module/components/routes/link.js +13 -1
  251. package/build-module/components/routes/link.js.map +1 -1
  252. package/build-module/components/routes/use-title.js +5 -1
  253. package/build-module/components/routes/use-title.js.map +1 -1
  254. package/build-module/components/save-button/index.js +28 -6
  255. package/build-module/components/save-button/index.js.map +1 -1
  256. package/build-module/components/save-hub/index.js +13 -32
  257. package/build-module/components/save-hub/index.js.map +1 -1
  258. package/build-module/components/save-panel/index.js +19 -7
  259. package/build-module/components/save-panel/index.js.map +1 -1
  260. package/build-module/components/secondary-sidebar/list-view-sidebar.js +6 -11
  261. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  262. package/build-module/components/sidebar/index.js +14 -4
  263. package/build-module/components/sidebar/index.js.map +1 -1
  264. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +9 -3
  265. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  266. package/build-module/components/sidebar-edit-mode/index.js +10 -5
  267. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  268. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +29 -0
  269. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
  270. package/build-module/components/sidebar-edit-mode/template-card/index.js +2 -7
  271. package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
  272. package/build-module/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +2 -2
  273. package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
  274. package/build-module/components/sidebar-navigation-item/index.js +6 -8
  275. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  276. package/build-module/components/sidebar-navigation-screen/index.js +13 -5
  277. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  278. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +70 -14
  279. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  280. package/build-module/components/sidebar-navigation-screen-main/index.js +30 -24
  281. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  282. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  283. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  284. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +141 -0
  285. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
  286. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +10 -0
  287. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
  288. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +52 -93
  289. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  290. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +71 -0
  291. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
  292. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +13 -72
  293. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  294. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +40 -0
  295. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
  296. package/build-module/components/sidebar-navigation-screen-page/index.js +48 -0
  297. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -0
  298. package/build-module/components/sidebar-navigation-screen-pages/index.js +57 -0
  299. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -0
  300. package/build-module/components/sidebar-navigation-screen-templates/index.js +38 -12
  301. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  302. package/build-module/components/sidebar-navigation-subtitle/index.js +10 -0
  303. package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -0
  304. package/build-module/components/site-hub/index.js +32 -6
  305. package/build-module/components/site-hub/index.js.map +1 -1
  306. package/build-module/components/start-template-options/index.js +13 -17
  307. package/build-module/components/start-template-options/index.js.map +1 -1
  308. package/build-module/components/style-book/index.js +93 -20
  309. package/build-module/components/style-book/index.js.map +1 -1
  310. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -1
  311. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  312. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -1
  313. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  314. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +13 -1
  315. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  316. package/build-module/components/use-edited-entity-record/index.js +8 -4
  317. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  318. package/build-module/hooks/commands/use-edit-mode-commands.js +86 -0
  319. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -0
  320. package/build-module/hooks/template-part-edit.js +5 -1
  321. package/build-module/hooks/template-part-edit.js.map +1 -1
  322. package/build-module/index.js +1 -0
  323. package/build-module/index.js.map +1 -1
  324. package/build-module/store/actions.js +5 -3
  325. package/build-module/store/actions.js.map +1 -1
  326. package/build-module/utils/is-previewing-theme.js +17 -0
  327. package/build-module/utils/is-previewing-theme.js.map +1 -0
  328. package/build-module/utils/use-activate-theme.js +36 -0
  329. package/build-module/utils/use-activate-theme.js.map +1 -0
  330. package/build-style/style-rtl.css +409 -265
  331. package/build-style/style.css +410 -265
  332. package/package.json +37 -35
  333. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +82 -0
  334. package/src/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +44 -34
  335. package/src/components/add-new-template/new-template-part.js +4 -1
  336. package/src/components/add-new-template/new-template.js +142 -154
  337. package/src/components/add-new-template/style.scss +120 -103
  338. package/src/components/app/index.js +6 -3
  339. package/src/components/block-editor/back-button.js +4 -1
  340. package/src/components/block-editor/editor-canvas.js +36 -8
  341. package/src/components/block-editor/index.js +2 -3
  342. package/src/components/block-editor/style.scss +15 -8
  343. package/src/components/create-template-part-modal/index.js +19 -25
  344. package/src/components/editor/index.js +20 -8
  345. package/src/components/editor/style.scss +21 -6
  346. package/src/components/editor-canvas-container/index.js +43 -21
  347. package/src/components/global-styles/block-preview-panel.js +1 -1
  348. package/src/components/global-styles/color-palette-panel.js +9 -0
  349. package/src/components/global-styles/dimensions-panel.js +15 -15
  350. package/src/components/global-styles/gradients-palette-panel.js +8 -0
  351. package/src/components/global-styles/root-menu.js +66 -0
  352. package/src/components/global-styles/screen-block-list.js +2 -2
  353. package/src/components/global-styles/screen-block.js +255 -7
  354. package/src/components/global-styles/screen-colors.js +9 -16
  355. package/src/components/global-styles/screen-css.js +21 -21
  356. package/src/components/global-styles/screen-layout.js +5 -9
  357. package/src/components/global-styles/screen-revisions/index.js +169 -0
  358. package/src/components/global-styles/screen-revisions/revisions-buttons.js +139 -0
  359. package/src/components/global-styles/screen-revisions/style.scss +100 -0
  360. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +138 -0
  361. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +99 -0
  362. package/src/components/global-styles/screen-root.js +7 -5
  363. package/src/components/global-styles/screen-typography-element.js +1 -3
  364. package/src/components/global-styles/screen-typography.js +44 -79
  365. package/src/components/global-styles/style-variations-container.js +17 -28
  366. package/src/components/global-styles/style.scss +4 -23
  367. package/src/components/global-styles/typography-panel.js +12 -13
  368. package/src/components/global-styles/ui.js +83 -110
  369. package/src/components/global-styles/variations-panel.js +3 -26
  370. package/src/components/header-edit-mode/document-actions/index.js +26 -129
  371. package/src/components/header-edit-mode/document-actions/style.scss +28 -59
  372. package/src/components/header-edit-mode/index.js +23 -2
  373. package/src/components/header-edit-mode/style.scss +1 -0
  374. package/src/components/keyboard-shortcuts/register.js +1 -1
  375. package/src/components/layout/hooks.js +46 -0
  376. package/src/components/layout/index.js +60 -125
  377. package/src/components/layout/style.scss +9 -5
  378. package/src/components/list/actions/index.js +12 -5
  379. package/src/components/list/index.js +4 -1
  380. package/src/components/list/style.scss +5 -0
  381. package/src/components/list/table.js +3 -1
  382. package/src/components/plugin-template-setting-panel/index.js +33 -0
  383. package/src/components/resizable-frame/index.js +253 -0
  384. package/src/components/resizable-frame/style.scss +69 -0
  385. package/src/components/revisions/index.js +105 -0
  386. package/src/components/routes/link.js +16 -1
  387. package/src/components/routes/use-title.js +4 -1
  388. package/src/components/save-button/index.js +27 -6
  389. package/src/components/save-hub/index.js +17 -35
  390. package/src/components/save-panel/index.js +15 -3
  391. package/src/components/secondary-sidebar/list-view-sidebar.js +4 -7
  392. package/src/components/sidebar/index.js +15 -4
  393. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +9 -7
  394. package/src/components/sidebar-edit-mode/index.js +17 -6
  395. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +26 -0
  396. package/src/components/sidebar-edit-mode/style.scss +10 -0
  397. package/src/components/sidebar-edit-mode/template-card/index.js +1 -9
  398. package/src/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -2
  399. package/src/components/sidebar-navigation-item/index.js +13 -14
  400. package/src/components/sidebar-navigation-item/style.scss +17 -1
  401. package/src/components/sidebar-navigation-screen/index.js +26 -5
  402. package/src/components/sidebar-navigation-screen/style.scss +1 -2
  403. package/src/components/sidebar-navigation-screen-global-styles/index.js +106 -21
  404. package/src/components/sidebar-navigation-screen-main/index.js +39 -35
  405. package/src/components/sidebar-navigation-screen-navigation-item/index.js +3 -9
  406. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +157 -0
  407. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +9 -0
  408. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +63 -105
  409. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +83 -0
  410. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +8 -74
  411. package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +47 -0
  412. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +6 -20
  413. package/src/components/sidebar-navigation-screen-page/index.js +59 -0
  414. package/src/components/sidebar-navigation-screen-pages/index.js +82 -0
  415. package/src/components/sidebar-navigation-screen-pages/style.scss +4 -0
  416. package/src/components/sidebar-navigation-screen-templates/index.js +57 -14
  417. package/src/components/sidebar-navigation-subtitle/index.js +5 -0
  418. package/src/components/sidebar-navigation-subtitle/style.scss +7 -0
  419. package/src/components/site-hub/index.js +88 -58
  420. package/src/components/site-hub/style.scss +8 -0
  421. package/src/components/start-template-options/index.js +19 -27
  422. package/src/components/start-template-options/style.scss +28 -21
  423. package/src/components/style-book/index.js +132 -43
  424. package/src/components/style-book/style.scss +19 -0
  425. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
  426. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -1
  427. package/src/components/sync-state-with-url/use-sync-path-with-url.js +14 -1
  428. package/src/components/use-edited-entity-record/index.js +12 -3
  429. package/src/hooks/commands/use-edit-mode-commands.js +79 -0
  430. package/src/hooks/template-part-edit.js +4 -1
  431. package/src/index.js +1 -0
  432. package/src/store/actions.js +4 -5
  433. package/src/store/test/actions.js +6 -14
  434. package/src/store/test/utils.js +15 -5
  435. package/src/style.scss +5 -2
  436. package/src/utils/is-previewing-theme.js +18 -0
  437. package/src/utils/use-activate-theme.js +38 -0
  438. package/build/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
  439. package/build/components/add-new-template/add-custom-template-modal.js.map +0 -1
  440. package/build/components/global-styles/border-panel.js +0 -133
  441. package/build/components/global-styles/border-panel.js.map +0 -1
  442. package/build/components/global-styles/context-menu.js +0 -126
  443. package/build/components/global-styles/context-menu.js.map +0 -1
  444. package/build/components/global-styles/custom-css.js +0 -113
  445. package/build/components/global-styles/custom-css.js.map +0 -1
  446. package/build/components/global-styles/effects-panel.js +0 -53
  447. package/build/components/global-styles/effects-panel.js.map +0 -1
  448. package/build/components/global-styles/filters-panel.js +0 -50
  449. package/build/components/global-styles/filters-panel.js.map +0 -1
  450. package/build/components/global-styles/screen-border.js +0 -61
  451. package/build/components/global-styles/screen-border.js.map +0 -1
  452. package/build/components/global-styles/screen-effects.js +0 -61
  453. package/build/components/global-styles/screen-effects.js.map +0 -1
  454. package/build/components/global-styles/screen-filters.js +0 -46
  455. package/build/components/global-styles/screen-filters.js.map +0 -1
  456. package/build/components/global-styles/screen-variations.js +0 -71
  457. package/build/components/global-styles/screen-variations.js.map +0 -1
  458. package/build/components/navigate-to-link/index.js +0 -51
  459. package/build/components/navigate-to-link/index.js.map +0 -1
  460. package/build/components/routes/index.js +0 -60
  461. package/build/components/routes/index.js.map +0 -1
  462. package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
  463. package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -19
  464. package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
  465. package/build/components/template-details/edit-template-title.js +0 -42
  466. package/build/components/template-details/edit-template-title.js.map +0 -1
  467. package/build/components/template-details/index.js +0 -103
  468. package/build/components/template-details/index.js.map +0 -1
  469. package/build/components/template-details/template-areas.js +0 -160
  470. package/build/components/template-details/template-areas.js.map +0 -1
  471. package/build/components/template-details/template-part-area-selector.js +0 -48
  472. package/build/components/template-details/template-part-area-selector.js.map +0 -1
  473. package/build/hooks/commands/index.js +0 -19
  474. package/build/hooks/commands/index.js.map +0 -1
  475. package/build/hooks/commands/use-navigation-commands.js +0 -126
  476. package/build/hooks/commands/use-navigation-commands.js.map +0 -1
  477. package/build/hooks/commands/use-wp-admin-commands.js +0 -97
  478. package/build/hooks/commands/use-wp-admin-commands.js.map +0 -1
  479. package/build/utils/history.js +0 -41
  480. package/build/utils/history.js.map +0 -1
  481. package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
  482. package/build-module/components/add-new-template/add-custom-template-modal.js.map +0 -1
  483. package/build-module/components/global-styles/border-panel.js +0 -123
  484. package/build-module/components/global-styles/border-panel.js.map +0 -1
  485. package/build-module/components/global-styles/context-menu.js +0 -107
  486. package/build-module/components/global-styles/context-menu.js.map +0 -1
  487. package/build-module/components/global-styles/custom-css.js +0 -98
  488. package/build-module/components/global-styles/custom-css.js.map +0 -1
  489. package/build-module/components/global-styles/effects-panel.js +0 -43
  490. package/build-module/components/global-styles/effects-panel.js.map +0 -1
  491. package/build-module/components/global-styles/filters-panel.js +0 -40
  492. package/build-module/components/global-styles/filters-panel.js.map +0 -1
  493. package/build-module/components/global-styles/screen-border.js +0 -44
  494. package/build-module/components/global-styles/screen-border.js.map +0 -1
  495. package/build-module/components/global-styles/screen-effects.js +0 -44
  496. package/build-module/components/global-styles/screen-effects.js.map +0 -1
  497. package/build-module/components/global-styles/screen-filters.js +0 -33
  498. package/build-module/components/global-styles/screen-filters.js.map +0 -1
  499. package/build-module/components/global-styles/screen-variations.js +0 -54
  500. package/build-module/components/global-styles/screen-variations.js.map +0 -1
  501. package/build-module/components/navigate-to-link/index.js +0 -39
  502. package/build-module/components/navigate-to-link/index.js.map +0 -1
  503. package/build-module/components/routes/index.js +0 -47
  504. package/build-module/components/routes/index.js.map +0 -1
  505. package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
  506. package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -11
  507. package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
  508. package/build-module/components/template-details/edit-template-title.js +0 -33
  509. package/build-module/components/template-details/edit-template-title.js.map +0 -1
  510. package/build-module/components/template-details/index.js +0 -83
  511. package/build-module/components/template-details/index.js.map +0 -1
  512. package/build-module/components/template-details/template-areas.js +0 -141
  513. package/build-module/components/template-details/template-areas.js.map +0 -1
  514. package/build-module/components/template-details/template-part-area-selector.js +0 -36
  515. package/build-module/components/template-details/template-part-area-selector.js.map +0 -1
  516. package/build-module/hooks/commands/index.js +0 -10
  517. package/build-module/hooks/commands/index.js.map +0 -1
  518. package/build-module/hooks/commands/use-navigation-commands.js +0 -109
  519. package/build-module/hooks/commands/use-navigation-commands.js.map +0 -1
  520. package/build-module/hooks/commands/use-wp-admin-commands.js +0 -81
  521. package/build-module/hooks/commands/use-wp-admin-commands.js.map +0 -1
  522. package/build-module/utils/history.js +0 -31
  523. package/build-module/utils/history.js.map +0 -1
  524. package/src/components/add-new-template/add-custom-generic-template-modal.js +0 -101
  525. package/src/components/global-styles/border-panel.js +0 -112
  526. package/src/components/global-styles/context-menu.js +0 -175
  527. package/src/components/global-styles/custom-css.js +0 -131
  528. package/src/components/global-styles/effects-panel.js +0 -40
  529. package/src/components/global-styles/filters-panel.js +0 -39
  530. package/src/components/global-styles/screen-border.js +0 -35
  531. package/src/components/global-styles/screen-effects.js +0 -35
  532. package/src/components/global-styles/screen-filters.js +0 -27
  533. package/src/components/global-styles/screen-variations.js +0 -46
  534. package/src/components/navigate-to-link/index.js +0 -46
  535. package/src/components/routes/index.js +0 -53
  536. package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -9
  537. package/src/components/template-details/edit-template-title.js +0 -41
  538. package/src/components/template-details/index.js +0 -113
  539. package/src/components/template-details/style.scss +0 -72
  540. package/src/components/template-details/template-areas.js +0 -164
  541. package/src/components/template-details/template-part-area-selector.js +0 -39
  542. package/src/hooks/commands/index.js +0 -10
  543. package/src/hooks/commands/use-navigation-commands.js +0 -112
  544. package/src/hooks/commands/use-wp-admin-commands.js +0 -79
  545. package/src/utils/history.js +0 -39
@@ -34,20 +34,18 @@ function SidebarNavigationItem(_ref) {
34
34
  } = _ref;
35
35
  return (0, _element.createElement)(_components.__experimentalItem, (0, _extends2.default)({
36
36
  className: (0, _classnames.default)('edit-site-sidebar-navigation-item', className)
37
- }, props), icon && (0, _element.createElement)(_components.__experimentalHStack, {
37
+ }, props), (0, _element.createElement)(_components.__experimentalHStack, {
38
38
  justify: "flex-start"
39
- }, (0, _element.createElement)(_icons.Icon, {
39
+ }, icon && (0, _element.createElement)(_icons.Icon, {
40
40
  style: {
41
41
  fill: 'currentcolor'
42
42
  },
43
43
  icon: icon,
44
44
  size: 24
45
45
  }), (0, _element.createElement)(_components.FlexBlock, null, children), withChevron && (0, _element.createElement)(_icons.Icon, {
46
- style: {
47
- fill: 'currentcolor'
48
- },
49
- icon: _icons.chevronRight,
46
+ icon: _icons.chevronRightSmall,
47
+ className: "edit-site-sidebar-navigation-item__drilldown-indicator",
50
48
  size: 24
51
- })), !icon && children);
49
+ })));
52
50
  }
53
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"names":["SidebarNavigationItem","className","icon","withChevron","children","props","fill","chevronRight"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;AAQe,SAASA,qBAAT,OAMX;AAAA,MAN2C;AAC9CC,IAAAA,SAD8C;AAE9CC,IAAAA,IAF8C;AAG9CC,IAAAA,WAAW,GAAG,KAHgC;AAI9CC,IAAAA,QAJ8C;AAK9C,OAAGC;AAL2C,GAM3C;AACH,SACC,4BAAC,8BAAD;AACC,IAAA,SAAS,EAAG,yBACX,mCADW,EAEXJ,SAFW;AADb,KAKMI,KALN,GAOGH,IAAI,IACL,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,WAAD;AACC,IAAA,KAAK,EAAG;AAAEI,MAAAA,IAAI,EAAE;AAAR,KADT;AAEC,IAAA,IAAI,EAAGJ,IAFR;AAGC,IAAA,IAAI,EAAG;AAHR,IADD,EAMC,4BAAC,qBAAD,QAAaE,QAAb,CAND,EAOGD,WAAW,IACZ,4BAAC,WAAD;AACC,IAAA,KAAK,EAAG;AAAEG,MAAAA,IAAI,EAAE;AAAR,KADT;AAEC,IAAA,IAAI,EAAGC,mBAFR;AAGC,IAAA,IAAI,EAAG;AAHR,IARF,CARF,EAwBG,CAAEL,IAAF,IAAUE,QAxBb,CADD;AA4BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { chevronRight, Icon } from '@wordpress/icons';\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tchildren,\n\t...props\n} ) {\n\treturn (\n\t\t<Item\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ icon && (\n\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t\t{ withChevron && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\t\ticon={ chevronRight }\n\t\t\t\t\t\t\tsize={ 24 }\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\t{ ! icon && children }\n\t\t</Item>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-item/index.js"],"names":["SidebarNavigationItem","className","icon","withChevron","children","props","fill","chevronRightSmall"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;AAQe,SAASA,qBAAT,OAMX;AAAA,MAN2C;AAC9CC,IAAAA,SAD8C;AAE9CC,IAAAA,IAF8C;AAG9CC,IAAAA,WAAW,GAAG,KAHgC;AAI9CC,IAAAA,QAJ8C;AAK9C,OAAGC;AAL2C,GAM3C;AACH,SACC,4BAAC,8BAAD;AACC,IAAA,SAAS,EAAG,yBACX,mCADW,EAEXJ,SAFW;AADb,KAKMI,KALN,GAOC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACGH,IAAI,IACL,4BAAC,WAAD;AACC,IAAA,KAAK,EAAG;AAAEI,MAAAA,IAAI,EAAE;AAAR,KADT;AAEC,IAAA,IAAI,EAAGJ,IAFR;AAGC,IAAA,IAAI,EAAG;AAHR,IAFF,EAQC,4BAAC,qBAAD,QAAaE,QAAb,CARD,EASGD,WAAW,IACZ,4BAAC,WAAD;AACC,IAAA,IAAI,EAAGI,wBADR;AAEC,IAAA,SAAS,EAAC,wDAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAVF,CAPD,CADD;AA2BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n} from '@wordpress/components';\nimport { chevronRightSmall, Icon } from '@wordpress/icons';\n\nexport default function SidebarNavigationItem( {\n\tclassName,\n\ticon,\n\twithChevron = false,\n\tchildren,\n\t...props\n} ) {\n\treturn (\n\t\t<Item\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-item',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t{ icon && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tstyle={ { fill: 'currentcolor' } }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t{ withChevron && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-item__drilldown-indicator\"\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</Item>\n\t);\n}\n"]}
@@ -15,6 +15,8 @@ var _i18n = require("@wordpress/i18n");
15
15
 
16
16
  var _icons = require("@wordpress/icons");
17
17
 
18
+ var _coreData = require("@wordpress/core-data");
19
+
18
20
  var _data = require("@wordpress/data");
19
21
 
20
22
  var _store = require("../../store");
@@ -23,6 +25,8 @@ var _privateApis = require("../../private-apis");
23
25
 
24
26
  var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
25
27
 
28
+ var _isPreviewingTheme = require("../../utils/is-previewing-theme");
29
+
26
30
  /**
27
31
  * WordPress dependencies
28
32
  */
@@ -31,6 +35,8 @@ var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
31
35
  * Internal dependencies
32
36
  */
33
37
  function SidebarNavigationScreen(_ref) {
38
+ var _theme$name;
39
+
34
40
  let {
35
41
  isRoot,
36
42
  title,
@@ -48,6 +54,10 @@ function SidebarNavigationScreen(_ref) {
48
54
  dashboardLink: getSettings().__experimentalDashboardLink
49
55
  };
50
56
  }, []);
57
+ const {
58
+ getTheme
59
+ } = (0, _data.useSelect)(_coreData.store);
60
+ const theme = getTheme((0, _isPreviewingTheme.currentlyPreviewingTheme)());
51
61
  return (0, _element.createElement)(_components.__experimentalVStack, {
52
62
  spacing: 2
53
63
  }, (0, _element.createElement)(_components.__experimentalHStack, {
@@ -57,17 +67,17 @@ function SidebarNavigationScreen(_ref) {
57
67
  }, !isRoot ? (0, _element.createElement)(_components.__experimentalNavigatorToParentButton, {
58
68
  as: _sidebarButton.default,
59
69
  icon: (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft,
60
- "aria-label": (0, _i18n.__)('Back')
70
+ label: (0, _i18n.__)('Back')
61
71
  }) : (0, _element.createElement)(_sidebarButton.default, {
62
72
  icon: (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft,
63
- label: (0, _i18n.__)('Go back to the Dashboard'),
64
- href: dashboardLink || 'index.php'
73
+ label: !(0, _isPreviewingTheme.isPreviewingTheme)() ? (0, _i18n.__)('Go back to the Dashboard') : (0, _i18n.__)('Go back to the theme showcase'),
74
+ href: !(0, _isPreviewingTheme.isPreviewingTheme)() ? dashboardLink || 'index.php' : 'themes.php'
65
75
  }), (0, _element.createElement)(_components.__experimentalHeading, {
66
76
  className: "edit-site-sidebar-navigation-screen__title",
67
77
  color: 'white',
68
78
  level: 2,
69
79
  size: 20
70
- }, title), actions), (0, _element.createElement)("nav", {
80
+ }, !(0, _isPreviewingTheme.isPreviewingTheme)() ? title : (0, _i18n.sprintf)('Previewing %1$s: %2$s', theme === null || theme === void 0 ? void 0 : (_theme$name = theme.name) === null || _theme$name === void 0 ? void 0 : _theme$name.rendered, title)), actions), (0, _element.createElement)("nav", {
71
81
  className: "edit-site-sidebar-navigation-screen__content"
72
82
  }, description && (0, _element.createElement)("p", {
73
83
  className: "edit-site-sidebar-navigation-screen__description"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","isRoot","title","actions","content","description","dashboardLink","select","getSettings","editSiteStore","__experimentalDashboardLink","SidebarButton","chevronRight","chevronLeft"],"mappings":";;;;;;;;;;;AAGA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAWA;AACA;AACA;AAKe,SAASA,uBAAT,OAMX;AAAA,MAN6C;AAChDC,IAAAA,MADgD;AAEhDC,IAAAA,KAFgD;AAGhDC,IAAAA,OAHgD;AAIhDC,IAAAA,OAJgD;AAKhDC,IAAAA;AALgD,GAM7C;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoB,qBAAaC,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAkB,yBAAQD,MAAM,CAAEE,YAAF,CAAd,CAAxB;AACA,WAAO;AACNH,MAAAA,aAAa,EAAEE,WAAW,GAAGE;AADvB,KAAP;AAGA,GALyB,EAKvB,EALuB,CAA1B;AAOA,SACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gCAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAC,YAFX;AAGC,IAAA,SAAS,EAAC;AAHX,KAKG,CAAET,MAAF,GACD,4BAAC,iDAAD;AACC,IAAA,EAAE,EAAGU,sBADN;AAEC,IAAA,IAAI,EAAG,qBAAUC,mBAAV,GAAyBC,kBAFjC;AAGC,kBAAa,cAAI,MAAJ;AAHd,IADC,GAOD,4BAAC,sBAAD;AACC,IAAA,IAAI,EAAG,qBAAUD,mBAAV,GAAyBC,kBADjC;AAEC,IAAA,KAAK,EAAG,cAAI,0BAAJ,CAFT;AAGC,IAAA,IAAI,EAAGP,aAAa,IAAI;AAHzB,IAZF,EAkBC,4BAAC,iCAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,KAAK,EAAG,OAFT;AAGC,IAAA,KAAK,EAAG,CAHT;AAIC,IAAA,IAAI,EAAG;AAJR,KAMGJ,KANH,CAlBD,EA0BGC,OA1BH,CADD,EA8BC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGE,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CAFF,EAMGD,OANH,CA9BD,CADD;AAyCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\nimport SidebarButton from '../sidebar-button';\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tcontent,\n\tdescription,\n} ) {\n\tconst { dashboardLink } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack\n\t\t\t\tspacing={ 4 }\n\t\t\t\talignment=\"flex-start\"\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t>\n\t\t\t\t{ ! isRoot ? (\n\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\tas={ SidebarButton }\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\taria-label={ __( 'Back' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\tlabel={ __( 'Go back to the Dashboard' ) }\n\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<Heading\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\tcolor={ 'white' }\n\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\tsize={ 20 }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\t\t\t\t{ actions }\n\t\t\t</HStack>\n\n\t\t\t<nav className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t{ description && (\n\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ content }\n\t\t\t</nav>\n\t\t</VStack>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","isRoot","title","actions","content","description","dashboardLink","select","getSettings","editSiteStore","__experimentalDashboardLink","getTheme","coreStore","theme","SidebarButton","chevronRight","chevronLeft","name","rendered"],"mappings":";;;;;;;;;;;AAGA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAYA;AACA;AACA;AASe,SAASA,uBAAT,OAMX;AAAA;;AAAA,MAN6C;AAChDC,IAAAA,MADgD;AAEhDC,IAAAA,KAFgD;AAGhDC,IAAAA,OAHgD;AAIhDC,IAAAA,OAJgD;AAKhDC,IAAAA;AALgD,GAM7C;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoB,qBAAaC,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAkB,yBAAQD,MAAM,CAAEE,YAAF,CAAd,CAAxB;AACA,WAAO;AACNH,MAAAA,aAAa,EAAEE,WAAW,GAAGE;AADvB,KAAP;AAGA,GALyB,EAKvB,EALuB,CAA1B;AAMA,QAAM;AAAEC,IAAAA;AAAF,MAAe,qBAAWC,eAAX,CAArB;AACA,QAAMC,KAAK,GAAGF,QAAQ,CAAE,kDAAF,CAAtB;AAEA,SACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gCAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAC,YAFX;AAGC,IAAA,SAAS,EAAC;AAHX,KAKG,CAAEV,MAAF,GACD,4BAAC,iDAAD;AACC,IAAA,EAAE,EAAGa,sBADN;AAEC,IAAA,IAAI,EAAG,qBAAUC,mBAAV,GAAyBC,kBAFjC;AAGC,IAAA,KAAK,EAAG,cAAI,MAAJ;AAHT,IADC,GAOD,4BAAC,sBAAD;AACC,IAAA,IAAI,EAAG,qBAAUD,mBAAV,GAAyBC,kBADjC;AAEC,IAAA,KAAK,EACJ,CAAE,2CAAF,GACG,cAAI,0BAAJ,CADH,GAEG,cAAI,+BAAJ,CALL;AAOC,IAAA,IAAI,EACH,CAAE,2CAAF,GACGV,aAAa,IAAI,WADpB,GAEG;AAVL,IAZF,EA0BC,4BAAC,iCAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,KAAK,EAAG,OAFT;AAGC,IAAA,KAAK,EAAG,CAHT;AAIC,IAAA,IAAI,EAAG;AAJR,KAMG,CAAE,2CAAF,GACCJ,KADD,GAEC,mBACA,uBADA,EAEAW,KAFA,aAEAA,KAFA,sCAEAA,KAAK,CAAEI,IAFP,gDAEA,YAAaC,QAFb,EAGAhB,KAHA,CARJ,CA1BD,EAwCGC,OAxCH,CADD,EA4CC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGE,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CAFF,EAMGD,OANH,CA5CD,CADD;AAuDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tcontent,\n\tdescription,\n} ) {\n\tconst { dashboardLink } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t};\n\t}, [] );\n\tconst { getTheme } = useSelect( coreStore );\n\tconst theme = getTheme( currentlyPreviewingTheme() );\n\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack\n\t\t\t\tspacing={ 4 }\n\t\t\t\talignment=\"flex-start\"\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t>\n\t\t\t\t{ ! isRoot ? (\n\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\tas={ SidebarButton }\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t! isPreviewingTheme()\n\t\t\t\t\t\t\t\t? __( 'Go back to the Dashboard' )\n\t\t\t\t\t\t\t\t: __( 'Go back to the theme showcase' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t! isPreviewingTheme()\n\t\t\t\t\t\t\t\t? dashboardLink || 'index.php'\n\t\t\t\t\t\t\t\t: 'themes.php'\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<Heading\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\tcolor={ 'white' }\n\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\tsize={ 20 }\n\t\t\t\t>\n\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t? title\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t'Previewing %1$s: %2$s',\n\t\t\t\t\t\t\t\ttheme?.name?.rendered,\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t ) }\n\t\t\t\t</Heading>\n\t\t\t\t{ actions }\n\t\t\t</HStack>\n\n\t\t\t<nav className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t{ description && (\n\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ content }\n\t\t\t</nav>\n\t\t</VStack>\n\t);\n}\n"]}
@@ -5,16 +5,25 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ exports.SidebarNavigationItemGlobalStyles = SidebarNavigationItemGlobalStyles;
8
9
  exports.default = SidebarNavigationScreenGlobalStyles;
9
10
 
10
11
  var _element = require("@wordpress/element");
11
12
 
13
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
+
12
15
  var _i18n = require("@wordpress/i18n");
13
16
 
14
17
  var _icons = require("@wordpress/icons");
15
18
 
16
19
  var _data = require("@wordpress/data");
17
20
 
21
+ var _coreData = require("@wordpress/core-data");
22
+
23
+ var _components = require("@wordpress/components");
24
+
25
+ var _compose = require("@wordpress/compose");
26
+
18
27
  var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
19
28
 
20
29
  var _styleVariationsContainer = _interopRequireDefault(require("../global-styles/style-variations-container"));
@@ -25,6 +34,10 @@ var _store = require("../../store");
25
34
 
26
35
  var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
27
36
 
37
+ var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
38
+
39
+ var _styleBook = _interopRequireDefault(require("../style-book"));
40
+
28
41
  /**
29
42
  * WordPress dependencies
30
43
  */
@@ -32,27 +45,78 @@ var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
32
45
  /**
33
46
  * Internal dependencies
34
47
  */
35
- function SidebarNavigationScreenGlobalStyles() {
48
+ function SidebarNavigationItemGlobalStyles(props) {
36
49
  const {
37
50
  openGeneralSidebar
38
51
  } = (0, _data.useDispatch)(_store.store);
39
52
  const {
40
53
  setCanvasMode
41
54
  } = (0, _privateApis.unlock)((0, _data.useDispatch)(_store.store));
42
- return (0, _element.createElement)(_sidebarNavigationScreen.default, {
55
+ const hasGlobalStyleVariations = (0, _data.useSelect)(select => {
56
+ var _select$__experimenta;
57
+
58
+ return !!((_select$__experimenta = select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations()) !== null && _select$__experimenta !== void 0 && _select$__experimenta.length);
59
+ }, []);
60
+
61
+ if (hasGlobalStyleVariations) {
62
+ return (0, _element.createElement)(_components.__experimentalNavigatorButton, (0, _extends2.default)({}, props, {
63
+ as: _sidebarNavigationItem.default,
64
+ path: "/wp_global_styles"
65
+ }));
66
+ }
67
+
68
+ return (0, _element.createElement)(_sidebarNavigationItem.default, (0, _extends2.default)({}, props, {
69
+ onClick: () => {
70
+ // switch to edit mode.
71
+ setCanvasMode('edit'); // open global styles sidebar.
72
+
73
+ openGeneralSidebar('edit-site/global-styles');
74
+ }
75
+ }));
76
+ }
77
+
78
+ function SidebarNavigationScreenGlobalStyles() {
79
+ const {
80
+ openGeneralSidebar
81
+ } = (0, _data.useDispatch)(_store.store);
82
+ const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
83
+ const {
84
+ setCanvasMode,
85
+ setEditorCanvasContainerView
86
+ } = (0, _privateApis.unlock)((0, _data.useDispatch)(_store.store));
87
+ const isStyleBookOpened = (0, _data.useSelect)(select => 'style-book' === (0, _privateApis.unlock)(select(_store.store)).getEditorCanvasContainerView(), []);
88
+
89
+ const openGlobalStyles = async () => Promise.all([setCanvasMode('edit'), openGeneralSidebar('edit-site/global-styles')]);
90
+
91
+ const openStyleBook = async () => {
92
+ await openGlobalStyles(); // Open the Style Book once the canvas mode is set to edit,
93
+ // and the global styles sidebar is open. This ensures that
94
+ // the Style Book is not prematurely closed.
95
+
96
+ setEditorCanvasContainerView('style-book');
97
+ };
98
+
99
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_sidebarNavigationScreen.default, {
43
100
  title: (0, _i18n.__)('Styles'),
44
101
  description: (0, _i18n.__)('Choose a different style combination for the theme styles.'),
45
102
  content: (0, _element.createElement)(_styleVariationsContainer.default, null),
46
- actions: (0, _element.createElement)(_sidebarButton.default, {
103
+ actions: (0, _element.createElement)("div", null, !isMobileViewport && (0, _element.createElement)(_sidebarButton.default, {
104
+ icon: _icons.seen,
105
+ label: (0, _i18n.__)('Style Book'),
106
+ onClick: () => setEditorCanvasContainerView(!isStyleBookOpened ? 'style-book' : undefined),
107
+ isPressed: isStyleBookOpened
108
+ }), (0, _element.createElement)(_sidebarButton.default, {
47
109
  icon: _icons.edit,
48
110
  label: (0, _i18n.__)('Edit styles'),
49
- onClick: () => {
50
- // switch to edit mode.
51
- setCanvasMode('edit'); // open global styles sidebar.
52
-
53
- openGeneralSidebar('edit-site/global-styles');
54
- }
55
- })
56
- });
111
+ onClick: async () => await openGlobalStyles()
112
+ }))
113
+ }), isStyleBookOpened && !isMobileViewport && (0, _element.createElement)(_styleBook.default, {
114
+ enableResizing: false,
115
+ isSelected: () => false,
116
+ onClick: openStyleBook,
117
+ onSelect: openStyleBook,
118
+ showCloseButton: false,
119
+ showTabs: false
120
+ }));
57
121
  }
58
122
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"names":["SidebarNavigationScreenGlobalStyles","openGeneralSidebar","editSiteStore","setCanvasMode","edit"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAKA;AACA;AACA;AAOe,SAASA,mCAAT,GAA+C;AAC7D,QAAM;AAAEC,IAAAA;AAAF,MAAyB,uBAAaC,YAAb,CAA/B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAoB,yBAAQ,uBAAaD,YAAb,CAAR,CAA1B;AACA,SACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAG,cAAI,QAAJ,CADT;AAEC,IAAA,WAAW,EAAG,cACb,4DADa,CAFf;AAKC,IAAA,OAAO,EAAG,4BAAC,iCAAD,OALX;AAMC,IAAA,OAAO,EACN,4BAAC,sBAAD;AACC,MAAA,IAAI,EAAGE,WADR;AAEC,MAAA,KAAK,EAAG,cAAI,aAAJ,CAFT;AAGC,MAAA,OAAO,EAAG,MAAM;AACf;AACAD,QAAAA,aAAa,CAAE,MAAF,CAAb,CAFe,CAGf;;AACAF,QAAAA,kBAAkB,CAAE,yBAAF,CAAlB;AACA;AARF;AAPF,IADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t) }\n\t\t\tcontent={ <StyleVariationsContainer /> }\n\t\t\tactions={\n\t\t\t\t<SidebarButton\n\t\t\t\t\ticon={ edit }\n\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t// switch to edit mode.\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t\t// open global styles sidebar.\n\t\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"names":["SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","editSiteStore","setCanvasMode","hasGlobalStyleVariations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","SidebarNavigationItem","SidebarNavigationScreenGlobalStyles","isMobileViewport","setEditorCanvasContainerView","isStyleBookOpened","getEditorCanvasContainerView","openGlobalStyles","Promise","all","openStyleBook","seen","undefined","edit"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<NavigatorButton\n\t\t\t\t{ ...props }\n\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\tpath=\"/wp_global_styles\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// switch to edit mode.\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t// open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tconst isStyleBookOpened = useSelect(\n\t\t( select ) =>\n\t\t\t'style-book' ===\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\n\tconst openGlobalStyles = async () =>\n\t\tPromise.all( [\n\t\t\tsetCanvasMode( 'edit' ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\n\tconst openStyleBook = async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tcontent={ <StyleVariationsContainer /> }\n\t\t\t\tactions={\n\t\t\t\t\t<div>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isStyleBookOpened && ! isMobileViewport && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -17,12 +17,18 @@ var _icons = require("@wordpress/icons");
17
17
 
18
18
  var _data = require("@wordpress/data");
19
19
 
20
- var _coreData = require("@wordpress/core-data");
21
-
22
20
  var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
23
21
 
24
22
  var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
25
23
 
24
+ var _sidebarNavigationScreenGlobalStyles = require("../sidebar-navigation-screen-global-styles");
25
+
26
+ var _privateApis = require("../../private-apis");
27
+
28
+ var _store = require("../../store");
29
+
30
+ var _navigatorButton = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus/navigator-button"));
31
+
26
32
  /**
27
33
  * WordPress dependencies
28
34
  */
@@ -31,33 +37,35 @@ var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigati
31
37
  * Internal dependencies
32
38
  */
33
39
  function SidebarNavigationScreenMain() {
34
- const hasNavigationMenus = (0, _data.useSelect)(select => {
35
- // The query needs to be the same as in the "SidebarNavigationScreenNavigationMenus" component,
36
- // to avoid double network calls.
37
- const navigationMenus = select(_coreData.store).getEntityRecords('postType', 'wp_navigation', {
38
- per_page: 1,
39
- status: 'publish',
40
- order: 'desc',
41
- orderby: 'date'
42
- });
43
- return (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 0;
44
- });
45
- const showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN ? hasNavigationMenus : false;
40
+ const editorCanvasContainerView = (0, _data.useSelect)(select => {
41
+ return (0, _privateApis.unlock)(select(_store.store)).getEditorCanvasContainerView();
42
+ }, []);
43
+ const {
44
+ setEditorCanvasContainerView
45
+ } = (0, _privateApis.unlock)((0, _data.useDispatch)(_store.store)); // Clear the editor canvas container view when accessing the main navigation screen.
46
+
47
+ (0, _element.useEffect)(() => {
48
+ if (editorCanvasContainerView) {
49
+ setEditorCanvasContainerView(undefined);
50
+ }
51
+ }, [editorCanvasContainerView, setEditorCanvasContainerView]);
46
52
  return (0, _element.createElement)(_sidebarNavigationScreen.default, {
47
53
  isRoot: true,
48
54
  title: (0, _i18n.__)('Design'),
49
55
  description: (0, _i18n.__)('Customize the appearance of your website using the block editor.'),
50
- content: (0, _element.createElement)(_components.__experimentalItemGroup, null, showNavigationScreen && (0, _element.createElement)(_components.__experimentalNavigatorButton, {
51
- as: _sidebarNavigationItem.default,
52
- path: "/navigation",
56
+ content: (0, _element.createElement)(_components.__experimentalItemGroup, null, (0, _element.createElement)(_navigatorButton.default, {
53
57
  withChevron: true,
54
- icon: _icons.navigation
55
- }, (0, _i18n.__)('Navigation')), (0, _element.createElement)(_components.__experimentalNavigatorButton, {
56
- as: _sidebarNavigationItem.default,
57
- path: "/wp_global_styles",
58
+ icon: _icons.navigation,
59
+ as: _sidebarNavigationItem.default
60
+ }, (0, _i18n.__)('Navigation')), (0, _element.createElement)(_sidebarNavigationScreenGlobalStyles.SidebarNavigationItemGlobalStyles, {
58
61
  withChevron: true,
59
62
  icon: _icons.styles
60
63
  }, (0, _i18n.__)('Styles')), (0, _element.createElement)(_components.__experimentalNavigatorButton, {
64
+ as: _sidebarNavigationItem.default,
65
+ path: "/page",
66
+ withChevron: true,
67
+ icon: _icons.page
68
+ }, (0, _i18n.__)('Pages')), (0, _element.createElement)(_components.__experimentalNavigatorButton, {
61
69
  as: _sidebarNavigationItem.default,
62
70
  path: "/wp_template",
63
71
  withChevron: true,
@@ -66,8 +74,8 @@ function SidebarNavigationScreenMain() {
66
74
  as: _sidebarNavigationItem.default,
67
75
  path: "/wp_template_part",
68
76
  withChevron: true,
69
- icon: _icons.symbolFilled
70
- }, (0, _i18n.__)('Template Parts')))
77
+ icon: _icons.symbol
78
+ }, (0, _i18n.__)('Library')))
71
79
  });
72
80
  }
73
81
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["SidebarNavigationScreenMain","hasNavigationMenus","select","navigationMenus","coreStore","getEntityRecords","per_page","status","order","orderby","length","showNavigationScreen","process","env","IS_GUTENBERG_PLUGIN","SidebarNavigationItem","navigation","styles","layout","symbolFilled"],"mappings":";;;;;;;;;;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIe,SAASA,2BAAT,GAAuC;AACrD,QAAMC,kBAAkB,GAAG,qBAAaC,MAAF,IAAc;AACnD;AACA;AACA,UAAMC,eAAe,GAAGD,MAAM,CAAEE,eAAF,CAAN,CAAoBC,gBAApB,CACvB,UADuB,EAEvB,eAFuB,EAGvB;AACCC,MAAAA,QAAQ,EAAE,CADX;AAECC,MAAAA,MAAM,EAAE,SAFT;AAGCC,MAAAA,KAAK,EAAE,MAHR;AAICC,MAAAA,OAAO,EAAE;AAJV,KAHuB,CAAxB;AAWA,WAAO,CAAAN,eAAe,SAAf,IAAAA,eAAe,WAAf,YAAAA,eAAe,CAAEO,MAAjB,IAA0B,CAAjC;AACA,GAf0B,CAA3B;AAiBA,QAAMC,oBAAoB,GAAGC,OAAO,CAACC,GAAR,CAAYC,mBAAZ,GAC1Bb,kBAD0B,GAE1B,KAFH;AAGA,SACC,4BAAC,gCAAD;AACC,IAAA,MAAM,MADP;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cACb,kEADa,CAHf;AAMC,IAAA,OAAO,EACN,4BAAC,mCAAD,QACGU,oBAAoB,IACrB,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGI,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,mBAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGE;AAJR,OAMG,cAAI,QAAJ,CANH,CAXD,EAmBC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGF,8BADN;AAEC,MAAA,IAAI,EAAC,cAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGG;AAJR,OAMG,cAAI,WAAJ,CANH,CAnBD,EA2BC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGH,8BADN;AAEC,MAAA,IAAI,EAAC,mBAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGI;AAJR,OAMG,cAAI,gBAAJ,CANH,CA3BD;AAPF,IADD;AA+CA","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, styles } 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 hasNavigationMenus = useSelect( ( select ) => {\n\t\t// The query needs to be the same as in the \"SidebarNavigationScreenNavigationMenus\" component,\n\t\t// to avoid double network calls.\n\t\tconst navigationMenus = select( coreStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_navigation',\n\t\t\t{\n\t\t\t\tper_page: 1,\n\t\t\t\tstatus: 'publish',\n\t\t\t\torder: 'desc',\n\t\t\t\torderby: 'date',\n\t\t\t}\n\t\t);\n\n\t\treturn navigationMenus?.length > 0;\n\t} );\n\n\tconst showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN\n\t\t? hasNavigationMenus\n\t\t: false;\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{ showNavigationScreen && (\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=\"/wp_global_styles\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ styles }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Styles' ) }\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=\"/wp_template\"\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=\"/wp_template_part\"\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","editorCanvasContainerView","select","editSiteStore","getEditorCanvasContainerView","setEditorCanvasContainerView","undefined","navigation","SidebarNavigationItem","styles","page","layout","symbol"],"mappings":";;;;;;;;;AAWA;;AARA;;AAIA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AArBA;AACA;AACA;;AAWA;AACA;AACA;AAQe,SAASA,2BAAT,GAAuC;AACrD,QAAMC,yBAAyB,GAAG,qBAAaC,MAAF,IAAc;AAC1D,WAAO,yBAAQA,MAAM,CAAEC,YAAF,CAAd,EAAkCC,4BAAlC,EAAP;AACA,GAFiC,EAE/B,EAF+B,CAAlC;AAIA,QAAM;AAAEC,IAAAA;AAAF,MAAmC,yBACxC,uBAAaF,YAAb,CADwC,CAAzC,CALqD,CASrD;;AACA,0BAAW,MAAM;AAChB,QAAKF,yBAAL,EAAiC;AAChCI,MAAAA,4BAA4B,CAAEC,SAAF,CAA5B;AACA;AACD,GAJD,EAIG,CAAEL,yBAAF,EAA6BI,4BAA7B,CAJH;AAMA,SACC,4BAAC,gCAAD;AACC,IAAA,MAAM,MADP;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cACb,kEADa,CAHf;AAMC,IAAA,OAAO,EACN,4BAAC,mCAAD,QACC,4BAAC,wBAAD;AACC,MAAA,WAAW,MADZ;AAEC,MAAA,IAAI,EAAGE,iBAFR;AAGC,MAAA,EAAE,EAAGC;AAHN,OAKG,cAAI,YAAJ,CALH,CADD,EASC,4BAAC,sEAAD;AACC,MAAA,WAAW,MADZ;AAEC,MAAA,IAAI,EAAGC;AAFR,OAIG,cAAI,QAAJ,CAJH,CATD,EAeC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGD,8BADN;AAEC,MAAA,IAAI,EAAC,OAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGE;AAJR,OAMG,cAAI,OAAJ,CANH,CAfD,EAuBC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGF,8BADN;AAEC,MAAA,IAAI,EAAC,cAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGG;AAJR,OAMG,cAAI,WAAJ,CANH,CAvBD,EA+BC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGH,8BADN;AAEC,MAAA,IAAI,EAAC,mBAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGI;AAJR,OAMG,cAAI,SAAJ,CANH,CA/BD;AAPF,IADD;AAmDA","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, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarNavigationScreenNavigationMenuButton from '../sidebar-navigation-screen-navigation-menus/navigator-button';\n\nexport default function SidebarNavigationScreenMain() {\n\tconst editorCanvasContainerView = useSelect( ( select ) => {\n\t\treturn unlock( select( editSiteStore ) ).getEditorCanvasContainerView();\n\t}, [] );\n\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tif ( editorCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ editorCanvasContainerView, setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<SidebarNavigationScreenNavigationMenuButton\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t</SidebarNavigationScreenNavigationMenuButton>\n\n\t\t\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ styles }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/page\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ page }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Pages' ) }\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=\"/wp_template\"\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=\"/wp_template_part\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Library' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t</ItemGroup>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
@@ -58,7 +58,7 @@ function SidebarNavigationScreenNavigationItem() {
58
58
  label: (0, _i18n.__)('Edit'),
59
59
  icon: _icons.pencil
60
60
  }),
61
- description: postType === 'page' ? (0, _i18n.__)('Pages are static and are not listed by date. Pages do not use tags or categories.') : (0, _i18n.__)('Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'),
61
+ description: (0, _i18n.__)('Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'),
62
62
  content: (0, _element.createElement)(_element.Fragment, null, record !== null && record !== void 0 && record.link ? (0, _element.createElement)(_components.ExternalLink, {
63
63
  className: "edit-site-sidebar-navigation-screen__page-link",
64
64
  href: record.link
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js"],"names":["SidebarNavigationScreenNavigationItem","setCanvasMode","editSiteStore","params","postType","postId","record","title","rendered","pencil","link","description"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAWA;AACA;AACA;AAMe,SAASA,qCAAT,GAAiD;AAAA;;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAoB,yBAAQ,uBAAaC,YAAb,CAAR,CAA1B;AACA,QAAM;AACLC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AADH,MAEF,6CAFJ;AAGA,QAAM;AAAEC,IAAAA;AAAF,MAAa,+BAAiB,UAAjB,EAA6BF,QAA7B,EAAuCC,MAAvC,CAAnB;AAEA,SACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAGC,MAAM,GAAG,kCAAgBA,MAAhB,aAAgBA,MAAhB,wCAAgBA,MAAM,CAAEC,KAAxB,kDAAgB,cAAeC,QAA/B,CAAH,GAA+C,IAD9D;AAEC,IAAA,OAAO,EACN,4BAAC,sBAAD;AACC,MAAA,OAAO,EAAG,MAAMP,aAAa,CAAE,MAAF,CAD9B;AAEC,MAAA,KAAK,EAAG,cAAI,MAAJ,CAFT;AAGC,MAAA,IAAI,EAAGQ;AAHR,MAHF;AASC,IAAA,WAAW,EACVL,QAAQ,KAAK,MAAb,GACG,cACA,mFADA,CADH,GAIG,cACA,oGADA,CAdL;AAkBC,IAAA,OAAO,EACN,qDACGE,MAAM,SAAN,IAAAA,MAAM,WAAN,IAAAA,MAAM,CAAEI,IAAR,GACD,4BAAC,wBAAD;AACC,MAAA,SAAS,EAAC,gDADX;AAEC,MAAA,IAAI,EAAGJ,MAAM,CAACI;AAFf,OAIGJ,MAAM,CAACI,IAJV,CADC,GAOE,IARL,EASGJ,MAAM,GACL,kCAAgBA,MAAhB,aAAgBA,MAAhB,8CAAgBA,MAAM,CAAEK,WAAxB,wDAAgB,oBAAqBH,QAArC,CADK,GAEL,IAXJ;AAnBF,IADD;AAoCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tExternalLink,\n} from '@wordpress/components';\nimport { useEntityRecord } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\n\nexport default function SidebarNavigationScreenNavigationItem() {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst {\n\t\tparams: { postType, postId },\n\t} = useNavigator();\n\tconst { record } = useEntityRecord( 'postType', postType, postId );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ record ? decodeEntities( record?.title?.rendered ) : null }\n\t\t\tactions={\n\t\t\t\t<SidebarButton\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\ticon={ pencil }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tdescription={\n\t\t\t\tpostType === 'page'\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Pages are static and are not listed by date. Pages do not use tags or categories.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'\n\t\t\t\t\t )\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ record?.link ? (\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__page-link\"\n\t\t\t\t\t\t\thref={ record.link }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ record.link }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ record\n\t\t\t\t\t\t? decodeEntities( record?.description?.rendered )\n\t\t\t\t\t\t: null }\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-navigation-item/index.js"],"names":["SidebarNavigationScreenNavigationItem","setCanvasMode","editSiteStore","params","postType","postId","record","title","rendered","pencil","link","description"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAWA;AACA;AACA;AAMe,SAASA,qCAAT,GAAiD;AAAA;;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAoB,yBAAQ,uBAAaC,YAAb,CAAR,CAA1B;AACA,QAAM;AACLC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AADH,MAEF,6CAFJ;AAGA,QAAM;AAAEC,IAAAA;AAAF,MAAa,+BAAiB,UAAjB,EAA6BF,QAA7B,EAAuCC,MAAvC,CAAnB;AAEA,SACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAGC,MAAM,GAAG,kCAAgBA,MAAhB,aAAgBA,MAAhB,wCAAgBA,MAAM,CAAEC,KAAxB,kDAAgB,cAAeC,QAA/B,CAAH,GAA+C,IAD9D;AAEC,IAAA,OAAO,EACN,4BAAC,sBAAD;AACC,MAAA,OAAO,EAAG,MAAMP,aAAa,CAAE,MAAF,CAD9B;AAEC,MAAA,KAAK,EAAG,cAAI,MAAJ,CAFT;AAGC,MAAA,IAAI,EAAGQ;AAHR,MAHF;AASC,IAAA,WAAW,EAAG,cACb,oGADa,CATf;AAYC,IAAA,OAAO,EACN,qDACGH,MAAM,SAAN,IAAAA,MAAM,WAAN,IAAAA,MAAM,CAAEI,IAAR,GACD,4BAAC,wBAAD;AACC,MAAA,SAAS,EAAC,gDADX;AAEC,MAAA,IAAI,EAAGJ,MAAM,CAACI;AAFf,OAIGJ,MAAM,CAACI,IAJV,CADC,GAOE,IARL,EASGJ,MAAM,GACL,kCAAgBA,MAAhB,aAAgBA,MAAhB,8CAAgBA,MAAM,CAAEK,WAAxB,wDAAgB,oBAAqBH,QAArC,CADK,GAEL,IAXJ;AAbF,IADD;AA8BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tExternalLink,\n} from '@wordpress/components';\nimport { useEntityRecord } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\n\nexport default function SidebarNavigationScreenNavigationItem() {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst {\n\t\tparams: { postType, postId },\n\t} = useNavigator();\n\tconst { record } = useEntityRecord( 'postType', postType, postId );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ record ? decodeEntities( record?.title?.rendered ) : null }\n\t\t\tactions={\n\t\t\t\t<SidebarButton\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\ticon={ pencil }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tdescription={ __(\n\t\t\t\t'Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ record?.link ? (\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__page-link\"\n\t\t\t\t\t\t\thref={ record.link }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ record.link }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ record\n\t\t\t\t\t\t? decodeEntities( record?.description?.rendered )\n\t\t\t\t\t\t: null }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
@@ -0,0 +1,162 @@
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 = SidebarNavigationScreenNavigationMenu;
9
+
10
+ var _element = require("@wordpress/element");
11
+
12
+ var _coreData = require("@wordpress/core-data");
13
+
14
+ var _components = require("@wordpress/components");
15
+
16
+ var _i18n = require("@wordpress/i18n");
17
+
18
+ var _data = require("@wordpress/data");
19
+
20
+ var _router = require("@wordpress/router");
21
+
22
+ var _blockEditor = require("@wordpress/block-editor");
23
+
24
+ var _blocks = require("@wordpress/blocks");
25
+
26
+ var _htmlEntities = require("@wordpress/html-entities");
27
+
28
+ var _privateApis = require("../../private-apis");
29
+
30
+ var _store = require("../../store");
31
+
32
+ var _isPreviewingTheme = require("../../utils/is-previewing-theme");
33
+
34
+ var _sidebarNavigationScreenNavigationMenus = require("../sidebar-navigation-screen-navigation-menus");
35
+
36
+ var _navigationMenuContent = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus/navigation-menu-content"));
37
+
38
+ /**
39
+ * WordPress dependencies
40
+ */
41
+
42
+ /**
43
+ * Internal dependencies
44
+ */
45
+ const {
46
+ useHistory
47
+ } = (0, _privateApis.unlock)(_router.privateApis);
48
+
49
+ const noop = () => {};
50
+
51
+ function SidebarNavigationScreenNavigationMenu() {
52
+ var _navigationMenu$title, _navigationMenu$conte;
53
+
54
+ const postType = `wp_navigation`;
55
+ const {
56
+ params: {
57
+ postId
58
+ }
59
+ } = (0, _components.__experimentalUseNavigator)();
60
+ const {
61
+ record: navigationMenu,
62
+ isResolving: isLoading
63
+ } = (0, _coreData.useEntityRecord)('postType', postType, postId);
64
+ const menuTitle = (navigationMenu === null || navigationMenu === void 0 ? void 0 : (_navigationMenu$title = navigationMenu.title) === null || _navigationMenu$title === void 0 ? void 0 : _navigationMenu$title.rendered) || (navigationMenu === null || navigationMenu === void 0 ? void 0 : navigationMenu.slug);
65
+
66
+ if (isLoading) {
67
+ return (0, _element.createElement)(_sidebarNavigationScreenNavigationMenus.SidebarNavigationScreenWrapper, {
68
+ description: (0, _i18n.__)('Navigation menus are a curated collection of blocks that allow visitors to get around your site.')
69
+ }, (0, _element.createElement)(_components.Spinner, {
70
+ className: "edit-site-sidebar-navigation-screen-navigation-menus__loading"
71
+ }));
72
+ }
73
+
74
+ if (!isLoading && !navigationMenu) {
75
+ return (0, _element.createElement)(_sidebarNavigationScreenNavigationMenus.SidebarNavigationScreenWrapper, {
76
+ description: (0, _i18n.__)('Navigation Menu missing.')
77
+ });
78
+ }
79
+
80
+ if (!(navigationMenu !== null && navigationMenu !== void 0 && (_navigationMenu$conte = navigationMenu.content) !== null && _navigationMenu$conte !== void 0 && _navigationMenu$conte.raw)) {
81
+ return (0, _element.createElement)(_sidebarNavigationScreenNavigationMenus.SidebarNavigationScreenWrapper, {
82
+ title: (0, _htmlEntities.decodeEntities)(menuTitle),
83
+ description: (0, _i18n.__)('This Navigation Menu is empty.')
84
+ });
85
+ }
86
+
87
+ return (0, _element.createElement)(_sidebarNavigationScreenNavigationMenus.SidebarNavigationScreenWrapper, {
88
+ title: (0, _htmlEntities.decodeEntities)(menuTitle),
89
+ description: (0, _i18n.__)('Navigation menus are a curated collection of blocks that allow visitors to get around your site.')
90
+ }, (0, _element.createElement)(NavigationMenuEditor, {
91
+ navigationMenu: navigationMenu
92
+ }));
93
+ }
94
+
95
+ function NavigationMenuEditor(_ref) {
96
+ let {
97
+ navigationMenu
98
+ } = _ref;
99
+ const history = useHistory();
100
+ const onSelect = (0, _element.useCallback)(selectedBlock => {
101
+ const {
102
+ attributes,
103
+ name
104
+ } = selectedBlock;
105
+
106
+ if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
107
+ history.push({
108
+ postType: attributes.type,
109
+ postId: attributes.id,
110
+ ...((0, _isPreviewingTheme.isPreviewingTheme)() && {
111
+ theme_preview: (0, _isPreviewingTheme.currentlyPreviewingTheme)()
112
+ })
113
+ });
114
+ }
115
+
116
+ if (name === 'core/page-list-item' && attributes.id && history) {
117
+ history.push({
118
+ postType: 'page',
119
+ postId: attributes.id,
120
+ ...((0, _isPreviewingTheme.isPreviewingTheme)() && {
121
+ theme_preview: (0, _isPreviewingTheme.currentlyPreviewingTheme)()
122
+ })
123
+ });
124
+ }
125
+ }, [history]);
126
+ const {
127
+ storedSettings
128
+ } = (0, _data.useSelect)(select => {
129
+ const {
130
+ getSettings
131
+ } = (0, _privateApis.unlock)(select(_store.store));
132
+ return {
133
+ storedSettings: getSettings(false)
134
+ };
135
+ }, []);
136
+ const blocks = (0, _element.useMemo)(() => {
137
+ if (!NavigationMenuEditor) {
138
+ return [];
139
+ }
140
+
141
+ return [(0, _blocks.createBlock)('core/navigation', {
142
+ ref: navigationMenu === null || navigationMenu === void 0 ? void 0 : navigationMenu.id
143
+ })];
144
+ }, [navigationMenu]);
145
+
146
+ if (!navigationMenu || !(blocks !== null && blocks !== void 0 && blocks.length)) {
147
+ return null;
148
+ }
149
+
150
+ return (0, _element.createElement)(_blockEditor.BlockEditorProvider, {
151
+ settings: storedSettings,
152
+ value: blocks,
153
+ onChange: noop,
154
+ onInput: noop
155
+ }, (0, _element.createElement)("div", {
156
+ className: "edit-site-sidebar-navigation-screen-navigation-menus__content"
157
+ }, (0, _element.createElement)(_navigationMenuContent.default, {
158
+ rootClientId: blocks[0].clientId,
159
+ onSelect: onSelect
160
+ })));
161
+ }
162
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js"],"names":["useHistory","routerPrivateApis","noop","SidebarNavigationScreenNavigationMenu","postType","params","postId","record","navigationMenu","isResolving","isLoading","menuTitle","title","rendered","slug","content","raw","NavigationMenuEditor","history","onSelect","selectedBlock","attributes","name","kind","id","type","push","theme_preview","storedSettings","select","getSettings","editSiteStore","blocks","ref","length","clientId"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecord } from '@wordpress/core-data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tSpinner,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport NavigationMenuContent from '../sidebar-navigation-screen-navigation-menus/navigation-menu-content';\n\nconst { useHistory } = unlock( routerPrivateApis );\nconst noop = () => {};\n\nexport default function SidebarNavigationScreenNavigationMenu() {\n\tconst postType = `wp_navigation`;\n\tconst {\n\t\tparams: { postId },\n\t} = useNavigator();\n\n\tconst { record: navigationMenu, isResolving: isLoading } = useEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n\n\tconst menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Navigation menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! navigationMenu ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'Navigation Menu missing.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! navigationMenu?.content?.raw ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\ttitle={ decodeEntities( menuTitle ) }\n\t\t\t\tdescription={ __( 'This Navigation Menu is empty.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper\n\t\t\ttitle={ decodeEntities( menuTitle ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Navigation menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t) }\n\t\t>\n\t\t\t<NavigationMenuEditor navigationMenu={ navigationMenu } />\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nfunction NavigationMenuEditor( { navigationMenu } ) {\n\tconst history = useHistory();\n\n\tconst onSelect = useCallback(\n\t\t( selectedBlock ) => {\n\t\t\tconst { attributes, name } = 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\t...( isPreviewingTheme() && {\n\t\t\t\t\t\ttheme_preview: currentlyPreviewingTheme(),\n\t\t\t\t\t} ),\n\t\t\t\t} );\n\t\t\t}\n\t\t\tif ( name === 'core/page-list-item' && attributes.id && history ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostType: 'page',\n\t\t\t\t\tpostId: attributes.id,\n\t\t\t\t\t...( isPreviewingTheme() && {\n\t\t\t\t\t\ttheme_preview: currentlyPreviewingTheme(),\n\t\t\t\t\t} ),\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history ]\n\t);\n\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings( false ),\n\t\t};\n\t}, [] );\n\n\tconst blocks = useMemo( () => {\n\t\tif ( ! NavigationMenuEditor ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\tcreateBlock( 'core/navigation', { ref: navigationMenu?.id } ),\n\t\t];\n\t}, [ navigationMenu ] );\n\n\tif ( ! navigationMenu || ! blocks?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tvalue={ blocks }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-navigation-menus__content\">\n\t\t\t\t<NavigationMenuContent\n\t\t\t\t\trootClientId={ blocks[ 0 ].clientId }\n\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</BlockEditorProvider>\n\t);\n}\n"]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PRELOADED_NAVIGATION_MENUS_QUERY = void 0;
7
+ // This requested is preloaded in `gutenberg_preload_navigation_posts`.
8
+ // As unbounded queries are limited to 100 by `fetchAllMiddleware`
9
+ // on apiFetch this query is limited to 100.
10
+ const PRELOADED_NAVIGATION_MENUS_QUERY = {
11
+ per_page: 100,
12
+ status: 'publish',
13
+ order: 'desc',
14
+ orderby: 'date'
15
+ };
16
+ exports.PRELOADED_NAVIGATION_MENUS_QUERY = PRELOADED_NAVIGATION_MENUS_QUERY;
17
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js"],"names":["PRELOADED_NAVIGATION_MENUS_QUERY","per_page","status","order","orderby"],"mappings":";;;;;;AAAA;AACA;AACA;AACO,MAAMA,gCAAgC,GAAG;AAC/CC,EAAAA,QAAQ,EAAE,GADqC;AAE/CC,EAAAA,MAAM,EAAE,SAFuC;AAG/CC,EAAAA,KAAK,EAAE,MAHwC;AAI/CC,EAAAA,OAAO,EAAE;AAJsC,CAAzC","sourcesContent":["// This requested is preloaded in `gutenberg_preload_navigation_posts`.\n// As unbounded queries are limited to 100 by `fetchAllMiddleware`\n// on apiFetch this query is limited to 100.\nexport const PRELOADED_NAVIGATION_MENUS_QUERY = {\n\tper_page: 100,\n\tstatus: 'publish',\n\torder: 'desc',\n\torderby: 'date',\n};\n"]}