@wordpress/edit-site 4.19.0 → 5.0.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 (319) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/add-new-template/add-custom-template-modal.js +1 -0
  3. package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
  4. package/build/components/add-new-template/index.js +8 -5
  5. package/build/components/add-new-template/index.js.map +1 -1
  6. package/build/components/add-new-template/new-template-part.js +21 -6
  7. package/build/components/add-new-template/new-template-part.js.map +1 -1
  8. package/build/components/add-new-template/new-template.js +12 -8
  9. package/build/components/add-new-template/new-template.js.map +1 -1
  10. package/build/components/app/index.js +15 -30
  11. package/build/components/app/index.js.map +1 -1
  12. package/build/components/block-editor/editor-canvas.js +64 -0
  13. package/build/components/block-editor/editor-canvas.js.map +1 -0
  14. package/build/components/block-editor/index.js +61 -59
  15. package/build/components/block-editor/index.js.map +1 -1
  16. package/build/components/block-editor/resizable-editor.js +10 -44
  17. package/build/components/block-editor/resizable-editor.js.map +1 -1
  18. package/build/components/editor/index.js +80 -127
  19. package/build/components/editor/index.js.map +1 -1
  20. package/build/components/global-styles/block-preview-panel.js +42 -0
  21. package/build/components/global-styles/block-preview-panel.js.map +1 -0
  22. package/build/components/global-styles/context-menu.js +6 -2
  23. package/build/components/global-styles/context-menu.js.map +1 -1
  24. package/build/components/global-styles/custom-css.js +61 -0
  25. package/build/components/global-styles/custom-css.js.map +1 -0
  26. package/build/components/global-styles/dimensions-panel.js +2 -6
  27. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  28. package/build/components/global-styles/global-styles-provider.js +15 -2
  29. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  30. package/build/components/global-styles/hooks.js +5 -2
  31. package/build/components/global-styles/hooks.js.map +1 -1
  32. package/build/components/global-styles/palette.js +1 -1
  33. package/build/components/global-styles/palette.js.map +1 -1
  34. package/build/components/global-styles/screen-block-list.js +2 -1
  35. package/build/components/global-styles/screen-block-list.js.map +1 -1
  36. package/build/components/global-styles/screen-block.js +10 -2
  37. package/build/components/global-styles/screen-block.js.map +1 -1
  38. package/build/components/global-styles/screen-border.js +43 -0
  39. package/build/components/global-styles/screen-border.js.map +1 -0
  40. package/build/components/global-styles/screen-colors.js +1 -1
  41. package/build/components/global-styles/screen-colors.js.map +1 -1
  42. package/build/components/global-styles/screen-css.js +42 -0
  43. package/build/components/global-styles/screen-css.js.map +1 -0
  44. package/build/components/global-styles/screen-layout.js +0 -5
  45. package/build/components/global-styles/screen-layout.js.map +1 -1
  46. package/build/components/global-styles/screen-root.js +14 -1
  47. package/build/components/global-styles/screen-root.js.map +1 -1
  48. package/build/components/global-styles/screen-style-variations.js +3 -3
  49. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  50. package/build/components/global-styles/ui.js +50 -4
  51. package/build/components/global-styles/ui.js.map +1 -1
  52. package/build/components/global-styles/use-global-styles-output.js +5 -1
  53. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  54. package/build/components/global-styles/utils.js +3 -3
  55. package/build/components/global-styles/utils.js.map +1 -1
  56. package/build/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +4 -8
  57. package/build/components/global-styles-renderer/index.js.map +1 -0
  58. package/build/components/header-edit-mode/document-actions/index.js +12 -5
  59. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  60. package/build/components/header-edit-mode/index.js +19 -12
  61. package/build/components/header-edit-mode/index.js.map +1 -1
  62. package/build/components/keyboard-shortcuts/index.js +11 -1
  63. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  64. package/build/components/layout/index.js +231 -0
  65. package/build/components/layout/index.js.map +1 -0
  66. package/build/components/list/header.js +5 -1
  67. package/build/components/list/header.js.map +1 -1
  68. package/build/components/list/index.js +4 -22
  69. package/build/components/list/index.js.map +1 -1
  70. package/build/components/navigate-to-link/index.js +1 -3
  71. package/build/components/navigate-to-link/index.js.map +1 -1
  72. package/build/components/routes/index.js +1 -1
  73. package/build/components/routes/index.js.map +1 -1
  74. package/build/components/sidebar/index.js +42 -0
  75. package/build/components/sidebar/index.js.map +1 -0
  76. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +24 -4
  77. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  78. package/build/components/sidebar-edit-mode/index.js +1 -1
  79. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  80. package/build/components/sidebar-navigation-item/index.js +53 -0
  81. package/build/components/sidebar-navigation-item/index.js.map +1 -0
  82. package/build/components/sidebar-navigation-screen/index.js +49 -0
  83. package/build/components/sidebar-navigation-screen/index.js.map +1 -0
  84. package/build/components/sidebar-navigation-screen-main/index.js +76 -0
  85. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -0
  86. package/build/components/sidebar-navigation-screen-templates/index.js +188 -0
  87. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -0
  88. package/build/components/site-icon/index.js +70 -0
  89. package/build/components/site-icon/index.js.map +1 -0
  90. package/build/components/site-title/index.js +55 -0
  91. package/build/components/site-title/index.js.map +1 -0
  92. package/build/components/style-book/index.js +173 -0
  93. package/build/components/style-book/index.js.map +1 -0
  94. package/build/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +5 -4
  95. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -0
  96. package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +53 -0
  97. package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +1 -0
  98. package/build/index.js +2 -45
  99. package/build/index.js.map +1 -1
  100. package/build/store/actions.js +93 -43
  101. package/build/store/actions.js.map +1 -1
  102. package/build/store/reducer.js +35 -107
  103. package/build/store/reducer.js.map +1 -1
  104. package/build/store/selectors.js +69 -78
  105. package/build/store/selectors.js.map +1 -1
  106. package/build-module/components/add-new-template/add-custom-template-modal.js +1 -0
  107. package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
  108. package/build-module/components/add-new-template/index.js +7 -5
  109. package/build-module/components/add-new-template/index.js.map +1 -1
  110. package/build-module/components/add-new-template/new-template-part.js +18 -6
  111. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  112. package/build-module/components/add-new-template/new-template.js +13 -9
  113. package/build-module/components/add-new-template/new-template.js.map +1 -1
  114. package/build-module/components/app/index.js +15 -28
  115. package/build-module/components/app/index.js.map +1 -1
  116. package/build-module/components/block-editor/editor-canvas.js +51 -0
  117. package/build-module/components/block-editor/editor-canvas.js.map +1 -0
  118. package/build-module/components/block-editor/index.js +61 -60
  119. package/build-module/components/block-editor/index.js.map +1 -1
  120. package/build-module/components/block-editor/resizable-editor.js +11 -40
  121. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  122. package/build-module/components/editor/index.js +81 -124
  123. package/build-module/components/editor/index.js.map +1 -1
  124. package/build-module/components/global-styles/block-preview-panel.js +32 -0
  125. package/build-module/components/global-styles/block-preview-panel.js.map +1 -0
  126. package/build-module/components/global-styles/context-menu.js +7 -3
  127. package/build-module/components/global-styles/context-menu.js.map +1 -1
  128. package/build-module/components/global-styles/custom-css.js +51 -0
  129. package/build-module/components/global-styles/custom-css.js.map +1 -0
  130. package/build-module/components/global-styles/dimensions-panel.js +3 -7
  131. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  132. package/build-module/components/global-styles/global-styles-provider.js +15 -2
  133. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  134. package/build-module/components/global-styles/hooks.js +5 -3
  135. package/build-module/components/global-styles/hooks.js.map +1 -1
  136. package/build-module/components/global-styles/palette.js +1 -1
  137. package/build-module/components/global-styles/palette.js.map +1 -1
  138. package/build-module/components/global-styles/screen-block-list.js +2 -1
  139. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  140. package/build-module/components/global-styles/screen-block.js +8 -2
  141. package/build-module/components/global-styles/screen-block.js.map +1 -1
  142. package/build-module/components/global-styles/screen-border.js +27 -0
  143. package/build-module/components/global-styles/screen-border.js.map +1 -0
  144. package/build-module/components/global-styles/screen-colors.js +1 -1
  145. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  146. package/build-module/components/global-styles/screen-css.js +28 -0
  147. package/build-module/components/global-styles/screen-css.js.map +1 -0
  148. package/build-module/components/global-styles/screen-layout.js +0 -4
  149. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  150. package/build-module/components/global-styles/screen-root.js +14 -1
  151. package/build-module/components/global-styles/screen-root.js.map +1 -1
  152. package/build-module/components/global-styles/screen-style-variations.js +2 -2
  153. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  154. package/build-module/components/global-styles/ui.js +48 -5
  155. package/build-module/components/global-styles/ui.js.map +1 -1
  156. package/build-module/components/global-styles/use-global-styles-output.js +5 -1
  157. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  158. package/build-module/components/global-styles/utils.js +4 -4
  159. package/build-module/components/global-styles/utils.js.map +1 -1
  160. package/build-module/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +4 -7
  161. package/build-module/components/global-styles-renderer/index.js.map +1 -0
  162. package/build-module/components/header-edit-mode/document-actions/index.js +13 -6
  163. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  164. package/build-module/components/header-edit-mode/index.js +16 -11
  165. package/build-module/components/header-edit-mode/index.js.map +1 -1
  166. package/build-module/components/keyboard-shortcuts/index.js +10 -1
  167. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  168. package/build-module/components/layout/index.js +203 -0
  169. package/build-module/components/layout/index.js.map +1 -0
  170. package/build-module/components/list/header.js +5 -1
  171. package/build-module/components/list/header.js.map +1 -1
  172. package/build-module/components/list/index.js +4 -19
  173. package/build-module/components/list/index.js.map +1 -1
  174. package/build-module/components/navigate-to-link/index.js +1 -3
  175. package/build-module/components/navigate-to-link/index.js.map +1 -1
  176. package/build-module/components/routes/index.js +1 -1
  177. package/build-module/components/routes/index.js.map +1 -1
  178. package/build-module/components/sidebar/index.js +30 -0
  179. package/build-module/components/sidebar/index.js.map +1 -0
  180. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +27 -7
  181. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  182. package/build-module/components/sidebar-edit-mode/index.js +3 -3
  183. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  184. package/build-module/components/sidebar-navigation-item/index.js +40 -0
  185. package/build-module/components/sidebar-navigation-item/index.js.map +1 -0
  186. package/build-module/components/sidebar-navigation-screen/index.js +39 -0
  187. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -0
  188. package/build-module/components/sidebar-navigation-screen-main/index.js +57 -0
  189. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -0
  190. package/build-module/components/sidebar-navigation-screen-templates/index.js +165 -0
  191. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -0
  192. package/build-module/components/site-icon/index.js +55 -0
  193. package/build-module/components/site-icon/index.js.map +1 -0
  194. package/build-module/components/site-title/index.js +43 -0
  195. package/build-module/components/site-title/index.js.map +1 -0
  196. package/build-module/components/style-book/index.js +156 -0
  197. package/build-module/components/style-book/index.js.map +1 -0
  198. package/build-module/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +4 -3
  199. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -0
  200. package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +43 -0
  201. package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +1 -0
  202. package/build-module/index.js +5 -36
  203. package/build-module/index.js.map +1 -1
  204. package/build-module/store/actions.js +87 -42
  205. package/build-module/store/actions.js.map +1 -1
  206. package/build-module/store/reducer.js +35 -102
  207. package/build-module/store/reducer.js.map +1 -1
  208. package/build-module/store/selectors.js +60 -72
  209. package/build-module/store/selectors.js.map +1 -1
  210. package/build-style/style-rtl.css +550 -346
  211. package/build-style/style.css +550 -346
  212. package/package.json +32 -31
  213. package/src/components/add-new-template/add-custom-template-modal.js +1 -0
  214. package/src/components/add-new-template/index.js +6 -3
  215. package/src/components/add-new-template/new-template-part.js +15 -3
  216. package/src/components/add-new-template/new-template.js +14 -7
  217. package/src/components/add-new-template/style.scss +0 -4
  218. package/src/components/app/index.js +14 -43
  219. package/src/components/block-editor/editor-canvas.js +69 -0
  220. package/src/components/block-editor/index.js +102 -87
  221. package/src/components/block-editor/resizable-editor.js +9 -64
  222. package/src/components/block-editor/style.scss +25 -1
  223. package/src/components/code-editor/style.scss +1 -1
  224. package/src/components/editor/index.js +170 -236
  225. package/src/components/editor/style.scss +0 -22
  226. package/src/components/global-styles/block-preview-panel.js +29 -0
  227. package/src/components/global-styles/context-menu.js +11 -2
  228. package/src/components/global-styles/custom-css.js +73 -0
  229. package/src/components/global-styles/dimensions-panel.js +2 -5
  230. package/src/components/global-styles/global-styles-provider.js +39 -17
  231. package/src/components/global-styles/hooks.js +8 -3
  232. package/src/components/global-styles/palette.js +1 -1
  233. package/src/components/global-styles/screen-block-list.js +2 -1
  234. package/src/components/global-styles/screen-block.js +9 -1
  235. package/src/components/global-styles/screen-border.js +23 -0
  236. package/src/components/global-styles/screen-colors.js +2 -1
  237. package/src/components/global-styles/screen-css.js +33 -0
  238. package/src/components/global-styles/screen-layout.js +0 -3
  239. package/src/components/global-styles/screen-root.js +30 -1
  240. package/src/components/global-styles/screen-style-variations.js +5 -2
  241. package/src/components/global-styles/style.scss +31 -2
  242. package/src/components/global-styles/ui.js +47 -4
  243. package/src/components/global-styles/use-global-styles-output.js +5 -0
  244. package/src/components/global-styles/utils.js +8 -5
  245. package/src/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +3 -9
  246. package/src/components/header-edit-mode/document-actions/index.js +14 -9
  247. package/src/components/header-edit-mode/document-actions/style.scss +8 -1
  248. package/src/components/header-edit-mode/index.js +96 -78
  249. package/src/components/header-edit-mode/style.scss +5 -33
  250. package/src/components/keyboard-shortcuts/index.js +13 -0
  251. package/src/components/layout/index.js +278 -0
  252. package/src/components/layout/style.scss +176 -0
  253. package/src/components/list/header.js +5 -1
  254. package/src/components/list/index.js +12 -31
  255. package/src/components/list/style.scss +10 -4
  256. package/src/components/navigate-to-link/index.js +2 -8
  257. package/src/components/routes/index.js +1 -1
  258. package/src/components/sidebar/index.js +34 -0
  259. package/src/components/sidebar/style.scss +8 -0
  260. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -7
  261. package/src/components/sidebar-edit-mode/index.js +3 -3
  262. package/src/components/sidebar-edit-mode/navigation-menu-sidebar/style.scss +21 -3
  263. package/src/components/sidebar-edit-mode/settings-header/style.scss +47 -34
  264. package/src/components/sidebar-edit-mode/style.scss +0 -13
  265. package/src/components/sidebar-navigation-item/index.js +51 -0
  266. package/src/components/sidebar-navigation-item/style.scss +17 -0
  267. package/src/components/sidebar-navigation-screen/index.js +55 -0
  268. package/src/components/sidebar-navigation-screen/style.scss +41 -0
  269. package/src/components/sidebar-navigation-screen-main/index.js +72 -0
  270. package/src/components/sidebar-navigation-screen-templates/index.js +181 -0
  271. package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
  272. package/src/components/site-icon/index.js +56 -0
  273. package/src/components/site-icon/style.scss +10 -0
  274. package/src/components/site-title/index.js +39 -0
  275. package/src/components/style-book/index.js +193 -0
  276. package/src/components/style-book/style.scss +78 -0
  277. package/src/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +3 -3
  278. package/src/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +36 -0
  279. package/src/components/template-details/style.scss +4 -0
  280. package/src/index.js +3 -53
  281. package/src/store/actions.js +93 -48
  282. package/src/store/reducer.js +29 -91
  283. package/src/store/selectors.js +61 -101
  284. package/src/store/test/actions.js +3 -15
  285. package/src/store/test/reducer.js +8 -192
  286. package/src/store/test/selectors.js +3 -42
  287. package/src/style.scss +19 -3
  288. package/build/components/editor/global-styles-renderer.js.map +0 -1
  289. package/build/components/navigation-sidebar/index.js +0 -62
  290. package/build/components/navigation-sidebar/index.js.map +0 -1
  291. package/build/components/navigation-sidebar/navigation-panel/constants.js +0 -77
  292. package/build/components/navigation-sidebar/navigation-panel/constants.js.map +0 -1
  293. package/build/components/navigation-sidebar/navigation-panel/index.js +0 -152
  294. package/build/components/navigation-sidebar/navigation-panel/index.js.map +0 -1
  295. package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -81
  296. package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +0 -1
  297. package/build/components/navigation-sidebar/navigation-toggle/index.js +0 -124
  298. package/build/components/navigation-sidebar/navigation-toggle/index.js.map +0 -1
  299. package/build/components/url-query-controller/index.js.map +0 -1
  300. package/build-module/components/editor/global-styles-renderer.js.map +0 -1
  301. package/build-module/components/navigation-sidebar/index.js +0 -45
  302. package/build-module/components/navigation-sidebar/index.js.map +0 -1
  303. package/build-module/components/navigation-sidebar/navigation-panel/constants.js +0 -49
  304. package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +0 -1
  305. package/build-module/components/navigation-sidebar/navigation-panel/index.js +0 -131
  306. package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +0 -1
  307. package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -66
  308. package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +0 -1
  309. package/build-module/components/navigation-sidebar/navigation-toggle/index.js +0 -108
  310. package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +0 -1
  311. package/build-module/components/url-query-controller/index.js.map +0 -1
  312. package/src/components/navigation-sidebar/index.js +0 -46
  313. package/src/components/navigation-sidebar/navigation-panel/constants.js +0 -94
  314. package/src/components/navigation-sidebar/navigation-panel/index.js +0 -142
  315. package/src/components/navigation-sidebar/navigation-panel/style.scss +0 -152
  316. package/src/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -81
  317. package/src/components/navigation-sidebar/navigation-toggle/index.js +0 -114
  318. package/src/components/navigation-sidebar/navigation-toggle/style.scss +0 -71
  319. package/src/components/navigation-sidebar/navigation-toggle/test/index.js +0 -65
@@ -8,20 +8,12 @@ import deepFreeze from 'deep-freeze';
8
8
  */
9
9
  import {
10
10
  settings,
11
- homeTemplateId,
12
11
  editedPost,
13
- navigationPanel,
14
12
  blockInserterPanel,
15
13
  listViewPanel,
16
14
  } from '../reducer';
17
15
 
18
- import {
19
- setNavigationPanelActiveMenu,
20
- openNavigationPanelToMenu,
21
- setIsNavigationPanelOpened,
22
- setIsInserterOpened,
23
- setIsListViewOpened,
24
- } from '../actions';
16
+ import { setIsInserterOpened, setIsListViewOpened } from '../actions';
25
17
 
26
18
  describe( 'state', () => {
27
19
  describe( 'settings()', () => {
@@ -53,17 +45,6 @@ describe( 'state', () => {
53
45
  } );
54
46
  } );
55
47
 
56
- describe( 'homeTemplateId()', () => {
57
- it( 'should apply default state', () => {
58
- expect( homeTemplateId( undefined, {} ) ).toEqual( undefined );
59
- } );
60
-
61
- it( 'should default to returning the same state', () => {
62
- const state = {};
63
- expect( homeTemplateId( state, {} ) ).toBe( state );
64
- } );
65
- } );
66
-
67
48
  describe( 'editedPost()', () => {
68
49
  it( 'should apply default state', () => {
69
50
  expect( editedPost( undefined, {} ) ).toEqual( {} );
@@ -79,153 +60,18 @@ describe( 'state', () => {
79
60
  editedPost(
80
61
  { id: 1, type: 'wp_template' },
81
62
  {
82
- type: 'SET_TEMPLATE',
83
- templateId: 2,
84
- }
85
- )
86
- ).toEqual( { id: 2, type: 'wp_template' } );
87
- } );
88
-
89
- it( 'should update when a page is set', () => {
90
- expect(
91
- editedPost(
92
- { id: 1, type: 'wp_template' },
93
- {
94
- type: 'SET_PAGE',
95
- templateId: 2,
96
- page: {},
97
- }
98
- )
99
- ).toEqual( { id: 2, type: 'wp_template', page: {} } );
100
- } );
101
-
102
- it( 'should update when a template part is set', () => {
103
- expect(
104
- editedPost(
105
- { id: 1, type: 'wp_template' },
106
- {
107
- type: 'SET_TEMPLATE_PART',
108
- templatePartId: 2,
63
+ type: 'SET_EDITED_POST',
64
+ postType: 'wp_template',
65
+ id: 2,
66
+ context: { templateSlug: 'slug' },
109
67
  }
110
68
  )
111
- ).toEqual( { id: 2, type: 'wp_template_part' } );
112
- } );
113
- } );
114
-
115
- describe( 'navigationPanel()', () => {
116
- it( 'should apply default state', () => {
117
- expect( navigationPanel( undefined, {} ) ).toEqual( {
118
- menu: 'root',
119
- isOpen: false,
120
- } );
121
- } );
122
-
123
- it( 'should default to returning the same state', () => {
124
- const state = { test: 1 };
125
- expect( navigationPanel( state, {} ) ).toBe( state );
126
- } );
127
-
128
- it( 'should set the active navigation panel', () => {
129
- expect(
130
- navigationPanel(
131
- undefined,
132
- setNavigationPanelActiveMenu( 'test-menu' )
133
- )
134
69
  ).toEqual( {
135
- isOpen: false,
136
- menu: 'test-menu',
70
+ postType: 'wp_template',
71
+ id: 2,
72
+ context: { templateSlug: 'slug' },
137
73
  } );
138
74
  } );
139
-
140
- it( 'should be able to open the navigation panel to a menu', () => {
141
- expect(
142
- navigationPanel(
143
- undefined,
144
- openNavigationPanelToMenu( 'test-menu' )
145
- )
146
- ).toEqual( {
147
- isOpen: true,
148
- menu: 'test-menu',
149
- } );
150
- } );
151
-
152
- it( 'should be able to open the navigation panel', () => {
153
- expect(
154
- navigationPanel( undefined, setIsNavigationPanelOpened( true ) )
155
- ).toEqual( {
156
- isOpen: true,
157
- menu: 'root',
158
- } );
159
- } );
160
-
161
- it( 'should change the menu to root when closing the panel', () => {
162
- const state = navigationPanel(
163
- undefined,
164
- openNavigationPanelToMenu( 'test-menu' )
165
- );
166
-
167
- expect( state.menu ).toEqual( 'test-menu' );
168
- expect(
169
- navigationPanel( state, setIsNavigationPanelOpened( false ) )
170
- ).toEqual( {
171
- isOpen: false,
172
- menu: 'root',
173
- } );
174
- } );
175
-
176
- it( 'should close the navigation panel when opening the inserter and change the menu to root', () => {
177
- const state = navigationPanel(
178
- undefined,
179
- openNavigationPanelToMenu( 'test-menu' )
180
- );
181
-
182
- expect( state.menu ).toEqual( 'test-menu' );
183
- expect(
184
- navigationPanel( state, setIsInserterOpened( true ) )
185
- ).toEqual( {
186
- isOpen: false,
187
- menu: 'root',
188
- } );
189
- } );
190
-
191
- it( 'should close the navigation panel when opening the list view and change the menu to root', () => {
192
- const state = navigationPanel(
193
- undefined,
194
- openNavigationPanelToMenu( 'test-menu' )
195
- );
196
-
197
- expect( state.menu ).toEqual( 'test-menu' );
198
- expect(
199
- navigationPanel( state, setIsListViewOpened( true ) )
200
- ).toEqual( {
201
- isOpen: false,
202
- menu: 'root',
203
- } );
204
- } );
205
-
206
- it( 'should not change the state when closing the inserter', () => {
207
- const state = navigationPanel(
208
- undefined,
209
- openNavigationPanelToMenu( 'test-menu' )
210
- );
211
-
212
- expect( state.menu ).toEqual( 'test-menu' );
213
- expect(
214
- navigationPanel( state, setIsInserterOpened( false ) )
215
- ).toEqual( state );
216
- } );
217
-
218
- it( 'should not change the state when closing the list view', () => {
219
- const state = navigationPanel(
220
- undefined,
221
- openNavigationPanelToMenu( 'test-menu' )
222
- );
223
-
224
- expect( state.menu ).toEqual( 'test-menu' );
225
- expect(
226
- navigationPanel( state, setIsListViewOpened( false ) )
227
- ).toEqual( state );
228
- } );
229
75
  } );
230
76
 
231
77
  describe( 'blockInserterPanel()', () => {
@@ -246,27 +92,12 @@ describe( 'state', () => {
246
92
  ).toBe( false );
247
93
  } );
248
94
 
249
- it( 'should close the inserter when opening the nav panel', () => {
250
- expect(
251
- blockInserterPanel( true, openNavigationPanelToMenu( 'noop' ) )
252
- ).toBe( false );
253
- expect(
254
- blockInserterPanel( true, setIsNavigationPanelOpened( true ) )
255
- ).toBe( false );
256
- } );
257
-
258
95
  it( 'should close the inserter when opening the list view panel', () => {
259
96
  expect(
260
97
  blockInserterPanel( true, setIsListViewOpened( true ) )
261
98
  ).toBe( false );
262
99
  } );
263
100
 
264
- it( 'should not change the state when closing the nav panel', () => {
265
- expect(
266
- blockInserterPanel( true, setIsNavigationPanelOpened( false ) )
267
- ).toBe( true );
268
- } );
269
-
270
101
  it( 'should not change the state when closing the list view panel', () => {
271
102
  expect(
272
103
  blockInserterPanel( true, setIsListViewOpened( false ) )
@@ -292,27 +123,12 @@ describe( 'state', () => {
292
123
  );
293
124
  } );
294
125
 
295
- it( 'should close the list view when opening the nav panel', () => {
296
- expect(
297
- listViewPanel( true, openNavigationPanelToMenu( 'noop' ) )
298
- ).toBe( false );
299
- expect(
300
- listViewPanel( true, setIsNavigationPanelOpened( true ) )
301
- ).toBe( false );
302
- } );
303
-
304
126
  it( 'should close the list view when opening the inserter panel', () => {
305
127
  expect( listViewPanel( true, setIsInserterOpened( true ) ) ).toBe(
306
128
  false
307
129
  );
308
130
  } );
309
131
 
310
- it( 'should not change the state when closing the nav panel', () => {
311
- expect(
312
- listViewPanel( true, setIsNavigationPanelOpened( false ) )
313
- ).toBe( true );
314
- } );
315
-
316
132
  it( 'should not change the state when closing the inserter panel', () => {
317
133
  expect( listViewPanel( true, setIsInserterOpened( false ) ) ).toBe(
318
134
  true
@@ -9,13 +9,9 @@ import { store as coreDataStore } from '@wordpress/core-data';
9
9
  import {
10
10
  getCanUserCreateMedia,
11
11
  getSettings,
12
- getHomeTemplateId,
13
12
  getEditedPostType,
14
13
  getEditedPostId,
15
- getPage,
16
- getNavigationPanelActiveMenu,
17
14
  getReusableBlocks,
18
- isNavigationOpened,
19
15
  isInserterOpened,
20
16
  isListViewOpened,
21
17
  __unstableGetPreference,
@@ -72,7 +68,7 @@ describe( 'selectors', () => {
72
68
  const state = {
73
69
  settings: {},
74
70
  preferences: {},
75
- editedPost: { type: 'wp_template' },
71
+ editedPost: { postType: 'wp_template' },
76
72
  };
77
73
  const setInserterOpened = () => {};
78
74
  expect( getSettings( state, setInserterOpened ) ).toEqual( {
@@ -95,7 +91,7 @@ describe( 'selectors', () => {
95
91
 
96
92
  const state = {
97
93
  settings: { key: 'value' },
98
- editedPost: { type: 'wp_template_part' },
94
+ editedPost: { postType: 'wp_template_part' },
99
95
  };
100
96
  const setInserterOpened = () => {};
101
97
 
@@ -114,13 +110,6 @@ describe( 'selectors', () => {
114
110
  } );
115
111
  } );
116
112
 
117
- describe( 'getHomeTemplateId', () => {
118
- it( 'returns the home template ID', () => {
119
- const state = { homeTemplateId: {} };
120
- expect( getHomeTemplateId( state ) ).toBe( state.homeTemplateId );
121
- } );
122
- } );
123
-
124
113
  describe( 'getEditedPostId', () => {
125
114
  it( 'returns the template ID', () => {
126
115
  const state = { editedPost: { id: 10 } };
@@ -130,39 +119,11 @@ describe( 'selectors', () => {
130
119
 
131
120
  describe( 'getEditedPostType', () => {
132
121
  it( 'returns the template type', () => {
133
- const state = { editedPost: { type: 'wp_template' } };
122
+ const state = { editedPost: { postType: 'wp_template' } };
134
123
  expect( getEditedPostType( state ) ).toBe( 'wp_template' );
135
124
  } );
136
125
  } );
137
126
 
138
- describe( 'getPage', () => {
139
- it( 'returns the page object', () => {
140
- const page = {};
141
- const state = { editedPost: { page } };
142
- expect( getPage( state ) ).toBe( page );
143
- } );
144
- } );
145
-
146
- describe( 'getNavigationPanelActiveMenu', () => {
147
- it( 'returns the current navigation menu', () => {
148
- const state = {
149
- navigationPanel: { menu: 'test-menu', isOpen: false },
150
- };
151
- expect( getNavigationPanelActiveMenu( state ) ).toBe( 'test-menu' );
152
- } );
153
- } );
154
-
155
- describe( 'isNavigationOpened', () => {
156
- it( 'returns the navigation panel isOpened state', () => {
157
- const state = {
158
- navigationPanel: { menu: 'test-menu', isOpen: false },
159
- };
160
- expect( isNavigationOpened( state ) ).toBe( false );
161
- state.navigationPanel.isOpen = true;
162
- expect( isNavigationOpened( state ) ).toBe( true );
163
- } );
164
- } );
165
-
166
127
  describe( 'isInserterOpened', () => {
167
128
  it( 'returns the block inserter panel isOpened state', () => {
168
129
  const state = {
package/src/style.scss CHANGED
@@ -5,8 +5,6 @@
5
5
  @import "./components/global-styles/style.scss";
6
6
  @import "./components/header-edit-mode/style.scss";
7
7
  @import "./components/header-edit-mode/document-actions/style.scss";
8
- @import "./components/navigation-sidebar/navigation-toggle/style.scss";
9
- @import "./components/navigation-sidebar/navigation-panel/style.scss";
10
8
  @import "./components/list/style.scss";
11
9
  @import "./components/add-new-template/style.scss";
12
10
  @import "./components/sidebar-edit-mode/style.scss";
@@ -19,11 +17,27 @@
19
17
  @import "./components/secondary-sidebar/style.scss";
20
18
  @import "./components/welcome-guide/style.scss";
21
19
  @import "./components/keyboard-shortcut-help-modal/style.scss";
20
+ @import "./components/layout/style.scss";
21
+ @import "./components/sidebar/style.scss";
22
+ @import "./components/sidebar-navigation-item/style.scss";
23
+ @import "./components/sidebar-navigation-screen/style.scss";
24
+ @import "./components/sidebar-navigation-screen-templates/style.scss";
25
+ @import "./components/site-icon/style.scss";
26
+ @import "./components/style-book/style.scss";
27
+
28
+ html #wpadminbar {
29
+ display: none;
30
+ }
31
+
32
+ html #wpbody {
33
+ padding-top: 0;
34
+ }
22
35
 
23
36
  // In order to use mix-blend-mode, this element needs to have an explicitly set background-color.
24
37
  // We scope it to .wp-toolbar to be wp-admin only, to prevent bleed into other implementations.
25
38
  html.wp-toolbar {
26
39
  background: $white;
40
+ padding-top: 0;
27
41
  }
28
42
 
29
43
  body.appearance_page_gutenberg-template-parts,
@@ -38,13 +52,15 @@ body.site-editor-php {
38
52
  }
39
53
 
40
54
  .edit-site {
55
+ height: 100vh;
56
+
41
57
  // On mobile the main content area has to scroll, otherwise you can invoke
42
58
  // the over-scroll bounce on the non-scrolling container, for a bad experience.
43
59
  @include break-small {
44
60
  bottom: 0;
45
61
  left: 0;
46
62
  min-height: 100vh;
47
- position: absolute;
63
+ position: fixed;
48
64
  right: 0;
49
65
  top: 0;
50
66
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/editor/global-styles-renderer.js"],"names":["useGlobalStylesRenderer","styles","settings","svgFilters","getSettings","editSiteStore","updateSettings","currentStoreSettings","nonGlobalStyles","style","isGlobalStyles","__experimentalFeatures","GlobalStylesRenderer"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAKA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AAGA,SAASA,uBAAT,GAAmC;AAClC,QAAM,CAAEC,MAAF,EAAUC,QAAV,EAAoBC,UAApB,IAAmC,mDAAzC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAkB,qBAAWC,YAAX,CAAxB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAqB,uBAAaD,YAAb,CAA3B;AAEA,0BAAW,MAAM;AAChB,QAAK,CAAEJ,MAAF,IAAY,CAAEC,QAAnB,EAA8B;AAC7B;AACA;;AAED,UAAMK,oBAAoB,GAAGH,WAAW,EAAxC;AACA,UAAMI,eAAe,GAAG,oBACvBD,oBAAoB,CAACN,MADE,EAErBQ,KAAF,IAAa,CAAEA,KAAK,CAACC,cAFE,CAAxB;AAIAJ,IAAAA,cAAc,CAAE,EACf,GAAGC,oBADY;AAEfN,MAAAA,MAAM,EAAE,CAAE,GAAGO,eAAL,EAAsB,GAAGP,MAAzB,CAFO;AAGfE,MAAAA,UAHe;AAIfQ,MAAAA,sBAAsB,EAAET;AAJT,KAAF,CAAd;AAMA,GAhBD,EAgBG,CAAED,MAAF,EAAUC,QAAV,CAhBH;AAiBA;;AAEM,SAASU,oBAAT,GAAgC;AACtCZ,EAAAA,uBAAuB;AAEvB,SAAO,IAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { filter } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesOutput } from '../global-styles/use-global-styles-output';\n\nfunction useGlobalStylesRenderer() {\n\tconst [ styles, settings, svgFilters ] = useGlobalStylesOutput();\n\tconst { getSettings } = useSelect( editSiteStore );\n\tconst { updateSettings } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( ! styles || ! settings ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentStoreSettings = getSettings();\n\t\tconst nonGlobalStyles = filter(\n\t\t\tcurrentStoreSettings.styles,\n\t\t\t( style ) => ! style.isGlobalStyles\n\t\t);\n\t\tupdateSettings( {\n\t\t\t...currentStoreSettings,\n\t\t\tstyles: [ ...nonGlobalStyles, ...styles ],\n\t\t\tsvgFilters,\n\t\t\t__experimentalFeatures: settings,\n\t\t} );\n\t}, [ styles, settings ] );\n}\n\nexport function GlobalStylesRenderer() {\n\tuseGlobalStylesRenderer();\n\n\treturn null;\n}\n"]}
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = exports.NavigationPanelPreviewSlot = exports.NavigationPanelPreviewFill = void 0;
9
-
10
- var _element = require("@wordpress/element");
11
-
12
- var _components = require("@wordpress/components");
13
-
14
- var _compose = require("@wordpress/compose");
15
-
16
- var _data = require("@wordpress/data");
17
-
18
- var _store = require("../../store");
19
-
20
- var _navigationPanel = _interopRequireDefault(require("./navigation-panel"));
21
-
22
- var _navigationToggle = _interopRequireDefault(require("./navigation-toggle"));
23
-
24
- /**
25
- * WordPress dependencies
26
- */
27
-
28
- /**
29
- * Internal dependencies
30
- */
31
- const {
32
- Fill: NavigationPanelPreviewFill,
33
- Slot: NavigationPanelPreviewSlot
34
- } = (0, _components.createSlotFill)('EditSiteNavigationPanelPreview');
35
- exports.NavigationPanelPreviewSlot = NavigationPanelPreviewSlot;
36
- exports.NavigationPanelPreviewFill = NavigationPanelPreviewFill;
37
- const {
38
- Fill: NavigationSidebarFill,
39
- Slot: NavigationSidebarSlot
40
- } = (0, _components.createSlotFill)('EditSiteNavigationSidebar');
41
-
42
- function NavigationSidebar(_ref) {
43
- let {
44
- isDefaultOpen = false,
45
- activeTemplateType
46
- } = _ref;
47
- const isDesktopViewport = (0, _compose.useViewportMatch)('medium');
48
- const {
49
- setIsNavigationPanelOpened
50
- } = (0, _data.useDispatch)(_store.store);
51
- (0, _element.useEffect)(function autoOpenNavigationPanelOnViewportChange() {
52
- setIsNavigationPanelOpened(isDefaultOpen && isDesktopViewport);
53
- }, [isDefaultOpen, isDesktopViewport, setIsNavigationPanelOpened]);
54
- return (0, _element.createElement)(NavigationSidebarFill, null, (0, _element.createElement)(_navigationToggle.default, null), (0, _element.createElement)(_navigationPanel.default, {
55
- activeItem: activeTemplateType
56
- }), (0, _element.createElement)(NavigationPanelPreviewSlot, null));
57
- }
58
-
59
- NavigationSidebar.Slot = NavigationSidebarSlot;
60
- var _default = NavigationSidebar;
61
- exports.default = _default;
62
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/index.js"],"names":["Fill","NavigationPanelPreviewFill","Slot","NavigationPanelPreviewSlot","NavigationSidebarFill","NavigationSidebarSlot","NavigationSidebar","isDefaultOpen","activeTemplateType","isDesktopViewport","setIsNavigationPanelOpened","editSiteStore","autoOpenNavigationPanelOnViewportChange"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAbA;AACA;AACA;;AAMA;AACA;AACA;AAKO,MAAM;AACZA,EAAAA,IAAI,EAAEC,0BADM;AAEZC,EAAAA,IAAI,EAAEC;AAFM,IAGT,gCAAgB,gCAAhB,CAHG;;;AAKP,MAAM;AAAEH,EAAAA,IAAI,EAAEI,qBAAR;AAA+BF,EAAAA,IAAI,EAAEG;AAArC,IACL,gCAAgB,2BAAhB,CADD;;AAGA,SAASC,iBAAT,OAA4E;AAAA,MAAhD;AAAEC,IAAAA,aAAa,GAAG,KAAlB;AAAyBC,IAAAA;AAAzB,GAAgD;AAC3E,QAAMC,iBAAiB,GAAG,+BAAkB,QAAlB,CAA1B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAiC,uBAAaC,YAAb,CAAvC;AAEA,0BACC,SAASC,uCAAT,GAAmD;AAClDF,IAAAA,0BAA0B,CAAEH,aAAa,IAAIE,iBAAnB,CAA1B;AACA,GAHF,EAIC,CAAEF,aAAF,EAAiBE,iBAAjB,EAAoCC,0BAApC,CAJD;AAOA,SACC,4BAAC,qBAAD,QACC,4BAAC,yBAAD,OADD,EAEC,4BAAC,wBAAD;AAAiB,IAAA,UAAU,EAAGF;AAA9B,IAFD,EAGC,4BAAC,0BAAD,OAHD,CADD;AAOA;;AAEDF,iBAAiB,CAACJ,IAAlB,GAAyBG,qBAAzB;eAEeC,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { createSlotFill } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport NavigationPanel from './navigation-panel';\nimport NavigationToggle from './navigation-toggle';\n\nexport const {\n\tFill: NavigationPanelPreviewFill,\n\tSlot: NavigationPanelPreviewSlot,\n} = createSlotFill( 'EditSiteNavigationPanelPreview' );\n\nconst { Fill: NavigationSidebarFill, Slot: NavigationSidebarSlot } =\n\tcreateSlotFill( 'EditSiteNavigationSidebar' );\n\nfunction NavigationSidebar( { isDefaultOpen = false, activeTemplateType } ) {\n\tconst isDesktopViewport = useViewportMatch( 'medium' );\n\tconst { setIsNavigationPanelOpened } = useDispatch( editSiteStore );\n\n\tuseEffect(\n\t\tfunction autoOpenNavigationPanelOnViewportChange() {\n\t\t\tsetIsNavigationPanelOpened( isDefaultOpen && isDesktopViewport );\n\t\t},\n\t\t[ isDefaultOpen, isDesktopViewport, setIsNavigationPanelOpened ]\n\t);\n\n\treturn (\n\t\t<NavigationSidebarFill>\n\t\t\t<NavigationToggle />\n\t\t\t<NavigationPanel activeItem={ activeTemplateType } />\n\t\t\t<NavigationPanelPreviewSlot />\n\t\t</NavigationSidebarFill>\n\t);\n}\n\nNavigationSidebar.Slot = NavigationSidebarSlot;\n\nexport default NavigationSidebar;\n"]}
@@ -1,77 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.TEMPLATE_PARTS_SUB_MENUS = exports.TEMPLATE_OVERRIDES = exports.TEMPLATES_TOP_LEVEL = exports.TEMPLATES_SECONDARY = exports.TEMPLATES_PRIMARY = exports.TEMPLATES_POSTS_PREFIXES = exports.TEMPLATES_PAGES_PREFIXES = exports.TEMPLATES_GENERAL = exports.MENU_TEMPLATE_PARTS_SIDEBARS = exports.MENU_TEMPLATE_PARTS_HEADERS = exports.MENU_TEMPLATE_PARTS_GENERAL = exports.MENU_TEMPLATE_PARTS_FOOTERS = exports.MENU_TEMPLATE_PARTS = exports.MENU_TEMPLATES_UNUSED = exports.MENU_TEMPLATES_POSTS = exports.MENU_TEMPLATES_PAGES = exports.MENU_TEMPLATES_GENERAL = exports.MENU_TEMPLATES = exports.MENU_ROOT = void 0;
7
-
8
- var _i18n = require("@wordpress/i18n");
9
-
10
- var _constants = require("../../../store/constants");
11
-
12
- /**
13
- * WordPress dependencies
14
- */
15
-
16
- /**
17
- * Internal dependencies
18
- */
19
- const TEMPLATES_PRIMARY = ['index', 'singular', 'archive', 'single', 'page', 'home', '404', 'search'];
20
- exports.TEMPLATES_PRIMARY = TEMPLATES_PRIMARY;
21
- const TEMPLATES_SECONDARY = ['author', 'category', 'taxonomy', 'date', 'tag', 'attachment', 'single', 'front-page'];
22
- exports.TEMPLATES_SECONDARY = TEMPLATES_SECONDARY;
23
- const TEMPLATES_TOP_LEVEL = [...TEMPLATES_PRIMARY, ...TEMPLATES_SECONDARY];
24
- exports.TEMPLATES_TOP_LEVEL = TEMPLATES_TOP_LEVEL;
25
- const TEMPLATES_GENERAL = ['page-home'];
26
- exports.TEMPLATES_GENERAL = TEMPLATES_GENERAL;
27
- const TEMPLATES_POSTS_PREFIXES = ['post-', 'author-', 'single-', 'tag-'];
28
- exports.TEMPLATES_POSTS_PREFIXES = TEMPLATES_POSTS_PREFIXES;
29
- const TEMPLATES_PAGES_PREFIXES = ['page-'];
30
- exports.TEMPLATES_PAGES_PREFIXES = TEMPLATES_PAGES_PREFIXES;
31
- const TEMPLATE_OVERRIDES = {
32
- singular: ['single', 'page'],
33
- index: ['archive', '404', 'search', 'singular', 'home'],
34
- home: ['front-page']
35
- };
36
- exports.TEMPLATE_OVERRIDES = TEMPLATE_OVERRIDES;
37
- const MENU_ROOT = 'root';
38
- exports.MENU_ROOT = MENU_ROOT;
39
- const MENU_TEMPLATE_PARTS = 'template-parts';
40
- exports.MENU_TEMPLATE_PARTS = MENU_TEMPLATE_PARTS;
41
- const MENU_TEMPLATES = 'templates';
42
- exports.MENU_TEMPLATES = MENU_TEMPLATES;
43
- const MENU_TEMPLATES_GENERAL = 'templates-general';
44
- exports.MENU_TEMPLATES_GENERAL = MENU_TEMPLATES_GENERAL;
45
- const MENU_TEMPLATES_PAGES = 'templates-pages';
46
- exports.MENU_TEMPLATES_PAGES = MENU_TEMPLATES_PAGES;
47
- const MENU_TEMPLATES_POSTS = 'templates-posts';
48
- exports.MENU_TEMPLATES_POSTS = MENU_TEMPLATES_POSTS;
49
- const MENU_TEMPLATES_UNUSED = 'templates-unused';
50
- exports.MENU_TEMPLATES_UNUSED = MENU_TEMPLATES_UNUSED;
51
- const MENU_TEMPLATE_PARTS_HEADERS = 'template-parts-headers';
52
- exports.MENU_TEMPLATE_PARTS_HEADERS = MENU_TEMPLATE_PARTS_HEADERS;
53
- const MENU_TEMPLATE_PARTS_FOOTERS = 'template-parts-footers';
54
- exports.MENU_TEMPLATE_PARTS_FOOTERS = MENU_TEMPLATE_PARTS_FOOTERS;
55
- const MENU_TEMPLATE_PARTS_SIDEBARS = 'template-parts-sidebars';
56
- exports.MENU_TEMPLATE_PARTS_SIDEBARS = MENU_TEMPLATE_PARTS_SIDEBARS;
57
- const MENU_TEMPLATE_PARTS_GENERAL = 'template-parts-general';
58
- exports.MENU_TEMPLATE_PARTS_GENERAL = MENU_TEMPLATE_PARTS_GENERAL;
59
- const TEMPLATE_PARTS_SUB_MENUS = [{
60
- area: _constants.TEMPLATE_PART_AREA_HEADER,
61
- menu: MENU_TEMPLATE_PARTS_HEADERS,
62
- title: (0, _i18n.__)('headers')
63
- }, {
64
- area: _constants.TEMPLATE_PART_AREA_FOOTER,
65
- menu: MENU_TEMPLATE_PARTS_FOOTERS,
66
- title: (0, _i18n.__)('footers')
67
- }, {
68
- area: _constants.TEMPLATE_PART_AREA_SIDEBAR,
69
- menu: MENU_TEMPLATE_PARTS_SIDEBARS,
70
- title: (0, _i18n.__)('sidebars')
71
- }, {
72
- area: _constants.TEMPLATE_PART_AREA_GENERAL,
73
- menu: MENU_TEMPLATE_PARTS_GENERAL,
74
- title: (0, _i18n.__)('general')
75
- }];
76
- exports.TEMPLATE_PARTS_SUB_MENUS = TEMPLATE_PARTS_SUB_MENUS;
77
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js"],"names":["TEMPLATES_PRIMARY","TEMPLATES_SECONDARY","TEMPLATES_TOP_LEVEL","TEMPLATES_GENERAL","TEMPLATES_POSTS_PREFIXES","TEMPLATES_PAGES_PREFIXES","TEMPLATE_OVERRIDES","singular","index","home","MENU_ROOT","MENU_TEMPLATE_PARTS","MENU_TEMPLATES","MENU_TEMPLATES_GENERAL","MENU_TEMPLATES_PAGES","MENU_TEMPLATES_POSTS","MENU_TEMPLATES_UNUSED","MENU_TEMPLATE_PARTS_HEADERS","MENU_TEMPLATE_PARTS_FOOTERS","MENU_TEMPLATE_PARTS_SIDEBARS","MENU_TEMPLATE_PARTS_GENERAL","TEMPLATE_PARTS_SUB_MENUS","area","TEMPLATE_PART_AREA_HEADER","menu","title","TEMPLATE_PART_AREA_FOOTER","TEMPLATE_PART_AREA_SIDEBAR","TEMPLATE_PART_AREA_GENERAL"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAQO,MAAMA,iBAAiB,GAAG,CAChC,OADgC,EAEhC,UAFgC,EAGhC,SAHgC,EAIhC,QAJgC,EAKhC,MALgC,EAMhC,MANgC,EAOhC,KAPgC,EAQhC,QARgC,CAA1B;;AAWA,MAAMC,mBAAmB,GAAG,CAClC,QADkC,EAElC,UAFkC,EAGlC,UAHkC,EAIlC,MAJkC,EAKlC,KALkC,EAMlC,YANkC,EAOlC,QAPkC,EAQlC,YARkC,CAA5B;;AAWA,MAAMC,mBAAmB,GAAG,CAClC,GAAGF,iBAD+B,EAElC,GAAGC,mBAF+B,CAA5B;;AAKA,MAAME,iBAAiB,GAAG,CAAE,WAAF,CAA1B;;AAEA,MAAMC,wBAAwB,GAAG,CACvC,OADuC,EAEvC,SAFuC,EAGvC,SAHuC,EAIvC,MAJuC,CAAjC;;AAOA,MAAMC,wBAAwB,GAAG,CAAE,OAAF,CAAjC;;AAEA,MAAMC,kBAAkB,GAAG;AACjCC,EAAAA,QAAQ,EAAE,CAAE,QAAF,EAAY,MAAZ,CADuB;AAEjCC,EAAAA,KAAK,EAAE,CAAE,SAAF,EAAa,KAAb,EAAoB,QAApB,EAA8B,UAA9B,EAA0C,MAA1C,CAF0B;AAGjCC,EAAAA,IAAI,EAAE,CAAE,YAAF;AAH2B,CAA3B;;AAMA,MAAMC,SAAS,GAAG,MAAlB;;AACA,MAAMC,mBAAmB,GAAG,gBAA5B;;AACA,MAAMC,cAAc,GAAG,WAAvB;;AACA,MAAMC,sBAAsB,GAAG,mBAA/B;;AACA,MAAMC,oBAAoB,GAAG,iBAA7B;;AACA,MAAMC,oBAAoB,GAAG,iBAA7B;;AACA,MAAMC,qBAAqB,GAAG,kBAA9B;;AAEA,MAAMC,2BAA2B,GAAG,wBAApC;;AACA,MAAMC,2BAA2B,GAAG,wBAApC;;AACA,MAAMC,4BAA4B,GAAG,yBAArC;;AACA,MAAMC,2BAA2B,GAAG,wBAApC;;AAEA,MAAMC,wBAAwB,GAAG,CACvC;AACCC,EAAAA,IAAI,EAAEC,oCADP;AAECC,EAAAA,IAAI,EAAEP,2BAFP;AAGCQ,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CADuC,EAMvC;AACCH,EAAAA,IAAI,EAAEI,oCADP;AAECF,EAAAA,IAAI,EAAEN,2BAFP;AAGCO,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CANuC,EAWvC;AACCH,EAAAA,IAAI,EAAEK,qCADP;AAECH,EAAAA,IAAI,EAAEL,4BAFP;AAGCM,EAAAA,KAAK,EAAE,cAAI,UAAJ;AAHR,CAXuC,EAgBvC;AACCH,EAAAA,IAAI,EAAEM,qCADP;AAECJ,EAAAA,IAAI,EAAEJ,2BAFP;AAGCK,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CAhBuC,CAAjC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_AREA_HEADER,\n\tTEMPLATE_PART_AREA_FOOTER,\n\tTEMPLATE_PART_AREA_SIDEBAR,\n\tTEMPLATE_PART_AREA_GENERAL,\n} from '../../../store/constants';\n\nexport const TEMPLATES_PRIMARY = [\n\t'index',\n\t'singular',\n\t'archive',\n\t'single',\n\t'page',\n\t'home',\n\t'404',\n\t'search',\n];\n\nexport const TEMPLATES_SECONDARY = [\n\t'author',\n\t'category',\n\t'taxonomy',\n\t'date',\n\t'tag',\n\t'attachment',\n\t'single',\n\t'front-page',\n];\n\nexport const TEMPLATES_TOP_LEVEL = [\n\t...TEMPLATES_PRIMARY,\n\t...TEMPLATES_SECONDARY,\n];\n\nexport const TEMPLATES_GENERAL = [ 'page-home' ];\n\nexport const TEMPLATES_POSTS_PREFIXES = [\n\t'post-',\n\t'author-',\n\t'single-',\n\t'tag-',\n];\n\nexport const TEMPLATES_PAGES_PREFIXES = [ 'page-' ];\n\nexport const TEMPLATE_OVERRIDES = {\n\tsingular: [ 'single', 'page' ],\n\tindex: [ 'archive', '404', 'search', 'singular', 'home' ],\n\thome: [ 'front-page' ],\n};\n\nexport const MENU_ROOT = 'root';\nexport const MENU_TEMPLATE_PARTS = 'template-parts';\nexport const MENU_TEMPLATES = 'templates';\nexport const MENU_TEMPLATES_GENERAL = 'templates-general';\nexport const MENU_TEMPLATES_PAGES = 'templates-pages';\nexport const MENU_TEMPLATES_POSTS = 'templates-posts';\nexport const MENU_TEMPLATES_UNUSED = 'templates-unused';\n\nexport const MENU_TEMPLATE_PARTS_HEADERS = 'template-parts-headers';\nexport const MENU_TEMPLATE_PARTS_FOOTERS = 'template-parts-footers';\nexport const MENU_TEMPLATE_PARTS_SIDEBARS = 'template-parts-sidebars';\nexport const MENU_TEMPLATE_PARTS_GENERAL = 'template-parts-general';\n\nexport const TEMPLATE_PARTS_SUB_MENUS = [\n\t{\n\t\tarea: TEMPLATE_PART_AREA_HEADER,\n\t\tmenu: MENU_TEMPLATE_PARTS_HEADERS,\n\t\ttitle: __( 'headers' ),\n\t},\n\t{\n\t\tarea: TEMPLATE_PART_AREA_FOOTER,\n\t\tmenu: MENU_TEMPLATE_PARTS_FOOTERS,\n\t\ttitle: __( 'footers' ),\n\t},\n\t{\n\t\tarea: TEMPLATE_PART_AREA_SIDEBAR,\n\t\tmenu: MENU_TEMPLATE_PARTS_SIDEBARS,\n\t\ttitle: __( 'sidebars' ),\n\t},\n\t{\n\t\tarea: TEMPLATE_PART_AREA_GENERAL,\n\t\tmenu: MENU_TEMPLATE_PARTS_GENERAL,\n\t\ttitle: __( 'general' ),\n\t},\n];\n"]}