@wordpress/edit-site 3.0.1-next.253d9b6e21.0 → 3.0.3

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 (276) hide show
  1. package/README.md +1 -1
  2. package/build/components/block-editor/back-button.js +60 -0
  3. package/build/components/block-editor/back-button.js.map +1 -0
  4. package/build/components/block-editor/index.js +20 -5
  5. package/build/components/block-editor/index.js.map +1 -1
  6. package/build/components/edit-template-part-menu-button/index.js +63 -0
  7. package/build/components/edit-template-part-menu-button/index.js.map +1 -0
  8. package/build/components/editor/global-styles-provider.js +15 -2
  9. package/build/components/editor/global-styles-provider.js.map +1 -1
  10. package/build/components/editor/global-styles-renderer.js +8 -8
  11. package/build/components/editor/global-styles-renderer.js.map +1 -1
  12. package/build/components/editor/index.js +7 -7
  13. package/build/components/editor/index.js.map +1 -1
  14. package/build/components/editor/utils.js +4 -9
  15. package/build/components/editor/utils.js.map +1 -1
  16. package/build/components/{sidebar → global-styles}/border-panel.js +2 -2
  17. package/build/components/global-styles/border-panel.js.map +1 -0
  18. package/build/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
  19. package/build/components/global-styles/color-palette-panel.js.map +1 -0
  20. package/build/components/{sidebar → global-styles}/color-panel.js +24 -21
  21. package/build/components/global-styles/color-panel.js.map +1 -0
  22. package/build/components/global-styles/context-menu.js +58 -0
  23. package/build/components/global-styles/context-menu.js.map +1 -0
  24. package/build/components/{sidebar → global-styles}/dimensions-panel.js +58 -8
  25. package/build/components/global-styles/dimensions-panel.js.map +1 -0
  26. package/build/components/global-styles/header.js +54 -0
  27. package/build/components/global-styles/header.js.map +1 -0
  28. package/build/components/global-styles/index.js +89 -0
  29. package/build/components/global-styles/index.js.map +1 -0
  30. package/build/components/global-styles/navigation-button.js +43 -0
  31. package/build/components/global-styles/navigation-button.js.map +1 -0
  32. package/build/components/global-styles/palette.js +57 -0
  33. package/build/components/global-styles/palette.js.map +1 -0
  34. package/build/components/global-styles/preview.js +59 -0
  35. package/build/components/global-styles/preview.js.map +1 -0
  36. package/build/components/global-styles/screen-block-list.js +76 -0
  37. package/build/components/global-styles/screen-block-list.js.map +1 -0
  38. package/build/components/global-styles/screen-block.js +45 -0
  39. package/build/components/global-styles/screen-block.js.map +1 -0
  40. package/build/components/global-styles/screen-color-palette.js +48 -0
  41. package/build/components/global-styles/screen-color-palette.js.map +1 -0
  42. package/build/components/global-styles/screen-colors.js +51 -0
  43. package/build/components/global-styles/screen-colors.js.map +1 -0
  44. package/build/components/global-styles/screen-layout.js +60 -0
  45. package/build/components/global-styles/screen-layout.js.map +1 -0
  46. package/build/components/global-styles/screen-root.js +44 -0
  47. package/build/components/global-styles/screen-root.js.map +1 -0
  48. package/build/components/global-styles/screen-typography.js +50 -0
  49. package/build/components/global-styles/screen-typography.js.map +1 -0
  50. package/build/components/global-styles/subtitle.js +25 -0
  51. package/build/components/global-styles/subtitle.js.map +1 -0
  52. package/build/components/{sidebar → global-styles}/typography-panel.js +1 -3
  53. package/build/components/global-styles/typography-panel.js.map +1 -0
  54. package/build/components/header/document-actions/index.js +1 -1
  55. package/build/components/header/document-actions/index.js.map +1 -1
  56. package/build/components/header/plugin-more-menu-item/index.js +82 -0
  57. package/build/components/header/plugin-more-menu-item/index.js.map +1 -0
  58. package/build/components/header/plugin-sidebar-more-menu-item/index.js +75 -0
  59. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
  60. package/build/components/header/undo-redo/redo.js +1 -1
  61. package/build/components/header/undo-redo/redo.js.map +1 -1
  62. package/build/components/header/undo-redo/undo.js +1 -1
  63. package/build/components/header/undo-redo/undo.js.map +1 -1
  64. package/build/components/keyboard-shortcuts/index.js +2 -10
  65. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  66. package/build/components/navigation-sidebar/index.js +1 -1
  67. package/build/components/navigation-sidebar/index.js.map +1 -1
  68. package/build/components/navigation-sidebar/navigation-panel/constants.js +10 -10
  69. package/build/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
  70. package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js +1 -3
  71. package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
  72. package/build/components/save-button/index.js +1 -1
  73. package/build/components/save-button/index.js.map +1 -1
  74. package/build/components/secondary-sidebar/inserter-sidebar.js +2 -1
  75. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  76. package/build/components/sidebar/global-styles-sidebar.js +11 -161
  77. package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
  78. package/build/components/sidebar/index.js +1 -6
  79. package/build/components/sidebar/index.js.map +1 -1
  80. package/build/components/sidebar/plugin-sidebar/index.js +95 -0
  81. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -0
  82. package/build/components/template-details/index.js +12 -6
  83. package/build/components/template-details/index.js.map +1 -1
  84. package/build/components/template-details/template-areas.js +73 -0
  85. package/build/components/template-details/template-areas.js.map +1 -0
  86. package/build/components/template-part-converter/convert-to-regular.js +3 -3
  87. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  88. package/build/components/template-part-converter/index.js +1 -1
  89. package/build/components/template-part-converter/index.js.map +1 -1
  90. package/build/components/url-query-controller/index.js +1 -1
  91. package/build/components/url-query-controller/index.js.map +1 -1
  92. package/build/index.js +24 -0
  93. package/build/index.js.map +1 -1
  94. package/build/store/actions.js +60 -7
  95. package/build/store/actions.js.map +1 -1
  96. package/build/store/constants.js +19 -1
  97. package/build/store/constants.js.map +1 -1
  98. package/build/store/reducer.js +16 -7
  99. package/build/store/reducer.js.map +1 -1
  100. package/build/store/selectors.js +91 -9
  101. package/build/store/selectors.js.map +1 -1
  102. package/build-module/components/block-editor/back-button.js +48 -0
  103. package/build-module/components/block-editor/back-button.js.map +1 -0
  104. package/build-module/components/block-editor/index.js +17 -5
  105. package/build-module/components/block-editor/index.js.map +1 -1
  106. package/build-module/components/edit-template-part-menu-button/index.js +49 -0
  107. package/build-module/components/edit-template-part-menu-button/index.js.map +1 -0
  108. package/build-module/components/editor/global-styles-provider.js +16 -3
  109. package/build-module/components/editor/global-styles-provider.js.map +1 -1
  110. package/build-module/components/editor/global-styles-renderer.js +8 -8
  111. package/build-module/components/editor/global-styles-renderer.js.map +1 -1
  112. package/build-module/components/editor/index.js +4 -5
  113. package/build-module/components/editor/index.js.map +1 -1
  114. package/build-module/components/editor/utils.js +2 -7
  115. package/build-module/components/editor/utils.js.map +1 -1
  116. package/build-module/components/{sidebar → global-styles}/border-panel.js +2 -2
  117. package/build-module/components/global-styles/border-panel.js.map +1 -0
  118. package/build-module/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
  119. package/build-module/components/global-styles/color-palette-panel.js.map +1 -0
  120. package/build-module/components/{sidebar → global-styles}/color-panel.js +25 -22
  121. package/build-module/components/global-styles/color-panel.js.map +1 -0
  122. package/build-module/components/global-styles/context-menu.js +41 -0
  123. package/build-module/components/global-styles/context-menu.js.map +1 -0
  124. package/build-module/components/{sidebar → global-styles}/dimensions-panel.js +58 -9
  125. package/build-module/components/global-styles/dimensions-panel.js.map +1 -0
  126. package/build-module/components/global-styles/header.js +41 -0
  127. package/build-module/components/global-styles/header.js.map +1 -0
  128. package/build-module/components/global-styles/index.js +70 -0
  129. package/build-module/components/global-styles/index.js.map +1 -0
  130. package/build-module/components/global-styles/navigation-button.js +31 -0
  131. package/build-module/components/global-styles/navigation-button.js.map +1 -0
  132. package/build-module/components/global-styles/palette.js +43 -0
  133. package/build-module/components/global-styles/palette.js.map +1 -0
  134. package/build-module/components/global-styles/preview.js +50 -0
  135. package/build-module/components/global-styles/preview.js.map +1 -0
  136. package/build-module/components/global-styles/screen-block-list.js +58 -0
  137. package/build-module/components/global-styles/screen-block-list.js.map +1 -0
  138. package/build-module/components/global-styles/screen-block.js +32 -0
  139. package/build-module/components/global-styles/screen-block.js.map +1 -0
  140. package/build-module/components/global-styles/screen-color-palette.js +35 -0
  141. package/build-module/components/global-styles/screen-color-palette.js.map +1 -0
  142. package/build-module/components/global-styles/screen-colors.js +38 -0
  143. package/build-module/components/global-styles/screen-colors.js.map +1 -0
  144. package/build-module/components/global-styles/screen-layout.js +44 -0
  145. package/build-module/components/global-styles/screen-layout.js.map +1 -0
  146. package/build-module/components/global-styles/screen-root.js +29 -0
  147. package/build-module/components/global-styles/screen-root.js.map +1 -0
  148. package/build-module/components/global-styles/screen-typography.js +37 -0
  149. package/build-module/components/global-styles/screen-typography.js.map +1 -0
  150. package/build-module/components/global-styles/subtitle.js +17 -0
  151. package/build-module/components/global-styles/subtitle.js.map +1 -0
  152. package/build-module/components/{sidebar → global-styles}/typography-panel.js +1 -2
  153. package/build-module/components/global-styles/typography-panel.js.map +1 -0
  154. package/build-module/components/header/document-actions/index.js +1 -1
  155. package/build-module/components/header/document-actions/index.js.map +1 -1
  156. package/build-module/components/header/plugin-more-menu-item/index.js +70 -0
  157. package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -0
  158. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
  159. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
  160. package/build-module/components/header/undo-redo/redo.js +1 -1
  161. package/build-module/components/header/undo-redo/redo.js.map +1 -1
  162. package/build-module/components/header/undo-redo/undo.js +1 -1
  163. package/build-module/components/header/undo-redo/undo.js.map +1 -1
  164. package/build-module/components/keyboard-shortcuts/index.js +3 -11
  165. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  166. package/build-module/components/navigation-sidebar/index.js +1 -1
  167. package/build-module/components/navigation-sidebar/index.js.map +1 -1
  168. package/build-module/components/navigation-sidebar/navigation-panel/constants.js +5 -3
  169. package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
  170. package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js +1 -3
  171. package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
  172. package/build-module/components/save-button/index.js +1 -1
  173. package/build-module/components/save-button/index.js.map +1 -1
  174. package/build-module/components/secondary-sidebar/inserter-sidebar.js +2 -1
  175. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  176. package/build-module/components/sidebar/global-styles-sidebar.js +13 -159
  177. package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
  178. package/build-module/components/sidebar/index.js +2 -7
  179. package/build-module/components/sidebar/index.js.map +1 -1
  180. package/build-module/components/sidebar/plugin-sidebar/index.js +84 -0
  181. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -0
  182. package/build-module/components/template-details/index.js +13 -8
  183. package/build-module/components/template-details/index.js.map +1 -1
  184. package/build-module/components/template-details/template-areas.js +60 -0
  185. package/build-module/components/template-details/template-areas.js.map +1 -0
  186. package/build-module/components/template-part-converter/convert-to-regular.js +3 -3
  187. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  188. package/build-module/components/template-part-converter/index.js +1 -1
  189. package/build-module/components/template-part-converter/index.js.map +1 -1
  190. package/build-module/components/url-query-controller/index.js +1 -1
  191. package/build-module/components/url-query-controller/index.js.map +1 -1
  192. package/build-module/index.js +3 -0
  193. package/build-module/index.js.map +1 -1
  194. package/build-module/store/actions.js +51 -7
  195. package/build-module/store/actions.js.map +1 -1
  196. package/build-module/store/constants.js +13 -0
  197. package/build-module/store/constants.js.map +1 -1
  198. package/build-module/store/reducer.js +16 -7
  199. package/build-module/store/reducer.js.map +1 -1
  200. package/build-module/store/selectors.js +85 -9
  201. package/build-module/store/selectors.js.map +1 -1
  202. package/build-style/style-rtl.css +158 -19
  203. package/build-style/style.css +158 -19
  204. package/package.json +26 -26
  205. package/src/components/block-editor/back-button.js +44 -0
  206. package/src/components/block-editor/index.js +18 -2
  207. package/src/components/block-editor/style.scss +26 -0
  208. package/src/components/edit-template-part-menu-button/index.js +57 -0
  209. package/src/components/editor/global-styles-provider.js +19 -3
  210. package/src/components/editor/global-styles-renderer.js +8 -5
  211. package/src/components/editor/index.js +5 -8
  212. package/src/components/editor/test/global-styles-provider.js +131 -0
  213. package/src/components/editor/test/global-styles-renderer.js +1 -1
  214. package/src/components/editor/test/utils.js +146 -0
  215. package/src/components/editor/utils.js +2 -7
  216. package/src/components/{sidebar → global-styles}/border-panel.js +2 -2
  217. package/src/components/{sidebar → global-styles}/color-palette-panel.js +13 -11
  218. package/src/components/{sidebar → global-styles}/color-panel.js +43 -28
  219. package/src/components/global-styles/context-menu.js +54 -0
  220. package/src/components/{sidebar → global-styles}/dimensions-panel.js +60 -9
  221. package/src/components/global-styles/header.js +50 -0
  222. package/src/components/global-styles/index.js +81 -0
  223. package/src/components/global-styles/navigation-button.js +35 -0
  224. package/src/components/global-styles/palette.js +67 -0
  225. package/src/components/global-styles/preview.js +41 -0
  226. package/src/components/global-styles/screen-block-list.js +59 -0
  227. package/src/components/global-styles/screen-block.js +28 -0
  228. package/src/components/global-styles/screen-color-palette.js +33 -0
  229. package/src/components/global-styles/screen-colors.js +36 -0
  230. package/src/components/global-styles/screen-layout.js +45 -0
  231. package/src/components/global-styles/screen-root.js +43 -0
  232. package/src/components/global-styles/screen-typography.js +33 -0
  233. package/src/components/global-styles/style.scss +35 -0
  234. package/src/components/global-styles/subtitle.js +10 -0
  235. package/src/components/{sidebar → global-styles}/typography-panel.js +1 -2
  236. package/src/components/header/document-actions/index.js +1 -1
  237. package/src/components/header/plugin-more-menu-item/index.js +71 -0
  238. package/src/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
  239. package/src/components/header/undo-redo/redo.js +4 -1
  240. package/src/components/header/undo-redo/undo.js +4 -1
  241. package/src/components/keyboard-shortcuts/index.js +25 -40
  242. package/src/components/navigation-sidebar/index.js +1 -1
  243. package/src/components/navigation-sidebar/navigation-panel/constants.js +9 -4
  244. package/src/components/navigation-sidebar/navigation-panel/content-navigation-item.js +1 -1
  245. package/src/components/navigation-sidebar/navigation-panel/style.scss +1 -0
  246. package/src/components/navigation-sidebar/navigation-toggle/style.scss +3 -2
  247. package/src/components/save-button/index.js +1 -1
  248. package/src/components/secondary-sidebar/inserter-sidebar.js +1 -0
  249. package/src/components/sidebar/global-styles-sidebar.js +14 -187
  250. package/src/components/sidebar/index.js +2 -7
  251. package/src/components/sidebar/plugin-sidebar/index.js +80 -0
  252. package/src/components/sidebar/style.scss +40 -0
  253. package/src/components/template-details/index.js +17 -7
  254. package/src/components/template-details/style.scss +36 -27
  255. package/src/components/template-details/template-areas.js +66 -0
  256. package/src/components/template-part-converter/convert-to-regular.js +2 -8
  257. package/src/components/template-part-converter/index.js +1 -1
  258. package/src/components/url-query-controller/index.js +1 -1
  259. package/src/index.js +3 -0
  260. package/src/store/actions.js +59 -7
  261. package/src/store/constants.js +15 -0
  262. package/src/store/reducer.js +26 -12
  263. package/src/store/selectors.js +96 -9
  264. package/src/store/test/reducer.js +40 -23
  265. package/src/store/test/selectors.js +34 -3
  266. package/src/style.scss +1 -0
  267. package/build/components/sidebar/border-panel.js.map +0 -1
  268. package/build/components/sidebar/color-palette-panel.js.map +0 -1
  269. package/build/components/sidebar/color-panel.js.map +0 -1
  270. package/build/components/sidebar/dimensions-panel.js.map +0 -1
  271. package/build/components/sidebar/typography-panel.js.map +0 -1
  272. package/build-module/components/sidebar/border-panel.js.map +0 -1
  273. package/build-module/components/sidebar/color-palette-panel.js.map +0 -1
  274. package/build-module/components/sidebar/color-panel.js.map +0 -1
  275. package/build-module/components/sidebar/dimensions-panel.js.map +0 -1
  276. package/build-module/components/sidebar/typography-panel.js.map +0 -1
@@ -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","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;AAC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AA,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} );\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 state.\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","PREFERENCES_DEFAULTS","MENU_ROOT","preferences","features","state","action","type","feature","deviceType","settings","editedPost","id","templateId","page","templatePartId","slice","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,CAAEC,KAAK,GAAGJ,oBAAoB,CAACG,QAA/B,EAAyCE,MAAzC,EAAkD;AACzD,YAASA,MAAM,CAACC,IAAhB;AACC,WAAK,gBAAL;AAAuB;AACtB,iBAAO,EACN,GAAGF,KADG;AAEN,aAAEC,MAAM,CAACE,OAAT,GAAoB,CAAEH,KAAK,CAAEC,MAAM,CAACE,OAAT;AAFrB,WAAP;AAIA;;AACD;AACC,eAAOH,KAAP;AARF;AAUA;;AAZ0C,CAAF,CAAnC;AAeP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASI,UAAT,CAAqBJ,KAAK,GAAG,SAA7B,EAAwCC,MAAxC,EAAiD;AACvD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,yBAAL;AACC,aAAOD,MAAM,CAACG,UAAd;AAFF;;AAKA,SAAOJ,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASK,QAAT,CAAmBL,KAAK,GAAG,EAA3B,EAA+BC,MAA/B,EAAwC;AAC9C,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,iBAAL;AACC,aAAO,EACN,GAAGF,KADG;AAEN,WAAGC,MAAM,CAACI;AAFJ,OAAP;AAFF;;AAQA,SAAOL,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,O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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASkB,aAAT,CAAwBlB,KAAK,GAAG,KAAhC,EAAuCC,MAAvC,EAAgD;AACtD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,+BAAL;AACC,aAAO,KAAP;;AACD,SAAK,gCAAL;AACC,aAAOD,MAAM,CAACc,MAAP,GAAgB,KAAhB,GAAwBf,KAA/B;;AACD,SAAK,wBAAL;AACC,aAAOC,MAAM,CAACe,KAAP,GAAe,KAAf,GAAuBhB,KAA9B;;AACD,SAAK,yBAAL;AACC,aAAOC,MAAM,CAACc,MAAd;AARF;;AAUA,SAAOf,KAAP;AACA;AAED,eAAeL,eAAe,CAAE;AAC/BG,EAAAA,WAD+B;AAE/BM,EAAAA,UAF+B;AAG/BC,EAAAA,QAH+B;AAI/BC,EAAAA,UAJ+B;AAK/BM,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} );\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 {Array} state Current state history.\n * @param {Object} action Dispatched action.\n *\n * @return {Array} 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\t{\n\t\t\t\t\ttype: 'wp_template',\n\t\t\t\t\tid: action.templateId,\n\t\t\t\t\tpage: action.page,\n\t\t\t\t},\n\t\t\t];\n\t\tcase 'SET_TEMPLATE_PART':\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: 'wp_template_part',\n\t\t\t\t\tid: action.templatePartId,\n\t\t\t\t},\n\t\t\t];\n\t\tcase 'PUSH_TEMPLATE_PART':\n\t\t\treturn [\n\t\t\t\t...state,\n\t\t\t\t{\n\t\t\t\t\ttype: 'wp_template_part',\n\t\t\t\t\tid: action.templatePartId,\n\t\t\t\t},\n\t\t\t];\n\t\tcase 'GO_BACK':\n\t\t\treturn state.slice( 0, -1 );\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,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { get, map } from 'lodash';
4
+ import { get, map, keyBy } from 'lodash';
5
5
  import createSelector from 'rememo';
6
6
  /**
7
7
  * WordPress dependencies
@@ -10,12 +10,17 @@ import createSelector from 'rememo';
10
10
  import { store as coreDataStore } from '@wordpress/core-data';
11
11
  import { createRegistrySelector } from '@wordpress/data';
12
12
  import { uploadMedia } from '@wordpress/media-utils';
13
+ import { isTemplatePart } from '@wordpress/blocks';
13
14
  /**
14
15
  * Internal dependencies
15
16
  */
16
17
 
17
18
  import { MENU_ROOT, MENU_TEMPLATE_PARTS, MENU_TEMPLATES_UNUSED, TEMPLATE_PARTS_SUB_MENUS } from '../components/navigation-sidebar/navigation-panel/constants';
18
19
  import { getTemplateLocation, isTemplateSuperseded } from '../components/navigation-sidebar/navigation-panel/template-hierarchy';
20
+ /**
21
+ * @typedef {'template'|'template_type'} TemplateType Template type.
22
+ */
23
+
19
24
  /**
20
25
  * Returns whether the given feature is enabled or not.
21
26
  *
@@ -96,27 +101,58 @@ export const getSettings = createSelector((state, setIsInserterOpen) => {
96
101
  export function getHomeTemplateId(state) {
97
102
  return state.homeTemplateId;
98
103
  }
104
+
105
+ function getCurrentEditedPost(state) {
106
+ return state.editedPost[state.editedPost.length - 1] || {};
107
+ }
108
+
109
+ function getPreviousEditedPost(state) {
110
+ return state.editedPost[state.editedPost.length - 2] || {};
111
+ }
99
112
  /**
100
113
  * Returns the current edited post type (wp_template or wp_template_part).
101
114
  *
102
115
  * @param {Object} state Global application state.
103
116
  *
104
- * @return {number?} Template ID.
117
+ * @return {TemplateType?} Template type.
105
118
  */
106
119
 
120
+
107
121
  export function getEditedPostType(state) {
108
- return state.editedPost.type;
122
+ return getCurrentEditedPost(state).type;
109
123
  }
110
124
  /**
111
125
  * Returns the ID of the currently edited template or template part.
112
126
  *
113
127
  * @param {Object} state Global application state.
114
128
  *
115
- * @return {number?} Post ID.
129
+ * @return {string?} Post ID.
116
130
  */
117
131
 
118
132
  export function getEditedPostId(state) {
119
- return state.editedPost.id;
133
+ return getCurrentEditedPost(state).id;
134
+ }
135
+ /**
136
+ * Returns the previous edited post type (wp_template or wp_template_part).
137
+ *
138
+ * @param {Object} state Global application state.
139
+ *
140
+ * @return {TemplateType?} Template type.
141
+ */
142
+
143
+ export function getPreviousEditedPostType(state) {
144
+ return getPreviousEditedPost(state).type;
145
+ }
146
+ /**
147
+ * Returns the ID of the previous edited template or template part.
148
+ *
149
+ * @param {Object} state Global application state.
150
+ *
151
+ * @return {string?} Post ID.
152
+ */
153
+
154
+ export function getPreviousEditedPostId(state) {
155
+ return getPreviousEditedPost(state).id;
120
156
  }
121
157
  /**
122
158
  * Returns the current page object.
@@ -127,7 +163,7 @@ export function getEditedPostId(state) {
127
163
  */
128
164
 
129
165
  export function getPage(state) {
130
- return state.editedPost.page;
166
+ return getCurrentEditedPost(state).page;
131
167
  }
132
168
  /**
133
169
  * Returns the active menu in the navigation panel.
@@ -202,17 +238,19 @@ export function isInserterOpened(state) {
202
238
  *
203
239
  * @param {Object} state Global application state.
204
240
  *
205
- * @return {Object} The root client ID and index to insert at.
241
+ * @return {Object} The root client ID, index to insert at and starting filter value.
206
242
  */
207
243
 
208
244
  export function __experimentalGetInsertionPoint(state) {
209
245
  const {
210
246
  rootClientId,
211
- insertionIndex
247
+ insertionIndex,
248
+ filterValue
212
249
  } = state.blockInserterPanel;
213
250
  return {
214
251
  rootClientId,
215
- insertionIndex
252
+ insertionIndex,
253
+ filterValue
216
254
  };
217
255
  }
218
256
  /**
@@ -226,4 +264,42 @@ export function __experimentalGetInsertionPoint(state) {
226
264
  export function isListViewOpened(state) {
227
265
  return state.listViewPanel;
228
266
  }
267
+ /**
268
+ * Returns the template part blocks grouped by areas for the current edited template.
269
+ *
270
+ * @param {Object} state Global application state.
271
+ * @return {Object} Template part blocks by areas.
272
+ */
273
+
274
+ export const getTemplateAreaBlocks = createRegistrySelector(select => state => {
275
+ const templateType = getEditedPostType(state);
276
+ const templateId = getEditedPostId(state);
277
+ const template = select(coreDataStore).getEditedEntityRecord('postType', templateType, templateId);
278
+ const templateParts = select(coreDataStore).getEntityRecords('postType', 'wp_template_part', {
279
+ per_page: -1
280
+ });
281
+ const templatePartsById = keyBy(templateParts, templatePart => templatePart.id);
282
+ const templatePartBlocksByAreas = {};
283
+
284
+ for (const block of (_template$blocks = template.blocks) !== null && _template$blocks !== void 0 ? _template$blocks : []) {
285
+ var _template$blocks;
286
+
287
+ if (isTemplatePart(block)) {
288
+ const {
289
+ attributes: {
290
+ theme,
291
+ slug
292
+ }
293
+ } = block;
294
+ const templatePartId = `${theme}//${slug}`;
295
+ const templatePart = templatePartsById[templatePartId];
296
+
297
+ if (templatePart) {
298
+ templatePartBlocksByAreas[templatePart.area] = block;
299
+ }
300
+ }
301
+ }
302
+
303
+ return templatePartBlocksByAreas;
304
+ });
229
305
  //# sourceMappingURL=selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["get","map","createSelector","store","coreDataStore","createRegistrySelector","uploadMedia","MENU_ROOT","MENU_TEMPLATE_PARTS","MENU_TEMPLATES_UNUSED","TEMPLATE_PARTS_SUB_MENUS","getTemplateLocation","isTemplateSuperseded","isFeatureActive","state","feature","preferences","features","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","select","canUser","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","hasFixedToolbar","__experimentalSetIsInserterOpened","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","homeTemplateId","getEditedPostType","editedPost","type","getEditedPostId","id","getPage","page","getNavigationPanelActiveMenu","navigationPanel","menu","getCurrentTemplateNavigationPanelSubMenu","templateType","templateId","template","getEntityRecord","find","submenu","area","templates","getEntityRecords","per_page","showOnFront","getEditedEntityRecord","show_on_front","slug","isNavigationOpened","isOpen","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","isListViewOpened","listViewPanel"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,GAAd,QAAyB,QAAzB;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;AAEA;AACA;AACA;;AACA,SACCC,SADD,EAECC,mBAFD,EAGCC,qBAHD,EAICC,wBAJD,QAKO,6DALP;AAMA,SACCC,mBADD,EAECC,oBAFD,QAGO,sEAHP;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,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C,+BAAT,CAA0CtD,KAA1C,EAAkD;AACxD,QAAM;AAAEuD,IAAAA,YAAF;AAAgBC,IAAAA;AAAhB,MAAmCxD,KAAK,CAACqD,kBAA/C;AACA,SAAO;AAAEE,IAAAA,YAAF;AAAgBC,IAAAA;AAAhB,GAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BzD,KAA3B,EAAmC;AACzC,SAAOA,KAAK,CAAC0D,aAAb;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get, map } 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';\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 * 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 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};\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]\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\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 {number?} Template ID.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.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 {number?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.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 state.editedPost.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\t{\n\t\t\t\tper_page: -1,\n\t\t\t}\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 and index to insert at.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst { rootClientId, insertionIndex } = state.blockInserterPanel;\n\treturn { rootClientId, insertionIndex };\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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["get","map","keyBy","createSelector","store","coreDataStore","createRegistrySelector","uploadMedia","isTemplatePart","MENU_ROOT","MENU_TEMPLATE_PARTS","MENU_TEMPLATES_UNUSED","TEMPLATE_PARTS_SUB_MENUS","getTemplateLocation","isTemplateSuperseded","isFeatureActive","state","feature","preferences","features","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","select","canUser","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","hasFixedToolbar","__experimentalSetIsInserterOpened","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","homeTemplateId","getCurrentEditedPost","editedPost","length","getPreviousEditedPost","getEditedPostType","type","getEditedPostId","id","getPreviousEditedPostType","getPreviousEditedPostId","getPage","page","getNavigationPanelActiveMenu","navigationPanel","menu","getCurrentTemplateNavigationPanelSubMenu","templateType","templateId","template","getEntityRecord","find","submenu","area","templates","getEntityRecords","per_page","showOnFront","getEditedEntityRecord","show_on_front","slug","isNavigationOpened","isOpen","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","getTemplateAreaBlocks","templateParts","templatePartsById","templatePart","templatePartBlocksByAreas","block","blocks","att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AAtC;;AAEA,UAAKN,YAAL,EAAoB;AACnBC,QAAAA,yBAAyB,CAAED,YAAY,CAACrB,IAAf,CAAzB,GAAiDuB,KAAjD;AACA;AACD;AACD;;AAED,SAAOD,yBAAP;AACA,CAvCyD,CAApD","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';\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 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};\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]\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[ state.editedPost.length - 1 ] || {};\n}\n\nfunction getPreviousEditedPost( state ) {\n\treturn state.editedPost[ state.editedPost.length - 2 ] || {};\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 previous 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 getPreviousEditedPostType( state ) {\n\treturn getPreviousEditedPost( state ).type;\n}\n\n/**\n * Returns the ID of the previous edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getPreviousEditedPostId( state ) {\n\treturn getPreviousEditedPost( 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\t{\n\t\t\t\tper_page: -1,\n\t\t\t}\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 part blocks grouped by areas for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Object} Template part blocks by areas.\n */\nexport const getTemplateAreaBlocks = 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( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\t{\n\t\t\t\tper_page: -1,\n\t\t\t}\n\t\t);\n\t\tconst templatePartsById = keyBy(\n\t\t\ttemplateParts,\n\t\t\t( templatePart ) => templatePart.id\n\t\t);\n\n\t\tconst templatePartBlocksByAreas = {};\n\n\t\tfor ( const block of template.blocks ?? [] ) {\n\t\t\tif ( isTemplatePart( 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\tif ( templatePart ) {\n\t\t\t\t\ttemplatePartBlocksByAreas[ templatePart.area ] = block;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn templatePartBlocksByAreas;\n\t}\n);\n"]}
@@ -122,6 +122,12 @@
122
122
  }
123
123
  }
124
124
 
125
+ @media (min-width: 782px) {
126
+ .components-panel__header + .interface-complementary-area-header {
127
+ margin-top: 0;
128
+ }
129
+ }
130
+
125
131
  .interface-complementary-area {
126
132
  background: #fff;
127
133
  color: #1e1e1e;
@@ -383,6 +389,39 @@ body.is-fullscreen-mode .interface-interface-skeleton {
383
389
  bottom: 0;
384
390
  }
385
391
 
392
+ .interface-more-menu-dropdown {
393
+ margin-right: -4px;
394
+ }
395
+ .interface-more-menu-dropdown .components-button {
396
+ width: auto;
397
+ padding: 0 2px;
398
+ }
399
+ @media (min-width: 600px) {
400
+ .interface-more-menu-dropdown {
401
+ margin-right: 0;
402
+ }
403
+ .interface-more-menu-dropdown .components-button {
404
+ padding: 0 4px;
405
+ }
406
+ }
407
+
408
+ .interface-more-menu-dropdown__content .components-popover__content {
409
+ min-width: 280px;
410
+ }
411
+ @media (min-width: 480px) {
412
+ .interface-more-menu-dropdown__content .components-popover__content {
413
+ width: auto;
414
+ max-width: 480px;
415
+ }
416
+ }
417
+ .interface-more-menu-dropdown__content .components-popover__content .components-dropdown-menu__menu {
418
+ padding: 0;
419
+ }
420
+
421
+ .components-popover.interface-more-menu-dropdown__content {
422
+ z-index: 99998;
423
+ }
424
+
386
425
  .interface-pinned-items {
387
426
  display: flex;
388
427
  }
@@ -411,6 +450,62 @@ body.is-fullscreen-mode .interface-interface-skeleton {
411
450
  padding: 6px;
412
451
  }
413
452
 
453
+ .edit-site-visual-editor {
454
+ position: relative;
455
+ background-color: #2f2f2f;
456
+ }
457
+ .edit-site-visual-editor.is-focus-mode {
458
+ padding: 48px 48px 0;
459
+ }
460
+
461
+ .edit-site-visual-editor__editor-canvas {
462
+ border-radius: 2px 2px 0 0;
463
+ }
464
+
465
+ .edit-site-visual-editor__back-button {
466
+ position: absolute;
467
+ top: 8px;
468
+ right: 8px;
469
+ color: #fff;
470
+ }
471
+ .edit-site-visual-editor__back-button:active:not([aria-disabled=true]), .edit-site-visual-editor__back-button:focus:not([aria-disabled=true]), .edit-site-visual-editor__back-button:hover {
472
+ color: #f0f0f0;
473
+ }
474
+
475
+ .edit-site-global-styles-preview {
476
+ display: flex;
477
+ align-items: center;
478
+ justify-content: center;
479
+ min-height: 152px;
480
+ margin: 16px;
481
+ line-height: 1;
482
+ }
483
+ .edit-site-global-styles-preview .component-color-indicator {
484
+ border-radius: 50%;
485
+ border: 0;
486
+ height: 36px;
487
+ width: 36px;
488
+ margin-right: 0;
489
+ padding: 0;
490
+ }
491
+
492
+ .edit-site-global-style-palette {
493
+ margin: 16px;
494
+ }
495
+ .edit-site-global-style-palette .component-color-indicator {
496
+ display: block;
497
+ border-radius: 50%;
498
+ border: 0;
499
+ height: 24px;
500
+ width: 24px;
501
+ margin-right: 0;
502
+ padding: 0;
503
+ }
504
+
505
+ .edit-site-global-styles-header__description {
506
+ padding: 0 16px;
507
+ }
508
+
414
509
  .edit-site-header {
415
510
  align-items: center;
416
511
  background-color: #fff;
@@ -681,9 +776,10 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
681
776
  background: #1e1e1e;
682
777
  border-radius: 0;
683
778
  color: #fff;
684
- height: 60px;
779
+ height: 61px;
685
780
  width: 60px;
686
781
  z-index: 1;
782
+ margin-bottom: -1px;
687
783
  }
688
784
  .edit-site-navigation-toggle__button.has-icon {
689
785
  min-width: 60px;
@@ -704,7 +800,7 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
704
800
  bottom: 9px;
705
801
  right: 9px;
706
802
  border-radius: 4px;
707
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #23282e;
803
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e;
708
804
  }
709
805
  @media (prefers-reduced-motion: reduce) {
710
806
  .edit-site-navigation-toggle__button.has-icon::before {
@@ -730,6 +826,7 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
730
826
  width: 0;
731
827
  overflow: hidden;
732
828
  background: #1e1e1e;
829
+ color: #fff;
733
830
  transition: width 100ms linear;
734
831
  }
735
832
  @media (prefers-reduced-motion: reduce) {
@@ -913,6 +1010,46 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
913
1010
  margin-bottom: 0;
914
1011
  }
915
1012
 
1013
+ .edit-site-global-styles-sidebar .components-navigation__menu-title-heading {
1014
+ font-size: 15.6px;
1015
+ font-weight: 500;
1016
+ }
1017
+
1018
+ .edit-site-global-styles-sidebar .components-navigation__item > button span {
1019
+ font-weight: 500;
1020
+ }
1021
+
1022
+ .edit-site-typography-panel,
1023
+ .edit-site-global-styles-sidebar .block-editor-panel-color-gradient-settings {
1024
+ border: 0;
1025
+ }
1026
+
1027
+ .edit-site-global-styles-sidebar__blocks-group {
1028
+ padding-top: 24px;
1029
+ border-top: 1px solid #e0e0e0;
1030
+ }
1031
+
1032
+ .edit-site-global-styles-sidebar__blocks-group-help {
1033
+ padding: 0 16px;
1034
+ }
1035
+
1036
+ .edit-site-global-styles-color-palette-panel {
1037
+ padding: 16px;
1038
+ }
1039
+
1040
+ .edit-site-global-styles-sidebar__beta {
1041
+ display: inline-flex;
1042
+ margin-right: 8px;
1043
+ padding: 0 8px;
1044
+ height: 24px;
1045
+ border-radius: 2px;
1046
+ background-color: #000;
1047
+ color: #fff;
1048
+ align-items: center;
1049
+ font-size: 12px;
1050
+ line-height: 1;
1051
+ }
1052
+
916
1053
  .components-panel__header.edit-site-sidebar__panel-tabs {
917
1054
  justify-content: flex-start;
918
1055
  padding-right: 0;
@@ -1091,30 +1228,32 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
1091
1228
  right: 0 !important;
1092
1229
  }
1093
1230
 
1094
- .edit-site-template-details {
1095
- margin: 8px 16px;
1231
+ .edit-site-template-details .edit-site-template-details__group {
1232
+ margin: 0;
1233
+ padding: 16px;
1234
+ }
1235
+ .edit-site-template-details .edit-site-template-details__group + .edit-site-template-details__group {
1236
+ border-top: 1px solid #ccc;
1096
1237
  }
1097
- .edit-site-template-details p {
1098
- padding: 8px 0;
1238
+ .edit-site-template-details .edit-site-template-details__title {
1239
+ margin: 0 0 12px;
1099
1240
  }
1100
-
1101
- .edit-site-template-details__description {
1241
+ .edit-site-template-details .edit-site-template-details__description {
1242
+ margin: 0 0 12px;
1102
1243
  color: #757575;
1103
1244
  }
1104
-
1105
- .edit-site-template-details__revert {
1106
- border-top: 1px solid #ccc;
1245
+ .edit-site-template-details .edit-site-template-details__group.edit-site-template-details__template-areas {
1246
+ padding: 8px;
1107
1247
  }
1108
- .edit-site-template-details__revert .components-menu-item__button {
1248
+ .edit-site-template-details .edit-site-template-details__revert-button {
1109
1249
  height: auto;
1110
- padding: 16px;
1250
+ padding: 0;
1111
1251
  text-align: right;
1112
1252
  }
1113
- .edit-site-template-details__revert .components-menu-item__button:focus:not(:disabled) {
1253
+ .edit-site-template-details .edit-site-template-details__revert-button:focus:not(:disabled) {
1114
1254
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 0 0 3px #fff;
1115
1255
  }
1116
-
1117
- .edit-site-template-details__show-all-button.components-button {
1256
+ .edit-site-template-details .edit-site-template-details__show-all-button.components-button {
1118
1257
  display: block;
1119
1258
  background: #1e1e1e;
1120
1259
  color: #fff;
@@ -1122,13 +1261,13 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
1122
1261
  height: 44px;
1123
1262
  border-radius: 0;
1124
1263
  }
1125
- .edit-site-template-details__show-all-button.components-button:hover {
1264
+ .edit-site-template-details .edit-site-template-details__show-all-button.components-button:hover {
1126
1265
  color: #fff;
1127
1266
  }
1128
- .edit-site-template-details__show-all-button.components-button:active {
1267
+ .edit-site-template-details .edit-site-template-details__show-all-button.components-button:active {
1129
1268
  color: #ccc;
1130
1269
  }
1131
- .edit-site-template-details__show-all-button.components-button:focus:not(:disabled) {
1270
+ .edit-site-template-details .edit-site-template-details__show-all-button.components-button:focus:not(:disabled) {
1132
1271
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 0 0 3px #fff;
1133
1272
  }
1134
1273