@wordpress/edit-site 5.10.0 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +7 -22
  3. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
  4. package/build/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +11 -21
  5. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
  6. package/build/components/add-new-template/new-template.js +98 -65
  7. package/build/components/add-new-template/new-template.js.map +1 -1
  8. package/build/components/block-editor/index.js +1 -3
  9. package/build/components/block-editor/index.js.map +1 -1
  10. package/build/components/create-template-part-modal/index.js +6 -7
  11. package/build/components/create-template-part-modal/index.js.map +1 -1
  12. package/build/components/editor/index.js +15 -40
  13. package/build/components/editor/index.js.map +1 -1
  14. package/build/components/editor-canvas-container/index.js +10 -3
  15. package/build/components/editor-canvas-container/index.js.map +1 -1
  16. package/build/components/global-styles/screen-block.js +80 -3
  17. package/build/components/global-styles/screen-block.js.map +1 -1
  18. package/build/components/global-styles/screen-revisions/index.js +3 -10
  19. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  20. package/build/components/global-styles/screen-revisions/revisions-buttons.js +16 -18
  21. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  22. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +15 -24
  23. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  24. package/build/components/global-styles/screen-root.js +4 -4
  25. package/build/components/global-styles/screen-root.js.map +1 -1
  26. package/build/components/global-styles/style-variations-container.js +6 -10
  27. package/build/components/global-styles/style-variations-container.js.map +1 -1
  28. package/build/components/global-styles/ui.js +9 -9
  29. package/build/components/global-styles/ui.js.map +1 -1
  30. package/build/components/header-edit-mode/document-actions/index.js +28 -103
  31. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  32. package/build/components/header-edit-mode/index.js +14 -1
  33. package/build/components/header-edit-mode/index.js.map +1 -1
  34. package/build/components/layout/hooks.js +54 -0
  35. package/build/components/layout/hooks.js.map +1 -0
  36. package/build/components/layout/index.js +45 -98
  37. package/build/components/layout/index.js.map +1 -1
  38. package/build/components/list/actions/index.js +5 -2
  39. package/build/components/list/actions/index.js.map +1 -1
  40. package/build/components/resizable-frame/index.js +242 -0
  41. package/build/components/resizable-frame/index.js.map +1 -0
  42. package/build/components/revisions/index.js +2 -1
  43. package/build/components/revisions/index.js.map +1 -1
  44. package/build/components/secondary-sidebar/list-view-sidebar.js +4 -3
  45. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  46. package/build/components/sidebar/index.js +4 -4
  47. package/build/components/sidebar/index.js.map +1 -1
  48. package/build/components/sidebar-edit-mode/template-revisions/index.js +1 -1
  49. package/build/components/sidebar-edit-mode/template-revisions/index.js.map +1 -1
  50. package/build/components/sidebar-navigation-screen-global-styles/index.js +75 -11
  51. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  52. package/build/components/sidebar-navigation-screen-main/index.js +24 -33
  53. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  54. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +162 -0
  55. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
  56. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +17 -0
  57. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
  58. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +53 -103
  59. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  60. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +87 -0
  61. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
  62. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -71
  63. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  64. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +53 -0
  65. package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
  66. package/build/components/sidebar-navigation-screen-templates/index.js +36 -11
  67. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  68. package/build/components/site-hub/index.js +1 -3
  69. package/build/components/site-hub/index.js.map +1 -1
  70. package/build/components/style-book/index.js +93 -19
  71. package/build/components/style-book/index.js.map +1 -1
  72. package/build/components/use-edited-entity-record/index.js +8 -4
  73. package/build/components/use-edited-entity-record/index.js.map +1 -1
  74. package/build/hooks/commands/use-edit-mode-commands.js +105 -0
  75. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -0
  76. package/build/store/actions.js +5 -3
  77. package/build/store/actions.js.map +1 -1
  78. package/build-module/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +8 -20
  79. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
  80. package/build-module/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +13 -22
  81. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
  82. package/build-module/components/add-new-template/new-template.js +98 -67
  83. package/build-module/components/add-new-template/new-template.js.map +1 -1
  84. package/build-module/components/block-editor/index.js +1 -3
  85. package/build-module/components/block-editor/index.js.map +1 -1
  86. package/build-module/components/create-template-part-modal/index.js +7 -8
  87. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  88. package/build-module/components/editor/index.js +16 -43
  89. package/build-module/components/editor/index.js.map +1 -1
  90. package/build-module/components/editor-canvas-container/index.js +7 -3
  91. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  92. package/build-module/components/global-styles/screen-block.js +82 -4
  93. package/build-module/components/global-styles/screen-block.js.map +1 -1
  94. package/build-module/components/global-styles/screen-revisions/index.js +3 -10
  95. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  96. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +16 -19
  97. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  98. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +15 -24
  99. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  100. package/build-module/components/global-styles/screen-root.js +4 -4
  101. package/build-module/components/global-styles/screen-root.js.map +1 -1
  102. package/build-module/components/global-styles/style-variations-container.js +7 -11
  103. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  104. package/build-module/components/global-styles/ui.js +10 -10
  105. package/build-module/components/global-styles/ui.js.map +1 -1
  106. package/build-module/components/header-edit-mode/document-actions/index.js +31 -107
  107. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  108. package/build-module/components/header-edit-mode/index.js +14 -2
  109. package/build-module/components/header-edit-mode/index.js.map +1 -1
  110. package/build-module/components/layout/hooks.js +41 -0
  111. package/build-module/components/layout/hooks.js.map +1 -0
  112. package/build-module/components/layout/index.js +46 -101
  113. package/build-module/components/layout/index.js.map +1 -1
  114. package/build-module/components/list/actions/index.js +6 -3
  115. package/build-module/components/list/actions/index.js.map +1 -1
  116. package/build-module/components/resizable-frame/index.js +228 -0
  117. package/build-module/components/resizable-frame/index.js.map +1 -0
  118. package/build-module/components/revisions/index.js +2 -1
  119. package/build-module/components/revisions/index.js.map +1 -1
  120. package/build-module/components/secondary-sidebar/list-view-sidebar.js +3 -3
  121. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  122. package/build-module/components/sidebar/index.js +3 -3
  123. package/build-module/components/sidebar/index.js.map +1 -1
  124. package/build-module/components/sidebar-edit-mode/template-revisions/index.js +1 -1
  125. package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +1 -1
  126. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +70 -14
  127. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  128. package/build-module/components/sidebar-navigation-screen-main/index.js +21 -32
  129. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  130. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +141 -0
  131. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
  132. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +10 -0
  133. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
  134. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +52 -103
  135. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  136. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +71 -0
  137. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
  138. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +12 -71
  139. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  140. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +40 -0
  141. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
  142. package/build-module/components/sidebar-navigation-screen-templates/index.js +35 -11
  143. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  144. package/build-module/components/site-hub/index.js +1 -3
  145. package/build-module/components/site-hub/index.js.map +1 -1
  146. package/build-module/components/style-book/index.js +93 -20
  147. package/build-module/components/style-book/index.js.map +1 -1
  148. package/build-module/components/use-edited-entity-record/index.js +8 -4
  149. package/build-module/components/use-edited-entity-record/index.js.map +1 -1
  150. package/build-module/hooks/commands/use-edit-mode-commands.js +86 -0
  151. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -0
  152. package/build-module/store/actions.js +5 -3
  153. package/build-module/store/actions.js.map +1 -1
  154. package/build-style/style-rtl.css +233 -210
  155. package/build-style/style.css +234 -210
  156. package/package.json +37 -37
  157. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +82 -0
  158. package/src/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +13 -26
  159. package/src/components/add-new-template/new-template.js +139 -153
  160. package/src/components/add-new-template/style.scss +79 -66
  161. package/src/components/block-editor/index.js +2 -3
  162. package/src/components/create-template-part-modal/index.js +19 -25
  163. package/src/components/editor/index.js +16 -45
  164. package/src/components/editor/style.scss +21 -6
  165. package/src/components/editor-canvas-container/index.js +28 -19
  166. package/src/components/global-styles/screen-block.js +74 -3
  167. package/src/components/global-styles/screen-revisions/index.js +3 -11
  168. package/src/components/global-styles/screen-revisions/revisions-buttons.js +33 -25
  169. package/src/components/global-styles/screen-revisions/style.scss +3 -2
  170. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +16 -3
  171. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +15 -19
  172. package/src/components/global-styles/screen-root.js +5 -3
  173. package/src/components/global-styles/style-variations-container.js +13 -18
  174. package/src/components/global-styles/style.scss +3 -0
  175. package/src/components/global-styles/ui.js +11 -9
  176. package/src/components/header-edit-mode/document-actions/index.js +26 -129
  177. package/src/components/header-edit-mode/document-actions/style.scss +28 -59
  178. package/src/components/header-edit-mode/index.js +18 -0
  179. package/src/components/header-edit-mode/style.scss +1 -0
  180. package/src/components/layout/hooks.js +46 -0
  181. package/src/components/layout/index.js +56 -125
  182. package/src/components/layout/style.scss +8 -2
  183. package/src/components/list/actions/index.js +12 -5
  184. package/src/components/list/style.scss +1 -0
  185. package/src/components/resizable-frame/index.js +253 -0
  186. package/src/components/resizable-frame/style.scss +69 -0
  187. package/src/components/revisions/index.js +1 -0
  188. package/src/components/secondary-sidebar/list-view-sidebar.js +2 -1
  189. package/src/components/sidebar/index.js +4 -4
  190. package/src/components/sidebar-edit-mode/template-revisions/index.js +1 -2
  191. package/src/components/sidebar-navigation-item/style.scss +9 -0
  192. package/src/components/sidebar-navigation-screen/style.scss +1 -2
  193. package/src/components/sidebar-navigation-screen-global-styles/index.js +106 -21
  194. package/src/components/sidebar-navigation-screen-main/index.js +35 -52
  195. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +157 -0
  196. package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +9 -0
  197. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +63 -117
  198. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +83 -0
  199. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +6 -72
  200. package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +47 -0
  201. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +6 -20
  202. package/src/components/sidebar-navigation-screen-templates/index.js +53 -14
  203. package/src/components/site-hub/index.js +8 -9
  204. package/src/components/start-template-options/style.scss +20 -21
  205. package/src/components/style-book/index.js +132 -43
  206. package/src/components/style-book/style.scss +19 -0
  207. package/src/components/use-edited-entity-record/index.js +12 -3
  208. package/src/hooks/commands/use-edit-mode-commands.js +79 -0
  209. package/src/store/actions.js +4 -5
  210. package/src/store/test/utils.js +15 -5
  211. package/src/style.scss +1 -1
  212. package/build/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
  213. package/build/components/add-new-template/add-custom-template-modal.js.map +0 -1
  214. package/build/components/global-styles/border-panel.js +0 -135
  215. package/build/components/global-styles/border-panel.js.map +0 -1
  216. package/build/components/navigate-to-link/index.js +0 -51
  217. package/build/components/navigate-to-link/index.js.map +0 -1
  218. package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -19
  219. package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
  220. package/build/components/template-details/edit-template-title.js +0 -42
  221. package/build/components/template-details/edit-template-title.js.map +0 -1
  222. package/build/components/template-details/index.js +0 -103
  223. package/build/components/template-details/index.js.map +0 -1
  224. package/build/components/template-details/template-areas.js +0 -166
  225. package/build/components/template-details/template-areas.js.map +0 -1
  226. package/build/components/template-details/template-part-area-selector.js +0 -48
  227. package/build/components/template-details/template-part-area-selector.js.map +0 -1
  228. package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
  229. package/build-module/components/add-new-template/add-custom-template-modal.js.map +0 -1
  230. package/build-module/components/global-styles/border-panel.js +0 -125
  231. package/build-module/components/global-styles/border-panel.js.map +0 -1
  232. package/build-module/components/navigate-to-link/index.js +0 -39
  233. package/build-module/components/navigate-to-link/index.js.map +0 -1
  234. package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -11
  235. package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
  236. package/build-module/components/template-details/edit-template-title.js +0 -33
  237. package/build-module/components/template-details/edit-template-title.js.map +0 -1
  238. package/build-module/components/template-details/index.js +0 -83
  239. package/build-module/components/template-details/index.js.map +0 -1
  240. package/build-module/components/template-details/template-areas.js +0 -145
  241. package/build-module/components/template-details/template-areas.js.map +0 -1
  242. package/build-module/components/template-details/template-part-area-selector.js +0 -36
  243. package/build-module/components/template-details/template-part-area-selector.js.map +0 -1
  244. package/src/components/add-new-template/add-custom-generic-template-modal.js +0 -101
  245. package/src/components/global-styles/border-panel.js +0 -114
  246. package/src/components/navigate-to-link/index.js +0 -46
  247. package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -9
  248. package/src/components/template-details/edit-template-title.js +0 -41
  249. package/src/components/template-details/index.js +0 -113
  250. package/src/components/template-details/style.scss +0 -72
  251. package/src/components/template-details/template-areas.js +0 -167
  252. package/src/components/template-details/template-part-area-selector.js +0 -39
@@ -1,70 +1,23 @@
1
- .edit-site-new-template-dropdown {
2
- .edit-site-new-template-dropdown__menu-groups {
3
- @include break-small() {
4
- min-width: 300px;
5
- }
6
- }
1
+ .edit-site-custom-template-modal {
2
+ &__contents-wrapper {
3
+ height: 100%;
4
+ justify-content: flex-start !important; // Required as topLeft alignment isn't working on VStack
7
5
 
8
- // The specificity is needed to override the default tooltip styles.
9
- &__menu-item-tooltip.components-tooltip .components-popover__content {
10
- max-width: 320px;
11
- padding: $grid-unit-10 $grid-unit-15;
12
- border-radius: 2px;
13
- white-space: pre-wrap;
14
- min-width: 0;
15
- width: auto;
16
- text-align: left;
17
- }
18
- }
6
+ > * {
7
+ width: 100%;
8
+ }
19
9
 
20
- .edit-site-custom-template-modal {
21
- &__suggestions_list {
22
- margin-left: - $grid-unit-15;
23
- margin-right: - $grid-unit-15;
10
+ &__suggestions_list {
11
+ margin-left: - $grid-unit-15;
12
+ margin-right: - $grid-unit-15;
13
+ width: calc(100% + #{$grid-unit-15 * 2});
14
+ }
24
15
  }
25
16
 
26
17
  &__contents {
27
18
  > .components-button {
28
- padding: $grid-unit-30;
29
- border-radius: $radius-block-ui;
30
19
  height: auto;
31
- display: flex;
32
- flex-direction: column;
33
20
  justify-content: center;
34
- border: $border-width solid $gray-300;
35
-
36
- // Show the boundary of the button, in High Contrast Mode.
37
- outline: 1px solid transparent;
38
-
39
- span:first-child {
40
- color: $gray-900;
41
- }
42
-
43
- span {
44
- color: $gray-700;
45
- }
46
-
47
- &:hover {
48
- color: var(--wp-admin-theme-color-darker-10);
49
- background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
50
- border-color: transparent;
51
-
52
- span {
53
- color: var(--wp-admin-theme-color);
54
- }
55
- }
56
-
57
- &:focus {
58
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
59
- border-color: transparent;
60
-
61
- // Windows High Contrast mode will show this outline, but not the box-shadow.
62
- outline: 3px solid transparent;
63
-
64
- span:first-child {
65
- color: var(--wp-admin-theme-color);
66
- }
67
- }
68
21
  }
69
22
  }
70
23
 
@@ -86,7 +39,6 @@
86
39
 
87
40
  .edit-site-custom-template-modal__suggestions_list {
88
41
  @include break-small() {
89
- height: 232px;
90
42
  overflow: scroll;
91
43
  }
92
44
 
@@ -146,12 +98,6 @@
146
98
  }
147
99
 
148
100
  .edit-site-custom-generic-template__modal {
149
- .components-base-control {
150
- @include break-medium() {
151
- width: $grid-unit * 40;
152
- }
153
- }
154
-
155
101
  .components-modal__header {
156
102
  border-bottom: none;
157
103
  }
@@ -177,5 +123,72 @@
177
123
  align-items: center;
178
124
  justify-content: center;
179
125
  height: 100%;
126
+ position: absolute;
127
+ left: 50%;
128
+ transform: translateX(-50%);
129
+ }
130
+ }
131
+
132
+ .edit-site-add-new-template__modal {
133
+ max-width: $grid-unit-80 * 13;
134
+ width: calc(100% - #{$grid-unit-80});
135
+ margin-top: $grid-unit-80;
136
+ max-height: calc(100% - #{$grid-unit-80 * 2});
137
+
138
+ @include break-large() {
139
+ width: calc(100% - #{$grid-unit-80 * 2});
140
+ }
141
+ }
142
+
143
+ .edit-site-custom-template-modal__contents,
144
+ .edit-site-add-new-template__template-list__contents {
145
+ > .components-button {
146
+ padding: $grid-unit-30;
147
+ border-radius: $radius-block-ui;
148
+ display: flex;
149
+ flex-direction: column;
150
+ border: $border-width solid $gray-300;
151
+ min-height: $grid-unit-80 * 3;
152
+
153
+ // Show the boundary of the button, in High Contrast Mode.
154
+ outline: 1px solid transparent;
155
+
156
+ span:first-child {
157
+ color: $gray-900;
158
+ }
159
+
160
+ span {
161
+ color: $gray-700;
162
+ }
163
+
164
+ &:hover {
165
+ color: var(--wp-admin-theme-color-darker-10);
166
+ background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
167
+ border-color: transparent;
168
+
169
+ span {
170
+ color: var(--wp-admin-theme-color);
171
+ }
172
+ }
173
+
174
+ &:focus {
175
+ box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
176
+ border-color: transparent;
177
+
178
+ // Windows High Contrast mode will show this outline, but not the box-shadow.
179
+ outline: 3px solid transparent;
180
+
181
+ span:first-child {
182
+ color: var(--wp-admin-theme-color);
183
+ }
184
+ }
185
+ }
186
+ }
187
+
188
+ .edit-site-add-new-template__template-list__contents {
189
+ > .components-button {
190
+ height: 100%;
191
+ text-align: start;
192
+ align-items: flex-start;
180
193
  }
181
194
  }
@@ -143,6 +143,7 @@ export default function BlockEditor() {
143
143
  const [ resizeObserver, sizes ] = useResizeObserver();
144
144
 
145
145
  const isTemplatePart = templateType === 'wp_template_part';
146
+
146
147
  const hasBlocks = blocks.length !== 0;
147
148
  const enableResizing =
148
149
  isTemplatePart &&
@@ -169,9 +170,7 @@ export default function BlockEditor() {
169
170
  { ( [ editorCanvasView ] ) =>
170
171
  editorCanvasView ? (
171
172
  <div className="edit-site-visual-editor is-focus-mode">
172
- <ResizableEditor enableResizing>
173
- { editorCanvasView }
174
- </ResizableEditor>
173
+ { editorCanvasView }
175
174
  </div>
176
175
  ) : (
177
176
  <BlockTools
@@ -13,6 +13,7 @@ import {
13
13
  Modal,
14
14
  __experimentalRadioGroup as RadioGroup,
15
15
  __experimentalRadio as Radio,
16
+ __experimentalHStack as HStack,
16
17
  __experimentalVStack as VStack,
17
18
  } from '@wordpress/components';
18
19
  import { __ } from '@wordpress/i18n';
@@ -106,31 +107,24 @@ export default function CreateTemplatePartModal( { closeModal, onCreate } ) {
106
107
  ) }
107
108
  </RadioGroup>
108
109
  </BaseControl>
109
- <Flex
110
- className="edit-site-create-template-part-modal__modal-actions"
111
- justify="flex-end"
112
- >
113
- <FlexItem>
114
- <Button
115
- variant="secondary"
116
- onClick={ () => {
117
- closeModal();
118
- } }
119
- >
120
- { __( 'Cancel' ) }
121
- </Button>
122
- </FlexItem>
123
- <FlexItem>
124
- <Button
125
- variant="primary"
126
- type="submit"
127
- disabled={ ! title }
128
- isBusy={ isSubmitting }
129
- >
130
- { __( 'Create' ) }
131
- </Button>
132
- </FlexItem>
133
- </Flex>
110
+ <HStack justify="right">
111
+ <Button
112
+ variant="tertiary"
113
+ onClick={ () => {
114
+ closeModal();
115
+ } }
116
+ >
117
+ { __( 'Cancel' ) }
118
+ </Button>
119
+ <Button
120
+ variant="primary"
121
+ type="submit"
122
+ disabled={ ! title }
123
+ isBusy={ isSubmitting }
124
+ >
125
+ { __( 'Create' ) }
126
+ </Button>
127
+ </HStack>
134
128
  </VStack>
135
129
  </form>
136
130
  </Modal>
@@ -1,10 +1,15 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import classnames from 'classnames';
5
+
1
6
  /**
2
7
  * WordPress dependencies
3
8
  */
4
- import { useEffect, useMemo, useState } from '@wordpress/element';
9
+ import { useMemo } from '@wordpress/element';
5
10
  import { useSelect, useDispatch } from '@wordpress/data';
6
11
  import { Notice } from '@wordpress/components';
7
- import { EntityProvider, store as coreStore } from '@wordpress/core-data';
12
+ import { EntityProvider } from '@wordpress/core-data';
8
13
  import { store as preferencesStore } from '@wordpress/preferences';
9
14
  import {
10
15
  BlockContextProvider,
@@ -50,40 +55,7 @@ const interfaceLabels = {
50
55
  footer: __( 'Editor footer' ),
51
56
  };
52
57
 
53
- function useIsSiteEditorLoading() {
54
- const { isLoaded: hasLoadedPost } = useEditedEntityRecord();
55
- const { hasResolvingSelectors } = useSelect( ( select ) => {
56
- return {
57
- hasResolvingSelectors: select( coreStore ).hasResolvingSelectors(),
58
- };
59
- } );
60
- const [ loaded, setLoaded ] = useState( false );
61
- const inLoadingPause = ! loaded && ! hasResolvingSelectors;
62
-
63
- useEffect( () => {
64
- if ( inLoadingPause ) {
65
- /*
66
- * We're using an arbitrary 1s timeout here to catch brief moments
67
- * without any resolving selectors that would result in displaying
68
- * brief flickers of loading state and loaded state.
69
- *
70
- * It's worth experimenting with different values, since this also
71
- * adds 1s of artificial delay after loading has finished.
72
- */
73
- const timeout = setTimeout( () => {
74
- setLoaded( true );
75
- }, 1000 );
76
-
77
- return () => {
78
- clearTimeout( timeout );
79
- };
80
- }
81
- }, [ inLoadingPause ] );
82
-
83
- return ! loaded || ! hasLoadedPost;
84
- }
85
-
86
- export default function Editor() {
58
+ export default function Editor( { isLoading } ) {
87
59
  const {
88
60
  record: editedPost,
89
61
  getTitle,
@@ -186,8 +158,6 @@ export default function Editor() {
186
158
  // action in <URlQueryController> from double-announcing.
187
159
  useTitle( hasLoadedPost && title );
188
160
 
189
- const isLoading = useIsSiteEditorLoading();
190
-
191
161
  return (
192
162
  <>
193
163
  { isLoading ? <CanvasSpinner /> : null }
@@ -203,13 +173,14 @@ export default function Editor() {
203
173
  { isEditMode && <StartTemplateOptions /> }
204
174
  <InterfaceSkeleton
205
175
  enableRegionNavigation={ false }
206
- className={ showIconLabels && 'show-icon-labels' }
207
- notices={
208
- ( isEditMode ||
209
- window?.__experimentalEnableThemePreviews ) && (
210
- <EditorSnackbars />
211
- )
212
- }
176
+ className={ classnames(
177
+ 'edit-site-editor__interface-skeleton',
178
+ {
179
+ 'show-icon-labels': showIconLabels,
180
+ 'is-loading': isLoading,
181
+ }
182
+ ) }
183
+ notices={ <EditorSnackbars /> }
213
184
  content={
214
185
  <>
215
186
  <GlobalStylesRenderer />
@@ -1,3 +1,13 @@
1
+ .edit-site-editor__interface-skeleton {
2
+ opacity: 1;
3
+ transition: opacity 0.1s ease-out;
4
+ @include reduce-motion("transition");
5
+
6
+ &.is-loading {
7
+ opacity: 0;
8
+ }
9
+ }
10
+
1
11
  .edit-site-editor__toggle-save-panel {
2
12
  box-sizing: border-box;
3
13
  width: $sidebar-width;
@@ -9,11 +19,16 @@
9
19
  }
10
20
 
11
21
  // Adjust the position of the notices
12
- .edit-site .components-editor-notices__snackbar {
13
- position: fixed;
14
- right: 0;
15
- bottom: 40px;
16
- padding-left: 16px;
17
- padding-right: 16px;
22
+ .edit-site {
23
+ .components-editor-notices__snackbar {
24
+ position: fixed;
25
+ right: 0;
26
+ bottom: 0;
27
+ padding: 16px;
28
+ }
29
+ .is-edit-mode .components-editor-notices__snackbar {
30
+ bottom: 24px;
31
+ }
18
32
  }
33
+
19
34
  @include editor-left(".edit-site .components-editor-notices__snackbar")
@@ -18,6 +18,7 @@ import { useFocusOnMount, useFocusReturn } from '@wordpress/compose';
18
18
  */
19
19
  import { unlock } from '../../private-apis';
20
20
  import { store as editSiteStore } from '../../store';
21
+ import ResizableEditor from '../block-editor/resizable-editor';
21
22
 
22
23
  /**
23
24
  * Returns a translated string for the title of the editor canvas container.
@@ -46,7 +47,12 @@ const {
46
47
  Fill: EditorCanvasContainerFill,
47
48
  } = createPrivateSlotFill( SLOT_FILL_NAME );
48
49
 
49
- function EditorCanvasContainer( { children, closeButtonLabel, onClose } ) {
50
+ function EditorCanvasContainer( {
51
+ children,
52
+ closeButtonLabel,
53
+ onClose,
54
+ enableResizing = false,
55
+ } ) {
50
56
  const editorCanvasContainerView = useSelect(
51
57
  ( select ) =>
52
58
  unlock( select( editSiteStore ) ).getEditorCanvasContainerView(),
@@ -62,6 +68,7 @@ function EditorCanvasContainer( { children, closeButtonLabel, onClose } ) {
62
68
  () => getEditorCanvasContainerTitle( editorCanvasContainerView ),
63
69
  [ editorCanvasContainerView ]
64
70
  );
71
+
65
72
  function onCloseContainer() {
66
73
  if ( typeof onClose === 'function' ) {
67
74
  onClose();
@@ -97,24 +104,26 @@ function EditorCanvasContainer( { children, closeButtonLabel, onClose } ) {
97
104
 
98
105
  return (
99
106
  <EditorCanvasContainerFill>
100
- { /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }
101
- <section
102
- className="edit-site-editor-canvas-container"
103
- ref={ shouldShowCloseButton ? focusOnMountRef : null }
104
- onKeyDown={ closeOnEscape }
105
- aria-label={ title }
106
- >
107
- { shouldShowCloseButton && (
108
- <Button
109
- className="edit-site-editor-canvas-container__close-button"
110
- icon={ closeSmall }
111
- label={ closeButtonLabel || __( 'Close' ) }
112
- onClick={ onCloseContainer }
113
- showTooltip={ false }
114
- />
115
- ) }
116
- { childrenWithProps }
117
- </section>
107
+ <ResizableEditor enableResizing={ enableResizing }>
108
+ { /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }
109
+ <section
110
+ className="edit-site-editor-canvas-container"
111
+ ref={ shouldShowCloseButton ? focusOnMountRef : null }
112
+ onKeyDown={ closeOnEscape }
113
+ aria-label={ title }
114
+ >
115
+ { shouldShowCloseButton && (
116
+ <Button
117
+ className="edit-site-editor-canvas-container__close-button"
118
+ icon={ closeSmall }
119
+ label={ closeButtonLabel || __( 'Close' ) }
120
+ onClick={ onCloseContainer }
121
+ showTooltip={ false }
122
+ />
123
+ ) }
124
+ { childrenWithProps }
125
+ </section>
126
+ </ResizableEditor>
118
127
  </EditorCanvasContainerFill>
119
128
  );
120
129
  }
@@ -9,6 +9,7 @@ import { store as coreStore } from '@wordpress/core-data';
9
9
  import {
10
10
  PanelBody,
11
11
  __experimentalVStack as VStack,
12
+ __experimentalHasSplitBorders as hasSplitBorders,
12
13
  } from '@wordpress/components';
13
14
  import { __, sprintf } from '@wordpress/i18n';
14
15
 
@@ -21,6 +22,41 @@ import { unlock } from '../../private-apis';
21
22
  import Subtitle from './subtitle';
22
23
  import { useBlockVariations, VariationsPanel } from './variations-panel';
23
24
 
25
+ function applyFallbackStyle( border ) {
26
+ if ( ! border ) {
27
+ return border;
28
+ }
29
+
30
+ const hasColorOrWidth = border.color || border.width;
31
+
32
+ if ( ! border.style && hasColorOrWidth ) {
33
+ return { ...border, style: 'solid' };
34
+ }
35
+
36
+ if ( border.style && ! hasColorOrWidth ) {
37
+ return undefined;
38
+ }
39
+
40
+ return border;
41
+ }
42
+
43
+ function applyAllFallbackStyles( border ) {
44
+ if ( ! border ) {
45
+ return border;
46
+ }
47
+
48
+ if ( hasSplitBorders( border ) ) {
49
+ return {
50
+ top: applyFallbackStyle( border.top ),
51
+ right: applyFallbackStyle( border.right ),
52
+ bottom: applyFallbackStyle( border.bottom ),
53
+ left: applyFallbackStyle( border.left ),
54
+ };
55
+ }
56
+
57
+ return applyFallbackStyle( border );
58
+ }
59
+
24
60
  const {
25
61
  useHasDimensionsPanel,
26
62
  useHasTypographyPanel,
@@ -108,6 +144,41 @@ function ScreenBlock( { name, variation } ) {
108
144
  } );
109
145
  }
110
146
  };
147
+ const onChangeBorders = ( newStyle ) => {
148
+ if ( ! newStyle?.border ) {
149
+ setStyle( newStyle );
150
+ return;
151
+ }
152
+
153
+ // As Global Styles can't conditionally generate styles based on if
154
+ // other style properties have been set, we need to force split
155
+ // border definitions for user set global border styles. Border
156
+ // radius is derived from the same property i.e. `border.radius` if
157
+ // it is a string that is used. The longhand border radii styles are
158
+ // only generated if that property is an object.
159
+ //
160
+ // For borders (color, style, and width) those are all properties on
161
+ // the `border` style property. This means if the theme.json defined
162
+ // split borders and the user condenses them into a flat border or
163
+ // vice-versa we'd get both sets of styles which would conflict.
164
+ const { radius, ...newBorder } = newStyle.border;
165
+ const border = applyAllFallbackStyles( newBorder );
166
+ const updatedBorder = ! hasSplitBorders( border )
167
+ ? {
168
+ top: border,
169
+ right: border,
170
+ bottom: border,
171
+ left: border,
172
+ }
173
+ : {
174
+ color: null,
175
+ style: null,
176
+ width: null,
177
+ ...border,
178
+ };
179
+
180
+ setStyle( { ...newStyle, border: { ...updatedBorder, radius } } );
181
+ };
111
182
 
112
183
  return (
113
184
  <>
@@ -152,7 +223,7 @@ function ScreenBlock( { name, variation } ) {
152
223
  <StylesBorderPanel
153
224
  inheritedValue={ inheritedStyle }
154
225
  value={ style }
155
- onChange={ setStyle }
226
+ onChange={ onChangeBorders }
156
227
  settings={ settings }
157
228
  />
158
229
  ) }
@@ -160,7 +231,7 @@ function ScreenBlock( { name, variation } ) {
160
231
  <StylesEffectsPanel
161
232
  inheritedValue={ inheritedStyleWithLayout }
162
233
  value={ styleWithLayout }
163
- onChange={ onChangeDimensions }
234
+ onChange={ setStyle }
164
235
  settings={ settings }
165
236
  includeLayoutControls
166
237
  />
@@ -169,7 +240,7 @@ function ScreenBlock( { name, variation } ) {
169
240
  <StylesFiltersPanel
170
241
  inheritedValue={ inheritedStyleWithLayout }
171
242
  value={ styleWithLayout }
172
- onChange={ onChangeDimensions }
243
+ onChange={ setStyle }
173
244
  settings={ {
174
245
  ...settings,
175
246
  color: {
@@ -42,19 +42,11 @@ function ScreenRevisions() {
42
42
  blocks: select( blockEditorStore ).getBlocks(),
43
43
  };
44
44
  }, [] );
45
-
46
45
  const { revisions, isLoading, hasUnsavedChanges } =
47
46
  useGlobalStylesRevisions();
47
+ const [ selectedRevisionId, setSelectedRevisionId ] = useState();
48
48
  const [ globalStylesRevision, setGlobalStylesRevision ] =
49
49
  useState( userConfig );
50
-
51
- const [ currentRevisionId, setCurrentRevisionId ] = useState(
52
- /*
53
- * We need this for the first render,
54
- * otherwise the unsaved changes haven't been merged into the revisions array yet.
55
- */
56
- hasUnsavedChanges ? 'unsaved' : revisions?.[ 0 ]?.id
57
- );
58
50
  const [
59
51
  isLoadingRevisionWithUnsavedChanges,
60
52
  setIsLoadingRevisionWithUnsavedChanges,
@@ -89,7 +81,7 @@ function ScreenRevisions() {
89
81
  settings: revision?.settings,
90
82
  id: revision?.id,
91
83
  } );
92
- setCurrentRevisionId( revision?.id );
84
+ setSelectedRevisionId( revision?.id );
93
85
  };
94
86
 
95
87
  const isLoadButtonEnabled =
@@ -117,7 +109,7 @@ function ScreenRevisions() {
117
109
  <div className="edit-site-global-styles-screen-revisions">
118
110
  <RevisionsButtons
119
111
  onChange={ selectRevision }
120
- currentRevisionId={ currentRevisionId }
112
+ selectedRevisionId={ selectedRevisionId }
121
113
  userRevisions={ revisions }
122
114
  />
123
115
  { isLoadButtonEnabled && (