@wordpress/edit-site 6.3.0 → 6.5.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 (334) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-pattern/index.js +14 -3
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-post/index.js +2 -1
  5. package/build/components/add-new-post/index.js.map +1 -1
  6. package/build/components/add-new-template/index.js +3 -1
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/add-new-template/utils.js +2 -2
  9. package/build/components/add-new-template/utils.js.map +1 -1
  10. package/build/components/block-editor/use-site-editor-settings.js +1 -82
  11. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  12. package/build/components/editor/index.js +71 -20
  13. package/build/components/editor/index.js.map +1 -1
  14. package/build/components/global-styles/block-preview-panel.js +14 -5
  15. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  16. package/build/components/global-styles/font-families.js +40 -22
  17. package/build/components/global-styles/font-families.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/context.js +0 -5
  19. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/font-collection.js +25 -5
  21. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/index.js +5 -12
  23. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/installed-fonts.js +78 -15
  25. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/upload-fonts.js +2 -3
  27. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  28. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +39 -0
  29. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -0
  30. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +39 -0
  31. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +1 -0
  32. package/build/components/global-styles/font-sizes/font-size-preview.js +44 -0
  33. package/build/components/global-styles/font-sizes/font-size-preview.js.map +1 -0
  34. package/build/components/global-styles/font-sizes/font-size.js +213 -0
  35. package/build/components/global-styles/font-sizes/font-size.js.map +1 -0
  36. package/build/components/global-styles/font-sizes/font-sizes-count.js +50 -0
  37. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +1 -0
  38. package/build/components/global-styles/font-sizes/font-sizes.js +163 -0
  39. package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -0
  40. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +67 -0
  41. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +1 -0
  42. package/build/components/global-styles/screen-block.js +10 -8
  43. package/build/components/global-styles/screen-block.js.map +1 -1
  44. package/build/components/global-styles/screen-style-variations.js +2 -2
  45. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  46. package/build/components/global-styles/screen-typeset.js +40 -0
  47. package/build/components/global-styles/screen-typeset.js.map +1 -0
  48. package/build/components/global-styles/screen-typography-element.js +14 -0
  49. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  50. package/build/components/global-styles/screen-typography.js +5 -6
  51. package/build/components/global-styles/screen-typography.js.map +1 -1
  52. package/build/components/global-styles/shadows-edit-panel.js +50 -59
  53. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  54. package/build/components/global-styles/size-control/index.js +85 -0
  55. package/build/components/global-styles/size-control/index.js.map +1 -0
  56. package/build/components/global-styles/style-variations-container.js +3 -0
  57. package/build/components/global-styles/style-variations-container.js.map +1 -1
  58. package/build/components/global-styles/typeset-button.js +97 -0
  59. package/build/components/global-styles/typeset-button.js.map +1 -0
  60. package/build/components/global-styles/typeset.js +80 -0
  61. package/build/components/global-styles/typeset.js.map +1 -0
  62. package/build/components/global-styles/ui.js +12 -0
  63. package/build/components/global-styles/ui.js.map +1 -1
  64. package/build/components/global-styles/utils.js +10 -1
  65. package/build/components/global-styles/utils.js.map +1 -1
  66. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  67. package/build/components/global-styles/variations/variations-typography.js +1 -1
  68. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  69. package/build/components/layout/index.js +6 -0
  70. package/build/components/layout/index.js.map +1 -1
  71. package/build/components/layout/router.js +14 -6
  72. package/build/components/layout/router.js.map +1 -1
  73. package/build/components/page-patterns/fields.js +230 -0
  74. package/build/components/page-patterns/fields.js.map +1 -0
  75. package/build/components/page-patterns/header.js +1 -1
  76. package/build/components/page-patterns/header.js.map +1 -1
  77. package/build/components/page-patterns/index.js +21 -227
  78. package/build/components/page-patterns/index.js.map +1 -1
  79. package/build/components/page-patterns/use-patterns.js +26 -1
  80. package/build/components/page-patterns/use-patterns.js.map +1 -1
  81. package/build/components/page-templates/fields.js +169 -0
  82. package/build/components/page-templates/fields.js.map +1 -0
  83. package/build/components/page-templates/index.js +38 -198
  84. package/build/components/page-templates/index.js.map +1 -1
  85. package/build/components/post-edit/index.js +117 -0
  86. package/build/components/post-edit/index.js.map +1 -0
  87. package/build/components/post-fields/index.js +318 -0
  88. package/build/components/post-fields/index.js.map +1 -0
  89. package/build/components/post-list/index.js +339 -0
  90. package/build/components/post-list/index.js.map +1 -0
  91. package/build/components/posts-app/router.js +3 -3
  92. package/build/components/posts-app/router.js.map +1 -1
  93. package/build/components/sidebar-dataviews/add-new-view.js +2 -2
  94. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  95. package/build/components/sidebar-dataviews/dataview-item.js +2 -3
  96. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  97. package/build/components/sidebar-dataviews/default-views.js +103 -91
  98. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  99. package/build/components/sidebar-dataviews/index.js +2 -2
  100. package/build/components/sidebar-dataviews/index.js.map +1 -1
  101. package/build/components/sidebar-navigation-screen-global-styles/content.js +64 -0
  102. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -0
  103. package/build/components/sidebar-navigation-screen-global-styles/index.js +2 -47
  104. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  105. package/build/components/site-hub/index.js +6 -3
  106. package/build/components/site-hub/index.js.map +1 -1
  107. package/build/components/style-book/index.js +22 -25
  108. package/build/components/style-book/index.js.map +1 -1
  109. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
  110. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  111. package/build/hooks/push-changes-to-global-styles/index.js +3 -4
  112. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  113. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -4
  114. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  115. package/build/index.js +4 -2
  116. package/build/index.js.map +1 -1
  117. package/build/store/selectors.js +34 -6
  118. package/build/store/selectors.js.map +1 -1
  119. package/build/utils/get-filtered-template-parts.js +64 -0
  120. package/build/utils/get-filtered-template-parts.js.map +1 -0
  121. package/build-module/components/add-new-pattern/index.js +14 -3
  122. package/build-module/components/add-new-pattern/index.js.map +1 -1
  123. package/build-module/components/add-new-post/index.js +2 -1
  124. package/build-module/components/add-new-post/index.js.map +1 -1
  125. package/build-module/components/add-new-template/index.js +3 -1
  126. package/build-module/components/add-new-template/index.js.map +1 -1
  127. package/build-module/components/add-new-template/utils.js +2 -2
  128. package/build-module/components/add-new-template/utils.js.map +1 -1
  129. package/build-module/components/block-editor/use-site-editor-settings.js +1 -82
  130. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  131. package/build-module/components/editor/index.js +73 -22
  132. package/build-module/components/editor/index.js.map +1 -1
  133. package/build-module/components/global-styles/block-preview-panel.js +14 -5
  134. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  135. package/build-module/components/global-styles/font-families.js +42 -24
  136. package/build-module/components/global-styles/font-families.js.map +1 -1
  137. package/build-module/components/global-styles/font-library-modal/context.js +0 -5
  138. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  139. package/build-module/components/global-styles/font-library-modal/font-collection.js +26 -6
  140. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  141. package/build-module/components/global-styles/font-library-modal/index.js +5 -12
  142. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  143. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +81 -18
  144. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  145. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +2 -3
  146. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  147. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +32 -0
  148. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -0
  149. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +32 -0
  150. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +1 -0
  151. package/build-module/components/global-styles/font-sizes/font-size-preview.js +37 -0
  152. package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +1 -0
  153. package/build-module/components/global-styles/font-sizes/font-size.js +207 -0
  154. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -0
  155. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +43 -0
  156. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +1 -0
  157. package/build-module/components/global-styles/font-sizes/font-sizes.js +157 -0
  158. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -0
  159. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +61 -0
  160. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +1 -0
  161. package/build-module/components/global-styles/screen-block.js +10 -8
  162. package/build-module/components/global-styles/screen-block.js.map +1 -1
  163. package/build-module/components/global-styles/screen-style-variations.js +2 -2
  164. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  165. package/build-module/components/global-styles/screen-typeset.js +34 -0
  166. package/build-module/components/global-styles/screen-typeset.js.map +1 -0
  167. package/build-module/components/global-styles/screen-typography-element.js +14 -0
  168. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  169. package/build-module/components/global-styles/screen-typography.js +5 -6
  170. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  171. package/build-module/components/global-styles/shadows-edit-panel.js +51 -60
  172. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  173. package/build-module/components/global-styles/size-control/index.js +79 -0
  174. package/build-module/components/global-styles/size-control/index.js.map +1 -0
  175. package/build-module/components/global-styles/style-variations-container.js +3 -0
  176. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  177. package/build-module/components/global-styles/typeset-button.js +89 -0
  178. package/build-module/components/global-styles/typeset-button.js.map +1 -0
  179. package/build-module/components/global-styles/typeset.js +71 -0
  180. package/build-module/components/global-styles/typeset.js.map +1 -0
  181. package/build-module/components/global-styles/ui.js +12 -0
  182. package/build-module/components/global-styles/ui.js.map +1 -1
  183. package/build-module/components/global-styles/utils.js +10 -1
  184. package/build-module/components/global-styles/utils.js.map +1 -1
  185. package/build-module/components/global-styles/variations/variations-color.js +1 -1
  186. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  187. package/build-module/components/global-styles/variations/variations-typography.js +1 -2
  188. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  189. package/build-module/components/layout/index.js +6 -0
  190. package/build-module/components/layout/index.js.map +1 -1
  191. package/build-module/components/layout/router.js +14 -6
  192. package/build-module/components/layout/router.js.map +1 -1
  193. package/build-module/components/page-patterns/fields.js +223 -0
  194. package/build-module/components/page-patterns/fields.js.map +1 -0
  195. package/build-module/components/page-patterns/header.js +1 -1
  196. package/build-module/components/page-patterns/header.js.map +1 -1
  197. package/build-module/components/page-patterns/index.js +24 -230
  198. package/build-module/components/page-patterns/index.js.map +1 -1
  199. package/build-module/components/page-patterns/use-patterns.js +26 -1
  200. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  201. package/build-module/components/page-templates/fields.js +160 -0
  202. package/build-module/components/page-templates/fields.js.map +1 -0
  203. package/build-module/components/page-templates/index.js +39 -199
  204. package/build-module/components/page-templates/index.js.map +1 -1
  205. package/build-module/components/post-edit/index.js +110 -0
  206. package/build-module/components/post-edit/index.js.map +1 -0
  207. package/build-module/components/post-fields/index.js +310 -0
  208. package/build-module/components/post-fields/index.js.map +1 -0
  209. package/build-module/components/post-list/index.js +333 -0
  210. package/build-module/components/post-list/index.js.map +1 -0
  211. package/build-module/components/posts-app/router.js +3 -3
  212. package/build-module/components/posts-app/router.js.map +1 -1
  213. package/build-module/components/sidebar-dataviews/add-new-view.js +2 -2
  214. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  215. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -3
  216. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  217. package/build-module/components/sidebar-dataviews/default-views.js +102 -90
  218. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  219. package/build-module/components/sidebar-dataviews/index.js +5 -5
  220. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  221. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +57 -0
  222. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -0
  223. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +2 -47
  224. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  225. package/build-module/components/site-hub/index.js +7 -4
  226. package/build-module/components/site-hub/index.js.map +1 -1
  227. package/build-module/components/style-book/index.js +23 -26
  228. package/build-module/components/style-book/index.js.map +1 -1
  229. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
  230. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  231. package/build-module/hooks/push-changes-to-global-styles/index.js +3 -4
  232. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  233. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -3
  234. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  235. package/build-module/index.js +4 -2
  236. package/build-module/index.js.map +1 -1
  237. package/build-module/store/selectors.js +35 -7
  238. package/build-module/store/selectors.js.map +1 -1
  239. package/build-module/utils/get-filtered-template-parts.js +57 -0
  240. package/build-module/utils/get-filtered-template-parts.js.map +1 -0
  241. package/build-style/posts-rtl.css +749 -492
  242. package/build-style/posts.css +749 -492
  243. package/build-style/style-rtl.css +956 -613
  244. package/build-style/style.css +956 -613
  245. package/package.json +41 -41
  246. package/src/components/add-new-pattern/index.js +16 -5
  247. package/src/components/add-new-post/index.js +2 -1
  248. package/src/components/add-new-template/index.js +4 -1
  249. package/src/components/add-new-template/style.scss +4 -6
  250. package/src/components/add-new-template/utils.js +10 -6
  251. package/src/components/block-editor/use-site-editor-settings.js +15 -111
  252. package/src/components/editor/index.js +80 -22
  253. package/src/components/editor/style.scss +59 -1
  254. package/src/components/global-styles/block-preview-panel.js +22 -9
  255. package/src/components/global-styles/font-families.js +65 -32
  256. package/src/components/global-styles/font-library-modal/context.js +0 -5
  257. package/src/components/global-styles/font-library-modal/font-collection.js +34 -10
  258. package/src/components/global-styles/font-library-modal/index.js +6 -9
  259. package/src/components/global-styles/font-library-modal/installed-fonts.js +115 -16
  260. package/src/components/global-styles/font-library-modal/style.scss +9 -0
  261. package/src/components/global-styles/font-library-modal/upload-fonts.js +2 -2
  262. package/src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +43 -0
  263. package/src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +37 -0
  264. package/src/components/global-styles/font-sizes/font-size-preview.js +43 -0
  265. package/src/components/global-styles/font-sizes/font-size.js +250 -0
  266. package/src/components/global-styles/font-sizes/font-sizes-count.js +40 -0
  267. package/src/components/global-styles/font-sizes/font-sizes.js +263 -0
  268. package/src/components/global-styles/font-sizes/rename-font-size-dialog.js +70 -0
  269. package/src/components/global-styles/screen-block.js +12 -14
  270. package/src/components/global-styles/screen-style-variations.js +2 -2
  271. package/src/components/global-styles/screen-typeset.js +42 -0
  272. package/src/components/global-styles/screen-typography-element.js +14 -0
  273. package/src/components/global-styles/screen-typography.js +7 -6
  274. package/src/components/global-styles/shadows-edit-panel.js +66 -73
  275. package/src/components/global-styles/size-control/index.js +86 -0
  276. package/src/components/global-styles/style-variations-container.js +4 -0
  277. package/src/components/global-styles/style.scss +17 -10
  278. package/src/components/global-styles/typeset-button.js +93 -0
  279. package/src/components/global-styles/typeset.js +73 -0
  280. package/src/components/global-styles/ui.js +15 -0
  281. package/src/components/global-styles/utils.js +13 -1
  282. package/src/components/global-styles/variations/variations-color.js +1 -1
  283. package/src/components/global-styles/variations/variations-typography.js +1 -2
  284. package/src/components/layout/index.js +11 -0
  285. package/src/components/layout/router.js +13 -5
  286. package/src/components/layout/style.scss +34 -8
  287. package/src/components/page-patterns/fields.js +251 -0
  288. package/src/components/page-patterns/header.js +1 -1
  289. package/src/components/page-patterns/index.js +24 -246
  290. package/src/components/page-patterns/style.scss +82 -85
  291. package/src/components/page-patterns/use-patterns.js +31 -1
  292. package/src/components/page-templates/fields.js +157 -0
  293. package/src/components/page-templates/index.js +46 -192
  294. package/src/components/page-templates/style.scss +19 -8
  295. package/src/components/post-edit/index.js +115 -0
  296. package/src/components/post-edit/style.scss +9 -0
  297. package/src/components/post-fields/index.js +357 -0
  298. package/src/components/post-list/index.js +386 -0
  299. package/src/components/{posts-app → post-list}/style.scss +12 -9
  300. package/src/components/posts-app/router.js +3 -3
  301. package/src/components/sidebar-dataviews/add-new-view.js +2 -4
  302. package/src/components/sidebar-dataviews/dataview-item.js +2 -2
  303. package/src/components/sidebar-dataviews/default-views.js +116 -104
  304. package/src/components/sidebar-dataviews/index.js +4 -3
  305. package/src/components/sidebar-navigation-screen-global-styles/content.js +55 -0
  306. package/src/components/sidebar-navigation-screen-global-styles/index.js +1 -55
  307. package/src/components/site-hub/index.js +11 -2
  308. package/src/components/site-icon/style.scss +4 -1
  309. package/src/components/style-book/index.js +27 -32
  310. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
  311. package/src/hooks/push-changes-to-global-styles/index.js +3 -4
  312. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -3
  313. package/src/index.js +6 -2
  314. package/src/posts.scss +1 -1
  315. package/src/store/selectors.js +53 -14
  316. package/src/store/test/selectors.js +1 -26
  317. package/src/style.scss +2 -1
  318. package/src/utils/get-filtered-template-parts.js +61 -0
  319. package/src/utils/test/get-filtered-template-parts.js +127 -0
  320. package/build/components/global-styles/screen-background.js +0 -36
  321. package/build/components/global-styles/screen-background.js.map +0 -1
  322. package/build/components/posts-app/posts-list.js +0 -568
  323. package/build/components/posts-app/posts-list.js.map +0 -1
  324. package/build/utils/clone-deep.js +0 -15
  325. package/build/utils/clone-deep.js.map +0 -1
  326. package/build-module/components/global-styles/screen-background.js +0 -30
  327. package/build-module/components/global-styles/screen-background.js.map +0 -1
  328. package/build-module/components/posts-app/posts-list.js +0 -560
  329. package/build-module/components/posts-app/posts-list.js.map +0 -1
  330. package/build-module/utils/clone-deep.js +0 -9
  331. package/build-module/utils/clone-deep.js.map +0 -1
  332. package/src/components/global-styles/screen-background.js +0 -29
  333. package/src/components/posts-app/posts-list.js +0 -651
  334. package/src/utils/clone-deep.js +0 -8
@@ -26,17 +26,31 @@ import {
26
26
  OPERATOR_IS_ANY,
27
27
  } from '../../utils/constants';
28
28
 
29
- export const DEFAULT_CONFIG_PER_VIEW_TYPE = {
29
+ export const defaultLayouts = {
30
30
  [ LAYOUT_TABLE ]: {
31
- primaryField: 'title',
31
+ layout: {
32
+ primaryField: 'title',
33
+ styles: {
34
+ 'featured-image': {
35
+ width: '1%',
36
+ },
37
+ title: {
38
+ maxWidth: 300,
39
+ },
40
+ },
41
+ },
32
42
  },
33
43
  [ LAYOUT_GRID ]: {
34
- mediaField: 'featured-image',
35
- primaryField: 'title',
44
+ layout: {
45
+ mediaField: 'featured-image',
46
+ primaryField: 'title',
47
+ },
36
48
  },
37
49
  [ LAYOUT_LIST ]: {
38
- primaryField: 'title',
39
- mediaField: 'featured-image',
50
+ layout: {
51
+ primaryField: 'title',
52
+ mediaField: 'featured-image',
53
+ },
40
54
  },
41
55
  };
42
56
 
@@ -51,9 +65,7 @@ const DEFAULT_POST_BASE = {
51
65
  direction: 'desc',
52
66
  },
53
67
  fields: [ 'title', 'author', 'status' ],
54
- layout: {
55
- ...DEFAULT_CONFIG_PER_VIEW_TYPE[ LAYOUT_LIST ],
56
- },
68
+ layout: defaultLayouts[ LAYOUT_LIST ].layout,
57
69
  };
58
70
 
59
71
  export function useDefaultViews( { postType } ) {
@@ -65,105 +77,105 @@ export function useDefaultViews( { postType } ) {
65
77
  [ postType ]
66
78
  );
67
79
  return useMemo( () => {
68
- return {
69
- [ postType ]: [
70
- {
71
- title: labels?.all_items || __( 'All items' ),
72
- slug: 'all',
73
- icon: pages,
74
- view: DEFAULT_POST_BASE,
75
- },
76
- {
77
- title: __( 'Published' ),
78
- slug: 'published',
79
- icon: published,
80
- view: {
81
- ...DEFAULT_POST_BASE,
82
- filters: [
83
- {
84
- field: 'status',
85
- operator: OPERATOR_IS_ANY,
86
- value: 'publish',
87
- },
88
- ],
89
- },
80
+ return [
81
+ {
82
+ title: labels?.all_items || __( 'All items' ),
83
+ slug: 'all',
84
+ icon: pages,
85
+ view: DEFAULT_POST_BASE,
86
+ },
87
+ {
88
+ title: __( 'Published' ),
89
+ slug: 'published',
90
+ icon: published,
91
+ view: {
92
+ ...DEFAULT_POST_BASE,
93
+ filters: [
94
+ {
95
+ field: 'status',
96
+ operator: OPERATOR_IS_ANY,
97
+ value: 'publish',
98
+ },
99
+ ],
90
100
  },
91
- {
92
- title: __( 'Scheduled' ),
93
- slug: 'future',
94
- icon: scheduled,
95
- view: {
96
- ...DEFAULT_POST_BASE,
97
- filters: [
98
- {
99
- field: 'status',
100
- operator: OPERATOR_IS_ANY,
101
- value: 'future',
102
- },
103
- ],
104
- },
101
+ },
102
+ {
103
+ title: __( 'Scheduled' ),
104
+ slug: 'future',
105
+ icon: scheduled,
106
+ view: {
107
+ ...DEFAULT_POST_BASE,
108
+ filters: [
109
+ {
110
+ field: 'status',
111
+ operator: OPERATOR_IS_ANY,
112
+ value: 'future',
113
+ },
114
+ ],
105
115
  },
106
- {
107
- title: __( 'Drafts' ),
108
- slug: 'drafts',
109
- icon: drafts,
110
- view: {
111
- ...DEFAULT_POST_BASE,
112
- filters: [
113
- {
114
- field: 'status',
115
- operator: OPERATOR_IS_ANY,
116
- value: 'draft',
117
- },
118
- ],
119
- },
116
+ },
117
+ {
118
+ title: __( 'Drafts' ),
119
+ slug: 'drafts',
120
+ icon: drafts,
121
+ view: {
122
+ ...DEFAULT_POST_BASE,
123
+ filters: [
124
+ {
125
+ field: 'status',
126
+ operator: OPERATOR_IS_ANY,
127
+ value: 'draft',
128
+ },
129
+ ],
120
130
  },
121
- {
122
- title: __( 'Pending' ),
123
- slug: 'pending',
124
- icon: pending,
125
- view: {
126
- ...DEFAULT_POST_BASE,
127
- filters: [
128
- {
129
- field: 'status',
130
- operator: OPERATOR_IS_ANY,
131
- value: 'pending',
132
- },
133
- ],
134
- },
131
+ },
132
+ {
133
+ title: __( 'Pending' ),
134
+ slug: 'pending',
135
+ icon: pending,
136
+ view: {
137
+ ...DEFAULT_POST_BASE,
138
+ filters: [
139
+ {
140
+ field: 'status',
141
+ operator: OPERATOR_IS_ANY,
142
+ value: 'pending',
143
+ },
144
+ ],
135
145
  },
136
- {
137
- title: __( 'Private' ),
138
- slug: 'private',
139
- icon: notAllowed,
140
- view: {
141
- ...DEFAULT_POST_BASE,
142
- filters: [
143
- {
144
- field: 'status',
145
- operator: OPERATOR_IS_ANY,
146
- value: 'private',
147
- },
148
- ],
149
- },
146
+ },
147
+ {
148
+ title: __( 'Private' ),
149
+ slug: 'private',
150
+ icon: notAllowed,
151
+ view: {
152
+ ...DEFAULT_POST_BASE,
153
+ filters: [
154
+ {
155
+ field: 'status',
156
+ operator: OPERATOR_IS_ANY,
157
+ value: 'private',
158
+ },
159
+ ],
150
160
  },
151
- {
152
- title: __( 'Trash' ),
153
- slug: 'trash',
154
- icon: trash,
155
- view: {
156
- ...DEFAULT_POST_BASE,
157
- filters: [
158
- {
159
- field: 'status',
160
- operator: OPERATOR_IS_ANY,
161
- value: 'trash',
162
- },
163
- ],
164
- },
161
+ },
162
+ {
163
+ title: __( 'Trash' ),
164
+ slug: 'trash',
165
+ icon: trash,
166
+ view: {
167
+ ...DEFAULT_POST_BASE,
168
+ type: LAYOUT_TABLE,
169
+ layout: defaultLayouts[ LAYOUT_TABLE ].layout,
170
+ filters: [
171
+ {
172
+ field: 'status',
173
+ operator: OPERATOR_IS_ANY,
174
+ value: 'trash',
175
+ },
176
+ ],
165
177
  },
166
- ],
167
- };
168
- }, [ labels, postType ] );
178
+ },
179
+ ];
180
+ }, [ labels ] );
169
181
  }
@@ -9,15 +9,16 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
9
9
  */
10
10
  import { useDefaultViews } from './default-views';
11
11
  import { unlock } from '../../lock-unlock';
12
- const { useLocation } = unlock( routerPrivateApis );
13
12
  import DataViewItem from './dataview-item';
14
13
  import CustomDataViewsList from './custom-dataviews-list';
15
14
 
15
+ const { useLocation } = unlock( routerPrivateApis );
16
+
16
17
  export default function DataViewsSidebarContent() {
17
18
  const {
18
19
  params: { postType, activeView = 'all', isCustom = 'false' },
19
20
  } = useLocation();
20
- const DEFAULT_VIEWS = useDefaultViews( { postType } );
21
+ const defaultViews = useDefaultViews( { postType } );
21
22
  if ( ! postType ) {
22
23
  return null;
23
24
  }
@@ -26,7 +27,7 @@ export default function DataViewsSidebarContent() {
26
27
  return (
27
28
  <>
28
29
  <ItemGroup>
29
- { DEFAULT_VIEWS[ postType ].map( ( dataview ) => {
30
+ { defaultViews.map( ( dataview ) => {
30
31
  return (
31
32
  <DataViewItem
32
33
  key={ dataview.slug }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { useSelect } from '@wordpress/data';
6
+ import { __experimentalVStack as VStack } from '@wordpress/components';
7
+ import { BlockEditorProvider } from '@wordpress/block-editor';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import StyleVariationsContainer from '../global-styles/style-variations-container';
13
+ import { unlock } from '../../lock-unlock';
14
+ import { store as editSiteStore } from '../../store';
15
+ import ColorVariations from '../global-styles/variations/variations-color';
16
+ import TypographyVariations from '../global-styles/variations/variations-typography';
17
+
18
+ const noop = () => {};
19
+
20
+ export default function SidebarNavigationScreenGlobalStylesContent() {
21
+ const { storedSettings } = useSelect( ( select ) => {
22
+ const { getSettings } = unlock( select( editSiteStore ) );
23
+
24
+ return {
25
+ storedSettings: getSettings(),
26
+ };
27
+ }, [] );
28
+
29
+ const gap = 3;
30
+
31
+ // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are
32
+ // loaded. This is necessary because the Iframe component waits until
33
+ // the block editor store's `__internalIsInitialized` is true before
34
+ // rendering the iframe. Without this, the iframe previews will not render
35
+ // in mobile viewport sizes, where the editor canvas is hidden.
36
+ return (
37
+ <BlockEditorProvider
38
+ settings={ storedSettings }
39
+ onChange={ noop }
40
+ onInput={ noop }
41
+ >
42
+ <VStack
43
+ spacing={ 10 }
44
+ className="edit-site-global-styles-variation-container"
45
+ >
46
+ <StyleVariationsContainer gap={ gap } />
47
+ <ColorVariations title={ __( 'Palettes' ) } gap={ gap } />
48
+ <TypographyVariations
49
+ title={ __( 'Typography' ) }
50
+ gap={ gap }
51
+ />
52
+ </VStack>
53
+ </BlockEditorProvider>
54
+ );
55
+ }
@@ -5,9 +5,7 @@ import { __ } from '@wordpress/i18n';
5
5
  import { edit, seen } from '@wordpress/icons';
6
6
  import { useSelect, useDispatch } from '@wordpress/data';
7
7
  import { store as coreStore } from '@wordpress/core-data';
8
- import { __experimentalVStack as VStack } from '@wordpress/components';
9
8
  import { useViewportMatch } from '@wordpress/compose';
10
- import { BlockEditorProvider } from '@wordpress/block-editor';
11
9
  import { useCallback } from '@wordpress/element';
12
10
  import { store as editorStore } from '@wordpress/editor';
13
11
  import { store as preferencesStore } from '@wordpress/preferences';
@@ -16,7 +14,6 @@ import { store as preferencesStore } from '@wordpress/preferences';
16
14
  * Internal dependencies
17
15
  */
18
16
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
19
- import StyleVariationsContainer from '../global-styles/style-variations-container';
20
17
  import { unlock } from '../../lock-unlock';
21
18
  import { store as editSiteStore } from '../../store';
22
19
  import SidebarButton from '../sidebar-button';
@@ -24,11 +21,7 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
24
21
  import StyleBook from '../style-book';
25
22
  import useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';
26
23
  import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
27
- import ColorVariations from '../global-styles/variations/variations-color';
28
- import TypographyVariations from '../global-styles/variations/variations-typography';
29
- import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
30
-
31
- const noop = () => {};
24
+ import SidebarNavigationScreenGlobalStylesContent from './content';
32
25
 
33
26
  export function SidebarNavigationItemGlobalStyles( props ) {
34
27
  const { openGeneralSidebar } = useDispatch( editSiteStore );
@@ -63,53 +56,6 @@ export function SidebarNavigationItemGlobalStyles( props ) {
63
56
  );
64
57
  }
65
58
 
66
- function SidebarNavigationScreenGlobalStylesContent() {
67
- const { storedSettings } = useSelect( ( select ) => {
68
- const { getSettings } = unlock( select( editSiteStore ) );
69
-
70
- return {
71
- storedSettings: getSettings(),
72
- };
73
- }, [] );
74
-
75
- const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( [
76
- 'color',
77
- ] );
78
- const typographyVariations =
79
- useCurrentMergeThemeStyleVariationsWithUserConfig( [ 'typography' ] );
80
-
81
- const gap = 3;
82
-
83
- // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are
84
- // loaded. This is necessary because the Iframe component waits until
85
- // the block editor store's `__internalIsInitialized` is true before
86
- // rendering the iframe. Without this, the iframe previews will not render
87
- // in mobile viewport sizes, where the editor canvas is hidden.
88
- return (
89
- <BlockEditorProvider
90
- settings={ storedSettings }
91
- onChange={ noop }
92
- onInput={ noop }
93
- >
94
- <VStack
95
- spacing={ 10 }
96
- className="edit-site-global-styles-variation-container"
97
- >
98
- <StyleVariationsContainer gap={ gap } />
99
- { colorVariations?.length && (
100
- <ColorVariations title={ __( 'Palettes' ) } gap={ gap } />
101
- ) }
102
- { typographyVariations?.length && (
103
- <TypographyVariations
104
- title={ __( 'Typography' ) }
105
- gap={ gap }
106
- />
107
- ) }
108
- </VStack>
109
- </BlockEditorProvider>
110
- );
111
- }
112
-
113
59
  export default function SidebarNavigationScreenGlobalStyles( { backPath } ) {
114
60
  const { revisions, isLoading: isLoadingRevisions } =
115
61
  useGlobalStylesRevisions();
@@ -7,7 +7,11 @@ import clsx from 'clsx';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { useSelect, useDispatch } from '@wordpress/data';
10
- import { Button, __experimentalHStack as HStack } from '@wordpress/components';
10
+ import {
11
+ Button,
12
+ __experimentalHStack as HStack,
13
+ VisuallyHidden,
14
+ } from '@wordpress/components';
11
15
  import { __ } from '@wordpress/i18n';
12
16
  import { store as coreStore } from '@wordpress/core-data';
13
17
  import { decodeEntities } from '@wordpress/html-entities';
@@ -80,9 +84,14 @@ const SiteHub = memo(
80
84
  variant="link"
81
85
  href={ homeUrl }
82
86
  target="_blank"
83
- label={ __( 'View site (opens in a new tab)' ) }
84
87
  >
85
88
  { decodeEntities( siteTitle ) }
89
+ <VisuallyHidden as="span">
90
+ {
91
+ /* translators: accessibility text */
92
+ __( '(opens in a new tab)' )
93
+ }
94
+ </VisuallyHidden>
86
95
  </Button>
87
96
  </div>
88
97
  <HStack
@@ -1,9 +1,11 @@
1
1
  .edit-site-site-icon__icon {
2
2
  fill: currentColor;
3
+ width: 100%;
4
+ height: 100%;
3
5
 
4
6
  .edit-site-layout.is-full-canvas & {
5
7
  // Make the WordPress icon not so big in full canvas.
6
- padding: $grid-unit-15 * 0.5; // 6px.
8
+ padding: $grid-unit-15;
7
9
  }
8
10
  }
9
11
 
@@ -12,6 +14,7 @@
12
14
  height: 100%;
13
15
  object-fit: cover;
14
16
  background: #333;
17
+ aspect-ratio: 1 / 1;
15
18
 
16
19
  .edit-site-layout.is-full-canvas & {
17
20
  border-radius: 0;
@@ -13,6 +13,7 @@ import {
13
13
  import { __, sprintf } from '@wordpress/i18n';
14
14
  import {
15
15
  getCategories,
16
+ getBlockType,
16
17
  getBlockTypes,
17
18
  getBlockFromExample,
18
19
  createBlock,
@@ -128,37 +129,7 @@ function isObjectEmpty( object ) {
128
129
  }
129
130
 
130
131
  function getExamples() {
131
- // Use our own example for the Heading block so that we can show multiple
132
- // heading levels.
133
- const headingsExample = {
134
- name: 'core/heading',
135
- title: __( 'Headings' ),
136
- category: 'text',
137
- blocks: [
138
- createBlock( 'core/heading', {
139
- content: __( 'Code Is Poetry' ),
140
- level: 1,
141
- } ),
142
- createBlock( 'core/heading', {
143
- content: __( 'Code Is Poetry' ),
144
- level: 2,
145
- } ),
146
- createBlock( 'core/heading', {
147
- content: __( 'Code Is Poetry' ),
148
- level: 3,
149
- } ),
150
- createBlock( 'core/heading', {
151
- content: __( 'Code Is Poetry' ),
152
- level: 4,
153
- } ),
154
- createBlock( 'core/heading', {
155
- content: __( 'Code Is Poetry' ),
156
- level: 5,
157
- } ),
158
- ],
159
- };
160
-
161
- const otherExamples = getBlockTypes()
132
+ const nonHeadingBlockExamples = getBlockTypes()
162
133
  .filter( ( blockType ) => {
163
134
  const { name, example, supports } = blockType;
164
135
  return (
@@ -174,7 +145,31 @@ function getExamples() {
174
145
  blocks: getBlockFromExample( blockType.name, blockType.example ),
175
146
  } ) );
176
147
 
177
- return [ headingsExample, ...otherExamples ];
148
+ const isHeadingBlockRegistered = !! getBlockType( 'core/heading' );
149
+
150
+ if ( ! isHeadingBlockRegistered ) {
151
+ return nonHeadingBlockExamples;
152
+ }
153
+
154
+ // Use our own example for the Heading block so that we can show multiple
155
+ // heading levels.
156
+ const headingsExample = {
157
+ name: 'core/heading',
158
+ title: __( 'Headings' ),
159
+ category: 'text',
160
+ blocks: [ 1, 2, 3, 4, 5, 6 ].map( ( level ) => {
161
+ return createBlock( 'core/heading', {
162
+ content: sprintf(
163
+ // translators: %d: heading level e.g: "1", "2", "3"
164
+ __( 'Heading %d' ),
165
+ level
166
+ ),
167
+ level,
168
+ } );
169
+ } ),
170
+ };
171
+
172
+ return [ headingsExample, ...nonHeadingBlockExamples ];
178
173
  }
179
174
 
180
175
  function StyleBook( {
@@ -90,6 +90,11 @@ function useResolveEditedEntityAndContext( { postId, postType } ) {
90
90
  return undefined;
91
91
  }
92
92
 
93
+ // Don't trigger resolution for multi-selected posts.
94
+ if ( postId && postId.includes( ',' ) ) {
95
+ return undefined;
96
+ }
97
+
93
98
  const {
94
99
  getEditedEntityRecord,
95
100
  getEntityRecords,
@@ -26,7 +26,6 @@ import { store as coreStore } from '@wordpress/core-data';
26
26
  */
27
27
  import { useSupportedStyles } from '../../components/global-styles/hooks';
28
28
  import { unlock } from '../../lock-unlock';
29
- import cloneDeep from '../../utils/clone-deep';
30
29
  import setNestedValue from '../../utils/set-nested-value';
31
30
 
32
31
  const { cleanEmptyObject, GlobalStylesContext } = unlock(
@@ -259,8 +258,8 @@ function PushChangesToGlobalStylesControl( {
259
258
  if ( changes.length > 0 ) {
260
259
  const { style: blockStyles } = attributes;
261
260
 
262
- const newBlockStyles = cloneDeep( blockStyles );
263
- const newUserConfig = cloneDeep( userConfig );
261
+ const newBlockStyles = structuredClone( blockStyles );
262
+ const newUserConfig = structuredClone( userConfig );
264
263
 
265
264
  for ( const { path, value } of changes ) {
266
265
  setNestedValue( newBlockStyles, path, undefined );
@@ -375,7 +374,7 @@ function PushChangesToGlobalStyles( props ) {
375
374
  const withPushChangesToGlobalStyles = createHigherOrderComponent(
376
375
  ( BlockEdit ) => ( props ) => (
377
376
  <>
378
- <BlockEdit { ...props } />
377
+ <BlockEdit key="edit" { ...props } />
379
378
  { props.isSelected && <PushChangesToGlobalStyles { ...props } /> }
380
379
  </>
381
380
  )
@@ -11,7 +11,6 @@ import { __ } from '@wordpress/i18n';
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
- import cloneDeep from '../../utils/clone-deep';
15
14
  import { unlock } from '../../lock-unlock';
16
15
 
17
16
  const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
@@ -91,7 +90,7 @@ export function useCurrentMergeThemeStyleVariationsWithUserConfig(
91
90
  const propertiesAsString = properties.toString();
92
91
 
93
92
  return useMemo( () => {
94
- const clonedUserVariation = cloneDeep( userVariation );
93
+ const clonedUserVariation = structuredClone( userVariation );
95
94
 
96
95
  // Get user variation and remove the settings for the given property.
97
96
  const userVariationWithoutProperties = removePropertiesFromObject(
@@ -167,7 +166,7 @@ export const filterObjectByProperties = ( object, properties ) => {
167
166
  */
168
167
  export function isVariationWithProperties( variation, properties ) {
169
168
  const variationWithProperties = filterObjectByProperties(
170
- cloneDeep( variation ),
169
+ structuredClone( variation ),
171
170
  properties
172
171
  );
173
172
 
package/src/index.js CHANGED
@@ -28,7 +28,10 @@ import { store as editSiteStore } from './store';
28
28
  import { unlock } from './lock-unlock';
29
29
  import App from './components/app';
30
30
 
31
- const { registerDefaultActions } = unlock( editorPrivateApis );
31
+ const {
32
+ registerCoreBlockBindingsSources,
33
+ bootstrapBlockBindingsSourcesFromServer,
34
+ } = unlock( editorPrivateApis );
32
35
 
33
36
  /**
34
37
  * Initializes the site editor screen.
@@ -45,6 +48,8 @@ export function initializeEditor( id, settings ) {
45
48
  ( { name } ) => name !== 'core/freeform'
46
49
  );
47
50
  registerCoreBlocks( coreBlocks );
51
+ bootstrapBlockBindingsSourcesFromServer( settings?.blockBindingsSources );
52
+ registerCoreBlockBindingsSources();
48
53
  dispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );
49
54
  registerLegacyWidgetBlock( { inserter: false } );
50
55
  registerWidgetGroupBlock( { inserter: false } );
@@ -53,7 +58,6 @@ export function initializeEditor( id, settings ) {
53
58
  enableFSEBlocks: true,
54
59
  } );
55
60
  }
56
- registerDefaultActions();
57
61
 
58
62
  // We dispatch actions and update the store synchronously before rendering
59
63
  // so that we won't trigger unnecessary re-renders with useEffect.
package/src/posts.scss CHANGED
@@ -7,7 +7,7 @@
7
7
  @import "./components/site-hub/style.scss";
8
8
  @import "./components/site-icon/style.scss";
9
9
  @import "./components/editor-canvas-container/style.scss";
10
- @import "./components/posts-app/style.scss";
10
+ @import "./components/post-list/style.scss";
11
11
  @import "./components/resizable-frame/style.scss";
12
12
 
13
13
  @include wordpress-admin-schemes();