@wordpress/edit-site 4.0.1-next.f435e9e01b.0 → 4.0.3-next.a55ed9455a.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 (175) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/build/components/add-new-template/new-template-part.js +4 -1
  3. package/build/components/add-new-template/new-template-part.js.map +1 -1
  4. package/build/components/app/index.js +20 -0
  5. package/build/components/app/index.js.map +1 -1
  6. package/build/components/editor/global-styles-renderer.js +7 -3
  7. package/build/components/editor/global-styles-renderer.js.map +1 -1
  8. package/build/components/editor/index.js +3 -18
  9. package/build/components/editor/index.js.map +1 -1
  10. package/build/components/error-boundary/index.js +11 -27
  11. package/build/components/error-boundary/index.js.map +1 -1
  12. package/build/components/error-boundary/warning.js +70 -0
  13. package/build/components/error-boundary/warning.js.map +1 -0
  14. package/build/components/global-styles/navigation-button.js +7 -27
  15. package/build/components/global-styles/navigation-button.js.map +1 -1
  16. package/build/components/global-styles/screen-block-list.js +31 -1
  17. package/build/components/global-styles/screen-block-list.js.map +1 -1
  18. package/build/components/global-styles/screen-typography.js.map +1 -1
  19. package/build/components/global-styles/typography-panel.js +5 -2
  20. package/build/components/global-styles/typography-panel.js.map +1 -1
  21. package/build/components/global-styles/use-global-styles-output.js +21 -4
  22. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  23. package/build/components/global-styles/utils.js +2 -2
  24. package/build/components/global-styles/utils.js.map +1 -1
  25. package/build/components/header/index.js +1 -1
  26. package/build/components/header/index.js.map +1 -1
  27. package/build/components/header/more-menu/index.js +9 -21
  28. package/build/components/header/more-menu/index.js.map +1 -1
  29. package/build/components/header/more-menu/site-export.js +1 -1
  30. package/build/components/header/more-menu/site-export.js.map +1 -1
  31. package/build/components/header/more-menu/welcome-guide-menu-item.js +4 -8
  32. package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -1
  33. package/build/components/keyboard-shortcuts/index.js +1 -1
  34. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  35. package/build/components/list/table.js +9 -20
  36. package/build/components/list/table.js.map +1 -1
  37. package/build/components/navigation-sidebar/navigation-panel/index.js +9 -3
  38. package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  39. package/build/components/navigation-sidebar/navigation-toggle/index.js +15 -4
  40. package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  41. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -11
  42. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  43. package/build/components/sidebar/global-styles-sidebar.js +5 -5
  44. package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
  45. package/build/components/template-part-converter/convert-to-template-part.js +4 -1
  46. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  47. package/build/components/welcome-guide/editor.js +6 -6
  48. package/build/components/welcome-guide/editor.js.map +1 -1
  49. package/build/components/welcome-guide/styles.js +6 -4
  50. package/build/components/welcome-guide/styles.js.map +1 -1
  51. package/build/index.js +22 -7
  52. package/build/index.js.map +1 -1
  53. package/build/store/actions.js +203 -163
  54. package/build/store/actions.js.map +1 -1
  55. package/build/store/index.js +3 -9
  56. package/build/store/index.js.map +1 -1
  57. package/build/store/reducer.js +0 -44
  58. package/build/store/reducer.js.map +1 -1
  59. package/build/store/selectors.js +33 -10
  60. package/build/store/selectors.js.map +1 -1
  61. package/build-module/components/add-new-template/new-template-part.js +4 -1
  62. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  63. package/build-module/components/app/index.js +16 -0
  64. package/build-module/components/app/index.js.map +1 -1
  65. package/build-module/components/editor/global-styles-renderer.js +6 -3
  66. package/build-module/components/editor/global-styles-renderer.js.map +1 -1
  67. package/build-module/components/editor/index.js +4 -17
  68. package/build-module/components/editor/index.js.map +1 -1
  69. package/build-module/components/error-boundary/index.js +9 -26
  70. package/build-module/components/error-boundary/index.js.map +1 -1
  71. package/build-module/components/error-boundary/warning.js +60 -0
  72. package/build-module/components/error-boundary/warning.js.map +1 -0
  73. package/build-module/components/global-styles/navigation-button.js +8 -28
  74. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  75. package/build-module/components/global-styles/screen-block-list.js +31 -2
  76. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  77. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  78. package/build-module/components/global-styles/typography-panel.js +6 -3
  79. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  80. package/build-module/components/global-styles/use-global-styles-output.js +20 -4
  81. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  82. package/build-module/components/global-styles/utils.js +2 -2
  83. package/build-module/components/global-styles/utils.js.map +1 -1
  84. package/build-module/components/header/index.js +1 -1
  85. package/build-module/components/header/index.js.map +1 -1
  86. package/build-module/components/header/more-menu/index.js +11 -22
  87. package/build-module/components/header/more-menu/index.js.map +1 -1
  88. package/build-module/components/header/more-menu/site-export.js +1 -1
  89. package/build-module/components/header/more-menu/site-export.js.map +1 -1
  90. package/build-module/components/header/more-menu/welcome-guide-menu-item.js +4 -8
  91. package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -1
  92. package/build-module/components/keyboard-shortcuts/index.js +1 -1
  93. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  94. package/build-module/components/list/table.js +9 -21
  95. package/build-module/components/list/table.js.map +1 -1
  96. package/build-module/components/navigation-sidebar/navigation-panel/index.js +9 -3
  97. package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  98. package/build-module/components/navigation-sidebar/navigation-toggle/index.js +12 -4
  99. package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  100. package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -12
  101. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  102. package/build-module/components/sidebar/global-styles-sidebar.js +4 -4
  103. package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
  104. package/build-module/components/template-part-converter/convert-to-template-part.js +4 -1
  105. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  106. package/build-module/components/welcome-guide/editor.js +5 -5
  107. package/build-module/components/welcome-guide/editor.js.map +1 -1
  108. package/build-module/components/welcome-guide/styles.js +5 -4
  109. package/build-module/components/welcome-guide/styles.js.map +1 -1
  110. package/build-module/index.js +20 -7
  111. package/build-module/index.js.map +1 -1
  112. package/build-module/store/actions.js +181 -154
  113. package/build-module/store/actions.js.map +1 -1
  114. package/build-module/store/index.js +4 -9
  115. package/build-module/store/index.js.map +1 -1
  116. package/build-module/store/reducer.js +0 -40
  117. package/build-module/store/reducer.js.map +1 -1
  118. package/build-module/store/selectors.js +28 -10
  119. package/build-module/store/selectors.js.map +1 -1
  120. package/build-style/style-rtl.css +101 -38
  121. package/build-style/style.css +101 -38
  122. package/package.json +33 -27
  123. package/src/components/add-new-template/new-template-part.js +7 -1
  124. package/src/components/app/index.js +19 -0
  125. package/src/components/editor/global-styles-renderer.js +7 -1
  126. package/src/components/editor/index.js +2 -20
  127. package/src/components/error-boundary/index.js +11 -28
  128. package/src/components/error-boundary/warning.js +59 -0
  129. package/src/components/global-styles/navigation-button.js +6 -25
  130. package/src/components/global-styles/screen-block-list.js +27 -2
  131. package/src/components/global-styles/screen-typography.js +1 -2
  132. package/src/components/global-styles/typography-panel.js +12 -5
  133. package/src/components/global-styles/use-global-styles-output.js +19 -3
  134. package/src/components/global-styles/utils.js +2 -2
  135. package/src/components/header/index.js +1 -1
  136. package/src/components/header/more-menu/index.js +12 -29
  137. package/src/components/header/more-menu/site-export.js +1 -1
  138. package/src/components/header/more-menu/welcome-guide-menu-item.js +3 -7
  139. package/src/components/keyboard-shortcuts/index.js +1 -1
  140. package/src/components/list/table.js +18 -23
  141. package/src/components/navigation-sidebar/navigation-panel/index.js +16 -11
  142. package/src/components/navigation-sidebar/navigation-toggle/index.js +13 -4
  143. package/src/components/navigation-sidebar/navigation-toggle/style.scss +32 -31
  144. package/src/components/navigation-sidebar/navigation-toggle/test/index.js +1 -1
  145. package/src/components/secondary-sidebar/list-view-sidebar.js +1 -11
  146. package/src/components/sidebar/global-styles-sidebar.js +6 -3
  147. package/src/components/sidebar/style.scss +1 -1
  148. package/src/components/template-part-converter/convert-to-template-part.js +6 -1
  149. package/src/components/welcome-guide/editor.js +8 -4
  150. package/src/components/welcome-guide/styles.js +5 -3
  151. package/src/index.js +25 -7
  152. package/src/store/actions.js +180 -215
  153. package/src/store/index.js +2 -8
  154. package/src/store/reducer.js +0 -30
  155. package/src/store/selectors.js +37 -10
  156. package/src/store/test/actions.js +203 -92
  157. package/src/store/test/reducer.js +0 -22
  158. package/src/store/test/selectors.js +22 -53
  159. package/src/style.scss +0 -1
  160. package/build/components/header/feature-toggle/index.js +0 -66
  161. package/build/components/header/feature-toggle/index.js.map +0 -1
  162. package/build/components/routes/redirect-to-homepage.js +0 -87
  163. package/build/components/routes/redirect-to-homepage.js.map +0 -1
  164. package/build/store/defaults.js +0 -15
  165. package/build/store/defaults.js.map +0 -1
  166. package/build-module/components/header/feature-toggle/index.js +0 -52
  167. package/build-module/components/header/feature-toggle/index.js.map +0 -1
  168. package/build-module/components/routes/redirect-to-homepage.js +0 -75
  169. package/build-module/components/routes/redirect-to-homepage.js.map +0 -1
  170. package/build-module/store/defaults.js +0 -8
  171. package/build-module/store/defaults.js.map +0 -1
  172. package/src/components/header/feature-toggle/index.js +0 -55
  173. package/src/components/header/more-menu/style.scss +0 -29
  174. package/src/components/routes/redirect-to-homepage.js +0 -71
  175. package/src/store/defaults.js +0 -7
@@ -6,46 +6,7 @@ import { combineReducers } from '@wordpress/data';
6
6
  * Internal dependencies
7
7
  */
8
8
 
9
- import { PREFERENCES_DEFAULTS } from './defaults';
10
9
  import { MENU_ROOT } from '../components/navigation-sidebar/navigation-panel/constants';
11
- /**
12
- * Reducer returning the user preferences.
13
- *
14
- * @param {Object} state Current state.
15
- * @param {Object} action Dispatched action.
16
- * @return {Object} Updated state.
17
- */
18
-
19
- export const preferences = combineReducers({
20
- features() {
21
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PREFERENCES_DEFAULTS.features;
22
- let action = arguments.length > 1 ? arguments[1] : undefined;
23
-
24
- switch (action.type) {
25
- case 'TOGGLE_FEATURE':
26
- {
27
- return { ...state,
28
- [action.feature]: !state[action.feature]
29
- };
30
- }
31
-
32
- default:
33
- return state;
34
- }
35
- },
36
-
37
- editorMode() {
38
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PREFERENCES_DEFAULTS.editorMode;
39
- let action = arguments.length > 1 ? arguments[1] : undefined;
40
-
41
- if (action.type === 'SWITCH_MODE') {
42
- return action.mode;
43
- }
44
-
45
- return state;
46
- }
47
-
48
- });
49
10
  /**
50
11
  * Reducer returning the editing canvas device type.
51
12
  *
@@ -250,7 +211,6 @@ export function listViewPanel() {
250
211
  return state;
251
212
  }
252
213
  export default combineReducers({
253
- preferences,
254
214
  deviceType,
255
215
  settings,
256
216
  editedPost,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/reducer.js"],"names":["combineReducers","PREFERENCES_DEFAULTS","MENU_ROOT","preferences","features","state","action","type","feature","editorMode","mode","deviceType","settings","editedPost","id","templateId","page","templatePartId","homeTemplateId","navigationPanel","menu","isOpen","value","blockInserterPanel","listViewPanel"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,YAArC;AACA,SAASC,SAAT,QAA0B,6DAA1B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,WAAW,GAAGH,eAAe,CAAE;AAC3CI,EAAAA,QAAQ,GAAkD;AAAA,QAAhDC,KAAgD,uEAAxCJ,oBAAoB,CAACG,QAAmB;AAAA,QAATE,MAAS;;AACzD,YAASA,MAAM,CAACC,IAAhB;AACC,WAAK,gBAAL;AAAuB;AACtB,iBAAO,EACN,GAAGF,KADG;AAEN,aAAEC,MAAM,CAACE,O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H+B;AAI/BC,EAAAA,UAJ+B;AAK/BK,EAAAA,cAL+B;AAM/BC,EAAAA,eAN+B;AAO/BI,EAAAA,kBAP+B;AAQ/BC,EAAAA;AAR+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { PREFERENCES_DEFAULTS } from './defaults';\nimport { MENU_ROOT } from '../components/navigation-sidebar/navigation-panel/constants';\n\n/**\n * Reducer returning the user preferences.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n * @return {Object} Updated state.\n */\nexport const preferences = combineReducers( {\n\tfeatures( state = PREFERENCES_DEFAULTS.features, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'TOGGLE_FEATURE': {\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\t[ action.feature ]: ! state[ action.feature ],\n\t\t\t\t};\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn state;\n\t\t}\n\t},\n\teditorMode( state = PREFERENCES_DEFAULTS.editorMode, action ) {\n\t\tif ( action.type === 'SWITCH_MODE' ) {\n\t\t\treturn action.mode;\n\t\t}\n\t\treturn state;\n\t},\n} );\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_TEMPLATE':\n\t\tcase 'SET_PAGE':\n\t\t\treturn {\n\t\t\t\ttype: 'wp_template',\n\t\t\t\tid: action.templateId,\n\t\t\t\tpage: action.page,\n\t\t\t};\n\t\tcase 'SET_TEMPLATE_PART':\n\t\t\treturn {\n\t\t\t\ttype: 'wp_template_part',\n\t\t\t\tid: action.templatePartId,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for information about the site's homepage.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function homeTemplateId( state, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_HOME_TEMPLATE':\n\t\t\treturn action.homeTemplateId;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for information about the navigation panel, such as its active menu\n * and whether it should be opened or closed.\n *\n * Note: this reducer interacts with the inserter and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function navigationPanel(\n\tstate = { menu: MENU_ROOT, isOpen: false },\n\taction\n) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_NAVIGATION_PANEL_ACTIVE_MENU':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: action.menu,\n\t\t\t};\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisOpen: true,\n\t\t\t\tmenu: action.menu,\n\t\t\t};\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: ! action.isOpen ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.isOpen,\n\t\t\t};\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: state.isOpen && action.isOpen ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.isOpen ? false : state.isOpen,\n\t\t\t};\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: state.isOpen && action.value ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.value ? false : state.isOpen,\n\t\t\t};\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn false;\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn false;\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tpreferences,\n\tdeviceType,\n\tsettings,\n\teditedPost,\n\thomeTemplateId,\n\tnavigationPanel,\n\tblockInserterPanel,\n\tlistViewPanel,\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/reducer.js"],"names":["combineReducers","MENU_ROOT","deviceType","state","action","type","settings","editedPost","id","templateId","page","templatePartId","homeTemplateId","navigationPanel","menu","isOpen","value","blockInserterPanel","listViewPanel"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,6DAA1B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,UAAT,GAAiD;AAAA,MAA5BC,KAA4B,uEAApB,SAAoB;AAAA,MAATC,MAAS;;AACvD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,yBAAL;AACC,aAAOD,MAAM,CAACF,UAAd;AAFF;;AAKA,SAAOC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,QAAT,GAAwC;AAAA,MAArBH,KAAqB,uEAAb,EAAa;AAAA,MAATC,MAAS;;AAC9C,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,iBAAL;AACC,aAAO,EACN,GAAGF,KADG;AAEN,WAAGC,MAAM,CAACE;AAFJ,OAAP;AAFF;;AAQA,SAAOH,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASI,UAAT,GAA0C;AAAA,MAArBJ,KAAqB,uEAAb,EAAa;AAAA,MAATC,MAAS;;AAChD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,cAAL;AACA,SAAK,UAAL;AACC,aAAO;AACNA,QAAAA,IAAI,EAAE,aADA;AAENG,QAAAA,EAAE,EAAEJ,MAAM,CAACK,UAFL;AAGNC,QAAAA,IAAI,EAAEN,MAAM,CAAC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EAAAA,QAF+B;AAG/BC,EAAAA,UAH+B;AAI/BK,EAAAA,cAJ+B;AAK/BC,EAAAA,eAL+B;AAM/BI,EAAAA,kBAN+B;AAO/BC,EAAAA;AAP+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { MENU_ROOT } from '../components/navigation-sidebar/navigation-panel/constants';\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_TEMPLATE':\n\t\tcase 'SET_PAGE':\n\t\t\treturn {\n\t\t\t\ttype: 'wp_template',\n\t\t\t\tid: action.templateId,\n\t\t\t\tpage: action.page,\n\t\t\t};\n\t\tcase 'SET_TEMPLATE_PART':\n\t\t\treturn {\n\t\t\t\ttype: 'wp_template_part',\n\t\t\t\tid: action.templatePartId,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for information about the site's homepage.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function homeTemplateId( state, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_HOME_TEMPLATE':\n\t\t\treturn action.homeTemplateId;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for information about the navigation panel, such as its active menu\n * and whether it should be opened or closed.\n *\n * Note: this reducer interacts with the inserter and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function navigationPanel(\n\tstate = { menu: MENU_ROOT, isOpen: false },\n\taction\n) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_NAVIGATION_PANEL_ACTIVE_MENU':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: action.menu,\n\t\t\t};\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisOpen: true,\n\t\t\t\tmenu: action.menu,\n\t\t\t};\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: ! action.isOpen ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.isOpen,\n\t\t\t};\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: state.isOpen && action.isOpen ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.isOpen ? false : state.isOpen,\n\t\t\t};\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenu: state.isOpen && action.value ? MENU_ROOT : state.menu, // Set menu to root when closing panel.\n\t\t\t\tisOpen: action.value ? false : state.isOpen,\n\t\t\t};\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn false;\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_NAVIGATION_PANEL_TO_MENU':\n\t\t\treturn false;\n\t\tcase 'SET_IS_NAVIGATION_PANEL_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tdeviceType,\n\tsettings,\n\teditedPost,\n\thomeTemplateId,\n\tnavigationPanel,\n\tblockInserterPanel,\n\tlistViewPanel,\n} );\n"]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { get, map, keyBy } from 'lodash';
4
+ import { map, keyBy } from 'lodash';
5
5
  import createSelector from 'rememo';
6
6
  /**
7
7
  * WordPress dependencies
@@ -9,9 +9,11 @@ import createSelector from 'rememo';
9
9
 
10
10
  import { store as coreDataStore } from '@wordpress/core-data';
11
11
  import { createRegistrySelector } from '@wordpress/data';
12
+ import deprecated from '@wordpress/deprecated';
12
13
  import { uploadMedia } from '@wordpress/media-utils';
13
14
  import { isTemplatePart } from '@wordpress/blocks';
14
15
  import { Platform } from '@wordpress/element';
16
+ import { store as preferencesStore } from '@wordpress/preferences';
15
17
  /**
16
18
  * Internal dependencies
17
19
  */
@@ -22,17 +24,32 @@ import { getTemplateLocation, isTemplateSuperseded } from '../components/navigat
22
24
  * @typedef {'template'|'template_type'} TemplateType Template type.
23
25
  */
24
26
 
27
+ /**
28
+ * Helper for getting a preference from the preferences store.
29
+ *
30
+ * This is only present so that `getSettings` doesn't need to be made a
31
+ * registry selector.
32
+ *
33
+ * It's unstable because the selector needs to be exported and so part of the
34
+ * public API to work.
35
+ */
36
+
37
+ export const __unstableGetPreference = createRegistrySelector(select => (state, name) => select(preferencesStore).get('core/edit-site', name));
25
38
  /**
26
39
  * Returns whether the given feature is enabled or not.
27
40
  *
28
- * @param {Object} state Global application state.
29
- * @param {string} feature Feature slug.
41
+ * @param {Object} state Global application state.
42
+ * @param {string} featureName Feature slug.
30
43
  *
31
44
  * @return {boolean} Is active.
32
45
  */
33
46
 
34
- export function isFeatureActive(state, feature) {
35
- return get(state.preferences.features, [feature], false);
47
+ export function isFeatureActive(state, featureName) {
48
+ deprecated(`select( 'core/interface' ).isFeatureActive`, {
49
+ since: '6.0',
50
+ alternative: `select( 'core/preferences' ).get`
51
+ });
52
+ return !!__unstableGetPreference(state, featureName);
36
53
  }
37
54
  /**
38
55
  * Returns the current editing canvas device type.
@@ -80,10 +97,11 @@ export const getReusableBlocks = createRegistrySelector(select => () => {
80
97
  export const getSettings = createSelector((state, setIsInserterOpen) => {
81
98
  const settings = { ...state.settings,
82
99
  outlineMode: true,
83
- focusMode: isFeatureActive(state, 'focusMode'),
84
- hasFixedToolbar: isFeatureActive(state, 'fixedToolbar'),
100
+ focusMode: !!__unstableGetPreference(state, 'focusMode'),
101
+ hasFixedToolbar: !!__unstableGetPreference(state, 'fixedToolbar'),
85
102
  __experimentalSetIsInserterOpened: setIsInserterOpen,
86
- __experimentalReusableBlocks: getReusableBlocks(state)
103
+ __experimentalReusableBlocks: getReusableBlocks(state),
104
+ __experimentalPreferPatternsOnRoot: 'wp_template' === getEditedPostType(state)
87
105
  };
88
106
  const canUserCreateMedia = getCanUserCreateMedia(state);
89
107
 
@@ -109,7 +127,7 @@ export const getSettings = createSelector((state, setIsInserterOpen) => {
109
127
  };
110
128
 
111
129
  return settings;
112
- }, state => [getCanUserCreateMedia(state), state.settings, isFeatureActive(state, 'focusMode'), isFeatureActive(state, 'fixedToolbar'), getReusableBlocks(state)]);
130
+ }, state => [getCanUserCreateMedia(state), state.settings, __unstableGetPreference(state, 'focusMode'), __unstableGetPreference(state, 'fixedToolbar'), getReusableBlocks(state), getEditedPostType(state)]);
113
131
  /**
114
132
  * Returns the current home template ID.
115
133
  *
@@ -302,6 +320,6 @@ export const getCurrentTemplateTemplateParts = createRegistrySelector(select =>
302
320
  */
303
321
 
304
322
  export function getEditorMode(state) {
305
- return state.preferences.editorMode || 'visual';
323
+ return __unstableGetPreference(state, 'editorMode');
306
324
  }
307
325
  //# sourceMappingURL=selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["get","map","keyBy","createSelector","store","coreDataStore","createRegistrySelector","uploadMedia","isTemplatePart","Platform","MENU_ROOT","MENU_TEMPLATE_PARTS","MENU_TEMPLATES_UNUSED","TEMPLATE_PARTS_SUB_MENUS","getTemplateLocation","isTemplateSuperseded","isFeatureActive","state","feature","preferences","features","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","select","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","hasFixedToolbar","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","homeTemplateId","getCurrentEditedPost","editedPost","getEditedPostType","type","getEditedPostId","id","getPage","page","getNavigationPanelActiveMenu","navigationPanel","menu","getCurrentTemplateNavigationPanelSubMenu","templateType","templateId","template","getEntityRecord","find","submenu","area","templates","showOnFront","getEditedEntityRecord","show_on_front","slug","isNavigationOpened","isOpen","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","getCurrentTemplateTemplateParts","templateParts","templatePartsById","templatePart","blocks","filter","block","attributes","theme","templatePartId","getEditorMode","editorMode"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,GAAd,EAAmBC,KAAnB,QAAgC,QAAhC;AACA,OAAOC,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,SACCC,SADD,EAECC,mBAFD,EAGCC,qBAHD,EAICC,wBAJD,QAKO,6DALP;AAMA,SACCC,mBADD,EAECC,oBAFD,QAGO,sEAHP;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,eAAT,CAA0BC,KAA1B,EAAiCC,OAAjC,EAA2C;AACjD,SAAOlB,GAAG,CAAEiB,KAAK,CAACE,WAAN,CAAkBC,QAApB,EAA8B,CAAEF,OAAF,CAA9B,EAA2C,KAA3C,CAAV;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,kCAAT,CAA6CJ,KAA7C,EAAqD;AAC3D,SAAOA,KAAK,CAACK,UAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAGjB,sBAAsB,CAAIkB,MAAF,IAAc,MAC1EA,MAAM,CAAEnB,aAAF,CAAN,CAAwBoB,OAAxB,CAAiC,QAAjC,EAA2C,OAA3C,CAD0D,CAApD;AAIP;AACA;AACA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nB,QAAAA;AAAT;AADP,QAEFiB,KAFJ;AAGA,UAAMG,cAAc,GAAI,GAAGD,KAAO,KAAKnB,IAAM,EAA7C;AACA,UAAMc,YAAY,GAAGD,iBAAiB,CAAEO,cAAF,CAAtC;AAEA,WAAO;AACNN,MAAAA,YADM;AAENG,MAAAA;AAFM,KAAP;AAIA,GAbK,EAcLD,MAdK,CAcG;AAAA,QAAE;AAAEF,MAAAA;AAAF,KAAF;AAAA,WAAwB,CAAC,CAAEA,YAA3B;AAAA,GAdH,CAAP;AAeA,CAjCmE,CAA9D;AAoCP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASO,aAAT,CAAwB3E,KAAxB,EAAgC;AACtC,SAAOA,KAAK,CAACE,WAAN,CAAkB0E,UAAlB,IAAgC,QAAvC;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get, map, keyBy } from 'lodash';\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { isTemplatePart } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMENU_ROOT,\n\tMENU_TEMPLATE_PARTS,\n\tMENU_TEMPLATES_UNUSED,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../components/navigation-sidebar/navigation-panel/constants';\nimport {\n\tgetTemplateLocation,\n\tisTemplateSuperseded,\n} from '../components/navigation-sidebar/navigation-panel/template-hierarchy';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, feature ) {\n\treturn get( state.preferences.features, [ feature ], false );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector( ( select ) => () =>\n\tselect( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: isFeatureActive( state, 'focusMode' ),\n\t\t\thasFixedToolbar: isFeatureActive( state, 'fixedToolbar' ),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\tisFeatureActive( state, 'focusMode' ),\n\t\tisFeatureActive( state, 'fixedToolbar' ),\n\t\tgetReusableBlocks( state ),\n\t]\n);\n\n/**\n * Returns the current home template ID.\n *\n * @param {Object} state Global application state.\n *\n * @return {number?} Home template ID.\n */\nexport function getHomeTemplateId( state ) {\n\treturn state.homeTemplateId;\n}\n\nfunction getCurrentEditedPost( state ) {\n\treturn state.editedPost;\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn getCurrentEditedPost( state ).type;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn getCurrentEditedPost( state ).id;\n}\n\n/**\n * Returns the current page object.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn getCurrentEditedPost( state ).page;\n}\n\n/**\n * Returns the active menu in the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Active menu.\n */\nexport function getNavigationPanelActiveMenu( state ) {\n\treturn state.navigationPanel.menu;\n}\n\n/**\n * Returns the current template or template part's corresponding\n * navigation panel's sub menu, to be used with `openNavigationPanelToMenu`.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} The current template or template part's sub menu.\n */\nexport const getCurrentTemplateNavigationPanelSubMenu = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = templateId\n\t\t\t? select( coreDataStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplateType,\n\t\t\t\t\ttemplateId\n\t\t\t )\n\t\t\t: null;\n\n\t\tif ( ! template ) {\n\t\t\treturn MENU_ROOT;\n\t\t}\n\n\t\tif ( 'wp_template_part' === templateType ) {\n\t\t\treturn (\n\t\t\t\tTEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t\t\t( submenu ) => submenu.area === template?.area\n\t\t\t\t)?.menu || MENU_TEMPLATE_PARTS\n\t\t\t);\n\t\t}\n\n\t\tconst templates = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template'\n\t\t);\n\t\tconst showOnFront = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'root',\n\t\t\t'site'\n\t\t).show_on_front;\n\n\t\tif (\n\t\t\tisTemplateSuperseded(\n\t\t\t\ttemplate.slug,\n\t\t\t\tmap( templates, 'slug' ),\n\t\t\t\tshowOnFront\n\t\t\t)\n\t\t) {\n\t\t\treturn MENU_TEMPLATES_UNUSED;\n\t\t}\n\n\t\treturn getTemplateLocation( template.slug );\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the navigation panel should be open; false if closed.\n */\nexport function isNavigationOpened( state ) {\n\treturn state.navigationPanel.isOpen;\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst {\n\t\trootClientId,\n\t\tinsertionIndex,\n\t\tfilterValue,\n\t} = state.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\ttemplateType,\n\t\t\ttemplateId\n\t\t);\n\n\t\tconst templateParts = select(\n\t\t\tcoreDataStore\n\t\t).getEntityRecords( 'postType', 'wp_template_part', { per_page: -1 } );\n\t\tconst templatePartsById = keyBy(\n\t\t\ttemplateParts,\n\t\t\t( templatePart ) => templatePart.id\n\t\t);\n\n\t\treturn ( template.blocks ?? [] )\n\t\t\t.filter( ( block ) => isTemplatePart( block ) )\n\t\t\t.map( ( block ) => {\n\t\t\t\tconst {\n\t\t\t\t\tattributes: { theme, slug },\n\t\t\t\t} = block;\n\t\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t\treturn {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t};\n\t\t\t} )\n\t\t\t.filter( ( { templatePart } ) => !! templatePart );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn state.preferences.editorMode || 'visual';\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["map","keyBy","createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","isTemplatePart","Platform","preferencesStore","MENU_ROOT","MENU_TEMPLATE_PARTS","MENU_TEMPLATES_UNUSED","TEMPLATE_PARTS_SUB_MENUS","getTemplateLocation","isTemplateSuperseded","__unstableGetPreference","select","state","name","get","isFeatureActive","featureName","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","hasFixedToolbar","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","homeTemplateId","getCurrentEditedPost","editedPost","type","getEditedPostId","id","getPage","page","getNavigationPanelActiveMenu","navigationPanel","menu","getCurrentTemplateNavigationPanelSubMenu","templateType","templateId","template","getEntityRecord","find","submenu","area","templates","showOnFront","getEditedEntityRecord","show_on_front","slug","isNavigationOpened","isOpen","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","getCurrentTemplateTemplateParts","templateParts","templatePartsById","templatePart","blocks","filter","block","attributes","theme","templatePartId","getEditorMode"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,KAAd,QAA2B,QAA3B;AACA,OAAOC,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASN,KAAK,IAAIO,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SACCC,SADD,EAECC,mBAFD,EAGCC,qBAHD,EAICC,wBAJD,QAKO,6DALP;AAMA,SACCC,mBADD,EAECC,oBAFD,QAGO,sEAHP;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,uBAAuB,GAAGZ,sBAAsB,CAC1Da,MAAF,IAAc,CAAEC,KAAF,EAASC,IAAT,KACbF,MAAM,CAAER,gBAAF,CAAN,CAA2BW,GAA3B,CAAgC,gBAAhC,EAAkDD,IAAlD,CAF2D,CAAtD;AAKP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,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ependencies\n */\nimport { map, keyBy } from 'lodash';\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { isTemplatePart } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMENU_ROOT,\n\tMENU_TEMPLATE_PARTS,\n\tMENU_TEMPLATES_UNUSED,\n\tTEMPLATE_PARTS_SUB_MENUS,\n} from '../components/navigation-sidebar/navigation-panel/constants';\nimport {\n\tgetTemplateLocation,\n\tisTemplateSuperseded,\n} from '../components/navigation-sidebar/navigation-panel/template-hierarchy';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Helper for getting a preference from the preferences store.\n *\n * This is only present so that `getSettings` doesn't need to be made a\n * registry selector.\n *\n * It's unstable because the selector needs to be exported and so part of the\n * public API to work.\n */\nexport const __unstableGetPreference = createRegistrySelector(\n\t( select ) => ( state, name ) =>\n\t\tselect( preferencesStore ).get( 'core/edit-site', name )\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, featureName ) {\n\tdeprecated( `select( 'core/interface' ).isFeatureActive`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\treturn !! __unstableGetPreference( state, featureName );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector( ( select ) => () =>\n\tselect( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: !! __unstableGetPreference( state, 'focusMode' ),\n\t\t\thasFixedToolbar: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\t'wp_template' === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\t__unstableGetPreference( state, 'focusMode' ),\n\t\t__unstableGetPreference( state, 'fixedToolbar' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * Returns the current home template ID.\n *\n * @param {Object} state Global application state.\n *\n * @return {number?} Home template ID.\n */\nexport function getHomeTemplateId( state ) {\n\treturn state.homeTemplateId;\n}\n\nfunction getCurrentEditedPost( state ) {\n\treturn state.editedPost;\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn getCurrentEditedPost( state ).type;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn getCurrentEditedPost( state ).id;\n}\n\n/**\n * Returns the current page object.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn getCurrentEditedPost( state ).page;\n}\n\n/**\n * Returns the active menu in the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Active menu.\n */\nexport function getNavigationPanelActiveMenu( state ) {\n\treturn state.navigationPanel.menu;\n}\n\n/**\n * Returns the current template or template part's corresponding\n * navigation panel's sub menu, to be used with `openNavigationPanelToMenu`.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} The current template or template part's sub menu.\n */\nexport const getCurrentTemplateNavigationPanelSubMenu = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = templateId\n\t\t\t? select( coreDataStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplateType,\n\t\t\t\t\ttemplateId\n\t\t\t )\n\t\t\t: null;\n\n\t\tif ( ! template ) {\n\t\t\treturn MENU_ROOT;\n\t\t}\n\n\t\tif ( 'wp_template_part' === templateType ) {\n\t\t\treturn (\n\t\t\t\tTEMPLATE_PARTS_SUB_MENUS.find(\n\t\t\t\t\t( submenu ) => submenu.area === template?.area\n\t\t\t\t)?.menu || MENU_TEMPLATE_PARTS\n\t\t\t);\n\t\t}\n\n\t\tconst templates = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template'\n\t\t);\n\t\tconst showOnFront = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'root',\n\t\t\t'site'\n\t\t).show_on_front;\n\n\t\tif (\n\t\t\tisTemplateSuperseded(\n\t\t\t\ttemplate.slug,\n\t\t\t\tmap( templates, 'slug' ),\n\t\t\t\tshowOnFront\n\t\t\t)\n\t\t) {\n\t\t\treturn MENU_TEMPLATES_UNUSED;\n\t\t}\n\n\t\treturn getTemplateLocation( template.slug );\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the navigation panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the navigation panel should be open; false if closed.\n */\nexport function isNavigationOpened( state ) {\n\treturn state.navigationPanel.isOpen;\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst {\n\t\trootClientId,\n\t\tinsertionIndex,\n\t\tfilterValue,\n\t} = state.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\ttemplateType,\n\t\t\ttemplateId\n\t\t);\n\n\t\tconst templateParts = select(\n\t\t\tcoreDataStore\n\t\t).getEntityRecords( 'postType', 'wp_template_part', { per_page: -1 } );\n\t\tconst templatePartsById = keyBy(\n\t\t\ttemplateParts,\n\t\t\t( templatePart ) => templatePart.id\n\t\t);\n\n\t\treturn ( template.blocks ?? [] )\n\t\t\t.filter( ( block ) => isTemplatePart( block ) )\n\t\t\t.map( ( block ) => {\n\t\t\t\tconst {\n\t\t\t\t\tattributes: { theme, slug },\n\t\t\t\t} = block;\n\t\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t\treturn {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t};\n\t\t\t} )\n\t\t\t.filter( ( { templatePart } ) => !! templatePart );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn __unstableGetPreference( state, 'editorMode' );\n}\n"]}
@@ -447,6 +447,95 @@ body.is-fullscreen-mode .interface-interface-skeleton {
447
447
  max-height: 24px;
448
448
  }
449
449
 
450
+ @media (min-width: 600px) {
451
+ .interface-preferences-modal {
452
+ width: calc(100% - 32px);
453
+ height: calc(100% - 120px);
454
+ }
455
+ }
456
+ @media (min-width: 782px) {
457
+ .interface-preferences-modal {
458
+ width: 750px;
459
+ }
460
+ }
461
+ @media (min-width: 960px) {
462
+ .interface-preferences-modal {
463
+ height: 70%;
464
+ }
465
+ }
466
+ @media (max-width: 781px) {
467
+ .interface-preferences-modal .components-modal__content {
468
+ padding: 0;
469
+ }
470
+ .interface-preferences-modal .components-modal__content::before {
471
+ content: none;
472
+ }
473
+ }
474
+
475
+ .interface-preferences__tabs .components-tab-panel__tabs {
476
+ position: absolute;
477
+ top: 84px;
478
+ right: 16px;
479
+ width: 160px;
480
+ }
481
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item {
482
+ border-radius: 2px;
483
+ font-weight: 400;
484
+ }
485
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active {
486
+ background: #f0f0f0;
487
+ box-shadow: none;
488
+ font-weight: 500;
489
+ }
490
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
491
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
492
+ }
493
+ .interface-preferences__tabs .components-tab-panel__tab-content {
494
+ padding-right: 24px;
495
+ margin-right: 160px;
496
+ }
497
+
498
+ @media (max-width: 781px) {
499
+ .interface-preferences__provider {
500
+ height: 100%;
501
+ }
502
+ }
503
+ .interface-preferences-modal__section {
504
+ margin: 0 0 2.5rem 0;
505
+ }
506
+ .interface-preferences-modal__section:last-child {
507
+ margin: 0;
508
+ }
509
+
510
+ .interface-preferences-modal__section-title {
511
+ font-size: 0.9rem;
512
+ font-weight: 600;
513
+ margin-top: 0;
514
+ }
515
+
516
+ .interface-preferences-modal__section-description {
517
+ margin: -8px 0 8px 0;
518
+ font-size: 12px;
519
+ font-style: normal;
520
+ color: #757575;
521
+ }
522
+
523
+ .interface-preferences-modal__option .components-base-control .components-base-control__field {
524
+ align-items: center;
525
+ display: flex;
526
+ margin-bottom: 0;
527
+ }
528
+ .interface-preferences-modal__option .components-base-control .components-base-control__field > label {
529
+ flex-grow: 1;
530
+ padding: 0.6rem 10px 0.6rem 0;
531
+ }
532
+ .interface-preferences-modal__option .components-base-control__help {
533
+ margin: -8px 58px 8px 0;
534
+ font-size: 12px;
535
+ font-style: normal;
536
+ color: #757575;
537
+ }
538
+
450
539
  .edit-site-block-editor__editor-styles-wrapper .components-button {
451
540
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
452
541
  font-size: 13px;
@@ -916,33 +1005,6 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
916
1005
  min-width: 240px;
917
1006
  }
918
1007
 
919
- .edit-site-more-menu {
920
- margin-right: -4px;
921
- }
922
- .edit-site-more-menu .components-button {
923
- width: auto;
924
- padding: 0 2px;
925
- }
926
- @media (min-width: 600px) {
927
- .edit-site-more-menu {
928
- margin-right: 4px;
929
- }
930
- .edit-site-more-menu .components-button {
931
- padding: 0 4px;
932
- }
933
- }
934
-
935
- .edit-site-more-menu__content .components-popover__content {
936
- min-width: 260px;
937
- }
938
- .edit-site-more-menu__content .components-popover__content .components-dropdown-menu__menu {
939
- padding: 0;
940
- }
941
-
942
- .components-popover.edit-site-more-menu__content {
943
- z-index: 99998;
944
- }
945
-
946
1008
  .edit-site-navigation-toggle {
947
1009
  align-items: center;
948
1010
  background: #1e1e1e;
@@ -954,7 +1016,7 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
954
1016
  width: 60px;
955
1017
  }
956
1018
 
957
- .edit-site-navigation-toggle__button {
1019
+ .edit-site-navigation-toggle__button.components-button {
958
1020
  align-items: center;
959
1021
  background: #1e1e1e;
960
1022
  border-radius: 0;
@@ -963,17 +1025,15 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
963
1025
  width: 60px;
964
1026
  z-index: 1;
965
1027
  margin-bottom: -1px;
966
- }
967
- .edit-site-navigation-toggle__button.has-icon {
968
1028
  min-width: 60px;
969
1029
  }
970
- .edit-site-navigation-toggle__button.has-icon:hover, .edit-site-navigation-toggle__button.has-icon:active {
1030
+ .edit-site-navigation-toggle__button.components-button:hover, .edit-site-navigation-toggle__button.components-button:active {
971
1031
  color: #fff;
972
1032
  }
973
- .edit-site-navigation-toggle__button.has-icon:focus {
1033
+ .edit-site-navigation-toggle__button.components-button:focus {
974
1034
  box-shadow: none;
975
1035
  }
976
- .edit-site-navigation-toggle__button.has-icon::before {
1036
+ .edit-site-navigation-toggle__button.components-button::before {
977
1037
  transition: box-shadow 0.1s ease;
978
1038
  content: "";
979
1039
  display: block;
@@ -986,18 +1046,21 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
986
1046
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e;
987
1047
  }
988
1048
  @media (prefers-reduced-motion: reduce) {
989
- .edit-site-navigation-toggle__button.has-icon::before {
1049
+ .edit-site-navigation-toggle__button.components-button::before {
990
1050
  transition-duration: 0s;
991
1051
  transition-delay: 0s;
992
1052
  }
993
1053
  }
994
- .edit-site-navigation-toggle__button.has-icon:hover::before {
1054
+ .edit-site-navigation-toggle__button.components-button:hover::before {
995
1055
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #757575;
996
1056
  }
997
- .edit-site-navigation-toggle__button.has-icon:focus::before {
1057
+ .edit-site-navigation-toggle__button.components-button.has-icon:hover::before {
1058
+ box-shadow: none;
1059
+ }
1060
+ .edit-site-navigation-toggle__button.components-button:focus::before {
998
1061
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba(255, 255, 255, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
999
1062
  }
1000
- .edit-site-navigation-toggle__button .edit-site-navigation-toggle__site-icon {
1063
+ .edit-site-navigation-toggle__button.components-button .edit-site-navigation-toggle__site-icon {
1001
1064
  width: 36px;
1002
1065
  height: 36px;
1003
1066
  border-radius: 2px;
@@ -1383,7 +1446,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1383
1446
  .edit-site-global-styles-sidebar {
1384
1447
  display: flex;
1385
1448
  flex-direction: column;
1386
- height: 100%;
1449
+ min-height: 100%;
1387
1450
  }
1388
1451
  .edit-site-global-styles-sidebar__panel, .edit-site-global-styles-sidebar__navigator-provider {
1389
1452
  display: flex;
@@ -447,6 +447,95 @@ body.is-fullscreen-mode .interface-interface-skeleton {
447
447
  max-height: 24px;
448
448
  }
449
449
 
450
+ @media (min-width: 600px) {
451
+ .interface-preferences-modal {
452
+ width: calc(100% - 32px);
453
+ height: calc(100% - 120px);
454
+ }
455
+ }
456
+ @media (min-width: 782px) {
457
+ .interface-preferences-modal {
458
+ width: 750px;
459
+ }
460
+ }
461
+ @media (min-width: 960px) {
462
+ .interface-preferences-modal {
463
+ height: 70%;
464
+ }
465
+ }
466
+ @media (max-width: 781px) {
467
+ .interface-preferences-modal .components-modal__content {
468
+ padding: 0;
469
+ }
470
+ .interface-preferences-modal .components-modal__content::before {
471
+ content: none;
472
+ }
473
+ }
474
+
475
+ .interface-preferences__tabs .components-tab-panel__tabs {
476
+ position: absolute;
477
+ top: 84px;
478
+ left: 16px;
479
+ width: 160px;
480
+ }
481
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item {
482
+ border-radius: 2px;
483
+ font-weight: 400;
484
+ }
485
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active {
486
+ background: #f0f0f0;
487
+ box-shadow: none;
488
+ font-weight: 500;
489
+ }
490
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
491
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
492
+ }
493
+ .interface-preferences__tabs .components-tab-panel__tab-content {
494
+ padding-left: 24px;
495
+ margin-left: 160px;
496
+ }
497
+
498
+ @media (max-width: 781px) {
499
+ .interface-preferences__provider {
500
+ height: 100%;
501
+ }
502
+ }
503
+ .interface-preferences-modal__section {
504
+ margin: 0 0 2.5rem 0;
505
+ }
506
+ .interface-preferences-modal__section:last-child {
507
+ margin: 0;
508
+ }
509
+
510
+ .interface-preferences-modal__section-title {
511
+ font-size: 0.9rem;
512
+ font-weight: 600;
513
+ margin-top: 0;
514
+ }
515
+
516
+ .interface-preferences-modal__section-description {
517
+ margin: -8px 0 8px 0;
518
+ font-size: 12px;
519
+ font-style: normal;
520
+ color: #757575;
521
+ }
522
+
523
+ .interface-preferences-modal__option .components-base-control .components-base-control__field {
524
+ align-items: center;
525
+ display: flex;
526
+ margin-bottom: 0;
527
+ }
528
+ .interface-preferences-modal__option .components-base-control .components-base-control__field > label {
529
+ flex-grow: 1;
530
+ padding: 0.6rem 0 0.6rem 10px;
531
+ }
532
+ .interface-preferences-modal__option .components-base-control__help {
533
+ margin: -8px 0 8px 58px;
534
+ font-size: 12px;
535
+ font-style: normal;
536
+ color: #757575;
537
+ }
538
+
450
539
  .edit-site-block-editor__editor-styles-wrapper .components-button {
451
540
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
452
541
  font-size: 13px;
@@ -916,33 +1005,6 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
916
1005
  min-width: 240px;
917
1006
  }
918
1007
 
919
- .edit-site-more-menu {
920
- margin-left: -4px;
921
- }
922
- .edit-site-more-menu .components-button {
923
- width: auto;
924
- padding: 0 2px;
925
- }
926
- @media (min-width: 600px) {
927
- .edit-site-more-menu {
928
- margin-left: 4px;
929
- }
930
- .edit-site-more-menu .components-button {
931
- padding: 0 4px;
932
- }
933
- }
934
-
935
- .edit-site-more-menu__content .components-popover__content {
936
- min-width: 260px;
937
- }
938
- .edit-site-more-menu__content .components-popover__content .components-dropdown-menu__menu {
939
- padding: 0;
940
- }
941
-
942
- .components-popover.edit-site-more-menu__content {
943
- z-index: 99998;
944
- }
945
-
946
1008
  .edit-site-navigation-toggle {
947
1009
  align-items: center;
948
1010
  background: #1e1e1e;
@@ -954,7 +1016,7 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
954
1016
  width: 60px;
955
1017
  }
956
1018
 
957
- .edit-site-navigation-toggle__button {
1019
+ .edit-site-navigation-toggle__button.components-button {
958
1020
  align-items: center;
959
1021
  background: #1e1e1e;
960
1022
  border-radius: 0;
@@ -963,17 +1025,15 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
963
1025
  width: 60px;
964
1026
  z-index: 1;
965
1027
  margin-bottom: -1px;
966
- }
967
- .edit-site-navigation-toggle__button.has-icon {
968
1028
  min-width: 60px;
969
1029
  }
970
- .edit-site-navigation-toggle__button.has-icon:hover, .edit-site-navigation-toggle__button.has-icon:active {
1030
+ .edit-site-navigation-toggle__button.components-button:hover, .edit-site-navigation-toggle__button.components-button:active {
971
1031
  color: #fff;
972
1032
  }
973
- .edit-site-navigation-toggle__button.has-icon:focus {
1033
+ .edit-site-navigation-toggle__button.components-button:focus {
974
1034
  box-shadow: none;
975
1035
  }
976
- .edit-site-navigation-toggle__button.has-icon::before {
1036
+ .edit-site-navigation-toggle__button.components-button::before {
977
1037
  transition: box-shadow 0.1s ease;
978
1038
  content: "";
979
1039
  display: block;
@@ -986,18 +1046,21 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
986
1046
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e;
987
1047
  }
988
1048
  @media (prefers-reduced-motion: reduce) {
989
- .edit-site-navigation-toggle__button.has-icon::before {
1049
+ .edit-site-navigation-toggle__button.components-button::before {
990
1050
  transition-duration: 0s;
991
1051
  transition-delay: 0s;
992
1052
  }
993
1053
  }
994
- .edit-site-navigation-toggle__button.has-icon:hover::before {
1054
+ .edit-site-navigation-toggle__button.components-button:hover::before {
995
1055
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #757575;
996
1056
  }
997
- .edit-site-navigation-toggle__button.has-icon:focus::before {
1057
+ .edit-site-navigation-toggle__button.components-button.has-icon:hover::before {
1058
+ box-shadow: none;
1059
+ }
1060
+ .edit-site-navigation-toggle__button.components-button:focus::before {
998
1061
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba(255, 255, 255, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
999
1062
  }
1000
- .edit-site-navigation-toggle__button .edit-site-navigation-toggle__site-icon {
1063
+ .edit-site-navigation-toggle__button.components-button .edit-site-navigation-toggle__site-icon {
1001
1064
  width: 36px;
1002
1065
  height: 36px;
1003
1066
  border-radius: 2px;
@@ -1383,7 +1446,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1383
1446
  .edit-site-global-styles-sidebar {
1384
1447
  display: flex;
1385
1448
  flex-direction: column;
1386
- height: 100%;
1449
+ min-height: 100%;
1387
1450
  }
1388
1451
  .edit-site-global-styles-sidebar__panel, .edit-site-global-styles-sidebar__navigator-provider {
1389
1452
  display: flex;