@wordpress/edit-site 6.11.0 → 6.12.1-next.082ed6819.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 (346) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-template/utils.js +1 -2
  3. package/build/components/add-new-template/utils.js.map +1 -1
  4. package/build/components/app/index.js +0 -5
  5. package/build/components/app/index.js.map +1 -1
  6. package/build/components/block-editor/use-editor-iframe-props.js +6 -8
  7. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  8. package/build/components/block-editor/use-site-editor-settings.js +4 -12
  9. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  10. package/build/components/editor/index.js +23 -27
  11. package/build/components/editor/index.js.map +1 -1
  12. package/build/components/editor/use-editor-title.js +37 -12
  13. package/build/components/editor/use-editor-title.js.map +1 -1
  14. package/build/components/editor/use-resolve-edited-entity.js +133 -0
  15. package/build/components/editor/use-resolve-edited-entity.js.map +1 -0
  16. package/build/components/editor-canvas-container/index.js +1 -1
  17. package/build/components/editor-canvas-container/index.js.map +1 -1
  18. package/build/components/global-styles/block-preview-panel.js +8 -10
  19. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  20. package/build/components/global-styles/screen-block.js +18 -5
  21. package/build/components/global-styles/screen-block.js.map +1 -1
  22. package/build/components/global-styles/screen-revisions/revisions-buttons.js +24 -22
  23. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  24. package/build/components/global-styles/screen-style-variations.js +11 -5
  25. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  26. package/build/components/global-styles/shadows-edit-panel.js +2 -3
  27. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  28. package/build/components/global-styles/ui.js +42 -2
  29. package/build/components/global-styles/ui.js.map +1 -1
  30. package/build/components/global-styles-renderer/index.js +6 -8
  31. package/build/components/global-styles-renderer/index.js.map +1 -1
  32. package/build/components/global-styles-sidebar/index.js +17 -1
  33. package/build/components/global-styles-sidebar/index.js.map +1 -1
  34. package/build/components/layout/hooks.js +1 -10
  35. package/build/components/layout/hooks.js.map +1 -1
  36. package/build/components/layout/index.js +1 -0
  37. package/build/components/layout/index.js.map +1 -1
  38. package/build/components/page-patterns/fields.js +3 -7
  39. package/build/components/page-patterns/fields.js.map +1 -1
  40. package/build/components/page-patterns/header.js +2 -2
  41. package/build/components/page-patterns/header.js.map +1 -1
  42. package/build/components/page-patterns/use-patterns.js +4 -8
  43. package/build/components/page-patterns/use-patterns.js.map +1 -1
  44. package/build/components/page-templates/fields.js +1 -2
  45. package/build/components/page-templates/fields.js.map +1 -1
  46. package/build/components/post-edit/index.js +15 -11
  47. package/build/components/post-edit/index.js.map +1 -1
  48. package/build/components/post-list/index.js +13 -3
  49. package/build/components/post-list/index.js.map +1 -1
  50. package/build/components/posts-app/index.js +3 -4
  51. package/build/components/posts-app/index.js.map +1 -1
  52. package/build/components/posts-app-routes/home.js +48 -0
  53. package/build/components/posts-app-routes/home.js.map +1 -0
  54. package/build/components/posts-app-routes/index.js +37 -0
  55. package/build/components/posts-app-routes/index.js.map +1 -0
  56. package/build/components/posts-app-routes/posts-edit.js +44 -0
  57. package/build/components/posts-app-routes/posts-edit.js.map +1 -0
  58. package/build/components/posts-app-routes/posts-list-view-quick-edit.js +63 -0
  59. package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +1 -0
  60. package/build/components/posts-app-routes/posts-list-view.js +48 -0
  61. package/build/components/posts-app-routes/posts-list-view.js.map +1 -0
  62. package/build/components/posts-app-routes/posts-view-quick-edit.js +60 -0
  63. package/build/components/posts-app-routes/posts-view-quick-edit.js.map +1 -0
  64. package/build/components/posts-app-routes/posts-view.js +41 -0
  65. package/build/components/posts-app-routes/posts-view.js.map +1 -0
  66. package/build/components/sidebar/index.js +11 -3
  67. package/build/components/sidebar/index.js.map +1 -1
  68. package/build/components/sidebar-global-styles-wrapper/index.js +129 -0
  69. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -0
  70. package/build/components/sidebar-navigation-screen-details-footer/index.js +17 -23
  71. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  72. package/build/components/sidebar-navigation-screen-global-styles/index.js +18 -90
  73. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  74. package/build/components/sidebar-navigation-screen-main/index.js +43 -42
  75. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  76. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  77. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  78. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +2 -3
  79. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  80. package/build/components/site-editor-routes/index.js +1 -2
  81. package/build/components/site-editor-routes/index.js.map +1 -1
  82. package/build/components/site-editor-routes/styles-view.js +8 -2
  83. package/build/components/site-editor-routes/styles-view.js.map +1 -1
  84. package/build/components/site-hub/index.js +19 -6
  85. package/build/components/site-hub/index.js.map +1 -1
  86. package/build/components/style-book/constants.js +10 -3
  87. package/build/components/style-book/constants.js.map +1 -1
  88. package/build/components/style-book/examples.js +94 -2
  89. package/build/components/style-book/examples.js.map +1 -1
  90. package/build/components/style-book/index.js +70 -11
  91. package/build/components/style-book/index.js.map +1 -1
  92. package/build/components/welcome-guide/index.js +4 -2
  93. package/build/components/welcome-guide/index.js.map +1 -1
  94. package/build/components/welcome-guide/page.js +1 -9
  95. package/build/components/welcome-guide/page.js.map +1 -1
  96. package/build/components/welcome-guide/template.js +1 -12
  97. package/build/components/welcome-guide/template.js.map +1 -1
  98. package/build/hooks/commands/use-common-commands.js +15 -15
  99. package/build/hooks/commands/use-common-commands.js.map +1 -1
  100. package/build/index.js +1 -9
  101. package/build/index.js.map +1 -1
  102. package/build/posts.js +1 -0
  103. package/build/posts.js.map +1 -1
  104. package/build/store/actions.js +13 -0
  105. package/build/store/actions.js.map +1 -1
  106. package/build/store/selectors.js +21 -1
  107. package/build/store/selectors.js.map +1 -1
  108. package/build-module/components/add-new-template/utils.js +1 -2
  109. package/build-module/components/add-new-template/utils.js.map +1 -1
  110. package/build-module/components/app/index.js +0 -5
  111. package/build-module/components/app/index.js.map +1 -1
  112. package/build-module/components/block-editor/use-editor-iframe-props.js +6 -8
  113. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  114. package/build-module/components/block-editor/use-site-editor-settings.js +4 -12
  115. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  116. package/build-module/components/editor/index.js +23 -27
  117. package/build-module/components/editor/index.js.map +1 -1
  118. package/build-module/components/editor/use-editor-title.js +37 -12
  119. package/build-module/components/editor/use-editor-title.js.map +1 -1
  120. package/build-module/components/editor/use-resolve-edited-entity.js +125 -0
  121. package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -0
  122. package/build-module/components/editor-canvas-container/index.js +1 -1
  123. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  124. package/build-module/components/global-styles/block-preview-panel.js +8 -10
  125. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  126. package/build-module/components/global-styles/screen-block.js +18 -5
  127. package/build-module/components/global-styles/screen-block.js.map +1 -1
  128. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +25 -23
  129. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  130. package/build-module/components/global-styles/screen-style-variations.js +11 -5
  131. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  132. package/build-module/components/global-styles/shadows-edit-panel.js +2 -3
  133. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  134. package/build-module/components/global-styles/ui.js +42 -2
  135. package/build-module/components/global-styles/ui.js.map +1 -1
  136. package/build-module/components/global-styles-renderer/index.js +6 -8
  137. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  138. package/build-module/components/global-styles-sidebar/index.js +18 -2
  139. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  140. package/build-module/components/layout/hooks.js +1 -9
  141. package/build-module/components/layout/hooks.js.map +1 -1
  142. package/build-module/components/layout/index.js +1 -0
  143. package/build-module/components/layout/index.js.map +1 -1
  144. package/build-module/components/page-patterns/fields.js +4 -8
  145. package/build-module/components/page-patterns/fields.js.map +1 -1
  146. package/build-module/components/page-patterns/header.js +2 -2
  147. package/build-module/components/page-patterns/header.js.map +1 -1
  148. package/build-module/components/page-patterns/use-patterns.js +4 -8
  149. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  150. package/build-module/components/page-templates/fields.js +1 -2
  151. package/build-module/components/page-templates/fields.js.map +1 -1
  152. package/build-module/components/post-edit/index.js +14 -10
  153. package/build-module/components/post-edit/index.js.map +1 -1
  154. package/build-module/components/post-list/index.js +13 -3
  155. package/build-module/components/post-list/index.js.map +1 -1
  156. package/build-module/components/posts-app/index.js +3 -4
  157. package/build-module/components/posts-app/index.js.map +1 -1
  158. package/build-module/components/posts-app-routes/home.js +40 -0
  159. package/build-module/components/posts-app-routes/home.js.map +1 -0
  160. package/build-module/components/posts-app-routes/index.js +30 -0
  161. package/build-module/components/posts-app-routes/index.js.map +1 -0
  162. package/build-module/components/posts-app-routes/posts-edit.js +36 -0
  163. package/build-module/components/posts-app-routes/posts-edit.js.map +1 -0
  164. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +55 -0
  165. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +1 -0
  166. package/build-module/components/posts-app-routes/posts-list-view.js +40 -0
  167. package/build-module/components/posts-app-routes/posts-list-view.js.map +1 -0
  168. package/build-module/components/posts-app-routes/posts-view-quick-edit.js +52 -0
  169. package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +1 -0
  170. package/build-module/components/posts-app-routes/posts-view.js +33 -0
  171. package/build-module/components/posts-app-routes/posts-view.js.map +1 -0
  172. package/build-module/components/sidebar/index.js +11 -3
  173. package/build-module/components/sidebar/index.js.map +1 -1
  174. package/build-module/components/sidebar-global-styles-wrapper/index.js +121 -0
  175. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -0
  176. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +20 -26
  177. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  178. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +19 -91
  179. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  180. package/build-module/components/sidebar-navigation-screen-main/index.js +43 -43
  181. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  182. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  183. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  184. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +3 -4
  185. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  186. package/build-module/components/site-editor-routes/index.js +1 -2
  187. package/build-module/components/site-editor-routes/index.js.map +1 -1
  188. package/build-module/components/site-editor-routes/styles-view.js +8 -2
  189. package/build-module/components/site-editor-routes/styles-view.js.map +1 -1
  190. package/build-module/components/site-hub/index.js +19 -6
  191. package/build-module/components/site-hub/index.js.map +1 -1
  192. package/build-module/components/style-book/constants.js +10 -3
  193. package/build-module/components/style-book/constants.js.map +1 -1
  194. package/build-module/components/style-book/examples.js +94 -2
  195. package/build-module/components/style-book/examples.js.map +1 -1
  196. package/build-module/components/style-book/index.js +71 -12
  197. package/build-module/components/style-book/index.js.map +1 -1
  198. package/build-module/components/welcome-guide/index.js +4 -2
  199. package/build-module/components/welcome-guide/index.js.map +1 -1
  200. package/build-module/components/welcome-guide/page.js +1 -9
  201. package/build-module/components/welcome-guide/page.js.map +1 -1
  202. package/build-module/components/welcome-guide/template.js +1 -11
  203. package/build-module/components/welcome-guide/template.js.map +1 -1
  204. package/build-module/hooks/commands/use-common-commands.js +15 -15
  205. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  206. package/build-module/index.js +2 -10
  207. package/build-module/index.js.map +1 -1
  208. package/build-module/posts.js +1 -0
  209. package/build-module/posts.js.map +1 -1
  210. package/build-module/store/actions.js +13 -0
  211. package/build-module/store/actions.js.map +1 -1
  212. package/build-module/store/selectors.js +21 -1
  213. package/build-module/store/selectors.js.map +1 -1
  214. package/build-style/posts-rtl.css +106 -16
  215. package/build-style/posts.css +106 -16
  216. package/build-style/style-rtl.css +176 -78
  217. package/build-style/style.css +176 -78
  218. package/package.json +39 -40
  219. package/src/components/add-new-template/utils.js +2 -2
  220. package/src/components/app/index.js +0 -5
  221. package/src/components/block-editor/use-editor-iframe-props.js +2 -3
  222. package/src/components/block-editor/use-site-editor-settings.js +7 -21
  223. package/src/components/editor/index.js +31 -30
  224. package/src/components/editor/use-editor-title.js +50 -13
  225. package/src/components/editor/use-resolve-edited-entity.js +132 -0
  226. package/src/components/editor-canvas-container/index.js +1 -1
  227. package/src/components/editor-canvas-container/style.scss +0 -1
  228. package/src/components/global-styles/block-preview-panel.js +10 -10
  229. package/src/components/global-styles/screen-block.js +26 -8
  230. package/src/components/global-styles/screen-revisions/revisions-buttons.js +28 -31
  231. package/src/components/global-styles/screen-revisions/style.scss +11 -17
  232. package/src/components/global-styles/screen-style-variations.js +14 -5
  233. package/src/components/global-styles/shadows-edit-panel.js +4 -2
  234. package/src/components/global-styles/ui.js +41 -1
  235. package/src/components/global-styles-renderer/index.js +4 -10
  236. package/src/components/global-styles-sidebar/index.js +16 -2
  237. package/src/components/layout/hooks.js +1 -7
  238. package/src/components/layout/index.js +6 -1
  239. package/src/components/page-patterns/fields.js +6 -12
  240. package/src/components/page-patterns/header.js +3 -2
  241. package/src/components/page-patterns/style.scss +0 -5
  242. package/src/components/page-patterns/use-patterns.js +9 -7
  243. package/src/components/page-templates/fields.js +2 -3
  244. package/src/components/page-templates/style.scss +1 -0
  245. package/src/components/post-edit/index.js +37 -32
  246. package/src/components/post-edit/style.scss +7 -0
  247. package/src/components/post-list/index.js +10 -5
  248. package/src/components/post-list/style.scss +29 -3
  249. package/src/components/posts-app/index.js +3 -4
  250. package/src/components/posts-app-routes/home.js +36 -0
  251. package/src/components/posts-app-routes/index.js +36 -0
  252. package/src/components/posts-app-routes/posts-edit.js +31 -0
  253. package/src/components/posts-app-routes/posts-list-view-quick-edit.js +52 -0
  254. package/src/components/posts-app-routes/posts-list-view.js +40 -0
  255. package/src/components/posts-app-routes/posts-view-quick-edit.js +49 -0
  256. package/src/components/posts-app-routes/posts-view.js +35 -0
  257. package/src/components/sidebar/index.js +23 -7
  258. package/src/components/sidebar-global-styles-wrapper/index.js +150 -0
  259. package/src/components/sidebar-global-styles-wrapper/style.scss +35 -0
  260. package/src/components/sidebar-navigation-item/style.scss +2 -2
  261. package/src/components/sidebar-navigation-screen/style.scss +7 -2
  262. package/src/components/sidebar-navigation-screen-details-footer/index.js +27 -38
  263. package/src/components/sidebar-navigation-screen-details-footer/style.scss +0 -4
  264. package/src/components/sidebar-navigation-screen-global-styles/index.js +19 -103
  265. package/src/components/sidebar-navigation-screen-main/index.js +46 -45
  266. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +8 -0
  267. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  268. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +4 -4
  269. package/src/components/site-editor-routes/README.md +2 -2
  270. package/src/components/site-editor-routes/index.js +0 -2
  271. package/src/components/site-editor-routes/styles-view.js +11 -1
  272. package/src/components/site-hub/index.js +33 -16
  273. package/src/components/site-hub/style.scss +1 -1
  274. package/src/components/site-icon/style.scss +16 -0
  275. package/src/components/style-book/constants.ts +11 -3
  276. package/src/components/style-book/examples.tsx +128 -2
  277. package/src/components/style-book/index.js +86 -8
  278. package/src/components/welcome-guide/index.js +3 -3
  279. package/src/components/welcome-guide/page.js +1 -7
  280. package/src/components/welcome-guide/template.js +1 -8
  281. package/src/hooks/commands/use-common-commands.js +253 -246
  282. package/src/index.js +2 -13
  283. package/src/posts.js +1 -0
  284. package/src/store/actions.js +15 -0
  285. package/src/store/selectors.js +24 -1
  286. package/src/style.scss +2 -5
  287. package/build/components/async/index.js +0 -51
  288. package/build/components/async/index.js.map +0 -1
  289. package/build/components/post-fields/index.js +0 -290
  290. package/build/components/post-fields/index.js.map +0 -1
  291. package/build/components/posts-app/router.js +0 -85
  292. package/build/components/posts-app/router.js.map +0 -1
  293. package/build/components/sidebar-navigation-screen-details-panel/index.js +0 -54
  294. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +0 -1
  295. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +0 -21
  296. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +0 -1
  297. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +0 -33
  298. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +0 -1
  299. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +0 -21
  300. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +0 -1
  301. package/build/components/site-editor-routes/styles-edit.js +0 -28
  302. package/build/components/site-editor-routes/styles-edit.js.map +0 -1
  303. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -219
  304. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +0 -1
  305. package/build/components/use-edited-entity-record/index.js +0 -60
  306. package/build/components/use-edited-entity-record/index.js.map +0 -1
  307. package/build/hooks/commands/use-edit-mode-commands.js +0 -179
  308. package/build/hooks/commands/use-edit-mode-commands.js.map +0 -1
  309. package/build-module/components/async/index.js +0 -44
  310. package/build-module/components/async/index.js.map +0 -1
  311. package/build-module/components/post-fields/index.js +0 -283
  312. package/build-module/components/post-fields/index.js.map +0 -1
  313. package/build-module/components/posts-app/router.js +0 -77
  314. package/build-module/components/posts-app/router.js.map +0 -1
  315. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +0 -29
  316. package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +0 -1
  317. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +0 -14
  318. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +0 -1
  319. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +0 -25
  320. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +0 -1
  321. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +0 -14
  322. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +0 -1
  323. package/build-module/components/site-editor-routes/styles-edit.js +0 -20
  324. package/build-module/components/site-editor-routes/styles-edit.js.map +0 -1
  325. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -212
  326. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +0 -1
  327. package/build-module/components/use-edited-entity-record/index.js +0 -53
  328. package/build-module/components/use-edited-entity-record/index.js.map +0 -1
  329. package/build-module/hooks/commands/use-edit-mode-commands.js +0 -171
  330. package/build-module/hooks/commands/use-edit-mode-commands.js.map +0 -1
  331. package/src/components/async/index.js +0 -43
  332. package/src/components/post-fields/index.js +0 -361
  333. package/src/components/post-fields/style.scss +0 -3
  334. package/src/components/posts-app/router.js +0 -69
  335. package/src/components/sidebar-navigation-screen-details-panel/index.js +0 -40
  336. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +0 -14
  337. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +0 -31
  338. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +0 -14
  339. package/src/components/sidebar-navigation-screen-details-panel/style.scss +0 -26
  340. package/src/components/site-editor-routes/styles-edit.js +0 -17
  341. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -267
  342. package/src/components/use-edited-entity-record/index.js +0 -58
  343. package/src/hooks/commands/use-edit-mode-commands.js +0 -168
  344. package/src/store/test/actions.js +0 -83
  345. package/src/store/test/reducer.js +0 -69
  346. package/src/store/test/selectors.js +0 -41
@@ -0,0 +1,31 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import PostList from '../post-list';
10
+ import DataViewsSidebarContent from '../sidebar-dataviews';
11
+ import SidebarNavigationScreen from '../sidebar-navigation-screen';
12
+ import Editor from '../editor';
13
+
14
+ export const postsEditRoute = {
15
+ name: 'posts-edit',
16
+ match: ( params ) => {
17
+ return params.postType === 'post' && params.canvas === 'edit';
18
+ },
19
+ areas: {
20
+ sidebar: (
21
+ <SidebarNavigationScreen
22
+ title={ __( 'Posts' ) }
23
+ isRoot
24
+ content={ <DataViewsSidebarContent /> }
25
+ />
26
+ ),
27
+ content: <PostList postType="post" />,
28
+ mobile: <Editor isPostsList />,
29
+ preview: <Editor isPostsList />,
30
+ },
31
+ };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import PostList from '../post-list';
11
+ import DataViewsSidebarContent from '../sidebar-dataviews';
12
+ import SidebarNavigationScreen from '../sidebar-navigation-screen';
13
+ import { unlock } from '../../lock-unlock';
14
+ import { PostEdit } from '../post-edit';
15
+ import Editor from '../editor';
16
+
17
+ const { useLocation } = unlock( routerPrivateApis );
18
+
19
+ function PostQuickEdit() {
20
+ const { params } = useLocation();
21
+ return <PostEdit postType="post" postId={ params.postId } />;
22
+ }
23
+
24
+ export const postsListViewQuickEditRoute = {
25
+ name: 'posts-list-view-quick-edit',
26
+ match: ( params ) => {
27
+ return (
28
+ params.isCustom !== 'true' &&
29
+ ( params.layout ?? 'list' ) === 'list' &&
30
+ !! params.quickEdit &&
31
+ params.postType === 'post' &&
32
+ params.canvas !== 'edit'
33
+ );
34
+ },
35
+ areas: {
36
+ sidebar: (
37
+ <SidebarNavigationScreen
38
+ title={ __( 'Posts' ) }
39
+ isRoot
40
+ content={ <DataViewsSidebarContent /> }
41
+ />
42
+ ),
43
+ content: <PostList postType="post" />,
44
+ mobile: <PostList postType="post" />,
45
+ preview: <Editor />,
46
+ edit: <PostQuickEdit />,
47
+ },
48
+ widths: {
49
+ content: 380,
50
+ edit: 380,
51
+ },
52
+ };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import PostList from '../post-list';
10
+ import DataViewsSidebarContent from '../sidebar-dataviews';
11
+ import SidebarNavigationScreen from '../sidebar-navigation-screen';
12
+ import Editor from '../editor';
13
+
14
+ export const postsListViewRoute = {
15
+ name: 'posts-list-view',
16
+ match: ( params ) => {
17
+ return (
18
+ params.isCustom !== 'true' &&
19
+ ( params.layout ?? 'list' ) === 'list' &&
20
+ ! params.quickEdit &&
21
+ params.postType === 'post' &&
22
+ params.canvas !== 'edit'
23
+ );
24
+ },
25
+ areas: {
26
+ sidebar: (
27
+ <SidebarNavigationScreen
28
+ title={ __( 'Posts' ) }
29
+ isRoot
30
+ content={ <DataViewsSidebarContent /> }
31
+ />
32
+ ),
33
+ content: <PostList postType="post" />,
34
+ preview: <Editor isPostsList />,
35
+ mobile: <PostList postType="post" />,
36
+ },
37
+ widths: {
38
+ content: 380,
39
+ },
40
+ };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import PostList from '../post-list';
11
+ import DataViewsSidebarContent from '../sidebar-dataviews';
12
+ import SidebarNavigationScreen from '../sidebar-navigation-screen';
13
+ import { unlock } from '../../lock-unlock';
14
+ import { PostEdit } from '../post-edit';
15
+
16
+ const { useLocation } = unlock( routerPrivateApis );
17
+
18
+ function PostQuickEdit() {
19
+ const { params } = useLocation();
20
+ return <PostEdit postType="post" postId={ params.postId } />;
21
+ }
22
+
23
+ export const postsViewQuickEditRoute = {
24
+ name: 'posts-view-quick-edit',
25
+ match: ( params ) => {
26
+ return (
27
+ ( params.isCustom === 'true' ||
28
+ ( params.layout ?? 'list' ) !== 'list' ) &&
29
+ !! params.quickEdit &&
30
+ params.postType === 'post' &&
31
+ params.canvas !== 'edit'
32
+ );
33
+ },
34
+ areas: {
35
+ sidebar: (
36
+ <SidebarNavigationScreen
37
+ title={ __( 'Posts' ) }
38
+ isRoot
39
+ content={ <DataViewsSidebarContent /> }
40
+ />
41
+ ),
42
+ content: <PostList postType="post" />,
43
+ mobile: <PostList postType="post" />,
44
+ edit: <PostQuickEdit />,
45
+ },
46
+ widths: {
47
+ edit: 380,
48
+ },
49
+ };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import PostList from '../post-list';
10
+ import DataViewsSidebarContent from '../sidebar-dataviews';
11
+ import SidebarNavigationScreen from '../sidebar-navigation-screen';
12
+
13
+ export const postsViewRoute = {
14
+ name: 'posts-view',
15
+ match: ( params ) => {
16
+ return (
17
+ ( params.isCustom === 'true' ||
18
+ ( params.layout ?? 'list' ) !== 'list' ) &&
19
+ ! params.quickEdit &&
20
+ params.postType === 'post' &&
21
+ params.canvas !== 'edit'
22
+ );
23
+ },
24
+ areas: {
25
+ sidebar: (
26
+ <SidebarNavigationScreen
27
+ title={ __( 'Posts' ) }
28
+ isRoot
29
+ content={ <DataViewsSidebarContent /> }
30
+ />
31
+ ),
32
+ content: <PostList postType="post" />,
33
+ mobile: <PostList postType="post" />,
34
+ },
35
+ };
@@ -55,7 +55,7 @@ function createNavState() {
55
55
  };
56
56
  }
57
57
 
58
- function SidebarContentWrapper( { children } ) {
58
+ function SidebarContentWrapper( { children, shouldAnimate } ) {
59
59
  const navState = useContext( SidebarNavigationContext );
60
60
  const wrapperRef = useRef();
61
61
  const [ navAnimation, setNavAnimation ] = useState( null );
@@ -66,10 +66,19 @@ function SidebarContentWrapper( { children } ) {
66
66
  setNavAnimation( direction );
67
67
  }, [ navState ] );
68
68
 
69
- const wrapperCls = clsx( 'edit-site-sidebar__screen-wrapper', {
70
- 'slide-from-left': navAnimation === 'back',
71
- 'slide-from-right': navAnimation === 'forward',
72
- } );
69
+ const wrapperCls = clsx(
70
+ 'edit-site-sidebar__screen-wrapper',
71
+ /*
72
+ * Some panes do not have sub-panes and therefore
73
+ * should not animate when clicked on.
74
+ */
75
+ shouldAnimate
76
+ ? {
77
+ 'slide-from-left': navAnimation === 'back',
78
+ 'slide-from-right': navAnimation === 'forward',
79
+ }
80
+ : {}
81
+ );
73
82
 
74
83
  return (
75
84
  <div ref={ wrapperRef } className={ wrapperCls }>
@@ -78,13 +87,20 @@ function SidebarContentWrapper( { children } ) {
78
87
  );
79
88
  }
80
89
 
81
- export default function SidebarContent( { routeKey, children } ) {
90
+ export default function SidebarContent( {
91
+ routeKey,
92
+ shouldAnimate,
93
+ children,
94
+ } ) {
82
95
  const [ navState ] = useState( createNavState );
83
96
 
84
97
  return (
85
98
  <SidebarNavigationContext.Provider value={ navState }>
86
99
  <div className="edit-site-sidebar__content">
87
- <SidebarContentWrapper key={ routeKey }>
100
+ <SidebarContentWrapper
101
+ shouldAnimate={ shouldAnimate }
102
+ key={ routeKey }
103
+ >
88
104
  { children }
89
105
  </SidebarContentWrapper>
90
106
  </div>
@@ -0,0 +1,150 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { useMemo, useState } from '@wordpress/element';
6
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
7
+ import { useViewportMatch } from '@wordpress/compose';
8
+ import {
9
+ Button,
10
+ privateApis as componentsPrivateApis,
11
+ } from '@wordpress/components';
12
+
13
+ /**
14
+ * Internal dependencies
15
+ */
16
+ import GlobalStylesUI from '../global-styles/ui';
17
+ import Page from '../page';
18
+ import { unlock } from '../../lock-unlock';
19
+ import StyleBook from '../style-book';
20
+ import { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';
21
+
22
+ const { useLocation, useHistory } = unlock( routerPrivateApis );
23
+ const { Menu } = unlock( componentsPrivateApis );
24
+ const GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';
25
+
26
+ const GlobalStylesPageActions = ( {
27
+ isStyleBookOpened,
28
+ setIsStyleBookOpened,
29
+ } ) => {
30
+ return (
31
+ <Menu
32
+ trigger={
33
+ <Button __next40pxDefaultSize variant="tertiary" size="compact">
34
+ { __( 'Preview' ) }
35
+ </Button>
36
+ }
37
+ >
38
+ <Menu.RadioItem
39
+ value
40
+ checked={ isStyleBookOpened }
41
+ name="styles-preview-actions"
42
+ onChange={ () => setIsStyleBookOpened( true ) }
43
+ defaultChecked
44
+ >
45
+ <Menu.ItemLabel>{ __( 'Style book' ) }</Menu.ItemLabel>
46
+ <Menu.ItemHelpText>
47
+ { __( 'Preview blocks and styles.' ) }
48
+ </Menu.ItemHelpText>
49
+ </Menu.RadioItem>
50
+ <Menu.RadioItem
51
+ value={ false }
52
+ checked={ ! isStyleBookOpened }
53
+ name="styles-preview-actions"
54
+ onChange={ () => setIsStyleBookOpened( false ) }
55
+ >
56
+ <Menu.ItemLabel>{ __( 'Site' ) }</Menu.ItemLabel>
57
+ <Menu.ItemHelpText>
58
+ { __( 'Preview your site.' ) }
59
+ </Menu.ItemHelpText>
60
+ </Menu.RadioItem>
61
+ </Menu>
62
+ );
63
+ };
64
+
65
+ export default function GlobalStylesUIWrapper() {
66
+ const { params } = useLocation();
67
+ const history = useHistory();
68
+ const { canvas = 'view' } = params;
69
+ const [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );
70
+ const isMobileViewport = useViewportMatch( 'medium', '<' );
71
+ const pathWithPrefix = params.path;
72
+ const [ path, onPathChange ] = useMemo( () => {
73
+ const processedPath = pathWithPrefix.substring(
74
+ GLOBAL_STYLES_PATH_PREFIX.length
75
+ );
76
+ return [
77
+ processedPath ? processedPath : '/',
78
+ ( newPath ) => {
79
+ history.push( {
80
+ path:
81
+ ! newPath || newPath === '/'
82
+ ? GLOBAL_STYLES_PATH_PREFIX
83
+ : `${ GLOBAL_STYLES_PATH_PREFIX }${ newPath }`,
84
+ } );
85
+ },
86
+ ];
87
+ }, [ pathWithPrefix, history ] );
88
+
89
+ return (
90
+ <>
91
+ <Page
92
+ actions={
93
+ ! isMobileViewport ? (
94
+ <GlobalStylesPageActions
95
+ isStyleBookOpened={ isStyleBookOpened }
96
+ setIsStyleBookOpened={ setIsStyleBookOpened }
97
+ />
98
+ ) : null
99
+ }
100
+ className="edit-site-styles"
101
+ title={ __( 'Styles' ) }
102
+ >
103
+ <GlobalStylesUI path={ path } onPathChange={ onPathChange } />
104
+ </Page>
105
+ { canvas === 'view' && isStyleBookOpened && (
106
+ <StyleBook
107
+ enableResizing={ false }
108
+ showCloseButton={ false }
109
+ showTabs={ false }
110
+ isSelected={ ( blockName ) =>
111
+ // Match '/blocks/core%2Fbutton' and
112
+ // '/blocks/core%2Fbutton/typography', but not
113
+ // '/blocks/core%2Fbuttons'.
114
+ path ===
115
+ `/wp_global_styles/blocks/${ encodeURIComponent(
116
+ blockName
117
+ ) }` ||
118
+ path.startsWith(
119
+ `/wp_global_styles/blocks/${ encodeURIComponent(
120
+ blockName
121
+ ) }/`
122
+ )
123
+ }
124
+ path={ path }
125
+ onSelect={ ( blockName ) => {
126
+ if (
127
+ STYLE_BOOK_COLOR_GROUPS.find(
128
+ ( group ) => group.slug === blockName
129
+ )
130
+ ) {
131
+ // Go to color palettes Global Styles.
132
+ onPathChange( '/colors/palette' );
133
+ return;
134
+ }
135
+ if ( blockName === 'typography' ) {
136
+ // Go to typography Global Styles.
137
+ onPathChange( '/typography' );
138
+ return;
139
+ }
140
+
141
+ // Now go to the selected block.
142
+ onPathChange(
143
+ `/blocks/${ encodeURIComponent( blockName ) }`
144
+ );
145
+ } }
146
+ />
147
+ ) }
148
+ </>
149
+ );
150
+ }
@@ -0,0 +1,35 @@
1
+ .edit-site-styles .edit-site-page-content {
2
+ .edit-site-global-styles-screen-root {
3
+ box-shadow: none;
4
+ & > div > hr {
5
+ display: none;
6
+ }
7
+ }
8
+ .edit-site-global-styles-sidebar__navigator-provider {
9
+ .components-tools-panel {
10
+ border-top: none;
11
+ }
12
+ overflow-y: auto;
13
+ padding-left: 0;
14
+ padding-right: 0;
15
+
16
+ .edit-site-global-styles-sidebar__navigator-screen {
17
+ padding-top: $grid-unit-15;
18
+ padding-left: $grid-unit-15;
19
+ padding-right: $grid-unit-15;
20
+ padding-bottom: $grid-unit-15;
21
+ outline: none;
22
+ }
23
+ }
24
+ .edit-site-page-header {
25
+ padding-left: $grid-unit-60;
26
+ padding-right: $grid-unit-60;
27
+ @container (max-width: 430px) {
28
+ padding-left: $grid-unit-30;
29
+ padding-right: $grid-unit-30;
30
+ }
31
+ }
32
+ .edit-site-sidebar-button {
33
+ color: $gray-900;
34
+ }
35
+ }
@@ -7,7 +7,7 @@
7
7
 
8
8
  &:hover,
9
9
  &:focus,
10
- &[aria-current] {
10
+ &[aria-current="true"] {
11
11
  color: $gray-200;
12
12
  background: $gray-800;
13
13
 
@@ -16,7 +16,7 @@
16
16
  }
17
17
  }
18
18
 
19
- &[aria-current] {
19
+ &[aria-current="true"] {
20
20
  background: var(--wp-admin-theme-color);
21
21
  color: $white;
22
22
  }
@@ -18,7 +18,7 @@
18
18
  .edit-site-sidebar-navigation-screen__content {
19
19
  padding: 0 $grid-unit-20;
20
20
 
21
- .components-item-group {
21
+ .edit-site-sidebar-navigation-screen-details-footer {
22
22
  margin-left: -$grid-unit-20;
23
23
  margin-right: -$grid-unit-20;
24
24
  }
@@ -127,9 +127,14 @@
127
127
  bottom: 0;
128
128
  background-color: $gray-900;
129
129
  gap: 0;
130
- padding: $grid-unit-20 0;
130
+ padding: $grid-unit-10 $grid-unit-20;
131
131
  margin: $grid-unit-20 0 0;
132
132
  border-top: 1px solid $gray-800;
133
+
134
+ .components-item-group {
135
+ margin-left: -$grid-unit-20;
136
+ margin-right: -$grid-unit-20;
137
+ }
133
138
  }
134
139
 
135
140
  /* In general style overrides are discouraged.
@@ -1,28 +1,19 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __, sprintf } from '@wordpress/i18n';
5
- import { humanTimeDiff } from '@wordpress/date';
6
- import { createInterpolateElement } from '@wordpress/element';
4
+ import { _n, sprintf } from '@wordpress/i18n';
7
5
  import { addQueryArgs } from '@wordpress/url';
8
- import {
9
- Icon,
10
- __experimentalItemGroup as ItemGroup,
11
- } from '@wordpress/components';
6
+ import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
12
7
  import { backup } from '@wordpress/icons';
13
8
 
14
9
  /**
15
10
  * Internal dependencies
16
11
  */
17
- import {
18
- SidebarNavigationScreenDetailsPanelRow,
19
- SidebarNavigationScreenDetailsPanelLabel,
20
- SidebarNavigationScreenDetailsPanelValue,
21
- } from '../sidebar-navigation-screen-details-panel';
22
12
  import SidebarNavigationItem from '../sidebar-navigation-item';
23
13
 
24
14
  export default function SidebarNavigationScreenDetailsFooter( {
25
15
  record,
16
+ revisionsCount,
26
17
  ...otherProps
27
18
  } ) {
28
19
  /*
@@ -34,9 +25,20 @@ export default function SidebarNavigationScreenDetailsFooter( {
34
25
  const hrefProps = {};
35
26
  const lastRevisionId =
36
27
  record?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;
37
- const revisionsCount =
38
- record?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;
39
- // Enable the revisions link if there is a last revision and there are more than one revisions.
28
+
29
+ // Use incoming prop first, then the record's version history, if available.
30
+ revisionsCount =
31
+ revisionsCount ||
32
+ record?._links?.[ 'version-history' ]?.[ 0 ]?.count ||
33
+ 0;
34
+
35
+ /*
36
+ * Enable the revisions link if there is a last revision and there is more than one revision.
37
+ * This link is used for theme assets, e.g., templates, which have no database record until they're edited.
38
+ * For these files there's only a "revision" after they're edited twice,
39
+ * which means the revision.php page won't display a proper diff.
40
+ * See: https://github.com/WordPress/gutenberg/issues/49164.
41
+ */
40
42
  if ( lastRevisionId && revisionsCount > 1 ) {
41
43
  hrefProps.href = addQueryArgs( 'revision.php', {
42
44
  revision: record?._links[ 'predecessor-version' ][ 0 ].id,
@@ -44,33 +46,20 @@ export default function SidebarNavigationScreenDetailsFooter( {
44
46
  hrefProps.as = 'a';
45
47
  }
46
48
  return (
47
- <ItemGroup className="edit-site-sidebar-navigation-screen-details-footer">
49
+ <ItemGroup
50
+ size="large"
51
+ className="edit-site-sidebar-navigation-screen-details-footer"
52
+ >
48
53
  <SidebarNavigationItem
49
- aria-label={ __( 'Revisions' ) }
54
+ icon={ backup }
50
55
  { ...hrefProps }
51
56
  { ...otherProps }
52
57
  >
53
- <SidebarNavigationScreenDetailsPanelRow justify="space-between">
54
- <SidebarNavigationScreenDetailsPanelLabel>
55
- { __( 'Last modified' ) }
56
- </SidebarNavigationScreenDetailsPanelLabel>
57
- <SidebarNavigationScreenDetailsPanelValue>
58
- { createInterpolateElement(
59
- sprintf(
60
- /* translators: %s: is the relative time when the post was last modified. */
61
- __( '<time>%s</time>' ),
62
- humanTimeDiff( record.modified )
63
- ),
64
- {
65
- time: <time dateTime={ record.modified } />,
66
- }
67
- ) }
68
- </SidebarNavigationScreenDetailsPanelValue>
69
- <Icon
70
- className="edit-site-sidebar-navigation-screen-details-footer__icon"
71
- icon={ backup }
72
- />
73
- </SidebarNavigationScreenDetailsPanelRow>
58
+ { sprintf(
59
+ /* translators: %d: Number of Styles revisions. */
60
+ _n( '%d Revision', '%d Revisions', revisionsCount ),
61
+ revisionsCount
62
+ ) }
74
63
  </SidebarNavigationItem>
75
64
  </ItemGroup>
76
65
  );
@@ -5,8 +5,4 @@
5
5
  div.edit-site-sidebar-navigation-item.components-item[aria-current] {
6
6
  background: none;
7
7
  }
8
- .edit-site-sidebar-navigation-screen-details-footer__icon {
9
- margin-left: auto;
10
- fill: $gray-600;
11
- }
12
8
  }