@wordpress/preferences 4.48.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 CHANGED
@@ -2,7 +2,17 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- ## 4.48.0 (2026-06-04)
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)).
6
16
 
7
17
  ## 4.47.0 (2026-05-27)
8
18
 
@@ -32,7 +42,7 @@
32
42
 
33
43
  ### Internal
34
44
 
35
- - TypeScript conversion
45
+ - TypeScript conversion
36
46
 
37
47
  ## 4.33.0 (2025-10-17)
38
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 prefer is active for a particular scope.
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 prefer 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"],
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 prefer 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"],
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 prefer is active for a particular
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.48.0",
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,16 +50,17 @@
51
50
  ],
52
51
  "sideEffects": false,
53
52
  "dependencies": {
54
- "@wordpress/a11y": "^4.48.0",
55
- "@wordpress/base-styles": "^9.1.0",
56
- "@wordpress/components": "^35.0.0",
57
- "@wordpress/compose": "^8.1.0",
58
- "@wordpress/data": "^10.48.0",
59
- "@wordpress/deprecated": "^4.48.0",
60
- "@wordpress/element": "^8.0.0",
61
- "@wordpress/i18n": "^6.21.0",
62
- "@wordpress/icons": "^13.3.0",
63
- "@wordpress/private-apis": "^1.48.0",
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": {
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "e7856693aeb4e2522d13608cd32c994e4a97cb9c"
73
+ "gitHead": "99df7432c5c7cb83ba41146fd1f57f3c19004305"
74
74
  }
@@ -5,6 +5,7 @@
5
5
  ## Example
6
6
 
7
7
  See the `PreferencesModal` readme for usage info.
8
+
8
9
  ## Props
9
10
  ### sections
10
11
 
@@ -50,7 +50,7 @@ const withDeprecatedKeys =
50
50
  };
51
51
 
52
52
  /**
53
- * Returns a boolean indicating whether a prefer is active for a particular
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.