@wordpress/preferences 4.32.0 → 4.32.1-next.b8c8708f3.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/build/components/index.js +36 -12
- package/build/components/index.js.map +7 -1
- package/build/components/preference-base-option/index.js +39 -30
- package/build/components/preference-base-option/index.js.map +7 -1
- package/build/components/preference-toggle-control/index.js +52 -30
- package/build/components/preference-toggle-control/index.js.map +7 -1
- package/build/components/preference-toggle-menu-item/index.js +65 -47
- package/build/components/preference-toggle-menu-item/index.js.map +7 -1
- package/build/components/preferences-modal/index.js +35 -23
- package/build/components/preferences-modal/index.js.map +7 -1
- package/build/components/preferences-modal-section/index.js +31 -28
- package/build/components/preferences-modal-section/index.js.map +7 -1
- package/build/components/preferences-modal-tabs/index.js +123 -134
- package/build/components/preferences-modal-tabs/index.js.map +7 -1
- package/build/index.js +29 -36
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/private-apis.js +49 -24
- package/build/private-apis.js.map +7 -1
- package/build/store/actions.js +36 -69
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -12
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +44 -32
- package/build/store/index.js.map +7 -1
- package/build/store/reducer.js +39 -65
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +67 -33
- package/build/store/selectors.js.map +7 -1
- package/build-module/components/index.js +5 -2
- package/build-module/components/index.js.map +7 -1
- package/build-module/components/preference-base-option/index.js +21 -24
- package/build-module/components/preference-base-option/index.js.map +7 -1
- package/build-module/components/preference-toggle-control/index.js +24 -23
- package/build-module/components/preference-toggle-control/index.js.map +7 -1
- package/build-module/components/preference-toggle-menu-item/index.js +46 -40
- package/build-module/components/preference-toggle-menu-item/index.js.map +7 -1
- package/build-module/components/preferences-modal/index.js +17 -17
- package/build-module/components/preferences-modal/index.js.map +7 -1
- package/build-module/components/preferences-modal-section/index.js +13 -23
- package/build-module/components/preferences-modal-section/index.js.map +7 -1
- package/build-module/components/preferences-modal-tabs/index.js +116 -127
- package/build-module/components/preferences-modal-tabs/index.js.map +7 -1
- package/build-module/index.js +7 -4
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/private-apis.js +11 -11
- package/build-module/private-apis.js.map +7 -1
- package/build-module/store/actions.js +15 -65
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -7
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +10 -22
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/reducer.js +17 -59
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +35 -26
- package/build-module/store/selectors.js.map +7 -1
- package/build-style/style-rtl.css +4 -158
- package/build-style/style.css +4 -158
- package/package.json +20 -12
- package/src/components/preference-base-option/style.scss +2 -0
- package/src/components/preferences-modal/style.scss +6 -2
- package/src/components/preferences-modal-section/style.scss +3 -0
- package/src/components/preferences-modal-tabs/style.scss +4 -1
- package/src/style.scss +4 -4
|
@@ -1,151 +1,140 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var preferences_modal_tabs_exports = {};
|
|
19
|
+
__export(preferences_modal_tabs_exports, {
|
|
20
|
+
default: () => PreferencesModalTabs
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
const {
|
|
23
|
-
Tabs
|
|
24
|
-
} = (0, _lockUnlock.unlock)(_components.privateApis);
|
|
25
|
-
const PREFERENCES_MENU = 'preferences-menu';
|
|
26
|
-
function PreferencesModalTabs({
|
|
27
|
-
sections
|
|
28
|
-
}) {
|
|
29
|
-
const isLargeViewport = (0, _compose.useViewportMatch)('medium');
|
|
30
|
-
|
|
31
|
-
// This is also used to sync the two different rendered components
|
|
32
|
-
// between small and large viewports.
|
|
33
|
-
const [activeMenu, setActiveMenu] = (0, _element.useState)(PREFERENCES_MENU);
|
|
34
|
-
/**
|
|
35
|
-
* Create helper objects from `sections` for easier data handling.
|
|
36
|
-
* `tabs` is used for creating the `Tabs` and `sectionsContentMap`
|
|
37
|
-
* is used for easier access to active tab's content.
|
|
38
|
-
*/
|
|
39
|
-
const {
|
|
40
|
-
tabs,
|
|
41
|
-
sectionsContentMap
|
|
42
|
-
} = (0, _element.useMemo)(() => {
|
|
22
|
+
module.exports = __toCommonJS(preferences_modal_tabs_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_compose = require("@wordpress/compose");
|
|
25
|
+
var import_components = require("@wordpress/components");
|
|
26
|
+
var import_element = require("@wordpress/element");
|
|
27
|
+
var import_icons = require("@wordpress/icons");
|
|
28
|
+
var import_i18n = require("@wordpress/i18n");
|
|
29
|
+
var import_lock_unlock = require("../../lock-unlock");
|
|
30
|
+
const { Tabs } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
31
|
+
const PREFERENCES_MENU = "preferences-menu";
|
|
32
|
+
function PreferencesModalTabs({ sections }) {
|
|
33
|
+
const isLargeViewport = (0, import_compose.useViewportMatch)("medium");
|
|
34
|
+
const [activeMenu, setActiveMenu] = (0, import_element.useState)(PREFERENCES_MENU);
|
|
35
|
+
const { tabs, sectionsContentMap } = (0, import_element.useMemo)(() => {
|
|
43
36
|
let mappedTabs = {
|
|
44
37
|
tabs: [],
|
|
45
38
|
sectionsContentMap: {}
|
|
46
39
|
};
|
|
47
40
|
if (sections.length) {
|
|
48
|
-
mappedTabs = sections.reduce(
|
|
49
|
-
name,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
accumulator.sectionsContentMap[name] = content;
|
|
58
|
-
return accumulator;
|
|
59
|
-
}, {
|
|
60
|
-
tabs: [],
|
|
61
|
-
sectionsContentMap: {}
|
|
62
|
-
});
|
|
41
|
+
mappedTabs = sections.reduce(
|
|
42
|
+
(accumulator, { name, tabLabel: title, content }) => {
|
|
43
|
+
accumulator.tabs.push({ name, title });
|
|
44
|
+
accumulator.sectionsContentMap[name] = content;
|
|
45
|
+
return accumulator;
|
|
46
|
+
},
|
|
47
|
+
{ tabs: [], sectionsContentMap: {} }
|
|
48
|
+
);
|
|
63
49
|
}
|
|
64
50
|
return mappedTabs;
|
|
65
51
|
}, [sections]);
|
|
66
52
|
let modalContent;
|
|
67
|
-
// We render different components based on the viewport size.
|
|
68
53
|
if (isLargeViewport) {
|
|
69
|
-
modalContent =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
defaultTabId: activeMenu !== PREFERENCES_MENU ? activeMenu :
|
|
54
|
+
modalContent = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "preferences__tabs", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
55
|
+
Tabs,
|
|
56
|
+
{
|
|
57
|
+
defaultTabId: activeMenu !== PREFERENCES_MENU ? activeMenu : void 0,
|
|
73
58
|
onSelect: setActiveMenu,
|
|
74
59
|
orientation: "vertical",
|
|
75
|
-
children: [
|
|
76
|
-
className: "preferences__tabs-tablist",
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tabs.TabList, { className: "preferences__tabs-tablist", children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
|
+
Tabs.Tab,
|
|
63
|
+
{
|
|
64
|
+
tabId: tab.name,
|
|
65
|
+
className: "preferences__tabs-tab",
|
|
66
|
+
children: tab.title
|
|
67
|
+
},
|
|
68
|
+
tab.name
|
|
69
|
+
)) }),
|
|
70
|
+
tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
Tabs.TabPanel,
|
|
72
|
+
{
|
|
73
|
+
tabId: tab.name,
|
|
74
|
+
className: "preferences__tabs-tabpanel",
|
|
75
|
+
focusable: false,
|
|
76
|
+
children: sectionsContentMap[tab.name] || null
|
|
77
|
+
},
|
|
78
|
+
tab.name
|
|
79
|
+
))
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
) });
|
|
90
83
|
} else {
|
|
91
|
-
modalContent =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
children:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
})
|
|
145
|
-
}, `${section.name}-menu`);
|
|
146
|
-
})]
|
|
147
|
-
});
|
|
84
|
+
modalContent = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.Navigator, { initialPath: "/", className: "preferences__provider", children: [
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Navigator.Screen, { path: "/", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Card, { isBorderless: true, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalItemGroup, { children: tabs.map((tab) => {
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
+
import_components.Navigator.Button,
|
|
88
|
+
{
|
|
89
|
+
path: `/${tab.name}`,
|
|
90
|
+
as: import_components.__experimentalItem,
|
|
91
|
+
isAction: true,
|
|
92
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", children: [
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalTruncate, { children: tab.title }) }),
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
|
+
import_icons.Icon,
|
|
96
|
+
{
|
|
97
|
+
icon: (0, import_i18n.isRTL)() ? import_icons.chevronLeft : import_icons.chevronRight
|
|
98
|
+
}
|
|
99
|
+
) })
|
|
100
|
+
] })
|
|
101
|
+
},
|
|
102
|
+
tab.name
|
|
103
|
+
);
|
|
104
|
+
}) }) }) }) }),
|
|
105
|
+
sections.length && sections.map((section) => {
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
107
|
+
import_components.Navigator.Screen,
|
|
108
|
+
{
|
|
109
|
+
path: `/${section.name}`,
|
|
110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.Card, { isBorderless: true, size: "large", children: [
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
112
|
+
import_components.CardHeader,
|
|
113
|
+
{
|
|
114
|
+
isBorderless: false,
|
|
115
|
+
justify: "left",
|
|
116
|
+
size: "small",
|
|
117
|
+
gap: "6",
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
120
|
+
import_components.Navigator.BackButton,
|
|
121
|
+
{
|
|
122
|
+
icon: (0, import_i18n.isRTL)() ? import_icons.chevronRight : import_icons.chevronLeft,
|
|
123
|
+
label: (0, import_i18n.__)("Back")
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalText, { size: "16", children: section.tabLabel })
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.CardBody, { children: section.content })
|
|
131
|
+
] })
|
|
132
|
+
},
|
|
133
|
+
`${section.name}-menu`
|
|
134
|
+
);
|
|
135
|
+
})
|
|
136
|
+
] });
|
|
148
137
|
}
|
|
149
138
|
return modalContent;
|
|
150
139
|
}
|
|
151
|
-
//# sourceMappingURL=index.js.map
|
|
140
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_components","_element","_icons","_i18n","_lockUnlock","_jsxRuntime","Tabs","unlock","componentsPrivateApis","PREFERENCES_MENU","PreferencesModalTabs","sections","isLargeViewport","useViewportMatch","activeMenu","setActiveMenu","useState","tabs","sectionsContentMap","useMemo","mappedTabs","length","reduce","accumulator","name","tabLabel","title","content","push","modalContent","jsx","className","children","jsxs","defaultTabId","undefined","onSelect","orientation","TabList","map","tab","Tab","tabId","TabPanel","focusable","Navigator","initialPath","Screen","path","Card","isBorderless","size","CardBody","__experimentalItemGroup","Button","as","Item","isAction","__experimentalHStack","justify","FlexItem","__experimentalTruncate","Icon","icon","isRTL","chevronLeft","chevronRight","section","CardHeader","gap","BackButton","label","__","__experimentalText"],"sources":["@wordpress/preferences/src/components/preferences-modal-tabs/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tNavigator,\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\tCard,\n\tCardHeader,\n\tCardBody,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport { chevronLeft, chevronRight, Icon } from '@wordpress/icons';\nimport { isRTL, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\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 `Tabs` 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\tlet modalContent;\n\t// We render different components based on the viewport size.\n\tif ( isLargeViewport ) {\n\t\tmodalContent = (\n\t\t\t<div className=\"preferences__tabs\">\n\t\t\t\t<Tabs\n\t\t\t\t\tdefaultTabId={\n\t\t\t\t\t\tactiveMenu !== PREFERENCES_MENU ? activeMenu : undefined\n\t\t\t\t\t}\n\t\t\t\t\tonSelect={ setActiveMenu }\n\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t>\n\t\t\t\t\t<Tabs.TabList className=\"preferences__tabs-tablist\">\n\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\tclassName=\"preferences__tabs-tab\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\tclassName=\"preferences__tabs-tabpanel\"\n\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sectionsContentMap[ tab.name ] || null }\n\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t) ) }\n\t\t\t\t</Tabs>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tmodalContent = (\n\t\t\t<Navigator initialPath=\"/\" className=\"preferences__provider\">\n\t\t\t\t<Navigator.Screen 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<Navigator.Button\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</Navigator.Button>\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</Navigator.Screen>\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<Navigator.Screen\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<Navigator.BackButton\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\tlabel={ __( 'Back' ) }\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</Navigator.Screen>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t</Navigator>\n\t\t);\n\t}\n\n\treturn modalContent;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAaA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AAA2C,IAAAM,WAAA,GAAAN,OAAA;AAxB3C;AACA;AACA;;AAmBA;AACA;AACA;;AAGA,MAAM;EAAEO;AAAK,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,CAAC;AAEhD,MAAMC,gBAAgB,GAAG,kBAAkB;AAE5B,SAASC,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5D,MAAMC,eAAe,GAAG,IAAAC,yBAAgB,EAAE,QAAS,CAAC;;EAEpD;EACA;EACA,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAG,IAAAC,iBAAQ,EAAEP,gBAAiB,CAAC;EAClE;AACD;AACA;AACA;AACA;EACC,MAAM;IAAEQ,IAAI;IAAEC;EAAmB,CAAC,GAAG,IAAAC,gBAAO,EAAE,MAAM;IACnD,IAAIC,UAAU,GAAG;MAChBH,IAAI,EAAE,EAAE;MACRC,kBAAkB,EAAE,CAAC;IACtB,CAAC;IACD,IAAKP,QAAQ,CAACU,MAAM,EAAG;MACtBD,UAAU,GAAGT,QAAQ,CAACW,MAAM,CAC3B,CAAEC,WAAW,EAAE;QAAEC,IAAI;Q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OAAO,CAAC1C;cAAQ,CACb,CAAC;YAAA,CACI,CAAC,eACb,IAAApB,WAAA,CAAAyB,GAAA,EAAC9B,WAAA,CAAAoD,QAAQ;cAAApB,QAAA,EAAGmC,OAAO,CAACxC;YAAO,CAAY,CAAC;UAAA,CACnC;QAAC,GAvBD,GAAIwC,OAAO,CAAC3C,IAAI,OAwBL,CAAC;MAErB,CAAE,CAAC;IAAA,CACM,CACX;EACF;EAEA,OAAOK,YAAY;AACpB","ignoreList":[]}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/preferences-modal-tabs/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tNavigator,\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\tCard,\n\tCardHeader,\n\tCardBody,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport { chevronLeft, chevronRight, Icon } from '@wordpress/icons';\nimport { isRTL, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\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 `Tabs` 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\tlet modalContent;\n\t// We render different components based on the viewport size.\n\tif ( isLargeViewport ) {\n\t\tmodalContent = (\n\t\t\t<div className=\"preferences__tabs\">\n\t\t\t\t<Tabs\n\t\t\t\t\tdefaultTabId={\n\t\t\t\t\t\tactiveMenu !== PREFERENCES_MENU ? activeMenu : undefined\n\t\t\t\t\t}\n\t\t\t\t\tonSelect={ setActiveMenu }\n\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t>\n\t\t\t\t\t<Tabs.TabList className=\"preferences__tabs-tablist\">\n\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\tclassName=\"preferences__tabs-tab\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\tclassName=\"preferences__tabs-tabpanel\"\n\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sectionsContentMap[ tab.name ] || null }\n\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t) ) }\n\t\t\t\t</Tabs>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tmodalContent = (\n\t\t\t<Navigator initialPath=\"/\" className=\"preferences__provider\">\n\t\t\t\t<Navigator.Screen 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<Navigator.Button\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</Navigator.Button>\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</Navigator.Screen>\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<Navigator.Screen\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<Navigator.BackButton\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\tlabel={ __( 'Back' ) }\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</Navigator.Screen>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t</Navigator>\n\t\t);\n\t}\n\n\treturn modalContent;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;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AAAA;AAAA,oBACpB;AAAA,oBACA,4CAAC,kBAAAC,oBAAA,EAAK,MAAK,MACR,kBAAQ,UACX;AAAA;AAAA;AAAA,cACD;AAAA,cACA,4CAAC,8BAAW,kBAAQ,SAAS;AAAA,eAC9B;AAAA;AAAA,UAvBM,GAAI,QAAQ,IAAK;AAAA,QAwBxB;AAAA,MAEF,CAAE;AAAA,OACJ;AAAA,EAEF;AAEA,SAAO;AACR;",
|
|
6
|
+
"names": ["componentsPrivateApis", "ItemGroup", "Item", "HStack", "Truncate", "Text"]
|
|
7
|
+
}
|
package/build/index.js
CHANGED
|
@@ -1,40 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
14
|
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
__export(index_exports, {
|
|
21
|
+
store: () => import_store.store
|
|
14
22
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
var _store = require("./store");
|
|
28
|
-
var _privateApis = require("./private-apis");
|
|
29
|
-
Object.keys(_privateApis).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
32
|
-
if (key in exports && exports[key] === _privateApis[key]) return;
|
|
33
|
-
Object.defineProperty(exports, key, {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function () {
|
|
36
|
-
return _privateApis[key];
|
|
37
|
-
}
|
|
38
|
-
});
|
|
23
|
+
module.exports = __toCommonJS(index_exports);
|
|
24
|
+
__reExport(index_exports, require("./components"), module.exports);
|
|
25
|
+
var import_store = require("./store");
|
|
26
|
+
__reExport(index_exports, require("./private-apis"), module.exports);
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
store,
|
|
30
|
+
...require("./components"),
|
|
31
|
+
...require("./private-apis")
|
|
39
32
|
});
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.js"],
|
|
4
|
+
"sourcesContent": ["export * from './components';\nexport { store } from './store';\nexport * from './private-apis';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,yBAAd;AACA,mBAAsB;AACtB,0BAAc,2BAFd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/lock-unlock.js
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var lock_unlock_exports = {};
|
|
19
|
+
__export(lock_unlock_exports, {
|
|
20
|
+
lock: () => lock,
|
|
21
|
+
unlock: () => unlock
|
|
5
22
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
23
|
+
module.exports = __toCommonJS(lock_unlock_exports);
|
|
24
|
+
var import_private_apis = require("@wordpress/private-apis");
|
|
25
|
+
const { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
|
|
26
|
+
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
|
27
|
+
"@wordpress/preferences"
|
|
28
|
+
);
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
13
31
|
lock,
|
|
14
32
|
unlock
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
exports.lock = lock;
|
|
18
|
-
//# sourceMappingURL=lock-unlock.js.map
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=lock-unlock.js.map
|
package/build/lock-unlock.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lock-unlock.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/preferences'\n\t);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAiE;AAC1D,MAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/private-apis.js
CHANGED
|
@@ -1,26 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var private_apis_exports = {};
|
|
29
|
+
__export(private_apis_exports, {
|
|
30
|
+
privateApis: () => privateApis
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
PreferenceToggleControl: _preferenceToggleControl.default,
|
|
22
|
-
PreferencesModal: _preferencesModal.default,
|
|
23
|
-
PreferencesModalSection: _preferencesModalSection.default,
|
|
24
|
-
PreferencesModalTabs: _preferencesModalTabs.default
|
|
32
|
+
module.exports = __toCommonJS(private_apis_exports);
|
|
33
|
+
var import_preference_base_option = __toESM(require("./components/preference-base-option"));
|
|
34
|
+
var import_preference_toggle_control = __toESM(require("./components/preference-toggle-control"));
|
|
35
|
+
var import_preferences_modal = __toESM(require("./components/preferences-modal"));
|
|
36
|
+
var import_preferences_modal_section = __toESM(require("./components/preferences-modal-section"));
|
|
37
|
+
var import_preferences_modal_tabs = __toESM(require("./components/preferences-modal-tabs"));
|
|
38
|
+
var import_lock_unlock = require("./lock-unlock");
|
|
39
|
+
const privateApis = {};
|
|
40
|
+
(0, import_lock_unlock.lock)(privateApis, {
|
|
41
|
+
PreferenceBaseOption: import_preference_base_option.default,
|
|
42
|
+
PreferenceToggleControl: import_preference_toggle_control.default,
|
|
43
|
+
PreferencesModal: import_preferences_modal.default,
|
|
44
|
+
PreferencesModalSection: import_preferences_modal_section.default,
|
|
45
|
+
PreferencesModalTabs: import_preferences_modal_tabs.default
|
|
25
46
|
});
|
|
26
|
-
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
49
|
+
privateApis
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=private-apis.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/private-apis.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport PreferenceBaseOption from './components/preference-base-option';\nimport PreferenceToggleControl from './components/preference-toggle-control';\nimport PreferencesModal from './components/preferences-modal';\nimport PreferencesModalSection from './components/preferences-modal-section';\nimport PreferencesModalTabs from './components/preferences-modal-tabs';\nimport { lock } from './lock-unlock';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tPreferenceBaseOption,\n\tPreferenceToggleControl,\n\tPreferencesModal,\n\tPreferencesModalSection,\n\tPreferencesModalTabs,\n} );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oCAAiC;AACjC,uCAAoC;AACpC,+BAA6B;AAC7B,uCAAoC;AACpC,oCAAiC;AACjC,yBAAqB;AAEd,MAAM,cAAc,CAAC;AAAA,IAC5B,yBAAM,aAAa;AAAA,EAClB,oDAAAA;AAAA,EACA,0DAAAC;AAAA,EACA,2CAAAC;AAAA,EACA,0DAAAC;AAAA,EACA,oDAAAC;AACD,CAAE;",
|
|
6
|
+
"names": ["PreferenceBaseOption", "PreferenceToggleControl", "PreferencesModal", "PreferencesModalSection", "PreferencesModalTabs"]
|
|
7
|
+
}
|