@wordpress/preferences 4.47.0 → 4.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/README.md +1 -1
- package/build/store/selectors.cjs.map +1 -1
- package/build-module/store/selectors.mjs.map +1 -1
- package/build-types/store/selectors.d.ts +1 -1
- package/package.json +15 -15
- package/src/components/preferences-modal-tabs/README.md +1 -0
- package/src/store/selectors.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 4.48.1 (2026-06-16)
|
|
6
|
+
|
|
7
|
+
## 4.48.0 (2026-06-10)
|
|
8
|
+
|
|
9
|
+
### Code Quality
|
|
10
|
+
|
|
11
|
+
- Add missing `@types/react` dependency. [#78882](https://github.com/WordPress/gutenberg/pull/78882).
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
|
|
15
|
+
- Fix documentation typos ([#78686](https://github.com/WordPress/gutenberg/pull/78686)).
|
|
16
|
+
|
|
5
17
|
## 4.47.0 (2026-05-27)
|
|
6
18
|
|
|
7
19
|
## 4.46.0 (2026-05-14)
|
|
@@ -30,7 +42,7 @@
|
|
|
30
42
|
|
|
31
43
|
### Internal
|
|
32
44
|
|
|
33
|
-
-
|
|
45
|
+
- TypeScript conversion
|
|
34
46
|
|
|
35
47
|
## 4.33.0 (2025-10-17)
|
|
36
48
|
|
package/README.md
CHANGED
|
@@ -232,7 +232,7 @@ The following selectors are available on the object returned by `wp.data.select(
|
|
|
232
232
|
|
|
233
233
|
#### get
|
|
234
234
|
|
|
235
|
-
Returns a boolean indicating whether a
|
|
235
|
+
Returns a boolean indicating whether a preference is active for a particular scope.
|
|
236
236
|
|
|
237
237
|
_Parameters_
|
|
238
238
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/selectors.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n/**\n * Internal dependencies\n */\nimport type { StoreState } from './types';\n\nconst withDeprecatedKeys =\n\t(\n\t\toriginalGet: ( state: StoreState, scope: string, name: string ) => any\n\t) =>\n\t( state: StoreState, scope: string, name: string ) => {\n\t\tconst settingsToMoveToCore = [\n\t\t\t'allowRightClickOverrides',\n\t\t\t'distractionFree',\n\t\t\t'editorMode',\n\t\t\t'fixedToolbar',\n\t\t\t'focusMode',\n\t\t\t'hiddenBlockTypes',\n\t\t\t'inactivePanels',\n\t\t\t'keepCaretInsideBlock',\n\t\t\t'mostUsedBlocks',\n\t\t\t'openPanels',\n\t\t\t'showBlockBreadcrumbs',\n\t\t\t'showIconLabels',\n\t\t\t'showListViewByDefault',\n\t\t\t'isPublishSidebarEnabled',\n\t\t\t'isComplementaryAreaVisible',\n\t\t\t'pinnedItems',\n\t\t];\n\n\t\tif (\n\t\t\tsettingsToMoveToCore.includes( name ) &&\n\t\t\t[ 'core/edit-post', 'core/edit-site' ].includes( scope )\n\t\t) {\n\t\t\tdeprecated(\n\t\t\t\t`wp.data.select( 'core/preferences' ).get( '${ scope }', '${ name }' )`,\n\t\t\t\t{\n\t\t\t\t\tsince: '6.5',\n\t\t\t\t\talternative: `wp.data.select( 'core/preferences' ).get( 'core', '${ name }' )`,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn originalGet( state, 'core', name );\n\t\t}\n\n\t\treturn originalGet( state, scope, name );\n\t};\n\n/**\n * Returns a boolean indicating whether a
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n/**\n * Internal dependencies\n */\nimport type { StoreState } from './types';\n\nconst withDeprecatedKeys =\n\t(\n\t\toriginalGet: ( state: StoreState, scope: string, name: string ) => any\n\t) =>\n\t( state: StoreState, scope: string, name: string ) => {\n\t\tconst settingsToMoveToCore = [\n\t\t\t'allowRightClickOverrides',\n\t\t\t'distractionFree',\n\t\t\t'editorMode',\n\t\t\t'fixedToolbar',\n\t\t\t'focusMode',\n\t\t\t'hiddenBlockTypes',\n\t\t\t'inactivePanels',\n\t\t\t'keepCaretInsideBlock',\n\t\t\t'mostUsedBlocks',\n\t\t\t'openPanels',\n\t\t\t'showBlockBreadcrumbs',\n\t\t\t'showIconLabels',\n\t\t\t'showListViewByDefault',\n\t\t\t'isPublishSidebarEnabled',\n\t\t\t'isComplementaryAreaVisible',\n\t\t\t'pinnedItems',\n\t\t];\n\n\t\tif (\n\t\t\tsettingsToMoveToCore.includes( name ) &&\n\t\t\t[ 'core/edit-post', 'core/edit-site' ].includes( scope )\n\t\t) {\n\t\t\tdeprecated(\n\t\t\t\t`wp.data.select( 'core/preferences' ).get( '${ scope }', '${ name }' )`,\n\t\t\t\t{\n\t\t\t\t\tsince: '6.5',\n\t\t\t\t\talternative: `wp.data.select( 'core/preferences' ).get( 'core', '${ name }' )`,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn originalGet( state, 'core', name );\n\t\t}\n\n\t\treturn originalGet( state, scope, name );\n\t};\n\n/**\n * Returns a boolean indicating whether a preference is active for a particular\n * scope.\n *\n * @param {StoreState} 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(\n\t( state: StoreState, scope: string, name: string ) => {\n\t\tconst value = state.preferences[ scope ]?.[ name ];\n\t\treturn value !== undefined ? value : state.defaults[ scope ]?.[ name ];\n\t}\n);\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAuB;AAMvB,IAAM,qBACL,CACC,gBAED,CAAE,OAAmB,OAAe,SAAkB;AACrD,QAAM,uBAAuB;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,MACC,qBAAqB,SAAU,IAAK,KACpC,CAAE,kBAAkB,gBAAiB,EAAE,SAAU,KAAM,GACtD;AACD,0BAAAA;AAAA,MACC,8CAA+C,KAAM,OAAQ,IAAK;AAAA,MAClE;AAAA,QACC,OAAO;AAAA,QACP,aAAa,sDAAuD,IAAK;AAAA,MAC1E;AAAA,IACD;AAEA,WAAO,YAAa,OAAO,QAAQ,IAAK;AAAA,EACzC;AAEA,SAAO,YAAa,OAAO,OAAO,IAAK;AACxC;AAYM,IAAM,MAAM;AAAA,EAClB,CAAE,OAAmB,OAAe,SAAkB;AACrD,UAAM,QAAQ,MAAM,YAAa,KAAM,IAAK,IAAK;AACjD,WAAO,UAAU,SAAY,QAAQ,MAAM,SAAU,KAAM,IAAK,IAAK;AAAA,EACtE;AACD;",
|
|
6
6
|
"names": ["deprecated"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/selectors.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n/**\n * Internal dependencies\n */\nimport type { StoreState } from './types';\n\nconst withDeprecatedKeys =\n\t(\n\t\toriginalGet: ( state: StoreState, scope: string, name: string ) => any\n\t) =>\n\t( state: StoreState, scope: string, name: string ) => {\n\t\tconst settingsToMoveToCore = [\n\t\t\t'allowRightClickOverrides',\n\t\t\t'distractionFree',\n\t\t\t'editorMode',\n\t\t\t'fixedToolbar',\n\t\t\t'focusMode',\n\t\t\t'hiddenBlockTypes',\n\t\t\t'inactivePanels',\n\t\t\t'keepCaretInsideBlock',\n\t\t\t'mostUsedBlocks',\n\t\t\t'openPanels',\n\t\t\t'showBlockBreadcrumbs',\n\t\t\t'showIconLabels',\n\t\t\t'showListViewByDefault',\n\t\t\t'isPublishSidebarEnabled',\n\t\t\t'isComplementaryAreaVisible',\n\t\t\t'pinnedItems',\n\t\t];\n\n\t\tif (\n\t\t\tsettingsToMoveToCore.includes( name ) &&\n\t\t\t[ 'core/edit-post', 'core/edit-site' ].includes( scope )\n\t\t) {\n\t\t\tdeprecated(\n\t\t\t\t`wp.data.select( 'core/preferences' ).get( '${ scope }', '${ name }' )`,\n\t\t\t\t{\n\t\t\t\t\tsince: '6.5',\n\t\t\t\t\talternative: `wp.data.select( 'core/preferences' ).get( 'core', '${ name }' )`,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn originalGet( state, 'core', name );\n\t\t}\n\n\t\treturn originalGet( state, scope, name );\n\t};\n\n/**\n * Returns a boolean indicating whether a
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n/**\n * Internal dependencies\n */\nimport type { StoreState } from './types';\n\nconst withDeprecatedKeys =\n\t(\n\t\toriginalGet: ( state: StoreState, scope: string, name: string ) => any\n\t) =>\n\t( state: StoreState, scope: string, name: string ) => {\n\t\tconst settingsToMoveToCore = [\n\t\t\t'allowRightClickOverrides',\n\t\t\t'distractionFree',\n\t\t\t'editorMode',\n\t\t\t'fixedToolbar',\n\t\t\t'focusMode',\n\t\t\t'hiddenBlockTypes',\n\t\t\t'inactivePanels',\n\t\t\t'keepCaretInsideBlock',\n\t\t\t'mostUsedBlocks',\n\t\t\t'openPanels',\n\t\t\t'showBlockBreadcrumbs',\n\t\t\t'showIconLabels',\n\t\t\t'showListViewByDefault',\n\t\t\t'isPublishSidebarEnabled',\n\t\t\t'isComplementaryAreaVisible',\n\t\t\t'pinnedItems',\n\t\t];\n\n\t\tif (\n\t\t\tsettingsToMoveToCore.includes( name ) &&\n\t\t\t[ 'core/edit-post', 'core/edit-site' ].includes( scope )\n\t\t) {\n\t\t\tdeprecated(\n\t\t\t\t`wp.data.select( 'core/preferences' ).get( '${ scope }', '${ name }' )`,\n\t\t\t\t{\n\t\t\t\t\tsince: '6.5',\n\t\t\t\t\talternative: `wp.data.select( 'core/preferences' ).get( 'core', '${ name }' )`,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn originalGet( state, 'core', name );\n\t\t}\n\n\t\treturn originalGet( state, scope, name );\n\t};\n\n/**\n * Returns a boolean indicating whether a preference is active for a particular\n * scope.\n *\n * @param {StoreState} 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(\n\t( state: StoreState, scope: string, name: string ) => {\n\t\tconst value = state.preferences[ scope ]?.[ name ];\n\t\treturn value !== undefined ? value : state.defaults[ scope ]?.[ name ];\n\t}\n);\n"],
|
|
5
5
|
"mappings": ";AAGA,OAAO,gBAAgB;AAMvB,IAAM,qBACL,CACC,gBAED,CAAE,OAAmB,OAAe,SAAkB;AACrD,QAAM,uBAAuB;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,MACC,qBAAqB,SAAU,IAAK,KACpC,CAAE,kBAAkB,gBAAiB,EAAE,SAAU,KAAM,GACtD;AACD;AAAA,MACC,8CAA+C,KAAM,OAAQ,IAAK;AAAA,MAClE;AAAA,QACC,OAAO;AAAA,QACP,aAAa,sDAAuD,IAAK;AAAA,MAC1E;AAAA,IACD;AAEA,WAAO,YAAa,OAAO,QAAQ,IAAK;AAAA,EACzC;AAEA,SAAO,YAAa,OAAO,OAAO,IAAK;AACxC;AAYM,IAAM,MAAM;AAAA,EAClB,CAAE,OAAmB,OAAe,SAAkB;AACrD,UAAM,QAAQ,MAAM,YAAa,KAAM,IAAK,IAAK;AACjD,WAAO,UAAU,SAAY,QAAQ,MAAM,SAAU,KAAM,IAAK,IAAK;AAAA,EACtE;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { StoreState } from './types';
|
|
5
5
|
/**
|
|
6
|
-
* Returns a boolean indicating whether a
|
|
6
|
+
* Returns a boolean indicating whether a preference is active for a particular
|
|
7
7
|
* scope.
|
|
8
8
|
*
|
|
9
9
|
* @param {StoreState} state The store state.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/preferences",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.48.1",
|
|
4
4
|
"description": "Utilities for managing WordPress preferences.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"./package.json": "./package.json",
|
|
44
44
|
"./build-style/": "./build-style/"
|
|
45
45
|
},
|
|
46
|
-
"react-native": "src/index",
|
|
47
46
|
"wpScript": true,
|
|
48
47
|
"types": "build-types",
|
|
49
48
|
"wpScriptExtraDependencies": [
|
|
@@ -51,24 +50,25 @@
|
|
|
51
50
|
],
|
|
52
51
|
"sideEffects": false,
|
|
53
52
|
"dependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"@wordpress/
|
|
56
|
-
"@wordpress/
|
|
57
|
-
"@wordpress/
|
|
58
|
-
"@wordpress/
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/
|
|
62
|
-
"@wordpress/
|
|
63
|
-
"@wordpress/
|
|
53
|
+
"@types/react": "^18.3.27",
|
|
54
|
+
"@wordpress/a11y": "^4.48.1",
|
|
55
|
+
"@wordpress/base-styles": "^10.0.1",
|
|
56
|
+
"@wordpress/components": "^35.0.1",
|
|
57
|
+
"@wordpress/compose": "^8.1.1",
|
|
58
|
+
"@wordpress/data": "^10.48.1",
|
|
59
|
+
"@wordpress/deprecated": "^4.48.1",
|
|
60
|
+
"@wordpress/element": "^8.0.1",
|
|
61
|
+
"@wordpress/i18n": "^6.21.1",
|
|
62
|
+
"@wordpress/icons": "^14.0.1",
|
|
63
|
+
"@wordpress/private-apis": "^1.48.1",
|
|
64
64
|
"clsx": "^2.1.1"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"react": "^
|
|
68
|
-
"react-dom": "^
|
|
67
|
+
"react": "^18.0.0",
|
|
68
|
+
"react-dom": "^18.0.0"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "99df7432c5c7cb83ba41146fd1f57f3c19004305"
|
|
74
74
|
}
|
package/src/store/selectors.ts
CHANGED
|
@@ -50,7 +50,7 @@ const withDeprecatedKeys =
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* Returns a boolean indicating whether a
|
|
53
|
+
* Returns a boolean indicating whether a preference is active for a particular
|
|
54
54
|
* scope.
|
|
55
55
|
*
|
|
56
56
|
* @param {StoreState} state The store state.
|