@wordpress/edit-site 5.6.0 → 5.8.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 (279) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-template/new-template-part.js +3 -11
  3. package/build/components/add-new-template/new-template-part.js.map +1 -1
  4. package/build/components/add-new-template/new-template.js +7 -7
  5. package/build/components/add-new-template/new-template.js.map +1 -1
  6. package/build/components/add-new-template/utils.js +1 -1
  7. package/build/components/add-new-template/utils.js.map +1 -1
  8. package/build/components/block-editor/editor-canvas.js +7 -10
  9. package/build/components/block-editor/editor-canvas.js.map +1 -1
  10. package/build/components/editor/index.js +6 -4
  11. package/build/components/editor/index.js.map +1 -1
  12. package/build/components/global-styles/border-panel.js +35 -1
  13. package/build/components/global-styles/border-panel.js.map +1 -1
  14. package/build/components/global-styles/context-menu.js +8 -11
  15. package/build/components/global-styles/context-menu.js.map +1 -1
  16. package/build/components/global-styles/dimensions-panel.js +11 -1
  17. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  18. package/build/components/global-styles/effects-panel.js +53 -0
  19. package/build/components/global-styles/effects-panel.js.map +1 -0
  20. package/build/components/global-styles/filters-panel.js +45 -0
  21. package/build/components/global-styles/filters-panel.js.map +1 -0
  22. package/build/components/global-styles/global-styles-provider.js +7 -4
  23. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  24. package/build/components/global-styles/hooks.js +1 -58
  25. package/build/components/global-styles/hooks.js.map +1 -1
  26. package/build/components/global-styles/preview.js +4 -5
  27. package/build/components/global-styles/preview.js.map +1 -1
  28. package/build/components/global-styles/screen-block-list.js +17 -12
  29. package/build/components/global-styles/screen-block-list.js.map +1 -1
  30. package/build/components/global-styles/screen-colors.js +22 -211
  31. package/build/components/global-styles/screen-colors.js.map +1 -1
  32. package/build/components/global-styles/screen-css.js +1 -1
  33. package/build/components/global-styles/screen-css.js.map +1 -1
  34. package/build/components/global-styles/screen-effects.js +15 -7
  35. package/build/components/global-styles/screen-effects.js.map +1 -1
  36. package/build/components/global-styles/screen-filters.js +2 -2
  37. package/build/components/global-styles/screen-filters.js.map +1 -1
  38. package/build/components/global-styles/screen-style-variations.js +8 -118
  39. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  40. package/build/components/global-styles/screen-typography-element.js +4 -0
  41. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  42. package/build/components/global-styles/screen-typography.js +5 -0
  43. package/build/components/global-styles/screen-typography.js.map +1 -1
  44. package/build/components/global-styles/style-variations-container.js +149 -0
  45. package/build/components/global-styles/style-variations-container.js.map +1 -0
  46. package/build/components/global-styles/ui.js +51 -37
  47. package/build/components/global-styles/ui.js.map +1 -1
  48. package/build/components/global-styles-renderer/index.js +1 -2
  49. package/build/components/global-styles-renderer/index.js.map +1 -1
  50. package/build/components/header-edit-mode/more-menu/index.js +1 -1
  51. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  52. package/build/components/keyboard-shortcuts/index.js +0 -137
  53. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  54. package/build/components/layout/index.js +8 -1
  55. package/build/components/layout/index.js.map +1 -1
  56. package/build/components/preferences-modal/index.js +4 -0
  57. package/build/components/preferences-modal/index.js.map +1 -1
  58. package/build/components/secondary-sidebar/list-view-sidebar.js +6 -1
  59. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  60. package/build/components/sidebar/index.js +4 -0
  61. package/build/components/sidebar/index.js.map +1 -1
  62. package/build/components/sidebar-navigation-screen/index.js +8 -6
  63. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  64. package/build/components/sidebar-navigation-screen-global-styles/index.js +58 -0
  65. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -0
  66. package/build/components/sidebar-navigation-screen-main/index.js +5 -0
  67. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  68. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +114 -9
  69. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  70. package/build/components/site-hub/index.js +4 -3
  71. package/build/components/site-hub/index.js.map +1 -1
  72. package/build/components/start-template-options/index.js +44 -9
  73. package/build/components/start-template-options/index.js.map +1 -1
  74. package/build/components/style-book/index.js +6 -7
  75. package/build/components/style-book/index.js.map +1 -1
  76. package/build/components/welcome-guide/styles.js +1 -1
  77. package/build/components/welcome-guide/styles.js.map +1 -1
  78. package/build/hooks/commands/index.js +19 -0
  79. package/build/hooks/commands/index.js.map +1 -0
  80. package/build/hooks/commands/use-navigation-commands.js +117 -0
  81. package/build/hooks/commands/use-navigation-commands.js.map +1 -0
  82. package/build/hooks/commands/use-wp-admin-commands.js +94 -0
  83. package/build/hooks/commands/use-wp-admin-commands.js.map +1 -0
  84. package/build/hooks/push-changes-to-global-styles/index.js +1 -0
  85. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  86. package/build/hooks/template-part-edit.js +2 -1
  87. package/build/hooks/template-part-edit.js.map +1 -1
  88. package/build/index.js +2 -1
  89. package/build/index.js.map +1 -1
  90. package/build/store/selectors.js +2 -1
  91. package/build/store/selectors.js.map +1 -1
  92. package/build-module/components/add-new-template/new-template-part.js +3 -9
  93. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  94. package/build-module/components/add-new-template/new-template.js +7 -7
  95. package/build-module/components/add-new-template/new-template.js.map +1 -1
  96. package/build-module/components/add-new-template/utils.js +1 -1
  97. package/build-module/components/add-new-template/utils.js.map +1 -1
  98. package/build-module/components/block-editor/editor-canvas.js +8 -11
  99. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  100. package/build-module/components/editor/index.js +6 -4
  101. package/build-module/components/editor/index.js.map +1 -1
  102. package/build-module/components/global-styles/border-panel.js +34 -1
  103. package/build-module/components/global-styles/border-panel.js.map +1 -1
  104. package/build-module/components/global-styles/context-menu.js +8 -8
  105. package/build-module/components/global-styles/context-menu.js.map +1 -1
  106. package/build-module/components/global-styles/dimensions-panel.js +11 -1
  107. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  108. package/build-module/components/global-styles/effects-panel.js +43 -0
  109. package/build-module/components/global-styles/effects-panel.js.map +1 -0
  110. package/build-module/components/global-styles/filters-panel.js +35 -0
  111. package/build-module/components/global-styles/filters-panel.js.map +1 -0
  112. package/build-module/components/global-styles/global-styles-provider.js +8 -5
  113. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  114. package/build-module/components/global-styles/hooks.js +1 -52
  115. package/build-module/components/global-styles/hooks.js.map +1 -1
  116. package/build-module/components/global-styles/preview.js +4 -5
  117. package/build-module/components/global-styles/preview.js.map +1 -1
  118. package/build-module/components/global-styles/screen-block-list.js +16 -11
  119. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  120. package/build-module/components/global-styles/screen-colors.js +23 -208
  121. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  122. package/build-module/components/global-styles/screen-css.js +1 -1
  123. package/build-module/components/global-styles/screen-css.js.map +1 -1
  124. package/build-module/components/global-styles/screen-effects.js +13 -4
  125. package/build-module/components/global-styles/screen-effects.js.map +1 -1
  126. package/build-module/components/global-styles/screen-filters.js +2 -2
  127. package/build-module/components/global-styles/screen-filters.js.map +1 -1
  128. package/build-module/components/global-styles/screen-style-variations.js +11 -114
  129. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  130. package/build-module/components/global-styles/screen-typography-element.js +4 -0
  131. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  132. package/build-module/components/global-styles/screen-typography.js +5 -0
  133. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  134. package/build-module/components/global-styles/style-variations-container.js +130 -0
  135. package/build-module/components/global-styles/style-variations-container.js.map +1 -0
  136. package/build-module/components/global-styles/ui.js +49 -33
  137. package/build-module/components/global-styles/ui.js.map +1 -1
  138. package/build-module/components/global-styles-renderer/index.js +1 -2
  139. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  140. package/build-module/components/header-edit-mode/more-menu/index.js +1 -1
  141. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  142. package/build-module/components/keyboard-shortcuts/index.js +1 -135
  143. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  144. package/build-module/components/layout/index.js +6 -1
  145. package/build-module/components/layout/index.js.map +1 -1
  146. package/build-module/components/preferences-modal/index.js +4 -0
  147. package/build-module/components/preferences-modal/index.js.map +1 -1
  148. package/build-module/components/secondary-sidebar/list-view-sidebar.js +6 -2
  149. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  150. package/build-module/components/sidebar/index.js +3 -0
  151. package/build-module/components/sidebar/index.js.map +1 -1
  152. package/build-module/components/sidebar-navigation-screen/index.js +9 -7
  153. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  154. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +41 -0
  155. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -0
  156. package/build-module/components/sidebar-navigation-screen-main/index.js +6 -1
  157. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  158. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +113 -11
  159. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  160. package/build-module/components/site-hub/index.js +3 -3
  161. package/build-module/components/site-hub/index.js.map +1 -1
  162. package/build-module/components/start-template-options/index.js +45 -10
  163. package/build-module/components/start-template-options/index.js.map +1 -1
  164. package/build-module/components/style-book/index.js +7 -8
  165. package/build-module/components/style-book/index.js.map +1 -1
  166. package/build-module/components/welcome-guide/styles.js +1 -1
  167. package/build-module/components/welcome-guide/styles.js.map +1 -1
  168. package/build-module/hooks/commands/index.js +10 -0
  169. package/build-module/hooks/commands/index.js.map +1 -0
  170. package/build-module/hooks/commands/use-navigation-commands.js +101 -0
  171. package/build-module/hooks/commands/use-navigation-commands.js.map +1 -0
  172. package/build-module/hooks/commands/use-wp-admin-commands.js +79 -0
  173. package/build-module/hooks/commands/use-wp-admin-commands.js.map +1 -0
  174. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -0
  175. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  176. package/build-module/hooks/template-part-edit.js +2 -1
  177. package/build-module/hooks/template-part-edit.js.map +1 -1
  178. package/build-module/index.js +2 -1
  179. package/build-module/index.js.map +1 -1
  180. package/build-module/store/selectors.js +2 -1
  181. package/build-module/store/selectors.js.map +1 -1
  182. package/build-style/style-rtl.css +24 -63
  183. package/build-style/style.css +24 -63
  184. package/package.json +33 -31
  185. package/src/components/add-new-template/new-template-part.js +1 -6
  186. package/src/components/add-new-template/new-template.js +3 -6
  187. package/src/components/add-new-template/utils.js +1 -1
  188. package/src/components/block-editor/editor-canvas.js +13 -23
  189. package/src/components/editor/index.js +11 -3
  190. package/src/components/global-styles/border-panel.js +32 -1
  191. package/src/components/global-styles/context-menu.js +8 -8
  192. package/src/components/global-styles/dimensions-panel.js +11 -0
  193. package/src/components/global-styles/effects-panel.js +40 -0
  194. package/src/components/global-styles/filters-panel.js +33 -0
  195. package/src/components/global-styles/global-styles-provider.js +4 -4
  196. package/src/components/global-styles/hooks.js +1 -78
  197. package/src/components/global-styles/preview.js +2 -2
  198. package/src/components/global-styles/screen-block-list.js +11 -7
  199. package/src/components/global-styles/screen-colors.js +25 -229
  200. package/src/components/global-styles/screen-css.js +1 -1
  201. package/src/components/global-styles/screen-effects.js +12 -5
  202. package/src/components/global-styles/screen-filters.js +2 -2
  203. package/src/components/global-styles/screen-style-variations.js +10 -129
  204. package/src/components/global-styles/screen-typography-element.js +4 -0
  205. package/src/components/global-styles/screen-typography.js +6 -0
  206. package/src/components/global-styles/stories/index.js +425 -0
  207. package/src/components/global-styles/style-variations-container.js +136 -0
  208. package/src/components/global-styles/style.scss +4 -57
  209. package/src/components/global-styles/ui.js +50 -33
  210. package/src/components/global-styles-renderer/index.js +1 -2
  211. package/src/components/header-edit-mode/more-menu/index.js +1 -1
  212. package/src/components/keyboard-shortcuts/index.js +1 -155
  213. package/src/components/layout/index.js +4 -0
  214. package/src/components/preferences-modal/index.js +7 -0
  215. package/src/components/secondary-sidebar/list-view-sidebar.js +4 -3
  216. package/src/components/sidebar/index.js +4 -0
  217. package/src/components/sidebar-navigation-screen/index.js +10 -5
  218. package/src/components/sidebar-navigation-screen/style.scss +20 -5
  219. package/src/components/sidebar-navigation-screen-global-styles/index.js +41 -0
  220. package/src/components/sidebar-navigation-screen-main/index.js +9 -1
  221. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +134 -9
  222. package/src/components/site-hub/index.js +3 -3
  223. package/src/components/start-template-options/index.js +40 -8
  224. package/src/components/start-template-options/style.scss +7 -14
  225. package/src/components/style-book/index.js +10 -16
  226. package/src/components/style-book/style.scss +1 -1
  227. package/src/components/welcome-guide/styles.js +1 -1
  228. package/src/hooks/commands/index.js +10 -0
  229. package/src/hooks/commands/use-navigation-commands.js +103 -0
  230. package/src/hooks/commands/use-wp-admin-commands.js +77 -0
  231. package/src/hooks/push-changes-to-global-styles/index.js +1 -0
  232. package/src/hooks/template-part-edit.js +1 -0
  233. package/src/index.js +1 -0
  234. package/src/store/selectors.js +2 -1
  235. package/build/components/global-styles/color-utils.js +0 -17
  236. package/build/components/global-styles/color-utils.js.map +0 -1
  237. package/build/components/global-styles/duotone-panel.js +0 -78
  238. package/build/components/global-styles/duotone-panel.js.map +0 -1
  239. package/build/components/global-styles/filter-utils.js +0 -17
  240. package/build/components/global-styles/filter-utils.js.map +0 -1
  241. package/build/components/global-styles/screen-background-color.js +0 -114
  242. package/build/components/global-styles/screen-background-color.js.map +0 -1
  243. package/build/components/global-styles/screen-button-color.js +0 -88
  244. package/build/components/global-styles/screen-button-color.js.map +0 -1
  245. package/build/components/global-styles/screen-heading-color.js +0 -165
  246. package/build/components/global-styles/screen-heading-color.js.map +0 -1
  247. package/build/components/global-styles/screen-link-color.js +0 -105
  248. package/build/components/global-styles/screen-link-color.js.map +0 -1
  249. package/build/components/global-styles/screen-text-color.js +0 -71
  250. package/build/components/global-styles/screen-text-color.js.map +0 -1
  251. package/build/components/global-styles/shadow-panel.js +0 -197
  252. package/build/components/global-styles/shadow-panel.js.map +0 -1
  253. package/build-module/components/global-styles/color-utils.js +0 -9
  254. package/build-module/components/global-styles/color-utils.js.map +0 -1
  255. package/build-module/components/global-styles/duotone-panel.js +0 -67
  256. package/build-module/components/global-styles/duotone-panel.js.map +0 -1
  257. package/build-module/components/global-styles/filter-utils.js +0 -9
  258. package/build-module/components/global-styles/filter-utils.js.map +0 -1
  259. package/build-module/components/global-styles/screen-background-color.js +0 -97
  260. package/build-module/components/global-styles/screen-background-color.js.map +0 -1
  261. package/build-module/components/global-styles/screen-button-color.js +0 -73
  262. package/build-module/components/global-styles/screen-button-color.js.map +0 -1
  263. package/build-module/components/global-styles/screen-heading-color.js +0 -149
  264. package/build-module/components/global-styles/screen-heading-color.js.map +0 -1
  265. package/build-module/components/global-styles/screen-link-color.js +0 -89
  266. package/build-module/components/global-styles/screen-link-color.js.map +0 -1
  267. package/build-module/components/global-styles/screen-text-color.js +0 -56
  268. package/build-module/components/global-styles/screen-text-color.js.map +0 -1
  269. package/build-module/components/global-styles/shadow-panel.js +0 -178
  270. package/build-module/components/global-styles/shadow-panel.js.map +0 -1
  271. package/src/components/global-styles/color-utils.js +0 -14
  272. package/src/components/global-styles/duotone-panel.js +0 -82
  273. package/src/components/global-styles/filter-utils.js +0 -9
  274. package/src/components/global-styles/screen-background-color.js +0 -132
  275. package/src/components/global-styles/screen-button-color.js +0 -104
  276. package/src/components/global-styles/screen-heading-color.js +0 -206
  277. package/src/components/global-styles/screen-link-color.js +0 -124
  278. package/src/components/global-styles/screen-text-color.js +0 -62
  279. package/src/components/global-styles/shadow-panel.js +0 -178
@@ -983,7 +983,6 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
983
983
  max-width: 100%;
984
984
  }
985
985
 
986
- .edit-site-global-styles-screen-heading-color,
987
986
  .edit-site-global-styles-screen-typography,
988
987
  .edit-site-global-styles-screen-css {
989
988
  margin: 16px;
@@ -1002,9 +1001,10 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1002
1001
  .edit-site-global-styles-screen-colors {
1003
1002
  margin: 16px;
1004
1003
  }
1005
- .edit-site-global-styles-screen-colors .component-color-indicator {
1006
- background: #fff linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
1007
- flex-shrink: 0;
1004
+ .edit-site-global-styles-screen-colors .color-block-support-panel {
1005
+ padding-left: 0;
1006
+ padding-right: 0;
1007
+ border-top: none;
1008
1008
  }
1009
1009
 
1010
1010
  .edit-site-global-styles-header__description {
@@ -1036,13 +1036,6 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1036
1036
  margin: 0;
1037
1037
  }
1038
1038
 
1039
- .edit-site-screen-text-color__control,
1040
- .edit-site-screen-link-color__control,
1041
- .edit-site-screen-button-color__control,
1042
- .edit-site-screen-background-color__control.has-no-tabs {
1043
- padding: 16px;
1044
- }
1045
-
1046
1039
  .edit-site-global-styles-variations_item {
1047
1040
  box-sizing: border-box;
1048
1041
  }
@@ -1070,12 +1063,6 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1070
1063
  flex-shrink: 0;
1071
1064
  }
1072
1065
 
1073
- .edit-site-global-styles__color-label {
1074
- white-space: nowrap;
1075
- overflow: hidden;
1076
- text-overflow: ellipsis;
1077
- }
1078
-
1079
1066
  .edit-site-global-styles__block-preview-panel {
1080
1067
  position: relative;
1081
1068
  width: 100%;
@@ -1146,40 +1133,6 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1146
1133
  flex-direction: column;
1147
1134
  }
1148
1135
 
1149
- .edit-site-global-styles__shadow-panel {
1150
- width: 230px;
1151
- }
1152
-
1153
- .edit-site-global-styles__shadow-dropdown {
1154
- display: block;
1155
- padding: 0;
1156
- }
1157
- .edit-site-global-styles__shadow-dropdown > button {
1158
- width: 100%;
1159
- padding: 8px;
1160
- }
1161
- .edit-site-global-styles__shadow-dropdown > button.is-open {
1162
- background-color: #f0f0f0;
1163
- }
1164
-
1165
- .edit-site-global-styles__shadow-indicator-wrapper {
1166
- padding: 6px;
1167
- overflow: hidden;
1168
- display: flex;
1169
- align-items: center;
1170
- justify-content: center;
1171
- }
1172
-
1173
- .edit-site-global-styles__shadow-indicator {
1174
- color: #2f2f2f;
1175
- border: #e0e0e0 1px solid;
1176
- border-radius: 2px;
1177
- cursor: pointer;
1178
- padding: 0;
1179
- height: 24px;
1180
- width: 24px;
1181
- }
1182
-
1183
1136
  .edit-site-global-styles-screen-root.edit-site-global-styles-screen-root,
1184
1137
  .edit-site-global-styles-screen-style-variations.edit-site-global-styles-screen-style-variations {
1185
1138
  background: unset;
@@ -2107,7 +2060,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2107
2060
  }
2108
2061
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container {
2109
2062
  height: 100%;
2110
- box-shadow: 0 0 0 1px #ddd;
2111
2063
  }
2112
2064
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__content {
2113
2065
  width: 100%;
@@ -2116,12 +2068,8 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2116
2068
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-patterns-list__item-title {
2117
2069
  display: none;
2118
2070
  }
2119
- .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item:hover .block-editor-block-preview__container {
2120
- box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
2121
- }
2122
- .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item:focus .block-editor-block-preview__container {
2123
- box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
2124
- outline: 2px solid transparent;
2071
+ .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__item:not(:focus):not(:hover) .block-editor-block-preview__container {
2072
+ box-shadow: 0 0 0 1px #ddd;
2125
2073
  }
2126
2074
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item:nth-last-child(2) .block-editor-block-preview__container {
2127
2075
  position: absolute;
@@ -2514,15 +2462,28 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2514
2462
  margin-bottom: 8px;
2515
2463
  padding-bottom: 8px;
2516
2464
  padding-right: 16px;
2465
+ z-index: 1;
2517
2466
  }
2518
2467
 
2519
2468
  .edit-site-sidebar-navigation-screen__title {
2520
- font-size: calc(1.56 * 13px);
2521
- line-height: normal;
2522
- font-weight: 500;
2523
2469
  flex-grow: 1;
2524
- color: #fff;
2525
- margin: 0;
2470
+ padding: 6px 0 0 0;
2471
+ }
2472
+
2473
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container {
2474
+ margin-left: 16px;
2475
+ }
2476
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item-preview {
2477
+ border: #1e1e1e 1px solid;
2478
+ }
2479
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item.is-active .edit-site-global-styles-variations_item-preview {
2480
+ border: #f0f0f0 1px solid;
2481
+ }
2482
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item:hover .edit-site-global-styles-variations_item-preview {
2483
+ border: var(--wp-admin-theme-color) 1px solid;
2484
+ }
2485
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item:focus .edit-site-global-styles-variations_item-preview {
2486
+ border: var(--wp-admin-theme-color) var(--wp-admin-border-width-focus) solid;
2526
2487
  }
2527
2488
 
2528
2489
  .edit-site-sidebar-navigation-screen-template__added-by-description {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "5.6.0",
3
+ "version": "5.8.0",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,35 +27,37 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.29.0",
31
- "@wordpress/api-fetch": "^6.26.0",
32
- "@wordpress/block-editor": "^11.6.0",
33
- "@wordpress/block-library": "^8.6.0",
34
- "@wordpress/blocks": "^12.6.0",
35
- "@wordpress/components": "^23.6.0",
36
- "@wordpress/compose": "^6.6.0",
37
- "@wordpress/core-data": "^6.6.0",
38
- "@wordpress/data": "^8.6.0",
39
- "@wordpress/deprecated": "^3.29.0",
40
- "@wordpress/editor": "^13.6.0",
41
- "@wordpress/element": "^5.6.0",
42
- "@wordpress/hooks": "^3.29.0",
43
- "@wordpress/html-entities": "^3.29.0",
44
- "@wordpress/i18n": "^4.29.0",
45
- "@wordpress/icons": "^9.20.0",
46
- "@wordpress/interface": "^5.6.0",
47
- "@wordpress/keyboard-shortcuts": "^4.6.0",
48
- "@wordpress/keycodes": "^3.29.0",
49
- "@wordpress/media-utils": "^4.20.0",
50
- "@wordpress/notices": "^3.29.0",
51
- "@wordpress/plugins": "^5.6.0",
52
- "@wordpress/preferences": "^3.6.0",
53
- "@wordpress/private-apis": "^0.11.0",
54
- "@wordpress/reusable-blocks": "^4.6.0",
55
- "@wordpress/style-engine": "^1.12.0",
56
- "@wordpress/url": "^3.30.0",
57
- "@wordpress/viewport": "^5.6.0",
58
- "@wordpress/widgets": "^3.6.0",
30
+ "@wordpress/a11y": "^3.31.0",
31
+ "@wordpress/api-fetch": "^6.28.0",
32
+ "@wordpress/block-editor": "^11.8.0",
33
+ "@wordpress/block-library": "^8.8.0",
34
+ "@wordpress/blocks": "^12.8.0",
35
+ "@wordpress/commands": "^0.2.0",
36
+ "@wordpress/components": "^23.8.0",
37
+ "@wordpress/compose": "^6.8.0",
38
+ "@wordpress/core-data": "^6.8.0",
39
+ "@wordpress/data": "^9.1.0",
40
+ "@wordpress/deprecated": "^3.31.0",
41
+ "@wordpress/dom": "^3.31.0",
42
+ "@wordpress/editor": "^13.8.0",
43
+ "@wordpress/element": "^5.8.0",
44
+ "@wordpress/hooks": "^3.31.0",
45
+ "@wordpress/html-entities": "^3.31.0",
46
+ "@wordpress/i18n": "^4.31.0",
47
+ "@wordpress/icons": "^9.22.0",
48
+ "@wordpress/interface": "^5.8.0",
49
+ "@wordpress/keyboard-shortcuts": "^4.8.0",
50
+ "@wordpress/keycodes": "^3.31.0",
51
+ "@wordpress/media-utils": "^4.22.0",
52
+ "@wordpress/notices": "^3.31.0",
53
+ "@wordpress/plugins": "^5.8.0",
54
+ "@wordpress/preferences": "^3.8.0",
55
+ "@wordpress/private-apis": "^0.13.0",
56
+ "@wordpress/reusable-blocks": "^4.8.0",
57
+ "@wordpress/style-engine": "^1.14.0",
58
+ "@wordpress/url": "^3.32.0",
59
+ "@wordpress/viewport": "^5.8.0",
60
+ "@wordpress/widgets": "^3.8.0",
59
61
  "classnames": "^2.3.1",
60
62
  "colord": "^2.9.2",
61
63
  "downloadjs": "^1.4.7",
@@ -73,5 +75,5 @@
73
75
  "publishConfig": {
74
76
  "access": "public"
75
77
  },
76
- "gitHead": "9534a7b3bbf07c1d40b94fdb7a3d091f297bfb06"
78
+ "gitHead": "d61700b9f1c72ba0b030fc815ef1685b4f4031ec"
77
79
  }
@@ -13,14 +13,12 @@ import { plus } from '@wordpress/icons';
13
13
  * Internal dependencies
14
14
  */
15
15
  import { useHistory } from '../routes';
16
- import { store as editSiteStore } from '../../store';
17
16
  import CreateTemplatePartModal from '../create-template-part-modal';
18
17
  import {
19
18
  useExistingTemplateParts,
20
19
  getUniqueTemplatePartTitle,
21
20
  getCleanTemplatePartSlug,
22
21
  } from '../../utils/template-part-create';
23
- import { unlock } from '../../private-apis';
24
22
 
25
23
  export default function NewTemplatePart( {
26
24
  postType,
@@ -31,7 +29,6 @@ export default function NewTemplatePart( {
31
29
  const [ isModalOpen, setIsModalOpen ] = useState( false );
32
30
  const { createErrorNotice } = useDispatch( noticesStore );
33
31
  const { saveEntityRecord } = useDispatch( coreStore );
34
- const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
35
32
  const existingTemplateParts = useExistingTemplateParts();
36
33
 
37
34
  async function createTemplatePart( { title, area } ) {
@@ -63,13 +60,11 @@ export default function NewTemplatePart( {
63
60
 
64
61
  setIsModalOpen( false );
65
62
 
66
- // Switch to edit mode.
67
- setCanvasMode( 'edit' );
68
-
69
63
  // Navigate to the created template part editor.
70
64
  history.push( {
71
65
  postId: templatePart.id,
72
66
  postType: 'wp_template_part',
67
+ canvas: 'edit',
73
68
  } );
74
69
 
75
70
  // TODO: Add a success notice?
@@ -98,9 +98,7 @@ export default function NewTemplate( {
98
98
  const { saveEntityRecord } = useDispatch( coreStore );
99
99
  const { createErrorNotice, createSuccessNotice } =
100
100
  useDispatch( noticesStore );
101
- const { setTemplate, setCanvasMode } = unlock(
102
- useDispatch( editSiteStore )
103
- );
101
+ const { setTemplate } = unlock( useDispatch( editSiteStore ) );
104
102
  async function createTemplate( template, isWPSuggestion = true ) {
105
103
  if ( isCreatingTemplate ) {
106
104
  return;
@@ -125,20 +123,19 @@ export default function NewTemplate( {
125
123
 
126
124
  // Set template before navigating away to avoid initial stale value.
127
125
  setTemplate( newTemplate.id, newTemplate.slug );
128
- // Switch to edit mode.
129
- setCanvasMode( 'edit' );
130
126
 
131
127
  // Navigate to the created template editor.
132
128
  history.push( {
133
129
  postId: newTemplate.id,
134
130
  postType: newTemplate.type,
131
+ canvas: 'edit',
135
132
  } );
136
133
 
137
134
  createSuccessNotice(
138
135
  sprintf(
139
136
  // translators: %s: Title of the created template e.g: "Category".
140
137
  __( '"%s" successfully created.' ),
141
- title
138
+ newTemplate.title?.rendered || title
142
139
  ),
143
140
  {
144
141
  type: 'snackbar',
@@ -146,7 +146,7 @@ export function usePostTypeArchiveMenuItems() {
146
146
  description: sprintf(
147
147
  // translators: %s: Name of the post type e.g: "Post".
148
148
  __(
149
- 'Displays an archive with the latests posts of type: %s.'
149
+ 'Displays an archive with the latest posts of type: %s.'
150
150
  ),
151
151
  postType.labels.singular_name
152
152
  ),
@@ -31,33 +31,13 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
31
31
  const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
32
32
  const deviceStyles = useResizeCanvas( deviceType );
33
33
  const mouseMoveTypingRef = useMouseMoveTypingReset();
34
+
34
35
  return (
35
36
  <Iframe
36
37
  expand={ isZoomOutMode }
37
38
  scale={ ( isZoomOutMode && 0.45 ) || undefined }
38
39
  frameSize={ isZoomOutMode ? 100 : undefined }
39
40
  style={ enableResizing ? {} : deviceStyles }
40
- head={
41
- <>
42
- <EditorStyles styles={ settings.styles } />
43
- <style>{
44
- // Forming a "block formatting context" to prevent margin collapsing.
45
- // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
46
- `.is-root-container { display: flow-root; }
47
- body { position: relative;
48
- ${ canvasMode === 'view' ? 'cursor: pointer;' : '' }}}`
49
- }</style>
50
- { enableResizing && (
51
- <style>
52
- {
53
- // Some themes will have `min-height: 100vh` for the root container,
54
- // which isn't a requirement in auto resize mode.
55
- `.is-root-container { min-height: 0 !important; }`
56
- }
57
- </style>
58
- ) }
59
- </>
60
- }
61
41
  ref={ mouseMoveTypingRef }
62
42
  name="editor-canvas"
63
43
  className="edit-site-visual-editor__editor-canvas"
@@ -70,8 +50,18 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
70
50
  }
71
51
  readonly={ canvasMode === 'view' }
72
52
  >
73
- { /* Filters need to be rendered before children to avoid Safari rendering issues. */ }
74
- { settings.svgFilters }
53
+ <EditorStyles styles={ settings.styles } />
54
+ <style>{
55
+ // Forming a "block formatting context" to prevent margin collapsing.
56
+ // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
57
+ `.is-root-container{display:flow-root;${
58
+ // Some themes will have `min-height: 100vh` for the root container,
59
+ // which isn't a requirement in auto resize mode.
60
+ enableResizing ? 'min-height:0!important;' : ''
61
+ }}body{position:relative; ${
62
+ canvasMode === 'view' ? 'cursor: pointer;' : ''
63
+ }}}`
64
+ }</style>
75
65
  { children }
76
66
  </Iframe>
77
67
  );
@@ -67,6 +67,7 @@ export default function Editor() {
67
67
  isInserterOpen,
68
68
  isListViewOpen,
69
69
  showIconLabels,
70
+ showBlockBreadcrumbs,
70
71
  } = useSelect( ( select ) => {
71
72
  const {
72
73
  getEditedPostContext,
@@ -94,6 +95,10 @@ export default function Editor() {
94
95
  'core/edit-site',
95
96
  'showIconLabels'
96
97
  ),
98
+ showBlockBreadcrumbs: select( preferencesStore ).get(
99
+ 'core/edit-site',
100
+ 'showBlockBreadcrumbs'
101
+ ),
97
102
  };
98
103
  }, [] );
99
104
  const { setEditedPostContext } = useDispatch( editSiteStore );
@@ -101,8 +106,11 @@ export default function Editor() {
101
106
  const isViewMode = canvasMode === 'view';
102
107
  const isEditMode = canvasMode === 'edit';
103
108
  const showVisualEditor = isViewMode || editorMode === 'visual';
104
- const showBlockBreakcrumb =
105
- isEditMode && showVisualEditor && blockEditorMode !== 'zoom-out';
109
+ const shouldShowBlockBreakcrumbs =
110
+ showBlockBreadcrumbs &&
111
+ isEditMode &&
112
+ showVisualEditor &&
113
+ blockEditorMode !== 'zoom-out';
106
114
  const shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;
107
115
  const shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;
108
116
  const secondarySidebarLabel = isListViewOpen
@@ -205,7 +213,7 @@ export default function Editor() {
205
213
  )
206
214
  }
207
215
  footer={
208
- showBlockBreakcrumb && (
216
+ shouldShowBlockBreakcrumbs && (
209
217
  <BlockBreadcrumb
210
218
  rootLabelText={ __( 'Template' ) }
211
219
  />
@@ -2,6 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
+ import { __experimentalHasSplitBorders as hasSplitBorders } from '@wordpress/components';
5
6
 
6
7
  /**
7
8
  * Internal dependencies
@@ -29,11 +30,41 @@ export default function BorderPanel( { name, variation = '' } ) {
29
30
  const [ rawSettings ] = useGlobalSetting( '', name );
30
31
  const settings = useSettingsForBlockElement( rawSettings, name );
31
32
 
33
+ const onChange = ( newStyle ) => {
34
+ // As Global Styles can't conditionally generate styles based on if
35
+ // other style properties have been set, we need to force split
36
+ // border definitions for user set global border styles. Border
37
+ // radius is derived from the same property i.e. `border.radius` if
38
+ // it is a string that is used. The longhand border radii styles are
39
+ // only generated if that property is an object.
40
+ //
41
+ // For borders (color, style, and width) those are all properties on
42
+ // the `border` style property. This means if the theme.json defined
43
+ // split borders and the user condenses them into a flat border or
44
+ // vice-versa we'd get both sets of styles which would conflict.
45
+ const { border } = newStyle;
46
+ const updatedBorder = ! hasSplitBorders( border )
47
+ ? {
48
+ top: border,
49
+ right: border,
50
+ bottom: border,
51
+ left: border,
52
+ }
53
+ : {
54
+ color: null,
55
+ style: null,
56
+ width: null,
57
+ ...border,
58
+ };
59
+
60
+ setStyle( { ...newStyle, border: updatedBorder } );
61
+ };
62
+
32
63
  return (
33
64
  <StylesBorderPanel
34
65
  inheritedValue={ inheritedStyle }
35
66
  value={ style }
36
- onChange={ setStyle }
67
+ onChange={ onChange }
37
68
  settings={ settings }
38
69
  />
39
70
  );
@@ -27,19 +27,19 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
27
27
  /**
28
28
  * Internal dependencies
29
29
  */
30
- import { useHasColorPanel } from './color-utils';
31
- import { useHasFilterPanel } from './filter-utils';
32
30
  import { useHasVariationsPanel } from './variations-panel';
33
31
  import { NavigationButtonAsItem } from './navigation-button';
34
32
  import { IconWithCurrentColor } from './icon-with-current-color';
35
33
  import { ScreenVariations } from './screen-variations';
36
- import { useHasShadowControl } from './shadow-panel';
37
34
  import { unlock } from '../../private-apis';
38
35
 
39
36
  const {
40
37
  useHasDimensionsPanel,
41
38
  useHasTypographyPanel,
42
39
  useHasBorderPanel,
40
+ useHasColorPanel,
41
+ useHasEffectsPanel,
42
+ useHasFiltersPanel,
43
43
  useGlobalSetting,
44
44
  useSettingsForBlockElement,
45
45
  } = unlock( blockEditorPrivateApis );
@@ -48,10 +48,10 @@ function ContextMenu( { name, parentMenu = '' } ) {
48
48
  const [ rawSettings ] = useGlobalSetting( '', name );
49
49
  const settings = useSettingsForBlockElement( rawSettings, name );
50
50
  const hasTypographyPanel = useHasTypographyPanel( settings );
51
- const hasColorPanel = useHasColorPanel( name );
51
+ const hasColorPanel = useHasColorPanel( settings );
52
52
  const hasBorderPanel = useHasBorderPanel( settings );
53
- const hasEffectsPanel = useHasShadowControl( name );
54
- const hasFilterPanel = useHasFilterPanel( name );
53
+ const hasEffectsPanel = useHasEffectsPanel( settings );
54
+ const hasFilterPanel = useHasFiltersPanel( settings );
55
55
  const hasDimensionsPanel = useHasDimensionsPanel( settings );
56
56
  const hasLayoutPanel = hasDimensionsPanel;
57
57
  const hasVariationsPanel = useHasVariationsPanel( name, parentMenu );
@@ -109,9 +109,9 @@ function ContextMenu( { name, parentMenu = '' } ) {
109
109
  <NavigationButtonAsItem
110
110
  icon={ shadow }
111
111
  path={ parentMenu + '/effects' }
112
- aria-label={ __( 'Shadow' ) }
112
+ aria-label={ __( 'Effects' ) }
113
113
  >
114
- { __( 'Shadow' ) }
114
+ { __( 'Effects' ) }
115
115
  </NavigationButtonAsItem>
116
116
  ) }
117
117
  { hasFilterPanel && (
@@ -16,6 +16,16 @@ const {
16
16
  DimensionsPanel: StylesDimensionsPanel,
17
17
  } = unlock( blockEditorPrivateApis );
18
18
 
19
+ const DEFAULT_CONTROLS = {
20
+ contentSize: true,
21
+ wideSize: true,
22
+ padding: true,
23
+ margin: true,
24
+ blockGap: true,
25
+ minHeight: true,
26
+ childLayout: false,
27
+ };
28
+
19
29
  export default function DimensionsPanel( { name, variation = '' } ) {
20
30
  let prefixParts = [];
21
31
  if ( variation ) {
@@ -66,6 +76,7 @@ export default function DimensionsPanel( { name, variation = '' } ) {
66
76
  onChange={ onChange }
67
77
  settings={ settings }
68
78
  includeLayoutControls
79
+ defaultControls={ DEFAULT_CONTROLS }
69
80
  />
70
81
  );
71
82
  }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { unlock } from '../../private-apis';
10
+
11
+ const {
12
+ useGlobalSetting,
13
+ useGlobalStyle,
14
+ EffectsPanel: StylesEffectsPanel,
15
+ useSettingsForBlockElement,
16
+ } = unlock( blockEditorPrivateApis );
17
+
18
+ export default function EffectsPanel( { name, variation = '' } ) {
19
+ let prefixParts = [];
20
+ if ( variation ) {
21
+ prefixParts = [ 'variations', variation ].concat( prefixParts );
22
+ }
23
+ const prefix = prefixParts.join( '.' );
24
+
25
+ const [ style ] = useGlobalStyle( prefix, name, 'user', false );
26
+ const [ inheritedStyle, setStyle ] = useGlobalStyle( prefix, name, 'all', {
27
+ shouldDecodeEncode: false,
28
+ } );
29
+ const [ rawSettings ] = useGlobalSetting( '', name );
30
+ const settings = useSettingsForBlockElement( rawSettings, name );
31
+
32
+ return (
33
+ <StylesEffectsPanel
34
+ inheritedValue={ inheritedStyle }
35
+ value={ style }
36
+ onChange={ setStyle }
37
+ settings={ settings }
38
+ />
39
+ );
40
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { unlock } from '../../private-apis';
10
+ const {
11
+ useGlobalStyle,
12
+ useGlobalSetting,
13
+ useSettingsForBlockElement,
14
+ FiltersPanel: StylesFiltersPanel,
15
+ } = unlock( blockEditorPrivateApis );
16
+
17
+ export default function FiltersPanel( { name } ) {
18
+ const [ style ] = useGlobalStyle( '', name, 'user', false );
19
+ const [ inheritedStyle, setStyle ] = useGlobalStyle( '', name, 'all', {
20
+ shouldDecodeEncode: false,
21
+ } );
22
+ const [ rawSettings ] = useGlobalSetting( '', name );
23
+ const settings = useSettingsForBlockElement( rawSettings, name );
24
+
25
+ return (
26
+ <StylesFiltersPanel
27
+ inheritedValue={ inheritedStyle }
28
+ value={ style }
29
+ onChange={ setStyle }
30
+ settings={ settings }
31
+ />
32
+ );
33
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { mergeWith, isEmpty, mapValues } from 'lodash';
4
+ import { mergeWith, isEmpty } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -41,9 +41,9 @@ const cleanEmptyObject = ( object ) => {
41
41
  return object;
42
42
  }
43
43
  const cleanedNestedObjects = Object.fromEntries(
44
- Object.entries( mapValues( object, cleanEmptyObject ) ).filter(
45
- ( [ , value ] ) => Boolean( value )
46
- )
44
+ Object.entries( object )
45
+ .map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )
46
+ .filter( ( [ , value ] ) => Boolean( value ) )
47
47
  );
48
48
  return isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;
49
49
  };