@wordpress/interface 5.34.0 → 6.0.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 -2
- package/build/components/action-item/index.js +46 -43
- package/build/components/action-item/index.js.map +1 -1
- package/build/components/complementary-area/index.js +83 -67
- package/build/components/complementary-area/index.js.map +1 -1
- package/build/components/complementary-area-header/index.js +16 -11
- package/build/components/complementary-area-header/index.js.map +1 -1
- package/build/components/complementary-area-more-menu-item/index.js +4 -4
- package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build/components/complementary-area-toggle/index.js +2 -2
- package/build/components/complementary-area-toggle/index.js.map +1 -1
- package/build/components/interface-skeleton/index.js +100 -72
- package/build/components/interface-skeleton/index.js.map +1 -1
- package/build/components/navigable-region/index.js +7 -6
- package/build/components/navigable-region/index.js.map +1 -1
- package/build/components/pinned-items/index.js +10 -8
- package/build/components/pinned-items/index.js.map +1 -1
- package/build-module/components/action-item/index.js +46 -43
- package/build-module/components/action-item/index.js.map +1 -1
- package/build-module/components/complementary-area/index.js +85 -67
- package/build-module/components/complementary-area/index.js.map +1 -1
- package/build-module/components/complementary-area-header/index.js +18 -11
- package/build-module/components/complementary-area-header/index.js.map +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.js +4 -4
- package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build-module/components/complementary-area-toggle/index.js +2 -2
- package/build-module/components/complementary-area-toggle/index.js.map +1 -1
- package/build-module/components/interface-skeleton/index.js +101 -72
- package/build-module/components/interface-skeleton/index.js.map +1 -1
- package/build-module/components/navigable-region/index.js +7 -6
- package/build-module/components/navigable-region/index.js.map +1 -1
- package/build-module/components/pinned-items/index.js +10 -8
- package/build-module/components/pinned-items/index.js.map +1 -1
- package/build-style/style-rtl.css +14 -13
- package/build-style/style.css +14 -13
- package/package.json +17 -16
- package/src/components/complementary-area/index.js +4 -5
- package/src/components/complementary-area/style.scss +2 -1
- package/src/components/complementary-area-header/index.js +2 -2
- package/src/components/complementary-area-header/style.scss +2 -9
- package/src/components/interface-skeleton/index.js +62 -42
- package/src/components/interface-skeleton/style.scss +13 -5
- package/src/components/navigable-region/index.js +2 -2
- package/src/components/pinned-items/index.js +2 -2
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
top: 0;
|
|
25
25
|
z-index: z-index(".interface-complementary-area .components-panel__header");
|
|
26
26
|
|
|
27
|
-
&.
|
|
27
|
+
&.editor-sidebar__panel-tabs {
|
|
28
28
|
top: $panel-header-height;
|
|
29
29
|
|
|
30
30
|
@include break-medium() {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
h2 {
|
|
41
41
|
font-size: $default-font-size;
|
|
42
|
+
font-weight: 500;
|
|
42
43
|
color: $gray-900;
|
|
43
44
|
margin-bottom: 1.5em;
|
|
44
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -33,7 +33,7 @@ const ComplementaryAreaHeader = ( {
|
|
|
33
33
|
{ toggleButton }
|
|
34
34
|
</div>
|
|
35
35
|
<div
|
|
36
|
-
className={
|
|
36
|
+
className={ clsx(
|
|
37
37
|
'components-panel__header',
|
|
38
38
|
'interface-complementary-area-header',
|
|
39
39
|
className
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
.interface-complementary-area-header {
|
|
19
19
|
background: $white;
|
|
20
|
-
padding-right: $grid-unit-
|
|
20
|
+
padding-right: $grid-unit-15; // Reduced padding to account for close buttons.
|
|
21
|
+
gap: $grid-unit-10; // Always ensure space between contents and close buttons.
|
|
21
22
|
|
|
22
23
|
.interface-complementary-area-header__title {
|
|
23
24
|
margin: 0;
|
|
@@ -36,11 +37,3 @@
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
-
// This overrides the negative margins between two consecutives panels.
|
|
41
|
-
// since the first panel is hidden.
|
|
42
|
-
.components-panel__header + .interface-complementary-area-header {
|
|
43
|
-
@include break-medium() {
|
|
44
|
-
margin-top: 0;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -26,6 +26,11 @@ import {
|
|
|
26
26
|
import NavigableRegion from '../navigable-region';
|
|
27
27
|
|
|
28
28
|
const ANIMATION_DURATION = 0.25;
|
|
29
|
+
const commonTransition = {
|
|
30
|
+
type: 'tween',
|
|
31
|
+
duration: ANIMATION_DURATION,
|
|
32
|
+
ease: [ 0.6, 0, 0.4, 1 ],
|
|
33
|
+
};
|
|
29
34
|
|
|
30
35
|
function useHTMLClass( className ) {
|
|
31
36
|
useEffect( () => {
|
|
@@ -42,12 +47,30 @@ function useHTMLClass( className ) {
|
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
const headerVariants = {
|
|
45
|
-
hidden: { opacity:
|
|
46
|
-
|
|
50
|
+
hidden: { opacity: 1, marginTop: -60 },
|
|
51
|
+
visible: { opacity: 1, marginTop: 0 },
|
|
52
|
+
distractionFreeHover: {
|
|
47
53
|
opacity: 1,
|
|
48
|
-
|
|
54
|
+
marginTop: 0,
|
|
55
|
+
transition: {
|
|
56
|
+
...commonTransition,
|
|
57
|
+
delay: 0.2,
|
|
58
|
+
delayChildren: 0.2,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
distractionFreeHidden: {
|
|
62
|
+
opacity: 0,
|
|
63
|
+
marginTop: -60,
|
|
64
|
+
},
|
|
65
|
+
distractionFreeDisabled: {
|
|
66
|
+
opacity: 0,
|
|
67
|
+
marginTop: 0,
|
|
68
|
+
transition: {
|
|
69
|
+
...commonTransition,
|
|
70
|
+
delay: 0.8,
|
|
71
|
+
delayChildren: 0.8,
|
|
72
|
+
},
|
|
49
73
|
},
|
|
50
|
-
distractionFreeInactive: { opacity: 1, transition: { delay: 0 } },
|
|
51
74
|
};
|
|
52
75
|
|
|
53
76
|
function InterfaceSkeleton(
|
|
@@ -58,7 +81,6 @@ function InterfaceSkeleton(
|
|
|
58
81
|
editorNotices,
|
|
59
82
|
sidebar,
|
|
60
83
|
secondarySidebar,
|
|
61
|
-
notices,
|
|
62
84
|
content,
|
|
63
85
|
actions,
|
|
64
86
|
labels,
|
|
@@ -106,7 +128,7 @@ function InterfaceSkeleton(
|
|
|
106
128
|
ref,
|
|
107
129
|
enableRegionNavigation ? navigateRegionsProps.ref : undefined,
|
|
108
130
|
] ) }
|
|
109
|
-
className={
|
|
131
|
+
className={ clsx(
|
|
110
132
|
className,
|
|
111
133
|
'interface-interface-skeleton',
|
|
112
134
|
navigateRegionsProps.className,
|
|
@@ -114,36 +136,39 @@ function InterfaceSkeleton(
|
|
|
114
136
|
) }
|
|
115
137
|
>
|
|
116
138
|
<div className="interface-interface-skeleton__editor">
|
|
117
|
-
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
139
|
+
<AnimatePresence initial={ false }>
|
|
140
|
+
{ !! header && (
|
|
141
|
+
<NavigableRegion
|
|
142
|
+
as={ motion.div }
|
|
143
|
+
className="interface-interface-skeleton__header"
|
|
144
|
+
aria-label={ mergedLabels.header }
|
|
145
|
+
initial={
|
|
146
|
+
isDistractionFree
|
|
147
|
+
? 'distractionFreeHidden'
|
|
148
|
+
: 'hidden'
|
|
149
|
+
}
|
|
150
|
+
whileHover={
|
|
151
|
+
isDistractionFree
|
|
152
|
+
? 'distractionFreeHover'
|
|
153
|
+
: 'visible'
|
|
154
|
+
}
|
|
155
|
+
animate={
|
|
156
|
+
isDistractionFree
|
|
157
|
+
? 'distractionFreeDisabled'
|
|
158
|
+
: 'visible'
|
|
159
|
+
}
|
|
160
|
+
exit={
|
|
161
|
+
isDistractionFree
|
|
162
|
+
? 'distractionFreeHidden'
|
|
163
|
+
: 'hidden'
|
|
164
|
+
}
|
|
165
|
+
variants={ headerVariants }
|
|
166
|
+
transition={ defaultTransition }
|
|
167
|
+
>
|
|
168
|
+
{ header }
|
|
169
|
+
</NavigableRegion>
|
|
170
|
+
) }
|
|
171
|
+
</AnimatePresence>
|
|
147
172
|
{ isDistractionFree && (
|
|
148
173
|
<div className="interface-interface-skeleton__header">
|
|
149
174
|
{ editorNotices }
|
|
@@ -184,11 +209,6 @@ function InterfaceSkeleton(
|
|
|
184
209
|
</NavigableRegion>
|
|
185
210
|
) }
|
|
186
211
|
</AnimatePresence>
|
|
187
|
-
{ !! notices && (
|
|
188
|
-
<div className="interface-interface-skeleton__notices">
|
|
189
|
-
{ notices }
|
|
190
|
-
</div>
|
|
191
|
-
) }
|
|
192
212
|
<NavigableRegion
|
|
193
213
|
className="interface-interface-skeleton__content"
|
|
194
214
|
ariaLabel={ mergedLabels.body }
|
|
@@ -5,8 +5,10 @@ html.interface-interface-skeleton__html-container {
|
|
|
5
5
|
width: 100%;
|
|
6
6
|
|
|
7
7
|
@include break-medium() {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
&:not(:has(.is-zoom-out)) {
|
|
9
|
+
position: initial;
|
|
10
|
+
width: initial;
|
|
11
|
+
}
|
|
10
12
|
}
|
|
11
13
|
}
|
|
12
14
|
|
|
@@ -123,26 +125,32 @@ html.interface-interface-skeleton__html-container {
|
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
.interface-interface-skeleton__sidebar {
|
|
128
|
+
border-top: $border-width solid $gray-200;
|
|
126
129
|
overflow: hidden;
|
|
127
130
|
|
|
128
131
|
@include break-medium() {
|
|
129
|
-
|
|
132
|
+
box-shadow: -$border-width $border-width 0 0 rgba($color: #000, $alpha: 0.133); // 0.133 = $gray-200 but with alpha.
|
|
133
|
+
outline: 1px solid transparent; // Shown for Windows 10 High Contrast mode.
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
.interface-interface-skeleton__secondary-sidebar {
|
|
138
|
+
border-top: $border-width solid $gray-200;
|
|
134
139
|
right: 0;
|
|
140
|
+
|
|
135
141
|
@include break-medium() {
|
|
136
|
-
|
|
142
|
+
box-shadow: $border-width $border-width 0 0 rgba($color: #000, $alpha: 0.133); // 0.133 = $gray-200 but with alpha.
|
|
143
|
+
outline: 1px solid transparent; // Shown for Windows 10 High Contrast mode.
|
|
137
144
|
}
|
|
138
145
|
}
|
|
139
146
|
|
|
140
147
|
.interface-interface-skeleton__header {
|
|
141
148
|
flex-shrink: 0;
|
|
142
149
|
height: auto; // Keep the height flexible.
|
|
143
|
-
|
|
150
|
+
box-shadow: 0 $border-width 0 0 rgba($color: #000, $alpha: 0.133); // 0.133 = $gray-200 but with alpha.
|
|
144
151
|
z-index: z-index(".interface-interface-skeleton__header");
|
|
145
152
|
color: $gray-900;
|
|
153
|
+
outline: 1px solid transparent; // Shown for Windows 10 High Contrast mode.
|
|
146
154
|
}
|
|
147
155
|
|
|
148
156
|
.interface-interface-skeleton__footer {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
6
|
export default function NavigableRegion( {
|
|
7
7
|
children,
|
|
@@ -12,7 +12,7 @@ export default function NavigableRegion( {
|
|
|
12
12
|
} ) {
|
|
13
13
|
return (
|
|
14
14
|
<Tag
|
|
15
|
-
className={
|
|
15
|
+
className={ clsx( 'interface-navigable-region', className ) }
|
|
16
16
|
aria-label={ ariaLabel }
|
|
17
17
|
role="region"
|
|
18
18
|
tabIndex="-1"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -18,7 +18,7 @@ function PinnedItemsSlot( { scope, className, ...props } ) {
|
|
|
18
18
|
{ ( fills ) =>
|
|
19
19
|
fills?.length > 0 && (
|
|
20
20
|
<div
|
|
21
|
-
className={
|
|
21
|
+
className={ clsx(
|
|
22
22
|
className,
|
|
23
23
|
'interface-pinned-items'
|
|
24
24
|
) }
|