@wordpress/interface 4.1.0 → 4.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -10
- package/build/components/action-item/index.js +30 -25
- package/build/components/action-item/index.js.map +1 -1
- package/build/components/complementary-area/index.js +30 -27
- package/build/components/complementary-area/index.js.map +1 -1
- package/build/components/complementary-area-header/index.js +7 -6
- package/build/components/complementary-area-header/index.js.map +1 -1
- package/build/components/complementary-area-more-menu-item/index.js +7 -6
- package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build/components/complementary-area-toggle/index.js +9 -8
- package/build/components/complementary-area-toggle/index.js.map +1 -1
- package/build/components/fullscreen-mode/index.js +4 -3
- package/build/components/fullscreen-mode/index.js.map +1 -1
- package/build/components/index.js +8 -8
- package/build/components/interface-skeleton/index.js +14 -13
- package/build/components/interface-skeleton/index.js.map +1 -1
- package/build/components/more-menu-dropdown/index.js +11 -10
- package/build/components/more-menu-dropdown/index.js.map +1 -1
- package/build/components/more-menu-feature-toggle/index.js +10 -9
- package/build/components/more-menu-feature-toggle/index.js.map +1 -1
- package/build/components/pinned-items/index.js +11 -9
- package/build/components/pinned-items/index.js.map +1 -1
- package/build/store/actions.js +13 -19
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +8 -4
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +32 -19
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build-module/components/action-item/index.js +30 -25
- package/build-module/components/action-item/index.js.map +1 -1
- package/build-module/components/complementary-area/index.js +30 -27
- package/build-module/components/complementary-area/index.js.map +1 -1
- package/build-module/components/complementary-area-header/index.js +7 -6
- package/build-module/components/complementary-area-header/index.js.map +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.js +7 -6
- package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build-module/components/complementary-area-toggle/index.js +9 -8
- package/build-module/components/complementary-area-toggle/index.js.map +1 -1
- package/build-module/components/fullscreen-mode/index.js +4 -3
- package/build-module/components/fullscreen-mode/index.js.map +1 -1
- package/build-module/components/interface-skeleton/index.js +14 -13
- package/build-module/components/interface-skeleton/index.js.map +1 -1
- package/build-module/components/more-menu-dropdown/index.js +10 -9
- package/build-module/components/more-menu-dropdown/index.js.map +1 -1
- package/build-module/components/more-menu-feature-toggle/index.js +10 -9
- package/build-module/components/more-menu-feature-toggle/index.js.map +1 -1
- package/build-module/components/pinned-items/index.js +11 -9
- package/build-module/components/pinned-items/index.js.map +1 -1
- package/build-module/store/actions.js +9 -13
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +4 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +30 -18
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +14 -2
- package/build-style/style.css +14 -2
- package/package.json +13 -13
- package/src/components/complementary-area/style.scss +10 -2
- package/src/components/complementary-area-header/style.scss +8 -0
- package/src/store/actions.js +5 -25
- package/src/store/index.js +2 -0
- package/src/store/reducer.js +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-header/index.js"],"names":["classnames","closeSmall","ComplementaryAreaToggle","ComplementaryAreaHeader","smallScreenTitle","children","className","toggleButtonProps","toggleButton"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,kBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;;AAEA,MAAMC,uBAAuB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/complementary-area-header/index.js"],"names":["classnames","closeSmall","ComplementaryAreaToggle","ComplementaryAreaHeader","smallScreenTitle","children","className","toggleButtonProps","toggleButton"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,kBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;;AAEA,MAAMC,uBAAuB,GAAG,QAKzB;AAAA,MAL2B;AACjCC,IAAAA,gBADiC;AAEjCC,IAAAA,QAFiC;AAGjCC,IAAAA,SAHiC;AAIjCC,IAAAA;AAJiC,GAK3B;AACN,QAAMC,YAAY,GACjB,cAAC,uBAAD;AAAyB,IAAA,IAAI,EAAGP;AAAhC,KAAkDM,iBAAlD,EADD;AAGA,SACC,8BACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGH,gBAAgB,IACjB;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGA,gBADH,CAFF,EAMGI,YANH,CADD,EASC;AACC,IAAA,SAAS,EAAGR,UAAU,CACrB,0BADqB,EAErB,qCAFqB,EAGrBM,SAHqB,CADvB;AAMC,IAAA,QAAQ,EAAG,CAAC;AANb,KAQGD,QARH,EASGG,YATH,CATD,CADD;AAuBA,CAhCD;;AAkCA,eAAeL,uBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tsmallScreenTitle,\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<>\n\t\t\t<div className=\"components-panel__header interface-complementary-area-header__small\">\n\t\t\t\t{ smallScreenTitle && (\n\t\t\t\t\t<span className=\"interface-complementary-area-header__small-title\">\n\t\t\t\t\t\t{ smallScreenTitle }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'components-panel__header',\n\t\t\t\t\t'interface-complementary-area-header',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"]}
|
|
@@ -23,12 +23,13 @@ const PluginsMenuItem = props => // Menu item is marked with unstable prop for b
|
|
|
23
23
|
// @see https://github.com/WordPress/gutenberg/issues/14457
|
|
24
24
|
createElement(MenuItem, omit(props, ['__unstableExplicitMenuItem', '__unstableTarget']));
|
|
25
25
|
|
|
26
|
-
export default function ComplementaryAreaMoreMenuItem({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
export default function ComplementaryAreaMoreMenuItem(_ref) {
|
|
27
|
+
let {
|
|
28
|
+
scope,
|
|
29
|
+
target,
|
|
30
|
+
__unstableExplicitMenuItem,
|
|
31
|
+
...props
|
|
32
|
+
} = _ref;
|
|
32
33
|
return createElement(ComplementaryAreaToggle, _extends({
|
|
33
34
|
as: toggleProps => {
|
|
34
35
|
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,
|
|
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"]}
|
|
@@ -18,14 +18,15 @@ import { useDispatch, useSelect } from '@wordpress/data';
|
|
|
18
18
|
import { store as interfaceStore } from '../../store';
|
|
19
19
|
import complementaryAreaContext from '../complementary-area-context';
|
|
20
20
|
|
|
21
|
-
function ComplementaryAreaToggle({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
function ComplementaryAreaToggle(_ref) {
|
|
22
|
+
let {
|
|
23
|
+
as = Button,
|
|
24
|
+
scope,
|
|
25
|
+
identifier,
|
|
26
|
+
icon,
|
|
27
|
+
selectedIcon,
|
|
28
|
+
...props
|
|
29
|
+
} = _ref;
|
|
29
30
|
const ComponentToUse = as;
|
|
30
31
|
const isSelected = useSelect(select => select(interfaceStore).getActiveComplementaryArea(scope) === identifier, [identifier]);
|
|
31
32
|
const {
|
|
@@ -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,
|
|
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"]}
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useEffect } from '@wordpress/element';
|
|
5
5
|
|
|
6
|
-
const FullscreenMode =
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const FullscreenMode = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
isActive
|
|
9
|
+
} = _ref;
|
|
9
10
|
useEffect(() => {
|
|
10
11
|
let isSticky = false; // `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes
|
|
11
12
|
// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/fullscreen-mode/index.js"],"names":["useEffect","FullscreenMode","isActive","isSticky","document","body","classList","contains","remove","add"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;;AAEA,MAAMC,cAAc,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/fullscreen-mode/index.js"],"names":["useEffect","FullscreenMode","isActive","isSticky","document","body","classList","contains","remove","add"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;;AAEA,MAAMC,cAAc,GAAG,QAAoB;AAAA,MAAlB;AAAEC,IAAAA;AAAF,GAAkB;AAC1CF,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAIG,QAAQ,GAAG,KAAf,CADgB,CAEhB;AACA;AACA;AACA;;AACA,QAAKC,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBC,QAAxB,CAAkC,aAAlC,CAAL,EAAyD;AACxDJ,MAAAA,QAAQ,GAAG,IAAX;AACAC,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,aAAhC;AACA;;AAED,WAAO,MAAM;AACZ,UAAKL,QAAL,EAAgB;AACfC,QAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBG,GAAxB,CAA6B,aAA7B;AACA;AACD,KAJD;AAKA,GAhBQ,EAgBN,EAhBM,CAAT;AAkBAT,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKE,QAAL,EAAgB;AACfE,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBG,GAAxB,CAA6B,oBAA7B;AACA,KAFD,MAEO;AACNL,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,oBAAhC;AACA;;AAED,WAAO,MAAM;AACZ,UAAKN,QAAL,EAAgB;AACfE,QAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,oBAAhC;AACA;AACD,KAJD;AAKA,GAZQ,EAYN,CAAEN,QAAF,CAZM,CAAT;AAcA,SAAO,IAAP;AACA,CAlCD;;AAmCA,eAAeD,cAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\nconst FullscreenMode = ( { isActive } ) => {\n\tuseEffect( () => {\n\t\tlet isSticky = false;\n\t\t// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes\n\t\t// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled\n\t\t// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as\n\t\t// a consequence of the FullscreenMode setup\n\t\tif ( document.body.classList.contains( 'sticky-menu' ) ) {\n\t\t\tisSticky = true;\n\t\t\tdocument.body.classList.remove( 'sticky-menu' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isSticky ) {\n\t\t\t\tdocument.body.classList.add( 'sticky-menu' );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isActive ) {\n\t\t\tdocument.body.classList.add( 'is-fullscreen-mode' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isActive ) {\n\t\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t\t}\n\t\t};\n\t}, [ isActive ] );\n\n\treturn null;\n};\nexport default FullscreenMode;\n"]}
|
|
@@ -33,19 +33,20 @@ function useHTMLClass(className) {
|
|
|
33
33
|
}, [className]);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
function InterfaceSkeleton({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
function InterfaceSkeleton(_ref, ref) {
|
|
37
|
+
let {
|
|
38
|
+
footer,
|
|
39
|
+
header,
|
|
40
|
+
sidebar,
|
|
41
|
+
secondarySidebar,
|
|
42
|
+
notices,
|
|
43
|
+
content,
|
|
44
|
+
drawer,
|
|
45
|
+
actions,
|
|
46
|
+
labels,
|
|
47
|
+
className,
|
|
48
|
+
shortcuts
|
|
49
|
+
} = _ref;
|
|
49
50
|
const navigateRegionsProps = useNavigateRegions(shortcuts);
|
|
50
51
|
useHTMLClass('interface-interface-skeleton__html-container');
|
|
51
52
|
const defaultLabels = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"names":["classnames","forwardRef","useEffect","__unstableUseNavigateRegions","useNavigateRegions","__","useMergeRefs","useHTMLClass","className","element","document","querySelector","classList","toggle","InterfaceSkeleton","footer","header","sidebar","secondarySidebar","notices","content","drawer","actions","labels","shortcuts","
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"names":["classnames","forwardRef","useEffect","__unstableUseNavigateRegions","useNavigateRegions","__","useMergeRefs","useHTMLClass","className","element","document","querySelector","classList","toggle","InterfaceSkeleton","ref","footer","header","sidebar","secondarySidebar","notices","content","drawer","actions","labels","shortcuts","navigateRegionsProps","defaultLabels","body","mergedLabels"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA;AACA;AACA;;AACA,SAASC,UAAT,EAAqBC,SAArB,QAAsC,oBAAtC;AACA,SAASC,4BAA4B,IAAIC,kBAAzC,QAAmE,uBAAnE;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,oBAA7B;;AAEA,SAASC,YAAT,CAAuBC,SAAvB,EAAmC;AAClCN,EAAAA,SAAS,CAAE,MAAM;AAChB,UAAMO,OAAO,GACZC,QAAQ,IAAIA,QAAQ,CAACC,aAAT,CAAyB,aAAaH,SAAW,GAAjD,CADb;;AAEA,QAAK,CAAEC,OAAP,EAAiB;AAChB;AACA;;AACDA,IAAAA,OAAO,CAACG,SAAR,CAAkBC,MAAlB,CAA0BL,SAA1B;AACA,WAAO,MAAM;AACZC,MAAAA,OAAO,CAACG,SAAR,CAAkBC,MAAlB,CAA0BL,SAA1B;AACA,KAFD;AAGA,GAVQ,EAUN,CAAEA,SAAF,CAVM,CAAT;AAWA;;AAED,SAASM,iBAAT,OAcCC,GAdD,EAeE;AAAA,MAdD;AACCC,IAAAA,MADD;AAECC,IAAAA,MAFD;AAGCC,IAAAA,OAHD;AAICC,IAAAA,gBAJD;AAKCC,IAAAA,OALD;AAMCC,IAAAA,OAND;A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AAI,EAAC,QAFN;AAGC,kBAAaY,YAAY,CAACZ,MAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGA,MANH,CAFF,EAWC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,CAAC,CAAEE,gBAAH,IACD;AACC,IAAA,SAAS,EAAC,iDADX;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAaU,YAAY,CAACV,gBAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGA,gBANH,CAFF,EAWG,CAAC,CAAEC,OAAH,IACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,OADH,CAZF,EAgBC;AACC,IAAA,SAAS,EAAC,uCADX;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAaS,YAAY,CAACD,IAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGP,OANH,CAhBD,EAwBG,CAAC,CAAEH,OAAH,IACD;AACC,IAAA,SAAS,EAAC,uCADX;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAaW,YAAY,CAACX,OAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGA,OANH,CAzBF,EAkCG,CAAC,CAAEK,OAAH,IACD;AACC,IAAA,SAAS,EAAC,uCADX;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAaM,YAAY,CAACN,OAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGA,OANH,CAnCF,CAXD,CAnBD,EA4EG,CAAC,CAAEP,MAAH,IACD;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,kBAAaa,YAAY,CAACb,MAH3B;AAIC,IAAA,QAAQ,EAAC;AAJV,KAMGA,MANH,CA7EF,CADD;AAyFA;;AAED,eAAef,UAAU,CAAEa,iBAAF,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport { __unstableUseNavigateRegions as useNavigateRegions } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs } from '@wordpress/compose';\n\nfunction useHTMLClass( className ) {\n\tuseEffect( () => {\n\t\tconst element =\n\t\t\tdocument && document.querySelector( `html:not(.${ className })` );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\t\telement.classList.toggle( className );\n\t\treturn () => {\n\t\t\telement.classList.toggle( className );\n\t\t};\n\t}, [ className ] );\n}\n\nfunction InterfaceSkeleton(\n\t{\n\t\tfooter,\n\t\theader,\n\t\tsidebar,\n\t\tsecondarySidebar,\n\t\tnotices,\n\t\tcontent,\n\t\tdrawer,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\n\t\tshortcuts,\n\t},\n\tref\n) {\n\tconst navigateRegionsProps = useNavigateRegions( shortcuts );\n\n\tuseHTMLClass( 'interface-interface-skeleton__html-container' );\n\n\tconst defaultLabels = {\n\t\t/* translators: accessibility text for the nav bar landmark region. */\n\t\tdrawer: __( 'Drawer' ),\n\t\t/* translators: accessibility text for the top bar landmark region. */\n\t\theader: __( 'Header' ),\n\t\t/* translators: accessibility text for the content landmark region. */\n\t\tbody: __( 'Content' ),\n\t\t/* translators: accessibility text for the secondary sidebar landmark region. */\n\t\tsecondarySidebar: __( 'Block Library' ),\n\t\t/* translators: accessibility text for the settings landmark region. */\n\t\tsidebar: __( 'Settings' ),\n\t\t/* translators: accessibility text for the publish landmark region. */\n\t\tactions: __( 'Publish' ),\n\t\t/* translators: accessibility text for the footer landmark region. */\n\t\tfooter: __( 'Footer' ),\n\t};\n\n\tconst mergedLabels = { ...defaultLabels, ...labels };\n\n\treturn (\n\t\t<div\n\t\t\t{ ...navigateRegionsProps }\n\t\t\tref={ useMergeRefs( [ ref, navigateRegionsProps.ref ] ) }\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'interface-interface-skeleton',\n\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t!! footer && 'has-footer'\n\t\t\t) }\n\t\t>\n\t\t\t{ !! drawer && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"interface-interface-skeleton__drawer\"\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label={ mergedLabels.drawer }\n\t\t\t\t>\n\t\t\t\t\t{ drawer }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"interface-interface-skeleton__editor\">\n\t\t\t\t{ !! header && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\trole=\"region\"\n\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"interface-interface-skeleton__body\">\n\t\t\t\t\t{ !! secondarySidebar && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__secondary-sidebar\"\n\t\t\t\t\t\t\trole=\"region\"\n\t\t\t\t\t\t\taria-label={ mergedLabels.secondarySidebar }\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ secondarySidebar }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! notices && (\n\t\t\t\t\t\t<div className=\"interface-interface-skeleton__notices\">\n\t\t\t\t\t\t\t{ notices }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__content\"\n\t\t\t\t\t\trole=\"region\"\n\t\t\t\t\t\taria-label={ mergedLabels.body }\n\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ content }\n\t\t\t\t\t</div>\n\t\t\t\t\t{ !! sidebar && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__sidebar\"\n\t\t\t\t\t\t\trole=\"region\"\n\t\t\t\t\t\t\taria-label={ mergedLabels.sidebar }\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sidebar }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! actions && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__actions\"\n\t\t\t\t\t\t\trole=\"region\"\n\t\t\t\t\t\t\taria-label={ mergedLabels.actions }\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{ !! footer && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"interface-interface-skeleton__footer\"\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label={ mergedLabels.footer }\n\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t>\n\t\t\t\t\t{ footer }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default forwardRef( InterfaceSkeleton );\n"]}
|
|
@@ -11,16 +11,17 @@ import classnames from 'classnames';
|
|
|
11
11
|
import { DropdownMenu } from '@wordpress/components';
|
|
12
12
|
import { __ } from '@wordpress/i18n';
|
|
13
13
|
import { moreVertical } from '@wordpress/icons';
|
|
14
|
-
export default function MoreMenuDropdown({
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export default function MoreMenuDropdown(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
as: DropdownComponent = DropdownMenu,
|
|
17
|
+
className,
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
19
|
+
/* translators: button label text should, if possible, be under 16 characters. */
|
|
20
|
+
label = __('Options'),
|
|
21
|
+
popoverProps,
|
|
22
|
+
toggleProps,
|
|
23
|
+
children
|
|
24
|
+
} = _ref;
|
|
24
25
|
return createElement(DropdownComponent, {
|
|
25
26
|
className: classnames('interface-more-menu-dropdown', className),
|
|
26
27
|
icon: moreVertical,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-dropdown/index.js"],"names":["classnames","DropdownMenu","__","moreVertical","MoreMenuDropdown","as","DropdownComponent","className","label","popoverProps","toggleProps","children","position","tooltipPosition","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,YAAT,QAA6B,uBAA7B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,kBAA7B;AAEA,eAAe,SAASC,gBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-dropdown/index.js"],"names":["classnames","DropdownMenu","__","moreVertical","MoreMenuDropdown","as","DropdownComponent","className","label","popoverProps","toggleProps","children","position","tooltipPosition","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,YAAT,QAA6B,uBAA7B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,kBAA7B;AAEA,eAAe,SAASC,gBAAT,OAQX;AAAA,MARsC;AACzCC,IAAAA,EAAE,EAAEC,iBAAiB,GAAGL,YADiB;AAEzCM,IAAAA,SAFyC;;AAGzC;AACAC,IAAAA,KAAK,GAAGN,EAAE,CAAE,SAAF,CAJ+B;AAKzCO,IAAAA,YALyC;AAMzCC,IAAAA,WANyC;AAOzCC,IAAAA;AAPyC,GAQtC;AACH,SACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAGX,UAAU,CACrB,8BADqB,EAErBO,SAFqB,CADvB;AAKC,IAAA,IAAI,EAAGJ,YALR;AAMC,IAAA,KAAK,EAAGK,KANT;AAOC,IAAA,YAAY,EAAG;AACdI,MAAAA,QAAQ,EAAE,aADI;AAEd,SAAGH,YAFW;AAGdF,MAAAA,SAAS,EAAEP,UAAU,CACpB,uCADoB,EAEpBS,YAFoB,aAEpBA,YAFoB,uBAEpBA,YAAY,CAAEF,SAFM;AAHP,KAPhB;AAeC,IAAA,WAAW,EAAG;AACbM,MAAAA,eAAe,EAAE,QADJ;AAEb,SAAGH;AAFU;AAff,KAoBKI,OAAF,IAAeH,QAAQ,CAAEG,OAAF,CApB1B,CADD;AAwBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { DropdownMenu } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreVertical } from '@wordpress/icons';\n\nexport default function MoreMenuDropdown( {\n\tas: DropdownComponent = DropdownMenu,\n\tclassName,\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tlabel = __( 'Options' ),\n\tpopoverProps,\n\ttoggleProps,\n\tchildren,\n} ) {\n\treturn (\n\t\t<DropdownComponent\n\t\t\tclassName={ classnames(\n\t\t\t\t'interface-more-menu-dropdown',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ label }\n\t\t\tpopoverProps={ {\n\t\t\t\tposition: 'bottom left',\n\t\t\t\t...popoverProps,\n\t\t\t\tclassName: classnames(\n\t\t\t\t\t'interface-more-menu-dropdown__content',\n\t\t\t\t\tpopoverProps?.className\n\t\t\t\t),\n\t\t\t} }\n\t\t\ttoggleProps={ {\n\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t...toggleProps,\n\t\t\t} }\n\t\t>\n\t\t\t{ ( onClose ) => children( onClose ) }\n\t\t</DropdownComponent>\n\t);\n}\n"]}
|
|
@@ -13,15 +13,16 @@ import { speak } from '@wordpress/a11y';
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { store as interfaceStore } from '../../store';
|
|
16
|
-
export default function MoreMenuFeatureToggle({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
export default function MoreMenuFeatureToggle(_ref) {
|
|
17
|
+
let {
|
|
18
|
+
scope,
|
|
19
|
+
label,
|
|
20
|
+
info,
|
|
21
|
+
messageActivated,
|
|
22
|
+
messageDeactivated,
|
|
23
|
+
shortcut,
|
|
24
|
+
feature
|
|
25
|
+
} = _ref;
|
|
25
26
|
const isActive = useSelect(select => select(interfaceStore).isFeatureActive(scope, feature), [feature]);
|
|
26
27
|
const {
|
|
27
28
|
toggleFeature
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-feature-toggle/index.js"],"names":["useSelect","useDispatch","MenuItem","__","check","speak","store","interfaceStore","MoreMenuFeatureToggle","scope","label","info","messageActivated","messageDeactivated","shortcut","feature","isActive","select","isFeatureActive","toggleFeature","speakMessage"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,QAAT,QAAyB,uBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SAASC,KAAT,QAAsB,iBAAtB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,aAAxC;AAEA,eAAe,SAASC,qBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-feature-toggle/index.js"],"names":["useSelect","useDispatch","MenuItem","__","check","speak","store","interfaceStore","MoreMenuFeatureToggle","scope","label","info","messageActivated","messageDeactivated","shortcut","feature","isActive","select","isFeatureActive","toggleFeature","speakMessage"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAAS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ies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\n\nexport default function MoreMenuFeatureToggle( {\n\tscope,\n\tlabel,\n\tinfo,\n\tmessageActivated,\n\tmessageDeactivated,\n\tshortcut,\n\tfeature,\n} ) {\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).isFeatureActive( scope, feature ),\n\t\t[ feature ]\n\t);\n\tconst { toggleFeature } = useDispatch( interfaceStore );\n\tconst speakMessage = () => {\n\t\tif ( isActive ) {\n\t\t\tspeak( messageDeactivated || __( 'Feature deactivated' ) );\n\t\t} else {\n\t\t\tspeak( messageActivated || __( 'Feature activated' ) );\n\t\t}\n\t};\n\n\treturn (\n\t\t<MenuItem\n\t\t\ticon={ isActive && check }\n\t\t\tisSelected={ isActive }\n\t\t\tonClick={ () => {\n\t\t\t\ttoggleFeature( scope, feature );\n\t\t\t\tspeakMessage();\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tinfo={ info }\n\t\t\tshortcut={ shortcut }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"]}
|
|
@@ -12,20 +12,22 @@ import classnames from 'classnames';
|
|
|
12
12
|
|
|
13
13
|
import { Slot, Fill } from '@wordpress/components';
|
|
14
14
|
|
|
15
|
-
function PinnedItems({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
function PinnedItems(_ref) {
|
|
16
|
+
let {
|
|
17
|
+
scope,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref;
|
|
19
20
|
return createElement(Fill, _extends({
|
|
20
21
|
name: `PinnedItems/${scope}`
|
|
21
22
|
}, props));
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
function PinnedItemsSlot({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
function PinnedItemsSlot(_ref2) {
|
|
26
|
+
let {
|
|
27
|
+
scope,
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
} = _ref2;
|
|
29
31
|
return createElement(Slot, _extends({
|
|
30
32
|
name: `PinnedItems/${scope}`
|
|
31
33
|
}, props), fills => !isEmpty(fills) && createElement("div", {
|
|
@@ -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,
|
|
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,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { controls } from '@wordpress/data';
|
|
5
|
-
/**
|
|
6
|
-
* Internal dependencies
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { STORE_NAME as interfaceStoreName } from './constants';
|
|
10
1
|
/**
|
|
11
2
|
* Returns an action object used in signalling that an active area should be changed.
|
|
12
3
|
*
|
|
@@ -16,7 +7,6 @@ import { STORE_NAME as interfaceStoreName } from './constants';
|
|
|
16
7
|
*
|
|
17
8
|
* @return {Object} Action object.
|
|
18
9
|
*/
|
|
19
|
-
|
|
20
10
|
function setSingleEnableItem(itemType, scope, item) {
|
|
21
11
|
return {
|
|
22
12
|
type: 'SET_SINGLE_ENABLE_ITEM',
|
|
@@ -101,9 +91,15 @@ export function unpinItem(scope, itemId) {
|
|
|
101
91
|
* @param {string} featureName The feature name.
|
|
102
92
|
*/
|
|
103
93
|
|
|
104
|
-
export function
|
|
105
|
-
|
|
106
|
-
|
|
94
|
+
export function toggleFeature(scope, featureName) {
|
|
95
|
+
return function (_ref) {
|
|
96
|
+
let {
|
|
97
|
+
select,
|
|
98
|
+
dispatch
|
|
99
|
+
} = _ref;
|
|
100
|
+
const currentValue = select.isFeatureActive(scope, featureName);
|
|
101
|
+
dispatch.setFeatureValue(scope, featureName, !currentValue);
|
|
102
|
+
};
|
|
107
103
|
}
|
|
108
104
|
/**
|
|
109
105
|
* Returns an action object used in signalling that a feature should be set to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/store/actions.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/store/actions.js"],"names":["setSingleEnableItem","itemType","scope","item","type","enableComplementaryArea","area","disableComplementaryArea","undefined","setMultipleEnableItem","isEnable","pinItem","itemId","unpinItem","toggleFeature","featureName","select","dispatch","currentValue","isFeatureActive","setFeatureValue","value","setFeatureDefaults","defaults"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,mBAAT,CAA8BC,QAA9B,EAAwCC,KAAxC,EAA+CC,IAA/C,EAAsD;AACrD,SAAO;AACNC,IAAAA,IAAI,EAAE,wBADA;AAENH,IAAAA,QAFM;AAGNC,IAAAA,KAHM;AAINC,IAAAA;AAJM,GAAP;AAMA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAASE,uBAAT,CAAkCH,KAAlC,EAAyCI,IAAzC,EAAgD;AACtD,SAAON,mBAAmB,CAAE,mBAAF,EAAuBE,KAAvB,EAA8BI,IAA9B,CAA1B;AACA;AAED;AACA;AACA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,eAAT,CAA0BlB,KAA1B,EAAiCa,WAAjC,EAA8CM,KAA9C,EAAsD;AAC5D,SAAO;AACNjB,IAAAA,IAAI,EAAE,mBADA;AAENF,IAAAA,KAFM;AAGNa,IAAAA,WAHM;AAINM,IAAAA,KAAK,EAAE,CAAC,CAAEA;AAJJ,GAAP;AAMA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,kBAAT,CAA6BpB,KAA7B,EAAoCqB,QAApC,EAA+C;AACrD,SAAO;AACNnB,IAAAA,IAAI,EAAE,sBADA;AAENF,IAAAA,KAFM;AAGNqB,IAAAA;AAHM,GAAP;AAKA","sourcesContent":["/**\n * Returns an action object used in signalling that an active area should be changed.\n *\n * @param {string} itemType Type of item.\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n *\n * @return {Object} Action object.\n */\nfunction setSingleEnableItem( itemType, scope, item ) {\n\treturn {\n\t\ttype: 'SET_SINGLE_ENABLE_ITEM',\n\t\titemType,\n\t\tscope,\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a complementary item should be enabled.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n *\n * @return {Object} Action object.\n */\nexport function enableComplementaryArea( scope, area ) {\n\treturn setSingleEnableItem( 'complementaryArea', scope, area );\n}\n\n/**\n * Returns an action object used in signalling that the complementary area of a given scope should be disabled.\n *\n * @param {string} scope Complementary area scope.\n *\n * @return {Object} Action object.\n */\nexport function disableComplementaryArea( scope ) {\n\treturn setSingleEnableItem( 'complementaryArea', scope, undefined );\n}\n\n/**\n * Returns an action object to make an area enabled/disabled.\n *\n * @param {string} itemType Type of item.\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n * @param {boolean} isEnable Boolean indicating if an area should be pinned or not.\n *\n * @return {Object} Action object.\n */\nfunction setMultipleEnableItem( itemType, scope, item, isEnable ) {\n\treturn {\n\t\ttype: 'SET_MULTIPLE_ENABLE_ITEM',\n\t\titemType,\n\t\tscope,\n\t\titem,\n\t\tisEnable,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that an item should be pinned.\n *\n * @param {string} scope Item scope.\n * @param {string} itemId Item identifier.\n *\n * @return {Object} Action object.\n */\nexport function pinItem( scope, itemId ) {\n\treturn setMultipleEnableItem( 'pinnedItems', scope, itemId, true );\n}\n\n/**\n * Returns an action object used in signalling that an item should be unpinned.\n *\n * @param {string} scope Item scope.\n * @param {string} itemId Item identifier.\n *\n * @return {Object} Action object.\n */\nexport function unpinItem( scope, itemId ) {\n\treturn setMultipleEnableItem( 'pinnedItems', scope, itemId, false );\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 ( { select, dispatch } ) {\n\t\tconst currentValue = select.isFeatureActive( scope, featureName );\n\t\tdispatch.setFeatureValue( scope, featureName, ! currentValue );\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 {\n\t\ttype: 'SET_FEATURE_VALUE',\n\t\tscope,\n\t\tfeatureName,\n\t\tvalue: !! 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 {\n\t\ttype: 'SET_FEATURE_DEFAULTS',\n\t\tscope,\n\t\tdefaults,\n\t};\n}\n"]}
|
|
@@ -22,7 +22,8 @@ export const store = createReduxStore(STORE_NAME, {
|
|
|
22
22
|
reducer,
|
|
23
23
|
actions,
|
|
24
24
|
selectors,
|
|
25
|
-
persist: ['enableItems', 'preferences']
|
|
25
|
+
persist: ['enableItems', 'preferences'],
|
|
26
|
+
__experimentalUseThunks: true
|
|
26
27
|
}); // Once we build a more generic persistence plugin that works across types of stores
|
|
27
28
|
// we'd be able to replace this with a register call.
|
|
28
29
|
|
|
@@ -30,6 +31,7 @@ registerStore(STORE_NAME, {
|
|
|
30
31
|
reducer,
|
|
31
32
|
actions,
|
|
32
33
|
selectors,
|
|
33
|
-
persist: ['enableItems', 'preferences']
|
|
34
|
+
persist: ['enableItems', 'preferences'],
|
|
35
|
+
__experimentalUseThunks: true
|
|
34
36
|
});
|
|
35
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/store/index.js"],"names":["createReduxStore","registerStore","reducer","actions","selectors","STORE_NAME","store","persist"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAT,EAA2BC,aAA3B,QAAgD,iBAAhD;AAEA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,WAApB;AACA,OAAO,KAAKC,OAAZ,MAAyB,WAAzB;AACA,OAAO,KAAKC,SAAZ,MAA2B,aAA3B;AACA,SAASC,UAAT,QAA2B,aAA3B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,KAAK,GAAGN,gBAAgB,CAAEK,UAAF,EAAc;AAClDH,EAAAA,OADkD;AAElDC,EAAAA,OAFkD;AAGlDC,EAAAA,SAHkD;AAIlDG,EAAAA,OAAO,EAAE,CAAE,aAAF,EAAiB,aAAjB;
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/store/index.js"],"names":["createReduxStore","registerStore","reducer","actions","selectors","STORE_NAME","store","persist","__experimentalUseThunks"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAT,EAA2BC,aAA3B,QAAgD,iBAAhD;AAEA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,WAApB;AACA,OAAO,KAAKC,OAAZ,MAAyB,WAAzB;AACA,OAAO,KAAKC,SAAZ,MAA2B,aAA3B;AACA,SAASC,UAAT,QAA2B,aAA3B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,KAAK,GAAGN,gBAAgB,CAAEK,UAAF,EAAc;AAClDH,EAAAA,OADkD;AAElDC,EAAAA,OAFkD;AAGlDC,EAAAA,SAHkD;AAIlDG,EAAAA,OAAO,EAAE,CAAE,aAAF,EAAiB,aAAjB,CAJyC;AAKlDC,EAAAA,uBAAuB,EAAE;AALyB,CAAd,CAA9B,C,CAQP;AACA;;AACAP,aAAa,CAAEI,UAAF,EAAc;AAC1BH,EAAAA,OAD0B;AAE1BC,EAAAA,OAF0B;AAG1BC,EAAAA,SAH0B;AAI1BG,EAAAA,OAAO,EAAE,CAAE,aAAF,EAAiB,aAAjB,CAJiB;AAK1BC,EAAAA,uBAAuB,EAAE;AALC,CAAd,CAAb","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, registerStore } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the interface namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n\tpersist: [ 'enableItems', 'preferences' ],\n\t__experimentalUseThunks: true,\n} );\n\n// Once we build a more generic persistence plugin that works across types of stores\n// we'd be able to replace this with a register call.\nregisterStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n\tpersist: [ 'enableItems', 'preferences' ],\n\t__experimentalUseThunks: true,\n} );\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { get } from 'lodash';
|
|
5
5
|
/**
|
|
6
6
|
* WordPress dependencies
|
|
7
7
|
*/
|
|
@@ -20,12 +20,15 @@ import { combineReducers } from '@wordpress/data';
|
|
|
20
20
|
* @return {Object} Updated state.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
export function singleEnableItems(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
export function singleEnableItems() {
|
|
24
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
25
|
+
let {
|
|
26
|
+
type,
|
|
27
|
+
itemType,
|
|
28
|
+
scope,
|
|
29
|
+
item
|
|
30
|
+
} = arguments.length > 1 ? arguments[1] : undefined;
|
|
31
|
+
|
|
29
32
|
if (type !== 'SET_SINGLE_ENABLE_ITEM' || !itemType || !scope) {
|
|
30
33
|
return state;
|
|
31
34
|
}
|
|
@@ -50,13 +53,16 @@ export function singleEnableItems(state = {}, {
|
|
|
50
53
|
* @return {Object} Updated state.
|
|
51
54
|
*/
|
|
52
55
|
|
|
53
|
-
export function multipleEnableItems(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
export function multipleEnableItems() {
|
|
57
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
58
|
+
let {
|
|
59
|
+
type,
|
|
60
|
+
itemType,
|
|
61
|
+
scope,
|
|
62
|
+
item,
|
|
63
|
+
isEnable
|
|
64
|
+
} = arguments.length > 1 ? arguments[1] : undefined;
|
|
65
|
+
|
|
60
66
|
if (type !== 'SET_MULTIPLE_ENABLE_ITEM' || !itemType || !scope || !item || get(state, [itemType, scope, item]) === isEnable) {
|
|
61
67
|
return state;
|
|
62
68
|
}
|
|
@@ -83,8 +89,11 @@ export function multipleEnableItems(state = {}, {
|
|
|
83
89
|
* @return {Object} Updated state.
|
|
84
90
|
*/
|
|
85
91
|
|
|
86
|
-
export const preferenceDefaults =
|
|
87
|
-
features(
|
|
92
|
+
export const preferenceDefaults = combineReducers({
|
|
93
|
+
features() {
|
|
94
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
95
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
96
|
+
|
|
88
97
|
if (action.type === 'SET_FEATURE_DEFAULTS') {
|
|
89
98
|
const {
|
|
90
99
|
scope,
|
|
@@ -110,8 +119,11 @@ export const preferenceDefaults = flow([combineReducers])({
|
|
|
110
119
|
* @return {Object} Updated state.
|
|
111
120
|
*/
|
|
112
121
|
|
|
113
|
-
export const preferences =
|
|
114
|
-
features(
|
|
122
|
+
export const preferences = combineReducers({
|
|
123
|
+
features() {
|
|
124
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
125
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
126
|
+
|
|
115
127
|
if (action.type === 'SET_FEATURE_VALUE') {
|
|
116
128
|
const {
|
|
117
129
|
scope,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/store/reducer.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/store/reducer.js"],"names":["get","combineReducers","singleEnableItems","state","type","itemType","scope","item","multipleEnableItems","isEnable","currentTypeState","currentScopeState","preferenceDefaults","features","action","defaults","preferences","featureName","value","enableItems"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,iBAAT,GAGL;AAAA,MAFDC,KAEC,uEAFO,EAEP;AAAA,MADD;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA,KAAlB;AAAyBC,IAAAA;AAAzB,GACC;;AACD,MAAKH,IAAI,KAAK,wBAAT,IAAqC,CAAEC,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sBAArB,EAA8C;AAC7C,YAAM;AAAEE,QAAAA,KAAF;AAASS,QAAAA;AAAT,UAAsBD,MAA5B;AACA,aAAO,EACN,GAAGX,KADG;AAEN,SAAEG,KAAF,GAAW,EACV,GAAGH,KAAK,CAAEG,KAAF,CADE;AAEV,aAAGS;AAFO;AAFL,OAAP;AAOA;;AAED,WAAOZ,KAAP;AACA;;AAdiD,CAAF,CAA1C;AAiBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMa,WAAW,GAAGf,eAAe,CAAE;AAC3CY,EAAAA,QAAQ,GAAuB;AAAA,QAArBV,KAAqB,uEAAb,EAAa;AAAA,QAATW,MAAS;;AAC9B,QAAKA,MAAM,CAACV,IAAP,KAAgB,mBAArB,EAA2C;AAC1C,YAAM;AAAEE,QAAAA,KAAF;AAASW,QAAAA,WAAT;AAAsBC,QAAAA;AAAtB,UAAgCJ,MAAtC;AACA,aAAO,EACN,GAAGX,KADG;AAEN,SAAEG,KAAF,GAAW,EACV,GAAGH,KAAK,CAAEG,KAAF,CADE;AAEV,WAAEW,WAAF,GAAiBC;AAFP;AAFL,OAAP;AAOA;;AAED,WAAOf,KAAP;AACA;;AAd0C,CAAF,CAAnC;AAiBP,MAAMgB,WAAW,GAAGlB,eAAe,CAAE;AACpCC,EAAAA,iBADoC;AAEpCM,EAAAA;AAFoC,CAAF,CAAnC;AAKA,eAAeP,eAAe,CAAE;AAC/BkB,EAAAA,WAD+B;AAE/BP,EAAAA,kBAF+B;AAG/BI,EAAAA;AAH+B,CAAF,CAA9B","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer to keep tract of the active area per scope.\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action object.\n * @param {string} action.type Action type.\n * @param {string} action.itemType Type of item.\n * @param {string} action.scope Item scope.\n * @param {string} action.item Item name.\n *\n * @return {Object} Updated state.\n */\nexport function singleEnableItems(\n\tstate = {},\n\t{ type, itemType, scope, item }\n) {\n\tif ( type !== 'SET_SINGLE_ENABLE_ITEM' || ! itemType || ! scope ) {\n\t\treturn state;\n\t}\n\n\treturn {\n\t\t...state,\n\t\t[ itemType ]: {\n\t\t\t...state[ itemType ],\n\t\t\t[ scope ]: item || null,\n\t\t},\n\t};\n}\n\n/**\n * Reducer keeping track of the \"pinned\" items per scope.\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action object.\n * @param {string} action.type Action type.\n * @param {string} action.itemType Type of item.\n * @param {string} action.scope Item scope.\n * @param {string} action.item Item name.\n * @param {boolean} action.isEnable Whether the item is pinned.\n *\n * @return {Object} Updated state.\n */\nexport function multipleEnableItems(\n\tstate = {},\n\t{ type, itemType, scope, item, isEnable }\n) {\n\tif (\n\t\ttype !== 'SET_MULTIPLE_ENABLE_ITEM' ||\n\t\t! itemType ||\n\t\t! scope ||\n\t\t! item ||\n\t\tget( state, [ itemType, scope, item ] ) === isEnable\n\t) {\n\t\treturn state;\n\t}\n\tconst currentTypeState = state[ itemType ] || {};\n\tconst currentScopeState = currentTypeState[ scope ] || {};\n\n\treturn {\n\t\t...state,\n\t\t[ itemType ]: {\n\t\t\t...currentTypeState,\n\t\t\t[ scope ]: {\n\t\t\t\t...currentScopeState,\n\t\t\t\t[ item ]: isEnable || false,\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Reducer returning the defaults for user preferences.\n *\n * This is kept intentionally separate from the preferences\n * themselves so that defaults are not persisted.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const preferenceDefaults = combineReducers( {\n\tfeatures( state = {}, action ) {\n\t\tif ( action.type === 'SET_FEATURE_DEFAULTS' ) {\n\t\t\tconst { scope, defaults } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: {\n\t\t\t\t\t...state[ scope ],\n\t\t\t\t\t...defaults,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn state;\n\t},\n} );\n\n/**\n * Reducer returning the user preferences.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const preferences = combineReducers( {\n\tfeatures( state = {}, action ) {\n\t\tif ( action.type === 'SET_FEATURE_VALUE' ) {\n\t\t\tconst { scope, featureName, value } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: {\n\t\t\t\t\t...state[ scope ],\n\t\t\t\t\t[ featureName ]: value,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn state;\n\t},\n} );\n\nconst enableItems = combineReducers( {\n\tsingleEnableItems,\n\tmultipleEnableItems,\n} );\n\nexport default combineReducers( {\n\tenableItems,\n\tpreferenceDefaults,\n\tpreferences,\n} );\n"]}
|
|
@@ -122,6 +122,12 @@
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
@media (min-width: 782px) {
|
|
126
|
+
.components-panel__header + .interface-complementary-area-header {
|
|
127
|
+
margin-top: 0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
125
131
|
.interface-complementary-area {
|
|
126
132
|
background: #fff;
|
|
127
133
|
color: #1e1e1e;
|
|
@@ -157,12 +163,18 @@
|
|
|
157
163
|
.interface-complementary-area p {
|
|
158
164
|
margin-top: 0;
|
|
159
165
|
}
|
|
160
|
-
.interface-complementary-area h2
|
|
161
|
-
.interface-complementary-area h3 {
|
|
166
|
+
.interface-complementary-area h2 {
|
|
162
167
|
font-size: 13px;
|
|
163
168
|
color: #1e1e1e;
|
|
164
169
|
margin-bottom: 1.5em;
|
|
165
170
|
}
|
|
171
|
+
.interface-complementary-area h3 {
|
|
172
|
+
font-size: 11px;
|
|
173
|
+
text-transform: uppercase;
|
|
174
|
+
font-weight: 500;
|
|
175
|
+
color: #1e1e1e;
|
|
176
|
+
margin-bottom: 1.5em;
|
|
177
|
+
}
|
|
166
178
|
.interface-complementary-area hr {
|
|
167
179
|
border-top: none;
|
|
168
180
|
border-bottom: 1px solid #f0f0f0;
|