@wordpress/edit-site 5.4.0 → 5.6.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 (339) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-template/add-custom-template-modal.js +12 -3
  3. package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
  4. package/build/components/add-new-template/new-template-part.js +8 -7
  5. package/build/components/add-new-template/new-template-part.js.map +1 -1
  6. package/build/components/add-new-template/new-template.js +19 -16
  7. package/build/components/add-new-template/new-template.js.map +1 -1
  8. package/build/components/app/index.js +4 -2
  9. package/build/components/app/index.js.map +1 -1
  10. package/build/components/block-editor/editor-canvas.js +2 -1
  11. package/build/components/block-editor/editor-canvas.js.map +1 -1
  12. package/build/components/editor/index.js +5 -7
  13. package/build/components/editor/index.js.map +1 -1
  14. package/build/components/global-styles/border-panel.js +20 -159
  15. package/build/components/global-styles/border-panel.js.map +1 -1
  16. package/build/components/global-styles/context-menu.js +13 -11
  17. package/build/components/global-styles/context-menu.js.map +1 -1
  18. package/build/components/global-styles/dimensions-panel.js +41 -487
  19. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  20. package/build/components/global-styles/duotone-panel.js +78 -0
  21. package/build/components/global-styles/duotone-panel.js.map +1 -0
  22. package/build/components/global-styles/filter-utils.js +17 -0
  23. package/build/components/global-styles/filter-utils.js.map +1 -0
  24. package/build/components/global-styles/hooks.js +11 -26
  25. package/build/components/global-styles/hooks.js.map +1 -1
  26. package/build/components/global-styles/preview.js +9 -5
  27. package/build/components/global-styles/preview.js.map +1 -1
  28. package/build/components/global-styles/screen-block-list.js +6 -11
  29. package/build/components/global-styles/screen-block-list.js.map +1 -1
  30. package/build/components/global-styles/screen-border.js +14 -6
  31. package/build/components/global-styles/screen-border.js.map +1 -1
  32. package/build/components/global-styles/screen-filters.js +46 -0
  33. package/build/components/global-styles/screen-filters.js.map +1 -0
  34. package/build/components/global-styles/screen-layout.js +13 -5
  35. package/build/components/global-styles/screen-layout.js.map +1 -1
  36. package/build/components/global-styles/screen-root.js +2 -1
  37. package/build/components/global-styles/screen-root.js.map +1 -1
  38. package/build/components/global-styles/screen-style-variations.js +2 -1
  39. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  40. package/build/components/global-styles/screen-variations.js +1 -1
  41. package/build/components/global-styles/screen-variations.js.map +1 -1
  42. package/build/components/global-styles/shadow-panel.js +6 -4
  43. package/build/components/global-styles/shadow-panel.js.map +1 -1
  44. package/build/components/global-styles/typography-panel.js +2 -5
  45. package/build/components/global-styles/typography-panel.js.map +1 -1
  46. package/build/components/global-styles/ui.js +7 -1
  47. package/build/components/global-styles/ui.js.map +1 -1
  48. package/build/components/keyboard-shortcut-help-modal/config.js +12 -0
  49. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  50. package/build/components/keyboard-shortcuts/edit-mode.js +124 -0
  51. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -0
  52. package/build/components/keyboard-shortcuts/global.js +48 -0
  53. package/build/components/keyboard-shortcuts/global.js.map +1 -0
  54. package/build/components/keyboard-shortcuts/index.js +67 -0
  55. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  56. package/build/components/keyboard-shortcuts/register.js +153 -0
  57. package/build/components/keyboard-shortcuts/register.js.map +1 -0
  58. package/build/components/layout/index.js +12 -1
  59. package/build/components/layout/index.js.map +1 -1
  60. package/build/components/list/added-by.js +127 -136
  61. package/build/components/list/added-by.js.map +1 -1
  62. package/build/components/list/index.js +2 -1
  63. package/build/components/list/index.js.map +1 -1
  64. package/build/components/list/table.js +9 -7
  65. package/build/components/list/table.js.map +1 -1
  66. package/build/components/routes/link.js +4 -1
  67. package/build/components/routes/link.js.map +1 -1
  68. package/build/components/save-hub/index.js +82 -0
  69. package/build/components/save-hub/index.js.map +1 -0
  70. package/build/components/save-panel/index.js +11 -1
  71. package/build/components/save-panel/index.js.map +1 -1
  72. package/build/components/sidebar/index.js +27 -17
  73. package/build/components/sidebar/index.js.map +1 -1
  74. package/build/components/sidebar-button/index.js +30 -0
  75. package/build/components/sidebar-button/index.js.map +1 -0
  76. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
  77. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  78. package/build/components/sidebar-navigation-screen/index.js +14 -11
  79. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  80. package/build/components/sidebar-navigation-screen-main/index.js +16 -16
  81. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  82. package/build/components/sidebar-navigation-screen-navigation-item/index.js +22 -26
  83. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  84. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +97 -14
  85. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  86. package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +19 -0
  87. package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +1 -0
  88. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +77 -0
  89. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -0
  90. package/build/components/sidebar-navigation-screen-template/index.js +66 -27
  91. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  92. package/build/components/sidebar-navigation-screen-templates/index.js +30 -17
  93. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  94. package/build/components/sidebar-navigation-screen-templates-browse/index.js +14 -10
  95. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  96. package/build/components/site-hub/index.js +3 -1
  97. package/build/components/site-hub/index.js.map +1 -1
  98. package/build/components/style-book/index.js +151 -21
  99. package/build/components/style-book/index.js.map +1 -1
  100. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +36 -34
  101. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  102. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +24 -8
  103. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  104. package/build/components/sync-state-with-url/use-sync-path-with-url.js +67 -18
  105. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  106. package/build/components/template-details/index.js +5 -10
  107. package/build/components/template-details/index.js.map +1 -1
  108. package/build/components/template-part-converter/convert-to-regular.js +8 -12
  109. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  110. package/build/components/template-part-converter/convert-to-template-part.js +2 -2
  111. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  112. package/build/components/template-part-converter/index.js +19 -14
  113. package/build/components/template-part-converter/index.js.map +1 -1
  114. package/build/components/use-edited-entity-record/index.js +6 -6
  115. package/build/components/use-edited-entity-record/index.js.map +1 -1
  116. package/build/index.js +13 -22
  117. package/build/index.js.map +1 -1
  118. package/build/store/actions.js +2 -2
  119. package/build/store/actions.js.map +1 -1
  120. package/build/utils/get-is-list-page.js +1 -1
  121. package/build/utils/get-is-list-page.js.map +1 -1
  122. package/build/utils/history.js +8 -2
  123. package/build/utils/history.js.map +1 -1
  124. package/build-module/components/add-new-template/add-custom-template-modal.js +13 -4
  125. package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
  126. package/build-module/components/add-new-template/new-template-part.js +8 -7
  127. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  128. package/build-module/components/add-new-template/new-template.js +21 -17
  129. package/build-module/components/add-new-template/new-template.js.map +1 -1
  130. package/build-module/components/app/index.js +3 -2
  131. package/build-module/components/app/index.js.map +1 -1
  132. package/build-module/components/block-editor/editor-canvas.js +2 -1
  133. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  134. package/build-module/components/editor/index.js +5 -6
  135. package/build-module/components/editor/index.js.map +1 -1
  136. package/build-module/components/global-styles/border-panel.js +21 -157
  137. package/build-module/components/global-styles/border-panel.js.map +1 -1
  138. package/build-module/components/global-styles/context-menu.js +14 -11
  139. package/build-module/components/global-styles/context-menu.js.map +1 -1
  140. package/build-module/components/global-styles/dimensions-panel.js +43 -480
  141. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  142. package/build-module/components/global-styles/duotone-panel.js +67 -0
  143. package/build-module/components/global-styles/duotone-panel.js.map +1 -0
  144. package/build-module/components/global-styles/filter-utils.js +9 -0
  145. package/build-module/components/global-styles/filter-utils.js.map +1 -0
  146. package/build-module/components/global-styles/hooks.js +11 -26
  147. package/build-module/components/global-styles/hooks.js.map +1 -1
  148. package/build-module/components/global-styles/preview.js +10 -6
  149. package/build-module/components/global-styles/preview.js.map +1 -1
  150. package/build-module/components/global-styles/screen-block-list.js +6 -8
  151. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  152. package/build-module/components/global-styles/screen-border.js +12 -3
  153. package/build-module/components/global-styles/screen-border.js.map +1 -1
  154. package/build-module/components/global-styles/screen-filters.js +33 -0
  155. package/build-module/components/global-styles/screen-filters.js.map +1 -0
  156. package/build-module/components/global-styles/screen-layout.js +11 -2
  157. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  158. package/build-module/components/global-styles/screen-root.js +2 -1
  159. package/build-module/components/global-styles/screen-root.js.map +1 -1
  160. package/build-module/components/global-styles/screen-style-variations.js +2 -1
  161. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  162. package/build-module/components/global-styles/screen-variations.js +1 -1
  163. package/build-module/components/global-styles/screen-variations.js.map +1 -1
  164. package/build-module/components/global-styles/shadow-panel.js +6 -4
  165. package/build-module/components/global-styles/shadow-panel.js.map +1 -1
  166. package/build-module/components/global-styles/typography-panel.js +2 -5
  167. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  168. package/build-module/components/global-styles/ui.js +6 -1
  169. package/build-module/components/global-styles/ui.js.map +1 -1
  170. package/build-module/components/keyboard-shortcut-help-modal/config.js +12 -0
  171. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  172. package/build-module/components/keyboard-shortcuts/edit-mode.js +108 -0
  173. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -0
  174. package/build-module/components/keyboard-shortcuts/global.js +37 -0
  175. package/build-module/components/keyboard-shortcuts/global.js.map +1 -0
  176. package/build-module/components/keyboard-shortcuts/index.js +65 -0
  177. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  178. package/build-module/components/keyboard-shortcuts/register.js +141 -0
  179. package/build-module/components/keyboard-shortcuts/register.js.map +1 -0
  180. package/build-module/components/layout/index.js +10 -1
  181. package/build-module/components/layout/index.js.map +1 -1
  182. package/build-module/components/list/added-by.js +126 -138
  183. package/build-module/components/list/added-by.js.map +1 -1
  184. package/build-module/components/list/index.js +2 -1
  185. package/build-module/components/list/index.js.map +1 -1
  186. package/build-module/components/list/table.js +9 -7
  187. package/build-module/components/list/table.js.map +1 -1
  188. package/build-module/components/routes/link.js +5 -2
  189. package/build-module/components/routes/link.js.map +1 -1
  190. package/build-module/components/save-hub/index.js +68 -0
  191. package/build-module/components/save-hub/index.js.map +1 -0
  192. package/build-module/components/save-panel/index.js +8 -1
  193. package/build-module/components/save-panel/index.js.map +1 -1
  194. package/build-module/components/sidebar/index.js +24 -19
  195. package/build-module/components/sidebar/index.js.map +1 -1
  196. package/build-module/components/sidebar-button/index.js +18 -0
  197. package/build-module/components/sidebar-button/index.js.map +1 -0
  198. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
  199. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  200. package/build-module/components/sidebar-navigation-screen/index.js +12 -12
  201. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  202. package/build-module/components/sidebar-navigation-screen-main/index.js +16 -16
  203. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  204. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +24 -30
  205. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  206. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +91 -14
  207. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  208. package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +11 -0
  209. package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +1 -0
  210. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +66 -0
  211. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -0
  212. package/build-module/components/sidebar-navigation-screen-template/index.js +67 -30
  213. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  214. package/build-module/components/sidebar-navigation-screen-templates/index.js +28 -18
  215. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  216. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +13 -10
  217. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  218. package/build-module/components/site-hub/index.js +3 -1
  219. package/build-module/components/site-hub/index.js.map +1 -1
  220. package/build-module/components/style-book/index.js +152 -25
  221. package/build-module/components/style-book/index.js.map +1 -1
  222. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +36 -34
  223. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  224. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +24 -8
  225. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  226. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +65 -18
  227. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  228. package/build-module/components/template-details/index.js +5 -9
  229. package/build-module/components/template-details/index.js.map +1 -1
  230. package/build-module/components/template-part-converter/convert-to-regular.js +9 -13
  231. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  232. package/build-module/components/template-part-converter/convert-to-template-part.js +3 -3
  233. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  234. package/build-module/components/template-part-converter/index.js +20 -15
  235. package/build-module/components/template-part-converter/index.js.map +1 -1
  236. package/build-module/components/use-edited-entity-record/index.js +6 -6
  237. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  238. package/build-module/index.js +16 -23
  239. package/build-module/index.js.map +1 -1
  240. package/build-module/store/actions.js +2 -2
  241. package/build-module/store/actions.js.map +1 -1
  242. package/build-module/utils/get-is-list-page.js +1 -1
  243. package/build-module/utils/get-is-list-page.js.map +1 -1
  244. package/build-module/utils/history.js +9 -3
  245. package/build-module/utils/history.js.map +1 -1
  246. package/build-style/style-rtl.css +203 -143
  247. package/build-style/style.css +203 -143
  248. package/package.json +31 -31
  249. package/src/components/add-new-template/add-custom-template-modal.js +14 -10
  250. package/src/components/add-new-template/new-template-part.js +7 -9
  251. package/src/components/add-new-template/new-template.js +60 -38
  252. package/src/components/add-new-template/style.scss +12 -6
  253. package/src/components/app/index.js +9 -6
  254. package/src/components/block-editor/editor-canvas.js +2 -1
  255. package/src/components/block-editor/style.scss +1 -1
  256. package/src/components/editor/index.js +62 -65
  257. package/src/components/editor/style.scss +0 -6
  258. package/src/components/global-styles/border-panel.js +24 -199
  259. package/src/components/global-styles/context-menu.js +18 -12
  260. package/src/components/global-styles/dimensions-panel.js +43 -577
  261. package/src/components/global-styles/duotone-panel.js +82 -0
  262. package/src/components/global-styles/filter-utils.js +9 -0
  263. package/src/components/global-styles/hooks.js +12 -36
  264. package/src/components/global-styles/preview.js +155 -140
  265. package/src/components/global-styles/screen-block-list.js +6 -11
  266. package/src/components/global-styles/screen-border.js +10 -3
  267. package/src/components/global-styles/screen-filters.js +27 -0
  268. package/src/components/global-styles/screen-layout.js +9 -2
  269. package/src/components/global-styles/screen-root.js +1 -1
  270. package/src/components/global-styles/screen-style-variations.js +5 -1
  271. package/src/components/global-styles/screen-variations.js +0 -1
  272. package/src/components/global-styles/shadow-panel.js +4 -3
  273. package/src/components/global-styles/style.scss +10 -0
  274. package/src/components/global-styles/typography-panel.js +5 -7
  275. package/src/components/global-styles/ui.js +6 -1
  276. package/src/components/keyboard-shortcut-help-modal/config.js +10 -0
  277. package/src/components/keyboard-shortcuts/edit-mode.js +116 -0
  278. package/src/components/keyboard-shortcuts/global.js +35 -0
  279. package/src/components/keyboard-shortcuts/index.js +70 -0
  280. package/src/components/keyboard-shortcuts/register.js +157 -0
  281. package/src/components/layout/index.js +19 -0
  282. package/src/components/layout/style.scss +9 -4
  283. package/src/components/list/added-by.js +152 -155
  284. package/src/components/list/index.js +3 -1
  285. package/src/components/list/style.scss +5 -13
  286. package/src/components/list/table.js +11 -9
  287. package/src/components/routes/link.js +9 -2
  288. package/src/components/save-hub/index.js +78 -0
  289. package/src/components/save-hub/style.scss +15 -0
  290. package/src/components/save-panel/index.js +8 -1
  291. package/src/components/sidebar/index.js +33 -16
  292. package/src/components/sidebar/style.scss +4 -3
  293. package/src/components/sidebar-button/index.js +21 -0
  294. package/src/components/sidebar-button/style.scss +24 -0
  295. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +3 -7
  296. package/src/components/sidebar-edit-mode/style.scss +16 -0
  297. package/src/components/sidebar-navigation-item/style.scss +1 -23
  298. package/src/components/sidebar-navigation-screen/index.js +37 -38
  299. package/src/components/sidebar-navigation-screen/style.scss +16 -9
  300. package/src/components/sidebar-navigation-screen-main/index.js +24 -11
  301. package/src/components/sidebar-navigation-screen-navigation-item/index.js +39 -26
  302. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +99 -12
  303. package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +9 -0
  304. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +78 -0
  305. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +108 -1
  306. package/src/components/sidebar-navigation-screen-template/index.js +89 -30
  307. package/src/components/sidebar-navigation-screen-template/style.scss +25 -0
  308. package/src/components/sidebar-navigation-screen-templates/index.js +29 -14
  309. package/src/components/sidebar-navigation-screen-templates/style.scss +0 -5
  310. package/src/components/sidebar-navigation-screen-templates-browse/index.js +12 -6
  311. package/src/components/site-hub/index.js +5 -1
  312. package/src/components/site-hub/style.scss +5 -1
  313. package/src/components/style-book/index.js +234 -55
  314. package/src/components/style-book/style.scss +1 -45
  315. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +28 -23
  316. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +38 -8
  317. package/src/components/sync-state-with-url/use-sync-path-with-url.js +77 -17
  318. package/src/components/template-details/index.js +4 -8
  319. package/src/components/template-part-converter/convert-to-regular.js +10 -17
  320. package/src/components/template-part-converter/convert-to-template-part.js +9 -16
  321. package/src/components/template-part-converter/index.js +28 -12
  322. package/src/components/use-edited-entity-record/index.js +26 -18
  323. package/src/index.js +11 -22
  324. package/src/store/actions.js +2 -2
  325. package/src/store/test/actions.js +0 -2
  326. package/src/style.scss +3 -1
  327. package/src/utils/get-is-list-page.js +1 -1
  328. package/src/utils/history.js +13 -9
  329. package/build/components/navigation-inspector/index.js +0 -161
  330. package/build/components/navigation-inspector/index.js.map +0 -1
  331. package/build/components/navigation-inspector/navigation-menu.js +0 -62
  332. package/build/components/navigation-inspector/navigation-menu.js.map +0 -1
  333. package/build-module/components/navigation-inspector/index.js +0 -146
  334. package/build-module/components/navigation-inspector/index.js.map +0 -1
  335. package/build-module/components/navigation-inspector/navigation-menu.js +0 -52
  336. package/build-module/components/navigation-inspector/navigation-menu.js.map +0 -1
  337. package/src/components/navigation-inspector/index.js +0 -191
  338. package/src/components/navigation-inspector/navigation-menu.js +0 -66
  339. package/src/components/navigation-inspector/style.scss +0 -46
@@ -2,18 +2,16 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
- import { useMemo } from '@wordpress/element';
6
5
 
7
6
  /**
8
7
  * Internal dependencies
9
8
  */
10
9
  import { unlock } from '../../private-apis';
11
- import { useSupportedStyles } from './hooks';
12
10
 
13
11
  const {
14
12
  useGlobalStyle,
15
13
  useGlobalSetting,
16
- overrideSettingsWithSupports,
14
+ useSettingsForBlockElement,
17
15
  TypographyPanel: StylesTypographyPanel,
18
16
  } = unlock( blockEditorPrivateApis );
19
17
 
@@ -40,10 +38,10 @@ export default function TypographyPanel( {
40
38
  } );
41
39
  const [ rawSettings ] = useGlobalSetting( '', name );
42
40
  const usedElement = element === 'heading' ? headingLevel : element;
43
- const supports = useSupportedStyles( name, usedElement );
44
- const settings = useMemo(
45
- () => overrideSettingsWithSupports( rawSettings, supports ),
46
- [ rawSettings, supports ]
41
+ const settings = useSettingsForBlockElement(
42
+ rawSettings,
43
+ name,
44
+ usedElement
47
45
  );
48
46
 
49
47
  return (
@@ -24,6 +24,7 @@ import ScreenBlockList from './screen-block-list';
24
24
  import ScreenBlock from './screen-block';
25
25
  import ScreenTypography from './screen-typography';
26
26
  import ScreenTypographyElement from './screen-typography-element';
27
+ import ScreenFilters from './screen-filters';
27
28
  import ScreenColors from './screen-colors';
28
29
  import ScreenColorPalette from './screen-color-palette';
29
30
  import ScreenBackgroundColor from './screen-background-color';
@@ -68,7 +69,7 @@ function GlobalStylesActionMenu() {
68
69
  <GlobalStylesMenuFill>
69
70
  <DropdownMenu
70
71
  icon={ moreVertical }
71
- label={ __( 'More Styles actions' ) }
72
+ label={ __( 'Styles actions' ) }
72
73
  controls={ [
73
74
  {
74
75
  title: __( 'Reset to defaults' ),
@@ -205,6 +206,10 @@ function ContextScreens( { name, parentMenu = '', variation = '' } ) {
205
206
  <ScreenBackgroundColor name={ name } variation={ variation } />
206
207
  </GlobalStylesNavigationScreen>
207
208
 
209
+ <GlobalStylesNavigationScreen path={ parentMenu + '/filters' }>
210
+ <ScreenFilters name={ name } />
211
+ </GlobalStylesNavigationScreen>
212
+
208
213
  <GlobalStylesNavigationScreen path={ parentMenu + '/colors/text' }>
209
214
  <ScreenTextColor name={ name } variation={ variation } />
210
215
  </GlobalStylesNavigationScreen>
@@ -36,4 +36,14 @@ export const textFormattingShortcuts = [
36
36
  keyCombination: { modifier: 'access', character: 'x' },
37
37
  description: __( 'Make the selected text inline code.' ),
38
38
  },
39
+ {
40
+ keyCombination: { modifier: 'access', character: '0' },
41
+ description: __( 'Convert the current heading to a paragraph.' ),
42
+ },
43
+ {
44
+ keyCombination: { modifier: 'access', character: '1-6' },
45
+ description: __(
46
+ 'Convert the current paragraph or heading to a heading of level 1 to 6.'
47
+ ),
48
+ },
39
49
  ];
@@ -0,0 +1,116 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useShortcut } from '@wordpress/keyboard-shortcuts';
5
+ import { useDispatch, useSelect } from '@wordpress/data';
6
+ import { store as coreStore } from '@wordpress/core-data';
7
+ import { store as blockEditorStore } from '@wordpress/block-editor';
8
+ import { store as interfaceStore } from '@wordpress/interface';
9
+ import { createBlock } from '@wordpress/blocks';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import { store as editSiteStore } from '../../store';
15
+ import { SIDEBAR_BLOCK } from '../sidebar-edit-mode/constants';
16
+ import { STORE_NAME } from '../../store/constants';
17
+
18
+ function KeyboardShortcutsEditMode() {
19
+ const { getEditorMode } = useSelect( editSiteStore );
20
+ const isListViewOpen = useSelect(
21
+ ( select ) => select( editSiteStore ).isListViewOpened(),
22
+ []
23
+ );
24
+ const isBlockInspectorOpen = useSelect(
25
+ ( select ) =>
26
+ select( interfaceStore ).getActiveComplementaryArea(
27
+ editSiteStore.name
28
+ ) === SIDEBAR_BLOCK,
29
+ []
30
+ );
31
+ const { redo, undo } = useDispatch( coreStore );
32
+ const { setIsListViewOpened, switchEditorMode } =
33
+ useDispatch( editSiteStore );
34
+ const { enableComplementaryArea, disableComplementaryArea } =
35
+ useDispatch( interfaceStore );
36
+
37
+ const { replaceBlocks } = useDispatch( blockEditorStore );
38
+ const { getBlockName, getSelectedBlockClientId, getBlockAttributes } =
39
+ useSelect( blockEditorStore );
40
+
41
+ const handleTextLevelShortcut = ( event, level ) => {
42
+ event.preventDefault();
43
+ const destinationBlockName =
44
+ level === 0 ? 'core/paragraph' : 'core/heading';
45
+ const currentClientId = getSelectedBlockClientId();
46
+ if ( currentClientId === null ) {
47
+ return;
48
+ }
49
+ const blockName = getBlockName( currentClientId );
50
+ if ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {
51
+ return;
52
+ }
53
+ const attributes = getBlockAttributes( currentClientId );
54
+ const textAlign =
55
+ blockName === 'core/paragraph' ? 'align' : 'textAlign';
56
+ const destinationTextAlign =
57
+ destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';
58
+
59
+ replaceBlocks(
60
+ currentClientId,
61
+ createBlock( destinationBlockName, {
62
+ level,
63
+ content: attributes.content,
64
+ ...{ [ destinationTextAlign ]: attributes[ textAlign ] },
65
+ } )
66
+ );
67
+ };
68
+
69
+ useShortcut( 'core/edit-site/undo', ( event ) => {
70
+ undo();
71
+ event.preventDefault();
72
+ } );
73
+
74
+ useShortcut( 'core/edit-site/redo', ( event ) => {
75
+ redo();
76
+ event.preventDefault();
77
+ } );
78
+
79
+ useShortcut( 'core/edit-site/toggle-list-view', () => {
80
+ setIsListViewOpened( ! isListViewOpen );
81
+ } );
82
+
83
+ useShortcut( 'core/edit-site/toggle-block-settings-sidebar', ( event ) => {
84
+ // This shortcut has no known clashes, but use preventDefault to prevent any
85
+ // obscure shortcuts from triggering.
86
+ event.preventDefault();
87
+
88
+ if ( isBlockInspectorOpen ) {
89
+ disableComplementaryArea( STORE_NAME );
90
+ } else {
91
+ enableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );
92
+ }
93
+ } );
94
+
95
+ useShortcut( 'core/edit-site/toggle-mode', () => {
96
+ switchEditorMode( getEditorMode() === 'visual' ? 'text' : 'visual' );
97
+ } );
98
+
99
+ useShortcut( 'core/edit-site/transform-heading-to-paragraph', ( event ) =>
100
+ handleTextLevelShortcut( event, 0 )
101
+ );
102
+
103
+ [ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
104
+ //the loop is based off on a constant therefore
105
+ //the hook will execute the same way every time
106
+ //eslint-disable-next-line react-hooks/rules-of-hooks
107
+ useShortcut(
108
+ `core/edit-site/transform-paragraph-to-heading-${ level }`,
109
+ ( event ) => handleTextLevelShortcut( event, level )
110
+ );
111
+ } );
112
+
113
+ return null;
114
+ }
115
+
116
+ export default KeyboardShortcutsEditMode;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useShortcut } from '@wordpress/keyboard-shortcuts';
5
+ import { useDispatch, useSelect } from '@wordpress/data';
6
+ import { store as coreStore } from '@wordpress/core-data';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import { store as editSiteStore } from '../../store';
12
+
13
+ function KeyboardShortcutsGlobal() {
14
+ const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =
15
+ useSelect( coreStore );
16
+ const { setIsSaveViewOpened } = useDispatch( editSiteStore );
17
+
18
+ useShortcut( 'core/edit-site/save', ( event ) => {
19
+ event.preventDefault();
20
+
21
+ const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
22
+ const isDirty = !! dirtyEntityRecords.length;
23
+ const isSaving = dirtyEntityRecords.some( ( record ) =>
24
+ isSavingEntityRecord( record.kind, record.name, record.key )
25
+ );
26
+
27
+ if ( ! isSaving && isDirty ) {
28
+ setIsSaveViewOpened( true );
29
+ }
30
+ } );
31
+
32
+ return null;
33
+ }
34
+
35
+ export default KeyboardShortcutsGlobal;
@@ -10,7 +10,9 @@ import { isAppleOS } from '@wordpress/keycodes';
10
10
  import { useDispatch, useSelect } from '@wordpress/data';
11
11
  import { __ } from '@wordpress/i18n';
12
12
  import { store as coreStore } from '@wordpress/core-data';
13
+ import { store as blockEditorStore } from '@wordpress/block-editor';
13
14
  import { store as interfaceStore } from '@wordpress/interface';
15
+ import { createBlock } from '@wordpress/blocks';
14
16
 
15
17
  /**
16
18
  * Internal dependencies
@@ -41,6 +43,38 @@ function KeyboardShortcuts() {
41
43
  useDispatch( interfaceStore );
42
44
  const { setIsSaveViewOpened } = useDispatch( editSiteStore );
43
45
 
46
+ const { replaceBlocks } = useDispatch( blockEditorStore );
47
+ const { getBlockName, getSelectedBlockClientId, getBlockAttributes } =
48
+ useSelect( blockEditorStore );
49
+
50
+ const handleTextLevelShortcut = ( event, level ) => {
51
+ event.preventDefault();
52
+ const destinationBlockName =
53
+ level === 0 ? 'core/paragraph' : 'core/heading';
54
+ const currentClientId = getSelectedBlockClientId();
55
+ if ( currentClientId === null ) {
56
+ return;
57
+ }
58
+ const blockName = getBlockName( currentClientId );
59
+ if ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {
60
+ return;
61
+ }
62
+ const attributes = getBlockAttributes( currentClientId );
63
+ const textAlign =
64
+ blockName === 'core/paragraph' ? 'align' : 'textAlign';
65
+ const destinationTextAlign =
66
+ destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';
67
+
68
+ replaceBlocks(
69
+ currentClientId,
70
+ createBlock( destinationBlockName, {
71
+ level,
72
+ content: attributes.content,
73
+ ...{ [ destinationTextAlign ]: attributes[ textAlign ] },
74
+ } )
75
+ );
76
+ };
77
+
44
78
  useShortcut( 'core/edit-site/save', ( event ) => {
45
79
  event.preventDefault();
46
80
 
@@ -85,6 +119,20 @@ function KeyboardShortcuts() {
85
119
  switchEditorMode( getEditorMode() === 'visual' ? 'text' : 'visual' );
86
120
  } );
87
121
 
122
+ useShortcut( 'core/edit-site/transform-heading-to-paragraph', ( event ) =>
123
+ handleTextLevelShortcut( event, 0 )
124
+ );
125
+
126
+ [ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
127
+ //the loop is based off on a constant therefore
128
+ //the hook will execute the same way every time
129
+ //eslint-disable-next-line react-hooks/rules-of-hooks
130
+ useShortcut(
131
+ `core/edit-site/transform-paragraph-to-heading-${ level }`,
132
+ ( event ) => handleTextLevelShortcut( event, level )
133
+ );
134
+ } );
135
+
88
136
  return null;
89
137
  }
90
138
 
@@ -208,6 +256,28 @@ function KeyboardShortcutsRegister() {
208
256
  character: 'm',
209
257
  },
210
258
  } );
259
+
260
+ registerShortcut( {
261
+ name: `core/edit-site/transform-heading-to-paragraph`,
262
+ category: 'block-library',
263
+ description: __( 'Transform heading to paragraph.' ),
264
+ keyCombination: {
265
+ modifier: 'access',
266
+ character: `0`,
267
+ },
268
+ } );
269
+
270
+ [ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
271
+ registerShortcut( {
272
+ name: `core/edit-site/transform-paragraph-to-heading-${ level }`,
273
+ category: 'block-library',
274
+ description: __( 'Transform paragraph to heading.' ),
275
+ keyCombination: {
276
+ modifier: 'access',
277
+ character: `${ level }`,
278
+ },
279
+ } );
280
+ } );
211
281
  }, [ registerShortcut ] );
212
282
 
213
283
  return null;
@@ -0,0 +1,157 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useEffect } from '@wordpress/element';
5
+ import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
6
+ import { isAppleOS } from '@wordpress/keycodes';
7
+ import { useDispatch } from '@wordpress/data';
8
+ import { __ } from '@wordpress/i18n';
9
+
10
+ function KeyboardShortcutsRegister() {
11
+ // Registering the shortcuts.
12
+ const { registerShortcut } = useDispatch( keyboardShortcutsStore );
13
+ useEffect( () => {
14
+ registerShortcut( {
15
+ name: 'core/edit-site/save',
16
+ category: 'global',
17
+ description: __( 'Save your changes.' ),
18
+ keyCombination: {
19
+ modifier: 'primary',
20
+ character: 's',
21
+ },
22
+ } );
23
+
24
+ registerShortcut( {
25
+ name: 'core/edit-site/undo',
26
+ category: 'global',
27
+ description: __( 'Undo your last changes.' ),
28
+ keyCombination: {
29
+ modifier: 'primary',
30
+ character: 'z',
31
+ },
32
+ } );
33
+
34
+ registerShortcut( {
35
+ name: 'core/edit-site/redo',
36
+ category: 'global',
37
+ description: __( 'Redo your last undo.' ),
38
+ keyCombination: {
39
+ modifier: 'primaryShift',
40
+ character: 'z',
41
+ },
42
+ // Disable on Apple OS because it conflicts with the browser's
43
+ // history shortcut. It's a fine alias for both Windows and Linux.
44
+ // Since there's no conflict for Ctrl+Shift+Z on both Windows and
45
+ // Linux, we keep it as the default for consistency.
46
+ aliases: isAppleOS()
47
+ ? []
48
+ : [
49
+ {
50
+ modifier: 'primary',
51
+ character: 'y',
52
+ },
53
+ ],
54
+ } );
55
+
56
+ registerShortcut( {
57
+ name: 'core/edit-site/toggle-list-view',
58
+ category: 'global',
59
+ description: __( 'Open the block list view.' ),
60
+ keyCombination: {
61
+ modifier: 'access',
62
+ character: 'o',
63
+ },
64
+ } );
65
+
66
+ registerShortcut( {
67
+ name: 'core/edit-site/toggle-block-settings-sidebar',
68
+ category: 'global',
69
+ description: __( 'Show or hide the block settings sidebar.' ),
70
+ keyCombination: {
71
+ modifier: 'primaryShift',
72
+ character: ',',
73
+ },
74
+ } );
75
+
76
+ registerShortcut( {
77
+ name: 'core/edit-site/keyboard-shortcuts',
78
+ category: 'main',
79
+ description: __( 'Display these keyboard shortcuts.' ),
80
+ keyCombination: {
81
+ modifier: 'access',
82
+ character: 'h',
83
+ },
84
+ } );
85
+
86
+ registerShortcut( {
87
+ name: 'core/edit-site/next-region',
88
+ category: 'global',
89
+ description: __( 'Navigate to the next part of the editor.' ),
90
+ keyCombination: {
91
+ modifier: 'ctrl',
92
+ character: '`',
93
+ },
94
+ aliases: [
95
+ {
96
+ modifier: 'access',
97
+ character: 'n',
98
+ },
99
+ ],
100
+ } );
101
+
102
+ registerShortcut( {
103
+ name: 'core/edit-site/previous-region',
104
+ category: 'global',
105
+ description: __( 'Navigate to the previous part of the editor.' ),
106
+ keyCombination: {
107
+ modifier: 'ctrlShift',
108
+ character: '`',
109
+ },
110
+ aliases: [
111
+ {
112
+ modifier: 'access',
113
+ character: 'p',
114
+ },
115
+ {
116
+ modifier: 'ctrlShift',
117
+ character: '~',
118
+ },
119
+ ],
120
+ } );
121
+ registerShortcut( {
122
+ name: 'core/edit-site/toggle-mode',
123
+ category: 'global',
124
+ description: __( 'Switch between visual editor and code editor.' ),
125
+ keyCombination: {
126
+ modifier: 'secondary',
127
+ character: 'm',
128
+ },
129
+ } );
130
+
131
+ registerShortcut( {
132
+ name: `core/edit-site/transform-heading-to-paragraph`,
133
+ category: 'block-library',
134
+ description: __( 'Transform heading to paragraph.' ),
135
+ keyCombination: {
136
+ modifier: 'access',
137
+ character: `0`,
138
+ },
139
+ } );
140
+
141
+ [ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
142
+ registerShortcut( {
143
+ name: `core/edit-site/transform-paragraph-to-heading-${ level }`,
144
+ category: 'block-library',
145
+ description: __( 'Transform paragraph to heading.' ),
146
+ keyCombination: {
147
+ modifier: 'access',
148
+ character: `${ level }`,
149
+ },
150
+ } );
151
+ } );
152
+ }, [ registerShortcut ] );
153
+
154
+ return null;
155
+ }
156
+
157
+ export default KeyboardShortcutsRegister;
@@ -40,6 +40,8 @@ import ResizeHandle from '../block-editor/resize-handle';
40
40
  import useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';
41
41
  import { unlock } from '../../private-apis';
42
42
  import SavePanel from '../save-panel';
43
+ import KeyboardShortcutsRegister from '../keyboard-shortcuts/register';
44
+ import KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';
43
45
 
44
46
  const ANIMATION_DURATION = 0.5;
45
47
  const emptyResizeHandleStyles = {
@@ -121,6 +123,8 @@ export default function Layout() {
121
123
 
122
124
  return (
123
125
  <>
126
+ <KeyboardShortcutsRegister />
127
+ <KeyboardShortcutsGlobal />
124
128
  { fullResizer }
125
129
  <div
126
130
  { ...navigateRegionsProps }
@@ -273,6 +277,21 @@ export default function Layout() {
273
277
  { canvasResizer }
274
278
  { !! canvasSize.width && (
275
279
  <motion.div
280
+ whileHover={
281
+ isEditorPage && canvasMode === 'view'
282
+ ? {
283
+ scale: 1.005,
284
+ transition: {
285
+ duration:
286
+ disableMotion ||
287
+ isResizing
288
+ ? 0
289
+ : 0.5,
290
+ ease: 'easeOut',
291
+ },
292
+ }
293
+ : {}
294
+ }
276
295
  initial={ false }
277
296
  layout="position"
278
297
  className="edit-site-layout__canvas"
@@ -49,11 +49,9 @@
49
49
  }
50
50
 
51
51
  .edit-site-layout__content {
52
+ height: 100%;
52
53
  flex-grow: 1;
53
54
  display: flex;
54
-
55
- // Hide scrollbars during the edit/view animation.
56
- overflow: hidden;
57
55
  }
58
56
 
59
57
  .edit-site-layout__sidebar {
@@ -207,10 +205,17 @@
207
205
 
208
206
  &:focus,
209
207
  &:focus-within {
210
- top: 0;
208
+ top: auto;
211
209
  bottom: 0;
212
210
  }
213
211
 
212
+ &.is-entity-save-view-open {
213
+ &:focus,
214
+ &:focus-within {
215
+ top: 0;
216
+ }
217
+ }
218
+
214
219
  @include break-medium {
215
220
  border-left: $border-width solid $gray-300;
216
221
  }