@wordpress/edit-site 5.19.6 → 5.20.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 (725) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-page/index.js +9 -8
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +6 -5
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +8 -7
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.js +20 -19
  9. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  10. package/build/components/add-new-template/index.js +2 -2
  11. package/build/components/add-new-template/index.js.map +1 -1
  12. package/build/components/add-new-template/new-template.js +17 -16
  13. package/build/components/add-new-template/new-template.js.map +1 -1
  14. package/build/components/add-new-template/template-actions-loading-screen.js +4 -4
  15. package/build/components/add-new-template/template-actions-loading-screen.js.map +1 -1
  16. package/build/components/app/index.js +2 -2
  17. package/build/components/app/index.js.map +1 -1
  18. package/build/components/block-editor/back-button.js +2 -2
  19. package/build/components/block-editor/back-button.js.map +1 -1
  20. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +10 -6
  21. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -1
  22. package/build/components/block-editor/block-editor-provider/index.js +3 -3
  23. package/build/components/block-editor/block-editor-provider/index.js.map +1 -1
  24. package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +3 -2
  25. package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -1
  26. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +19 -11
  27. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -1
  28. package/build/components/block-editor/block-inspector-button.js +2 -2
  29. package/build/components/block-editor/block-inspector-button.js.map +1 -1
  30. package/build/components/block-editor/editor-canvas.js +4 -3
  31. package/build/components/block-editor/editor-canvas.js.map +1 -1
  32. package/build/components/block-editor/index.js +2 -2
  33. package/build/components/block-editor/index.js.map +1 -1
  34. package/build/components/block-editor/resizable-editor.js +4 -3
  35. package/build/components/block-editor/resizable-editor.js.map +1 -1
  36. package/build/components/block-editor/resize-handle.js +3 -3
  37. package/build/components/block-editor/resize-handle.js.map +1 -1
  38. package/build/components/block-editor/site-editor-canvas.js +8 -7
  39. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  40. package/build/components/canvas-loader/index.js +4 -4
  41. package/build/components/canvas-loader/index.js.map +1 -1
  42. package/build/components/code-editor/index.js +8 -7
  43. package/build/components/code-editor/index.js.map +1 -1
  44. package/build/components/create-template-part-modal/index.js +17 -16
  45. package/build/components/create-template-part-modal/index.js.map +1 -1
  46. package/build/components/dataviews/dataviews.js +61 -0
  47. package/build/components/dataviews/dataviews.js.map +1 -0
  48. package/build/components/dataviews/index.js +21 -0
  49. package/build/components/dataviews/index.js.map +1 -0
  50. package/build/components/dataviews/list-view.js +89 -0
  51. package/build/components/dataviews/list-view.js.map +1 -0
  52. package/build/components/dataviews/pagination.js +89 -0
  53. package/build/components/dataviews/pagination.js.map +1 -0
  54. package/build/components/dataviews/text-filter.js +44 -0
  55. package/build/components/dataviews/text-filter.js.map +1 -0
  56. package/build/components/dataviews/view-actions.js +189 -0
  57. package/build/components/dataviews/view-actions.js.map +1 -0
  58. package/build/components/editor/index.js +15 -14
  59. package/build/components/editor/index.js.map +1 -1
  60. package/build/components/editor-canvas-container/index.js +4 -3
  61. package/build/components/editor-canvas-container/index.js.map +1 -1
  62. package/build/components/error-boundary/index.js +2 -1
  63. package/build/components/error-boundary/index.js.map +1 -1
  64. package/build/components/error-boundary/warning.js +4 -4
  65. package/build/components/error-boundary/warning.js.map +1 -1
  66. package/build/components/global-styles/block-preview-panel.js +5 -4
  67. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  68. package/build/components/global-styles/color-indicator-wrapper.js +2 -2
  69. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  70. package/build/components/global-styles/color-palette-panel.js +5 -5
  71. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  72. package/build/components/global-styles/dimensions-panel.js +3 -2
  73. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  74. package/build/components/global-styles/font-families.js +14 -14
  75. package/build/components/global-styles/font-families.js.map +1 -1
  76. package/build/components/global-styles/font-family-item.js +6 -5
  77. package/build/components/global-styles/font-family-item.js.map +1 -1
  78. package/build/components/global-styles/font-library-modal/collection-font-details.js +6 -6
  79. package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -1
  80. package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -5
  81. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  82. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +2 -2
  83. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  84. package/build/components/global-styles/font-library-modal/context.js +2 -1
  85. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  86. package/build/components/global-styles/font-library-modal/font-card.js +7 -7
  87. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  88. package/build/components/global-styles/font-library-modal/font-collection.js +17 -16
  89. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  90. package/build/components/global-styles/font-library-modal/font-demo.js +5 -4
  91. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  92. package/build/components/global-styles/font-library-modal/font-variant.js +7 -7
  93. package/build/components/global-styles/font-library-modal/font-variant.js.map +1 -1
  94. package/build/components/global-styles/font-library-modal/fonts-grid.js +8 -7
  95. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
  96. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +9 -9
  97. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  98. package/build/components/global-styles/font-library-modal/index.js +7 -6
  99. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  100. package/build/components/global-styles/font-library-modal/installed-fonts.js +17 -16
  101. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  102. package/build/components/global-styles/font-library-modal/library-font-card.js +3 -2
  103. package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  104. package/build/components/global-styles/font-library-modal/library-font-details.js +6 -6
  105. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  106. package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -4
  107. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  108. package/build/components/global-styles/font-library-modal/local-fonts.js +12 -11
  109. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  110. package/build/components/global-styles/font-library-modal/tab-layout.js +9 -9
  111. package/build/components/global-styles/font-library-modal/tab-layout.js.map +1 -1
  112. package/build/components/global-styles/font-library-modal/upload-fonts.js +3 -3
  113. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  114. package/build/components/global-styles/global-styles-provider.js +3 -2
  115. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  116. package/build/components/global-styles/gradients-palette-panel.js +8 -8
  117. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  118. package/build/components/global-styles/header.js +7 -7
  119. package/build/components/global-styles/header.js.map +1 -1
  120. package/build/components/global-styles/icon-with-current-color.js +2 -2
  121. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  122. package/build/components/global-styles/navigation-button.js +7 -7
  123. package/build/components/global-styles/navigation-button.js.map +1 -1
  124. package/build/components/global-styles/palette.js +11 -10
  125. package/build/components/global-styles/palette.js.map +1 -1
  126. package/build/components/global-styles/preview.js +17 -16
  127. package/build/components/global-styles/preview.js.map +1 -1
  128. package/build/components/global-styles/root-menu.js +4 -4
  129. package/build/components/global-styles/root-menu.js.map +1 -1
  130. package/build/components/global-styles/screen-block-list.js +10 -9
  131. package/build/components/global-styles/screen-block-list.js.map +1 -1
  132. package/build/components/global-styles/screen-block.js +17 -16
  133. package/build/components/global-styles/screen-block.js.map +1 -1
  134. package/build/components/global-styles/screen-color-palette.js +5 -5
  135. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  136. package/build/components/global-styles/screen-colors.js +5 -5
  137. package/build/components/global-styles/screen-colors.js.map +1 -1
  138. package/build/components/global-styles/screen-css.js +5 -5
  139. package/build/components/global-styles/screen-css.js.map +1 -1
  140. package/build/components/global-styles/screen-layout.js +3 -3
  141. package/build/components/global-styles/screen-layout.js.map +1 -1
  142. package/build/components/global-styles/screen-revisions/index.js +10 -9
  143. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  144. package/build/components/global-styles/screen-revisions/revisions-buttons.js +10 -10
  145. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  146. package/build/components/global-styles/screen-root.js +14 -14
  147. package/build/components/global-styles/screen-root.js.map +1 -1
  148. package/build/components/global-styles/screen-style-variations.js +5 -4
  149. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  150. package/build/components/global-styles/screen-typography-element.js +15 -14
  151. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  152. package/build/components/global-styles/screen-typography.js +5 -5
  153. package/build/components/global-styles/screen-typography.js.map +1 -1
  154. package/build/components/global-styles/style-variations-container.js +8 -7
  155. package/build/components/global-styles/style-variations-container.js.map +1 -1
  156. package/build/components/global-styles/subtitle.js +2 -2
  157. package/build/components/global-styles/subtitle.js.map +1 -1
  158. package/build/components/global-styles/typography-panel.js +2 -2
  159. package/build/components/global-styles/typography-panel.js.map +1 -1
  160. package/build/components/global-styles/typography-preview.js +2 -2
  161. package/build/components/global-styles/typography-preview.js.map +1 -1
  162. package/build/components/global-styles/typogrphy-elements.js +13 -13
  163. package/build/components/global-styles/typogrphy-elements.js.map +1 -1
  164. package/build/components/global-styles/ui.js +41 -40
  165. package/build/components/global-styles/ui.js.map +1 -1
  166. package/build/components/global-styles/variations-panel.js +3 -3
  167. package/build/components/global-styles/variations-panel.js.map +1 -1
  168. package/build/components/header-edit-mode/document-actions/index.js +16 -15
  169. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  170. package/build/components/header-edit-mode/index.js +20 -19
  171. package/build/components/header-edit-mode/index.js.map +1 -1
  172. package/build/components/header-edit-mode/mode-switcher/index.js +3 -3
  173. package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  174. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +2 -2
  175. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
  176. package/build/components/header-edit-mode/more-menu/index.js +14 -14
  177. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  178. package/build/components/header-edit-mode/more-menu/site-export.js +2 -2
  179. package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  180. package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js +2 -2
  181. package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
  182. package/build/components/header-edit-mode/plugin-more-menu-item/index.js +1 -1
  183. package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +1 -1
  184. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +3 -3
  185. package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  186. package/build/components/header-edit-mode/tools-more-menu-group/index.js +2 -2
  187. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  188. package/build/components/header-edit-mode/undo-redo/redo.js +3 -2
  189. package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
  190. package/build/components/header-edit-mode/undo-redo/undo.js +3 -2
  191. package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
  192. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  193. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  194. package/build/components/keyboard-shortcut-help-modal/index.js +15 -15
  195. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  196. package/build/components/keyboard-shortcut-help-modal/shortcut.js +8 -7
  197. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  198. package/build/components/layout/index.js +15 -14
  199. package/build/components/layout/index.js.map +1 -1
  200. package/build/components/list/added-by.js +9 -8
  201. package/build/components/list/added-by.js.map +1 -1
  202. package/build/components/list/header.js +5 -5
  203. package/build/components/list/header.js.map +1 -1
  204. package/build/components/list/index.js +5 -5
  205. package/build/components/list/index.js.map +1 -1
  206. package/build/components/list/table.js +15 -15
  207. package/build/components/list/table.js.map +1 -1
  208. package/build/components/page/header.js +6 -6
  209. package/build/components/page/header.js.map +1 -1
  210. package/build/components/page/index.js +5 -5
  211. package/build/components/page/index.js.map +1 -1
  212. package/build/components/page-actions/index.js +3 -3
  213. package/build/components/page-actions/index.js.map +1 -1
  214. package/build/components/page-actions/trash-page-menu-item.js +2 -2
  215. package/build/components/page-actions/trash-page-menu-item.js.map +1 -1
  216. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +3 -2
  217. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  218. package/build/components/page-content-focus-manager/edit-template-notification.js +3 -2
  219. package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -1
  220. package/build/components/page-content-focus-manager/index.js +35 -4
  221. package/build/components/page-content-focus-manager/index.js.map +1 -1
  222. package/build/components/page-main/index.js +7 -4
  223. package/build/components/page-main/index.js.map +1 -1
  224. package/build/components/page-pages/index.js +174 -0
  225. package/build/components/page-pages/index.js.map +1 -0
  226. package/build/components/page-patterns/duplicate-menu-item.js +2 -2
  227. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  228. package/build/components/page-patterns/grid-item.js +21 -20
  229. package/build/components/page-patterns/grid-item.js.map +1 -1
  230. package/build/components/page-patterns/grid.js +3 -3
  231. package/build/components/page-patterns/grid.js.map +1 -1
  232. package/build/components/page-patterns/header.js +4 -4
  233. package/build/components/page-patterns/header.js.map +1 -1
  234. package/build/components/page-patterns/index.js +4 -4
  235. package/build/components/page-patterns/index.js.map +1 -1
  236. package/build/components/page-patterns/no-patterns.js +2 -2
  237. package/build/components/page-patterns/no-patterns.js.map +1 -1
  238. package/build/components/page-patterns/pagination.js +10 -10
  239. package/build/components/page-patterns/pagination.js.map +1 -1
  240. package/build/components/page-patterns/patterns-list.js +15 -14
  241. package/build/components/page-patterns/patterns-list.js.map +1 -1
  242. package/build/components/page-patterns/rename-menu-item.js +10 -9
  243. package/build/components/page-patterns/rename-menu-item.js.map +1 -1
  244. package/build/components/page-template-parts/add-new-template-part.js +4 -3
  245. package/build/components/page-template-parts/add-new-template-part.js.map +1 -1
  246. package/build/components/page-template-parts/index.js +9 -9
  247. package/build/components/page-template-parts/index.js.map +1 -1
  248. package/build/components/page-templates/index.js +10 -10
  249. package/build/components/page-templates/index.js.map +1 -1
  250. package/build/components/plugin-template-setting-panel/index.js +1 -1
  251. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  252. package/build/components/preferences-modal/enable-feature.js +2 -2
  253. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  254. package/build/components/preferences-modal/index.js +12 -11
  255. package/build/components/preferences-modal/index.js.map +1 -1
  256. package/build/components/resizable-frame/index.js +7 -6
  257. package/build/components/resizable-frame/index.js.map +1 -1
  258. package/build/components/revisions/index.js +9 -8
  259. package/build/components/revisions/index.js.map +1 -1
  260. package/build/components/routes/link.js +2 -2
  261. package/build/components/routes/link.js.map +1 -1
  262. package/build/components/save-button/index.js +2 -2
  263. package/build/components/save-button/index.js.map +1 -1
  264. package/build/components/save-hub/index.js +4 -4
  265. package/build/components/save-hub/index.js.map +1 -1
  266. package/build/components/save-panel/index.js +11 -11
  267. package/build/components/save-panel/index.js.map +1 -1
  268. package/build/components/secondary-sidebar/inserter-sidebar.js +7 -6
  269. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  270. package/build/components/secondary-sidebar/list-view-sidebar.js +7 -6
  271. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  272. package/build/components/sidebar/index.js +23 -14
  273. package/build/components/sidebar/index.js.map +1 -1
  274. package/build/components/sidebar-button/index.js +2 -2
  275. package/build/components/sidebar-button/index.js.map +1 -1
  276. package/build/components/sidebar-edit-mode/default-sidebar.js +3 -3
  277. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  278. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +8 -7
  279. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  280. package/build/components/sidebar-edit-mode/index.js +6 -5
  281. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  282. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +20 -10
  283. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  284. package/build/components/sidebar-edit-mode/page-panels/index.js +7 -7
  285. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  286. package/build/components/sidebar-edit-mode/page-panels/page-content.js +3 -2
  287. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
  288. package/build/components/sidebar-edit-mode/page-panels/page-status.js +21 -20
  289. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
  290. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +4 -4
  291. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  292. package/build/components/sidebar-edit-mode/page-panels/publish-date.js +7 -6
  293. package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -1
  294. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +2 -2
  295. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
  296. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +7 -6
  297. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -1
  298. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +2 -2
  299. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  300. package/build/components/sidebar-edit-mode/settings-header/index.js +3 -3
  301. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  302. package/build/components/sidebar-edit-mode/sidebar-card/index.js +7 -7
  303. package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
  304. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +2 -2
  305. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
  306. package/build/components/sidebar-edit-mode/template-panel/index.js +5 -5
  307. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  308. package/build/components/sidebar-edit-mode/template-panel/last-revision.js +5 -5
  309. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
  310. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +4 -3
  311. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -1
  312. package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js +7 -6
  313. package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +1 -1
  314. package/build/components/sidebar-edit-mode/template-panel/template-actions.js +4 -4
  315. package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
  316. package/build/components/sidebar-edit-mode/template-panel/template-areas.js +7 -7
  317. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -1
  318. package/build/components/sidebar-navigation-item/index.js +5 -5
  319. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  320. package/build/components/sidebar-navigation-screen/index.js +11 -11
  321. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  322. package/build/components/sidebar-navigation-screen-details-footer/index.js +8 -7
  323. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  324. package/build/components/sidebar-navigation-screen-details-panel/index.js +3 -3
  325. package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
  326. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +2 -2
  327. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
  328. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  329. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  330. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +2 -2
  331. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
  332. package/build/components/sidebar-navigation-screen-global-styles/index.js +12 -11
  333. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  334. package/build/components/sidebar-navigation-screen-main/index.js +9 -8
  335. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  336. package/build/components/sidebar-navigation-screen-main/template-part-hint.js +2 -2
  337. package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -1
  338. package/build/components/sidebar-navigation-screen-navigation-item/index.js +4 -4
  339. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  340. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +2 -2
  341. package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
  342. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -2
  343. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  344. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -7
  345. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  346. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +8 -7
  347. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  348. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +4 -3
  349. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  350. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +9 -8
  351. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  352. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +5 -5
  353. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  354. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +8 -8
  355. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  356. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +7 -6
  357. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  358. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +5 -4
  359. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  360. package/build/components/sidebar-navigation-screen-page/index.js +11 -11
  361. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  362. package/build/components/sidebar-navigation-screen-page/page-details.js +6 -6
  363. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  364. package/build/components/sidebar-navigation-screen-page/status-label.js +5 -4
  365. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  366. package/build/components/sidebar-navigation-screen-pages/index.js +26 -17
  367. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  368. package/build/components/sidebar-navigation-screen-pattern/index.js +4 -4
  369. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  370. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +4 -4
  371. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  372. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +3 -3
  373. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
  374. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +6 -5
  375. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  376. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +4 -4
  377. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  378. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -2
  379. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  380. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +7 -7
  381. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  382. package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -3
  383. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  384. package/build/components/sidebar-navigation-screen-patterns/index.js +14 -14
  385. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  386. package/build/components/sidebar-navigation-screen-template/home-template-details.js +13 -12
  387. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  388. package/build/components/sidebar-navigation-screen-template/index.js +12 -12
  389. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  390. package/build/components/sidebar-navigation-screen-templates/index.js +6 -6
  391. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  392. package/build/components/sidebar-navigation-screen-templates-browse/index.js +2 -2
  393. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  394. package/build/components/site-hub/index.js +12 -11
  395. package/build/components/site-hub/index.js.map +1 -1
  396. package/build/components/site-icon/index.js +5 -5
  397. package/build/components/site-icon/index.js.map +1 -1
  398. package/build/components/start-template-options/index.js +10 -9
  399. package/build/components/start-template-options/index.js.map +1 -1
  400. package/build/components/style-book/index.js +19 -18
  401. package/build/components/style-book/index.js.map +1 -1
  402. package/build/components/table/index.js +6 -6
  403. package/build/components/table/index.js.map +1 -1
  404. package/build/components/template-actions/index.js +8 -7
  405. package/build/components/template-actions/index.js.map +1 -1
  406. package/build/components/template-actions/rename-menu-item.js +10 -9
  407. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  408. package/build/components/template-part-converter/convert-to-regular.js +2 -2
  409. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  410. package/build/components/template-part-converter/convert-to-template-part.js +4 -3
  411. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  412. package/build/components/template-part-converter/index.js +5 -5
  413. package/build/components/template-part-converter/index.js.map +1 -1
  414. package/build/components/welcome-guide/editor.js +8 -7
  415. package/build/components/welcome-guide/editor.js.map +1 -1
  416. package/build/components/welcome-guide/image.js +4 -4
  417. package/build/components/welcome-guide/image.js.map +1 -1
  418. package/build/components/welcome-guide/index.js +2 -2
  419. package/build/components/welcome-guide/index.js.map +1 -1
  420. package/build/components/welcome-guide/page.js +6 -6
  421. package/build/components/welcome-guide/page.js.map +1 -1
  422. package/build/components/welcome-guide/styles.js +15 -15
  423. package/build/components/welcome-guide/styles.js.map +1 -1
  424. package/build/components/welcome-guide/template.js +6 -6
  425. package/build/components/welcome-guide/template.js.map +1 -1
  426. package/build/hooks/commands/use-common-commands.js +2 -2
  427. package/build/hooks/commands/use-common-commands.js.map +1 -1
  428. package/build/hooks/navigation-menu-edit.js +5 -5
  429. package/build/hooks/navigation-menu-edit.js.map +1 -1
  430. package/build/hooks/push-changes-to-global-styles/index.js +6 -5
  431. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  432. package/build/hooks/template-part-edit.js +5 -5
  433. package/build/hooks/template-part-edit.js.map +1 -1
  434. package/build/index.js +3 -2
  435. package/build/index.js.map +1 -1
  436. package/build/lock-unlock.js +1 -1
  437. package/build/lock-unlock.js.map +1 -1
  438. package/build/store/selectors.js +5 -4
  439. package/build/store/selectors.js.map +1 -1
  440. package/build/utils/get-is-list-page.js +1 -1
  441. package/build/utils/get-is-list-page.js.map +1 -1
  442. package/build-module/components/add-new-page/index.js +1 -1
  443. package/build-module/components/add-new-pattern/index.js +1 -1
  444. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
  445. package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -1
  446. package/build-module/components/add-new-template/index.js +1 -1
  447. package/build-module/components/add-new-template/new-template.js +1 -1
  448. package/build-module/components/add-new-template/template-actions-loading-screen.js +1 -1
  449. package/build-module/components/app/index.js +1 -1
  450. package/build-module/components/block-editor/back-button.js +1 -1
  451. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +9 -5
  452. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -1
  453. package/build-module/components/block-editor/block-editor-provider/index.js +1 -1
  454. package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +1 -1
  455. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +19 -11
  456. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -1
  457. package/build-module/components/block-editor/block-inspector-button.js +1 -1
  458. package/build-module/components/block-editor/editor-canvas.js +1 -1
  459. package/build-module/components/block-editor/index.js +1 -1
  460. package/build-module/components/block-editor/resizable-editor.js +1 -1
  461. package/build-module/components/block-editor/resize-handle.js +1 -1
  462. package/build-module/components/block-editor/site-editor-canvas.js +1 -1
  463. package/build-module/components/canvas-loader/index.js +1 -1
  464. package/build-module/components/code-editor/index.js +1 -1
  465. package/build-module/components/create-template-part-modal/index.js +1 -1
  466. package/build-module/components/dataviews/dataviews.js +53 -0
  467. package/build-module/components/dataviews/dataviews.js.map +1 -0
  468. package/build-module/components/dataviews/index.js +3 -0
  469. package/build-module/components/dataviews/index.js.map +1 -0
  470. package/build-module/components/dataviews/list-view.js +80 -0
  471. package/build-module/components/dataviews/list-view.js.map +1 -0
  472. package/build-module/components/dataviews/pagination.js +83 -0
  473. package/build-module/components/dataviews/pagination.js.map +1 -0
  474. package/build-module/components/dataviews/text-filter.js +36 -0
  475. package/build-module/components/dataviews/text-filter.js.map +1 -0
  476. package/build-module/components/dataviews/view-actions.js +179 -0
  477. package/build-module/components/dataviews/view-actions.js.map +1 -0
  478. package/build-module/components/editor/index.js +1 -1
  479. package/build-module/components/editor-canvas-container/index.js +1 -1
  480. package/build-module/components/error-boundary/index.js +1 -1
  481. package/build-module/components/error-boundary/warning.js +1 -1
  482. package/build-module/components/global-styles/block-preview-panel.js +1 -1
  483. package/build-module/components/global-styles/color-indicator-wrapper.js +1 -1
  484. package/build-module/components/global-styles/color-palette-panel.js +1 -1
  485. package/build-module/components/global-styles/dimensions-panel.js +1 -1
  486. package/build-module/components/global-styles/font-families.js +3 -4
  487. package/build-module/components/global-styles/font-families.js.map +1 -1
  488. package/build-module/components/global-styles/font-family-item.js +1 -1
  489. package/build-module/components/global-styles/font-library-modal/collection-font-details.js +1 -1
  490. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +1 -1
  491. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +1 -1
  492. package/build-module/components/global-styles/font-library-modal/context.js +1 -1
  493. package/build-module/components/global-styles/font-library-modal/font-card.js +1 -1
  494. package/build-module/components/global-styles/font-library-modal/font-collection.js +1 -1
  495. package/build-module/components/global-styles/font-library-modal/font-demo.js +1 -1
  496. package/build-module/components/global-styles/font-library-modal/font-variant.js +1 -1
  497. package/build-module/components/global-styles/font-library-modal/fonts-grid.js +1 -1
  498. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  499. package/build-module/components/global-styles/font-library-modal/index.js +1 -1
  500. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  501. package/build-module/components/global-styles/font-library-modal/library-font-card.js +1 -1
  502. package/build-module/components/global-styles/font-library-modal/library-font-details.js +1 -1
  503. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +1 -1
  504. package/build-module/components/global-styles/font-library-modal/local-fonts.js +1 -1
  505. package/build-module/components/global-styles/font-library-modal/tab-layout.js +1 -1
  506. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +1 -1
  507. package/build-module/components/global-styles/global-styles-provider.js +1 -1
  508. package/build-module/components/global-styles/gradients-palette-panel.js +1 -1
  509. package/build-module/components/global-styles/header.js +1 -1
  510. package/build-module/components/global-styles/icon-with-current-color.js +1 -1
  511. package/build-module/components/global-styles/navigation-button.js +1 -1
  512. package/build-module/components/global-styles/palette.js +1 -1
  513. package/build-module/components/global-styles/preview.js +1 -1
  514. package/build-module/components/global-styles/root-menu.js +1 -1
  515. package/build-module/components/global-styles/screen-block-list.js +1 -1
  516. package/build-module/components/global-styles/screen-block.js +1 -1
  517. package/build-module/components/global-styles/screen-color-palette.js +1 -1
  518. package/build-module/components/global-styles/screen-colors.js +1 -1
  519. package/build-module/components/global-styles/screen-css.js +1 -1
  520. package/build-module/components/global-styles/screen-layout.js +1 -1
  521. package/build-module/components/global-styles/screen-revisions/index.js +1 -1
  522. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
  523. package/build-module/components/global-styles/screen-root.js +1 -1
  524. package/build-module/components/global-styles/screen-style-variations.js +1 -1
  525. package/build-module/components/global-styles/screen-typography-element.js +1 -1
  526. package/build-module/components/global-styles/screen-typography.js +2 -2
  527. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  528. package/build-module/components/global-styles/style-variations-container.js +1 -1
  529. package/build-module/components/global-styles/subtitle.js +1 -1
  530. package/build-module/components/global-styles/typography-panel.js +1 -1
  531. package/build-module/components/global-styles/typography-preview.js +1 -1
  532. package/build-module/components/global-styles/typogrphy-elements.js +1 -1
  533. package/build-module/components/global-styles/ui.js +1 -1
  534. package/build-module/components/global-styles/variations-panel.js +1 -1
  535. package/build-module/components/header-edit-mode/document-actions/index.js +1 -1
  536. package/build-module/components/header-edit-mode/index.js +1 -1
  537. package/build-module/components/header-edit-mode/mode-switcher/index.js +1 -1
  538. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +1 -1
  539. package/build-module/components/header-edit-mode/more-menu/index.js +1 -1
  540. package/build-module/components/header-edit-mode/more-menu/site-export.js +1 -1
  541. package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js +1 -1
  542. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +1 -1
  543. package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +1 -1
  544. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +2 -2
  545. package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
  546. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +1 -1
  547. package/build-module/components/header-edit-mode/undo-redo/redo.js +1 -1
  548. package/build-module/components/header-edit-mode/undo-redo/undo.js +1 -1
  549. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -1
  550. package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -1
  551. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -1
  552. package/build-module/components/layout/index.js +1 -1
  553. package/build-module/components/list/added-by.js +1 -1
  554. package/build-module/components/list/header.js +1 -1
  555. package/build-module/components/list/index.js +1 -1
  556. package/build-module/components/list/table.js +1 -1
  557. package/build-module/components/page/header.js +1 -1
  558. package/build-module/components/page/index.js +1 -1
  559. package/build-module/components/page-actions/index.js +1 -1
  560. package/build-module/components/page-actions/trash-page-menu-item.js +1 -1
  561. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +1 -1
  562. package/build-module/components/page-content-focus-manager/edit-template-notification.js +1 -1
  563. package/build-module/components/page-content-focus-manager/index.js +34 -4
  564. package/build-module/components/page-content-focus-manager/index.js.map +1 -1
  565. package/build-module/components/page-main/index.js +4 -1
  566. package/build-module/components/page-main/index.js.map +1 -1
  567. package/build-module/components/page-pages/index.js +166 -0
  568. package/build-module/components/page-pages/index.js.map +1 -0
  569. package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
  570. package/build-module/components/page-patterns/grid-item.js +1 -1
  571. package/build-module/components/page-patterns/grid.js +1 -1
  572. package/build-module/components/page-patterns/header.js +1 -1
  573. package/build-module/components/page-patterns/index.js +1 -1
  574. package/build-module/components/page-patterns/no-patterns.js +1 -1
  575. package/build-module/components/page-patterns/pagination.js +1 -1
  576. package/build-module/components/page-patterns/patterns-list.js +1 -1
  577. package/build-module/components/page-patterns/rename-menu-item.js +1 -1
  578. package/build-module/components/page-template-parts/add-new-template-part.js +1 -1
  579. package/build-module/components/page-template-parts/index.js +1 -1
  580. package/build-module/components/page-templates/index.js +1 -1
  581. package/build-module/components/plugin-template-setting-panel/index.js +1 -1
  582. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  583. package/build-module/components/preferences-modal/enable-feature.js +1 -1
  584. package/build-module/components/preferences-modal/index.js +1 -1
  585. package/build-module/components/resizable-frame/index.js +1 -1
  586. package/build-module/components/revisions/index.js +1 -1
  587. package/build-module/components/routes/link.js +1 -1
  588. package/build-module/components/save-button/index.js +1 -1
  589. package/build-module/components/save-hub/index.js +1 -1
  590. package/build-module/components/save-panel/index.js +1 -1
  591. package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -1
  592. package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -1
  593. package/build-module/components/sidebar/index.js +10 -2
  594. package/build-module/components/sidebar/index.js.map +1 -1
  595. package/build-module/components/sidebar-button/index.js +1 -1
  596. package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -1
  597. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +1 -1
  598. package/build-module/components/sidebar-edit-mode/index.js +1 -1
  599. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +15 -5
  600. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  601. package/build-module/components/sidebar-edit-mode/page-panels/index.js +1 -1
  602. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +1 -1
  603. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +1 -1
  604. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +1 -1
  605. package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +1 -1
  606. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +1 -1
  607. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +1 -1
  608. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +1 -1
  609. package/build-module/components/sidebar-edit-mode/settings-header/index.js +1 -1
  610. package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +1 -1
  611. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
  612. package/build-module/components/sidebar-edit-mode/template-panel/index.js +1 -1
  613. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +1 -1
  614. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +1 -1
  615. package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js +1 -1
  616. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +1 -1
  617. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +1 -1
  618. package/build-module/components/sidebar-navigation-item/index.js +1 -1
  619. package/build-module/components/sidebar-navigation-screen/index.js +1 -1
  620. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  621. package/build-module/components/sidebar-navigation-screen-details-panel/index.js +1 -1
  622. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +1 -1
  623. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +1 -1
  624. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +1 -1
  625. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +1 -1
  626. package/build-module/components/sidebar-navigation-screen-main/index.js +1 -1
  627. package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +1 -1
  628. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
  629. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +1 -1
  630. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +1 -1
  631. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +1 -1
  632. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -1
  633. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
  634. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -1
  635. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
  636. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  637. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +1 -1
  638. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -1
  639. package/build-module/components/sidebar-navigation-screen-page/index.js +1 -1
  640. package/build-module/components/sidebar-navigation-screen-page/page-details.js +1 -1
  641. package/build-module/components/sidebar-navigation-screen-page/status-label.js +1 -1
  642. package/build-module/components/sidebar-navigation-screen-pages/index.js +13 -5
  643. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  644. package/build-module/components/sidebar-navigation-screen-pattern/index.js +1 -1
  645. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -3
  646. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  647. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +1 -1
  648. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
  649. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  650. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +1 -1
  651. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +1 -1
  652. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  653. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +1 -1
  654. package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -1
  655. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +1 -1
  656. package/build-module/components/sidebar-navigation-screen-template/index.js +1 -1
  657. package/build-module/components/sidebar-navigation-screen-templates/index.js +1 -1
  658. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -1
  659. package/build-module/components/site-hub/index.js +1 -1
  660. package/build-module/components/site-icon/index.js +1 -1
  661. package/build-module/components/start-template-options/index.js +4 -4
  662. package/build-module/components/start-template-options/index.js.map +1 -1
  663. package/build-module/components/style-book/index.js +1 -1
  664. package/build-module/components/table/index.js +1 -1
  665. package/build-module/components/template-actions/index.js +1 -1
  666. package/build-module/components/template-actions/rename-menu-item.js +1 -1
  667. package/build-module/components/template-part-converter/convert-to-regular.js +1 -1
  668. package/build-module/components/template-part-converter/convert-to-template-part.js +1 -1
  669. package/build-module/components/template-part-converter/index.js +1 -1
  670. package/build-module/components/welcome-guide/editor.js +1 -1
  671. package/build-module/components/welcome-guide/image.js +1 -1
  672. package/build-module/components/welcome-guide/index.js +1 -1
  673. package/build-module/components/welcome-guide/page.js +1 -1
  674. package/build-module/components/welcome-guide/styles.js +1 -1
  675. package/build-module/components/welcome-guide/template.js +1 -1
  676. package/build-module/hooks/commands/use-common-commands.js +4 -4
  677. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  678. package/build-module/hooks/navigation-menu-edit.js +1 -1
  679. package/build-module/hooks/push-changes-to-global-styles/index.js +1 -1
  680. package/build-module/hooks/template-part-edit.js +1 -1
  681. package/build-module/index.js +1 -1
  682. package/build-module/lock-unlock.js +1 -1
  683. package/build-module/lock-unlock.js.map +1 -1
  684. package/build-module/store/selectors.js +5 -4
  685. package/build-module/store/selectors.js.map +1 -1
  686. package/build-module/utils/get-is-list-page.js +1 -1
  687. package/build-module/utils/get-is-list-page.js.map +1 -1
  688. package/build-style/style-rtl.css +58 -21
  689. package/build-style/style.css +58 -21
  690. package/package.json +41 -40
  691. package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +10 -5
  692. package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +33 -4
  693. package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +27 -14
  694. package/src/components/dataviews/dataviews.js +60 -0
  695. package/src/components/dataviews/index.js +2 -0
  696. package/src/components/dataviews/list-view.js +106 -0
  697. package/src/components/dataviews/pagination.js +118 -0
  698. package/src/components/dataviews/style.scss +36 -0
  699. package/src/components/dataviews/text-filter.js +37 -0
  700. package/src/components/dataviews/view-actions.js +246 -0
  701. package/src/components/global-styles/font-families.js +1 -5
  702. package/src/components/global-styles/screen-typography.js +3 -4
  703. package/src/components/header-edit-mode/plugin-more-menu-item/index.js +1 -1
  704. package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +1 -1
  705. package/src/components/page-content-focus-manager/index.js +29 -4
  706. package/src/components/page-main/index.js +3 -0
  707. package/src/components/page-pages/index.js +190 -0
  708. package/src/components/plugin-template-setting-panel/index.js +1 -1
  709. package/src/components/sidebar/index.js +11 -0
  710. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +31 -16
  711. package/src/components/sidebar-navigation-screen/style.scss +0 -13
  712. package/src/components/sidebar-navigation-screen-pages/index.js +11 -4
  713. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +7 -2
  714. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +8 -2
  715. package/src/components/start-template-options/index.js +3 -3
  716. package/src/hooks/commands/use-common-commands.js +12 -4
  717. package/src/lock-unlock.js +1 -1
  718. package/src/store/selectors.js +10 -9
  719. package/src/style.scss +1 -0
  720. package/src/utils/get-is-list-page.js +3 -2
  721. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -29
  722. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +0 -1
  723. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -22
  724. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +0 -1
  725. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -32
@@ -1 +1 @@
1
- {"version":3,"names":["Modal","Flex","FlexItem","Button","__","useState","useEffect","useMemo","__experimentalBlockPatternsList","BlockPatternsList","store","blockEditorStore","useSelect","useAsyncList","preferencesStore","parse","editSiteStore","coreStore","useEntityBlockEditor","apiFetch","addQueryArgs","TEMPLATE_POST_TYPE","useFallbackTemplateContent","slug","isCustom","templateContent","setTemplateContent","path","is_custom","ignore_empty","then","content","raw","useStartPatterns","fallbackContent","patterns","select","getEditedPostType","getEditedPostId","getEntityRecord","postId","postType","record","getSettings","__experimentalBlockPatterns","currentThemeStylesheet","getCurrentTheme","stylesheet","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","attributes","theme","undefined","blocks","title","filter","pattern","Array","isArray","templateTypes","some","templateType","startsWith","PatternSelection","onChoosePattern","onChange","blockPatterns","shownBlockPatterns","createElement","shownPatterns","onClickPattern","selection","StartModal","onClose","className","closeLabel","focusOnMount","onRequestClose","isFullScreen","justify","expanded","variant","onClick","START_TEMPLATE_MODAL_STATES","INITIAL","CLOSED","StartTemplateOptions","modalState","setModalState","shouldOpenModal","_postType","getEditedEntityRecord","hasEditsForEntityRecord","templateRecord","hasEdits","get"],"sources":["@wordpress/edit-site/src/components/start-template-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal, Flex, FlexItem, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport {\n\t__experimentalBlockPatternsList as BlockPatternsList,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nfunction useFallbackTemplateContent( slug, isCustom = false ) {\n\tconst [ templateContent, setTemplateContent ] = useState( '' );\n\n\tuseEffect( () => {\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/templates/lookup', {\n\t\t\t\tslug,\n\t\t\t\tis_custom: isCustom,\n\t\t\t\tignore_empty: true,\n\t\t\t} ),\n\t\t} ).then( ( { content } ) => setTemplateContent( content.raw ) );\n\t}, [ isCustom, slug ] );\n\treturn templateContent;\n}\n\nfunction useStartPatterns( fallbackContent ) {\n\tconst { slug, patterns } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = select( editSiteStore );\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst postId = getEditedPostId();\n\t\tconst postType = getEditedPostType();\n\t\tconst record = getEntityRecord( 'postType', postType, postId );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tslug: record.slug,\n\t\t\tpatterns: getSettings().__experimentalBlockPatterns,\n\t\t};\n\t}, [] );\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme().stylesheet\n\t);\n\n\t// Duplicated from packages/block-library/src/pattern/edit.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\treturn useMemo( () => {\n\t\t// filter patterns that are supposed to be used in the current template being edited.\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'fallback',\n\t\t\t\tblocks: parse( fallbackContent ),\n\t\t\t\ttitle: __( 'Fallback content' ),\n\t\t\t},\n\t\t\t...patterns\n\t\t\t\t.filter( ( pattern ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tArray.isArray( pattern.templateTypes ) &&\n\t\t\t\t\t\tpattern.templateTypes.some( ( templateType ) =>\n\t\t\t\t\t\t\tslug.startsWith( templateType )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} )\n\t\t\t\t.map( ( pattern ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...pattern,\n\t\t\t\t\t\tblocks: parse( pattern.content ).map( ( block ) =>\n\t\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t} ),\n\t\t];\n\t}, [ fallbackContent, slug, patterns ] );\n}\n\nfunction PatternSelection( { fallbackContent, onChoosePattern, postType } ) {\n\tconst [ , , onChange ] = useEntityBlockEditor( 'postType', postType );\n\tconst blockPatterns = useStartPatterns( fallbackContent );\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( pattern, blocks ) => {\n\t\t\t\tonChange( blocks, { selection: undefined } );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartModal( { slug, isCustom, onClose, postType } ) {\n\tconst fallbackContent = useFallbackTemplateContent( slug, isCustom );\n\tif ( ! fallbackContent ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-site-start-template-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\tfocusOnMount=\"firstElement\"\n\t\t\tonRequestClose={ onClose }\n\t\t\tisFullScreen={ true }\n\t\t>\n\t\t\t<div className=\"edit-site-start-template-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tfallbackContent={ fallbackContent }\n\t\t\t\t\tslug={ slug }\n\t\t\t\t\tisCustom={ isCustom }\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tonChoosePattern={ () => {\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<Flex\n\t\t\t\tclassName=\"edit-site-start-template-options__modal__actions\"\n\t\t\t\tjustify=\"flex-end\"\n\t\t\t\texpanded={ false }\n\t\t\t>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Button variant=\"tertiary\" onClick={ onClose }>\n\t\t\t\t\t\t{ __( 'Skip' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</Modal>\n\t);\n}\n\nconst START_TEMPLATE_MODAL_STATES = {\n\tINITIAL: 'INITIAL',\n\tCLOSED: 'CLOSED',\n};\n\nexport default function StartTemplateOptions() {\n\tconst [ modalState, setModalState ] = useState(\n\t\tSTART_TEMPLATE_MODAL_STATES.INITIAL\n\t);\n\tconst { shouldOpenModal, slug, isCustom, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostType, getEditedPostId } =\n\t\t\t\tselect( editSiteStore );\n\t\t\tconst _postType = getEditedPostType();\n\t\t\tconst postId = getEditedPostId();\n\t\t\tconst { getEditedEntityRecord, hasEditsForEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst templateRecord = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tconst hasEdits = hasEditsForEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\tpostId\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tshouldOpenModal:\n\t\t\t\t\t! hasEdits &&\n\t\t\t\t\t'' === templateRecord.content &&\n\t\t\t\t\tTEMPLATE_POST_TYPE === _postType &&\n\t\t\t\t\t! select( preferencesStore ).get(\n\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t'welcomeGuide'\n\t\t\t\t\t),\n\t\t\t\tslug: templateRecord.slug,\n\t\t\t\tisCustom: templateRecord.is_custom,\n\t\t\t\tpostType: _postType,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tif (\n\t\t( modalState === START_TEMPLATE_MODAL_STATES.INITIAL &&\n\t\t\t! shouldOpenModal ) ||\n\t\tmodalState === START_TEMPLATE_MODAL_STATES.CLOSED\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StartModal\n\t\t\tslug={ slug }\n\t\t\tisCustom={ isCustom }\n\t\t\tpostType={ postType }\n\t\t\tonClose={ () =>\n\t\t\t\tsetModalState( START_TEMPLATE_MODAL_STATES.CLOSED )\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACrE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACjE,SACCC,+BAA+B,IAAIC,iBAAiB,EACpDC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASH,KAAK,IAAII,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,KAAK,QAAQ,mBAAmB;;AAEzC;AACA;AACA;AACA,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SAASN,KAAK,IAAIO,SAAS,EAAEC,oBAAoB,QAAQ,sBAAsB;AAC/E,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1D,SAASC,0BAA0BA,CAAEC,IAAI,E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EK,QAAQ,IACV,EAAE,KAAKD,cAAc,CAACnE,OAAO,IAC7BV,kBAAkB,KAAK0E,SAAS,IAChC,CAAE3D,MAAM,CAAEtB,gBAAiB,CAAC,CAACsF,GAAG,CAC/B,gBAAgB,EAChB,cACD,CAAC;MACF7E,IAAI,EAAE2E,cAAc,CAAC3E,IAAI;MACzBC,QAAQ,EAAE0E,cAAc,CAACtE,SAAS;MAClCa,QAAQ,EAAEsD;IACX,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,IACGH,UAAU,KAAKJ,2BAA2B,CAACC,OAAO,IACnD,CAAEK,eAAe,IAClBF,UAAU,KAAKJ,2BAA2B,CAACE,MAAM,EAChD;IACD,OAAO,IAAI;EACZ;EAEA,OACCjB,aAAA,CAACI,UAAU;IACVtD,IAAI,EAAGA,IAAM;IACbC,QAAQ,EAAGA,QAAU;IACrBiB,QAAQ,EAAGA,QAAU;IACrBqC,OAAO,EAAGA,CAAA,KACTe,aAAa,CAAEL,2BAA2B,CAACE,MAAO;EAClD,CACD,CAAC;AAEJ"}
1
+ {"version":3,"names":["Modal","Flex","FlexItem","Button","__","useState","useEffect","useMemo","__experimentalBlockPatternsList","BlockPatternsList","store","blockEditorStore","useSelect","useAsyncList","preferencesStore","parse","coreStore","useEntityBlockEditor","apiFetch","addQueryArgs","editSiteStore","TEMPLATE_POST_TYPE","useFallbackTemplateContent","slug","isCustom","templateContent","setTemplateContent","path","is_custom","ignore_empty","then","content","raw","useStartPatterns","fallbackContent","patterns","select","getEditedPostType","getEditedPostId","getEntityRecord","postId","postType","record","getSettings","__experimentalBlockPatterns","currentThemeStylesheet","getCurrentTheme","stylesheet","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","attributes","theme","undefined","blocks","title","filter","pattern","Array","isArray","templateTypes","some","templateType","startsWith","PatternSelection","onChoosePattern","onChange","blockPatterns","shownBlockPatterns","createElement","shownPatterns","onClickPattern","selection","StartModal","onClose","className","closeLabel","focusOnMount","onRequestClose","isFullScreen","justify","expanded","variant","onClick","START_TEMPLATE_MODAL_STATES","INITIAL","CLOSED","StartTemplateOptions","modalState","setModalState","shouldOpenModal","_postType","getEditedEntityRecord","hasEditsForEntityRecord","templateRecord","hasEdits","get"],"sources":["@wordpress/edit-site/src/components/start-template-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal, Flex, FlexItem, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport {\n\t__experimentalBlockPatternsList as BlockPatternsList,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nfunction useFallbackTemplateContent( slug, isCustom = false ) {\n\tconst [ templateContent, setTemplateContent ] = useState( '' );\n\n\tuseEffect( () => {\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/templates/lookup', {\n\t\t\t\tslug,\n\t\t\t\tis_custom: isCustom,\n\t\t\t\tignore_empty: true,\n\t\t\t} ),\n\t\t} ).then( ( { content } ) => setTemplateContent( content.raw ) );\n\t}, [ isCustom, slug ] );\n\treturn templateContent;\n}\n\nfunction useStartPatterns( fallbackContent ) {\n\tconst { slug, patterns } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = select( editSiteStore );\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst postId = getEditedPostId();\n\t\tconst postType = getEditedPostType();\n\t\tconst record = getEntityRecord( 'postType', postType, postId );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tslug: record.slug,\n\t\t\tpatterns: getSettings().__experimentalBlockPatterns,\n\t\t};\n\t}, [] );\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme().stylesheet\n\t);\n\n\t// Duplicated from packages/block-library/src/pattern/edit.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\treturn useMemo( () => {\n\t\t// filter patterns that are supposed to be used in the current template being edited.\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'fallback',\n\t\t\t\tblocks: parse( fallbackContent ),\n\t\t\t\ttitle: __( 'Fallback content' ),\n\t\t\t},\n\t\t\t...patterns\n\t\t\t\t.filter( ( pattern ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tArray.isArray( pattern.templateTypes ) &&\n\t\t\t\t\t\tpattern.templateTypes.some( ( templateType ) =>\n\t\t\t\t\t\t\tslug.startsWith( templateType )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} )\n\t\t\t\t.map( ( pattern ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...pattern,\n\t\t\t\t\t\tblocks: parse( pattern.content ).map( ( block ) =>\n\t\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t} ),\n\t\t];\n\t}, [ fallbackContent, slug, patterns ] );\n}\n\nfunction PatternSelection( { fallbackContent, onChoosePattern, postType } ) {\n\tconst [ , , onChange ] = useEntityBlockEditor( 'postType', postType );\n\tconst blockPatterns = useStartPatterns( fallbackContent );\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( pattern, blocks ) => {\n\t\t\t\tonChange( blocks, { selection: undefined } );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartModal( { slug, isCustom, onClose, postType } ) {\n\tconst fallbackContent = useFallbackTemplateContent( slug, isCustom );\n\tif ( ! fallbackContent ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-site-start-template-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\tfocusOnMount=\"firstElement\"\n\t\t\tonRequestClose={ onClose }\n\t\t\tisFullScreen={ true }\n\t\t>\n\t\t\t<div className=\"edit-site-start-template-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tfallbackContent={ fallbackContent }\n\t\t\t\t\tslug={ slug }\n\t\t\t\t\tisCustom={ isCustom }\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tonChoosePattern={ () => {\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<Flex\n\t\t\t\tclassName=\"edit-site-start-template-options__modal__actions\"\n\t\t\t\tjustify=\"flex-end\"\n\t\t\t\texpanded={ false }\n\t\t\t>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Button variant=\"tertiary\" onClick={ onClose }>\n\t\t\t\t\t\t{ __( 'Skip' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</Modal>\n\t);\n}\n\nconst START_TEMPLATE_MODAL_STATES = {\n\tINITIAL: 'INITIAL',\n\tCLOSED: 'CLOSED',\n};\n\nexport default function StartTemplateOptions() {\n\tconst [ modalState, setModalState ] = useState(\n\t\tSTART_TEMPLATE_MODAL_STATES.INITIAL\n\t);\n\tconst { shouldOpenModal, slug, isCustom, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostType, getEditedPostId } =\n\t\t\t\tselect( editSiteStore );\n\t\t\tconst _postType = getEditedPostType();\n\t\t\tconst postId = getEditedPostId();\n\t\t\tconst { getEditedEntityRecord, hasEditsForEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst templateRecord = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tconst hasEdits = hasEditsForEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\tpostId\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tshouldOpenModal:\n\t\t\t\t\t! hasEdits &&\n\t\t\t\t\t'' === templateRecord.content &&\n\t\t\t\t\tTEMPLATE_POST_TYPE === _postType &&\n\t\t\t\t\t! select( preferencesStore ).get(\n\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t'welcomeGuide'\n\t\t\t\t\t),\n\t\t\t\tslug: templateRecord.slug,\n\t\t\t\tisCustom: templateRecord.is_custom,\n\t\t\t\tpostType: _postType,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tif (\n\t\t( modalState === START_TEMPLATE_MODAL_STATES.INITIAL &&\n\t\t\t! shouldOpenModal ) ||\n\t\tmodalState === START_TEMPLATE_MODAL_STATES.CLOSED\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StartModal\n\t\t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U,KAAKJ,2BAA2B,CAACE,MAAM,EAChD;IACD,OAAO,IAAI;EACZ;EAEA,OACCjB,aAAA,CAACI,UAAU;IACVtD,IAAI,EAAGA,IAAM;IACbC,QAAQ,EAAGA,QAAU;IACrBiB,QAAQ,EAAGA,QAAU;IACrBqC,OAAO,EAAGA,CAAA,KACTe,aAAa,CAAEL,2BAA2B,CAACE,MAAO;EAClD,CACD,CAAC;AAEJ"}
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  export default function Table({
3
3
  data,
4
4
  columns
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  export default function WelcomeGuideImage({
3
3
  nonAnimatedSrc,
4
4
  animatedSrc
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * Internal dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -3,8 +3,8 @@
3
3
  */
4
4
  import { useMemo } from '@wordpress/element';
5
5
  import { useDispatch, useSelect } from '@wordpress/data';
6
- import { __ } from '@wordpress/i18n';
7
- import { trash, backup, help, styles, external, brush } from '@wordpress/icons';
6
+ import { __, isRTL } from '@wordpress/i18n';
7
+ import { rotateLeft, rotateRight, backup, help, styles, external, brush } from '@wordpress/icons';
8
8
  import { useCommandLoader, useCommand } from '@wordpress/commands';
9
9
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
10
10
  import { privateApis as routerPrivateApis } from '@wordpress/router';
@@ -136,8 +136,8 @@ function useGlobalStylesResetCommands() {
136
136
  }
137
137
  return [{
138
138
  name: 'core/edit-site/reset-global-styles',
139
- label: __('Reset styles to defaults'),
140
- icon: trash,
139
+ label: __('Reset styles'),
140
+ icon: isRTL() ? rotateRight : rotateLeft,
141
141
  callback: ({
142
142
  close
143
143
  }) => {
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useDispatch","useSelect","__","trash","backup","help","styles","external","brush","useCommandLoader","useCommand","privateApis","blockEditorPrivateApis","routerPrivateApis","store","preferencesStore","coreStore","useViewportMatch","unlock","editSiteStore","getIsListPage","useGlobalStylesReset","useHistory","useLocation","useGlobalStylesOpenStylesCommands","openGeneralSidebar","setCanvasMode","params","isMobileViewport","isEditorPage","getCanvasMode","history","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","commands","name","label","callback","close","push","path","canvas","icon","isLoading","useGlobalStylesToggleWelcomeGuideCommands","set","setTimeout","useGlobalStylesResetCommands","canReset","onReset","useGlobalStylesOpenCssCommands","setEditorCanvasContainerView","isListPage","canEditCSS","_globalStyles$_links$","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","useGlobalStylesOpenRevisionsCommands","hasRevisions","getCurrentThemeGlobalStylesRevisions","length","useCommonCommands","homeUrl","getUnstableBase","home","window","open","hook"],"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { trash, backup, help, styles, external, brush } from '@wordpress/icons';\nimport { useCommandLoader, useCommand } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport getIsListPage from '../../utils/get-is-list-page';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nfunction useGlobalStylesOpenStylesCommands() {\n\tconst { openGeneralSidebar, setCanvasMode } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isEditorPage = ! getIsListPage( params, isMobileViewport );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst history = useHistory();\n\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! isBlockBasedTheme ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\tlabel: __( 'Open styles' ),\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t},\n\t\t\t\ticon: styles,\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetCanvasMode,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tisBlockBasedTheme,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesToggleWelcomeGuideCommands() {\n\tconst { openGeneralSidebar, setCanvasMode } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isEditorPage = ! getIsListPage( params, isMobileViewport );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst { set } = useDispatch( preferencesStore );\n\n\tconst history = useHistory();\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! isBlockBasedTheme ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\t\t\tlabel: __( 'Learn about styles' ),\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t}, 500 );\n\t\t\t\t},\n\t\t\t\ticon: help,\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetCanvasMode,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tisBlockBasedTheme,\n\t\tset,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesResetCommands() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst commands = useMemo( () => {\n\t\tif ( ! canReset ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\tlabel: __( 'Reset styles to defaults' ),\n\t\t\t\ticon: trash,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tonReset();\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [ canReset, onReset ] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenCssCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView, setCanvasMode } =\n\t\tunlock( useDispatch( editSiteStore ) );\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isListPage = getIsListPage( params, isMobileViewport );\n\tconst isEditorPage = ! isListPage;\n\tconst history = useHistory();\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! canEditCSS ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles-css',\n\t\t\t\tlabel: __( 'Customize CSS' ),\n\t\t\t\ticon: brush,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tcanEditCSS,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tsetCanvasMode,\n\t] );\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenRevisionsCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView, setCanvasMode } =\n\t\tunlock( useDispatch( editSiteStore ) );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isEditorPage = ! getIsListPage( params, isMobileViewport );\n\tconst history = useHistory();\n\tconst hasRevisions = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getCurrentThemeGlobalStylesRevisions()?.length,\n\t\t[]\n\t);\n\tconst commands = useMemo( () => {\n\t\tif ( ! hasRevisions ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-global-styles-revisions',\n\t\t\t\tlabel: __( 'Style revisions' ),\n\t\t\t\ticon: backup,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thasRevisions,\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tsetCanvasMode,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useCommonCommands() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\n\t\treturn getUnstableBase()?.home;\n\t}, [] );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/view-site',\n\t\tlabel: __( 'View site' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\twindow.open( homeUrl, '_blank' );\n\t\t},\n\t\ticon: external,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles',\n\t\thook: useGlobalStylesOpenStylesCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\thook: useGlobalStylesToggleWelcomeGuideCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: useGlobalStylesResetCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-css',\n\t\thook: useGlobalStylesOpenCssCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-revisions',\n\t\thook: useGlobalStylesOpenRevisionsCommands,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,kBAAkB;AAC/E,SAASC,gBAAgB,EAAEC,UAAU,QAAQ,qBAAqB;AAClE,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASD,WAAW,IAAIE,iBAAiB,QAA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,OAAO,GAAGnE,SAAS,CAAIgC,MAAM,IAAM;IACxC,MAAM;MACLoC,eAAe,CAAE;IAClB,CAAC,GAAGpC,MAAM,CAAEjB,SAAU,CAAC;IAEvB,OAAOqD,eAAe,CAAC,CAAC,EAAEC,IAAI;EAC/B,CAAC,EAAE,EAAG,CAAC;EAEP5D,UAAU,CAAE;IACX2B,IAAI,EAAE,0BAA0B;IAChCC,KAAK,EAAEpC,EAAE,CAAE,WAAY,CAAC;IACxBqC,QAAQ,EAAEA,CAAE;MAAEC;IAAM,CAAC,KAAM;MAC1BA,KAAK,CAAC,CAAC;MACP+B,MAAM,CAACC,IAAI,CAAEJ,OAAO,EAAE,QAAS,CAAC;IACjC,CAAC;IACDxB,IAAI,EAAErC;EACP,CAAE,CAAC;EAEHE,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,4BAA4B;IAClCoC,IAAI,EAAEjD;EACP,CAAE,CAAC;EAEHf,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,4CAA4C;IAClDoC,IAAI,EAAE3B;EACP,CAAE,CAAC;EAEHrC,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,oCAAoC;IAC1CoC,IAAI,EAAExB;EACP,CAAE,CAAC;EAEHxC,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,gCAAgC;IACtCoC,IAAI,EAAErB;EACP,CAAE,CAAC;EAEH3C,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,sCAAsC;IAC5CoC,IAAI,EAAEV;EACP,CAAE,CAAC;AACJ"}
1
+ {"version":3,"names":["useMemo","useDispatch","useSelect","__","isRTL","rotateLeft","rotateRight","backup","help","styles","external","brush","useCommandLoader","useCommand","privateApis","blockEditorPrivateApis","routerPrivateApis","store","preferencesStore","coreStore","useViewportMatch","unlock","editSiteStore","getIsListPage","useGlobalStylesReset","useHistory","useLocation","useGlobalStylesOpenStylesCommands","openGeneralSidebar","setCanvasMode","params","isMobileViewport","isEditorPage","getCanvasMode","history","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","commands","name","label","callback","close","push","path","canvas","icon","isLoading","useGlobalStylesToggleWelcomeGuideCommands","set","setTimeout","useGlobalStylesResetCommands","canReset","onReset","useGlobalStylesOpenCssCommands","setEditorCanvasContainerView","isListPage","canEditCSS","_globalStyles$_links$","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","useGlobalStylesOpenRevisionsCommands","hasRevisions","getCurrentThemeGlobalStylesRevisions","length","useCommonCommands","homeUrl","getUnstableBase","home","window","open","hook"],"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\trotateLeft,\n\trotateRight,\n\tbackup,\n\thelp,\n\tstyles,\n\texternal,\n\tbrush,\n} from '@wordpress/icons';\nimport { useCommandLoader, useCommand } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport getIsListPage from '../../utils/get-is-list-page';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nfunction useGlobalStylesOpenStylesCommands() {\n\tconst { openGeneralSidebar, setCanvasMode } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isEditorPage = ! getIsListPage( params, isMobileViewport );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst history = useHistory();\n\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! isBlockBasedTheme ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\tlabel: __( 'Open styles' ),\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t},\n\t\t\t\ticon: styles,\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetCanvasMode,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tisBlockBasedTheme,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesToggleWelcomeGuideCommands() {\n\tconst { openGeneralSidebar, setCanvasMode } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isEditorPage = ! getIsListPage( params, isMobileViewport );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst { set } = useDispatch( preferencesStore );\n\n\tconst history = useHistory();\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! isBlockBasedTheme ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\t\t\tlabel: __( 'Learn about styles' ),\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t}, 500 );\n\t\t\t\t},\n\t\t\t\ticon: help,\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetCanvasMode,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tisBlockBasedTheme,\n\t\tset,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesResetCommands() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst commands = useMemo( () => {\n\t\tif ( ! canReset ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\tlabel: __( 'Reset styles' ),\n\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tonReset();\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [ canReset, onReset ] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenCssCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView, setCanvasMode } =\n\t\tunlock( useDispatch( editSiteStore ) );\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isListPage = getIsListPage( params, isMobileViewport );\n\tconst isEditorPage = ! isListPage;\n\tconst history = useHistory();\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! canEditCSS ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles-css',\n\t\t\t\tlabel: __( 'Customize CSS' ),\n\t\t\t\ticon: brush,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tcanEditCSS,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tsetCanvasMode,\n\t] );\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenRevisionsCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView, setCanvasMode } =\n\t\tunlock( useDispatch( editSiteStore ) );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isEditorPage = ! getIsListPage( params, isMobileViewport );\n\tconst history = useHistory();\n\tconst hasRevisions = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getCurrentThemeGlobalStylesRevisions()?.length,\n\t\t[]\n\t);\n\tconst commands = useMemo( () => {\n\t\tif ( ! hasRevisions ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-global-styles-revisions',\n\t\t\t\tlabel: __( 'Style revisions' ),\n\t\t\t\ticon: backup,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thasRevisions,\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tsetCanvasMode,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useCommonCommands() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\n\t\treturn getUnstableBase()?.home;\n\t}, [] );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/view-site',\n\t\tlabel: __( 'View site' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\twindow.open( homeUrl, '_blank' );\n\t\t},\n\t\ticon: external,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles',\n\t\thook: useGlobalStylesOpenStylesCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\thook: useGlobalStylesToggleWelcomeGuideCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: useGlobalStylesResetCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-css',\n\t\thook: useGlobalStylesOpenCssCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-revisions',\n\t\thook: useGlobalStylesOpenRevisionsCommands,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SACCC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,QAAQ,EACRC,KAAK,QACC,kBAAkB;AACzB,SAASC,gBAAgB,EAAEC,UAAU,QAAQ,qBAAqB;AAClE,SAASC,WAAW,IAAIC,sBAAsB,QAA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AS,EAAE,KAAK;IAChBT;EACD,CAAC;AACF;AAEA,OAAO,SAAS+B,iBAAiBA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGrE,SAAS,CAAIkC,MAAM,IAAM;IACxC,MAAM;MACLoC,eAAe,CAAE;IAClB,CAAC,GAAGpC,MAAM,CAAEjB,SAAU,CAAC;IAEvB,OAAOqD,eAAe,CAAC,CAAC,EAAEC,IAAI;EAC/B,CAAC,EAAE,EAAG,CAAC;EAEP5D,UAAU,CAAE;IACX2B,IAAI,EAAE,0BAA0B;IAChCC,KAAK,EAAEtC,EAAE,CAAE,WAAY,CAAC;IACxBuC,QAAQ,EAAEA,CAAE;MAAEC;IAAM,CAAC,KAAM;MAC1BA,KAAK,CAAC,CAAC;MACP+B,MAAM,CAACC,IAAI,CAAEJ,OAAO,EAAE,QAAS,CAAC;IACjC,CAAC;IACDxB,IAAI,EAAErC;EACP,CAAE,CAAC;EAEHE,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,4BAA4B;IAClCoC,IAAI,EAAEjD;EACP,CAAE,CAAC;EAEHf,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,4CAA4C;IAClDoC,IAAI,EAAE3B;EACP,CAAE,CAAC;EAEHrC,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,oCAAoC;IAC1CoC,IAAI,EAAExB;EACP,CAAE,CAAC;EAEHxC,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,gCAAgC;IACtCoC,IAAI,EAAErB;EACP,CAAE,CAAC;EAEH3C,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,sCAAsC;IAC5CoC,IAAI,EAAEV;EACP,CAAE,CAAC;AACJ"}
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -5,5 +5,5 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
5
5
  export const {
6
6
  lock,
7
7
  unlock
8
- } = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/edit-site');
8
+ } = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/edit-site');
9
9
  //# sourceMappingURL=lock-unlock.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/edit-site/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/edit-site'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,iHAAiH,EACjH,sBACD,CAAC"}
1
+ {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/edit-site/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/edit-site'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,8GAA8G,EAC9G,sBACD,CAAC"}
@@ -259,13 +259,14 @@ export function isSaveViewOpened(state) {
259
259
  * @param {Object} state Global application state.
260
260
  * @return {Array} Template parts and their blocks in an array.
261
261
  */
262
- export const getCurrentTemplateTemplateParts = createRegistrySelector(select => () => {
262
+ export const getCurrentTemplateTemplateParts = createRegistrySelector(select => state => {
263
+ const templateType = getEditedPostType(state);
264
+ const templateId = getEditedPostId(state);
265
+ const template = select(coreDataStore).getEditedEntityRecord('postType', templateType, templateId);
263
266
  const templateParts = select(coreDataStore).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, {
264
267
  per_page: -1
265
268
  });
266
- const clientIds = select(blockEditorStore).__experimentalGetGlobalBlocksByName('core/template-part');
267
- const blocks = select(blockEditorStore).getBlocksByClientId(clientIds);
268
- return getFilteredTemplatePartBlocks(blocks, templateParts);
269
+ return getFilteredTemplatePartBlocks(template.blocks, templateParts);
269
270
  });
270
271
 
271
272
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","Platform","preferencesStore","blockEditorStore","getFilteredTemplatePartBlocks","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","__unstableGetPreference","select","state","name","get","isFeatureActive","featureName","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","hasPageContentFocus","postContentClientId","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateParts","clientIds","blocks","getBlocksByClientId","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../utils/constants';\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Helper for getting a preference from the preferences store.\n *\n * This is only present so that `getSettings` doesn't need to be made a\n * registry selector.\n *\n * It's unstable because the selector needs to be exported and so part of the\n * public API to work.\n */\nexport const __unstableGetPreference = createRegistrySelector(\n\t( select ) => ( state, name ) =>\n\t\tselect( preferencesStore ).get( 'core/edit-site', name )\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, featureName ) {\n\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\treturn !! __unstableGetPreference( state, featureName );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: !! __unstableGetPreference( state, 'focusMode' ),\n\t\t\tisDistractionFree: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasFixedToolbar: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tshowIconLabels: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\tTEMPLATE_POST_TYPE === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\t__unstableGetPreference( state, 'focusMode' ),\n\t\t__unstableGetPreference( state, 'distractionFree' ),\n\t\t__unstableGetPreference( state, 'fixedToolbar' ),\n\t\t__unstableGetPreference( state, 'keepCaretInsideBlock' ),\n\t\t__unstableGetPreference( state, 'showIconLabels' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif ( hasPageContentFocus( state ) ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\tconst clientIds =\n\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t'core/template-part'\n\t\t\t);\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn __unstableGetPreference( state, 'editorMode' );\n}\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Whether or not the editor has a page loaded into it.\n *\n * @see setPage\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor has a page loaded into it.\n */\nexport function isPage( state ) {\n\treturn !! state.editedPost.context?.postId;\n}\n\n/**\n * Whether or not the editor allows only page content to be edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus( state ) {\n\treturn isPage( state ) ? state.hasPageContentFocus : false;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAc,MAAM,QAAQ;;AAEnC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;AAClE,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASC,6BAA6B,QAAQ,SAAS;AACvD,SACCC,kBAAkB,EAClBC,uBAAuB,QACjB,oBAAoB;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGT,sBAAsB,CAC1DU,MAAM,IAAM,CAAEC,KAAK,EAAEC,IAAI,KAC1BF,MAAM,CAAEN,gBAAiB,CAAC,CAACS,GAAG,CAAE,gBAAgB,EAAED,IAAK,CACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,eAAeA,CAAEH,KAAK,EAAEI,WAAW,EAAG;EACrDd,UAAU,CAAG,4CAA2C,EAAE;IACzDe,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;EAEH,OAAO,CAAC,CAAER,uBAAuB,CAAEE,KAAK,EAAEI,WAAY,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,kCAAkCA,CAAEP,KAAK,EAAG;EAC3D,OAAOA,KAAK,CAACQ,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;A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G;EACpC7E,UAAU,CAAE,iDAAiD,EAAE;IAC9De,KAAK,EAAE,KAAK;IACZgC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS+B,MAAMA,CAAEpE,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAACsC,UAAU,CAACK,OAAO,EAAE0B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASlB,mBAAmBA,CAAEnD,KAAK,EAAG;EAC5C,OAAOoE,MAAM,CAAEpE,KAAM,CAAC,GAAGA,KAAK,CAACmD,mBAAmB,GAAG,KAAK;AAC3D"}
1
+ {"version":3,"names":["createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","Platform","preferencesStore","blockEditorStore","getFilteredTemplatePartBlocks","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","__unstableGetPreference","select","state","name","get","isFeatureActive","featureName","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","hasPageContentFocus","postContentClientId","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateType","templateId","template","getEditedEntityRecord","templateParts","blocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../utils/constants';\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Helper for getting a preference from the preferences store.\n *\n * This is only present so that `getSettings` doesn't need to be made a\n * registry selector.\n *\n * It's unstable because the selector needs to be exported and so part of the\n * public API to work.\n */\nexport const __unstableGetPreference = createRegistrySelector(\n\t( select ) => ( state, name ) =>\n\t\tselect( preferencesStore ).get( 'core/edit-site', name )\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, featureName ) {\n\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\treturn !! __unstableGetPreference( state, featureName );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: !! __unstableGetPreference( state, 'focusMode' ),\n\t\t\tisDistractionFree: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasFixedToolbar: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tshowIconLabels: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\tTEMPLATE_POST_TYPE === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\t__unstableGetPreference( state, 'focusMode' ),\n\t\t__unstableGetPreference( state, 'distractionFree' ),\n\t\t__unstableGetPreference( state, 'fixedToolbar' ),\n\t\t__unstableGetPreference( state, 'keepCaretInsideBlock' ),\n\t\t__unstableGetPreference( state, 'showIconLabels' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif ( hasPageContentFocus( state ) ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\ttemplateType,\n\t\t\ttemplateId\n\t\t);\n\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\treturn getFilteredTemplatePartBlocks( template.blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn __unstableGetPreference( state, 'editorMode' );\n}\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Whether or not the editor has a page loaded into it.\n *\n * @see setPage\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor has a page loaded into it.\n */\nexport function isPage( state ) {\n\treturn !! state.editedPost.context?.postId;\n}\n\n/**\n * Whether or not the editor allows only page content to be edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus( state ) {\n\treturn isPage( state ) ? state.hasPageContentFocus : false;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAc,MAAM,QAAQ;;AAEnC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASL,KAAK,IAAIM,gBAAgB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CAAEnD,KAAK,EAAG;EAC5C,OAAOsE,MAAM,CAAEtE,KAAM,CAAC,GAAGA,KAAK,CAACmD,mBAAmB,GAAG,KAAK;AAC3D"}
@@ -14,7 +14,7 @@ export default function getIsListPage({
14
14
  categoryType,
15
15
  categoryId
16
16
  }, isMobileViewport) {
17
- return path === '/wp_template/all' || path === '/wp_template_part/all' || path === '/patterns' && (
17
+ return ['/wp_template/all', '/wp_template_part/all', '/pages'].includes(path) || path === '/patterns' && (
18
18
  // Don't treat "/patterns" without categoryType and categoryId as a
19
19
  // list page in mobile because the sidebar covers the whole page.
20
20
  !isMobileViewport || !!categoryType && !!categoryId);
@@ -1 +1 @@
1
- {"version":3,"names":["getIsListPage","path","categoryType","categoryId","isMobileViewport"],"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n * @param {string} [params.categoryType] The current category type.\n * @param {string} [params.categoryId] The current category id.\n * @param {boolean} isMobileViewport Is mobile viewport.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage(\n\t{ path, categoryType, categoryId },\n\tisMobileViewport\n) {\n\treturn (\n\t\tpath === '/wp_template/all' ||\n\t\tpath === '/wp_template_part/all' ||\n\t\t( path === '/patterns' &&\n\t\t\t// Don't treat \"/patterns\" without categoryType and categoryId as a\n\t\t\t// list page in mobile because the sidebar covers the whole page.\n\t\t\t( ! isMobileViewport || ( !! categoryType && !! categoryId ) ) )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,aAAaA,CACpC;EAAEC,IAAI;EAAEC,YAAY;EAAEC;AAAW,CAAC,EAClCC,gBAAgB,EACf;EACD,OACCH,IAAI,KAAK,kBAAkB,IAC3BA,IAAI,KAAK,uBAAuB,IAC9BA,IAAI,KAAK,WAAW;EACrB;EACA;EACE,CAAEG,gBAAgB,IAAM,CAAC,CAAEF,YAAY,IAAI,CAAC,CAAEC,UAAY,CAAI;AAEnE"}
1
+ {"version":3,"names":["getIsListPage","path","categoryType","categoryId","isMobileViewport","includes"],"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n * @param {string} [params.categoryType] The current category type.\n * @param {string} [params.categoryId] The current category id.\n * @param {boolean} isMobileViewport Is mobile viewport.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage(\n\t{ path, categoryType, categoryId },\n\tisMobileViewport\n) {\n\treturn (\n\t\t[ '/wp_template/all', '/wp_template_part/all', '/pages' ].includes(\n\t\t\tpath\n\t\t) ||\n\t\t( path === '/patterns' &&\n\t\t\t// Don't treat \"/patterns\" without categoryType and categoryId as a\n\t\t\t// list page in mobile because the sidebar covers the whole page.\n\t\t\t( ! isMobileViewport || ( !! categoryType && !! categoryId ) ) )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,aAAaA,CACpC;EAAEC,IAAI;EAAEC,YAAY;EAAEC;AAAW,CAAC,EAClCC,gBAAgB,EACf;EACD,OACC,CAAE,kBAAkB,EAAE,uBAAuB,EAAE,QAAQ,CAAE,CAACC,QAAQ,CACjEJ,IACD,CAAC,IACCA,IAAI,KAAK,WAAW;EACrB;EACA;EACE,CAAEG,gBAAgB,IAAM,CAAC,CAAEF,YAAY,IAAI,CAAC,CAAEC,UAAY,CAAI;AAEnE"}