@wordpress/interface 4.9.0 → 4.12.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/action-item/index.js +5 -10
  3. package/build/components/action-item/index.js.map +1 -1
  4. package/build/components/complementary-area/index.js.map +1 -1
  5. package/build/components/complementary-area-more-menu-item/index.js +13 -12
  6. package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
  7. package/build/components/complementary-area-toggle/index.js +2 -7
  8. package/build/components/complementary-area-toggle/index.js.map +1 -1
  9. package/build/components/pinned-items/index.js +1 -3
  10. package/build/components/pinned-items/index.js.map +1 -1
  11. package/build/store/actions.js.map +1 -1
  12. package/build-module/components/action-item/index.js +3 -6
  13. package/build-module/components/action-item/index.js.map +1 -1
  14. package/build-module/components/complementary-area/index.js.map +1 -1
  15. package/build-module/components/complementary-area-more-menu-item/index.js +13 -11
  16. package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
  17. package/build-module/components/complementary-area-toggle/index.js +2 -6
  18. package/build-module/components/complementary-area-toggle/index.js.map +1 -1
  19. package/build-module/components/pinned-items/index.js +1 -2
  20. package/build-module/components/pinned-items/index.js.map +1 -1
  21. package/build-module/store/actions.js.map +1 -1
  22. package/build-style/style-rtl.css +0 -3
  23. package/build-style/style.css +0 -3
  24. package/package.json +14 -15
  25. package/src/components/action-item/index.js +3 -6
  26. package/src/components/complementary-area/index.js +6 -9
  27. package/src/components/complementary-area-more-menu-item/index.js +5 -13
  28. package/src/components/complementary-area-toggle/index.js +4 -9
  29. package/src/components/pinned-items/index.js +1 -2
  30. package/src/components/preferences-modal/style.scss +0 -4
  31. package/src/store/actions.js +76 -71
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.12.0 (2022-07-13)
6
+
7
+ ## 4.11.0 (2022-06-29)
8
+
9
+ ## 4.10.0 (2022-06-15)
10
+
5
11
  ## 4.9.0 (2022-06-01)
6
12
 
7
13
  ## 4.8.0 (2022-05-18)
@@ -11,17 +11,13 @@ 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
  */
19
+ const noop = () => {};
20
+
25
21
  function ActionItemSlot(_ref) {
26
22
  let {
27
23
  name,
@@ -35,7 +31,7 @@ function ActionItemSlot(_ref) {
35
31
  bubblesVirtually: bubblesVirtually,
36
32
  fillProps: fillProps
37
33
  }, fills => {
38
- if ((0, _lodash.isEmpty)(_element.Children.toArray(fills))) {
34
+ if (!_element.Children.toArray(fills).length) {
39
35
  return null;
40
36
  } // Special handling exists for backward compatibility.
41
37
  // It ensures that menu items created by plugin authors aren't
@@ -86,9 +82,8 @@ function ActionItem(_ref3) {
86
82
  } = _ref4;
87
83
  return (0, _element.createElement)(Component, (0, _extends2.default)({
88
84
  onClick: onClick || fpOnClick ? function () {
89
- (onClick || _lodash.noop)(...arguments);
90
-
91
- (fpOnClick || _lodash.noop)(...arguments);
85
+ (onClick || noop)(...arguments);
86
+ (fpOnClick || noop)(...arguments);
92
87
  } : undefined
93
88
  }, props));
94
89
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/action-item/index.js"],"names":["ActionItemSlot","name","as","Component","ButtonGroup","fillProps","bubblesVirtually","props","fills","Children","toArray","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","Button","onClick","fpOnClick","noop","undefined","Slot"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,cAAT,OAMI;AAAA,MANqB;AACxBC,IAAAA,IADwB;AAExBC,IAAAA,EA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,KACG,SAA8B;AAAA,QAA5B;AAAEqB,MAAAA,OAAO,EAAEC;AAAX,KAA4B;AAC/B,WACC,4BAAC,SAAD;AACC,MAAA,OAAO,EACND,OAAO,IAAIC,SAAX,GACG,YAAe;AACf,SAAED,OAAO,IAAIE,YAAb,EAAqB,YAArB;;AACA,SAAED,SAAS,IAAIC,YAAf,EAAuB,YAAvB;AACC,OAJJ,GAKGC;AAPL,OASMlB,KATN,EADD;AAaA,GAfF,CADD;AAmBA;;AAEDa,UAAU,CAACM,IAAX,GAAkB1B,cAAlB;eAEeoB,U","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty, noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\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 ( isEmpty( Children.toArray( fills ) ) ) {\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
+ {"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,IAAA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AAGN;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"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"names":["ComplementaryAreaSlot","scope","props","ComplementaryAreaFill","children","className","useAdjustComplementaryListener","identifier","activeArea","isActive","isSmall","previousIsSmall","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","interfaceStore","current","ComplementaryArea","closeLabel","header","headerClassName","icon","isPinnable","panelClassName","name","smallScreenTitle","title","toggleShortcut","isActiveByDefault","showIconLabels","isPinned","isLarge","select","getActiveComplementaryArea","isItemPinned","_activeArea","viewportStore","isViewportMatch","pinItem","unpinItem","undefined","check","label","shortcut","star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AA,SAAS,EAAGP;AAAnB,KAAsCnB,QAAtC,CA9CD,CA7BF,CADD;AAiFA;;AAED,MAAM0C,wBAAwB,GAAG,uCAChC7B,iBADgC,CAAjC;AAIA6B,wBAAwB,CAACC,IAAzB,GAAgC/C,qBAAhC;eAEe8C,wB","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';\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 } ) {\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<div className={ className }>{ children }</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 } = useDispatch(\n\t\tinterfaceStore\n\t);\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\t// Disable the complementary area.\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size 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 enabled when we go from small to big window size\n\t\t\t// and we are going 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 enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\t// Enable the complementary area.\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 reopened but another complementary area becomes active,\n\t\t\t// remove 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}, [ isActive, isSmall, scope, identifier, activeArea ] );\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\tshowIconLabels = false,\n} ) {\n\tconst { isActive, isPinned, activeArea, isSmall, isLarge } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveComplementaryArea, isItemPinned } = select(\n\t\t\t\tinterfaceStore\n\t\t\t);\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\t\t\treturn {\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};\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\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t}\n\t}, [ activeArea, isActiveByDefault, scope, identifier, isSmall ] );\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\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/>\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>\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<strong>{ title }</strong>\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 = withComplementaryAreaContext(\n\tComplementaryArea\n);\n\nComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryAreaWrapped;\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"names":["ComplementaryAreaSlot","scope","props","ComplementaryAreaFill","children","className","useAdjustComplementaryListener","identifier","activeArea","isActive","isSmall","previousIsSmall","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","interfaceStore","current","ComplementaryArea","closeLabel","header","headerClassName","icon","isPinnable","panelClassName","name","smallScreenTitle","title","toggleShortcut","isActiveByDefault","showIconLabels","isPinned","isLarge","select","getActiveComplementaryArea","isItemPinned","_activeArea","viewportStore","isViewportMatch","pinItem","unpinItem","undefined","check","label","shortcut","starFilled","starEmpty","ComplementaryAreaWrapped","Slot"],"mappings":";;;;;;;;;AAYA;;;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAQA,SAASA,qBAAT,OAAsD;AAAA,MAAtB;AAAEC,IAAAA,KAAF;AAAS,OAAGC;AAAZ,GAAsB;AACrD,SAAO,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,qBAAqBD,KAAO;AAA1C,KAAmDC,KAAnD,EAAP;AACA;;AAED,SAASC,qBAAT,QAAiE;AAAA,MAAjC;AAAEF,IAAAA,KAAF;AAASG,IAAAA,QAAT;AAAmBC,IAAAA;AAAnB,GAAiC;AAChE,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAA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G,MAAMJ,wBAAwB,CAAEb,KAAF,CAHzC;AAIC,IAAA,gBAAgB,EAAGwB,gBAJpB;AAKC,IAAA,iBAAiB,EAAG;AACnBiB,MAAAA,KAAK,EAAExB,UADY;AAEnByB,MAAAA,QAAQ,EAAEhB,cAFS;AAGnB1B,MAAAA,KAHmB;AAInBM,MAAAA;AAJmB;AALrB,KAYGY,MAAM,IACP,qDACC,4CAAUO,KAAV,CADD,EAEGJ,UAAU,IACX,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,IAAI,EACHQ,QAAQ,GAAGc,iBAAH,GAAgBC,gBAH1B;AAKC,IAAA,KAAK,EACJf,QAAQ,GACL,cAAI,oBAAJ,CADK,GAEL,cAAI,gBAAJ,CARL;AAUC,IAAA,OAAO,EAAG,MACT,CAAEA,QAAQ,GAAGS,SAAH,GAAeD,OAAzB,EACCrC,KADD,EAECM,UAFD,CAXF;AAgBC,IAAA,SAAS,EAAGuB,QAhBb;AAiBC,qBAAgBA;AAjBjB,IAHF,CAbF,CAPD,EA8CC,4BAAC,iBAAD;AAAO,IAAA,SAAS,EAAGP;AAAnB,KAAsCnB,QAAtC,CA9CD,CA7BF,CADD;AAiFA;;AAED,MAAM0C,wBAAwB,GAC7B,uCAA8B7B,iBAA9B,CADD;AAGA6B,wBAAwB,CAACC,IAAzB,GAAgC/C,qBAAhC;eAEe8C,wB","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';\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 } ) {\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<div className={ className }>{ children }</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 a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\t// Disable the complementary area.\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size 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 enabled when we go from small to big window size\n\t\t\t// and we are going 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 enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\t// Enable the complementary area.\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 reopened but another complementary area becomes active,\n\t\t\t// remove 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}, [ isActive, isSmall, scope, identifier, activeArea ] );\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\tshowIconLabels = false,\n} ) {\n\tconst { isActive, isPinned, activeArea, isSmall, isLarge } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveComplementaryArea, isItemPinned } =\n\t\t\t\tselect( interfaceStore );\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\t\t\treturn {\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};\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\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t}\n\t}, [ activeArea, isActiveByDefault, scope, identifier, isSmall ] );\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\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/>\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>\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<strong>{ title }</strong>\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"]}
@@ -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 = props => // Menu item is marked with unstable prop for backward compatibility.
36
- // They are removed so they don't leak to DOM elements.
37
- // @see https://github.com/WordPress/gutenberg/issues/14457
38
- (0, _element.createElement)(_components.MenuItem, (0, _lodash.omit)(props, ['__unstableExplicitMenuItem', '__unstableTarget']));
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(_ref) {
41
+ function ComplementaryAreaMoreMenuItem(_ref2) {
41
42
  let {
42
43
  scope,
43
44
  target,
44
45
  __unstableExplicitMenuItem,
45
46
  ...props
46
- } = _ref;
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","props","ComplementaryAreaMoreMenuItem","scope","target","__unstableExplicitMenuItem","toggleProps","check"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAIA,MAAMA,eAAe,GAAKC,KAAF,IACvB;AACA;AACA;AACA,4BAAC,oBAAD,EACM,kBAAMA,KAAN,EAAa,CACjB,4BADiB,EAEjB,kBAFiB,CAAb,CADN,CAJD;;AAYe,SAASC,6BAAT,OAKX;AAAA,MALmD;AACtDC,IAAAA,KADsD;AAEtDC,IAAAA,MAFsD;AAGtDC,IAAAA,0BAHsD;AAItD,OAAGJ;AAJmD,GAKnD;AACH,SACC,4BAAC,gCAAD;AACC,IAAA,EAAE,EAAKK,WAAF,IAAmB;AACvB,aACC,4BAAC,mBAAD;AACC,QAAA,0BAA0B,EACzBD,0BAFF;AAIC,QAAA,gBAAgB,EAAI,GAAGF,KAAO,IAAIC,MAAQ,EAJ3C;AAKC,QAAA,EAAE,EAAGJ,eALN;AAMC,QAAA,IAAI,EAAI,GAAGG,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,KAkBMF,KAlBN,EADD;AAsBA","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\n\n/**\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 = ( props ) => (\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<MenuItem\n\t\t{ ...omit( props, [\n\t\t\t'__unstableExplicitMenuItem',\n\t\t\t'__unstableTarget',\n\t\t] ) }\n\t/>\n);\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
+ {"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
- }, (0, _lodash.omit)(props, ['name'])));
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;;AAKA;;AACA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,uBAAT,OAOI;AAAA,MAP8B;AACjCC,IAAAA,EAAE,GAAGC,kBAD4B;AAEjCC,IAAAA,KAFiC;AAGjCC,IAAAA,UAHiC;AAIjCC,IAAAA,IAJiC;AAKjCC,IAAAA,YALiC;AAMjC,OAAGC;AAN8B,GAO9B;AACH,QAAMC,cAAc,GAAGP,EAAvB;AACA,QAAMQ,UAAU,GAAG,qBAChBC,MAAF,IACCA,MAAM,CAAEC,YAAF,CAAN,CAAyBC,0BAAzB,CAAqDT,KAArD,MACAC,UAHiB,EAIlB,CAAEA,UAAF,CAJkB,CAAnB;AAMA,QAAM;AAAES,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MAAwD,uBAC7DH,YAD6D,CAA9D;AAGA,SACC,4BAAC,cAAD;AACC,IAAA,IAAI,EAAGL,YAAY,IAAIG,UAAhB,GAA6BH,YAA7B,GAA4CD,IADpD;AAEC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKI,UAAL,EAAkB;AACjBK,QAAAA,wBAAwB,CAAEX,KAAF,CAAxB;AACA,OAFD,MAEO;AACNU,QAAAA,uBAAuB,CAAEV,KAAF,EAASC,UAAT,CAAvB;AACA;AACD;AARF,KASM,kBAAMG,KAAN,EAAa,CAAE,MAAF,CAAb,CATN,EADD;AAaA;;eAEc,uCAA0BP,uBAA1B,C","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\n\n/**\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\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 } = useDispatch(\n\t\tinterfaceStore\n\t);\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{ ...omit( props, [ 'name' ] ) }\n\t\t/>\n\t);\n}\n\nexport default complementaryAreaContext( ComplementaryAreaToggle );\n"]}
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 => !(0, _lodash.isEmpty)(fills) && (0, _element.createElement)("div", {
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;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;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,CAAE,qBAASA,KAAT,CAAF,IACC;AACC,IAAA,SAAS,EAAG,yBACXD,SADW,EAEX,wBAFW;AADb,KAMGC,KANH,CAHH,CADD;AAgBA;;AAEDL,WAAW,CAACM,IAAZ,GAAmBH,eAAnB;eAEeH,W","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\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\t! isEmpty( fills ) && (\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
+ {"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 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/store/actions.js"],"names":["setDefaultComplementaryArea","scope","area","type","enableComplementaryArea","registry","dispatch","isComplementaryAreaVisible","select","preferencesStore","get","set","disableComplementaryArea","pinItem","item","pinnedItems","unpinItem","toggleFeature","featureName","since","alternative","toggle","setFeatureValue","value","setFeatureDefaults","defaults","setDefaults"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,2BAA2B,GAAG,CAAEC,KAAF,EAASC,IAAT,MAAqB;AAC/DC,EAAAA,IAAI,EAAE,gCADyD;AAE/DF,EAAAA,KAF+D;AAG/DC,EAAAA;AAH+D,CAArB,CAApC;AAMP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAME,uBAAuB,GAAG,CAAEH,KAAF,EAASC,IAAT,KAAmB,QAGnD;AAAA,MAHqD;AAC3DG,IAAAA,QAD2D;AAE3DC,IAAAA;AAF2D,GAGrD;;AACN;AACA,MAAK,CAAEJ,IAAP,EAAc;AACb;AACA;;AAED,QAAMK,0BAA0B,GAAGF,QAAQ,CACzCG,MADiC,CACzBC,kBADyB,EAEjCC,GAFiC,CAE5BT,KAF4B,EAErB,4BAFqB,CAAnC;;AAIA,MAAK,CAAEM,0BAAP,EAAoC;AACnCF,IAAAA,QAAQ,CACNC,QADF,CACYG,kBADZ,EAEEE,GAFF,CAEOV,KAFP,EAEc,4BAFd,EAE4C,IAF5C;AAGA;;AAEDK,EAAAA,QAAQ,CAAE;AACTH,IAAAA,IAAI,EAAE,2BADG;AAETF,IAAAA,KAFS;AAGTC,IAAAA;AAHS,GAAF,CAAR;AAKA,CAxBM;AA0BP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMU,wBAAwB,GAAKX,KAAF,IAAa,SAAoB;AAAA,MAAlB;AAAEI,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AsCiB,WAAtC,CAAmDzB,KAAnD,EAA0DwB,QAA1D;AACA,GAPD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Set a default complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n *\n * @return {Object} Action object.\n */\nexport const setDefaultComplementaryArea = ( scope, area ) => ( {\n\ttype: 'SET_DEFAULT_COMPLEMENTARY_AREA',\n\tscope,\n\tarea,\n} );\n\n/**\n * Enable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n */\nexport const enableComplementaryArea = ( scope, area ) => ( {\n\tregistry,\n\tdispatch,\n} ) => {\n\t// Return early if there's no area.\n\tif ( ! area ) {\n\t\treturn;\n\t}\n\n\tconst isComplementaryAreaVisible = registry\n\t\t.select( preferencesStore )\n\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\tif ( ! isComplementaryAreaVisible ) {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, 'isComplementaryAreaVisible', true );\n\t}\n\n\tdispatch( {\n\t\ttype: 'ENABLE_COMPLEMENTARY_AREA',\n\t\tscope,\n\t\tarea,\n\t} );\n};\n\n/**\n * Disable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n */\nexport const disableComplementaryArea = ( scope ) => ( { registry } ) => {\n\tconst isComplementaryAreaVisible = registry\n\t\t.select( preferencesStore )\n\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\tif ( isComplementaryAreaVisible ) {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, 'isComplementaryAreaVisible', false );\n\t}\n};\n\n/**\n * Pins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n *\n * @return {Object} Action object.\n */\nexport const pinItem = ( scope, item ) => ( { registry } ) => {\n\t// Return early if there's no item.\n\tif ( ! item ) {\n\t\treturn;\n\t}\n\n\tconst pinnedItems = registry\n\t\t.select( preferencesStore )\n\t\t.get( scope, 'pinnedItems' );\n\n\t// The item is already pinned, there's nothing to do.\n\tif ( pinnedItems?.[ item ] === true ) {\n\t\treturn;\n\t}\n\n\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t...pinnedItems,\n\t\t[ item ]: true,\n\t} );\n};\n\n/**\n * Unpins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n */\nexport const unpinItem = ( scope, item ) => ( { registry } ) => {\n\t// Return early if there's no item.\n\tif ( ! item ) {\n\t\treturn;\n\t}\n\n\tconst pinnedItems = registry\n\t\t.select( preferencesStore )\n\t\t.get( scope, 'pinnedItems' );\n\n\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t...pinnedItems,\n\t\t[ item ]: false,\n\t} );\n};\n\n/**\n * Returns an action object used in signalling that a feature should be toggled.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n */\nexport function toggleFeature( scope, featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).toggleFeature`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).toggle`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).toggle( scope, featureName );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a feature should be set to\n * a true or false value\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n * @param {boolean} value The value to set.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureValue( scope, featureName, value ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureValue`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).set`,\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, featureName, !! value );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that defaults should be set for features.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {Object<string, boolean>} defaults A key/value map of feature names to values.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureDefaults( scope, defaults ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureDefaults`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).setDefaults`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).setDefaults( scope, defaults );\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/store/actions.js"],"names":["setDefaultComplementaryArea","scope","area","type","enableComplementaryArea","registry","dispatch","isComplementaryAreaVisible","select","preferencesStore","get","set","disableComplementaryArea","pinItem","item","pinnedItems","unpinItem","toggleFeature","featureName","since","alternative","toggle","setFeatureValue","value","setFeatureDefaults","defaults","setDefaults"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,2BAA2B,GAAG,CAAEC,KAAF,EAASC,IAAT,MAAqB;AAC/DC,EAAAA,IAAI,EAAE,gCADyD;AAE/DF,EAAAA,KAF+D;AAG/DC,EAAAA;AAH+D,CAArB,CAApC;AAMP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAME,uBAAuB,GACnC,CAAEH,KAAF,EAASC,IAAT,KACA,QAA8B;AAAA,MAA5B;AAAEG,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAA4B;;AAC7B;AACA,MAAK,CAAEJ,IAAP,EAAc;AACb;AACA;;AAED,QAAMK,0BAA0B,GAAGF,QAAQ,CACzCG,MADiC,CACzBC,kBADyB,EAEjCC,GAFiC,CAE5BT,KAF4B,EAErB,4BAFqB,CAAnC;;AAIA,MAAK,CAAEM,0BAAP,EAAoC;AACnCF,IAAAA,QAAQ,CACNC,QADF,CACYG,kBADZ,EAEEE,GAFF,CAE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CAA6BvB,KAA7B,EAAoCwB,QAApC,EAA+C;AACrD,SAAO,iBAA0B;AAAA,QAAf;AAAEpB,MAAAA;AAAF,KAAe;AAChC,6BAAa,iDAAb,EAA+D;AAC9Dc,MAAAA,KAAK,EAAE,KADuD;AAE9DC,MAAAA,WAAW,EAAG;AAFgD,KAA/D;AAKAf,IAAAA,QAAQ,CAACC,QAAT,CAAmBG,kBAAnB,EAAsCiB,WAAtC,CAAmDzB,KAAnD,EAA0DwB,QAA1D;AACA,GAPD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Set a default complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n *\n * @return {Object} Action object.\n */\nexport const setDefaultComplementaryArea = ( scope, area ) => ( {\n\ttype: 'SET_DEFAULT_COMPLEMENTARY_AREA',\n\tscope,\n\tarea,\n} );\n\n/**\n * Enable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n */\nexport const enableComplementaryArea =\n\t( scope, area ) =>\n\t( { registry, dispatch } ) => {\n\t\t// Return early if there's no area.\n\t\tif ( ! area ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( ! isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', true );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'ENABLE_COMPLEMENTARY_AREA',\n\t\t\tscope,\n\t\t\tarea,\n\t\t} );\n\t};\n\n/**\n * Disable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n */\nexport const disableComplementaryArea =\n\t( scope ) =>\n\t( { registry } ) => {\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', false );\n\t\t}\n\t};\n\n/**\n * Pins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n *\n * @return {Object} Action object.\n */\nexport const pinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\t// The item is already pinned, there's nothing to do.\n\t\tif ( pinnedItems?.[ item ] === true ) {\n\t\t\treturn;\n\t\t}\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: true,\n\t\t} );\n\t};\n\n/**\n * Unpins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n */\nexport const unpinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: false,\n\t\t} );\n\t};\n\n/**\n * Returns an action object used in signalling that a feature should be toggled.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n */\nexport function toggleFeature( scope, featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).toggleFeature`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).toggle`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).toggle( scope, featureName );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a feature should be set to\n * a true or false value\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n * @param {boolean} value The value to set.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureValue( scope, featureName, value ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureValue`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).set`,\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, featureName, !! value );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that defaults should be set for features.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {Object<string, boolean>} defaults A key/value map of feature names to values.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureDefaults( scope, defaults ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureDefaults`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).setDefaults`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).setDefaults( scope, defaults );\n\t};\n}\n"]}
@@ -1,17 +1,14 @@
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, noop } 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
 
10
+ const noop = () => {};
11
+
15
12
  function ActionItemSlot(_ref) {
16
13
  let {
17
14
  name,
@@ -25,7 +22,7 @@ function ActionItemSlot(_ref) {
25
22
  bubblesVirtually: bubblesVirtually,
26
23
  fillProps: fillProps
27
24
  }, fills => {
28
- if (isEmpty(Children.toArray(fills))) {
25
+ if (!Children.toArray(fills).length) {
29
26
  return null;
30
27
  } // Special handling exists for backward compatibility.
31
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":["isEmpty","noop","ButtonGroup","Button","Slot","Fill","Children","ActionItemSlot","name","as","Component","fillProps","bubblesVirtually","props","fills","toArray","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","onClick","fpOnClick","undefined"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,OAAT,EAAkBC,IAAlB,QAA8B,QAA9B;AAEA;AACA;AACA;;AACA,SAASC,WAAT,EAAsBC,MAAtB,EAA8BC,IAA9B,EAAoCC,IAApC,QAAgD,uBAAhD;AACA,SAASC,QAAT,QAAyB,oBAAzB;;AAEA,SAASC,cAAT,OAMI;AAAA,MANqB;AACxBC,IAAAA,IADwB;AAExBC,IAAAA,EAAE,EAAEC,SAAS,GAAGR,WAFQ;AAGxBS,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,QAAKd,OAAO,CAAEM,QAAQ,CAACS,OAAT,CAAkBD,KAAlB,CAAF,CAAZ,EAA4C;AAC3C,aAAO,IAAP;AACA,KAHa,CAKd;AACA;AACA;AACA;AACA;;;AACA,UAAME,oBAAoB,GAAG,EAA7B;AACAV,IAAAA,QAAQ,CAACW,OAAT,CACCH,KADD,EAEC,SAEO;AAAA,UAFL;AACDD,QAAAA,KAAK,EAAE;AAAEK,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,GAAGf,QAAQ,CAACgB,GAAT,CAAcR,KAAd,EAAuBS,KAAF,IAAa;AAClD,UACC,CAAEA,KAAK,CAACV,KAAN,CAAYK,0BAAd,IACAF,oBAAoB,CAACQ,QAArB,CACCD,KAAK,CAACV,KAAN,CAAYM,gBADb,CAFD,EAKE;AACD,eAAO,IAAP;AACA;;AACD,aAAOI,KAAP;AACA,KAVgB,CAAjB;AAYA,WAAO,cAAC,SAAD,EAAgBV,KAAhB,EAA0BQ,QAA1B,CAAP;AACA,GAvCF,CADD;AA2CA;;AAED,SAASI,UAAT,QAA2E;AAAA,MAAtD;AAAEjB,IAAAA,IAAF;AAAQC,IAAAA,EAAE,EAAEC,SAAS,GAAGP,MAAxB;AAAgCuB,IAAAA,OAAhC;AAAyC,OAAGb;AAA5C,GAAsD;AAC1E,SACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAGL;AAAb,KACG,SAA8B;AAAA,QAA5B;AAAEkB,MAAAA,OAAO,EAAEC;AAAX,KAA4B;AAC/B,WACC,cAAC,SAAD;AACC,MAAA,OAAO,EACND,OAAO,IAAIC,SAAX,GACG,YAAe;AACf,SAAED,OAAO,IAAIzB,IAAb,EAAqB,YAArB;AACA,SAAE0B,SAAS,IAAI1B,IAAf,EAAuB,YAAvB;AACC,OAJJ,GAKG2B;AAPL,OASMf,KATN,EADD;AAaA,GAfF,CADD;AAmBA;;AAEDY,UAAU,CAACrB,IAAX,GAAkBG,cAAlB;AAEA,eAAekB,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty, noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\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 ( isEmpty( Children.toArray( fills ) ) ) {\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
+ {"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 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"names":["classnames","Button","Panel","Slot","Fill","useDispatch","useSelect","__","check","starEmpty","starFilled","useEffect","useRef","store","viewportStore","ComplementaryAreaHeader","ComplementaryAreaMoreMenuItem","ComplementaryAreaToggle","withComplementaryAreaContext","PinnedItems","interfaceStore","ComplementaryAreaSlot","scope","props","ComplementaryAreaFill","children","className","useAdjustComplementaryListener","identifier","activeArea","isActive","isSmall","previousIsSmall","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","current","ComplementaryArea","closeLabel","header","headerClassName","icon","isPinnable","panelClassName","name","smallScreenTitle","title","toggleShortcut","isActiveByDefault","showIconLabels","isPinned","isLarge","select","getActiveComplementaryArea","isItemPinned","_activeArea","isViewportMatch","pinItem","unpinItem","undefined","label","shortcut","ComplementaryAreaWrapped"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,EAAiBC,KAAjB,EAAwBC,IAAxB,EAA8BC,IAA9B,QAA0C,uBAA1C;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAT,EAAgBC,SAAhB,EAA2BC,UAA3B,QAA6C,kBAA7C;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SAASC,KAAK,IA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,GAAGQ,SAAH,GAAeD,OAAzB,EACCnC,KADD,EAECM,UAFD,CAXF;AAgBC,IAAA,SAAS,EAAGsB,QAhBb;AAiBC,qBAAgBA;AAjBjB,IAHF,CAbF,CAPD,EA8CC,cAAC,KAAD;AAAO,IAAA,SAAS,EAAGP;AAAnB,KAAsClB,QAAtC,CA9CD,CA7BF,CADD;AAiFA;;AAED,MAAMqC,wBAAwB,GAAG5C,4BAA4B,CAC5DmB,iBAD4D,CAA7D;AAIAyB,wBAAwB,CAAC3D,IAAzB,GAAgCkB,qBAAhC;AAEA,eAAeyC,wBAAf","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';\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 } ) {\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<div className={ className }>{ children }</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 } = useDispatch(\n\t\tinterfaceStore\n\t);\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\t// Disable the complementary area.\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size 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 enabled when we go from small to big window size\n\t\t\t// and we are going 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 enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\t// Enable the complementary area.\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 reopened but another complementary area becomes active,\n\t\t\t// remove 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}, [ isActive, isSmall, scope, identifier, activeArea ] );\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\tshowIconLabels = false,\n} ) {\n\tconst { isActive, isPinned, activeArea, isSmall, isLarge } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveComplementaryArea, isItemPinned } = select(\n\t\t\t\tinterfaceStore\n\t\t\t);\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\t\t\treturn {\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};\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\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t}\n\t}, [ activeArea, isActiveByDefault, scope, identifier, isSmall ] );\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\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/>\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>\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<strong>{ title }</strong>\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 = withComplementaryAreaContext(\n\tComplementaryArea\n);\n\nComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryAreaWrapped;\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"names":["classnames","Button","Panel","Slot","Fill","useDispatch","useSelect","__","check","starEmpty","starFilled","useEffect","useRef","store","viewportStore","ComplementaryAreaHeader","ComplementaryAreaMoreMenuItem","ComplementaryAreaToggle","withComplementaryAreaContext","PinnedItems","interfaceStore","ComplementaryAreaSlot","scope","props","ComplementaryAreaFill","children","className","useAdjustComplementaryListener","identifier","activeArea","isActive","isSmall","previousIsSmall","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","current","ComplementaryArea","closeLabel","header","headerClassName","icon","isPinnable","panelClassName","name","smallScreenTitle","title","toggleShortcut","isActiveByDefault","showIconLabels","isPinned","isLarge","select","getActiveComplementaryArea","isItemPinned","_activeArea","isViewportMatch","pinItem","unpinItem","undefined","label","shortcut","ComplementaryAreaWrapped"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,EAAiBC,KAAjB,EAAwBC,IAAxB,EAA8BC,IAA9B,QAA0C,uBAA1C;AACA,SAASC,WAAT,EAAsBC,SAAtB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GAAGxC,UAAH,GAAgBD,SAH1B;AAKC,IAAA,KAAK,EACJyC,QAAQ,GACL3C,EAAE,CAAE,oBAAF,CADG,GAELA,EAAE,CAAE,gBAAF,CARP;AAUC,IAAA,OAAO,EAAG,MACT,CAAE2C,QAAQ,GAAGQ,SAAH,GAAeD,OAAzB,EACCnC,KADD,EAECM,UAFD,CAXF;AAgBC,IAAA,SAAS,EAAGsB,QAhBb;AAiBC,qBAAgBA;AAjBjB,IAHF,CAbF,CAPD,EA8CC,cAAC,KAAD;AAAO,IAAA,SAAS,EAAGP;AAAnB,KAAsClB,QAAtC,CA9CD,CA7BF,CADD;AAiFA;;AAED,MAAMqC,wBAAwB,GAC7B5C,4BAA4B,CAAEmB,iBAAF,CAD7B;AAGAyB,wBAAwB,CAAC3D,IAAzB,GAAgCkB,qBAAhC;AAEA,eAAeyC,wBAAf","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';\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 } ) {\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<div className={ className }>{ children }</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 a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\t// Disable the complementary area.\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size 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 enabled when we go from small to big window size\n\t\t\t// and we are going 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 enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\t// Enable the complementary area.\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 reopened but another complementary area becomes active,\n\t\t\t// remove 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}, [ isActive, isSmall, scope, identifier, activeArea ] );\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\tshowIconLabels = false,\n} ) {\n\tconst { isActive, isPinned, activeArea, isSmall, isLarge } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveComplementaryArea, isItemPinned } =\n\t\t\t\tselect( interfaceStore );\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\t\t\treturn {\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};\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\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t}\n\t}, [ activeArea, isActiveByDefault, scope, identifier, isSmall ] );\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\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/>\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>\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<strong>{ title }</strong>\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"]}
@@ -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 = props => // Menu item is marked with unstable prop for backward compatibility.
22
- // They are removed so they don't leak to DOM elements.
23
- // @see https://github.com/WordPress/gutenberg/issues/14457
24
- createElement(MenuItem, omit(props, ['__unstableExplicitMenuItem', '__unstableTarget']));
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(_ref) {
28
+ export default function ComplementaryAreaMoreMenuItem(_ref2) {
27
29
  let {
28
30
  scope,
29
31
  target,
30
32
  __unstableExplicitMenuItem,
31
33
  ...props
32
- } = _ref;
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":["omit","check","MenuItem","ComplementaryAreaToggle","ActionItem","PluginsMenuItem","props","ComplementaryAreaMoreMenuItem","scope","target","__unstableExplicitMenuItem","toggleProps"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SAASC,QAAT,QAAyB,uBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,UAAP,MAAuB,gBAAvB;;AAEA,MAAMC,eAAe,GAAKC,KAAF,IACvB;AACA;AACA;AACA,cAAC,QAAD,EACMN,IAAI,CAAEM,KAAF,EAAS,CACjB,4BADiB,EAEjB,kBAFiB,CAAT,CADV,CAJD;;AAYA,eAAe,SAASC,6BAAT,OAKX;AAAA,MALmD;AACtDC,IAAAA,KADsD;AAEtDC,IAAAA,MAFsD;AAGtDC,IAAAA,0BAHsD;AAItD,OAAGJ;AAJmD,GAKnD;AACH,SACC,cAAC,uBAAD;AACC,IAAA,EAAE,EAAKK,WAAF,IAAmB;AACvB,aACC,cAAC,UAAD;AACC,QAAA,0BAA0B,EACzBD,0BAFF;AAIC,QAAA,gBAAgB,EAAI,GAAGF,KAAO,IAAIC,MAAQ,EAJ3C;AAKC,QAAA,EAAE,EAAGJ,eALN;AAMC,QAAA,IAAI,EAAI,GAAGG,KAAO;AANnB,SAOMG,WAPN,EADD;AAWA,KAbF;AAcC,IAAA,IAAI,EAAC,kBAdN;AAeC,IAAA,YAAY,EAAGV,KAfhB;AAgBC,IAAA,IAAI,EAAGQ,MAhBR;AAiBC,IAAA,KAAK,EAAGD;AAjBT,KAkBMF,KAlBN,EADD;AAsBA","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\n\n/**\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 = ( props ) => (\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<MenuItem\n\t\t{ ...omit( props, [\n\t\t\t'__unstableExplicitMenuItem',\n\t\t\t'__unstableTarget',\n\t\t] ) }\n\t/>\n);\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
+ {"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
- }, omit(props, ['name'])));
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":["omit","Button","useDispatch","useSelect","store","interfaceStore","complementaryAreaContext","ComplementaryAreaToggle","as","scope","identifier","icon","selectedIcon","props","ComponentToUse","isSelected","select","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,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,OAOI;AAAA,MAP8B;AACjCC,IAAAA,EAAE,GAAGP,MAD4B;AAEjCQ,IAAAA,KAFiC;AAGjCC,IAAAA,UAHiC;AAIjCC,IAAAA,IAJiC;AAKjCC,IAAAA,YALiC;AAMjC,OAAGC;AAN8B,GAO9B;AACH,QAAMC,cAAc,GAAGN,EAAvB;AACA,QAAMO,UAAU,GAAGZ,SAAS,CACzBa,MAAF,IACCA,MAAM,CAAEX,cAAF,CAAN,CAAyBY,0BAAzB,CAAqDR,KAArD,MACAC,UAH0B,EAI3B,CAAEA,UAAF,CAJ2B,CAA5B;AAMA,QAAM;AAAEQ,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MAAwDjB,WAAW,CACxEG,cADwE,CAAzE;AAGA,SACC,cAAC,cAAD;AACC,IAAA,IAAI,EAAGO,YAAY,IAAIG,UAAhB,GAA6BH,YAA7B,GAA4CD,IADpD;AAEC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKI,UAAL,EAAkB;AACjBI,QAAAA,wBAAwB,CAAEV,KAAF,CAAxB;AACA,OAFD,MAEO;AACNS,QAAAA,uBAAuB,CAAET,KAAF,EAASC,UAAT,CAAvB;AACA;AACD;AARF,KASMV,IAAI,CAAEa,KAAF,EAAS,CAAE,MAAF,CAAT,CATV,EADD;AAaA;;AAED,eAAeP,wBAAwB,CAAEC,uBAAF,CAAvC","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\n\n/**\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\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 } = useDispatch(\n\t\tinterfaceStore\n\t);\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{ ...omit( props, [ 'name' ] ) }\n\t\t/>\n\t);\n}\n\nexport default complementaryAreaContext( ComplementaryAreaToggle );\n"]}
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 => !isEmpty(fills) && createElement("div", {
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":["isEmpty","classnames","Slot","Fill","PinnedItems","scope","props","PinnedItemsSlot","className","fills"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AACA,OAAOC,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,CAAET,OAAO,CAAES,KAAF,CAAT,IACC;AACC,IAAA,SAAS,EAAGR,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 { isEmpty } from 'lodash';\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\t! isEmpty( fills ) && (\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
+ {"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"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/store/actions.js"],"names":["deprecated","store","preferencesStore","setDefaultComplementaryArea","scope","area","type","enableComplementaryArea","registry","dispatch","isComplementaryAreaVisible","select","get","set","disableComplementaryArea","pinItem","item","pinnedItems","unpinItem","toggleFeature","featureName","since","alternative","toggle","setFeatureValue","value","setFeatureDefaults","defaults","setDefaults"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,uBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,2BAA2B,GAAG,CAAEC,KAAF,EAASC,IAAT,MAAqB;AAC/DC,EAAAA,IAAI,EAAE,gCADyD;AAE/DF,EAAAA,KAF+D;AAG/DC,EAAAA;AAH+D,CAArB,CAApC;AAMP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAME,uBAAuB,GAAG,CAAEH,KAAF,EAASC,IAAT,KAAmB,QAGnD;AAAA,MAHqD;AAC3DG,IAAAA,QAD2D;AAE3DC,IAAAA;AAF2D,GAGrD;;AACN;AACA,MAAK,CAAEJ,IAAP,EAAc;AACb;AACA;;AAED,QAAMK,0BAA0B,GAAGF,QAAQ,CACzCG,MADiC,CACzBT,gBADyB,EAEjCU,GAFiC,CAE5BR,KAF4B,EAErB,4BAFqB,CAAnC;;AAIA,MAAK,CAAEM,0BAAP,EAAoC;AACnCF,IAAAA,QAAQ,CACNC,QADF,CACYP,gBADZ,EAEEW,GAFF,CAEOT,KAFP,EAEc,4BAFd,EAE4C,IAF5C;AAGA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ACA;AACA;;AACA,OAAO,SAASC,kBAAT,CAA6BtB,KAA7B,EAAoCuB,QAApC,EAA+C;AACrD,SAAO,iBAA0B;AAAA,QAAf;AAAEnB,MAAAA;AAAF,KAAe;AAChCR,IAAAA,UAAU,CAAG,iDAAH,EAAqD;AAC9DqB,MAAAA,KAAK,EAAE,KADuD;AAE9DC,MAAAA,WAAW,EAAG;AAFgD,KAArD,CAAV;AAKAd,IAAAA,QAAQ,CAACC,QAAT,CAAmBP,gBAAnB,EAAsC0B,WAAtC,CAAmDxB,KAAnD,EAA0DuB,QAA1D;AACA,GAPD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Set a default complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n *\n * @return {Object} Action object.\n */\nexport const setDefaultComplementaryArea = ( scope, area ) => ( {\n\ttype: 'SET_DEFAULT_COMPLEMENTARY_AREA',\n\tscope,\n\tarea,\n} );\n\n/**\n * Enable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n */\nexport const enableComplementaryArea = ( scope, area ) => ( {\n\tregistry,\n\tdispatch,\n} ) => {\n\t// Return early if there's no area.\n\tif ( ! area ) {\n\t\treturn;\n\t}\n\n\tconst isComplementaryAreaVisible = registry\n\t\t.select( preferencesStore )\n\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\tif ( ! isComplementaryAreaVisible ) {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, 'isComplementaryAreaVisible', true );\n\t}\n\n\tdispatch( {\n\t\ttype: 'ENABLE_COMPLEMENTARY_AREA',\n\t\tscope,\n\t\tarea,\n\t} );\n};\n\n/**\n * Disable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n */\nexport const disableComplementaryArea = ( scope ) => ( { registry } ) => {\n\tconst isComplementaryAreaVisible = registry\n\t\t.select( preferencesStore )\n\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\tif ( isComplementaryAreaVisible ) {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, 'isComplementaryAreaVisible', false );\n\t}\n};\n\n/**\n * Pins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n *\n * @return {Object} Action object.\n */\nexport const pinItem = ( scope, item ) => ( { registry } ) => {\n\t// Return early if there's no item.\n\tif ( ! item ) {\n\t\treturn;\n\t}\n\n\tconst pinnedItems = registry\n\t\t.select( preferencesStore )\n\t\t.get( scope, 'pinnedItems' );\n\n\t// The item is already pinned, there's nothing to do.\n\tif ( pinnedItems?.[ item ] === true ) {\n\t\treturn;\n\t}\n\n\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t...pinnedItems,\n\t\t[ item ]: true,\n\t} );\n};\n\n/**\n * Unpins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n */\nexport const unpinItem = ( scope, item ) => ( { registry } ) => {\n\t// Return early if there's no item.\n\tif ( ! item ) {\n\t\treturn;\n\t}\n\n\tconst pinnedItems = registry\n\t\t.select( preferencesStore )\n\t\t.get( scope, 'pinnedItems' );\n\n\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t...pinnedItems,\n\t\t[ item ]: false,\n\t} );\n};\n\n/**\n * Returns an action object used in signalling that a feature should be toggled.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n */\nexport function toggleFeature( scope, featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).toggleFeature`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).toggle`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).toggle( scope, featureName );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a feature should be set to\n * a true or false value\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n * @param {boolean} value The value to set.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureValue( scope, featureName, value ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureValue`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).set`,\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, featureName, !! value );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that defaults should be set for features.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {Object<string, boolean>} defaults A key/value map of feature names to values.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureDefaults( scope, defaults ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureDefaults`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).setDefaults`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).setDefaults( scope, defaults );\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/store/actions.js"],"names":["deprecated","store","preferencesStore","setDefaultComplementaryArea","scope","area","type","enableComplementaryArea","registry","dispatch","isComplementaryAreaVisible","select","get","set","disableComplementaryArea","pinItem","item","pinnedItems","unpinItem","toggleFeature","featureName","since","alternative","toggle","setFeatureValue","value","setFeatureDefaults","defaults","setDefaults"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,uBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,2BAA2B,GAAG,CAAEC,KAAF,EAASC,IAAT,MAAqB;AAC/DC,EAAAA,IAAI,EAAE,gCADyD;AAE/DF,EAAAA,KAF+D;AAG/DC,EAAAA;AAH+D,CAArB,CAApC;AAMP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAA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ASI,eAAT,CAA0BpB,KAA1B,EAAiCgB,WAAjC,EAA8CK,KAA9C,EAAsD;AAC5D,SAAO,iBAA0B;AAAA,QAAf;AAAEjB,MAAAA;AAAF,KAAe;AAChCR,IAAAA,UAAU,CAAG,8CAAH,EAAkD;AAC3DqB,MAAAA,KAAK,EAAE,KADoD;AAE3DC,MAAAA,WAAW,EAAG;AAF6C,KAAlD,CAAV;AAKAd,IAAAA,QAAQ,CACNC,QADF,CACYP,gBADZ,EAEEW,GAFF,CAEOT,KAFP,EAEcgB,WAFd,EAE2B,CAAC,CAAEK,KAF9B;AAGA,GATD;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,kBAAT,CAA6BtB,KAA7B,EAAoCuB,QAApC,EAA+C;AACrD,SAAO,iBAA0B;AAAA,QAAf;AAAEnB,MAAAA;AAAF,KAAe;AAChCR,IAAAA,UAAU,CAAG,iDAAH,EAAqD;AAC9DqB,MAAAA,KAAK,EAAE,KADuD;AAE9DC,MAAAA,WAAW,EAAG;AAFgD,KAArD,CAAV;AAKAd,IAAAA,QAAQ,CAACC,QAAT,CAAmBP,gBAAnB,EAAsC0B,WAAtC,CAAmDxB,KAAnD,EAA0DuB,QAA1D;AACA,GAPD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Set a default complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n *\n * @return {Object} Action object.\n */\nexport const setDefaultComplementaryArea = ( scope, area ) => ( {\n\ttype: 'SET_DEFAULT_COMPLEMENTARY_AREA',\n\tscope,\n\tarea,\n} );\n\n/**\n * Enable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n */\nexport const enableComplementaryArea =\n\t( scope, area ) =>\n\t( { registry, dispatch } ) => {\n\t\t// Return early if there's no area.\n\t\tif ( ! area ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( ! isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', true );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'ENABLE_COMPLEMENTARY_AREA',\n\t\t\tscope,\n\t\t\tarea,\n\t\t} );\n\t};\n\n/**\n * Disable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n */\nexport const disableComplementaryArea =\n\t( scope ) =>\n\t( { registry } ) => {\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', false );\n\t\t}\n\t};\n\n/**\n * Pins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n *\n * @return {Object} Action object.\n */\nexport const pinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\t// The item is already pinned, there's nothing to do.\n\t\tif ( pinnedItems?.[ item ] === true ) {\n\t\t\treturn;\n\t\t}\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: true,\n\t\t} );\n\t};\n\n/**\n * Unpins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n */\nexport const unpinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: false,\n\t\t} );\n\t};\n\n/**\n * Returns an action object used in signalling that a feature should be toggled.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n */\nexport function toggleFeature( scope, featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).toggleFeature`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).toggle`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).toggle( scope, featureName );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a feature should be set to\n * a true or false value\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n * @param {boolean} value The value to set.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureValue( scope, featureName, value ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureValue`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).set`,\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, featureName, !! value );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that defaults should be set for features.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {Object<string, boolean>} defaults A key/value map of feature names to values.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureDefaults( scope, defaults ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureDefaults`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).setDefaults`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).setDefaults( scope, defaults );\n\t};\n}\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 {
@@ -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.9.0",
3
+ "version": "4.12.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.10.0",
36
- "@wordpress/components": "^19.12.0",
37
- "@wordpress/compose": "^5.8.0",
38
- "@wordpress/data": "^6.10.0",
39
- "@wordpress/deprecated": "^3.10.0",
40
- "@wordpress/element": "^4.8.0",
41
- "@wordpress/i18n": "^4.10.0",
42
- "@wordpress/icons": "^9.1.0",
43
- "@wordpress/plugins": "^4.8.0",
44
- "@wordpress/preferences": "^2.2.0",
45
- "@wordpress/viewport": "^4.8.0",
46
- "classnames": "^2.3.1",
47
- "lodash": "^4.17.21"
35
+ "@wordpress/a11y": "^3.13.0",
36
+ "@wordpress/components": "^19.15.0",
37
+ "@wordpress/compose": "^5.11.0",
38
+ "@wordpress/data": "^6.13.0",
39
+ "@wordpress/deprecated": "^3.13.0",
40
+ "@wordpress/element": "^4.11.0",
41
+ "@wordpress/i18n": "^4.13.0",
42
+ "@wordpress/icons": "^9.4.0",
43
+ "@wordpress/plugins": "^4.11.0",
44
+ "@wordpress/preferences": "^2.5.0",
45
+ "@wordpress/viewport": "^4.11.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": "a3e0b62091e8a8bdf5e2518e42d60d7098af48cc"
55
+ "gitHead": "9d9d33bbdf317a4381b8ca1713e43bb50df653b3"
57
56
  }
@@ -1,14 +1,11 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { isEmpty, noop } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
9
4
  import { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';
10
5
  import { Children } from '@wordpress/element';
11
6
 
7
+ const noop = () => {};
8
+
12
9
  function ActionItemSlot( {
13
10
  name,
14
11
  as: Component = ButtonGroup,
@@ -23,7 +20,7 @@ function ActionItemSlot( {
23
20
  fillProps={ fillProps }
24
21
  >
25
22
  { ( fills ) => {
26
- if ( isEmpty( Children.toArray( fills ) ) ) {
23
+ if ( ! Children.toArray( fills ).length ) {
27
24
  return null;
28
25
  }
29
26
 
@@ -44,9 +44,8 @@ function useAdjustComplementaryListener(
44
44
  ) {
45
45
  const previousIsSmall = useRef( false );
46
46
  const shouldOpenWhenNotSmall = useRef( false );
47
- const { enableComplementaryArea, disableComplementaryArea } = useDispatch(
48
- interfaceStore
49
- );
47
+ const { enableComplementaryArea, disableComplementaryArea } =
48
+ useDispatch( interfaceStore );
50
49
  useEffect( () => {
51
50
  // If the complementary area is active and the editor is switching from a big to a small window size.
52
51
  if ( isActive && isSmall && ! previousIsSmall.current ) {
@@ -100,9 +99,8 @@ function ComplementaryArea( {
100
99
  } ) {
101
100
  const { isActive, isPinned, activeArea, isSmall, isLarge } = useSelect(
102
101
  ( select ) => {
103
- const { getActiveComplementaryArea, isItemPinned } = select(
104
- interfaceStore
105
- );
102
+ const { getActiveComplementaryArea, isItemPinned } =
103
+ select( interfaceStore );
106
104
  const _activeArea = getActiveComplementaryArea( scope );
107
105
  return {
108
106
  isActive: _activeArea === identifier,
@@ -217,9 +215,8 @@ function ComplementaryArea( {
217
215
  );
218
216
  }
219
217
 
220
- const ComplementaryAreaWrapped = withComplementaryAreaContext(
221
- ComplementaryArea
222
- );
218
+ const ComplementaryAreaWrapped =
219
+ withComplementaryAreaContext( ComplementaryArea );
223
220
 
224
221
  ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;
225
222
 
@@ -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 = ( props ) => (
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
- <MenuItem
23
- { ...omit( props, [
24
- '__unstableExplicitMenuItem',
25
- '__unstableTarget',
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;
@@ -30,9 +26,8 @@ function ComplementaryAreaToggle( {
30
26
  identifier,
31
27
  [ identifier ]
32
28
  );
33
- const { enableComplementaryArea, disableComplementaryArea } = useDispatch(
34
- interfaceStore
35
- );
29
+ const { enableComplementaryArea, disableComplementaryArea } =
30
+ useDispatch( interfaceStore );
36
31
  return (
37
32
  <ComponentToUse
38
33
  icon={ selectedIcon && isSelected ? selectedIcon : icon }
@@ -43,7 +38,7 @@ function ComplementaryAreaToggle( {
43
38
  enableComplementaryArea( scope, identifier );
44
39
  }
45
40
  } }
46
- { ...omit( props, [ 'name' ] ) }
41
+ { ...props }
47
42
  />
48
43
  );
49
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
- ! isEmpty( fills ) && (
19
+ fills?.length > 0 && (
21
20
  <div
22
21
  className={ classnames(
23
22
  className,
@@ -16,10 +16,6 @@
16
16
  @media (max-width: #{ ($break-medium - 1) }) {
17
17
  .components-modal__content {
18
18
  padding: 0;
19
-
20
- &::before {
21
- content: none;
22
- }
23
19
  }
24
20
  }
25
21
  }
@@ -24,48 +24,49 @@ export const setDefaultComplementaryArea = ( scope, area ) => ( {
24
24
  * @param {string} scope Complementary area scope.
25
25
  * @param {string} area Area identifier.
26
26
  */
27
- export const enableComplementaryArea = ( scope, area ) => ( {
28
- registry,
29
- dispatch,
30
- } ) => {
31
- // Return early if there's no area.
32
- if ( ! area ) {
33
- return;
34
- }
35
-
36
- const isComplementaryAreaVisible = registry
37
- .select( preferencesStore )
38
- .get( scope, 'isComplementaryAreaVisible' );
39
-
40
- if ( ! isComplementaryAreaVisible ) {
41
- registry
42
- .dispatch( preferencesStore )
43
- .set( scope, 'isComplementaryAreaVisible', true );
44
- }
45
-
46
- dispatch( {
47
- type: 'ENABLE_COMPLEMENTARY_AREA',
48
- scope,
49
- area,
50
- } );
51
- };
27
+ export const enableComplementaryArea =
28
+ ( scope, area ) =>
29
+ ( { registry, dispatch } ) => {
30
+ // Return early if there's no area.
31
+ if ( ! area ) {
32
+ return;
33
+ }
34
+
35
+ const isComplementaryAreaVisible = registry
36
+ .select( preferencesStore )
37
+ .get( scope, 'isComplementaryAreaVisible' );
38
+
39
+ if ( ! isComplementaryAreaVisible ) {
40
+ registry
41
+ .dispatch( preferencesStore )
42
+ .set( scope, 'isComplementaryAreaVisible', true );
43
+ }
44
+
45
+ dispatch( {
46
+ type: 'ENABLE_COMPLEMENTARY_AREA',
47
+ scope,
48
+ area,
49
+ } );
50
+ };
52
51
 
53
52
  /**
54
53
  * Disable the complementary area.
55
54
  *
56
55
  * @param {string} scope Complementary area scope.
57
56
  */
58
- export const disableComplementaryArea = ( scope ) => ( { registry } ) => {
59
- const isComplementaryAreaVisible = registry
60
- .select( preferencesStore )
61
- .get( scope, 'isComplementaryAreaVisible' );
62
-
63
- if ( isComplementaryAreaVisible ) {
64
- registry
65
- .dispatch( preferencesStore )
66
- .set( scope, 'isComplementaryAreaVisible', false );
67
- }
68
- };
57
+ export const disableComplementaryArea =
58
+ ( scope ) =>
59
+ ( { registry } ) => {
60
+ const isComplementaryAreaVisible = registry
61
+ .select( preferencesStore )
62
+ .get( scope, 'isComplementaryAreaVisible' );
63
+
64
+ if ( isComplementaryAreaVisible ) {
65
+ registry
66
+ .dispatch( preferencesStore )
67
+ .set( scope, 'isComplementaryAreaVisible', false );
68
+ }
69
+ };
69
70
 
70
71
  /**
71
72
  * Pins an item.
@@ -75,26 +76,28 @@ export const disableComplementaryArea = ( scope ) => ( { registry } ) => {
75
76
  *
76
77
  * @return {Object} Action object.
77
78
  */
78
- export const pinItem = ( scope, item ) => ( { registry } ) => {
79
- // Return early if there's no item.
80
- if ( ! item ) {
81
- return;
82
- }
83
-
84
- const pinnedItems = registry
85
- .select( preferencesStore )
86
- .get( scope, 'pinnedItems' );
87
-
88
- // The item is already pinned, there's nothing to do.
89
- if ( pinnedItems?.[ item ] === true ) {
90
- return;
91
- }
92
-
93
- registry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {
94
- ...pinnedItems,
95
- [ item ]: true,
96
- } );
97
- };
79
+ export const pinItem =
80
+ ( scope, item ) =>
81
+ ( { registry } ) => {
82
+ // Return early if there's no item.
83
+ if ( ! item ) {
84
+ return;
85
+ }
86
+
87
+ const pinnedItems = registry
88
+ .select( preferencesStore )
89
+ .get( scope, 'pinnedItems' );
90
+
91
+ // The item is already pinned, there's nothing to do.
92
+ if ( pinnedItems?.[ item ] === true ) {
93
+ return;
94
+ }
95
+
96
+ registry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {
97
+ ...pinnedItems,
98
+ [ item ]: true,
99
+ } );
100
+ };
98
101
 
99
102
  /**
100
103
  * Unpins an item.
@@ -102,21 +105,23 @@ export const pinItem = ( scope, item ) => ( { registry } ) => {
102
105
  * @param {string} scope Item scope.
103
106
  * @param {string} item Item identifier.
104
107
  */
105
- export const unpinItem = ( scope, item ) => ( { registry } ) => {
106
- // Return early if there's no item.
107
- if ( ! item ) {
108
- return;
109
- }
110
-
111
- const pinnedItems = registry
112
- .select( preferencesStore )
113
- .get( scope, 'pinnedItems' );
114
-
115
- registry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {
116
- ...pinnedItems,
117
- [ item ]: false,
118
- } );
119
- };
108
+ export const unpinItem =
109
+ ( scope, item ) =>
110
+ ( { registry } ) => {
111
+ // Return early if there's no item.
112
+ if ( ! item ) {
113
+ return;
114
+ }
115
+
116
+ const pinnedItems = registry
117
+ .select( preferencesStore )
118
+ .get( scope, 'pinnedItems' );
119
+
120
+ registry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {
121
+ ...pinnedItems,
122
+ [ item ]: false,
123
+ } );
124
+ };
120
125
 
121
126
  /**
122
127
  * Returns an action object used in signalling that a feature should be toggled.