@wordpress/edit-site 5.21.1-next.f8d8eceb.0 → 5.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/actions/index.js +86 -4
  3. package/build/components/actions/index.js.map +1 -1
  4. package/build/components/add-new-template/new-template.js +0 -7
  5. package/build/components/add-new-template/new-template.js.map +1 -1
  6. package/build/components/block-editor/use-site-editor-settings.js +54 -63
  7. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  8. package/build/components/dataviews/add-filter.js +90 -0
  9. package/build/components/dataviews/add-filter.js.map +1 -0
  10. package/build/components/dataviews/dataviews.js +23 -4
  11. package/build/components/dataviews/dataviews.js.map +1 -1
  12. package/build/components/dataviews/filters.js +36 -32
  13. package/build/components/dataviews/filters.js.map +1 -1
  14. package/build/components/dataviews/in-filter.js +22 -20
  15. package/build/components/dataviews/in-filter.js.map +1 -1
  16. package/build/components/dataviews/index.js +9 -2
  17. package/build/components/dataviews/index.js.map +1 -1
  18. package/build/components/dataviews/item-actions.js +81 -13
  19. package/build/components/dataviews/item-actions.js.map +1 -1
  20. package/build/components/dataviews/pagination.js +3 -2
  21. package/build/components/dataviews/pagination.js.map +1 -1
  22. package/build/components/dataviews/reset-filters.js +33 -0
  23. package/build/components/dataviews/reset-filters.js.map +1 -0
  24. package/build/components/dataviews/search.js +1 -0
  25. package/build/components/dataviews/search.js.map +1 -1
  26. package/build/components/dataviews/view-actions.js +27 -10
  27. package/build/components/dataviews/view-actions.js.map +1 -1
  28. package/build/components/dataviews/view-list.js +126 -5
  29. package/build/components/dataviews/view-list.js.map +1 -1
  30. package/build/components/dataviews/view-side-by-side.js +20 -0
  31. package/build/components/dataviews/view-side-by-side.js.map +1 -0
  32. package/build/components/editor/index.js +53 -53
  33. package/build/components/editor/index.js.map +1 -1
  34. package/build/components/global-styles/screen-revisions/index.js +42 -21
  35. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  36. package/build/components/global-styles/screen-root.js +3 -3
  37. package/build/components/global-styles/screen-root.js.map +1 -1
  38. package/build/components/global-styles/ui.js +3 -3
  39. package/build/components/global-styles/ui.js.map +1 -1
  40. package/build/components/global-styles-renderer/index.js +1 -1
  41. package/build/components/global-styles-renderer/index.js.map +1 -1
  42. package/build/components/header-edit-mode/document-tools/index.js +160 -0
  43. package/build/components/header-edit-mode/document-tools/index.js.map +1 -0
  44. package/build/components/header-edit-mode/index.js +48 -116
  45. package/build/components/header-edit-mode/index.js.map +1 -1
  46. package/build/components/header-edit-mode/more-menu/site-export.js +2 -6
  47. package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  48. package/build/components/layout/index.js +4 -19
  49. package/build/components/layout/index.js.map +1 -1
  50. package/build/components/list/added-by.js +1 -0
  51. package/build/components/list/added-by.js.map +1 -1
  52. package/build/components/page-content-focus-manager/back-to-page-notification.js +5 -10
  53. package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
  54. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +36 -23
  55. package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  56. package/build/components/page-main/index.js +2 -1
  57. package/build/components/page-main/index.js.map +1 -1
  58. package/build/components/page-pages/index.js +133 -78
  59. package/build/components/page-pages/index.js.map +1 -1
  60. package/build/components/page-pages/side-editor.js +25 -0
  61. package/build/components/page-pages/side-editor.js.map +1 -0
  62. package/build/components/page-patterns/grid-item.js +2 -2
  63. package/build/components/page-patterns/grid-item.js.map +1 -1
  64. package/build/components/page-patterns/patterns-list.js +3 -3
  65. package/build/components/page-patterns/patterns-list.js.map +1 -1
  66. package/build/components/page-patterns/rename-category-menu-item.js +27 -9
  67. package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
  68. package/build/components/page-patterns/use-patterns.js +1 -1
  69. package/build/components/page-patterns/use-patterns.js.map +1 -1
  70. package/build/components/page-templates/dataviews-templates.js +201 -0
  71. package/build/components/page-templates/dataviews-templates.js.map +1 -0
  72. package/build/components/page-templates/template-actions.js +168 -0
  73. package/build/components/page-templates/template-actions.js.map +1 -0
  74. package/build/components/save-button/index.js +4 -2
  75. package/build/components/save-button/index.js.map +1 -1
  76. package/build/components/sidebar/index.js +1 -2
  77. package/build/components/sidebar/index.js.map +1 -1
  78. package/build/components/sidebar-dataviews/add-new-view.js +124 -0
  79. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -0
  80. package/build/components/sidebar-dataviews/custom-dataviews-list.js +189 -0
  81. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -0
  82. package/build/components/sidebar-dataviews/dataview-item.js +71 -0
  83. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -0
  84. package/build/components/sidebar-dataviews/default-views.js +60 -0
  85. package/build/components/sidebar-dataviews/default-views.js.map +1 -0
  86. package/build/components/sidebar-dataviews/index.js +22 -37
  87. package/build/components/sidebar-dataviews/index.js.map +1 -1
  88. package/build/components/sidebar-edit-mode/default-sidebar.js +2 -6
  89. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  90. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +11 -11
  91. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  92. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
  93. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  94. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +4 -12
  95. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
  96. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +4 -12
  97. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -1
  98. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +2 -6
  99. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  100. package/build/components/sidebar-edit-mode/template-panel/hooks.js +3 -3
  101. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  102. package/build/components/sidebar-navigation-screen-global-styles/index.js +1 -1
  103. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  104. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
  105. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  106. package/build/components/sidebar-navigation-screen-page/page-details.js +4 -12
  107. package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  108. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
  109. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  110. package/build/components/site-hub/index.js +18 -6
  111. package/build/components/site-hub/index.js.map +1 -1
  112. package/build/components/start-template-options/index.js +12 -16
  113. package/build/components/start-template-options/index.js.map +1 -1
  114. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +112 -49
  115. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  116. package/build/components/template-part-converter/convert-to-regular.js +1 -1
  117. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  118. package/build/hooks/push-changes-to-global-styles/index.js +3 -1
  119. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  120. package/build/hooks/template-part-edit.js +6 -2
  121. package/build/hooks/template-part-edit.js.map +1 -1
  122. package/build/index.js +0 -3
  123. package/build/index.js.map +1 -1
  124. package/build/store/actions.js +35 -82
  125. package/build/store/actions.js.map +1 -1
  126. package/build/store/selectors.js +25 -63
  127. package/build/store/selectors.js.map +1 -1
  128. package/build/utils/constants.js +3 -3
  129. package/build/utils/constants.js.map +1 -1
  130. package/build/utils/use-activate-theme.js +8 -0
  131. package/build/utils/use-activate-theme.js.map +1 -1
  132. package/build-module/components/actions/index.js +85 -5
  133. package/build-module/components/actions/index.js.map +1 -1
  134. package/build-module/components/add-new-template/new-template.js +0 -7
  135. package/build-module/components/add-new-template/new-template.js.map +1 -1
  136. package/build-module/components/block-editor/use-site-editor-settings.js +54 -62
  137. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  138. package/build-module/components/dataviews/add-filter.js +83 -0
  139. package/build-module/components/dataviews/add-filter.js.map +1 -0
  140. package/build-module/components/dataviews/dataviews.js +22 -4
  141. package/build-module/components/dataviews/dataviews.js.map +1 -1
  142. package/build-module/components/dataviews/filters.js +34 -32
  143. package/build-module/components/dataviews/filters.js.map +1 -1
  144. package/build-module/components/dataviews/in-filter.js +20 -19
  145. package/build-module/components/dataviews/in-filter.js.map +1 -1
  146. package/build-module/components/dataviews/index.js +1 -1
  147. package/build-module/components/dataviews/index.js.map +1 -1
  148. package/build-module/components/dataviews/item-actions.js +84 -16
  149. package/build-module/components/dataviews/item-actions.js.map +1 -1
  150. package/build-module/components/dataviews/pagination.js +3 -2
  151. package/build-module/components/dataviews/pagination.js.map +1 -1
  152. package/build-module/components/dataviews/reset-filters.js +26 -0
  153. package/build-module/components/dataviews/reset-filters.js.map +1 -0
  154. package/build-module/components/dataviews/search.js +1 -0
  155. package/build-module/components/dataviews/search.js.map +1 -1
  156. package/build-module/components/dataviews/view-actions.js +28 -11
  157. package/build-module/components/dataviews/view-actions.js.map +1 -1
  158. package/build-module/components/dataviews/view-list.js +128 -7
  159. package/build-module/components/dataviews/view-list.js.map +1 -1
  160. package/build-module/components/dataviews/view-side-by-side.js +12 -0
  161. package/build-module/components/dataviews/view-side-by-side.js.map +1 -0
  162. package/build-module/components/editor/index.js +57 -57
  163. package/build-module/components/editor/index.js.map +1 -1
  164. package/build-module/components/global-styles/screen-revisions/index.js +42 -21
  165. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  166. package/build-module/components/global-styles/screen-root.js +3 -3
  167. package/build-module/components/global-styles/screen-root.js.map +1 -1
  168. package/build-module/components/global-styles/ui.js +3 -3
  169. package/build-module/components/global-styles/ui.js.map +1 -1
  170. package/build-module/components/global-styles-renderer/index.js +1 -1
  171. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  172. package/build-module/components/header-edit-mode/document-tools/index.js +152 -0
  173. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -0
  174. package/build-module/components/header-edit-mode/index.js +52 -120
  175. package/build-module/components/header-edit-mode/index.js.map +1 -1
  176. package/build-module/components/header-edit-mode/more-menu/site-export.js +2 -6
  177. package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
  178. package/build-module/components/layout/index.js +5 -20
  179. package/build-module/components/layout/index.js.map +1 -1
  180. package/build-module/components/list/added-by.js +1 -1
  181. package/build-module/components/list/added-by.js.map +1 -1
  182. package/build-module/components/page-content-focus-manager/back-to-page-notification.js +5 -10
  183. package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
  184. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +36 -23
  185. package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
  186. package/build-module/components/page-main/index.js +2 -1
  187. package/build-module/components/page-main/index.js.map +1 -1
  188. package/build-module/components/page-pages/index.js +137 -80
  189. package/build-module/components/page-pages/index.js.map +1 -1
  190. package/build-module/components/page-pages/side-editor.js +17 -0
  191. package/build-module/components/page-pages/side-editor.js.map +1 -0
  192. package/build-module/components/page-patterns/grid-item.js +2 -2
  193. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  194. package/build-module/components/page-patterns/patterns-list.js +4 -4
  195. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  196. package/build-module/components/page-patterns/rename-category-menu-item.js +25 -9
  197. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  198. package/build-module/components/page-patterns/use-patterns.js +2 -2
  199. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  200. package/build-module/components/page-templates/dataviews-templates.js +193 -0
  201. package/build-module/components/page-templates/dataviews-templates.js.map +1 -0
  202. package/build-module/components/page-templates/template-actions.js +157 -0
  203. package/build-module/components/page-templates/template-actions.js.map +1 -0
  204. package/build-module/components/save-button/index.js +4 -2
  205. package/build-module/components/save-button/index.js.map +1 -1
  206. package/build-module/components/sidebar/index.js +1 -2
  207. package/build-module/components/sidebar/index.js.map +1 -1
  208. package/build-module/components/sidebar-dataviews/add-new-view.js +116 -0
  209. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -0
  210. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +180 -0
  211. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -0
  212. package/build-module/components/sidebar-dataviews/dataview-item.js +63 -0
  213. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -0
  214. package/build-module/components/sidebar-dataviews/default-views.js +52 -0
  215. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -0
  216. package/build-module/components/sidebar-dataviews/index.js +23 -38
  217. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  218. package/build-module/components/sidebar-edit-mode/default-sidebar.js +2 -6
  219. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  220. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +12 -12
  221. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
  222. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +3 -1
  223. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  224. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +5 -13
  225. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
  226. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +5 -13
  227. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -1
  228. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +2 -6
  229. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  230. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +4 -4
  231. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
  232. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +1 -1
  233. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  234. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
  235. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  236. package/build-module/components/sidebar-navigation-screen-page/page-details.js +4 -12
  237. package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
  238. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -2
  239. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  240. package/build-module/components/site-hub/index.js +19 -7
  241. package/build-module/components/site-hub/index.js.map +1 -1
  242. package/build-module/components/start-template-options/index.js +13 -16
  243. package/build-module/components/start-template-options/index.js.map +1 -1
  244. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +112 -50
  245. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  246. package/build-module/components/template-part-converter/convert-to-regular.js +1 -1
  247. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  248. package/build-module/hooks/push-changes-to-global-styles/index.js +4 -2
  249. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  250. package/build-module/hooks/template-part-edit.js +6 -2
  251. package/build-module/hooks/template-part-edit.js.map +1 -1
  252. package/build-module/index.js +0 -3
  253. package/build-module/index.js.map +1 -1
  254. package/build-module/store/actions.js +33 -79
  255. package/build-module/store/actions.js.map +1 -1
  256. package/build-module/store/selectors.js +19 -58
  257. package/build-module/store/selectors.js.map +1 -1
  258. package/build-module/utils/constants.js +1 -1
  259. package/build-module/utils/constants.js.map +1 -1
  260. package/build-module/utils/use-activate-theme.js +8 -0
  261. package/build-module/utils/use-activate-theme.js.map +1 -1
  262. package/build-style/style-rtl.css +69 -119
  263. package/build-style/style.css +69 -119
  264. package/package.json +41 -41
  265. package/src/components/actions/index.js +113 -5
  266. package/src/components/add-new-template/new-template.js +0 -5
  267. package/src/components/block-editor/style.scss +0 -87
  268. package/src/components/block-editor/use-site-editor-settings.js +68 -89
  269. package/src/components/dataviews/README.md +77 -83
  270. package/src/components/dataviews/add-filter.js +111 -0
  271. package/src/components/dataviews/dataviews.js +20 -2
  272. package/src/components/dataviews/filters.js +56 -49
  273. package/src/components/dataviews/in-filter.js +35 -17
  274. package/src/components/dataviews/index.js +1 -1
  275. package/src/components/dataviews/item-actions.js +95 -20
  276. package/src/components/dataviews/pagination.js +5 -4
  277. package/src/components/dataviews/reset-filters.js +26 -0
  278. package/src/components/dataviews/search.js +1 -0
  279. package/src/components/dataviews/style.scss +5 -1
  280. package/src/components/dataviews/view-actions.js +39 -9
  281. package/src/components/dataviews/view-list.js +174 -3
  282. package/src/components/dataviews/view-side-by-side.js +9 -0
  283. package/src/components/editor/index.js +149 -121
  284. package/src/components/global-styles/screen-revisions/index.js +52 -25
  285. package/src/components/global-styles/screen-root.js +2 -1
  286. package/src/components/global-styles/ui.js +1 -1
  287. package/src/components/global-styles-renderer/index.js +1 -1
  288. package/src/components/header-edit-mode/document-tools/index.js +201 -0
  289. package/src/components/header-edit-mode/index.js +86 -184
  290. package/src/components/header-edit-mode/more-menu/site-export.js +2 -6
  291. package/src/components/header-edit-mode/style.scss +35 -2
  292. package/src/components/layout/index.js +4 -11
  293. package/src/components/layout/style.scss +6 -18
  294. package/src/components/list/added-by.js +1 -1
  295. package/src/components/page-content-focus-manager/back-to-page-notification.js +4 -15
  296. package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +38 -33
  297. package/src/components/page-main/index.js +6 -1
  298. package/src/components/page-pages/index.js +162 -81
  299. package/src/components/page-pages/side-editor.js +14 -0
  300. package/src/components/page-patterns/grid-item.js +3 -3
  301. package/src/components/page-patterns/patterns-list.js +10 -4
  302. package/src/components/page-patterns/rename-category-menu-item.js +29 -12
  303. package/src/components/page-patterns/use-patterns.js +3 -2
  304. package/src/components/page-templates/dataviews-templates.js +224 -0
  305. package/src/components/page-templates/template-actions.js +209 -0
  306. package/src/components/save-button/index.js +10 -5
  307. package/src/components/sidebar/index.js +1 -2
  308. package/src/components/sidebar-dataviews/add-new-view.js +141 -0
  309. package/src/components/sidebar-dataviews/custom-dataviews-list.js +227 -0
  310. package/src/components/sidebar-dataviews/dataview-item.js +67 -0
  311. package/src/components/sidebar-dataviews/default-views.js +54 -0
  312. package/src/components/sidebar-dataviews/index.js +36 -44
  313. package/src/components/sidebar-dataviews/style.scss +22 -0
  314. package/src/components/sidebar-edit-mode/default-sidebar.js +6 -6
  315. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +14 -21
  316. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +3 -0
  317. package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +10 -9
  318. package/src/components/sidebar-edit-mode/page-panels/style.scss +5 -0
  319. package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +10 -9
  320. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +6 -6
  321. package/src/components/sidebar-edit-mode/template-panel/hooks.js +11 -7
  322. package/src/components/sidebar-navigation-screen-global-styles/index.js +1 -1
  323. package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
  324. package/src/components/sidebar-navigation-screen-page/page-details.js +7 -18
  325. package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -2
  326. package/src/components/site-hub/index.js +9 -8
  327. package/src/components/start-template-options/index.js +14 -12
  328. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +117 -50
  329. package/src/components/template-part-converter/convert-to-regular.js +1 -1
  330. package/src/hooks/push-changes-to-global-styles/index.js +13 -6
  331. package/src/hooks/template-part-edit.js +4 -2
  332. package/src/index.js +0 -8
  333. package/src/store/actions.js +37 -95
  334. package/src/store/selectors.js +31 -91
  335. package/src/store/test/actions.js +11 -137
  336. package/src/store/test/selectors.js +0 -82
  337. package/src/style.scss +1 -0
  338. package/src/utils/constants.js +1 -1
  339. package/src/utils/use-activate-theme.js +5 -0
  340. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +0 -77
  341. package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +0 -1
  342. package/build/components/block-editor/block-editor-provider/index.js +0 -31
  343. package/build/components/block-editor/block-editor-provider/index.js.map +0 -1
  344. package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +0 -110
  345. package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +0 -1
  346. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +0 -84
  347. package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +0 -1
  348. package/build/components/block-editor/index.js +0 -30
  349. package/build/components/block-editor/index.js.map +0 -1
  350. package/build/components/dataviews/context.js +0 -15
  351. package/build/components/dataviews/context.js.map +0 -1
  352. package/build/components/page-pages/default-views.js +0 -60
  353. package/build/components/page-pages/default-views.js.map +0 -1
  354. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +0 -69
  355. package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +0 -1
  356. package/build-module/components/block-editor/block-editor-provider/index.js +0 -23
  357. package/build-module/components/block-editor/block-editor-provider/index.js.map +0 -1
  358. package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +0 -102
  359. package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +0 -1
  360. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +0 -78
  361. package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +0 -1
  362. package/build-module/components/block-editor/index.js +0 -22
  363. package/build-module/components/block-editor/index.js.map +0 -1
  364. package/build-module/components/dataviews/context.js +0 -7
  365. package/build-module/components/dataviews/context.js.map +0 -1
  366. package/build-module/components/page-pages/default-views.js +0 -53
  367. package/build-module/components/page-pages/default-views.js.map +0 -1
  368. package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +0 -75
  369. package/src/components/block-editor/block-editor-provider/index.js +0 -29
  370. package/src/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +0 -114
  371. package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +0 -116
  372. package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +0 -90
  373. package/src/components/block-editor/index.js +0 -28
  374. package/src/components/dataviews/context.js +0 -7
  375. package/src/components/page-pages/default-views.js +0 -58
@@ -18,7 +18,8 @@ exports.setIsNavigationPanelOpened = setIsNavigationPanelOpened;
18
18
  exports.setIsSaveViewOpened = setIsSaveViewOpened;
19
19
  exports.setNavigationMenu = setNavigationMenu;
20
20
  exports.setNavigationPanelActiveMenu = setNavigationPanelActiveMenu;
21
- exports.setTemplate = exports.setPage = void 0;
21
+ exports.setPage = setPage;
22
+ exports.setTemplate = setTemplate;
22
23
  exports.setTemplatePart = setTemplatePart;
23
24
  exports.toggleDistractionFree = exports.switchEditorMode = void 0;
24
25
  exports.toggleFeature = toggleFeature;
@@ -55,9 +56,9 @@ function toggleFeature(featureName) {
55
56
  return function ({
56
57
  registry
57
58
  }) {
58
- (0, _deprecated.default)("select( 'core/edit-site' ).toggleFeature( featureName )", {
59
+ (0, _deprecated.default)("dispatch( 'core/edit-site' ).toggleFeature( featureName )", {
59
60
  since: '6.0',
60
- alternative: "select( 'core/preferences').toggle( 'core/edit-site', featureName )"
61
+ alternative: "dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )"
61
62
  });
62
63
  registry.dispatch(_preferences.store).toggle('core/edit-site', featureName);
63
64
  };
@@ -80,42 +81,37 @@ function __experimentalSetPreviewDeviceType(deviceType) {
80
81
  /**
81
82
  * Action that sets a template, optionally fetching it from REST API.
82
83
  *
83
- * @param {number} templateId The template ID.
84
- * @param {string} templateSlug The template slug.
85
84
  * @return {Object} Action object.
86
85
  */
87
- const setTemplate = (templateId, templateSlug) => async ({
88
- dispatch,
89
- registry
90
- }) => {
91
- if (!templateSlug) {
92
- try {
93
- const template = await registry.resolveSelect(_coreData.store).getEntityRecord('postType', _constants2.TEMPLATE_POST_TYPE, templateId);
94
- templateSlug = template?.slug;
95
- } catch (error) {}
96
- }
97
- dispatch({
98
- type: 'SET_EDITED_POST',
99
- postType: _constants2.TEMPLATE_POST_TYPE,
100
- id: templateId,
101
- context: {
102
- templateSlug
103
- }
86
+ function setTemplate() {
87
+ (0, _deprecated.default)("dispatch( 'core/edit-site' ).setTemplate", {
88
+ since: '6.5',
89
+ version: '6.8',
90
+ hint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.'
104
91
  });
105
- };
92
+ return {
93
+ type: 'NOTHING'
94
+ };
95
+ }
106
96
 
107
97
  /**
108
98
  * Action that adds a new template and sets it as the current template.
109
99
  *
110
100
  * @param {Object} template The template.
111
101
  *
102
+ * @deprecated
103
+ *
112
104
  * @return {Object} Action object used to set the current template.
113
105
  */
114
- exports.setTemplate = setTemplate;
115
106
  const addTemplate = template => async ({
116
107
  dispatch,
117
108
  registry
118
109
  }) => {
110
+ (0, _deprecated.default)("dispatch( 'core/edit-site' ).addTemplate", {
111
+ since: '6.5',
112
+ version: '6.8',
113
+ hint: 'use saveEntityRecord directly'
114
+ });
119
115
  const newTemplate = await registry.dispatch(_coreData.store).saveEntityRecord('postType', _constants2.TEMPLATE_POST_TYPE, template);
120
116
  if (template.content) {
121
117
  registry.dispatch(_coreData.store).editEntityRecord('postType', _constants2.TEMPLATE_POST_TYPE, newTemplate.id, {
@@ -127,10 +123,7 @@ const addTemplate = template => async ({
127
123
  dispatch({
128
124
  type: 'SET_EDITED_POST',
129
125
  postType: _constants2.TEMPLATE_POST_TYPE,
130
- id: newTemplate.id,
131
- context: {
132
- templateSlug: newTemplate.slug
133
- }
126
+ id: newTemplate.id
134
127
  });
135
128
  };
136
129
 
@@ -204,14 +197,16 @@ function setNavigationMenu(navigationMenuId) {
204
197
  *
205
198
  * @param {string} postType The entity's post type.
206
199
  * @param {string} postId The entity's ID.
200
+ * @param {Object} context The entity's context.
207
201
  *
208
202
  * @return {Object} Action object.
209
203
  */
210
- function setEditedEntity(postType, postId) {
204
+ function setEditedEntity(postType, postId, context) {
211
205
  return {
212
206
  type: 'SET_EDITED_POST',
213
207
  postType,
214
- id: postId
208
+ id: postId,
209
+ context
215
210
  };
216
211
  }
217
212
 
@@ -246,61 +241,20 @@ function setEditedPostContext(context) {
246
241
  * Resolves the template for a page and displays both. If no path is given, attempts
247
242
  * to use the postId to generate a path like `?p=${ postId }`.
248
243
  *
249
- * @param {Object} page The page object.
250
- * @param {string} page.type The page type.
251
- * @param {string} page.slug The page slug.
252
- * @param {string} page.path The page path.
253
- * @param {Object} page.context The page context.
244
+ * @deprecated
254
245
  *
255
246
  * @return {number} The resolved template ID for the page route.
256
247
  */
257
- const setPage = page => async ({
258
- dispatch,
259
- registry
260
- }) => {
261
- let template;
262
- const getDefaultTemplate = async slug => (0, _apiFetch.default)({
263
- path: (0, _url.addQueryArgs)('/wp/v2/templates/lookup', {
264
- slug: `page-${slug}`
265
- })
266
- });
267
- if (page.path) {
268
- template = await registry.resolveSelect(_coreData.store).__experimentalGetTemplateForLink(page.path);
269
- } else {
270
- const editedEntity = await registry.resolveSelect(_coreData.store).getEditedEntityRecord('postType', page.context?.postType || 'post', page.context?.postId);
271
- const currentTemplateSlug = editedEntity?.template;
272
- if (currentTemplateSlug) {
273
- const currentTemplate = (await registry.resolveSelect(_coreData.store).getEntityRecords('postType', _constants2.TEMPLATE_POST_TYPE, {
274
- per_page: -1
275
- }))?.find(({
276
- slug
277
- }) => slug === currentTemplateSlug);
278
- if (currentTemplate) {
279
- template = currentTemplate;
280
- } else {
281
- // If a page has a `template` set and is not included in the list
282
- // of the current theme's templates, query for current theme's default template.
283
- template = await getDefaultTemplate(editedEntity?.slug);
284
- }
285
- } else {
286
- // Page's `template` is empty, that indicates we need to use the default template for the page.
287
- template = await getDefaultTemplate(editedEntity?.slug);
288
- }
289
- }
290
- if (!template) {
291
- return;
292
- }
293
- dispatch({
294
- type: 'SET_EDITED_POST',
295
- postType: _constants2.TEMPLATE_POST_TYPE,
296
- id: template.id,
297
- context: {
298
- ...page.context,
299
- templateSlug: template.slug
300
- }
248
+ function setPage() {
249
+ (0, _deprecated.default)("dispatch( 'core/edit-site' ).setPage", {
250
+ since: '6.5',
251
+ version: '6.8',
252
+ hint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.'
301
253
  });
302
- return template.id;
303
- };
254
+ return {
255
+ type: 'NOTHING'
256
+ };
257
+ }
304
258
 
305
259
  /**
306
260
  * Action that sets the active navigation panel menu.
@@ -309,7 +263,6 @@ const setPage = page => async ({
309
263
  *
310
264
  * @return {Object} Action object.
311
265
  */
312
- exports.setPage = setPage;
313
266
  function setNavigationPanelActiveMenu() {
314
267
  (0, _deprecated.default)("dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu", {
315
268
  since: '6.2',
@@ -1 +1 @@
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,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;AACA,IAAAc,WAAA,GAAAd,OAAA;AArBA;AACA;AACA;;AAcA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACO,SAASe,aAAaA,C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,CAAE,CAAC;AACJ,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAnG,OAAA,CAAAkG,sBAAA,GAAAA,sBAAA;AAKO,MAAMnC,qBAAqB,GACjCA,CAAA,KACA,CAAE;EAAElF,QAAQ;EAAEJ;AAAS,CAAC,KAAM;EAC7B,MAAMoF,iBAAiB,GAAGpF,QAAQ,CAChCoC,MAAM,CAAE/B,kBAAiB,CAAC,CAC1BgF,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC;EAC5C,IAAK,CAAED,iBAAiB,EAAG;IAC1BpF,QAAQ,CAAC2H,KAAK,CAAE,MAAM;MACrB3H,QAAQ,CACNI,QAAQ,CAAEC,kBAAiB,CAAC,CAC5BgH,GAAG,CAAE,gBAAgB,EAAE,cAAc,EAAE,KAAM,CAAC;MAChDjH,QAAQ,CAAC0E,mBAAmB,CAAE,KAAM,CAAC;MACrC1E,QAAQ,CAAC8E,mBAAmB,CAAE,KAAM,CAAC;MACrC9E,QAAQ,CAAC6G,mBAAmB,CAAC,CAAC;IAC/B,CAAE,CAAC;EACJ;EACAjH,QAAQ,CAAC2H,KAAK,CAAE,MAAM;IACrB3H,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"}
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","version","hint","addTemplate","template","newTemplate","coreStore","saveEntityRecord","TEMPLATE_POST_TYPE","content","editEntityRecord","id","blocks","parse","undoIgnore","postType","exports","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","noticesStore","createSuccessNotice","sprintf","__","decodeEntities","error","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","TEMPLATE_PART_POST_TYPE","setNavigationMenu","navigationMenuId","NAVIGATION_POST_TYPE","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","isDistractionFree","get","toggleDistractionFree","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","isTemplateRevertable","templateEntityConfig","getEntityConfig","fileTemplatePath","addQueryArgs","baseURL","source","fileTemplate","apiFetch","path","serializeBlocks","blocksForSerialization","__unstableSerializeAndClean","edited","getEditedEntityRecord","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(\n\t\t\t\"dispatch( 'core/edit-site' ).toggleFeature( featureName )\",\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative:\n\t\t\t\t\t\"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t\t}\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 * @return {Object} Action object.\n */\nexport function setTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setTemplate\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\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 * @deprecated\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\tdeprecated( \"dispatch( 'core/edit-site' ).addTemplate\", {\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t\thint: 'use saveEntityRecord directly',\n\t\t} );\n\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} );\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 * @param {Object} context The entity's context.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId, context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t\tcontext,\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 * @deprecated\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setPage() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setPage\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\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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AA,KACA,CAAE;EAAEjE,QAAQ;EAAEJ;AAAS,CAAC,KAAM;EAC7B,MAAMmE,iBAAiB,GAAGnE,QAAQ,CAChC+B,MAAM,CAAE1B,kBAAiB,CAAC,CAC1B+D,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC;EAC5C,IAAK,CAAED,iBAAiB,EAAG;IAC1BnE,QAAQ,CAAC8G,KAAK,CAAE,MAAM;MACrB9G,QAAQ,CACNI,QAAQ,CAAEC,kBAAiB,CAAC,CAC5BmG,GAAG,CAAE,gBAAgB,EAAE,cAAc,EAAE,KAAM,CAAC;MAChDpG,QAAQ,CAACyD,mBAAmB,CAAE,KAAM,CAAC;MACrCzD,QAAQ,CAAC6D,mBAAmB,CAAE,KAAM,CAAC;MACrC7D,QAAQ,CAACgG,mBAAmB,CAAC,CAAC;IAC/B,CAAE,CAAC;EACJ;EACApG,QAAQ,CAAC8G,KAAK,CAAE,MAAM;IACrB9G,QAAQ,CACNI,QAAQ,CAAEC,kBAAiB,CAAC,CAC5BmG,GAAG,CACH,gBAAgB,EAChB,iBAAiB,EACjB,CAAErC,iBACH,CAAC;IACFnE,QAAQ,CACNI,QAAQ,CAAEgC,cAAa,CAAC,CACxB2E,gBAAgB,CAChB5C,iBAAiB,GACd,IAAA5B,QAAE,EAAE,uBAAwB,CAAC,GAC7B,IAAAA,QAAE,EAAE,sBAAuB,CAAC,EAC/B;MACClB,EAAE,EAAE,6CAA6C;MACjDZ,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC;AAACiB,OAAA,CAAA2C,qBAAA,GAAAA,qBAAA"}
@@ -6,38 +6,33 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.__experimentalGetInsertionPoint = void 0;
8
8
  exports.__experimentalGetPreviewDeviceType = __experimentalGetPreviewDeviceType;
9
- exports.getCanUserCreateMedia = exports.__unstableGetPreference = void 0;
9
+ exports.getCanUserCreateMedia = void 0;
10
10
  exports.getCurrentTemplateNavigationPanelSubMenu = getCurrentTemplateNavigationPanelSubMenu;
11
11
  exports.getCurrentTemplateTemplateParts = void 0;
12
12
  exports.getEditedPostContext = getEditedPostContext;
13
13
  exports.getEditedPostId = getEditedPostId;
14
14
  exports.getEditedPostType = getEditedPostType;
15
- exports.getEditorMode = getEditorMode;
15
+ exports.getEditorMode = void 0;
16
16
  exports.getHomeTemplateId = getHomeTemplateId;
17
17
  exports.getNavigationPanelActiveMenu = getNavigationPanelActiveMenu;
18
18
  exports.getPage = getPage;
19
- exports.getSettings = exports.getReusableBlocks = void 0;
19
+ exports.getReusableBlocks = void 0;
20
+ exports.getSettings = getSettings;
20
21
  exports.hasPageContentFocus = hasPageContentFocus;
21
- exports.isFeatureActive = isFeatureActive;
22
+ exports.isFeatureActive = void 0;
22
23
  exports.isInserterOpened = isInserterOpened;
23
24
  exports.isListViewOpened = isListViewOpened;
24
25
  exports.isNavigationOpened = isNavigationOpened;
25
26
  exports.isPage = isPage;
26
27
  exports.isSaveViewOpened = isSaveViewOpened;
27
- var _rememo = _interopRequireDefault(require("rememo"));
28
28
  var _coreData = require("@wordpress/core-data");
29
29
  var _data = require("@wordpress/data");
30
30
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
31
- var _mediaUtils = require("@wordpress/media-utils");
32
31
  var _element = require("@wordpress/element");
33
32
  var _preferences = require("@wordpress/preferences");
34
33
  var _blockEditor = require("@wordpress/block-editor");
35
34
  var _utils = require("./utils");
36
35
  var _constants = require("../utils/constants");
37
- /**
38
- * External dependencies
39
- */
40
-
41
36
  /**
42
37
  * WordPress dependencies
43
38
  */
@@ -50,17 +45,6 @@ var _constants = require("../utils/constants");
50
45
  * @typedef {'template'|'template_type'} TemplateType Template type.
51
46
  */
52
47
 
53
- /**
54
- * Helper for getting a preference from the preferences store.
55
- *
56
- * This is only present so that `getSettings` doesn't need to be made a
57
- * registry selector.
58
- *
59
- * It's unstable because the selector needs to be exported and so part of the
60
- * public API to work.
61
- */
62
- const __unstableGetPreference = (0, _data.createRegistrySelector)(select => (state, name) => select(_preferences.store).get('core/edit-site', name));
63
-
64
48
  /**
65
49
  * Returns whether the given feature is enabled or not.
66
50
  *
@@ -70,14 +54,13 @@ const __unstableGetPreference = (0, _data.createRegistrySelector)(select => (sta
70
54
  *
71
55
  * @return {boolean} Is active.
72
56
  */
73
- exports.__unstableGetPreference = __unstableGetPreference;
74
- function isFeatureActive(state, featureName) {
57
+ const isFeatureActive = (0, _data.createRegistrySelector)(select => (_, featureName) => {
75
58
  (0, _deprecated.default)(`select( 'core/edit-site' ).isFeatureActive`, {
76
59
  since: '6.0',
77
60
  alternative: `select( 'core/preferences' ).get`
78
61
  });
79
- return !!__unstableGetPreference(state, featureName);
80
- }
62
+ return !!select(_preferences.store).get('core/edit-site', featureName);
63
+ });
81
64
 
82
65
  /**
83
66
  * Returns the current editing canvas device type.
@@ -86,6 +69,7 @@ function isFeatureActive(state, featureName) {
86
69
  *
87
70
  * @return {string} Device type.
88
71
  */
72
+ exports.isFeatureActive = isFeatureActive;
89
73
  function __experimentalGetPreviewDeviceType(state) {
90
74
  return state.deviceType;
91
75
  }
@@ -108,6 +92,10 @@ const getCanUserCreateMedia = (0, _data.createRegistrySelector)(select => () =>
108
92
  */
109
93
  exports.getCanUserCreateMedia = getCanUserCreateMedia;
110
94
  const getReusableBlocks = (0, _data.createRegistrySelector)(select => () => {
95
+ (0, _deprecated.default)("select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )", {
96
+ since: '6.5',
97
+ version: '6.8'
98
+ });
111
99
  const isWeb = _element.Platform.OS === 'web';
112
100
  return isWeb ? select(_coreData.store).getEntityRecords('postType', 'wp_block', {
113
101
  per_page: -1
@@ -115,50 +103,23 @@ const getReusableBlocks = (0, _data.createRegistrySelector)(select => () => {
115
103
  });
116
104
 
117
105
  /**
118
- * Returns the settings, taking into account active features and permissions.
106
+ * Returns the site editor settings.
119
107
  *
120
- * @param {Object} state Global application state.
121
- * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.
108
+ * @param {Object} state Global application state.
122
109
  *
123
110
  * @return {Object} Settings.
124
111
  */
125
112
  exports.getReusableBlocks = getReusableBlocks;
126
- const getSettings = (0, _rememo.default)((state, setIsInserterOpen) => {
127
- const settings = {
128
- ...state.settings,
129
- outlineMode: true,
130
- focusMode: !!__unstableGetPreference(state, 'focusMode'),
131
- isDistractionFree: !!__unstableGetPreference(state, 'distractionFree'),
132
- hasFixedToolbar: !!__unstableGetPreference(state, 'fixedToolbar'),
133
- keepCaretInsideBlock: !!__unstableGetPreference(state, 'keepCaretInsideBlock'),
134
- showIconLabels: !!__unstableGetPreference(state, 'showIconLabels'),
135
- __experimentalSetIsInserterOpened: setIsInserterOpen,
136
- __experimentalReusableBlocks: getReusableBlocks(state),
137
- __experimentalPreferPatternsOnRoot: _constants.TEMPLATE_POST_TYPE === getEditedPostType(state)
138
- };
139
- const canUserCreateMedia = getCanUserCreateMedia(state);
140
- if (!canUserCreateMedia) {
141
- return settings;
142
- }
143
- settings.mediaUpload = ({
144
- onError,
145
- ...rest
146
- }) => {
147
- (0, _mediaUtils.uploadMedia)({
148
- wpAllowedMimeTypes: state.settings.allowedMimeTypes,
149
- onError: ({
150
- message
151
- }) => onError(message),
152
- ...rest
153
- });
154
- };
155
- return settings;
156
- }, state => [getCanUserCreateMedia(state), state.settings, __unstableGetPreference(state, 'focusMode'), __unstableGetPreference(state, 'distractionFree'), __unstableGetPreference(state, 'fixedToolbar'), __unstableGetPreference(state, 'keepCaretInsideBlock'), __unstableGetPreference(state, 'showIconLabels'), getReusableBlocks(state), getEditedPostType(state)]);
113
+ function getSettings(state) {
114
+ // It is important that we don't inject anything into these settings locally.
115
+ // The reason for this is that we have an effect in place that calls setSettings based on the previous value of getSettings.
116
+ // If we add computed settings here, we'll be adding these computed settings to the state which is very unexpected.
117
+ return state.settings;
118
+ }
157
119
 
158
120
  /**
159
121
  * @deprecated
160
122
  */
161
- exports.getSettings = getSettings;
162
123
  function getHomeTemplateId() {
163
124
  (0, _deprecated.default)("select( 'core/edit-site' ).getHomeTemplateId", {
164
125
  since: '6.2',
@@ -308,13 +269,14 @@ const getCurrentTemplateTemplateParts = (0, _data.createRegistrySelector)(select
308
269
  * @return {string} Editing mode.
309
270
  */
310
271
  exports.getCurrentTemplateTemplateParts = getCurrentTemplateTemplateParts;
311
- function getEditorMode(state) {
312
- return __unstableGetPreference(state, 'editorMode');
313
- }
272
+ const getEditorMode = (0, _data.createRegistrySelector)(select => () => {
273
+ return select(_preferences.store).get('core/edit-site', 'editorMode');
274
+ });
314
275
 
315
276
  /**
316
277
  * @deprecated
317
278
  */
279
+ exports.getEditorMode = getEditorMode;
318
280
  function getCurrentTemplateNavigationPanelSubMenu() {
319
281
  (0, _deprecated.default)("dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu", {
320
282
  since: '6.2',
@@ -1 +1 @@
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","templateParts","TEMPLATE_PART_POST_TYPE","clientIds","blocks","getBlocksByClientId","getFilteredTemplatePartBlocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../utils/constants';\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Helper for getting a preference from the preferences store.\n *\n * This is only present so that `getSettings` doesn't need to be made a\n * registry selector.\n *\n * It's unstable because the selector needs to be exported and so part of the\n * public API to work.\n */\nexport const __unstableGetPreference = createRegistrySelector(\n\t( select ) => ( state, name ) =>\n\t\tselect( preferencesStore ).get( 'core/edit-site', name )\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, featureName ) {\n\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\treturn !! __unstableGetPreference( state, featureName );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: !! __unstableGetPreference( state, 'focusMode' ),\n\t\t\tisDistractionFree: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasFixedToolbar: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tshowIconLabels: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\tTEMPLATE_POST_TYPE === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\t__unstableGetPreference( state, 'focusMode' ),\n\t\t__unstableGetPreference( state, 'distractionFree' ),\n\t\t__unstableGetPreference( state, 'fixedToolbar' ),\n\t\t__unstableGetPreference( state, 'keepCaretInsideBlock' ),\n\t\t__unstableGetPreference( state, 'showIconLabels' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif ( hasPageContentFocus( state ) ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\tconst clientIds =\n\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t'core/template-part'\n\t\t\t);\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn __unstableGetPreference( state, 'editorMode' );\n}\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Whether or not the editor has a page loaded into it.\n *\n * @see setPage\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor has a page loaded into it.\n */\nexport function isPage( state ) {\n\treturn !! state.editedPost.context?.postId;\n}\n\n/**\n * Whether or not the editor allows only page content to be edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus( state ) {\n\treturn isPage( state ) ? state.hasPageContentFocus : false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,G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KAAK;IACZqC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASkC,MAAMA,CAAE/E,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAAC8C,UAAU,CAACK,OAAO,EAAE6B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASrB,mBAAmBA,CAAE3D,KAAK,EAAG;EAC5C,OAAO+E,MAAM,CAAE/E,KAAM,CAAC,GAAGA,KAAK,CAAC2D,mBAAmB,GAAG,KAAK;AAC3D"}
1
+ {"version":3,"names":["_coreData","require","_data","_deprecated","_interopRequireDefault","_element","_preferences","_blockEditor","_utils","_constants","isFeatureActive","createRegistrySelector","select","_","featureName","deprecated","since","alternative","preferencesStore","get","exports","__experimentalGetPreviewDeviceType","state","deviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","version","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","settings","getHomeTemplateId","getEditedPostType","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","hasPageContentFocus","postContentClientId","blockEditorStore","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateParts","TEMPLATE_PART_POST_TYPE","clientIds","blocks","getBlocksByClientId","getFilteredTemplatePartBlocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\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 { TEMPLATE_PART_POST_TYPE } from '../utils/constants';\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\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 const isFeatureActive = createRegistrySelector(\n\t( select ) => ( _, featureName ) => {\n\t\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `select( 'core/preferences' ).get`,\n\t\t} );\n\n\t\treturn !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\tfeatureName\n\t\t);\n\t}\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\tdeprecated(\n\t\t\"select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t}\n\t);\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 site editor settings.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Settings.\n */\nexport function getSettings( state ) {\n\t// It is important that we don't inject anything into these settings locally.\n\t// The reason for this is that we have an effect in place that calls setSettings based on the previous value of getSettings.\n\t// If we add computed settings here, we'll be adding these computed settings to the state which is very unexpected.\n\treturn state.settings;\n}\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif ( hasPageContentFocus( state ) ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\tconst clientIds =\n\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t'core/template-part'\n\t\t\t);\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector( ( select ) => () => {\n\treturn select( preferencesStore ).get( 'core/edit-site', '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,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAdA;AACA;AACA;;AAQA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,eAAe,GAAG,IAAAC,4BAAsB,EAClDC,MAAM,IAAM,CAAEC,CAAC,EAAEC,WAAW,KAAM;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M,kBAAiB,CAAC,CAACC,GAAG,CAAE,gBAAgB,EAAE,YAAa,CAAC;AACxE,CAAE,CAAC;;AAEH;AACA;AACA;AAFAC,OAAA,CAAA+C,aAAA,GAAAA,aAAA;AAGO,SAASC,wCAAwCA,CAAA,EAAG;EAC1D,IAAArD,mBAAU,EACT,uEAAuE,EACvE;IACCC,KAAK,EAAE,KAAK;IACZY,OAAO,EAAE;EACV,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACO,SAASyC,4BAA4BA,CAAA,EAAG;EAC9C,IAAAtD,mBAAU,EAAE,2DAA2D,EAAE;IACxEC,KAAK,EAAE,KAAK;IACZY,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAAS0C,kBAAkBA,CAAA,EAAG;EACpC,IAAAvD,mBAAU,EAAE,iDAAiD,EAAE;IAC9DC,KAAK,EAAE,KAAK;IACZY,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS2C,MAAMA,CAAEjD,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAACgB,UAAU,CAACK,OAAO,EAAE6B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASrB,mBAAmBA,CAAE7B,KAAK,EAAG;EAC5C,OAAOiD,MAAM,CAAEjD,KAAM,CAAC,GAAGA,KAAK,CAAC6B,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_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;
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.PAGE_CONTENT_BLOCK_TYPES = exports.NAVIGATION_POST_TYPE = exports.FOCUSABLE_ENTITIES = exports.EXCLUDED_PATTERN_SOURCES = void 0;
7
7
  var _i18n = require("@wordpress/i18n");
8
8
  var _patterns = require("@wordpress/patterns");
9
9
  var _lockUnlock = require("../lock-unlock");
@@ -38,13 +38,13 @@ const {
38
38
  PATTERN_TYPES,
39
39
  PATTERN_DEFAULT_CATEGORY,
40
40
  PATTERN_USER_CATEGORY,
41
- PATTERN_CORE_SOURCES,
41
+ EXCLUDED_PATTERN_SOURCES,
42
42
  PATTERN_SYNC_TYPES
43
43
  } = (0, _lockUnlock.unlock)(_patterns.privateApis);
44
44
 
45
45
  // Entities that are editable in focus mode.
46
46
  exports.PATTERN_SYNC_TYPES = PATTERN_SYNC_TYPES;
47
- exports.PATTERN_CORE_SOURCES = PATTERN_CORE_SOURCES;
47
+ exports.EXCLUDED_PATTERN_SOURCES = EXCLUDED_PATTERN_SOURCES;
48
48
  exports.PATTERN_USER_CATEGORY = PATTERN_USER_CATEGORY;
49
49
  exports.PATTERN_DEFAULT_CATEGORY = PATTERN_DEFAULT_CATEGORY;
50
50
  exports.PATTERN_TYPES = PATTERN_TYPES;