@wordpress/edit-site 5.2.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/add-new-template/add-custom-generic-template-modal.js +8 -10
  3. package/build/components/add-new-template/add-custom-generic-template-modal.js.map +1 -1
  4. package/build/components/add-new-template/add-custom-template-modal.js +0 -1
  5. package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
  6. package/build/components/add-new-template/new-template-part.js +9 -32
  7. package/build/components/add-new-template/new-template-part.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +5 -4
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/add-new-template/utils.js +1 -9
  11. package/build/components/add-new-template/utils.js.map +1 -1
  12. package/build/components/app/index.js +2 -7
  13. package/build/components/app/index.js.map +1 -1
  14. package/build/components/block-editor/editor-canvas.js +13 -2
  15. package/build/components/block-editor/editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/index.js +16 -14
  17. package/build/components/block-editor/index.js.map +1 -1
  18. package/build/components/block-editor/inserter-media-categories.js +237 -0
  19. package/build/components/block-editor/inserter-media-categories.js.map +1 -0
  20. package/build/components/canvas-spinner/index.js +20 -0
  21. package/build/components/canvas-spinner/index.js.map +1 -0
  22. package/build/components/create-template-part-modal/index.js +4 -2
  23. package/build/components/create-template-part-modal/index.js.map +1 -1
  24. package/build/components/editor/index.js +9 -5
  25. package/build/components/editor/index.js.map +1 -1
  26. package/build/components/error-boundary/index.js +2 -12
  27. package/build/components/error-boundary/index.js.map +1 -1
  28. package/build/components/error-boundary/warning.js +5 -28
  29. package/build/components/error-boundary/warning.js.map +1 -1
  30. package/build/components/global-styles/block-preview-panel.js +2 -2
  31. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  32. package/build/components/global-styles/border-panel.js +17 -9
  33. package/build/components/global-styles/border-panel.js.map +1 -1
  34. package/build/components/global-styles/color-palette-panel.js +13 -7
  35. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  36. package/build/components/global-styles/context-menu.js +39 -4
  37. package/build/components/global-styles/context-menu.js.map +1 -1
  38. package/build/components/global-styles/custom-css.js +65 -14
  39. package/build/components/global-styles/custom-css.js.map +1 -1
  40. package/build/components/global-styles/dimensions-panel.js +49 -31
  41. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  42. package/build/components/global-styles/global-styles-provider.js +13 -3
  43. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  44. package/build/components/global-styles/gradients-palette-panel.js +17 -11
  45. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  46. package/build/components/global-styles/hooks.js +21 -142
  47. package/build/components/global-styles/hooks.js.map +1 -1
  48. package/build/components/global-styles/index.js +0 -28
  49. package/build/components/global-styles/index.js.map +1 -1
  50. package/build/components/global-styles/palette.js +11 -4
  51. package/build/components/global-styles/palette.js.map +1 -1
  52. package/build/components/global-styles/preview.js +18 -15
  53. package/build/components/global-styles/preview.js.map +1 -1
  54. package/build/components/global-styles/screen-background-color.js +27 -13
  55. package/build/components/global-styles/screen-background-color.js.map +1 -1
  56. package/build/components/global-styles/screen-border.js +10 -4
  57. package/build/components/global-styles/screen-border.js.map +1 -1
  58. package/build/components/global-styles/screen-button-color.js +16 -9
  59. package/build/components/global-styles/screen-button-color.js.map +1 -1
  60. package/build/components/global-styles/screen-colors.js +43 -34
  61. package/build/components/global-styles/screen-colors.js.map +1 -1
  62. package/build/components/global-styles/screen-css.js +20 -8
  63. package/build/components/global-styles/screen-css.js.map +1 -1
  64. package/build/components/global-styles/screen-heading-color.js +23 -16
  65. package/build/components/global-styles/screen-heading-color.js.map +1 -1
  66. package/build/components/global-styles/screen-layout.js +3 -3
  67. package/build/components/global-styles/screen-layout.js.map +1 -1
  68. package/build/components/global-styles/screen-link-color.js +18 -11
  69. package/build/components/global-styles/screen-link-color.js.map +1 -1
  70. package/build/components/global-styles/screen-root.js +25 -9
  71. package/build/components/global-styles/screen-root.js.map +1 -1
  72. package/build/components/global-styles/screen-style-variations.js +8 -4
  73. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  74. package/build/components/global-styles/screen-text-color.js +14 -7
  75. package/build/components/global-styles/screen-text-color.js.map +1 -1
  76. package/build/components/global-styles/screen-typography.js +18 -12
  77. package/build/components/global-styles/screen-typography.js.map +1 -1
  78. package/build/components/global-styles/shadow-panel.js +196 -0
  79. package/build/components/global-styles/shadow-panel.js.map +1 -0
  80. package/build/components/global-styles/typography-panel.js +43 -29
  81. package/build/components/global-styles/typography-panel.js.map +1 -1
  82. package/build/components/global-styles/typography-preview.js +19 -9
  83. package/build/components/global-styles/typography-preview.js.map +1 -1
  84. package/build/components/global-styles/ui.js +104 -34
  85. package/build/components/global-styles/ui.js.map +1 -1
  86. package/build/components/global-styles/utils.js +5 -334
  87. package/build/components/global-styles/utils.js.map +1 -1
  88. package/build/components/global-styles-renderer/index.js +7 -5
  89. package/build/components/global-styles-renderer/index.js.map +1 -1
  90. package/build/components/header-edit-mode/document-actions/index.js +2 -2
  91. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  92. package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
  93. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  94. package/build/components/layout/index.js +11 -11
  95. package/build/components/layout/index.js.map +1 -1
  96. package/build/components/list/actions/rename-menu-item.js +8 -11
  97. package/build/components/list/actions/rename-menu-item.js.map +1 -1
  98. package/build/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +9 -6
  99. package/build/components/navigation-inspector/index.js.map +1 -0
  100. package/build/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +14 -14
  101. package/build/components/navigation-inspector/navigation-menu.js.map +1 -0
  102. package/build/components/sidebar/index.js +3 -1
  103. package/build/components/sidebar/index.js.map +1 -1
  104. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +3 -18
  105. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  106. package/build/components/sidebar-edit-mode/index.js +1 -14
  107. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  108. package/build/components/sidebar-navigation-screen/index.js +3 -2
  109. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  110. package/build/components/sidebar-navigation-screen-main/index.js +23 -1
  111. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  112. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +52 -0
  113. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -0
  114. package/build/components/sidebar-navigation-screen-templates/index.js +3 -8
  115. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  116. package/build/components/site-hub/index.js +11 -10
  117. package/build/components/site-hub/index.js.map +1 -1
  118. package/build/components/site-icon/index.js +1 -1
  119. package/build/components/site-icon/index.js.map +1 -1
  120. package/build/components/style-book/index.js +7 -4
  121. package/build/components/style-book/index.js.map +1 -1
  122. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +6 -4
  123. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  124. package/build/components/template-part-converter/convert-to-template-part.js +5 -9
  125. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  126. package/build/experiments.js +19 -0
  127. package/build/experiments.js.map +1 -0
  128. package/build/hooks/push-changes-to-global-styles/index.js +65 -6
  129. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  130. package/build/index.js +53 -60
  131. package/build/index.js.map +1 -1
  132. package/build/store/actions.js +1 -27
  133. package/build/store/actions.js.map +1 -1
  134. package/build/store/index.js +8 -0
  135. package/build/store/index.js.map +1 -1
  136. package/build/store/private-actions.js +40 -0
  137. package/build/store/private-actions.js.map +1 -0
  138. package/build/store/private-selectors.js +18 -0
  139. package/build/store/private-selectors.js.map +1 -0
  140. package/build/store/selectors.js +7 -40
  141. package/build/store/selectors.js.map +1 -1
  142. package/build/store/utils.js +77 -0
  143. package/build/store/utils.js.map +1 -0
  144. package/build/utils/template-part-create.js +71 -0
  145. package/build/utils/template-part-create.js.map +1 -0
  146. package/build-module/components/add-new-template/add-custom-generic-template-modal.js +9 -11
  147. package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +1 -1
  148. package/build-module/components/add-new-template/add-custom-template-modal.js +0 -1
  149. package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
  150. package/build-module/components/add-new-template/new-template-part.js +8 -31
  151. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  152. package/build-module/components/add-new-template/new-template.js +4 -4
  153. package/build-module/components/add-new-template/new-template.js.map +1 -1
  154. package/build-module/components/add-new-template/utils.js +0 -5
  155. package/build-module/components/add-new-template/utils.js.map +1 -1
  156. package/build-module/components/app/index.js +2 -7
  157. package/build-module/components/app/index.js.map +1 -1
  158. package/build-module/components/block-editor/editor-canvas.js +13 -3
  159. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  160. package/build-module/components/block-editor/index.js +17 -15
  161. package/build-module/components/block-editor/index.js.map +1 -1
  162. package/build-module/components/block-editor/inserter-media-categories.js +225 -0
  163. package/build-module/components/block-editor/inserter-media-categories.js.map +1 -0
  164. package/build-module/components/canvas-spinner/index.js +12 -0
  165. package/build-module/components/canvas-spinner/index.js.map +1 -0
  166. package/build-module/components/create-template-part-modal/index.js +5 -3
  167. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  168. package/build-module/components/editor/index.js +7 -5
  169. package/build-module/components/editor/index.js.map +1 -1
  170. package/build-module/components/error-boundary/index.js +2 -12
  171. package/build-module/components/error-boundary/index.js.map +1 -1
  172. package/build-module/components/error-boundary/warning.js +5 -28
  173. package/build-module/components/error-boundary/warning.js.map +1 -1
  174. package/build-module/components/global-styles/block-preview-panel.js +2 -2
  175. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  176. package/build-module/components/global-styles/border-panel.js +17 -11
  177. package/build-module/components/global-styles/border-panel.js.map +1 -1
  178. package/build-module/components/global-styles/color-palette-panel.js +11 -7
  179. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  180. package/build-module/components/global-styles/context-menu.js +40 -8
  181. package/build-module/components/global-styles/context-menu.js.map +1 -1
  182. package/build-module/components/global-styles/custom-css.js +61 -15
  183. package/build-module/components/global-styles/custom-css.js.map +1 -1
  184. package/build-module/components/global-styles/dimensions-panel.js +49 -32
  185. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  186. package/build-module/components/global-styles/global-styles-provider.js +7 -2
  187. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  188. package/build-module/components/global-styles/gradients-palette-panel.js +15 -11
  189. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  190. package/build-module/components/global-styles/hooks.js +23 -134
  191. package/build-module/components/global-styles/hooks.js.map +1 -1
  192. package/build-module/components/global-styles/index.js +0 -2
  193. package/build-module/components/global-styles/index.js.map +1 -1
  194. package/build-module/components/global-styles/palette.js +10 -5
  195. package/build-module/components/global-styles/palette.js.map +1 -1
  196. package/build-module/components/global-styles/preview.js +18 -14
  197. package/build-module/components/global-styles/preview.js.map +1 -1
  198. package/build-module/components/global-styles/screen-background-color.js +26 -15
  199. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  200. package/build-module/components/global-styles/screen-border.js +10 -5
  201. package/build-module/components/global-styles/screen-border.js.map +1 -1
  202. package/build-module/components/global-styles/screen-button-color.js +16 -11
  203. package/build-module/components/global-styles/screen-button-color.js.map +1 -1
  204. package/build-module/components/global-styles/screen-colors.js +43 -37
  205. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  206. package/build-module/components/global-styles/screen-css.js +21 -9
  207. package/build-module/components/global-styles/screen-css.js.map +1 -1
  208. package/build-module/components/global-styles/screen-heading-color.js +23 -18
  209. package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
  210. package/build-module/components/global-styles/screen-layout.js +4 -4
  211. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  212. package/build-module/components/global-styles/screen-link-color.js +18 -13
  213. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  214. package/build-module/components/global-styles/screen-root.js +23 -9
  215. package/build-module/components/global-styles/screen-root.js.map +1 -1
  216. package/build-module/components/global-styles/screen-style-variations.js +5 -2
  217. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  218. package/build-module/components/global-styles/screen-text-color.js +14 -9
  219. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  220. package/build-module/components/global-styles/screen-typography.js +16 -12
  221. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  222. package/build-module/components/global-styles/shadow-panel.js +177 -0
  223. package/build-module/components/global-styles/shadow-panel.js.map +1 -0
  224. package/build-module/components/global-styles/typography-panel.js +43 -31
  225. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  226. package/build-module/components/global-styles/typography-preview.js +17 -9
  227. package/build-module/components/global-styles/typography-preview.js.map +1 -1
  228. package/build-module/components/global-styles/ui.js +98 -35
  229. package/build-module/components/global-styles/ui.js.map +1 -1
  230. package/build-module/components/global-styles/utils.js +4 -319
  231. package/build-module/components/global-styles/utils.js.map +1 -1
  232. package/build-module/components/global-styles-renderer/index.js +5 -5
  233. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  234. package/build-module/components/header-edit-mode/document-actions/index.js +2 -2
  235. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  236. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
  237. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  238. package/build-module/components/layout/index.js +10 -11
  239. package/build-module/components/layout/index.js.map +1 -1
  240. package/build-module/components/list/actions/rename-menu-item.js +9 -12
  241. package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
  242. package/build-module/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +9 -6
  243. package/build-module/components/navigation-inspector/index.js.map +1 -0
  244. package/build-module/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +14 -15
  245. package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -0
  246. package/build-module/components/sidebar/index.js +2 -1
  247. package/build-module/components/sidebar/index.js.map +1 -1
  248. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +6 -21
  249. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  250. package/build-module/components/sidebar-edit-mode/index.js +1 -13
  251. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  252. package/build-module/components/sidebar-navigation-screen/index.js +3 -2
  253. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  254. package/build-module/components/sidebar-navigation-screen-main/index.js +22 -2
  255. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  256. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +40 -0
  257. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -0
  258. package/build-module/components/sidebar-navigation-screen-templates/index.js +4 -9
  259. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  260. package/build-module/components/site-hub/index.js +10 -10
  261. package/build-module/components/site-hub/index.js.map +1 -1
  262. package/build-module/components/site-icon/index.js +1 -1
  263. package/build-module/components/site-icon/index.js.map +1 -1
  264. package/build-module/components/style-book/index.js +8 -5
  265. package/build-module/components/style-book/index.js.map +1 -1
  266. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -4
  267. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  268. package/build-module/components/template-part-converter/convert-to-template-part.js +5 -9
  269. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  270. package/build-module/experiments.js +9 -0
  271. package/build-module/experiments.js.map +1 -0
  272. package/build-module/hooks/push-changes-to-global-styles/index.js +62 -3
  273. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  274. package/build-module/index.js +52 -60
  275. package/build-module/index.js.map +1 -1
  276. package/build-module/store/actions.js +0 -23
  277. package/build-module/store/actions.js.map +1 -1
  278. package/build-module/store/index.js +5 -0
  279. package/build-module/store/index.js.map +1 -1
  280. package/build-module/store/private-actions.js +29 -0
  281. package/build-module/store/private-actions.js.map +1 -0
  282. package/build-module/store/private-selectors.js +11 -0
  283. package/build-module/store/private-selectors.js.map +1 -0
  284. package/build-module/store/selectors.js +6 -37
  285. package/build-module/store/selectors.js.map +1 -1
  286. package/build-module/store/utils.js +66 -0
  287. package/build-module/store/utils.js.map +1 -0
  288. package/build-module/utils/template-part-create.js +53 -0
  289. package/build-module/utils/template-part-create.js.map +1 -0
  290. package/build-style/style-rtl.css +314 -216
  291. package/build-style/style.css +314 -216
  292. package/package.json +32 -30
  293. package/src/components/add-new-template/add-custom-generic-template-modal.js +20 -28
  294. package/src/components/add-new-template/add-custom-template-modal.js +0 -1
  295. package/src/components/add-new-template/new-template-part.js +14 -34
  296. package/src/components/add-new-template/new-template.js +5 -3
  297. package/src/components/add-new-template/style.scss +0 -4
  298. package/src/components/add-new-template/utils.js +0 -14
  299. package/src/components/app/index.js +2 -2
  300. package/src/components/block-editor/editor-canvas.js +12 -2
  301. package/src/components/block-editor/index.js +16 -28
  302. package/src/components/block-editor/inserter-media-categories.js +247 -0
  303. package/src/components/block-editor/style.scss +20 -7
  304. package/src/components/canvas-spinner/index.js +12 -0
  305. package/src/components/canvas-spinner/style.scss +7 -0
  306. package/src/components/create-template-part-modal/index.js +75 -67
  307. package/src/components/create-template-part-modal/style.scss +0 -10
  308. package/src/components/editor/index.js +8 -5
  309. package/src/components/error-boundary/index.js +2 -10
  310. package/src/components/error-boundary/warning.js +6 -35
  311. package/src/components/global-styles/README.md +1 -75
  312. package/src/components/global-styles/block-preview-panel.js +2 -2
  313. package/src/components/global-styles/border-panel.js +19 -17
  314. package/src/components/global-styles/color-palette-panel.js +10 -7
  315. package/src/components/global-styles/context-menu.js +114 -44
  316. package/src/components/global-styles/custom-css.js +76 -19
  317. package/src/components/global-styles/dimensions-panel.js +46 -36
  318. package/src/components/global-styles/global-styles-provider.js +6 -2
  319. package/src/components/global-styles/gradients-palette-panel.js +17 -11
  320. package/src/components/global-styles/hooks.js +31 -155
  321. package/src/components/global-styles/index.js +0 -2
  322. package/src/components/global-styles/palette.js +9 -5
  323. package/src/components/global-styles/preview.js +19 -13
  324. package/src/components/global-styles/screen-background-color.js +37 -21
  325. package/src/components/global-styles/screen-border.js +10 -5
  326. package/src/components/global-styles/screen-button-color.js +21 -19
  327. package/src/components/global-styles/screen-colors.js +48 -65
  328. package/src/components/global-styles/screen-css.js +30 -14
  329. package/src/components/global-styles/screen-heading-color.js +32 -27
  330. package/src/components/global-styles/screen-layout.js +4 -7
  331. package/src/components/global-styles/screen-link-color.js +26 -26
  332. package/src/components/global-styles/screen-root.js +24 -9
  333. package/src/components/global-styles/screen-style-variations.js +7 -2
  334. package/src/components/global-styles/screen-text-color.js +15 -19
  335. package/src/components/global-styles/screen-typography.js +27 -12
  336. package/src/components/global-styles/shadow-panel.js +174 -0
  337. package/src/components/global-styles/style.scss +85 -1
  338. package/src/components/global-styles/typography-panel.js +60 -48
  339. package/src/components/global-styles/typography-preview.js +28 -9
  340. package/src/components/global-styles/ui.js +97 -53
  341. package/src/components/global-styles/utils.js +4 -371
  342. package/src/components/global-styles-renderer/index.js +3 -4
  343. package/src/components/header-edit-mode/document-actions/index.js +1 -1
  344. package/src/components/keyboard-shortcut-help-modal/index.js +0 -1
  345. package/src/components/layout/index.js +12 -4
  346. package/src/components/layout/style.scss +4 -5
  347. package/src/components/list/actions/rename-menu-item.js +14 -23
  348. package/src/components/list/style.scss +0 -4
  349. package/src/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +2 -2
  350. package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +10 -12
  351. package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/style.scss +0 -17
  352. package/src/components/sidebar/index.js +2 -0
  353. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +8 -32
  354. package/src/components/sidebar-edit-mode/index.js +0 -11
  355. package/src/components/sidebar-edit-mode/settings-header/style.scss +8 -0
  356. package/src/components/sidebar-navigation-item/style.scss +28 -3
  357. package/src/components/sidebar-navigation-screen/index.js +4 -3
  358. package/src/components/sidebar-navigation-screen/style.scss +2 -0
  359. package/src/components/sidebar-navigation-screen-main/index.js +23 -1
  360. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +45 -0
  361. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +12 -0
  362. package/src/components/sidebar-navigation-screen-templates/index.js +12 -19
  363. package/src/components/site-hub/index.js +8 -10
  364. package/src/components/site-hub/style.scss +7 -1
  365. package/src/components/site-icon/index.js +1 -1
  366. package/src/components/site-icon/style.scss +2 -2
  367. package/src/components/style-book/index.js +10 -5
  368. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -3
  369. package/src/components/template-part-converter/convert-to-template-part.js +12 -10
  370. package/src/experiments.js +10 -0
  371. package/src/hooks/push-changes-to-global-styles/index.js +63 -5
  372. package/src/index.js +51 -59
  373. package/src/store/actions.js +0 -24
  374. package/src/store/index.js +5 -0
  375. package/src/store/private-actions.js +29 -0
  376. package/src/store/private-selectors.js +10 -0
  377. package/src/store/selectors.js +6 -37
  378. package/src/store/test/utils.js +181 -0
  379. package/src/store/utils.js +69 -0
  380. package/src/style.scss +4 -2
  381. package/src/utils/template-part-create.js +62 -0
  382. package/src/utils/test/template-part-create.js +63 -0
  383. package/build/components/global-styles/context.js +0 -22
  384. package/build/components/global-styles/context.js.map +0 -1
  385. package/build/components/global-styles/typography-utils.js +0 -92
  386. package/build/components/global-styles/typography-utils.js.map +0 -1
  387. package/build/components/global-styles/use-global-styles-output.js +0 -943
  388. package/build/components/global-styles/use-global-styles-output.js.map +0 -1
  389. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -42
  390. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/index.js.map +0 -1
  391. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +0 -1
  392. package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +0 -1
  393. package/build-module/components/global-styles/context.js +0 -12
  394. package/build-module/components/global-styles/context.js.map +0 -1
  395. package/build-module/components/global-styles/typography-utils.js +0 -84
  396. package/build-module/components/global-styles/typography-utils.js.map +0 -1
  397. package/build-module/components/global-styles/use-global-styles-output.js +0 -901
  398. package/build-module/components/global-styles/use-global-styles-output.js.map +0 -1
  399. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -28
  400. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/index.js.map +0 -1
  401. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +0 -1
  402. package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +0 -1
  403. package/src/components/global-styles/context.js +0 -15
  404. package/src/components/global-styles/test/typography-utils.js +0 -393
  405. package/src/components/global-styles/test/use-global-styles-output.js +0 -814
  406. package/src/components/global-styles/test/utils.js +0 -206
  407. package/src/components/global-styles/typography-utils.js +0 -87
  408. package/src/components/global-styles/use-global-styles-output.js +0 -1059
  409. package/src/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -37
@@ -1,379 +1,12 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { get } from 'lodash';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import { getTypographyFontSizeValue } from './typography-utils';
10
-
11
- /* Supporting data. */
12
- export const ROOT_BLOCK_NAME = 'root';
13
- export const ROOT_BLOCK_SELECTOR = 'body';
14
- export const ROOT_BLOCK_SUPPORTS = [
15
- 'background',
16
- 'backgroundColor',
17
- 'color',
18
- 'linkColor',
19
- 'buttonColor',
20
- 'fontFamily',
21
- 'fontSize',
22
- 'fontStyle',
23
- 'fontWeight',
24
- 'lineHeight',
25
- 'textDecoration',
26
- 'textTransform',
27
- 'padding',
28
- ];
29
-
30
- export const PRESET_METADATA = [
31
- {
32
- path: [ 'color', 'palette' ],
33
- valueKey: 'color',
34
- cssVarInfix: 'color',
35
- classes: [
36
- { classSuffix: 'color', propertyName: 'color' },
37
- {
38
- classSuffix: 'background-color',
39
- propertyName: 'background-color',
40
- },
41
- {
42
- classSuffix: 'border-color',
43
- propertyName: 'border-color',
44
- },
45
- ],
46
- },
47
- {
48
- path: [ 'color', 'gradients' ],
49
- valueKey: 'gradient',
50
- cssVarInfix: 'gradient',
51
- classes: [
52
- {
53
- classSuffix: 'gradient-background',
54
- propertyName: 'background',
55
- },
56
- ],
57
- },
58
- {
59
- path: [ 'color', 'duotone' ],
60
- cssVarInfix: 'duotone',
61
- valueFunc: ( { slug } ) => `url( '#wp-duotone-${ slug }' )`,
62
- classes: [],
63
- },
64
- {
65
- path: [ 'typography', 'fontSizes' ],
66
- valueFunc: ( preset, { typography: typographySettings } ) =>
67
- getTypographyFontSizeValue( preset, typographySettings ),
68
- valueKey: 'size',
69
- cssVarInfix: 'font-size',
70
- classes: [ { classSuffix: 'font-size', propertyName: 'font-size' } ],
71
- },
72
- {
73
- path: [ 'typography', 'fontFamilies' ],
74
- valueKey: 'fontFamily',
75
- cssVarInfix: 'font-family',
76
- classes: [
77
- { classSuffix: 'font-family', propertyName: 'font-family' },
78
- ],
79
- },
80
- {
81
- path: [ 'spacing', 'spacingSizes' ],
82
- valueKey: 'size',
83
- cssVarInfix: 'spacing',
84
- valueFunc: ( { size } ) => size,
85
- classes: [],
86
- },
87
- ];
88
-
89
- export const STYLE_PATH_TO_CSS_VAR_INFIX = {
90
- 'color.background': 'color',
91
- 'color.text': 'color',
92
- 'elements.link.color.text': 'color',
93
- 'elements.link.:hover.color.text': 'color',
94
- 'elements.link.typography.fontFamily': 'font-family',
95
- 'elements.link.typography.fontSize': 'font-size',
96
- 'elements.button.color.text': 'color',
97
- 'elements.button.color.background': 'color',
98
- 'elements.button.typography.fontFamily': 'font-family',
99
- 'elements.button.typography.fontSize': 'font-size',
100
- 'elements.heading.color': 'color',
101
- 'elements.heading.color.background': 'color',
102
- 'elements.heading.typography.fontFamily': 'font-family',
103
- 'elements.heading.gradient': 'gradient',
104
- 'elements.heading.color.gradient': 'gradient',
105
- 'elements.h1.color': 'color',
106
- 'elements.h1.color.background': 'color',
107
- 'elements.h1.typography.fontFamily': 'font-family',
108
- 'elements.h1.color.gradient': 'gradient',
109
- 'elements.h2.color': 'color',
110
- 'elements.h2.color.background': 'color',
111
- 'elements.h2.typography.fontFamily': 'font-family',
112
- 'elements.h2.color.gradient': 'gradient',
113
- 'elements.h3.color': 'color',
114
- 'elements.h3.color.background': 'color',
115
- 'elements.h3.typography.fontFamily': 'font-family',
116
- 'elements.h3.color.gradient': 'gradient',
117
- 'elements.h4.color': 'color',
118
- 'elements.h4.color.background': 'color',
119
- 'elements.h4.typography.fontFamily': 'font-family',
120
- 'elements.h4.color.gradient': 'gradient',
121
- 'elements.h5.color': 'color',
122
- 'elements.h5.color.background': 'color',
123
- 'elements.h5.typography.fontFamily': 'font-family',
124
- 'elements.h5.color.gradient': 'gradient',
125
- 'elements.h6.color': 'color',
126
- 'elements.h6.color.background': 'color',
127
- 'elements.h6.typography.fontFamily': 'font-family',
128
- 'elements.h6.color.gradient': 'gradient',
129
- 'color.gradient': 'gradient',
130
- 'typography.fontSize': 'font-size',
131
- 'typography.fontFamily': 'font-family',
132
- };
133
-
134
- // A static list of block attributes that store global style preset slugs.
135
- export const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {
136
- 'color.background': 'backgroundColor',
137
- 'color.text': 'textColor',
138
- 'color.gradient': 'gradient',
139
- 'typography.fontSize': 'fontSize',
140
- 'typography.fontFamily': 'fontFamily',
141
- };
142
-
143
- function findInPresetsBy(
144
- features,
145
- blockName,
146
- presetPath,
147
- presetProperty,
148
- presetValueValue
149
- ) {
150
- // Block presets take priority above root level presets.
151
- const orderedPresetsByOrigin = [
152
- get( features, [ 'blocks', blockName, ...presetPath ] ),
153
- get( features, presetPath ),
154
- ];
155
-
156
- for ( const presetByOrigin of orderedPresetsByOrigin ) {
157
- if ( presetByOrigin ) {
158
- // Preset origins ordered by priority.
159
- const origins = [ 'custom', 'theme', 'default' ];
160
- for ( const origin of origins ) {
161
- const presets = presetByOrigin[ origin ];
162
- if ( presets ) {
163
- const presetObject = presets.find(
164
- ( preset ) =>
165
- preset[ presetProperty ] === presetValueValue
166
- );
167
- if ( presetObject ) {
168
- if ( presetProperty === 'slug' ) {
169
- return presetObject;
170
- }
171
- // If there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored.
172
- const highestPresetObjectWithSameSlug = findInPresetsBy(
173
- features,
174
- blockName,
175
- presetPath,
176
- 'slug',
177
- presetObject.slug
178
- );
179
- if (
180
- highestPresetObjectWithSameSlug[
181
- presetProperty
182
- ] === presetObject[ presetProperty ]
183
- ) {
184
- return presetObject;
185
- }
186
- return undefined;
187
- }
188
- }
189
- }
190
- }
191
- }
192
- }
193
-
194
- export function getPresetVariableFromValue(
195
- features,
196
- blockName,
197
- variableStylePath,
198
- presetPropertyValue
199
- ) {
200
- if ( ! presetPropertyValue ) {
201
- return presetPropertyValue;
202
- }
203
-
204
- const cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[ variableStylePath ];
205
-
206
- const metadata = PRESET_METADATA.find(
207
- ( data ) => data.cssVarInfix === cssVarInfix
208
- );
209
-
210
- if ( ! metadata ) {
211
- // The property doesn't have preset data
212
- // so the value should be returned as it is.
213
- return presetPropertyValue;
214
- }
215
- const { valueKey, path } = metadata;
216
-
217
- const presetObject = findInPresetsBy(
218
- features,
219
- blockName,
220
- path,
221
- valueKey,
222
- presetPropertyValue
223
- );
224
-
225
- if ( ! presetObject ) {
226
- // Value wasn't found in the presets,
227
- // so it must be a custom value.
228
- return presetPropertyValue;
229
- }
230
-
231
- return `var:preset|${ cssVarInfix }|${ presetObject.slug }`;
232
- }
233
-
234
- function getValueFromPresetVariable(
235
- features,
236
- blockName,
237
- variable,
238
- [ presetType, slug ]
239
- ) {
240
- const metadata = PRESET_METADATA.find(
241
- ( data ) => data.cssVarInfix === presetType
242
- );
243
- if ( ! metadata ) {
244
- return variable;
245
- }
246
-
247
- const presetObject = findInPresetsBy(
248
- features.settings,
249
- blockName,
250
- metadata.path,
251
- 'slug',
252
- slug
253
- );
254
-
255
- if ( presetObject ) {
256
- const { valueKey } = metadata;
257
- const result = presetObject[ valueKey ];
258
- return getValueFromVariable( features, blockName, result );
259
- }
260
-
261
- return variable;
262
- }
263
-
264
- function getValueFromCustomVariable( features, blockName, variable, path ) {
265
- const result =
266
- get( features.settings, [ 'blocks', blockName, 'custom', ...path ] ) ??
267
- get( features.settings, [ 'custom', ...path ] );
268
- if ( ! result ) {
269
- return variable;
270
- }
271
- // A variable may reference another variable so we need recursion until we find the value.
272
- return getValueFromVariable( features, blockName, result );
273
- }
274
-
275
- /**
276
- * Attempts to fetch the value of a theme.json CSS variable.
277
- *
278
- * @param {Object} features GlobalStylesContext config, e.g., user, base or merged. Represents the theme.json tree.
279
- * @param {string} blockName The name of a block as represented in the styles property. E.g., 'root' for root-level, and 'core/${blockName}' for blocks.
280
- * @param {string|*} variable An incoming style value. A CSS var value is expected, but it could be any value.
281
- * @return {string|*|{ref}} The value of the CSS var, if found. If not found, the passed variable argument.
282
- */
283
- export function getValueFromVariable( features, blockName, variable ) {
284
- if ( ! variable || typeof variable !== 'string' ) {
285
- if ( variable?.ref && typeof variable?.ref === 'string' ) {
286
- const refPath = variable.ref.split( '.' );
287
- variable = get( features, refPath );
288
- // Presence of another ref indicates a reference to another dynamic value.
289
- // Pointing to another dynamic value is not supported.
290
- if ( ! variable || !! variable?.ref ) {
291
- return variable;
292
- }
293
- } else {
294
- return variable;
295
- }
296
- }
297
- const USER_VALUE_PREFIX = 'var:';
298
- const THEME_VALUE_PREFIX = 'var(--wp--';
299
- const THEME_VALUE_SUFFIX = ')';
300
-
301
- let parsedVar;
302
-
303
- if ( variable.startsWith( USER_VALUE_PREFIX ) ) {
304
- parsedVar = variable.slice( USER_VALUE_PREFIX.length ).split( '|' );
305
- } else if (
306
- variable.startsWith( THEME_VALUE_PREFIX ) &&
307
- variable.endsWith( THEME_VALUE_SUFFIX )
308
- ) {
309
- parsedVar = variable
310
- .slice( THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length )
311
- .split( '--' );
312
- } else {
313
- // We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )`
314
- return variable;
315
- }
316
-
317
- const [ type, ...path ] = parsedVar;
318
- if ( type === 'preset' ) {
319
- return getValueFromPresetVariable(
320
- features,
321
- blockName,
322
- variable,
323
- path
324
- );
325
- }
326
- if ( type === 'custom' ) {
327
- return getValueFromCustomVariable(
328
- features,
329
- blockName,
330
- variable,
331
- path
332
- );
333
- }
334
- return variable;
335
- }
336
-
337
- /**
338
- * Function that scopes a selector with another one. This works a bit like
339
- * SCSS nesting except the `&` operator isn't supported.
340
- *
341
- * @example
342
- * ```js
343
- * const scope = '.a, .b .c';
344
- * const selector = '> .x, .y';
345
- * const merged = scopeSelector( scope, selector );
346
- * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y'
347
- * ```
348
- *
349
- * @param {string} scope Selector to scope to.
350
- * @param {string} selector Original selector.
351
- *
352
- * @return {string} Scoped selector.
353
- */
354
- export function scopeSelector( scope, selector ) {
355
- const scopes = scope.split( ',' );
356
- const selectors = selector.split( ',' );
357
-
358
- const selectorsScoped = [];
359
- scopes.forEach( ( outer ) => {
360
- selectors.forEach( ( inner ) => {
361
- selectorsScoped.push( `${ outer.trim() } ${ inner.trim() }` );
362
- } );
363
- } );
364
-
365
- return selectorsScoped.join( ', ' );
366
- }
367
-
368
1
  /**
369
2
  *
370
- * @param {string} path The variation path in the Global Styles tree.
3
+ * @param {string} variation The variation name.
371
4
  *
372
5
  * @return {string} The variation class name.
373
6
  */
374
- export function getVariationClassNameFromPath( path ) {
375
- if ( ! path ) {
7
+ export function getVariationClassName( variation ) {
8
+ if ( ! variation ) {
376
9
  return '';
377
10
  }
378
- return `is-style-${ path.split( '.' )[ 1 ] }`;
11
+ return `is-style-${ variation }`;
379
12
  }
@@ -3,16 +3,15 @@
3
3
  */
4
4
  import { useEffect } from '@wordpress/element';
5
5
  import { useSelect, useDispatch } from '@wordpress/data';
6
+ import { experiments as blockEditorExperiments } from '@wordpress/block-editor';
6
7
 
7
8
  /**
8
9
  * Internal dependencies
9
10
  */
10
11
  import { store as editSiteStore } from '../../store';
12
+ import { unlock } from '../../experiments';
11
13
 
12
- /**
13
- * Internal dependencies
14
- */
15
- import { useGlobalStylesOutput } from '../global-styles/use-global-styles-output';
14
+ const { useGlobalStylesOutput } = unlock( blockEditorExperiments );
16
15
 
17
16
  function useGlobalStylesRenderer() {
18
17
  const [ styles, settings, svgFilters ] = useGlobalStylesOutput();
@@ -88,6 +88,7 @@ export default function DocumentActions() {
88
88
  // Use the title wrapper as the popover anchor so that the dropdown is
89
89
  // centered over the whole title area rather than just one part of it.
90
90
  anchor: popoverAnchor,
91
+ placement: 'bottom',
91
92
  } ),
92
93
  [ popoverAnchor ]
93
94
  );
@@ -146,7 +147,6 @@ export default function DocumentActions() {
146
147
 
147
148
  <Dropdown
148
149
  popoverProps={ popoverProps }
149
- position="bottom center"
150
150
  renderToggle={ ( { isOpen, onToggle } ) => (
151
151
  <Button
152
152
  className="edit-site-document-actions__get-info"
@@ -94,7 +94,6 @@ export default function KeyboardShortcutHelpModal( {
94
94
  <Modal
95
95
  className="edit-site-keyboard-shortcut-help-modal"
96
96
  title={ __( 'Keyboard shortcuts' ) }
97
- closeLabel={ __( 'Close' ) }
98
97
  onRequestClose={ toggleModal }
99
98
  >
100
99
  <ShortcutSection
@@ -38,6 +38,7 @@ import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-e
38
38
  import SiteHub from '../site-hub';
39
39
  import ResizeHandle from '../block-editor/resize-handle';
40
40
  import useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';
41
+ import { unlock } from '../../experiments';
41
42
 
42
43
  const ANIMATION_DURATION = 0.5;
43
44
  const emptyResizeHandleStyles = {
@@ -52,7 +53,7 @@ const emptyResizeHandleStyles = {
52
53
  left: undefined,
53
54
  };
54
55
 
55
- export default function Layout( { onError } ) {
56
+ export default function Layout() {
56
57
  // This ensures the edited entity id and type are initialized properly.
57
58
  useInitEditedEntityFromURL();
58
59
  useSyncCanvasModeWithURL();
@@ -66,9 +67,9 @@ export default function Layout( { onError } ) {
66
67
  const { getAllShortcutKeyCombinations } = select(
67
68
  keyboardShortcutsStore
68
69
  );
69
- const { __unstableGetCanvasMode } = select( editSiteStore );
70
+ const { getCanvasMode } = unlock( select( editSiteStore ) );
70
71
  return {
71
- canvasMode: __unstableGetCanvasMode(),
72
+ canvasMode: getCanvasMode(),
72
73
  previousShortcut: getAllShortcutKeyCombinations(
73
74
  'core/edit-site/previous-region'
74
75
  ),
@@ -236,6 +237,13 @@ export default function Layout( { onError } ) {
236
237
  <ResizeHandle
237
238
  direction="right"
238
239
  variation="separator"
240
+ resizeWidthBy={ ( delta ) => {
241
+ setForcedWidth(
242
+ ( forcedWidth ??
243
+ defaultSidebarWidth ) +
244
+ delta
245
+ );
246
+ } }
239
247
  />
240
248
  ),
241
249
  } }
@@ -307,7 +315,7 @@ export default function Layout( { onError } ) {
307
315
  ease: 'easeOut',
308
316
  } }
309
317
  >
310
- <ErrorBoundary onError={ onError }>
318
+ <ErrorBoundary>
311
319
  { isEditorPage && <Editor /> }
312
320
  { isListPage && <ListPage /> }
313
321
  </ErrorBoundary>
@@ -63,7 +63,6 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
63
63
  .edit-site-layout__content {
64
64
  flex-grow: 1;
65
65
  display: flex;
66
- gap: $canvas-padding;
67
66
 
68
67
  // Hide scrollbars during the edit/view animation.
69
68
  overflow: hidden;
@@ -85,15 +84,15 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
85
84
  top: 0;
86
85
  }
87
86
 
88
- .resizable-editor__drag-handle.is-right {
89
- right: math.div(-$grid-unit-15, 2);
90
- }
91
-
92
87
  > div {
93
88
  overflow-y: auto;
94
89
  min-height: 100%;
95
90
  @include custom-scrollbars-on-hover;
96
91
  }
92
+
93
+ .resizable-editor__drag-handle {
94
+ right: 0;
95
+ }
97
96
  }
98
97
 
99
98
  .edit-site-layout__canvas-container {
@@ -6,11 +6,11 @@ import { useState } from '@wordpress/element';
6
6
  import { useDispatch } from '@wordpress/data';
7
7
  import {
8
8
  Button,
9
- Flex,
10
- FlexItem,
11
9
  MenuItem,
12
10
  Modal,
13
11
  TextControl,
12
+ __experimentalHStack as HStack,
13
+ __experimentalVStack as VStack,
14
14
  } from '@wordpress/components';
15
15
  import { store as coreStore } from '@wordpress/core-data';
16
16
  import { store as noticesStore } from '@wordpress/notices';
@@ -75,30 +75,22 @@ export default function RenameMenuItem( { template, onClose } ) {
75
75
  { isModalOpen && (
76
76
  <Modal
77
77
  title={ __( 'Rename' ) }
78
- closeLabel={ __( 'Close' ) }
79
78
  onRequestClose={ () => {
80
79
  setIsModalOpen( false );
81
80
  } }
82
81
  overlayClassName="edit-site-list__rename-modal"
83
82
  >
84
83
  <form onSubmit={ onTemplateRename }>
85
- <Flex align="flex-start" gap={ 8 }>
86
- <FlexItem>
87
- <TextControl
88
- label={ __( 'Name' ) }
89
- value={ title }
90
- onChange={ setTitle }
91
- required
92
- />
93
- </FlexItem>
94
- </Flex>
84
+ <VStack spacing="5">
85
+ <TextControl
86
+ __nextHasNoMarginBottom
87
+ label={ __( 'Name' ) }
88
+ value={ title }
89
+ onChange={ setTitle }
90
+ required
91
+ />
95
92
 
96
- <Flex
97
- className="edit-site-list__rename-modal-actions"
98
- justify="flex-end"
99
- expanded={ false }
100
- >
101
- <FlexItem>
93
+ <HStack justify="right">
102
94
  <Button
103
95
  variant="tertiary"
104
96
  onClick={ () => {
@@ -107,13 +99,12 @@ export default function RenameMenuItem( { template, onClose } ) {
107
99
  >
108
100
  { __( 'Cancel' ) }
109
101
  </Button>
110
- </FlexItem>
111
- <FlexItem>
102
+
112
103
  <Button variant="primary" type="submit">
113
104
  { __( 'Save' ) }
114
105
  </Button>
115
- </FlexItem>
116
- </Flex>
106
+ </HStack>
107
+ </VStack>
117
108
  </form>
118
109
  </Modal>
119
110
  ) }
@@ -132,10 +132,6 @@
132
132
  }
133
133
  }
134
134
 
135
- .edit-site-list__rename-modal-actions {
136
- margin-top: $grid-unit-15;
137
- }
138
-
139
135
  .edit-site-template__actions {
140
136
  button:not(:last-child) {
141
137
  margin-right: $grid-unit-10;
@@ -20,7 +20,7 @@ import NavigationMenu from './navigation-menu';
20
20
 
21
21
  const NAVIGATION_MENUS_QUERY = [ { per_page: -1, status: 'publish' } ];
22
22
 
23
- export default function NavigationInspector() {
23
+ export default function NavigationInspector( { onSelect } ) {
24
24
  const {
25
25
  selectedNavigationBlockId,
26
26
  clientIdToRef,
@@ -207,8 +207,8 @@ export default function NavigationInspector() {
207
207
  onInput={ onInput }
208
208
  >
209
209
  <NavigationMenu
210
- id={ navMenuListId }
211
210
  innerBlocks={ publishedInnerBlocks }
211
+ onSelect={ onSelect }
212
212
  />
213
213
  </BlockEditorProvider>
214
214
  ) }
@@ -2,13 +2,17 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import {
5
- __experimentalListView as ListView,
6
- __experimentalOffCanvasEditor as OffCanvasEditor,
5
+ experiments as blockEditorExperiments,
7
6
  store as blockEditorStore,
8
7
  } from '@wordpress/block-editor';
9
8
  import { useEffect } from '@wordpress/element';
10
9
  import { useDispatch } from '@wordpress/data';
11
10
 
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import { unlock } from '../../experiments';
15
+
12
16
  const ALLOWED_BLOCKS = {
13
17
  'core/navigation': [
14
18
  'core/navigation-link',
@@ -32,9 +36,11 @@ const ALLOWED_BLOCKS = {
32
36
  ],
33
37
  };
34
38
 
35
- export default function NavigationMenu( { innerBlocks, id } ) {
39
+ export default function NavigationMenu( { innerBlocks, onSelect } ) {
36
40
  const { updateBlockListSettings } = useDispatch( blockEditorStore );
37
41
 
42
+ const { OffCanvasEditor } = unlock( blockEditorExperiments );
43
+
38
44
  //TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList
39
45
  //Think through a better way of doing this, possible with adding allowed blocks to block library metadata
40
46
  useEffect( () => {
@@ -50,13 +56,5 @@ export default function NavigationMenu( { innerBlocks, id } ) {
50
56
  } );
51
57
  }, [ updateBlockListSettings, innerBlocks ] );
52
58
 
53
- if ( window?.__experimentalEnableOffCanvasNavigationEditor ) {
54
- return (
55
- <OffCanvasEditor
56
- blocks={ innerBlocks }
57
- selectBlockInCanvas={ false }
58
- />
59
- );
60
- }
61
- return <ListView id={ id } />;
59
+ return <OffCanvasEditor blocks={ innerBlocks } onSelect={ onSelect } />;
62
60
  }
@@ -44,20 +44,3 @@
44
44
  .edit-site-navigation-inspector__empty-msg {
45
45
  padding: 0 $grid-unit-10;
46
46
  }
47
-
48
- .edit-site-navigation-menu-sidebar__panel {
49
- padding: $grid-unit-20;
50
- }
51
-
52
- .edit-site-navigation-sidebar__beta {
53
- display: inline-flex;
54
- margin-left: $grid-unit-10;
55
- padding: 0 $grid-unit-10;
56
- height: $grid-unit-30;
57
- border-radius: $radius-block-ui;
58
- background-color: $gray-900;
59
- color: $white;
60
- align-items: center;
61
- font-size: $helptext-font-size;
62
- line-height: 1;
63
- }
@@ -10,6 +10,7 @@ import { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress
10
10
  import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
11
11
  import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';
12
12
  import useSyncSidebarPathWithURL from '../sync-state-with-url/use-sync-sidebar-path-with-url';
13
+ import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
13
14
 
14
15
  function SidebarScreens() {
15
16
  useSyncSidebarPathWithURL();
@@ -17,6 +18,7 @@ function SidebarScreens() {
17
18
  return (
18
19
  <>
19
20
  <SidebarNavigationScreenMain />
21
+ <SidebarNavigationScreenNavigationMenus />
20
22
  <SidebarNavigationScreenTemplates postType="wp_template" />
21
23
  <SidebarNavigationScreenTemplates postType="wp_template_part" />
22
24
  </>