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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (687) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +65 -4
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-template/index.js +3 -2
  5. package/build/components/add-new-template/index.js.map +1 -1
  6. package/build/components/add-new-template/new-template.js +6 -1
  7. package/build/components/add-new-template/new-template.js.map +1 -1
  8. package/build/components/add-new-template/utils.js +6 -1
  9. package/build/components/add-new-template/utils.js.map +1 -1
  10. package/build/components/app/index.js +2 -7
  11. package/build/components/app/index.js.map +1 -1
  12. package/build/components/block-editor/back-button.js +3 -2
  13. package/build/components/block-editor/back-button.js.map +1 -1
  14. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +73 -0
  15. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -0
  16. package/build/components/block-editor/block-editor-provider/index.js +31 -0
  17. package/build/components/block-editor/block-editor-provider/index.js.map +1 -0
  18. package/build/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  19. package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -0
  20. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +76 -0
  21. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -0
  22. package/build/components/block-editor/editor-canvas.js +20 -16
  23. package/build/components/block-editor/editor-canvas.js.map +1 -1
  24. package/build/components/block-editor/index.js +2 -9
  25. package/build/components/block-editor/index.js.map +1 -1
  26. package/build/components/block-editor/site-editor-canvas.js +2 -4
  27. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  28. package/build/components/block-editor/use-site-editor-settings.js +8 -4
  29. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  30. package/build/components/canvas-loader/index.js +18 -1
  31. package/build/components/canvas-loader/index.js.map +1 -1
  32. package/build/components/create-template-part-modal/index.js +8 -12
  33. package/build/components/create-template-part-modal/index.js.map +1 -1
  34. package/build/components/editor/index.js +7 -9
  35. package/build/components/editor/index.js.map +1 -1
  36. package/build/components/global-styles/dimensions-panel.js +5 -4
  37. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  38. package/build/components/global-styles/font-families.js +68 -0
  39. package/build/components/global-styles/font-families.js.map +1 -0
  40. package/build/components/global-styles/font-family-item.js +47 -0
  41. package/build/components/global-styles/font-family-item.js.map +1 -0
  42. package/build/components/global-styles/font-library-modal/collection-font-details.js +49 -0
  43. package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -0
  44. package/build/components/global-styles/font-library-modal/collection-font-variant.js +55 -0
  45. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -0
  46. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +31 -0
  47. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
  48. package/build/components/global-styles/font-library-modal/context.js +309 -0
  49. package/build/components/global-styles/font-library-modal/context.js.map +1 -0
  50. package/build/components/global-styles/font-library-modal/font-card.js +61 -0
  51. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -0
  52. package/build/components/global-styles/font-library-modal/font-collection.js +172 -0
  53. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -0
  54. package/build/components/global-styles/font-library-modal/font-demo.js +86 -0
  55. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -0
  56. package/build/components/global-styles/font-library-modal/font-variant.js +51 -0
  57. package/build/components/global-styles/font-library-modal/font-variant.js.map +1 -0
  58. package/build/components/global-styles/font-library-modal/fonts-grid.js +54 -0
  59. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
  60. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +41 -0
  61. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -0
  62. package/build/components/global-styles/font-library-modal/index.js +65 -0
  63. package/build/components/global-styles/font-library-modal/index.js.map +1 -0
  64. package/build/components/global-styles/font-library-modal/installed-fonts.js +128 -0
  65. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
  66. package/build/components/global-styles/font-library-modal/library-font-card.js +39 -0
  67. package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
  68. package/build/components/global-styles/font-library-modal/library-font-details.js +44 -0
  69. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
  70. package/build/components/global-styles/font-library-modal/library-font-variant.js +59 -0
  71. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
  72. package/build/components/global-styles/font-library-modal/local-fonts.js +143 -0
  73. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
  74. package/build/components/global-styles/font-library-modal/resolvers.js +53 -0
  75. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -0
  76. package/build/components/global-styles/font-library-modal/tab-layout.js +45 -0
  77. package/build/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
  78. package/build/components/global-styles/font-library-modal/utils/constants.js +31 -0
  79. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
  80. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +21 -0
  81. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -0
  82. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +20 -0
  83. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -0
  84. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
  85. package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
  86. package/build/components/global-styles/font-library-modal/utils/index.js +155 -0
  87. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -0
  88. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +22 -0
  89. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
  90. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +76 -0
  91. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -0
  92. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +36 -0
  93. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -0
  94. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +92 -0
  95. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
  96. package/build/components/global-styles/global-styles-provider.js +7 -12
  97. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  98. package/build/components/global-styles/screen-block.js +34 -21
  99. package/build/components/global-styles/screen-block.js.map +1 -1
  100. package/build/components/global-styles/screen-revisions/index.js +1 -3
  101. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  102. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  103. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  104. package/build/components/global-styles/screen-typography.js +4 -72
  105. package/build/components/global-styles/screen-typography.js.map +1 -1
  106. package/build/components/global-styles/style-variations-container.js +3 -5
  107. package/build/components/global-styles/style-variations-container.js.map +1 -1
  108. package/build/components/global-styles/typogrphy-elements.js +96 -0
  109. package/build/components/global-styles/typogrphy-elements.js.map +1 -0
  110. package/build/components/header-edit-mode/document-actions/index.js +9 -8
  111. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  112. package/build/components/header-edit-mode/index.js +4 -1
  113. package/build/components/header-edit-mode/index.js.map +1 -1
  114. package/build/components/layout/index.js +5 -1
  115. package/build/components/layout/index.js.map +1 -1
  116. package/build/components/list/added-by.js +13 -8
  117. package/build/components/list/added-by.js.map +1 -1
  118. package/build/components/list/index.js +2 -1
  119. package/build/components/list/index.js.map +1 -1
  120. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -3
  121. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  122. package/build/components/page-patterns/duplicate-menu-item.js +56 -20
  123. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  124. package/build/components/page-patterns/grid-item.js +48 -22
  125. package/build/components/page-patterns/grid-item.js.map +1 -1
  126. package/build/components/page-patterns/header.js +3 -7
  127. package/build/components/page-patterns/header.js.map +1 -1
  128. package/build/components/page-patterns/index.js +3 -3
  129. package/build/components/page-patterns/index.js.map +1 -1
  130. package/build/components/page-patterns/patterns-list.js +7 -7
  131. package/build/components/page-patterns/patterns-list.js.map +1 -1
  132. package/build/components/page-patterns/rename-menu-item.js +6 -5
  133. package/build/components/page-patterns/rename-menu-item.js.map +1 -1
  134. package/build/components/page-patterns/search-items.js +8 -2
  135. package/build/components/page-patterns/search-items.js.map +1 -1
  136. package/build/components/page-patterns/use-patterns.js +71 -51
  137. package/build/components/page-patterns/use-patterns.js.map +1 -1
  138. package/build/components/page-patterns/utils.js +1 -20
  139. package/build/components/page-patterns/utils.js.map +1 -1
  140. package/build/components/page-template-parts/add-new-template-part.js +3 -2
  141. package/build/components/page-template-parts/add-new-template-part.js.map +1 -1
  142. package/build/components/page-template-parts/index.js +2 -1
  143. package/build/components/page-template-parts/index.js.map +1 -1
  144. package/build/components/page-templates/index.js +3 -2
  145. package/build/components/page-templates/index.js.map +1 -1
  146. package/build/components/save-hub/index.js +2 -1
  147. package/build/components/save-hub/index.js.map +1 -1
  148. package/build/components/secondary-sidebar/list-view-sidebar.js +24 -17
  149. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  150. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +53 -26
  151. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  152. package/build/components/sidebar-edit-mode/page-panels/hooks.js +65 -0
  153. package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
  154. package/build/components/sidebar-edit-mode/page-panels/index.js +1 -4
  155. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  156. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
  157. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  158. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +56 -0
  159. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
  160. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +91 -0
  161. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
  162. package/build/components/sidebar-edit-mode/settings-header/index.js +2 -6
  163. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  164. package/build/components/sidebar-edit-mode/template-panel/index.js +11 -9
  165. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  166. package/build/components/sidebar-edit-mode/template-panel/last-revision.js +6 -4
  167. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
  168. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +218 -0
  169. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
  170. package/build/components/sidebar-navigation-screen/index.js +6 -4
  171. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  172. package/build/components/sidebar-navigation-screen-details-footer/index.js +32 -4
  173. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  174. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
  175. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  176. package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -31
  177. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  178. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  179. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  180. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -1
  181. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  182. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  183. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  184. package/build/components/sidebar-navigation-screen-page/index.js +3 -3
  185. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  186. package/build/components/sidebar-navigation-screen-page/page-details.js +2 -1
  187. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  188. package/build/components/sidebar-navigation-screen-pages/index.js +5 -4
  189. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  190. package/build/components/sidebar-navigation-screen-pattern/index.js +20 -9
  191. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  192. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -2
  193. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  194. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
  195. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  196. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  197. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  198. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +41 -11
  199. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  200. package/build/components/sidebar-navigation-screen-patterns/index.js +9 -37
  201. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  202. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +44 -5
  203. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  204. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +7 -2
  205. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  206. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
  207. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  208. package/build/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  209. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  210. package/build/components/sidebar-navigation-screen-template/index.js +2 -2
  211. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  212. package/build/components/sidebar-navigation-screen-templates/index.js +5 -4
  213. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  214. package/build/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
  215. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  216. package/build/components/start-template-options/index.js +20 -2
  217. package/build/components/start-template-options/index.js.map +1 -1
  218. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -4
  219. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  220. package/build/components/sync-state-with-url/use-sync-path-with-url.js +4 -3
  221. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  222. package/build/components/template-actions/index.js +8 -4
  223. package/build/components/template-actions/index.js.map +1 -1
  224. package/build/components/template-actions/rename-menu-item.js +9 -3
  225. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  226. package/build/components/welcome-guide/styles.js +2 -2
  227. package/build/components/welcome-guide/styles.js.map +1 -1
  228. package/build/hooks/commands/use-edit-mode-commands.js +4 -3
  229. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  230. package/build/hooks/navigation-menu-edit.js +2 -1
  231. package/build/hooks/navigation-menu-edit.js.map +1 -1
  232. package/build/hooks/push-changes-to-global-styles/index.js +5 -37
  233. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  234. package/build/hooks/template-part-edit.js +2 -1
  235. package/build/hooks/template-part-edit.js.map +1 -1
  236. package/build/store/actions.js +38 -14
  237. package/build/store/actions.js.map +1 -1
  238. package/build/store/constants.js +1 -9
  239. package/build/store/constants.js.map +1 -1
  240. package/build/store/private-actions.js +21 -1
  241. package/build/store/private-actions.js.map +1 -1
  242. package/build/store/private-selectors.js +23 -0
  243. package/build/store/private-selectors.js.map +1 -1
  244. package/build/store/reducer.js +19 -1
  245. package/build/store/reducer.js.map +1 -1
  246. package/build/store/selectors.js +3 -2
  247. package/build/store/selectors.js.map +1 -1
  248. package/build/utils/constants.js +64 -2
  249. package/build/utils/constants.js.map +1 -1
  250. package/build/utils/is-template-removable.js +6 -1
  251. package/build/utils/is-template-removable.js.map +1 -1
  252. package/build/utils/is-template-revertable.js +6 -1
  253. package/build/utils/is-template-revertable.js.map +1 -1
  254. package/build/utils/template-part-create.js +6 -1
  255. package/build/utils/template-part-create.js.map +1 -1
  256. package/build-module/components/add-new-pattern/index.js +69 -8
  257. package/build-module/components/add-new-pattern/index.js.map +1 -1
  258. package/build-module/components/add-new-template/index.js +3 -2
  259. package/build-module/components/add-new-template/index.js.map +1 -1
  260. package/build-module/components/add-new-template/new-template.js +6 -1
  261. package/build-module/components/add-new-template/new-template.js.map +1 -1
  262. package/build-module/components/add-new-template/utils.js +6 -1
  263. package/build-module/components/add-new-template/utils.js.map +1 -1
  264. package/build-module/components/app/index.js +2 -7
  265. package/build-module/components/app/index.js.map +1 -1
  266. package/build-module/components/block-editor/back-button.js +3 -2
  267. package/build-module/components/block-editor/back-button.js.map +1 -1
  268. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +65 -0
  269. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -0
  270. package/build-module/components/block-editor/block-editor-provider/index.js +23 -0
  271. package/build-module/components/block-editor/block-editor-provider/index.js.map +1 -0
  272. package/build-module/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  273. package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -0
  274. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +70 -0
  275. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -0
  276. package/build-module/components/block-editor/editor-canvas.js +21 -17
  277. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  278. package/build-module/components/block-editor/index.js +1 -8
  279. package/build-module/components/block-editor/index.js.map +1 -1
  280. package/build-module/components/block-editor/site-editor-canvas.js +5 -7
  281. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  282. package/build-module/components/block-editor/use-site-editor-settings.js +8 -4
  283. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  284. package/build-module/components/canvas-loader/index.js +18 -1
  285. package/build-module/components/canvas-loader/index.js.map +1 -1
  286. package/build-module/components/create-template-part-modal/index.js +8 -12
  287. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  288. package/build-module/components/editor/index.js +7 -9
  289. package/build-module/components/editor/index.js.map +1 -1
  290. package/build-module/components/global-styles/dimensions-panel.js +5 -4
  291. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  292. package/build-module/components/global-styles/font-families.js +58 -0
  293. package/build-module/components/global-styles/font-families.js.map +1 -0
  294. package/build-module/components/global-styles/font-family-item.js +40 -0
  295. package/build-module/components/global-styles/font-family-item.js.map +1 -0
  296. package/build-module/components/global-styles/font-library-modal/collection-font-details.js +40 -0
  297. package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +1 -0
  298. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +45 -0
  299. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -0
  300. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +23 -0
  301. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
  302. package/build-module/components/global-styles/font-library-modal/context.js +300 -0
  303. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -0
  304. package/build-module/components/global-styles/font-library-modal/font-card.js +52 -0
  305. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -0
  306. package/build-module/components/global-styles/font-library-modal/font-collection.js +164 -0
  307. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -0
  308. package/build-module/components/global-styles/font-library-modal/font-demo.js +79 -0
  309. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -0
  310. package/build-module/components/global-styles/font-library-modal/font-variant.js +42 -0
  311. package/build-module/components/global-styles/font-library-modal/font-variant.js.map +1 -0
  312. package/build-module/components/global-styles/font-library-modal/fonts-grid.js +47 -0
  313. package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
  314. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +33 -0
  315. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -0
  316. package/build-module/components/global-styles/font-library-modal/index.js +57 -0
  317. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -0
  318. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +120 -0
  319. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
  320. package/build-module/components/global-styles/font-library-modal/library-font-card.js +31 -0
  321. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
  322. package/build-module/components/global-styles/font-library-modal/library-font-details.js +35 -0
  323. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
  324. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +50 -0
  325. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
  326. package/build-module/components/global-styles/font-library-modal/local-fonts.js +135 -0
  327. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
  328. package/build-module/components/global-styles/font-library-modal/resolvers.js +42 -0
  329. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -0
  330. package/build-module/components/global-styles/font-library-modal/tab-layout.js +37 -0
  331. package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
  332. package/build-module/components/global-styles/font-library-modal/utils/constants.js +21 -0
  333. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
  334. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +15 -0
  335. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -0
  336. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +13 -0
  337. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -0
  338. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +52 -0
  339. package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
  340. package/build-module/components/global-styles/font-library-modal/utils/index.js +141 -0
  341. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -0
  342. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +16 -0
  343. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
  344. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +68 -0
  345. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -0
  346. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +30 -0
  347. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -0
  348. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +86 -0
  349. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
  350. package/build-module/components/global-styles/global-styles-provider.js +7 -12
  351. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  352. package/build-module/components/global-styles/screen-block.js +34 -21
  353. package/build-module/components/global-styles/screen-block.js.map +1 -1
  354. package/build-module/components/global-styles/screen-revisions/index.js +1 -3
  355. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  356. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  357. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  358. package/build-module/components/global-styles/screen-typography.js +6 -74
  359. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  360. package/build-module/components/global-styles/style-variations-container.js +3 -5
  361. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  362. package/build-module/components/global-styles/typogrphy-elements.js +87 -0
  363. package/build-module/components/global-styles/typogrphy-elements.js.map +1 -0
  364. package/build-module/components/header-edit-mode/document-actions/index.js +9 -8
  365. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  366. package/build-module/components/header-edit-mode/index.js +4 -1
  367. package/build-module/components/header-edit-mode/index.js.map +1 -1
  368. package/build-module/components/layout/index.js +5 -1
  369. package/build-module/components/layout/index.js.map +1 -1
  370. package/build-module/components/list/added-by.js +13 -8
  371. package/build-module/components/list/added-by.js.map +1 -1
  372. package/build-module/components/list/index.js +2 -1
  373. package/build-module/components/list/index.js.map +1 -1
  374. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -3
  375. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  376. package/build-module/components/page-patterns/duplicate-menu-item.js +55 -20
  377. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
  378. package/build-module/components/page-patterns/grid-item.js +49 -23
  379. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  380. package/build-module/components/page-patterns/header.js +3 -7
  381. package/build-module/components/page-patterns/header.js.map +1 -1
  382. package/build-module/components/page-patterns/index.js +3 -3
  383. package/build-module/components/page-patterns/index.js.map +1 -1
  384. package/build-module/components/page-patterns/patterns-list.js +7 -7
  385. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  386. package/build-module/components/page-patterns/rename-menu-item.js +6 -5
  387. package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
  388. package/build-module/components/page-patterns/search-items.js +8 -2
  389. package/build-module/components/page-patterns/search-items.js.map +1 -1
  390. package/build-module/components/page-patterns/use-patterns.js +71 -52
  391. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  392. package/build-module/components/page-patterns/utils.js +0 -11
  393. package/build-module/components/page-patterns/utils.js.map +1 -1
  394. package/build-module/components/page-template-parts/add-new-template-part.js +3 -2
  395. package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -1
  396. package/build-module/components/page-template-parts/index.js +2 -1
  397. package/build-module/components/page-template-parts/index.js.map +1 -1
  398. package/build-module/components/page-templates/index.js +3 -2
  399. package/build-module/components/page-templates/index.js.map +1 -1
  400. package/build-module/components/save-hub/index.js +2 -1
  401. package/build-module/components/save-hub/index.js.map +1 -1
  402. package/build-module/components/secondary-sidebar/list-view-sidebar.js +26 -19
  403. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  404. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +54 -29
  405. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  406. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +55 -0
  407. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
  408. package/build-module/components/sidebar-edit-mode/page-panels/index.js +1 -4
  409. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  410. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
  411. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  412. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +49 -0
  413. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
  414. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +85 -0
  415. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
  416. package/build-module/components/sidebar-edit-mode/settings-header/index.js +2 -6
  417. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  418. package/build-module/components/sidebar-edit-mode/template-panel/index.js +12 -10
  419. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  420. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +8 -6
  421. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
  422. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +209 -0
  423. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
  424. package/build-module/components/sidebar-navigation-screen/index.js +6 -4
  425. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  426. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +32 -5
  427. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  428. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
  429. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  430. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +6 -33
  431. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  432. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  433. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  434. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
  435. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  436. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  437. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  438. package/build-module/components/sidebar-navigation-screen-page/index.js +3 -3
  439. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  440. package/build-module/components/sidebar-navigation-screen-page/page-details.js +2 -1
  441. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  442. package/build-module/components/sidebar-navigation-screen-pages/index.js +5 -4
  443. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  444. package/build-module/components/sidebar-navigation-screen-pattern/index.js +21 -10
  445. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  446. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -2
  447. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  448. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
  449. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  450. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  451. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  452. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +41 -11
  453. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  454. package/build-module/components/sidebar-navigation-screen-patterns/index.js +12 -40
  455. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  456. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +44 -5
  457. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  458. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +7 -2
  459. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  460. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -2
  461. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  462. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  463. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  464. package/build-module/components/sidebar-navigation-screen-template/index.js +2 -2
  465. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  466. package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -4
  467. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  468. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
  469. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  470. package/build-module/components/start-template-options/index.js +20 -2
  471. package/build-module/components/start-template-options/index.js.map +1 -1
  472. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -4
  473. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  474. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +4 -3
  475. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  476. package/build-module/components/template-actions/index.js +8 -4
  477. package/build-module/components/template-actions/index.js.map +1 -1
  478. package/build-module/components/template-actions/rename-menu-item.js +9 -3
  479. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  480. package/build-module/components/welcome-guide/styles.js +2 -2
  481. package/build-module/components/welcome-guide/styles.js.map +1 -1
  482. package/build-module/hooks/commands/use-edit-mode-commands.js +4 -3
  483. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  484. package/build-module/hooks/navigation-menu-edit.js +2 -1
  485. package/build-module/hooks/navigation-menu-edit.js.map +1 -1
  486. package/build-module/hooks/push-changes-to-global-styles/index.js +5 -37
  487. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  488. package/build-module/hooks/template-part-edit.js +2 -1
  489. package/build-module/hooks/template-part-edit.js.map +1 -1
  490. package/build-module/store/actions.js +39 -16
  491. package/build-module/store/actions.js.map +1 -1
  492. package/build-module/store/constants.js +0 -4
  493. package/build-module/store/constants.js.map +1 -1
  494. package/build-module/store/private-actions.js +19 -0
  495. package/build-module/store/private-actions.js.map +1 -1
  496. package/build-module/store/private-selectors.js +22 -0
  497. package/build-module/store/private-selectors.js.map +1 -1
  498. package/build-module/store/reducer.js +18 -1
  499. package/build-module/store/reducer.js.map +1 -1
  500. package/build-module/store/selectors.js +3 -3
  501. package/build-module/store/selectors.js.map +1 -1
  502. package/build-module/utils/constants.js +51 -1
  503. package/build-module/utils/constants.js.map +1 -1
  504. package/build-module/utils/is-template-removable.js +6 -1
  505. package/build-module/utils/is-template-removable.js.map +1 -1
  506. package/build-module/utils/is-template-revertable.js +6 -1
  507. package/build-module/utils/is-template-revertable.js.map +1 -1
  508. package/build-module/utils/template-part-create.js +6 -1
  509. package/build-module/utils/template-part-create.js.map +1 -1
  510. package/build-style/style-rtl.css +267 -37
  511. package/build-style/style.css +267 -37
  512. package/lib/inflate.js +4082 -0
  513. package/lib/lib-font.browser.js +3831 -0
  514. package/lib/unbrotli.js +2679 -0
  515. package/package.json +40 -40
  516. package/src/components/add-new-pattern/index.js +86 -8
  517. package/src/components/add-new-template/index.js +3 -2
  518. package/src/components/add-new-template/new-template.js +6 -1
  519. package/src/components/add-new-template/utils.js +12 -3
  520. package/src/components/app/index.js +9 -12
  521. package/src/components/block-editor/back-button.js +6 -2
  522. package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +70 -0
  523. package/src/components/block-editor/block-editor-provider/index.js +29 -0
  524. package/src/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  525. package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +87 -0
  526. package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +77 -0
  527. package/src/components/block-editor/editor-canvas.js +31 -19
  528. package/src/components/block-editor/index.js +1 -14
  529. package/src/components/block-editor/site-editor-canvas.js +7 -12
  530. package/src/components/block-editor/style.scss +88 -1
  531. package/src/components/block-editor/use-site-editor-settings.js +26 -19
  532. package/src/components/canvas-loader/index.js +12 -1
  533. package/src/components/canvas-loader/style.scss +1 -1
  534. package/src/components/create-template-part-modal/index.js +11 -12
  535. package/src/components/editor/index.js +9 -10
  536. package/src/components/global-styles/dimensions-panel.js +8 -4
  537. package/src/components/global-styles/font-families.js +71 -0
  538. package/src/components/global-styles/font-family-item.js +44 -0
  539. package/src/components/global-styles/font-library-modal/collection-font-details.js +56 -0
  540. package/src/components/global-styles/font-library-modal/collection-font-variant.js +45 -0
  541. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +33 -0
  542. package/src/components/global-styles/font-library-modal/context.js +378 -0
  543. package/src/components/global-styles/font-library-modal/font-card.js +75 -0
  544. package/src/components/global-styles/font-library-modal/font-collection.js +257 -0
  545. package/src/components/global-styles/font-library-modal/font-demo.js +83 -0
  546. package/src/components/global-styles/font-library-modal/font-variant.js +53 -0
  547. package/src/components/global-styles/font-library-modal/fonts-grid.js +55 -0
  548. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +50 -0
  549. package/src/components/global-styles/font-library-modal/index.js +67 -0
  550. package/src/components/global-styles/font-library-modal/installed-fonts.js +174 -0
  551. package/src/components/global-styles/font-library-modal/library-font-card.js +33 -0
  552. package/src/components/global-styles/font-library-modal/library-font-details.js +45 -0
  553. package/src/components/global-styles/font-library-modal/library-font-variant.js +54 -0
  554. package/src/components/global-styles/font-library-modal/local-fonts.js +160 -0
  555. package/src/components/global-styles/font-library-modal/resolvers.js +45 -0
  556. package/src/components/global-styles/font-library-modal/style.scss +139 -0
  557. package/src/components/global-styles/font-library-modal/tab-layout.js +50 -0
  558. package/src/components/global-styles/font-library-modal/utils/constants.js +23 -0
  559. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +18 -0
  560. package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +21 -0
  561. package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
  562. package/src/components/global-styles/font-library-modal/utils/index.js +153 -0
  563. package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +15 -0
  564. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +86 -0
  565. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +33 -0
  566. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +69 -0
  567. package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +109 -0
  568. package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +53 -0
  569. package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +30 -0
  570. package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +240 -0
  571. package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +31 -0
  572. package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +57 -0
  573. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +62 -0
  574. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +56 -0
  575. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +108 -0
  576. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +161 -0
  577. package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +41 -0
  578. package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +74 -0
  579. package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +141 -0
  580. package/src/components/global-styles/font-library-modal/utils/toggleFont.js +90 -0
  581. package/src/components/global-styles/global-styles-provider.js +2 -7
  582. package/src/components/global-styles/screen-block.js +42 -20
  583. package/src/components/global-styles/screen-revisions/index.js +0 -2
  584. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
  585. package/src/components/global-styles/screen-typography.js +9 -95
  586. package/src/components/global-styles/style-variations-container.js +0 -2
  587. package/src/components/global-styles/typogrphy-elements.js +110 -0
  588. package/src/components/header-edit-mode/document-actions/index.js +17 -8
  589. package/src/components/header-edit-mode/index.js +2 -1
  590. package/src/components/layout/index.js +10 -1
  591. package/src/components/list/added-by.js +29 -11
  592. package/src/components/list/index.js +7 -1
  593. package/src/components/list/style.scss +2 -0
  594. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -8
  595. package/src/components/page-patterns/duplicate-menu-item.js +67 -24
  596. package/src/components/page-patterns/grid-item.js +80 -33
  597. package/src/components/page-patterns/header.js +3 -12
  598. package/src/components/page-patterns/index.js +3 -3
  599. package/src/components/page-patterns/patterns-list.js +7 -7
  600. package/src/components/page-patterns/rename-menu-item.js +18 -7
  601. package/src/components/page-patterns/search-items.js +20 -2
  602. package/src/components/page-patterns/style.scss +1 -5
  603. package/src/components/page-patterns/use-patterns.js +217 -127
  604. package/src/components/page-patterns/utils.js +0 -19
  605. package/src/components/page-template-parts/add-new-template-part.js +5 -2
  606. package/src/components/page-template-parts/index.js +2 -1
  607. package/src/components/page-templates/index.js +3 -2
  608. package/src/components/save-hub/index.js +2 -1
  609. package/src/components/secondary-sidebar/list-view-sidebar.js +31 -26
  610. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +94 -52
  611. package/src/components/sidebar-edit-mode/page-panels/hooks.js +88 -0
  612. package/src/components/sidebar-edit-mode/page-panels/index.js +0 -4
  613. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
  614. package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +44 -0
  615. package/src/components/sidebar-edit-mode/page-panels/style.scss +46 -9
  616. package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +82 -0
  617. package/src/components/sidebar-edit-mode/settings-header/index.js +4 -7
  618. package/src/components/sidebar-edit-mode/template-panel/index.js +28 -24
  619. package/src/components/sidebar-edit-mode/template-panel/last-revision.js +19 -15
  620. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +277 -0
  621. package/src/components/sidebar-navigation-screen/index.js +4 -9
  622. package/src/components/sidebar-navigation-screen/style.scss +7 -1
  623. package/src/components/sidebar-navigation-screen-details-footer/index.js +38 -10
  624. package/src/components/sidebar-navigation-screen-details-footer/style.scss +10 -3
  625. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -0
  626. package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -44
  627. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  628. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
  629. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  630. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
  631. package/src/components/sidebar-navigation-screen-page/index.js +3 -3
  632. package/src/components/sidebar-navigation-screen-page/page-details.js +2 -1
  633. package/src/components/sidebar-navigation-screen-pages/index.js +5 -4
  634. package/src/components/sidebar-navigation-screen-pattern/index.js +22 -8
  635. package/src/components/sidebar-navigation-screen-pattern/style.scss +0 -3
  636. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +8 -2
  637. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +7 -1
  638. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  639. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +63 -20
  640. package/src/components/sidebar-navigation-screen-patterns/index.js +20 -51
  641. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +61 -6
  642. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +12 -2
  643. package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -5
  644. package/src/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  645. package/src/components/sidebar-navigation-screen-template/index.js +2 -4
  646. package/src/components/sidebar-navigation-screen-templates/index.js +5 -4
  647. package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -2
  648. package/src/components/start-template-options/index.js +39 -2
  649. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -4
  650. package/src/components/sync-state-with-url/use-sync-path-with-url.js +8 -3
  651. package/src/components/template-actions/index.js +15 -8
  652. package/src/components/template-actions/rename-menu-item.js +21 -5
  653. package/src/components/welcome-guide/styles.js +2 -2
  654. package/src/hooks/commands/use-edit-mode-commands.js +4 -3
  655. package/src/hooks/navigation-menu-edit.js +2 -1
  656. package/src/hooks/push-changes-to-global-styles/index.js +6 -49
  657. package/src/hooks/template-part-edit.js +2 -1
  658. package/src/store/actions.js +56 -22
  659. package/src/store/constants.js +0 -5
  660. package/src/store/private-actions.js +19 -0
  661. package/src/store/private-selectors.js +22 -0
  662. package/src/store/reducer.js +18 -0
  663. package/src/store/selectors.js +6 -3
  664. package/src/store/test/reducer.js +18 -0
  665. package/src/style.scss +1 -1
  666. package/src/utils/constants.js +54 -3
  667. package/src/utils/is-template-removable.js +8 -1
  668. package/src/utils/is-template-revertable.js +8 -1
  669. package/src/utils/template-part-create.js +6 -1
  670. package/build/components/block-editor/get-block-editor-provider.js +0 -35
  671. package/build/components/block-editor/get-block-editor-provider.js.map +0 -1
  672. package/build/components/block-editor/providers/default-block-editor-provider.js +0 -49
  673. package/build/components/block-editor/providers/default-block-editor-provider.js.map +0 -1
  674. package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +0 -1
  675. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -30
  676. package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
  677. package/build-module/components/block-editor/get-block-editor-provider.js +0 -28
  678. package/build-module/components/block-editor/get-block-editor-provider.js.map +0 -1
  679. package/build-module/components/block-editor/providers/default-block-editor-provider.js +0 -41
  680. package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +0 -1
  681. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +0 -1
  682. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -23
  683. package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
  684. package/src/components/block-editor/get-block-editor-provider.js +0 -29
  685. package/src/components/block-editor/providers/default-block-editor-provider.js +0 -44
  686. package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -12
  687. package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -24
@@ -1 +1 @@
1
- {"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","getPathAndQueryString","__","sprintf","store","noticesStore","coreStore","interfaceStore","blockEditorStore","speak","preferencesStore","decodeEntities","STORE_NAME","editSiteStoreName","isTemplateRevertable","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","templateId","templateSlug","template","resolveSelect","getEntityRecord","slug","error","postType","id","context","addTemplate","newTemplate","saveEntityRecord","content","editEntityRecord","blocks","undoIgnore","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","createSuccessNotice","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","setHomeTemplateId","version","setEditedPostContext","setPage","page","path","entity","link","__experimentalGetTemplateForLink","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","isDistractionFree","get","toggleDistractionFree","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","clearSelectedBlock","setHasPageContentFocus","hasPageContentFocus","batch","createInfoNotice"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs, getPathAndQueryString } from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( \"select( 'core/edit-site' ).toggleFeature( featureName )\", {\n\t\t\tsince: '6.0',\n\t\t\talternative:\n\t\t\t\t\"select( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @param {number} templateId The template ID.\n * @param {string} templateSlug The template slug.\n * @return {Object} Action object.\n */\nexport const setTemplate =\n\t( templateId, templateSlug ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! templateSlug ) {\n\t\t\ttry {\n\t\t\t\tconst template = await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getEntityRecord( 'postType', 'wp_template', templateId );\n\t\t\t\ttemplateSlug = template?.slug;\n\t\t\t} catch ( error ) {}\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: templateId,\n\t\t\tcontext: { templateSlug },\n\t\t} );\n\t};\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: newTemplate.id,\n\t\t\tcontext: { templateSlug: newTemplate.slug },\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate =\n\t( template ) =>\n\tasync ( { registry } ) => {\n\t\ttry {\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.deleteEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} );\n\n\t\t\tconst lastError = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntityDeleteError(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\t// Depending on how the entity was retrieved it's title might be\n\t\t\t// an object or simple string.\n\t\t\tconst templateTitle =\n\t\t\t\ttypeof template.title === 'string'\n\t\t\t\t\t? template.title\n\t\t\t\t\t: template.title?.rendered;\n\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( templateTitle )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'site-editor-template-deleted-success' }\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while deleting the template.' );\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: 'wp_template_part',\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: 'wp_navigation',\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @param {Object} page The page object.\n * @param {string} page.type The page type.\n * @param {string} page.slug The page slug.\n * @param {string} page.path The page path.\n * @param {Object} page.context The page context.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport const setPage =\n\t( page ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! page.path && page.context?.postId ) {\n\t\t\tconst entity = await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpage.context.postType || 'post',\n\t\t\t\t\tpage.context.postId\n\t\t\t\t);\n\t\t\t// If the entity is undefined for some reason, path will resolve to \"/\"\n\t\t\tpage.path = getPathAndQueryString( entity?.link );\n\t\t}\n\n\t\tconst template = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.__experimentalGetTemplateForLink( page.path );\n\n\t\tif ( ! template ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: template.id,\n\t\t\tcontext: {\n\t\t\t\t...page.context,\n\t\t\t\ttemplateSlug: template.slug,\n\t\t\t},\n\t\t} );\n\n\t\treturn template.id;\n\t};\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens or closes the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the list view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the list view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree && isOpen ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\t\tisOpen,\n\t\t} );\n\t};\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core/edit-site', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core/edit-site', 'fixedToolbar', false );\n\t\t\t\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'distractionFree',\n\t\t\t\t\t! isDistractionFree\n\t\t\t\t);\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-site/distraction-free-mode/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;AACtE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,EAAEC,qBAAqB,QAAQ,gBAAgB;AACpE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAI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H,CAAC;IACFhE,QAAQ,CACNG,QAAQ,CAAEf,YAAa,CAAC,CACxB+G,gBAAgB,CAChBnC,iBAAiB,GACd/E,EAAE,CAAE,uBAAwB,CAAC,GAC7BA,EAAE,CAAE,sBAAuB,CAAC,EAC/B;MACCgC,EAAE,EAAE,6CAA6C;MACjDV,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","__","sprintf","store","noticesStore","coreStore","interfaceStore","blockEditorStore","speak","preferencesStore","decodeEntities","STORE_NAME","editSiteStoreName","isTemplateRevertable","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","templateId","templateSlug","template","resolveSelect","getEntityRecord","slug","error","postType","id","context","addTemplate","newTemplate","saveEntityRecord","content","editEntityRecord","blocks","undoIgnore","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","createSuccessNotice","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","setHomeTemplateId","version","setEditedPostContext","setPage","page","getDefaultTemplate","path","__experimentalGetTemplateForLink","editedEntity","getEditedEntityRecord","currentTemplateSlug","currentTemplate","getEntityRecords","per_page","find","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","isDistractionFree","get","toggleDistractionFree","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","serializeBlocks","blocksForSerialization","edited","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","clearSelectedBlock","setHasPageContentFocus","hasPageContentFocus","batch","createInfoNotice"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../utils/constants';\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( \"select( 'core/edit-site' ).toggleFeature( featureName )\", {\n\t\t\tsince: '6.0',\n\t\t\talternative:\n\t\t\t\t\"select( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @param {number} templateId The template ID.\n * @param {string} templateSlug The template slug.\n * @return {Object} Action object.\n */\nexport const setTemplate =\n\t( templateId, templateSlug ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! templateSlug ) {\n\t\t\ttry {\n\t\t\t\tconst template = await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\ttemplateId\n\t\t\t\t\t);\n\t\t\t\ttemplateSlug = template?.slug;\n\t\t\t} catch ( error ) {}\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: templateId,\n\t\t\tcontext: { templateSlug },\n\t\t} );\n\t};\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', TEMPLATE_POST_TYPE, template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: newTemplate.id,\n\t\t\tcontext: { templateSlug: newTemplate.slug },\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate =\n\t( template ) =>\n\tasync ( { registry } ) => {\n\t\ttry {\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.deleteEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} );\n\n\t\t\tconst lastError = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntityDeleteError(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\t// Depending on how the entity was retrieved it's title might be\n\t\t\t// an object or simple string.\n\t\t\tconst templateTitle =\n\t\t\t\ttypeof template.title === 'string'\n\t\t\t\t\t? template.title\n\t\t\t\t\t: template.title?.rendered;\n\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( templateTitle )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'site-editor-template-deleted-success' }\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while deleting the template.' );\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @param {Object} page The page object.\n * @param {string} page.type The page type.\n * @param {string} page.slug The page slug.\n * @param {string} page.path The page path.\n * @param {Object} page.context The page context.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport const setPage =\n\t( page ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tlet template;\n\t\tconst getDefaultTemplate = async ( slug ) =>\n\t\t\tapiFetch( {\n\t\t\t\tpath: addQueryArgs( '/wp/v2/templates/lookup', {\n\t\t\t\t\tslug: `page-${ slug }`,\n\t\t\t\t} ),\n\t\t\t} );\n\n\t\tif ( page.path ) {\n\t\t\ttemplate = await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.__experimentalGetTemplateForLink( page.path );\n\t\t} else {\n\t\t\tconst editedEntity = await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpage.context?.postType || 'post',\n\t\t\t\t\tpage.context?.postId\n\t\t\t\t);\n\t\t\tconst currentTemplateSlug = editedEntity?.template;\n\t\t\tif ( currentTemplateSlug ) {\n\t\t\t\tconst currentTemplate = (\n\t\t\t\t\tawait registry\n\t\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t\t.getEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t} )\n\t\t\t\t)?.find( ( { slug } ) => slug === currentTemplateSlug );\n\t\t\t\tif ( currentTemplate ) {\n\t\t\t\t\ttemplate = currentTemplate;\n\t\t\t\t} else {\n\t\t\t\t\t// If a page has a `template` set and is not included in the list\n\t\t\t\t\t// of the current theme's templates, query for current theme's default template.\n\t\t\t\t\ttemplate = await getDefaultTemplate( editedEntity?.slug );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Page's `template` is empty, that indicates we need to use the default template for the page.\n\t\t\t\ttemplate = await getDefaultTemplate( editedEntity?.slug );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! template ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: template.id,\n\t\t\tcontext: {\n\t\t\t\t...page.context,\n\t\t\t\ttemplateSlug: template.slug,\n\t\t\t},\n\t\t} );\n\n\t\treturn template.id;\n\t};\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens or closes the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the list view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the list view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree && isOpen ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\t\tisOpen,\n\t\t} );\n\t};\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core/edit-site', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core/edit-site', 'fixedToolbar', false );\n\t\t\t\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'distractionFree',\n\t\t\t\t\t! isDistractionFree\n\t\t\t\t);\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-site/distraction-free-mode/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;AACtE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,cAAc,QAAQ,sBAAsB;AAC9D,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,UAAU,IAAIC,iBAAiB,QAAQ,aAAa;AAC7D,OAAOC,oBAAoB,MAAM,iCAAiC;AAClE,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,QACd,oBAAoB;AAC3B;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,WAAW,EAAG;EAC5C,OAAO,UAAW;IAAEC;EAAS,CAAC,EAAG;IAChCpB,UAAU,CAAE,yDAAyD,EAAE;MACtEqB,KAAK,EAAE,KAAK;MACZC,WAAW,EACV;IACF,CAAE,CAAC;IAEHF,QAAQ,CACNG,QAAQ,CAAEb,g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CAAC;IAC/B,CAAE,CAAC;EACJ;EACA/F,QAAQ,CAACuG,KAAK,CAAE,MAAM;IACrBvG,QAAQ,CACNG,QAAQ,CAAEb,gBAAiB,CAAC,CAC5B6G,GAAG,CACH,gBAAgB,EAChB,iBAAiB,EACjB,CAAE7B,iBACH,CAAC;IACFtE,QAAQ,CACNG,QAAQ,CAAElB,YAAa,CAAC,CACxBuH,gBAAgB,CAChBlC,iBAAiB,GACdxF,EAAE,CAAE,uBAAwB,CAAC,GAC7BA,EAAE,CAAE,sBAAuB,CAAC,EAC/B;MACCmC,EAAE,EAAE,6CAA6C;MACjDV,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC"}
@@ -4,8 +4,4 @@
4
4
  * @type {string}
5
5
  */
6
6
  export const STORE_NAME = 'core/edit-site';
7
- export const TEMPLATE_PART_AREA_HEADER = 'header';
8
- export const TEMPLATE_PART_AREA_FOOTER = 'footer';
9
- export const TEMPLATE_PART_AREA_SIDEBAR = 'sidebar';
10
- export const TEMPLATE_PART_AREA_GENERAL = 'uncategorized';
11
7
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["STORE_NAME","TEMPLATE_PART_AREA_HEADER","TEMPLATE_PART_AREA_FOOTER","TEMPLATE_PART_AREA_SIDEBAR","TEMPLATE_PART_AREA_GENERAL"],"sources":["@wordpress/edit-site/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-site';\n\nexport const TEMPLATE_PART_AREA_HEADER = 'header';\nexport const TEMPLATE_PART_AREA_FOOTER = 'footer';\nexport const TEMPLATE_PART_AREA_SIDEBAR = 'sidebar';\nexport const TEMPLATE_PART_AREA_GENERAL = 'uncategorized';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,gBAAgB;AAE1C,OAAO,MAAMC,yBAAyB,GAAG,QAAQ;AACjD,OAAO,MAAMC,yBAAyB,GAAG,QAAQ;AACjD,OAAO,MAAMC,0BAA0B,GAAG,SAAS;AACnD,OAAO,MAAMC,0BAA0B,GAAG,eAAe"}
1
+ {"version":3,"names":["STORE_NAME"],"sources":["@wordpress/edit-site/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-site';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,gBAAgB"}
@@ -43,4 +43,23 @@ export const setEditorCanvasContainerView = view => ({
43
43
  view
44
44
  });
45
45
  };
46
+
47
+ /**
48
+ * Sets the type of page content focus. Can be one of:
49
+ *
50
+ * - `'disableTemplate'`: Disable the blocks belonging to the page's template.
51
+ * - `'hideTemplate'`: Hide the blocks belonging to the page's template.
52
+ *
53
+ * @param {'disableTemplate'|'hideTemplate'} pageContentFocusType The type of page content focus.
54
+ *
55
+ * @return {Object} Action object.
56
+ */
57
+ export const setPageContentFocusType = pageContentFocusType => ({
58
+ dispatch
59
+ }) => {
60
+ dispatch({
61
+ type: 'SET_PAGE_CONTENT_FOCUS_TYPE',
62
+ pageContentFocusType
63
+ });
64
+ };
46
65
  //# sourceMappingURL=private-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["store","blockEditorStore","preferencesStore","setCanvasMode","mode","registry","dispatch","select","__unstableSetEditorMode","type","get","setIsListViewOpened","isPage","setHasPageContentFocus","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch, select } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.setIsListViewOpened( true );\n\t\t}\n\t\t// Switch focus away from editing the template when switching to view mode.\n\t\tif ( mode === 'view' && select.isPage() ) {\n\t\t\tdispatch.setHasPageContentFocus( true );\n\t\t}\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAM;EACrCF,QAAQ,CAACC,QAAQ,CAAEL,gBAAiB,CAAC,CAACO,uBAAuB,CAAE,MAAO,CAAC;EACvEF,QAAQ,CAAE;IACTG,IAAI,EAAE,iBAAiB;IACvBL;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNE,MAAM,CAAEL,gBAAiB,CAAC,CAC1BQ,GAAG,CAAE,gBAAgB,EAAE,uBAAwB,CAAC,IAClD,CAAEL,QAAQ,CACRE,MAAM,CAAEL,gBAAiB,CAAC,CAC1BQ,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC,EAC3C;IACDJ,QAAQ,CAACK,mBAAmB,CAAE,IAAK,CAAC;EACrC;EACA;EACA,IAAKP,IAAI,KAAK,MAAM,IAAIG,MAAM,CAACK,MAAM,CAAC,CAAC,EAAG;IACzCN,QAAQ,CAACO,sBAAsB,CAAE,IAAK,CAAC;EACxC;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAET;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTG,IAAI,EAAE,kCAAkC;IACxCM;EACD,CAAE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"names":["store","blockEditorStore","preferencesStore","setCanvasMode","mode","registry","dispatch","select","__unstableSetEditorMode","type","get","setIsListViewOpened","isPage","setHasPageContentFocus","setEditorCanvasContainerView","view","setPageContentFocusType","pageContentFocusType"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch, select } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.setIsListViewOpened( true );\n\t\t}\n\t\t// Switch focus away from editing the template when switching to view mode.\n\t\tif ( mode === 'view' && select.isPage() ) {\n\t\t\tdispatch.setHasPageContentFocus( true );\n\t\t}\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n\n/**\n * Sets the type of page content focus. Can be one of:\n *\n * - `'disableTemplate'`: Disable the blocks belonging to the page's template.\n * - `'hideTemplate'`: Hide the blocks belonging to the page's template.\n *\n * @param {'disableTemplate'|'hideTemplate'} pageContentFocusType The type of page content focus.\n *\n * @return {Object} Action object.\n */\nexport const setPageContentFocusType =\n\t( pageContentFocusType ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_PAGE_CONTENT_FOCUS_TYPE',\n\t\t\tpageContentFocusType,\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAM;EACrCF,QAAQ,CAACC,QAAQ,CAAEL,gBAAiB,CAAC,CAACO,uBAAuB,CAAE,MAAO,CAAC;EACvEF,QAAQ,CAAE;IACTG,IAAI,EAAE,iBAAiB;IACvBL;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNE,MAAM,CAAEL,gBAAiB,CAAC,CAC1BQ,GAAG,CAAE,gBAAgB,EAAE,uBAAwB,CAAC,IAClD,CAAEL,QAAQ,CACRE,MAAM,CAAEL,gBAAiB,CAAC,CAC1BQ,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC,EAC3C;IACDJ,QAAQ,CAACK,mBAAmB,CAAE,IAAK,CAAC;EACrC;EACA;EACA,IAAKP,IAAI,KAAK,MAAM,IAAIG,MAAM,CAACK,MAAM,CAAC,CAAC,EAAG;IACzCN,QAAQ,CAACO,sBAAsB,CAAE,IAAK,CAAC;EACxC;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAET;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTG,IAAI,EAAE,kCAAkC;IACxCM;EACD,CAAE,CAAC;AACJ,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GACjCC,oBAAoB,IACtB,CAAE;EAAEX;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTG,IAAI,EAAE,6BAA6B;IACnCQ;EACD,CAAE,CAAC;AACJ,CAAC"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { hasPageContentFocus } from './selectors';
5
+
1
6
  /**
2
7
  * Returns the current canvas mode.
3
8
  *
@@ -19,4 +24,21 @@ export function getCanvasMode(state) {
19
24
  export function getEditorCanvasContainerView(state) {
20
25
  return state.editorCanvasContainerView;
21
26
  }
27
+
28
+ /**
29
+ * Returns the type of the current page content focus, or null if there is no
30
+ * page content focus.
31
+ *
32
+ * Possible values are:
33
+ *
34
+ * - `'disableTemplate'`: Disable the blocks belonging to the page's template.
35
+ * - `'hideTemplate'`: Hide the blocks belonging to the page's template.
36
+ *
37
+ * @param {Object} state Global application state.
38
+ *
39
+ * @return {'disableTemplate'|'hideTemplate'|null} Type of the current page content focus.
40
+ */
41
+ export function getPageContentFocusType(state) {
42
+ return hasPageContentFocus(state) ? state.pageContentFocusType : null;
43
+ }
22
44
  //# sourceMappingURL=private-selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getCanvasMode","state","canvasMode","getEditorCanvasContainerView","editorCanvasContainerView"],"sources":["@wordpress/edit-site/src/store/private-selectors.js"],"sourcesContent":["/**\n * Returns the current canvas mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Canvas mode.\n */\nexport function getCanvasMode( state ) {\n\treturn state.canvasMode;\n}\n\n/**\n * Returns the editor canvas container view.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editor canvas container view.\n */\nexport function getEditorCanvasContainerView( state ) {\n\treturn state.editorCanvasContainerView;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAAEC,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACC,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAAEF,KAAK,EAAG;EACrD,OAAOA,KAAK,CAACG,yBAAyB;AACvC"}
1
+ {"version":3,"names":["hasPageContentFocus","getCanvasMode","state","canvasMode","getEditorCanvasContainerView","editorCanvasContainerView","getPageContentFocusType","pageContentFocusType"],"sources":["@wordpress/edit-site/src/store/private-selectors.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { hasPageContentFocus } from './selectors';\n\n/**\n * Returns the current canvas mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Canvas mode.\n */\nexport function getCanvasMode( state ) {\n\treturn state.canvasMode;\n}\n\n/**\n * Returns the editor canvas container view.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editor canvas container view.\n */\nexport function getEditorCanvasContainerView( state ) {\n\treturn state.editorCanvasContainerView;\n}\n\n/**\n * Returns the type of the current page content focus, or null if there is no\n * page content focus.\n *\n * Possible values are:\n *\n * - `'disableTemplate'`: Disable the blocks belonging to the page's template.\n * - `'hideTemplate'`: Hide the blocks belonging to the page's template.\n *\n * @param {Object} state Global application state.\n *\n * @return {'disableTemplate'|'hideTemplate'|null} Type of the current page content focus.\n */\nexport function getPageContentFocusType( state ) {\n\treturn hasPageContentFocus( state ) ? state.pageContentFocusType : null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,mBAAmB,QAAQ,aAAa;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACC,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAAEF,KAAK,EAAG;EACrD,OAAOA,KAAK,CAACG,yBAAyB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAAEJ,KAAK,EAAG;EAChD,OAAOF,mBAAmB,CAAEE,KAAM,CAAC,GAAGA,KAAK,CAACK,oBAAoB,GAAG,IAAI;AACxE"}
@@ -170,6 +170,22 @@ export function hasPageContentFocus(state = false, action) {
170
170
  }
171
171
  return state;
172
172
  }
173
+
174
+ /**
175
+ * Reducer used to track the type of page content focus.
176
+ *
177
+ * @param {string} state Current state.
178
+ * @param {Object} action Dispatched action.
179
+ *
180
+ * @return {string} Updated state.
181
+ */
182
+ export function pageContentFocusType(state = 'disableTemplate', action) {
183
+ switch (action.type) {
184
+ case 'SET_PAGE_CONTENT_FOCUS_TYPE':
185
+ return action.pageContentFocusType;
186
+ }
187
+ return state;
188
+ }
173
189
  export default combineReducers({
174
190
  deviceType,
175
191
  settings,
@@ -179,6 +195,7 @@ export default combineReducers({
179
195
  saveViewPanel,
180
196
  canvasMode,
181
197
  editorCanvasContainerView,
182
- hasPageContentFocus
198
+ hasPageContentFocus,
199
+ pageContentFocusType
183
200
  });
184
201
  //# sourceMappingURL=reducer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["combineReducers","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","hasPageContentFocus","postId"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track whether the editor allows only page content to be\n * edited.\n *\n * @param {boolean} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {boolean} Updated state.\n */\nexport function hasPageContentFocus( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn !! action.context?.postId;\n\t\tcase 'SET_HAS_PAGE_CONTENT_FOCUS':\n\t\t\treturn action.hasPageContentFocus;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tdeviceType,\n\tsettings,\n\teditedPost,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n\thasPageContentFocus,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAEC,KAAK,GAAG,SAAS,EAAEC,MAAM,EAAG;EACvD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACF,UAAU;EAC1B;EAEA,OAAOC,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,QAAQA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK;QACR,GAAGC,MAAM,CAACE;MACX,CAAC;EACH;EAEA,OAAOH,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,UAAUA,CAAEJ,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAChD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACNG,QAAQ,EAAEJ,MAAM,CAACI,QAAQ;QACzBC,EAAE,EAAEL,MAAM,CAACK,EAAE;QACbC,OA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AK,iBAAiB;MACrB,OAAOD,MAAM,CAACa,IAAI;EACpB;EAEA,OAAOd,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASe,yBAAyBA,CAAEf,KAAK,GAAGgB,SAAS,EAAEf,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACgB,IAAI;EACpB;EAEA,OAAOjB,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASkB,mBAAmBA,CAAElB,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EAC5D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO,CAAC,CAAED,MAAM,CAACM,OAAO,EAAEY,MAAM;IACjC,KAAK,4BAA4B;MAChC,OAAOlB,MAAM,CAACiB,mBAAmB;EACnC;EAEA,OAAOlB,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC,UAAU;EACVI,QAAQ;EACRC,UAAU;EACVI,kBAAkB;EAClBG,aAAa;EACbC,aAAa;EACbC,UAAU;EACVE,yBAAyB;EACzBG;AACD,CAAE,CAAC"}
1
+ {"version":3,"names":["combineReducers","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","hasPageContentFocus","postId","pageContentFocusType"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track whether the editor allows only page content to be\n * edited.\n *\n * @param {boolean} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {boolean} Updated state.\n */\nexport function hasPageContentFocus( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn !! action.context?.postId;\n\t\tcase 'SET_HAS_PAGE_CONTENT_FOCUS':\n\t\t\treturn action.hasPageContentFocus;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the type of page content focus.\n *\n * @param {string} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {string} Updated state.\n */\nexport function pageContentFocusType( state = 'disableTemplate', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PAGE_CONTENT_FOCUS_TYPE':\n\t\t\treturn action.pageContentFocusType;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tdeviceType,\n\tsettings,\n\teditedPost,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n\thasPageContentFocus,\n\tpageContentFocusType,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAEC,KAAK,GAAG,SAAS,EAAEC,MAAM,EAAG;EACvD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACF,UAAU;EAC1B;EAEA,OAAOC,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,QAAQA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK;QACR,GAAGC,MAAM,CAACE;MACX,CAAC;EACH;EAEA,OAAOH,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,UAAUA,CAAEJ,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAChD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACNG,QAAQ,EAAEJ,MAAM,CAACI,QAAQ;QACzBC,EAAE,EAAEL,MAAM,CAACK,EAAE;QACbC,OAAO,EAAEN,MAAM,CAACM;MACjB,CAAC;IACF,KAAK,yBAAyB;MAC7B,OAAO;QACN,GAAGP,KAAK;QACRO,OAAO,EAAEN,MAAM,CAACM;MACjB,CAAC;EACH;EAEA,OAAOP,KAAK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GgB,SAAS,EAAEf,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACgB,IAAI;EACpB;EAEA,OAAOjB,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASkB,mBAAmBA,CAAElB,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EAC5D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO,CAAC,CAAED,MAAM,CAACM,OAAO,EAAEY,MAAM;IACjC,KAAK,4BAA4B;MAChC,OAAOlB,MAAM,CAACiB,mBAAmB;EACnC;EAEA,OAAOlB,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASoB,oBAAoBA,CAAEpB,KAAK,GAAG,iBAAiB,EAAEC,MAAM,EAAG;EACzE,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,6BAA6B;MACjC,OAAOD,MAAM,CAACmB,oBAAoB;EACpC;EAEA,OAAOpB,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC,UAAU;EACVI,QAAQ;EACRC,UAAU;EACVI,kBAAkB;EAClBG,aAAa;EACbC,aAAa;EACbC,UAAU;EACVE,yBAAyB;EACzBG,mBAAmB;EACnBE;AACD,CAAE,CAAC"}
@@ -18,7 +18,7 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
18
18
  * Internal dependencies
19
19
  */
20
20
  import { getFilteredTemplatePartBlocks } from './utils';
21
-
21
+ import { TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE } from '../utils/constants';
22
22
  /**
23
23
  * @typedef {'template'|'template_type'} TemplateType Template type.
24
24
  */
@@ -104,7 +104,7 @@ export const getSettings = createSelector((state, setIsInserterOpen) => {
104
104
  showIconLabels: !!__unstableGetPreference(state, 'showIconLabels'),
105
105
  __experimentalSetIsInserterOpened: setIsInserterOpen,
106
106
  __experimentalReusableBlocks: getReusableBlocks(state),
107
- __experimentalPreferPatternsOnRoot: 'wp_template' === getEditedPostType(state)
107
+ __experimentalPreferPatternsOnRoot: TEMPLATE_POST_TYPE === getEditedPostType(state)
108
108
  };
109
109
  const canUserCreateMedia = getCanUserCreateMedia(state);
110
110
  if (!canUserCreateMedia) {
@@ -263,7 +263,7 @@ export const getCurrentTemplateTemplateParts = createRegistrySelector(select =>
263
263
  const templateType = getEditedPostType(state);
264
264
  const templateId = getEditedPostId(state);
265
265
  const template = select(coreDataStore).getEditedEntityRecord('postType', templateType, templateId);
266
- const templateParts = select(coreDataStore).getEntityRecords('postType', 'wp_template_part', {
266
+ const templateParts = select(coreDataStore).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, {
267
267
  per_page: -1
268
268
  });
269
269
  return getFilteredTemplatePartBlocks(template.blocks, templateParts);
@@ -1 +1 @@
1
- {"version":3,"names":["createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","Platform","preferencesStore","blockEditorStore","getFilteredTemplatePartBlocks","__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';\n\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\t'wp_template' === 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\t'wp_template_part',\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,QAAQ,wBAAwB;AAClE,SAASN,KAAK,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AAG,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,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;AAC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ASE,aAAaA,CAAElE,KAAK,EAAG;EACtC,OAAOF,uBAAuB,CAAEE,KAAK,EAAE,YAAa,CAAC;AACtD;;AAEA;AACA;AACA;AACA,OAAO,SAASmE,wCAAwCA,CAAA,EAAG;EAC1D7E,UAAU,CACT,uEAAuE,EACvE;IACCe,KAAK,EAAE,KAAK;IACZgC,OAAO,EAAE;EACV,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAAS+B,4BAA4BA,CAAA,EAAG;EAC9C9E,UAAU,CAAE,2DAA2D,EAAE;IACxEe,KAAK,EAAE,KAAK;IACZgC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA,OAAO,SAASgC,kBAAkBA,CAAA,EAAG;EACpC/E,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,SAASiC,MAAMA,CAAEtE,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAACsC,UAAU,CAACK,OAAO,EAAE4B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASpB,mBAAmBA,CAAEnD,KAAK,EAAG;EAC5C,OAAOsE,MAAM,CAAEtE,KAAM,CAAC,GAAGA,KAAK,CAACmD,mBAAmB,GAAG,KAAK;AAC3D"}
@@ -1,2 +1,52 @@
1
- export const FOCUSABLE_ENTITIES = ['wp_template_part', 'wp_navigation', 'wp_block'];
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { privateApis as patternPrivateApis } from '@wordpress/patterns';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { unlock } from '../lock-unlock';
11
+
12
+ // Navigation
13
+ export const NAVIGATION_POST_TYPE = 'wp_navigation';
14
+
15
+ // Templates.
16
+ export const TEMPLATE_POST_TYPE = 'wp_template';
17
+ export const TEMPLATE_PART_POST_TYPE = 'wp_template_part';
18
+ export const TEMPLATE_ORIGINS = {
19
+ custom: 'custom',
20
+ theme: 'theme',
21
+ plugin: 'plugin'
22
+ };
23
+ export const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';
24
+
25
+ // Patterns.
26
+ export const {
27
+ PATTERN_TYPES,
28
+ PATTERN_DEFAULT_CATEGORY,
29
+ PATTERN_USER_CATEGORY,
30
+ PATTERN_CORE_SOURCES,
31
+ PATTERN_SYNC_TYPES
32
+ } = unlock(patternPrivateApis);
33
+
34
+ // Entities that are editable in focus mode.
35
+ export const FOCUSABLE_ENTITIES = [TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user];
36
+
37
+ /**
38
+ * Block types that are considered to be page content. These are the only blocks
39
+ * editable when hasPageContentFocus() is true.
40
+ */
41
+ export const PAGE_CONTENT_BLOCK_TYPES = {
42
+ 'core/post-title': true,
43
+ 'core/post-featured-image': true,
44
+ 'core/post-content': true
45
+ };
46
+ export const POST_TYPE_LABELS = {
47
+ [TEMPLATE_POST_TYPE]: __('Template'),
48
+ [TEMPLATE_PART_POST_TYPE]: __('Template Part'),
49
+ [PATTERN_TYPES.user]: __('Pattern'),
50
+ [NAVIGATION_POST_TYPE]: __('Navigation')
51
+ };
2
52
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FOCUSABLE_ENTITIES"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["export const FOCUSABLE_ENTITIES = [\n\t'wp_template_part',\n\t'wp_navigation',\n\t'wp_block',\n];\n"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,GAAG,CACjC,kBAAkB,EAClB,eAAe,EACf,UAAU,CACV"}
1
+ {"version":3,"names":["__","privateApis","patternPrivateApis","unlock","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","PATTERN_CORE_SOURCES","PATTERN_SYNC_TYPES","FOCUSABLE_ENTITIES","user","PAGE_CONTENT_BLOCK_TYPES","POST_TYPE_LABELS"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n// Navigation\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\n\n// Templates.\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tPATTERN_CORE_SOURCES,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternPrivateApis );\n\n// Entities that are editable in focus mode.\nexport const FOCUSABLE_ENTITIES = [\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\n/**\n * Block types that are considered to be page content. These are the only blocks\n * editable when hasPageContentFocus() is true.\n */\nexport const PAGE_CONTENT_BLOCK_TYPES = {\n\t'core/post-title': true,\n\t'core/post-featured-image': true,\n\t'core/post-content': true,\n};\n\nexport const POST_TYPE_LABELS = {\n\t[ TEMPLATE_POST_TYPE ]: __( 'Template' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Template Part' ),\n\t[ PATTERN_TYPES.user ]: __( 'Pattern' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Navigation' ),\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,kBAAkB,QAAQ,qBAAqB;;AAEvE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA,OAAO,MAAMC,oBAAoB,GAAG,eAAe;;AAEnD;AACA,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAC/C,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB;AACzD,OAAO,MAAMC,gBAAgB,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AACD,OAAO,MAAMC,mCAAmC,GAAG,eAAe;;AAElE;AACA,OAAO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,qBAAqB;EACrBC,oBAAoB;EACpBC;AACD,CAAC,GAAGb,MAAM,CAAED,kBAAmB,CAAC;;AAEhC;AACA,OAAO,MAAMe,kBAAkB,GAAG,CACjCX,uBAAuB,EACvBF,oBAAoB,EACpBQ,aAAa,CAACM,IAAI,CAClB;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAG;EACvC,iBAAiB,EAAE,IAAI;EACvB,0BAA0B,EAAE,IAAI;EAChC,mBAAmB,EAAE;AACtB,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAG;EAC/B,CAAEf,kBAAkB,GAAIL,EAAE,CAAE,UAAW,CAAC;EACxC,CAAEM,uBAAuB,GAAIN,EAAE,CAAE,eAAgB,CAAC;EAClD,CAAEY,aAAa,CAACM,IAAI,GAAIlB,EAAE,CAAE,SAAU,CAAC;EACvC,CAAEI,oBAAoB,GAAIJ,EAAE,CAAE,YAAa;AAC5C,CAAC"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { TEMPLATE_ORIGINS } from './constants';
5
+
1
6
  /**
2
7
  * Check if a template is removable.
3
8
  *
@@ -8,6 +13,6 @@ export default function isTemplateRemovable(template) {
8
13
  if (!template) {
9
14
  return false;
10
15
  }
11
- return template.source === 'custom' && !template.has_theme_file;
16
+ return template.source === TEMPLATE_ORIGINS.custom && !template.has_theme_file;
12
17
  }
13
18
  //# sourceMappingURL=is-template-removable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isTemplateRemovable","template","source","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-removable.js"],"sourcesContent":["/**\n * Check if a template is removable.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRemovable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\n\treturn template.source === 'custom' && ! template.has_theme_file;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,mBAAmBA,CAAEC,QAAQ,EAAG;EACvD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EAEA,OAAOA,QAAQ,CAACC,MAAM,KAAK,QAAQ,IAAI,CAAED,QAAQ,CAACE,cAAc;AACjE"}
1
+ {"version":3,"names":["TEMPLATE_ORIGINS","isTemplateRemovable","template","source","custom","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-removable.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { TEMPLATE_ORIGINS } from './constants';\n\n/**\n * Check if a template is removable.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRemovable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\ttemplate.source === TEMPLATE_ORIGINS.custom && ! template.has_theme_file\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,aAAa;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,mBAAmBA,CAAEC,QAAQ,EAAG;EACvD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EAEA,OACCA,QAAQ,CAACC,MAAM,KAAKH,gBAAgB,CAACI,MAAM,IAAI,CAAEF,QAAQ,CAACG,cAAc;AAE1E"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { TEMPLATE_ORIGINS } from './constants';
5
+
1
6
  /**
2
7
  * Check if a template is revertable to its original theme-provided template file.
3
8
  *
@@ -9,7 +14,7 @@ export default function isTemplateRevertable(template) {
9
14
  return false;
10
15
  }
11
16
  /* eslint-disable camelcase */
12
- return template?.source === 'custom' && template?.has_theme_file;
17
+ return template?.source === TEMPLATE_ORIGINS.custom && template?.has_theme_file;
13
18
  /* eslint-enable camelcase */
14
19
  }
15
20
  //# sourceMappingURL=is-template-revertable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isTemplateRevertable","template","source","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-revertable.js"],"sourcesContent":["/**\n * Check if a template is revertable to its original theme-provided template file.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRevertable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\t/* eslint-disable camelcase */\n\treturn template?.source === 'custom' && template?.has_theme_file;\n\t/* eslint-enable camelcase */\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,oBAAoBA,CAAEC,QAAQ,EAAG;EACxD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA;EACA,OAAOA,QAAQ,EAAEC,MAAM,KAAK,QAAQ,IAAID,QAAQ,EAAEE,cAAc;EAChE;AACD"}
1
+ {"version":3,"names":["TEMPLATE_ORIGINS","isTemplateRevertable","template","source","custom","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-revertable.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { TEMPLATE_ORIGINS } from './constants';\n\n/**\n * Check if a template is revertable to its original theme-provided template file.\n *\n * @param {Object} template The template entity to check.\n * @return {boolean} Whether the template is revertable.\n */\nexport default function isTemplateRevertable( template ) {\n\tif ( ! template ) {\n\t\treturn false;\n\t}\n\t/* eslint-disable camelcase */\n\treturn (\n\t\ttemplate?.source === TEMPLATE_ORIGINS.custom && template?.has_theme_file\n\t);\n\t/* eslint-enable camelcase */\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,aAAa;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAAEC,QAAQ,EAAG;EACxD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EACA;EACA,OACCA,QAAQ,EAAEC,MAAM,KAAKH,gBAAgB,CAACI,MAAM,IAAIF,QAAQ,EAAEG,cAAc;EAEzE;AACD"}
@@ -8,8 +8,13 @@ import { paramCase as kebabCase } from 'change-case';
8
8
  */
9
9
  import { useSelect } from '@wordpress/data';
10
10
  import { store as coreStore } from '@wordpress/core-data';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import { TEMPLATE_PART_POST_TYPE } from './constants';
11
16
  export const useExistingTemplateParts = () => {
12
- return useSelect(select => select(coreStore).getEntityRecords('postType', 'wp_template_part', {
17
+ return useSelect(select => select(coreStore).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, {
13
18
  per_page: -1
14
19
  }), []);
15
20
  };