@wordpress/edit-site 6.6.1 → 6.7.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-template-modal-content.js +6 -7
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +7 -10
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +0 -24
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +6 -3
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +4 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +4 -1
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +5 -2
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +27 -19
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +21 -8
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +4 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-size.js +10 -11
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +4 -6
- package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build/components/global-styles/header.js +1 -8
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +1 -1
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +4 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preset-colors.js +1 -1
- package/build/components/global-styles/preset-colors.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +4 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +20 -10
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/typeset-button.js +5 -4
- package/build/components/global-styles/typeset-button.js.map +1 -1
- package/build/components/layout/index.js +1 -2
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/fields.js +5 -2
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/pagination/index.js +4 -4
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/save-panel/index.js +4 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +4 -1
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +8 -2
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/site-hub/index.js +30 -14
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +1 -5
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -4
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +12 -12
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/welcome-guide/template.js +20 -9
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +2 -4
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +6 -7
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +7 -10
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +0 -23
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +6 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +4 -1
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +4 -1
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +7 -4
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +29 -21
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +24 -11
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +4 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +15 -16
- package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js +4 -6
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -9
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +2 -2
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +4 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js +1 -1
- package/build-module/components/global-styles/preset-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +4 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +20 -10
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/typeset-button.js +6 -5
- package/build-module/components/global-styles/typeset-button.js.map +1 -1
- package/build-module/components/layout/index.js +1 -2
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +5 -2
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/pagination/index.js +5 -5
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +4 -1
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +4 -1
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +8 -2
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/site-hub/index.js +30 -14
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +1 -5
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -4
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +12 -12
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +19 -9
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +2 -4
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-style/posts-rtl.css +90 -83
- package/build-style/posts.css +90 -83
- package/build-style/style-rtl.css +94 -99
- package/build-style/style.css +94 -99
- package/package.json +41 -41
- package/src/components/add-new-template/add-custom-template-modal-content.js +6 -7
- package/src/components/add-new-template/index.js +6 -8
- package/src/components/add-new-template/style.scss +1 -2
- package/src/components/block-editor/use-site-editor-settings.js +0 -18
- package/src/components/editor/index.js +4 -2
- package/src/components/editor-canvas-container/index.js +2 -0
- package/src/components/editor-canvas-container/style.scss +1 -1
- package/src/components/error-boundary/warning.js +6 -1
- package/src/components/global-styles/font-library-modal/font-card.js +5 -3
- package/src/components/global-styles/font-library-modal/font-collection.js +45 -27
- package/src/components/global-styles/font-library-modal/installed-fonts.js +36 -14
- package/src/components/global-styles/font-library-modal/upload-fonts.js +2 -0
- package/src/components/global-styles/font-sizes/font-size.js +18 -18
- package/src/components/global-styles/font-sizes/font-sizes.js +9 -11
- package/src/components/global-styles/header.js +2 -7
- package/src/components/global-styles/navigation-button.js +2 -4
- package/src/components/global-styles/palette.js +2 -0
- package/src/components/global-styles/preset-colors.js +1 -1
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -0
- package/src/components/global-styles/screen-revisions/style.scss +1 -1
- package/src/components/global-styles/shadows-edit-panel.js +23 -13
- package/src/components/global-styles/style.scss +5 -5
- package/src/components/global-styles/typeset-button.js +10 -3
- package/src/components/global-styles/variations/style.scss +1 -2
- package/src/components/layout/index.js +0 -2
- package/src/components/layout/style.scss +2 -24
- package/src/components/page/style.scss +5 -1
- package/src/components/page-patterns/fields.js +3 -1
- package/src/components/page-patterns/style.scss +2 -11
- package/src/components/page-templates/style.scss +1 -2
- package/src/components/pagination/index.js +5 -5
- package/src/components/post-list/style.scss +1 -1
- package/src/components/save-panel/index.js +2 -0
- package/src/components/sidebar-button/index.js +2 -0
- package/src/components/sidebar-dataviews/add-new-view.js +4 -0
- package/src/components/sidebar-dataviews/style.scss +1 -1
- package/src/components/sidebar-navigation-item/style.scss +0 -1
- package/src/components/sidebar-navigation-screen/style.scss +0 -1
- package/src/components/site-hub/index.js +18 -12
- package/src/components/style-book/index.js +1 -4
- package/src/components/style-book/style.scss +2 -2
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -4
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +15 -12
- package/src/components/welcome-guide/template.js +12 -18
- package/src/hooks/commands/use-common-commands.js +3 -5
|
@@ -23,14 +23,20 @@ import { getFontFamilies } from './utils';
|
|
|
23
23
|
import { NavigationButtonAsItem } from './navigation-button';
|
|
24
24
|
import Subtitle from './subtitle';
|
|
25
25
|
import { unlock } from '../../lock-unlock';
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
filterObjectByProperties,
|
|
28
|
+
useCurrentMergeThemeStyleVariationsWithUserConfig,
|
|
29
|
+
} from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
|
|
27
30
|
|
|
28
31
|
const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
|
|
29
32
|
const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
|
|
30
33
|
|
|
31
34
|
function TypesetButton() {
|
|
32
|
-
const
|
|
33
|
-
const
|
|
35
|
+
const propertiesToFilter = [ 'typography' ];
|
|
36
|
+
const typographyVariations =
|
|
37
|
+
useCurrentMergeThemeStyleVariationsWithUserConfig( propertiesToFilter );
|
|
38
|
+
const hasTypographyVariations = typographyVariations?.length > 1;
|
|
39
|
+
const { base, user: userConfig } = useContext( GlobalStylesContext );
|
|
34
40
|
const config = mergeBaseAndUserConfigs( base, userConfig );
|
|
35
41
|
const allFontFamilies = getFontFamilies( config );
|
|
36
42
|
const hasFonts =
|
|
@@ -63,6 +69,7 @@ function TypesetButton() {
|
|
|
63
69
|
}, [ allFontFamilies, userTypographyConfig, variations ] );
|
|
64
70
|
|
|
65
71
|
return (
|
|
72
|
+
hasTypographyVariations &&
|
|
66
73
|
hasFonts && (
|
|
67
74
|
<VStack spacing={ 2 }>
|
|
68
75
|
<HStack justify="space-between">
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
.edit-site-global-styles-variations_item {
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
// To round the outline in Windows 10 high contrast mode.
|
|
4
|
-
border-radius: $radius-block-ui;
|
|
5
4
|
cursor: pointer;
|
|
6
5
|
|
|
7
6
|
.edit-site-global-styles-variations_item-preview {
|
|
8
|
-
border-radius: $radius-
|
|
7
|
+
border-radius: $radius-small;
|
|
9
8
|
outline: $border-width solid rgba($black, 0.1);
|
|
10
9
|
outline-offset: -$border-width;
|
|
11
10
|
overflow: hidden;
|
|
@@ -81,7 +81,6 @@ export default function Layout( { route } ) {
|
|
|
81
81
|
} );
|
|
82
82
|
const disableMotion = useReducedMotion();
|
|
83
83
|
const [ canvasResizer, canvasSize ] = useResizeObserver();
|
|
84
|
-
const [ fullResizer ] = useResizeObserver();
|
|
85
84
|
const isEditorLoading = useIsSiteEditorLoading();
|
|
86
85
|
const [ isResizableFrameOversized, setIsResizableFrameOversized ] =
|
|
87
86
|
useState( false );
|
|
@@ -113,7 +112,6 @@ export default function Layout( { route } ) {
|
|
|
113
112
|
<CommandMenu />
|
|
114
113
|
<KeyboardShortcutsRegister />
|
|
115
114
|
<KeyboardShortcutsGlobal />
|
|
116
|
-
{ fullResizer }
|
|
117
115
|
<div
|
|
118
116
|
{ ...navigateRegionsProps }
|
|
119
117
|
ref={ navigateRegionsProps.ref }
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
overflow: hidden;
|
|
121
121
|
|
|
122
122
|
.edit-site-layout:not(.is-full-canvas) & {
|
|
123
|
-
border-radius: $radius-
|
|
123
|
+
border-radius: $radius-large;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
}
|
|
@@ -200,7 +200,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
200
200
|
right: 9px;
|
|
201
201
|
bottom: 9px;
|
|
202
202
|
left: 9px;
|
|
203
|
-
border-radius: $radius-
|
|
203
|
+
border-radius: $radius-medium;
|
|
204
204
|
box-shadow: none;
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -259,25 +259,3 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
259
259
|
padding-left: 16px;
|
|
260
260
|
padding-right: 16px;
|
|
261
261
|
}
|
|
262
|
-
|
|
263
|
-
.edit-site-layout.is-full-canvas {
|
|
264
|
-
.edit-site-layout__view-mode-toggle.components-button {
|
|
265
|
-
&:focus-visible,
|
|
266
|
-
&:focus {
|
|
267
|
-
|
|
268
|
-
box-shadow: none;
|
|
269
|
-
outline: none;
|
|
270
|
-
outline-offset: 0;
|
|
271
|
-
|
|
272
|
-
.edit-site-site-icon svg {
|
|
273
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color, #3858e9);
|
|
274
|
-
outline: 3px solid #0000;
|
|
275
|
-
height: 40px;
|
|
276
|
-
width: 40px;
|
|
277
|
-
padding: 2px;
|
|
278
|
-
border-radius: 2px;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
.edit-site-page {
|
|
2
2
|
color: $gray-800;
|
|
3
3
|
background: $white;
|
|
4
|
-
height: 100
|
|
4
|
+
height: calc(100% - #{$header-height});
|
|
5
5
|
/* stylelint-disable-next-line property-no-unknown -- '@container' not globally permitted */
|
|
6
6
|
container: edit-site-page / inline-size;
|
|
7
7
|
transition: width ease-out 0.2s;
|
|
8
8
|
@include reduce-motion("transition");
|
|
9
|
+
|
|
10
|
+
@include break-medium() {
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
.edit-site-page-header {
|
|
@@ -126,13 +126,15 @@ function TitleField( { item } ) {
|
|
|
126
126
|
<Flex
|
|
127
127
|
as="div"
|
|
128
128
|
gap={ 0 }
|
|
129
|
-
justify="
|
|
129
|
+
justify="flex-start"
|
|
130
130
|
className="edit-site-patterns__pattern-title"
|
|
131
131
|
>
|
|
132
132
|
{ item.type === PATTERN_TYPES.theme ? (
|
|
133
133
|
title
|
|
134
134
|
) : (
|
|
135
135
|
<Button
|
|
136
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
137
|
+
__next40pxDefaultSize={ false }
|
|
136
138
|
variant="link"
|
|
137
139
|
onClick={ onClick }
|
|
138
140
|
// Required for the grid's roving tab index system.
|
|
@@ -11,11 +11,6 @@
|
|
|
11
11
|
.dataviews-view-table & {
|
|
12
12
|
width: 96px;
|
|
13
13
|
flex-grow: 0;
|
|
14
|
-
border-radius: 2px;
|
|
15
|
-
|
|
16
|
-
.page-patterns-preview-field__button {
|
|
17
|
-
border-radius: 2px;
|
|
18
|
-
}
|
|
19
14
|
}
|
|
20
15
|
|
|
21
16
|
.page-patterns-preview-field__button {
|
|
@@ -110,10 +105,6 @@
|
|
|
110
105
|
}
|
|
111
106
|
|
|
112
107
|
.edit-site-page-patterns-dataviews {
|
|
113
|
-
.dataviews-pagination {
|
|
114
|
-
z-index: z-index(".edit-site-patterns__dataviews-list-pagination");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
108
|
.dataviews-view-grid__badge-fields {
|
|
118
109
|
.dataviews-view-grid__field-value:has(.edit-site-patterns__field-sync-status-fully) {
|
|
119
110
|
background: rgba(var(--wp-block-synced-color--rgb), 0.04);
|
|
@@ -135,8 +126,8 @@
|
|
|
135
126
|
.components-form-token-field__suggestions-list:not(:empty) {
|
|
136
127
|
position: absolute;
|
|
137
128
|
border: $border-width solid var(--wp-admin-theme-color);
|
|
138
|
-
border-bottom-left-radius: $radius-
|
|
139
|
-
border-bottom-right-radius: $radius-
|
|
129
|
+
border-bottom-left-radius: $radius-small;
|
|
130
|
+
border-bottom-right-radius: $radius-small;
|
|
140
131
|
box-shadow: 0 0 0.5px 0.5px var(--wp-admin-theme-color);
|
|
141
132
|
box-sizing: border-box;
|
|
142
133
|
z-index: 1;
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.dataviews-view-table & {
|
|
39
|
-
border-radius: $radius-block-ui;
|
|
40
39
|
position: relative;
|
|
41
40
|
width: 120px;
|
|
42
41
|
max-height: 160px;
|
|
@@ -49,7 +48,7 @@
|
|
|
49
48
|
width: 100%;
|
|
50
49
|
height: 100%;
|
|
51
50
|
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
52
|
-
border-radius: $radius-
|
|
51
|
+
border-radius: $radius-medium;
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
__experimentalText as Text,
|
|
12
12
|
Button,
|
|
13
13
|
} from '@wordpress/components';
|
|
14
|
-
import { __, _x, _n, sprintf } from '@wordpress/i18n';
|
|
14
|
+
import { __, _x, _n, sprintf, isRTL } from '@wordpress/i18n';
|
|
15
15
|
import { previous, chevronLeft, chevronRight, next } from '@wordpress/icons';
|
|
16
16
|
|
|
17
17
|
export default function Pagination( {
|
|
@@ -50,7 +50,7 @@ export default function Pagination( {
|
|
|
50
50
|
accessibleWhenDisabled
|
|
51
51
|
disabled={ disabled || currentPage === 1 }
|
|
52
52
|
label={ __( 'First page' ) }
|
|
53
|
-
icon={ previous }
|
|
53
|
+
icon={ isRTL() ? next : previous }
|
|
54
54
|
size="compact"
|
|
55
55
|
/>
|
|
56
56
|
<Button
|
|
@@ -59,7 +59,7 @@ export default function Pagination( {
|
|
|
59
59
|
accessibleWhenDisabled
|
|
60
60
|
disabled={ disabled || currentPage === 1 }
|
|
61
61
|
label={ __( 'Previous page' ) }
|
|
62
|
-
icon={ chevronLeft }
|
|
62
|
+
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
63
63
|
size="compact"
|
|
64
64
|
/>
|
|
65
65
|
</HStack>
|
|
@@ -78,7 +78,7 @@ export default function Pagination( {
|
|
|
78
78
|
accessibleWhenDisabled
|
|
79
79
|
disabled={ disabled || currentPage === numPages }
|
|
80
80
|
label={ __( 'Next page' ) }
|
|
81
|
-
icon={ chevronRight }
|
|
81
|
+
icon={ isRTL() ? chevronLeft : chevronRight }
|
|
82
82
|
size="compact"
|
|
83
83
|
/>
|
|
84
84
|
<Button
|
|
@@ -87,7 +87,7 @@ export default function Pagination( {
|
|
|
87
87
|
accessibleWhenDisabled
|
|
88
88
|
disabled={ disabled || currentPage === numPages }
|
|
89
89
|
label={ __( 'Last page' ) }
|
|
90
|
-
icon={ next }
|
|
90
|
+
icon={ isRTL() ? previous : next }
|
|
91
91
|
size="compact"
|
|
92
92
|
/>
|
|
93
93
|
</HStack>
|
|
@@ -150,6 +150,8 @@ export default function SavePanel() {
|
|
|
150
150
|
} ) }
|
|
151
151
|
>
|
|
152
152
|
<Button
|
|
153
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
154
|
+
__next40pxDefaultSize={ false }
|
|
153
155
|
variant="secondary"
|
|
154
156
|
className="edit-site-editor__toggle-save-panel-button"
|
|
155
157
|
onClick={ () => setIsSaveViewOpened( true ) }
|
|
@@ -11,6 +11,8 @@ import { Button } from '@wordpress/components';
|
|
|
11
11
|
export default function SidebarButton( props ) {
|
|
12
12
|
return (
|
|
13
13
|
<Button
|
|
14
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
15
|
+
__next40pxDefaultSize={ false }
|
|
14
16
|
{ ...props }
|
|
15
17
|
className={ clsx( 'edit-site-sidebar-button', props.className ) }
|
|
16
18
|
/>
|
|
@@ -88,6 +88,8 @@ function AddNewItemModalContent( { type, setIsAdding } ) {
|
|
|
88
88
|
/>
|
|
89
89
|
<HStack justify="right">
|
|
90
90
|
<Button
|
|
91
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
92
|
+
__next40pxDefaultSize={ false }
|
|
91
93
|
variant="tertiary"
|
|
92
94
|
onClick={ () => {
|
|
93
95
|
setIsAdding( false );
|
|
@@ -97,6 +99,8 @@ function AddNewItemModalContent( { type, setIsAdding } ) {
|
|
|
97
99
|
</Button>
|
|
98
100
|
|
|
99
101
|
<Button
|
|
102
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
103
|
+
__next40pxDefaultSize={ false }
|
|
100
104
|
variant="primary"
|
|
101
105
|
type="submit"
|
|
102
106
|
aria-disabled={ ! title || isSaving }
|
|
@@ -36,15 +36,12 @@ const SiteHub = memo(
|
|
|
36
36
|
const { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {
|
|
37
37
|
const { getSettings } = unlock( select( editSiteStore ) );
|
|
38
38
|
|
|
39
|
-
const {
|
|
40
|
-
|
|
41
|
-
getUnstableBase, // Site index.
|
|
42
|
-
} = select( coreStore );
|
|
43
|
-
const _site = getSite();
|
|
39
|
+
const { getEntityRecord } = select( coreStore );
|
|
40
|
+
const _site = getEntityRecord( 'root', 'site' );
|
|
44
41
|
return {
|
|
45
42
|
dashboardLink:
|
|
46
43
|
getSettings().__experimentalDashboardLink || 'index.php',
|
|
47
|
-
homeUrl:
|
|
44
|
+
homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
|
|
48
45
|
siteTitle:
|
|
49
46
|
! _site?.title && !! _site?.url
|
|
50
47
|
? filterURLForDisplay( _site?.url )
|
|
@@ -65,6 +62,8 @@ const SiteHub = memo(
|
|
|
65
62
|
) }
|
|
66
63
|
>
|
|
67
64
|
<Button
|
|
65
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
66
|
+
__next40pxDefaultSize={ false }
|
|
68
67
|
ref={ ref }
|
|
69
68
|
href={ dashboardLink }
|
|
70
69
|
label={ __( 'Go to the Dashboard' ) }
|
|
@@ -81,6 +80,8 @@ const SiteHub = memo(
|
|
|
81
80
|
<HStack>
|
|
82
81
|
<div className="edit-site-site-hub__title">
|
|
83
82
|
<Button
|
|
83
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
84
|
+
__next40pxDefaultSize={ false }
|
|
84
85
|
variant="link"
|
|
85
86
|
href={ homeUrl }
|
|
86
87
|
target="_blank"
|
|
@@ -100,6 +101,8 @@ const SiteHub = memo(
|
|
|
100
101
|
className="edit-site-site-hub__actions"
|
|
101
102
|
>
|
|
102
103
|
<Button
|
|
104
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
105
|
+
__next40pxDefaultSize={ false }
|
|
103
106
|
className="edit-site-site-hub_toggle-command-center"
|
|
104
107
|
icon={ search }
|
|
105
108
|
onClick={ () => openCommandCenter() }
|
|
@@ -122,13 +125,10 @@ export const SiteHubMobile = memo(
|
|
|
122
125
|
const { navigate } = useContext( SidebarNavigationContext );
|
|
123
126
|
|
|
124
127
|
const { homeUrl, siteTitle } = useSelect( ( select ) => {
|
|
125
|
-
const {
|
|
126
|
-
|
|
127
|
-
getUnstableBase, // Site index.
|
|
128
|
-
} = select( coreStore );
|
|
129
|
-
const _site = getSite();
|
|
128
|
+
const { getEntityRecord } = select( coreStore );
|
|
129
|
+
const _site = getEntityRecord( 'root', 'site' );
|
|
130
130
|
return {
|
|
131
|
-
homeUrl:
|
|
131
|
+
homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
|
|
132
132
|
siteTitle:
|
|
133
133
|
! _site?.title && !! _site?.url
|
|
134
134
|
? filterURLForDisplay( _site?.url )
|
|
@@ -149,6 +149,8 @@ export const SiteHubMobile = memo(
|
|
|
149
149
|
) }
|
|
150
150
|
>
|
|
151
151
|
<Button
|
|
152
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
153
|
+
__next40pxDefaultSize={ false }
|
|
152
154
|
ref={ ref }
|
|
153
155
|
label={ __( 'Go to Site Editor' ) }
|
|
154
156
|
className="edit-site-layout__view-mode-toggle"
|
|
@@ -168,6 +170,8 @@ export const SiteHubMobile = memo(
|
|
|
168
170
|
<HStack>
|
|
169
171
|
<div className="edit-site-site-hub__title">
|
|
170
172
|
<Button
|
|
173
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
174
|
+
__next40pxDefaultSize={ false }
|
|
171
175
|
variant="link"
|
|
172
176
|
href={ homeUrl }
|
|
173
177
|
target="_blank"
|
|
@@ -182,6 +186,8 @@ export const SiteHubMobile = memo(
|
|
|
182
186
|
className="edit-site-site-hub__actions"
|
|
183
187
|
>
|
|
184
188
|
<Button
|
|
189
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
190
|
+
__next40pxDefaultSize={ false }
|
|
185
191
|
className="edit-site-site-hub_toggle-command-center"
|
|
186
192
|
icon={ search }
|
|
187
193
|
onClick={ () => openCommandCenter() }
|
|
@@ -48,7 +48,6 @@ const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
|
|
|
48
48
|
const {
|
|
49
49
|
CompositeV2: Composite,
|
|
50
50
|
CompositeItemV2: CompositeItem,
|
|
51
|
-
useCompositeStoreV2: useCompositeStore,
|
|
52
51
|
Tabs,
|
|
53
52
|
} = unlock( componentsPrivateApis );
|
|
54
53
|
|
|
@@ -383,11 +382,9 @@ const StyleBookBody = ( {
|
|
|
383
382
|
|
|
384
383
|
const Examples = memo(
|
|
385
384
|
( { className, examples, category, label, isSelected, onSelect } ) => {
|
|
386
|
-
const compositeStore = useCompositeStore( { orientation: 'vertical' } );
|
|
387
|
-
|
|
388
385
|
return (
|
|
389
386
|
<Composite
|
|
390
|
-
|
|
387
|
+
orientation="vertical"
|
|
391
388
|
className={ className }
|
|
392
389
|
aria-label={ label }
|
|
393
390
|
role="grid"
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
// This is useful when the style book is used to fill a frame.
|
|
4
4
|
height: 100%;
|
|
5
5
|
&.is-button {
|
|
6
|
-
border-radius: $radius-
|
|
6
|
+
border-radius: $radius-large;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.edit-site-style-book__iframe {
|
|
11
11
|
&.is-button {
|
|
12
|
-
border-radius: $radius-
|
|
12
|
+
border-radius: $radius-large;
|
|
13
13
|
}
|
|
14
14
|
&.is-focused {
|
|
15
15
|
outline: calc(2 * var(--wp-admin-border-width-focus)) solid var(--wp-admin-theme-color);
|
|
@@ -37,10 +37,9 @@ function useResolveEditedEntityAndContext( { postId, postType } ) {
|
|
|
37
37
|
url,
|
|
38
38
|
frontPageTemplateId,
|
|
39
39
|
} = useSelect( ( select ) => {
|
|
40
|
-
const {
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const base = getUnstableBase();
|
|
40
|
+
const { getEntityRecord, getEntityRecords } = select( coreDataStore );
|
|
41
|
+
const siteData = getEntityRecord( 'root', 'site' );
|
|
42
|
+
const base = getEntityRecord( 'root', '__unstableBase' );
|
|
44
43
|
const templates = getEntityRecords( 'postType', TEMPLATE_POST_TYPE, {
|
|
45
44
|
per_page: -1,
|
|
46
45
|
} );
|
|
@@ -21,48 +21,51 @@ export default function useSyncCanvasModeWithURL() {
|
|
|
21
21
|
[]
|
|
22
22
|
);
|
|
23
23
|
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
24
|
-
const
|
|
24
|
+
const currentCanvasModeRef = useRef( canvasMode );
|
|
25
25
|
const { canvas: canvasInUrl } = params;
|
|
26
|
-
const
|
|
27
|
-
const
|
|
26
|
+
const currentCanvasInUrlRef = useRef( canvasInUrl );
|
|
27
|
+
const currentUrlParamsRef = useRef( params );
|
|
28
28
|
useEffect( () => {
|
|
29
|
-
|
|
29
|
+
currentUrlParamsRef.current = params;
|
|
30
30
|
}, [ params ] );
|
|
31
31
|
|
|
32
32
|
useEffect( () => {
|
|
33
|
-
|
|
33
|
+
currentCanvasModeRef.current = canvasMode;
|
|
34
34
|
if ( canvasMode === 'init' ) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
if (
|
|
39
39
|
canvasMode === 'edit' &&
|
|
40
|
-
|
|
40
|
+
currentCanvasInUrlRef.current !== canvasMode
|
|
41
41
|
) {
|
|
42
42
|
history.push( {
|
|
43
|
-
...
|
|
43
|
+
...currentUrlParamsRef.current,
|
|
44
44
|
canvas: 'edit',
|
|
45
45
|
} );
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
if (
|
|
49
49
|
canvasMode === 'view' &&
|
|
50
|
-
|
|
50
|
+
currentCanvasInUrlRef.current !== undefined
|
|
51
51
|
) {
|
|
52
52
|
history.push( {
|
|
53
|
-
...
|
|
53
|
+
...currentUrlParamsRef.current,
|
|
54
54
|
canvas: undefined,
|
|
55
55
|
} );
|
|
56
56
|
}
|
|
57
57
|
}, [ canvasMode, history ] );
|
|
58
58
|
|
|
59
59
|
useEffect( () => {
|
|
60
|
-
|
|
61
|
-
if (
|
|
60
|
+
currentCanvasInUrlRef.current = canvasInUrl;
|
|
61
|
+
if (
|
|
62
|
+
canvasInUrl !== 'edit' &&
|
|
63
|
+
currentCanvasModeRef.current !== 'view'
|
|
64
|
+
) {
|
|
62
65
|
setCanvasMode( 'view' );
|
|
63
66
|
} else if (
|
|
64
67
|
canvasInUrl === 'edit' &&
|
|
65
|
-
|
|
68
|
+
currentCanvasModeRef.current !== 'edit'
|
|
66
69
|
) {
|
|
67
70
|
setCanvasMode( 'edit' );
|
|
68
71
|
}
|
|
@@ -10,29 +10,23 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import
|
|
13
|
+
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
14
14
|
|
|
15
15
|
export default function WelcomeGuideTemplate() {
|
|
16
16
|
const { toggle } = useDispatch( preferencesStore );
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
'core/edit-site',
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const { getCurrentPostType } = select( editorStore );
|
|
29
|
-
return (
|
|
30
|
-
isTemplateActive &&
|
|
31
|
-
! isEditorActive &&
|
|
32
|
-
isPage() &&
|
|
33
|
-
getCurrentPostType() === 'wp_template'
|
|
34
|
-
);
|
|
18
|
+
const { isLoaded, record } = useEditedEntityRecord();
|
|
19
|
+
const isPostTypeTemplate = isLoaded && record.type === 'wp_template';
|
|
20
|
+
const { isActive, hasPreviousEntity } = useSelect( ( select ) => {
|
|
21
|
+
const { getEditorSettings } = select( editorStore );
|
|
22
|
+
const { get } = select( preferencesStore );
|
|
23
|
+
return {
|
|
24
|
+
isActive: get( 'core/edit-site', 'welcomeGuideTemplate' ),
|
|
25
|
+
hasPreviousEntity:
|
|
26
|
+
!! getEditorSettings().onNavigateToPreviousEntityRecord,
|
|
27
|
+
};
|
|
35
28
|
}, [] );
|
|
29
|
+
const isVisible = isActive && isPostTypeTemplate && hasPreviousEntity;
|
|
36
30
|
|
|
37
31
|
if ( ! isVisible ) {
|
|
38
32
|
return null;
|
|
@@ -287,11 +287,9 @@ function useGlobalStylesOpenRevisionsCommands() {
|
|
|
287
287
|
|
|
288
288
|
export function useCommonCommands() {
|
|
289
289
|
const homeUrl = useSelect( ( select ) => {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return getUnstableBase()?.home;
|
|
290
|
+
// Site index.
|
|
291
|
+
return select( coreStore ).getEntityRecord( 'root', '__unstableBase' )
|
|
292
|
+
?.home;
|
|
295
293
|
}, [] );
|
|
296
294
|
|
|
297
295
|
useCommand( {
|