@wordpress/edit-site 6.14.0 → 6.15.1
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/LICENSE.md +1 -1
- package/build/components/add-new-pattern/index.js +6 -10
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/editor/index.js +1 -9
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/confirm-reset-shadow-dialog.js +39 -0
- package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +1 -0
- package/build/components/global-styles/font-library-modal/index.js +1 -1
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-size.js +17 -14
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +17 -20
- package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build/components/global-styles/screen-block.js +1 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +21 -13
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/shadows-panel.js +43 -5
- package/build/components/global-styles/shadows-panel.js.map +1 -1
- package/build/components/layout/index.js +10 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/fields.js +6 -35
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-templates/fields.js +6 -19
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/post-list/index.js +13 -5
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +5 -7
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +3 -2
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +40 -72
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +1 -0
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/site-editor-routes/stylebook.js +6 -2
- package/build/components/site-editor-routes/stylebook.js.map +1 -1
- package/build/components/site-editor-routes/styles.js +7 -1
- package/build/components/site-editor-routes/styles.js.map +1 -1
- package/build/components/style-book/constants.js +36 -2
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/index.js +106 -61
- package/build/components/style-book/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +6 -10
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/editor/index.js +1 -9
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +32 -0
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/index.js +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +17 -14
- 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 +24 -27
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +21 -13
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/shadows-panel.js +46 -8
- package/build-module/components/global-styles/shadows-panel.js.map +1 -1
- package/build-module/components/layout/index.js +11 -2
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +7 -36
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-templates/fields.js +6 -19
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/post-list/index.js +13 -5
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +5 -7
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +3 -2
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +41 -75
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -0
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/site-editor-routes/stylebook.js +6 -2
- package/build-module/components/site-editor-routes/stylebook.js.map +1 -1
- package/build-module/components/site-editor-routes/styles.js +7 -1
- package/build-module/components/site-editor-routes/styles.js.map +1 -1
- package/build-module/components/style-book/constants.js +35 -1
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/index.js +107 -62
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-style/posts-rtl.css +72 -78
- package/build-style/posts.css +72 -78
- package/build-style/style-rtl.css +163 -184
- package/build-style/style.css +163 -184
- package/package.json +42 -41
- package/src/components/add-new-pattern/index.js +10 -7
- package/src/components/canvas-loader/style.scss +4 -3
- package/src/components/editor/index.js +1 -7
- package/src/components/editor/style.scss +4 -2
- package/src/components/editor-canvas-container/style.scss +7 -1
- package/src/components/global-styles/confirm-reset-shadow-dialog.js +37 -0
- package/src/components/global-styles/font-library-modal/index.js +1 -1
- package/src/components/global-styles/font-library-modal/style.scss +4 -2
- package/src/components/global-styles/font-sizes/font-size.js +28 -19
- package/src/components/global-styles/font-sizes/font-sizes.js +37 -35
- package/src/components/global-styles/screen-block.js +3 -2
- package/src/components/global-styles/shadows-edit-panel.js +38 -28
- package/src/components/global-styles/shadows-panel.js +64 -5
- package/src/components/global-styles/style.scss +9 -1
- package/src/components/global-styles/variations/style.scss +4 -3
- package/src/components/layout/index.js +12 -1
- package/src/components/layout/style.scss +8 -3
- package/src/components/page/style.scss +8 -5
- package/src/components/page-patterns/fields.js +11 -41
- package/src/components/page-patterns/style.scss +4 -25
- package/src/components/page-templates/fields.js +6 -16
- package/src/components/page-templates/style.scss +4 -20
- package/src/components/post-list/index.js +13 -4
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +7 -6
- package/src/components/sidebar-dataviews/default-views.js +3 -2
- package/src/components/sidebar-dataviews/style.scss +4 -1
- package/src/components/sidebar-global-styles-wrapper/index.js +37 -83
- package/src/components/sidebar-global-styles-wrapper/style.scss +22 -0
- package/src/components/sidebar-navigation-item/style.scss +6 -0
- package/src/components/sidebar-navigation-screen-main/index.js +1 -1
- package/src/components/site-editor-routes/stylebook.js +2 -2
- package/src/components/site-editor-routes/styles.js +5 -1
- package/src/components/site-hub/style.scss +4 -2
- package/src/components/style-book/constants.ts +49 -1
- package/src/components/style-book/index.js +151 -77
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.15.1",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,45 +30,46 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "7.25.7",
|
|
32
32
|
"@react-spring/web": "^9.4.5",
|
|
33
|
-
"@wordpress/a11y": "
|
|
34
|
-
"@wordpress/api-fetch": "
|
|
35
|
-
"@wordpress/blob": "
|
|
36
|
-
"@wordpress/block-editor": "
|
|
37
|
-
"@wordpress/block-library": "
|
|
38
|
-
"@wordpress/blocks": "
|
|
39
|
-
"@wordpress/commands": "
|
|
40
|
-
"@wordpress/components": "
|
|
41
|
-
"@wordpress/compose": "
|
|
42
|
-
"@wordpress/core-commands": "
|
|
43
|
-
"@wordpress/core-data": "
|
|
44
|
-
"@wordpress/data": "
|
|
45
|
-
"@wordpress/dataviews": "
|
|
46
|
-
"@wordpress/date": "
|
|
47
|
-
"@wordpress/deprecated": "
|
|
48
|
-
"@wordpress/dom": "
|
|
49
|
-
"@wordpress/editor": "
|
|
50
|
-
"@wordpress/element": "
|
|
51
|
-
"@wordpress/escape-html": "
|
|
52
|
-
"@wordpress/fields": "
|
|
53
|
-
"@wordpress/hooks": "
|
|
54
|
-
"@wordpress/html-entities": "
|
|
55
|
-
"@wordpress/i18n": "
|
|
56
|
-
"@wordpress/icons": "
|
|
57
|
-
"@wordpress/keyboard-shortcuts": "
|
|
58
|
-
"@wordpress/keycodes": "
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/
|
|
62
|
-
"@wordpress/
|
|
63
|
-
"@wordpress/
|
|
64
|
-
"@wordpress/
|
|
65
|
-
"@wordpress/
|
|
66
|
-
"@wordpress/
|
|
67
|
-
"@wordpress/
|
|
68
|
-
"@wordpress/
|
|
69
|
-
"@wordpress/
|
|
70
|
-
"@wordpress/
|
|
71
|
-
"@wordpress/
|
|
33
|
+
"@wordpress/a11y": "^4.15.1",
|
|
34
|
+
"@wordpress/api-fetch": "^7.15.1",
|
|
35
|
+
"@wordpress/blob": "^4.15.0",
|
|
36
|
+
"@wordpress/block-editor": "^14.10.1",
|
|
37
|
+
"@wordpress/block-library": "^9.15.1",
|
|
38
|
+
"@wordpress/blocks": "^14.4.1",
|
|
39
|
+
"@wordpress/commands": "^1.15.1",
|
|
40
|
+
"@wordpress/components": "^29.1.1",
|
|
41
|
+
"@wordpress/compose": "^7.15.1",
|
|
42
|
+
"@wordpress/core-commands": "^1.15.1",
|
|
43
|
+
"@wordpress/core-data": "^7.15.1",
|
|
44
|
+
"@wordpress/data": "^10.15.1",
|
|
45
|
+
"@wordpress/dataviews": "^4.11.1",
|
|
46
|
+
"@wordpress/date": "^5.15.1",
|
|
47
|
+
"@wordpress/deprecated": "^4.15.1",
|
|
48
|
+
"@wordpress/dom": "^4.15.1",
|
|
49
|
+
"@wordpress/editor": "^14.15.1",
|
|
50
|
+
"@wordpress/element": "^6.15.1",
|
|
51
|
+
"@wordpress/escape-html": "^3.15.0",
|
|
52
|
+
"@wordpress/fields": "^0.7.1",
|
|
53
|
+
"@wordpress/hooks": "^4.15.0",
|
|
54
|
+
"@wordpress/html-entities": "^4.15.0",
|
|
55
|
+
"@wordpress/i18n": "^5.15.1",
|
|
56
|
+
"@wordpress/icons": "^10.15.1",
|
|
57
|
+
"@wordpress/keyboard-shortcuts": "^5.15.1",
|
|
58
|
+
"@wordpress/keycodes": "^4.15.1",
|
|
59
|
+
"@wordpress/media-utils": "^5.15.1",
|
|
60
|
+
"@wordpress/notices": "^5.15.1",
|
|
61
|
+
"@wordpress/patterns": "^2.15.1",
|
|
62
|
+
"@wordpress/plugins": "^7.15.1",
|
|
63
|
+
"@wordpress/preferences": "^4.15.1",
|
|
64
|
+
"@wordpress/primitives": "^4.15.1",
|
|
65
|
+
"@wordpress/private-apis": "^1.15.0",
|
|
66
|
+
"@wordpress/reusable-blocks": "^5.15.1",
|
|
67
|
+
"@wordpress/router": "^1.15.1",
|
|
68
|
+
"@wordpress/style-engine": "^2.15.0",
|
|
69
|
+
"@wordpress/url": "^4.15.0",
|
|
70
|
+
"@wordpress/viewport": "^6.15.1",
|
|
71
|
+
"@wordpress/widgets": "^4.15.1",
|
|
72
|
+
"@wordpress/wordcount": "^4.15.0",
|
|
72
73
|
"change-case": "^4.1.2",
|
|
73
74
|
"clsx": "^2.1.1",
|
|
74
75
|
"colord": "^2.9.2",
|
|
@@ -83,5 +84,5 @@
|
|
|
83
84
|
"publishConfig": {
|
|
84
85
|
"access": "public"
|
|
85
86
|
},
|
|
86
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "0d4503ecc364cf4ca16024673baf5a84dacf212f"
|
|
87
88
|
}
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
TEMPLATE_PART_POST_TYPE,
|
|
26
26
|
} from '../../utils/constants';
|
|
27
27
|
|
|
28
|
-
const { useHistory } = unlock( routerPrivateApis );
|
|
28
|
+
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
29
29
|
const { CreatePatternModal, useAddPatternCategory } = unlock(
|
|
30
30
|
editPatternsPrivateApis
|
|
31
31
|
);
|
|
@@ -33,6 +33,7 @@ const { CreateTemplatePartModal } = unlock( editorPrivateApis );
|
|
|
33
33
|
|
|
34
34
|
export default function AddNewPattern() {
|
|
35
35
|
const history = useHistory();
|
|
36
|
+
const location = useLocation();
|
|
36
37
|
const [ showPatternModal, setShowPatternModal ] = useState( false );
|
|
37
38
|
const [ showTemplatePartModal, setShowTemplatePartModal ] =
|
|
38
39
|
useState( false );
|
|
@@ -159,13 +160,12 @@ export default function AddNewPattern() {
|
|
|
159
160
|
return;
|
|
160
161
|
}
|
|
161
162
|
try {
|
|
162
|
-
const {
|
|
163
|
-
params: { postType, categoryId },
|
|
164
|
-
} = history.getLocationWithParams();
|
|
165
163
|
let currentCategoryId;
|
|
166
164
|
// When we're not handling template parts, we should
|
|
167
165
|
// add or create the proper pattern category.
|
|
168
|
-
if (
|
|
166
|
+
if (
|
|
167
|
+
location.query.postType !== TEMPLATE_PART_POST_TYPE
|
|
168
|
+
) {
|
|
169
169
|
/*
|
|
170
170
|
* categoryMap.values() returns an iterator.
|
|
171
171
|
* Iterator.prototype.find() is not yet widely supported.
|
|
@@ -173,7 +173,10 @@ export default function AddNewPattern() {
|
|
|
173
173
|
*/
|
|
174
174
|
const currentCategory = Array.from(
|
|
175
175
|
categoryMap.values()
|
|
176
|
-
).find(
|
|
176
|
+
).find(
|
|
177
|
+
( term ) =>
|
|
178
|
+
term.name === location.query.categoryId
|
|
179
|
+
);
|
|
177
180
|
if ( currentCategory ) {
|
|
178
181
|
currentCategoryId =
|
|
179
182
|
currentCategory.id ||
|
|
@@ -194,7 +197,7 @@ export default function AddNewPattern() {
|
|
|
194
197
|
// category.
|
|
195
198
|
if (
|
|
196
199
|
! currentCategoryId &&
|
|
197
|
-
categoryId !== 'my-patterns'
|
|
200
|
+
location.query.categoryId !== 'my-patterns'
|
|
198
201
|
) {
|
|
199
202
|
history.navigate(
|
|
200
203
|
`/pattern?categoryId=${ PATTERN_DEFAULT_CATEGORY }`
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
@media not (prefers-reduced-motion) {
|
|
13
|
+
animation: 0.5s ease 0.2s edit-site-canvas-loader__fade-in-animation;
|
|
14
|
+
animation-fill-mode: forwards;
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
& > div {
|
|
17
18
|
width: 160px;
|
|
@@ -20,7 +20,6 @@ import { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library
|
|
|
20
20
|
import { useCallback, useMemo } from '@wordpress/element';
|
|
21
21
|
import { store as noticesStore } from '@wordpress/notices';
|
|
22
22
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
23
|
-
import { store as preferencesStore } from '@wordpress/preferences';
|
|
24
23
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
25
24
|
import { Icon, arrowUpLeft } from '@wordpress/icons';
|
|
26
25
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
@@ -130,7 +129,6 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
130
129
|
const { postType, postId, context } = entity;
|
|
131
130
|
const {
|
|
132
131
|
supportsGlobalStyles,
|
|
133
|
-
showIconLabels,
|
|
134
132
|
editorCanvasView,
|
|
135
133
|
currentPostIsTrashed,
|
|
136
134
|
hasSiteIcon,
|
|
@@ -138,13 +136,11 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
138
136
|
const { getEditorCanvasContainerView } = unlock(
|
|
139
137
|
select( editSiteStore )
|
|
140
138
|
);
|
|
141
|
-
const { get } = select( preferencesStore );
|
|
142
139
|
const { getCurrentTheme, getEntityRecord } = select( coreDataStore );
|
|
143
140
|
const siteData = getEntityRecord( 'root', '__unstableBase', undefined );
|
|
144
141
|
|
|
145
142
|
return {
|
|
146
143
|
supportsGlobalStyles: getCurrentTheme()?.is_block_theme,
|
|
147
|
-
showIconLabels: get( 'core', 'showIconLabels' ),
|
|
148
144
|
editorCanvasView: getEditorCanvasContainerView(),
|
|
149
145
|
currentPostIsTrashed:
|
|
150
146
|
select( editorStore ).getCurrentPostAttribute( 'status' ) ===
|
|
@@ -267,9 +263,7 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
267
263
|
postId={ postWithTemplate ? context.postId : postId }
|
|
268
264
|
templateId={ postWithTemplate ? postId : undefined }
|
|
269
265
|
settings={ settings }
|
|
270
|
-
className=
|
|
271
|
-
'show-icon-labels': showIconLabels,
|
|
272
|
-
} ) }
|
|
266
|
+
className="edit-site-editor__editor-interface"
|
|
273
267
|
styles={ styles }
|
|
274
268
|
customSaveButton={
|
|
275
269
|
_isPreviewingTheme && <SaveButton size="compact" />
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
.edit-site-editor-canvas-container {
|
|
2
2
|
height: 100%;
|
|
3
3
|
|
|
4
|
+
// This is the gray background color that's applied behind "isolation mode".
|
|
5
|
+
// The color normally comes from .editor-visual-editor, but that class is missing here.
|
|
6
|
+
background-color: $gray-300;
|
|
7
|
+
|
|
4
8
|
// Controls height of editor and editor canvas container (style book, global styles revisions previews etc.)
|
|
5
9
|
iframe {
|
|
6
10
|
display: block;
|
|
@@ -22,7 +26,9 @@
|
|
|
22
26
|
position: absolute;
|
|
23
27
|
right: 0;
|
|
24
28
|
top: 0;
|
|
25
|
-
|
|
29
|
+
@media not (prefers-reduced-motion) {
|
|
30
|
+
transition: all 0.3s; // Match .block-editor-iframe__body transition.
|
|
31
|
+
}
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
.edit-site-editor-canvas-container__close-button {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
function ConfirmResetShadowDialog( {
|
|
8
|
+
text,
|
|
9
|
+
confirmButtonText,
|
|
10
|
+
isOpen,
|
|
11
|
+
toggleOpen,
|
|
12
|
+
onConfirm,
|
|
13
|
+
} ) {
|
|
14
|
+
const handleConfirm = async () => {
|
|
15
|
+
toggleOpen();
|
|
16
|
+
onConfirm();
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const handleCancel = () => {
|
|
20
|
+
toggleOpen();
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<ConfirmDialog
|
|
25
|
+
isOpen={ isOpen }
|
|
26
|
+
cancelButtonText={ __( 'Cancel' ) }
|
|
27
|
+
confirmButtonText={ confirmButtonText }
|
|
28
|
+
onCancel={ handleCancel }
|
|
29
|
+
onConfirm={ handleConfirm }
|
|
30
|
+
size="medium"
|
|
31
|
+
>
|
|
32
|
+
{ text }
|
|
33
|
+
</ConfirmDialog>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default ConfirmResetShadowDialog;
|
|
@@ -129,8 +129,10 @@ $footer-height: 70px;
|
|
|
129
129
|
.font-library-modal__font-variant_demo-text {
|
|
130
130
|
white-space: nowrap;
|
|
131
131
|
flex-shrink: 0;
|
|
132
|
-
|
|
133
|
-
@
|
|
132
|
+
|
|
133
|
+
@media not (prefers-reduced-motion) {
|
|
134
|
+
transition: opacity 0.3s ease-in-out;
|
|
135
|
+
}
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
138
|
|
|
@@ -166,25 +166,34 @@ function FontSize() {
|
|
|
166
166
|
marginBottom={ 0 }
|
|
167
167
|
paddingX={ 4 }
|
|
168
168
|
>
|
|
169
|
-
<Menu
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
169
|
+
<Menu>
|
|
170
|
+
<Menu.TriggerButton
|
|
171
|
+
render={
|
|
172
|
+
<Button
|
|
173
|
+
size="small"
|
|
174
|
+
icon={ moreVertical }
|
|
175
|
+
label={ __(
|
|
176
|
+
'Font size options'
|
|
177
|
+
) }
|
|
178
|
+
/>
|
|
179
|
+
}
|
|
180
|
+
/>
|
|
181
|
+
<Menu.Popover>
|
|
182
|
+
<Menu.Item
|
|
183
|
+
onClick={ toggleRenameDialog }
|
|
184
|
+
>
|
|
185
|
+
<Menu.ItemLabel>
|
|
186
|
+
{ __( 'Rename' ) }
|
|
187
|
+
</Menu.ItemLabel>
|
|
188
|
+
</Menu.Item>
|
|
189
|
+
<Menu.Item
|
|
190
|
+
onClick={ toggleDeleteConfirm }
|
|
191
|
+
>
|
|
192
|
+
<Menu.ItemLabel>
|
|
193
|
+
{ __( 'Delete' ) }
|
|
194
|
+
</Menu.ItemLabel>
|
|
195
|
+
</Menu.Item>
|
|
196
|
+
</Menu.Popover>
|
|
188
197
|
</Menu>
|
|
189
198
|
</Spacer>
|
|
190
199
|
</FlexItem>
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
__experimentalVStack as VStack,
|
|
12
12
|
__experimentalHStack as HStack,
|
|
13
13
|
FlexItem,
|
|
14
|
-
FlexBlock,
|
|
15
14
|
Button,
|
|
16
15
|
} from '@wordpress/components';
|
|
17
16
|
import {
|
|
@@ -27,14 +26,15 @@ import { useState } from '@wordpress/element';
|
|
|
27
26
|
* Internal dependencies
|
|
28
27
|
*/
|
|
29
28
|
import { unlock } from '../../../lock-unlock';
|
|
30
|
-
const { Menu } = unlock( componentsPrivateApis );
|
|
31
|
-
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
32
29
|
import Subtitle from '../subtitle';
|
|
33
30
|
import { NavigationButtonAsItem } from '../navigation-button';
|
|
34
31
|
import { getNewIndexFromPresets } from '../utils';
|
|
35
32
|
import ScreenHeader from '../header';
|
|
36
33
|
import ConfirmResetFontSizesDialog from './confirm-reset-font-sizes-dialog';
|
|
37
34
|
|
|
35
|
+
const { Menu } = unlock( componentsPrivateApis );
|
|
36
|
+
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
37
|
+
|
|
38
38
|
function FontSizeGroup( {
|
|
39
39
|
label,
|
|
40
40
|
origin,
|
|
@@ -81,24 +81,31 @@ function FontSizeGroup( {
|
|
|
81
81
|
/>
|
|
82
82
|
) }
|
|
83
83
|
{ !! handleResetFontSizes && (
|
|
84
|
-
<Menu
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
84
|
+
<Menu>
|
|
85
|
+
<Menu.TriggerButton
|
|
86
|
+
render={
|
|
87
|
+
<Button
|
|
88
|
+
size="small"
|
|
89
|
+
icon={ moreVertical }
|
|
90
|
+
label={ __(
|
|
91
|
+
'Font size presets options'
|
|
92
|
+
) }
|
|
93
|
+
/>
|
|
94
|
+
}
|
|
95
|
+
/>
|
|
96
|
+
<Menu.Popover>
|
|
97
|
+
<Menu.Item onClick={ toggleResetDialog }>
|
|
98
|
+
<Menu.ItemLabel>
|
|
99
|
+
{ origin === 'custom'
|
|
100
|
+
? __(
|
|
101
|
+
'Remove font size presets'
|
|
102
|
+
)
|
|
103
|
+
: __(
|
|
104
|
+
'Reset font size presets'
|
|
105
|
+
) }
|
|
106
|
+
</Menu.ItemLabel>
|
|
107
|
+
</Menu.Item>
|
|
108
|
+
</Menu.Popover>
|
|
102
109
|
</Menu>
|
|
103
110
|
) }
|
|
104
111
|
</FlexItem>
|
|
@@ -111,23 +118,18 @@ function FontSizeGroup( {
|
|
|
111
118
|
key={ size.slug }
|
|
112
119
|
path={ `/typography/font-sizes/${ origin }/${ size.slug }` }
|
|
113
120
|
>
|
|
114
|
-
<HStack
|
|
121
|
+
<HStack>
|
|
115
122
|
<FlexItem className="edit-site-font-size__item">
|
|
116
123
|
{ size.name }
|
|
117
124
|
</FlexItem>
|
|
118
|
-
<FlexItem>
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
? chevronLeft
|
|
127
|
-
: chevronRight
|
|
128
|
-
}
|
|
129
|
-
/>
|
|
130
|
-
</HStack>
|
|
125
|
+
<FlexItem display="flex">
|
|
126
|
+
<Icon
|
|
127
|
+
icon={
|
|
128
|
+
isRTL()
|
|
129
|
+
? chevronLeft
|
|
130
|
+
: chevronRight
|
|
131
|
+
}
|
|
132
|
+
/>
|
|
131
133
|
</FlexItem>
|
|
132
134
|
</HStack>
|
|
133
135
|
</NavigationButtonAsItem>
|
|
@@ -113,8 +113,9 @@ function ScreenBlock( { name, variation } ) {
|
|
|
113
113
|
if (
|
|
114
114
|
settingsForBlockElement?.spacing?.blockGap &&
|
|
115
115
|
blockType?.supports?.spacing?.blockGap &&
|
|
116
|
-
( blockType?.supports?.spacing?.
|
|
117
|
-
|
|
116
|
+
( blockType?.supports?.spacing?.__experimentalSkipSerialization ===
|
|
117
|
+
true ||
|
|
118
|
+
blockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(
|
|
118
119
|
( spacingType ) => spacingType === 'blockGap'
|
|
119
120
|
) )
|
|
120
121
|
) {
|
|
@@ -163,33 +163,38 @@ export default function ShadowsEditPanel() {
|
|
|
163
163
|
<ScreenHeader title={ selectedShadow.name } />
|
|
164
164
|
<FlexItem>
|
|
165
165
|
<Spacer marginTop={ 2 } marginBottom={ 0 } paddingX={ 4 }>
|
|
166
|
-
<Menu
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
166
|
+
<Menu>
|
|
167
|
+
<Menu.TriggerButton
|
|
168
|
+
render={
|
|
169
|
+
<Button
|
|
170
|
+
size="small"
|
|
171
|
+
icon={ moreVertical }
|
|
172
|
+
label={ __( 'Menu' ) }
|
|
173
|
+
/>
|
|
174
|
+
}
|
|
175
|
+
/>
|
|
176
|
+
<Menu.Popover>
|
|
177
|
+
{ ( category === 'custom'
|
|
178
|
+
? customShadowMenuItems
|
|
179
|
+
: presetShadowMenuItems
|
|
180
|
+
).map( ( item ) => (
|
|
181
|
+
<Menu.Item
|
|
182
|
+
key={ item.action }
|
|
183
|
+
onClick={ () =>
|
|
184
|
+
onMenuClick( item.action )
|
|
185
|
+
}
|
|
186
|
+
disabled={
|
|
187
|
+
item.action === 'reset' &&
|
|
188
|
+
selectedShadow.shadow ===
|
|
189
|
+
baseSelectedShadow.shadow
|
|
190
|
+
}
|
|
191
|
+
>
|
|
192
|
+
<Menu.ItemLabel>
|
|
193
|
+
{ item.label }
|
|
194
|
+
</Menu.ItemLabel>
|
|
195
|
+
</Menu.Item>
|
|
196
|
+
) ) }
|
|
197
|
+
</Menu.Popover>
|
|
193
198
|
</Menu>
|
|
194
199
|
</Spacer>
|
|
195
200
|
</FlexItem>
|
|
@@ -387,7 +392,12 @@ function ShadowItem( { shadow, onChange, canRemove, onRemove } ) {
|
|
|
387
392
|
'aria-expanded': isOpen,
|
|
388
393
|
};
|
|
389
394
|
const removeButtonProps = {
|
|
390
|
-
onClick:
|
|
395
|
+
onClick: () => {
|
|
396
|
+
if ( isOpen ) {
|
|
397
|
+
onToggle();
|
|
398
|
+
}
|
|
399
|
+
onRemove();
|
|
400
|
+
},
|
|
391
401
|
className: clsx(
|
|
392
402
|
'edit-site-global-styles__shadow-editor__remove-button',
|
|
393
403
|
{ 'is-open': isOpen }
|