@wordpress/interface 4.1.0 → 4.1.4
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/README.md +18 -10
- package/build/components/action-item/index.js +30 -25
- package/build/components/action-item/index.js.map +1 -1
- package/build/components/complementary-area/index.js +30 -27
- package/build/components/complementary-area/index.js.map +1 -1
- package/build/components/complementary-area-header/index.js +7 -6
- package/build/components/complementary-area-header/index.js.map +1 -1
- package/build/components/complementary-area-more-menu-item/index.js +7 -6
- package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build/components/complementary-area-toggle/index.js +9 -8
- package/build/components/complementary-area-toggle/index.js.map +1 -1
- package/build/components/fullscreen-mode/index.js +4 -3
- package/build/components/fullscreen-mode/index.js.map +1 -1
- package/build/components/index.js +8 -8
- package/build/components/interface-skeleton/index.js +14 -13
- package/build/components/interface-skeleton/index.js.map +1 -1
- package/build/components/more-menu-dropdown/index.js +11 -10
- package/build/components/more-menu-dropdown/index.js.map +1 -1
- package/build/components/more-menu-feature-toggle/index.js +10 -9
- package/build/components/more-menu-feature-toggle/index.js.map +1 -1
- package/build/components/pinned-items/index.js +11 -9
- package/build/components/pinned-items/index.js.map +1 -1
- package/build/store/actions.js +13 -19
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +8 -4
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +32 -19
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build-module/components/action-item/index.js +30 -25
- package/build-module/components/action-item/index.js.map +1 -1
- package/build-module/components/complementary-area/index.js +30 -27
- package/build-module/components/complementary-area/index.js.map +1 -1
- package/build-module/components/complementary-area-header/index.js +7 -6
- package/build-module/components/complementary-area-header/index.js.map +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.js +7 -6
- package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build-module/components/complementary-area-toggle/index.js +9 -8
- package/build-module/components/complementary-area-toggle/index.js.map +1 -1
- package/build-module/components/fullscreen-mode/index.js +4 -3
- package/build-module/components/fullscreen-mode/index.js.map +1 -1
- package/build-module/components/interface-skeleton/index.js +14 -13
- package/build-module/components/interface-skeleton/index.js.map +1 -1
- package/build-module/components/more-menu-dropdown/index.js +10 -9
- package/build-module/components/more-menu-dropdown/index.js.map +1 -1
- package/build-module/components/more-menu-feature-toggle/index.js +10 -9
- package/build-module/components/more-menu-feature-toggle/index.js.map +1 -1
- package/build-module/components/pinned-items/index.js +11 -9
- package/build-module/components/pinned-items/index.js.map +1 -1
- package/build-module/store/actions.js +9 -13
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +4 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +30 -18
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +14 -2
- package/build-style/style.css +14 -2
- package/package.json +13 -13
- package/src/components/complementary-area/style.scss +10 -2
- package/src/components/complementary-area-header/style.scss +8 -0
- package/src/store/actions.js +5 -25
- package/src/store/index.js +2 -0
- package/src/store/reducer.js +3 -3
package/build-style/style.css
CHANGED
|
@@ -122,6 +122,12 @@
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
@media (min-width: 782px) {
|
|
126
|
+
.components-panel__header + .interface-complementary-area-header {
|
|
127
|
+
margin-top: 0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
125
131
|
.interface-complementary-area {
|
|
126
132
|
background: #fff;
|
|
127
133
|
color: #1e1e1e;
|
|
@@ -157,12 +163,18 @@
|
|
|
157
163
|
.interface-complementary-area p {
|
|
158
164
|
margin-top: 0;
|
|
159
165
|
}
|
|
160
|
-
.interface-complementary-area h2
|
|
161
|
-
.interface-complementary-area h3 {
|
|
166
|
+
.interface-complementary-area h2 {
|
|
162
167
|
font-size: 13px;
|
|
163
168
|
color: #1e1e1e;
|
|
164
169
|
margin-bottom: 1.5em;
|
|
165
170
|
}
|
|
171
|
+
.interface-complementary-area h3 {
|
|
172
|
+
font-size: 11px;
|
|
173
|
+
text-transform: uppercase;
|
|
174
|
+
font-weight: 500;
|
|
175
|
+
color: #1e1e1e;
|
|
176
|
+
margin-bottom: 1.5em;
|
|
177
|
+
}
|
|
166
178
|
.interface-complementary-area hr {
|
|
167
179
|
border-top: none;
|
|
168
180
|
border-bottom: 1px solid #f0f0f0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/interface",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
4
4
|
"description": "Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
"{src,build,build-module}/{index.js,store/index.js}"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@babel/runtime": "^7.
|
|
35
|
-
"@wordpress/a11y": "^3.2.
|
|
36
|
-
"@wordpress/components": "^
|
|
37
|
-
"@wordpress/compose": "^5.0.
|
|
38
|
-
"@wordpress/data": "^6.1.
|
|
39
|
-
"@wordpress/deprecated": "^3.2.
|
|
40
|
-
"@wordpress/element": "^4.0.
|
|
41
|
-
"@wordpress/i18n": "^4.2.
|
|
42
|
-
"@wordpress/icons": "^
|
|
43
|
-
"@wordpress/plugins": "^4.0.
|
|
44
|
-
"@wordpress/viewport": "^4.0.
|
|
34
|
+
"@babel/runtime": "^7.16.0",
|
|
35
|
+
"@wordpress/a11y": "^3.2.4",
|
|
36
|
+
"@wordpress/components": "^19.0.2",
|
|
37
|
+
"@wordpress/compose": "^5.0.6",
|
|
38
|
+
"@wordpress/data": "^6.1.4",
|
|
39
|
+
"@wordpress/deprecated": "^3.2.3",
|
|
40
|
+
"@wordpress/element": "^4.0.4",
|
|
41
|
+
"@wordpress/i18n": "^4.2.4",
|
|
42
|
+
"@wordpress/icons": "^6.1.1",
|
|
43
|
+
"@wordpress/plugins": "^4.0.6",
|
|
44
|
+
"@wordpress/viewport": "^4.0.6",
|
|
45
45
|
"classnames": "^2.3.1",
|
|
46
46
|
"lodash": "^4.17.21"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "9a1dd3474d937468e4cf9caf9886ad61ef0a8f50"
|
|
52
52
|
}
|
|
@@ -35,13 +35,21 @@
|
|
|
35
35
|
margin-top: 0;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
h2
|
|
39
|
-
h3 {
|
|
38
|
+
h2 {
|
|
40
39
|
font-size: $default-font-size;
|
|
41
40
|
color: $gray-900;
|
|
42
41
|
margin-bottom: 1.5em;
|
|
43
42
|
}
|
|
44
43
|
|
|
44
|
+
// Subheading style.
|
|
45
|
+
h3 {
|
|
46
|
+
font-size: 11px;
|
|
47
|
+
text-transform: uppercase;
|
|
48
|
+
font-weight: 500;
|
|
49
|
+
color: $gray-900;
|
|
50
|
+
margin-bottom: 1.5em;
|
|
51
|
+
}
|
|
52
|
+
|
|
45
53
|
hr {
|
|
46
54
|
border-top: none;
|
|
47
55
|
border-bottom: 1px solid $gray-100;
|
|
@@ -31,3 +31,11 @@
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
// This overrides the negative margins between two consecutives panels.
|
|
36
|
+
// since the first panel is hidden.
|
|
37
|
+
.components-panel__header + .interface-complementary-area-header {
|
|
38
|
+
@include break-medium() {
|
|
39
|
+
margin-top: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
package/src/store/actions.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { controls } from '@wordpress/data';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { STORE_NAME as interfaceStoreName } from './constants';
|
|
10
|
-
|
|
11
1
|
/**
|
|
12
2
|
* Returns an action object used in signalling that an active area should be changed.
|
|
13
3
|
*
|
|
@@ -99,21 +89,11 @@ export function unpinItem( scope, itemId ) {
|
|
|
99
89
|
* @param {string} scope The feature scope (e.g. core/edit-post).
|
|
100
90
|
* @param {string} featureName The feature name.
|
|
101
91
|
*/
|
|
102
|
-
export function
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
featureName
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
yield controls.dispatch(
|
|
111
|
-
interfaceStoreName,
|
|
112
|
-
'setFeatureValue',
|
|
113
|
-
scope,
|
|
114
|
-
featureName,
|
|
115
|
-
! currentValue
|
|
116
|
-
);
|
|
92
|
+
export function toggleFeature( scope, featureName ) {
|
|
93
|
+
return function ( { select, dispatch } ) {
|
|
94
|
+
const currentValue = select.isFeatureActive( scope, featureName );
|
|
95
|
+
dispatch.setFeatureValue( scope, featureName, ! currentValue );
|
|
96
|
+
};
|
|
117
97
|
}
|
|
118
98
|
|
|
119
99
|
/**
|
package/src/store/index.js
CHANGED
|
@@ -23,6 +23,7 @@ export const store = createReduxStore( STORE_NAME, {
|
|
|
23
23
|
actions,
|
|
24
24
|
selectors,
|
|
25
25
|
persist: [ 'enableItems', 'preferences' ],
|
|
26
|
+
__experimentalUseThunks: true,
|
|
26
27
|
} );
|
|
27
28
|
|
|
28
29
|
// Once we build a more generic persistence plugin that works across types of stores
|
|
@@ -32,4 +33,5 @@ registerStore( STORE_NAME, {
|
|
|
32
33
|
actions,
|
|
33
34
|
selectors,
|
|
34
35
|
persist: [ 'enableItems', 'preferences' ],
|
|
36
|
+
__experimentalUseThunks: true,
|
|
35
37
|
} );
|
package/src/store/reducer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { get } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -89,7 +89,7 @@ export function multipleEnableItems(
|
|
|
89
89
|
*
|
|
90
90
|
* @return {Object} Updated state.
|
|
91
91
|
*/
|
|
92
|
-
export const preferenceDefaults =
|
|
92
|
+
export const preferenceDefaults = combineReducers( {
|
|
93
93
|
features( state = {}, action ) {
|
|
94
94
|
if ( action.type === 'SET_FEATURE_DEFAULTS' ) {
|
|
95
95
|
const { scope, defaults } = action;
|
|
@@ -114,7 +114,7 @@ export const preferenceDefaults = flow( [ combineReducers ] )( {
|
|
|
114
114
|
*
|
|
115
115
|
* @return {Object} Updated state.
|
|
116
116
|
*/
|
|
117
|
-
export const preferences =
|
|
117
|
+
export const preferences = combineReducers( {
|
|
118
118
|
features( state = {}, action ) {
|
|
119
119
|
if ( action.type === 'SET_FEATURE_VALUE' ) {
|
|
120
120
|
const { scope, featureName, value } = action;
|