@wordpress/edit-site 6.22.0 → 6.24.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 +4 -0
- package/build/components/global-styles/color-palette-panel.js +20 -8
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/palette.js +0 -8
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/more-menu/index.js +1 -6
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/more-menu/site-export.js +9 -0
- package/build/components/more-menu/site-export.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +6 -6
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +21 -9
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/palette.js +2 -10
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/more-menu/index.js +1 -6
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/more-menu/site-export.js +10 -1
- package/build-module/components/more-menu/site-export.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +6 -6
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-style/posts-rtl.css +137 -16
- package/build-style/posts.css +137 -16
- package/build-style/style-rtl.css +137 -16
- package/build-style/style.css +137 -16
- package/package.json +42 -42
- package/src/components/global-styles/color-palette-panel.js +29 -11
- package/src/components/global-styles/font-library-modal/font-collection.js +1 -1
- package/src/components/global-styles/palette.js +1 -16
- package/src/components/more-menu/index.js +1 -7
- package/src/components/more-menu/site-export.js +14 -1
- package/src/components/sidebar-navigation-screen-main/index.js +7 -7
- package/tsconfig.tsbuildinfo +1 -1
package/build-style/style.css
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
|
-
/**
|
|
3
|
-
* Converts a hex value into the rgb equivalent.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} hex - the hexadecimal value to convert
|
|
6
|
-
* @return {string} comma separated rgb values
|
|
7
|
-
*/
|
|
8
2
|
/**
|
|
9
3
|
* Colors
|
|
10
4
|
*/
|
|
11
5
|
/**
|
|
12
6
|
* Breakpoints & Media Queries
|
|
13
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* Colors
|
|
10
|
+
*/
|
|
14
11
|
/**
|
|
15
12
|
* SCSS Variables.
|
|
16
13
|
*
|
|
@@ -18,15 +15,136 @@
|
|
|
18
15
|
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
19
16
|
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
20
17
|
*/
|
|
18
|
+
/**
|
|
19
|
+
* Fonts & basic variables.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Typography
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Grid System.
|
|
26
|
+
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Radius scale.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Elevation scale.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Dimensions.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Mobile specific styles
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* Editor styles.
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* Block & Editor UI.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Block paddings.
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* React Native specific.
|
|
51
|
+
* These variables do not appear to be used anywhere else.
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* Colors
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* SCSS Variables.
|
|
58
|
+
*
|
|
59
|
+
* Please use variables from this sheet to ensure consistency across the UI.
|
|
60
|
+
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
61
|
+
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
62
|
+
*/
|
|
63
|
+
/**
|
|
64
|
+
* Fonts & basic variables.
|
|
65
|
+
*/
|
|
66
|
+
/**
|
|
67
|
+
* Typography
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* Grid System.
|
|
71
|
+
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* Radius scale.
|
|
75
|
+
*/
|
|
76
|
+
/**
|
|
77
|
+
* Elevation scale.
|
|
78
|
+
*/
|
|
79
|
+
/**
|
|
80
|
+
* Dimensions.
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Mobile specific styles
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* Editor styles.
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
* Block & Editor UI.
|
|
90
|
+
*/
|
|
91
|
+
/**
|
|
92
|
+
* Block paddings.
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* React Native specific.
|
|
96
|
+
* These variables do not appear to be used anywhere else.
|
|
97
|
+
*/
|
|
98
|
+
/**
|
|
99
|
+
* Breakpoints & Media Queries
|
|
100
|
+
*/
|
|
21
101
|
/**
|
|
22
102
|
* Converts a hex value into the rgb equivalent.
|
|
23
103
|
*
|
|
24
104
|
* @param {string} hex - the hexadecimal value to convert
|
|
25
105
|
* @return {string} comma separated rgb values
|
|
26
106
|
*/
|
|
107
|
+
/**
|
|
108
|
+
* Long content fade mixin
|
|
109
|
+
*
|
|
110
|
+
* Creates a fading overlay to signify that the content is longer
|
|
111
|
+
* than the space allows.
|
|
112
|
+
*/
|
|
113
|
+
/**
|
|
114
|
+
* Typography
|
|
115
|
+
*/
|
|
116
|
+
/**
|
|
117
|
+
* Breakpoint mixins
|
|
118
|
+
*/
|
|
119
|
+
/**
|
|
120
|
+
* Focus styles.
|
|
121
|
+
*/
|
|
122
|
+
/**
|
|
123
|
+
* Applies editor left position to the selector passed as argument
|
|
124
|
+
*/
|
|
125
|
+
/**
|
|
126
|
+
* Styles that are reused verbatim in a few places
|
|
127
|
+
*/
|
|
128
|
+
/**
|
|
129
|
+
* Allows users to opt-out of animations via OS-level preferences.
|
|
130
|
+
*/
|
|
131
|
+
/**
|
|
132
|
+
* Reset default styles for JavaScript UI based pages.
|
|
133
|
+
* This is a WP-admin agnostic reset
|
|
134
|
+
*/
|
|
135
|
+
/**
|
|
136
|
+
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
137
|
+
*/
|
|
27
138
|
/**
|
|
28
139
|
* Colors
|
|
29
140
|
*/
|
|
141
|
+
/**
|
|
142
|
+
* SCSS Variables.
|
|
143
|
+
*
|
|
144
|
+
* Please use variables from this sheet to ensure consistency across the UI.
|
|
145
|
+
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
146
|
+
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
147
|
+
*/
|
|
30
148
|
/**
|
|
31
149
|
* Fonts & basic variables.
|
|
32
150
|
*/
|
|
@@ -62,6 +180,9 @@
|
|
|
62
180
|
* React Native specific.
|
|
63
181
|
* These variables do not appear to be used anywhere else.
|
|
64
182
|
*/
|
|
183
|
+
/**
|
|
184
|
+
* Breakpoints & Media Queries
|
|
185
|
+
*/
|
|
65
186
|
/**
|
|
66
187
|
* Converts a hex value into the rgb equivalent.
|
|
67
188
|
*
|
|
@@ -100,6 +221,9 @@
|
|
|
100
221
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
101
222
|
*/
|
|
102
223
|
:root {
|
|
224
|
+
--wp-block-synced-color: #7a00df;
|
|
225
|
+
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
226
|
+
--wp-bound-block-color: var(--wp-block-synced-color);
|
|
103
227
|
--wp-admin-theme-color: #007cba;
|
|
104
228
|
--wp-admin-theme-color--rgb: 0, 124, 186;
|
|
105
229
|
--wp-admin-theme-color-darker-10: #006ba1;
|
|
@@ -107,9 +231,6 @@
|
|
|
107
231
|
--wp-admin-theme-color-darker-20: #005a87;
|
|
108
232
|
--wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
|
|
109
233
|
--wp-admin-border-width-focus: 2px;
|
|
110
|
-
--wp-block-synced-color: #7a00df;
|
|
111
|
-
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
112
|
-
--wp-bound-block-color: var(--wp-block-synced-color);
|
|
113
234
|
}
|
|
114
235
|
@media (min-resolution: 192dpi) {
|
|
115
236
|
:root {
|
|
@@ -409,13 +530,13 @@
|
|
|
409
530
|
.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input {
|
|
410
531
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
411
532
|
padding: 6px 8px;
|
|
412
|
-
box-shadow: 0 0 0 transparent;
|
|
413
|
-
border-radius: 2px;
|
|
414
|
-
border: 1px solid #949494;
|
|
415
533
|
/* Fonts smaller than 16px causes mobile safari to zoom. */
|
|
416
534
|
font-size: 16px;
|
|
417
535
|
/* Override core line-height. To be reviewed. */
|
|
418
536
|
line-height: normal;
|
|
537
|
+
box-shadow: 0 0 0 transparent;
|
|
538
|
+
border-radius: 2px;
|
|
539
|
+
border: 1px solid #949494;
|
|
419
540
|
display: block;
|
|
420
541
|
padding: 0 32px 0 8px;
|
|
421
542
|
background: #f0f0f0;
|
|
@@ -2782,7 +2903,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2782
2903
|
contain: content;
|
|
2783
2904
|
}
|
|
2784
2905
|
|
|
2785
|
-
@keyframes
|
|
2906
|
+
@keyframes _r2pke_slide-from-right {
|
|
2786
2907
|
from {
|
|
2787
2908
|
transform: translateX(50px);
|
|
2788
2909
|
opacity: 0;
|
|
@@ -2792,7 +2913,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2792
2913
|
opacity: 1;
|
|
2793
2914
|
}
|
|
2794
2915
|
}
|
|
2795
|
-
@keyframes
|
|
2916
|
+
@keyframes _r2pke_slide-from-left {
|
|
2796
2917
|
from {
|
|
2797
2918
|
transform: translateX(-50px);
|
|
2798
2919
|
opacity: 0;
|
|
@@ -2848,10 +2969,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2848
2969
|
}
|
|
2849
2970
|
}
|
|
2850
2971
|
.edit-site-sidebar__screen-wrapper.slide-from-left {
|
|
2851
|
-
animation-name:
|
|
2972
|
+
animation-name: _r2pke_slide-from-left;
|
|
2852
2973
|
}
|
|
2853
2974
|
.edit-site-sidebar__screen-wrapper.slide-from-right {
|
|
2854
|
-
animation-name:
|
|
2975
|
+
animation-name: _r2pke_slide-from-right;
|
|
2855
2976
|
}
|
|
2856
2977
|
|
|
2857
2978
|
.edit-site-sidebar-button {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.24.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,46 +30,46 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "7.25.7",
|
|
32
32
|
"@react-spring/web": "^9.4.5",
|
|
33
|
-
"@wordpress/a11y": "^4.
|
|
34
|
-
"@wordpress/api-fetch": "^7.
|
|
35
|
-
"@wordpress/blob": "^4.
|
|
36
|
-
"@wordpress/block-editor": "^14.
|
|
37
|
-
"@wordpress/block-library": "^9.
|
|
38
|
-
"@wordpress/blocks": "^14.
|
|
39
|
-
"@wordpress/commands": "^1.
|
|
40
|
-
"@wordpress/components": "^29.
|
|
41
|
-
"@wordpress/compose": "^7.
|
|
42
|
-
"@wordpress/core-commands": "^1.
|
|
43
|
-
"@wordpress/core-data": "^7.
|
|
44
|
-
"@wordpress/data": "^10.
|
|
45
|
-
"@wordpress/dataviews": "^4.
|
|
46
|
-
"@wordpress/date": "^5.
|
|
47
|
-
"@wordpress/deprecated": "^4.
|
|
48
|
-
"@wordpress/dom": "^4.
|
|
49
|
-
"@wordpress/editor": "^14.
|
|
50
|
-
"@wordpress/element": "^6.
|
|
51
|
-
"@wordpress/escape-html": "^3.
|
|
52
|
-
"@wordpress/fields": "^0.
|
|
53
|
-
"@wordpress/hooks": "^4.
|
|
54
|
-
"@wordpress/html-entities": "^4.
|
|
55
|
-
"@wordpress/i18n": "^5.
|
|
56
|
-
"@wordpress/icons": "^10.
|
|
57
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
58
|
-
"@wordpress/keycodes": "^4.
|
|
59
|
-
"@wordpress/media-utils": "^5.
|
|
60
|
-
"@wordpress/notices": "^5.
|
|
61
|
-
"@wordpress/patterns": "^2.
|
|
62
|
-
"@wordpress/plugins": "^7.
|
|
63
|
-
"@wordpress/preferences": "^4.
|
|
64
|
-
"@wordpress/primitives": "^4.
|
|
65
|
-
"@wordpress/private-apis": "^1.
|
|
66
|
-
"@wordpress/reusable-blocks": "^5.
|
|
67
|
-
"@wordpress/router": "^1.
|
|
68
|
-
"@wordpress/style-engine": "^2.
|
|
69
|
-
"@wordpress/url": "^4.
|
|
70
|
-
"@wordpress/viewport": "^6.
|
|
71
|
-
"@wordpress/widgets": "^4.
|
|
72
|
-
"@wordpress/wordcount": "^4.
|
|
33
|
+
"@wordpress/a11y": "^4.24.0",
|
|
34
|
+
"@wordpress/api-fetch": "^7.24.0",
|
|
35
|
+
"@wordpress/blob": "^4.24.0",
|
|
36
|
+
"@wordpress/block-editor": "^14.19.0",
|
|
37
|
+
"@wordpress/block-library": "^9.24.0",
|
|
38
|
+
"@wordpress/blocks": "^14.13.0",
|
|
39
|
+
"@wordpress/commands": "^1.24.0",
|
|
40
|
+
"@wordpress/components": "^29.10.0",
|
|
41
|
+
"@wordpress/compose": "^7.24.0",
|
|
42
|
+
"@wordpress/core-commands": "^1.24.0",
|
|
43
|
+
"@wordpress/core-data": "^7.24.0",
|
|
44
|
+
"@wordpress/data": "^10.24.0",
|
|
45
|
+
"@wordpress/dataviews": "^4.20.0",
|
|
46
|
+
"@wordpress/date": "^5.24.0",
|
|
47
|
+
"@wordpress/deprecated": "^4.24.0",
|
|
48
|
+
"@wordpress/dom": "^4.24.0",
|
|
49
|
+
"@wordpress/editor": "^14.24.0",
|
|
50
|
+
"@wordpress/element": "^6.24.0",
|
|
51
|
+
"@wordpress/escape-html": "^3.24.0",
|
|
52
|
+
"@wordpress/fields": "^0.16.0",
|
|
53
|
+
"@wordpress/hooks": "^4.24.0",
|
|
54
|
+
"@wordpress/html-entities": "^4.24.0",
|
|
55
|
+
"@wordpress/i18n": "^5.24.0",
|
|
56
|
+
"@wordpress/icons": "^10.24.0",
|
|
57
|
+
"@wordpress/keyboard-shortcuts": "^5.24.0",
|
|
58
|
+
"@wordpress/keycodes": "^4.24.0",
|
|
59
|
+
"@wordpress/media-utils": "^5.24.0",
|
|
60
|
+
"@wordpress/notices": "^5.24.0",
|
|
61
|
+
"@wordpress/patterns": "^2.24.0",
|
|
62
|
+
"@wordpress/plugins": "^7.24.0",
|
|
63
|
+
"@wordpress/preferences": "^4.24.0",
|
|
64
|
+
"@wordpress/primitives": "^4.24.0",
|
|
65
|
+
"@wordpress/private-apis": "^1.24.0",
|
|
66
|
+
"@wordpress/reusable-blocks": "^5.24.0",
|
|
67
|
+
"@wordpress/router": "^1.24.0",
|
|
68
|
+
"@wordpress/style-engine": "^2.24.0",
|
|
69
|
+
"@wordpress/url": "^4.24.0",
|
|
70
|
+
"@wordpress/viewport": "^6.24.0",
|
|
71
|
+
"@wordpress/widgets": "^4.24.0",
|
|
72
|
+
"@wordpress/wordcount": "^4.24.0",
|
|
73
73
|
"change-case": "^4.1.2",
|
|
74
74
|
"clsx": "^2.1.1",
|
|
75
75
|
"colord": "^2.9.2",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "9c03d1458cae76792ae15e67b421205836bf4393"
|
|
88
88
|
}
|
|
@@ -5,15 +5,18 @@ import { useViewportMatch } from '@wordpress/compose';
|
|
|
5
5
|
import {
|
|
6
6
|
__experimentalPaletteEdit as PaletteEdit,
|
|
7
7
|
__experimentalVStack as VStack,
|
|
8
|
+
Button,
|
|
8
9
|
} from '@wordpress/components';
|
|
9
10
|
import { __ } from '@wordpress/i18n';
|
|
10
11
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
12
|
+
import { shuffle } from '@wordpress/icons';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Internal dependencies
|
|
14
16
|
*/
|
|
15
17
|
import { unlock } from '../../lock-unlock';
|
|
16
18
|
import ColorVariations from './variations/variations-color';
|
|
19
|
+
import { useColorRandomizer } from './hooks';
|
|
17
20
|
|
|
18
21
|
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
19
22
|
const mobilePopoverProps = { placement: 'bottom-start', offset: 8 };
|
|
@@ -49,22 +52,37 @@ export default function ColorPalettePanel( { name } ) {
|
|
|
49
52
|
const isMobileViewport = useViewportMatch( 'small', '<' );
|
|
50
53
|
const popoverProps = isMobileViewport ? mobilePopoverProps : undefined;
|
|
51
54
|
|
|
55
|
+
const [ randomizeThemeColors ] = useColorRandomizer();
|
|
56
|
+
|
|
52
57
|
return (
|
|
53
58
|
<VStack
|
|
54
59
|
className="edit-site-global-styles-color-palette-panel"
|
|
55
60
|
spacing={ 8 }
|
|
56
61
|
>
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
<VStack spacing={ 4 }>
|
|
63
|
+
{ !! themeColors && !! themeColors.length && (
|
|
64
|
+
<PaletteEdit
|
|
65
|
+
canReset={ themeColors !== baseThemeColors }
|
|
66
|
+
canOnlyChangeValues
|
|
67
|
+
colors={ themeColors }
|
|
68
|
+
onChange={ setThemeColors }
|
|
69
|
+
paletteLabel={ __( 'Theme' ) }
|
|
70
|
+
paletteLabelHeadingLevel={ 3 }
|
|
71
|
+
popoverProps={ popoverProps }
|
|
72
|
+
/>
|
|
73
|
+
) }
|
|
74
|
+
{ window.__experimentalEnableColorRandomizer &&
|
|
75
|
+
themeColors?.length > 0 && (
|
|
76
|
+
<Button
|
|
77
|
+
__next40pxDefaultSize
|
|
78
|
+
variant="secondary"
|
|
79
|
+
icon={ shuffle }
|
|
80
|
+
onClick={ randomizeThemeColors }
|
|
81
|
+
>
|
|
82
|
+
{ __( 'Randomize colors' ) }
|
|
83
|
+
</Button>
|
|
84
|
+
) }
|
|
85
|
+
</VStack>
|
|
68
86
|
{ !! defaultColors &&
|
|
69
87
|
!! defaultColors.length &&
|
|
70
88
|
!! defaultPaletteEnabled && (
|
|
@@ -8,10 +8,9 @@ import {
|
|
|
8
8
|
__experimentalZStack as ZStack,
|
|
9
9
|
__experimentalVStack as VStack,
|
|
10
10
|
ColorIndicator,
|
|
11
|
-
Button,
|
|
12
11
|
} from '@wordpress/components';
|
|
13
12
|
import { isRTL, __ } from '@wordpress/i18n';
|
|
14
|
-
import { Icon,
|
|
13
|
+
import { Icon, chevronLeft, chevronRight } from '@wordpress/icons';
|
|
15
14
|
import { useMemo } from '@wordpress/element';
|
|
16
15
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
17
16
|
|
|
@@ -20,7 +19,6 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
20
19
|
*/
|
|
21
20
|
import Subtitle from './subtitle';
|
|
22
21
|
import { NavigationButtonAsItem } from './navigation-button';
|
|
23
|
-
import { useColorRandomizer } from './hooks';
|
|
24
22
|
import ColorIndicatorWrapper from './color-indicator-wrapper';
|
|
25
23
|
import { unlock } from '../../lock-unlock';
|
|
26
24
|
|
|
@@ -38,8 +36,6 @@ function Palette( { name } ) {
|
|
|
38
36
|
name
|
|
39
37
|
);
|
|
40
38
|
|
|
41
|
-
const [ randomizeThemeColors ] = useColorRandomizer();
|
|
42
|
-
|
|
43
39
|
const colors = useMemo(
|
|
44
40
|
() => [
|
|
45
41
|
...( customColors || EMPTY_COLORS ),
|
|
@@ -87,17 +83,6 @@ function Palette( { name } ) {
|
|
|
87
83
|
</HStack>
|
|
88
84
|
</NavigationButtonAsItem>
|
|
89
85
|
</ItemGroup>
|
|
90
|
-
{ window.__experimentalEnableColorRandomizer &&
|
|
91
|
-
themeColors?.length > 0 && (
|
|
92
|
-
<Button
|
|
93
|
-
__next40pxDefaultSize
|
|
94
|
-
variant="secondary"
|
|
95
|
-
icon={ shuffle }
|
|
96
|
-
onClick={ randomizeThemeColors }
|
|
97
|
-
>
|
|
98
|
-
{ __( 'Randomize colors' ) }
|
|
99
|
-
</Button>
|
|
100
|
-
) }
|
|
101
86
|
</VStack>
|
|
102
87
|
);
|
|
103
88
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
6
4
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
7
5
|
|
|
8
6
|
/**
|
|
@@ -15,14 +13,10 @@ import { unlock } from '../../lock-unlock';
|
|
|
15
13
|
const { ToolsMoreMenuGroup, PreferencesModal } = unlock( editorPrivateApis );
|
|
16
14
|
|
|
17
15
|
export default function MoreMenu() {
|
|
18
|
-
const isBlockBasedTheme = useSelect( ( select ) => {
|
|
19
|
-
return select( coreStore ).getCurrentTheme().is_block_theme;
|
|
20
|
-
}, [] );
|
|
21
|
-
|
|
22
16
|
return (
|
|
23
17
|
<>
|
|
24
18
|
<ToolsMoreMenuGroup>
|
|
25
|
-
|
|
19
|
+
<SiteExport />
|
|
26
20
|
<WelcomeGuideMenuItem />
|
|
27
21
|
</ToolsMoreMenuGroup>
|
|
28
22
|
<PreferencesModal />
|
|
@@ -5,13 +5,26 @@ import { __, _x } from '@wordpress/i18n';
|
|
|
5
5
|
import { MenuItem } from '@wordpress/components';
|
|
6
6
|
import apiFetch from '@wordpress/api-fetch';
|
|
7
7
|
import { download } from '@wordpress/icons';
|
|
8
|
-
import { useDispatch } from '@wordpress/data';
|
|
8
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
9
9
|
import { downloadBlob } from '@wordpress/blob';
|
|
10
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
10
11
|
import { store as noticesStore } from '@wordpress/notices';
|
|
11
12
|
|
|
12
13
|
export default function SiteExport() {
|
|
14
|
+
const canExport = useSelect( ( select ) => {
|
|
15
|
+
const targetHints =
|
|
16
|
+
select( coreStore ).getCurrentTheme()?._links?.[
|
|
17
|
+
'wp:export-theme'
|
|
18
|
+
]?.[ 0 ]?.targetHints ?? {};
|
|
19
|
+
|
|
20
|
+
return !! targetHints.allow?.includes( 'GET' );
|
|
21
|
+
}, [] );
|
|
13
22
|
const { createErrorNotice } = useDispatch( noticesStore );
|
|
14
23
|
|
|
24
|
+
if ( ! canExport ) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
15
28
|
async function handleExport() {
|
|
16
29
|
try {
|
|
17
30
|
const response = await apiFetch( {
|
|
@@ -22,6 +22,13 @@ export function MainSidebarNavigationContent( { isBlockBasedTheme = true } ) {
|
|
|
22
22
|
<ItemGroup className="edit-site-sidebar-navigation-screen-main">
|
|
23
23
|
{ isBlockBasedTheme && (
|
|
24
24
|
<>
|
|
25
|
+
<SidebarNavigationItemGlobalStyles
|
|
26
|
+
to="/styles"
|
|
27
|
+
uid="global-styles-navigation-item"
|
|
28
|
+
icon={ styles }
|
|
29
|
+
>
|
|
30
|
+
{ __( 'Styles' ) }
|
|
31
|
+
</SidebarNavigationItemGlobalStyles>
|
|
25
32
|
<SidebarNavigationItem
|
|
26
33
|
uid="navigation-navigation-item"
|
|
27
34
|
to="/navigation"
|
|
@@ -30,13 +37,6 @@ export function MainSidebarNavigationContent( { isBlockBasedTheme = true } ) {
|
|
|
30
37
|
>
|
|
31
38
|
{ __( 'Navigation' ) }
|
|
32
39
|
</SidebarNavigationItem>
|
|
33
|
-
<SidebarNavigationItemGlobalStyles
|
|
34
|
-
to="/styles"
|
|
35
|
-
uid="global-styles-navigation-item"
|
|
36
|
-
icon={ styles }
|
|
37
|
-
>
|
|
38
|
-
{ __( 'Styles' ) }
|
|
39
|
-
</SidebarNavigationItemGlobalStyles>
|
|
40
40
|
<SidebarNavigationItem
|
|
41
41
|
uid="page-navigation-item"
|
|
42
42
|
to="/page"
|