@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.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +7 -22
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +11 -21
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/new-template.js +98 -65
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/block-editor/index.js +1 -3
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +6 -7
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +15 -40
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +10 -3
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/screen-block.js +80 -3
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +3 -10
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +16 -18
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +15 -24
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +4 -4
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +6 -10
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/ui.js +9 -9
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +28 -103
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +14 -1
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/layout/hooks.js +54 -0
- package/build/components/layout/hooks.js.map +1 -0
- package/build/components/layout/index.js +45 -98
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/actions/index.js +5 -2
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +242 -0
- package/build/components/resizable-frame/index.js.map +1 -0
- package/build/components/revisions/index.js +2 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +4 -3
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +4 -4
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-revisions/index.js +1 -1
- package/build/components/sidebar-edit-mode/template-revisions/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +75 -11
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +24 -33
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +162 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +17 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +53 -103
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +87 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -71
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +53 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +36 -11
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/site-hub/index.js +1 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +93 -19
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +8 -4
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +105 -0
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -0
- package/build/store/actions.js +5 -3
- package/build/store/actions.js.map +1 -1
- package/build-module/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +8 -20
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +13 -22
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/new-template.js +98 -67
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/block-editor/index.js +1 -3
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +7 -8
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +16 -43
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +7 -3
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +82 -4
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +3 -10
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +16 -19
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +15 -24
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +4 -4
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +7 -11
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/ui.js +10 -10
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +31 -107
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +14 -2
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/layout/hooks.js +41 -0
- package/build-module/components/layout/hooks.js.map +1 -0
- package/build-module/components/layout/index.js +46 -101
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/actions/index.js +6 -3
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +228 -0
- package/build-module/components/resizable-frame/index.js.map +1 -0
- package/build-module/components/revisions/index.js +2 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +3 -3
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -3
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-revisions/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +70 -14
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +21 -32
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +141 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +10 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +52 -103
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +71 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +12 -71
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +40 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +35 -11
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +1 -3
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +93 -20
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +8 -4
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +86 -0
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -0
- package/build-module/store/actions.js +5 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +233 -210
- package/build-style/style.css +234 -210
- package/package.json +37 -37
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +82 -0
- package/src/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +13 -26
- package/src/components/add-new-template/new-template.js +139 -153
- package/src/components/add-new-template/style.scss +79 -66
- package/src/components/block-editor/index.js +2 -3
- package/src/components/create-template-part-modal/index.js +19 -25
- package/src/components/editor/index.js +16 -45
- package/src/components/editor/style.scss +21 -6
- package/src/components/editor-canvas-container/index.js +28 -19
- package/src/components/global-styles/screen-block.js +74 -3
- package/src/components/global-styles/screen-revisions/index.js +3 -11
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +33 -25
- package/src/components/global-styles/screen-revisions/style.scss +3 -2
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +16 -3
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +15 -19
- package/src/components/global-styles/screen-root.js +5 -3
- package/src/components/global-styles/style-variations-container.js +13 -18
- package/src/components/global-styles/style.scss +3 -0
- package/src/components/global-styles/ui.js +11 -9
- package/src/components/header-edit-mode/document-actions/index.js +26 -129
- package/src/components/header-edit-mode/document-actions/style.scss +28 -59
- package/src/components/header-edit-mode/index.js +18 -0
- package/src/components/header-edit-mode/style.scss +1 -0
- package/src/components/layout/hooks.js +46 -0
- package/src/components/layout/index.js +56 -125
- package/src/components/layout/style.scss +8 -2
- package/src/components/list/actions/index.js +12 -5
- package/src/components/list/style.scss +1 -0
- package/src/components/resizable-frame/index.js +253 -0
- package/src/components/resizable-frame/style.scss +69 -0
- package/src/components/revisions/index.js +1 -0
- package/src/components/secondary-sidebar/list-view-sidebar.js +2 -1
- package/src/components/sidebar/index.js +4 -4
- package/src/components/sidebar-edit-mode/template-revisions/index.js +1 -2
- package/src/components/sidebar-navigation-item/style.scss +9 -0
- package/src/components/sidebar-navigation-screen/style.scss +1 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +106 -21
- package/src/components/sidebar-navigation-screen-main/index.js +35 -52
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +157 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +9 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +63 -117
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +83 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +6 -72
- package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +47 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +6 -20
- package/src/components/sidebar-navigation-screen-templates/index.js +53 -14
- package/src/components/site-hub/index.js +8 -9
- package/src/components/start-template-options/style.scss +20 -21
- package/src/components/style-book/index.js +132 -43
- package/src/components/style-book/style.scss +19 -0
- package/src/components/use-edited-entity-record/index.js +12 -3
- package/src/hooks/commands/use-edit-mode-commands.js +79 -0
- package/src/store/actions.js +4 -5
- package/src/store/test/utils.js +15 -5
- package/src/style.scss +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build/components/global-styles/border-panel.js +0 -135
- package/build/components/global-styles/border-panel.js.map +0 -1
- package/build/components/navigate-to-link/index.js +0 -51
- package/build/components/navigate-to-link/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -19
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build/components/template-details/edit-template-title.js +0 -42
- package/build/components/template-details/edit-template-title.js.map +0 -1
- package/build/components/template-details/index.js +0 -103
- package/build/components/template-details/index.js.map +0 -1
- package/build/components/template-details/template-areas.js +0 -166
- package/build/components/template-details/template-areas.js.map +0 -1
- package/build/components/template-details/template-part-area-selector.js +0 -48
- package/build/components/template-details/template-part-area-selector.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build-module/components/global-styles/border-panel.js +0 -125
- package/build-module/components/global-styles/border-panel.js.map +0 -1
- package/build-module/components/navigate-to-link/index.js +0 -39
- package/build-module/components/navigate-to-link/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -11
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build-module/components/template-details/edit-template-title.js +0 -33
- package/build-module/components/template-details/edit-template-title.js.map +0 -1
- package/build-module/components/template-details/index.js +0 -83
- package/build-module/components/template-details/index.js.map +0 -1
- package/build-module/components/template-details/template-areas.js +0 -145
- package/build-module/components/template-details/template-areas.js.map +0 -1
- package/build-module/components/template-details/template-part-area-selector.js +0 -36
- package/build-module/components/template-details/template-part-area-selector.js.map +0 -1
- package/src/components/add-new-template/add-custom-generic-template-modal.js +0 -101
- package/src/components/global-styles/border-panel.js +0 -114
- package/src/components/navigate-to-link/index.js +0 -46
- package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -9
- package/src/components/template-details/edit-template-title.js +0 -41
- package/src/components/template-details/index.js +0 -113
- package/src/components/template-details/style.scss +0 -72
- package/src/components/template-details/template-areas.js +0 -167
- package/src/components/template-details/template-part-area-selector.js +0 -39
|
@@ -1,70 +1,23 @@
|
|
|
1
|
-
.edit-site-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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 {
|
|
9
|
+
import { useMemo } from '@wordpress/element';
|
|
5
10
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
11
|
import { Notice } from '@wordpress/components';
|
|
7
|
-
import { EntityProvider
|
|
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
|
|
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={
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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( {
|
|
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
|
-
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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={
|
|
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={
|
|
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={
|
|
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
|
-
|
|
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
|
-
|
|
112
|
+
selectedRevisionId={ selectedRevisionId }
|
|
121
113
|
userRevisions={ revisions }
|
|
122
114
|
/>
|
|
123
115
|
{ isLoadButtonEnabled && (
|