@wordpress/edit-site 5.0.0 → 5.2.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 +14 -1
- package/LICENSE.md +1 -1
- package/build/components/add-new-template/new-template-part.js +21 -1
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/utils.js +9 -1
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +0 -1
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +17 -52
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +2 -1
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/editor/index.js +5 -17
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +27 -6
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +5 -5
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +9 -1
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/custom-css.js +1 -0
- package/build/components/global-styles/custom-css.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +16 -11
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +3 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +6 -6
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +4 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +2 -6
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-border.js +12 -2
- package/build/components/global-styles/screen-border.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +3 -4
- package/build/components/global-styles/screen-button-color.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +53 -25
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-heading-color.js +9 -10
- package/build/components/global-styles/screen-heading-color.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +12 -2
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +8 -8
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +7 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +4 -4
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +11 -1
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/screen-variations.js +71 -0
- package/build/components/global-styles/screen-variations.js.map +1 -0
- package/build/components/global-styles/typography-panel.js +9 -8
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +17 -5
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/ui.js +85 -18
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +119 -33
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +60 -3
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +85 -0
- package/build/components/global-styles/variations-panel.js.map +1 -0
- package/build/components/header-edit-mode/document-actions/index.js +10 -41
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/layout/index.js +129 -87
- package/build/components/layout/index.js.map +1 -1
- package/build/components/sidebar/index.js +5 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +3 -1
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js +2 -0
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +1 -1
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js +10 -0
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +1 -31
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +3 -22
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/site-hub/index.js +149 -0
- package/build/components/site-hub/index.js.map +1 -0
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +54 -0
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -0
- package/build/components/template-details/edit-template-title.js +1 -0
- package/build/components/template-details/edit-template-title.js.map +1 -1
- package/build/components/template-details/template-part-area-selector.js +1 -0
- package/build/components/template-details/template-part-area-selector.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +60 -0
- package/build/components/use-edited-entity-record/index.js.map +1 -0
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +144 -0
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -0
- package/build/index.js +5 -0
- package/build/index.js.map +1 -1
- package/build/store/reducer.js +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +20 -1
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +5 -0
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +0 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +19 -50
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/resize-handle.js +2 -1
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- package/build-module/components/editor/index.js +2 -13
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +26 -6
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +5 -5
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +7 -1
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +1 -0
- package/build-module/components/global-styles/custom-css.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +16 -11
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +3 -2
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +6 -6
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +3 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +2 -5
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +10 -2
- package/build-module/components/global-styles/screen-border.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +3 -4
- package/build-module/components/global-styles/screen-button-color.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +51 -25
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-heading-color.js +9 -10
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +10 -2
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +8 -8
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +8 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +4 -4
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +9 -1
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/screen-variations.js +54 -0
- package/build-module/components/global-styles/screen-variations.js.map +1 -0
- package/build-module/components/global-styles/typography-panel.js +9 -8
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +17 -5
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/ui.js +84 -19
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +121 -35
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +56 -3
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +68 -0
- package/build-module/components/global-styles/variations-panel.js.map +1 -0
- package/build-module/components/header-edit-mode/document-actions/index.js +10 -38
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/layout/index.js +129 -88
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +4 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +3 -1
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js +2 -0
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js +11 -1
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +2 -27
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -23
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +127 -0
- package/build-module/components/site-hub/index.js.map +1 -0
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +43 -0
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -0
- package/build-module/components/template-details/edit-template-title.js +1 -0
- package/build-module/components/template-details/edit-template-title.js.map +1 -1
- package/build-module/components/template-details/template-part-area-selector.js +1 -0
- package/build-module/components/template-details/template-part-area-selector.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +48 -0
- package/build-module/components/use-edited-entity-record/index.js.map +1 -0
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +132 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -0
- package/build-module/index.js +4 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/reducer.js +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +190 -125
- package/build-style/style.css +190 -125
- package/package.json +30 -29
- package/src/components/add-new-template/new-template-part.js +23 -1
- package/src/components/add-new-template/utils.js +14 -0
- package/src/components/block-editor/editor-canvas.js +0 -1
- package/src/components/block-editor/index.js +14 -59
- package/src/components/block-editor/resize-handle.js +6 -2
- package/src/components/block-editor/style.scss +43 -7
- package/src/components/editor/index.js +2 -17
- package/src/components/global-styles/block-preview-panel.js +37 -10
- package/src/components/global-styles/border-panel.js +8 -5
- package/src/components/global-styles/context-menu.js +6 -0
- package/src/components/global-styles/custom-css.js +1 -0
- package/src/components/global-styles/dimensions-panel.js +32 -15
- package/src/components/global-styles/global-styles-provider.js +11 -5
- package/src/components/global-styles/screen-background-color.js +12 -6
- package/src/components/global-styles/screen-block-list.js +6 -1
- package/src/components/global-styles/screen-block.js +1 -4
- package/src/components/global-styles/screen-border.js +8 -3
- package/src/components/global-styles/screen-button-color.js +2 -4
- package/src/components/global-styles/screen-colors.js +84 -20
- package/src/components/global-styles/screen-heading-color.js +8 -10
- package/src/components/global-styles/screen-layout.js +11 -3
- package/src/components/global-styles/screen-link-color.js +19 -8
- package/src/components/global-styles/screen-root.js +34 -27
- package/src/components/global-styles/screen-text-color.js +7 -4
- package/src/components/global-styles/screen-typography.js +13 -3
- package/src/components/global-styles/screen-variations.js +47 -0
- package/src/components/global-styles/style.scss +9 -0
- package/src/components/global-styles/test/typography-utils.js +72 -23
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/typography-panel.js +31 -8
- package/src/components/global-styles/typography-utils.js +24 -4
- package/src/components/global-styles/ui.js +101 -13
- package/src/components/global-styles/use-global-styles-output.js +137 -14
- package/src/components/global-styles/utils.js +56 -3
- package/src/components/global-styles/variations-panel.js +78 -0
- package/src/components/header-edit-mode/document-actions/index.js +18 -37
- package/src/components/header-edit-mode/style.scss +1 -0
- package/src/components/layout/index.js +217 -172
- package/src/components/layout/style.scss +98 -66
- package/src/components/list/style.scss +1 -8
- package/src/components/sidebar/index.js +4 -1
- package/src/components/sidebar-edit-mode/index.js +1 -1
- package/src/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js +2 -0
- package/src/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js +10 -0
- package/src/components/sidebar-edit-mode/navigation-menu-sidebar/style.scss +4 -0
- package/src/components/sidebar-navigation-screen/style.scss +2 -4
- package/src/components/sidebar-navigation-screen-main/index.js +1 -29
- package/src/components/sidebar-navigation-screen-templates/index.js +9 -27
- package/src/components/site-hub/index.js +161 -0
- package/src/components/site-hub/style.scss +31 -0
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +40 -0
- package/src/components/template-details/edit-template-title.js +1 -0
- package/src/components/template-details/template-part-area-selector.js +1 -0
- package/src/components/use-edited-entity-record/index.js +37 -0
- package/src/hooks/index.js +1 -0
- package/src/hooks/push-changes-to-global-styles/index.js +162 -0
- package/src/hooks/push-changes-to-global-styles/style.scss +4 -0
- package/src/index.js +2 -0
- package/src/store/reducer.js +1 -1
- package/src/style.scss +2 -0
- package/build/components/site-title/index.js +0 -55
- package/build/components/site-title/index.js.map +0 -1
- package/build-module/components/site-title/index.js +0 -43
- package/build-module/components/site-title/index.js.map +0 -1
- package/src/components/site-title/index.js +0 -39
|
@@ -1,83 +1,117 @@
|
|
|
1
|
+
$hub-height: $grid-unit-20 * 2 + $button-size;
|
|
2
|
+
|
|
1
3
|
.edit-site-layout {
|
|
2
|
-
|
|
4
|
+
height: 100%;
|
|
3
5
|
background: $gray-900;
|
|
4
6
|
color: $white;
|
|
5
7
|
display: flex;
|
|
6
8
|
flex-direction: column;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.edit-site-layout__hub {
|
|
12
|
+
position: fixed;
|
|
13
|
+
top: $canvas-padding;
|
|
14
|
+
left: $canvas-padding;
|
|
15
|
+
width: calc(100vw - #{$canvas-padding * 2});
|
|
16
|
+
height: $hub-height;
|
|
17
|
+
z-index: z-index(".edit-site-layout__hub");
|
|
18
|
+
|
|
19
|
+
background: $black;
|
|
20
|
+
padding: $grid-unit-20;
|
|
21
|
+
padding-left: 0;
|
|
22
|
+
border-radius: $radius-block-ui * 4;
|
|
23
|
+
box-shadow: $shadow-modal;
|
|
24
|
+
|
|
25
|
+
.edit-site-layout.is-full-canvas & {
|
|
26
|
+
top: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
padding: 0;
|
|
29
|
+
padding-right: $grid-unit-20;
|
|
30
|
+
height: $header-height;
|
|
31
|
+
border-radius: 0;
|
|
32
|
+
width: 100vw;
|
|
33
|
+
box-shadow: none;
|
|
34
|
+
|
|
35
|
+
@include break-medium {
|
|
36
|
+
width: auto;
|
|
37
|
+
padding-right: 0;
|
|
19
38
|
}
|
|
20
39
|
}
|
|
21
|
-
}
|
|
22
40
|
|
|
23
|
-
.edit-site-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
41
|
+
.edit-site-layout.is-full-canvas.is-edit-mode & {
|
|
42
|
+
width: auto;
|
|
43
|
+
padding-right: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@include break-medium {
|
|
47
|
+
width: calc(#{$nav-sidebar-width} - #{$canvas-padding * 2});
|
|
48
|
+
}
|
|
27
49
|
}
|
|
28
50
|
|
|
29
|
-
.edit-site-
|
|
30
|
-
align-items: center;
|
|
51
|
+
.edit-site-layout__header {
|
|
31
52
|
height: $header-height;
|
|
32
53
|
display: flex;
|
|
33
|
-
|
|
54
|
+
z-index: z-index(".edit-site-layout__header");
|
|
34
55
|
|
|
35
|
-
|
|
36
|
-
|
|
56
|
+
// This is only necessary for the exit animation
|
|
57
|
+
.edit-site-layout:not(.is-full-canvas) & {
|
|
58
|
+
position: fixed;
|
|
59
|
+
width: 100vw;
|
|
37
60
|
}
|
|
38
61
|
}
|
|
39
62
|
|
|
40
|
-
.edit-site-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
63
|
+
.edit-site-layout__content {
|
|
64
|
+
flex-grow: 1;
|
|
65
|
+
display: flex;
|
|
66
|
+
gap: $canvas-padding;
|
|
67
|
+
|
|
68
|
+
// Hide scrollbars during the edit/view animation.
|
|
69
|
+
overflow: hidden;
|
|
44
70
|
}
|
|
45
71
|
|
|
46
72
|
.edit-site-layout__sidebar {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
73
|
+
z-index: z-index(".edit-site-layout__sidebar");
|
|
74
|
+
width: 100vw;
|
|
75
|
+
|
|
76
|
+
@include break-medium {
|
|
77
|
+
width: $nav-sidebar-width;
|
|
78
|
+
}
|
|
52
79
|
|
|
53
80
|
// This is only necessary for the exit animation
|
|
54
81
|
.edit-site-layout.is-full-canvas & {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
position: absolute;
|
|
60
|
-
top: 60px;
|
|
61
|
-
}
|
|
82
|
+
position: fixed !important;
|
|
83
|
+
height: 100vh;
|
|
84
|
+
left: 0;
|
|
85
|
+
top: 0;
|
|
62
86
|
}
|
|
63
|
-
}
|
|
64
87
|
|
|
65
|
-
.
|
|
66
|
-
|
|
88
|
+
.resizable-editor__drag-handle.is-right {
|
|
89
|
+
right: math.div(-$grid-unit-15, 2);
|
|
90
|
+
}
|
|
67
91
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
right: 0;
|
|
92
|
+
> div {
|
|
93
|
+
overflow-y: auto;
|
|
94
|
+
min-height: 100%;
|
|
95
|
+
@include custom-scrollbars-on-hover;
|
|
73
96
|
}
|
|
74
97
|
}
|
|
75
98
|
|
|
76
99
|
.edit-site-layout__canvas-container {
|
|
77
|
-
grid-area: canvas;
|
|
78
100
|
position: relative;
|
|
79
101
|
flex-grow: 1;
|
|
80
|
-
z-index:
|
|
102
|
+
z-index: z-index(".edit-site-layout__canvas-container");
|
|
103
|
+
|
|
104
|
+
&.is-resizing::after {
|
|
105
|
+
// This covers the whole content which ensures mouse up triggers
|
|
106
|
+
// even if the content is "inert".
|
|
107
|
+
position: absolute;
|
|
108
|
+
top: 0;
|
|
109
|
+
left: 0;
|
|
110
|
+
right: 0;
|
|
111
|
+
bottom: 0;
|
|
112
|
+
content: "";
|
|
113
|
+
z-index: z-index(".edit-site-layout__canvas-container.is-resizing::after");
|
|
114
|
+
}
|
|
81
115
|
}
|
|
82
116
|
|
|
83
117
|
.edit-site-layout__canvas {
|
|
@@ -86,13 +120,14 @@
|
|
|
86
120
|
left: 0;
|
|
87
121
|
bottom: 0;
|
|
88
122
|
width: 100%;
|
|
89
|
-
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 8px 10px -6px rgba(0, 0, 0, 0.8);
|
|
90
123
|
|
|
91
124
|
& > div {
|
|
92
125
|
color: $gray-900;
|
|
93
126
|
background: $white;
|
|
127
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 8px 10px -6px rgba(0, 0, 0, 0.8);
|
|
94
128
|
}
|
|
95
|
-
|
|
129
|
+
|
|
130
|
+
@include break-medium {
|
|
96
131
|
top: $canvas-padding;
|
|
97
132
|
bottom: $canvas-padding;
|
|
98
133
|
width: calc(100% - #{$canvas-padding});
|
|
@@ -112,7 +147,10 @@
|
|
|
112
147
|
top: 0;
|
|
113
148
|
bottom: 0;
|
|
114
149
|
width: 100%;
|
|
115
|
-
|
|
150
|
+
|
|
151
|
+
& > div {
|
|
152
|
+
border-radius: 0;
|
|
153
|
+
}
|
|
116
154
|
}
|
|
117
155
|
}
|
|
118
156
|
|
|
@@ -124,11 +162,14 @@
|
|
|
124
162
|
|
|
125
163
|
.edit-site-layout__view-mode-toggle.components-button {
|
|
126
164
|
position: relative;
|
|
127
|
-
background: $gray-900;
|
|
128
165
|
color: $white;
|
|
129
|
-
height:
|
|
130
|
-
|
|
131
|
-
|
|
166
|
+
height: 100%;
|
|
167
|
+
width: 100%;
|
|
168
|
+
border-radius: $radius-block-ui;
|
|
169
|
+
padding: 0;
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
justify-content: center;
|
|
132
173
|
|
|
133
174
|
&:hover,
|
|
134
175
|
&:active {
|
|
@@ -150,15 +191,6 @@
|
|
|
150
191
|
bottom: 9px;
|
|
151
192
|
left: 9px;
|
|
152
193
|
border-radius: $radius-block-ui + $border-width + $border-width;
|
|
153
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $gray-900;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Hover color.
|
|
157
|
-
&:hover::before {
|
|
158
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $gray-700;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
&.has-icon:hover::before {
|
|
162
194
|
box-shadow: none;
|
|
163
195
|
}
|
|
164
196
|
|
|
@@ -170,7 +202,7 @@
|
|
|
170
202
|
}
|
|
171
203
|
|
|
172
204
|
.edit-site-layout__view-mode-toggle-icon {
|
|
205
|
+
display: flex;
|
|
173
206
|
border-radius: $radius-block-ui;
|
|
174
|
-
object-fit: cover;
|
|
175
207
|
}
|
|
176
208
|
}
|
|
@@ -44,18 +44,11 @@
|
|
|
44
44
|
.interface-interface-skeleton__content {
|
|
45
45
|
background: $white;
|
|
46
46
|
padding: $grid-unit-20;
|
|
47
|
-
|
|
48
|
-
.interface-navigable-region__stacker {
|
|
49
|
-
align-items: center;
|
|
50
|
-
}
|
|
47
|
+
align-items: center;
|
|
51
48
|
|
|
52
49
|
@include break-medium() {
|
|
53
50
|
padding: $grid-unit * 9;
|
|
54
51
|
}
|
|
55
|
-
|
|
56
|
-
& > .interface-navigable-region__stacker {
|
|
57
|
-
height: auto;
|
|
58
|
-
}
|
|
59
52
|
}
|
|
60
53
|
}
|
|
61
54
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { memo } from '@wordpress/element';
|
|
4
5
|
import { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -22,7 +23,7 @@ function SidebarScreens() {
|
|
|
22
23
|
);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
function Sidebar() {
|
|
26
27
|
return (
|
|
27
28
|
<NavigatorProvider
|
|
28
29
|
className="edit-site-sidebar__content"
|
|
@@ -32,3 +33,5 @@ export function Sidebar() {
|
|
|
32
33
|
</NavigatorProvider>
|
|
33
34
|
);
|
|
34
35
|
}
|
|
36
|
+
|
|
37
|
+
export default memo( Sidebar );
|
|
@@ -69,7 +69,7 @@ export function SidebarComplementaryAreaFills() {
|
|
|
69
69
|
// See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.
|
|
70
70
|
let MaybeNavigationMenuSidebar = Fragment;
|
|
71
71
|
|
|
72
|
-
if (
|
|
72
|
+
if ( window?.__experimentalEnableOffCanvasNavigationEditor === true ) {
|
|
73
73
|
MaybeNavigationMenuSidebar = NavigationMenuSidebar;
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -180,6 +180,8 @@ export default function NavigationInspector() {
|
|
|
180
180
|
) }
|
|
181
181
|
{ hasResolvedNavigationMenus && hasMoreThanOneNavigationMenu && (
|
|
182
182
|
<SelectControl
|
|
183
|
+
__nextHasNoMarginBottom
|
|
184
|
+
className="edit-site-navigation-inspector__select-menu"
|
|
183
185
|
aria-controls={
|
|
184
186
|
// aria-controls should only apply when referenced element is in DOM
|
|
185
187
|
hasLoadedInnerBlocks ? navMenuListId : undefined
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
__experimentalListView as ListView,
|
|
6
|
+
__experimentalOffCanvasEditor as OffCanvasEditor,
|
|
6
7
|
store as blockEditorStore,
|
|
7
8
|
} from '@wordpress/block-editor';
|
|
8
9
|
import { useEffect } from '@wordpress/element';
|
|
@@ -48,5 +49,14 @@ export default function NavigationMenu( { innerBlocks, id } ) {
|
|
|
48
49
|
}
|
|
49
50
|
} );
|
|
50
51
|
}, [ updateBlockListSettings, innerBlocks ] );
|
|
52
|
+
|
|
53
|
+
if ( window?.__experimentalEnableOffCanvasNavigationEditor ) {
|
|
54
|
+
return (
|
|
55
|
+
<OffCanvasEditor
|
|
56
|
+
blocks={ innerBlocks }
|
|
57
|
+
selectBlockInCanvas={ false }
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
51
61
|
return <ListView id={ id } />;
|
|
52
62
|
}
|
|
@@ -6,16 +6,14 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.edit-site-sidebar-navigation-screen__content {
|
|
9
|
-
margin: 0 $grid-unit-20
|
|
10
|
-
flex-grow: 1;
|
|
11
|
-
overflow-y: auto;
|
|
9
|
+
margin: 0 $grid-unit-20 $grid-unit-20 $button-size;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
.edit-site-sidebar-navigation-screen__title-icon {
|
|
15
13
|
position: sticky;
|
|
16
14
|
top: 0;
|
|
17
15
|
background: $gray-900;
|
|
18
|
-
padding-top: $grid-unit-
|
|
16
|
+
padding-top: $grid-unit-60 + $hub-height + $canvas-padding * 2;
|
|
19
17
|
box-shadow: 0 $grid-unit-10 $grid-unit-20 $gray-900;
|
|
20
18
|
margin-bottom: $grid-unit-10;
|
|
21
19
|
padding-bottom: $grid-unit-10;
|
|
@@ -3,50 +3,22 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
__experimentalItemGroup as ItemGroup,
|
|
6
|
-
__experimentalHStack as HStack,
|
|
7
6
|
__experimentalNavigatorButton as NavigatorButton,
|
|
8
|
-
Button,
|
|
9
7
|
} from '@wordpress/components';
|
|
10
8
|
import { __ } from '@wordpress/i18n';
|
|
11
9
|
import { layout, symbolFilled } from '@wordpress/icons';
|
|
12
|
-
import { useDispatch } from '@wordpress/data';
|
|
13
|
-
import { useViewportMatch } from '@wordpress/compose';
|
|
14
10
|
|
|
15
11
|
/**
|
|
16
12
|
* Internal dependencies
|
|
17
13
|
*/
|
|
18
14
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
19
15
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
20
|
-
import { useLocation } from '../routes';
|
|
21
|
-
import { store as editSiteStore } from '../../store';
|
|
22
|
-
import getIsListPage from '../../utils/get-is-list-page';
|
|
23
16
|
|
|
24
17
|
export default function SidebarNavigationScreenMain() {
|
|
25
|
-
const { params } = useLocation();
|
|
26
|
-
const isListPage = getIsListPage( params );
|
|
27
|
-
const isEditorPage = ! isListPage;
|
|
28
|
-
const { __unstableSetCanvasMode } = useDispatch( editSiteStore );
|
|
29
|
-
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
30
|
-
|
|
31
18
|
return (
|
|
32
19
|
<SidebarNavigationScreen
|
|
33
20
|
path="/"
|
|
34
|
-
title={
|
|
35
|
-
<HStack justify="space-between" style={ { minHeight: 36 } }>
|
|
36
|
-
<div>{ __( 'Design' ) }</div>
|
|
37
|
-
{ ! isMobileViewport && isEditorPage && (
|
|
38
|
-
<Button
|
|
39
|
-
className="edit-site-layout__edit-button"
|
|
40
|
-
label={ __( 'Open the editor' ) }
|
|
41
|
-
onClick={ () => {
|
|
42
|
-
__unstableSetCanvasMode( 'edit' );
|
|
43
|
-
} }
|
|
44
|
-
>
|
|
45
|
-
{ __( 'Edit' ) }
|
|
46
|
-
</Button>
|
|
47
|
-
) }
|
|
48
|
-
</HStack>
|
|
49
|
-
}
|
|
21
|
+
title={ __( 'Design' ) }
|
|
50
22
|
content={
|
|
51
23
|
<ItemGroup>
|
|
52
24
|
<NavigatorButton
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
import {
|
|
5
5
|
__experimentalItemGroup as ItemGroup,
|
|
6
6
|
__experimentalHStack as HStack,
|
|
7
|
-
Button,
|
|
8
7
|
} from '@wordpress/components';
|
|
9
8
|
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import {
|
|
9
|
+
import { useSelect } from '@wordpress/data';
|
|
11
10
|
import { useEntityRecords } from '@wordpress/core-data';
|
|
12
11
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
13
12
|
import { useViewportMatch } from '@wordpress/compose';
|
|
@@ -20,7 +19,6 @@ import { useLink } from '../routes/link';
|
|
|
20
19
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
21
20
|
import { useLocation } from '../routes';
|
|
22
21
|
import { store as editSiteStore } from '../../store';
|
|
23
|
-
import getIsListPage from '../../utils/get-is-list-page';
|
|
24
22
|
import AddNewTemplate from '../add-new-template';
|
|
25
23
|
|
|
26
24
|
function omit( object, keys ) {
|
|
@@ -62,10 +60,7 @@ export default function SidebarNavigationScreenTemplates( {
|
|
|
62
60
|
postType = 'wp_template',
|
|
63
61
|
} ) {
|
|
64
62
|
const { params } = useLocation();
|
|
65
|
-
const { __unstableSetCanvasMode } = useDispatch( editSiteStore );
|
|
66
63
|
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
67
|
-
const isListPage = getIsListPage( params );
|
|
68
|
-
const isEditorPage = ! isListPage;
|
|
69
64
|
|
|
70
65
|
// Ideally the URL params would be enough.
|
|
71
66
|
// Loading the editor should ideally redirect to the home page
|
|
@@ -125,31 +120,18 @@ export default function SidebarNavigationScreenTemplates( {
|
|
|
125
120
|
path={ config[ postType ].path }
|
|
126
121
|
parentTitle={ __( 'Design' ) }
|
|
127
122
|
title={
|
|
128
|
-
<HStack
|
|
123
|
+
<HStack justify="space-between">
|
|
129
124
|
<div style={ { flexShrink: 0 } }>
|
|
130
125
|
{ config[ postType ].labels.title }
|
|
131
126
|
</div>
|
|
132
127
|
{ ! isMobileViewport && (
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
/>
|
|
141
|
-
{ isEditorPage && (
|
|
142
|
-
<Button
|
|
143
|
-
className="edit-site-layout__edit-button"
|
|
144
|
-
label={ __( 'Open the editor' ) }
|
|
145
|
-
onClick={ () => {
|
|
146
|
-
__unstableSetCanvasMode( 'edit' );
|
|
147
|
-
} }
|
|
148
|
-
>
|
|
149
|
-
{ __( 'Edit' ) }
|
|
150
|
-
</Button>
|
|
151
|
-
) }
|
|
152
|
-
</HStack>
|
|
128
|
+
<AddNewTemplate
|
|
129
|
+
templateType={ postType }
|
|
130
|
+
toggleProps={ {
|
|
131
|
+
className:
|
|
132
|
+
'edit-site-sidebar-navigation-screen-templates__add-button',
|
|
133
|
+
} }
|
|
134
|
+
/>
|
|
153
135
|
) }
|
|
154
136
|
</HStack>
|
|
155
137
|
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
10
|
+
import {
|
|
11
|
+
Button,
|
|
12
|
+
__unstableMotion as motion,
|
|
13
|
+
__experimentalHStack as HStack,
|
|
14
|
+
__experimentalVStack as VStack,
|
|
15
|
+
} from '@wordpress/components';
|
|
16
|
+
import { useReducedMotion, useViewportMatch } from '@wordpress/compose';
|
|
17
|
+
import { __ } from '@wordpress/i18n';
|
|
18
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
19
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
20
|
+
import { forwardRef } from '@wordpress/element';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
import { store as editSiteStore } from '../../store';
|
|
26
|
+
import { useLocation } from '../routes';
|
|
27
|
+
import getIsListPage from '../../utils/get-is-list-page';
|
|
28
|
+
import SiteIcon from '../site-icon';
|
|
29
|
+
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
30
|
+
|
|
31
|
+
const HUB_ANIMATION_DURATION = 0.3;
|
|
32
|
+
|
|
33
|
+
const SiteHub = forwardRef(
|
|
34
|
+
( { isMobileCanvasVisible, setIsMobileCanvasVisible, ...props }, ref ) => {
|
|
35
|
+
const { params } = useLocation();
|
|
36
|
+
const isListPage = getIsListPage( params );
|
|
37
|
+
const isEditorPage = ! isListPage;
|
|
38
|
+
const { canvasMode, dashboardLink, entityConfig } = useSelect(
|
|
39
|
+
( select ) => {
|
|
40
|
+
select( editSiteStore ).getEditedPostType();
|
|
41
|
+
const {
|
|
42
|
+
__unstableGetCanvasMode,
|
|
43
|
+
getSettings,
|
|
44
|
+
getEditedPostType,
|
|
45
|
+
} = select( editSiteStore );
|
|
46
|
+
return {
|
|
47
|
+
canvasMode: __unstableGetCanvasMode(),
|
|
48
|
+
dashboardLink: getSettings().__experimentalDashboardLink,
|
|
49
|
+
entityConfig: select( coreStore ).getEntityConfig(
|
|
50
|
+
'postType',
|
|
51
|
+
getEditedPostType()
|
|
52
|
+
),
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
[]
|
|
56
|
+
);
|
|
57
|
+
const disableMotion = useReducedMotion();
|
|
58
|
+
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
59
|
+
const { __unstableSetCanvasMode } = useDispatch( editSiteStore );
|
|
60
|
+
const { clearSelectedBlock } = useDispatch( blockEditorStore );
|
|
61
|
+
const showEditButton =
|
|
62
|
+
( isEditorPage && canvasMode === 'view' && ! isMobileViewport ) ||
|
|
63
|
+
( isMobileViewport &&
|
|
64
|
+
canvasMode === 'view' &&
|
|
65
|
+
isMobileCanvasVisible );
|
|
66
|
+
const isBackToDashboardButton =
|
|
67
|
+
( ! isMobileViewport && canvasMode === 'view' ) ||
|
|
68
|
+
( isMobileViewport && ! isMobileCanvasVisible );
|
|
69
|
+
const showLabels = canvasMode !== 'edit';
|
|
70
|
+
const siteIconButtonProps = isBackToDashboardButton
|
|
71
|
+
? {
|
|
72
|
+
href: dashboardLink || 'index.php',
|
|
73
|
+
'aria-label': __( 'Go back to the dashboard' ),
|
|
74
|
+
}
|
|
75
|
+
: {
|
|
76
|
+
label: __( 'Open Navigation Sidebar' ),
|
|
77
|
+
onClick: () => {
|
|
78
|
+
clearSelectedBlock();
|
|
79
|
+
setIsMobileCanvasVisible( false );
|
|
80
|
+
__unstableSetCanvasMode( 'view' );
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
const { getTitle } = useEditedEntityRecord();
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<motion.div
|
|
87
|
+
ref={ ref }
|
|
88
|
+
{ ...props }
|
|
89
|
+
className={ classnames(
|
|
90
|
+
'edit-site-site-hub',
|
|
91
|
+
props.className
|
|
92
|
+
) }
|
|
93
|
+
layout
|
|
94
|
+
transition={ {
|
|
95
|
+
type: 'tween',
|
|
96
|
+
duration: disableMotion ? 0 : HUB_ANIMATION_DURATION,
|
|
97
|
+
ease: 'easeOut',
|
|
98
|
+
} }
|
|
99
|
+
>
|
|
100
|
+
<HStack
|
|
101
|
+
justify="flex-start"
|
|
102
|
+
className="edit-site-site-hub__text-content"
|
|
103
|
+
>
|
|
104
|
+
<motion.div
|
|
105
|
+
className="edit-site-site-hub__view-mode-toggle-container"
|
|
106
|
+
layout
|
|
107
|
+
transition={ {
|
|
108
|
+
type: 'tween',
|
|
109
|
+
duration: disableMotion
|
|
110
|
+
? 0
|
|
111
|
+
: HUB_ANIMATION_DURATION,
|
|
112
|
+
ease: 'easeOut',
|
|
113
|
+
} }
|
|
114
|
+
>
|
|
115
|
+
<Button
|
|
116
|
+
{ ...siteIconButtonProps }
|
|
117
|
+
className="edit-site-layout__view-mode-toggle"
|
|
118
|
+
>
|
|
119
|
+
<SiteIcon className="edit-site-layout__view-mode-toggle-icon" />
|
|
120
|
+
</Button>
|
|
121
|
+
</motion.div>
|
|
122
|
+
|
|
123
|
+
{ showLabels && (
|
|
124
|
+
<VStack spacing={ 0 }>
|
|
125
|
+
<div className="edit-site-site-hub__title">
|
|
126
|
+
{ getTitle() }
|
|
127
|
+
</div>
|
|
128
|
+
<div className="edit-site-site-hub__post-type">
|
|
129
|
+
{ entityConfig?.label }
|
|
130
|
+
</div>
|
|
131
|
+
</VStack>
|
|
132
|
+
) }
|
|
133
|
+
</HStack>
|
|
134
|
+
|
|
135
|
+
{ showEditButton && (
|
|
136
|
+
<Button
|
|
137
|
+
className="edit-site-site-hub__edit-button"
|
|
138
|
+
label={ __( 'Open the editor' ) }
|
|
139
|
+
onClick={ () => {
|
|
140
|
+
__unstableSetCanvasMode( 'edit' );
|
|
141
|
+
} }
|
|
142
|
+
variant="primary"
|
|
143
|
+
>
|
|
144
|
+
{ __( 'Edit' ) }
|
|
145
|
+
</Button>
|
|
146
|
+
) }
|
|
147
|
+
|
|
148
|
+
{ isMobileViewport && ! isMobileCanvasVisible && (
|
|
149
|
+
<Button
|
|
150
|
+
onClick={ () => setIsMobileCanvasVisible( true ) }
|
|
151
|
+
variant="primary"
|
|
152
|
+
>
|
|
153
|
+
{ __( 'View Editor' ) }
|
|
154
|
+
</Button>
|
|
155
|
+
) }
|
|
156
|
+
</motion.div>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
export default SiteHub;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.edit-site-site-hub {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: $grid-unit-10;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.edit-site-site-hub__edit-button {
|
|
9
|
+
height: $grid-unit-40;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.edit-site-site-hub__post-type {
|
|
13
|
+
opacity: 0.6;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.edit-site-site-hub__view-mode-toggle-container {
|
|
17
|
+
height: $header-height;
|
|
18
|
+
width: $header-height;
|
|
19
|
+
flex-shrink: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.edit-site-site-hub__text-content {
|
|
23
|
+
// Necessary for the ellipsis to work.
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.edit-site-site-hub__title {
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|