@wordpress/edit-site 5.18.1-next.5a1d1283.0 → 5.19.1

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 (687) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +65 -4
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-template/index.js +3 -2
  5. package/build/components/add-new-template/index.js.map +1 -1
  6. package/build/components/add-new-template/new-template.js +6 -1
  7. package/build/components/add-new-template/new-template.js.map +1 -1
  8. package/build/components/add-new-template/utils.js +6 -1
  9. package/build/components/add-new-template/utils.js.map +1 -1
  10. package/build/components/app/index.js +2 -7
  11. package/build/components/app/index.js.map +1 -1
  12. package/build/components/block-editor/back-button.js +3 -2
  13. package/build/components/block-editor/back-button.js.map +1 -1
  14. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +73 -0
  15. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -0
  16. package/build/components/block-editor/block-editor-provider/index.js +31 -0
  17. package/build/components/block-editor/block-editor-provider/index.js.map +1 -0
  18. package/build/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  19. package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -0
  20. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +76 -0
  21. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -0
  22. package/build/components/block-editor/editor-canvas.js +20 -16
  23. package/build/components/block-editor/editor-canvas.js.map +1 -1
  24. package/build/components/block-editor/index.js +2 -9
  25. package/build/components/block-editor/index.js.map +1 -1
  26. package/build/components/block-editor/site-editor-canvas.js +2 -4
  27. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  28. package/build/components/block-editor/use-site-editor-settings.js +8 -4
  29. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  30. package/build/components/canvas-loader/index.js +18 -1
  31. package/build/components/canvas-loader/index.js.map +1 -1
  32. package/build/components/create-template-part-modal/index.js +8 -12
  33. package/build/components/create-template-part-modal/index.js.map +1 -1
  34. package/build/components/editor/index.js +7 -9
  35. package/build/components/editor/index.js.map +1 -1
  36. package/build/components/global-styles/dimensions-panel.js +5 -4
  37. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  38. package/build/components/global-styles/font-families.js +68 -0
  39. package/build/components/global-styles/font-families.js.map +1 -0
  40. package/build/components/global-styles/font-family-item.js +47 -0
  41. package/build/components/global-styles/font-family-item.js.map +1 -0
  42. package/build/components/global-styles/font-library-modal/collection-font-details.js +49 -0
  43. package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -0
  44. package/build/components/global-styles/font-library-modal/collection-font-variant.js +55 -0
  45. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -0
  46. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +31 -0
  47. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
  48. package/build/components/global-styles/font-library-modal/context.js +309 -0
  49. package/build/components/global-styles/font-library-modal/context.js.map +1 -0
  50. package/build/components/global-styles/font-library-modal/font-card.js +61 -0
  51. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -0
  52. package/build/components/global-styles/font-library-modal/font-collection.js +172 -0
  53. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -0
  54. package/build/components/global-styles/font-library-modal/font-demo.js +86 -0
  55. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -0
  56. package/build/components/global-styles/font-library-modal/font-variant.js +51 -0
  57. package/build/components/global-styles/font-library-modal/font-variant.js.map +1 -0
  58. package/build/components/global-styles/font-library-modal/fonts-grid.js +54 -0
  59. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
  60. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +41 -0
  61. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -0
  62. package/build/components/global-styles/font-library-modal/index.js +65 -0
  63. package/build/components/global-styles/font-library-modal/index.js.map +1 -0
  64. package/build/components/global-styles/font-library-modal/installed-fonts.js +128 -0
  65. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
  66. package/build/components/global-styles/font-library-modal/library-font-card.js +39 -0
  67. package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
  68. package/build/components/global-styles/font-library-modal/library-font-details.js +44 -0
  69. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
  70. package/build/components/global-styles/font-library-modal/library-font-variant.js +59 -0
  71. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
  72. package/build/components/global-styles/font-library-modal/local-fonts.js +143 -0
  73. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
  74. package/build/components/global-styles/font-library-modal/resolvers.js +53 -0
  75. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -0
  76. package/build/components/global-styles/font-library-modal/tab-layout.js +45 -0
  77. package/build/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
  78. package/build/components/global-styles/font-library-modal/utils/constants.js +31 -0
  79. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
  80. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +21 -0
  81. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -0
  82. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +20 -0
  83. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -0
  84. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
  85. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
  86. package/build/components/global-styles/font-library-modal/utils/index.js +155 -0
  87. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -0
  88. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +22 -0
  89. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
  90. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +76 -0
  91. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -0
  92. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +36 -0
  93. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -0
  94. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +92 -0
  95. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
  96. package/build/components/global-styles/global-styles-provider.js +7 -12
  97. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  98. package/build/components/global-styles/screen-block.js +34 -21
  99. package/build/components/global-styles/screen-block.js.map +1 -1
  100. package/build/components/global-styles/screen-revisions/index.js +1 -3
  101. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  102. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  103. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  104. package/build/components/global-styles/screen-typography.js +4 -72
  105. package/build/components/global-styles/screen-typography.js.map +1 -1
  106. package/build/components/global-styles/style-variations-container.js +3 -5
  107. package/build/components/global-styles/style-variations-container.js.map +1 -1
  108. package/build/components/global-styles/typogrphy-elements.js +96 -0
  109. package/build/components/global-styles/typogrphy-elements.js.map +1 -0
  110. package/build/components/header-edit-mode/document-actions/index.js +9 -8
  111. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  112. package/build/components/header-edit-mode/index.js +4 -1
  113. package/build/components/header-edit-mode/index.js.map +1 -1
  114. package/build/components/layout/index.js +5 -1
  115. package/build/components/layout/index.js.map +1 -1
  116. package/build/components/list/added-by.js +13 -8
  117. package/build/components/list/added-by.js.map +1 -1
  118. package/build/components/list/index.js +2 -1
  119. package/build/components/list/index.js.map +1 -1
  120. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -3
  121. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  122. package/build/components/page-patterns/duplicate-menu-item.js +56 -20
  123. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  124. package/build/components/page-patterns/grid-item.js +48 -22
  125. package/build/components/page-patterns/grid-item.js.map +1 -1
  126. package/build/components/page-patterns/header.js +3 -7
  127. package/build/components/page-patterns/header.js.map +1 -1
  128. package/build/components/page-patterns/index.js +3 -3
  129. package/build/components/page-patterns/index.js.map +1 -1
  130. package/build/components/page-patterns/patterns-list.js +7 -7
  131. package/build/components/page-patterns/patterns-list.js.map +1 -1
  132. package/build/components/page-patterns/rename-menu-item.js +6 -5
  133. package/build/components/page-patterns/rename-menu-item.js.map +1 -1
  134. package/build/components/page-patterns/search-items.js +8 -2
  135. package/build/components/page-patterns/search-items.js.map +1 -1
  136. package/build/components/page-patterns/use-patterns.js +71 -51
  137. package/build/components/page-patterns/use-patterns.js.map +1 -1
  138. package/build/components/page-patterns/utils.js +1 -20
  139. package/build/components/page-patterns/utils.js.map +1 -1
  140. package/build/components/page-template-parts/add-new-template-part.js +3 -2
  141. package/build/components/page-template-parts/add-new-template-part.js.map +1 -1
  142. package/build/components/page-template-parts/index.js +2 -1
  143. package/build/components/page-template-parts/index.js.map +1 -1
  144. package/build/components/page-templates/index.js +3 -2
  145. package/build/components/page-templates/index.js.map +1 -1
  146. package/build/components/save-hub/index.js +2 -1
  147. package/build/components/save-hub/index.js.map +1 -1
  148. package/build/components/secondary-sidebar/list-view-sidebar.js +24 -17
  149. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  150. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +53 -26
  151. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  152. package/build/components/sidebar-edit-mode/page-panels/hooks.js +65 -0
  153. package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
  154. package/build/components/sidebar-edit-mode/page-panels/index.js +1 -4
  155. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  156. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
  157. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  158. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +56 -0
  159. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
  160. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +91 -0
  161. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
  162. package/build/components/sidebar-edit-mode/settings-header/index.js +2 -6
  163. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  164. package/build/components/sidebar-edit-mode/template-panel/index.js +11 -9
  165. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  166. package/build/components/sidebar-edit-mode/template-panel/last-revision.js +6 -4
  167. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
  168. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +218 -0
  169. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
  170. package/build/components/sidebar-navigation-screen/index.js +6 -4
  171. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  172. package/build/components/sidebar-navigation-screen-details-footer/index.js +32 -4
  173. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  174. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
  175. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  176. package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -31
  177. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  178. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  179. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  180. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -1
  181. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  182. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  183. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  184. package/build/components/sidebar-navigation-screen-page/index.js +3 -3
  185. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  186. package/build/components/sidebar-navigation-screen-page/page-details.js +2 -1
  187. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  188. package/build/components/sidebar-navigation-screen-pages/index.js +5 -4
  189. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  190. package/build/components/sidebar-navigation-screen-pattern/index.js +20 -9
  191. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  192. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -2
  193. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  194. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
  195. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  196. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  197. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  198. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +41 -11
  199. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  200. package/build/components/sidebar-navigation-screen-patterns/index.js +9 -37
  201. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  202. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +44 -5
  203. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  204. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +7 -2
  205. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  206. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
  207. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  208. package/build/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  209. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  210. package/build/components/sidebar-navigation-screen-template/index.js +2 -2
  211. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  212. package/build/components/sidebar-navigation-screen-templates/index.js +5 -4
  213. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  214. package/build/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
  215. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  216. package/build/components/start-template-options/index.js +20 -2
  217. package/build/components/start-template-options/index.js.map +1 -1
  218. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -4
  219. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  220. package/build/components/sync-state-with-url/use-sync-path-with-url.js +4 -3
  221. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  222. package/build/components/template-actions/index.js +8 -4
  223. package/build/components/template-actions/index.js.map +1 -1
  224. package/build/components/template-actions/rename-menu-item.js +9 -3
  225. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  226. package/build/components/welcome-guide/styles.js +2 -2
  227. package/build/components/welcome-guide/styles.js.map +1 -1
  228. package/build/hooks/commands/use-edit-mode-commands.js +4 -3
  229. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  230. package/build/hooks/navigation-menu-edit.js +2 -1
  231. package/build/hooks/navigation-menu-edit.js.map +1 -1
  232. package/build/hooks/push-changes-to-global-styles/index.js +5 -37
  233. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  234. package/build/hooks/template-part-edit.js +2 -1
  235. package/build/hooks/template-part-edit.js.map +1 -1
  236. package/build/store/actions.js +38 -14
  237. package/build/store/actions.js.map +1 -1
  238. package/build/store/constants.js +1 -9
  239. package/build/store/constants.js.map +1 -1
  240. package/build/store/private-actions.js +21 -1
  241. package/build/store/private-actions.js.map +1 -1
  242. package/build/store/private-selectors.js +23 -0
  243. package/build/store/private-selectors.js.map +1 -1
  244. package/build/store/reducer.js +19 -1
  245. package/build/store/reducer.js.map +1 -1
  246. package/build/store/selectors.js +3 -2
  247. package/build/store/selectors.js.map +1 -1
  248. package/build/utils/constants.js +64 -2
  249. package/build/utils/constants.js.map +1 -1
  250. package/build/utils/is-template-removable.js +6 -1
  251. package/build/utils/is-template-removable.js.map +1 -1
  252. package/build/utils/is-template-revertable.js +6 -1
  253. package/build/utils/is-template-revertable.js.map +1 -1
  254. package/build/utils/template-part-create.js +6 -1
  255. package/build/utils/template-part-create.js.map +1 -1
  256. package/build-module/components/add-new-pattern/index.js +69 -8
  257. package/build-module/components/add-new-pattern/index.js.map +1 -1
  258. package/build-module/components/add-new-template/index.js +3 -2
  259. package/build-module/components/add-new-template/index.js.map +1 -1
  260. package/build-module/components/add-new-template/new-template.js +6 -1
  261. package/build-module/components/add-new-template/new-template.js.map +1 -1
  262. package/build-module/components/add-new-template/utils.js +6 -1
  263. package/build-module/components/add-new-template/utils.js.map +1 -1
  264. package/build-module/components/app/index.js +2 -7
  265. package/build-module/components/app/index.js.map +1 -1
  266. package/build-module/components/block-editor/back-button.js +3 -2
  267. package/build-module/components/block-editor/back-button.js.map +1 -1
  268. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +65 -0
  269. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -0
  270. package/build-module/components/block-editor/block-editor-provider/index.js +23 -0
  271. package/build-module/components/block-editor/block-editor-provider/index.js.map +1 -0
  272. package/build-module/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  273. package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -0
  274. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +70 -0
  275. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -0
  276. package/build-module/components/block-editor/editor-canvas.js +21 -17
  277. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  278. package/build-module/components/block-editor/index.js +1 -8
  279. package/build-module/components/block-editor/index.js.map +1 -1
  280. package/build-module/components/block-editor/site-editor-canvas.js +5 -7
  281. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  282. package/build-module/components/block-editor/use-site-editor-settings.js +8 -4
  283. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  284. package/build-module/components/canvas-loader/index.js +18 -1
  285. package/build-module/components/canvas-loader/index.js.map +1 -1
  286. package/build-module/components/create-template-part-modal/index.js +8 -12
  287. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  288. package/build-module/components/editor/index.js +7 -9
  289. package/build-module/components/editor/index.js.map +1 -1
  290. package/build-module/components/global-styles/dimensions-panel.js +5 -4
  291. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  292. package/build-module/components/global-styles/font-families.js +58 -0
  293. package/build-module/components/global-styles/font-families.js.map +1 -0
  294. package/build-module/components/global-styles/font-family-item.js +40 -0
  295. package/build-module/components/global-styles/font-family-item.js.map +1 -0
  296. package/build-module/components/global-styles/font-library-modal/collection-font-details.js +40 -0
  297. package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +1 -0
  298. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +45 -0
  299. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -0
  300. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +23 -0
  301. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
  302. package/build-module/components/global-styles/font-library-modal/context.js +300 -0
  303. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -0
  304. package/build-module/components/global-styles/font-library-modal/font-card.js +52 -0
  305. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -0
  306. package/build-module/components/global-styles/font-library-modal/font-collection.js +164 -0
  307. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -0
  308. package/build-module/components/global-styles/font-library-modal/font-demo.js +79 -0
  309. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -0
  310. package/build-module/components/global-styles/font-library-modal/font-variant.js +42 -0
  311. package/build-module/components/global-styles/font-library-modal/font-variant.js.map +1 -0
  312. package/build-module/components/global-styles/font-library-modal/fonts-grid.js +47 -0
  313. package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
  314. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +33 -0
  315. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -0
  316. package/build-module/components/global-styles/font-library-modal/index.js +57 -0
  317. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -0
  318. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +120 -0
  319. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
  320. package/build-module/components/global-styles/font-library-modal/library-font-card.js +31 -0
  321. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
  322. package/build-module/components/global-styles/font-library-modal/library-font-details.js +35 -0
  323. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
  324. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +50 -0
  325. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
  326. package/build-module/components/global-styles/font-library-modal/local-fonts.js +135 -0
  327. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
  328. package/build-module/components/global-styles/font-library-modal/resolvers.js +42 -0
  329. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -0
  330. package/build-module/components/global-styles/font-library-modal/tab-layout.js +37 -0
  331. package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
  332. package/build-module/components/global-styles/font-library-modal/utils/constants.js +21 -0
  333. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
  334. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +15 -0
  335. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -0
  336. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +13 -0
  337. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -0
  338. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +52 -0
  339. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
  340. package/build-module/components/global-styles/font-library-modal/utils/index.js +141 -0
  341. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -0
  342. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +16 -0
  343. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
  344. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +68 -0
  345. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -0
  346. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +30 -0
  347. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -0
  348. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +86 -0
  349. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
  350. package/build-module/components/global-styles/global-styles-provider.js +7 -12
  351. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  352. package/build-module/components/global-styles/screen-block.js +34 -21
  353. package/build-module/components/global-styles/screen-block.js.map +1 -1
  354. package/build-module/components/global-styles/screen-revisions/index.js +1 -3
  355. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  356. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  357. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  358. package/build-module/components/global-styles/screen-typography.js +6 -74
  359. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  360. package/build-module/components/global-styles/style-variations-container.js +3 -5
  361. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  362. package/build-module/components/global-styles/typogrphy-elements.js +87 -0
  363. package/build-module/components/global-styles/typogrphy-elements.js.map +1 -0
  364. package/build-module/components/header-edit-mode/document-actions/index.js +9 -8
  365. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  366. package/build-module/components/header-edit-mode/index.js +4 -1
  367. package/build-module/components/header-edit-mode/index.js.map +1 -1
  368. package/build-module/components/layout/index.js +5 -1
  369. package/build-module/components/layout/index.js.map +1 -1
  370. package/build-module/components/list/added-by.js +13 -8
  371. package/build-module/components/list/added-by.js.map +1 -1
  372. package/build-module/components/list/index.js +2 -1
  373. package/build-module/components/list/index.js.map +1 -1
  374. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -3
  375. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  376. package/build-module/components/page-patterns/duplicate-menu-item.js +55 -20
  377. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
  378. package/build-module/components/page-patterns/grid-item.js +49 -23
  379. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  380. package/build-module/components/page-patterns/header.js +3 -7
  381. package/build-module/components/page-patterns/header.js.map +1 -1
  382. package/build-module/components/page-patterns/index.js +3 -3
  383. package/build-module/components/page-patterns/index.js.map +1 -1
  384. package/build-module/components/page-patterns/patterns-list.js +7 -7
  385. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  386. package/build-module/components/page-patterns/rename-menu-item.js +6 -5
  387. package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
  388. package/build-module/components/page-patterns/search-items.js +8 -2
  389. package/build-module/components/page-patterns/search-items.js.map +1 -1
  390. package/build-module/components/page-patterns/use-patterns.js +71 -52
  391. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  392. package/build-module/components/page-patterns/utils.js +0 -11
  393. package/build-module/components/page-patterns/utils.js.map +1 -1
  394. package/build-module/components/page-template-parts/add-new-template-part.js +3 -2
  395. package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -1
  396. package/build-module/components/page-template-parts/index.js +2 -1
  397. package/build-module/components/page-template-parts/index.js.map +1 -1
  398. package/build-module/components/page-templates/index.js +3 -2
  399. package/build-module/components/page-templates/index.js.map +1 -1
  400. package/build-module/components/save-hub/index.js +2 -1
  401. package/build-module/components/save-hub/index.js.map +1 -1
  402. package/build-module/components/secondary-sidebar/list-view-sidebar.js +26 -19
  403. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  404. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +54 -29
  405. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  406. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +55 -0
  407. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
  408. package/build-module/components/sidebar-edit-mode/page-panels/index.js +1 -4
  409. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  410. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
  411. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  412. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +49 -0
  413. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
  414. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +85 -0
  415. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
  416. package/build-module/components/sidebar-edit-mode/settings-header/index.js +2 -6
  417. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  418. package/build-module/components/sidebar-edit-mode/template-panel/index.js +12 -10
  419. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  420. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +8 -6
  421. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
  422. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +209 -0
  423. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
  424. package/build-module/components/sidebar-navigation-screen/index.js +6 -4
  425. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  426. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +32 -5
  427. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  428. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
  429. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  430. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +6 -33
  431. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  432. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  433. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  434. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
  435. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  436. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  437. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  438. package/build-module/components/sidebar-navigation-screen-page/index.js +3 -3
  439. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  440. package/build-module/components/sidebar-navigation-screen-page/page-details.js +2 -1
  441. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  442. package/build-module/components/sidebar-navigation-screen-pages/index.js +5 -4
  443. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  444. package/build-module/components/sidebar-navigation-screen-pattern/index.js +21 -10
  445. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  446. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -2
  447. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  448. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
  449. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  450. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  451. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  452. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +41 -11
  453. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  454. package/build-module/components/sidebar-navigation-screen-patterns/index.js +12 -40
  455. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  456. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +44 -5
  457. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  458. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +7 -2
  459. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  460. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -2
  461. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  462. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  463. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  464. package/build-module/components/sidebar-navigation-screen-template/index.js +2 -2
  465. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  466. package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -4
  467. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  468. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
  469. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  470. package/build-module/components/start-template-options/index.js +20 -2
  471. package/build-module/components/start-template-options/index.js.map +1 -1
  472. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -4
  473. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  474. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +4 -3
  475. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  476. package/build-module/components/template-actions/index.js +8 -4
  477. package/build-module/components/template-actions/index.js.map +1 -1
  478. package/build-module/components/template-actions/rename-menu-item.js +9 -3
  479. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  480. package/build-module/components/welcome-guide/styles.js +2 -2
  481. package/build-module/components/welcome-guide/styles.js.map +1 -1
  482. package/build-module/hooks/commands/use-edit-mode-commands.js +4 -3
  483. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  484. package/build-module/hooks/navigation-menu-edit.js +2 -1
  485. package/build-module/hooks/navigation-menu-edit.js.map +1 -1
  486. package/build-module/hooks/push-changes-to-global-styles/index.js +5 -37
  487. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  488. package/build-module/hooks/template-part-edit.js +2 -1
  489. package/build-module/hooks/template-part-edit.js.map +1 -1
  490. package/build-module/store/actions.js +39 -16
  491. package/build-module/store/actions.js.map +1 -1
  492. package/build-module/store/constants.js +0 -4
  493. package/build-module/store/constants.js.map +1 -1
  494. package/build-module/store/private-actions.js +19 -0
  495. package/build-module/store/private-actions.js.map +1 -1
  496. package/build-module/store/private-selectors.js +22 -0
  497. package/build-module/store/private-selectors.js.map +1 -1
  498. package/build-module/store/reducer.js +18 -1
  499. package/build-module/store/reducer.js.map +1 -1
  500. package/build-module/store/selectors.js +3 -3
  501. package/build-module/store/selectors.js.map +1 -1
  502. package/build-module/utils/constants.js +51 -1
  503. package/build-module/utils/constants.js.map +1 -1
  504. package/build-module/utils/is-template-removable.js +6 -1
  505. package/build-module/utils/is-template-removable.js.map +1 -1
  506. package/build-module/utils/is-template-revertable.js +6 -1
  507. package/build-module/utils/is-template-revertable.js.map +1 -1
  508. package/build-module/utils/template-part-create.js +6 -1
  509. package/build-module/utils/template-part-create.js.map +1 -1
  510. package/build-style/style-rtl.css +267 -37
  511. package/build-style/style.css +267 -37
  512. package/lib/inflate.js +4082 -0
  513. package/lib/lib-font.browser.js +3831 -0
  514. package/lib/unbrotli.js +2679 -0
  515. package/package.json +40 -40
  516. package/src/components/add-new-pattern/index.js +86 -8
  517. package/src/components/add-new-template/index.js +3 -2
  518. package/src/components/add-new-template/new-template.js +6 -1
  519. package/src/components/add-new-template/utils.js +12 -3
  520. package/src/components/app/index.js +9 -12
  521. package/src/components/block-editor/back-button.js +6 -2
  522. package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +70 -0
  523. package/src/components/block-editor/block-editor-provider/index.js +29 -0
  524. package/src/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  525. package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +87 -0
  526. package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +77 -0
  527. package/src/components/block-editor/editor-canvas.js +31 -19
  528. package/src/components/block-editor/index.js +1 -14
  529. package/src/components/block-editor/site-editor-canvas.js +7 -12
  530. package/src/components/block-editor/style.scss +88 -1
  531. package/src/components/block-editor/use-site-editor-settings.js +26 -19
  532. package/src/components/canvas-loader/index.js +12 -1
  533. package/src/components/canvas-loader/style.scss +1 -1
  534. package/src/components/create-template-part-modal/index.js +11 -12
  535. package/src/components/editor/index.js +9 -10
  536. package/src/components/global-styles/dimensions-panel.js +8 -4
  537. package/src/components/global-styles/font-families.js +71 -0
  538. package/src/components/global-styles/font-family-item.js +44 -0
  539. package/src/components/global-styles/font-library-modal/collection-font-details.js +56 -0
  540. package/src/components/global-styles/font-library-modal/collection-font-variant.js +45 -0
  541. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +33 -0
  542. package/src/components/global-styles/font-library-modal/context.js +378 -0
  543. package/src/components/global-styles/font-library-modal/font-card.js +75 -0
  544. package/src/components/global-styles/font-library-modal/font-collection.js +257 -0
  545. package/src/components/global-styles/font-library-modal/font-demo.js +83 -0
  546. package/src/components/global-styles/font-library-modal/font-variant.js +53 -0
  547. package/src/components/global-styles/font-library-modal/fonts-grid.js +55 -0
  548. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +50 -0
  549. package/src/components/global-styles/font-library-modal/index.js +67 -0
  550. package/src/components/global-styles/font-library-modal/installed-fonts.js +174 -0
  551. package/src/components/global-styles/font-library-modal/library-font-card.js +33 -0
  552. package/src/components/global-styles/font-library-modal/library-font-details.js +45 -0
  553. package/src/components/global-styles/font-library-modal/library-font-variant.js +54 -0
  554. package/src/components/global-styles/font-library-modal/local-fonts.js +160 -0
  555. package/src/components/global-styles/font-library-modal/resolvers.js +45 -0
  556. package/src/components/global-styles/font-library-modal/style.scss +139 -0
  557. package/src/components/global-styles/font-library-modal/tab-layout.js +50 -0
  558. package/src/components/global-styles/font-library-modal/utils/constants.js +23 -0
  559. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +18 -0
  560. package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +21 -0
  561. package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
  562. package/src/components/global-styles/font-library-modal/utils/index.js +153 -0
  563. package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +15 -0
  564. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +86 -0
  565. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +33 -0
  566. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +69 -0
  567. package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +109 -0
  568. package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +53 -0
  569. package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +30 -0
  570. package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +240 -0
  571. package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +31 -0
  572. package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +57 -0
  573. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +62 -0
  574. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +56 -0
  575. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +108 -0
  576. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +161 -0
  577. package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +41 -0
  578. package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +74 -0
  579. package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +141 -0
  580. package/src/components/global-styles/font-library-modal/utils/toggleFont.js +90 -0
  581. package/src/components/global-styles/global-styles-provider.js +2 -7
  582. package/src/components/global-styles/screen-block.js +42 -20
  583. package/src/components/global-styles/screen-revisions/index.js +0 -2
  584. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  585. package/src/components/global-styles/screen-typography.js +9 -95
  586. package/src/components/global-styles/style-variations-container.js +0 -2
  587. package/src/components/global-styles/typogrphy-elements.js +110 -0
  588. package/src/components/header-edit-mode/document-actions/index.js +17 -8
  589. package/src/components/header-edit-mode/index.js +2 -1
  590. package/src/components/layout/index.js +10 -1
  591. package/src/components/list/added-by.js +29 -11
  592. package/src/components/list/index.js +7 -1
  593. package/src/components/list/style.scss +2 -0
  594. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -8
  595. package/src/components/page-patterns/duplicate-menu-item.js +67 -24
  596. package/src/components/page-patterns/grid-item.js +80 -33
  597. package/src/components/page-patterns/header.js +3 -12
  598. package/src/components/page-patterns/index.js +3 -3
  599. package/src/components/page-patterns/patterns-list.js +7 -7
  600. package/src/components/page-patterns/rename-menu-item.js +18 -7
  601. package/src/components/page-patterns/search-items.js +20 -2
  602. package/src/components/page-patterns/style.scss +1 -5
  603. package/src/components/page-patterns/use-patterns.js +217 -127
  604. package/src/components/page-patterns/utils.js +0 -19
  605. package/src/components/page-template-parts/add-new-template-part.js +5 -2
  606. package/src/components/page-template-parts/index.js +2 -1
  607. package/src/components/page-templates/index.js +3 -2
  608. package/src/components/save-hub/index.js +2 -1
  609. package/src/components/secondary-sidebar/list-view-sidebar.js +31 -26
  610. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +94 -52
  611. package/src/components/sidebar-edit-mode/page-panels/hooks.js +88 -0
  612. package/src/components/sidebar-edit-mode/page-panels/index.js +0 -4
  613. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
  614. package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +44 -0
  615. package/src/components/sidebar-edit-mode/page-panels/style.scss +46 -9
  616. package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +82 -0
  617. package/src/components/sidebar-edit-mode/settings-header/index.js +4 -7
  618. package/src/components/sidebar-edit-mode/template-panel/index.js +28 -24
  619. package/src/components/sidebar-edit-mode/template-panel/last-revision.js +19 -15
  620. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +277 -0
  621. package/src/components/sidebar-navigation-screen/index.js +4 -9
  622. package/src/components/sidebar-navigation-screen/style.scss +7 -1
  623. package/src/components/sidebar-navigation-screen-details-footer/index.js +38 -10
  624. package/src/components/sidebar-navigation-screen-details-footer/style.scss +10 -3
  625. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -0
  626. package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -44
  627. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  628. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
  629. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  630. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
  631. package/src/components/sidebar-navigation-screen-page/index.js +3 -3
  632. package/src/components/sidebar-navigation-screen-page/page-details.js +2 -1
  633. package/src/components/sidebar-navigation-screen-pages/index.js +5 -4
  634. package/src/components/sidebar-navigation-screen-pattern/index.js +22 -8
  635. package/src/components/sidebar-navigation-screen-pattern/style.scss +0 -3
  636. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +8 -2
  637. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +7 -1
  638. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  639. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +63 -20
  640. package/src/components/sidebar-navigation-screen-patterns/index.js +20 -51
  641. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +61 -6
  642. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +12 -2
  643. package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -5
  644. package/src/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  645. package/src/components/sidebar-navigation-screen-template/index.js +2 -4
  646. package/src/components/sidebar-navigation-screen-templates/index.js +5 -4
  647. package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -2
  648. package/src/components/start-template-options/index.js +39 -2
  649. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -4
  650. package/src/components/sync-state-with-url/use-sync-path-with-url.js +8 -3
  651. package/src/components/template-actions/index.js +15 -8
  652. package/src/components/template-actions/rename-menu-item.js +21 -5
  653. package/src/components/welcome-guide/styles.js +2 -2
  654. package/src/hooks/commands/use-edit-mode-commands.js +4 -3
  655. package/src/hooks/navigation-menu-edit.js +2 -1
  656. package/src/hooks/push-changes-to-global-styles/index.js +6 -49
  657. package/src/hooks/template-part-edit.js +2 -1
  658. package/src/store/actions.js +56 -22
  659. package/src/store/constants.js +0 -5
  660. package/src/store/private-actions.js +19 -0
  661. package/src/store/private-selectors.js +22 -0
  662. package/src/store/reducer.js +18 -0
  663. package/src/store/selectors.js +6 -3
  664. package/src/store/test/reducer.js +18 -0
  665. package/src/style.scss +1 -1
  666. package/src/utils/constants.js +54 -3
  667. package/src/utils/is-template-removable.js +8 -1
  668. package/src/utils/is-template-revertable.js +8 -1
  669. package/src/utils/template-part-create.js +6 -1
  670. package/build/components/block-editor/get-block-editor-provider.js +0 -35
  671. package/build/components/block-editor/get-block-editor-provider.js.map +0 -1
  672. package/build/components/block-editor/providers/default-block-editor-provider.js +0 -49
  673. package/build/components/block-editor/providers/default-block-editor-provider.js.map +0 -1
  674. package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +0 -1
  675. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -30
  676. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
  677. package/build-module/components/block-editor/get-block-editor-provider.js +0 -28
  678. package/build-module/components/block-editor/get-block-editor-provider.js.map +0 -1
  679. package/build-module/components/block-editor/providers/default-block-editor-provider.js +0 -41
  680. package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +0 -1
  681. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +0 -1
  682. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -23
  683. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
  684. package/src/components/block-editor/get-block-editor-provider.js +0 -29
  685. package/src/components/block-editor/providers/default-block-editor-provider.js +0 -44
  686. package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -12
  687. package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -24
@@ -1 +1 @@
1
- {"version":3,"names":["__","_x","sprintf","__experimentalTruncate","Truncate","count","wordCount","useSelect","decodeEntities","store","coreStore","useEntityRecord","safeDecodeURIComponent","StatusLabel","unlock","editSiteStore","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","AVERAGE_READING_RATE","getPageDetails","page","details","label","value","createElement","status","password","date","short","numberOfLines","slug","templateTitle","push","parentTitle","wordCountType","wordsCounted","content","rendered","readingTime","Math","round","isPostsPage","toLocaleString","PageDetails","id","record","select","getEditedPostContext","postContext","templates","getEntityRecords","per_page","templateSlug","postType","_templateTitle","find","template","title","_parentTitle","parent","getEntityRecord","_fields","siteSettings","page_for_posts","spacing","map","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/page-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { __experimentalTruncate as Truncate } from '@wordpress/components';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport StatusLabel from './status-label';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\n\n// Taken from packages/editor/src/components/time-to-read/index.js.\nconst AVERAGE_READING_RATE = 189;\n\nfunction getPageDetails( page ) {\n\tif ( ! page ) {\n\t\treturn [];\n\t}\n\n\tconst details = [\n\t\t{\n\t\t\tlabel: __( 'Status' ),\n\t\t\tvalue: (\n\t\t\t\t<StatusLabel\n\t\t\t\t\tstatus={ page?.password ? 'protected' : page.status }\n\t\t\t\t\tdate={ page?.date }\n\t\t\t\t\tshort\n\t\t\t\t/>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Slug' ),\n\t\t\tvalue: (\n\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t{ safeDecodeURIComponent( page.slug ) }\n\t\t\t\t</Truncate>\n\t\t\t),\n\t\t},\n\t];\n\n\tif ( page?.templateTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Template' ),\n\t\t\tvalue: decodeEntities( page.templateTitle ),\n\t\t} );\n\t}\n\n\tif ( page?.parentTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Parent' ),\n\t\t\tvalue: decodeEntities( page.parentTitle || __( '(no title)' ) ),\n\t\t} );\n\t}\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst wordsCounted = page?.content?.rendered\n\t\t? wordCount( page.content.rendered, wordCountType )\n\t\t: 0;\n\tconst readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );\n\n\tif ( wordsCounted && ! page?.isPostsPage ) {\n\t\tdetails.push(\n\t\t\t{\n\t\t\t\tlabel: __( 'Words' ),\n\t\t\t\tvalue: wordsCounted.toLocaleString() || __( 'Unknown' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: __( 'Time to read' ),\n\t\t\t\tvalue:\n\t\t\t\t\treadingTime > 1\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the number of minutes. */\n\t\t\t\t\t\t\t\t__( '%s mins' ),\n\t\t\t\t\t\t\t\treadingTime.toLocaleString()\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( '< 1 min' ),\n\t\t\t}\n\t\t);\n\t}\n\treturn details;\n}\n\nexport default function PageDetails( { id } ) {\n\tconst { record } = useEntityRecord( 'postType', 'page', id );\n\tconst { parentTitle, templateTitle, isPostsPage } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostContext } = unlock( select( editSiteStore ) );\n\t\t\tconst postContext = getEditedPostContext();\n\t\t\tconst templates = select( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\t{ per_page: -1 }\n\t\t\t);\n\t\t\t// Template title.\n\t\t\tconst templateSlug =\n\t\t\t\t// Checks that the post type matches the current theme's post type, otherwise\n\t\t\t\t// the templateSlug returns 'home'.\n\t\t\t\tpostContext?.postType === 'page'\n\t\t\t\t\t? postContext?.templateSlug\n\t\t\t\t\t: null;\n\t\t\tconst _templateTitle =\n\t\t\t\ttemplates && templateSlug\n\t\t\t\t\t? templates.find(\n\t\t\t\t\t\t\t( template ) => template.slug === templateSlug\n\t\t\t\t\t )?.title?.rendered\n\t\t\t\t\t: null;\n\n\t\t\t// Parent page title.\n\t\t\tconst _parentTitle = record?.parent\n\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\trecord.parent,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_fields: [ 'title' ],\n\t\t\t\t\t\t}\n\t\t\t\t )?.title?.rendered\n\t\t\t\t: null;\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\n\t\t\treturn {\n\t\t\t\tparentTitle: _parentTitle,\n\t\t\t\ttemplateTitle: _templateTitle,\n\t\t\t\tisPostsPage: record?.id === siteSettings?.page_for_posts,\n\t\t\t};\n\t\t},\n\t\t[ record?.parent, record?.id ]\n\t);\n\treturn (\n\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\tspacing={ 5 }\n\t\t\ttitle={ __( 'Details' ) }\n\t\t>\n\t\t\t{ getPageDetails( {\n\t\t\t\tparentTitle,\n\t\t\t\ttemplateTitle,\n\t\t\t\tisPostsPage,\n\t\t\t\t...record,\n\t\t\t} ).map( ( { label, value } ) => (\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ value }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t) ) }\n\t\t</SidebarNavigationScreenDetailsPanel>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,sBAAsB,IAAIC,QAAQ,Q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CAAG;IACbP,KAAK,EAAG3D,EAAE,CAAE,SAAU;EAAG,GAEvBqB,cAAc,CAAE;IACjBc,WAAW;IACXF,aAAa;IACbU,WAAW;IACX,GAAGI;EACJ,CAAE,CAAC,CAACoB,GAAG,CAAE,CAAE;IAAE3C,KAAK;IAAEC;EAAM,CAAC,KAC1BC,aAAA,CAACT,sCAAsC;IAACmD,GAAG,EAAG5C;EAAO,GACpDE,aAAA,CAACR,wCAAwC,QACtCM,KACuC,CAAC,EAC3CE,aAAA,CAACP,wCAAwC,QACtCM,KACuC,CACH,CACvC,CACkC,CAAC;AAExC"}
1
+ {"version":3,"names":["__","_x","sprintf","__experimentalTruncate","Truncate","count","wordCount","useSelect","decodeEntities","store","coreStore","useEntityRecord","safeDecodeURIComponent","StatusLabel","unlock","editSiteStore","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","TEMPLATE_POST_TYPE","AVERAGE_READING_RATE","getPageDetails","page","details","label","value","createElement","status","password","date","short","numberOfLines","slug","templateTitle","push","parentTitle","wordCountType","wordsCounted","content","rendered","readingTime","Math","round","isPostsPage","toLocaleString","PageDetails","id","record","select","getEditedPostContext","postContext","templates","getEntityRecords","per_page","templateSlug","postType","_templateTitle","find","template","title","_parentTitle","parent","getEntityRecord","_fields","siteSettings","page_for_posts","spacing","map","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/page-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { __experimentalTruncate as Truncate } from '@wordpress/components';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport StatusLabel from './status-label';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\n// Taken from packages/editor/src/components/time-to-read/index.js.\nconst AVERAGE_READING_RATE = 189;\n\nfunction getPageDetails( page ) {\n\tif ( ! page ) {\n\t\treturn [];\n\t}\n\n\tconst details = [\n\t\t{\n\t\t\tlabel: __( 'Status' ),\n\t\t\tvalue: (\n\t\t\t\t<StatusLabel\n\t\t\t\t\tstatus={ page?.password ? 'protected' : page.status }\n\t\t\t\t\tdate={ page?.date }\n\t\t\t\t\tshort\n\t\t\t\t/>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Slug' ),\n\t\t\tvalue: (\n\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t{ safeDecodeURIComponent( page.slug ) }\n\t\t\t\t</Truncate>\n\t\t\t),\n\t\t},\n\t];\n\n\tif ( page?.templateTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Template' ),\n\t\t\tvalue: decodeEntities( page.templateTitle ),\n\t\t} );\n\t}\n\n\tif ( page?.parentTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Parent' ),\n\t\t\tvalue: decodeEntities( page.parentTitle || __( '(no title)' ) ),\n\t\t} );\n\t}\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst wordsCounted = page?.content?.rendered\n\t\t? wordCount( page.content.rendered, wordCountType )\n\t\t: 0;\n\tconst readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );\n\n\tif ( wordsCounted && ! page?.isPostsPage ) {\n\t\tdetails.push(\n\t\t\t{\n\t\t\t\tlabel: __( 'Words' ),\n\t\t\t\tvalue: wordsCounted.toLocaleString() || __( 'Unknown' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: __( 'Time to read' ),\n\t\t\t\tvalue:\n\t\t\t\t\treadingTime > 1\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the number of minutes. */\n\t\t\t\t\t\t\t\t__( '%s mins' ),\n\t\t\t\t\t\t\t\treadingTime.toLocaleString()\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( '< 1 min' ),\n\t\t\t}\n\t\t);\n\t}\n\treturn details;\n}\n\nexport default function PageDetails( { id } ) {\n\tconst { record } = useEntityRecord( 'postType', 'page', id );\n\tconst { parentTitle, templateTitle, isPostsPage } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostContext } = unlock( select( editSiteStore ) );\n\t\t\tconst postContext = getEditedPostContext();\n\t\t\tconst templates = select( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t{ per_page: -1 }\n\t\t\t);\n\t\t\t// Template title.\n\t\t\tconst templateSlug =\n\t\t\t\t// Checks that the post type matches the current theme's post type, otherwise\n\t\t\t\t// the templateSlug returns 'home'.\n\t\t\t\tpostContext?.postType === 'page'\n\t\t\t\t\t? postContext?.templateSlug\n\t\t\t\t\t: null;\n\t\t\tconst _templateTitle =\n\t\t\t\ttemplates && templateSlug\n\t\t\t\t\t? templates.find(\n\t\t\t\t\t\t\t( template ) => template.slug === templateSlug\n\t\t\t\t\t )?.title?.rendered\n\t\t\t\t\t: null;\n\n\t\t\t// Parent page title.\n\t\t\tconst _parentTitle = record?.parent\n\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\trecord.parent,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_fields: [ 'title' ],\n\t\t\t\t\t\t}\n\t\t\t\t )?.title?.rendered\n\t\t\t\t: null;\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\n\t\t\treturn {\n\t\t\t\tparentTitle: _parentTitle,\n\t\t\t\ttemplateTitle: _templateTitle,\n\t\t\t\tisPostsPage: record?.id === siteSettings?.page_for_posts,\n\t\t\t};\n\t\t},\n\t\t[ record?.parent, record?.id ]\n\t);\n\treturn (\n\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\tspacing={ 5 }\n\t\t\ttitle={ __( 'Details' ) }\n\t\t>\n\t\t\t{ getPageDetails( {\n\t\t\t\tparentTitle,\n\t\t\t\ttemplateTitle,\n\t\t\t\tisPostsPage,\n\t\t\t\t...record,\n\t\t\t} ).map( ( { label, value } ) => (\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ value }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t) ) }\n\t\t</SidebarNavigationScreenDetailsPanel>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,sBAAsB,IAAIC,QAAQ,QAAQ,uBAAuB;AAC1E,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,EAAEC,eAAe,QAAQ,sBAAsB;AAC1E,S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GAAG,CAAE,CAAE;IAAE3C,KAAK;IAAEC;EAAM,CAAC,KAC1BC,aAAA,CAACV,sCAAsC;IAACoD,GAAG,EAAG5C;EAAO,GACpDE,aAAA,CAACT,wCAAwC,QACtCO,KACuC,CAAC,EAC3CE,aAAA,CAACR,wCAAwC,QACtCO,KACuC,CACH,CACvC,CACkC,CAAC;AAExC"}
@@ -20,6 +20,7 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
20
20
  import SidebarButton from '../sidebar-button';
21
21
  import AddNewPageModal from '../add-new-page';
22
22
  import { unlock } from '../../lock-unlock';
23
+ import { TEMPLATE_POST_TYPE } from '../../utils/constants';
23
24
  const {
24
25
  useHistory
25
26
  } = unlock(routerPrivateApis);
@@ -50,7 +51,7 @@ export default function SidebarNavigationScreenPages() {
50
51
  const {
51
52
  records: templates,
52
53
  isResolving: isLoadingTemplates
53
- } = useEntityRecords('postType', 'wp_template', {
54
+ } = useEntityRecords('postType', TEMPLATE_POST_TYPE, {
54
55
  per_page: -1
55
56
  });
56
57
  const dynamicPageTemplates = templates?.filter(({
@@ -109,7 +110,7 @@ export default function SidebarNavigationScreenPages() {
109
110
  }
110
111
  return {
111
112
  icon: itemIcon,
112
- postType: postsPageTemplateId ? 'wp_template' : 'page',
113
+ postType: postsPageTemplateId ? TEMPLATE_POST_TYPE : 'page',
113
114
  postId: postsPageTemplateId || id
114
115
  };
115
116
  };
@@ -125,7 +126,7 @@ export default function SidebarNavigationScreenPages() {
125
126
  onClick: () => setShowAddPage(true)
126
127
  }),
127
128
  content: createElement(Fragment, null, (isLoadingPages || isLoadingTemplates) && createElement(ItemGroup, null, createElement(Item, null, __('Loading pages…'))), !(isLoadingPages || isLoadingTemplates) && createElement(ItemGroup, null, !pagesAndTemplates?.length && createElement(Item, null, __('No page found')), isHomePageBlog && homeTemplate && createElement(PageItem, {
128
- postType: "wp_template",
129
+ postType: TEMPLATE_POST_TYPE,
129
130
  postId: homeTemplate.id,
130
131
  key: homeTemplate.id,
131
132
  icon: home,
@@ -145,7 +146,7 @@ export default function SidebarNavigationScreenPages() {
145
146
  footer: createElement(VStack, {
146
147
  spacing: 0
147
148
  }, dynamicPageTemplates?.map(item => createElement(PageItem, {
148
- postType: "wp_template",
149
+ postType: TEMPLATE_POST_TYPE,
149
150
  postId: item.id,
150
151
  key: item.id,
151
152
  icon: layout,
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalTruncate","Truncate","__experimentalVStack","VStack","useState","__","useEntityRecords","store","coreStore","decodeEntities","privateApis","routerPrivateApis","layout","page","home","verse","plus","useSelect","SidebarNavigationScreen","useLink","SidebarNavigationItem","SidebarButton","AddNewPageModal","unlock","useHistory","PageItem","postType","postId","props","linkInfo","backPath","createElement","SidebarNavigationScreenPages","records","pages","isResolving","isLoadingPages","status","per_page","templates","isLoadingTemplates","dynamicPageTemplates","filter","slug","includes","homeTemplate","find","template","getPostsPageTemplate","pagesAndTemplates","concat","frontPage","postsPage","select","getEntityRecord","siteSettings","page_on_front","page_for_posts","isHomePageBlog","reorderedPages","length","homePageIndex","findIndex","item","id","homePage","splice","postsPageIndex","blogPage","showAddPage","setShowAddPage","history","handleNewPage","type","push","canvas","getPageProps","itemIcon","postsPageTemplateId","icon","Fragment","onSave","onClose","title","description","actions","label","onClick","content","key","withChevron","numberOfLines","rendered","map","footer","spacing","className","href","document","location"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pages/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalTruncate as Truncate,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { layout, page, home, verse, plus } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport SidebarButton from '../sidebar-button';\nimport AddNewPageModal from '../add-new-page';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst PageItem = ( { postType = 'page', postId, ...props } ) => {\n\tconst linkInfo = useLink(\n\t\t{\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t},\n\t\t{\n\t\t\tbackPath: '/page',\n\t\t}\n\t);\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n\nexport default function SidebarNavigationScreenPages() {\n\tconst { records: pages, isResolving: isLoadingPages } = useEntityRecords(\n\t\t'postType',\n\t\t'page',\n\t\t{\n\t\t\tstatus: 'any',\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\tconst { records: templates, isResolving: isLoadingTemplates } =\n\t\tuseEntityRecords( 'postType', 'wp_template', {\n\t\t\tper_page: -1,\n\t\t} );\n\n\tconst dynamicPageTemplates = templates?.filter( ( { slug } ) =>\n\t\t[ '404', 'search' ].includes( slug )\n\t);\n\n\tconst homeTemplate =\n\t\ttemplates?.find( ( template ) => template.slug === 'front-page' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'home' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'index' );\n\n\tconst getPostsPageTemplate = () =>\n\t\ttemplates?.find( ( template ) => template.slug === 'home' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'index' );\n\n\tconst pagesAndTemplates = pages?.concat( dynamicPageTemplates, [\n\t\thomeTemplate,\n\t] );\n\n\tconst { frontPage, postsPage } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\t\treturn {\n\t\t\tfrontPage: siteSettings?.page_on_front,\n\t\t\tpostsPage: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\n\tconst isHomePageBlog = frontPage === postsPage;\n\n\tconst reorderedPages = pages && [ ...pages ];\n\n\tif ( ! isHomePageBlog && reorderedPages?.length ) {\n\t\tconst homePageIndex = reorderedPages.findIndex(\n\t\t\t( item ) => item.id === frontPage\n\t\t);\n\t\tconst homePage = reorderedPages.splice( homePageIndex, 1 );\n\t\treorderedPages?.splice( 0, 0, ...homePage );\n\n\t\tconst postsPageIndex = reorderedPages.findIndex(\n\t\t\t( item ) => item.id === postsPage\n\t\t);\n\n\t\tconst blogPage = reorderedPages.splice( postsPageIndex, 1 );\n\n\t\treorderedPages.splice( 1, 0, ...blogPage );\n\t}\n\n\tconst [ showAddPage, setShowAddPage ] = useState( false );\n\n\tconst history = useHistory();\n\n\tconst handleNewPage = ( { type, id } ) => {\n\t\t// Navigate to the created template editor.\n\t\thistory.push( {\n\t\t\tpostId: id,\n\t\t\tpostType: type,\n\t\t\tcanvas: 'edit',\n\t\t} );\n\t\tsetShowAddPage( false );\n\t};\n\n\tconst getPageProps = ( id ) => {\n\t\tlet itemIcon = page;\n\t\tconst postsPageTemplateId =\n\t\t\tpostsPage && postsPage === id ? getPostsPageTemplate()?.id : null;\n\n\t\tswitch ( id ) {\n\t\t\tcase frontPage:\n\t\t\t\titemIcon = home;\n\t\t\t\tbreak;\n\t\t\tcase postsPage:\n\t\t\t\titemIcon = verse;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn {\n\t\t\ticon: itemIcon,\n\t\t\tpostType: postsPageTemplateId ? 'wp_template' : 'page',\n\t\t\tpostId: postsPageTemplateId || id,\n\t\t};\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{ showAddPage && (\n\t\t\t\t<AddNewPageModal\n\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\tonClose={ () => setShowAddPage( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Pages' ) }\n\t\t\t\tdescription={ __( 'Browse and edit pages on your site.' ) }\n\t\t\t\tactions={\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ __( 'Draft a new page' ) }\n\t\t\t\t\t\tonClick={ () => setShowAddPage( true ) }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ( isLoadingPages || isLoadingTemplates ) && (\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t<Item>{ __( 'Loading pages…' ) }</Item>\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! ( isLoadingPages || isLoadingTemplates ) && (\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t{ ! pagesAndTemplates?.length && (\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No page found' ) }</Item>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isHomePageBlog && homeTemplate && (\n\t\t\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\t\t\tpostType=\"wp_template\"\n\t\t\t\t\t\t\t\t\t\tpostId={ homeTemplate.id }\n\t\t\t\t\t\t\t\t\t\tkey={ homeTemplate.id }\n\t\t\t\t\t\t\t\t\t\ticon={ home }\n\t\t\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\t\thomeTemplate.title?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ reorderedPages?.map( ( { id, title } ) => (\n\t\t\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\t\t\t{ ...getPageProps( id ) }\n\t\t\t\t\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\t\ttitle?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t<VStack spacing={ 0 }>\n\t\t\t\t\t\t{ dynamicPageTemplates?.map( ( item ) => (\n\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\tpostType=\"wp_template\"\n\t\t\t\t\t\t\t\tpostId={ item.id }\n\t\t\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\titem.title?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-pages__see-all\"\n\t\t\t\t\t\t\thref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AAI,CAACC,EAAI;MACfe,IAAI,EAAGnE,MAAQ;MACf8E,WAAW;IAAA,GAEX3D,aAAA,CAAC9B,QAAQ;MAAC0F,aAAa,EAAG;IAAG,GAC1BlF,cAAc,CACfsD,IAAI,CAACoB,KAAK,EAAES,QAAQ,IACnBvF,EAAE,CAAE,YAAa,CACnB,CACS,CACD,CACT,CAAC,EACH0B,aAAA,CAACX,qBAAqB;MACrB4E,SAAS,EAAC,oDAAoD;MAC9DC,IAAI,EAAC,yBAAyB;MAC9BV,OAAO,EAAGA,CAAA,KAAM;QACfW,QAAQ,CAACC,QAAQ,GAAG,yBAAyB;MAC9C;IAAG,GAED9F,EAAE,CAAE,kBAAmB,CACH,CAChB;EACR,CACD,CACA,CAAC;AAEL"}
1
+ {"version":3,"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalTruncate","Truncate","__experimentalVStack","VStack","useState","__","useEntityRecords","store","coreStore","decodeEntities","privateApis","routerPrivateApis","layout","page","home","verse","plus","useSelect","SidebarNavigationScreen","useLink","SidebarNavigationItem","SidebarButton","AddNewPageModal","unlock","TEMPLATE_POST_TYPE","useHistory","PageItem","postType","postId","props","linkInfo","backPath","createElement","SidebarNavigationScreenPages","records","pages","isResolving","isLoadingPages","status","per_page","templates","isLoadingTemplates","dynamicPageTemplates","filter","slug","includes","homeTemplate","find","template","getPostsPageTemplate","pagesAndTemplates","concat","frontPage","postsPage","select","getEntityRecord","siteSettings","page_on_front","page_for_posts","isHomePageBlog","reorderedPages","length","homePageIndex","findIndex","item","id","homePage","splice","postsPageIndex","blogPage","showAddPage","setShowAddPage","history","handleNewPage","type","push","canvas","getPageProps","itemIcon","postsPageTemplateId","icon","Fragment","onSave","onClose","title","description","actions","label","onClick","content","key","withChevron","numberOfLines","rendered","map","footer","spacing","className","href","document","location"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pages/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalTruncate as Truncate,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { layout, page, home, verse, plus } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport SidebarButton from '../sidebar-button';\nimport AddNewPageModal from '../add-new-page';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst PageItem = ( { postType = 'page', postId, ...props } ) => {\n\tconst linkInfo = useLink(\n\t\t{\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t},\n\t\t{\n\t\t\tbackPath: '/page',\n\t\t}\n\t);\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n\nexport default function SidebarNavigationScreenPages() {\n\tconst { records: pages, isResolving: isLoadingPages } = useEntityRecords(\n\t\t'postType',\n\t\t'page',\n\t\t{\n\t\t\tstatus: 'any',\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\tconst { records: templates, isResolving: isLoadingTemplates } =\n\t\tuseEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\n\tconst dynamicPageTemplates = templates?.filter( ( { slug } ) =>\n\t\t[ '404', 'search' ].includes( slug )\n\t);\n\n\tconst homeTemplate =\n\t\ttemplates?.find( ( template ) => template.slug === 'front-page' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'home' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'index' );\n\n\tconst getPostsPageTemplate = () =>\n\t\ttemplates?.find( ( template ) => template.slug === 'home' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'index' );\n\n\tconst pagesAndTemplates = pages?.concat( dynamicPageTemplates, [\n\t\thomeTemplate,\n\t] );\n\n\tconst { frontPage, postsPage } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\t\treturn {\n\t\t\tfrontPage: siteSettings?.page_on_front,\n\t\t\tpostsPage: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\n\tconst isHomePageBlog = frontPage === postsPage;\n\n\tconst reorderedPages = pages && [ ...pages ];\n\n\tif ( ! isHomePageBlog && reorderedPages?.length ) {\n\t\tconst homePageIndex = reorderedPages.findIndex(\n\t\t\t( item ) => item.id === frontPage\n\t\t);\n\t\tconst homePage = reorderedPages.splice( homePageIndex, 1 );\n\t\treorderedPages?.splice( 0, 0, ...homePage );\n\n\t\tconst postsPageIndex = reorderedPages.findIndex(\n\t\t\t( item ) => item.id === postsPage\n\t\t);\n\n\t\tconst blogPage = reorderedPages.splice( postsPageIndex, 1 );\n\n\t\treorderedPages.splice( 1, 0, ...blogPage );\n\t}\n\n\tconst [ showAddPage, setShowAddPage ] = useState( false );\n\n\tconst history = useHistory();\n\n\tconst handleNewPage = ( { type, id } ) => {\n\t\t// Navigate to the created template editor.\n\t\thistory.push( {\n\t\t\tpostId: id,\n\t\t\tpostType: type,\n\t\t\tcanvas: 'edit',\n\t\t} );\n\t\tsetShowAddPage( false );\n\t};\n\n\tconst getPageProps = ( id ) => {\n\t\tlet itemIcon = page;\n\t\tconst postsPageTemplateId =\n\t\t\tpostsPage && postsPage === id ? getPostsPageTemplate()?.id : null;\n\n\t\tswitch ( id ) {\n\t\t\tcase frontPage:\n\t\t\t\titemIcon = home;\n\t\t\t\tbreak;\n\t\t\tcase postsPage:\n\t\t\t\titemIcon = verse;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn {\n\t\t\ticon: itemIcon,\n\t\t\tpostType: postsPageTemplateId ? TEMPLATE_POST_TYPE : 'page',\n\t\t\tpostId: postsPageTemplateId || id,\n\t\t};\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{ showAddPage && (\n\t\t\t\t<AddNewPageModal\n\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\tonClose={ () => setShowAddPage( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Pages' ) }\n\t\t\t\tdescription={ __( 'Browse and edit pages on your site.' ) }\n\t\t\t\tactions={\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ __( 'Draft a new page' ) }\n\t\t\t\t\t\tonClick={ () => setShowAddPage( true ) }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ( isLoadingPages || isLoadingTemplates ) && (\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t<Item>{ __( 'Loading pages…' ) }</Item>\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! ( isLoadingPages || isLoadingTemplates ) && (\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t{ ! pagesAndTemplates?.length && (\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No page found' ) }</Item>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isHomePageBlog && homeTemplate && (\n\t\t\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\t\t\tpostType={ TEMPLATE_POST_TYPE }\n\t\t\t\t\t\t\t\t\t\tpostId={ homeTemplate.id }\n\t\t\t\t\t\t\t\t\t\tkey={ homeTemplate.id }\n\t\t\t\t\t\t\t\t\t\ticon={ home }\n\t\t\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\t\thomeTemplate.title?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ reorderedPages?.map( ( { id, title } ) => (\n\t\t\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\t\t\t{ ...getPageProps( id ) }\n\t\t\t\t\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\t\ttitle?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t<VStack spacing={ 0 }>\n\t\t\t\t\t\t{ dynamicPageTemplates?.map( ( item ) => (\n\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\tpostType={ TEMPLATE_POST_TYPE }\n\t\t\t\t\t\t\t\tpostId={ item.id }\n\t\t\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\titem.title?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-pages__see-all\"\n\t\t\t\t\t\t\thref=\"edit.php?post_type=page\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tdocument.location = 'edit.php?post_type=page';\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Manage all pages' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t</VStack>\n\t\t\t\t}\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAAS,EACpCC,kBAAkB,IAAIC,IAAI,EAC1BC,sBAAsB,IAAIC,QAAQ,EAClCC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC3E,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,IAAI,QAAQ,kBAAkB;AAClE,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,qBAAqB,MAAM,4BAA4B;AAC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,GAEX3D,aAAA,CAAC/B,QAAQ;MAAC2F,aAAa,EAAG;IAAG,GAC1BnF,cAAc,CACf2E,KAAK,EAAES,QAAQ,IACdxF,EAAE,CAAE,YAAa,CACnB,CACS,CACD,CACT,CACQ,CAEX,CACF;IACD0F,MAAM,EACL/D,aAAA,CAAC7B,MAAM;MAAC6F,OAAO,EAAG;IAAG,GAClBtD,oBAAoB,EAAEoD,GAAG,CAAI9B,IAAI,IAClChC,aAAA,CAACN,QAAQ;MACRC,QAAQ,EAAGH,kBAAoB;MAC/BI,MAAM,EAAGoC,IAAI,CAACC,EAAI;MAClByB,GAAG,EAAG1B,IAAI,CAACC,EAAI;MACfe,IAAI,EAAGpE,MAAQ;MACf+E,WAAW;IAAA,GAEX3D,aAAA,CAAC/B,QAAQ;MAAC2F,aAAa,EAAG;IAAG,GAC1BnF,cAAc,CACfuD,IAAI,CAACoB,KAAK,EAAES,QAAQ,IACnBxF,EAAE,CAAE,YAAa,CACnB,CACS,CACD,CACT,CAAC,EACH2B,aAAA,CAACZ,qBAAqB;MACrB6E,SAAS,EAAC,oDAAoD;MAC9DC,IAAI,EAAC,yBAAyB;MAC9BV,OAAO,EAAGA,CAAA,KAAM;QACfW,QAAQ,CAACC,QAAQ,GAAG,yBAAyB;MAC9C;IAAG,GAED/F,EAAE,CAAE,kBAAmB,CACH,CAChB;EACR,CACD,CACA,CAAC;AAEL"}
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement, Fragment } from "@wordpress/element";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -17,17 +17,19 @@ import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-e
17
17
  import usePatternDetails from './use-pattern-details';
18
18
  import { store as editSiteStore } from '../../store';
19
19
  import { unlock } from '../../lock-unlock';
20
+ import TemplateActions from '../template-actions';
21
+ import { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';
20
22
  export default function SidebarNavigationScreenPattern() {
23
+ const navigator = useNavigator();
21
24
  const {
22
- params
23
- } = useNavigator();
25
+ params: {
26
+ postType,
27
+ postId
28
+ }
29
+ } = navigator;
24
30
  const {
25
31
  categoryType
26
32
  } = getQueryArgs(window.location.href);
27
- const {
28
- postType,
29
- postId
30
- } = params;
31
33
  const {
32
34
  setCanvasMode
33
35
  } = unlock(useDispatch(editSiteStore));
@@ -37,13 +39,22 @@ export default function SidebarNavigationScreenPattern() {
37
39
  // The absence of a category type in the query params for template parts
38
40
  // indicates the user has arrived at the template part via the "manage all"
39
41
  // page and the back button should return them to that list page.
40
- const backPath = !categoryType && postType === 'wp_template_part' ? '/wp_template_part/all' : '/patterns';
42
+ const backPath = !categoryType && postType === TEMPLATE_PART_POST_TYPE ? '/wp_template_part/all' : '/patterns';
41
43
  return createElement(SidebarNavigationScreen, {
42
- actions: createElement(SidebarButton, {
44
+ actions: createElement(Fragment, null, createElement(TemplateActions, {
45
+ postType: postType,
46
+ postId: postId,
47
+ toggleProps: {
48
+ as: SidebarButton
49
+ },
50
+ onRemove: () => {
51
+ navigator.goTo(backPath);
52
+ }
53
+ }), createElement(SidebarButton, {
43
54
  onClick: () => setCanvasMode('edit'),
44
55
  label: __('Edit'),
45
56
  icon: pencil
46
- }),
57
+ })),
47
58
  backPath: backPath,
48
59
  ...patternDetails
49
60
  });
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalUseNavigator","useNavigator","useDispatch","__","pencil","getQueryArgs","SidebarButton","SidebarNavigationScreen","useInitEditedEntityFromURL","usePatternDetails","store","editSiteStore","unlock","SidebarNavigationScreenPattern","params","categoryType","window","location","href","postType","postId","setCanvasMode","patternDetails","backPath","createElement","actions","onClick","label","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\nimport { getQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport usePatternDetails from './use-pattern-details';\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function SidebarNavigationScreenPattern() {\n\tconst { params } = useNavigator();\n\tconst { categoryType } = getQueryArgs( window.location.href );\n\tconst { postType, postId } = params;\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tuseInitEditedEntityFromURL();\n\n\tconst patternDetails = usePatternDetails( postType, postId );\n\n\t// The absence of a category type in the query params for template parts\n\t// indicates the user has arrived at the template part via the \"manage all\"\n\t// page and the back button should return them to that list page.\n\tconst backPath =\n\t\t! categoryType && postType === 'wp_template_part'\n\t\t\t? '/wp_template_part/all'\n\t\t\t: '/patterns';\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tactions={\n\t\t\t\t<SidebarButton\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\ticon={ pencil }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tbackPath={ backPath }\n\t\t\t{ ...patternDetails }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,0BAA0B,IAAIC,YAAY,QAAQ,uBAAuB;AAClF,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,0BAA0B,MAAM,wDAAwD;AAC/F,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,eAAe,SAASC,8BAA8BA,CAAA,EAAG;EACxD,MAAM;IAAEC;EAAO,CAAC,GAAGb,YAAY,CAAC,CAAC;EACjC,MAAM;IAAEc;EAAa,CAAC,GAAGV,YAAY,CAAEW,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAC;EAC7D,MAAM;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGN,MAAM;EACnC,MAAM;IAAEO;EAAc,CAAC,GAAGT,MAAM,CAAEV,WAAW,CAAES,aAAc,CAAE,CAAC;EAEhEH,0BAA0B,CAAC,CAAC;EAE5B,MAAMc,cAAc,GAAGb,iBAAiB,CAAEU,QAAQ,EAAEC,MAAO,CAAC;;EAE5D;EACA;EACA;EACA,MAAMG,QAAQ,GACb,CAAER,YAAY,IAAII,QAAQ,KAAK,kBAAkB,GAC9C,uBAAuB,GACvB,WAAW;EAEf,OACCK,aAAA,CAACjB,uBAAuB;IACvBkB,OAAO,EACND,aAAA,CAAClB,aAAa;MACboB,OAAO,EAAGA,CAAA,KAAML,aAAa,CAAE,MAAO,CAAG;MACzCM,KAAK,EAAGxB,EAAE,CAAE,MAAO,CAAG;MACtByB,IAAI,EAAGxB;IAAQ,CACf,CACD;IACDmB,QAAQ,EAAGA,QAAU;IAAA,GAChBD;EAAc,CACnB,CAAC;AAEJ"}
1
+ {"version":3,"names":["__experimentalUseNavigator","useNavigator","useDispatch","__","pencil","getQueryArgs","SidebarButton","SidebarNavigationScreen","useInitEditedEntityFromURL","usePatternDetails","store","editSiteStore","unlock","TemplateActions","TEMPLATE_PART_POST_TYPE","SidebarNavigationScreenPattern","navigator","params","postType","postId","categoryType","window","location","href","setCanvasMode","patternDetails","backPath","createElement","actions","Fragment","toggleProps","as","onRemove","goTo","onClick","label","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\nimport { getQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport usePatternDetails from './use-pattern-details';\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport TemplateActions from '../template-actions';\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\n\nexport default function SidebarNavigationScreenPattern() {\n\tconst navigator = useNavigator();\n\tconst {\n\t\tparams: { postType, postId },\n\t} = navigator;\n\tconst { categoryType } = getQueryArgs( window.location.href );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tuseInitEditedEntityFromURL();\n\n\tconst patternDetails = usePatternDetails( postType, postId );\n\n\t// The absence of a category type in the query params for template parts\n\t// indicates the user has arrived at the template part via the \"manage all\"\n\t// page and the back button should return them to that list page.\n\tconst backPath =\n\t\t! categoryType && postType === TEMPLATE_PART_POST_TYPE\n\t\t\t? '/wp_template_part/all'\n\t\t\t: '/patterns';\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<TemplateActions\n\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\ttoggleProps={ { as: SidebarButton } }\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\tnavigator.goTo( backPath );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\t\ticon={ pencil }\n\t\t\t\t\t/>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,QAAA,QACCF,aAAA,CAACd,eAAe;MACfK,QAAQ,EAAGA,QAAU;MACrBC,MAAM,EAAGA,MAAQ;MACjBW,WAAW,EAAG;QAAEC,EAAE,EAAEzB;MAAc,CAAG;MACrC0B,QAAQ,EAAGA,CAAA,KAAM;QAChBhB,SAAS,CAACiB,IAAI,CAAEP,QAAS,CAAC;MAC3B;IAAG,CACH,CAAC,EACFC,aAAA,CAACrB,aAAa;MACb4B,OAAO,EAAGA,CAAA,KAAMV,aAAa,CAAE,MAAO,CAAG;MACzCW,KAAK,EAAGhC,EAAE,CAAE,MAAO,CAAG;MACtBiC,IAAI,EAAGhC;IAAQ,CACf,CACA,CACF;IACDsB,QAAQ,EAAGA,QAAU;IAAA,GAChBD;EAAc,CACnB,CAAC;AAEJ"}
@@ -10,13 +10,14 @@ import { __ } from '@wordpress/i18n';
10
10
  */
11
11
  import SidebarNavigationItem from '../sidebar-navigation-item';
12
12
  import { useLink } from '../routes/link';
13
+ import { NAVIGATION_POST_TYPE } from '../../utils/constants';
13
14
  export default function TemplatePartNavigationMenuListItem({
14
15
  id
15
16
  }) {
16
- const [title] = useEntityProp('postType', 'wp_navigation', 'title', id);
17
+ const [title] = useEntityProp('postType', NAVIGATION_POST_TYPE, 'title', id);
17
18
  const linkInfo = useLink({
18
19
  postId: id,
19
- postType: 'wp_navigation'
20
+ postType: NAVIGATION_POST_TYPE
20
21
  });
21
22
  if (!id) return null;
22
23
  return createElement(SidebarNavigationItem, {
@@ -1 +1 @@
1
- {"version":3,"names":["useEntityProp","__","SidebarNavigationItem","useLink","TemplatePartNavigationMenuListItem","id","title","linkInfo","postId","postType","createElement","withChevron"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useLink } from '../routes/link';\n\nexport default function TemplatePartNavigationMenuListItem( { id } ) {\n\tconst [ title ] = useEntityProp( 'postType', 'wp_navigation', 'title', id );\n\n\tconst linkInfo = useLink( {\n\t\tpostId: id,\n\t\tpostType: 'wp_navigation',\n\t} );\n\n\tif ( ! id ) return null;\n\n\treturn (\n\t\t<SidebarNavigationItem withChevron { ...linkInfo }>\n\t\t\t{ title || __( '(no title)' ) }\n\t\t</SidebarNavigationItem>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,sBAAsB;AACpD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,OAAO,QAAQ,gBAAgB;AAExC,eAAe,SAASC,kCAAkCA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACpE,MAAM,CAAEC,KAAK,CAAE,GAAGN,aAAa,CAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAEK,EAAG,CAAC;EAE3E,MAAME,QAAQ,GAAGJ,OAAO,CAAE;IACzBK,MAAM,EAAEH,EAAE;IACVI,QAAQ,EAAE;EACX,CAAE,CAAC;EAEH,IAAK,CAAEJ,EAAE,EAAG,OAAO,IAAI;EAEvB,OACCK,aAAA,CAACR,qBAAqB;IAACS,WAAW;IAAA,GAAMJ;EAAQ,GAC7CD,KAAK,IAAIL,EAAE,CAAE,YAAa,CACN,CAAC;AAE1B"}
1
+ {"version":3,"names":["useEntityProp","__","SidebarNavigationItem","useLink","NAVIGATION_POST_TYPE","TemplatePartNavigationMenuListItem","id","title","linkInfo","postId","postType","createElement","withChevron"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useLink } from '../routes/link';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function TemplatePartNavigationMenuListItem( { id } ) {\n\tconst [ title ] = useEntityProp(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\t'title',\n\t\tid\n\t);\n\n\tconst linkInfo = useLink( {\n\t\tpostId: id,\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t} );\n\n\tif ( ! id ) return null;\n\n\treturn (\n\t\t<SidebarNavigationItem withChevron { ...linkInfo }>\n\t\t\t{ title || __( '(no title)' ) }\n\t\t</SidebarNavigationItem>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,sBAAsB;AACpD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,eAAe,SAASC,kCAAkCA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACpE,MAAM,CAAEC,KAAK,CAAE,GAAGP,aAAa,CAC9B,UAAU,EACVI,oBAAoB,EACpB,OAAO,EACPE,EACD,CAAC;EAED,MAAME,QAAQ,GAAGL,OAAO,CAAE;IACzBM,MAAM,EAAEH,EAAE;IACVI,QAAQ,EAAEN;EACX,CAAE,CAAC;EAEH,IAAK,CAAEE,EAAE,EAAG,OAAO,IAAI;EAEvB,OACCK,aAAA,CAACT,qBAAqB;IAACU,WAAW;IAAA,GAAMJ;EAAQ,GAC7CD,KAAK,IAAIN,EAAE,CAAE,YAAa,CACN,CAAC;AAE1B"}
@@ -10,10 +10,11 @@ import { useEntityProp } from '@wordpress/core-data';
10
10
  * Internal dependencies
11
11
  */
12
12
  import NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';
13
+ import { NAVIGATION_POST_TYPE } from '../../utils/constants';
13
14
  export default function TemplatePartNavigationMenu({
14
15
  id
15
16
  }) {
16
- const [title] = useEntityProp('postType', 'wp_navigation', 'title', id);
17
+ const [title] = useEntityProp('postType', NAVIGATION_POST_TYPE, 'title', id);
17
18
  if (!id) return null;
18
19
  return createElement(Fragment, null, createElement(Heading, {
19
20
  className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title",
@@ -1 +1 @@
1
- {"version":3,"names":["__","__experimentalHeading","Heading","useEntityProp","NavigationMenuEditor","TemplatePartNavigationMenu","id","title","createElement","Fragment","className","size","upperCase","weight","navigationMenuId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\nimport { useEntityProp } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';\n\nexport default function TemplatePartNavigationMenu( { id } ) {\n\tconst [ title ] = useEntityProp( 'postType', 'wp_navigation', 'title', id );\n\n\tif ( ! id ) return null;\n\n\treturn (\n\t\t<>\n\t\t\t<Heading\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu__title\"\n\t\t\t\tsize=\"11\"\n\t\t\t\tupperCase={ true }\n\t\t\t\tweight={ 500 }\n\t\t\t>\n\t\t\t\t{ title || __( 'Navigation' ) }\n\t\t\t</Heading>\n\t\t\t<NavigationMenuEditor navigationMenuId={ id } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,uBAAuB;AACxE,SAASC,aAAa,QAAQ,sBAAsB;;AAEpD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,qEAAqE;AAEtG,eAAe,SAASC,0BAA0BA,CAAE;EAAEC;AAAG,CAAC,EAAG;EAC5D,MAAM,CAAEC,KAAK,CAAE,GAAGJ,aAAa,CAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAEG,EAAG,CAAC;EAE3E,IAAK,CAAEA,EAAE,EAAG,OAAO,IAAI;EAEvB,OACCE,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACN,OAAO;IACPQ,SAAS,EAAC,0EAA0E;IACpFC,IAAI,EAAC,IAAI;IACTC,SAAS,EAAG,IAAM;IAClBC,MAAM,EAAG;EAAK,GAEZN,KAAK,IAAIP,EAAE,CAAE,YAAa,CACpB,CAAC,EACVQ,aAAA,CAACJ,oBAAoB;IAACU,gBAAgB,EAAGR;EAAI,CAAE,CAC9C,CAAC;AAEL"}
1
+ {"version":3,"names":["__","__experimentalHeading","Heading","useEntityProp","NavigationMenuEditor","NAVIGATION_POST_TYPE","TemplatePartNavigationMenu","id","title","createElement","Fragment","className","size","upperCase","weight","navigationMenuId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\nimport { useEntityProp } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function TemplatePartNavigationMenu( { id } ) {\n\tconst [ title ] = useEntityProp(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\t'title',\n\t\tid\n\t);\n\n\tif ( ! id ) return null;\n\n\treturn (\n\t\t<>\n\t\t\t<Heading\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu__title\"\n\t\t\t\tsize=\"11\"\n\t\t\t\tupperCase={ true }\n\t\t\t\tweight={ 500 }\n\t\t\t>\n\t\t\t\t{ title || __( 'Navigation' ) }\n\t\t\t</Heading>\n\t\t\t<NavigationMenuEditor navigationMenuId={ id } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,uBAAuB;AACxE,SAASC,aAAa,QAAQ,sBAAsB;;AAEpD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,qEAAqE;AACtG,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,eAAe,SAASC,0BAA0BA,CAAE;EAAEC;AAAG,CAAC,EAAG;EAC5D,MAAM,CAAEC,KAAK,CAAE,GAAGL,aAAa,CAC9B,UAAU,EACVE,oBAAoB,EACpB,OAAO,EACPE,EACD,CAAC;EAED,IAAK,CAAEA,EAAE,EAAG,OAAO,IAAI;EAEvB,OACCE,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACP,OAAO;IACPS,SAAS,EAAC,0EAA0E;IACpFC,IAAI,EAAC,IAAI;IACTC,SAAS,EAAG,IAAM;IAClBC,MAAM,EAAG;EAAK,GAEZN,KAAK,IAAIR,EAAE,CAAE,YAAa,CACpB,CAAC,EACVS,aAAA,CAACL,oBAAoB;IAACW,gBAAgB,EAAGR;EAAI,CAAE,CAC9C,CAAC;AAEL"}
@@ -9,6 +9,7 @@ import { parse } from '@wordpress/blocks';
9
9
  */
10
10
  import TemplatePartNavigationMenus from './template-part-navigation-menus';
11
11
  import useEditedEntityRecord from '../use-edited-entity-record';
12
+ import { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';
12
13
 
13
14
  /**
14
15
  * Retrieves a list of specific blocks from a given tree of blocks.
@@ -50,7 +51,7 @@ export default function useNavigationMenuContent(postType, postId) {
50
51
  // Only managing navigation menus in template parts is supported
51
52
  // to match previous behaviour. This could potentially be expanded
52
53
  // to patterns as well.
53
- if (postType !== 'wp_template_part') {
54
+ if (postType !== TEMPLATE_PART_POST_TYPE) {
54
55
  return;
55
56
  }
56
57
  const blocks = record?.content && typeof record.content !== 'function' ? parse(record.content) : [];
@@ -1 +1 @@
1
- {"version":3,"names":["parse","TemplatePartNavigationMenus","useEditedEntityRecord","getBlocksOfTypeFromBlocks","targetBlockType","blocks","length","findInBlocks","_blocks","navigationBlocks","block","name","push","innerBlocks","innerNavigationBlocks","useNavigationMenuContent","postType","postId","record","content","navigationMenuIds","map","attributes","ref","uniqueNavigationMenuIds","Set","filter","menuId","createElement","menus"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenus from './template-part-navigation-menus';\nimport useEditedEntityRecord from '../use-edited-entity-record';\n\n/**\n * Retrieves a list of specific blocks from a given tree of blocks.\n *\n * @param {string} targetBlockType The name of the block type to find.\n * @param {Array} blocks A list of blocks from a template part entity.\n *\n * @return {Array} A list of any navigation blocks found in the blocks.\n */\nfunction getBlocksOfTypeFromBlocks( targetBlockType, blocks ) {\n\tif ( ! targetBlockType || ! blocks?.length ) {\n\t\treturn [];\n\t}\n\n\tconst findInBlocks = ( _blocks ) => {\n\t\tif ( ! _blocks ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst navigationBlocks = [];\n\n\t\tfor ( const block of _blocks ) {\n\t\t\tif ( block.name === targetBlockType ) {\n\t\t\t\tnavigationBlocks.push( block );\n\t\t\t}\n\n\t\t\tif ( block?.innerBlocks ) {\n\t\t\t\tconst innerNavigationBlocks = findInBlocks( block.innerBlocks );\n\n\t\t\t\tif ( innerNavigationBlocks.length ) {\n\t\t\t\t\tnavigationBlocks.push( ...innerNavigationBlocks );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn navigationBlocks;\n\t};\n\n\treturn findInBlocks( blocks );\n}\n\nexport default function useNavigationMenuContent( postType, postId ) {\n\tconst { record } = useEditedEntityRecord( postType, postId );\n\n\t// Only managing navigation menus in template parts is supported\n\t// to match previous behaviour. This could potentially be expanded\n\t// to patterns as well.\n\tif ( postType !== 'wp_template_part' ) {\n\t\treturn;\n\t}\n\n\tconst blocks =\n\t\trecord?.content && typeof record.content !== 'function'\n\t\t\t? parse( record.content )\n\t\t\t: [];\n\n\tconst navigationBlocks = getBlocksOfTypeFromBlocks(\n\t\t'core/navigation',\n\t\tblocks\n\t);\n\n\tif ( ! navigationBlocks.length ) {\n\t\treturn;\n\t}\n\n\tconst navigationMenuIds = navigationBlocks?.map(\n\t\t( block ) => block.attributes.ref\n\t);\n\n\t// Dedupe the Navigation blocks, as you can have multiple navigation blocks in the template.\n\t// Also, filter out undefined values, as blocks don't have an id when initially added.\n\tconst uniqueNavigationMenuIds = [ ...new Set( navigationMenuIds ) ].filter(\n\t\t( menuId ) => menuId\n\t);\n\n\tif ( ! uniqueNavigationMenuIds?.length ) {\n\t\treturn;\n\t}\n\n\treturn <TemplatePartNavigationMenus menus={ uniqueNavigationMenuIds } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,mBAAmB;;AAEzC;AACA;AACA;AACA,OAAOC,2BAA2B,MAAM,kCAAkC;AAC1E,OAAOC,qBAAqB,MAAM,6BAA6B;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,yBAAyBA,CAAEC,eAAe,EAAEC,MAAM,EAAG;EAC7D,IAAK,CAAED,eAAe,IAAI,CAAEC,MAAM,EAAEC,MAAM,EAAG;IAC5C,OAAO,EAAE;EACV;EAEA,MAAMC,YAAY,GAAKC,OAAO,IAAM;IACnC,IAAK,CAAEA,OAAO,EAAG;MAChB,OAAO,EAAE;IACV;IAEA,MAAMC,gBAAgB,GAAG,EAAE;IAE3B,KAAM,MAAMC,KAAK,IAAIF,OAAO,EAAG;MAC9B,IAAKE,KAAK,CAACC,IAAI,KAAKP,eAAe,EAAG;QACrCK,gBAAgB,CAACG,IAAI,CAAEF,KAAM,CAAC;MAC/B;MAEA,IAAKA,KAAK,EAAEG,WAAW,EAAG;QACzB,MAAMC,qBAAqB,GAAGP,YAAY,CAAEG,KAAK,CAACG,WAAY,CAAC;QAE/D,IAAKC,qBAAqB,CAACR,MAAM,EAAG;UACnCG,gBAAgB,CAACG,IAAI,CAAE,GAAGE,qBAAsB,CAAC;QAClD;MACD;IACD;IAEA,OAAOL,gBAAgB;EACxB,CAAC;EAED,OAAOF,YAAY,CAAEF,MAAO,CAAC;AAC9B;AAEA,eAAe,SAASU,wBAAwBA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EACpE,MAAM;IAAEC;EAAO,CAAC,GAAGhB,qBAAqB,CAAEc,QAAQ,EAAEC,MAAO,CAAC;;EAE5D;EACA;EACA;EACA,IAAKD,QAAQ,KAAK,kBAAkB,EAAG;IACtC;EACD;EAEA,MAAMX,MAAM,GACXa,MAAM,EAAEC,OAAO,IAAI,OAAOD,MAAM,CAACC,OAAO,KAAK,UAAU,GACpDnB,KAAK,CAAEkB,MAAM,CAACC,OAAQ,CAAC,GACvB,EAAE;EAEN,MAAMV,gBAAgB,GAAGN,yBAAyB,CACjD,iBAAiB,EACjBE,MACD,CAAC;EAED,IAAK,CAAEI,gBAAgB,CAACH,MAAM,EAAG;IAChC;EACD;EAEA,MAAMc,iBAAiB,GAAGX,gBAAgB,EAAEY,GAAG,CAC5CX,KAAK,IAAMA,KAAK,CAACY,UAAU,CAACC,GAC/B,CAAC;;EAED;EACA;EACA,MAAMC,uBAAuB,GAAG,CAAE,GAAG,IAAIC,GAAG,CAAEL,iBAAkB,CAAC,CAAE,CAACM,MAAM,CACvEC,MAAM,IAAMA,MACf,CAAC;EAED,IAAK,CAAEH,uBAAuB,EAAElB,MAAM,EAAG;IACxC;EACD;EAEA,OAAOsB,aAAA,CAAC3B,2BAA2B;IAAC4B,KAAK,EAAGL;EAAyB,CAAE,CAAC;AACzE"}
1
+ {"version":3,"names":["parse","TemplatePartNavigationMenus","useEditedEntityRecord","TEMPLATE_PART_POST_TYPE","getBlocksOfTypeFromBlocks","targetBlockType","blocks","length","findInBlocks","_blocks","navigationBlocks","block","name","push","innerBlocks","innerNavigationBlocks","useNavigationMenuContent","postType","postId","record","content","navigationMenuIds","map","attributes","ref","uniqueNavigationMenuIds","Set","filter","menuId","createElement","menus"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenus from './template-part-navigation-menus';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\n\n/**\n * Retrieves a list of specific blocks from a given tree of blocks.\n *\n * @param {string} targetBlockType The name of the block type to find.\n * @param {Array} blocks A list of blocks from a template part entity.\n *\n * @return {Array} A list of any navigation blocks found in the blocks.\n */\nfunction getBlocksOfTypeFromBlocks( targetBlockType, blocks ) {\n\tif ( ! targetBlockType || ! blocks?.length ) {\n\t\treturn [];\n\t}\n\n\tconst findInBlocks = ( _blocks ) => {\n\t\tif ( ! _blocks ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst navigationBlocks = [];\n\n\t\tfor ( const block of _blocks ) {\n\t\t\tif ( block.name === targetBlockType ) {\n\t\t\t\tnavigationBlocks.push( block );\n\t\t\t}\n\n\t\t\tif ( block?.innerBlocks ) {\n\t\t\t\tconst innerNavigationBlocks = findInBlocks( block.innerBlocks );\n\n\t\t\t\tif ( innerNavigationBlocks.length ) {\n\t\t\t\t\tnavigationBlocks.push( ...innerNavigationBlocks );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn navigationBlocks;\n\t};\n\n\treturn findInBlocks( blocks );\n}\n\nexport default function useNavigationMenuContent( postType, postId ) {\n\tconst { record } = useEditedEntityRecord( postType, postId );\n\n\t// Only managing navigation menus in template parts is supported\n\t// to match previous behaviour. This could potentially be expanded\n\t// to patterns as well.\n\tif ( postType !== TEMPLATE_PART_POST_TYPE ) {\n\t\treturn;\n\t}\n\n\tconst blocks =\n\t\trecord?.content && typeof record.content !== 'function'\n\t\t\t? parse( record.content )\n\t\t\t: [];\n\n\tconst navigationBlocks = getBlocksOfTypeFromBlocks(\n\t\t'core/navigation',\n\t\tblocks\n\t);\n\n\tif ( ! navigationBlocks.length ) {\n\t\treturn;\n\t}\n\n\tconst navigationMenuIds = navigationBlocks?.map(\n\t\t( block ) => block.attributes.ref\n\t);\n\n\t// Dedupe the Navigation blocks, as you can have multiple navigation blocks in the template.\n\t// Also, filter out undefined values, as blocks don't have an id when initially added.\n\tconst uniqueNavigationMenuIds = [ ...new Set( navigationMenuIds ) ].filter(\n\t\t( menuId ) => menuId\n\t);\n\n\tif ( ! uniqueNavigationMenuIds?.length ) {\n\t\treturn;\n\t}\n\n\treturn <TemplatePartNavigationMenus menus={ uniqueNavigationMenuIds } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,mBAAmB;;AAEzC;AACA;AACA;AACA,OAAOC,2BAA2B,MAAM,kCAAkC;AAC1E,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,SAASC,uBAAuB,QAAQ,uBAAuB;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,yBAAyBA,CAAEC,eAAe,EAAEC,MAAM,EAAG;EAC7D,IAAK,CAAED,eAAe,IAAI,CAAEC,MAAM,EAAEC,MAAM,EAAG;IAC5C,OAAO,EAAE;EACV;EAEA,MAAMC,YAAY,GAAKC,OAAO,IAAM;IACnC,IAAK,CAAEA,OAAO,EAAG;MAChB,OAAO,EAAE;IACV;IAEA,MAAMC,gBAAgB,GAAG,EAAE;IAE3B,KAAM,MAAMC,KAAK,IAAIF,OAAO,EAAG;MAC9B,IAAKE,KAAK,CAACC,IAAI,KAAKP,eAAe,EAAG;QACrCK,gBAAgB,CAACG,IAAI,CAAEF,KAAM,CAAC;MAC/B;MAEA,IAAKA,KAAK,EAAEG,WAAW,EAAG;QACzB,MAAMC,qBAAqB,GAAGP,YAAY,CAAEG,KAAK,CAACG,WAAY,CAAC;QAE/D,IAAKC,qBAAqB,CAACR,MAAM,EAAG;UACnCG,gBAAgB,CAACG,IAAI,CAAE,GAAGE,qBAAsB,CAAC;QAClD;MACD;IACD;IAEA,OAAOL,gBAAgB;EACxB,CAAC;EAED,OAAOF,YAAY,CAAEF,MAAO,CAAC;AAC9B;AAEA,eAAe,SAASU,wBAAwBA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EACpE,MAAM;IAAEC;EAAO,CAAC,GAAGjB,qBAAqB,CAAEe,QAAQ,EAAEC,MAAO,CAAC;;EAE5D;EACA;EACA;EACA,IAAKD,QAAQ,KAAKd,uBAAuB,EAAG;IAC3C;EACD;EAEA,MAAMG,MAAM,GACXa,MAAM,EAAEC,OAAO,IAAI,OAAOD,MAAM,CAACC,OAAO,KAAK,UAAU,GACpDpB,KAAK,CAAEmB,MAAM,CAACC,OAAQ,CAAC,GACvB,EAAE;EAEN,MAAMV,gBAAgB,GAAGN,yBAAyB,CACjD,iBAAiB,EACjBE,MACD,CAAC;EAED,IAAK,CAAEI,gBAAgB,CAACH,MAAM,EAAG;IAChC;EACD;EAEA,MAAMc,iBAAiB,GAAGX,gBAAgB,EAAEY,GAAG,CAC5CX,KAAK,IAAMA,KAAK,CAACY,UAAU,CAACC,GAC/B,CAAC;;EAED;EACA;EACA,MAAMC,uBAAuB,GAAG,CAAE,GAAG,IAAIC,GAAG,CAAEL,iBAAkB,CAAC,CAAE,CAACM,MAAM,CACvEC,MAAM,IAAMA,MACf,CAAC;EAED,IAAK,CAAEH,uBAAuB,EAAElB,MAAM,EAAG;IACxC;EACD;EAEA,OAAOsB,aAAA,CAAC5B,2BAA2B;IAAC6B,KAAK,EAAGL;EAAyB,CAAE,CAAC;AACzE"}
@@ -20,6 +20,7 @@ import useEditedEntityRecord from '../use-edited-entity-record';
20
20
  import useNavigationMenuContent from './use-navigation-menu-content';
21
21
  import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
22
22
  import { SidebarNavigationScreenDetailsPanel, SidebarNavigationScreenDetailsPanelRow, SidebarNavigationScreenDetailsPanelLabel, SidebarNavigationScreenDetailsPanelValue } from '../sidebar-navigation-screen-details-panel';
23
+ import { PATTERN_TYPES, TEMPLATE_PART_POST_TYPE, PATTERN_SYNC_TYPES, TEMPLATE_ORIGINS } from '../../utils/constants';
23
24
  export default function usePatternDetails(postType, postId) {
24
25
  const {
25
26
  getDescription,
@@ -27,32 +28,61 @@ export default function usePatternDetails(postType, postId) {
27
28
  record
28
29
  } = useEditedEntityRecord(postType, postId);
29
30
  const templatePartAreas = useSelect(select => select(editorStore).__experimentalGetDefaultTemplatePartAreas(), []);
30
- const currentTheme = useSelect(select => select(coreStore).getCurrentTheme(), []);
31
+ const {
32
+ currentTheme,
33
+ userPatternCategories
34
+ } = useSelect(select => {
35
+ const {
36
+ getCurrentTheme,
37
+ getUserPatternCategories
38
+ } = select(coreStore);
39
+ return {
40
+ currentTheme: getCurrentTheme(),
41
+ userPatternCategories: getUserPatternCategories()
42
+ };
43
+ }, []);
31
44
  const addedBy = useAddedBy(postType, postId);
32
45
  const isAddedByActiveTheme = addedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;
33
46
  const title = getTitle();
34
47
  let description = getDescription();
35
48
  if (!description && addedBy.text) {
36
- description = sprintf(
49
+ description = postType === PATTERN_TYPES.user ? sprintf(
37
50
  // translators: %s: pattern title e.g: "Header".
38
- __('This is the %s pattern.'), getTitle());
51
+ __('This is the %s pattern.'), getTitle()) : sprintf(
52
+ // translators: %s: template part title e.g: "Header".
53
+ __('This is the %s template part.'), getTitle());
39
54
  }
40
- if (!description && postType === 'wp_block' && record?.title) {
55
+ if (!description && postType === PATTERN_TYPES.user && record?.title) {
41
56
  description = sprintf(
42
57
  // translators: %s: user created pattern title e.g. "Footer".
43
58
  __('This is the %s pattern.'), record.title);
44
59
  }
45
- const footer = !!record?.modified ? createElement(SidebarNavigationScreenDetailsFooter, {
46
- lastModifiedDateTime: record.modified
60
+ const footer = record?.modified ? createElement(SidebarNavigationScreenDetailsFooter, {
61
+ record: record
47
62
  }) : null;
48
63
  const details = [];
49
- if (postType === 'wp_block' || 'wp_template_part') {
64
+ if (postType === PATTERN_TYPES.user || postType === TEMPLATE_PART_POST_TYPE) {
50
65
  details.push({
51
66
  label: __('Syncing'),
52
- value: record.wp_pattern_sync_status === 'unsynced' ? __('Not synced') : __('Fully synced')
67
+ value: record.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced ? __('Not synced') : __('Fully synced')
53
68
  });
69
+ if (record.wp_pattern_category?.length === 0) {
70
+ details.push({
71
+ label: __('Categories'),
72
+ value: __('Uncategorized')
73
+ });
74
+ }
75
+ if (record.wp_pattern_category?.length > 0) {
76
+ const patternCategories = new Map();
77
+ userPatternCategories.forEach(userCategory => patternCategories.set(userCategory.id, userCategory));
78
+ const categories = record.wp_pattern_category.filter(category => patternCategories.get(category)).map(category => patternCategories.get(category).label);
79
+ details.push({
80
+ label: __('Categories'),
81
+ value: categories.length > 0 ? categories.join(', ') : ''
82
+ });
83
+ }
54
84
  }
55
- if (postType === 'wp_template_part') {
85
+ if (postType === TEMPLATE_PART_POST_TYPE) {
56
86
  const templatePartArea = templatePartAreas.find(area => area.area === record.area);
57
87
  let areaDetailValue = templatePartArea?.label;
58
88
  if (!areaDetailValue) {
@@ -65,7 +95,7 @@ export default function usePatternDetails(postType, postId) {
65
95
  value: areaDetailValue
66
96
  });
67
97
  }
68
- if (postType === 'wp_template_part' && addedBy.text && !isAddedByActiveTheme) {
98
+ if (postType === TEMPLATE_PART_POST_TYPE && addedBy.text && !isAddedByActiveTheme) {
69
99
  details.push({
70
100
  label: __('Added by'),
71
101
  value: createElement("span", {
@@ -73,7 +103,7 @@ export default function usePatternDetails(postType, postId) {
73
103
  }, addedBy.text)
74
104
  });
75
105
  }
76
- if (postType === 'wp_template_part' && addedBy.text && (record.origin === 'plugin' || record.has_theme_file === true)) {
106
+ if (postType === TEMPLATE_PART_POST_TYPE && addedBy.text && (record.origin === TEMPLATE_ORIGINS.plugin || record.has_theme_file === true)) {
77
107
  details.push({
78
108
  label: __('Customized'),
79
109
  value: createElement("span", {
@@ -1 +1 @@
1
- {"version":3,"names":["sentenceCase","__","sprintf","store","coreStore","editorStore","useSelect","useAddedBy","useEditedEntityRecord","useNavigationMenuContent","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","usePatternDetails","postType","postId","getDescription","getTitle","record","templatePartAreas","select","__experimentalGetDefaultTemplatePartAreas","currentTheme","getCurrentTheme","addedBy","isAddedByActiveTheme","type","theme","stylesheet","title","description","text","footer","modified","createElement","lastModifiedDateTime","details","push","label","value","wp_pattern_sync_status","templatePartArea","find","area","areaDetailValue","className","origin","has_theme_file","isCustomized","content","Fragment","length","spacing","map","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { sentenceCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useAddedBy } from '../list/added-by';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport useNavigationMenuContent from './use-navigation-menu-content';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\n\nexport default function usePatternDetails( postType, postId ) {\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord(\n\t\tpostType,\n\t\tpostId\n\t);\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tconst currentTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\tconst addedBy = useAddedBy( postType, postId );\n\tconst isAddedByActiveTheme =\n\t\taddedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;\n\tconst title = getTitle();\n\tlet description = getDescription();\n\n\tif ( ! description && addedBy.text ) {\n\t\tdescription = sprintf(\n\t\t\t// translators: %s: pattern title e.g: \"Header\".\n\t\t\t__( 'This is the %s pattern.' ),\n\t\t\tgetTitle()\n\t\t);\n\t}\n\n\tif ( ! description && postType === 'wp_block' && record?.title ) {\n\t\tdescription = sprintf(\n\t\t\t// translators: %s: user created pattern title e.g. \"Footer\".\n\t\t\t__( 'This is the %s pattern.' ),\n\t\t\trecord.title\n\t\t);\n\t}\n\n\tconst footer = !! record?.modified ? (\n\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\tlastModifiedDateTime={ record.modified }\n\t\t/>\n\t) : null;\n\n\tconst details = [];\n\n\tif ( postType === 'wp_block' || 'wp_template_part' ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Syncing' ),\n\t\t\tvalue:\n\t\t\t\trecord.wp_pattern_sync_status === 'unsynced'\n\t\t\t\t\t? __( 'Not synced' )\n\t\t\t\t\t: __( 'Fully synced' ),\n\t\t} );\n\t}\n\n\tif ( postType === 'wp_template_part' ) {\n\t\tconst templatePartArea = templatePartAreas.find(\n\t\t\t( area ) => area.area === record.area\n\t\t);\n\n\t\tlet areaDetailValue = templatePartArea?.label;\n\n\t\tif ( ! areaDetailValue ) {\n\t\t\tareaDetailValue = record.area\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: Sentenced cased template part area e.g: \"My custom area\".\n\t\t\t\t\t\t__( '%s (removed)' ),\n\t\t\t\t\t\tsentenceCase( record.area )\n\t\t\t\t )\n\t\t\t\t: __( 'None' );\n\t\t}\n\n\t\tdetails.push( { label: __( 'Area' ), value: areaDetailValue } );\n\t}\n\n\tif (\n\t\tpostType === 'wp_template_part' &&\n\t\taddedBy.text &&\n\t\t! isAddedByActiveTheme\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Added by' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-author\">\n\t\t\t\t\t{ addedBy.text }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tif (\n\t\tpostType === 'wp_template_part' &&\n\t\taddedBy.text &&\n\t\t( record.origin === 'plugin' || record.has_theme_file === true )\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Customized' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-customized\">\n\t\t\t\t\t{ addedBy.isCustomized ? __( 'Yes' ) : __( 'No' ) }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tconst content = (\n\t\t<>\n\t\t\t{ useNavigationMenuContent( postType, postId ) }\n\t\t\t{ !! details.length && (\n\t\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\t\tspacing={ 5 }\n\t\t\t\t\ttitle={ __( 'Details' ) }\n\t\t\t\t>\n\t\t\t\t\t{ details.map( ( { label, value } ) => (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\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AwC,QACtC2B,KACuC,CAAC,EAC3CJ,aAAA,CAACtB,wCAAwC,QACtC2B,KACuC,CACH,CACvC,CACkC,CAErC,CACF;EAED,OAAO;IAAEV,KAAK;IAAEC,WAAW;IAAEmB,OAAO;IAAEjB;EAAO,CAAC;AAC/C"}
1
+ {"version":3,"names":["sentenceCase","__","sprintf","store","coreStore","editorStore","useSelect","useAddedBy","useEditedEntityRecord","useNavigationMenuContent","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","PATTERN_SYNC_TYPES","TEMPLATE_ORIGINS","usePatternDetails","postType","postId","getDescription","getTitle","record","templatePartAreas","select","__experimentalGetDefaultTemplatePartAreas","currentTheme","userPatternCategories","getCurrentTheme","getUserPatternCategories","addedBy","isAddedByActiveTheme","type","theme","stylesheet","title","description","text","user","footer","modified","createElement","details","push","label","value","wp_pattern_sync_status","unsynced","wp_pattern_category","length","patternCategories","Map","forEach","userCategory","set","id","categories","filter","category","get","map","join","templatePartArea","find","area","areaDetailValue","className","origin","plugin","has_theme_file","isCustomized","content","Fragment","spacing","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { sentenceCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useAddedBy } from '../list/added-by';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport useNavigationMenuContent from './use-navigation-menu-content';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport {\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_SYNC_TYPES,\n\tTEMPLATE_ORIGINS,\n} from '../../utils/constants';\n\nexport default function usePatternDetails( postType, postId ) {\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord(\n\t\tpostType,\n\t\tpostId\n\t);\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tconst { currentTheme, userPatternCategories } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getUserPatternCategories } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tcurrentTheme: getCurrentTheme(),\n\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t};\n\t}, [] );\n\n\tconst addedBy = useAddedBy( postType, postId );\n\tconst isAddedByActiveTheme =\n\t\taddedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;\n\tconst title = getTitle();\n\tlet description = getDescription();\n\n\tif ( ! description && addedBy.text ) {\n\t\tdescription =\n\t\t\tpostType === PATTERN_TYPES.user\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: pattern title e.g: \"Header\".\n\t\t\t\t\t\t__( 'This is the %s pattern.' ),\n\t\t\t\t\t\tgetTitle()\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t// translators: %s: template part title e.g: \"Header\".\n\t\t\t\t\t\t__( 'This is the %s template part.' ),\n\t\t\t\t\t\tgetTitle()\n\t\t\t\t );\n\t}\n\n\tif ( ! description && postType === PATTERN_TYPES.user && record?.title ) {\n\t\tdescription = sprintf(\n\t\t\t// translators: %s: user created pattern title e.g. \"Footer\".\n\t\t\t__( 'This is the %s pattern.' ),\n\t\t\trecord.title\n\t\t);\n\t}\n\n\tconst footer = record?.modified ? (\n\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t) : null;\n\n\tconst details = [];\n\n\tif (\n\t\tpostType === PATTERN_TYPES.user ||\n\t\tpostType === TEMPLATE_PART_POST_TYPE\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Syncing' ),\n\t\t\tvalue:\n\t\t\t\trecord.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t\t? __( 'Not synced' )\n\t\t\t\t\t: __( 'Fully synced' ),\n\t\t} );\n\n\t\tif ( record.wp_pattern_category?.length === 0 ) {\n\t\t\tdetails.push( {\n\t\t\t\tlabel: __( 'Categories' ),\n\t\t\t\tvalue: __( 'Uncategorized' ),\n\t\t\t} );\n\t\t}\n\t\tif ( record.wp_pattern_category?.length > 0 ) {\n\t\t\tconst patternCategories = new Map();\n\t\t\tuserPatternCategories.forEach( ( userCategory ) =>\n\t\t\t\tpatternCategories.set( userCategory.id, userCategory )\n\t\t\t);\n\n\t\t\tconst categories = record.wp_pattern_category\n\t\t\t\t.filter( ( category ) => patternCategories.get( category ) )\n\t\t\t\t.map( ( category ) => patternCategories.get( category ).label );\n\n\t\t\tdetails.push( {\n\t\t\t\tlabel: __( 'Categories' ),\n\t\t\t\tvalue: categories.length > 0 ? categories.join( ', ' ) : '',\n\t\t\t} );\n\t\t}\n\t}\n\n\tif ( postType === TEMPLATE_PART_POST_TYPE ) {\n\t\tconst templatePartArea = templatePartAreas.find(\n\t\t\t( area ) => area.area === record.area\n\t\t);\n\n\t\tlet areaDetailValue = templatePartArea?.label;\n\n\t\tif ( ! areaDetailValue ) {\n\t\t\tareaDetailValue = record.area\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: Sentenced cased template part area e.g: \"My custom area\".\n\t\t\t\t\t\t__( '%s (removed)' ),\n\t\t\t\t\t\tsentenceCase( record.area )\n\t\t\t\t )\n\t\t\t\t: __( 'None' );\n\t\t}\n\n\t\tdetails.push( { label: __( 'Area' ), value: areaDetailValue } );\n\t}\n\n\tif (\n\t\tpostType === TEMPLATE_PART_POST_TYPE &&\n\t\taddedBy.text &&\n\t\t! isAddedByActiveTheme\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Added by' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-author\">\n\t\t\t\t\t{ addedBy.text }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tif (\n\t\tpostType === TEMPLATE_PART_POST_TYPE &&\n\t\taddedBy.text &&\n\t\t( record.origin === TEMPLATE_ORIGINS.plugin ||\n\t\t\trecord.has_theme_file === true )\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Customized' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-customized\">\n\t\t\t\t\t{ addedBy.isCustomized ? __( 'Yes' ) : __( 'No' ) }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tconst content = (\n\t\t<>\n\t\t\t{ useNavigationMenuContent( postType, postId ) }\n\t\t\t{ !! details.length && (\n\t\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\t\tspacing={ 5 }\n\t\t\t\t\ttitle={ __( 'Details' ) }\n\t\t\t\t>\n\t\t\t\t\t{ details.map( ( { label, value } ) => (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t) ) }\n\t\t\t\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