@wordpress/interface 5.11.0 → 5.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/action-item/index.js +31 -38
- package/build/components/action-item/index.js.map +1 -1
- package/build/components/complementary-area/index.js +30 -34
- package/build/components/complementary-area/index.js.map +1 -1
- package/build/components/complementary-area-header/index.js +10 -12
- package/build/components/complementary-area-header/index.js.map +1 -1
- package/build/components/complementary-area-more-menu-item/index.js +24 -27
- package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build/components/complementary-area-toggle/index.js +13 -15
- package/build/components/complementary-area-toggle/index.js.map +1 -1
- package/build/components/fullscreen-mode/index.js +3 -4
- package/build/components/fullscreen-mode/index.js.map +1 -1
- package/build/components/interface-skeleton/index.js +32 -33
- package/build/components/interface-skeleton/index.js.map +1 -1
- package/build/components/more-menu-dropdown/index.js +11 -12
- package/build/components/more-menu-dropdown/index.js.map +1 -1
- package/build/components/more-menu-feature-toggle/index.js +9 -10
- package/build/components/more-menu-feature-toggle/index.js.map +1 -1
- package/build/components/navigable-region/index.js +11 -13
- package/build/components/navigable-region/index.js.map +1 -1
- package/build/components/pinned-items/index.js +15 -17
- package/build/components/pinned-items/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +4 -5
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal-base-option/index.js +7 -8
- package/build/components/preferences-modal-base-option/index.js.map +1 -1
- package/build/components/preferences-modal-section/index.js +13 -16
- package/build/components/preferences-modal-section/index.js.map +1 -1
- package/build/components/preferences-modal-tabs/index.js +8 -10
- package/build/components/preferences-modal-tabs/index.js.map +1 -1
- package/build/store/actions.js +23 -33
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +1 -4
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +3 -7
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/action-item/index.js +31 -35
- package/build-module/components/action-item/index.js.map +1 -1
- package/build-module/components/complementary-area/index.js +30 -33
- package/build-module/components/complementary-area/index.js.map +1 -1
- package/build-module/components/complementary-area-header/index.js +10 -11
- package/build-module/components/complementary-area-header/index.js.map +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.js +23 -25
- package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build-module/components/complementary-area-toggle/index.js +13 -14
- package/build-module/components/complementary-area-toggle/index.js.map +1 -1
- package/build-module/components/fullscreen-mode/index.js +3 -4
- package/build-module/components/fullscreen-mode/index.js.map +1 -1
- package/build-module/components/interface-skeleton/index.js +32 -32
- package/build-module/components/interface-skeleton/index.js.map +1 -1
- package/build-module/components/more-menu-dropdown/index.js +10 -11
- package/build-module/components/more-menu-dropdown/index.js.map +1 -1
- package/build-module/components/more-menu-feature-toggle/index.js +9 -10
- package/build-module/components/more-menu-feature-toggle/index.js.map +1 -1
- package/build-module/components/navigable-region/index.js +11 -12
- package/build-module/components/navigable-region/index.js.map +1 -1
- package/build-module/components/pinned-items/index.js +15 -16
- package/build-module/components/pinned-items/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal-base-option/index.js +7 -8
- package/build-module/components/preferences-modal-base-option/index.js.map +1 -1
- package/build-module/components/preferences-modal-section/index.js +13 -16
- package/build-module/components/preferences-modal-section/index.js.map +1 -1
- package/build-module/components/preferences-modal-tabs/index.js +8 -10
- package/build-module/components/preferences-modal-tabs/index.js.map +1 -1
- package/build-module/store/actions.js +23 -33
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +1 -4
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +3 -7
- package/build-module/store/selectors.js.map +1 -1
- package/package.json +13 -13
- package/src/components/interface-skeleton/index.js +23 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"names":["useHTMLClass","className","element","document","querySelector","classList","toggle","InterfaceSkeleton","
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"names":["useHTMLClass","className","element","document","querySelector","classList","toggle","InterfaceSkeleton","isDistractionFree","footer","header","editorNotices","sidebar","secondarySidebar","notices","content","actions","labels","enableRegionNavigation","shortcuts","ref","navigateRegionsProps","defaultLabels","body","mergedLabels","headerVariants","hidden","opacity","hover","transition","type","delay","delayChildren","distractionFreeInactive","undefined","motion","div"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AAIA;;AACA;;AAKA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAGA,SAASA,YAAT,CAAuBC,SAAvB,EAAmC;AAClC,0BAAW,MAAM;AAChB,UAAMC,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,GAVD,EAUG,CAAEA,SAAF,CAVH;AAWA;;AAED,SAASM,iBAAT,CACC;AACCC,EAAAA,iBADD;AAECC,EAAAA,MAFD;AAGCC,EAAAA,MAHD;AAICC,EAAAA,aAJD;AAKCC,EAAAA,OALD;AAMCC,EAAAA,gBAND;AAOCC,EAAAA,OAPD;AAQCC,EAAAA,OARD;AASCC,EAAAA,OATD;AAUCC,EAAAA,MAVD;AAWChB,EAAAA,SAXD;AAYCiB,EAAAA,sBAAsB,GAAG,IAZ1B;AAaC;AACA;AACAC,EAAAA;AAfD,CADD,EAkBCC,GAlBD,EAmBE;AACD,QAAMC,oBAAoB,GAAG,8CAAoBF,SAApB,CAA7B;AAEAnB,EAAAA,YAAY,CAA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,wBAAD;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,SAAS,EAAGe,YAAY,CAACf;AAF1B,KAIGA,MAJH,CAxFF,CADD;AAkGA;;eAEc,yBAAYF,iBAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport {\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport NavigableRegion from '../navigable-region';\n\nfunction useHTMLClass( className ) {\n\tuseEffect( () => {\n\t\tconst element =\n\t\t\tdocument && document.querySelector( `html:not(.${ className })` );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\t\telement.classList.toggle( className );\n\t\treturn () => {\n\t\t\telement.classList.toggle( className );\n\t\t};\n\t}, [ className ] );\n}\n\nfunction InterfaceSkeleton(\n\t{\n\t\tisDistractionFree,\n\t\tfooter,\n\t\theader,\n\t\teditorNotices,\n\t\tsidebar,\n\t\tsecondarySidebar,\n\t\tnotices,\n\t\tcontent,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\n\t\tenableRegionNavigation = true,\n\t\t// Todo: does this need to be a prop.\n\t\t// Can we use a dependency to keyboard-shortcuts directly?\n\t\tshortcuts,\n\t},\n\tref\n) {\n\tconst navigateRegionsProps = useNavigateRegions( shortcuts );\n\n\tuseHTMLClass( 'interface-interface-skeleton__html-container' );\n\n\tconst defaultLabels = {\n\t\t/* translators: accessibility text for the top bar landmark region. */\n\t\theader: __( '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\tconst headerVariants = {\n\t\thidden: { opacity: 0 },\n\t\thover: {\n\t\t\topacity: 1,\n\t\t\ttransition: { type: 'tween', delay: 0.2, delayChildren: 0.2 },\n\t\t},\n\t\tdistractionFreeInactive: { opacity: 1, transition: { delay: 0 } },\n\t};\n\n\treturn (\n\t\t<div\n\t\t\t{ ...( enableRegionNavigation ? navigateRegionsProps : {} ) }\n\t\t\tref={ useMergeRefs( [\n\t\t\t\tref,\n\t\t\t\tenableRegionNavigation ? navigateRegionsProps.ref : undefined,\n\t\t\t] ) }\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'interface-interface-skeleton',\n\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t!! footer && 'has-footer'\n\t\t\t) }\n\t\t>\n\t\t\t<div className=\"interface-interface-skeleton__editor\">\n\t\t\t\t{ !! header && (\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hidden'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hover'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? 'hidden'\n\t\t\t\t\t\t\t\t: 'distractionFreeInactive'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvariants={ headerVariants }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t\t? { type: 'tween', delay: 0.8 }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t) }\n\t\t\t\t{ isDistractionFree && (\n\t\t\t\t\t<div className=\"interface-interface-skeleton__header\">\n\t\t\t\t\t\t{ editorNotices }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"interface-interface-skeleton__body\">\n\t\t\t\t\t{ !! secondarySidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__secondary-sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.secondarySidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ secondarySidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! notices && (\n\t\t\t\t\t\t<div className=\"interface-interface-skeleton__notices\">\n\t\t\t\t\t\t\t{ notices }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__content\"\n\t\t\t\t\t\tariaLabel={ mergedLabels.body }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ content }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t{ !! sidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.sidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! actions && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__actions\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.actions }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{ !! footer && (\n\t\t\t\t<NavigableRegion\n\t\t\t\t\tclassName=\"interface-interface-skeleton__footer\"\n\t\t\t\t\tariaLabel={ mergedLabels.footer }\n\t\t\t\t>\n\t\t\t\t\t{ footer }\n\t\t\t\t</NavigableRegion>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default forwardRef( InterfaceSkeleton );\n"]}
|
|
@@ -24,17 +24,16 @@ var _icons = require("@wordpress/icons");
|
|
|
24
24
|
/**
|
|
25
25
|
* WordPress dependencies
|
|
26
26
|
*/
|
|
27
|
-
function MoreMenuDropdown(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
27
|
+
function MoreMenuDropdown({
|
|
28
|
+
as: DropdownComponent = _components.DropdownMenu,
|
|
29
|
+
className,
|
|
30
|
+
|
|
31
|
+
/* translators: button label text should, if possible, be under 16 characters. */
|
|
32
|
+
label = (0, _i18n.__)('Options'),
|
|
33
|
+
popoverProps,
|
|
34
|
+
toggleProps,
|
|
35
|
+
children
|
|
36
|
+
}) {
|
|
38
37
|
return (0, _element.createElement)(DropdownComponent, {
|
|
39
38
|
className: (0, _classnames.default)('interface-more-menu-dropdown', className),
|
|
40
39
|
icon: _icons.moreVertical,
|
|
@@ -42,7 +41,7 @@ function MoreMenuDropdown(_ref) {
|
|
|
42
41
|
popoverProps: {
|
|
43
42
|
placement: 'bottom-end',
|
|
44
43
|
...popoverProps,
|
|
45
|
-
className: (0, _classnames.default)('interface-more-menu-dropdown__content', popoverProps
|
|
44
|
+
className: (0, _classnames.default)('interface-more-menu-dropdown__content', popoverProps?.className)
|
|
46
45
|
},
|
|
47
46
|
toggleProps: {
|
|
48
47
|
tooltipPosition: 'bottom',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-dropdown/index.js"],"names":["MoreMenuDropdown","as","DropdownComponent","DropdownMenu","className","label","popoverProps","toggleProps","children","moreVertical","placement","tooltipPosition","onClose"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,gBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-dropdown/index.js"],"names":["MoreMenuDropdown","as","DropdownComponent","DropdownMenu","className","label","popoverProps","toggleProps","children","moreVertical","placement","tooltipPosition","onClose"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,gBAAT,CAA2B;AACzCC,EAAAA,EAAE,EAAEC,iBAAiB,GAAGC,wBADiB;AAEzCC,EAAAA,SAFyC;;AAGzC;AACAC,EAAAA,KAAK,GAAG,cAAI,SAAJ,CAJiC;AAKzCC,EAAAA,YALyC;AAMzCC,EAAAA,WANyC;AAOzCC,EAAAA;AAPyC,CAA3B,EAQX;AACH,SACC,4BAAC,iBAAD;AACC,IAAA,SAAS,EAAG,yBACX,8BADW,EAEXJ,SAFW,CADb;AAKC,IAAA,IAAI,EAAGK,mBALR;AAMC,IAAA,KAAK,EAAGJ,KANT;AAOC,IAAA,YAAY,EAAG;AACdK,MAAAA,SAAS,EAAE,YADG;AAEd,SAAGJ,YAFW;AAGdF,MAAAA,SAAS,EAAE,yBACV,uCADU,EAEVE,YAAY,EAAEF,SAFJ;AAHG,KAPhB;AAeC,IAAA,WAAW,EAAG;AACbO,MAAAA,eAAe,EAAE,QADJ;AAEb,SAAGJ;AAFU;AAff,KAoBKK,OAAF,IAAeJ,QAAQ,CAAEI,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\tplacement: 'bottom-end',\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"]}
|
|
@@ -26,16 +26,15 @@ var _store = require("../../store");
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
-
function MoreMenuFeatureToggle(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} = _ref;
|
|
29
|
+
function MoreMenuFeatureToggle({
|
|
30
|
+
scope,
|
|
31
|
+
label,
|
|
32
|
+
info,
|
|
33
|
+
messageActivated,
|
|
34
|
+
messageDeactivated,
|
|
35
|
+
shortcut,
|
|
36
|
+
feature
|
|
37
|
+
}) {
|
|
39
38
|
const isActive = (0, _data.useSelect)(select => select(_store.store).isFeatureActive(scope, feature), [feature]);
|
|
40
39
|
const {
|
|
41
40
|
toggleFeature
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-feature-toggle/index.js"],"names":["MoreMenuFeatureToggle","scope","label","info","messageActivated","messageDeactivated","shortcut","feature","isActive","select","interfaceStore","isFeatureActive","toggleFeature","speakMessage","check"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,qBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/more-menu-feature-toggle/index.js"],"names":["MoreMenuFeatureToggle","scope","label","info","messageActivated","messageDeactivated","shortcut","feature","isActive","select","interfaceStore","isFeatureActive","toggleFeature","speakMessage","check"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,qBAAT,CAAgC;AAC9CC,EAAAA,KAD8C;AAE9CC,EAAAA,KAF8C;AAG9CC,EAAAA,IAH8C;AAI9CC,EAAAA,gBAJ8C;AAK9CC,EAAAA,kBAL8C;AAM9CC,EAAAA,QAN8C;AAO9CC,EAAAA;AAP8C,CAAhC,EAQX;AACH,QAAMC,QAAQ,GAAG,qBACdC,MAAF,IACCA,MAAM,CAAEC,YAAF,CAAN,CAAyBC,eAAzB,CAA0CV,KAA1C,EAAiDM,OAAjD,CAFe,EAGhB,CAAEA,OAAF,CAHgB,CAAjB;AAKA,QAAM;AAAEK,IAAAA;AAAF,MAAoB,uBAAaF,YAAb,CAA1B;;AACA,QAAMG,YAAY,GAAG,MAAM;AAC1B,QAAKL,QAAL,EAAgB;AACf,uBAAOH,kBAAkB,IAAI,cAAI,qBAAJ,CAA7B;AACA,KAFD,MAEO;AACN,uBAAOD,gBAAgB,IAAI,cAAI,mBAAJ,CAA3B;AACA;AACD,GAND;;AAQA,SACC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAGI,QAAQ,IAAIM,YADpB;AAEC,IAAA,UAAU,EAAGN,QAFd;AAGC,IAAA,OAAO,EAAG,MAAM;AACfI,MAAAA,aAAa,CAAEX,KAAF,EAASM,OAAT,CAAb;AACAM,MAAAA,YAAY;AACZ,KANF;AAOC,IAAA,IAAI,EAAC,kBAPN;AAQC,IAAA,IAAI,EAAGV,IARR;AASC,IAAA,QAAQ,EAAGG;AATZ,KAWGJ,KAXH,CADD;AAeA","sourcesContent":["/**\n * WordPress dependencies\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"]}
|
|
@@ -9,26 +9,24 @@ exports.default = NavigableRegion;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
15
|
* External dependencies
|
|
18
16
|
*/
|
|
19
|
-
function NavigableRegion(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return (0, _element.createElement)(Tag, (0, _extends2.default)({
|
|
17
|
+
function NavigableRegion({
|
|
18
|
+
children,
|
|
19
|
+
className,
|
|
20
|
+
ariaLabel,
|
|
21
|
+
as: Tag = 'div',
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return (0, _element.createElement)(Tag, {
|
|
28
25
|
className: (0, _classnames.default)('interface-navigable-region', className),
|
|
29
26
|
"aria-label": ariaLabel,
|
|
30
27
|
role: "region",
|
|
31
|
-
tabIndex: "-1"
|
|
32
|
-
|
|
28
|
+
tabIndex: "-1",
|
|
29
|
+
...props
|
|
30
|
+
}, children);
|
|
33
31
|
}
|
|
34
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/navigable-region/index.js"],"names":["NavigableRegion","children","className","ariaLabel","as","Tag","props"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/navigable-region/index.js"],"names":["NavigableRegion","children","className","ariaLabel","as","Tag","props"],"mappings":";;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGe,SAASA,eAAT,CAA0B;AACxCC,EAAAA,QADwC;AAExCC,EAAAA,SAFwC;AAGxCC,EAAAA,SAHwC;AAIxCC,EAAAA,EAAE,EAAEC,GAAG,GAAG,KAJ8B;AAKxC,KAAGC;AALqC,CAA1B,EAMX;AACH,SACC,4BAAC,GAAD;AACC,IAAA,SAAS,EAAG,yBAAY,4BAAZ,EAA0CJ,SAA1C,CADb;AAEC,kBAAaC,SAFd;AAGC,IAAA,IAAI,EAAC,QAHN;AAIC,IAAA,QAAQ,EAAC,IAJV;AAAA,OAKMG;AALN,KAOGL,QAPH,CADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\nexport default function NavigableRegion( {\n\tchildren,\n\tclassName,\n\tariaLabel,\n\tas: Tag = 'div',\n\t...props\n} ) {\n\treturn (\n\t\t<Tag\n\t\t\tclassName={ classnames( 'interface-navigable-region', className ) }\n\t\t\taria-label={ ariaLabel }\n\t\t\trole=\"region\"\n\t\t\ttabIndex=\"-1\"\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t</Tag>\n\t);\n}\n"]}
|
|
@@ -9,8 +9,6 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
13
|
|
|
16
14
|
var _components = require("@wordpress/components");
|
|
@@ -22,25 +20,25 @@ var _components = require("@wordpress/components");
|
|
|
22
20
|
/**
|
|
23
21
|
* WordPress dependencies
|
|
24
22
|
*/
|
|
25
|
-
function PinnedItems(
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
function PinnedItems({
|
|
24
|
+
scope,
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
return (0, _element.createElement)(_components.Fill, {
|
|
28
|
+
name: `PinnedItems/${scope}`,
|
|
28
29
|
...props
|
|
29
|
-
}
|
|
30
|
-
return (0, _element.createElement)(_components.Fill, (0, _extends2.default)({
|
|
31
|
-
name: `PinnedItems/${scope}`
|
|
32
|
-
}, props));
|
|
30
|
+
});
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
function PinnedItemsSlot(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
function PinnedItemsSlot({
|
|
34
|
+
scope,
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
return (0, _element.createElement)(_components.Slot, {
|
|
39
|
+
name: `PinnedItems/${scope}`,
|
|
39
40
|
...props
|
|
40
|
-
}
|
|
41
|
-
return (0, _element.createElement)(_components.Slot, (0, _extends2.default)({
|
|
42
|
-
name: `PinnedItems/${scope}`
|
|
43
|
-
}, props), fills => (fills === null || fills === void 0 ? void 0 : fills.length) > 0 && (0, _element.createElement)("div", {
|
|
41
|
+
}, fills => fills?.length > 0 && (0, _element.createElement)("div", {
|
|
44
42
|
className: (0, _classnames.default)(className, 'interface-pinned-items')
|
|
45
43
|
}, fills));
|
|
46
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/pinned-items/index.js"],"names":["PinnedItems","scope","props","PinnedItemsSlot","className","fills","length","Slot"],"mappings":"
|
|
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,CAAsB;AAAEC,EAAAA,KAAF;AAAS,KAAGC;AAAZ,CAAtB,EAA4C;AAC3C,SAAO,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,eAAeD,KAAO,EAApC;AAAA,OAA6CC;AAA7C,IAAP;AACA;;AAED,SAASC,eAAT,CAA0B;AAAEF,EAAAA,KAAF;AAASG,EAAAA,SAAT;AAAoB,KAAGF;AAAvB,CAA1B,EAA2D;AAC1D,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,eAAeD,KAAO,EAApC;AAAA,OAA6CC;AAA7C,KACKG,KAAF,IACDA,KAAK,EAAEC,MAAP,GAAgB,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"]}
|
|
@@ -14,11 +14,10 @@ var _i18n = require("@wordpress/i18n");
|
|
|
14
14
|
/**
|
|
15
15
|
* WordPress dependencies
|
|
16
16
|
*/
|
|
17
|
-
function PreferencesModal(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = _ref;
|
|
17
|
+
function PreferencesModal({
|
|
18
|
+
closeModal,
|
|
19
|
+
children
|
|
20
|
+
}) {
|
|
22
21
|
return (0, _element.createElement)(_components.Modal, {
|
|
23
22
|
className: "interface-preferences-modal",
|
|
24
23
|
title: (0, _i18n.__)('Preferences'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal/index.js"],"names":["PreferencesModal","closeModal","children"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIe,SAASA,gBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal/index.js"],"names":["PreferencesModal","closeModal","children"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIe,SAASA,gBAAT,CAA2B;AAAEC,EAAAA,UAAF;AAAcC,EAAAA;AAAd,CAA3B,EAAsD;AACpE,SACC,4BAAC,iBAAD;AACC,IAAA,SAAS,EAAC,6BADX;AAEC,IAAA,KAAK,EAAG,cAAI,aAAJ,CAFT;AAGC,IAAA,cAAc,EAAGD;AAHlB,KAKGC,QALH,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function PreferencesModal( { closeModal, children } ) {\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"interface-preferences-modal\"\n\t\t\ttitle={ __( 'Preferences' ) }\n\t\t\tonRequestClose={ closeModal }\n\t\t>\n\t\t\t{ children }\n\t\t</Modal>\n\t);\n}\n"]}
|
|
@@ -12,14 +12,13 @@ var _components = require("@wordpress/components");
|
|
|
12
12
|
/**
|
|
13
13
|
* WordPress dependencies
|
|
14
14
|
*/
|
|
15
|
-
function BaseOption(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
15
|
+
function BaseOption({
|
|
16
|
+
help,
|
|
17
|
+
label,
|
|
18
|
+
isChecked,
|
|
19
|
+
onChange,
|
|
20
|
+
children
|
|
21
|
+
}) {
|
|
23
22
|
return (0, _element.createElement)("div", {
|
|
24
23
|
className: "interface-preferences-modal__option"
|
|
25
24
|
}, (0, _element.createElement)(_components.ToggleControl, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal-base-option/index.js"],"names":["BaseOption","help","label","isChecked","onChange","children"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,SAASA,UAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal-base-option/index.js"],"names":["BaseOption","help","label","isChecked","onChange","children"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,SAASA,UAAT,CAAqB;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,KAAR;AAAeC,EAAAA,SAAf;AAA0BC,EAAAA,QAA1B;AAAoCC,EAAAA;AAApC,CAArB,EAAsE;AACrE,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,yBAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,IAAI,EAAGJ,IAFR;AAGC,IAAA,KAAK,EAAGC,KAHT;AAIC,IAAA,OAAO,EAAGC,SAJX;AAKC,IAAA,QAAQ,EAAGC;AALZ,IADD,EAQGC,QARH,CADD;AAYA;;eAEcL,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToggleControl } from '@wordpress/components';\n\nfunction BaseOption( { help, label, isChecked, onChange, children } ) {\n\treturn (\n\t\t<div className=\"interface-preferences-modal__option\">\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\thelp={ help }\n\t\t\t\tlabel={ label }\n\t\t\t\tchecked={ isChecked }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default BaseOption;\n"]}
|
|
@@ -7,22 +7,19 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _element = require("@wordpress/element");
|
|
9
9
|
|
|
10
|
-
const Section =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
className: "interface-preferences-modal__section-description"
|
|
24
|
-
}, description)), children);
|
|
25
|
-
};
|
|
10
|
+
const Section = ({
|
|
11
|
+
description,
|
|
12
|
+
title,
|
|
13
|
+
children
|
|
14
|
+
}) => (0, _element.createElement)("fieldset", {
|
|
15
|
+
className: "interface-preferences-modal__section"
|
|
16
|
+
}, (0, _element.createElement)("legend", {
|
|
17
|
+
className: "interface-preferences-modal__section-legend"
|
|
18
|
+
}, (0, _element.createElement)("h2", {
|
|
19
|
+
className: "interface-preferences-modal__section-title"
|
|
20
|
+
}, title), description && (0, _element.createElement)("p", {
|
|
21
|
+
className: "interface-preferences-modal__section-description"
|
|
22
|
+
}, description)), children);
|
|
26
23
|
|
|
27
24
|
var _default = Section;
|
|
28
25
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal-section/index.js"],"names":["Section","description","title","children"],"mappings":";;;;;;;;;AAAA,MAAMA,OAAO,GAAG
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal-section/index.js"],"names":["Section","description","title","children"],"mappings":";;;;;;;;;AAAA,MAAMA,OAAO,GAAG,CAAE;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,KAAf;AAAsBC,EAAAA;AAAtB,CAAF,KACf;AAAU,EAAA,SAAS,EAAC;AAApB,GACC;AAAQ,EAAA,SAAS,EAAC;AAAlB,GACC;AAAI,EAAA,SAAS,EAAC;AAAd,GACGD,KADH,CADD,EAIGD,WAAW,IACZ;AAAG,EAAA,SAAS,EAAC;AAAb,GACGA,WADH,CALF,CADD,EAWGE,QAXH,CADD;;eAgBeH,O","sourcesContent":["const Section = ( { description, title, children } ) => (\n\t<fieldset className=\"interface-preferences-modal__section\">\n\t\t<legend className=\"interface-preferences-modal__section-legend\">\n\t\t\t<h2 className=\"interface-preferences-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"interface-preferences-modal__section-description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</legend>\n\t\t{ children }\n\t</fieldset>\n);\n\nexport default Section;\n"]}
|
|
@@ -20,10 +20,9 @@ var _i18n = require("@wordpress/i18n");
|
|
|
20
20
|
*/
|
|
21
21
|
const PREFERENCES_MENU = 'preferences-menu';
|
|
22
22
|
|
|
23
|
-
function PreferencesModalTabs(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = _ref;
|
|
23
|
+
function PreferencesModalTabs({
|
|
24
|
+
sections
|
|
25
|
+
}) {
|
|
27
26
|
const isLargeViewport = (0, _compose.useViewportMatch)('medium'); // This is also used to sync the two different rendered components
|
|
28
27
|
// between small and large viewports.
|
|
29
28
|
|
|
@@ -44,12 +43,11 @@ function PreferencesModalTabs(_ref) {
|
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
if (sections.length) {
|
|
47
|
-
mappedTabs = sections.reduce((accumulator,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} = _ref2;
|
|
46
|
+
mappedTabs = sections.reduce((accumulator, {
|
|
47
|
+
name,
|
|
48
|
+
tabLabel: title,
|
|
49
|
+
content
|
|
50
|
+
}) => {
|
|
53
51
|
accumulator.tabs.push({
|
|
54
52
|
name,
|
|
55
53
|
title
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal-tabs/index.js"],"names":["PREFERENCES_MENU","PreferencesModalTabs","sections","isLargeViewport","activeMenu","setActiveMenu","tabs","sectionsContentMap","mappedTabs","length","reduce","accumulator","name","tabLabel","title","content","push","getCurrentTab","tab","modalContent","undefined","map","Item","chevronLeft","chevronRight","section"],"mappings":";;;;;;;AAoBA;;AAjBA;;AACA;;AAiBA;;AACA;;AAtBA;AACA;AACA;AAsBA,MAAMA,gBAAgB,GAAG,kBAAzB;;AAEe,SAASC,oBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal-tabs/index.js"],"names":["PREFERENCES_MENU","PreferencesModalTabs","sections","isLargeViewport","activeMenu","setActiveMenu","tabs","sectionsContentMap","mappedTabs","length","reduce","accumulator","name","tabLabel","title","content","push","getCurrentTab","tab","modalContent","undefined","map","Item","chevronLeft","chevronRight","section"],"mappings":";;;;;;;AAoBA;;AAjBA;;AACA;;AAiBA;;AACA;;AAtBA;AACA;AACA;AAsBA,MAAMA,gBAAgB,GAAG,kBAAzB;;AAEe,SAASC,oBAAT,CAA+B;AAAEC,EAAAA;AAAF,CAA/B,EAA8C;AAC5D,QAAMC,eAAe,GAAG,+BAAkB,QAAlB,CAAxB,CAD4D,CAG5D;AACA;;AACA,QAAM,CAAEC,UAAF,EAAcC,aAAd,IAAgC,uBAAUL,gBAAV,CAAtC;AACA;AACD;AACA;AACA;AACA;;AACC,QAAM;AAAEM,IAAAA,IAAF;AAAQC,IAAAA;AAAR,MAA+B,sBAAS,MAAM;AACnD,QAAIC,UAAU,GAAG;AAChBF,MAAAA,IAAI,EAAE,EADU;AAEhBC,MAAAA,kBAAkB,EAAE;AAFJ,KAAjB;;AAIA,QAAKL,QAAQ,CAACO,MAAd,EAAuB;AACtBD,MAAAA,UAAU,GAAGN,QAAQ,CAACQ,MAAT,CACZ,CAAEC,WAAF,EAAe;AAAEC,QAAAA,IAAF;AAAQC,QAAAA,QAAQ,EAAEC,KAAlB;AAAyBC,QAAAA;AAAzB,OAAf,KAAuD;AACtDJ,QAAAA,WAAW,CAACL,IAAZ,CAAiBU,IAAjB,CAAuB;AAAEJ,UAAAA,IAAF;AAAQE,UAAAA;AAAR,SAAvB;AACAH,QAAAA,WAAW,CAACJ,kBAAZ,CAAgCK,IAAhC,IAAyCG,OAAzC;AACA,eAAOJ,WAAP;AACA,OALW,EAMZ;AAAEL,QAAAA,IAAI,EAAE,EAAR;AAAYC,QAAAA,kBAAkB,EAAE;AAAhC,OANY,CAAb;AAQA;;AACD,WAAOC,UAAP;AACA,GAhBoC,EAgBlC,CAAEN,QAAF,CAhBkC,CAArC;AAkBA,QAA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CAACO,MAAT,IACDP,QAAQ,CAACmB,GAAT,CAAgBI,OAAF,IAAe;AAC5B,aACC,4BAAC,yCAAD;AACC,QAAA,GAAG,EAAI,GAAGA,OAAO,CAACb,IAAM,OADzB;AAEC,QAAA,IAAI,EAAGa,OAAO,CAACb;AAFhB,SAIC,4BAAC,gBAAD;AAAM,QAAA,YAAY,MAAlB;AAAmB,QAAA,IAAI,EAAC;AAAxB,SACC,4BAAC,sBAAD;AACC,QAAA,YAAY,EAAG,KADhB;AAEC,QAAA,OAAO,EAAC,MAFT;AAGC,QAAA,IAAI,EAAC,OAHN;AAIC,QAAA,GAAG,EAAC;AAJL,SAMC,4BAAC,6CAAD;AACC,QAAA,IAAI,EACH,qBACGY,mBADH,GAEGD,kBAJL;AAMC,sBAAa,cACZ,+BADY;AANd,QAND,EAgBC,4BAAC,8BAAD;AAAM,QAAA,IAAI,EAAC;AAAX,SACGE,OAAO,CAACZ,QADX,CAhBD,CADD,EAqBC,4BAAC,oBAAD,QAAYY,OAAO,CAACV,OAApB,CArBD,CAJD,CADD;AA8BA,KA/BD,CAxCF,CADD;AA2EA;;AAED,SAAOI,YAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalNavigatorButton as NavigatorButton,\n\t__experimentalNavigatorBackButton as NavigatorBackButton,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\t__experimentalTruncate as Truncate,\n\tFlexItem,\n\tTabPanel,\n\tCard,\n\tCardHeader,\n\tCardBody,\n} from '@wordpress/components';\nimport { useMemo, useCallback, useState } from '@wordpress/element';\nimport { chevronLeft, chevronRight, Icon } from '@wordpress/icons';\nimport { isRTL, __ } from '@wordpress/i18n';\n\nconst PREFERENCES_MENU = 'preferences-menu';\n\nexport default function PreferencesModalTabs( { sections } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\t// This is also used to sync the two different rendered components\n\t// between small and large viewports.\n\tconst [ activeMenu, setActiveMenu ] = useState( PREFERENCES_MENU );\n\t/**\n\t * Create helper objects from `sections` for easier data handling.\n\t * `tabs` is used for creating the `TabPanel` and `sectionsContentMap`\n\t * is used for easier access to active tab's content.\n\t */\n\tconst { tabs, sectionsContentMap } = useMemo( () => {\n\t\tlet mappedTabs = {\n\t\t\ttabs: [],\n\t\t\tsectionsContentMap: {},\n\t\t};\n\t\tif ( sections.length ) {\n\t\t\tmappedTabs = sections.reduce(\n\t\t\t\t( accumulator, { name, tabLabel: title, content } ) => {\n\t\t\t\t\taccumulator.tabs.push( { name, title } );\n\t\t\t\t\taccumulator.sectionsContentMap[ name ] = content;\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t{ tabs: [], sectionsContentMap: {} }\n\t\t\t);\n\t\t}\n\t\treturn mappedTabs;\n\t}, [ sections ] );\n\n\tconst getCurrentTab = useCallback(\n\t\t( tab ) => sectionsContentMap[ tab.name ] || null,\n\t\t[ sectionsContentMap ]\n\t);\n\n\tlet modalContent;\n\t// We render different components based on the viewport size.\n\tif ( isLargeViewport ) {\n\t\tmodalContent = (\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"interface-preferences__tabs\"\n\t\t\t\ttabs={ tabs }\n\t\t\t\tinitialTabName={\n\t\t\t\t\tactiveMenu !== PREFERENCES_MENU ? activeMenu : undefined\n\t\t\t\t}\n\t\t\t\tonSelect={ setActiveMenu }\n\t\t\t\torientation=\"vertical\"\n\t\t\t>\n\t\t\t\t{ getCurrentTab }\n\t\t\t</TabPanel>\n\t\t);\n\t} else {\n\t\tmodalContent = (\n\t\t\t<NavigatorProvider\n\t\t\t\tinitialPath=\"/\"\n\t\t\t\tclassName=\"interface-preferences__provider\"\n\t\t\t>\n\t\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t\t<Card isBorderless size=\"small\">\n\t\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\t\t\t\tpath={ tab.name }\n\t\t\t\t\t\t\t\t\t\t\tas={ Item }\n\t\t\t\t\t\t\t\t\t\t\tisAction\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t</NavigatorButton>\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</ItemGroup>\n\t\t\t\t\t\t</CardBody>\n\t\t\t\t\t</Card>\n\t\t\t\t</NavigatorScreen>\n\t\t\t\t{ sections.length &&\n\t\t\t\t\tsections.map( ( section ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<NavigatorScreen\n\t\t\t\t\t\t\t\tkey={ `${ section.name }-menu` }\n\t\t\t\t\t\t\t\tpath={ section.name }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Card isBorderless size=\"large\">\n\t\t\t\t\t\t\t\t\t<CardHeader\n\t\t\t\t\t\t\t\t\t\tisBorderless={ false }\n\t\t\t\t\t\t\t\t\t\tjustify=\"left\"\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\tgap=\"6\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<NavigatorBackButton\n\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigate to the previous view'\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\t<Text size=\"16\">\n\t\t\t\t\t\t\t\t\t\t\t{ section.tabLabel }\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t</CardHeader>\n\t\t\t\t\t\t\t\t\t<CardBody>{ section.content }</CardBody>\n\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t</NavigatorScreen>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t</NavigatorProvider>\n\t\t);\n\t}\n\n\treturn modalContent;\n}\n"]}
|
package/build/store/actions.js
CHANGED
|
@@ -42,12 +42,10 @@ const setDefaultComplementaryArea = (scope, area) => ({
|
|
|
42
42
|
|
|
43
43
|
exports.setDefaultComplementaryArea = setDefaultComplementaryArea;
|
|
44
44
|
|
|
45
|
-
const enableComplementaryArea = (scope, area) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} = _ref;
|
|
50
|
-
|
|
45
|
+
const enableComplementaryArea = (scope, area) => ({
|
|
46
|
+
registry,
|
|
47
|
+
dispatch
|
|
48
|
+
}) => {
|
|
51
49
|
// Return early if there's no area.
|
|
52
50
|
if (!area) {
|
|
53
51
|
return;
|
|
@@ -74,10 +72,9 @@ const enableComplementaryArea = (scope, area) => _ref => {
|
|
|
74
72
|
|
|
75
73
|
exports.enableComplementaryArea = enableComplementaryArea;
|
|
76
74
|
|
|
77
|
-
const disableComplementaryArea = scope =>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
} = _ref2;
|
|
75
|
+
const disableComplementaryArea = scope => ({
|
|
76
|
+
registry
|
|
77
|
+
}) => {
|
|
81
78
|
const isComplementaryAreaVisible = registry.select(_preferences.store).get(scope, 'isComplementaryAreaVisible');
|
|
82
79
|
|
|
83
80
|
if (isComplementaryAreaVisible) {
|
|
@@ -96,11 +93,9 @@ const disableComplementaryArea = scope => _ref2 => {
|
|
|
96
93
|
|
|
97
94
|
exports.disableComplementaryArea = disableComplementaryArea;
|
|
98
95
|
|
|
99
|
-
const pinItem = (scope, item) =>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
} = _ref3;
|
|
103
|
-
|
|
96
|
+
const pinItem = (scope, item) => ({
|
|
97
|
+
registry
|
|
98
|
+
}) => {
|
|
104
99
|
// Return early if there's no item.
|
|
105
100
|
if (!item) {
|
|
106
101
|
return;
|
|
@@ -108,7 +103,7 @@ const pinItem = (scope, item) => _ref3 => {
|
|
|
108
103
|
|
|
109
104
|
const pinnedItems = registry.select(_preferences.store).get(scope, 'pinnedItems'); // The item is already pinned, there's nothing to do.
|
|
110
105
|
|
|
111
|
-
if (
|
|
106
|
+
if (pinnedItems?.[item] === true) {
|
|
112
107
|
return;
|
|
113
108
|
}
|
|
114
109
|
|
|
@@ -126,11 +121,9 @@ const pinItem = (scope, item) => _ref3 => {
|
|
|
126
121
|
|
|
127
122
|
exports.pinItem = pinItem;
|
|
128
123
|
|
|
129
|
-
const unpinItem = (scope, item) =>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
} = _ref4;
|
|
133
|
-
|
|
124
|
+
const unpinItem = (scope, item) => ({
|
|
125
|
+
registry
|
|
126
|
+
}) => {
|
|
134
127
|
// Return early if there's no item.
|
|
135
128
|
if (!item) {
|
|
136
129
|
return;
|
|
@@ -152,10 +145,9 @@ const unpinItem = (scope, item) => _ref4 => {
|
|
|
152
145
|
exports.unpinItem = unpinItem;
|
|
153
146
|
|
|
154
147
|
function toggleFeature(scope, featureName) {
|
|
155
|
-
return function (
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
} = _ref5;
|
|
148
|
+
return function ({
|
|
149
|
+
registry
|
|
150
|
+
}) {
|
|
159
151
|
(0, _deprecated.default)(`dispatch( 'core/interface' ).toggleFeature`, {
|
|
160
152
|
since: '6.0',
|
|
161
153
|
alternative: `dispatch( 'core/preferences' ).toggle`
|
|
@@ -176,10 +168,9 @@ function toggleFeature(scope, featureName) {
|
|
|
176
168
|
|
|
177
169
|
|
|
178
170
|
function setFeatureValue(scope, featureName, value) {
|
|
179
|
-
return function (
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
} = _ref6;
|
|
171
|
+
return function ({
|
|
172
|
+
registry
|
|
173
|
+
}) {
|
|
183
174
|
(0, _deprecated.default)(`dispatch( 'core/interface' ).setFeatureValue`, {
|
|
184
175
|
since: '6.0',
|
|
185
176
|
alternative: `dispatch( 'core/preferences' ).set`
|
|
@@ -198,10 +189,9 @@ function setFeatureValue(scope, featureName, value) {
|
|
|
198
189
|
|
|
199
190
|
|
|
200
191
|
function setFeatureDefaults(scope, defaults) {
|
|
201
|
-
return function (
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
} = _ref7;
|
|
192
|
+
return function ({
|
|
193
|
+
registry
|
|
194
|
+
}) {
|
|
205
195
|
(0, _deprecated.default)(`dispatch( 'core/interface' ).setFeatureDefaults`, {
|
|
206
196
|
since: '6.0',
|
|
207
197
|
alternative: `dispatch( 'core/preferences' ).setDefaults`
|
|
@@ -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,GACnC,CAAEH,KAAF,EAASC,IAAT,KACA,
|
|
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,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6BAAa,8CAAb,EAA4D;AAC3Dc,MAAAA,KAAK,EAAE,KADoD;AAE3DC,MAAAA,WAAW,EAAG;AAF6C,KAA5D;AAKAf,IAAAA,QAAQ,CACNC,QADF,CACYG,kBADZ,EAEEE,GAFF,CAEOV,KAFP,EAEciB,WAFd,EAE2B,CAAC,CAAEK,KAF9B;AAGA,GATD;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,kBAAT,CAA6BvB,KAA7B,EAAoCwB,QAApC,EAA+C;AACrD,SAAO,UAAW;AAAEpB,IAAAA;AAAF,GAAX,EAA0B;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"]}
|
package/build/store/reducer.js
CHANGED
|
@@ -11,10 +11,7 @@ var _data = require("@wordpress/data");
|
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies
|
|
13
13
|
*/
|
|
14
|
-
function complementaryAreas() {
|
|
15
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
17
|
-
|
|
14
|
+
function complementaryAreas(state = {}, action) {
|
|
18
15
|
switch (action.type) {
|
|
19
16
|
case 'SET_DEFAULT_COMPLEMENTARY_AREA':
|
|
20
17
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/store/reducer.js"],"names":["complementaryAreas","state","action","type","scope","area"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,SAASA,kBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/store/reducer.js"],"names":["complementaryAreas","state","action","type","scope","area"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,SAASA,kBAAT,CAA6BC,KAAK,GAAG,EAArC,EAAyCC,MAAzC,EAAkD;AACxD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,gCAAL;AAAuC;AACtC,cAAM;AAAEC,UAAAA,KAAF;AAASC,UAAAA;AAAT,YAAkBH,MAAxB,CADsC,CAGtC;;AACA,YAAKD,KAAK,CAAEG,KAAF,CAAV,EAAsB;AACrB,iBAAOH,KAAP;AACA;;AAED,eAAO,EACN,GAAGA,KADG;AAEN,WAAEG,KAAF,GAAWC;AAFL,SAAP;AAIA;;AACD,SAAK,2BAAL;AAAkC;AACjC,cAAM;AAAED,UAAAA,KAAF;AAASC,UAAAA;AAAT,YAAkBH,MAAxB;AACA,eAAO,EACN,GAAGD,KADG;AAEN,WAAEG,KAAF,GAAWC;AAFL,SAAP;AAIA;AApBF;;AAuBA,SAAOJ,KAAP;AACA;;eAEc,2BAAiB;AAC/BD,EAAAA;AAD+B,CAAjB,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function complementaryAreas( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_DEFAULT_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\n\t\t\t// If there's already an area, don't overwrite it.\n\t\t\tif ( state[ scope ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t\tcase 'ENABLE_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tcomplementaryAreas,\n} );\n"]}
|