@wordpress/edit-site 5.25.0 → 5.26.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 (433) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/block-editor/back-button.js +3 -2
  4. package/build/components/block-editor/back-button.js.map +1 -1
  5. package/build/components/block-editor/resizable-editor.js +2 -2
  6. package/build/components/block-editor/resizable-editor.js.map +1 -1
  7. package/build/components/block-editor/use-post-link-props.js +27 -0
  8. package/build/components/block-editor/use-post-link-props.js.map +1 -0
  9. package/build/components/block-editor/use-site-editor-settings.js +7 -24
  10. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  11. package/build/components/create-template-part-modal/index.js +15 -7
  12. package/build/components/create-template-part-modal/index.js.map +1 -1
  13. package/build/components/editor/index.js +15 -16
  14. package/build/components/editor/index.js.map +1 -1
  15. package/build/components/editor-canvas-container/index.js +9 -7
  16. package/build/components/editor-canvas-container/index.js.map +1 -1
  17. package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
  18. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  19. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  20. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  21. package/build/components/global-styles/font-library-modal/context.js +5 -5
  22. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  23. package/build/components/global-styles/font-library-modal/font-collection.js +8 -4
  24. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  25. package/build/components/global-styles/font-library-modal/index.js +38 -21
  26. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  27. package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  28. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  29. package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -2
  30. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  31. package/build/components/global-styles/font-library-modal/local-fonts.js +26 -10
  32. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  33. package/build/components/global-styles/font-library-modal/resolvers.js +6 -6
  34. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  35. package/build/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
  36. package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
  37. package/build/components/global-styles/font-library-modal/utils/index.js +35 -38
  38. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  39. package/build/components/global-styles/preview.js +43 -1
  40. package/build/components/global-styles/preview.js.map +1 -1
  41. package/build/components/global-styles/screen-color-palette.js +16 -12
  42. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  43. package/build/components/global-styles/screen-revisions/index.js +52 -52
  44. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  45. package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -35
  46. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  47. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
  48. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  49. package/build/components/global-styles/ui.js +13 -62
  50. package/build/components/global-styles/ui.js.map +1 -1
  51. package/build/components/header-edit-mode/document-tools/index.js +8 -106
  52. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  53. package/build/components/header-edit-mode/index.js +7 -11
  54. package/build/components/header-edit-mode/index.js.map +1 -1
  55. package/build/components/header-edit-mode/mode-switcher/index.js +0 -2
  56. package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  57. package/build/components/header-edit-mode/more-menu/index.js +10 -7
  58. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  59. package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
  60. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  61. package/build/components/keyboard-shortcuts/register.js +0 -36
  62. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  63. package/build/components/layout/index.js +6 -13
  64. package/build/components/layout/index.js.map +1 -1
  65. package/build/components/page-main/index.js +4 -4
  66. package/build/components/page-main/index.js.map +1 -1
  67. package/build/components/page-pages/index.js +84 -37
  68. package/build/components/page-pages/index.js.map +1 -1
  69. package/build/components/page-patterns/dataviews-pattern-actions.js +305 -0
  70. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
  71. package/build/components/page-patterns/dataviews-patterns.js +307 -0
  72. package/build/components/page-patterns/dataviews-patterns.js.map +1 -0
  73. package/build/components/page-patterns/duplicate-menu-item.js +1 -1
  74. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  75. package/build/components/page-patterns/grid-item.js +4 -3
  76. package/build/components/page-patterns/grid-item.js.map +1 -1
  77. package/build/components/page-patterns/patterns-list.js +2 -1
  78. package/build/components/page-patterns/patterns-list.js.map +1 -1
  79. package/build/components/page-patterns/use-patterns.js +23 -13
  80. package/build/components/page-patterns/use-patterns.js.map +1 -1
  81. package/build/components/page-templates/index.js +312 -36
  82. package/build/components/page-templates/index.js.map +1 -1
  83. package/build/components/{page-patterns/pagination.js → pagination/index.js} +25 -12
  84. package/build/components/pagination/index.js.map +1 -0
  85. package/build/components/{page-pages/side-editor.js → post-preview/index.js} +8 -4
  86. package/build/components/post-preview/index.js.map +1 -0
  87. package/build/components/preferences-modal/enable-feature.js +3 -2
  88. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  89. package/build/components/preferences-modal/enable-panel-option.js +33 -0
  90. package/build/components/preferences-modal/enable-panel-option.js.map +1 -0
  91. package/build/components/preferences-modal/index.js +57 -9
  92. package/build/components/preferences-modal/index.js.map +1 -1
  93. package/build/components/revisions/index.js +3 -7
  94. package/build/components/revisions/index.js.map +1 -1
  95. package/build/components/routes/link.js +6 -2
  96. package/build/components/routes/link.js.map +1 -1
  97. package/build/components/save-button/index.js +6 -3
  98. package/build/components/save-button/index.js.map +1 -1
  99. package/build/components/sidebar/index.js +3 -11
  100. package/build/components/sidebar/index.js.map +1 -1
  101. package/build/components/sidebar-dataviews/add-new-view.js +2 -2
  102. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  103. package/build/components/sidebar-dataviews/default-views.js +18 -5
  104. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  105. package/build/components/sidebar-dataviews/index.js +3 -3
  106. package/build/components/sidebar-dataviews/index.js.map +1 -1
  107. package/build/components/sidebar-edit-mode/default-sidebar.js +1 -5
  108. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  109. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +62 -10
  110. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  111. package/build/components/sidebar-edit-mode/page-panels/index.js +1 -1
  112. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  113. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
  114. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  115. package/build/components/sidebar-edit-mode/template-panel/index.js +4 -13
  116. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  117. package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  118. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  119. package/build/components/sidebar-navigation-screen-global-styles/index.js +5 -2
  120. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  121. package/build/components/sidebar-navigation-screen-page/index.js +4 -1
  122. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  123. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +69 -0
  124. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
  125. package/build/components/style-book/index.js +38 -8
  126. package/build/components/style-book/index.js.map +1 -1
  127. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  128. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  129. package/build/hooks/commands/use-edit-mode-commands.js +11 -6
  130. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  131. package/build/index.js +12 -7
  132. package/build/index.js.map +1 -1
  133. package/build/store/actions.js +39 -44
  134. package/build/store/actions.js.map +1 -1
  135. package/build/store/private-actions.js +6 -2
  136. package/build/store/private-actions.js.map +1 -1
  137. package/build/store/reducer.js +0 -46
  138. package/build/store/reducer.js.map +1 -1
  139. package/build/store/selectors.js +32 -41
  140. package/build/store/selectors.js.map +1 -1
  141. package/build/utils/get-is-list-page.js +1 -1
  142. package/build/utils/get-is-list-page.js.map +1 -1
  143. package/build-module/components/block-editor/back-button.js +4 -3
  144. package/build-module/components/block-editor/back-button.js.map +1 -1
  145. package/build-module/components/block-editor/resizable-editor.js +2 -2
  146. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  147. package/build-module/components/block-editor/use-post-link-props.js +20 -0
  148. package/build-module/components/block-editor/use-post-link-props.js.map +1 -0
  149. package/build-module/components/block-editor/use-site-editor-settings.js +8 -25
  150. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  151. package/build-module/components/create-template-part-modal/index.js +14 -7
  152. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  153. package/build-module/components/editor/index.js +16 -17
  154. package/build-module/components/editor/index.js.map +1 -1
  155. package/build-module/components/editor-canvas-container/index.js +9 -7
  156. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  157. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
  158. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  159. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  160. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  161. package/build-module/components/global-styles/font-library-modal/context.js +7 -7
  162. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  163. package/build-module/components/global-styles/font-library-modal/font-collection.js +8 -4
  164. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  165. package/build-module/components/global-styles/font-library-modal/index.js +39 -22
  166. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  167. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  168. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  169. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +5 -2
  170. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  171. package/build-module/components/global-styles/font-library-modal/local-fonts.js +27 -11
  172. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  173. package/build-module/components/global-styles/font-library-modal/resolvers.js +5 -5
  174. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  175. package/build-module/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
  176. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
  177. package/build-module/components/global-styles/font-library-modal/utils/index.js +34 -36
  178. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  179. package/build-module/components/global-styles/preview.js +45 -3
  180. package/build-module/components/global-styles/preview.js.map +1 -1
  181. package/build-module/components/global-styles/screen-color-palette.js +17 -13
  182. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  183. package/build-module/components/global-styles/screen-revisions/index.js +53 -53
  184. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  185. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +27 -36
  186. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  187. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
  188. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  189. package/build-module/components/global-styles/ui.js +15 -64
  190. package/build-module/components/global-styles/ui.js.map +1 -1
  191. package/build-module/components/header-edit-mode/document-tools/index.js +13 -110
  192. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  193. package/build-module/components/header-edit-mode/index.js +7 -11
  194. package/build-module/components/header-edit-mode/index.js.map +1 -1
  195. package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -2
  196. package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  197. package/build-module/components/header-edit-mode/more-menu/index.js +10 -7
  198. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  199. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
  200. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  201. package/build-module/components/keyboard-shortcuts/register.js +0 -36
  202. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  203. package/build-module/components/layout/index.js +6 -13
  204. package/build-module/components/layout/index.js.map +1 -1
  205. package/build-module/components/page-main/index.js +4 -4
  206. package/build-module/components/page-main/index.js.map +1 -1
  207. package/build-module/components/page-pages/index.js +83 -36
  208. package/build-module/components/page-pages/index.js.map +1 -1
  209. package/build-module/components/page-patterns/dataviews-pattern-actions.js +292 -0
  210. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
  211. package/build-module/components/page-patterns/dataviews-patterns.js +299 -0
  212. package/build-module/components/page-patterns/dataviews-patterns.js.map +1 -0
  213. package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
  214. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
  215. package/build-module/components/page-patterns/grid-item.js +4 -3
  216. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  217. package/build-module/components/page-patterns/patterns-list.js +2 -1
  218. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  219. package/build-module/components/page-patterns/use-patterns.js +23 -13
  220. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  221. package/build-module/components/page-templates/index.js +314 -38
  222. package/build-module/components/page-templates/index.js.map +1 -1
  223. package/build-module/components/{page-patterns/pagination.js → pagination/index.js} +24 -12
  224. package/build-module/components/pagination/index.js.map +1 -0
  225. package/build-module/components/{page-pages/side-editor.js → post-preview/index.js} +7 -3
  226. package/build-module/components/post-preview/index.js.map +1 -0
  227. package/build-module/components/preferences-modal/enable-feature.js +3 -2
  228. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  229. package/build-module/components/preferences-modal/enable-panel-option.js +26 -0
  230. package/build-module/components/preferences-modal/enable-panel-option.js.map +1 -0
  231. package/build-module/components/preferences-modal/index.js +57 -9
  232. package/build-module/components/preferences-modal/index.js.map +1 -1
  233. package/build-module/components/revisions/index.js +4 -8
  234. package/build-module/components/revisions/index.js.map +1 -1
  235. package/build-module/components/routes/link.js +5 -2
  236. package/build-module/components/routes/link.js.map +1 -1
  237. package/build-module/components/save-button/index.js +6 -3
  238. package/build-module/components/save-button/index.js.map +1 -1
  239. package/build-module/components/sidebar/index.js +3 -11
  240. package/build-module/components/sidebar/index.js.map +1 -1
  241. package/build-module/components/sidebar-dataviews/add-new-view.js +1 -1
  242. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  243. package/build-module/components/sidebar-dataviews/default-views.js +17 -5
  244. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  245. package/build-module/components/sidebar-dataviews/index.js +2 -2
  246. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  247. package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -5
  248. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  249. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +64 -12
  250. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  251. package/build-module/components/sidebar-edit-mode/page-panels/index.js +2 -2
  252. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  253. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
  254. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  255. package/build-module/components/sidebar-edit-mode/template-panel/index.js +6 -15
  256. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  257. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  258. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  259. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -2
  260. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  261. package/build-module/components/sidebar-navigation-screen-page/index.js +4 -1
  262. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  263. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +61 -0
  264. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
  265. package/build-module/components/style-book/index.js +40 -10
  266. package/build-module/components/style-book/index.js.map +1 -1
  267. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  268. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  269. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -6
  270. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  271. package/build-module/index.js +12 -7
  272. package/build-module/index.js.map +1 -1
  273. package/build-module/store/actions.js +36 -41
  274. package/build-module/store/actions.js.map +1 -1
  275. package/build-module/store/private-actions.js +6 -2
  276. package/build-module/store/private-actions.js.map +1 -1
  277. package/build-module/store/reducer.js +0 -44
  278. package/build-module/store/reducer.js.map +1 -1
  279. package/build-module/store/selectors.js +30 -38
  280. package/build-module/store/selectors.js.map +1 -1
  281. package/build-module/utils/get-is-list-page.js +1 -1
  282. package/build-module/utils/get-is-list-page.js.map +1 -1
  283. package/build-style/style-rtl.css +357 -268
  284. package/build-style/style.css +357 -268
  285. package/package.json +42 -42
  286. package/src/components/add-new-template/style.scss +2 -1
  287. package/src/components/block-editor/back-button.js +4 -2
  288. package/src/components/block-editor/resizable-editor.js +1 -1
  289. package/src/components/block-editor/style.scss +1 -2
  290. package/src/components/block-editor/use-post-link-props.js +20 -0
  291. package/src/components/block-editor/use-site-editor-settings.js +10 -41
  292. package/src/components/code-editor/style.scss +0 -4
  293. package/src/components/create-template-part-modal/index.js +83 -82
  294. package/src/components/editor/index.js +24 -31
  295. package/src/components/editor-canvas-container/index.js +8 -6
  296. package/src/components/global-styles/font-library-modal/collection-font-variant.js +7 -2
  297. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  298. package/src/components/global-styles/font-library-modal/context.js +7 -7
  299. package/src/components/global-styles/font-library-modal/font-collection.js +10 -5
  300. package/src/components/global-styles/font-library-modal/index.js +44 -24
  301. package/src/components/global-styles/font-library-modal/installed-fonts.js +3 -3
  302. package/src/components/global-styles/font-library-modal/library-font-variant.js +7 -2
  303. package/src/components/global-styles/font-library-modal/local-fonts.js +53 -26
  304. package/src/components/global-styles/font-library-modal/resolvers.js +5 -5
  305. package/src/components/global-styles/font-library-modal/style.scss +5 -2
  306. package/src/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +9 -3
  307. package/src/components/global-styles/font-library-modal/utils/index.js +21 -23
  308. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +58 -0
  309. package/src/components/global-styles/preview.js +55 -3
  310. package/src/components/global-styles/screen-color-palette.js +16 -26
  311. package/src/components/global-styles/screen-revisions/index.js +91 -92
  312. package/src/components/global-styles/screen-revisions/revisions-buttons.js +37 -38
  313. package/src/components/global-styles/screen-revisions/style.scss +77 -20
  314. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +67 -0
  315. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +73 -46
  316. package/src/components/global-styles/ui.js +13 -74
  317. package/src/components/header-edit-mode/document-tools/index.js +33 -165
  318. package/src/components/header-edit-mode/index.js +6 -17
  319. package/src/components/header-edit-mode/mode-switcher/index.js +0 -4
  320. package/src/components/header-edit-mode/more-menu/index.js +9 -7
  321. package/src/components/header-edit-mode/style.scss +0 -47
  322. package/src/components/keyboard-shortcuts/edit-mode.js +1 -26
  323. package/src/components/keyboard-shortcuts/register.js +0 -43
  324. package/src/components/layout/index.js +8 -27
  325. package/src/components/layout/style.scss +10 -3
  326. package/src/components/list/style.scss +0 -5
  327. package/src/components/page/style.scss +1 -1
  328. package/src/components/page-main/index.js +8 -8
  329. package/src/components/page-pages/index.js +112 -41
  330. package/src/components/page-pages/style.scss +3 -2
  331. package/src/components/page-patterns/dataviews-pattern-actions.js +329 -0
  332. package/src/components/page-patterns/dataviews-patterns.js +380 -0
  333. package/src/components/page-patterns/duplicate-menu-item.js +1 -1
  334. package/src/components/page-patterns/grid-item.js +3 -2
  335. package/src/components/page-patterns/patterns-list.js +2 -1
  336. package/src/components/page-patterns/style.scss +89 -26
  337. package/src/components/page-patterns/use-patterns.js +24 -15
  338. package/src/components/page-templates/index.js +399 -64
  339. package/src/components/{page-patterns/pagination.js → pagination/index.js} +21 -10
  340. package/src/components/pagination/style.scss +5 -0
  341. package/src/components/post-preview/index.js +16 -0
  342. package/src/components/preferences-modal/enable-feature.js +9 -5
  343. package/src/components/preferences-modal/enable-panel-option.js +23 -0
  344. package/src/components/preferences-modal/index.js +107 -22
  345. package/src/components/revisions/index.js +8 -15
  346. package/src/components/routes/link.js +11 -3
  347. package/src/components/save-button/index.js +16 -3
  348. package/src/components/sidebar/index.js +6 -13
  349. package/src/components/sidebar-dataviews/add-new-view.js +1 -1
  350. package/src/components/sidebar-dataviews/default-views.js +23 -6
  351. package/src/components/sidebar-dataviews/index.js +2 -2
  352. package/src/components/sidebar-edit-mode/default-sidebar.js +0 -12
  353. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +85 -14
  354. package/src/components/sidebar-edit-mode/page-panels/index.js +15 -1
  355. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -12
  356. package/src/components/sidebar-edit-mode/style.scss +0 -10
  357. package/src/components/sidebar-edit-mode/template-panel/index.js +44 -40
  358. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -4
  359. package/src/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  360. package/src/components/sidebar-navigation-screen-global-styles/index.js +3 -2
  361. package/src/components/sidebar-navigation-screen-page/index.js +2 -1
  362. package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +77 -0
  363. package/src/components/site-hub/style.scss +5 -2
  364. package/src/components/style-book/index.js +65 -21
  365. package/src/components/style-book/style.scss +3 -3
  366. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
  367. package/src/hooks/commands/use-edit-mode-commands.js +8 -12
  368. package/src/index.js +11 -5
  369. package/src/store/actions.js +35 -45
  370. package/src/store/private-actions.js +7 -3
  371. package/src/store/reducer.js +0 -44
  372. package/src/store/selectors.js +32 -38
  373. package/src/store/test/actions.js +11 -39
  374. package/src/store/test/reducer.js +1 -82
  375. package/src/store/test/selectors.js +0 -24
  376. package/src/style.scss +1 -1
  377. package/src/utils/get-is-list-page.js +2 -3
  378. package/build/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
  379. package/build/components/global-styles/screen-revisions/get-revision-changes.js +0 -146
  380. package/build/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
  381. package/build/components/header-edit-mode/undo-redo/redo.js +0 -41
  382. package/build/components/header-edit-mode/undo-redo/redo.js.map +0 -1
  383. package/build/components/header-edit-mode/undo-redo/undo.js +0 -40
  384. package/build/components/header-edit-mode/undo-redo/undo.js.map +0 -1
  385. package/build/components/page-pages/side-editor.js.map +0 -1
  386. package/build/components/page-patterns/pagination.js.map +0 -1
  387. package/build/components/page-templates/dataviews-templates.js +0 -317
  388. package/build/components/page-templates/dataviews-templates.js.map +0 -1
  389. package/build/components/secondary-sidebar/inserter-sidebar.js +0 -60
  390. package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  391. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -109
  392. package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  393. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -35
  394. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
  395. package/build/components/sidebar-edit-mode/template-panel/last-revision.js +0 -73
  396. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
  397. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -219
  398. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
  399. package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
  400. package/build-module/components/global-styles/screen-revisions/get-revision-changes.js +0 -139
  401. package/build-module/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
  402. package/build-module/components/header-edit-mode/undo-redo/redo.js +0 -33
  403. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +0 -1
  404. package/build-module/components/header-edit-mode/undo-redo/undo.js +0 -32
  405. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +0 -1
  406. package/build-module/components/page-pages/side-editor.js.map +0 -1
  407. package/build-module/components/page-patterns/pagination.js.map +0 -1
  408. package/build-module/components/page-templates/dataviews-templates.js +0 -309
  409. package/build-module/components/page-templates/dataviews-templates.js.map +0 -1
  410. package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -53
  411. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  412. package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -102
  413. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  414. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -27
  415. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
  416. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +0 -65
  417. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
  418. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -209
  419. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
  420. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +0 -62
  421. package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +0 -28
  422. package/src/components/global-styles/screen-revisions/get-revision-changes.js +0 -171
  423. package/src/components/global-styles/screen-revisions/test/get-revision-changes.js +0 -191
  424. package/src/components/header-edit-mode/undo-redo/redo.js +0 -38
  425. package/src/components/header-edit-mode/undo-redo/undo.js +0 -34
  426. package/src/components/page-pages/side-editor.js +0 -14
  427. package/src/components/page-templates/dataviews-templates.js +0 -360
  428. package/src/components/secondary-sidebar/inserter-sidebar.js +0 -66
  429. package/src/components/secondary-sidebar/list-view-sidebar.js +0 -123
  430. package/src/components/secondary-sidebar/style.scss +0 -65
  431. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -26
  432. package/src/components/sidebar-edit-mode/template-panel/last-revision.js +0 -82
  433. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -279
@@ -50,16 +50,21 @@ export function initializeEditor(id, settings) {
50
50
  // so that we won't trigger unnecessary re-renders with useEffect.
51
51
  dispatch(preferencesStore).setDefaults('core/edit-site', {
52
52
  editorMode: 'visual',
53
- fixedToolbar: false,
54
- focusMode: false,
55
- distractionFree: false,
56
- keepCaretInsideBlock: false,
57
53
  welcomeGuide: true,
58
54
  welcomeGuideStyles: true,
59
55
  welcomeGuidePage: true,
60
- welcomeGuideTemplate: true,
61
- showListViewByDefault: false,
62
- showBlockBreadcrumbs: true
56
+ welcomeGuideTemplate: true
57
+ });
58
+ dispatch(preferencesStore).setDefaults('core', {
59
+ allowRightClickOverrides: true,
60
+ distractionFree: false,
61
+ fixedToolbar: false,
62
+ focusMode: false,
63
+ inactivePanels: [],
64
+ keepCaretInsideBlock: false,
65
+ openPanels: ['post-status'],
66
+ showBlockBreadcrumbs: true,
67
+ showListViewByDefault: false
63
68
  });
64
69
  dispatch(interfaceStore).setDefaultComplementaryArea('core/edit-site', 'edit-site/template');
65
70
  dispatch(editSiteStore).updateSettings(settings);
@@ -1 +1 @@
1
- {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","editorStore","interfaceStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","editorMode","fixedToolbar","focusMode","distractionFree","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","showListViewByDefault","showBlockBreadcrumbs","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","createElement","reinitializeEditor","since","version","default","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem","PluginTemplateSettingPanel"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tdistractionFree: false,\n\t\tkeepCaretInsideBlock: false,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t\tshowListViewByDefault: false,\n\t\tshowBlockBreadcrumbs: true,\n\t} );\n\n\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t'core/edit-site',\n\t\t'edit-site/template'\n\t);\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASP,KAAK,IAAIQ,WAAW,QAAQ,mBAAmB;AACxD,SAASR,KAAK,IAAIS,cAAc,QAAQ,sBAAsB;AAC9D,SAAST,KAAK,IAAIU,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAO,SAAS;AAChB,SAASZ,KAAK,IAAIa,aAAa,QAAQ,SAAS;AAChD,OAAOC,GAAG,MAAM,kBAAkB;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAG;EAChD,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEJ,EAAG,CAAC;EAC5C,MAAMK,IAAI,GAAGd,UAAU,CAAEW,MAAO,CAAC;EAEjCb,QAAQ,CAAEJ,WAAY,CAAC,CAACqB,uBAAuB,CAAC,CAAC;EACjD,MAAMC,UAAU,GAAGpB,2BAA2B,CAAC,CAAC,CAACqB,MAAM,CACtD,CAAE;IAAEC;EAAK,CAAC,KAAMA,IAAI,KAAK,eAC1B,CAAC;EACDvB,kBAAkB,CAAEqB,UAAW,CAAC;EAChClB,QAAQ,CAAEJ,WAAY,CAAC,CAACyB,4BAA4B,CAAE,WAAY,CAAC;EACnEf,yBAAyB,CAAE;IAAEgB,QAAQ,EAAE;EAAM,CAAE,CAAC;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;AAEA,OAAO,SAASkC,kBAAkBA,CAAA,EAAG;EACpCjD,UAAU,CAAE,gCAAgC,EAAE;IAC7CkD,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,aAAa,QAAQ,+CAA+C;AACxF,SAASD,OAAO,IAAIE,yBAAyB,QAAQ,6DAA6D;AAClH,SAASF,OAAO,IAAIG,kBAAkB,QAAQ,qDAAqD;AACnG,SAASH,OAAO,IAAII,0BAA0B,QAAQ,4CAA4C;AAClG,SAAS9D,KAAK,QAAQ,SAAS"}
1
+ {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","editorStore","interfaceStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","editorMode","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","createElement","reinitializeEditor","since","version","default","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem","PluginTemplateSettingPanel"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\teditorMode: 'visual',\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t'core/edit-site',\n\t\t'edit-site/template'\n\t);\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASP,KAAK,IAAIQ,WAAW,QAAQ,mBAAmB;AACxD,SAASR,KAAK,IAAIS,cAAc,QAAQ,sBAAsB;AAC9D,SAAST,KAAK,IAAIU,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;;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,38 @@ export function setIsNavigationPanelOpened() {
282
282
  }
283
283
 
284
284
  /**
285
- * Opens or closes the inserter.
285
+ * Returns an action object used to open/close the inserter.
286
286
  *
287
- * @param {boolean|Object} value Whether the inserter should be
288
- * opened (true) or closed (false).
289
- * To specify an insertion point,
290
- * use an object.
291
- * @param {string} value.rootClientId The root client ID to insert at.
292
- * @param {number} value.insertionIndex The index to insert at.
287
+ * @deprecated
293
288
  *
294
- * @return {Object} Action object.
289
+ * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).
295
290
  */
296
- export function setIsInserterOpened(value) {
297
- return {
298
- type: 'SET_IS_INSERTER_OPENED',
299
- value
300
- };
301
- }
291
+ export const setIsInserterOpened = value => ({
292
+ registry
293
+ }) => {
294
+ deprecated("dispatch( 'core/edit-site' ).setIsInserterOpened", {
295
+ since: '6.5',
296
+ alternative: "dispatch( 'core/editor').setIsInserterOpened"
297
+ });
298
+ registry.dispatch(editorStore).setIsInserterOpened(value);
299
+ };
300
+
301
+ /**
302
+ * Returns an action object used to open/close the list view.
303
+ *
304
+ * @deprecated
305
+ *
306
+ * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.
307
+ */
308
+ export const setIsListViewOpened = isOpen => ({
309
+ registry
310
+ }) => {
311
+ deprecated("dispatch( 'core/edit-site' ).setIsListViewOpened", {
312
+ since: '6.5',
313
+ alternative: "dispatch( 'core/editor').setIsListViewOpened"
314
+ });
315
+ registry.dispatch(editorStore).setIsListViewOpened(isOpen);
316
+ };
302
317
 
303
318
  /**
304
319
  * Returns an action object used to update the settings.
@@ -314,26 +329,6 @@ export function updateSettings(settings) {
314
329
  };
315
330
  }
316
331
 
317
- /**
318
- * Sets whether the list view panel should be open.
319
- *
320
- * @param {boolean} isOpen If true, opens the list view. If false, closes it.
321
- * It does not toggle the state, but sets it directly.
322
- */
323
- export const setIsListViewOpened = isOpen => ({
324
- dispatch,
325
- registry
326
- }) => {
327
- const isDistractionFree = registry.select(preferencesStore).get('core/edit-site', 'distractionFree');
328
- if (isDistractionFree && isOpen) {
329
- dispatch.toggleDistractionFree();
330
- }
331
- dispatch({
332
- type: 'SET_IS_LIST_VIEW_OPENED',
333
- isOpen
334
- });
335
- };
336
-
337
332
  /**
338
333
  * Sets whether the save view panel should be open.
339
334
  *
@@ -445,7 +440,7 @@ export const openGeneralSidebar = name => ({
445
440
  dispatch,
446
441
  registry
447
442
  }) => {
448
- const isDistractionFree = registry.select(preferencesStore).get('core/edit-site', 'distractionFree');
443
+ const isDistractionFree = registry.select(preferencesStore).get('core', 'distractionFree');
449
444
  if (isDistractionFree) {
450
445
  dispatch.toggleDistractionFree();
451
446
  }
@@ -473,7 +468,7 @@ export const switchEditorMode = mode => ({
473
468
  if (mode === 'visual') {
474
469
  speak(__('Visual editor selected'), 'assertive');
475
470
  } else if (mode === 'text') {
476
- const isDistractionFree = registry.select(preferencesStore).get('core/edit-site', 'distractionFree');
471
+ const isDistractionFree = registry.select(preferencesStore).get('core', 'distractionFree');
477
472
  if (isDistractionFree) {
478
473
  dispatch.toggleDistractionFree();
479
474
  }
@@ -513,17 +508,17 @@ export const toggleDistractionFree = () => ({
513
508
  dispatch,
514
509
  registry
515
510
  }) => {
516
- const isDistractionFree = registry.select(preferencesStore).get('core/edit-site', 'distractionFree');
511
+ const isDistractionFree = registry.select(preferencesStore).get('core', 'distractionFree');
517
512
  if (!isDistractionFree) {
518
513
  registry.batch(() => {
519
- registry.dispatch(preferencesStore).set('core/edit-site', 'fixedToolbar', true);
520
- dispatch.setIsInserterOpened(false);
521
- dispatch.setIsListViewOpened(false);
514
+ registry.dispatch(preferencesStore).set('core', 'fixedToolbar', true);
515
+ registry.dispatch(editorStore).setIsInserterOpened(false);
516
+ registry.dispatch(editorStore).setIsListViewOpened(false);
522
517
  dispatch.closeGeneralSidebar();
523
518
  });
524
519
  }
525
520
  registry.batch(() => {
526
- registry.dispatch(preferencesStore).set('core/edit-site', 'distractionFree', !isDistractionFree);
521
+ registry.dispatch(preferencesStore).set('core', 'distractionFree', !isDistractionFree);
527
522
  registry.dispatch(noticesStore).createInfoNotice(isDistractionFree ? __('Distraction free off.') : __('Distraction free on.'), {
528
523
  id: 'core/edit-site/distraction-free-mode/notice',
529
524
  type: 'snackbar'
@@ -1 +1 @@
1
- {"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","__","sprintf","store","noticesStore","coreStore","interfaceStore","blockEditorStore","editorStore","speak","preferencesStore","decodeEntities","STORE_NAME","editSiteStoreName","isTemplateRevertable","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setTemplate","type","addTemplate","template","newTemplate","saveEntityRecord","content","editEntityRecord","id","blocks","undoIgnore","postType","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","createSuccessNotice","error","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","isDistractionFree","get","toggleDistractionFree","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","path","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","clearSelectedBlock","setHasPageContentFocus","hasPageContentFocus","batch","createInfoNotice"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs } 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 { store as editorStore } from '@wordpress/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 * @deprecated\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\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\tdeprecated( `dispatch( 'core/edit-site' ).setHasPageContentFocus`, {\n\t\t\tsince: '6.5',\n\t\t} );\n\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', true );\n\t\t\t\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'distractionFree',\n\t\t\t\t\t! isDistractionFree\n\t\t\t\t);\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-site/distraction-free-mode/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;AACtE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,cAAc,QAAQ,sBAAsB;AAC9D,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;AACnE,SAASJ,KAAK,IAAIK,WAAW,QAAQ,mBAAmB;AACxD,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,UAAU,IAAIC,iBAAiB,QAAQ,aAAa;AAC7D,OAAOC,oBAAoB,MAAM,iCAAiC;AAClE,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,QACd,oBAAoB;AAC3B;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,WAAW,EAAG;EAC5C,OAAO,UAAW;IAAEC;EAAS,CAAC,EAAG;IAChCrB,UAAU,CACT,2DAA2D,EAC3D;MACCsB,KAAK,EAAE,KAAK;MACZC,WAAW,EACV;IACF,CACD,CAAC;IAEDF,QAAQ,CACNG,QAAQ,CAAE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B,CAAE/B,iBACH,CAAC;IACFxD,QAAQ,CACNG,QAAQ,CAAEnB,YAAa,CAAC,CACxB4G,gBAAgB,CAChBpC,iBAAiB,GACd3E,EAAE,CAAE,uBAAwB,CAAC,GAC7BA,EAAE,CAAE,sBAAuB,CAAC,EAC/B;MACCqC,EAAE,EAAE,6CAA6C;MACjDP,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","__","sprintf","store","noticesStore","coreStore","interfaceStore","blockEditorStore","editorStore","speak","preferencesStore","decodeEntities","STORE_NAME","editSiteStoreName","isTemplateRevertable","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setTemplate","type","addTemplate","template","newTemplate","saveEntityRecord","content","editEntityRecord","id","blocks","undoIgnore","postType","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","createSuccessNotice","error","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","setIsListViewOpened","isOpen","updateSettings","settings","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","path","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","isDistractionFree","get","toggleDistractionFree","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","clearSelectedBlock","setHasPageContentFocus","hasPageContentFocus","batch","createInfoNotice"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/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 * @deprecated\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\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 * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\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 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', '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', '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\tdeprecated( `dispatch( 'core/edit-site' ).setHasPageContentFocus`, {\n\t\t\tsince: '6.5',\n\t\t} );\n\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', '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', 'fixedToolbar', true );\n\t\t\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t\t\t\tregistry.dispatch( editorStore ).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( 'core', 'distractionFree', ! isDistractionFree );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-site/distraction-free-mode/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;AACtE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,cAAc,QAAQ,sBAAsB;AAC9D,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;AACnE,SAASJ,KAAK,IAAIK,WAAW,QAAQ,mBAAmB;AACxD,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,UAAU,IAAIC,iBAAiB,QAAQ,aAAa;AAC7D,OAAOC,oBAAoB,MAAM,iCAAiC;AAClE,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,QACd,oBAAoB;AAC3B;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,WAAW,EAAG;EAC5C,OAAO,UAAW;IAAEC;EAAS,CAAC,EAAG;IAChCrB,UAAU,CACT,2DAA2D,EAC3D;MACCsB,KAAK,EAAE,KAAK;MACZC,WAAW,EACV;IACF,CACD,CAA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AM;IACrB3F,QAAQ,CACNG,QAAQ,CAAEb,gBAAiB,CAAC,CAC5BiG,GAAG,CAAE,MAAM,EAAE,iBAAiB,EAAE,CAAER,iBAAkB,CAAC;IACvD/E,QAAQ,CACNG,QAAQ,CAAEnB,YAAa,CAAC,CACxB4G,gBAAgB,CAChBb,iBAAiB,GACdlG,EAAE,CAAE,uBAAwB,CAAC,GAC7BA,EAAE,CAAE,sBAAuB,CAAC,EAC/B;MACCqC,EAAE,EAAE,6CAA6C;MACjDP,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC"}
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { store as blockEditorStore } from '@wordpress/block-editor';
5
5
  import { store as preferencesStore } from '@wordpress/preferences';
6
+ import { store as editorStore } from '@wordpress/editor';
6
7
 
7
8
  /**
8
9
  * Action that switches the canvas mode.
@@ -20,9 +21,12 @@ export const setCanvasMode = mode => ({
20
21
  });
21
22
  // Check if the block list view should be open by default.
22
23
  // If `distractionFree` mode is enabled, the block list view should not be open.
23
- if (mode === 'edit' && registry.select(preferencesStore).get('core/edit-site', 'showListViewByDefault') && !registry.select(preferencesStore).get('core/edit-site', 'distractionFree')) {
24
- dispatch.setIsListViewOpened(true);
24
+ if (mode === 'edit' && registry.select(preferencesStore).get('core', 'showListViewByDefault') && !registry.select(preferencesStore).get('core', 'distractionFree')) {
25
+ registry.dispatch(editorStore).setIsListViewOpened(true);
26
+ } else {
27
+ registry.dispatch(editorStore).setIsListViewOpened(false);
25
28
  }
29
+ registry.dispatch(editorStore).setIsInserterOpened(false);
26
30
  };
27
31
 
28
32
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["store","blockEditorStore","preferencesStore","setCanvasMode","mode","registry","dispatch","__unstableSetEditorMode","type","select","get","setIsListViewOpened","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.setIsListViewOpened( true );\n\t\t}\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7BD,QAAQ,CAACC,QAAQ,CAAEL,gBAAiB,CAAC,CAACM,uBAAuB,CAAE,MAAO,CAAC;EACvED,QAAQ,CAAE;IACTE,IAAI,EAAE,iBAAiB;IACvBJ;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNI,MAAM,CAAEP,gBAAiB,CAAC,CAC1BQ,GAAG,CAAE,gBAAgB,EAAE,uBAAwB,CAAC,IAClD,CAAEL,QAAQ,CACRI,MAAM,CAAEP,gBAAiB,CAAC,CAC1BQ,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC,EAC3C;IACDJ,QAAQ,CAACK,mBAAmB,CAAE,IAAK,CAAC;EACrC;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEP;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTE,IAAI,EAAE,kCAAkC;IACxCK;EACD,CAAE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"names":["store","blockEditorStore","preferencesStore","editorStore","setCanvasMode","mode","registry","dispatch","__unstableSetEditorMode","type","select","get","setIsListViewOpened","setIsInserterOpened","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( true );\n\t\t} else {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t}\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;AAClE,SAASF,KAAK,IAAIG,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7BD,QAAQ,CAACC,QAAQ,CAAEN,gBAAiB,CAAC,CAACO,uBAAuB,CAAE,MAAO,CAAC;EACvED,QAAQ,CAAE;IACTE,IAAI,EAAE,iBAAiB;IACvBJ;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNI,MAAM,CAAER,gBAAiB,CAAC,CAC1BS,GAAG,CAAE,MAAM,EAAE,uBAAwB,CAAC,IACxC,CAAEL,QAAQ,CACRI,MAAM,CAAER,gBAAiB,CAAC,CAC1BS,GAAG,CAAE,MAAM,EAAE,iBAAkB,CAAC,EACjC;IACDL,QAAQ,CAACC,QAAQ,CAAEJ,WAAY,CAAC,CAACS,mBAAmB,CAAE,IAAK,CAAC;EAC7D,CAAC,MAAM;IACNN,QAAQ,CAACC,QAAQ,CAAEJ,WAAY,CAAC,CAACS,mBAAmB,CAAE,KAAM,CAAC;EAC9D;EACAN,QAAQ,CAACC,QAAQ,CAAEJ,WAAY,CAAC,CAACU,mBAAmB,CAAE,KAAM,CAAC;AAC9D,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAER;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTE,IAAI,EAAE,kCAAkC;IACxCM;EACD,CAAE,CAAC;AACJ,CAAC"}
@@ -48,48 +48,6 @@ export function editedPost(state = {}, action) {
48
48
  return state;
49
49
  }
50
50
 
51
- /**
52
- * Reducer to set the block inserter panel open or closed.
53
- *
54
- * Note: this reducer interacts with the navigation and list view panels reducers
55
- * to make sure that only one of the three panels is open at the same time.
56
- *
57
- * @param {boolean|Object} state Current state.
58
- * @param {Object} action Dispatched action.
59
- */
60
- export function blockInserterPanel(state = false, action) {
61
- switch (action.type) {
62
- case 'SET_IS_LIST_VIEW_OPENED':
63
- return action.isOpen ? false : state;
64
- case 'SET_IS_INSERTER_OPENED':
65
- return action.value;
66
- case 'SET_CANVAS_MODE':
67
- return false;
68
- }
69
- return state;
70
- }
71
-
72
- /**
73
- * Reducer to set the list view panel open or closed.
74
- *
75
- * Note: this reducer interacts with the navigation and inserter panels reducers
76
- * to make sure that only one of the three panels is open at the same time.
77
- *
78
- * @param {Object} state Current state.
79
- * @param {Object} action Dispatched action.
80
- */
81
- export function listViewPanel(state = false, action) {
82
- switch (action.type) {
83
- case 'SET_IS_INSERTER_OPENED':
84
- return action.value ? false : state;
85
- case 'SET_IS_LIST_VIEW_OPENED':
86
- return action.isOpen;
87
- case 'SET_CANVAS_MODE':
88
- return false;
89
- }
90
- return state;
91
- }
92
-
93
51
  /**
94
52
  * Reducer to set the save view panel open or closed.
95
53
  *
@@ -138,8 +96,6 @@ function editorCanvasContainerView(state = undefined, action) {
138
96
  export default combineReducers({
139
97
  settings,
140
98
  editedPost,
141
- blockInserterPanel,
142
- listViewPanel,
143
99
  saveViewPanel,
144
100
  canvasMode,
145
101
  editorCanvasContainerView
@@ -1 +1 @@
1
- {"version":3,"names":["combineReducers","settings","state","action","type","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tsettings,\n\teditedPost,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAE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ACO,MAAM;IACrB,KAAK,iBAAiB;MACrB,OAAO,KAAK;EACd;EACA,OAAOR,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASW,aAAaA,CAAEX,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACO,MAAM;IACrB,KAAK,iBAAiB;MACrB,OAAO,KAAK;EACd;EACA,OAAOR,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASY,UAAUA,CAAEZ,KAAK,GAAG,MAAM,EAAEC,MAAM,EAAG;EAC7C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAOD,MAAM,CAACY,IAAI;EACpB;EAEA,OAAOb,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASc,yBAAyBA,CAAEd,KAAK,GAAGe,SAAS,EAAEd,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACe,IAAI;EACpB;EAEA,OAAOhB,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC,QAAQ;EACRI,UAAU;EACVI,kBAAkB;EAClBG,aAAa;EACbC,aAAa;EACbC,UAAU;EACVE;AACD,CAAE,CAAC"}
1
+ {"version":3,"names":["combineReducers","settings","state","action","type","editedPost","postType","id","context","saveViewPanel","isOpen","canvasMode","mode","editorCanvasContainerView","undefined","view"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tsettings,\n\teditedPost,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK;QACR,GAAGC,MAAM,CAACF;MACX,CAAC;EACH;EAEA,OAAOC,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,UAAUA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAChD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACNE,QAAQ,EAAEH,MAAM,CAACG,QAAQ;QACzBC,EAAE,EAAEJ,MAAM,CAACI,EAAE;QACbC,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;IACF,KAAK,yBAAyB;MAC7B,OAAO;QACN,GAAGN,KAAK;QACRM,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;EACH;EAEA,OAAON,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,aAAaA,CAAEP,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACO,MAAM;IACrB,KAAK,iBAAiB;MACrB,OAAO,KAAK;EACd;EACA,OAAOR,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,UAAUA,CAAET,KAAK,GAAG,MAAM,EAAEC,MAAM,EAAG;EAC7C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAOD,MAAM,CAACS,IAAI;EACpB;EAEA,OAAOV,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASW,yBAAyBA,CAAEX,KAAK,GAAGY,SAAS,EAAEX,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACY,IAAI;EACpB;EAEA,OAAOb,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC,QAAQ;EACRI,UAAU;EACVI,aAAa;EACbE,UAAU;EACVE;AACD,CAAE,CAAC"}
@@ -14,6 +14,8 @@ import { store as editorStore } from '@wordpress/editor';
14
14
  */
15
15
  import { getFilteredTemplatePartBlocks } from './utils';
16
16
  import { TEMPLATE_PART_POST_TYPE } from '../utils/constants';
17
+ import { unlock } from '../lock-unlock';
18
+
17
19
  /**
18
20
  * @typedef {'template'|'template_type'} TemplateType Template type.
19
21
  */
@@ -153,63 +155,53 @@ export function getPage(state) {
153
155
  }
154
156
 
155
157
  /**
156
- * Returns the current opened/closed state of the inserter panel.
158
+ * Returns true if the inserter is opened.
159
+ *
160
+ * @deprecated
157
161
  *
158
162
  * @param {Object} state Global application state.
159
163
  *
160
- * @return {boolean} True if the inserter panel should be open; false if closed.
164
+ * @return {boolean} Whether the inserter is opened.
161
165
  */
162
- export function isInserterOpened(state) {
163
- return !!state.blockInserterPanel;
164
- }
166
+ export const isInserterOpened = createRegistrySelector(select => () => {
167
+ deprecated(`select( 'core/edit-site' ).isInserterOpened`, {
168
+ since: '6.5',
169
+ alternative: `select( 'core/editor' ).isInserterOpened`
170
+ });
171
+ return select(editorStore).isInserterOpened();
172
+ });
165
173
 
166
174
  /**
167
175
  * Get the insertion point for the inserter.
168
176
  *
177
+ * @deprecated
178
+ *
169
179
  * @param {Object} state Global application state.
170
180
  *
171
181
  * @return {Object} The root client ID, index to insert at and starting filter value.
172
182
  */
173
- export const __experimentalGetInsertionPoint = createRegistrySelector(select => state => {
174
- if (typeof state.blockInserterPanel === 'object') {
175
- const {
176
- rootClientId,
177
- insertionIndex,
178
- filterValue
179
- } = state.blockInserterPanel;
180
- return {
181
- rootClientId,
182
- insertionIndex,
183
- filterValue
184
- };
185
- }
186
- if (isPage(state) && select(editorStore).getRenderingMode() !== 'template-only') {
187
- const [postContentClientId] = select(blockEditorStore).__experimentalGetGlobalBlocksByName('core/post-content');
188
- if (postContentClientId) {
189
- return {
190
- rootClientId: postContentClientId,
191
- insertionIndex: undefined,
192
- filterValue: undefined
193
- };
194
- }
195
- }
196
- return {
197
- rootClientId: undefined,
198
- insertionIndex: undefined,
199
- filterValue: undefined
200
- };
183
+ export const __experimentalGetInsertionPoint = createRegistrySelector(select => () => {
184
+ deprecated(`select( 'core/edit-site' ).__experimentalGetInsertionPoint`, {
185
+ since: '6.5',
186
+ version: '6.7'
187
+ });
188
+ return unlock(select(editorStore)).getInsertionPoint();
201
189
  });
202
190
 
203
191
  /**
204
- * Returns the current opened/closed state of the list view panel.
192
+ * Returns true if the list view is opened.
205
193
  *
206
194
  * @param {Object} state Global application state.
207
195
  *
208
- * @return {boolean} True if the list view panel should be open; false if closed.
196
+ * @return {boolean} Whether the list view is opened.
209
197
  */
210
- export function isListViewOpened(state) {
211
- return state.listViewPanel;
212
- }
198
+ export const isListViewOpened = createRegistrySelector(select => () => {
199
+ deprecated(`select( 'core/edit-site' ).isListViewOpened`, {
200
+ since: '6.5',
201
+ alternative: `select( 'core/editor' ).isListViewOpened`
202
+ });
203
+ return select(editorStore).isListViewOpened();
204
+ });
213
205
 
214
206
  /**
215
207
  * Returns the current opened/closed state of the save panel.