@wordpress/interface 4.11.0 → 4.14.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 +6 -0
- package/build/components/action-item/index.js +1 -7
- package/build/components/action-item/index.js.map +1 -1
- package/build/components/complementary-area-more-menu-item/index.js +13 -12
- package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build/components/complementary-area-toggle/index.js +2 -7
- package/build/components/complementary-area-toggle/index.js.map +1 -1
- package/build/components/pinned-items/index.js +1 -3
- package/build/components/pinned-items/index.js.map +1 -1
- package/build-module/components/action-item/index.js +1 -6
- package/build-module/components/action-item/index.js.map +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.js +13 -11
- package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build-module/components/complementary-area-toggle/index.js +2 -6
- package/build-module/components/complementary-area-toggle/index.js.map +1 -1
- package/build-module/components/pinned-items/index.js +1 -2
- package/build-module/components/pinned-items/index.js.map +1 -1
- package/build-style/style-rtl.css +0 -3
- package/build-style/style.css +0 -3
- package/package.json +14 -15
- package/src/components/action-item/index.js +1 -6
- package/src/components/complementary-area-more-menu-item/index.js +5 -13
- package/src/components/complementary-area-toggle/index.js +2 -6
- package/src/components/pinned-items/index.js +1 -2
- package/src/components/preferences-modal/style.scss +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -11,14 +11,8 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
14
|
var _components = require("@wordpress/components");
|
|
17
15
|
|
|
18
|
-
/**
|
|
19
|
-
* External dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
16
|
/**
|
|
23
17
|
* WordPress dependencies
|
|
24
18
|
*/
|
|
@@ -37,7 +31,7 @@ function ActionItemSlot(_ref) {
|
|
|
37
31
|
bubblesVirtually: bubblesVirtually,
|
|
38
32
|
fillProps: fillProps
|
|
39
33
|
}, fills => {
|
|
40
|
-
if (
|
|
34
|
+
if (!_element.Children.toArray(fills).length) {
|
|
41
35
|
return null;
|
|
42
36
|
} // Special handling exists for backward compatibility.
|
|
43
37
|
// It ensures that menu items created by plugin authors aren't
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/action-item/index.js"],"names":["noop","ActionItemSlot","name","as","Component","ButtonGroup","fillProps","bubblesVirtually","props","fills","Children","toArray","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","Button","onClick","fpOnClick","undefined","Slot"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/action-item/index.js"],"names":["noop","ActionItemSlot","name","as","Component","ButtonGroup","fillProps","bubblesVirtually","props","fills","Children","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","Button","onClick","fpOnClick","undefined","Slot"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAHA;AACA;AACA;AAIA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,cAAT,OAMI;AAAA,MANqB;AACxBC,IAAAA,IADwB;AAExBC,IAAAA,EAAE,EAAEC,SAAS,GAAGC,uBAFQ;AAGxBC,IAAAA,SAAS,GAAG,EAHY;AAIxBC,IAAAA,gBAJwB;AAKxB,OAAGC;AALqB,GAMrB;AACH,SACC,4BAAC,gBAAD;AACC,IAAA,IAAI,EAAGN,IADR;AAEC,IAAA,gBAAgB,EAAGK,gBAFpB;AAGC,IAAA,SAAS,EAAGD;AAHb,KAKKG,KAAF,IAAa;AACd,QAAK,CAAEC,kBAASC,OAAT,CAAkBF,KAAlB,EAA0BG,MAAjC,EAA0C;AACzC,aAAO,IAAP;AACA,KAHa,CAKd;AACA;AACA;AACA;AACA;;;AACA,UAAMC,oBAAoB,GAAG,EAA7B;;AACAH,sBAASI,OAAT,CACCL,KADD,EAEC,SAEO;AAAA,UAFL;AACDD,QAAAA,KAAK,EAAE;AAAEO,UAAAA,0BAAF;AAA8BC,UAAAA;AAA9B;AADN,OAEK;;AACN,UAAKA,gBAAgB,IAAID,0BAAzB,EAAsD;AACrDF,QAAAA,oBAAoB,CAACI,IAArB,CAA2BD,gBAA3B;AACA;AACD,KARF;;AAUA,UAAME,QAAQ,GAAGR,kBAASS,GAAT,CAAcV,KAAd,EAAuBW,KAAF,IAAa;AAClD,UACC,CAAEA,KAAK,CAACZ,KAAN,CAAYO,0BAAd,IACAF,oBAAoB,CAACQ,QAArB,CACCD,KAAK,CAACZ,KAAN,CAAYQ,gBADb,CAFD,EAKE;AACD,eAAO,IAAP;AACA;;AACD,aAAOI,KAAP;AACA,KAVgB,CAAjB;;AAYA,WAAO,4BAAC,SAAD,EAAgBZ,KAAhB,EAA0BU,QAA1B,CAAP;AACA,GAvCF,CADD;AA2CA;;AAED,SAASI,UAAT,QAA2E;AAAA,MAAtD;AAAEpB,IAAAA,IAAF;AAAQC,IAAAA,EAAE,EAAEC,SAAS,GAAGmB,kBAAxB;AAAgCC,IAAAA,OAAhC;AAAyC,OAAGhB;AAA5C,GAAsD;AAC1E,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAGN;AAAb,KACG,SAA8B;AAAA,QAA5B;AAAEsB,MAAAA,OAAO,EAAEC;AAAX,KAA4B;AAC/B,WACC,4BAAC,SAAD;AACC,MAAA,OAAO,EACND,OAAO,IAAIC,SAAX,GACG,YAAe;AACf,SAAED,OAAO,IAAIxB,IAAb,EAAqB,YAArB;AACA,SAAEyB,SAAS,IAAIzB,IAAf,EAAuB,YAAvB;AACC,OAJJ,GAKG0B;AAPL,OASMlB,KATN,EADD;AAaA,GAfF,CADD;AAmBA;;AAEDc,UAAU,CAACK,IAAX,GAAkB1B,cAAlB;eAEeqB,U","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"]}
|
|
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
14
|
var _icons = require("@wordpress/icons");
|
|
17
15
|
|
|
18
16
|
var _components = require("@wordpress/components");
|
|
@@ -21,10 +19,6 @@ var _complementaryAreaToggle = _interopRequireDefault(require("../complementary-
|
|
|
21
19
|
|
|
22
20
|
var _actionItem = _interopRequireDefault(require("../action-item"));
|
|
23
21
|
|
|
24
|
-
/**
|
|
25
|
-
* External dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
22
|
/**
|
|
29
23
|
* WordPress dependencies
|
|
30
24
|
*/
|
|
@@ -32,18 +26,25 @@ var _actionItem = _interopRequireDefault(require("../action-item"));
|
|
|
32
26
|
/**
|
|
33
27
|
* Internal dependencies
|
|
34
28
|
*/
|
|
35
|
-
const PluginsMenuItem =
|
|
36
|
-
|
|
37
|
-
//
|
|
38
|
-
|
|
29
|
+
const PluginsMenuItem = _ref => {
|
|
30
|
+
let {
|
|
31
|
+
// Menu item is marked with unstable prop for backward compatibility.
|
|
32
|
+
// They are removed so they don't leak to DOM elements.
|
|
33
|
+
// @see https://github.com/WordPress/gutenberg/issues/14457
|
|
34
|
+
__unstableExplicitMenuItem,
|
|
35
|
+
__unstableTarget,
|
|
36
|
+
...restProps
|
|
37
|
+
} = _ref;
|
|
38
|
+
return (0, _element.createElement)(_components.MenuItem, restProps);
|
|
39
|
+
};
|
|
39
40
|
|
|
40
|
-
function ComplementaryAreaMoreMenuItem(
|
|
41
|
+
function ComplementaryAreaMoreMenuItem(_ref2) {
|
|
41
42
|
let {
|
|
42
43
|
scope,
|
|
43
44
|
target,
|
|
44
45
|
__unstableExplicitMenuItem,
|
|
45
46
|
...props
|
|
46
|
-
} =
|
|
47
|
+
} = _ref2;
|
|
47
48
|
return (0, _element.createElement)(_complementaryAreaToggle.default, (0, _extends2.default)({
|
|
48
49
|
as: toggleProps => {
|
|
49
50
|
return (0, _element.createElement)(_actionItem.default, (0, _extends2.default)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"names":["PluginsMenuItem","
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"names":["PluginsMenuItem","__unstableExplicitMenuItem","__unstableTarget","restProps","ComplementaryAreaMoreMenuItem","scope","target","props","toggleProps","check"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,MAAMA,eAAe,GAAG;AAAA,MAAE;AACzB;AACA;AACA;AACAC,IAAAA,0BAJyB;AAKzBC,IAAAA,gBALyB;AAMzB,OAAGC;AANsB,GAAF;AAAA,SAOjB,4BAAC,oBAAD,EAAeA,SAAf,CAPiB;AAAA,CAAxB;;AASe,SAASC,6BAAT,QAKX;AAAA,MALmD;AACtDC,IAAAA,KADsD;AAEtDC,IAAAA,MAFsD;AAGtDL,IAAAA,0BAHsD;AAItD,OAAGM;AAJmD,GAKnD;AACH,SACC,4BAAC,gCAAD;AACC,IAAA,EAAE,EAAKC,WAAF,IAAmB;AACvB,aACC,4BAAC,mBAAD;AACC,QAAA,0BAA0B,EACzBP,0BAFF;AAIC,QAAA,gBAAgB,EAAI,GAAGI,KAAO,IAAIC,MAAQ,EAJ3C;AAKC,QAAA,EAAE,EAAGN,eALN;AAMC,QAAA,IAAI,EAAI,GAAGK,KAAO;AANnB,SAOMG,WAPN,EADD;AAWA,KAbF;AAcC,IAAA,IAAI,EAAC,kBAdN;AAeC,IAAA,YAAY,EAAGC,YAfhB;AAgBC,IAAA,IAAI,EAAGH,MAhBR;AAiBC,IAAA,KAAK,EAAGD;AAjBT,KAkBME,KAlBN,EADD;AAsBA","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"]}
|
|
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
14
|
var _components = require("@wordpress/components");
|
|
17
15
|
|
|
18
16
|
var _data = require("@wordpress/data");
|
|
@@ -21,10 +19,6 @@ var _store = require("../../store");
|
|
|
21
19
|
|
|
22
20
|
var _complementaryAreaContext = _interopRequireDefault(require("../complementary-area-context"));
|
|
23
21
|
|
|
24
|
-
/**
|
|
25
|
-
* External dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
22
|
/**
|
|
29
23
|
* WordPress dependencies
|
|
30
24
|
*/
|
|
@@ -39,6 +33,7 @@ function ComplementaryAreaToggle(_ref) {
|
|
|
39
33
|
identifier,
|
|
40
34
|
icon,
|
|
41
35
|
selectedIcon,
|
|
36
|
+
name,
|
|
42
37
|
...props
|
|
43
38
|
} = _ref;
|
|
44
39
|
const ComponentToUse = as;
|
|
@@ -56,7 +51,7 @@ function ComplementaryAreaToggle(_ref) {
|
|
|
56
51
|
enableComplementaryArea(scope, identifier);
|
|
57
52
|
}
|
|
58
53
|
}
|
|
59
|
-
},
|
|
54
|
+
}, props));
|
|
60
55
|
}
|
|
61
56
|
|
|
62
57
|
var _default = (0, _complementaryAreaContext.default)(ComplementaryAreaToggle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"names":["ComplementaryAreaToggle","as","Button","scope","identifier","icon","selectedIcon","props","ComponentToUse","isSelected","select","interfaceStore","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea"],"mappings":";;;;;;;;;;;;;AAGA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"names":["ComplementaryAreaToggle","as","Button","scope","identifier","icon","selectedIcon","name","props","ComponentToUse","isSelected","select","interfaceStore","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,uBAAT,OAQI;AAAA,MAR8B;AACjCC,IAAAA,EAAE,GAAGC,kBAD4B;AAEjCC,IAAAA,KAFiC;AAGjCC,IAAAA,UAHiC;AAIjCC,IAAAA,IAJiC;AAKjCC,IAAAA,YALiC;AAMjCC,IAAAA,IANiC;AAOjC,OAAGC;AAP8B,GAQ9B;AACH,QAAMC,cAAc,GAAGR,EAAvB;AACA,QAAMS,UAAU,GAAG,qBAChBC,MAAF,IACCA,MAAM,CAAEC,YAAF,CAAN,CAAyBC,0BAAzB,CAAqDV,KAArD,MACAC,UAHiB,EAIlB,CAAEA,UAAF,CAJkB,CAAnB;AAMA,QAAM;AAAEU,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MACL,uBAAaH,YAAb,CADD;AAEA,SACC,4BAAC,cAAD;AACC,IAAA,IAAI,EAAGN,YAAY,IAAII,UAAhB,GAA6BJ,YAA7B,GAA4CD,IADpD;AAEC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKK,UAAL,EAAkB;AACjBK,QAAAA,wBAAwB,CAAEZ,KAAF,CAAxB;AACA,OAFD,MAEO;AACNW,QAAAA,uBAAuB,CAAEX,KAAF,EAASC,UAAT,CAAvB;AACA;AACD;AARF,KASMI,KATN,EADD;AAaA;;eAEc,uCAA0BR,uBAA1B,C","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 ]\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\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"]}
|
|
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
15
|
|
|
18
16
|
var _components = require("@wordpress/components");
|
|
@@ -42,7 +40,7 @@ function PinnedItemsSlot(_ref2) {
|
|
|
42
40
|
} = _ref2;
|
|
43
41
|
return (0, _element.createElement)(_components.Slot, (0, _extends2.default)({
|
|
44
42
|
name: `PinnedItems/${scope}`
|
|
45
|
-
}, props), fills =>
|
|
43
|
+
}, props), fills => (fills === null || fills === void 0 ? void 0 : fills.length) > 0 && (0, _element.createElement)("div", {
|
|
46
44
|
className: (0, _classnames.default)(className, 'interface-pinned-items')
|
|
47
45
|
}, fills));
|
|
48
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/pinned-items/index.js"],"names":["PinnedItems","scope","props","PinnedItemsSlot","className","fills","Slot"],"mappings":";;;;;;;;;;;;;AAGA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/pinned-items/index.js"],"names":["PinnedItems","scope","props","PinnedItemsSlot","className","fills","length","Slot"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,SAASA,WAAT,OAA4C;AAAA,MAAtB;AAAEC,IAAAA,KAAF;AAAS,OAAGC;AAAZ,GAAsB;AAC3C,SAAO,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,eAAeD,KAAO;AAApC,KAA6CC,KAA7C,EAAP;AACA;;AAED,SAASC,eAAT,QAA2D;AAAA,MAAjC;AAAEF,IAAAA,KAAF;AAASG,IAAAA,SAAT;AAAoB,OAAGF;AAAvB,GAAiC;AAC1D,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,eAAeD,KAAO;AAApC,KAA6CC,KAA7C,GACKG,KAAF,IACD,CAAAA,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEC,MAAP,IAAgB,CAAhB,IACC;AACC,IAAA,SAAS,EAAG,yBACXF,SADW,EAEX,wBAFW;AADb,KAMGC,KANH,CAHH,CADD;AAgBA;;AAEDL,WAAW,CAACO,IAAZ,GAAmBJ,eAAnB;eAEeH,W","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"]}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { createElement } from "@wordpress/element";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* External dependencies
|
|
6
|
-
*/
|
|
7
|
-
import { isEmpty } from 'lodash';
|
|
8
4
|
/**
|
|
9
5
|
* WordPress dependencies
|
|
10
6
|
*/
|
|
11
|
-
|
|
12
7
|
import { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';
|
|
13
8
|
import { Children } from '@wordpress/element';
|
|
14
9
|
|
|
@@ -27,7 +22,7 @@ function ActionItemSlot(_ref) {
|
|
|
27
22
|
bubblesVirtually: bubblesVirtually,
|
|
28
23
|
fillProps: fillProps
|
|
29
24
|
}, fills => {
|
|
30
|
-
if (
|
|
25
|
+
if (!Children.toArray(fills).length) {
|
|
31
26
|
return null;
|
|
32
27
|
} // Special handling exists for backward compatibility.
|
|
33
28
|
// It ensures that menu items created by plugin authors aren't
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/action-item/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/action-item/index.js"],"names":["ButtonGroup","Button","Slot","Fill","Children","noop","ActionItemSlot","name","as","Component","fillProps","bubblesVirtually","props","fills","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","onClick","fpOnClick","undefined"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,MAAtB,EAA8BC,IAA9B,EAAoCC,IAApC,QAAgD,uBAAhD;AACA,SAASC,QAAT,QAAyB,oBAAzB;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,cAAT,OAMI;AAAA,MANqB;AACxBC,IAAAA,IADwB;AAExBC,IAAAA,EAAE,EAAEC,SAAS,GAAGT,WAFQ;AAGxBU,IAAAA,SAAS,GAAG,EAHY;AAIxBC,IAAAA,gBAJwB;AAKxB,OAAGC;AALqB,GAMrB;AACH,SACC,cAAC,IAAD;AACC,IAAA,IAAI,EAAGL,IADR;AAEC,IAAA,gBAAgB,EAAGI,gBAFpB;AAGC,IAAA,SAAS,EAAGD;AAHb,KAKKG,KAAF,IAAa;AACd,QAAK,CAAET,QAAQ,CAACU,OAAT,CAAkBD,KAAlB,EAA0BE,MAAjC,EAA0C;AACzC,aAAO,IAAP;AACA,KAHa,CAKd;AACA;AACA;AACA;AACA;;;AACA,UAAMC,oBAAoB,GAAG,EAA7B;AACAZ,IAAAA,QAAQ,CAACa,OAAT,CACCJ,KADD,EAEC,SAEO;AAAA,UAFL;AACDD,QAAAA,KAAK,EAAE;AAAEM,UAAAA,0BAAF;AAA8BC,UAAAA;AAA9B;AADN,OAEK;;AACN,UAAKA,gBAAgB,IAAID,0BAAzB,EAAsD;AACrDF,QAAAA,oBAAoB,CAACI,IAArB,CAA2BD,gBAA3B;AACA;AACD,KARF;AAUA,UAAME,QAAQ,GAAGjB,QAAQ,CAACkB,GAAT,CAAcT,KAAd,EAAuBU,KAAF,IAAa;AAClD,UACC,CAAEA,KAAK,CAACX,KAAN,CAAYM,0BAAd,IACAF,oBAAoB,CAACQ,QAArB,CACCD,KAAK,CAACX,KAAN,CAAYO,gBADb,CAFD,EAKE;AACD,eAAO,IAAP;AACA;;AACD,aAAOI,KAAP;AACA,KAVgB,CAAjB;AAYA,WAAO,cAAC,SAAD,EAAgBX,KAAhB,EAA0BS,QAA1B,CAAP;AACA,GAvCF,CADD;AA2CA;;AAED,SAASI,UAAT,QAA2E;AAAA,MAAtD;AAAElB,IAAAA,IAAF;AAAQC,IAAAA,EAAE,EAAEC,SAAS,GAAGR,MAAxB;AAAgCyB,IAAAA,OAAhC;AAAyC,OAAGd;AAA5C,GAAsD;AAC1E,SACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAGL;AAAb,KACG,SAA8B;AAAA,QAA5B;AAAEmB,MAAAA,OAAO,EAAEC;AAAX,KAA4B;AAC/B,WACC,cAAC,SAAD;AACC,MAAA,OAAO,EACND,OAAO,IAAIC,SAAX,GACG,YAAe;AACf,SAAED,OAAO,IAAIrB,IAAb,EAAqB,YAArB;AACA,SAAEsB,SAAS,IAAItB,IAAf,EAAuB,YAAvB;AACC,OAJJ,GAKGuB;AAPL,OASMhB,KATN,EADD;AAaA,GAfF,CADD;AAmBA;;AAEDa,UAAU,CAACvB,IAAX,GAAkBI,cAAlB;AAEA,eAAemB,UAAf","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"]}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { createElement } from "@wordpress/element";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* External dependencies
|
|
6
|
-
*/
|
|
7
|
-
import { omit } from 'lodash';
|
|
8
4
|
/**
|
|
9
5
|
* WordPress dependencies
|
|
10
6
|
*/
|
|
11
|
-
|
|
12
7
|
import { check } from '@wordpress/icons';
|
|
13
8
|
import { MenuItem } from '@wordpress/components';
|
|
14
9
|
/**
|
|
@@ -18,18 +13,25 @@ import { MenuItem } from '@wordpress/components';
|
|
|
18
13
|
import ComplementaryAreaToggle from '../complementary-area-toggle';
|
|
19
14
|
import ActionItem from '../action-item';
|
|
20
15
|
|
|
21
|
-
const PluginsMenuItem =
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
|
|
16
|
+
const PluginsMenuItem = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
// Menu item is marked with unstable prop for backward compatibility.
|
|
19
|
+
// They are removed so they don't leak to DOM elements.
|
|
20
|
+
// @see https://github.com/WordPress/gutenberg/issues/14457
|
|
21
|
+
__unstableExplicitMenuItem,
|
|
22
|
+
__unstableTarget,
|
|
23
|
+
...restProps
|
|
24
|
+
} = _ref;
|
|
25
|
+
return createElement(MenuItem, restProps);
|
|
26
|
+
};
|
|
25
27
|
|
|
26
|
-
export default function ComplementaryAreaMoreMenuItem(
|
|
28
|
+
export default function ComplementaryAreaMoreMenuItem(_ref2) {
|
|
27
29
|
let {
|
|
28
30
|
scope,
|
|
29
31
|
target,
|
|
30
32
|
__unstableExplicitMenuItem,
|
|
31
33
|
...props
|
|
32
|
-
} =
|
|
34
|
+
} = _ref2;
|
|
33
35
|
return createElement(ComplementaryAreaToggle, _extends({
|
|
34
36
|
as: toggleProps => {
|
|
35
37
|
return createElement(ActionItem, _extends({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"names":["check","MenuItem","ComplementaryAreaToggle","ActionItem","PluginsMenuItem","__unstableExplicitMenuItem","__unstableTarget","restProps","ComplementaryAreaMoreMenuItem","scope","target","props","toggleProps"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,kBAAtB;AACA,SAASC,QAAT,QAAyB,uBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,UAAP,MAAuB,gBAAvB;;AAEA,MAAMC,eAAe,GAAG;AAAA,MAAE;AACzB;AACA;AACA;AACAC,IAAAA,0BAJyB;AAKzBC,IAAAA,gBALyB;AAMzB,OAAGC;AANsB,GAAF;AAAA,SAOjB,cAAC,QAAD,EAAeA,SAAf,CAPiB;AAAA,CAAxB;;AASA,eAAe,SAASC,6BAAT,QAKX;AAAA,MALmD;AACtDC,IAAAA,KADsD;AAEtDC,IAAAA,MAFsD;AAGtDL,IAAAA,0BAHsD;AAItD,OAAGM;AAJmD,GAKnD;AACH,SACC,cAAC,uBAAD;AACC,IAAA,EAAE,EAAKC,WAAF,IAAmB;AACvB,aACC,cAAC,UAAD;AACC,QAAA,0BAA0B,EACzBP,0BAFF;AAIC,QAAA,gBAAgB,EAAI,GAAGI,KAAO,IAAIC,MAAQ,EAJ3C;AAKC,QAAA,EAAE,EAAGN,eALN;AAMC,QAAA,IAAI,EAAI,GAAGK,KAAO;AANnB,SAOMG,WAPN,EADD;AAWA,KAbF;AAcC,IAAA,IAAI,EAAC,kBAdN;AAeC,IAAA,YAAY,EAAGZ,KAfhB;AAgBC,IAAA,IAAI,EAAGU,MAhBR;AAiBC,IAAA,KAAK,EAAGD;AAjBT,KAkBME,KAlBN,EADD;AAsBA","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"]}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { createElement } from "@wordpress/element";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* External dependencies
|
|
6
|
-
*/
|
|
7
|
-
import { omit } from 'lodash';
|
|
8
4
|
/**
|
|
9
5
|
* WordPress dependencies
|
|
10
6
|
*/
|
|
11
|
-
|
|
12
7
|
import { Button } from '@wordpress/components';
|
|
13
8
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
14
9
|
/**
|
|
@@ -25,6 +20,7 @@ function ComplementaryAreaToggle(_ref) {
|
|
|
25
20
|
identifier,
|
|
26
21
|
icon,
|
|
27
22
|
selectedIcon,
|
|
23
|
+
name,
|
|
28
24
|
...props
|
|
29
25
|
} = _ref;
|
|
30
26
|
const ComponentToUse = as;
|
|
@@ -42,7 +38,7 @@ function ComplementaryAreaToggle(_ref) {
|
|
|
42
38
|
enableComplementaryArea(scope, identifier);
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
|
-
},
|
|
41
|
+
}, props));
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
export default complementaryAreaContext(ComplementaryAreaToggle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"names":["Button","useDispatch","useSelect","store","interfaceStore","complementaryAreaContext","ComplementaryAreaToggle","as","scope","identifier","icon","selectedIcon","name","props","ComponentToUse","isSelected","select","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,aAAxC;AACA,OAAOC,wBAAP,MAAqC,+BAArC;;AAEA,SAASC,uBAAT,OAQI;AAAA,MAR8B;AACjCC,IAAAA,EAAE,GAAGP,MAD4B;AAEjCQ,IAAAA,KAFiC;AAGjCC,IAAAA,UAHiC;AAIjCC,IAAAA,IAJiC;AAKjCC,IAAAA,YALiC;AAMjCC,IAAAA,IANiC;AAOjC,OAAGC;AAP8B,GAQ9B;AACH,QAAMC,cAAc,GAAGP,EAAvB;AACA,QAAMQ,UAAU,GAAGb,SAAS,CACzBc,MAAF,IACCA,MAAM,CAAEZ,cAAF,CAAN,CAAyBa,0BAAzB,CAAqDT,KAArD,MACAC,UAH0B,EAI3B,CAAEA,UAAF,CAJ2B,CAA5B;AAMA,QAAM;AAAES,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MACLlB,WAAW,CAAEG,cAAF,CADZ;AAEA,SACC,cAAC,cAAD;AACC,IAAA,IAAI,EAAGO,YAAY,IAAII,UAAhB,GAA6BJ,YAA7B,GAA4CD,IADpD;AAEC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKK,UAAL,EAAkB;AACjBI,QAAAA,wBAAwB,CAAEX,KAAF,CAAxB;AACA,OAFD,MAEO;AACNU,QAAAA,uBAAuB,CAAEV,KAAF,EAASC,UAAT,CAAvB;AACA;AACD;AARF,KASMI,KATN,EADD;AAaA;;AAED,eAAeR,wBAAwB,CAAEC,uBAAF,CAAvC","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 ]\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\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"]}
|
|
@@ -4,7 +4,6 @@ import { createElement } from "@wordpress/element";
|
|
|
4
4
|
/**
|
|
5
5
|
* External dependencies
|
|
6
6
|
*/
|
|
7
|
-
import { isEmpty } from 'lodash';
|
|
8
7
|
import classnames from 'classnames';
|
|
9
8
|
/**
|
|
10
9
|
* WordPress dependencies
|
|
@@ -30,7 +29,7 @@ function PinnedItemsSlot(_ref2) {
|
|
|
30
29
|
} = _ref2;
|
|
31
30
|
return createElement(Slot, _extends({
|
|
32
31
|
name: `PinnedItems/${scope}`
|
|
33
|
-
}, props), fills =>
|
|
32
|
+
}, props), fills => (fills === null || fills === void 0 ? void 0 : fills.length) > 0 && createElement("div", {
|
|
34
33
|
className: classnames(className, 'interface-pinned-items')
|
|
35
34
|
}, fills));
|
|
36
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/pinned-items/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/pinned-items/index.js"],"names":["classnames","Slot","Fill","PinnedItems","scope","props","PinnedItemsSlot","className","fills","length"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,uBAA3B;;AAEA,SAASC,WAAT,OAA4C;AAAA,MAAtB;AAAEC,IAAAA,KAAF;AAAS,OAAGC;AAAZ,GAAsB;AAC3C,SAAO,cAAC,IAAD;AAAM,IAAA,IAAI,EAAI,eAAeD,KAAO;AAApC,KAA6CC,KAA7C,EAAP;AACA;;AAED,SAASC,eAAT,QAA2D;AAAA,MAAjC;AAAEF,IAAAA,KAAF;AAASG,IAAAA,SAAT;AAAoB,OAAGF;AAAvB,GAAiC;AAC1D,SACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAI,eAAeD,KAAO;AAApC,KAA6CC,KAA7C,GACKG,KAAF,IACD,CAAAA,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEC,MAAP,IAAgB,CAAhB,IACC;AACC,IAAA,SAAS,EAAGT,UAAU,CACrBO,SADqB,EAErB,wBAFqB;AADvB,KAMGC,KANH,CAHH,CADD;AAgBA;;AAEDL,WAAW,CAACF,IAAZ,GAAmBK,eAAnB;AAEA,eAAeH,WAAf","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"]}
|
|
@@ -468,9 +468,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
468
468
|
.interface-preferences-modal .components-modal__content {
|
|
469
469
|
padding: 0;
|
|
470
470
|
}
|
|
471
|
-
.interface-preferences-modal .components-modal__content::before {
|
|
472
|
-
content: none;
|
|
473
|
-
}
|
|
474
471
|
}
|
|
475
472
|
|
|
476
473
|
.interface-preferences__tabs .components-tab-panel__tabs {
|
package/build-style/style.css
CHANGED
|
@@ -468,9 +468,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
468
468
|
.interface-preferences-modal .components-modal__content {
|
|
469
469
|
padding: 0;
|
|
470
470
|
}
|
|
471
|
-
.interface-preferences-modal .components-modal__content::before {
|
|
472
|
-
content: none;
|
|
473
|
-
}
|
|
474
471
|
}
|
|
475
472
|
|
|
476
473
|
.interface-preferences__tabs .components-tab-panel__tabs {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/interface",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.0",
|
|
4
4
|
"description": "Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -32,19 +32,18 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
|
-
"@wordpress/a11y": "^3.
|
|
36
|
-
"@wordpress/components": "^19.
|
|
37
|
-
"@wordpress/compose": "^5.
|
|
38
|
-
"@wordpress/data": "^6.
|
|
39
|
-
"@wordpress/deprecated": "^3.
|
|
40
|
-
"@wordpress/element": "^4.
|
|
41
|
-
"@wordpress/i18n": "^4.
|
|
42
|
-
"@wordpress/icons": "^9.
|
|
43
|
-
"@wordpress/plugins": "^4.
|
|
44
|
-
"@wordpress/preferences": "^2.
|
|
45
|
-
"@wordpress/viewport": "^4.
|
|
46
|
-
"classnames": "^2.3.1"
|
|
47
|
-
"lodash": "^4.17.21"
|
|
35
|
+
"@wordpress/a11y": "^3.15.0",
|
|
36
|
+
"@wordpress/components": "^19.17.0",
|
|
37
|
+
"@wordpress/compose": "^5.13.0",
|
|
38
|
+
"@wordpress/data": "^6.15.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.15.0",
|
|
40
|
+
"@wordpress/element": "^4.13.0",
|
|
41
|
+
"@wordpress/i18n": "^4.15.0",
|
|
42
|
+
"@wordpress/icons": "^9.6.0",
|
|
43
|
+
"@wordpress/plugins": "^4.13.0",
|
|
44
|
+
"@wordpress/preferences": "^2.7.0",
|
|
45
|
+
"@wordpress/viewport": "^4.13.0",
|
|
46
|
+
"classnames": "^2.3.1"
|
|
48
47
|
},
|
|
49
48
|
"peerDependencies": {
|
|
50
49
|
"react": "^17.0.0",
|
|
@@ -53,5 +52,5 @@
|
|
|
53
52
|
"publishConfig": {
|
|
54
53
|
"access": "public"
|
|
55
54
|
},
|
|
56
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "08358f53b627a15148c3a3e433cdf58cf8714aa4"
|
|
57
56
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { isEmpty } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -25,7 +20,7 @@ function ActionItemSlot( {
|
|
|
25
20
|
fillProps={ fillProps }
|
|
26
21
|
>
|
|
27
22
|
{ ( fills ) => {
|
|
28
|
-
if (
|
|
23
|
+
if ( ! Children.toArray( fills ).length ) {
|
|
29
24
|
return null;
|
|
30
25
|
}
|
|
31
26
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { omit } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -15,17 +10,14 @@ import { MenuItem } from '@wordpress/components';
|
|
|
15
10
|
import ComplementaryAreaToggle from '../complementary-area-toggle';
|
|
16
11
|
import ActionItem from '../action-item';
|
|
17
12
|
|
|
18
|
-
const PluginsMenuItem = (
|
|
13
|
+
const PluginsMenuItem = ( {
|
|
19
14
|
// Menu item is marked with unstable prop for backward compatibility.
|
|
20
15
|
// They are removed so they don't leak to DOM elements.
|
|
21
16
|
// @see https://github.com/WordPress/gutenberg/issues/14457
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
] ) }
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
17
|
+
__unstableExplicitMenuItem,
|
|
18
|
+
__unstableTarget,
|
|
19
|
+
...restProps
|
|
20
|
+
} ) => <MenuItem { ...restProps } />;
|
|
29
21
|
|
|
30
22
|
export default function ComplementaryAreaMoreMenuItem( {
|
|
31
23
|
scope,
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { omit } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -21,6 +16,7 @@ function ComplementaryAreaToggle( {
|
|
|
21
16
|
identifier,
|
|
22
17
|
icon,
|
|
23
18
|
selectedIcon,
|
|
19
|
+
name,
|
|
24
20
|
...props
|
|
25
21
|
} ) {
|
|
26
22
|
const ComponentToUse = as;
|
|
@@ -42,7 +38,7 @@ function ComplementaryAreaToggle( {
|
|
|
42
38
|
enableComplementaryArea( scope, identifier );
|
|
43
39
|
}
|
|
44
40
|
} }
|
|
45
|
-
{ ...
|
|
41
|
+
{ ...props }
|
|
46
42
|
/>
|
|
47
43
|
);
|
|
48
44
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { isEmpty } from 'lodash';
|
|
5
4
|
import classnames from 'classnames';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -17,7 +16,7 @@ function PinnedItemsSlot( { scope, className, ...props } ) {
|
|
|
17
16
|
return (
|
|
18
17
|
<Slot name={ `PinnedItems/${ scope }` } { ...props }>
|
|
19
18
|
{ ( fills ) =>
|
|
20
|
-
|
|
19
|
+
fills?.length > 0 && (
|
|
21
20
|
<div
|
|
22
21
|
className={ classnames(
|
|
23
22
|
className,
|