@wordpress/interface 5.16.0 → 5.17.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.
Files changed (102) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/action-item/index.js +6 -14
  3. package/build/components/action-item/index.js.map +1 -1
  4. package/build/components/complementary-area/index.js +9 -28
  5. package/build/components/complementary-area/index.js.map +1 -1
  6. package/build/components/complementary-area-context/index.js +0 -3
  7. package/build/components/complementary-area-context/index.js.map +1 -1
  8. package/build/components/complementary-area-header/index.js +1 -7
  9. package/build/components/complementary-area-header/index.js.map +1 -1
  10. package/build/components/complementary-area-more-menu-item/index.js +3 -9
  11. package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
  12. package/build/components/complementary-area-toggle/index.js +2 -10
  13. package/build/components/complementary-area-toggle/index.js.map +1 -1
  14. package/build/components/fullscreen-mode/index.js +3 -7
  15. package/build/components/fullscreen-mode/index.js.map +1 -1
  16. package/build/components/index.js +0 -14
  17. package/build/components/index.js.map +1 -1
  18. package/build/components/index.native.js +0 -3
  19. package/build/components/index.native.js.map +1 -1
  20. package/build/components/interface-skeleton/index.js +8 -22
  21. package/build/components/interface-skeleton/index.js.map +1 -1
  22. package/build/components/more-menu-dropdown/index.js +1 -8
  23. package/build/components/more-menu-dropdown/index.js.map +1 -1
  24. package/build/components/more-menu-feature-toggle/index.js +2 -11
  25. package/build/components/more-menu-feature-toggle/index.js.map +1 -1
  26. package/build/components/navigable-region/index.js +1 -4
  27. package/build/components/navigable-region/index.js.map +1 -1
  28. package/build/components/pinned-items/index.js +1 -7
  29. package/build/components/pinned-items/index.js.map +1 -1
  30. package/build/components/preferences-modal/index.js +1 -4
  31. package/build/components/preferences-modal/index.js.map +1 -1
  32. package/build/components/preferences-modal-base-option/index.js +1 -4
  33. package/build/components/preferences-modal-base-option/index.js.map +1 -1
  34. package/build/components/preferences-modal-section/index.js +0 -3
  35. package/build/components/preferences-modal-section/index.js.map +1 -1
  36. package/build/components/preferences-modal-tabs/index.js +6 -15
  37. package/build/components/preferences-modal-tabs/index.js.map +1 -1
  38. package/build/index.js +0 -3
  39. package/build/index.js.map +1 -1
  40. package/build/store/actions.js +15 -37
  41. package/build/store/actions.js.map +1 -1
  42. package/build/store/constants.js +0 -1
  43. package/build/store/constants.js.map +1 -1
  44. package/build/store/index.js +3 -11
  45. package/build/store/index.js.map +1 -1
  46. package/build/store/reducer.js +8 -14
  47. package/build/store/reducer.js.map +1 -1
  48. package/build/store/selectors.js +8 -15
  49. package/build/store/selectors.js.map +1 -1
  50. package/build-module/components/action-item/index.js +5 -10
  51. package/build-module/components/action-item/index.js.map +1 -1
  52. package/build-module/components/complementary-area/index.js +10 -17
  53. package/build-module/components/complementary-area/index.js.map +1 -1
  54. package/build-module/components/complementary-area-context/index.js.map +1 -1
  55. package/build-module/components/complementary-area-header/index.js +2 -5
  56. package/build-module/components/complementary-area-header/index.js.map +1 -1
  57. package/build-module/components/complementary-area-more-menu-item/index.js +3 -5
  58. package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
  59. package/build-module/components/complementary-area-toggle/index.js +2 -5
  60. package/build-module/components/complementary-area-toggle/index.js.map +1 -1
  61. package/build-module/components/fullscreen-mode/index.js +2 -6
  62. package/build-module/components/fullscreen-mode/index.js.map +1 -1
  63. package/build-module/components/index.js.map +1 -1
  64. package/build-module/components/index.native.js.map +1 -1
  65. package/build-module/components/interface-skeleton/index.js +9 -17
  66. package/build-module/components/interface-skeleton/index.js.map +1 -1
  67. package/build-module/components/more-menu-dropdown/index.js +1 -3
  68. package/build-module/components/more-menu-dropdown/index.js.map +1 -1
  69. package/build-module/components/more-menu-feature-toggle/index.js +2 -5
  70. package/build-module/components/more-menu-feature-toggle/index.js.map +1 -1
  71. package/build-module/components/navigable-region/index.js +0 -1
  72. package/build-module/components/navigable-region/index.js.map +1 -1
  73. package/build-module/components/pinned-items/index.js +1 -5
  74. package/build-module/components/pinned-items/index.js.map +1 -1
  75. package/build-module/components/preferences-modal/index.js +0 -1
  76. package/build-module/components/preferences-modal/index.js.map +1 -1
  77. package/build-module/components/preferences-modal-base-option/index.js +0 -3
  78. package/build-module/components/preferences-modal-base-option/index.js.map +1 -1
  79. package/build-module/components/preferences-modal-section/index.js +0 -2
  80. package/build-module/components/preferences-modal-section/index.js.map +1 -1
  81. package/build-module/components/preferences-modal-tabs/index.js +5 -9
  82. package/build-module/components/preferences-modal-tabs/index.js.map +1 -1
  83. package/build-module/index.js.map +1 -1
  84. package/build-module/store/actions.js +16 -20
  85. package/build-module/store/actions.js.map +1 -1
  86. package/build-module/store/constants.js.map +1 -1
  87. package/build-module/store/index.js +5 -4
  88. package/build-module/store/index.js.map +1 -1
  89. package/build-module/store/reducer.js +7 -9
  90. package/build-module/store/reducer.js.map +1 -1
  91. package/build-module/store/selectors.js +9 -10
  92. package/build-module/store/selectors.js.map +1 -1
  93. package/build-style/style-rtl.css +14 -8
  94. package/build-style/style.css +14 -8
  95. package/package.json +13 -13
  96. package/src/components/complementary-area/README.md +1 -1
  97. package/src/components/complementary-area/index.js +18 -2
  98. package/src/components/complementary-area-toggle/index.js +1 -1
  99. package/src/components/interface-skeleton/index.js +2 -0
  100. package/src/components/interface-skeleton/style.scss +6 -0
  101. package/src/components/more-menu-feature-toggle/index.js +1 -1
  102. package/src/components/pinned-items/style.scss +12 -10
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/store/reducer.js"],"names":["combineReducers","complementaryAreas","state","action","type","scope","area","activeModal","name"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA,OAAO,SAASC,kBAAT,CAA6BC,KAAK,GAAG,EAArC,EAAyCC,MAAzC,EAAkD;AACxD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,gCAAL;AAAuC;AACtC,cAAM;AAAEC,UAAAA,KAAF;AAASC,UAAAA;AAAT,YAAkBH,MAAxB,CADsC,CAGtC;;AACA,YAAKD,KAAK,CAAEG,KAAF,CAAV,EAAsB;AACrB,iBAAOH,KAAP;AACA;;AAED,eAAO,EACN,GAAGA,KADG;AAEN,WAAEG,KAAF,GAAWC;AAFL,SAAP;AAIA;;AACD,SAAK,2BAAL;AAAkC;AACjC,cAAM;AAAED,UAAAA,KAAF;AAASC,UAAAA;AAAT,YAAkBH,MAAxB;AACA,eAAO,EACN,GAAGD,KADG;AAEN,WAAEG,KAAF,GAAWC;AAFL,SAAP;AAIA;AApBF;;AAuBA,SAAOJ,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASK,WAAT,CAAsBL,KAAK,GAAG,IAA9B,EAAoCC,MAApC,EAA6C;AACnD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,YAAL;AACC,aAAOD,MAAM,CAACK,IAAd;;AACD,SAAK,aAAL;AACC,aAAO,IAAP;AAJF;;AAOA,SAAON,KAAP;AACA;AAED,eAAeF,eAAe,CAAE;AAC/BC,EAAAA,kBAD+B;AAE/BM,EAAAA;AAF+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function complementaryAreas( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_DEFAULT_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\n\t\t\t// If there's already an area, don't overwrite it.\n\t\t\tif ( state[ scope ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t\tcase 'ENABLE_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for storing the name of the open modal, or null if no modal is open.\n *\n * @param {Object} state Previous state.\n * @param {Object} action Action object containing the `name` of the modal\n *\n * @return {Object} Updated state\n */\nexport function activeModal( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_MODAL':\n\t\t\treturn action.name;\n\t\tcase 'CLOSE_MODAL':\n\t\t\treturn null;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tcomplementaryAreas,\n\tactiveModal,\n} );\n"]}
1
+ {"version":3,"names":["combineReducers","complementaryAreas","state","action","type","scope","area","activeModal","name"],"sources":["@wordpress/interface/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function complementaryAreas( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_DEFAULT_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\n\t\t\t// If there's already an area, don't overwrite it.\n\t\t\tif ( state[ scope ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t\tcase 'ENABLE_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for storing the name of the open modal, or null if no modal is open.\n *\n * @param {Object} state Previous state.\n * @param {Object} action Action object containing the `name` of the modal\n *\n * @return {Object} Updated state\n */\nexport function activeModal( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_MODAL':\n\t\t\treturn action.name;\n\t\tcase 'CLOSE_MODAL':\n\t\t\treturn null;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tcomplementaryAreas,\n\tactiveModal,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;AAEjD,OAAO,SAASC,kBAAkBA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EACxD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,gCAAgC;MAAE;QACtC,MAAM;UAAEC,KAAK;UAAEC;QAAK,CAAC,GAAGH,MAAM;;QAE9B;QACA,IAAKD,KAAK,CAAEG,KAAK,CAAE,EAAG;UACrB,OAAOH,KAAK;QACb;QAEA,OAAO;UACN,GAAGA,KAAK;UACR,CAAEG,KAAK,GAAIC;QACZ,CAAC;MACF;IACA,KAAK,2BAA2B;MAAE;QACjC,MAAM;UAAED,KAAK;UAAEC;QAAK,CAAC,GAAGH,MAAM;QAC9B,OAAO;UACN,GAAGD,KAAK;UACR,CAAEG,KAAK,GAAIC;QACZ,CAAC;MACF;EACD;EAEA,OAAOJ,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,WAAWA,CAAEL,KAAK,GAAG,IAAI,EAAEC,MAAM,EAAG;EACnD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,YAAY;MAChB,OAAOD,MAAM,CAACK,IAAI;IACnB,KAAK,aAAa;MACjB,OAAO,IAAI;EACb;EAEA,OAAON,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC,kBAAkB;EAClBM;AACD,CAAE,CAAC"}
@@ -4,6 +4,7 @@
4
4
  import { createRegistrySelector } from '@wordpress/data';
5
5
  import deprecated from '@wordpress/deprecated';
6
6
  import { store as preferencesStore } from '@wordpress/preferences';
7
+
7
8
  /**
8
9
  * Returns the complementary area that is active in a given scope.
9
10
  *
@@ -12,21 +13,20 @@ import { store as preferencesStore } from '@wordpress/preferences';
12
13
  *
13
14
  * @return {string | null | undefined} The complementary area that is active in the given scope.
14
15
  */
15
-
16
16
  export const getActiveComplementaryArea = createRegistrySelector(select => (state, scope) => {
17
- const isComplementaryAreaVisible = select(preferencesStore).get(scope, 'isComplementaryAreaVisible'); // Return `undefined` to indicate that the user has never toggled
17
+ const isComplementaryAreaVisible = select(preferencesStore).get(scope, 'isComplementaryAreaVisible');
18
+
19
+ // Return `undefined` to indicate that the user has never toggled
18
20
  // visibility, this is the vanilla default. Other code relies on this
19
21
  // nuance in the return value.
20
-
21
22
  if (isComplementaryAreaVisible === undefined) {
22
23
  return undefined;
23
- } // Return `null` to indicate the user hid the complementary area.
24
-
24
+ }
25
25
 
26
+ // Return `null` to indicate the user hid the complementary area.
26
27
  if (isComplementaryAreaVisible === false) {
27
28
  return null;
28
29
  }
29
-
30
30
  return state?.complementaryAreas?.[scope];
31
31
  });
32
32
  export const isComplementaryAreaLoading = createRegistrySelector(select => (state, scope) => {
@@ -34,6 +34,7 @@ export const isComplementaryAreaLoading = createRegistrySelector(select => (stat
34
34
  const identifier = state?.complementaryAreas?.[scope];
35
35
  return isVisible && identifier === undefined;
36
36
  });
37
+
37
38
  /**
38
39
  * Returns a boolean indicating if an item is pinned or not.
39
40
  *
@@ -43,13 +44,12 @@ export const isComplementaryAreaLoading = createRegistrySelector(select => (stat
43
44
  *
44
45
  * @return {boolean} True if the item is pinned and false otherwise.
45
46
  */
46
-
47
47
  export const isItemPinned = createRegistrySelector(select => (state, scope, item) => {
48
48
  var _pinnedItems$item;
49
-
50
49
  const pinnedItems = select(preferencesStore).get(scope, 'pinnedItems');
51
50
  return (_pinnedItems$item = pinnedItems?.[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true;
52
51
  });
52
+
53
53
  /**
54
54
  * Returns a boolean indicating whether a feature is active for a particular
55
55
  * scope.
@@ -60,7 +60,6 @@ export const isItemPinned = createRegistrySelector(select => (state, scope, item
60
60
  *
61
61
  * @return {boolean} Is the feature enabled?
62
62
  */
63
-
64
63
  export const isFeatureActive = createRegistrySelector(select => (state, scope, featureName) => {
65
64
  deprecated(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
66
65
  since: '6.0',
@@ -68,6 +67,7 @@ export const isFeatureActive = createRegistrySelector(select => (state, scope, f
68
67
  });
69
68
  return !!select(preferencesStore).get(scope, featureName);
70
69
  });
70
+
71
71
  /**
72
72
  * Returns true if a modal is active, or false otherwise.
73
73
  *
@@ -76,7 +76,6 @@ export const isFeatureActive = createRegistrySelector(select => (state, scope, f
76
76
  *
77
77
  * @return {boolean} Whether the modal is active.
78
78
  */
79
-
80
79
  export function isModalActive(state, modalName) {
81
80
  return state.activeModal === modalName;
82
81
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/store/selectors.js"],"names":["createRegistrySelector","deprecated","store","preferencesStore","getActiveComplementaryArea","select","state","scope","isComplementaryAreaVisible","get","undefined","complementaryAreas","isComplementaryAreaLoading","isVisible","identifier","isItemPinned","item","pinnedItems","isFeatureActive","featureName","since","alternative","isModalActive","modalName","activeModal"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAT,QAAuC,iBAAvC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,0BAA0B,GAAGJ,sBAAsB,CAC7DK,MAAF,IAAc,CAAEC,KAAF,EAASC,KAAT,KAAoB;AACjC,QAAMC,0BAA0B,GAAGH,MAAM,CAAEF,gBAAF,CAAN,CAA2BM,GAA3B,CAClCF,KADkC,EAElC,4BAFkC,CAAnC,CADiC,CAMjC;AACA;AACA;;AACA,MAAKC,0BAA0B,KAAKE,SAApC,EAAgD;AAC/C,WAAOA,SAAP;AACA,GAXgC,CAajC;;;AACA,MAAKF,0BAA0B,KAAK,KAApC,EAA4C;AAC3C,WAAO,IAAP;AACA;;AAED,SAAOF,KAAK,EAAEK,kBAAP,GAA6BJ,KAA7B,CAAP;AACA,CApB8D,CAAzD;AAuBP,OAAO,MAAMK,0BAA0B,GAAGZ,sBAAsB,CAC7DK,MAAF,IAAc,CAAEC,KAAF,EAASC,KAAT,KAAoB;AACjC,QAAMM,SAAS,GAAGR,MAAM,CAAEF,gBAAF,CAAN,CAA2BM,GAA3B,CACjBF,KADiB,EAEjB,4BAFiB,CAAlB;AAIA,QAAMO,UAAU,GAAGR,KAAK,EAAEK,kBAAP,GAA6BJ,KAA7B,CAAnB;AAEA,SAAOM,SAAS,IAAIC,UAAU,KAAKJ,SAAnC;AACA,CAT8D,CAAzD;AAYP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMK,YAAY,GAAGf,sBAAsB,CAC/CK,MAAF,IAAc,CAAEC,KAAF,EAASC,KAAT,EAAgBS,IAAhB,KAA0B;AAAA;;AACvC,QAAMC,WAAW,GAAGZ,MAAM,CAAEF,gBAAF,CAAN,CAA2BM,GAA3B,CACnBF,KADmB,EAEnB,aAFmB,CAApB;AAIA,8BAAOU,WAAW,GAAID,IAAJ,CAAlB,iEAAgC,IAAhC;AACA,CAPgD,CAA3C;AAUP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAME,eAAe,GAAGlB,sBAAsB,CAClDK,MAAF,IAAc,CAAEC,KAAF,EAASC,KAAT,EAAgBY,WAAhB,KAAiC;AAC9ClB,EAAAA,UAAU,CACR,kEADQ,EAET;AACCmB,IAAAA,KAAK,EAAE,KADR;AAECC,IAAAA,WAAW,EAAG;AAFf,GAFS,CAAV;AAQA,SAAO,CAAC,CAAEhB,MAAM,CAAEF,gBAAF,CAAN,CAA2BM,GAA3B,CAAgCF,KAAhC,EAAuCY,WAAvC,CAAV;AACA,CAXmD,CAA9C;AAcP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,aAAT,CAAwBhB,KAAxB,EAA+BiB,SAA/B,EAA2C;AACjD,SAAOjB,KAAK,CAACkB,WAAN,KAAsBD,SAA7B;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Returns the complementary area that is active in a given scope.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Item scope.\n *\n * @return {string | null | undefined} The complementary area that is active in the given scope.\n */\nexport const getActiveComplementaryArea = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tconst isComplementaryAreaVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\n\t\t// Return `undefined` to indicate that the user has never toggled\n\t\t// visibility, this is the vanilla default. Other code relies on this\n\t\t// nuance in the return value.\n\t\tif ( isComplementaryAreaVisible === undefined ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Return `null` to indicate the user hid the complementary area.\n\t\tif ( isComplementaryAreaVisible === false ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn state?.complementaryAreas?.[ scope ];\n\t}\n);\n\nexport const isComplementaryAreaLoading = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tconst isVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\t\tconst identifier = state?.complementaryAreas?.[ scope ];\n\n\t\treturn isVisible && identifier === undefined;\n\t}\n);\n\n/**\n * Returns a boolean indicating if an item is pinned or not.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Scope.\n * @param {string} item Item to check.\n *\n * @return {boolean} True if the item is pinned and false otherwise.\n */\nexport const isItemPinned = createRegistrySelector(\n\t( select ) => ( state, scope, item ) => {\n\t\tconst pinnedItems = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'pinnedItems'\n\t\t);\n\t\treturn pinnedItems?.[ item ] ?? true;\n\t}\n);\n\n/**\n * Returns a boolean indicating whether a feature 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} featureName The name of the feature.\n *\n * @return {boolean} Is the feature enabled?\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, scope, featureName ) => {\n\t\tdeprecated(\n\t\t\t`select( 'core/interface' ).isFeatureActive( scope, featureName )`,\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative: `select( 'core/preferences' ).get( scope, featureName )`,\n\t\t\t}\n\t\t);\n\n\t\treturn !! select( preferencesStore ).get( scope, featureName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport function isModalActive( state, modalName ) {\n\treturn state.activeModal === modalName;\n}\n"]}
1
+ {"version":3,"names":["createRegistrySelector","deprecated","store","preferencesStore","getActiveComplementaryArea","select","state","scope","isComplementaryAreaVisible","get","undefined","complementaryAreas","isComplementaryAreaLoading","isVisible","identifier","isItemPinned","item","_pinnedItems$item","pinnedItems","isFeatureActive","featureName","since","alternative","isModalActive","modalName","activeModal"],"sources":["@wordpress/interface/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Returns the complementary area that is active in a given scope.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Item scope.\n *\n * @return {string | null | undefined} The complementary area that is active in the given scope.\n */\nexport const getActiveComplementaryArea = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tconst isComplementaryAreaVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\n\t\t// Return `undefined` to indicate that the user has never toggled\n\t\t// visibility, this is the vanilla default. Other code relies on this\n\t\t// nuance in the return value.\n\t\tif ( isComplementaryAreaVisible === undefined ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Return `null` to indicate the user hid the complementary area.\n\t\tif ( isComplementaryAreaVisible === false ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn state?.complementaryAreas?.[ scope ];\n\t}\n);\n\nexport const isComplementaryAreaLoading = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tconst isVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\t\tconst identifier = state?.complementaryAreas?.[ scope ];\n\n\t\treturn isVisible && identifier === undefined;\n\t}\n);\n\n/**\n * Returns a boolean indicating if an item is pinned or not.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Scope.\n * @param {string} item Item to check.\n *\n * @return {boolean} True if the item is pinned and false otherwise.\n */\nexport const isItemPinned = createRegistrySelector(\n\t( select ) => ( state, scope, item ) => {\n\t\tconst pinnedItems = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'pinnedItems'\n\t\t);\n\t\treturn pinnedItems?.[ item ] ?? true;\n\t}\n);\n\n/**\n * Returns a boolean indicating whether a feature 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} featureName The name of the feature.\n *\n * @return {boolean} Is the feature enabled?\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, scope, featureName ) => {\n\t\tdeprecated(\n\t\t\t`select( 'core/interface' ).isFeatureActive( scope, featureName )`,\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative: `select( 'core/preferences' ).get( scope, featureName )`,\n\t\t\t}\n\t\t);\n\n\t\treturn !! select( preferencesStore ).get( scope, featureName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport function isModalActive( state, modalName ) {\n\treturn state.activeModal === modalName;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,iBAAiB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,GAAGJ,sBAAsB,CAC7DK,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,KAAM;EACjC,MAAMC,0BAA0B,GAAGH,MAAM,CAAEF,gBAAiB,CAAC,CAACM,GAAG,CAChEF,KAAK,EACL,4BACD,CAAC;;EAED;EACA;EACA;EACA,IAAKC,0BAA0B,KAAKE,SAAS,EAAG;IAC/C,OAAOA,SAAS;EACjB;;EAEA;EACA,IAAKF,0BAA0B,KAAK,KAAK,EAAG;IAC3C,OAAO,IAAI;EACZ;EAEA,OAAOF,KAAK,EAAEK,kBAAkB,GAAIJ,KAAK,CAAE;AAC5C,CACD,CAAC;AAED,OAAO,MAAMK,0BAA0B,GAAGZ,sBAAsB,CAC7DK,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,KAAM;EACjC,MAAMM,SAAS,GAAGR,MAAM,CAAEF,gBAAiB,CAAC,CAACM,GAAG,CAC/CF,KAAK,EACL,4BACD,CAAC;EACD,MAAMO,UAAU,GAAGR,KAAK,EAAEK,kBAAkB,GAAIJ,KAAK,CAAE;EAEvD,OAAOM,SAAS,IAAIC,UAAU,KAAKJ,SAAS;AAC7C,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,YAAY,GAAGf,sBAAsB,CAC/CK,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,EAAES,IAAI,KAAM;EAAA,IAAAC,iBAAA;EACvC,MAAMC,WAAW,GAAGb,MAAM,CAAEF,gBAAiB,CAAC,CAACM,GAAG,CACjDF,KAAK,EACL,aACD,CAAC;EACD,QAAAU,iBAAA,GAAOC,WAAW,GAAIF,IAAI,CAAE,cAAAC,iBAAA,cAAAA,iBAAA,GAAI,IAAI;AACrC,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,eAAe,GAAGnB,sBAAsB,CAClDK,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,EAAEa,WAAW,KAAM;EAC9CnB,UAAU,CACR,kEAAiE,EAClE;IACCoB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CACD,CAAC;EAED,OAAO,CAAC,CAAEjB,MAAM,CAAEF,gBAAiB,CAAC,CAACM,GAAG,CAAEF,KAAK,EAAEa,WAAY,CAAC;AAC/D,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,aAAaA,CAAEjB,KAAK,EAAEkB,SAAS,EAAG;EACjD,OAAOlB,KAAK,CAACmB,WAAW,KAAKD,SAAS;AACvC"}
@@ -320,6 +320,11 @@ body.is-fullscreen-mode .interface-interface-skeleton {
320
320
  overflow: auto;
321
321
  z-index: 20;
322
322
  }
323
+ @media (min-width: 782px) {
324
+ .interface-interface-skeleton__content {
325
+ z-index: auto;
326
+ }
327
+ }
323
328
 
324
329
  .interface-interface-skeleton__secondary-sidebar,
325
330
  .interface-interface-skeleton__sidebar {
@@ -466,21 +471,22 @@ body.is-fullscreen-mode .interface-interface-skeleton {
466
471
  gap: 4px;
467
472
  margin-left: -4px;
468
473
  }
469
- .interface-pinned-items .components-button:not(:first-child) {
470
- display: none;
471
- }
472
- @media (min-width: 600px) {
473
- .interface-pinned-items .components-button:not(:first-child) {
474
- display: flex;
475
- }
476
- }
477
474
  .interface-pinned-items .components-button {
475
+ display: none;
478
476
  margin: 0;
479
477
  }
478
+ .interface-pinned-items .components-button:nth-last-child(1), .interface-pinned-items .components-button:nth-last-child(2) {
479
+ display: flex;
480
+ }
480
481
  .interface-pinned-items .components-button svg {
481
482
  max-width: 24px;
482
483
  max-height: 24px;
483
484
  }
485
+ @media (min-width: 600px) {
486
+ .interface-pinned-items .components-button {
487
+ display: flex;
488
+ }
489
+ }
484
490
 
485
491
  @media (min-width: 600px) {
486
492
  .interface-preferences-modal {
@@ -320,6 +320,11 @@ body.is-fullscreen-mode .interface-interface-skeleton {
320
320
  overflow: auto;
321
321
  z-index: 20;
322
322
  }
323
+ @media (min-width: 782px) {
324
+ .interface-interface-skeleton__content {
325
+ z-index: auto;
326
+ }
327
+ }
323
328
 
324
329
  .interface-interface-skeleton__secondary-sidebar,
325
330
  .interface-interface-skeleton__sidebar {
@@ -466,21 +471,22 @@ body.is-fullscreen-mode .interface-interface-skeleton {
466
471
  gap: 4px;
467
472
  margin-right: -4px;
468
473
  }
469
- .interface-pinned-items .components-button:not(:first-child) {
470
- display: none;
471
- }
472
- @media (min-width: 600px) {
473
- .interface-pinned-items .components-button:not(:first-child) {
474
- display: flex;
475
- }
476
- }
477
474
  .interface-pinned-items .components-button {
475
+ display: none;
478
476
  margin: 0;
479
477
  }
478
+ .interface-pinned-items .components-button:nth-last-child(1), .interface-pinned-items .components-button:nth-last-child(2) {
479
+ display: flex;
480
+ }
480
481
  .interface-pinned-items .components-button svg {
481
482
  max-width: 24px;
482
483
  max-height: 24px;
483
484
  }
485
+ @media (min-width: 600px) {
486
+ .interface-pinned-items .components-button {
487
+ display: flex;
488
+ }
489
+ }
484
490
 
485
491
  @media (min-width: 600px) {
486
492
  .interface-preferences-modal {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/interface",
3
- "version": "5.16.0",
3
+ "version": "5.17.1",
4
4
  "description": "Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,17 +32,17 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.16.0",
35
- "@wordpress/a11y": "^3.39.0",
36
- "@wordpress/components": "^25.5.0",
37
- "@wordpress/compose": "^6.16.0",
38
- "@wordpress/data": "^9.9.0",
39
- "@wordpress/deprecated": "^3.39.0",
40
- "@wordpress/element": "^5.16.0",
41
- "@wordpress/i18n": "^4.39.0",
42
- "@wordpress/icons": "^9.30.0",
43
- "@wordpress/plugins": "^6.7.0",
44
- "@wordpress/preferences": "^3.16.0",
45
- "@wordpress/viewport": "^5.16.0",
35
+ "@wordpress/a11y": "^3.40.1",
36
+ "@wordpress/components": "^25.6.1",
37
+ "@wordpress/compose": "^6.17.1",
38
+ "@wordpress/data": "^9.10.1",
39
+ "@wordpress/deprecated": "^3.40.1",
40
+ "@wordpress/element": "^5.17.1",
41
+ "@wordpress/i18n": "^4.40.1",
42
+ "@wordpress/icons": "^9.31.1",
43
+ "@wordpress/plugins": "^6.8.1",
44
+ "@wordpress/preferences": "^3.17.1",
45
+ "@wordpress/viewport": "^5.17.1",
46
46
  "classnames": "^2.3.1"
47
47
  },
48
48
  "peerDependencies": {
@@ -52,5 +52,5 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  },
55
- "gitHead": "b898cf1dc8e70841d1647ea0994ac6278acc18a7"
55
+ "gitHead": "bb1fbf87bb0f451744530fc6a85de2dff1263bed"
56
56
  }
@@ -5,7 +5,7 @@ Multiple areas may be added in a given time, but only one is visible; the compon
5
5
 
6
6
  The contents passed to ComplementaryArea are rendered in the ComplementaryArea.Slot corresponding to their scope if the complementary area is enabled.
7
7
 
8
- Besides rendering the complimentary area, the component renders a button in `PinnedItems` that allows opening the complementary area. The button only appears if the complementary is marked as favorite. By default, the complementary area headers rendered contain a button to mark and unmark areas as favorites.
8
+ Besides rendering the complementary area, the component renders a button in `PinnedItems` that allows opening the complementary area. The button only appears if the complementary is marked as favorite. By default, the complementary area headers rendered contain a button to mark and unmark areas as favorites.
9
9
 
10
10
  ## Props
11
11
 
@@ -79,7 +79,15 @@ function useAdjustComplementaryListener(
79
79
  if ( isSmall !== previousIsSmall.current ) {
80
80
  previousIsSmall.current = isSmall;
81
81
  }
82
- }, [ isActive, isSmall, scope, identifier, activeArea ] );
82
+ }, [
83
+ isActive,
84
+ isSmall,
85
+ scope,
86
+ identifier,
87
+ activeArea,
88
+ disableComplementaryArea,
89
+ enableComplementaryArea,
90
+ ] );
83
91
  }
84
92
 
85
93
  function ComplementaryArea( {
@@ -145,7 +153,15 @@ function ComplementaryArea( {
145
153
  } else if ( activeArea === undefined && isSmall ) {
146
154
  disableComplementaryArea( scope, identifier );
147
155
  }
148
- }, [ activeArea, isActiveByDefault, scope, identifier, isSmall ] );
156
+ }, [
157
+ activeArea,
158
+ isActiveByDefault,
159
+ scope,
160
+ identifier,
161
+ isSmall,
162
+ enableComplementaryArea,
163
+ disableComplementaryArea,
164
+ ] );
149
165
 
150
166
  return (
151
167
  <>
@@ -24,7 +24,7 @@ function ComplementaryAreaToggle( {
24
24
  ( select ) =>
25
25
  select( interfaceStore ).getActiveComplementaryArea( scope ) ===
26
26
  identifier,
27
- [ identifier ]
27
+ [ identifier, scope ]
28
28
  );
29
29
  const { enableComplementaryArea, disableComplementaryArea } =
30
30
  useDispatch( interfaceStore );
@@ -52,6 +52,7 @@ function InterfaceSkeleton(
52
52
  secondarySidebar,
53
53
  notices,
54
54
  content,
55
+ contentProps,
55
56
  actions,
56
57
  labels,
57
58
  className,
@@ -150,6 +151,7 @@ function InterfaceSkeleton(
150
151
  <NavigableRegion
151
152
  className="interface-interface-skeleton__content"
152
153
  ariaLabel={ mergedLabels.body }
154
+ { ...contentProps }
153
155
  >
154
156
  { content }
155
157
  </NavigableRegion>
@@ -88,6 +88,12 @@ html.interface-interface-skeleton__html-container {
88
88
  // to "bleed" through the header.
89
89
  // See https://github.com/WordPress/gutenberg/issues/32631
90
90
  z-index: z-index(".interface-interface-skeleton__content");
91
+
92
+ // On Safari the z-index is not respected when the element is fixed.
93
+ // Setting it to auto fixes the problem
94
+ @include break-medium() {
95
+ z-index: auto;
96
+ }
91
97
  }
92
98
 
93
99
  .interface-interface-skeleton__secondary-sidebar,
@@ -24,7 +24,7 @@ export default function MoreMenuFeatureToggle( {
24
24
  const isActive = useSelect(
25
25
  ( select ) =>
26
26
  select( interfaceStore ).isFeatureActive( scope, feature ),
27
- [ feature ]
27
+ [ feature, scope ]
28
28
  );
29
29
  const { toggleFeature } = useDispatch( interfaceStore );
30
30
  const speakMessage = () => {
@@ -3,8 +3,19 @@
3
3
 
4
4
  // We intentionally hide pinned items (plugins) on mobile, and unhide them at desktop breakpoints.
5
5
  // Otherwise the list can wreak havoc on the layout.
6
- .components-button:not(:first-child) {
6
+ .components-button {
7
7
  display: none;
8
+ margin: 0;
9
+
10
+ &:nth-last-child(1),
11
+ &:nth-last-child(2) {
12
+ display: flex;
13
+ }
14
+
15
+ svg {
16
+ max-width: $icon-size;
17
+ max-height: $icon-size;
18
+ }
8
19
 
9
20
  @include break-small() {
10
21
  display: flex;
@@ -16,13 +27,4 @@
16
27
 
17
28
  // Account for larger grid from parent container gap.
18
29
  margin-right: -$grid-unit-05;
19
-
20
- .components-button {
21
- margin: 0;
22
-
23
- svg {
24
- max-width: $icon-size;
25
- max-height: $icon-size;
26
- }
27
- }
28
30
  }