@wordpress/edit-site 5.19.0 → 5.19.2

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 (448) hide show
  1. package/build/components/add-new-pattern/index.js +3 -3
  2. package/build/components/add-new-pattern/index.js.map +1 -1
  3. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +73 -0
  4. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -0
  5. package/build/components/block-editor/block-editor-provider/index.js +31 -0
  6. package/build/components/block-editor/block-editor-provider/index.js.map +1 -0
  7. package/build/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  8. package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -0
  9. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +76 -0
  10. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -0
  11. package/build/components/block-editor/index.js +2 -9
  12. package/build/components/block-editor/index.js.map +1 -1
  13. package/build/components/block-editor/site-editor-canvas.js +1 -1
  14. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  15. package/build/components/create-template-part-modal/index.js +8 -12
  16. package/build/components/create-template-part-modal/index.js.map +1 -1
  17. package/build/components/editor/index.js +4 -1
  18. package/build/components/editor/index.js.map +1 -1
  19. package/build/components/global-styles/font-families.js +2 -1
  20. package/build/components/global-styles/font-families.js.map +1 -1
  21. package/build/components/global-styles/font-family-item.js +2 -2
  22. package/build/components/global-styles/font-family-item.js.map +1 -1
  23. package/build/components/global-styles/font-library-modal/collection-font-details.js +49 -0
  24. package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -0
  25. package/build/components/global-styles/font-library-modal/collection-font-variant.js +55 -0
  26. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -0
  27. package/build/components/global-styles/font-library-modal/context.js +26 -2
  28. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  29. package/build/components/global-styles/font-library-modal/font-card.js +7 -4
  30. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  31. package/build/components/global-styles/font-library-modal/font-collection.js +172 -0
  32. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -0
  33. package/build/components/global-styles/font-library-modal/font-demo.js +30 -13
  34. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  35. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +41 -0
  36. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -0
  37. package/build/components/global-styles/font-library-modal/index.js +25 -7
  38. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  39. package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  40. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  41. package/build/components/global-styles/font-library-modal/library-font-card.js +0 -5
  42. package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  43. package/build/components/global-styles/font-library-modal/library-font-details.js +2 -1
  44. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  45. package/build/components/global-styles/font-library-modal/resolvers.js +16 -0
  46. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  47. package/build/components/global-styles/font-library-modal/tab-layout.js +2 -2
  48. package/build/components/global-styles/font-library-modal/tab-layout.js.map +1 -1
  49. package/build/components/global-styles/font-library-modal/utils/constants.js +1 -7
  50. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  51. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +21 -0
  52. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -0
  53. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +20 -0
  54. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -0
  55. package/build/components/global-styles/font-library-modal/utils/index.js +2 -52
  56. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  57. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +76 -0
  58. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -0
  59. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +36 -0
  60. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -0
  61. package/build/components/global-styles/screen-typography.js +1 -1
  62. package/build/components/global-styles/screen-typography.js.map +1 -1
  63. package/build/components/header-edit-mode/document-actions/index.js +9 -8
  64. package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
  65. package/build/components/header-edit-mode/index.js +4 -1
  66. package/build/components/header-edit-mode/index.js.map +1 -1
  67. package/build/components/layout/index.js +5 -1
  68. package/build/components/layout/index.js.map +1 -1
  69. package/build/components/list/added-by.js +13 -8
  70. package/build/components/list/added-by.js.map +1 -1
  71. package/build/components/list/index.js +2 -1
  72. package/build/components/list/index.js.map +1 -1
  73. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -3
  74. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  75. package/build/components/page-patterns/duplicate-menu-item.js +5 -5
  76. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  77. package/build/components/page-patterns/grid-item.js +5 -5
  78. package/build/components/page-patterns/grid-item.js.map +1 -1
  79. package/build/components/page-patterns/index.js +1 -1
  80. package/build/components/page-patterns/index.js.map +1 -1
  81. package/build/components/page-patterns/search-items.js +1 -1
  82. package/build/components/page-patterns/search-items.js.map +1 -1
  83. package/build/components/page-patterns/use-patterns.js +28 -34
  84. package/build/components/page-patterns/use-patterns.js.map +1 -1
  85. package/build/components/page-template-parts/add-new-template-part.js +3 -2
  86. package/build/components/page-template-parts/add-new-template-part.js.map +1 -1
  87. package/build/components/page-template-parts/index.js +2 -1
  88. package/build/components/page-template-parts/index.js.map +1 -1
  89. package/build/components/page-templates/index.js +3 -2
  90. package/build/components/page-templates/index.js.map +1 -1
  91. package/build/components/save-hub/index.js +2 -1
  92. package/build/components/save-hub/index.js.map +1 -1
  93. package/build/components/secondary-sidebar/list-view-sidebar.js +24 -17
  94. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  95. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +21 -3
  96. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  97. package/build/components/sidebar-edit-mode/page-panels/hooks.js +2 -1
  98. package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -1
  99. package/build/components/sidebar-edit-mode/settings-header/index.js +2 -6
  100. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  101. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +9 -2
  102. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -1
  103. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  104. package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  105. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -1
  106. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  107. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  108. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  109. package/build/components/sidebar-navigation-screen-page/page-details.js +2 -1
  110. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  111. package/build/components/sidebar-navigation-screen-pages/index.js +5 -4
  112. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  113. package/build/components/sidebar-navigation-screen-pattern/index.js +2 -1
  114. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  115. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -2
  116. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  117. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
  118. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  119. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  120. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  121. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +8 -7
  122. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  123. package/build/components/sidebar-navigation-screen-patterns/index.js +3 -3
  124. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  125. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +7 -2
  126. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  127. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +7 -2
  128. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  129. package/build/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  130. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  131. package/build/components/sidebar-navigation-screen-templates/index.js +4 -3
  132. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  133. package/build/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
  134. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  135. package/build/components/start-template-options/index.js +20 -2
  136. package/build/components/start-template-options/index.js.map +1 -1
  137. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -4
  138. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  139. package/build/components/sync-state-with-url/use-sync-path-with-url.js +4 -3
  140. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  141. package/build/components/template-actions/index.js +2 -1
  142. package/build/components/template-actions/index.js.map +1 -1
  143. package/build/components/template-actions/rename-menu-item.js +8 -3
  144. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  145. package/build/hooks/commands/use-edit-mode-commands.js +4 -3
  146. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  147. package/build/hooks/navigation-menu-edit.js +2 -1
  148. package/build/hooks/navigation-menu-edit.js.map +1 -1
  149. package/build/hooks/template-part-edit.js +2 -1
  150. package/build/hooks/template-part-edit.js.map +1 -1
  151. package/build/store/actions.js +10 -9
  152. package/build/store/actions.js.map +1 -1
  153. package/build/store/constants.js +1 -9
  154. package/build/store/constants.js.map +1 -1
  155. package/build/store/private-actions.js +21 -1
  156. package/build/store/private-actions.js.map +1 -1
  157. package/build/store/private-selectors.js +23 -0
  158. package/build/store/private-selectors.js.map +1 -1
  159. package/build/store/reducer.js +19 -1
  160. package/build/store/reducer.js.map +1 -1
  161. package/build/store/selectors.js +3 -2
  162. package/build/store/selectors.js.map +1 -1
  163. package/build/utils/constants.js +22 -3
  164. package/build/utils/constants.js.map +1 -1
  165. package/build/utils/is-template-removable.js +1 -1
  166. package/build/utils/is-template-removable.js.map +1 -1
  167. package/build/utils/is-template-revertable.js +1 -1
  168. package/build/utils/is-template-revertable.js.map +1 -1
  169. package/build/utils/template-part-create.js +6 -1
  170. package/build/utils/template-part-create.js.map +1 -1
  171. package/build-module/components/add-new-pattern/index.js +3 -3
  172. package/build-module/components/add-new-pattern/index.js.map +1 -1
  173. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +65 -0
  174. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -0
  175. package/build-module/components/block-editor/block-editor-provider/index.js +23 -0
  176. package/build-module/components/block-editor/block-editor-provider/index.js.map +1 -0
  177. package/build-module/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  178. package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -0
  179. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +70 -0
  180. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -0
  181. package/build-module/components/block-editor/index.js +1 -8
  182. package/build-module/components/block-editor/index.js.map +1 -1
  183. package/build-module/components/block-editor/site-editor-canvas.js +2 -2
  184. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  185. package/build-module/components/create-template-part-modal/index.js +8 -12
  186. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  187. package/build-module/components/editor/index.js +4 -1
  188. package/build-module/components/editor/index.js.map +1 -1
  189. package/build-module/components/global-styles/font-families.js +3 -2
  190. package/build-module/components/global-styles/font-families.js.map +1 -1
  191. package/build-module/components/global-styles/font-family-item.js +2 -2
  192. package/build-module/components/global-styles/font-family-item.js.map +1 -1
  193. package/build-module/components/global-styles/font-library-modal/collection-font-details.js +40 -0
  194. package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +1 -0
  195. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +45 -0
  196. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -0
  197. package/build-module/components/global-styles/font-library-modal/context.js +27 -3
  198. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  199. package/build-module/components/global-styles/font-library-modal/font-card.js +8 -5
  200. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  201. package/build-module/components/global-styles/font-library-modal/font-collection.js +164 -0
  202. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -0
  203. package/build-module/components/global-styles/font-library-modal/font-demo.js +30 -13
  204. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  205. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +33 -0
  206. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -0
  207. package/build-module/components/global-styles/font-library-modal/index.js +26 -7
  208. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  209. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  210. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  211. package/build-module/components/global-styles/font-library-modal/library-font-card.js +0 -5
  212. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  213. package/build-module/components/global-styles/font-library-modal/library-font-details.js +2 -1
  214. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  215. package/build-module/components/global-styles/font-library-modal/resolvers.js +14 -0
  216. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  217. package/build-module/components/global-styles/font-library-modal/tab-layout.js +2 -2
  218. package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +1 -1
  219. package/build-module/components/global-styles/font-library-modal/utils/constants.js +1 -6
  220. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  221. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +15 -0
  222. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -0
  223. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +13 -0
  224. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -0
  225. package/build-module/components/global-styles/font-library-modal/utils/index.js +2 -51
  226. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  227. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +68 -0
  228. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -0
  229. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +30 -0
  230. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -0
  231. package/build-module/components/global-styles/screen-typography.js +1 -1
  232. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  233. package/build-module/components/header-edit-mode/document-actions/index.js +9 -8
  234. package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
  235. package/build-module/components/header-edit-mode/index.js +4 -1
  236. package/build-module/components/header-edit-mode/index.js.map +1 -1
  237. package/build-module/components/layout/index.js +5 -1
  238. package/build-module/components/layout/index.js.map +1 -1
  239. package/build-module/components/list/added-by.js +13 -8
  240. package/build-module/components/list/added-by.js.map +1 -1
  241. package/build-module/components/list/index.js +2 -1
  242. package/build-module/components/list/index.js.map +1 -1
  243. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -3
  244. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  245. package/build-module/components/page-patterns/duplicate-menu-item.js +5 -5
  246. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
  247. package/build-module/components/page-patterns/grid-item.js +5 -5
  248. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  249. package/build-module/components/page-patterns/index.js +1 -1
  250. package/build-module/components/page-patterns/index.js.map +1 -1
  251. package/build-module/components/page-patterns/search-items.js +2 -2
  252. package/build-module/components/page-patterns/search-items.js.map +1 -1
  253. package/build-module/components/page-patterns/use-patterns.js +28 -35
  254. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  255. package/build-module/components/page-template-parts/add-new-template-part.js +3 -2
  256. package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -1
  257. package/build-module/components/page-template-parts/index.js +2 -1
  258. package/build-module/components/page-template-parts/index.js.map +1 -1
  259. package/build-module/components/page-templates/index.js +3 -2
  260. package/build-module/components/page-templates/index.js.map +1 -1
  261. package/build-module/components/save-hub/index.js +2 -1
  262. package/build-module/components/save-hub/index.js.map +1 -1
  263. package/build-module/components/secondary-sidebar/list-view-sidebar.js +26 -19
  264. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  265. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +21 -3
  266. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  267. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +2 -1
  268. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -1
  269. package/build-module/components/sidebar-edit-mode/settings-header/index.js +2 -6
  270. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  271. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +9 -2
  272. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -1
  273. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  274. package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
  275. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
  276. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  277. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  278. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  279. package/build-module/components/sidebar-navigation-screen-page/page-details.js +2 -1
  280. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  281. package/build-module/components/sidebar-navigation-screen-pages/index.js +5 -4
  282. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  283. package/build-module/components/sidebar-navigation-screen-pattern/index.js +2 -1
  284. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  285. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -2
  286. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  287. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
  288. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  289. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  290. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  291. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +8 -7
  292. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  293. package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -4
  294. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  295. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +8 -3
  296. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  297. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +7 -2
  298. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  299. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  300. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  301. package/build-module/components/sidebar-navigation-screen-templates/index.js +4 -3
  302. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  303. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
  304. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  305. package/build-module/components/start-template-options/index.js +20 -2
  306. package/build-module/components/start-template-options/index.js.map +1 -1
  307. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -4
  308. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  309. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +4 -3
  310. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  311. package/build-module/components/template-actions/index.js +2 -1
  312. package/build-module/components/template-actions/index.js.map +1 -1
  313. package/build-module/components/template-actions/rename-menu-item.js +8 -3
  314. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  315. package/build-module/hooks/commands/use-edit-mode-commands.js +4 -3
  316. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  317. package/build-module/hooks/navigation-menu-edit.js +2 -1
  318. package/build-module/hooks/navigation-menu-edit.js.map +1 -1
  319. package/build-module/hooks/template-part-edit.js +2 -1
  320. package/build-module/hooks/template-part-edit.js.map +1 -1
  321. package/build-module/store/actions.js +10 -10
  322. package/build-module/store/actions.js.map +1 -1
  323. package/build-module/store/constants.js +0 -4
  324. package/build-module/store/constants.js.map +1 -1
  325. package/build-module/store/private-actions.js +19 -0
  326. package/build-module/store/private-actions.js.map +1 -1
  327. package/build-module/store/private-selectors.js +22 -0
  328. package/build-module/store/private-selectors.js.map +1 -1
  329. package/build-module/store/reducer.js +18 -1
  330. package/build-module/store/reducer.js.map +1 -1
  331. package/build-module/store/selectors.js +3 -3
  332. package/build-module/store/selectors.js.map +1 -1
  333. package/build-module/utils/constants.js +17 -1
  334. package/build-module/utils/constants.js.map +1 -1
  335. package/build-module/utils/is-template-removable.js +2 -2
  336. package/build-module/utils/is-template-removable.js.map +1 -1
  337. package/build-module/utils/is-template-revertable.js +2 -2
  338. package/build-module/utils/is-template-revertable.js.map +1 -1
  339. package/build-module/utils/template-part-create.js +6 -1
  340. package/build-module/utils/template-part-create.js.map +1 -1
  341. package/build-style/style-rtl.css +23 -0
  342. package/build-style/style.css +23 -0
  343. package/package.json +40 -40
  344. package/src/components/add-new-pattern/index.js +3 -3
  345. package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +70 -0
  346. package/src/components/block-editor/block-editor-provider/index.js +29 -0
  347. package/src/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
  348. package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +87 -0
  349. package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +77 -0
  350. package/src/components/block-editor/index.js +1 -14
  351. package/src/components/block-editor/site-editor-canvas.js +5 -2
  352. package/src/components/create-template-part-modal/index.js +11 -12
  353. package/src/components/editor/index.js +6 -2
  354. package/src/components/global-styles/font-families.js +5 -1
  355. package/src/components/global-styles/font-family-item.js +2 -2
  356. package/src/components/global-styles/font-library-modal/collection-font-details.js +56 -0
  357. package/src/components/global-styles/font-library-modal/collection-font-variant.js +45 -0
  358. package/src/components/global-styles/font-library-modal/context.js +33 -2
  359. package/src/components/global-styles/font-library-modal/font-card.js +9 -4
  360. package/src/components/global-styles/font-library-modal/font-collection.js +257 -0
  361. package/src/components/global-styles/font-library-modal/font-demo.js +36 -10
  362. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +50 -0
  363. package/src/components/global-styles/font-library-modal/index.js +30 -5
  364. package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -1
  365. package/src/components/global-styles/font-library-modal/library-font-card.js +1 -8
  366. package/src/components/global-styles/font-library-modal/library-font-details.js +2 -3
  367. package/src/components/global-styles/font-library-modal/resolvers.js +16 -0
  368. package/src/components/global-styles/font-library-modal/style.scss +26 -0
  369. package/src/components/global-styles/font-library-modal/tab-layout.js +2 -2
  370. package/src/components/global-styles/font-library-modal/utils/constants.js +1 -9
  371. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +18 -0
  372. package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +21 -0
  373. package/src/components/global-styles/font-library-modal/utils/index.js +9 -69
  374. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +86 -0
  375. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +33 -0
  376. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +69 -0
  377. package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +109 -0
  378. package/src/components/global-styles/font-library-modal/utils/test/{getPreviewStyle.spec.js → preview-styles.spec.js} +49 -9
  379. package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +74 -0
  380. package/src/components/global-styles/screen-typography.js +4 -1
  381. package/src/components/header-edit-mode/document-actions/index.js +17 -8
  382. package/src/components/header-edit-mode/index.js +2 -1
  383. package/src/components/layout/index.js +10 -1
  384. package/src/components/list/added-by.js +29 -11
  385. package/src/components/list/index.js +7 -1
  386. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -8
  387. package/src/components/page-patterns/duplicate-menu-item.js +5 -5
  388. package/src/components/page-patterns/grid-item.js +5 -5
  389. package/src/components/page-patterns/index.js +1 -1
  390. package/src/components/page-patterns/search-items.js +7 -1
  391. package/src/components/page-patterns/use-patterns.js +190 -134
  392. package/src/components/page-template-parts/add-new-template-part.js +5 -2
  393. package/src/components/page-template-parts/index.js +2 -1
  394. package/src/components/page-templates/index.js +3 -2
  395. package/src/components/save-hub/index.js +2 -1
  396. package/src/components/secondary-sidebar/list-view-sidebar.js +31 -26
  397. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +48 -20
  398. package/src/components/sidebar-edit-mode/page-panels/hooks.js +9 -4
  399. package/src/components/sidebar-edit-mode/page-panels/style.scss +6 -0
  400. package/src/components/sidebar-edit-mode/settings-header/index.js +4 -7
  401. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +9 -2
  402. package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
  403. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
  404. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  405. package/src/components/sidebar-navigation-screen-page/page-details.js +2 -1
  406. package/src/components/sidebar-navigation-screen-pages/index.js +5 -4
  407. package/src/components/sidebar-navigation-screen-pattern/index.js +2 -1
  408. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +8 -2
  409. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +7 -1
  410. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
  411. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +18 -8
  412. package/src/components/sidebar-navigation-screen-patterns/index.js +8 -4
  413. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +16 -3
  414. package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +12 -2
  415. package/src/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
  416. package/src/components/sidebar-navigation-screen-templates/index.js +4 -3
  417. package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -2
  418. package/src/components/start-template-options/index.js +39 -2
  419. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -4
  420. package/src/components/sync-state-with-url/use-sync-path-with-url.js +8 -3
  421. package/src/components/template-actions/index.js +2 -1
  422. package/src/components/template-actions/rename-menu-item.js +8 -3
  423. package/src/hooks/commands/use-edit-mode-commands.js +4 -3
  424. package/src/hooks/navigation-menu-edit.js +2 -1
  425. package/src/hooks/template-part-edit.js +2 -1
  426. package/src/store/actions.js +18 -10
  427. package/src/store/constants.js +0 -5
  428. package/src/store/private-actions.js +19 -0
  429. package/src/store/private-selectors.js +22 -0
  430. package/src/store/reducer.js +18 -0
  431. package/src/store/selectors.js +6 -3
  432. package/src/store/test/reducer.js +18 -0
  433. package/src/utils/constants.js +17 -1
  434. package/src/utils/is-template-removable.js +2 -2
  435. package/src/utils/is-template-revertable.js +2 -2
  436. package/src/utils/template-part-create.js +6 -1
  437. package/build/components/block-editor/get-block-editor-provider.js +0 -35
  438. package/build/components/block-editor/get-block-editor-provider.js.map +0 -1
  439. package/build/components/block-editor/providers/default-block-editor-provider.js +0 -49
  440. package/build/components/block-editor/providers/default-block-editor-provider.js.map +0 -1
  441. package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +0 -1
  442. package/build-module/components/block-editor/get-block-editor-provider.js +0 -28
  443. package/build-module/components/block-editor/get-block-editor-provider.js.map +0 -1
  444. package/build-module/components/block-editor/providers/default-block-editor-provider.js +0 -41
  445. package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +0 -1
  446. package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +0 -1
  447. package/src/components/block-editor/get-block-editor-provider.js +0 -29
  448. package/src/components/block-editor/providers/default-block-editor-provider.js +0 -44
@@ -1 +1 @@
1
- {"version":3,"names":["_apiFetch","_interopRequireDefault","require","_blocks","_deprecated","_url","_i18n","_notices","_coreData","_interface","_blockEditor","_a11y","_preferences","_htmlEntities","_constants","_isTemplateRevertable","toggleFeature","featureName","registry","deprecated","since","alternative","dispatch","preferencesStore","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","templateId","templateSlug","template","resolveSelect","coreStore","getEntityRecord","slug","error","postType","id","context","exports","addTemplate","newTemplate","saveEntityRecord","content","editEntityRecord","blocks","parse","undoIgnore","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","noticesStore","createSuccessNotice","sprintf","__","decodeEntities","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","setHomeTemplateId","version","setEditedPostContext","setPage","page","getDefaultTemplate","apiFetch","path","addQueryArgs","__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","isTemplateRevertable","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","serializeBlocks","blocksForSerialization","__unstableSerializeAndClean","edited","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","interfaceStore","enableComplementaryArea","editSiteStoreName","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","blockEditorStore","clearSelectedBlock","speak","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';\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 {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', 'wp_template', {\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: '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":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAKA,IAAAY,UAAA,GAAAZ,OAAA;AACA,IAAAa,qBAAA,GAAAd,sBAAA,CAAAC,OAAA;AApBA;AACA;AACA;;AAcA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASc,aAAaA,CAAEC,WAAW,EAAG;EAC5C,OAAO,UAAW;IAAEC;EAAS,CAAC,EAAG;IAChC,IAAAC,mBAAU,EAAE,yDAAyD,EAAE;MACtEC,KAAK,EAAE,K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;EAAEJ;AAAS,CAAC,KAAM;EAC7B,MAAMiF,iBAAiB,GAAGjF,QAAQ,CAChCmC,MAAM,CAAE9B,kBAAiB,CAAC,CAC1B6E,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC;EAC5C,IAAK,CAAED,iBAAiB,EAAG;IAC1BjF,QAAQ,CAACwH,KAAK,CAAE,MAAM;MACrBxH,QAAQ,CACNI,QAAQ,CAAEC,kBAAiB,CAAC,CAC5B6G,GAAG,CAAE,gBAAgB,EAAE,cAAc,EAAE,KAAM,CAAC;MAChD9G,QAAQ,CAACuE,mBAAmB,CAAE,KAAM,CAAC;MACrCvE,QAAQ,CAAC2E,mBAAmB,CAAE,KAAM,CAAC;MACrC3E,QAAQ,CAAC0G,mBAAmB,CAAC,CAAC;IAC/B,CAAE,CAAC;EACJ;EACA9G,QAAQ,CAACwH,KAAK,CAAE,MAAM;IACrBxH,QAAQ,CACNI,QAAQ,CAAEC,kBAAiB,CAAC,CAC5B6G,GAAG,CACH,gBAAgB,EAChB,iBAAiB,EACjB,CAAEjC,iBACH,CAAC;IACFjF,QAAQ,CACNI,QAAQ,CAAEoC,cAAa,CAAC,CACxBiF,gBAAgB,CAChBxC,iBAAiB,GACd,IAAAtC,QAAE,EAAE,uBAAwB,CAAC,GAC7B,IAAAA,QAAE,EAAE,sBAAuB,CAAC,EAC/B;MACCvB,EAAE,EAAE,6CAA6C;MACjDX,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC;AAACa,OAAA,CAAA6D,qBAAA,GAAAA,qBAAA"}
1
+ {"version":3,"names":["_apiFetch","_interopRequireDefault","require","_blocks","_deprecated","_url","_i18n","_notices","_coreData","_interface","_blockEditor","_a11y","_preferences","_htmlEntities","_constants","_isTemplateRevertable","_constants2","toggleFeature","featureName","registry","deprecated","since","alternative","dispatch","preferencesStore","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","templateId","templateSlug","template","resolveSelect","coreStore","getEntityRecord","TEMPLATE_POST_TYPE","slug","error","postType","id","context","exports","addTemplate","newTemplate","saveEntityRecord","content","editEntityRecord","blocks","parse","undoIgnore","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","noticesStore","createSuccessNotice","sprintf","__","decodeEntities","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","TEMPLATE_PART_POST_TYPE","setNavigationMenu","navigationMenuId","NAVIGATION_POST_TYPE","setEditedEntity","postId","setHomeTemplateId","version","setEditedPostContext","setPage","page","getDefaultTemplate","apiFetch","path","addQueryArgs","__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","isTemplateRevertable","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","serializeBlocks","blocksForSerialization","__unstableSerializeAndClean","edited","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","interfaceStore","enableComplementaryArea","editSiteStoreName","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","blockEditorStore","clearSelectedBlock","speak","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":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,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H,QAAQ,CACNI,QAAQ,CAAEC,kBAAiB,CAAC,CAC5BgH,GAAG,CACH,gBAAgB,EAChB,iBAAiB,EACjB,CAAEjC,iBACH,CAAC;IACFpF,QAAQ,CACNI,QAAQ,CAAEqC,cAAa,CAAC,CACxBmF,gBAAgB,CAChBxC,iBAAiB,GACd,IAAAxC,QAAE,EAAE,uBAAwB,CAAC,GAC7B,IAAAA,QAAE,EAAE,sBAAuB,CAAC,EAC/B;MACCvB,EAAE,EAAE,6CAA6C;MACjDZ,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC;AAACc,OAAA,CAAA+D,qBAAA,GAAAA,qBAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TEMPLATE_PART_AREA_SIDEBAR = exports.TEMPLATE_PART_AREA_HEADER = exports.TEMPLATE_PART_AREA_GENERAL = exports.TEMPLATE_PART_AREA_FOOTER = exports.STORE_NAME = void 0;
6
+ exports.STORE_NAME = void 0;
7
7
  /**
8
8
  * The identifier for the data store.
9
9
  *
@@ -11,12 +11,4 @@ exports.TEMPLATE_PART_AREA_SIDEBAR = exports.TEMPLATE_PART_AREA_HEADER = exports
11
11
  */
12
12
  const STORE_NAME = 'core/edit-site';
13
13
  exports.STORE_NAME = STORE_NAME;
14
- const TEMPLATE_PART_AREA_HEADER = 'header';
15
- exports.TEMPLATE_PART_AREA_HEADER = TEMPLATE_PART_AREA_HEADER;
16
- const TEMPLATE_PART_AREA_FOOTER = 'footer';
17
- exports.TEMPLATE_PART_AREA_FOOTER = TEMPLATE_PART_AREA_FOOTER;
18
- const TEMPLATE_PART_AREA_SIDEBAR = 'sidebar';
19
- exports.TEMPLATE_PART_AREA_SIDEBAR = TEMPLATE_PART_AREA_SIDEBAR;
20
- const TEMPLATE_PART_AREA_GENERAL = 'uncategorized';
21
- exports.TEMPLATE_PART_AREA_GENERAL = TEMPLATE_PART_AREA_GENERAL;
22
14
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["STORE_NAME","exports","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;AACO,MAAMA,UAAU,GAAG,gBAAgB;AAACC,OAAA,CAAAD,UAAA,GAAAA,UAAA;AAEpC,MAAME,yBAAyB,GAAG,QAAQ;AAACD,OAAA,CAAAC,yBAAA,GAAAA,yBAAA;AAC3C,MAAMC,yBAAyB,GAAG,QAAQ;AAACF,OAAA,CAAAE,yBAAA,GAAAA,yBAAA;AAC3C,MAAMC,0BAA0B,GAAG,SAAS;AAACH,OAAA,CAAAG,0BAAA,GAAAA,0BAAA;AAC7C,MAAMC,0BAA0B,GAAG,eAAe;AAACJ,OAAA,CAAAI,0BAAA,GAAAA,0BAAA"}
1
+ {"version":3,"names":["STORE_NAME","exports"],"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;AACO,MAAMA,UAAU,GAAG,gBAAgB;AAACC,OAAA,CAAAD,UAAA,GAAAA,UAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setEditorCanvasContainerView = exports.setCanvasMode = void 0;
6
+ exports.setPageContentFocusType = exports.setEditorCanvasContainerView = exports.setCanvasMode = void 0;
7
7
  var _blockEditor = require("@wordpress/block-editor");
8
8
  var _preferences = require("@wordpress/preferences");
9
9
  /**
@@ -50,5 +50,25 @@ const setEditorCanvasContainerView = view => ({
50
50
  view
51
51
  });
52
52
  };
53
+
54
+ /**
55
+ * Sets the type of page content focus. Can be one of:
56
+ *
57
+ * - `'disableTemplate'`: Disable the blocks belonging to the page's template.
58
+ * - `'hideTemplate'`: Hide the blocks belonging to the page's template.
59
+ *
60
+ * @param {'disableTemplate'|'hideTemplate'} pageContentFocusType The type of page content focus.
61
+ *
62
+ * @return {Object} Action object.
63
+ */
53
64
  exports.setEditorCanvasContainerView = setEditorCanvasContainerView;
65
+ const setPageContentFocusType = pageContentFocusType => ({
66
+ dispatch
67
+ }) => {
68
+ dispatch({
69
+ type: 'SET_PAGE_CONTENT_FOCUS_TYPE',
70
+ pageContentFocusType
71
+ });
72
+ };
73
+ exports.setPageContentFocusType = setPageContentFocusType;
54
74
  //# sourceMappingURL=private-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_preferences","setCanvasMode","mode","registry","dispatch","select","blockEditorStore","__unstableSetEditorMode","type","preferencesStore","get","setIsListViewOpened","isPage","setHasPageContentFocus","exports","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":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAM;EACrCF,QAAQ,CAACC,QAAQ,CAAEE,kBAAiB,CAAC,CAACC,uBAAuB,CAAE,MAAO,CAAC;EACvEH,QAAQ,CAAE;IACTI,IAAI,EAAE,iBAAiB;IACvBN;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNE,MAAM,CAAEI,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,uBAAwB,CAAC,IAClD,CAAEP,QAAQ,CACRE,MAAM,CAAEI,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC,EAC3C;IACDN,QAAQ,CAACO,mBAAmB,CAAE,IAAK,CAAC;EACrC;EACA;EACA,IAAKT,IAAI,KAAK,MAAM,IAAIG,MAAM,CAACO,MAAM,CAAC,CAAC,EAAG;IACzCR,QAAQ,CAACS,sBAAsB,CAAE,IAAK,CAAC;EACxC;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAb,aAAA,GAAAA,aAAA;AAKO,MAAMc,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEZ;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTI,IAAI,EAAE,kCAAkC;IACxCQ;EACD,CAAE,CAAC;AACJ,CAAC;AAACF,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
1
+ {"version":3,"names":["_blockEditor","require","_preferences","setCanvasMode","mode","registry","dispatch","select","blockEditorStore","__unstableSetEditorMode","type","preferencesStore","get","setIsListViewOpened","isPage","setHasPageContentFocus","exports","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":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAM;EACrCF,QAAQ,CAACC,QAAQ,CAAEE,kBAAiB,CAAC,CAACC,uBAAuB,CAAE,MAAO,CAAC;EACvEH,QAAQ,CAAE;IACTI,IAAI,EAAE,iBAAiB;IACvBN;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNE,MAAM,CAAEI,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,uBAAwB,CAAC,IAClD,CAAEP,QAAQ,CACRE,MAAM,CAAEI,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC,EAC3C;IACDN,QAAQ,CAACO,mBAAmB,CAAE,IAAK,CAAC;EACrC;EACA;EACA,IAAKT,IAAI,KAAK,MAAM,IAAIG,MAAM,CAACO,MAAM,CAAC,CAAC,EAAG;IACzCR,QAAQ,CAACS,sBAAsB,CAAE,IAAK,CAAC;EACxC;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAb,aAAA,GAAAA,aAAA;AAKO,MAAMc,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEZ;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTI,IAAI,EAAE,kCAAkC;IACxCQ;EACD,CAAE,CAAC;AACJ,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATAF,OAAA,CAAAC,4BAAA,GAAAA,4BAAA;AAUO,MAAME,uBAAuB,GACjCC,oBAAoB,IACtB,CAAE;EAAEd;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTI,IAAI,EAAE,6BAA6B;IACnCU;EACD,CAAE,CAAC;AACJ,CAAC;AAACJ,OAAA,CAAAG,uBAAA,GAAAA,uBAAA"}
@@ -5,6 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getCanvasMode = getCanvasMode;
7
7
  exports.getEditorCanvasContainerView = getEditorCanvasContainerView;
8
+ exports.getPageContentFocusType = getPageContentFocusType;
9
+ var _selectors = require("./selectors");
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+
8
14
  /**
9
15
  * Returns the current canvas mode.
10
16
  *
@@ -26,4 +32,21 @@ function getCanvasMode(state) {
26
32
  function getEditorCanvasContainerView(state) {
27
33
  return state.editorCanvasContainerView;
28
34
  }
35
+
36
+ /**
37
+ * Returns the type of the current page content focus, or null if there is no
38
+ * page content focus.
39
+ *
40
+ * Possible values are:
41
+ *
42
+ * - `'disableTemplate'`: Disable the blocks belonging to the page's template.
43
+ * - `'hideTemplate'`: Hide the blocks belonging to the page's template.
44
+ *
45
+ * @param {Object} state Global application state.
46
+ *
47
+ * @return {'disableTemplate'|'hideTemplate'|null} Type of the current page content focus.
48
+ */
49
+ function getPageContentFocusType(state) {
50
+ return (0, _selectors.hasPageContentFocus)(state) ? state.pageContentFocusType : null;
51
+ }
29
52
  //# 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;AACO,SAASA,aAAaA,CAAEC,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACC,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,4BAA4BA,CAAEF,KAAK,EAAG;EACrD,OAAOA,KAAK,CAACG,yBAAyB;AACvC"}
1
+ {"version":3,"names":["_selectors","require","getCanvasMode","state","canvasMode","getEditorCanvasContainerView","editorCanvasContainerView","getPageContentFocusType","hasPageContentFocus","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":";;;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAAEC,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACC,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,4BAA4BA,CAAEF,KAAK,EAAG;EACrD,OAAOA,KAAK,CAACG,yBAAyB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAAEJ,KAAK,EAAG;EAChD,OAAO,IAAAK,8BAAmB,EAAEL,KAAM,CAAC,GAAGA,KAAK,CAACM,oBAAoB,GAAG,IAAI;AACxE"}
@@ -9,6 +9,7 @@ exports.deviceType = deviceType;
9
9
  exports.editedPost = editedPost;
10
10
  exports.hasPageContentFocus = hasPageContentFocus;
11
11
  exports.listViewPanel = listViewPanel;
12
+ exports.pageContentFocusType = pageContentFocusType;
12
13
  exports.saveViewPanel = saveViewPanel;
13
14
  exports.settings = settings;
14
15
  var _data = require("@wordpress/data");
@@ -183,6 +184,22 @@ function hasPageContentFocus(state = false, action) {
183
184
  }
184
185
  return state;
185
186
  }
187
+
188
+ /**
189
+ * Reducer used to track the type of page content focus.
190
+ *
191
+ * @param {string} state Current state.
192
+ * @param {Object} action Dispatched action.
193
+ *
194
+ * @return {string} Updated state.
195
+ */
196
+ function pageContentFocusType(state = 'disableTemplate', action) {
197
+ switch (action.type) {
198
+ case 'SET_PAGE_CONTENT_FOCUS_TYPE':
199
+ return action.pageContentFocusType;
200
+ }
201
+ return state;
202
+ }
186
203
  var _default = (0, _data.combineReducers)({
187
204
  deviceType,
188
205
  settings,
@@ -192,7 +209,8 @@ var _default = (0, _data.combineReducers)({
192
209
  saveViewPanel,
193
210
  canvasMode,
194
211
  editorCanvasContainerView,
195
- hasPageContentFocus
212
+ hasPageContentFocus,
213
+ pageContentFocusType
196
214
  });
197
215
  exports.default = _default;
198
216
  //# sourceMappingURL=reducer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","hasPageContentFocus","postId","_default","combineReducers","exports","default"],"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":";;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,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;AACO,SAASG,QAAQA,CAAEH,KAAK,GAAG,CAAC,CAAC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AA"}
1
+ {"version":3,"names":["_data","require","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","hasPageContentFocus","postId","pageContentFocusType","_default","combineReducers","exports","default"],"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":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,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;AACO,SAASG,QAAQA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK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EACVI,kBAAkB;EAClBG,aAAa;EACbC,aAAa;EACbC,UAAU;EACVE,yBAAyB;EACzBG,mBAAmB;EACnBE;AACD,CAAE,CAAC;AAAAG,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
@@ -33,6 +33,7 @@ var _element = require("@wordpress/element");
33
33
  var _preferences = require("@wordpress/preferences");
34
34
  var _blockEditor = require("@wordpress/block-editor");
35
35
  var _utils = require("./utils");
36
+ var _constants = require("../utils/constants");
36
37
  /**
37
38
  * External dependencies
38
39
  */
@@ -133,7 +134,7 @@ const getSettings = (0, _rememo.default)((state, setIsInserterOpen) => {
133
134
  showIconLabels: !!__unstableGetPreference(state, 'showIconLabels'),
134
135
  __experimentalSetIsInserterOpened: setIsInserterOpen,
135
136
  __experimentalReusableBlocks: getReusableBlocks(state),
136
- __experimentalPreferPatternsOnRoot: 'wp_template' === getEditedPostType(state)
137
+ __experimentalPreferPatternsOnRoot: _constants.TEMPLATE_POST_TYPE === getEditedPostType(state)
137
138
  };
138
139
  const canUserCreateMedia = getCanUserCreateMedia(state);
139
140
  if (!canUserCreateMedia) {
@@ -294,7 +295,7 @@ const getCurrentTemplateTemplateParts = (0, _data.createRegistrySelector)(select
294
295
  const templateType = getEditedPostType(state);
295
296
  const templateId = getEditedPostId(state);
296
297
  const template = select(_coreData.store).getEditedEntityRecord('postType', templateType, templateId);
297
- const templateParts = select(_coreData.store).getEntityRecords('postType', 'wp_template_part', {
298
+ const templateParts = select(_coreData.store).getEntityRecords('postType', _constants.TEMPLATE_PART_POST_TYPE, {
298
299
  per_page: -1
299
300
  });
300
301
  return (0, _utils.getFilteredTemplatePartBlocks)(template.blocks, templateParts);
@@ -1 +1 @@
1
- {"version":3,"names":["_rememo","_interopRequireDefault","require","_coreData","_data","_deprecated","_mediaUtils","_element","_preferences","_blockEditor","_utils","__unstableGetPreference","createRegistrySelector","select","state","name","preferencesStore","get","exports","isFeatureActive","featureName","deprecated","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","createSelector","setIsInserterOpen","settings","outlineMode","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","hasPageContentFocus","postContentClientId","blockEditorStore","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateType","templateId","template","getEditedEntityRecord","templateParts","getFilteredTemplatePartBlocks","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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,uBAAuB,GAAG,IAAAC,4BAAsB,EAC1DC,MAAM,IAAM,CAAEC,KAAK,EAAEC,IAAI,KAC1BF,MAAM,CAAEG,kBAAiB,CAAC,CAACC,GAAG,CAAE,gBAAgB,EAAEF,IAAK,CACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARAG,OAAA,CAAAP,uBAAA,GAAAA,uBAAA;AASO,SAASQ,eAAeA,CAAEL,KAAK,EAAEM,WAAW,EAAG;EACrD,IAAAC,mBAAU,EAAG,4CAA2C,EAAE;IACzDC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;EAEH,OAAO,CAAC,CAAEZ,uBAAuB,CAAEG,KAAK,EAAEM,WAAY,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI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wCA,CAAA,EAAG;EAC1D,IAAArE,mBAAU,EACT,uEAAuE,EACvE;IACCC,KAAK,EAAE,KAAK;IACZoC,OAAO,EAAE;EACV,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACO,SAASiC,4BAA4BA,CAAA,EAAG;EAC9C,IAAAtE,mBAAU,EAAE,2DAA2D,EAAE;IACxEC,KAAK,EAAE,KAAK;IACZoC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAASkC,kBAAkBA,CAAA,EAAG;EACpC,IAAAvE,mBAAU,EAAE,iDAAiD,EAAE;IAC9DC,KAAK,EAAE,KAAK;IACZoC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASmC,MAAMA,CAAE/E,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAAC6C,UAAU,CAACK,OAAO,EAAE8B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAStB,mBAAmBA,CAAE1D,KAAK,EAAG;EAC5C,OAAO+E,MAAM,CAAE/E,KAAM,CAAC,GAAGA,KAAK,CAAC0D,mBAAmB,GAAG,KAAK;AAC3D"}
1
+ {"version":3,"names":["_rememo","_interopRequireDefault","require","_coreData","_data","_deprecated","_mediaUtils","_element","_preferences","_blockEditor","_utils","_constants","__unstableGetPreference","createRegistrySelector","select","state","name","preferencesStore","get","exports","isFeatureActive","featureName","deprecated","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","createSelector","setIsInserterOpen","settings","outlineMode","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","TEMPLATE_POST_TYPE","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","hasPageContentFocus","postContentClientId","blockEditorStore","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateType","templateId","template","getEditedEntityRecord","templateParts","TEMPLATE_PART_POST_TYPE","getFilteredTemplatePartBlocks","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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAMA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMU,uBAAuB,GAAG,IAAAC,4BAAsB,EAC1DC,MAAM,IAAM,CAAEC,KAAK,EAAEC,IAAI,KAC1BF,MAAM,CAAEG,kBAAiB,CAAC,CAACC,GAAG,CAAE,gBAAgB,EAAEF,IAAK,CACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARAG,OAAA,CAAAP,uBAAA,GAAAA,uBAAA;AASO,SAASQ,eAAeA,CAAEL,KAAK,EAAEM,WAAW,EAAG;EACrD,IAAAC,mBAAU,EAAG,4CAA2C,EAAE;IACzDC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;EAEH,OAAO,CAAC,CAAEZ,uBAAuB,CAAEG,KAAK,EAAEM,WAAY,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,kCAAkCA,CAAEV,KAAK,EAAG;EAC3D,OAAOA,KAAK,CAACW,UAAU;AACxB;;AAEA;AACA;AACA;AACA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KAAK;IACZqC,OAAO,EAAE;EACV,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACO,SAASkC,4BAA4BA,CAAA,EAAG;EAC9C,IAAAxE,mBAAU,EAAE,2DAA2D,EAAE;IACxEC,KAAK,EAAE,KAAK;IACZqC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAASmC,kBAAkBA,CAAA,EAAG;EACpC,IAAAzE,mBAAU,EAAE,iDAAiD,EAAE;IAC9DC,KAAK,EAAE,KAAK;IACZqC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASoC,MAAMA,CAAEjF,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAAC8C,UAAU,CAACK,OAAO,EAAE+B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASvB,mBAAmBA,CAAE3D,KAAK,EAAG;EAC5C,OAAOiF,MAAM,CAAEjF,KAAM,CAAC,GAAGA,KAAK,CAAC2D,mBAAmB,GAAG,KAAK;AAC3D"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TEMPLATE_POST_TYPE = exports.TEMPLATE_PART_POST_TYPE = exports.TEMPLATE_CUSTOM_SOURCE = exports.POST_TYPE_LABELS = exports.PATTERN_TYPES = exports.PATTERN_SYNC_TYPES = exports.PATTERN_DEFAULT_CATEGORY = exports.PATTERN_CORE_SOURCES = exports.NAVIGATION_POST_TYPE = exports.FOCUSABLE_ENTITIES = void 0;
6
+ exports.TEMPLATE_POST_TYPE = exports.TEMPLATE_PART_POST_TYPE = exports.TEMPLATE_PART_AREA_DEFAULT_CATEGORY = exports.TEMPLATE_ORIGINS = exports.POST_TYPE_LABELS = exports.PATTERN_USER_CATEGORY = exports.PATTERN_TYPES = exports.PATTERN_SYNC_TYPES = exports.PATTERN_DEFAULT_CATEGORY = exports.PATTERN_CORE_SOURCES = exports.PAGE_CONTENT_BLOCK_TYPES = exports.NAVIGATION_POST_TYPE = exports.FOCUSABLE_ENTITIES = void 0;
7
7
  var _i18n = require("@wordpress/i18n");
8
8
  var _patterns = require("@wordpress/patterns");
9
9
  var _lockUnlock = require("../lock-unlock");
@@ -24,13 +24,20 @@ const TEMPLATE_POST_TYPE = 'wp_template';
24
24
  exports.TEMPLATE_POST_TYPE = TEMPLATE_POST_TYPE;
25
25
  const TEMPLATE_PART_POST_TYPE = 'wp_template_part';
26
26
  exports.TEMPLATE_PART_POST_TYPE = TEMPLATE_PART_POST_TYPE;
27
- const TEMPLATE_CUSTOM_SOURCE = 'custom';
27
+ const TEMPLATE_ORIGINS = {
28
+ custom: 'custom',
29
+ theme: 'theme',
30
+ plugin: 'plugin'
31
+ };
32
+ exports.TEMPLATE_ORIGINS = TEMPLATE_ORIGINS;
33
+ const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';
28
34
 
29
35
  // Patterns.
30
- exports.TEMPLATE_CUSTOM_SOURCE = TEMPLATE_CUSTOM_SOURCE;
36
+ exports.TEMPLATE_PART_AREA_DEFAULT_CATEGORY = TEMPLATE_PART_AREA_DEFAULT_CATEGORY;
31
37
  const {
32
38
  PATTERN_TYPES,
33
39
  PATTERN_DEFAULT_CATEGORY,
40
+ PATTERN_USER_CATEGORY,
34
41
  PATTERN_CORE_SOURCES,
35
42
  PATTERN_SYNC_TYPES
36
43
  } = (0, _lockUnlock.unlock)(_patterns.privateApis);
@@ -38,10 +45,22 @@ const {
38
45
  // Entities that are editable in focus mode.
39
46
  exports.PATTERN_SYNC_TYPES = PATTERN_SYNC_TYPES;
40
47
  exports.PATTERN_CORE_SOURCES = PATTERN_CORE_SOURCES;
48
+ exports.PATTERN_USER_CATEGORY = PATTERN_USER_CATEGORY;
41
49
  exports.PATTERN_DEFAULT_CATEGORY = PATTERN_DEFAULT_CATEGORY;
42
50
  exports.PATTERN_TYPES = PATTERN_TYPES;
43
51
  const FOCUSABLE_ENTITIES = [TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user];
52
+
53
+ /**
54
+ * Block types that are considered to be page content. These are the only blocks
55
+ * editable when hasPageContentFocus() is true.
56
+ */
44
57
  exports.FOCUSABLE_ENTITIES = FOCUSABLE_ENTITIES;
58
+ const PAGE_CONTENT_BLOCK_TYPES = {
59
+ 'core/post-title': true,
60
+ 'core/post-featured-image': true,
61
+ 'core/post-content': true
62
+ };
63
+ exports.PAGE_CONTENT_BLOCK_TYPES = PAGE_CONTENT_BLOCK_TYPES;
45
64
  const POST_TYPE_LABELS = {
46
65
  [TEMPLATE_POST_TYPE]: (0, _i18n.__)('Template'),
47
66
  [TEMPLATE_PART_POST_TYPE]: (0, _i18n.__)('Template Part'),
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_patterns","_lockUnlock","NAVIGATION_POST_TYPE","exports","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_CUSTOM_SOURCE","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_CORE_SOURCES","PATTERN_SYNC_TYPES","unlock","patternPrivateApis","FOCUSABLE_ENTITIES","user","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_CUSTOM_SOURCE = 'custom';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_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\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":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACO,MAAMG,oBAAoB,GAAG,eAAe;;AAEnD;AAAAC,OAAA,CAAAD,oBAAA,GAAAA,oBAAA;AACO,MAAME,kBAAkB,GAAG,aAAa;AAACD,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AACzC,MAAMC,uBAAuB,GAAG,kBAAkB;AAACF,OAAA,CAAAE,uBAAA,GAAAA,uBAAA;AACnD,MAAMC,sBAAsB,GAAG,QAAQ;;AAE9C;AAAAH,OAAA,CAAAG,sBAAA,GAAAA,sBAAA;AACO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,oBAAoB;EACpBC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAmB,CAAC;;AAEhC;AAAAT,OAAA,CAAAO,kBAAA,GAAAA,kBAAA;AAAAP,OAAA,CAAAM,oBAAA,GAAAA,oBAAA;AAAAN,OAAA,CAAAK,wBAAA,GAAAA,wBAAA;AAAAL,OAAA,CAAAI,aAAA,GAAAA,aAAA;AACO,MAAMM,kBAAkB,GAAG,CACjCR,uBAAuB,EACvBH,oBAAoB,EACpBK,aAAa,CAACO,IAAI,CAClB;AAACX,OAAA,CAAAU,kBAAA,GAAAA,kBAAA;AAEK,MAAME,gBAAgB,GAAG;EAC/B,CAAEX,kBAAkB,GAAI,IAAAY,QAAE,EAAE,UAAW,CAAC;EACxC,CAAEX,uBAAuB,GAAI,IAAAW,QAAE,EAAE,eAAgB,CAAC;EAClD,CAAET,aAAa,CAACO,IAAI,GAAI,IAAAE,QAAE,EAAE,SAAU,CAAC;EACvC,CAAEd,oBAAoB,GAAI,IAAAc,QAAE,EAAE,YAAa;AAC5C,CAAC;AAACb,OAAA,CAAAY,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_i18n","require","_patterns","_lockUnlock","NAVIGATION_POST_TYPE","exports","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","unlock","patternPrivateApis","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":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACO,MAAMG,oBAAoB,GAAG,eAAe;;AAEnD;AAAAC,OAAA,CAAAD,oBAAA,GAAAA,oBAAA;AACO,MAAME,kBAAkB,GAAG,aAAa;AAACD,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AACzC,MAAMC,uBAAuB,GAAG,kBAAkB;AAACF,OAAA,CAAAE,uBAAA,GAAAA,uBAAA;AACnD,MAAMC,gBAAgB,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AAACN,OAAA,CAAAG,gBAAA,GAAAA,gBAAA;AACK,MAAMI,mCAAmC,GAAG,eAAe;;AAElE;AAAAP,OAAA,CAAAO,mCAAA,GAAAA,mCAAA;AACO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,qBAAqB;EACrBC,oBAAoB;EACpBC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAmB,CAAC;;AAEhC;AAAAd,OAAA,CAAAY,kBAAA,GAAAA,kBAAA;AAAAZ,OAAA,CAAAW,oBAAA,GAAAA,oBAAA;AAAAX,OAAA,CAAAU,qBAAA,GAAAA,qBAAA;AAAAV,OAAA,CAAAS,wBAAA,GAAAA,wBAAA;AAAAT,OAAA,CAAAQ,aAAA,GAAAA,aAAA;AACO,MAAMO,kBAAkB,GAAG,CACjCb,uBAAuB,EACvBH,oBAAoB,EACpBS,aAAa,CAACQ,IAAI,CAClB;;AAED;AACA;AACA;AACA;AAHAhB,OAAA,CAAAe,kBAAA,GAAAA,kBAAA;AAIO,MAAME,wBAAwB,GAAG;EACvC,iBAAiB,EAAE,IAAI;EACvB,0BAA0B,EAAE,IAAI;EAChC,mBAAmB,EAAE;AACtB,CAAC;AAACjB,OAAA,CAAAiB,wBAAA,GAAAA,wBAAA;AAEK,MAAMC,gBAAgB,GAAG;EAC/B,CAAEjB,kBAAkB,GAAI,IAAAkB,QAAE,EAAE,UAAW,CAAC;EACxC,CAAEjB,uBAAuB,GAAI,IAAAiB,QAAE,EAAE,eAAgB,CAAC;EAClD,CAAEX,aAAa,CAACQ,IAAI,GAAI,IAAAG,QAAE,EAAE,SAAU,CAAC;EACvC,CAAEpB,oBAAoB,GAAI,IAAAoB,QAAE,EAAE,YAAa;AAC5C,CAAC;AAACnB,OAAA,CAAAkB,gBAAA,GAAAA,gBAAA"}
@@ -19,6 +19,6 @@ function isTemplateRemovable(template) {
19
19
  if (!template) {
20
20
  return false;
21
21
  }
22
- return template.source === _constants.TEMPLATE_CUSTOM_SOURCE && !template.has_theme_file;
22
+ return template.source === _constants.TEMPLATE_ORIGINS.custom && !template.has_theme_file;
23
23
  }
24
24
  //# sourceMappingURL=is-template-removable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","require","isTemplateRemovable","template","source","TEMPLATE_CUSTOM_SOURCE","has_theme_file"],"sources":["@wordpress/edit-site/src/utils/is-template-removable.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { TEMPLATE_CUSTOM_SOURCE } 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_CUSTOM_SOURCE && ! template.has_theme_file\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,mBAAmBA,CAAEC,QAAQ,EAAG;EACvD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EAEA,OACCA,QAAQ,CAACC,MAAM,KAAKC,iCAAsB,IAAI,CAAEF,QAAQ,CAACG,cAAc;AAEzE"}
1
+ {"version":3,"names":["_constants","require","isTemplateRemovable","template","source","TEMPLATE_ORIGINS","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":";;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,mBAAmBA,CAAEC,QAAQ,EAAG;EACvD,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,KAAK;EACb;EAEA,OACCA,QAAQ,CAACC,MAAM,KAAKC,2BAAgB,CAACC,MAAM,IAAI,CAAEH,QAAQ,CAACI,cAAc;AAE1E"}
@@ -20,7 +20,7 @@ function isTemplateRevertable(template) {
20
20
  return false;
21
21
  }
22
22
  /* eslint-disable camelcase */
23
- return template?.source === _constants.TEMPLATE_CUSTOM_SOURCE && template?.has_theme_file;
23
+ return template?.source === _constants.TEMPLATE_ORIGINS.custom && template?.has_theme_file;
24
24
  /* eslint-enable camelcase */
25
25
  }
26
26
  //# sourceMappingURL=is-template-revertable.js.map