@wordpress/preferences 3.26.0 → 3.28.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 (72) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/preference-base-option/index.js +31 -0
  3. package/build/components/preference-base-option/index.js.map +1 -0
  4. package/build/components/preference-toggle-control/index.js +42 -0
  5. package/build/components/preference-toggle-control/index.js.map +1 -0
  6. package/build/components/preference-toggle-menu-item/index.js +4 -1
  7. package/build/components/preference-toggle-menu-item/index.js.map +1 -1
  8. package/build/components/preferences-modal/index.js +24 -0
  9. package/build/components/preferences-modal/index.js.map +1 -0
  10. package/build/components/preferences-modal-section/index.js +24 -0
  11. package/build/components/preferences-modal-section/index.js.map +1 -0
  12. package/build/components/preferences-modal-tabs/index.js +129 -0
  13. package/build/components/preferences-modal-tabs/index.js.map +1 -0
  14. package/build/index.js +12 -0
  15. package/build/index.js.map +1 -1
  16. package/build/lock-unlock.js +18 -0
  17. package/build/lock-unlock.js.map +1 -0
  18. package/build/private-apis.js +26 -0
  19. package/build/private-apis.js.map +1 -0
  20. package/build/store/constants.js +1 -2
  21. package/build/store/constants.js.map +1 -1
  22. package/build/store/index.js +4 -5
  23. package/build/store/index.js.map +1 -1
  24. package/build/store/reducer.js +2 -4
  25. package/build/store/reducer.js.map +1 -1
  26. package/build/store/selectors.js +21 -3
  27. package/build/store/selectors.js.map +1 -1
  28. package/build-module/components/preference-base-option/index.js +24 -0
  29. package/build-module/components/preference-base-option/index.js.map +1 -0
  30. package/build-module/components/preference-toggle-control/index.js +34 -0
  31. package/build-module/components/preference-toggle-control/index.js.map +1 -0
  32. package/build-module/components/preference-toggle-menu-item/index.js +4 -1
  33. package/build-module/components/preference-toggle-menu-item/index.js.map +1 -1
  34. package/build-module/components/preferences-modal/index.js +17 -0
  35. package/build-module/components/preferences-modal/index.js.map +1 -0
  36. package/build-module/components/preferences-modal-section/index.js +18 -0
  37. package/build-module/components/preferences-modal-section/index.js.map +1 -0
  38. package/build-module/components/preferences-modal-tabs/index.js +122 -0
  39. package/build-module/components/preferences-modal-tabs/index.js.map +1 -0
  40. package/build-module/index.js +1 -0
  41. package/build-module/index.js.map +1 -1
  42. package/build-module/lock-unlock.js +9 -0
  43. package/build-module/lock-unlock.js.map +1 -0
  44. package/build-module/private-apis.js +18 -0
  45. package/build-module/private-apis.js.map +1 -0
  46. package/build-module/store/index.js +1 -1
  47. package/build-module/store/index.js.map +1 -1
  48. package/build-module/store/selectors.js +18 -2
  49. package/build-module/store/selectors.js.map +1 -1
  50. package/build-style/style-rtl.css +199 -0
  51. package/build-style/style.css +199 -0
  52. package/package.json +11 -8
  53. package/src/components/preference-base-option/README.md +40 -0
  54. package/src/components/preference-base-option/index.js +21 -0
  55. package/src/components/preference-base-option/style.scss +10 -0
  56. package/src/components/preference-toggle-control/index.js +38 -0
  57. package/src/components/preference-toggle-menu-item/index.js +4 -1
  58. package/src/components/preferences-modal/README.md +69 -0
  59. package/src/components/preferences-modal/index.js +17 -0
  60. package/src/components/preferences-modal/style.scss +21 -0
  61. package/src/components/preferences-modal-section/README.md +31 -0
  62. package/src/components/preferences-modal-section/index.js +15 -0
  63. package/src/components/preferences-modal-section/style.scss +28 -0
  64. package/src/components/preferences-modal-tabs/README.md +14 -0
  65. package/src/components/preferences-modal-tabs/index.js +178 -0
  66. package/src/components/preferences-modal-tabs/style.scss +48 -0
  67. package/src/index.js +1 -0
  68. package/src/lock-unlock.js +9 -0
  69. package/src/private-apis.js +18 -0
  70. package/src/store/index.js +1 -1
  71. package/src/store/selectors.js +42 -2
  72. package/src/style.scss +4 -0
@@ -0,0 +1,24 @@
1
+ import { createElement } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { ToggleControl } from '@wordpress/components';
6
+ function BaseOption({
7
+ help,
8
+ label,
9
+ isChecked,
10
+ onChange,
11
+ children
12
+ }) {
13
+ return createElement("div", {
14
+ className: "preference-base-option"
15
+ }, createElement(ToggleControl, {
16
+ __nextHasNoMarginBottom: true,
17
+ help: help,
18
+ label: label,
19
+ checked: isChecked,
20
+ onChange: onChange
21
+ }), children);
22
+ }
23
+ export default BaseOption;
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ToggleControl","BaseOption","help","label","isChecked","onChange","children","createElement","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;AAErD,SAASC,UAAUA,CAAE;EAAEC,IAAI;EAAEC,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EAAG;EACrE,OACCC,aAAA;IAAKC,SAAS,EAAC;EAAwB,GACtCD,aAAA,CAACP,aAAa;IACbS,uBAAuB;IACvBP,IAAI,EAAGA,IAAM;IACbC,KAAK,EAAGA,KAAO;IACfO,OAAO,EAAGN,SAAW;IACrBC,QAAQ,EAAGA;EAAU,CACrB,CAAC,EACAC,QACE,CAAC;AAER;AAEA,eAAeL,UAAU"}
@@ -0,0 +1,34 @@
1
+ import { createElement } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { useSelect, useDispatch } from '@wordpress/data';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { store as preferencesStore } from '../../store';
11
+ import PreferenceBaseOption from '../preference-base-option';
12
+ function PreferenceToggleControl(props) {
13
+ const {
14
+ scope,
15
+ featureName,
16
+ onToggle = () => {},
17
+ ...remainingProps
18
+ } = props;
19
+ const isChecked = useSelect(select => !!select(preferencesStore).get(scope, featureName), [scope, featureName]);
20
+ const {
21
+ toggle
22
+ } = useDispatch(preferencesStore);
23
+ const onChange = () => {
24
+ onToggle();
25
+ toggle(scope, featureName);
26
+ };
27
+ return createElement(PreferenceBaseOption, {
28
+ onChange: onChange,
29
+ isChecked: isChecked,
30
+ ...remainingProps
31
+ });
32
+ }
33
+ export default PreferenceToggleControl;
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSelect","useDispatch","store","preferencesStore","PreferenceBaseOption","PreferenceToggleControl","props","scope","featureName","onToggle","remainingProps","isChecked","select","get","toggle","onChange","createElement"],"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;AAE5D,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,GAAGX,SAAS,CACxBY,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAET,gBAAiB,CAAC,CAACU,GAAG,CAAEN,KAAK,EAAEC,WAAY,CAAC,EACrE,CAAED,KAAK,EAAEC,WAAW,CACrB,CAAC;EACD,MAAM;IAAEM;EAAO,CAAC,GAAGb,WAAW,CAAEE,gBAAiB,CAAC;EAClD,MAAMY,QAAQ,GAAGA,CAAA,KAAM;IACtBN,QAAQ,CAAC,CAAC;IACVK,MAAM,CAAEP,KAAK,EAAEC,WAAY,CAAC;EAC7B,CAAC;EAED,OACCQ,aAAA,CAACZ,oBAAoB;IACpBW,QAAQ,EAAGA,QAAU;IACrBJ,SAAS,EAAGA,SAAW;IAAA,GAClBD;EAAc,CACnB,CAAC;AAEJ;AAEA,eAAeL,uBAAuB"}
@@ -20,6 +20,7 @@ export default function PreferenceToggleMenuItem({
20
20
  messageActivated,
21
21
  messageDeactivated,
22
22
  shortcut,
23
+ handleToggling = true,
23
24
  onToggle = () => null,
24
25
  disabled = false
25
26
  }) {
@@ -43,7 +44,9 @@ export default function PreferenceToggleMenuItem({
43
44
  isSelected: isActive,
44
45
  onClick: () => {
45
46
  onToggle();
46
- toggle(scope, name);
47
+ if (handleToggling) {
48
+ toggle(scope, name);
49
+ }
47
50
  speakMessage();
48
51
  },
49
52
  role: "menuitemcheckbox",
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","MenuItem","__","sprintf","check","speak","store","preferencesStore","PreferenceToggleMenuItem","scope","name","label","info","messageActivated","messageDeactivated","shortcut","onToggle","disabled","isActive","select","get","toggle","speakMessage","message","createElement","icon","isSelected","onClick","role"],"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\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\ttoggle( scope, name );\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":";AAA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MACfX,QAAQ,CAAC,CAAC;MACVK,MAAM,CAAEZ,KAAK,EAAEC,IAAK,CAAC;MACrBY,YAAY,CAAC,CAAC;IACf,CAAG;IACHM,IAAI,EAAC,kBAAkB;IACvBhB,IAAI,EAAGA,IAAM;IACbG,QAAQ,EAAGA,QAAU;IACrBE,QAAQ,EAAGA;EAAU,GAEnBN,KACO,CAAC;AAEb"}
1
+ {"version":3,"names":["useSelect","useDispatch","MenuItem","__","sprintf","check","speak","store","preferencesStore","PreferenceToggleMenuItem","scope","name","label","info","messageActivated","messageDeactivated","shortcut","handleToggling","onToggle","disabled","isActive","select","get","toggle","speakMessage","message","createElement","icon","isSelected","onClick","role"],"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;AAEvD,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,GAAGpB,SAAS,CACvBqB,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAEb,gBAAiB,CAAC,CAACc,GAAG,CAAEZ,KAAK,EAAEC,IAAK,CAAC,EAC9D,CAAED,KAAK,EAAEC,IAAI,CACd,CAAC;EACD,MAAM;IAAEY;EAAO,CAAC,GAAGtB,WAAW,CAAEO,gBAAiB,CAAC;EAClD,MAAMgB,YAAY,GAAGA,CAAA,KAAM;IAC1B,IAAKJ,QAAQ,EAAG;MACf,MAAMK,OAAO,GACZV,kBAAkB,IAClBX,OAAO,EACN;MACAD,EAAE,CAAE,6BAA8B,CAAC,EACnCS,KACD,CAAC;MACFN,KAAK,CAAEmB,OAAQ,CAAC;IACjB,CAAC,MAAM;MACN,MAAMA,OAAO,GACZX,gBAAgB,IAChBV,OAAO,EACN;MACAD,EAAE,CAAE,2BAA4B,CAAC,EACjCS,KACD,CAAC;MACFN,KAAK,CAAEmB,OAAQ,CAAC;IACjB;EACD,CAAC;EAED,OACCC,aAAA,CAACxB,QAAQ;IACRyB,IAAI,EAAGP,QAAQ,IAAIf,KAAO;IAC1BuB,UAAU,EAAGR,QAAU;IACvBS,OAAO,EAAGA,CAAA,KAAM;MACfX,QAAQ,CAAC,CAAC;MACV,IAAKD,cAAc,EAAG;QACrBM,MAAM,CAAEb,KAAK,EAAEC,IAAK,CAAC;MACtB;MACAa,YAAY,CAAC,CAAC;IACf,CAAG;IACHM,IAAI,EAAC,kBAAkB;IACvBjB,IAAI,EAAGA,IAAM;IACbG,QAAQ,EAAGA,QAAU;IACrBG,QAAQ,EAAGA;EAAU,GAEnBP,KACO,CAAC;AAEb"}
@@ -0,0 +1,17 @@
1
+ import { createElement } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { Modal } from '@wordpress/components';
6
+ import { __ } from '@wordpress/i18n';
7
+ export default function PreferencesModal({
8
+ closeModal,
9
+ children
10
+ }) {
11
+ return createElement(Modal, {
12
+ className: "preferences-modal",
13
+ title: __('Preferences'),
14
+ onRequestClose: closeModal
15
+ }, children);
16
+ }
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Modal","__","PreferencesModal","closeModal","children","createElement","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;AAEpC,eAAe,SAASC,gBAAgBA,CAAE;EAAEC,UAAU;EAAEC;AAAS,CAAC,EAAG;EACpE,OACCC,aAAA,CAACL,KAAK;IACLM,SAAS,EAAC,mBAAmB;IAC7BC,KAAK,EAAGN,EAAE,CAAE,aAAc,CAAG;IAC7BO,cAAc,EAAGL;EAAY,GAE3BC,QACI,CAAC;AAEV"}
@@ -0,0 +1,18 @@
1
+ import { createElement } from "react";
2
+ const Section = ({
3
+ description,
4
+ title,
5
+ children
6
+ }) => createElement("fieldset", {
7
+ className: "preferences-modal__section"
8
+ }, createElement("legend", {
9
+ className: "preferences-modal__section-legend"
10
+ }, createElement("h2", {
11
+ className: "preferences-modal__section-title"
12
+ }, title), description && createElement("p", {
13
+ className: "preferences-modal__section-description"
14
+ }, description)), createElement("div", {
15
+ className: "preferences-modal__section-content"
16
+ }, children));
17
+ export default Section;
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Section","description","title","children","createElement","className"],"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,KACjDC,aAAA;EAAUC,SAAS,EAAC;AAA4B,GAC/CD,aAAA;EAAQC,SAAS,EAAC;AAAmC,GACpDD,aAAA;EAAIC,SAAS,EAAC;AAAkC,GAAGH,KAAW,CAAC,EAC7DD,WAAW,IACZG,aAAA;EAAGC,SAAS,EAAC;AAAwC,GAClDJ,WACA,CAEG,CAAC,EACTG,aAAA;EAAKC,SAAS,EAAC;AAAoC,GAAGF,QAAe,CAC5D,CACV;AAED,eAAeH,OAAO"}
@@ -0,0 +1,122 @@
1
+ import { createElement } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { useViewportMatch } from '@wordpress/compose';
6
+ import { __experimentalNavigatorProvider as NavigatorProvider, __experimentalNavigatorScreen as NavigatorScreen, __experimentalNavigatorButton as NavigatorButton, __experimentalNavigatorBackButton as NavigatorBackButton, __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';
7
+ import { useMemo, useState } from '@wordpress/element';
8
+ import { chevronLeft, chevronRight, Icon } from '@wordpress/icons';
9
+ import { isRTL, __ } from '@wordpress/i18n';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import { unlock } from '../../lock-unlock';
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.
26
+ 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(() => {
36
+ let mappedTabs = {
37
+ tabs: [],
38
+ sectionsContentMap: {}
39
+ };
40
+ 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
+ });
56
+ }
57
+ return mappedTabs;
58
+ }, [sections]);
59
+ let modalContent;
60
+ // We render different components based on the viewport size.
61
+ if (isLargeViewport) {
62
+ modalContent = createElement("div", {
63
+ className: "preferences__tabs"
64
+ }, createElement(Tabs, {
65
+ initialTabId: activeMenu !== PREFERENCES_MENU ? activeMenu : undefined,
66
+ onSelect: setActiveMenu,
67
+ orientation: "vertical"
68
+ }, createElement(Tabs.TabList, {
69
+ className: "preferences__tabs-tablist"
70
+ }, tabs.map(tab => createElement(Tabs.Tab, {
71
+ tabId: tab.name,
72
+ key: tab.name,
73
+ className: "preferences__tabs-tab"
74
+ }, tab.title))), tabs.map(tab => createElement(Tabs.TabPanel, {
75
+ tabId: tab.name,
76
+ key: tab.name,
77
+ className: "preferences__tabs-tabpanel",
78
+ focusable: false
79
+ }, sectionsContentMap[tab.name] || null))));
80
+ } else {
81
+ modalContent = createElement(NavigatorProvider, {
82
+ initialPath: "/",
83
+ className: "preferences__provider"
84
+ }, createElement(NavigatorScreen, {
85
+ path: "/"
86
+ }, createElement(Card, {
87
+ isBorderless: true,
88
+ size: "small"
89
+ }, createElement(CardBody, null, createElement(ItemGroup, null, tabs.map(tab => {
90
+ return createElement(NavigatorButton, {
91
+ key: tab.name,
92
+ path: tab.name,
93
+ as: Item,
94
+ isAction: true
95
+ }, createElement(HStack, {
96
+ justify: "space-between"
97
+ }, createElement(FlexItem, null, createElement(Truncate, null, tab.title)), createElement(FlexItem, null, createElement(Icon, {
98
+ icon: isRTL() ? chevronLeft : chevronRight
99
+ }))));
100
+ }))))), sections.length && sections.map(section => {
101
+ return createElement(NavigatorScreen, {
102
+ key: `${section.name}-menu`,
103
+ path: section.name
104
+ }, createElement(Card, {
105
+ isBorderless: true,
106
+ size: "large"
107
+ }, createElement(CardHeader, {
108
+ isBorderless: false,
109
+ justify: "left",
110
+ size: "small",
111
+ gap: "6"
112
+ }, createElement(NavigatorBackButton, {
113
+ icon: isRTL() ? chevronRight : chevronLeft,
114
+ "aria-label": __('Navigate to the previous view')
115
+ }), createElement(Text, {
116
+ size: "16"
117
+ }, section.tabLabel)), createElement(CardBody, null, section.content)));
118
+ }));
119
+ }
120
+ return modalContent;
121
+ }
122
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useViewportMatch","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalNavigatorButton","NavigatorButton","__experimentalNavigatorBackButton","NavigatorBackButton","__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalHStack","HStack","__experimentalText","Text","__experimentalTruncate","Truncate","FlexItem","Card","CardHeader","CardBody","privateApis","componentsPrivateApis","useMemo","useState","chevronLeft","chevronRight","Icon","isRTL","__","unlock","Tabs","PREFERENCES_MENU","PreferencesModalTabs","sections","isLargeViewport","activeMenu","setActiveMenu","tabs","sectionsContentMap","mappedTabs","length","reduce","accumulator","name","tabLabel","title","content","push","modalContent","createElement","className","initialTabId","undefined","onSelect","orientation","TabList","map","tab","Tab","tabId","key","TabPanel","focusable","initialPath","path","isBorderless","size","as","isAction","justify","icon","section","gap"],"sources":["@wordpress/preferences/src/components/preferences-modal-tabs/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalNavigatorButton as NavigatorButton,\n\t__experimentalNavigatorBackButton as NavigatorBackButton,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\t__experimentalTruncate as Truncate,\n\tFlexItem,\n\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\tinitialTabId={\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<NavigatorProvider\n\t\t\t\tinitialPath=\"/\"\n\t\t\t\tclassName=\"preferences__provider\"\n\t\t\t>\n\t\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t\t<Card isBorderless size=\"small\">\n\t\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\t\t\t\tpath={ tab.name }\n\t\t\t\t\t\t\t\t\t\t\tas={ Item }\n\t\t\t\t\t\t\t\t\t\t\tisAction\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t</CardBody>\n\t\t\t\t\t</Card>\n\t\t\t\t</NavigatorScreen>\n\t\t\t\t{ sections.length &&\n\t\t\t\t\tsections.map( ( section ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<NavigatorScreen\n\t\t\t\t\t\t\t\tkey={ `${ section.name }-menu` }\n\t\t\t\t\t\t\t\tpath={ section.name }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Card isBorderless size=\"large\">\n\t\t\t\t\t\t\t\t\t<CardHeader\n\t\t\t\t\t\t\t\t\t\tisBorderless={ false }\n\t\t\t\t\t\t\t\t\t\tjustify=\"left\"\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\tgap=\"6\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<NavigatorBackButton\n\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigate to the previous view'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<Text size=\"16\">\n\t\t\t\t\t\t\t\t\t\t\t{ section.tabLabel }\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t</CardHeader>\n\t\t\t\t\t\t\t\t\t<CardBody>{ section.content }</CardBody>\n\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t</NavigatorScreen>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t</NavigatorProvider>\n\t\t);\n\t}\n\n\treturn modalContent;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,+BAA+B,IAAIC,iBAAiB,EACpDC,6BAA6B,IAAIC,eAAe,EAChDC,6BAA6B,IAAIC,eAAe,EAChDC,iCAAiC,IAAIC,mBAAmB,EACxDC,uBAAuB,IAAIC,SAAS,EACpCC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,EAC1B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e,CACnB;EACF;EAEA,OAAOE,YAAY;AACpB"}
@@ -1,3 +1,4 @@
1
1
  export * from './components';
2
2
  export { store } from './store';
3
+ export * from './private-apis';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["store"],"sources":["@wordpress/preferences/src/index.js"],"sourcesContent":["export * from './components';\nexport { store } from './store';\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,SAASA,KAAK,QAAQ,SAAS"}
1
+ {"version":3,"names":["store"],"sources":["@wordpress/preferences/src/index.js"],"sourcesContent":["export * from './components';\nexport { store } from './store';\nexport * from './private-apis';\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,SAASA,KAAK,QAAQ,SAAS;AAC/B,cAAc,gBAAgB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
5
+ export const {
6
+ lock,
7
+ unlock
8
+ } = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/preferences');
9
+ //# sourceMappingURL=lock-unlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"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 know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/preferences'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAC1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,iHAAiH,EACjH,wBACD,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import PreferenceBaseOption from './components/preference-base-option';
5
+ import PreferenceToggleControl from './components/preference-toggle-control';
6
+ import PreferencesModal from './components/preferences-modal';
7
+ import PreferencesModalSection from './components/preferences-modal-section';
8
+ import PreferencesModalTabs from './components/preferences-modal-tabs';
9
+ import { lock } from './lock-unlock';
10
+ export const privateApis = {};
11
+ lock(privateApis, {
12
+ PreferenceBaseOption,
13
+ PreferenceToggleControl,
14
+ PreferencesModal,
15
+ PreferencesModalSection,
16
+ PreferencesModalTabs
17
+ });
18
+ //# sourceMappingURL=private-apis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PreferenceBaseOption","PreferenceToggleControl","PreferencesModal","PreferencesModalSection","PreferencesModalTabs","lock","privateApis"],"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":"AAAA;AACA;AACA;AACA,OAAOA,oBAAoB,MAAM,qCAAqC;AACtE,OAAOC,uBAAuB,MAAM,wCAAwC;AAC5E,OAAOC,gBAAgB,MAAM,gCAAgC;AAC7D,OAAOC,uBAAuB,MAAM,wCAAwC;AAC5E,OAAOC,oBAAoB,MAAM,qCAAqC;AACtE,SAASC,IAAI,QAAQ,eAAe;AAEpC,OAAO,MAAMC,WAAW,GAAG,CAAC,CAAC;AAC7BD,IAAI,CAAEC,WAAW,EAAE;EAClBN,oBAAoB;EACpBC,uBAAuB;EACvBC,gBAAgB;EAChBC,uBAAuB;EACvBC;AACD,CAAE,CAAC"}
@@ -12,7 +12,7 @@ import * as selectors from './selectors';
12
12
  import { STORE_NAME } from './constants';
13
13
 
14
14
  /**
15
- * Store definition for the interface namespace.
15
+ * Store definition for the preferences namespace.
16
16
  *
17
17
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
18
18
  *
@@ -1 +1 @@
1
- {"version":3,"names":["createReduxStore","register","reducer","actions","selectors","STORE_NAME","store"],"sources":["@wordpress/preferences/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the interface namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\nregister( store );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,SAASC,UAAU,QAAQ,aAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGN,gBAAgB,CAAEK,UAAU,EAAE;EAClDH,OAAO;EACPC,OAAO;EACPC;AACD,CAAE,CAAC;AAEHH,QAAQ,CAAEK,KAAM,CAAC"}
1
+ {"version":3,"names":["createReduxStore","register","reducer","actions","selectors","STORE_NAME","store"],"sources":["@wordpress/preferences/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the preferences namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\nregister( store );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,SAASC,UAAU,QAAQ,aAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGN,gBAAgB,CAAEK,UAAU,EAAE;EAClDH,OAAO;EACPC,OAAO;EACPC;AACD,CAAE,CAAC;AAEHH,QAAQ,CAAEK,KAAM,CAAC"}
@@ -1,3 +1,19 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import deprecated from '@wordpress/deprecated';
5
+ const withDeprecatedKeys = originalGet => (state, scope, name) => {
6
+ const settingsToMoveToCore = ['allowRightClickOverrides', 'distractionFree', 'editorMode', 'fixedToolbar', 'focusMode', 'hiddenBlockTypes', 'inactivePanels', 'keepCaretInsideBlock', 'mostUsedBlocks', 'openPanels', 'showBlockBreadcrumbs', 'showIconLabels', 'showListViewByDefault'];
7
+ if (settingsToMoveToCore.includes(name) && ['core/edit-post', 'core/edit-site'].includes(scope)) {
8
+ deprecated(`wp.data.select( 'core/preferences' ).get( '${scope}', '${name}' )`, {
9
+ since: '6.5',
10
+ alternative: `wp.data.select( 'core/preferences' ).get( 'core', '${name}' )`
11
+ });
12
+ return originalGet(state, 'core', name);
13
+ }
14
+ return originalGet(state, scope, name);
15
+ };
16
+
1
17
  /**
2
18
  * Returns a boolean indicating whether a prefer is active for a particular
3
19
  * scope.
@@ -8,8 +24,8 @@
8
24
  *
9
25
  * @return {*} Is the feature enabled?
10
26
  */
11
- export function get(state, scope, name) {
27
+ export const get = withDeprecatedKeys((state, scope, name) => {
12
28
  const value = state.preferences[scope]?.[name];
13
29
  return value !== undefined ? value : state.defaults[scope]?.[name];
14
- }
30
+ });
15
31
  //# sourceMappingURL=selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["get","state","scope","name","value","preferences","undefined","defaults"],"sources":["@wordpress/preferences/src/store/selectors.js"],"sourcesContent":["/**\n * Returns a boolean indicating whether a prefer is active for a particular\n * scope.\n *\n * @param {Object} state The store state.\n * @param {string} scope The scope of the feature (e.g. core/edit-post).\n * @param {string} name The name of the feature.\n *\n * @return {*} Is the feature enabled?\n */\nexport function get( state, scope, name ) {\n\tconst value = state.preferences[ scope ]?.[ name ];\n\treturn value !== undefined ? value : state.defaults[ scope ]?.[ name ];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,GAAGA,CAAEC,KAAK,EAAEC,KAAK,EAAEC,IAAI,EAAG;EACzC,MAAMC,KAAK,GAAGH,KAAK,CAACI,WAAW,CAAEH,KAAK,CAAE,GAAIC,IAAI,CAAE;EAClD,OAAOC,KAAK,KAAKE,SAAS,GAAGF,KAAK,GAAGH,KAAK,CAACM,QAAQ,CAAEL,KAAK,CAAE,GAAIC,IAAI,CAAE;AACvE"}
1
+ {"version":3,"names":["deprecated","withDeprecatedKeys","originalGet","state","scope","name","settingsToMoveToCore","includes","since","alternative","get","value","preferences","undefined","defaults"],"sources":["@wordpress/preferences/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\nconst withDeprecatedKeys = ( originalGet ) => ( state, scope, name ) => {\n\tconst settingsToMoveToCore = [\n\t\t'allowRightClickOverrides',\n\t\t'distractionFree',\n\t\t'editorMode',\n\t\t'fixedToolbar',\n\t\t'focusMode',\n\t\t'hiddenBlockTypes',\n\t\t'inactivePanels',\n\t\t'keepCaretInsideBlock',\n\t\t'mostUsedBlocks',\n\t\t'openPanels',\n\t\t'showBlockBreadcrumbs',\n\t\t'showIconLabels',\n\t\t'showListViewByDefault',\n\t];\n\n\tif (\n\t\tsettingsToMoveToCore.includes( name ) &&\n\t\t[ 'core/edit-post', 'core/edit-site' ].includes( scope )\n\t) {\n\t\tdeprecated(\n\t\t\t`wp.data.select( 'core/preferences' ).get( '${ scope }', '${ name }' )`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\talternative: `wp.data.select( 'core/preferences' ).get( 'core', '${ name }' )`,\n\t\t\t}\n\t\t);\n\n\t\treturn originalGet( state, 'core', name );\n\t}\n\n\treturn originalGet( state, scope, name );\n};\n\n/**\n * Returns a boolean indicating whether a prefer is active for a particular\n * scope.\n *\n * @param {Object} state The store state.\n * @param {string} scope The scope of the feature (e.g. core/edit-post).\n * @param {string} name The name of the feature.\n *\n * @return {*} Is the feature enabled?\n */\nexport const get = withDeprecatedKeys( ( state, scope, name ) => {\n\tconst value = state.preferences[ scope ]?.[ name ];\n\treturn value !== undefined ? value : state.defaults[ scope ]?.[ name ];\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,uBAAuB;AAE9C,MAAMC,kBAAkB,GAAKC,WAAW,IAAM,CAAEC,KAAK,EAAEC,KAAK,EAAEC,IAAI,KAAM;EACvE,MAAMC,oBAAoB,GAAG,CAC5B,0BAA0B,EAC1B,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,CACvB;EAED,IACCA,oBAAoB,CAACC,QAAQ,CAAEF,IAAK,CAAC,IACrC,CAAE,gBAAgB,EAAE,gBAAgB,CAAE,CAACE,QAAQ,CAAEH,KAAM,CAAC,EACvD;IACDJ,UAAU,CACR,8CAA8CI,KAAO,OAAOC,IAAM,KAAI,EACvE;MACCG,KAAK,EAAE,KAAK;MACZC,WAAW,EAAG,sDAAsDJ,IAAM;IAC3E,CACD,CAAC;IAED,OAAOH,WAAW,CAAEC,KAAK,EAAE,MAAM,EAAEE,IAAK,CAAC;EAC1C;EAEA,OAAOH,WAAW,CAAEC,KAAK,EAAEC,KAAK,EAAEC,IAAK,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,GAAG,GAAGT,kBAAkB,CAAE,CAAEE,KAAK,EAAEC,KAAK,EAAEC,IAAI,KAAM;EAChE,MAAMM,KAAK,GAAGR,KAAK,CAACS,WAAW,CAAER,KAAK,CAAE,GAAIC,IAAI,CAAE;EAClD,OAAOM,KAAK,KAAKE,SAAS,GAAGF,KAAK,GAAGR,KAAK,CAACW,QAAQ,CAAEV,KAAK,CAAE,GAAIC,IAAI,CAAE;AACvE,CAAE,CAAC"}
@@ -0,0 +1,199 @@
1
+ /**
2
+ * Converts a hex value into the rgb equivalent.
3
+ *
4
+ * @param {string} hex - the hexadecimal value to convert
5
+ * @return {string} comma separated rgb values
6
+ */
7
+ /**
8
+ * Colors
9
+ */
10
+ /**
11
+ * Breakpoints & Media Queries
12
+ */
13
+ /**
14
+ * SCSS Variables.
15
+ *
16
+ * Please use variables from this sheet to ensure consistency across the UI.
17
+ * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
18
+ * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
19
+ */
20
+ /**
21
+ * Converts a hex value into the rgb equivalent.
22
+ *
23
+ * @param {string} hex - the hexadecimal value to convert
24
+ * @return {string} comma separated rgb values
25
+ */
26
+ /**
27
+ * Colors
28
+ */
29
+ /**
30
+ * Fonts & basic variables.
31
+ */
32
+ /**
33
+ * Grid System.
34
+ * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
35
+ */
36
+ /**
37
+ * Dimensions.
38
+ */
39
+ /**
40
+ * Shadows.
41
+ */
42
+ /**
43
+ * Editor widths.
44
+ */
45
+ /**
46
+ * Block & Editor UI.
47
+ */
48
+ /**
49
+ * Block paddings.
50
+ */
51
+ /**
52
+ * React Native specific.
53
+ * These variables do not appear to be used anywhere else.
54
+ */
55
+ /**
56
+ * Converts a hex value into the rgb equivalent.
57
+ *
58
+ * @param {string} hex - the hexadecimal value to convert
59
+ * @return {string} comma separated rgb values
60
+ */
61
+ /**
62
+ * Long content fade mixin
63
+ *
64
+ * Creates a fading overlay to signify that the content is longer
65
+ * than the space allows.
66
+ */
67
+ /**
68
+ * Breakpoint mixins
69
+ */
70
+ /**
71
+ * Focus styles.
72
+ */
73
+ /**
74
+ * Applies editor left position to the selector passed as argument
75
+ */
76
+ /**
77
+ * Styles that are reused verbatim in a few places
78
+ */
79
+ /**
80
+ * Allows users to opt-out of animations via OS-level preferences.
81
+ */
82
+ /**
83
+ * Reset default styles for JavaScript UI based pages.
84
+ * This is a WP-admin agnostic reset
85
+ */
86
+ /**
87
+ * Reset the WP Admin page styles for Gutenberg-like pages.
88
+ */
89
+ :root {
90
+ --wp-admin-theme-color: #007cba;
91
+ --wp-admin-theme-color--rgb: 0, 124, 186;
92
+ --wp-admin-theme-color-darker-10: #006ba1;
93
+ --wp-admin-theme-color-darker-10--rgb: 0, 107, 161;
94
+ --wp-admin-theme-color-darker-20: #005a87;
95
+ --wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
96
+ --wp-admin-border-width-focus: 2px;
97
+ --wp-block-synced-color: #7a00df;
98
+ --wp-block-synced-color--rgb: 122, 0, 223;
99
+ }
100
+ @media (min-resolution: 192dpi) {
101
+ :root {
102
+ --wp-admin-border-width-focus: 1.5px;
103
+ }
104
+ }
105
+
106
+ .preference-base-option + .preference-base-option {
107
+ margin-top: 16px;
108
+ }
109
+ .preference-base-option .components-base-control__help {
110
+ margin-top: 0;
111
+ margin-right: 48px;
112
+ }
113
+
114
+ @media (min-width: 600px) {
115
+ .preferences-modal {
116
+ width: calc(100% - 32px);
117
+ height: calc(100% - 120px);
118
+ }
119
+ }
120
+ @media (min-width: 782px) {
121
+ .preferences-modal {
122
+ width: 750px;
123
+ }
124
+ }
125
+ @media (min-width: 960px) {
126
+ .preferences-modal {
127
+ height: 70%;
128
+ }
129
+ }
130
+ @media (max-width: 781px) {
131
+ .preferences-modal .components-modal__content {
132
+ padding: 0;
133
+ }
134
+ }
135
+
136
+ .preferences__tabs-tablist {
137
+ position: absolute;
138
+ top: 84px;
139
+ right: 16px;
140
+ width: 160px;
141
+ }
142
+
143
+ .preferences__tabs-tab {
144
+ border-radius: 2px;
145
+ font-weight: 400;
146
+ }
147
+ .preferences__tabs-tab[aria-selected=true] {
148
+ background: #f0f0f0;
149
+ box-shadow: none;
150
+ font-weight: 500;
151
+ }
152
+ .preferences__tabs-tab[aria-selected=true]::after {
153
+ content: none;
154
+ }
155
+ .preferences__tabs-tab[role=tab]:focus:not(:disabled) {
156
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
157
+ outline: 2px solid transparent;
158
+ }
159
+ .preferences__tabs-tab:focus-visible::before {
160
+ content: none;
161
+ }
162
+
163
+ .preferences__tabs-tabpanel {
164
+ padding-right: 24px;
165
+ margin-right: 160px;
166
+ }
167
+
168
+ @media (max-width: 781px) {
169
+ .preferences__provider {
170
+ height: 100%;
171
+ }
172
+ }
173
+ .preferences-modal__section {
174
+ margin: 0 0 2.5rem 0;
175
+ }
176
+ .preferences-modal__section:last-child {
177
+ margin: 0;
178
+ }
179
+
180
+ .preferences-modal__section-legend {
181
+ margin-bottom: 8px;
182
+ }
183
+
184
+ .preferences-modal__section-title {
185
+ font-size: 0.9rem;
186
+ font-weight: 600;
187
+ margin-top: 0;
188
+ }
189
+
190
+ .preferences-modal__section-description {
191
+ margin: -8px 0 8px 0;
192
+ font-size: 12px;
193
+ font-style: normal;
194
+ color: #757575;
195
+ }
196
+
197
+ .preferences-modal__section:has(.preferences-modal__section-content:empty) {
198
+ display: none;
199
+ }