@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.
Files changed (68) hide show
  1. package/build/components/index.js +36 -12
  2. package/build/components/index.js.map +7 -1
  3. package/build/components/preference-base-option/index.js +39 -30
  4. package/build/components/preference-base-option/index.js.map +7 -1
  5. package/build/components/preference-toggle-control/index.js +52 -30
  6. package/build/components/preference-toggle-control/index.js.map +7 -1
  7. package/build/components/preference-toggle-menu-item/index.js +65 -47
  8. package/build/components/preference-toggle-menu-item/index.js.map +7 -1
  9. package/build/components/preferences-modal/index.js +35 -23
  10. package/build/components/preferences-modal/index.js.map +7 -1
  11. package/build/components/preferences-modal-section/index.js +31 -28
  12. package/build/components/preferences-modal-section/index.js.map +7 -1
  13. package/build/components/preferences-modal-tabs/index.js +123 -134
  14. package/build/components/preferences-modal-tabs/index.js.map +7 -1
  15. package/build/index.js +29 -36
  16. package/build/index.js.map +7 -1
  17. package/build/lock-unlock.js +31 -15
  18. package/build/lock-unlock.js.map +7 -1
  19. package/build/private-apis.js +49 -24
  20. package/build/private-apis.js.map +7 -1
  21. package/build/store/actions.js +36 -69
  22. package/build/store/actions.js.map +7 -1
  23. package/build/store/constants.js +27 -12
  24. package/build/store/constants.js.map +7 -1
  25. package/build/store/index.js +44 -32
  26. package/build/store/index.js.map +7 -1
  27. package/build/store/reducer.js +39 -65
  28. package/build/store/reducer.js.map +7 -1
  29. package/build/store/selectors.js +67 -33
  30. package/build/store/selectors.js.map +7 -1
  31. package/build-module/components/index.js +5 -2
  32. package/build-module/components/index.js.map +7 -1
  33. package/build-module/components/preference-base-option/index.js +21 -24
  34. package/build-module/components/preference-base-option/index.js.map +7 -1
  35. package/build-module/components/preference-toggle-control/index.js +24 -23
  36. package/build-module/components/preference-toggle-control/index.js.map +7 -1
  37. package/build-module/components/preference-toggle-menu-item/index.js +46 -40
  38. package/build-module/components/preference-toggle-menu-item/index.js.map +7 -1
  39. package/build-module/components/preferences-modal/index.js +17 -17
  40. package/build-module/components/preferences-modal/index.js.map +7 -1
  41. package/build-module/components/preferences-modal-section/index.js +13 -23
  42. package/build-module/components/preferences-modal-section/index.js.map +7 -1
  43. package/build-module/components/preferences-modal-tabs/index.js +116 -127
  44. package/build-module/components/preferences-modal-tabs/index.js.map +7 -1
  45. package/build-module/index.js +7 -4
  46. package/build-module/index.js.map +7 -1
  47. package/build-module/lock-unlock.js +8 -7
  48. package/build-module/lock-unlock.js.map +7 -1
  49. package/build-module/private-apis.js +11 -11
  50. package/build-module/private-apis.js.map +7 -1
  51. package/build-module/store/actions.js +15 -65
  52. package/build-module/store/actions.js.map +7 -1
  53. package/build-module/store/constants.js +5 -7
  54. package/build-module/store/constants.js.map +7 -1
  55. package/build-module/store/index.js +10 -22
  56. package/build-module/store/index.js.map +7 -1
  57. package/build-module/store/reducer.js +17 -59
  58. package/build-module/store/reducer.js.map +7 -1
  59. package/build-module/store/selectors.js +35 -26
  60. package/build-module/store/selectors.js.map +7 -1
  61. package/build-style/style-rtl.css +4 -158
  62. package/build-style/style.css +4 -158
  63. package/package.json +20 -12
  64. package/src/components/preference-base-option/style.scss +2 -0
  65. package/src/components/preferences-modal/style.scss +6 -2
  66. package/src/components/preferences-modal-section/style.scss +3 -0
  67. package/src/components/preferences-modal-tabs/style.scss +4 -1
  68. package/src/style.scss +4 -4
@@ -1,151 +1,140 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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.default = PreferencesModalTabs;
7
- var _compose = require("@wordpress/compose");
8
- var _components = require("@wordpress/components");
9
- var _element = require("@wordpress/element");
10
- var _icons = require("@wordpress/icons");
11
- var _i18n = require("@wordpress/i18n");
12
- var _lockUnlock = require("../../lock-unlock");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * WordPress dependencies
16
- */
17
-
18
- /**
19
- * Internal dependencies
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((accumulator, {
49
- name,
50
- tabLabel: title,
51
- content
52
- }) => {
53
- accumulator.tabs.push({
54
- name,
55
- title
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 = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
70
- className: "preferences__tabs",
71
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tabs, {
72
- defaultTabId: activeMenu !== PREFERENCES_MENU ? activeMenu : undefined,
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: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.TabList, {
76
- className: "preferences__tabs-tablist",
77
- children: tabs.map(tab => /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.Tab, {
78
- tabId: tab.name,
79
- className: "preferences__tabs-tab",
80
- children: tab.title
81
- }, tab.name))
82
- }), tabs.map(tab => /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.TabPanel, {
83
- tabId: tab.name,
84
- className: "preferences__tabs-tabpanel",
85
- focusable: false,
86
- children: sectionsContentMap[tab.name] || null
87
- }, tab.name))]
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 = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Navigator, {
92
- initialPath: "/",
93
- className: "preferences__provider",
94
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Navigator.Screen, {
95
- path: "/",
96
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Card, {
97
- isBorderless: true,
98
- size: "small",
99
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CardBody, {
100
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalItemGroup, {
101
- children: tabs.map(tab => {
102
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Navigator.Button, {
103
- path: `/${tab.name}`,
104
- as: _components.__experimentalItem,
105
- isAction: true,
106
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
107
- justify: "space-between",
108
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
109
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalTruncate, {
110
- children: tab.title
111
- })
112
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
113
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
114
- icon: (0, _i18n.isRTL)() ? _icons.chevronLeft : _icons.chevronRight
115
- })
116
- })]
117
- })
118
- }, tab.name);
119
- })
120
- })
121
- })
122
- })
123
- }), sections.length && sections.map(section => {
124
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Navigator.Screen, {
125
- path: `/${section.name}`,
126
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Card, {
127
- isBorderless: true,
128
- size: "large",
129
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.CardHeader, {
130
- isBorderless: false,
131
- justify: "left",
132
- size: "small",
133
- gap: "6",
134
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Navigator.BackButton, {
135
- icon: (0, _i18n.isRTL)() ? _icons.chevronRight : _icons.chevronLeft,
136
- label: (0, _i18n.__)('Back')
137
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
138
- size: "16",
139
- children: section.tabLabel
140
- })]
141
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CardBody, {
142
- children: section.content
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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AAA,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": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgEI;AA7DJ,qBAAiC;AACjC,wBAYO;AACP,qBAAkC;AAClC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AA,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
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- store: true
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
- Object.defineProperty(exports, "store", {
10
- enumerable: true,
11
- get: function () {
12
- return _store.store;
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
- var _components = require("./components");
16
- Object.keys(_components).forEach(function (key) {
17
- if (key === "default" || key === "__esModule") return;
18
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
19
- if (key in exports && exports[key] === _components[key]) return;
20
- Object.defineProperty(exports, key, {
21
- enumerable: true,
22
- get: function () {
23
- return _components[key];
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
@@ -1 +1,7 @@
1
- {"version":3,"names":["_components","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_store","_privateApis"],"sources":["@wordpress/preferences/src/index.js"],"sourcesContent":["export * from './components';\nexport { store } from './store';\nexport * from './private-apis';\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,MAAA,GAAAb,OAAA;AACA,IAAAc,YAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,YAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,YAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,YAAA,CAAAV,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
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
+ }
@@ -1,18 +1,34 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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
- exports.unlock = exports.lock = void 0;
7
- var _privateApis = require("@wordpress/private-apis");
8
- /**
9
- * WordPress dependencies
10
- */
11
-
12
- const {
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
- } = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/preferences');
16
- exports.unlock = unlock;
17
- exports.lock = lock;
18
- //# sourceMappingURL=lock-unlock.js.map
33
+ });
34
+ //# sourceMappingURL=lock-unlock.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/preferences/src/lock-unlock.js"],"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"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAEO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,+HAA+H,EAC/H,wBACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA","ignoreList":[]}
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
+ }
@@ -1,26 +1,51 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
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.privateApis = void 0;
8
- var _preferenceBaseOption = _interopRequireDefault(require("./components/preference-base-option"));
9
- var _preferenceToggleControl = _interopRequireDefault(require("./components/preference-toggle-control"));
10
- var _preferencesModal = _interopRequireDefault(require("./components/preferences-modal"));
11
- var _preferencesModalSection = _interopRequireDefault(require("./components/preferences-modal-section"));
12
- var _preferencesModalTabs = _interopRequireDefault(require("./components/preferences-modal-tabs"));
13
- var _lockUnlock = require("./lock-unlock");
14
- /**
15
- * Internal dependencies
16
- */
17
-
18
- const privateApis = exports.privateApis = {};
19
- (0, _lockUnlock.lock)(privateApis, {
20
- PreferenceBaseOption: _preferenceBaseOption.default,
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
- //# sourceMappingURL=private-apis.js.map
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
- {"version":3,"names":["_preferenceBaseOption","_interopRequireDefault","require","_preferenceToggleControl","_preferencesModal","_preferencesModalSection","_preferencesModalTabs","_lockUnlock","privateApis","exports","lock","PreferenceBaseOption","PreferenceToggleControl","PreferencesModal","PreferencesModalSection","PreferencesModalTabs"],"sources":["@wordpress/preferences/src/private-apis.js"],"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"],"mappings":";;;;;;;AAGA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,wBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,qBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQO,MAAMM,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,CAAC,CAAC;AAC7B,IAAAE,gBAAI,EAAEF,WAAW,EAAE;EAClBG,oBAAoB,EAApBA,6BAAoB;EACpBC,uBAAuB,EAAvBA,gCAAuB;EACvBC,gBAAgB,EAAhBA,yBAAgB;EAChBC,uBAAuB,EAAvBA,gCAAuB;EACvBC,oBAAoB,EAApBA;AACD,CAAE,CAAC","ignoreList":[]}
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
+ }