@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,25 +1,22 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { ToggleControl } from '@wordpress/components';
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- function BaseOption({
7
- help,
8
- label,
9
- isChecked,
10
- onChange,
11
- children
12
- }) {
13
- return /*#__PURE__*/_jsxs("div", {
14
- className: "preference-base-option",
15
- children: [/*#__PURE__*/_jsx(ToggleControl, {
16
- __nextHasNoMarginBottom: true,
17
- help: help,
18
- label: label,
19
- checked: isChecked,
20
- onChange: onChange
21
- }), children]
22
- });
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { ToggleControl } from "@wordpress/components";
3
+ function BaseOption({ help, label, isChecked, onChange, children }) {
4
+ return /* @__PURE__ */ jsxs("div", { className: "preference-base-option", children: [
5
+ /* @__PURE__ */ jsx(
6
+ ToggleControl,
7
+ {
8
+ __nextHasNoMarginBottom: true,
9
+ help,
10
+ label,
11
+ checked: isChecked,
12
+ onChange
13
+ }
14
+ ),
15
+ children
16
+ ] });
23
17
  }
24
- export default BaseOption;
25
- //# sourceMappingURL=index.js.map
18
+ var preference_base_option_default = BaseOption;
19
+ export {
20
+ preference_base_option_default as default
21
+ };
22
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["ToggleControl","jsx","_jsx","jsxs","_jsxs","BaseOption","help","label","isChecked","onChange","children","className","__nextHasNoMarginBottom","checked"],"sources":["@wordpress/preferences/src/components/preference-base-option/index.js"],"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=\"preference-base-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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtD,SAASC,UAAUA,CAAE;EAAEC,IAAI;EAAEC,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EAAG;EACrE,oBACCN,KAAA;IAAKO,SAAS,EAAC,wBAAwB;IAAAD,QAAA,gBACtCR,IAAA,CAACF,aAAa;MACbY,uBAAuB;MACvBN,IAAI,EAAGA,IAAM;MACbC,KAAK,EAAGA,KAAO;MACfM,OAAO,EAAGL,SAAW;MACrBC,QAAQ,EAAGA;IAAU,CACrB,CAAC,EACAC,QAAQ;EAAA,CACN,CAAC;AAER;AAEA,eAAeL,UAAU","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/preference-base-option/index.js"],
4
+ "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=\"preference-base-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"],
5
+ "mappings": "AAOE,SACC,KADD;AAJF,SAAS,qBAAqB;AAE9B,SAAS,WAAY,EAAE,MAAM,OAAO,WAAW,UAAU,SAAS,GAAI;AACrE,SACC,qBAAC,SAAI,WAAU,0BACd;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,yBAAuB;AAAA,QACvB;AAAA,QACA;AAAA,QACA,SAAU;AAAA,QACV;AAAA;AAAA,IACD;AAAA,IACE;AAAA,KACH;AAEF;AAEA,IAAO,iCAAQ;",
6
+ "names": []
7
+ }
@@ -1,34 +1,35 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useSelect, useDispatch } from '@wordpress/data';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import { store as preferencesStore } from '../../store';
10
- import PreferenceBaseOption from '../preference-base-option';
11
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useSelect, useDispatch } from "@wordpress/data";
3
+ import { store as preferencesStore } from "../../store";
4
+ import PreferenceBaseOption from "../preference-base-option";
12
5
  function PreferenceToggleControl(props) {
13
6
  const {
14
7
  scope,
15
8
  featureName,
16
- onToggle = () => {},
9
+ onToggle = () => {
10
+ },
17
11
  ...remainingProps
18
12
  } = props;
19
- const isChecked = useSelect(select => !!select(preferencesStore).get(scope, featureName), [scope, featureName]);
20
- const {
21
- toggle
22
- } = useDispatch(preferencesStore);
13
+ const isChecked = useSelect(
14
+ (select) => !!select(preferencesStore).get(scope, featureName),
15
+ [scope, featureName]
16
+ );
17
+ const { toggle } = useDispatch(preferencesStore);
23
18
  const onChange = () => {
24
19
  onToggle();
25
20
  toggle(scope, featureName);
26
21
  };
27
- return /*#__PURE__*/_jsx(PreferenceBaseOption, {
28
- onChange: onChange,
29
- isChecked: isChecked,
30
- ...remainingProps
31
- });
22
+ return /* @__PURE__ */ jsx(
23
+ PreferenceBaseOption,
24
+ {
25
+ onChange,
26
+ isChecked,
27
+ ...remainingProps
28
+ }
29
+ );
32
30
  }
33
- export default PreferenceToggleControl;
34
- //# sourceMappingURL=index.js.map
31
+ var preference_toggle_control_default = PreferenceToggleControl;
32
+ export {
33
+ preference_toggle_control_default as default
34
+ };
35
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["useSelect","useDispatch","store","preferencesStore","PreferenceBaseOption","jsx","_jsx","PreferenceToggleControl","props","scope","featureName","onToggle","remainingProps","isChecked","select","get","toggle","onChange"],"sources":["@wordpress/preferences/src/components/preference-toggle-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as preferencesStore } from '../../store';\nimport PreferenceBaseOption from '../preference-base-option';\n\nfunction PreferenceToggleControl( props ) {\n\tconst {\n\t\tscope,\n\t\tfeatureName,\n\t\tonToggle = () => {},\n\t\t...remainingProps\n\t} = props;\n\tconst isChecked = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, featureName ),\n\t\t[ scope, featureName ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst onChange = () => {\n\t\tonToggle();\n\t\ttoggle( scope, featureName );\n\t};\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tonChange={ onChange }\n\t\t\tisChecked={ isChecked }\n\t\t\t{ ...remainingProps }\n\t\t/>\n\t);\n}\n\nexport default PreferenceToggleControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,oBAAoB,MAAM,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7D,SAASC,uBAAuBA,CAAEC,KAAK,EAAG;EACzC,MAAM;IACLC,KAAK;IACLC,WAAW;IACXC,QAAQ,GAAGA,CAAA,KAAM,CAAC,CAAC;IACnB,GAAGC;EACJ,CAAC,GAAGJ,KAAK;EACT,MAAMK,SAAS,GAAGb,SAAS,CACxBc,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAEX,gBAAiB,CAAC,CAACY,GAAG,CAAEN,KAAK,EAAEC,WAAY,CAAC,EACrE,CAAED,KAAK,EAAEC,WAAW,CACrB,CAAC;EACD,MAAM;IAAEM;EAAO,CAAC,GAAGf,WAAW,CAAEE,gBAAiB,CAAC;EAClD,MAAMc,QAAQ,GAAGA,CAAA,KAAM;IACtBN,QAAQ,CAAC,CAAC;IACVK,MAAM,CAAEP,KAAK,EAAEC,WAAY,CAAC;EAC7B,CAAC;EAED,oBACCJ,IAAA,CAACF,oBAAoB;IACpBa,QAAQ,EAAGA,QAAU;IACrBJ,SAAS,EAAGA,SAAW;IAAA,GAClBD;EAAc,CACnB,CAAC;AAEJ;AAEA,eAAeL,uBAAuB","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/preference-toggle-control/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as preferencesStore } from '../../store';\nimport PreferenceBaseOption from '../preference-base-option';\n\nfunction PreferenceToggleControl( props ) {\n\tconst {\n\t\tscope,\n\t\tfeatureName,\n\t\tonToggle = () => {},\n\t\t...remainingProps\n\t} = props;\n\tconst isChecked = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, featureName ),\n\t\t[ scope, featureName ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst onChange = () => {\n\t\tonToggle();\n\t\ttoggle( scope, featureName );\n\t};\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tonChange={ onChange }\n\t\t\tisChecked={ isChecked }\n\t\t\t{ ...remainingProps }\n\t\t/>\n\t);\n}\n\nexport default PreferenceToggleControl;\n"],
5
+ "mappings": "AA6BE;AA1BF,SAAS,WAAW,mBAAmB;AAKvC,SAAS,SAAS,wBAAwB;AAC1C,OAAO,0BAA0B;AAEjC,SAAS,wBAAyB,OAAQ;AACzC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA,WAAW,MAAM;AAAA,IAAC;AAAA,IAClB,GAAG;AAAA,EACJ,IAAI;AACJ,QAAM,YAAY;AAAA,IACjB,CAAE,WAAY,CAAC,CAAE,OAAQ,gBAAiB,EAAE,IAAK,OAAO,WAAY;AAAA,IACpE,CAAE,OAAO,WAAY;AAAA,EACtB;AACA,QAAM,EAAE,OAAO,IAAI,YAAa,gBAAiB;AACjD,QAAM,WAAW,MAAM;AACtB,aAAS;AACT,WAAQ,OAAO,WAAY;AAAA,EAC5B;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF;AAEA,IAAO,oCAAQ;",
6
+ "names": []
7
+ }
@@ -1,18 +1,11 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useSelect, useDispatch } from '@wordpress/data';
5
- import { MenuItem } from '@wordpress/components';
6
- import { __, sprintf } from '@wordpress/i18n';
7
- import { check } from '@wordpress/icons';
8
- import { speak } from '@wordpress/a11y';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
- import { store as preferencesStore } from '../../store';
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- export default function PreferenceToggleMenuItem({
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useSelect, useDispatch } from "@wordpress/data";
3
+ import { MenuItem } from "@wordpress/components";
4
+ import { __, sprintf } from "@wordpress/i18n";
5
+ import { check } from "@wordpress/icons";
6
+ import { speak } from "@wordpress/a11y";
7
+ import { store as preferencesStore } from "../../store";
8
+ function PreferenceToggleMenuItem({
16
9
  scope,
17
10
  name,
18
11
  label,
@@ -24,36 +17,49 @@ export default function PreferenceToggleMenuItem({
24
17
  onToggle = () => null,
25
18
  disabled = false
26
19
  }) {
27
- const isActive = useSelect(select => !!select(preferencesStore).get(scope, name), [scope, name]);
28
- const {
29
- toggle
30
- } = useDispatch(preferencesStore);
20
+ const isActive = useSelect(
21
+ (select) => !!select(preferencesStore).get(scope, name),
22
+ [scope, name]
23
+ );
24
+ const { toggle } = useDispatch(preferencesStore);
31
25
  const speakMessage = () => {
32
26
  if (isActive) {
33
- const message = messageDeactivated || sprintf(/* translators: %s: preference name, e.g. 'Fullscreen mode' */
34
- __('Preference deactivated - %s'), label);
27
+ const message = messageDeactivated || sprintf(
28
+ /* translators: %s: preference name, e.g. 'Fullscreen mode' */
29
+ __("Preference deactivated - %s"),
30
+ label
31
+ );
35
32
  speak(message);
36
33
  } else {
37
- const message = messageActivated || sprintf(/* translators: %s: preference name, e.g. 'Fullscreen mode' */
38
- __('Preference activated - %s'), label);
34
+ const message = messageActivated || sprintf(
35
+ /* translators: %s: preference name, e.g. 'Fullscreen mode' */
36
+ __("Preference activated - %s"),
37
+ label
38
+ );
39
39
  speak(message);
40
40
  }
41
41
  };
42
- return /*#__PURE__*/_jsx(MenuItem, {
43
- icon: isActive && check,
44
- isSelected: isActive,
45
- onClick: () => {
46
- onToggle();
47
- if (handleToggling) {
48
- toggle(scope, name);
49
- }
50
- speakMessage();
51
- },
52
- role: "menuitemcheckbox",
53
- info: info,
54
- shortcut: shortcut,
55
- disabled: disabled,
56
- children: label
57
- });
42
+ return /* @__PURE__ */ jsx(
43
+ MenuItem,
44
+ {
45
+ icon: isActive && check,
46
+ isSelected: isActive,
47
+ onClick: () => {
48
+ onToggle();
49
+ if (handleToggling) {
50
+ toggle(scope, name);
51
+ }
52
+ speakMessage();
53
+ },
54
+ role: "menuitemcheckbox",
55
+ info,
56
+ shortcut,
57
+ disabled,
58
+ children: label
59
+ }
60
+ );
58
61
  }
59
- //# sourceMappingURL=index.js.map
62
+ export {
63
+ PreferenceToggleMenuItem as default
64
+ };
65
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["useSelect","useDispatch","MenuItem","__","sprintf","check","speak","store","preferencesStore","jsx","_jsx","PreferenceToggleMenuItem","scope","name","label","info","messageActivated","messageDeactivated","shortcut","handleToggling","onToggle","disabled","isActive","select","get","toggle","speakMessage","message","icon","isSelected","onClick","role","children"],"sources":["@wordpress/preferences/src/components/preference-toggle-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { store as preferencesStore } from '../../store';\n\nexport default function PreferenceToggleMenuItem( {\n\tscope,\n\tname,\n\tlabel,\n\tinfo,\n\tmessageActivated,\n\tmessageDeactivated,\n\tshortcut,\n\thandleToggling = true,\n\tonToggle = () => null,\n\tdisabled = false,\n} ) {\n\tconst isActive = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, name ),\n\t\t[ scope, name ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst speakMessage = () => {\n\t\tif ( isActive ) {\n\t\t\tconst message =\n\t\t\t\tmessageDeactivated ||\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: preference name, e.g. 'Fullscreen mode' */\n\t\t\t\t\t__( 'Preference deactivated - %s' ),\n\t\t\t\t\tlabel\n\t\t\t\t);\n\t\t\tspeak( message );\n\t\t} else {\n\t\t\tconst message =\n\t\t\t\tmessageActivated ||\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: preference name, e.g. 'Fullscreen mode' */\n\t\t\t\t\t__( 'Preference activated - %s' ),\n\t\t\t\t\tlabel\n\t\t\t\t);\n\t\t\tspeak( message );\n\t\t}\n\t};\n\n\treturn (\n\t\t<MenuItem\n\t\t\ticon={ isActive && check }\n\t\t\tisSelected={ isActive }\n\t\t\tonClick={ () => {\n\t\t\t\tonToggle();\n\t\t\t\tif ( handleToggling ) {\n\t\t\t\t\ttoggle( scope, name );\n\t\t\t\t}\n\t\t\t\tspeakMessage();\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tinfo={ info }\n\t\t\tshortcut={ shortcut }\n\t\t\tdisabled={ disabled }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExD,eAAe,SAASC,wBAAwBA,CAAE;EACjDC,KAAK;EACLC,IAAI;EACJC,KAAK;EACLC,IAAI;EACJC,gBAAgB;EAChBC,kBAAkB;EAClBC,QAAQ;EACRC,cAAc,GAAG,IAAI;EACrBC,QAAQ,GAAGA,CAAA,KAAM,IAAI;EACrBC,QAAQ,GAAG;AACZ,CAAC,EAAG;EACH,MAAMC,QAAQ,GAAGtB,SAAS,CACvBuB,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAEf,gBAAiB,CAAC,CAACgB,GAAG,CAAEZ,KAAK,EAAEC,IAAK,CAAC,EAC9D,CAAED,KAAK,EAAEC,IAAI,CACd,CAAC;EACD,MAAM;IAAEY;EAAO,CAAC,GAAGxB,WAAW,CAAEO,gBAAiB,CAAC;EAClD,MAAMkB,YAAY,GAAGA,CAAA,KAAM;IAC1B,IAAKJ,QAAQ,EAAG;MACf,MAAMK,OAAO,GACZV,kBAAkB,IAClBb,OAAO,CACN;MACAD,EAAE,CAAE,6BAA8B,CAAC,EACnCW,KACD,CAAC;MACFR,KAAK,CAAEqB,OAAQ,CAAC;IACjB,CAAC,MAAM;MACN,MAAMA,OAAO,GACZX,gBAAgB,IAChBZ,OAAO,CACN;MACAD,EAAE,CAAE,2BAA4B,CAAC,EACjCW,KACD,CAAC;MACFR,KAAK,CAAEqB,OAAQ,CAAC;IACjB;EACD,CAAC;EAED,oBACCjB,IAAA,CAACR,QAAQ;IACR0B,IAAI,EAAGN,QAAQ,IAAIjB,KAAO;IAC1BwB,UAAU,EAAGP,QAAU;IACvBQ,OAAO,EAAGA,CAAA,KAAM;MACfV,QAAQ,CAAC,CAAC;MACV,IAAKD,cAAc,EAAG;QACrBM,MAAM,CAAEb,KAAK,EAAEC,IAAK,CAAC;MACtB;MACAa,YAAY,CAAC,CAAC;IACf,CAAG;IACHK,IAAI,EAAC,kBAAkB;IACvBhB,IAAI,EAAGA,IAAM;IACbG,QAAQ,EAAGA,QAAU;IACrBG,QAAQ,EAAGA,QAAU;IAAAW,QAAA,EAEnBlB;EAAK,CACE,CAAC;AAEb","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/preference-toggle-menu-item/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { store as preferencesStore } from '../../store';\n\nexport default function PreferenceToggleMenuItem( {\n\tscope,\n\tname,\n\tlabel,\n\tinfo,\n\tmessageActivated,\n\tmessageDeactivated,\n\tshortcut,\n\thandleToggling = true,\n\tonToggle = () => null,\n\tdisabled = false,\n} ) {\n\tconst isActive = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, name ),\n\t\t[ scope, name ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst speakMessage = () => {\n\t\tif ( isActive ) {\n\t\t\tconst message =\n\t\t\t\tmessageDeactivated ||\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: preference name, e.g. 'Fullscreen mode' */\n\t\t\t\t\t__( 'Preference deactivated - %s' ),\n\t\t\t\t\tlabel\n\t\t\t\t);\n\t\t\tspeak( message );\n\t\t} else {\n\t\t\tconst message =\n\t\t\t\tmessageActivated ||\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: preference name, e.g. 'Fullscreen mode' */\n\t\t\t\t\t__( 'Preference activated - %s' ),\n\t\t\t\t\tlabel\n\t\t\t\t);\n\t\t\tspeak( message );\n\t\t}\n\t};\n\n\treturn (\n\t\t<MenuItem\n\t\t\ticon={ isActive && check }\n\t\t\tisSelected={ isActive }\n\t\t\tonClick={ () => {\n\t\t\t\tonToggle();\n\t\t\t\tif ( handleToggling ) {\n\t\t\t\t\ttoggle( scope, name );\n\t\t\t\t}\n\t\t\t\tspeakMessage();\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tinfo={ info }\n\t\t\tshortcut={ shortcut }\n\t\t\tdisabled={ disabled }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"],
5
+ "mappings": "AAsDE;AAnDF,SAAS,WAAW,mBAAmB;AACvC,SAAS,gBAAgB;AACzB,SAAS,IAAI,eAAe;AAC5B,SAAS,aAAa;AACtB,SAAS,aAAa;AAKtB,SAAS,SAAS,wBAAwB;AAE3B,SAAR,yBAA2C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,WAAW,MAAM;AAAA,EACjB,WAAW;AACZ,GAAI;AACH,QAAM,WAAW;AAAA,IAChB,CAAE,WAAY,CAAC,CAAE,OAAQ,gBAAiB,EAAE,IAAK,OAAO,IAAK;AAAA,IAC7D,CAAE,OAAO,IAAK;AAAA,EACf;AACA,QAAM,EAAE,OAAO,IAAI,YAAa,gBAAiB;AACjD,QAAM,eAAe,MAAM;AAC1B,QAAK,UAAW;AACf,YAAM,UACL,sBACA;AAAA;AAAA,QAEC,GAAI,6BAA8B;AAAA,QAClC;AAAA,MACD;AACD,YAAO,OAAQ;AAAA,IAChB,OAAO;AACN,YAAM,UACL,oBACA;AAAA;AAAA,QAEC,GAAI,2BAA4B;AAAA,QAChC;AAAA,MACD;AACD,YAAO,OAAQ;AAAA,IAChB;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO,YAAY;AAAA,MACnB,YAAa;AAAA,MACb,SAAU,MAAM;AACf,iBAAS;AACT,YAAK,gBAAiB;AACrB,iBAAQ,OAAO,IAAK;AAAA,QACrB;AACA,qBAAa;AAAA,MACd;AAAA,MACA,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MAEE;AAAA;AAAA,EACH;AAEF;",
6
+ "names": []
7
+ }
@@ -1,18 +1,18 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { Modal } from '@wordpress/components';
5
- import { __ } from '@wordpress/i18n';
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- export default function PreferencesModal({
8
- closeModal,
9
- children
10
- }) {
11
- return /*#__PURE__*/_jsx(Modal, {
12
- className: "preferences-modal",
13
- title: __('Preferences'),
14
- onRequestClose: closeModal,
15
- children: children
16
- });
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Modal } from "@wordpress/components";
3
+ import { __ } from "@wordpress/i18n";
4
+ function PreferencesModal({ closeModal, children }) {
5
+ return /* @__PURE__ */ jsx(
6
+ Modal,
7
+ {
8
+ className: "preferences-modal",
9
+ title: __("Preferences"),
10
+ onRequestClose: closeModal,
11
+ children
12
+ }
13
+ );
17
14
  }
18
- //# sourceMappingURL=index.js.map
15
+ export {
16
+ PreferencesModal as default
17
+ };
18
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["Modal","__","jsx","_jsx","PreferencesModal","closeModal","children","className","title","onRequestClose"],"sources":["@wordpress/preferences/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function PreferencesModal( { closeModal, children } ) {\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"preferences-modal\"\n\t\t\ttitle={ __( 'Preferences' ) }\n\t\t\tonRequestClose={ closeModal }\n\t\t>\n\t\t\t{ children }\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,eAAe,SAASC,gBAAgBA,CAAE;EAAEC,UAAU;EAAEC;AAAS,CAAC,EAAG;EACpE,oBACCH,IAAA,CAACH,KAAK;IACLO,SAAS,EAAC,mBAAmB;IAC7BC,KAAK,EAAGP,EAAE,CAAE,aAAc,CAAG;IAC7BQ,cAAc,EAAGJ,UAAY;IAAAC,QAAA,EAE3BA;EAAQ,CACJ,CAAC;AAEV","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/preferences-modal/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function PreferencesModal( { closeModal, children } ) {\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"preferences-modal\"\n\t\t\ttitle={ __( 'Preferences' ) }\n\t\t\tonRequestClose={ closeModal }\n\t\t>\n\t\t\t{ children }\n\t\t</Modal>\n\t);\n}\n"],
5
+ "mappings": "AAQE;AALF,SAAS,aAAa;AACtB,SAAS,UAAU;AAEJ,SAAR,iBAAmC,EAAE,YAAY,SAAS,GAAI;AACpE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAQ,GAAI,aAAc;AAAA,MAC1B,gBAAiB;AAAA,MAEf;AAAA;AAAA,EACH;AAEF;",
6
+ "names": []
7
+ }
@@ -1,23 +1,13 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const Section = ({
3
- description,
4
- title,
5
- children
6
- }) => /*#__PURE__*/_jsxs("fieldset", {
7
- className: "preferences-modal__section",
8
- children: [/*#__PURE__*/_jsxs("legend", {
9
- className: "preferences-modal__section-legend",
10
- children: [/*#__PURE__*/_jsx("h2", {
11
- className: "preferences-modal__section-title",
12
- children: title
13
- }), description && /*#__PURE__*/_jsx("p", {
14
- className: "preferences-modal__section-description",
15
- children: description
16
- })]
17
- }), /*#__PURE__*/_jsx("div", {
18
- className: "preferences-modal__section-content",
19
- children: children
20
- })]
21
- });
22
- export default Section;
23
- //# sourceMappingURL=index.js.map
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ const Section = ({ description, title, children }) => /* @__PURE__ */ jsxs("fieldset", { className: "preferences-modal__section", children: [
3
+ /* @__PURE__ */ jsxs("legend", { className: "preferences-modal__section-legend", children: [
4
+ /* @__PURE__ */ jsx("h2", { className: "preferences-modal__section-title", children: title }),
5
+ description && /* @__PURE__ */ jsx("p", { className: "preferences-modal__section-description", children: description })
6
+ ] }),
7
+ /* @__PURE__ */ jsx("div", { className: "preferences-modal__section-content", children })
8
+ ] });
9
+ var preferences_modal_section_default = Section;
10
+ export {
11
+ preferences_modal_section_default as default
12
+ };
13
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["Section","description","title","children","_jsxs","className","_jsx"],"sources":["@wordpress/preferences/src/components/preferences-modal-section/index.js"],"sourcesContent":["const Section = ( { description, title, children } ) => (\n\t<fieldset className=\"preferences-modal__section\">\n\t\t<legend className=\"preferences-modal__section-legend\">\n\t\t\t<h2 className=\"preferences-modal__section-title\">{ title }</h2>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"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<div className=\"preferences-modal__section-content\">{ children }</div>\n\t</fieldset>\n);\n\nexport default Section;\n"],"mappings":";AAAA,MAAMA,OAAO,GAAGA,CAAE;EAAEC,WAAW;EAAEC,KAAK;EAAEC;AAAS,CAAC,kBACjDC,KAAA;EAAUC,SAAS,EAAC,4BAA4B;EAAAF,QAAA,gBAC/CC,KAAA;IAAQC,SAAS,EAAC,mCAAmC;IAAAF,QAAA,gBACpDG,IAAA;MAAID,SAAS,EAAC,kCAAkC;MAAAF,QAAA,EAAGD;IAAK,CAAM,CAAC,EAC7DD,WAAW,iBACZK,IAAA;MAAGD,SAAS,EAAC,wCAAwC;MAAAF,QAAA,EAClDF;IAAW,CACX,CACH;EAAA,CACM,CAAC,eACTK,IAAA;IAAKD,SAAS,EAAC,oCAAoC;IAAAF,QAAA,EAAGA;EAAQ,CAAO,CAAC;AAAA,CAC7D,CACV;AAED,eAAeH,OAAO","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/preferences-modal-section/index.js"],
4
+ "sourcesContent": ["const Section = ( { description, title, children } ) => (\n\t<fieldset className=\"preferences-modal__section\">\n\t\t<legend className=\"preferences-modal__section-legend\">\n\t\t\t<h2 className=\"preferences-modal__section-title\">{ title }</h2>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"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<div className=\"preferences-modal__section-content\">{ children }</div>\n\t</fieldset>\n);\n\nexport default Section;\n"],
5
+ "mappings": "AAEE,SACC,KADD;AAFF,MAAM,UAAU,CAAE,EAAE,aAAa,OAAO,SAAS,MAChD,qBAAC,cAAS,WAAU,8BACnB;AAAA,uBAAC,YAAO,WAAU,qCACjB;AAAA,wBAAC,QAAG,WAAU,oCAAqC,iBAAO;AAAA,IACxD,eACD,oBAAC,OAAE,WAAU,0CACV,uBACH;AAAA,KAEF;AAAA,EACA,oBAAC,SAAI,WAAU,sCAAuC,UAAU;AAAA,GACjE;AAGD,IAAO,oCAAQ;",
6
+ "names": []
7
+ }
@@ -1,144 +1,133 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useViewportMatch } from '@wordpress/compose';
5
- import { Navigator, __experimentalItemGroup as ItemGroup, __experimentalItem as Item, __experimentalHStack as HStack, __experimentalText as Text, __experimentalTruncate as Truncate, FlexItem, Card, CardHeader, CardBody, privateApis as componentsPrivateApis } from '@wordpress/components';
6
- import { useMemo, useState } from '@wordpress/element';
7
- import { chevronLeft, chevronRight, Icon } from '@wordpress/icons';
8
- import { isRTL, __ } from '@wordpress/i18n';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
- import { unlock } from '../../lock-unlock';
14
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- const {
16
- Tabs
17
- } = unlock(componentsPrivateApis);
18
- const PREFERENCES_MENU = 'preferences-menu';
19
- export default function PreferencesModalTabs({
20
- sections
21
- }) {
22
- const isLargeViewport = useViewportMatch('medium');
23
-
24
- // This is also used to sync the two different rendered components
25
- // between small and large viewports.
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useViewportMatch } from "@wordpress/compose";
3
+ import {
4
+ Navigator,
5
+ __experimentalItemGroup as ItemGroup,
6
+ __experimentalItem as Item,
7
+ __experimentalHStack as HStack,
8
+ __experimentalText as Text,
9
+ __experimentalTruncate as Truncate,
10
+ FlexItem,
11
+ Card,
12
+ CardHeader,
13
+ CardBody,
14
+ privateApis as componentsPrivateApis
15
+ } from "@wordpress/components";
16
+ import { useMemo, useState } from "@wordpress/element";
17
+ import { chevronLeft, chevronRight, Icon } from "@wordpress/icons";
18
+ import { isRTL, __ } from "@wordpress/i18n";
19
+ import { unlock } from "../../lock-unlock";
20
+ const { Tabs } = unlock(componentsPrivateApis);
21
+ const PREFERENCES_MENU = "preferences-menu";
22
+ function PreferencesModalTabs({ sections }) {
23
+ const isLargeViewport = useViewportMatch("medium");
26
24
  const [activeMenu, setActiveMenu] = useState(PREFERENCES_MENU);
27
- /**
28
- * Create helper objects from `sections` for easier data handling.
29
- * `tabs` is used for creating the `Tabs` and `sectionsContentMap`
30
- * is used for easier access to active tab's content.
31
- */
32
- const {
33
- tabs,
34
- sectionsContentMap
35
- } = useMemo(() => {
25
+ const { tabs, sectionsContentMap } = useMemo(() => {
36
26
  let mappedTabs = {
37
27
  tabs: [],
38
28
  sectionsContentMap: {}
39
29
  };
40
30
  if (sections.length) {
41
- mappedTabs = sections.reduce((accumulator, {
42
- name,
43
- tabLabel: title,
44
- content
45
- }) => {
46
- accumulator.tabs.push({
47
- name,
48
- title
49
- });
50
- accumulator.sectionsContentMap[name] = content;
51
- return accumulator;
52
- }, {
53
- tabs: [],
54
- sectionsContentMap: {}
55
- });
31
+ mappedTabs = sections.reduce(
32
+ (accumulator, { name, tabLabel: title, content }) => {
33
+ accumulator.tabs.push({ name, title });
34
+ accumulator.sectionsContentMap[name] = content;
35
+ return accumulator;
36
+ },
37
+ { tabs: [], sectionsContentMap: {} }
38
+ );
56
39
  }
57
40
  return mappedTabs;
58
41
  }, [sections]);
59
42
  let modalContent;
60
- // We render different components based on the viewport size.
61
43
  if (isLargeViewport) {
62
- modalContent = /*#__PURE__*/_jsx("div", {
63
- className: "preferences__tabs",
64
- children: /*#__PURE__*/_jsxs(Tabs, {
65
- defaultTabId: activeMenu !== PREFERENCES_MENU ? activeMenu : undefined,
44
+ modalContent = /* @__PURE__ */ jsx("div", { className: "preferences__tabs", children: /* @__PURE__ */ jsxs(
45
+ Tabs,
46
+ {
47
+ defaultTabId: activeMenu !== PREFERENCES_MENU ? activeMenu : void 0,
66
48
  onSelect: setActiveMenu,
67
49
  orientation: "vertical",
68
- children: [/*#__PURE__*/_jsx(Tabs.TabList, {
69
- className: "preferences__tabs-tablist",
70
- children: tabs.map(tab => /*#__PURE__*/_jsx(Tabs.Tab, {
71
- tabId: tab.name,
72
- className: "preferences__tabs-tab",
73
- children: tab.title
74
- }, tab.name))
75
- }), tabs.map(tab => /*#__PURE__*/_jsx(Tabs.TabPanel, {
76
- tabId: tab.name,
77
- className: "preferences__tabs-tabpanel",
78
- focusable: false,
79
- children: sectionsContentMap[tab.name] || null
80
- }, tab.name))]
81
- })
82
- });
50
+ children: [
51
+ /* @__PURE__ */ jsx(Tabs.TabList, { className: "preferences__tabs-tablist", children: tabs.map((tab) => /* @__PURE__ */ jsx(
52
+ Tabs.Tab,
53
+ {
54
+ tabId: tab.name,
55
+ className: "preferences__tabs-tab",
56
+ children: tab.title
57
+ },
58
+ tab.name
59
+ )) }),
60
+ tabs.map((tab) => /* @__PURE__ */ jsx(
61
+ Tabs.TabPanel,
62
+ {
63
+ tabId: tab.name,
64
+ className: "preferences__tabs-tabpanel",
65
+ focusable: false,
66
+ children: sectionsContentMap[tab.name] || null
67
+ },
68
+ tab.name
69
+ ))
70
+ ]
71
+ }
72
+ ) });
83
73
  } else {
84
- modalContent = /*#__PURE__*/_jsxs(Navigator, {
85
- initialPath: "/",
86
- className: "preferences__provider",
87
- children: [/*#__PURE__*/_jsx(Navigator.Screen, {
88
- path: "/",
89
- children: /*#__PURE__*/_jsx(Card, {
90
- isBorderless: true,
91
- size: "small",
92
- children: /*#__PURE__*/_jsx(CardBody, {
93
- children: /*#__PURE__*/_jsx(ItemGroup, {
94
- children: tabs.map(tab => {
95
- return /*#__PURE__*/_jsx(Navigator.Button, {
96
- path: `/${tab.name}`,
97
- as: Item,
98
- isAction: true,
99
- children: /*#__PURE__*/_jsxs(HStack, {
100
- justify: "space-between",
101
- children: [/*#__PURE__*/_jsx(FlexItem, {
102
- children: /*#__PURE__*/_jsx(Truncate, {
103
- children: tab.title
104
- })
105
- }), /*#__PURE__*/_jsx(FlexItem, {
106
- children: /*#__PURE__*/_jsx(Icon, {
107
- icon: isRTL() ? chevronLeft : chevronRight
108
- })
109
- })]
110
- })
111
- }, tab.name);
112
- })
113
- })
114
- })
115
- })
116
- }), sections.length && sections.map(section => {
117
- return /*#__PURE__*/_jsx(Navigator.Screen, {
118
- path: `/${section.name}`,
119
- children: /*#__PURE__*/_jsxs(Card, {
120
- isBorderless: true,
121
- size: "large",
122
- children: [/*#__PURE__*/_jsxs(CardHeader, {
123
- isBorderless: false,
124
- justify: "left",
125
- size: "small",
126
- gap: "6",
127
- children: [/*#__PURE__*/_jsx(Navigator.BackButton, {
128
- icon: isRTL() ? chevronRight : chevronLeft,
129
- label: __('Back')
130
- }), /*#__PURE__*/_jsx(Text, {
131
- size: "16",
132
- children: section.tabLabel
133
- })]
134
- }), /*#__PURE__*/_jsx(CardBody, {
135
- children: section.content
136
- })]
137
- })
138
- }, `${section.name}-menu`);
139
- })]
140
- });
74
+ modalContent = /* @__PURE__ */ jsxs(Navigator, { initialPath: "/", className: "preferences__provider", children: [
75
+ /* @__PURE__ */ jsx(Navigator.Screen, { path: "/", children: /* @__PURE__ */ jsx(Card, { isBorderless: true, size: "small", children: /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(ItemGroup, { children: tabs.map((tab) => {
76
+ return /* @__PURE__ */ jsx(
77
+ Navigator.Button,
78
+ {
79
+ path: `/${tab.name}`,
80
+ as: Item,
81
+ isAction: true,
82
+ children: /* @__PURE__ */ jsxs(HStack, { justify: "space-between", children: [
83
+ /* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(Truncate, { children: tab.title }) }),
84
+ /* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(
85
+ Icon,
86
+ {
87
+ icon: isRTL() ? chevronLeft : chevronRight
88
+ }
89
+ ) })
90
+ ] })
91
+ },
92
+ tab.name
93
+ );
94
+ }) }) }) }) }),
95
+ sections.length && sections.map((section) => {
96
+ return /* @__PURE__ */ jsx(
97
+ Navigator.Screen,
98
+ {
99
+ path: `/${section.name}`,
100
+ children: /* @__PURE__ */ jsxs(Card, { isBorderless: true, size: "large", children: [
101
+ /* @__PURE__ */ jsxs(
102
+ CardHeader,
103
+ {
104
+ isBorderless: false,
105
+ justify: "left",
106
+ size: "small",
107
+ gap: "6",
108
+ children: [
109
+ /* @__PURE__ */ jsx(
110
+ Navigator.BackButton,
111
+ {
112
+ icon: isRTL() ? chevronRight : chevronLeft,
113
+ label: __("Back")
114
+ }
115
+ ),
116
+ /* @__PURE__ */ jsx(Text, { size: "16", children: section.tabLabel })
117
+ ]
118
+ }
119
+ ),
120
+ /* @__PURE__ */ jsx(CardBody, { children: section.content })
121
+ ] })
122
+ },
123
+ `${section.name}-menu`
124
+ );
125
+ })
126
+ ] });
141
127
  }
142
128
  return modalContent;
143
129
  }
144
- //# sourceMappingURL=index.js.map
130
+ export {
131
+ PreferencesModalTabs as default
132
+ };
133
+ //# sourceMappingURL=index.js.map