@wordpress/interface 5.10.0 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/action-item/index.js +25 -30
- package/build/components/action-item/index.js.map +1 -1
- package/build/components/complementary-area/index.js +27 -30
- package/build/components/complementary-area/index.js.map +1 -1
- package/build/components/complementary-area-header/index.js +6 -7
- package/build/components/complementary-area-header/index.js.map +1 -1
- package/build/components/complementary-area-more-menu-item/index.js +15 -19
- package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build/components/complementary-area-toggle/index.js +9 -10
- 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 +17 -18
- 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 +7 -8
- package/build/components/navigable-region/index.js.map +1 -1
- package/build/components/pinned-items/index.js +10 -12
- 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 +25 -30
- package/build-module/components/action-item/index.js.map +1 -1
- package/build-module/components/complementary-area/index.js +27 -30
- package/build-module/components/complementary-area/index.js.map +1 -1
- package/build-module/components/complementary-area-header/index.js +6 -7
- package/build-module/components/complementary-area-header/index.js.map +1 -1
- package/build-module/components/complementary-area-more-menu-item/index.js +14 -18
- package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
- package/build-module/components/complementary-area-toggle/index.js +9 -10
- 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 +17 -18
- 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 +7 -8
- package/build-module/components/navigable-region/index.js.map +1 -1
- package/build-module/components/pinned-items/index.js +10 -12
- 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/build-style/style-rtl.css +1 -1
- package/build-style/style.css +1 -1
- package/package.json +13 -13
|
@@ -5,14 +5,13 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { ToggleControl } from '@wordpress/components';
|
|
7
7
|
|
|
8
|
-
function BaseOption(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
8
|
+
function BaseOption({
|
|
9
|
+
help,
|
|
10
|
+
label,
|
|
11
|
+
isChecked,
|
|
12
|
+
onChange,
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
16
15
|
return createElement("div", {
|
|
17
16
|
className: "interface-preferences-modal__option"
|
|
18
17
|
}, createElement(ToggleControl, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal-base-option/index.js"],"names":["ToggleControl","BaseOption","help","label","isChecked","onChange","children"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,uBAA9B;;AAEA,SAASC,UAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal-base-option/index.js"],"names":["ToggleControl","BaseOption","help","label","isChecked","onChange","children"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,uBAA9B;;AAEA,SAASC,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,cAAC,aAAD;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;;AAED,eAAeL,UAAf","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"]}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
2
|
|
|
3
|
-
const Section =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
className: "interface-preferences-modal__section-description"
|
|
17
|
-
}, description)), children);
|
|
18
|
-
};
|
|
3
|
+
const Section = ({
|
|
4
|
+
description,
|
|
5
|
+
title,
|
|
6
|
+
children
|
|
7
|
+
}) => createElement("fieldset", {
|
|
8
|
+
className: "interface-preferences-modal__section"
|
|
9
|
+
}, createElement("legend", {
|
|
10
|
+
className: "interface-preferences-modal__section-legend"
|
|
11
|
+
}, createElement("h2", {
|
|
12
|
+
className: "interface-preferences-modal__section-title"
|
|
13
|
+
}, title), description && createElement("p", {
|
|
14
|
+
className: "interface-preferences-modal__section-description"
|
|
15
|
+
}, description)), children);
|
|
19
16
|
|
|
20
17
|
export default Section;
|
|
21
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -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;;AAgBA,eAAeH,OAAf","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"]}
|
|
@@ -9,10 +9,9 @@ import { useMemo, useCallback, useState } from '@wordpress/element';
|
|
|
9
9
|
import { chevronLeft, chevronRight, Icon } from '@wordpress/icons';
|
|
10
10
|
import { isRTL, __ } from '@wordpress/i18n';
|
|
11
11
|
const PREFERENCES_MENU = 'preferences-menu';
|
|
12
|
-
export default function PreferencesModalTabs(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
12
|
+
export default function PreferencesModalTabs({
|
|
13
|
+
sections
|
|
14
|
+
}) {
|
|
16
15
|
const isLargeViewport = useViewportMatch('medium'); // This is also used to sync the two different rendered components
|
|
17
16
|
// between small and large viewports.
|
|
18
17
|
|
|
@@ -33,12 +32,11 @@ export default function PreferencesModalTabs(_ref) {
|
|
|
33
32
|
};
|
|
34
33
|
|
|
35
34
|
if (sections.length) {
|
|
36
|
-
mappedTabs = sections.reduce((accumulator,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} = _ref2;
|
|
35
|
+
mappedTabs = sections.reduce((accumulator, {
|
|
36
|
+
name,
|
|
37
|
+
tabLabel: title,
|
|
38
|
+
content
|
|
39
|
+
}) => {
|
|
42
40
|
accumulator.tabs.push({
|
|
43
41
|
name,
|
|
44
42
|
title
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal-tabs/index.js"],"names":["useViewportMatch","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalNavigatorButton","NavigatorButton","__experimentalNavigatorBackButton","NavigatorBackButton","__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalHStack","HStack","__experimentalText","Text","__experimentalTruncate","Truncate","FlexItem","TabPanel","Card","CardHeader","CardBody","useMemo","useCallback","useState","chevronLeft","chevronRight","Icon","isRTL","__","PREFERENCES_MENU","PreferencesModalTabs","sections","isLargeViewport","activeMenu","setActiveMenu","tabs","sectionsContentMap","mappedTabs","length","reduce","accumulator","name","tabLabel","title","content","push","getCurrentTab","tab","modalContent","undefined","map","section"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,gBAAT,QAAiC,oBAAjC;AACA,SACCC,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,6BAA6B,IAAIC,eAHlC,EAICC,iCAAiC,IAAIC,mBAJtC,EAKCC,uBAAuB,IAAIC,SAL5B,EAMCC,kBAAkB,IAAIC,IANvB,EAOCC,oBAAoB,IAAIC,MAPzB,EAQCC,kBAAkB,IAAIC,IARvB,EASCC,sBAAsB,IAAIC,QAT3B,EAUCC,QAVD,EAWCC,QAXD,EAYCC,IAZD,EAaCC,UAbD,EAcCC,QAdD,QAeO,uBAfP;AAgBA,SAASC,OAAT,EAAkBC,WAAlB,EAA+BC,QAA/B,QAA+C,oBAA/C;AACA,SAASC,WAAT,EAAsBC,YAAtB,EAAoCC,IAApC,QAAgD,kBAAhD;AACA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AAEA,MAAMC,gBAAgB,GAAG,kBAAzB;AAEA,eAAe,SAASC,oBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/components/preferences-modal-tabs/index.js"],"names":["useViewportMatch","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalNavigatorButton","NavigatorButton","__experimentalNavigatorBackButton","NavigatorBackButton","__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalHStack","HStack","__experimentalText","Text","__experimentalTruncate","Truncate","FlexItem","TabPanel","Card","CardHeader","CardBody","useMemo","useCallback","useState","chevronLeft","chevronRight","Icon","isRTL","__","PREFERENCES_MENU","PreferencesModalTabs","sections","isLargeViewport","activeMenu","setActiveMenu","tabs","sectionsContentMap","mappedTabs","length","reduce","accumulator","name","tabLabel","title","content","push","getCurrentTab","tab","modalContent","undefined","map","section"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,gBAAT,QAAiC,oBAAjC;AACA,SACCC,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,6BAA6B,IAAIC,eAHlC,EAICC,iCAAiC,IAAIC,mBAJtC,EAKCC,uBAAuB,IAAIC,SAL5B,EAMCC,kBAAkB,IAAIC,IANvB,EAOCC,oBAAoB,IAAIC,MAPzB,EAQCC,kBAAkB,IAAIC,IARvB,EASCC,sBAAsB,IAAIC,QAT3B,EAUCC,QAVD,EAWCC,QAXD,EAYCC,IAZD,EAaCC,UAbD,EAcCC,QAdD,QAeO,uBAfP;AAgBA,SAASC,OAAT,EAAkBC,WAAlB,EAA+BC,QAA/B,QAA+C,oBAA/C;AACA,SAASC,WAAT,EAAsBC,YAAtB,EAAoCC,IAApC,QAAgD,kBAAhD;AACA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AAEA,MAAMC,gBAAgB,GAAG,kBAAzB;AAEA,eAAe,SAASC,oBAAT,CAA+B;AAAEC,EAAAA;AAAF,CAA/B,EAA8C;AAC5D,QAAMC,eAAe,GAAGnC,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;AAGC,QAAA,IAAI,EAAC,OAHN;AAIC,QAAA,GAAG,EAAC;AAJL,SAMC,cAAC,mBAAD;AACC,QAAA,IAAI,EACHd,KAAK,KACFF,YADE,GAEFD,WAJL;AAMC,sBAAaI,EAAE,CACd,+BADc;AANhB,QAND,EAgBC,cAAC,IAAD;AAAM,QAAA,IAAI,EAAC;AAAX,SACGuB,OAAO,CAACT,QADX,CAhBD,CADD,EAqBC,cAAC,QAAD,QAAYS,OAAO,CAACP,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"]}
|
|
@@ -24,12 +24,10 @@ export const setDefaultComplementaryArea = (scope, area) => ({
|
|
|
24
24
|
* @param {string} area Area identifier.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
export const enableComplementaryArea = (scope, area) =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
32
|
-
|
|
27
|
+
export const enableComplementaryArea = (scope, area) => ({
|
|
28
|
+
registry,
|
|
29
|
+
dispatch
|
|
30
|
+
}) => {
|
|
33
31
|
// Return early if there's no area.
|
|
34
32
|
if (!area) {
|
|
35
33
|
return;
|
|
@@ -53,10 +51,9 @@ export const enableComplementaryArea = (scope, area) => _ref => {
|
|
|
53
51
|
* @param {string} scope Complementary area scope.
|
|
54
52
|
*/
|
|
55
53
|
|
|
56
|
-
export const disableComplementaryArea = scope =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} = _ref2;
|
|
54
|
+
export const disableComplementaryArea = scope => ({
|
|
55
|
+
registry
|
|
56
|
+
}) => {
|
|
60
57
|
const isComplementaryAreaVisible = registry.select(preferencesStore).get(scope, 'isComplementaryAreaVisible');
|
|
61
58
|
|
|
62
59
|
if (isComplementaryAreaVisible) {
|
|
@@ -72,11 +69,9 @@ export const disableComplementaryArea = scope => _ref2 => {
|
|
|
72
69
|
* @return {Object} Action object.
|
|
73
70
|
*/
|
|
74
71
|
|
|
75
|
-
export const pinItem = (scope, item) =>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
} = _ref3;
|
|
79
|
-
|
|
72
|
+
export const pinItem = (scope, item) => ({
|
|
73
|
+
registry
|
|
74
|
+
}) => {
|
|
80
75
|
// Return early if there's no item.
|
|
81
76
|
if (!item) {
|
|
82
77
|
return;
|
|
@@ -84,7 +79,7 @@ export const pinItem = (scope, item) => _ref3 => {
|
|
|
84
79
|
|
|
85
80
|
const pinnedItems = registry.select(preferencesStore).get(scope, 'pinnedItems'); // The item is already pinned, there's nothing to do.
|
|
86
81
|
|
|
87
|
-
if (
|
|
82
|
+
if (pinnedItems?.[item] === true) {
|
|
88
83
|
return;
|
|
89
84
|
}
|
|
90
85
|
|
|
@@ -99,11 +94,9 @@ export const pinItem = (scope, item) => _ref3 => {
|
|
|
99
94
|
* @param {string} item Item identifier.
|
|
100
95
|
*/
|
|
101
96
|
|
|
102
|
-
export const unpinItem = (scope, item) =>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
} = _ref4;
|
|
106
|
-
|
|
97
|
+
export const unpinItem = (scope, item) => ({
|
|
98
|
+
registry
|
|
99
|
+
}) => {
|
|
107
100
|
// Return early if there's no item.
|
|
108
101
|
if (!item) {
|
|
109
102
|
return;
|
|
@@ -122,10 +115,9 @@ export const unpinItem = (scope, item) => _ref4 => {
|
|
|
122
115
|
*/
|
|
123
116
|
|
|
124
117
|
export function toggleFeature(scope, featureName) {
|
|
125
|
-
return function (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
} = _ref5;
|
|
118
|
+
return function ({
|
|
119
|
+
registry
|
|
120
|
+
}) {
|
|
129
121
|
deprecated(`dispatch( 'core/interface' ).toggleFeature`, {
|
|
130
122
|
since: '6.0',
|
|
131
123
|
alternative: `dispatch( 'core/preferences' ).toggle`
|
|
@@ -145,10 +137,9 @@ export function toggleFeature(scope, featureName) {
|
|
|
145
137
|
*/
|
|
146
138
|
|
|
147
139
|
export function setFeatureValue(scope, featureName, value) {
|
|
148
|
-
return function (
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
} = _ref6;
|
|
140
|
+
return function ({
|
|
141
|
+
registry
|
|
142
|
+
}) {
|
|
152
143
|
deprecated(`dispatch( 'core/interface' ).setFeatureValue`, {
|
|
153
144
|
since: '6.0',
|
|
154
145
|
alternative: `dispatch( 'core/preferences' ).set`
|
|
@@ -166,10 +157,9 @@ export function setFeatureValue(scope, featureName, value) {
|
|
|
166
157
|
*/
|
|
167
158
|
|
|
168
159
|
export function setFeatureDefaults(scope, defaults) {
|
|
169
|
-
return function (
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
} = _ref7;
|
|
160
|
+
return function ({
|
|
161
|
+
registry
|
|
162
|
+
}) {
|
|
173
163
|
deprecated(`dispatch( 'core/interface' ).setFeatureDefaults`, {
|
|
174
164
|
since: '6.0',
|
|
175
165
|
alternative: `dispatch( 'core/preferences' ).setDefaults`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/store/actions.js"],"names":["deprecated","store","preferencesStore","setDefaultComplementaryArea","scope","area","type","enableComplementaryArea","registry","dispatch","isComplementaryAreaVisible","select","get","set","disableComplementaryArea","pinItem","item","pinnedItems","unpinItem","toggleFeature","featureName","since","alternative","toggle","setFeatureValue","value","setFeatureDefaults","defaults","setDefaults"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,uBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,2BAA2B,GAAG,CAAEC,KAAF,EAASC,IAAT,MAAqB;AAC/DC,EAAAA,IAAI,EAAE,gCADyD;AAE/DF,EAAAA,KAF+D;AAG/DC,EAAAA;AAH+D,CAArB,CAApC;AAMP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAME,uBAAuB,GACnC,CAAEH,KAAF,EAASC,IAAT,KACA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/store/actions.js"],"names":["deprecated","store","preferencesStore","setDefaultComplementaryArea","scope","area","type","enableComplementaryArea","registry","dispatch","isComplementaryAreaVisible","select","get","set","disableComplementaryArea","pinItem","item","pinnedItems","unpinItem","toggleFeature","featureName","since","alternative","toggle","setFeatureValue","value","setFeatureDefaults","defaults","setDefaults"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,uBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,2BAA2B,GAAG,CAAEC,KAAF,EAASC,IAAT,MAAqB;AAC/DC,EAAAA,IAAI,EAAE,gCADyD;AAE/DF,EAAAA,KAF+D;AAG/DC,EAAAA;AAH+D,CAArB,CAApC;AAMP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAME,uBAAuB,GACnC,CAAEH,KAAF,EAASC,IAAT,KACA,CAAE;AAAEG,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAF,KAA8B;AAC7B;AACA,MAAK,CAAEJ,IAAP,EAAc;AACb;AACA;;AAED,QAAMK,0BAA0B,GAAGF,QAAQ,CACzCG,MADiC,CACzBT,gBADyB,EAEjCU,GAFiC,CAE5BR,KAF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,CAAC,CAAEK,KAF9B;AAGA,GATD;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,kBAAT,CAA6BtB,KAA7B,EAAoCuB,QAApC,EAA+C;AACrD,SAAO,UAAW;AAAEnB,IAAAA;AAAF,GAAX,EAA0B;AAChCR,IAAAA,UAAU,CAAG,iDAAH,EAAqD;AAC9DqB,MAAAA,KAAK,EAAE,KADuD;AAE9DC,MAAAA,WAAW,EAAG;AAFgD,KAArD,CAAV;AAKAd,IAAAA,QAAQ,CAACC,QAAT,CAAmBP,gBAAnB,EAAsC0B,WAAtC,CAAmDxB,KAAnD,EAA0DuB,QAA1D;AACA,GAPD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Set a default complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n *\n * @return {Object} Action object.\n */\nexport const setDefaultComplementaryArea = ( scope, area ) => ( {\n\ttype: 'SET_DEFAULT_COMPLEMENTARY_AREA',\n\tscope,\n\tarea,\n} );\n\n/**\n * Enable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n */\nexport const enableComplementaryArea =\n\t( scope, area ) =>\n\t( { registry, dispatch } ) => {\n\t\t// Return early if there's no area.\n\t\tif ( ! area ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( ! isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', true );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'ENABLE_COMPLEMENTARY_AREA',\n\t\t\tscope,\n\t\t\tarea,\n\t\t} );\n\t};\n\n/**\n * Disable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n */\nexport const disableComplementaryArea =\n\t( scope ) =>\n\t( { registry } ) => {\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', false );\n\t\t}\n\t};\n\n/**\n * Pins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n *\n * @return {Object} Action object.\n */\nexport const pinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\t// The item is already pinned, there's nothing to do.\n\t\tif ( pinnedItems?.[ item ] === true ) {\n\t\t\treturn;\n\t\t}\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: true,\n\t\t} );\n\t};\n\n/**\n * Unpins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n */\nexport const unpinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: false,\n\t\t} );\n\t};\n\n/**\n * Returns an action object used in signalling that a feature should be toggled.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n */\nexport function toggleFeature( scope, featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).toggleFeature`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).toggle`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).toggle( scope, featureName );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a feature should be set to\n * a true or false value\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n * @param {boolean} value The value to set.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureValue( scope, featureName, value ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureValue`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).set`,\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, featureName, !! value );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that defaults should be set for features.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {Object<string, boolean>} defaults A key/value map of feature names to values.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureDefaults( scope, defaults ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureDefaults`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).setDefaults`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).setDefaults( scope, defaults );\n\t};\n}\n"]}
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { combineReducers } from '@wordpress/data';
|
|
5
|
-
export function complementaryAreas() {
|
|
6
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
8
|
-
|
|
5
|
+
export function complementaryAreas(state = {}, action) {
|
|
9
6
|
switch (action.type) {
|
|
10
7
|
case 'SET_DEFAULT_COMPLEMENTARY_AREA':
|
|
11
8
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/store/reducer.js"],"names":["combineReducers","complementaryAreas","state","action","type","scope","area"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA,OAAO,SAASC,kBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/store/reducer.js"],"names":["combineReducers","complementaryAreas","state","action","type","scope","area"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA,OAAO,SAASC,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;AAED,eAAeF,eAAe,CAAE;AAC/BC,EAAAA;AAD+B,CAAF,CAA9B","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"]}
|
|
@@ -14,8 +14,6 @@ import { store as preferencesStore } from '@wordpress/preferences';
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
export const getActiveComplementaryArea = createRegistrySelector(select => (state, scope) => {
|
|
17
|
-
var _state$complementaryA;
|
|
18
|
-
|
|
19
17
|
const isComplementaryAreaVisible = select(preferencesStore).get(scope, 'isComplementaryAreaVisible'); // Return `undefined` to indicate that the user has never toggled
|
|
20
18
|
// visibility, this is the vanilla default. Other code relies on this
|
|
21
19
|
// nuance in the return value.
|
|
@@ -29,13 +27,11 @@ export const getActiveComplementaryArea = createRegistrySelector(select => (stat
|
|
|
29
27
|
return null;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
return state
|
|
30
|
+
return state?.complementaryAreas?.[scope];
|
|
33
31
|
});
|
|
34
32
|
export const isComplementaryAreaLoading = createRegistrySelector(select => (state, scope) => {
|
|
35
|
-
var _state$complementaryA2;
|
|
36
|
-
|
|
37
33
|
const isVisible = select(preferencesStore).get(scope, 'isComplementaryAreaVisible');
|
|
38
|
-
const identifier = state
|
|
34
|
+
const identifier = state?.complementaryAreas?.[scope];
|
|
39
35
|
return isVisible && identifier === undefined;
|
|
40
36
|
});
|
|
41
37
|
/**
|
|
@@ -52,7 +48,7 @@ export const isItemPinned = createRegistrySelector(select => (state, scope, item
|
|
|
52
48
|
var _pinnedItems$item;
|
|
53
49
|
|
|
54
50
|
const pinnedItems = select(preferencesStore).get(scope, 'pinnedItems');
|
|
55
|
-
return (_pinnedItems$item = pinnedItems
|
|
51
|
+
return (_pinnedItems$item = pinnedItems?.[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true;
|
|
56
52
|
});
|
|
57
53
|
/**
|
|
58
54
|
* Returns a boolean indicating whether a feature is active for a particular
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/interface/src/store/selectors.js"],"names":["createRegistrySelector","deprecated","store","preferencesStore","getActiveComplementaryArea","select","state","scope","isComplementaryAreaVisible","get","undefined","complementaryAreas","isComplementaryAreaLoading","isVisible","identifier","isItemPinned","item","pinnedItems","isFeatureActive","featureName","since","alternative"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAT,QAAuC,iBAAvC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,0BAA0B,GAAGJ,sBAAsB,CAC7DK,MAAF,IAAc,CAAEC,KAAF,EAASC,KAAT,KAAoB;
|
|
1
|
+
{"version":3,"sources":["@wordpress/interface/src/store/selectors.js"],"names":["createRegistrySelector","deprecated","store","preferencesStore","getActiveComplementaryArea","select","state","scope","isComplementaryAreaVisible","get","undefined","complementaryAreas","isComplementaryAreaLoading","isVisible","identifier","isItemPinned","item","pinnedItems","isFeatureActive","featureName","since","alternative"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAT,QAAuC,iBAAvC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,0BAA0B,GAAGJ,sBAAsB,CAC7DK,MAAF,IAAc,CAAEC,KAAF,EAASC,KAAT,KAAoB;AACjC,QAAMC,0BAA0B,GAAGH,MAAM,CAAEF,gBAAF,CAAN,CAA2BM,GAA3B,CAClCF,KADkC,EAElC,4BAFkC,CAAnC,CADiC,CAMjC;AACA;AACA;;AACA,MAAKC,0BAA0B,KA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AhC,EAAuCY,WAAvC,CAAV;AACA,CAXmD,CAA9C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Returns the complementary area that is active in a given scope.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Item scope.\n *\n * @return {string | null | undefined} The complementary area that is active in the given scope.\n */\nexport const getActiveComplementaryArea = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tconst isComplementaryAreaVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\n\t\t// Return `undefined` to indicate that the user has never toggled\n\t\t// visibility, this is the vanilla default. Other code relies on this\n\t\t// nuance in the return value.\n\t\tif ( isComplementaryAreaVisible === undefined ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Return `null` to indicate the user hid the complementary area.\n\t\tif ( isComplementaryAreaVisible === false ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn state?.complementaryAreas?.[ scope ];\n\t}\n);\n\nexport const isComplementaryAreaLoading = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tconst isVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\t\tconst identifier = state?.complementaryAreas?.[ scope ];\n\n\t\treturn isVisible && identifier === undefined;\n\t}\n);\n\n/**\n * Returns a boolean indicating if an item is pinned or not.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Scope.\n * @param {string} item Item to check.\n *\n * @return {boolean} True if the item is pinned and false otherwise.\n */\nexport const isItemPinned = createRegistrySelector(\n\t( select ) => ( state, scope, item ) => {\n\t\tconst pinnedItems = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'pinnedItems'\n\t\t);\n\t\treturn pinnedItems?.[ item ] ?? true;\n\t}\n);\n\n/**\n * Returns a boolean indicating whether a feature is active for a particular\n * scope.\n *\n * @param {Object} state The store state.\n * @param {string} scope The scope of the feature (e.g. core/edit-post).\n * @param {string} featureName The name of the feature.\n *\n * @return {boolean} Is the feature enabled?\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, scope, featureName ) => {\n\t\tdeprecated(\n\t\t\t`select( 'core/interface' ).isFeatureActive( scope, featureName )`,\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative: `select( 'core/preferences' ).get( scope, featureName )`,\n\t\t\t}\n\t\t);\n\n\t\treturn !! select( preferencesStore ).get( scope, featureName );\n\t}\n);\n"]}
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
--wp-block-synced-color: #7a00df;
|
|
98
98
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
99
99
|
}
|
|
100
|
-
@media (
|
|
100
|
+
@media (min-resolution: 192dpi) {
|
|
101
101
|
:root {
|
|
102
102
|
--wp-admin-border-width-focus: 1.5px;
|
|
103
103
|
}
|
package/build-style/style.css
CHANGED
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
--wp-block-synced-color: #7a00df;
|
|
98
98
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
99
99
|
}
|
|
100
|
-
@media (
|
|
100
|
+
@media (min-resolution: 192dpi) {
|
|
101
101
|
:root {
|
|
102
102
|
--wp-admin-border-width-focus: 1.5px;
|
|
103
103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/interface",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.12.0",
|
|
4
4
|
"description": "Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
|
-
"@wordpress/a11y": "^3.
|
|
36
|
-
"@wordpress/components": "^
|
|
37
|
-
"@wordpress/compose": "^6.
|
|
38
|
-
"@wordpress/data": "^9.
|
|
39
|
-
"@wordpress/deprecated": "^3.
|
|
40
|
-
"@wordpress/element": "^5.
|
|
41
|
-
"@wordpress/i18n": "^4.
|
|
42
|
-
"@wordpress/icons": "^9.
|
|
43
|
-
"@wordpress/plugins": "^6.
|
|
44
|
-
"@wordpress/preferences": "^3.
|
|
45
|
-
"@wordpress/viewport": "^5.
|
|
35
|
+
"@wordpress/a11y": "^3.35.0",
|
|
36
|
+
"@wordpress/components": "^25.1.0",
|
|
37
|
+
"@wordpress/compose": "^6.12.0",
|
|
38
|
+
"@wordpress/data": "^9.5.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.35.0",
|
|
40
|
+
"@wordpress/element": "^5.12.0",
|
|
41
|
+
"@wordpress/i18n": "^4.35.0",
|
|
42
|
+
"@wordpress/icons": "^9.26.0",
|
|
43
|
+
"@wordpress/plugins": "^6.3.0",
|
|
44
|
+
"@wordpress/preferences": "^3.12.0",
|
|
45
|
+
"@wordpress/viewport": "^5.12.0",
|
|
46
46
|
"classnames": "^2.3.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "a92f606309b1541b834ff9b0a76ed2a466fc45ed"
|
|
56
56
|
}
|