@wordpress/interface 5.32.0 → 5.33.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 +2 -0
- package/README.md +10 -10
- package/build/components/action-item/index.js.map +1 -1
- package/build/components/complementary-area/index.js +58 -3
- package/build/components/complementary-area/index.js.map +1 -1
- package/build/components/complementary-area-context/index.js.map +1 -1
- package/build/components/complementary-area-header/index.js.map +1 -1
- package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build/components/complementary-area-toggle/index.js.map +1 -1
- package/build/components/fullscreen-mode/index.js.map +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/interface-skeleton/index.js +36 -2
- package/build/components/interface-skeleton/index.js.map +1 -1
- package/build/components/navigable-region/index.js.map +1 -1
- package/build/components/pinned-items/index.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/store/actions.js +21 -5
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/deprecated.js +42 -0
- package/build/store/deprecated.js.map +1 -0
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +9 -0
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/action-item/index.js.map +1 -1
- package/build-module/components/complementary-area/index.js +60 -5
- package/build-module/components/complementary-area/index.js.map +1 -1
- package/build-module/components/complementary-area-context/index.js.map +1 -1
- package/build-module/components/complementary-area-header/index.js.map +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build-module/components/complementary-area-toggle/index.js.map +1 -1
- package/build-module/components/fullscreen-mode/index.js.map +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/interface-skeleton/index.js +38 -4
- package/build-module/components/interface-skeleton/index.js.map +1 -1
- package/build-module/components/navigable-region/index.js.map +1 -1
- package/build-module/components/pinned-items/index.js.map +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +21 -5
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/deprecated.js +33 -0
- package/build-module/store/deprecated.js.map +1 -0
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +9 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +6 -4
- package/build-style/style.css +6 -4
- package/package.json +14 -14
- package/src/components/complementary-area/README.md +2 -2
- package/src/components/complementary-area/index.js +139 -58
- package/src/components/complementary-area-more-menu-item/README.md +1 -1
- package/src/components/complementary-area-toggle/README.md +1 -1
- package/src/components/interface-skeleton/index.js +50 -10
- package/src/components/interface-skeleton/style.scss +3 -3
- package/src/components/pinned-items/README.md +2 -2
- package/src/store/actions.js +24 -5
- package/src/store/deprecated.js +37 -0
- package/src/store/selectors.js +12 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -27,25 +27,25 @@ Below are some examples of how to control the active complementary area using th
|
|
|
27
27
|
```js
|
|
28
28
|
wp.data
|
|
29
29
|
.select( 'core/interface' )
|
|
30
|
-
.getActiveComplementaryArea( 'core
|
|
30
|
+
.getActiveComplementaryArea( 'core' );
|
|
31
31
|
// -> "edit-post/document"
|
|
32
32
|
|
|
33
33
|
wp.data
|
|
34
34
|
.dispatch( 'core/interface' )
|
|
35
|
-
.enableComplementaryArea( 'core
|
|
35
|
+
.enableComplementaryArea( 'core', 'edit-post/block' );
|
|
36
36
|
|
|
37
37
|
wp.data
|
|
38
38
|
.select( 'core/interface' )
|
|
39
|
-
.getActiveComplementaryArea( 'core
|
|
39
|
+
.getActiveComplementaryArea( 'core' );
|
|
40
40
|
// -> "edit-post/block"
|
|
41
41
|
|
|
42
42
|
wp.data
|
|
43
43
|
.dispatch( 'core/interface' )
|
|
44
|
-
.disableComplementaryArea( 'core
|
|
44
|
+
.disableComplementaryArea( 'core' );
|
|
45
45
|
|
|
46
46
|
wp.data
|
|
47
47
|
.select( 'core/interface' )
|
|
48
|
-
.getActiveComplementaryArea( 'core
|
|
48
|
+
.getActiveComplementaryArea( 'core' );
|
|
49
49
|
// -> null
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -56,17 +56,17 @@ wp.data
|
|
|
56
56
|
Example usage: `ComplementaryArea` component makes use of `PinnedItems` and automatically adds a pinned item for the complementary areas marked as a favorite.
|
|
57
57
|
|
|
58
58
|
```js
|
|
59
|
-
wp.data.select( 'core/interface' ).isItemPinned( 'core
|
|
59
|
+
wp.data.select( 'core/interface' ).isItemPinned( 'core', 'edit-post-block-patterns/block-patterns-sidebar' );
|
|
60
60
|
// -> false
|
|
61
61
|
|
|
62
|
-
wp.data.dispatch( 'core/interface' ).pinItem( 'core
|
|
62
|
+
wp.data.dispatch( 'core/interface' ).pinItem( 'core', 'edit-post-block-patterns/block-patterns-sidebar' );
|
|
63
63
|
|
|
64
|
-
wp.data.select( 'core/interface' ).isItemPinned( 'core
|
|
64
|
+
wp.data.select( 'core/interface' ).isItemPinned( 'core', 'edit-post-block-patterns/block-patterns-sidebar' );
|
|
65
65
|
// -> true
|
|
66
66
|
|
|
67
|
-
wp.data.dispatch( 'core/interface' ).unpinItem( 'core
|
|
67
|
+
wp.data.dispatch( 'core/interface' ).unpinItem( 'core', 'edit-post-block-patterns/block-patterns-sidebar' );
|
|
68
68
|
|
|
69
|
-
wp.data.select( 'core/interface' ).isItemPinned( 'core
|
|
69
|
+
wp.data.select( 'core/interface' ).isItemPinned( 'core', 'edit-post-block-patterns/block-patterns-sidebar' ); -> false
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
### Preferences
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_element","noop","ActionItemSlot","name","as","Component","ButtonGroup","fillProps","bubblesVirtually","props","_react","createElement","Slot","fills","Children","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","Button","onClick","Fill","fpOnClick","args","undefined","_default","exports","default"],"sources":["@wordpress/interface/src/components/action-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nconst noop = () => {};\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = ButtonGroup,\n\tfillProps = {},\n\tbubblesVirtually,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot\n\t\t\tname={ name }\n\t\t\tbubblesVirtually={ bubblesVirtually }\n\t\t\tfillProps={ fillProps }\n\t\t>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif ( ! Children.toArray( fills ).length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Special handling exists for backward compatibility.\n\t\t\t\t// It ensures that menu items created by plugin authors aren't\n\t\t\t\t// duplicated with automatically injected menu items coming\n\t\t\t\t// from pinnable plugin sidebars.\n\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t\tconst initializedByPlugins = [];\n\t\t\t\tChildren.forEach(\n\t\t\t\t\tfills,\n\t\t\t\t\t( {\n\t\t\t\t\t\tprops: { __unstableExplicitMenuItem, __unstableTarget },\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\tif ( __unstableTarget && __unstableExplicitMenuItem ) {\n\t\t\t\t\t\t\tinitializedByPlugins.push( __unstableTarget );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst children = Children.map( fills, ( child ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! child.props.__unstableExplicitMenuItem &&\n\t\t\t\t\t\tinitializedByPlugins.includes(\n\t\t\t\t\t\t\tchild.props.__unstableTarget\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t} );\n\n\t\t\t\treturn <Component { ...props }>{ children }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as: Component = Button, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { onClick: fpOnClick } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\tonClick || fpOnClick\n\t\t\t\t\t\t\t\t? ( ...args ) => {\n\t\t\t\t\t\t\t\t\t\t( onClick || noop )( ...args );\n\t\t\t\t\t\t\t\t\t\t( fpOnClick || noop )( ...args );\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\n\nexport default ActionItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,cAAcA,CAAE;EACxBC,IAAI;EACJC,EAAE,EAAEC,SAAS,GAAGC,uBAAW;EAC3BC,SAAS,GAAG,CAAC,CAAC;EACdC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACb,WAAA,CAAAc,IAAI;IACJT,IAAI,EAAGA,IAAM;IACbK,gBAAgB,EAAGA,gBAAkB;IACrCD,SAAS,EAAGA;EAAW,GAEnBM,KAAK,IAAM;IACd,IAAK,CAAEC,iBAAQ,CAACC,OAAO,CAAEF,KAAM,CAAC,CAACG,MAAM,EAAG;MACzC,OAAO,IAAI;IACZ;;IAEA;IACA;IACA;IACA;IACA;IACA,MAAMC,oBAAoB,GAAG,EAAE;IAC/BH,iBAAQ,CAACI,OAAO,CACfL,KAAK,EACL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OAAA,GAElBT,UAAU"}
|
|
1
|
+
{"version":3,"names":["_components","require","_element","noop","ActionItemSlot","name","as","Component","ButtonGroup","fillProps","bubblesVirtually","props","_react","createElement","Slot","fills","Children","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","Button","onClick","Fill","fpOnClick","args","undefined","_default","exports","default"],"sources":["@wordpress/interface/src/components/action-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nconst noop = () => {};\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = ButtonGroup,\n\tfillProps = {},\n\tbubblesVirtually,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot\n\t\t\tname={ name }\n\t\t\tbubblesVirtually={ bubblesVirtually }\n\t\t\tfillProps={ fillProps }\n\t\t>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif ( ! Children.toArray( fills ).length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Special handling exists for backward compatibility.\n\t\t\t\t// It ensures that menu items created by plugin authors aren't\n\t\t\t\t// duplicated with automatically injected menu items coming\n\t\t\t\t// from pinnable plugin sidebars.\n\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t\tconst initializedByPlugins = [];\n\t\t\t\tChildren.forEach(\n\t\t\t\t\tfills,\n\t\t\t\t\t( {\n\t\t\t\t\t\tprops: { __unstableExplicitMenuItem, __unstableTarget },\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\tif ( __unstableTarget && __unstableExplicitMenuItem ) {\n\t\t\t\t\t\t\tinitializedByPlugins.push( __unstableTarget );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst children = Children.map( fills, ( child ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! child.props.__unstableExplicitMenuItem &&\n\t\t\t\t\t\tinitializedByPlugins.includes(\n\t\t\t\t\t\t\tchild.props.__unstableTarget\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t} );\n\n\t\t\t\treturn <Component { ...props }>{ children }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as: Component = Button, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { onClick: fpOnClick } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\tonClick || fpOnClick\n\t\t\t\t\t\t\t\t? ( ...args ) => {\n\t\t\t\t\t\t\t\t\t\t( onClick || noop )( ...args );\n\t\t\t\t\t\t\t\t\t\t( fpOnClick || noop )( ...args );\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\n\nexport default ActionItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,cAAcA,CAAE;EACxBC,IAAI;EACJC,EAAE,EAAEC,SAAS,GAAGC,uBAAW;EAC3BC,SAAS,GAAG,CAAC,CAAC;EACdC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACb,WAAA,CAAAc,IAAI;IACJT,IAAI,EAAGA,IAAM;IACbK,gBAAgB,EAAGA,gBAAkB;IACrCD,SAAS,EAAGA;EAAW,GAEnBM,KAAK,IAAM;IACd,IAAK,CAAEC,iBAAQ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,GAAG8B,IAAK,CAAC;MAChC,CAAC,GACDC,SACH;MAAA,GACIvB;IAAK,CACV,CAAC;EAEJ,CACK,CAAC;AAET;AAEAiB,UAAU,CAACd,IAAI,GAAGV,cAAc;AAAC,IAAA+B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAElBT,UAAU","ignoreList":[]}
|
|
@@ -14,6 +14,7 @@ var _icons = require("@wordpress/icons");
|
|
|
14
14
|
var _element = require("@wordpress/element");
|
|
15
15
|
var _viewport = require("@wordpress/viewport");
|
|
16
16
|
var _preferences = require("@wordpress/preferences");
|
|
17
|
+
var _compose = require("@wordpress/compose");
|
|
17
18
|
var _complementaryAreaHeader = _interopRequireDefault(require("../complementary-area-header"));
|
|
18
19
|
var _complementaryAreaMoreMenuItem = _interopRequireDefault(require("../complementary-area-more-menu-item"));
|
|
19
20
|
var _complementaryAreaToggle = _interopRequireDefault(require("../complementary-area-toggle"));
|
|
@@ -32,6 +33,7 @@ var _store = require("../../store");
|
|
|
32
33
|
* Internal dependencies
|
|
33
34
|
*/
|
|
34
35
|
|
|
36
|
+
const ANIMATION_DURATION = 0.3;
|
|
35
37
|
function ComplementaryAreaSlot({
|
|
36
38
|
scope,
|
|
37
39
|
...props
|
|
@@ -41,18 +43,60 @@ function ComplementaryAreaSlot({
|
|
|
41
43
|
...props
|
|
42
44
|
});
|
|
43
45
|
}
|
|
46
|
+
const SIDEBAR_WIDTH = 280;
|
|
47
|
+
const variants = {
|
|
48
|
+
open: {
|
|
49
|
+
width: SIDEBAR_WIDTH
|
|
50
|
+
},
|
|
51
|
+
closed: {
|
|
52
|
+
width: 0
|
|
53
|
+
},
|
|
54
|
+
mobileOpen: {
|
|
55
|
+
width: '100vw'
|
|
56
|
+
}
|
|
57
|
+
};
|
|
44
58
|
function ComplementaryAreaFill({
|
|
59
|
+
activeArea,
|
|
60
|
+
isActive,
|
|
45
61
|
scope,
|
|
46
62
|
children,
|
|
47
63
|
className,
|
|
48
64
|
id
|
|
49
65
|
}) {
|
|
66
|
+
const disableMotion = (0, _compose.useReducedMotion)();
|
|
67
|
+
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
68
|
+
// This is used to delay the exit animation to the next tick.
|
|
69
|
+
// The reason this is done is to allow us to apply the right transition properties
|
|
70
|
+
// When we switch from an open sidebar to another open sidebar.
|
|
71
|
+
// we don't want to animate in this case.
|
|
72
|
+
const previousActiveArea = (0, _compose.usePrevious)(activeArea);
|
|
73
|
+
const previousIsActive = (0, _compose.usePrevious)(isActive);
|
|
74
|
+
const [, setState] = (0, _element.useState)({});
|
|
75
|
+
(0, _element.useEffect)(() => {
|
|
76
|
+
setState({});
|
|
77
|
+
}, [isActive]);
|
|
78
|
+
const transition = {
|
|
79
|
+
type: 'tween',
|
|
80
|
+
duration: disableMotion || isMobileViewport || !!previousActiveArea && !!activeArea && activeArea !== previousActiveArea ? 0 : ANIMATION_DURATION,
|
|
81
|
+
ease: [0.6, 0, 0.4, 1]
|
|
82
|
+
};
|
|
50
83
|
return (0, _react.createElement)(_components.Fill, {
|
|
51
84
|
name: `ComplementaryArea/${scope}`
|
|
85
|
+
}, (0, _react.createElement)(_components.__unstableAnimatePresence, {
|
|
86
|
+
initial: false
|
|
87
|
+
}, (previousIsActive || isActive) && (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
88
|
+
variants: variants,
|
|
89
|
+
initial: "closed",
|
|
90
|
+
animate: isMobileViewport ? 'mobileOpen' : 'open',
|
|
91
|
+
exit: "closed",
|
|
92
|
+
transition: transition
|
|
52
93
|
}, (0, _react.createElement)("div", {
|
|
53
94
|
id: id,
|
|
54
|
-
className: className
|
|
55
|
-
|
|
95
|
+
className: className,
|
|
96
|
+
style: {
|
|
97
|
+
width: isMobileViewport ? '100vw' : SIDEBAR_WIDTH
|
|
98
|
+
}
|
|
99
|
+
}, children))));
|
|
56
100
|
}
|
|
57
101
|
function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) {
|
|
58
102
|
const previousIsSmall = (0, _element.useRef)(false);
|
|
@@ -107,6 +151,11 @@ function ComplementaryArea({
|
|
|
107
151
|
toggleShortcut,
|
|
108
152
|
isActiveByDefault
|
|
109
153
|
}) {
|
|
154
|
+
// This state is used to delay the rendering of the Fill
|
|
155
|
+
// until the initial effect runs.
|
|
156
|
+
// This prevents the animation from running on mount if
|
|
157
|
+
// the complementary area is active by default.
|
|
158
|
+
const [isReady, setIsReady] = (0, _element.useState)(false);
|
|
110
159
|
const {
|
|
111
160
|
isLoading,
|
|
112
161
|
isActive,
|
|
@@ -150,7 +199,11 @@ function ComplementaryArea({
|
|
|
150
199
|
} else if (activeArea === undefined && isSmall) {
|
|
151
200
|
disableComplementaryArea(scope, identifier);
|
|
152
201
|
}
|
|
202
|
+
setIsReady(true);
|
|
153
203
|
}, [activeArea, isActiveByDefault, scope, identifier, isSmall, enableComplementaryArea, disableComplementaryArea]);
|
|
204
|
+
if (!isReady) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
154
207
|
return (0, _react.createElement)(_react.Fragment, null, isPinnable && (0, _react.createElement)(_pinnedItems.default, {
|
|
155
208
|
scope: scope
|
|
156
209
|
}, isPinned && (0, _react.createElement)(_complementaryAreaToggle.default, {
|
|
@@ -168,7 +221,9 @@ function ComplementaryArea({
|
|
|
168
221
|
target: name,
|
|
169
222
|
scope: scope,
|
|
170
223
|
icon: icon
|
|
171
|
-
}, title),
|
|
224
|
+
}, title), (0, _react.createElement)(ComplementaryAreaFill, {
|
|
225
|
+
activeArea: activeArea,
|
|
226
|
+
isActive: isActive,
|
|
172
227
|
className: (0, _classnames.default)('interface-complementary-area', className),
|
|
173
228
|
scope: scope,
|
|
174
229
|
id: identifier.replace('/', ':')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_data","_i18n","_icons","_element","_viewport","_preferences","_complementaryAreaHeader","_complementaryAreaMoreMenuItem","_complementaryAreaToggle","_complementaryAreaContext","_pinnedItems","_store","ComplementaryAreaSlot","scope","props","_react","createElement","Slot","name","ComplementaryAreaFill","children","className","id","Fill","useAdjustComplementaryListener","identifier","activeArea","isActive","isSmall","previousIsSmall","useRef","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","useDispatch","interfaceStore","useEffect","current","ComplementaryArea","closeLabel","__","header","headerClassName","icon","isPinnable","panelClassName","smallScreenTitle","title","toggleShortcut","isActiveByDefault","isLoading","isPinned","isLarge","showIconLabels","useSelect","select","getActiveComplementaryArea","isComplementaryAreaLoading","isItemPinned","get","preferencesStore","_activeArea","viewportStore","isViewportMatch","pinItem","unpinItem","undefined","Fragment","default","isPressed","label","check","showTooltip","variant","size","target","classnames","replace","onClose","toggleButtonProps","shortcut","Button","starFilled","starEmpty","onClick","Panel","ComplementaryAreaWrapped","withComplementaryAreaContext","_default","exports"],"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Panel, Slot, Fill } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { check, starEmpty, starFilled } from '@wordpress/icons';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as viewportStore } from '@wordpress/viewport';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaHeader from '../complementary-area-header';\nimport ComplementaryAreaMoreMenuItem from '../complementary-area-more-menu-item';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport withComplementaryAreaContext from '../complementary-area-context';\nimport PinnedItems from '../pinned-items';\nimport { store as interfaceStore } from '../../store';\n\nfunction ComplementaryAreaSlot( { scope, ...props } ) {\n\treturn <Slot name={ `ComplementaryArea/${ scope }` } { ...props } />;\n}\n\nfunction ComplementaryAreaFill( { scope, children, className, id } ) {\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<div id={ id } className={ className }>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</Fill>\n\t);\n}\n\nfunction useAdjustComplementaryListener(\n\tscope,\n\tidentifier,\n\tactiveArea,\n\tisActive,\n\tisSmall\n) {\n\tconst previousIsSmall = useRef( false );\n\tconst shouldOpenWhenNotSmall = useRef( false );\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from\n\t\t// a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size\n\t\t\t// goes from small to big.\n\t\t\tshouldOpenWhenNotSmall.current = true;\n\t\t} else if (\n\t\t\t// If there is a flag indicating the complementary area should be\n\t\t\t// enabled when we go from small to big window size and we are going\n\t\t\t// from a small to big window size.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\t! isSmall &&\n\t\t\tpreviousIsSmall.current\n\t\t) {\n\t\t\t// Remove the flag indicating the complementary area should be\n\t\t\t// enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if (\n\t\t\t// If the flag is indicating the current complementary should be\n\t\t\t// reopened but another complementary area becomes active, remove\n\t\t\t// the flag.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\tactiveArea &&\n\t\t\tactiveArea !== identifier\n\t\t) {\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t}\n\t\tif ( isSmall !== previousIsSmall.current ) {\n\t\t\tpreviousIsSmall.current = isSmall;\n\t\t}\n\t}, [\n\t\tisActive,\n\t\tisSmall,\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tdisableComplementaryArea,\n\t\tenableComplementaryArea,\n\t] );\n}\n\nfunction ComplementaryArea( {\n\tchildren,\n\tclassName,\n\tcloseLabel = __( 'Close plugin' ),\n\tidentifier,\n\theader,\n\theaderClassName,\n\ticon,\n\tisPinnable = true,\n\tpanelClassName,\n\tscope,\n\tname,\n\tsmallScreenTitle,\n\ttitle,\n\ttoggleShortcut,\n\tisActiveByDefault,\n} ) {\n\tconst {\n\t\tisLoading,\n\t\tisActive,\n\t\tisPinned,\n\t\tactiveArea,\n\t\tisSmall,\n\t\tisLarge,\n\t\tshowIconLabels,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetActiveComplementaryArea,\n\t\t\t\tisComplementaryAreaLoading,\n\t\t\t\tisItemPinned,\n\t\t\t} = select( interfaceStore );\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\n\t\t\treturn {\n\t\t\t\tisLoading: isComplementaryAreaLoading( scope ),\n\t\t\t\tisActive: _activeArea === identifier,\n\t\t\t\tisPinned: isItemPinned( scope, identifier ),\n\t\t\t\tactiveArea: _activeArea,\n\t\t\t\tisSmall: select( viewportStore ).isViewportMatch( '< medium' ),\n\t\t\t\tisLarge: select( viewportStore ).isViewportMatch( 'large' ),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t},\n\t\t[ identifier, scope ]\n\t);\n\tuseAdjustComplementaryListener(\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tisActive,\n\t\tisSmall\n\t);\n\tconst {\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t\tpinItem,\n\t\tunpinItem,\n\t} = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Set initial visibility: For large screens, enable if it's active by\n\t\t// default. For small screens, always initially disable.\n\t\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if ( activeArea === undefined && isSmall ) {\n\t\t\tdisableComplementaryArea( scope, identifier );\n\t\t}\n\t}, [\n\t\tactiveArea,\n\t\tisActiveByDefault,\n\t\tscope,\n\t\tidentifier,\n\t\tisSmall,\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t] );\n\n\treturn (\n\t\t<>\n\t\t\t{ isPinnable && (\n\t\t\t\t<PinnedItems scope={ scope }>\n\t\t\t\t\t{ isPinned && (\n\t\t\t\t\t\t<ComplementaryAreaToggle\n\t\t\t\t\t\t\tscope={ scope }\n\t\t\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisActive && ( ! showIconLabels || isLarge )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-expanded={ isActive }\n\t\t\t\t\t\t\taria-disabled={ isLoading }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\ticon={ showIconLabels ? check : icon }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PinnedItems>\n\t\t\t) }\n\t\t\t{ name && isPinnable && (\n\t\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\t\ttarget={ name }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t\t) }\n\t\t\t{ isActive && (\n\t\t\t\t<ComplementaryAreaFill\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'interface-complementary-area',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\tid={ identifier.replace( '/', ':' ) }\n\t\t\t\t>\n\t\t\t\t\t<ComplementaryAreaHeader\n\t\t\t\t\t\tclassName={ headerClassName }\n\t\t\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\t\t\tonClose={ () => disableComplementaryArea( scope ) }\n\t\t\t\t\t\tsmallScreenTitle={ smallScreenTitle }\n\t\t\t\t\t\ttoggleButtonProps={ {\n\t\t\t\t\t\t\tlabel: closeLabel,\n\t\t\t\t\t\t\tshortcut: toggleShortcut,\n\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\tidentifier,\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\t\t<>\n\t\t\t\t\t\t\t\t<h2 className=\"interface-complementary-area-header__title\">\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t\t{ isPinnable && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tclassName=\"interface-complementary-area__pin-unpin-item\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisPinned ? starFilled : starEmpty\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\tisPinned\n\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Unpin from toolbar' )\n\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Pin to toolbar' )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t( isPinned ? unpinItem : pinItem )(\n\t\t\t\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisPressed={ isPinned }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ isPinned }\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</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ComplementaryAreaHeader>\n\t\t\t\t\t<Panel className={ panelClassName }>{ children }</Panel>\n\t\t\t\t</ComplementaryAreaFill>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst ComplementaryAreaWrapped =\n\twithComplementaryAreaContext( ComplementaryArea );\n\nComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryAreaWrapped;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,wBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,8BAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,wBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,yBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,YAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAQA,SAASc,qBAAqBA,CAAE;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAG;EACrD,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACjB,WAAA,CAAAkB,IAAI;IAACC,IAAI,EAAI,qBAAqBL,KAAO,EAAG;IAAA,GAAMC;EAAK,CAAI,CAAC;AACrE;AAEA,SAASK,qBAAqBA,CAAE;EAAEN,KAAK;EAAEO,QAAQ;EAAEC,SAAS;EAAEC;AAAG,CAAC,EAAG;EACpE,OACC,IAAAP,MAAA,CAAAC,aAAA,EAACjB,WAAA,CAAAwB,IAAI;IAACL,IAAI,EAAI,qBAAqBL,KAAO;EAAG,GAC5C,IAAAE,MAAA,CAAAC,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KAAK;IAAChE,SAAS,EAAGwB;EAAgB,GAAGzB,QAAiB,CACjC,CAEvB,CAAC;AAEL;AAEA,MAAMkE,wBAAwB,GAC7B,IAAAC,iCAA4B,EAAEjD,iBAAkB,CAAC;AAElDgD,wBAAwB,CAACrE,IAAI,GAAGL,qBAAqB;AAAC,IAAA4E,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEvCkB,wBAAwB"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_data","_i18n","_icons","_element","_viewport","_preferences","_compose","_complementaryAreaHeader","_complementaryAreaMoreMenuItem","_complementaryAreaToggle","_complementaryAreaContext","_pinnedItems","_store","ANIMATION_DURATION","ComplementaryAreaSlot","scope","props","_react","createElement","Slot","name","SIDEBAR_WIDTH","variants","open","width","closed","mobileOpen","ComplementaryAreaFill","activeArea","isActive","children","className","id","disableMotion","useReducedMotion","isMobileViewport","useViewportMatch","previousActiveArea","usePrevious","previousIsActive","setState","useState","useEffect","transition","type","duration","ease","Fill","__unstableAnimatePresence","initial","__unstableMotion","div","animate","exit","style","useAdjustComplementaryListener","identifier","isSmall","previousIsSmall","useRef","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","useDispatch","interfaceStore","current","ComplementaryArea","closeLabel","__","header","headerClassName","icon","isPinnable","panelClassName","smallScreenTitle","title","toggleShortcut","isActiveByDefault","isReady","setIsReady","isLoading","isPinned","isLarge","showIconLabels","useSelect","select","getActiveComplementaryArea","isComplementaryAreaLoading","isItemPinned","get","preferencesStore","_activeArea","viewportStore","isViewportMatch","pinItem","unpinItem","undefined","Fragment","default","isPressed","label","check","showTooltip","variant","size","target","classnames","replace","onClose","toggleButtonProps","shortcut","Button","starFilled","starEmpty","onClick","Panel","ComplementaryAreaWrapped","withComplementaryAreaContext","_default","exports"],"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tPanel,\n\tSlot,\n\tFill,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { check, starEmpty, starFilled } from '@wordpress/icons';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { store as viewportStore } from '@wordpress/viewport';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tusePrevious,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaHeader from '../complementary-area-header';\nimport ComplementaryAreaMoreMenuItem from '../complementary-area-more-menu-item';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport withComplementaryAreaContext from '../complementary-area-context';\nimport PinnedItems from '../pinned-items';\nimport { store as interfaceStore } from '../../store';\n\nconst ANIMATION_DURATION = 0.3;\n\nfunction ComplementaryAreaSlot( { scope, ...props } ) {\n\treturn <Slot name={ `ComplementaryArea/${ scope }` } { ...props } />;\n}\n\nconst SIDEBAR_WIDTH = 280;\nconst variants = {\n\topen: { width: SIDEBAR_WIDTH },\n\tclosed: { width: 0 },\n\tmobileOpen: { width: '100vw' },\n};\n\nfunction ComplementaryAreaFill( {\n\tactiveArea,\n\tisActive,\n\tscope,\n\tchildren,\n\tclassName,\n\tid,\n} ) {\n\tconst disableMotion = useReducedMotion();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\t// This is used to delay the exit animation to the next tick.\n\t// The reason this is done is to allow us to apply the right transition properties\n\t// When we switch from an open sidebar to another open sidebar.\n\t// we don't want to animate in this case.\n\tconst previousActiveArea = usePrevious( activeArea );\n\tconst previousIsActive = usePrevious( isActive );\n\tconst [ , setState ] = useState( {} );\n\tuseEffect( () => {\n\t\tsetState( {} );\n\t}, [ isActive ] );\n\tconst transition = {\n\t\ttype: 'tween',\n\t\tduration:\n\t\t\tdisableMotion ||\n\t\t\tisMobileViewport ||\n\t\t\t( !! previousActiveArea &&\n\t\t\t\t!! activeArea &&\n\t\t\t\tactiveArea !== previousActiveArea )\n\t\t\t\t? 0\n\t\t\t\t: ANIMATION_DURATION,\n\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t};\n\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t{ ( previousIsActive || isActive ) && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tvariants={ variants }\n\t\t\t\t\t\tinitial=\"closed\"\n\t\t\t\t\t\tanimate={ isMobileViewport ? 'mobileOpen' : 'open' }\n\t\t\t\t\t\texit=\"closed\"\n\t\t\t\t\t\ttransition={ transition }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tid={ id }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\twidth: isMobileViewport\n\t\t\t\t\t\t\t\t\t? '100vw'\n\t\t\t\t\t\t\t\t\t: SIDEBAR_WIDTH,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t</Fill>\n\t);\n}\n\nfunction useAdjustComplementaryListener(\n\tscope,\n\tidentifier,\n\tactiveArea,\n\tisActive,\n\tisSmall\n) {\n\tconst previousIsSmall = useRef( false );\n\tconst shouldOpenWhenNotSmall = useRef( false );\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from\n\t\t// a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size\n\t\t\t// goes from small to big.\n\t\t\tshouldOpenWhenNotSmall.current = true;\n\t\t} else if (\n\t\t\t// If there is a flag indicating the complementary area should be\n\t\t\t// enabled when we go from small to big window size and we are going\n\t\t\t// from a small to big window size.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\t! isSmall &&\n\t\t\tpreviousIsSmall.current\n\t\t) {\n\t\t\t// Remove the flag indicating the complementary area should be\n\t\t\t// enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if (\n\t\t\t// If the flag is indicating the current complementary should be\n\t\t\t// reopened but another complementary area becomes active, remove\n\t\t\t// the flag.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\tactiveArea &&\n\t\t\tactiveArea !== identifier\n\t\t) {\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t}\n\t\tif ( isSmall !== previousIsSmall.current ) {\n\t\t\tpreviousIsSmall.current = isSmall;\n\t\t}\n\t}, [\n\t\tisActive,\n\t\tisSmall,\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tdisableComplementaryArea,\n\t\tenableComplementaryArea,\n\t] );\n}\n\nfunction ComplementaryArea( {\n\tchildren,\n\tclassName,\n\tcloseLabel = __( 'Close plugin' ),\n\tidentifier,\n\theader,\n\theaderClassName,\n\ticon,\n\tisPinnable = true,\n\tpanelClassName,\n\tscope,\n\tname,\n\tsmallScreenTitle,\n\ttitle,\n\ttoggleShortcut,\n\tisActiveByDefault,\n} ) {\n\t// This state is used to delay the rendering of the Fill\n\t// until the initial effect runs.\n\t// This prevents the animation from running on mount if\n\t// the complementary area is active by default.\n\tconst [ isReady, setIsReady ] = useState( false );\n\tconst {\n\t\tisLoading,\n\t\tisActive,\n\t\tisPinned,\n\t\tactiveArea,\n\t\tisSmall,\n\t\tisLarge,\n\t\tshowIconLabels,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetActiveComplementaryArea,\n\t\t\t\tisComplementaryAreaLoading,\n\t\t\t\tisItemPinned,\n\t\t\t} = select( interfaceStore );\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\n\t\t\treturn {\n\t\t\t\tisLoading: isComplementaryAreaLoading( scope ),\n\t\t\t\tisActive: _activeArea === identifier,\n\t\t\t\tisPinned: isItemPinned( scope, identifier ),\n\t\t\t\tactiveArea: _activeArea,\n\t\t\t\tisSmall: select( viewportStore ).isViewportMatch( '< medium' ),\n\t\t\t\tisLarge: select( viewportStore ).isViewportMatch( 'large' ),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t},\n\t\t[ identifier, scope ]\n\t);\n\tuseAdjustComplementaryListener(\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tisActive,\n\t\tisSmall\n\t);\n\tconst {\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t\tpinItem,\n\t\tunpinItem,\n\t} = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Set initial visibility: For large screens, enable if it's active by\n\t\t// default. For small screens, always initially disable.\n\t\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if ( activeArea === undefined && isSmall ) {\n\t\t\tdisableComplementaryArea( scope, identifier );\n\t\t}\n\t\tsetIsReady( true );\n\t}, [\n\t\tactiveArea,\n\t\tisActiveByDefault,\n\t\tscope,\n\t\tidentifier,\n\t\tisSmall,\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t] );\n\n\tif ( ! isReady ) {\n\t\treturn;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isPinnable && (\n\t\t\t\t<PinnedItems scope={ scope }>\n\t\t\t\t\t{ isPinned && (\n\t\t\t\t\t\t<ComplementaryAreaToggle\n\t\t\t\t\t\t\tscope={ scope }\n\t\t\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisActive && ( ! showIconLabels || isLarge )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-expanded={ isActive }\n\t\t\t\t\t\t\taria-disabled={ isLoading }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\ticon={ showIconLabels ? check : icon }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PinnedItems>\n\t\t\t) }\n\t\t\t{ name && isPinnable && (\n\t\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\t\ttarget={ name }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t\t) }\n\t\t\t<ComplementaryAreaFill\n\t\t\t\tactiveArea={ activeArea }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'interface-complementary-area',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\tscope={ scope }\n\t\t\t\tid={ identifier.replace( '/', ':' ) }\n\t\t\t>\n\t\t\t\t<ComplementaryAreaHeader\n\t\t\t\t\tclassName={ headerClassName }\n\t\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\t\tonClose={ () => disableComplementaryArea( scope ) }\n\t\t\t\t\tsmallScreenTitle={ smallScreenTitle }\n\t\t\t\t\ttoggleButtonProps={ {\n\t\t\t\t\t\tlabel: closeLabel,\n\t\t\t\t\t\tshortcut: toggleShortcut,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tidentifier,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ header || (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h2 className=\"interface-complementary-area-header__title\">\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t{ isPinnable && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"interface-complementary-area__pin-unpin-item\"\n\t\t\t\t\t\t\t\t\ticon={ isPinned ? starFilled : starEmpty }\n\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\tisPinned\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Unpin from toolbar' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Pin to toolbar' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t( isPinned ? unpinItem : pinItem )(\n\t\t\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tisPressed={ isPinned }\n\t\t\t\t\t\t\t\t\taria-expanded={ isPinned }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ComplementaryAreaHeader>\n\t\t\t\t<Panel className={ panelClassName }>{ children }</Panel>\n\t\t\t</ComplementaryAreaFill>\n\t\t</>\n\t);\n}\n\nconst ComplementaryAreaWrapped =\n\twithComplementaryAreaContext( ComplementaryArea );\n\nComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryAreaWrapped;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,G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ACtB,iBAAgBA;EAAU,CAC1B,CAED,CAEqB,CAAC,EAC1B,IAAAhE,MAAA,CAAAC,aAAA,EAACnB,WAAA,CAAAoH,KAAK;IAACpF,SAAS,EAAG0C;EAAgB,GAAG3C,QAAiB,CACjC,CACtB,CAAC;AAEL;AAEA,MAAMsF,wBAAwB,GAC7B,IAAAC,iCAA4B,EAAEnD,iBAAkB,CAAC;AAElDkD,wBAAwB,CAACjG,IAAI,GAAGL,qBAAqB;AAAC,IAAAwG,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEvCkB,wBAAwB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_plugins","require","_default","exports","default","withPluginContext","context","ownProps","icon","identifier","name"],"sources":["@wordpress/interface/src/components/complementary-area-context/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withPluginContext } from '@wordpress/plugins';\n\nexport default withPluginContext( ( context, ownProps ) => {\n\treturn {\n\t\ticon: ownProps.icon || context.icon,\n\t\tidentifier:\n\t\t\townProps.identifier || `${ context.name }/${ ownProps.name }`,\n\t};\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe,IAAAC,0BAAiB,EAAE,CAAEC,OAAO,EAAEC,QAAQ,KAAM;EAC1D,OAAO;IACNC,IAAI,EAAED,QAAQ,CAACC,IAAI,IAAIF,OAAO,CAACE,IAAI;IACnCC,UAAU,EACTF,QAAQ,CAACE,UAAU,IAAK,GAAGH,OAAO,CAACI,IAAM,IAAIH,QAAQ,CAACG,IAAM;EAC9D,CAAC;AACF,CAAE,CAAC"}
|
|
1
|
+
{"version":3,"names":["_plugins","require","_default","exports","default","withPluginContext","context","ownProps","icon","identifier","name"],"sources":["@wordpress/interface/src/components/complementary-area-context/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withPluginContext } from '@wordpress/plugins';\n\nexport default withPluginContext( ( context, ownProps ) => {\n\treturn {\n\t\ticon: ownProps.icon || context.icon,\n\t\tidentifier:\n\t\t\townProps.identifier || `${ context.name }/${ ownProps.name }`,\n\t};\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe,IAAAC,0BAAiB,EAAE,CAAEC,OAAO,EAAEC,QAAQ,KAAM;EAC1D,OAAO;IACNC,IAAI,EAAED,QAAQ,CAACC,IAAI,IAAIF,OAAO,CAACE,IAAI;IACnCC,UAAU,EACTF,QAAQ,CAACE,UAAU,IAAK,GAAGH,OAAO,CAACI,IAAM,IAAIH,QAAQ,CAACG,IAAM;EAC9D,CAAC;AACF,CAAE,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_icons","_complementaryAreaToggle","ComplementaryAreaHeader","smallScreenTitle","children","className","toggleButtonProps","toggleButton","_react","createElement","default","icon","closeSmall","Fragment","classnames","tabIndex","_default","exports"],"sources":["@wordpress/interface/src/components/complementary-area-header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tsmallScreenTitle,\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<>\n\t\t\t<div className=\"components-panel__header interface-complementary-area-header__small\">\n\t\t\t\t{ smallScreenTitle && (\n\t\t\t\t\t<h2 className=\"interface-complementary-area-header__small-title\">\n\t\t\t\t\t\t{ smallScreenTitle }\n\t\t\t\t\t</h2>\n\t\t\t\t) }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'components-panel__header',\n\t\t\t\t\t'interface-complementary-area-header',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,wBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAMG,uBAAuB,GAAGA,CAAE;EACjCC,gBAAgB;EAChBC,QAAQ;EACRC,SAAS;EACTC;AACD,CAAC,KAAM;EACN,MAAMC,YAAY,GACjB,IAAAC,MAAA,CAAAC,aAAA,EAACR,wBAAA,CAAAS,OAAuB;IAACC,IAAI,EAAGC,iBAAY;IAAA,GAAMN;EAAiB,CAAI,CACvE;EACD,OACC,IAAAE,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAK,QAAA,QACC,IAAAL,MAAA,CAAAC,aAAA;IAAKJ,SAAS,EAAC;EAAqE,GACjFF,gBAAgB,IACjB,IAAAK,MAAA,CAAAC,aAAA;IAAIJ,SAAS,EAAC;EAAkD,GAC7DF,gBACC,CACJ,EACCI,YACE,CAAC,EACN,IAAAC,MAAA,CAAAC,aAAA;IACCJ,SAAS,EAAG,IAAAS,mBAAU,EACrB,0BAA0B,EAC1B,qCAAqC,EACrCT,SACD,CAAG;IACHU,QAAQ,EAAG,CAAC;EAAG,GAEbX,QAAQ,EACRG,YACE,CACJ,CAAC;AAEL,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAP,OAAA,GAEaR,uBAAuB"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_icons","_complementaryAreaToggle","ComplementaryAreaHeader","smallScreenTitle","children","className","toggleButtonProps","toggleButton","_react","createElement","default","icon","closeSmall","Fragment","classnames","tabIndex","_default","exports"],"sources":["@wordpress/interface/src/components/complementary-area-header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tsmallScreenTitle,\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<>\n\t\t\t<div className=\"components-panel__header interface-complementary-area-header__small\">\n\t\t\t\t{ smallScreenTitle && (\n\t\t\t\t\t<h2 className=\"interface-complementary-area-header__small-title\">\n\t\t\t\t\t\t{ smallScreenTitle }\n\t\t\t\t\t</h2>\n\t\t\t\t) }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'components-panel__header',\n\t\t\t\t\t'interface-complementary-area-header',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,wBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAMG,uBAAuB,GAAGA,CAAE;EACjCC,gBAAgB;EAChBC,QAAQ;EACRC,SAAS;EACTC;AACD,CAAC,KAAM;EACN,MAAMC,YAAY,GACjB,IAAAC,MAAA,CAAAC,aAAA,EAACR,wBAAA,CAAAS,OAAuB;IAACC,IAAI,EAAGC,iBAAY;IAAA,GAAMN;EAAiB,CAAI,CACvE;EACD,OACC,IAAAE,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAK,QAAA,QACC,IAAAL,MAAA,CAAAC,aAAA;IAAKJ,SAAS,EAAC;EAAqE,GACjFF,gBAAgB,IACjB,IAAAK,MAAA,CAAAC,aAAA;IAAIJ,SAAS,EAAC;EAAkD,GAC7DF,gBACC,CACJ,EACCI,YACE,CAAC,EACN,IAAAC,MAAA,CAAAC,aAAA;IACCJ,SAAS,EAAG,IAAAS,mBAAU,EACrB,0BAA0B,EAC1B,qCAAqC,EACrCT,SACD,CAAG;IACHU,QAAQ,EAAG,CAAC;EAAG,GAEbX,QAAQ,EACRG,YACE,CACJ,CAAC;AAEL,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAP,OAAA,GAEaR,uBAAuB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_components","_complementaryAreaToggle","_interopRequireDefault","_actionItem","PluginsMenuItem","__unstableExplicitMenuItem","__unstableTarget","restProps","_react","createElement","MenuItem","ComplementaryAreaMoreMenuItem","scope","target","props","default","as","toggleProps","name","role","selectedIcon","check"],"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { check } from '@wordpress/icons';\nimport { MenuItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport ActionItem from '../action-item';\n\nconst PluginsMenuItem = ( {\n\t// Menu item is marked with unstable prop for backward compatibility.\n\t// They are removed so they don't leak to DOM elements.\n\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t__unstableExplicitMenuItem,\n\t__unstableTarget,\n\t...restProps\n} ) => <MenuItem { ...restProps } />;\n\nexport default function ComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t__unstableExplicitMenuItem,\n\t...props\n} ) {\n\treturn (\n\t\t<ComplementaryAreaToggle\n\t\t\tas={ ( toggleProps ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ActionItem\n\t\t\t\t\t\t__unstableExplicitMenuItem={\n\t\t\t\t\t\t\t__unstableExplicitMenuItem\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableTarget={ `${ scope }/${ target }` }\n\t\t\t\t\t\tas={ PluginsMenuItem }\n\t\t\t\t\t\tname={ `${ scope }/plugin-more-menu` }\n\t\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tselectedIcon={ check }\n\t\t\tname={ target }\n\t\t\tscope={ scope }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,wBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAMK,eAAe,GAAGA,CAAE;EACzB;EACA;EACA;EACAC,0BAA0B;EAC1BC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,KAAM,IAAAC,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,QAAQ;EAAA,GAAMH;AAAS,CAAI,CAAC;AAErB,SAASI,6BAA6BA,CAAE;EACtDC,KAAK;EACLC,MAAM;EACNR,0BAA0B;EAC1B,GAAGS;AACJ,CAAC,EAAG;EACH,OACC,IAAAN,MAAA,CAAAC,aAAA,EAACR,wBAAA,CAAAc,OAAuB;IACvBC,EAAE,EAAKC,WAAW,IAAM;MACvB,OACC,IAAAT,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAY,OAAU;QACVV,0BAA0B,EACzBA,0BACA;QACDC,gBAAgB,EAAI,GAAGM,KAAO,IAAIC,MAAQ,EAAG;QAC7CG,EAAE,EAAGZ,eAAiB;QACtBc,IAAI,EAAI,GAAGN,KAAO,mBAAoB;QAAA,GACjCK;MAAW,CAChB,CAAC;IAEJ,CAAG;IACHE,IAAI,EAAC,kBAAkB;IACvBC,YAAY,EAAGC,YAAO;IACtBH,IAAI,EAAGL,MAAQ;IACfD,KAAK,EAAGA,KAAO;IAAA,GACVE;EAAK,CACV,CAAC;AAEJ"}
|
|
1
|
+
{"version":3,"names":["_icons","require","_components","_complementaryAreaToggle","_interopRequireDefault","_actionItem","PluginsMenuItem","__unstableExplicitMenuItem","__unstableTarget","restProps","_react","createElement","MenuItem","ComplementaryAreaMoreMenuItem","scope","target","props","default","as","toggleProps","name","role","selectedIcon","check"],"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { check } from '@wordpress/icons';\nimport { MenuItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport ActionItem from '../action-item';\n\nconst PluginsMenuItem = ( {\n\t// Menu item is marked with unstable prop for backward compatibility.\n\t// They are removed so they don't leak to DOM elements.\n\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t__unstableExplicitMenuItem,\n\t__unstableTarget,\n\t...restProps\n} ) => <MenuItem { ...restProps } />;\n\nexport default function ComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t__unstableExplicitMenuItem,\n\t...props\n} ) {\n\treturn (\n\t\t<ComplementaryAreaToggle\n\t\t\tas={ ( toggleProps ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ActionItem\n\t\t\t\t\t\t__unstableExplicitMenuItem={\n\t\t\t\t\t\t\t__unstableExplicitMenuItem\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableTarget={ `${ scope }/${ target }` }\n\t\t\t\t\t\tas={ PluginsMenuItem }\n\t\t\t\t\t\tname={ `${ scope }/plugin-more-menu` }\n\t\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tselectedIcon={ check }\n\t\t\tname={ target }\n\t\t\tscope={ scope }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,wBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAMK,eAAe,GAAGA,CAAE;EACzB;EACA;EACA;EACAC,0BAA0B;EAC1BC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,KAAM,IAAAC,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,QAAQ;EAAA,GAAMH;AAAS,CAAI,CAAC;AAErB,SAASI,6BAA6BA,CAAE;EACtDC,KAAK;EACLC,MAAM;EACNR,0BAA0B;EAC1B,GAAGS;AACJ,CAAC,EAAG;EACH,OACC,IAAAN,MAAA,CAAAC,aAAA,EAACR,wBAAA,CAAAc,OAAuB;IACvBC,EAAE,EAAKC,WAAW,IAAM;MACvB,OACC,IAAAT,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAY,OAAU;QACVV,0BAA0B,EACzBA,0BACA;QACDC,gBAAgB,EAAI,GAAGM,KAAO,IAAIC,MAAQ,EAAG;QAC7CG,EAAE,EAAGZ,eAAiB;QACtBc,IAAI,EAAI,GAAGN,KAAO,mBAAoB;QAAA,GACjCK;MAAW,CAChB,CAAC;IAEJ,CAAG;IACHE,IAAI,EAAC,kBAAkB;IACvBC,YAAY,EAAGC,YAAO;IACtBH,IAAI,EAAGL,MAAQ;IACfD,KAAK,EAAGA,KAAO;IAAA,GACVE;EAAK,CACV,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_data","_store","_complementaryAreaContext","_interopRequireDefault","ComplementaryAreaToggle","as","Button","scope","identifier","icon","selectedIcon","name","props","ComponentToUse","isSelected","useSelect","select","interfaceStore","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea","useDispatch","_react","createElement","replace","onClick","_default","exports","default","complementaryAreaContext"],"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\nimport complementaryAreaContext from '../complementary-area-context';\n\nfunction ComplementaryAreaToggle( {\n\tas = Button,\n\tscope,\n\tidentifier,\n\ticon,\n\tselectedIcon,\n\tname,\n\t...props\n} ) {\n\tconst ComponentToUse = as;\n\tconst isSelected = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( scope ) ===\n\t\t\tidentifier,\n\t\t[ identifier, scope ]\n\t);\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\treturn (\n\t\t<ComponentToUse\n\t\t\ticon={ selectedIcon && isSelected ? selectedIcon : icon }\n\t\t\taria-controls={ identifier.replace( '/', ':' ) }\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isSelected ) {\n\t\t\t\t\tdisableComplementaryArea( scope );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( scope, identifier );\n\t\t\t\t}\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default complementaryAreaContext( ComplementaryAreaToggle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASK,uBAAuBA,CAAE;EACjCC,EAAE,GAAGC,kBAAM;EACXC,KAAK;EACLC,UAAU;EACVC,IAAI;EACJC,YAAY;EACZC,IAAI;EACJ,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,cAAc,GAAGR,EAAE;EACzB,MAAMS,UAAU,GAAG,IAAAC,eAAS,EACzBC,MAAM,IACPA,MAAM,CAAEC,YAAe,CAAC,CAACC,0BAA0B,CAAEX,KAAM,CAAC,KAC5DC,UAAU,EACX,CAAEA,UAAU,EAAED,KAAK,CACpB,CAAC;EACD,MAAM;IAAEY,uBAAuB;IAAEC;EAAyB,CAAC,GAC1D,IAAAC,iBAAW,EAAEJ,YAAe,CAAC;EAC9B,OACC,IAAAK,MAAA,CAAAC,aAAA,EAACV,cAAc;IACdJ,IAAI,EAAGC,YAAY,IAAII,UAAU,GAAGJ,YAAY,GAAGD,IAAM;IACzD,iBAAgBD,UAAU,CAACgB,OAAO,CAAE,GAAG,EAAE,GAAI,CAAG;IAChDC,OAAO,EAAGA,CAAA,KAAM;MACf,IAAKX,UAAU,EAAG;QACjBM,wBAAwB,CAAEb,KAAM,CAAC;MAClC,CAAC,MAAM;QACNY,uBAAuB,CAAEZ,KAAK,EAAEC,UAAW,CAAC;MAC7C;IACD,CAAG;IAAA,GACEI;EAAK,CACV,CAAC;AAEJ;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,iCAAwB,EAAEzB,uBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"names":["_components","require","_data","_store","_complementaryAreaContext","_interopRequireDefault","ComplementaryAreaToggle","as","Button","scope","identifier","icon","selectedIcon","name","props","ComponentToUse","isSelected","useSelect","select","interfaceStore","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea","useDispatch","_react","createElement","replace","onClick","_default","exports","default","complementaryAreaContext"],"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\nimport complementaryAreaContext from '../complementary-area-context';\n\nfunction ComplementaryAreaToggle( {\n\tas = Button,\n\tscope,\n\tidentifier,\n\ticon,\n\tselectedIcon,\n\tname,\n\t...props\n} ) {\n\tconst ComponentToUse = as;\n\tconst isSelected = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( scope ) ===\n\t\t\tidentifier,\n\t\t[ identifier, scope ]\n\t);\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\treturn (\n\t\t<ComponentToUse\n\t\t\ticon={ selectedIcon && isSelected ? selectedIcon : icon }\n\t\t\taria-controls={ identifier.replace( '/', ':' ) }\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isSelected ) {\n\t\t\t\t\tdisableComplementaryArea( scope );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( scope, identifier );\n\t\t\t\t}\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default complementaryAreaContext( ComplementaryAreaToggle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASK,uBAAuBA,CAAE;EACjCC,EAAE,GAAGC,kBAAM;EACXC,KAAK;EACLC,UAAU;EACVC,IAAI;EACJC,YAAY;EACZC,IAAI;EACJ,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,cAAc,GAAGR,EAAE;EACzB,MAAMS,UAAU,GAAG,IAAAC,eAAS,EACzBC,MAAM,IACPA,MAAM,CAAEC,YAAe,CAAC,CAACC,0BAA0B,CAAEX,KAAM,CAAC,KAC5DC,UAAU,EACX,CAAEA,UAAU,EAAED,KAAK,CACpB,CAAC;EACD,MAAM;IAAEY,uBAAuB;IAAEC;EAAyB,CAAC,GAC1D,IAAAC,iBAAW,EAAEJ,YAAe,CAAC;EAC9B,OACC,IAAAK,MAAA,CAAAC,aAAA,EAACV,cAAc;IACdJ,IAAI,EAAGC,YAAY,IAAII,UAAU,GAAGJ,YAAY,GAAGD,IAAM;IACzD,iBAAgBD,UAAU,CAACgB,OAAO,CAAE,GAAG,EAAE,GAAI,CAAG;IAChDC,OAAO,EAAGA,CAAA,KAAM;MACf,IAAKX,UAAU,EAAG;QACjBM,wBAAwB,CAAEb,KAAM,CAAC;MAClC,CAAC,MAAM;QACNY,uBAAuB,CAAEZ,KAAK,EAAEC,UAAW,CAAC;MAC7C;IACD,CAAG;IAAA,GACEI;EAAK,CACV,CAAC;AAEJ;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,iCAAwB,EAAEzB,uBAAwB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","FullscreenMode","isActive","useEffect","isSticky","document","body","classList","contains","remove","add","_default","exports","default"],"sources":["@wordpress/interface/src/components/fullscreen-mode/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\nconst FullscreenMode = ( { isActive } ) => {\n\tuseEffect( () => {\n\t\tlet isSticky = false;\n\t\t// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes\n\t\t// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled\n\t\t// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as\n\t\t// a consequence of the FullscreenMode setup.\n\t\tif ( document.body.classList.contains( 'sticky-menu' ) ) {\n\t\t\tisSticky = true;\n\t\t\tdocument.body.classList.remove( 'sticky-menu' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isSticky ) {\n\t\t\t\tdocument.body.classList.add( 'sticky-menu' );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isActive ) {\n\t\t\tdocument.body.classList.add( 'is-fullscreen-mode' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isActive ) {\n\t\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t\t}\n\t\t};\n\t}, [ isActive ] );\n\n\treturn null;\n};\nexport default FullscreenMode;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,cAAc,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAAM;EAC1C,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAIC,QAAQ,GAAG,KAAK;IACpB;IACA;IACA;IACA;IACA,IAAKC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACC,QAAQ,CAAE,aAAc,CAAC,EAAG;MACxDJ,QAAQ,GAAG,IAAI;MACfC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,aAAc,CAAC;IAChD;IAEA,OAAO,MAAM;MACZ,IAAKL,QAAQ,EAAG;QACfC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACG,GAAG,CAAE,aAAc,CAAC;MAC7C;IACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAP,kBAAS,EAAE,MAAM;IAChB,IAAKD,QAAQ,EAAG;MACfG,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACG,GAAG,CAAE,oBAAqB,CAAC;IACpD,CAAC,MAAM;MACNL,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,oBAAqB,CAAC;IACvD;IAEA,OAAO,MAAM;MACZ,IAAKP,QAAQ,EAAG;QACfG,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,oBAAqB,CAAC;MACvD;IACD,CAAC;EACF,CAAC,EAAE,CAAEP,QAAQ,CAAG,CAAC;EAEjB,OAAO,IAAI;AACZ,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACaZ,cAAc"}
|
|
1
|
+
{"version":3,"names":["_element","require","FullscreenMode","isActive","useEffect","isSticky","document","body","classList","contains","remove","add","_default","exports","default"],"sources":["@wordpress/interface/src/components/fullscreen-mode/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\nconst FullscreenMode = ( { isActive } ) => {\n\tuseEffect( () => {\n\t\tlet isSticky = false;\n\t\t// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes\n\t\t// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled\n\t\t// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as\n\t\t// a consequence of the FullscreenMode setup.\n\t\tif ( document.body.classList.contains( 'sticky-menu' ) ) {\n\t\t\tisSticky = true;\n\t\t\tdocument.body.classList.remove( 'sticky-menu' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isSticky ) {\n\t\t\t\tdocument.body.classList.add( 'sticky-menu' );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isActive ) {\n\t\t\tdocument.body.classList.add( 'is-fullscreen-mode' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isActive ) {\n\t\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t\t}\n\t\t};\n\t}, [ isActive ] );\n\n\treturn null;\n};\nexport default FullscreenMode;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,cAAc,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAAM;EAC1C,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAIC,QAAQ,GAAG,KAAK;IACpB;IACA;IACA;IACA;IACA,IAAKC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACC,QAAQ,CAAE,aAAc,CAAC,EAAG;MACxDJ,QAAQ,GAAG,IAAI;MACfC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,aAAc,CAAC;IAChD;IAEA,OAAO,MAAM;MACZ,IAAKL,QAAQ,EAAG;QACfC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACG,GAAG,CAAE,aAAc,CAAC;MAC7C;IACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAP,kBAAS,EAAE,MAAM;IAChB,IAAKD,QAAQ,EAAG;MACfG,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACG,GAAG,CAAE,oBAAqB,CAAC;IACpD,CAAC,MAAM;MACNL,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,oBAAqB,CAAC;IACvD;IAEA,OAAO,MAAM;MACZ,IAAKP,QAAQ,EAAG;QACfG,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,oBAAqB,CAAC;MACvD;IACD,CAAC;EACF,CAAC,EAAE,CAAEP,QAAQ,CAAG,CAAC;EAEjB,OAAO,IAAI;AACZ,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACaZ,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_complementaryArea","_interopRequireDefault","require","_complementaryAreaMoreMenuItem","_fullscreenMode","_interfaceSkeleton","_pinnedItems","_actionItem","_navigableRegion"],"sources":["@wordpress/interface/src/components/index.js"],"sourcesContent":["export { default as ComplementaryArea } from './complementary-area';\nexport { default as ComplementaryAreaMoreMenuItem } from './complementary-area-more-menu-item';\nexport { default as FullscreenMode } from './fullscreen-mode';\nexport { default as InterfaceSkeleton } from './interface-skeleton';\nexport { default as PinnedItems } from './pinned-items';\nexport { default as ActionItem } from './action-item';\nexport { default as NavigableRegion } from './navigable-region';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,8BAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,gBAAA,GAAAP,sBAAA,CAAAC,OAAA"}
|
|
1
|
+
{"version":3,"names":["_complementaryArea","_interopRequireDefault","require","_complementaryAreaMoreMenuItem","_fullscreenMode","_interfaceSkeleton","_pinnedItems","_actionItem","_navigableRegion"],"sources":["@wordpress/interface/src/components/index.js"],"sourcesContent":["export { default as ComplementaryArea } from './complementary-area';\nexport { default as ComplementaryAreaMoreMenuItem } from './complementary-area-more-menu-item';\nexport { default as FullscreenMode } from './fullscreen-mode';\nexport { default as InterfaceSkeleton } from './interface-skeleton';\nexport { default as PinnedItems } from './pinned-items';\nexport { default as ActionItem } from './action-item';\nexport { default as NavigableRegion } from './navigable-region';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,8BAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,gBAAA,GAAAP,sBAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_complementaryArea","_interopRequireDefault","require","_pinnedItems"],"sources":["@wordpress/interface/src/components/index.native.js"],"sourcesContent":["export { default as ComplementaryArea } from './complementary-area';\nexport { default as PinnedItems } from './pinned-items';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA"}
|
|
1
|
+
{"version":3,"names":["_complementaryArea","_interopRequireDefault","require","_pinnedItems"],"sources":["@wordpress/interface/src/components/index.native.js"],"sourcesContent":["export { default as ComplementaryArea } from './complementary-area';\nexport { default as PinnedItems } from './pinned-items';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -24,6 +24,7 @@ var _navigableRegion = _interopRequireDefault(require("../navigable-region"));
|
|
|
24
24
|
* Internal dependencies
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
+
const ANIMATION_DURATION = 0.25;
|
|
27
28
|
function useHTMLClass(className) {
|
|
28
29
|
(0, _element.useEffect)(() => {
|
|
29
30
|
const element = document && document.querySelector(`html:not(.${className})`);
|
|
@@ -72,6 +73,14 @@ function InterfaceSkeleton({
|
|
|
72
73
|
// Can we use a dependency to keyboard-shortcuts directly?
|
|
73
74
|
shortcuts
|
|
74
75
|
}, ref) {
|
|
76
|
+
const [secondarySidebarResizeListener, secondarySidebarSize] = (0, _compose.useResizeObserver)();
|
|
77
|
+
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
78
|
+
const disableMotion = (0, _compose.useReducedMotion)();
|
|
79
|
+
const defaultTransition = {
|
|
80
|
+
type: 'tween',
|
|
81
|
+
duration: disableMotion ? 0 : ANIMATION_DURATION,
|
|
82
|
+
ease: [0.6, 0, 0.4, 1]
|
|
83
|
+
};
|
|
75
84
|
const navigateRegionsProps = (0, _components.__unstableUseNavigateRegions)(shortcuts);
|
|
76
85
|
useHTMLClass('interface-interface-skeleton__html-container');
|
|
77
86
|
const defaultLabels = {
|
|
@@ -114,10 +123,35 @@ function InterfaceSkeleton({
|
|
|
114
123
|
className: "interface-interface-skeleton__header"
|
|
115
124
|
}, editorNotices), (0, _react.createElement)("div", {
|
|
116
125
|
className: "interface-interface-skeleton__body"
|
|
126
|
+
}, (0, _react.createElement)(_components.__unstableAnimatePresence, {
|
|
127
|
+
initial: false
|
|
117
128
|
}, !!secondarySidebar && (0, _react.createElement)(_navigableRegion.default, {
|
|
118
129
|
className: "interface-interface-skeleton__secondary-sidebar",
|
|
119
|
-
ariaLabel: mergedLabels.secondarySidebar
|
|
120
|
-
|
|
130
|
+
ariaLabel: mergedLabels.secondarySidebar,
|
|
131
|
+
as: _components.__unstableMotion.div,
|
|
132
|
+
initial: "closed",
|
|
133
|
+
animate: isMobileViewport ? 'mobileOpen' : 'open',
|
|
134
|
+
exit: "closed",
|
|
135
|
+
variants: {
|
|
136
|
+
open: {
|
|
137
|
+
width: secondarySidebarSize.width
|
|
138
|
+
},
|
|
139
|
+
closed: {
|
|
140
|
+
width: 0
|
|
141
|
+
},
|
|
142
|
+
mobileOpen: {
|
|
143
|
+
width: '100vw'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
transition: defaultTransition
|
|
147
|
+
}, (0, _react.createElement)("div", {
|
|
148
|
+
style: {
|
|
149
|
+
position: 'absolute',
|
|
150
|
+
width: 'fit-content',
|
|
151
|
+
height: '100%',
|
|
152
|
+
right: 0
|
|
153
|
+
}
|
|
154
|
+
}, secondarySidebarResizeListener, secondarySidebar))), !!notices && (0, _react.createElement)("div", {
|
|
121
155
|
className: "interface-interface-skeleton__notices"
|
|
122
156
|
}, notices), (0, _react.createElement)(_navigableRegion.default, {
|
|
123
157
|
className: "interface-interface-skeleton__content",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_components","_i18n","_compose","_navigableRegion","useHTMLClass","className","useEffect","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","navigateRegionsProps","useNavigateRegions","defaultLabels","_x","body","__","mergedLabels","_react","createElement","useMergeRefs","undefined","classnames","default","as","motion","div","initial","whileHover","animate","variants","ariaLabel","_default","exports","forwardRef"],"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport {\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport NavigableRegion from '../navigable-region';\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 navigateRegionsProps = useNavigateRegions( shortcuts );\n\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={ classnames(\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{ !! secondarySidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__secondary-sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.secondarySidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ secondarySidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,gBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAGA,SAASM,YAAYA,CAAEC,SAAS,EAAG;EAClC,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAMC,OAAO,GACZC,QAAQ,IAAIA,QAAQ,CAACC,aAAa,CAAG,aAA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AAEsB,gBAAgB,IACpB,IAAAe,MAAA,CAAAC,aAAA,EAACxC,gBAAA,CAAA4C,OAAe;IACf1C,SAAS,EAAC,iDAAiD;IAC3DkD,SAAS,EAAGd,YAAY,CAACd;EAAkB,GAEzCA,gBACc,CACjB,EACC,CAAC,CAAEC,OAAO,IACX,IAAAc,MAAA,CAAAC,aAAA;IAAKtC,SAAS,EAAC;EAAuC,GACnDuB,OACE,CACL,EACD,IAAAc,MAAA,CAAAC,aAAA,EAACxC,gBAAA,CAAA4C,OAAe;IACf1C,SAAS,EAAC,uCAAuC;IACjDkD,SAAS,EAAGd,YAAY,CAACF;EAAM,GAE7BV,OACc,CAAC,EAChB,CAAC,CAAEH,OAAO,IACX,IAAAgB,MAAA,CAAAC,aAAA,EAACxC,gBAAA,CAAA4C,OAAe;IACf1C,SAAS,EAAC,uCAAuC;IACjDkD,SAAS,EAAGd,YAAY,CAACf;EAAS,GAEhCA,OACc,CACjB,EACC,CAAC,CAAEI,OAAO,IACX,IAAAY,MAAA,CAAAC,aAAA,EAACxC,gBAAA,CAAA4C,OAAe;IACf1C,SAAS,EAAC,uCAAuC;IACjDkD,SAAS,EAAGd,YAAY,CAACX;EAAS,GAEhCA,OACc,CAEd,CACD,CAAC,EACJ,CAAC,CAAEP,MAAM,IACV,IAAAmB,MAAA,CAAAC,aAAA,EAACxC,gBAAA,CAAA4C,OAAe;IACf1C,SAAS,EAAC,sCAAsC;IAChDkD,SAAS,EAAGd,YAAY,CAAClB;EAAQ,GAE/BA,MACc,CAEd,CAAC;AAER;AAAC,IAAAiC,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEc,IAAAW,mBAAU,EAAErC,iBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_components","_i18n","_compose","_navigableRegion","ANIMATION_DURATION","useHTMLClass","className","useEffect","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","useResizeObserver","isMobileViewport","useViewportMatch","disableMotion","useReducedMotion","defaultTransition","duration","ease","navigateRegionsProps","useNavigateRegions","defaultLabels","_x","body","__","mergedLabels","_react","createElement","useMergeRefs","undefined","classnames","default","as","motion","div","initial","whileHover","animate","variants","__unstableAnimatePresence","ariaLabel","exit","open","width","closed","mobileOpen","style","position","height","right","_default","exports","forwardRef"],"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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={ classnames(\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: '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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAUA,IAAAK,gBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAzBA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAGA,MAAMM,kBAAkB,GAAG,IAAI;AAE/B,SAASC,YAAYA,CAAEC,SAAS,EAAG;EAClC,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAMC,OAAO,GACZC,QAAQ,IAAIA,QAAQ,CAACC,aAAa,CAAG,aAAaJ,SAAW,GAAG,CAAC;IAClE,IAAK,CAAEE,OAAO,EAAG;MAChB;IACD;IACAA,OAAO,CAACG,SAAS,CAACC,MAAM,CAAEN,SAAU,CAAC;IACrC,OAAO,MAAM;MACZE,OAAO,CAACG,SAAS,CAACC,MAAM,CAAEN,SAAU,CAAC;IACtC,CAAC;EAC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AAS,EAAGf,YAAY,CAACF;EAAM,GAE7BpB,OACc,CAAC,EAChB,CAAC,CAAEH,OAAO,IACX,IAAA0B,MAAA,CAAAC,aAAA,EAACnD,gBAAA,CAAAuD,OAAe;IACfpD,SAAS,EAAC,uCAAuC;IACjD6D,SAAS,EAAGf,YAAY,CAACzB;EAAS,GAEhCA,OACc,CACjB,EACC,CAAC,CAAEI,OAAO,IACX,IAAAsB,MAAA,CAAAC,aAAA,EAACnD,gBAAA,CAAAuD,OAAe;IACfpD,SAAS,EAAC,uCAAuC;IACjD6D,SAAS,EAAGf,YAAY,CAACrB;EAAS,GAEhCA,OACc,CAEd,CACD,CAAC,EACJ,CAAC,CAAEP,MAAM,IACV,IAAA6B,MAAA,CAAAC,aAAA,EAACnD,gBAAA,CAAAuD,OAAe;IACfpD,SAAS,EAAC,sCAAsC;IAChD6D,SAAS,EAAGf,YAAY,CAAC5B;EAAQ,GAE/BA,MACc,CAEd,CAAC;AAER;AAAC,IAAAqD,QAAA,GAAAC,OAAA,CAAApB,OAAA,GAEc,IAAAqB,mBAAU,EAAEzD,iBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","NavigableRegion","children","className","ariaLabel","as","Tag","props","_react","createElement","classnames","role","tabIndex"],"sources":["@wordpress/interface/src/components/navigable-region/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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={ classnames( '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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGe,SAASC,eAAeA,CAAE;EACxCC,QAAQ;EACRC,SAAS;EACTC,SAAS;EACTC,EAAE,EAAEC,GAAG,GAAG,KAAK;EACf,GAAGC;AACJ,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACH,GAAG;IACHH,SAAS,EAAG,IAAAO,mBAAU,EAAE,4BAA4B,EAAEP,SAAU,CAAG;IACnE,cAAaC,SAAW;IACxBO,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAC,IAAI;IAAA,GACRL;EAAK,GAERL,QACE,CAAC;AAER"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","NavigableRegion","children","className","ariaLabel","as","Tag","props","_react","createElement","classnames","role","tabIndex"],"sources":["@wordpress/interface/src/components/navigable-region/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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={ classnames( '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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGe,SAASC,eAAeA,CAAE;EACxCC,QAAQ;EACRC,SAAS;EACTC,SAAS;EACTC,EAAE,EAAEC,GAAG,GAAG,KAAK;EACf,GAAGC;AACJ,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACH,GAAG;IACHH,SAAS,EAAG,IAAAO,mBAAU,EAAE,4BAA4B,EAAEP,SAAU,CAAG;IACnE,cAAaC,SAAW;IACxBO,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAC,IAAI;IAAA,GACRL;EAAK,GAERL,QACE,CAAC;AAER","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","PinnedItems","scope","props","_react","createElement","Fill","name","PinnedItemsSlot","className","Slot","fills","length","classnames","_default","exports","default"],"sources":["@wordpress/interface/src/components/pinned-items/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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={ classnames(\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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,SAASE,WAAWA,CAAE;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC3C,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACL,WAAA,CAAAM,IAAI;IAACC,IAAI,EAAI,eAAeL,KAAO,EAAG;IAAA,GAAMC;EAAK,CAAI,CAAC;AAC/D;AAEA,SAASK,eAAeA,CAAE;EAAEN,KAAK;EAAEO,SAAS;EAAE,GAAGN;AAAM,CAAC,EAAG;EAC1D,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACL,WAAA,CAAAU,IAAI;IAACH,IAAI,EAAI,eAAeL,KAAO,EAAG;IAAA,GAAMC;EAAK,GAC7CQ,KAAK,IACRA,KAAK,EAAEC,MAAM,GAAG,CAAC,IAChB,IAAAR,MAAA,CAAAC,aAAA;IACCI,SAAS,EAAG,IAAAI,mBAAU,EACrBJ,SAAS,EACT,wBACD;EAAG,GAEDE,KACE,CAGF,CAAC;AAET;AAEAV,WAAW,CAACS,IAAI,GAAGF,eAAe;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEpBf,WAAW"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","PinnedItems","scope","props","_react","createElement","Fill","name","PinnedItemsSlot","className","Slot","fills","length","classnames","_default","exports","default"],"sources":["@wordpress/interface/src/components/pinned-items/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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={ classnames(\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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,SAASE,WAAWA,CAAE;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC3C,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACL,WAAA,CAAAM,IAAI;IAACC,IAAI,EAAI,eAAeL,KAAO,EAAG;IAAA,GAAMC;EAAK,CAAI,CAAC;AAC/D;AAEA,SAASK,eAAeA,CAAE;EAAEN,KAAK;EAAEO,SAAS;EAAE,GAAGN;AAAM,CAAC,EAAG;EAC1D,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACL,WAAA,CAAAU,IAAI;IAACH,IAAI,EAAI,eAAeL,KAAO,EAAG;IAAA,GAAMC;EAAK,GAC7CQ,KAAK,IACRA,KAAK,EAAEC,MAAM,GAAG,CAAC,IAChB,IAAAR,MAAA,CAAAC,aAAA;IACCI,SAAS,EAAG,IAAAI,mBAAU,EACrBJ,SAAS,EACT,wBACD;EAAG,GAEDE,KACE,CAGF,CAAC;AAET;AAEAV,WAAW,CAACS,IAAI,GAAGF,eAAe;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEpBf,WAAW","ignoreList":[]}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_store"],"sources":["@wordpress/interface/src/index.js"],"sourcesContent":["export * from './components';\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,MAAA,GAAAb,OAAA"}
|
|
1
|
+
{"version":3,"names":["_components","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_store"],"sources":["@wordpress/interface/src/index.js"],"sourcesContent":["export * from './components';\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,MAAA,GAAAb,OAAA","ignoreList":[]}
|
package/build/store/actions.js
CHANGED
|
@@ -14,10 +14,15 @@ exports.toggleFeature = toggleFeature;
|
|
|
14
14
|
exports.unpinItem = void 0;
|
|
15
15
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
16
16
|
var _preferences = require("@wordpress/preferences");
|
|
17
|
+
var _deprecated2 = require("./deprecated");
|
|
17
18
|
/**
|
|
18
19
|
* WordPress dependencies
|
|
19
20
|
*/
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
|
|
21
26
|
/**
|
|
22
27
|
* Set a default complementary area.
|
|
23
28
|
*
|
|
@@ -26,11 +31,15 @@ var _preferences = require("@wordpress/preferences");
|
|
|
26
31
|
*
|
|
27
32
|
* @return {Object} Action object.
|
|
28
33
|
*/
|
|
29
|
-
const setDefaultComplementaryArea = (scope, area) =>
|
|
30
|
-
|
|
31
|
-
scope,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
const setDefaultComplementaryArea = (scope, area) => {
|
|
35
|
+
scope = (0, _deprecated2.normalizeComplementaryAreaScope)(scope);
|
|
36
|
+
area = (0, _deprecated2.normalizeComplementaryAreaName)(scope, area);
|
|
37
|
+
return {
|
|
38
|
+
type: 'SET_DEFAULT_COMPLEMENTARY_AREA',
|
|
39
|
+
scope,
|
|
40
|
+
area
|
|
41
|
+
};
|
|
42
|
+
};
|
|
34
43
|
|
|
35
44
|
/**
|
|
36
45
|
* Enable the complementary area.
|
|
@@ -47,6 +56,8 @@ const enableComplementaryArea = (scope, area) => ({
|
|
|
47
56
|
if (!area) {
|
|
48
57
|
return;
|
|
49
58
|
}
|
|
59
|
+
scope = (0, _deprecated2.normalizeComplementaryAreaScope)(scope);
|
|
60
|
+
area = (0, _deprecated2.normalizeComplementaryAreaName)(scope, area);
|
|
50
61
|
const isComplementaryAreaVisible = registry.select(_preferences.store).get(scope, 'isComplementaryAreaVisible');
|
|
51
62
|
if (!isComplementaryAreaVisible) {
|
|
52
63
|
registry.dispatch(_preferences.store).set(scope, 'isComplementaryAreaVisible', true);
|
|
@@ -67,6 +78,7 @@ exports.enableComplementaryArea = enableComplementaryArea;
|
|
|
67
78
|
const disableComplementaryArea = scope => ({
|
|
68
79
|
registry
|
|
69
80
|
}) => {
|
|
81
|
+
scope = (0, _deprecated2.normalizeComplementaryAreaScope)(scope);
|
|
70
82
|
const isComplementaryAreaVisible = registry.select(_preferences.store).get(scope, 'isComplementaryAreaVisible');
|
|
71
83
|
if (isComplementaryAreaVisible) {
|
|
72
84
|
registry.dispatch(_preferences.store).set(scope, 'isComplementaryAreaVisible', false);
|
|
@@ -89,6 +101,8 @@ const pinItem = (scope, item) => ({
|
|
|
89
101
|
if (!item) {
|
|
90
102
|
return;
|
|
91
103
|
}
|
|
104
|
+
scope = (0, _deprecated2.normalizeComplementaryAreaScope)(scope);
|
|
105
|
+
item = (0, _deprecated2.normalizeComplementaryAreaName)(scope, item);
|
|
92
106
|
const pinnedItems = registry.select(_preferences.store).get(scope, 'pinnedItems');
|
|
93
107
|
|
|
94
108
|
// The item is already pinned, there's nothing to do.
|
|
@@ -115,6 +129,8 @@ const unpinItem = (scope, item) => ({
|
|
|
115
129
|
if (!item) {
|
|
116
130
|
return;
|
|
117
131
|
}
|
|
132
|
+
scope = (0, _deprecated2.normalizeComplementaryAreaScope)(scope);
|
|
133
|
+
item = (0, _deprecated2.normalizeComplementaryAreaName)(scope, item);
|
|
118
134
|
const pinnedItems = registry.select(_preferences.store).get(scope, 'pinnedItems');
|
|
119
135
|
registry.dispatch(_preferences.store).set(scope, 'pinnedItems', {
|
|
120
136
|
...pinnedItems,
|