@wordpress/preferences 3.26.0 → 3.27.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 (63) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/preference-base-option/index.js +32 -0
  3. package/build/components/preference-base-option/index.js.map +1 -0
  4. package/build/components/preference-toggle-control/index.js +43 -0
  5. package/build/components/preference-toggle-control/index.js.map +1 -0
  6. package/build/components/preferences-modal/index.js +24 -0
  7. package/build/components/preferences-modal/index.js.map +1 -0
  8. package/build/components/preferences-modal-section/index.js +25 -0
  9. package/build/components/preferences-modal-section/index.js.map +1 -0
  10. package/build/components/preferences-modal-tabs/index.js +129 -0
  11. package/build/components/preferences-modal-tabs/index.js.map +1 -0
  12. package/build/index.js +12 -0
  13. package/build/index.js.map +1 -1
  14. package/build/lock-unlock.js +18 -0
  15. package/build/lock-unlock.js.map +1 -0
  16. package/build/private-apis.js +27 -0
  17. package/build/private-apis.js.map +1 -0
  18. package/build/store/index.js +1 -1
  19. package/build/store/index.js.map +1 -1
  20. package/build/store/selectors.js +22 -3
  21. package/build/store/selectors.js.map +1 -1
  22. package/build-module/components/preference-base-option/index.js +24 -0
  23. package/build-module/components/preference-base-option/index.js.map +1 -0
  24. package/build-module/components/preference-toggle-control/index.js +34 -0
  25. package/build-module/components/preference-toggle-control/index.js.map +1 -0
  26. package/build-module/components/preferences-modal/index.js +17 -0
  27. package/build-module/components/preferences-modal/index.js.map +1 -0
  28. package/build-module/components/preferences-modal-section/index.js +18 -0
  29. package/build-module/components/preferences-modal-section/index.js.map +1 -0
  30. package/build-module/components/preferences-modal-tabs/index.js +122 -0
  31. package/build-module/components/preferences-modal-tabs/index.js.map +1 -0
  32. package/build-module/index.js +1 -0
  33. package/build-module/index.js.map +1 -1
  34. package/build-module/lock-unlock.js +9 -0
  35. package/build-module/lock-unlock.js.map +1 -0
  36. package/build-module/private-apis.js +18 -0
  37. package/build-module/private-apis.js.map +1 -0
  38. package/build-module/store/index.js +1 -1
  39. package/build-module/store/index.js.map +1 -1
  40. package/build-module/store/selectors.js +18 -2
  41. package/build-module/store/selectors.js.map +1 -1
  42. package/build-style/style-rtl.css +199 -0
  43. package/build-style/style.css +199 -0
  44. package/package.json +11 -8
  45. package/src/components/preference-base-option/README.md +40 -0
  46. package/src/components/preference-base-option/index.js +21 -0
  47. package/src/components/preference-base-option/style.scss +10 -0
  48. package/src/components/preference-toggle-control/index.js +38 -0
  49. package/src/components/preferences-modal/README.md +69 -0
  50. package/src/components/preferences-modal/index.js +17 -0
  51. package/src/components/preferences-modal/style.scss +21 -0
  52. package/src/components/preferences-modal-section/README.md +31 -0
  53. package/src/components/preferences-modal-section/index.js +15 -0
  54. package/src/components/preferences-modal-section/style.scss +28 -0
  55. package/src/components/preferences-modal-tabs/README.md +14 -0
  56. package/src/components/preferences-modal-tabs/index.js +178 -0
  57. package/src/components/preferences-modal-tabs/style.scss +48 -0
  58. package/src/index.js +1 -0
  59. package/src/lock-unlock.js +9 -0
  60. package/src/private-apis.js +18 -0
  61. package/src/store/index.js +1 -1
  62. package/src/store/selectors.js +42 -2
  63. package/src/style.scss +4 -0
@@ -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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QACnBiE,IAAI,EACH3C,KAAK,CAAC,CAAC,GACJF,YAAY,GACZD,WACH;QACD,cAAaI,EAAE,CACd,+BACD;MAAG,CACH,CAAC,EACFqB,aAAA,CAACpC,IAAI;QAACqD,IAAI,EAAC;MAAI,GACZK,OAAO,CAAC3B,QACL,CACK,CAAC,EACbK,aAAA,CAAC9B,QAAQ,QAAGoD,OAAO,CAACzB,OAAmB,CAClC,CACU,CAAC;IAEpB,CAAE,CACe,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
+ }
@@ -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-left: 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
+ left: 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-left: 24px;
165
+ margin-left: 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
+ }