@wordpress/interface 5.35.0 → 6.0.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 +6 -0
- 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 +82 -68
- package/build/components/complementary-area/index.js.map +1 -1
- package/build/components/complementary-area-header/index.js +15 -10
- 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 +99 -71
- package/build/components/interface-skeleton/index.js.map +1 -1
- package/build/components/navigable-region/index.js +5 -4
- package/build/components/navigable-region/index.js.map +1 -1
- package/build/components/pinned-items/index.js +9 -7
- 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 +84 -68
- package/build-module/components/complementary-area/index.js.map +1 -1
- package/build-module/components/complementary-area-header/index.js +17 -10
- 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 +100 -71
- package/build-module/components/interface-skeleton/index.js.map +1 -1
- package/build-module/components/navigable-region/index.js +5 -4
- package/build-module/components/navigable-region/index.js.map +1 -1
- package/build-module/components/pinned-items/index.js +9 -7
- package/build-module/components/pinned-items/index.js.map +1 -1
- package/build-style/style-rtl.css +8 -7
- package/build-style/style.css +8 -7
- package/package.json +16 -15
- package/src/components/interface-skeleton/index.js +60 -40
- package/src/components/interface-skeleton/style.scss +9 -10
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* External dependencies
|
|
4
3
|
*/
|
|
@@ -16,7 +15,14 @@ import { useMergeRefs, useReducedMotion, useViewportMatch, useResizeObserver } f
|
|
|
16
15
|
* Internal dependencies
|
|
17
16
|
*/
|
|
18
17
|
import NavigableRegion from '../navigable-region';
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
20
|
const ANIMATION_DURATION = 0.25;
|
|
21
|
+
const commonTransition = {
|
|
22
|
+
type: 'tween',
|
|
23
|
+
duration: ANIMATION_DURATION,
|
|
24
|
+
ease: [0.6, 0, 0.4, 1]
|
|
25
|
+
};
|
|
20
26
|
function useHTMLClass(className) {
|
|
21
27
|
useEffect(() => {
|
|
22
28
|
const element = document && document.querySelector(`html:not(.${className})`);
|
|
@@ -31,20 +37,33 @@ function useHTMLClass(className) {
|
|
|
31
37
|
}
|
|
32
38
|
const headerVariants = {
|
|
33
39
|
hidden: {
|
|
34
|
-
opacity:
|
|
40
|
+
opacity: 1,
|
|
41
|
+
marginTop: -60
|
|
42
|
+
},
|
|
43
|
+
visible: {
|
|
44
|
+
opacity: 1,
|
|
45
|
+
marginTop: 0
|
|
35
46
|
},
|
|
36
|
-
|
|
47
|
+
distractionFreeHover: {
|
|
37
48
|
opacity: 1,
|
|
49
|
+
marginTop: 0,
|
|
38
50
|
transition: {
|
|
39
|
-
|
|
51
|
+
...commonTransition,
|
|
40
52
|
delay: 0.2,
|
|
41
53
|
delayChildren: 0.2
|
|
42
54
|
}
|
|
43
55
|
},
|
|
44
|
-
|
|
45
|
-
opacity:
|
|
56
|
+
distractionFreeHidden: {
|
|
57
|
+
opacity: 0,
|
|
58
|
+
marginTop: -60
|
|
59
|
+
},
|
|
60
|
+
distractionFreeDisabled: {
|
|
61
|
+
opacity: 0,
|
|
62
|
+
marginTop: 0,
|
|
46
63
|
transition: {
|
|
47
|
-
|
|
64
|
+
...commonTransition,
|
|
65
|
+
delay: 0.8,
|
|
66
|
+
delayChildren: 0.8
|
|
48
67
|
}
|
|
49
68
|
}
|
|
50
69
|
};
|
|
@@ -55,7 +74,6 @@ function InterfaceSkeleton({
|
|
|
55
74
|
editorNotices,
|
|
56
75
|
sidebar,
|
|
57
76
|
secondarySidebar,
|
|
58
|
-
notices,
|
|
59
77
|
content,
|
|
60
78
|
actions,
|
|
61
79
|
labels,
|
|
@@ -93,71 +111,82 @@ function InterfaceSkeleton({
|
|
|
93
111
|
...defaultLabels,
|
|
94
112
|
...labels
|
|
95
113
|
};
|
|
96
|
-
return
|
|
114
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
97
115
|
...(enableRegionNavigation ? navigateRegionsProps : {}),
|
|
98
116
|
ref: useMergeRefs([ref, enableRegionNavigation ? navigateRegionsProps.ref : undefined]),
|
|
99
|
-
className: clsx(className, 'interface-interface-skeleton', navigateRegionsProps.className, !!footer && 'has-footer')
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
117
|
+
className: clsx(className, 'interface-interface-skeleton', navigateRegionsProps.className, !!footer && 'has-footer'),
|
|
118
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
119
|
+
className: "interface-interface-skeleton__editor",
|
|
120
|
+
children: [/*#__PURE__*/_jsx(AnimatePresence, {
|
|
121
|
+
initial: false,
|
|
122
|
+
children: !!header && /*#__PURE__*/_jsx(NavigableRegion, {
|
|
123
|
+
as: motion.div,
|
|
124
|
+
className: "interface-interface-skeleton__header",
|
|
125
|
+
"aria-label": mergedLabels.header,
|
|
126
|
+
initial: isDistractionFree ? 'distractionFreeHidden' : 'hidden',
|
|
127
|
+
whileHover: isDistractionFree ? 'distractionFreeHover' : 'visible',
|
|
128
|
+
animate: isDistractionFree ? 'distractionFreeDisabled' : 'visible',
|
|
129
|
+
exit: isDistractionFree ? 'distractionFreeHidden' : 'hidden',
|
|
130
|
+
variants: headerVariants,
|
|
131
|
+
transition: defaultTransition,
|
|
132
|
+
children: header
|
|
133
|
+
})
|
|
134
|
+
}), isDistractionFree && /*#__PURE__*/_jsx("div", {
|
|
135
|
+
className: "interface-interface-skeleton__header",
|
|
136
|
+
children: editorNotices
|
|
137
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
138
|
+
className: "interface-interface-skeleton__body",
|
|
139
|
+
children: [/*#__PURE__*/_jsx(AnimatePresence, {
|
|
140
|
+
initial: false,
|
|
141
|
+
children: !!secondarySidebar && /*#__PURE__*/_jsx(NavigableRegion, {
|
|
142
|
+
className: "interface-interface-skeleton__secondary-sidebar",
|
|
143
|
+
ariaLabel: mergedLabels.secondarySidebar,
|
|
144
|
+
as: motion.div,
|
|
145
|
+
initial: "closed",
|
|
146
|
+
animate: isMobileViewport ? 'mobileOpen' : 'open',
|
|
147
|
+
exit: "closed",
|
|
148
|
+
variants: {
|
|
149
|
+
open: {
|
|
150
|
+
width: secondarySidebarSize.width
|
|
151
|
+
},
|
|
152
|
+
closed: {
|
|
153
|
+
width: 0
|
|
154
|
+
},
|
|
155
|
+
mobileOpen: {
|
|
156
|
+
width: '100vw'
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
transition: defaultTransition,
|
|
160
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
161
|
+
style: {
|
|
162
|
+
position: 'absolute',
|
|
163
|
+
width: isMobileViewport ? '100vw' : 'fit-content',
|
|
164
|
+
height: '100%',
|
|
165
|
+
right: 0
|
|
166
|
+
},
|
|
167
|
+
children: [secondarySidebarResizeListener, secondarySidebar]
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
}), /*#__PURE__*/_jsx(NavigableRegion, {
|
|
171
|
+
className: "interface-interface-skeleton__content",
|
|
172
|
+
ariaLabel: mergedLabels.body,
|
|
173
|
+
children: content
|
|
174
|
+
}), !!sidebar && /*#__PURE__*/_jsx(NavigableRegion, {
|
|
175
|
+
className: "interface-interface-skeleton__sidebar",
|
|
176
|
+
ariaLabel: mergedLabels.sidebar,
|
|
177
|
+
children: sidebar
|
|
178
|
+
}), !!actions && /*#__PURE__*/_jsx(NavigableRegion, {
|
|
179
|
+
className: "interface-interface-skeleton__actions",
|
|
180
|
+
ariaLabel: mergedLabels.actions,
|
|
181
|
+
children: actions
|
|
182
|
+
})]
|
|
183
|
+
})]
|
|
184
|
+
}), !!footer && /*#__PURE__*/_jsx(NavigableRegion, {
|
|
185
|
+
className: "interface-interface-skeleton__footer",
|
|
186
|
+
ariaLabel: mergedLabels.footer,
|
|
187
|
+
children: footer
|
|
188
|
+
})]
|
|
189
|
+
});
|
|
161
190
|
}
|
|
162
191
|
export default forwardRef(InterfaceSkeleton);
|
|
163
192
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","forwardRef","useEffect","__unstableUseNavigateRegions","useNavigateRegions","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","__","_x","useMergeRefs","useReducedMotion","useViewportMatch","useResizeObserver","NavigableRegion","ANIMATION_DURATION","useHTMLClass","className","element","document","querySelector","classList","toggle","headerVariants","hidden","opacity","hover","transition","type","delay","delayChildren","distractionFreeInactive","InterfaceSkeleton","isDistractionFree","footer","header","editorNotices","sidebar","secondarySidebar","notices","content","actions","labels","enableRegionNavigation","shortcuts","ref","secondarySidebarResizeListener","secondarySidebarSize","isMobileViewport","disableMotion","defaultTransition","duration","ease","navigateRegionsProps","defaultLabels","body","mergedLabels","createElement","undefined","as","div","initial","whileHover","animate","variants","ariaLabel","exit","open","width","closed","mobileOpen","style","position","height","right"],"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport {\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tuseMergeRefs,\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport NavigableRegion from '../navigable-region';\n\nconst ANIMATION_DURATION = 0.25;\n\nfunction useHTMLClass( className ) {\n\tuseEffect( () => {\n\t\tconst element =\n\t\t\tdocument && document.querySelector( `html:not(.${ className })` );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\t\telement.classList.toggle( className );\n\t\treturn () => {\n\t\t\telement.classList.toggle( className );\n\t\t};\n\t}, [ className ] );\n}\n\nconst headerVariants = {\n\thidden: { opacity: 0 },\n\thover: {\n\t\topacity: 1,\n\t\ttransition: { type: 'tween', delay: 0.2, delayChildren: 0.2 },\n\t},\n\tdistractionFreeInactive: { opacity: 1, transition: { delay: 0 } },\n};\n\nfunction InterfaceSkeleton(\n\t{\n\t\tisDistractionFree,\n\t\tfooter,\n\t\theader,\n\t\teditorNotices,\n\t\tsidebar,\n\t\tsecondarySidebar,\n\t\tnotices,\n\t\tcontent,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\n\t\tenableRegionNavigation = true,\n\t\t// Todo: does this need to be a prop.\n\t\t// Can we use a dependency to keyboard-shortcuts directly?\n\t\tshortcuts,\n\t},\n\tref\n) {\n\tconst [ secondarySidebarResizeListener, secondarySidebarSize ] =\n\t\tuseResizeObserver();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst disableMotion = useReducedMotion();\n\tconst defaultTransition = {\n\t\ttype: 'tween',\n\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t};\n\tconst navigateRegionsProps = useNavigateRegions( shortcuts );\n\tuseHTMLClass( 'interface-interface-skeleton__html-container' );\n\n\tconst defaultLabels = {\n\t\t/* translators: accessibility text for the top bar landmark region. */\n\t\theader: _x( 'Header', 'header landmark area' ),\n\t\t/* translators: accessibility text for the content landmark region. */\n\t\tbody: __( 'Content' ),\n\t\t/* translators: accessibility text for the secondary sidebar landmark region. */\n\t\tsecondarySidebar: __( 'Block Library' ),\n\t\t/* translators: accessibility text for the settings landmark region. */\n\t\tsidebar: __( 'Settings' ),\n\t\t/* translators: accessibility text for the publish landmark region. */\n\t\tactions: __( 'Publish' ),\n\t\t/* translators: accessibility text for the footer landmark region. */\n\t\tfooter: __( 'Footer' ),\n\t};\n\n\tconst mergedLabels = { ...defaultLabels, ...labels };\n\n\treturn (\n\t\t<div\n\t\t\t{ ...( enableRegionNavigation ? navigateRegionsProps : {} ) }\n\t\t\tref={ useMergeRefs( [\n\t\t\t\tref,\n\t\t\t\tenableRegionNavigation ? navigateRegionsProps.ref : undefined,\n\t\t\t] ) }\n\t\t\tclassName={ clsx(\n\t\t\t\tclassName,\n\t\t\t\t'interface-interface-skeleton',\n\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t!! footer && 'has-footer'\n\t\t\t) }\n\t\t>\n\t\t\t<div className=\"interface-interface-skeleton__editor\">\n\t\t\t\t{ !! header && (\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hidden'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hover'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hidden'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvariants={ headerVariants }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? { type: 'tween', delay: 0.8 }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t) }\n\t\t\t\t{ isDistractionFree && (\n\t\t\t\t\t<div className=\"interface-interface-skeleton__header\">\n\t\t\t\t\t\t{ editorNotices }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"interface-interface-skeleton__body\">\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ !! secondarySidebar && (\n\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__secondary-sidebar\"\n\t\t\t\t\t\t\t\tariaLabel={ mergedLabels.secondarySidebar }\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tinitial=\"closed\"\n\t\t\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t\t\tisMobileViewport ? 'mobileOpen' : 'open'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\texit=\"closed\"\n\t\t\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\t\t\topen: { width: secondarySidebarSize.width },\n\t\t\t\t\t\t\t\t\tclosed: { width: 0 },\n\t\t\t\t\t\t\t\t\tmobileOpen: { width: '100vw' },\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ defaultTransition }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\t\twidth: isMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t? '100vw'\n\t\t\t\t\t\t\t\t\t\t\t: 'fit-content',\n\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ secondarySidebarResizeListener }\n\t\t\t\t\t\t\t\t\t{ secondarySidebar }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t{ !! notices && (\n\t\t\t\t\t\t<div className=\"interface-interface-skeleton__notices\">\n\t\t\t\t\t\t\t{ notices }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__content\"\n\t\t\t\t\t\tariaLabel={ mergedLabels.body }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ content }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t{ !! sidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.sidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! actions && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__actions\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.actions }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{ !! footer && (\n\t\t\t\t<NavigableRegion\n\t\t\t\t\tclassName=\"interface-interface-skeleton__footer\"\n\t\t\t\t\tariaLabel={ mergedLabels.footer }\n\t\t\t\t>\n\t\t\t\t\t{ footer }\n\t\t\t\t</NavigableRegion>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default forwardRef( InterfaceSkeleton );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,UAAU,EAAEC,SAAS,QAAQ,oBAAoB;AAC1D,SACCC,4BAA4B,IAAIC,kBAAkB,EAClDC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,YAAY,EACZC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,QACX,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,eAAe,MAAM,qBAAqB;AAEjD,MAAMC,kBAAkB,GAAG,IAAI;AAE/B,SAASC,YAAYA,CAAEC,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uCAAuC;IACjDgD,SAAS,EAAGT,YAAY,CAACD;EAAM,GAE7Bf,OACc,CAAC,EAChB,CAAC,CAAEH,OAAO,IACXoB,aAAA,CAAC3C,eAAe;IACfG,SAAS,EAAC,uCAAuC;IACjDgD,SAAS,EAAGT,YAAY,CAACnB;EAAS,GAEhCA,OACc,CACjB,EACC,CAAC,CAAEI,OAAO,IACXgB,aAAA,CAAC3C,eAAe;IACfG,SAAS,EAAC,uCAAuC;IACjDgD,SAAS,EAAGT,YAAY,CAACf;EAAS,GAEhCA,OACc,CAEd,CACD,CAAC,EACJ,CAAC,CAAEP,MAAM,IACVuB,aAAA,CAAC3C,eAAe;IACfG,SAAS,EAAC,sCAAsC;IAChDgD,SAAS,EAAGT,YAAY,CAACtB;EAAQ,GAE/BA,MACc,CAEd,CAAC;AAER;AAEA,eAAelC,UAAU,CAAEgC,iBAAkB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","forwardRef","useEffect","__unstableUseNavigateRegions","useNavigateRegions","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","__","_x","useMergeRefs","useReducedMotion","useViewportMatch","useResizeObserver","NavigableRegion","jsx","_jsx","jsxs","_jsxs","ANIMATION_DURATION","commonTransition","type","duration","ease","useHTMLClass","className","element","document","querySelector","classList","toggle","headerVariants","hidden","opacity","marginTop","visible","distractionFreeHover","transition","delay","delayChildren","distractionFreeHidden","distractionFreeDisabled","InterfaceSkeleton","isDistractionFree","footer","header","editorNotices","sidebar","secondarySidebar","content","actions","labels","enableRegionNavigation","shortcuts","ref","secondarySidebarResizeListener","secondarySidebarSize","isMobileViewport","disableMotion","defaultTransition","navigateRegionsProps","defaultLabels","body","mergedLabels","undefined","children","initial","as","div","whileHover","animate","exit","variants","ariaLabel","open","width","closed","mobileOpen","style","position","height","right"],"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport {\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tuseMergeRefs,\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport NavigableRegion from '../navigable-region';\n\nconst ANIMATION_DURATION = 0.25;\nconst commonTransition = {\n\ttype: 'tween',\n\tduration: ANIMATION_DURATION,\n\tease: [ 0.6, 0, 0.4, 1 ],\n};\n\nfunction useHTMLClass( className ) {\n\tuseEffect( () => {\n\t\tconst element =\n\t\t\tdocument && document.querySelector( `html:not(.${ className })` );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\t\telement.classList.toggle( className );\n\t\treturn () => {\n\t\t\telement.classList.toggle( className );\n\t\t};\n\t}, [ className ] );\n}\n\nconst headerVariants = {\n\thidden: { opacity: 1, marginTop: -60 },\n\tvisible: { opacity: 1, marginTop: 0 },\n\tdistractionFreeHover: {\n\t\topacity: 1,\n\t\tmarginTop: 0,\n\t\ttransition: {\n\t\t\t...commonTransition,\n\t\t\tdelay: 0.2,\n\t\t\tdelayChildren: 0.2,\n\t\t},\n\t},\n\tdistractionFreeHidden: {\n\t\topacity: 0,\n\t\tmarginTop: -60,\n\t},\n\tdistractionFreeDisabled: {\n\t\topacity: 0,\n\t\tmarginTop: 0,\n\t\ttransition: {\n\t\t\t...commonTransition,\n\t\t\tdelay: 0.8,\n\t\t\tdelayChildren: 0.8,\n\t\t},\n\t},\n};\n\nfunction InterfaceSkeleton(\n\t{\n\t\tisDistractionFree,\n\t\tfooter,\n\t\theader,\n\t\teditorNotices,\n\t\tsidebar,\n\t\tsecondarySidebar,\n\t\tcontent,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\n\t\tenableRegionNavigation = true,\n\t\t// Todo: does this need to be a prop.\n\t\t// Can we use a dependency to keyboard-shortcuts directly?\n\t\tshortcuts,\n\t},\n\tref\n) {\n\tconst [ secondarySidebarResizeListener, secondarySidebarSize ] =\n\t\tuseResizeObserver();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst disableMotion = useReducedMotion();\n\tconst defaultTransition = {\n\t\ttype: 'tween',\n\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t};\n\tconst navigateRegionsProps = useNavigateRegions( shortcuts );\n\tuseHTMLClass( 'interface-interface-skeleton__html-container' );\n\n\tconst defaultLabels = {\n\t\t/* translators: accessibility text for the top bar landmark region. */\n\t\theader: _x( 'Header', 'header landmark area' ),\n\t\t/* translators: accessibility text for the content landmark region. */\n\t\tbody: __( 'Content' ),\n\t\t/* translators: accessibility text for the secondary sidebar landmark region. */\n\t\tsecondarySidebar: __( 'Block Library' ),\n\t\t/* translators: accessibility text for the settings landmark region. */\n\t\tsidebar: __( 'Settings' ),\n\t\t/* translators: accessibility text for the publish landmark region. */\n\t\tactions: __( 'Publish' ),\n\t\t/* translators: accessibility text for the footer landmark region. */\n\t\tfooter: __( 'Footer' ),\n\t};\n\n\tconst mergedLabels = { ...defaultLabels, ...labels };\n\n\treturn (\n\t\t<div\n\t\t\t{ ...( enableRegionNavigation ? navigateRegionsProps : {} ) }\n\t\t\tref={ useMergeRefs( [\n\t\t\t\tref,\n\t\t\t\tenableRegionNavigation ? navigateRegionsProps.ref : undefined,\n\t\t\t] ) }\n\t\t\tclassName={ clsx(\n\t\t\t\tclassName,\n\t\t\t\t'interface-interface-skeleton',\n\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t!! footer && 'has-footer'\n\t\t\t) }\n\t\t>\n\t\t\t<div className=\"interface-interface-skeleton__editor\">\n\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t{ !! header && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t\t? 'distractionFreeHidden'\n\t\t\t\t\t\t\t\t\t: 'hidden'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t\t? 'distractionFreeHover'\n\t\t\t\t\t\t\t\t\t: 'visible'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t\t? 'distractionFreeDisabled'\n\t\t\t\t\t\t\t\t\t: 'visible'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\texit={\n\t\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t\t? 'distractionFreeHidden'\n\t\t\t\t\t\t\t\t\t: 'hidden'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvariants={ headerVariants }\n\t\t\t\t\t\t\ttransition={ defaultTransition }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ header }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</AnimatePresence>\n\t\t\t\t{ isDistractionFree && (\n\t\t\t\t\t<div className=\"interface-interface-skeleton__header\">\n\t\t\t\t\t\t{ editorNotices }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"interface-interface-skeleton__body\">\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ !! secondarySidebar && (\n\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__secondary-sidebar\"\n\t\t\t\t\t\t\t\tariaLabel={ mergedLabels.secondarySidebar }\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tinitial=\"closed\"\n\t\t\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t\t\tisMobileViewport ? 'mobileOpen' : 'open'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\texit=\"closed\"\n\t\t\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\t\t\topen: { width: secondarySidebarSize.width },\n\t\t\t\t\t\t\t\t\tclosed: { width: 0 },\n\t\t\t\t\t\t\t\t\tmobileOpen: { width: '100vw' },\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ defaultTransition }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\t\twidth: isMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t? '100vw'\n\t\t\t\t\t\t\t\t\t\t\t: 'fit-content',\n\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ secondarySidebarResizeListener }\n\t\t\t\t\t\t\t\t\t{ secondarySidebar }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__content\"\n\t\t\t\t\t\tariaLabel={ mergedLabels.body }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ content }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t{ !! sidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.sidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! actions && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__actions\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.actions }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{ !! footer && (\n\t\t\t\t<NavigableRegion\n\t\t\t\t\tclassName=\"interface-interface-skeleton__footer\"\n\t\t\t\t\tariaLabel={ mergedLabels.footer }\n\t\t\t\t>\n\t\t\t\t\t{ footer }\n\t\t\t\t</NavigableRegion>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default forwardRef( InterfaceSkeleton );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,UAAU,EAAEC,SAAS,QAAQ,oBAAoB;AAC1D,SACCC,4BAA4B,IAAIC,kBAAkB,EAClDC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,YAAY,EACZC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,QACX,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,eAAe,MAAM,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAElD,MAAMC,kBAAkB,GAAG,IAAI;AAC/B,MAAMC,gBAAgB,GAAG;EACxBC,IAAI,EAAE,OAAO;EACbC,QAAQ,EAAEH,kBAAkB;EAC5BI,IAAI,EAAE,CAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;AACvB,CAAC;AAED,SAASC,YAAYA,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AAE;cAAE,CAAC;cACpBE,UAAU,EAAE;gBAAEF,KAAK,EAAE;cAAQ;YAC9B,CAAG;YACHtC,UAAU,EAAGsB,iBAAmB;YAAAM,QAAA,eAEhC/C,KAAA;cACC4D,KAAK,EAAG;gBACPC,QAAQ,EAAE,UAAU;gBACpBJ,KAAK,EAAElB,gBAAgB,GACpB,OAAO,GACP,aAAa;gBAChBuB,MAAM,EAAE,MAAM;gBACdC,KAAK,EAAE;cACR,CAAG;cAAAhB,QAAA,GAEDV,8BAA8B,EAC9BP,gBAAgB;YAAA,CACd;UAAC,CACU;QACjB,CACe,CAAC,eAClBhC,IAAA,CAACF,eAAe;UACfW,SAAS,EAAC,uCAAuC;UACjDgD,SAAS,EAAGV,YAAY,CAACD,IAAM;UAAAG,QAAA,EAE7BhB;QAAO,CACO,CAAC,EAChB,CAAC,CAAEF,OAAO,iBACX/B,IAAA,CAACF,eAAe;UACfW,SAAS,EAAC,uCAAuC;UACjDgD,SAAS,EAAGV,YAAY,CAAChB,OAAS;UAAAkB,QAAA,EAEhClB;QAAO,CACO,CACjB,EACC,CAAC,CAAEG,OAAO,iBACXlC,IAAA,CAACF,eAAe;UACfW,SAAS,EAAC,uCAAuC;UACjDgD,SAAS,EAAGV,YAAY,CAACb,OAAS;UAAAe,QAAA,EAEhCf;QAAO,CACO,CACjB;MAAA,CACG,CAAC;IAAA,CACF,CAAC,EACJ,CAAC,CAAEN,MAAM,iBACV5B,IAAA,CAACF,eAAe;MACfW,SAAS,EAAC,sCAAsC;MAChDgD,SAAS,EAAGV,YAAY,CAACnB,MAAQ;MAAAqB,QAAA,EAE/BrB;IAAM,CACQ,CACjB;EAAA,CACG,CAAC;AAER;AAEA,eAAe5C,UAAU,CAAE0C,iBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* External dependencies
|
|
4
3
|
*/
|
|
5
4
|
import clsx from 'clsx';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
export default function NavigableRegion({
|
|
7
7
|
children,
|
|
8
8
|
className,
|
|
@@ -10,12 +10,13 @@ export default function NavigableRegion({
|
|
|
10
10
|
as: Tag = 'div',
|
|
11
11
|
...props
|
|
12
12
|
}) {
|
|
13
|
-
return
|
|
13
|
+
return /*#__PURE__*/_jsx(Tag, {
|
|
14
14
|
className: clsx('interface-navigable-region', className),
|
|
15
15
|
"aria-label": ariaLabel,
|
|
16
16
|
role: "region",
|
|
17
17
|
tabIndex: "-1",
|
|
18
|
-
...props
|
|
19
|
-
|
|
18
|
+
...props,
|
|
19
|
+
children: children
|
|
20
|
+
});
|
|
20
21
|
}
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","NavigableRegion","children","className","ariaLabel","as","Tag","props","
|
|
1
|
+
{"version":3,"names":["clsx","jsx","_jsx","NavigableRegion","children","className","ariaLabel","as","Tag","props","role","tabIndex"],"sources":["@wordpress/interface/src/components/navigable-region/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\nexport default function NavigableRegion( {\n\tchildren,\n\tclassName,\n\tariaLabel,\n\tas: Tag = 'div',\n\t...props\n} ) {\n\treturn (\n\t\t<Tag\n\t\t\tclassName={ clsx( 'interface-navigable-region', className ) }\n\t\t\taria-label={ ariaLabel }\n\t\t\trole=\"region\"\n\t\t\ttabIndex=\"-1\"\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t</Tag>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExB,eAAe,SAASC,eAAeA,CAAE;EACxCC,QAAQ;EACRC,SAAS;EACTC,SAAS;EACTC,EAAE,EAAEC,GAAG,GAAG,KAAK;EACf,GAAGC;AACJ,CAAC,EAAG;EACH,oBACCP,IAAA,CAACM,GAAG;IACHH,SAAS,EAAGL,IAAI,CAAE,4BAA4B,EAAEK,SAAU,CAAG;IAC7D,cAAaC,SAAW;IACxBI,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAC,IAAI;IAAA,GACRF,KAAK;IAAAL,QAAA,EAERA;EAAQ,CACN,CAAC;AAER","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* External dependencies
|
|
4
3
|
*/
|
|
@@ -8,11 +7,12 @@ import clsx from 'clsx';
|
|
|
8
7
|
* WordPress dependencies
|
|
9
8
|
*/
|
|
10
9
|
import { Slot, Fill } from '@wordpress/components';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
function PinnedItems({
|
|
12
12
|
scope,
|
|
13
13
|
...props
|
|
14
14
|
}) {
|
|
15
|
-
return
|
|
15
|
+
return /*#__PURE__*/_jsx(Fill, {
|
|
16
16
|
name: `PinnedItems/${scope}`,
|
|
17
17
|
...props
|
|
18
18
|
});
|
|
@@ -22,12 +22,14 @@ function PinnedItemsSlot({
|
|
|
22
22
|
className,
|
|
23
23
|
...props
|
|
24
24
|
}) {
|
|
25
|
-
return
|
|
25
|
+
return /*#__PURE__*/_jsx(Slot, {
|
|
26
26
|
name: `PinnedItems/${scope}`,
|
|
27
|
-
...props
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
...props,
|
|
28
|
+
children: fills => fills?.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
29
|
+
className: clsx(className, 'interface-pinned-items'),
|
|
30
|
+
children: fills
|
|
31
|
+
})
|
|
32
|
+
});
|
|
31
33
|
}
|
|
32
34
|
PinnedItems.Slot = PinnedItemsSlot;
|
|
33
35
|
export default PinnedItems;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","Slot","Fill","PinnedItems","scope","props","
|
|
1
|
+
{"version":3,"names":["clsx","Slot","Fill","jsx","_jsx","PinnedItems","scope","props","name","PinnedItemsSlot","className","children","fills","length"],"sources":["@wordpress/interface/src/components/pinned-items/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Slot, Fill } from '@wordpress/components';\n\nfunction PinnedItems( { scope, ...props } ) {\n\treturn <Fill name={ `PinnedItems/${ scope }` } { ...props } />;\n}\n\nfunction PinnedItemsSlot( { scope, className, ...props } ) {\n\treturn (\n\t\t<Slot name={ `PinnedItems/${ scope }` } { ...props }>\n\t\t\t{ ( fills ) =>\n\t\t\t\tfills?.length > 0 && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'interface-pinned-items'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t</Slot>\n\t);\n}\n\nPinnedItems.Slot = PinnedItemsSlot;\n\nexport default PinnedItems;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,SAASC,WAAWA,CAAE;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC3C,oBAAOH,IAAA,CAACF,IAAI;IAACM,IAAI,EAAI,eAAeF,KAAO,EAAG;IAAA,GAAMC;EAAK,CAAI,CAAC;AAC/D;AAEA,SAASE,eAAeA,CAAE;EAAEH,KAAK;EAAEI,SAAS;EAAE,GAAGH;AAAM,CAAC,EAAG;EAC1D,oBACCH,IAAA,CAACH,IAAI;IAACO,IAAI,EAAI,eAAeF,KAAO,EAAG;IAAA,GAAMC,KAAK;IAAAI,QAAA,EAC7CC,KAAK,IACRA,KAAK,EAAEC,MAAM,GAAG,CAAC,iBAChBT,IAAA;MACCM,SAAS,EAAGV,IAAI,CACfU,SAAS,EACT,wBACD,CAAG;MAAAC,QAAA,EAEDC;IAAK,CACH;EACL,CAEG,CAAC;AAET;AAEAP,WAAW,CAACJ,IAAI,GAAGQ,eAAe;AAElC,eAAeJ,WAAW","ignoreList":[]}
|
|
@@ -351,36 +351,37 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
351
351
|
.interface-interface-skeleton__sidebar {
|
|
352
352
|
position: relative !important;
|
|
353
353
|
}
|
|
354
|
-
.is-sidebar-opened .interface-interface-skeleton__secondary-sidebar,
|
|
355
|
-
.is-sidebar-opened .interface-interface-skeleton__sidebar {
|
|
356
|
-
z-index: 90;
|
|
357
|
-
}
|
|
358
354
|
}
|
|
359
355
|
|
|
360
356
|
.interface-interface-skeleton__sidebar {
|
|
357
|
+
border-top: 1px solid #e0e0e0;
|
|
361
358
|
overflow: hidden;
|
|
362
359
|
}
|
|
363
360
|
@media (min-width: 782px) {
|
|
364
361
|
.interface-interface-skeleton__sidebar {
|
|
365
|
-
|
|
362
|
+
box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.133);
|
|
363
|
+
outline: 1px solid transparent;
|
|
366
364
|
}
|
|
367
365
|
}
|
|
368
366
|
|
|
369
367
|
.interface-interface-skeleton__secondary-sidebar {
|
|
368
|
+
border-top: 1px solid #e0e0e0;
|
|
370
369
|
left: 0;
|
|
371
370
|
}
|
|
372
371
|
@media (min-width: 782px) {
|
|
373
372
|
.interface-interface-skeleton__secondary-sidebar {
|
|
374
|
-
|
|
373
|
+
box-shadow: -1px 1px 0 0 rgba(0, 0, 0, 0.133);
|
|
374
|
+
outline: 1px solid transparent;
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
.interface-interface-skeleton__header {
|
|
379
379
|
flex-shrink: 0;
|
|
380
380
|
height: auto;
|
|
381
|
-
|
|
381
|
+
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.133);
|
|
382
382
|
z-index: 30;
|
|
383
383
|
color: #1e1e1e;
|
|
384
|
+
outline: 1px solid transparent;
|
|
384
385
|
}
|
|
385
386
|
|
|
386
387
|
.interface-interface-skeleton__footer {
|
package/build-style/style.css
CHANGED
|
@@ -351,36 +351,37 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
351
351
|
.interface-interface-skeleton__sidebar {
|
|
352
352
|
position: relative !important;
|
|
353
353
|
}
|
|
354
|
-
.is-sidebar-opened .interface-interface-skeleton__secondary-sidebar,
|
|
355
|
-
.is-sidebar-opened .interface-interface-skeleton__sidebar {
|
|
356
|
-
z-index: 90;
|
|
357
|
-
}
|
|
358
354
|
}
|
|
359
355
|
|
|
360
356
|
.interface-interface-skeleton__sidebar {
|
|
357
|
+
border-top: 1px solid #e0e0e0;
|
|
361
358
|
overflow: hidden;
|
|
362
359
|
}
|
|
363
360
|
@media (min-width: 782px) {
|
|
364
361
|
.interface-interface-skeleton__sidebar {
|
|
365
|
-
|
|
362
|
+
box-shadow: -1px 1px 0 0 rgba(0, 0, 0, 0.133);
|
|
363
|
+
outline: 1px solid transparent;
|
|
366
364
|
}
|
|
367
365
|
}
|
|
368
366
|
|
|
369
367
|
.interface-interface-skeleton__secondary-sidebar {
|
|
368
|
+
border-top: 1px solid #e0e0e0;
|
|
370
369
|
right: 0;
|
|
371
370
|
}
|
|
372
371
|
@media (min-width: 782px) {
|
|
373
372
|
.interface-interface-skeleton__secondary-sidebar {
|
|
374
|
-
|
|
373
|
+
box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.133);
|
|
374
|
+
outline: 1px solid transparent;
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
.interface-interface-skeleton__header {
|
|
379
379
|
flex-shrink: 0;
|
|
380
380
|
height: auto;
|
|
381
|
-
|
|
381
|
+
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.133);
|
|
382
382
|
z-index: 30;
|
|
383
383
|
color: #1e1e1e;
|
|
384
|
+
outline: 1px solid transparent;
|
|
384
385
|
}
|
|
385
386
|
|
|
386
387
|
.interface-interface-skeleton__footer {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/interface",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
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",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"url": "https://github.com/WordPress/gutenberg/issues"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": ">=12"
|
|
23
|
+
"node": ">=18.12.0",
|
|
24
|
+
"npm": ">=8.19.2"
|
|
24
25
|
},
|
|
25
26
|
"main": "build/index.js",
|
|
26
27
|
"module": "build-module/index.js",
|
|
@@ -32,18 +33,18 @@
|
|
|
32
33
|
],
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"@babel/runtime": "^7.16.0",
|
|
35
|
-
"@wordpress/a11y": "^
|
|
36
|
-
"@wordpress/components": "^
|
|
37
|
-
"@wordpress/compose": "^
|
|
38
|
-
"@wordpress/data": "^
|
|
39
|
-
"@wordpress/deprecated": "^
|
|
40
|
-
"@wordpress/element": "^
|
|
41
|
-
"@wordpress/i18n": "^
|
|
42
|
-
"@wordpress/icons": "^
|
|
43
|
-
"@wordpress/plugins": "^
|
|
44
|
-
"@wordpress/preferences": "^
|
|
45
|
-
"@wordpress/private-apis": "^0.
|
|
46
|
-
"@wordpress/viewport": "^
|
|
36
|
+
"@wordpress/a11y": "^4.0.1",
|
|
37
|
+
"@wordpress/components": "^28.0.1",
|
|
38
|
+
"@wordpress/compose": "^7.0.1",
|
|
39
|
+
"@wordpress/data": "^10.0.1",
|
|
40
|
+
"@wordpress/deprecated": "^4.0.1",
|
|
41
|
+
"@wordpress/element": "^6.0.1",
|
|
42
|
+
"@wordpress/i18n": "^5.0.1",
|
|
43
|
+
"@wordpress/icons": "^10.0.1",
|
|
44
|
+
"@wordpress/plugins": "^7.0.1",
|
|
45
|
+
"@wordpress/preferences": "^4.0.1",
|
|
46
|
+
"@wordpress/private-apis": "^1.0.1",
|
|
47
|
+
"@wordpress/viewport": "^6.0.1",
|
|
47
48
|
"clsx": "^2.1.1"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
@@ -53,5 +54,5 @@
|
|
|
53
54
|
"publishConfig": {
|
|
54
55
|
"access": "public"
|
|
55
56
|
},
|
|
56
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "0e973525f7787401b5a544e0727774d52a78639f"
|
|
57
58
|
}
|
|
@@ -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,
|
|
@@ -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 }
|