@wordpress/preferences 3.31.0 → 3.32.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.32.0 (2024-04-03)
6
+
5
7
  ## 3.31.0 (2024-03-21)
6
8
 
7
9
  ## 3.30.0 (2024-03-06)
@@ -11,7 +11,7 @@ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
11
11
  */
12
12
 
13
13
  const withDeprecatedKeys = originalGet => (state, scope, name) => {
14
- const settingsToMoveToCore = ['allowRightClickOverrides', 'distractionFree', 'editorMode', 'fixedToolbar', 'focusMode', 'hiddenBlockTypes', 'inactivePanels', 'keepCaretInsideBlock', 'mostUsedBlocks', 'openPanels', 'showBlockBreadcrumbs', 'showIconLabels', 'showListViewByDefault'];
14
+ const settingsToMoveToCore = ['allowRightClickOverrides', 'distractionFree', 'editorMode', 'fixedToolbar', 'focusMode', 'hiddenBlockTypes', 'inactivePanels', 'keepCaretInsideBlock', 'mostUsedBlocks', 'openPanels', 'showBlockBreadcrumbs', 'showIconLabels', 'showListViewByDefault', 'isPublishSidebarEnabled'];
15
15
  if (settingsToMoveToCore.includes(name) && ['core/edit-post', 'core/edit-site'].includes(scope)) {
16
16
  (0, _deprecated.default)(`wp.data.select( 'core/preferences' ).get( '${scope}', '${name}' )`, {
17
17
  since: '6.5',
@@ -1 +1 @@
1
- {"version":3,"names":["_deprecated","_interopRequireDefault","require","withDeprecatedKeys","originalGet","state","scope","name","settingsToMoveToCore","includes","deprecated","since","alternative","get","exports","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":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA,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;IACD,IAAAI,mBAAU,EACR,8CAA8CJ,KAAO,OAAOC,IAAM,KAAI,EACvE;MACCI,KAAK,EAAE,KAAK;MACZC,WAAW,EAAG,sDAAsDL,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;AACO,MAAMM,GAAG,GAAAC,OAAA,CAAAD,GAAA,GAAGV,kBAAkB,CAAE,CAAEE,KAAK,EAAEC,KAAK,EAAEC,IAAI,KAAM;EAChE,MAAMQ,KAAK,GAAGV,KAAK,CAACW,WAAW,CAAEV,KAAK,CAAE,GAAIC,IAAI,CAAE;EAClD,OAAOQ,KAAK,KAAKE,SAAS,GAAGF,KAAK,GAAGV,KAAK,CAACa,QAAQ,CAAEZ,KAAK,CAAE,GAAIC,IAAI,CAAE;AACvE,CAAE,CAAC"}
1
+ {"version":3,"names":["_deprecated","_interopRequireDefault","require","withDeprecatedKeys","originalGet","state","scope","name","settingsToMoveToCore","includes","deprecated","since","alternative","get","exports","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\t'isPublishSidebarEnabled',\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":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA,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,EACvB,yBAAyB,CACzB;EAED,IACCA,oBAAoB,CAACC,QAAQ,CAAEF,IAAK,CAAC,IACrC,CAAE,gBAAgB,EAAE,gBAAgB,CAAE,CAACE,QAAQ,CAAEH,KAAM,CAAC,EACvD;IACD,IAAAI,mBAAU,EACR,8CAA8CJ,KAAO,OAAOC,IAAM,KAAI,EACvE;MACCI,KAAK,EAAE,KAAK;MACZC,WAAW,EAAG,sDAAsDL,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;AACO,MAAMM,GAAG,GAAAC,OAAA,CAAAD,GAAA,GAAGV,kBAAkB,CAAE,CAAEE,KAAK,EAAEC,KAAK,EAAEC,IAAI,KAAM;EAChE,MAAMQ,KAAK,GAAGV,KAAK,CAACW,WAAW,CAAEV,KAAK,CAAE,GAAIC,IAAI,CAAE;EAClD,OAAOQ,KAAK,KAAKE,SAAS,GAAGF,KAAK,GAAGV,KAAK,CAACa,QAAQ,CAAEZ,KAAK,CAAE,GAAIC,IAAI,CAAE;AACvE,CAAE,CAAC"}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import deprecated from '@wordpress/deprecated';
5
5
  const withDeprecatedKeys = originalGet => (state, scope, name) => {
6
- const settingsToMoveToCore = ['allowRightClickOverrides', 'distractionFree', 'editorMode', 'fixedToolbar', 'focusMode', 'hiddenBlockTypes', 'inactivePanels', 'keepCaretInsideBlock', 'mostUsedBlocks', 'openPanels', 'showBlockBreadcrumbs', 'showIconLabels', 'showListViewByDefault'];
6
+ const settingsToMoveToCore = ['allowRightClickOverrides', 'distractionFree', 'editorMode', 'fixedToolbar', 'focusMode', 'hiddenBlockTypes', 'inactivePanels', 'keepCaretInsideBlock', 'mostUsedBlocks', 'openPanels', 'showBlockBreadcrumbs', 'showIconLabels', 'showListViewByDefault', 'isPublishSidebarEnabled'];
7
7
  if (settingsToMoveToCore.includes(name) && ['core/edit-post', 'core/edit-site'].includes(scope)) {
8
8
  deprecated(`wp.data.select( 'core/preferences' ).get( '${scope}', '${name}' )`, {
9
9
  since: '6.5',
@@ -1 +1 @@
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"}
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\t'isPublishSidebarEnabled',\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,EACvB,yBAAyB,CACzB;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/preferences",
3
- "version": "3.31.0",
3
+ "version": "3.32.0",
4
4
  "description": "Utilities for managing WordPress preferences.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,15 +29,15 @@
29
29
  "sideEffects": false,
30
30
  "dependencies": {
31
31
  "@babel/runtime": "^7.16.0",
32
- "@wordpress/a11y": "^3.54.0",
33
- "@wordpress/components": "^27.2.0",
34
- "@wordpress/compose": "^6.31.0",
35
- "@wordpress/data": "^9.24.0",
36
- "@wordpress/deprecated": "^3.54.0",
37
- "@wordpress/element": "^5.31.0",
38
- "@wordpress/i18n": "^4.54.0",
39
- "@wordpress/icons": "^9.45.0",
40
- "@wordpress/private-apis": "^0.36.0",
32
+ "@wordpress/a11y": "^3.55.0",
33
+ "@wordpress/components": "^27.3.0",
34
+ "@wordpress/compose": "^6.32.0",
35
+ "@wordpress/data": "^9.25.0",
36
+ "@wordpress/deprecated": "^3.55.0",
37
+ "@wordpress/element": "^5.32.0",
38
+ "@wordpress/i18n": "^4.55.0",
39
+ "@wordpress/icons": "^9.46.0",
40
+ "@wordpress/private-apis": "^0.37.0",
41
41
  "classnames": "^2.3.1"
42
42
  },
43
43
  "peerDependencies": {
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "ffc07735d0abfb3f69e91d48f25b7fe8d1ef92d2"
50
+ "gitHead": "ac2b13783c28f959770cf029a797a712f59e1958"
51
51
  }
@@ -18,6 +18,7 @@ const withDeprecatedKeys = ( originalGet ) => ( state, scope, name ) => {
18
18
  'showBlockBreadcrumbs',
19
19
  'showIconLabels',
20
20
  'showListViewByDefault',
21
+ 'isPublishSidebarEnabled',
21
22
  ];
22
23
 
23
24
  if (