@wordpress/edit-site 5.24.1 → 5.25.1-next.79a6196f.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 (652) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/add-new-template/add-custom-template-modal-content.js +2 -3
  4. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  5. package/build/components/block-editor/back-button.js +3 -2
  6. package/build/components/block-editor/back-button.js.map +1 -1
  7. package/build/components/block-editor/editor-canvas.js +48 -23
  8. package/build/components/block-editor/editor-canvas.js.map +1 -1
  9. package/build/components/block-editor/resizable-editor.js +2 -2
  10. package/build/components/block-editor/resizable-editor.js.map +1 -1
  11. package/build/components/block-editor/site-editor-canvas.js +5 -54
  12. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  13. package/build/components/block-editor/use-post-link-props.js +27 -0
  14. package/build/components/block-editor/use-post-link-props.js.map +1 -0
  15. package/build/components/block-editor/use-site-editor-settings.js +15 -23
  16. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  17. package/build/components/create-template-part-modal/index.js +15 -7
  18. package/build/components/create-template-part-modal/index.js.map +1 -1
  19. package/build/components/editor/index.js +21 -33
  20. package/build/components/editor/index.js.map +1 -1
  21. package/build/components/editor-canvas-container/index.js +9 -7
  22. package/build/components/editor-canvas-container/index.js.map +1 -1
  23. package/build/components/global-styles/font-library-modal/collection-font-variant.js +11 -7
  24. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  25. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  26. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  27. package/build/components/global-styles/font-library-modal/context.js +6 -6
  28. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  29. package/build/components/global-styles/font-library-modal/font-collection.js +8 -4
  30. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  31. package/build/components/global-styles/font-library-modal/index.js +38 -21
  32. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  33. package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  34. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  35. package/build/components/global-styles/font-library-modal/library-font-variant.js +11 -7
  36. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  37. package/build/components/global-styles/font-library-modal/local-fonts.js +26 -10
  38. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  39. package/build/components/global-styles/font-library-modal/resolvers.js +6 -6
  40. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  41. package/build/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
  42. package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
  43. package/build/components/global-styles/font-library-modal/utils/index.js +35 -38
  44. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  45. package/build/components/global-styles/preview.js +43 -1
  46. package/build/components/global-styles/preview.js.map +1 -1
  47. package/build/components/global-styles/screen-color-palette.js +16 -12
  48. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  49. package/build/components/global-styles/screen-revisions/index.js +54 -58
  50. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  51. package/build/components/global-styles/screen-revisions/revisions-buttons.js +56 -15
  52. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  53. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
  54. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  55. package/build/components/global-styles/ui.js +13 -62
  56. package/build/components/global-styles/ui.js.map +1 -1
  57. package/build/components/header-edit-mode/document-tools/index.js +15 -106
  58. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  59. package/build/components/header-edit-mode/index.js +21 -47
  60. package/build/components/header-edit-mode/index.js.map +1 -1
  61. package/build/components/header-edit-mode/mode-switcher/index.js +0 -2
  62. package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  63. package/build/components/header-edit-mode/more-menu/index.js +19 -14
  64. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  65. package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
  66. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  67. package/build/components/keyboard-shortcuts/register.js +0 -36
  68. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  69. package/build/components/layout/index.js +15 -21
  70. package/build/components/layout/index.js.map +1 -1
  71. package/build/components/page/header.js +2 -1
  72. package/build/components/page/header.js.map +1 -1
  73. package/build/components/page-main/index.js +4 -4
  74. package/build/components/page-main/index.js.map +1 -1
  75. package/build/components/page-pages/index.js +102 -52
  76. package/build/components/page-pages/index.js.map +1 -1
  77. package/build/components/page-patterns/dataviews-pattern-actions.js +305 -0
  78. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
  79. package/build/components/page-patterns/dataviews-patterns.js +307 -0
  80. package/build/components/page-patterns/dataviews-patterns.js.map +1 -0
  81. package/build/components/page-patterns/duplicate-menu-item.js +1 -1
  82. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  83. package/build/components/page-patterns/grid-item.js +4 -3
  84. package/build/components/page-patterns/grid-item.js.map +1 -1
  85. package/build/components/page-patterns/patterns-list.js +3 -3
  86. package/build/components/page-patterns/patterns-list.js.map +1 -1
  87. package/build/components/page-patterns/rename-menu-item.js +3 -0
  88. package/build/components/page-patterns/rename-menu-item.js.map +1 -1
  89. package/build/components/page-patterns/use-patterns.js +23 -13
  90. package/build/components/page-patterns/use-patterns.js.map +1 -1
  91. package/build/components/page-templates/index.js +312 -36
  92. package/build/components/page-templates/index.js.map +1 -1
  93. package/build/components/{page-patterns/pagination.js → pagination/index.js} +25 -12
  94. package/build/components/pagination/index.js.map +1 -0
  95. package/build/components/{page-pages/side-editor.js → post-preview/index.js} +8 -4
  96. package/build/components/post-preview/index.js.map +1 -0
  97. package/build/components/preferences-modal/enable-feature.js +3 -2
  98. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  99. package/build/components/preferences-modal/enable-panel-option.js +33 -0
  100. package/build/components/preferences-modal/enable-panel-option.js.map +1 -0
  101. package/build/components/preferences-modal/index.js +89 -25
  102. package/build/components/preferences-modal/index.js.map +1 -1
  103. package/build/components/revisions/index.js +3 -7
  104. package/build/components/revisions/index.js.map +1 -1
  105. package/build/components/routes/link.js +6 -2
  106. package/build/components/routes/link.js.map +1 -1
  107. package/build/components/routes/use-title.js +3 -4
  108. package/build/components/routes/use-title.js.map +1 -1
  109. package/build/components/save-button/index.js +8 -4
  110. package/build/components/save-button/index.js.map +1 -1
  111. package/build/components/sidebar/index.js +26 -20
  112. package/build/components/sidebar/index.js.map +1 -1
  113. package/build/components/sidebar-dataviews/add-new-view.js +2 -2
  114. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  115. package/build/components/sidebar-dataviews/dataview-item.js +2 -10
  116. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  117. package/build/components/sidebar-dataviews/default-views.js +19 -6
  118. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  119. package/build/components/sidebar-dataviews/index.js +3 -3
  120. package/build/components/sidebar-dataviews/index.js.map +1 -1
  121. package/build/components/sidebar-edit-mode/default-sidebar.js +1 -5
  122. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  123. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +62 -10
  124. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  125. package/build/components/sidebar-edit-mode/page-panels/index.js +10 -4
  126. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  127. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +1 -2
  128. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  129. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
  130. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  131. package/build/components/sidebar-edit-mode/template-panel/index.js +4 -13
  132. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  133. package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  134. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  135. package/build/components/sidebar-navigation-screen-global-styles/index.js +5 -2
  136. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  137. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -0
  138. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  139. package/build/components/sidebar-navigation-screen-page/index.js +4 -1
  140. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  141. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +69 -0
  142. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
  143. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  144. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  145. package/build/components/sidebar-navigation-screen-template/home-template-details.js +3 -89
  146. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  147. package/build/components/sidebar-navigation-screen-template/index.js +2 -1
  148. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  149. package/build/components/sidebar-navigation-screen-template/template-areas.js +117 -0
  150. package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -0
  151. package/build/components/sidebar-navigation-screen-templates/index.js +63 -8
  152. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  153. package/build/components/site-hub/index.js +6 -3
  154. package/build/components/site-hub/index.js.map +1 -1
  155. package/build/components/style-book/index.js +38 -8
  156. package/build/components/style-book/index.js.map +1 -1
  157. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  158. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  159. package/build/components/template-actions/rename-menu-item.js +3 -0
  160. package/build/components/template-actions/rename-menu-item.js.map +1 -1
  161. package/build/components/welcome-guide/styles.js +1 -1
  162. package/build/components/welcome-guide/styles.js.map +1 -1
  163. package/build/hooks/commands/use-common-commands.js +9 -1
  164. package/build/hooks/commands/use-common-commands.js.map +1 -1
  165. package/build/hooks/commands/use-edit-mode-commands.js +11 -6
  166. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  167. package/build/hooks/navigation-menu-edit.js +1 -1
  168. package/build/hooks/navigation-menu-edit.js.map +1 -1
  169. package/build/hooks/template-part-edit.js +1 -1
  170. package/build/hooks/template-part-edit.js.map +1 -1
  171. package/build/index.js +12 -7
  172. package/build/index.js.map +1 -1
  173. package/build/store/actions.js +54 -52
  174. package/build/store/actions.js.map +1 -1
  175. package/build/store/private-actions.js +6 -2
  176. package/build/store/private-actions.js.map +1 -1
  177. package/build/store/reducer.js +0 -64
  178. package/build/store/reducer.js.map +1 -1
  179. package/build/store/selectors.js +44 -47
  180. package/build/store/selectors.js.map +1 -1
  181. package/build/utils/constants.js +15 -1
  182. package/build/utils/constants.js.map +1 -1
  183. package/build/utils/get-is-list-page.js +1 -1
  184. package/build/utils/get-is-list-page.js.map +1 -1
  185. package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -1
  186. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  187. package/build-module/components/block-editor/back-button.js +4 -3
  188. package/build-module/components/block-editor/back-button.js.map +1 -1
  189. package/build-module/components/block-editor/editor-canvas.js +50 -25
  190. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  191. package/build-module/components/block-editor/resizable-editor.js +2 -2
  192. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  193. package/build-module/components/block-editor/site-editor-canvas.js +8 -56
  194. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  195. package/build-module/components/block-editor/use-post-link-props.js +20 -0
  196. package/build-module/components/block-editor/use-post-link-props.js.map +1 -0
  197. package/build-module/components/block-editor/use-site-editor-settings.js +16 -24
  198. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  199. package/build-module/components/create-template-part-modal/index.js +14 -7
  200. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  201. package/build-module/components/editor/index.js +25 -37
  202. package/build-module/components/editor/index.js.map +1 -1
  203. package/build-module/components/editor-canvas-container/index.js +9 -7
  204. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  205. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +13 -8
  206. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  207. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  208. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  209. package/build-module/components/global-styles/font-library-modal/context.js +8 -8
  210. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  211. package/build-module/components/global-styles/font-library-modal/font-collection.js +8 -4
  212. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  213. package/build-module/components/global-styles/font-library-modal/index.js +39 -22
  214. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  215. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  216. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  217. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +13 -8
  218. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  219. package/build-module/components/global-styles/font-library-modal/local-fonts.js +27 -11
  220. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  221. package/build-module/components/global-styles/font-library-modal/resolvers.js +5 -5
  222. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  223. package/build-module/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
  224. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
  225. package/build-module/components/global-styles/font-library-modal/utils/index.js +34 -36
  226. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  227. package/build-module/components/global-styles/preview.js +45 -3
  228. package/build-module/components/global-styles/preview.js.map +1 -1
  229. package/build-module/components/global-styles/screen-color-palette.js +17 -13
  230. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  231. package/build-module/components/global-styles/screen-revisions/index.js +55 -59
  232. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  233. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +56 -15
  234. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  235. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
  236. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  237. package/build-module/components/global-styles/ui.js +15 -64
  238. package/build-module/components/global-styles/ui.js.map +1 -1
  239. package/build-module/components/header-edit-mode/document-tools/index.js +19 -109
  240. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  241. package/build-module/components/header-edit-mode/index.js +25 -51
  242. package/build-module/components/header-edit-mode/index.js.map +1 -1
  243. package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -2
  244. package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  245. package/build-module/components/header-edit-mode/more-menu/index.js +20 -15
  246. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  247. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
  248. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  249. package/build-module/components/keyboard-shortcuts/register.js +0 -36
  250. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  251. package/build-module/components/layout/index.js +15 -21
  252. package/build-module/components/layout/index.js.map +1 -1
  253. package/build-module/components/page/header.js +2 -1
  254. package/build-module/components/page/header.js.map +1 -1
  255. package/build-module/components/page-main/index.js +4 -4
  256. package/build-module/components/page-main/index.js.map +1 -1
  257. package/build-module/components/page-pages/index.js +101 -51
  258. package/build-module/components/page-pages/index.js.map +1 -1
  259. package/build-module/components/page-patterns/dataviews-pattern-actions.js +292 -0
  260. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
  261. package/build-module/components/page-patterns/dataviews-patterns.js +299 -0
  262. package/build-module/components/page-patterns/dataviews-patterns.js.map +1 -0
  263. package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
  264. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
  265. package/build-module/components/page-patterns/grid-item.js +4 -3
  266. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  267. package/build-module/components/page-patterns/patterns-list.js +3 -3
  268. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  269. package/build-module/components/page-patterns/rename-menu-item.js +3 -0
  270. package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
  271. package/build-module/components/page-patterns/use-patterns.js +23 -13
  272. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  273. package/build-module/components/page-templates/index.js +314 -38
  274. package/build-module/components/page-templates/index.js.map +1 -1
  275. package/build-module/components/{page-patterns/pagination.js → pagination/index.js} +24 -12
  276. package/build-module/components/pagination/index.js.map +1 -0
  277. package/build-module/components/{page-pages/side-editor.js → post-preview/index.js} +7 -3
  278. package/build-module/components/post-preview/index.js.map +1 -0
  279. package/build-module/components/preferences-modal/enable-feature.js +3 -2
  280. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  281. package/build-module/components/preferences-modal/enable-panel-option.js +26 -0
  282. package/build-module/components/preferences-modal/enable-panel-option.js.map +1 -0
  283. package/build-module/components/preferences-modal/index.js +90 -26
  284. package/build-module/components/preferences-modal/index.js.map +1 -1
  285. package/build-module/components/revisions/index.js +4 -8
  286. package/build-module/components/revisions/index.js.map +1 -1
  287. package/build-module/components/routes/link.js +5 -2
  288. package/build-module/components/routes/link.js.map +1 -1
  289. package/build-module/components/routes/use-title.js +3 -4
  290. package/build-module/components/routes/use-title.js.map +1 -1
  291. package/build-module/components/save-button/index.js +8 -4
  292. package/build-module/components/save-button/index.js.map +1 -1
  293. package/build-module/components/sidebar/index.js +26 -20
  294. package/build-module/components/sidebar/index.js.map +1 -1
  295. package/build-module/components/sidebar-dataviews/add-new-view.js +1 -1
  296. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  297. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -10
  298. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  299. package/build-module/components/sidebar-dataviews/default-views.js +17 -5
  300. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  301. package/build-module/components/sidebar-dataviews/index.js +2 -2
  302. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  303. package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -5
  304. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  305. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +64 -12
  306. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  307. package/build-module/components/sidebar-edit-mode/page-panels/index.js +10 -4
  308. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  309. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +2 -3
  310. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  311. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
  312. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  313. package/build-module/components/sidebar-edit-mode/template-panel/index.js +6 -15
  314. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  315. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  316. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  317. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -2
  318. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  319. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -0
  320. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  321. package/build-module/components/sidebar-navigation-screen-page/index.js +4 -1
  322. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  323. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +61 -0
  324. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
  325. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  326. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  327. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +5 -90
  328. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  329. package/build-module/components/sidebar-navigation-screen-template/index.js +2 -1
  330. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  331. package/build-module/components/sidebar-navigation-screen-template/template-areas.js +109 -0
  332. package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -0
  333. package/build-module/components/sidebar-navigation-screen-templates/index.js +64 -9
  334. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  335. package/build-module/components/site-hub/index.js +6 -3
  336. package/build-module/components/site-hub/index.js.map +1 -1
  337. package/build-module/components/style-book/index.js +40 -10
  338. package/build-module/components/style-book/index.js.map +1 -1
  339. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  340. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  341. package/build-module/components/template-actions/rename-menu-item.js +3 -0
  342. package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
  343. package/build-module/components/welcome-guide/styles.js +1 -1
  344. package/build-module/components/welcome-guide/styles.js.map +1 -1
  345. package/build-module/hooks/commands/use-common-commands.js +9 -1
  346. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  347. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -6
  348. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  349. package/build-module/hooks/navigation-menu-edit.js +1 -1
  350. package/build-module/hooks/navigation-menu-edit.js.map +1 -1
  351. package/build-module/hooks/template-part-edit.js +1 -1
  352. package/build-module/hooks/template-part-edit.js.map +1 -1
  353. package/build-module/index.js +12 -7
  354. package/build-module/index.js.map +1 -1
  355. package/build-module/store/actions.js +49 -47
  356. package/build-module/store/actions.js.map +1 -1
  357. package/build-module/store/private-actions.js +6 -2
  358. package/build-module/store/private-actions.js.map +1 -1
  359. package/build-module/store/reducer.js +0 -61
  360. package/build-module/store/reducer.js.map +1 -1
  361. package/build-module/store/selectors.js +40 -41
  362. package/build-module/store/selectors.js.map +1 -1
  363. package/build-module/utils/constants.js +8 -0
  364. package/build-module/utils/constants.js.map +1 -1
  365. package/build-module/utils/get-is-list-page.js +1 -1
  366. package/build-module/utils/get-is-list-page.js.map +1 -1
  367. package/build-style/style-rtl.css +607 -561
  368. package/build-style/style.css +607 -561
  369. package/package.json +42 -42
  370. package/src/components/add-new-template/add-custom-template-modal-content.js +1 -1
  371. package/src/components/add-new-template/style.scss +2 -1
  372. package/src/components/block-editor/back-button.js +4 -2
  373. package/src/components/block-editor/editor-canvas.js +63 -47
  374. package/src/components/block-editor/resizable-editor.js +1 -1
  375. package/src/components/block-editor/site-editor-canvas.js +32 -96
  376. package/src/components/block-editor/style.scss +7 -14
  377. package/src/components/block-editor/use-post-link-props.js +20 -0
  378. package/src/components/block-editor/use-site-editor-settings.js +38 -58
  379. package/src/components/code-editor/style.scss +0 -4
  380. package/src/components/create-template-part-modal/index.js +83 -82
  381. package/src/components/editor/index.js +34 -47
  382. package/src/components/editor-canvas-container/index.js +8 -6
  383. package/src/components/global-styles/font-library-modal/collection-font-variant.js +18 -7
  384. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  385. package/src/components/global-styles/font-library-modal/context.js +8 -8
  386. package/src/components/global-styles/font-library-modal/font-collection.js +10 -5
  387. package/src/components/global-styles/font-library-modal/index.js +44 -24
  388. package/src/components/global-styles/font-library-modal/installed-fonts.js +3 -3
  389. package/src/components/global-styles/font-library-modal/library-font-variant.js +18 -7
  390. package/src/components/global-styles/font-library-modal/local-fonts.js +53 -26
  391. package/src/components/global-styles/font-library-modal/resolvers.js +5 -5
  392. package/src/components/global-styles/font-library-modal/style.scss +5 -2
  393. package/src/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +9 -3
  394. package/src/components/global-styles/font-library-modal/utils/index.js +21 -23
  395. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +58 -0
  396. package/src/components/global-styles/preview.js +55 -3
  397. package/src/components/global-styles/screen-color-palette.js +16 -26
  398. package/src/components/global-styles/screen-revisions/index.js +93 -101
  399. package/src/components/global-styles/screen-revisions/revisions-buttons.js +85 -17
  400. package/src/components/global-styles/screen-revisions/style.scss +86 -21
  401. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +67 -0
  402. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +73 -46
  403. package/src/components/global-styles/ui.js +13 -74
  404. package/src/components/header-edit-mode/document-tools/index.js +35 -167
  405. package/src/components/header-edit-mode/index.js +33 -78
  406. package/src/components/header-edit-mode/mode-switcher/index.js +0 -4
  407. package/src/components/header-edit-mode/more-menu/index.js +25 -27
  408. package/src/components/header-edit-mode/style.scss +46 -68
  409. package/src/components/keyboard-shortcuts/edit-mode.js +1 -26
  410. package/src/components/keyboard-shortcuts/register.js +0 -43
  411. package/src/components/layout/index.js +29 -47
  412. package/src/components/layout/style.scss +10 -3
  413. package/src/components/page/header.js +2 -1
  414. package/src/components/page/style.scss +3 -3
  415. package/src/components/page-main/index.js +8 -8
  416. package/src/components/page-pages/index.js +157 -62
  417. package/src/components/page-pages/style.scss +4 -1
  418. package/src/components/page-patterns/dataviews-pattern-actions.js +329 -0
  419. package/src/components/page-patterns/dataviews-patterns.js +380 -0
  420. package/src/components/page-patterns/duplicate-menu-item.js +1 -1
  421. package/src/components/page-patterns/grid-item.js +3 -2
  422. package/src/components/page-patterns/patterns-list.js +7 -3
  423. package/src/components/page-patterns/rename-menu-item.js +7 -1
  424. package/src/components/page-patterns/style.scss +89 -26
  425. package/src/components/page-patterns/use-patterns.js +24 -15
  426. package/src/components/page-templates/index.js +399 -64
  427. package/src/components/{page-patterns/pagination.js → pagination/index.js} +21 -10
  428. package/src/components/pagination/style.scss +5 -0
  429. package/src/components/post-preview/index.js +16 -0
  430. package/src/components/preferences-modal/enable-feature.js +9 -5
  431. package/src/components/preferences-modal/enable-panel-option.js +23 -0
  432. package/src/components/preferences-modal/index.js +151 -40
  433. package/src/components/revisions/index.js +8 -15
  434. package/src/components/routes/link.js +11 -3
  435. package/src/components/routes/use-title.js +3 -10
  436. package/src/components/save-button/index.js +17 -3
  437. package/src/components/sidebar/index.js +45 -35
  438. package/src/components/sidebar/style.scss +10 -12
  439. package/src/components/sidebar-dataviews/add-new-view.js +1 -1
  440. package/src/components/sidebar-dataviews/dataview-item.js +3 -7
  441. package/src/components/sidebar-dataviews/default-views.js +23 -6
  442. package/src/components/sidebar-dataviews/index.js +2 -2
  443. package/src/components/sidebar-edit-mode/default-sidebar.js +0 -12
  444. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +85 -14
  445. package/src/components/sidebar-edit-mode/page-panels/index.js +53 -25
  446. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -2
  447. package/src/components/sidebar-edit-mode/page-panels/style.scss +1 -42
  448. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -12
  449. package/src/components/sidebar-edit-mode/style.scss +0 -10
  450. package/src/components/sidebar-edit-mode/template-panel/index.js +44 -40
  451. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -4
  452. package/src/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  453. package/src/components/sidebar-navigation-screen-global-styles/index.js +3 -2
  454. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +7 -1
  455. package/src/components/sidebar-navigation-screen-page/index.js +2 -1
  456. package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +77 -0
  457. package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
  458. package/src/components/sidebar-navigation-screen-template/home-template-details.js +1 -96
  459. package/src/components/sidebar-navigation-screen-template/index.js +8 -2
  460. package/src/components/sidebar-navigation-screen-template/template-areas.js +135 -0
  461. package/src/components/sidebar-navigation-screen-templates/index.js +85 -28
  462. package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
  463. package/src/components/site-hub/index.js +4 -5
  464. package/src/components/site-hub/style.scss +5 -2
  465. package/src/components/style-book/index.js +65 -21
  466. package/src/components/style-book/style.scss +3 -3
  467. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
  468. package/src/components/template-actions/rename-menu-item.js +7 -1
  469. package/src/components/welcome-guide/styles.js +1 -1
  470. package/src/hooks/commands/use-common-commands.js +10 -5
  471. package/src/hooks/commands/use-edit-mode-commands.js +8 -12
  472. package/src/hooks/navigation-menu-edit.js +1 -1
  473. package/src/hooks/template-part-edit.js +1 -1
  474. package/src/index.js +11 -5
  475. package/src/store/actions.js +50 -50
  476. package/src/store/private-actions.js +7 -3
  477. package/src/store/reducer.js +0 -62
  478. package/src/store/selectors.js +47 -41
  479. package/src/store/test/actions.js +11 -39
  480. package/src/store/test/reducer.js +1 -82
  481. package/src/store/test/selectors.js +0 -24
  482. package/src/style.scss +3 -3
  483. package/src/utils/constants.js +8 -0
  484. package/src/utils/get-is-list-page.js +2 -3
  485. package/build/components/dataviews/add-filter.js +0 -91
  486. package/build/components/dataviews/add-filter.js.map +0 -1
  487. package/build/components/dataviews/constants.js +0 -14
  488. package/build/components/dataviews/constants.js.map +0 -1
  489. package/build/components/dataviews/dataviews.js +0 -99
  490. package/build/components/dataviews/dataviews.js.map +0 -1
  491. package/build/components/dataviews/filter-summary.js +0 -62
  492. package/build/components/dataviews/filter-summary.js.map +0 -1
  493. package/build/components/dataviews/filters.js +0 -63
  494. package/build/components/dataviews/filters.js.map +0 -1
  495. package/build/components/dataviews/index.js +0 -21
  496. package/build/components/dataviews/index.js.map +0 -1
  497. package/build/components/dataviews/item-actions.js +0 -184
  498. package/build/components/dataviews/item-actions.js.map +0 -1
  499. package/build/components/dataviews/pagination.js +0 -123
  500. package/build/components/dataviews/pagination.js.map +0 -1
  501. package/build/components/dataviews/reset-filters.js +0 -33
  502. package/build/components/dataviews/reset-filters.js.map +0 -1
  503. package/build/components/dataviews/search.js +0 -51
  504. package/build/components/dataviews/search.js.map +0 -1
  505. package/build/components/dataviews/view-actions.js +0 -244
  506. package/build/components/dataviews/view-actions.js.map +0 -1
  507. package/build/components/dataviews/view-grid.js +0 -82
  508. package/build/components/dataviews/view-grid.js.map +0 -1
  509. package/build/components/dataviews/view-list.js +0 -399
  510. package/build/components/dataviews/view-list.js.map +0 -1
  511. package/build/components/dataviews/view-side-by-side.js +0 -20
  512. package/build/components/dataviews/view-side-by-side.js.map +0 -1
  513. package/build/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
  514. package/build/components/header-edit-mode/document-actions/index.js +0 -172
  515. package/build/components/header-edit-mode/document-actions/index.js.map +0 -1
  516. package/build/components/header-edit-mode/undo-redo/redo.js +0 -41
  517. package/build/components/header-edit-mode/undo-redo/redo.js.map +0 -1
  518. package/build/components/header-edit-mode/undo-redo/undo.js +0 -40
  519. package/build/components/header-edit-mode/undo-redo/undo.js.map +0 -1
  520. package/build/components/page-content-focus-notifications/back-to-page-notification.js +0 -61
  521. package/build/components/page-content-focus-notifications/back-to-page-notification.js.map +0 -1
  522. package/build/components/page-content-focus-notifications/edit-template-notification.js +0 -102
  523. package/build/components/page-content-focus-notifications/edit-template-notification.js.map +0 -1
  524. package/build/components/page-content-focus-notifications/index.js +0 -22
  525. package/build/components/page-content-focus-notifications/index.js.map +0 -1
  526. package/build/components/page-pages/side-editor.js.map +0 -1
  527. package/build/components/page-patterns/pagination.js.map +0 -1
  528. package/build/components/page-templates/dataviews-templates.js +0 -316
  529. package/build/components/page-templates/dataviews-templates.js.map +0 -1
  530. package/build/components/secondary-sidebar/inserter-sidebar.js +0 -60
  531. package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  532. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -109
  533. package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  534. package/build/components/sidebar-edit-mode/page-panels/edit-template.js +0 -101
  535. package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +0 -1
  536. package/build/components/sidebar-edit-mode/page-panels/hooks.js +0 -79
  537. package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +0 -1
  538. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -48
  539. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +0 -1
  540. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -84
  541. package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +0 -1
  542. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -35
  543. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
  544. package/build/components/sidebar-edit-mode/template-panel/last-revision.js +0 -73
  545. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
  546. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -219
  547. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
  548. package/build/utils/use-debounced-input.js +0 -22
  549. package/build/utils/use-debounced-input.js.map +0 -1
  550. package/build-module/components/dataviews/add-filter.js +0 -84
  551. package/build-module/components/dataviews/add-filter.js.map +0 -1
  552. package/build-module/components/dataviews/constants.js +0 -6
  553. package/build-module/components/dataviews/constants.js.map +0 -1
  554. package/build-module/components/dataviews/dataviews.js +0 -90
  555. package/build-module/components/dataviews/dataviews.js.map +0 -1
  556. package/build-module/components/dataviews/filter-summary.js +0 -55
  557. package/build-module/components/dataviews/filter-summary.js.map +0 -1
  558. package/build-module/components/dataviews/filters.js +0 -55
  559. package/build-module/components/dataviews/filters.js.map +0 -1
  560. package/build-module/components/dataviews/index.js +0 -2
  561. package/build-module/components/dataviews/index.js.map +0 -1
  562. package/build-module/components/dataviews/item-actions.js +0 -177
  563. package/build-module/components/dataviews/item-actions.js.map +0 -1
  564. package/build-module/components/dataviews/pagination.js +0 -115
  565. package/build-module/components/dataviews/pagination.js.map +0 -1
  566. package/build-module/components/dataviews/reset-filters.js +0 -26
  567. package/build-module/components/dataviews/reset-filters.js.map +0 -1
  568. package/build-module/components/dataviews/search.js +0 -43
  569. package/build-module/components/dataviews/search.js.map +0 -1
  570. package/build-module/components/dataviews/view-actions.js +0 -237
  571. package/build-module/components/dataviews/view-actions.js.map +0 -1
  572. package/build-module/components/dataviews/view-grid.js +0 -74
  573. package/build-module/components/dataviews/view-grid.js.map +0 -1
  574. package/build-module/components/dataviews/view-list.js +0 -390
  575. package/build-module/components/dataviews/view-list.js.map +0 -1
  576. package/build-module/components/dataviews/view-side-by-side.js +0 -12
  577. package/build-module/components/dataviews/view-side-by-side.js.map +0 -1
  578. package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
  579. package/build-module/components/header-edit-mode/document-actions/index.js +0 -164
  580. package/build-module/components/header-edit-mode/document-actions/index.js.map +0 -1
  581. package/build-module/components/header-edit-mode/undo-redo/redo.js +0 -33
  582. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +0 -1
  583. package/build-module/components/header-edit-mode/undo-redo/undo.js +0 -32
  584. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +0 -1
  585. package/build-module/components/page-content-focus-notifications/back-to-page-notification.js +0 -54
  586. package/build-module/components/page-content-focus-notifications/back-to-page-notification.js.map +0 -1
  587. package/build-module/components/page-content-focus-notifications/edit-template-notification.js +0 -96
  588. package/build-module/components/page-content-focus-notifications/edit-template-notification.js.map +0 -1
  589. package/build-module/components/page-content-focus-notifications/index.js +0 -14
  590. package/build-module/components/page-content-focus-notifications/index.js.map +0 -1
  591. package/build-module/components/page-pages/side-editor.js.map +0 -1
  592. package/build-module/components/page-patterns/pagination.js.map +0 -1
  593. package/build-module/components/page-templates/dataviews-templates.js +0 -308
  594. package/build-module/components/page-templates/dataviews-templates.js.map +0 -1
  595. package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -53
  596. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  597. package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -102
  598. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  599. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +0 -93
  600. package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +0 -1
  601. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +0 -69
  602. package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +0 -1
  603. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -41
  604. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +0 -1
  605. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -77
  606. package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +0 -1
  607. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -27
  608. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
  609. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +0 -65
  610. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
  611. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -209
  612. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
  613. package/build-module/utils/use-debounced-input.js +0 -15
  614. package/build-module/utils/use-debounced-input.js.map +0 -1
  615. package/src/components/dataviews/README.md +0 -191
  616. package/src/components/dataviews/add-filter.js +0 -108
  617. package/src/components/dataviews/constants.js +0 -5
  618. package/src/components/dataviews/dataviews.js +0 -99
  619. package/src/components/dataviews/filter-summary.js +0 -79
  620. package/src/components/dataviews/filters.js +0 -65
  621. package/src/components/dataviews/index.js +0 -1
  622. package/src/components/dataviews/item-actions.js +0 -208
  623. package/src/components/dataviews/pagination.js +0 -144
  624. package/src/components/dataviews/reset-filters.js +0 -26
  625. package/src/components/dataviews/search.js +0 -42
  626. package/src/components/dataviews/style.scss +0 -131
  627. package/src/components/dataviews/view-actions.js +0 -319
  628. package/src/components/dataviews/view-grid.js +0 -90
  629. package/src/components/dataviews/view-list.js +0 -512
  630. package/src/components/dataviews/view-side-by-side.js +0 -9
  631. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +0 -62
  632. package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +0 -28
  633. package/src/components/header-edit-mode/document-actions/index.js +0 -204
  634. package/src/components/header-edit-mode/document-actions/style.scss +0 -145
  635. package/src/components/header-edit-mode/undo-redo/redo.js +0 -38
  636. package/src/components/header-edit-mode/undo-redo/undo.js +0 -34
  637. package/src/components/page-content-focus-notifications/back-to-page-notification.js +0 -58
  638. package/src/components/page-content-focus-notifications/edit-template-notification.js +0 -104
  639. package/src/components/page-content-focus-notifications/index.js +0 -14
  640. package/src/components/page-pages/side-editor.js +0 -14
  641. package/src/components/page-templates/dataviews-templates.js +0 -345
  642. package/src/components/secondary-sidebar/inserter-sidebar.js +0 -66
  643. package/src/components/secondary-sidebar/list-view-sidebar.js +0 -123
  644. package/src/components/secondary-sidebar/style.scss +0 -65
  645. package/src/components/sidebar-edit-mode/page-panels/edit-template.js +0 -108
  646. package/src/components/sidebar-edit-mode/page-panels/hooks.js +0 -99
  647. package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -45
  648. package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -83
  649. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -26
  650. package/src/components/sidebar-edit-mode/template-panel/last-revision.js +0 -82
  651. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -279
  652. package/src/utils/use-debounced-input.js +0 -18
@@ -4,16 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.__experimentalSetPreviewDeviceType = __experimentalSetPreviewDeviceType;
8
- exports.openGeneralSidebar = exports.closeGeneralSidebar = exports.addTemplate = void 0;
7
+ exports.openGeneralSidebar = exports.closeGeneralSidebar = exports.addTemplate = exports.__experimentalSetPreviewDeviceType = void 0;
9
8
  exports.openNavigationPanelToMenu = openNavigationPanelToMenu;
10
9
  exports.revertTemplate = exports.removeTemplate = void 0;
11
10
  exports.setEditedEntity = setEditedEntity;
12
11
  exports.setEditedPostContext = setEditedPostContext;
13
12
  exports.setHasPageContentFocus = void 0;
14
13
  exports.setHomeTemplateId = setHomeTemplateId;
15
- exports.setIsInserterOpened = setIsInserterOpened;
16
- exports.setIsListViewOpened = void 0;
14
+ exports.setIsListViewOpened = exports.setIsInserterOpened = void 0;
17
15
  exports.setIsNavigationPanelOpened = setIsNavigationPanelOpened;
18
16
  exports.setIsSaveViewOpened = setIsSaveViewOpened;
19
17
  exports.setNavigationMenu = setNavigationMenu;
@@ -33,6 +31,7 @@ var _notices = require("@wordpress/notices");
33
31
  var _coreData = require("@wordpress/core-data");
34
32
  var _interface = require("@wordpress/interface");
35
33
  var _blockEditor = require("@wordpress/block-editor");
34
+ var _editor = require("@wordpress/editor");
36
35
  var _a11y = require("@wordpress/a11y");
37
36
  var _preferences = require("@wordpress/preferences");
38
37
  var _htmlEntities = require("@wordpress/html-entities");
@@ -67,22 +66,29 @@ function toggleFeature(featureName) {
67
66
  /**
68
67
  * Action that changes the width of the editing canvas.
69
68
  *
69
+ * @deprecated
70
+ *
70
71
  * @param {string} deviceType
71
72
  *
72
73
  * @return {Object} Action object.
73
74
  */
74
- function __experimentalSetPreviewDeviceType(deviceType) {
75
- return {
76
- type: 'SET_PREVIEW_DEVICE_TYPE',
77
- deviceType
78
- };
79
- }
75
+ const __experimentalSetPreviewDeviceType = deviceType => ({
76
+ registry
77
+ }) => {
78
+ (0, _deprecated.default)("dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType", {
79
+ since: '6.5',
80
+ version: '6.7',
81
+ hint: 'registry.dispatch( editorStore ).setDeviceType'
82
+ });
83
+ registry.dispatch(_editor.store).setDeviceType(deviceType);
84
+ };
80
85
 
81
86
  /**
82
87
  * Action that sets a template, optionally fetching it from REST API.
83
88
  *
84
89
  * @return {Object} Action object.
85
90
  */
91
+ exports.__experimentalSetPreviewDeviceType = __experimentalSetPreviewDeviceType;
86
92
  function setTemplate() {
87
93
  (0, _deprecated.default)("dispatch( 'core/edit-site' ).setTemplate", {
88
94
  since: '6.5',
@@ -304,23 +310,39 @@ function setIsNavigationPanelOpened() {
304
310
  }
305
311
 
306
312
  /**
307
- * Opens or closes the inserter.
313
+ * Returns an action object used to open/close the inserter.
308
314
  *
309
- * @param {boolean|Object} value Whether the inserter should be
310
- * opened (true) or closed (false).
311
- * To specify an insertion point,
312
- * use an object.
313
- * @param {string} value.rootClientId The root client ID to insert at.
314
- * @param {number} value.insertionIndex The index to insert at.
315
+ * @deprecated
315
316
  *
316
- * @return {Object} Action object.
317
+ * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).
317
318
  */
318
- function setIsInserterOpened(value) {
319
- return {
320
- type: 'SET_IS_INSERTER_OPENED',
321
- value
322
- };
323
- }
319
+ const setIsInserterOpened = value => ({
320
+ registry
321
+ }) => {
322
+ (0, _deprecated.default)("dispatch( 'core/edit-site' ).setIsInserterOpened", {
323
+ since: '6.5',
324
+ alternative: "dispatch( 'core/editor').setIsInserterOpened"
325
+ });
326
+ registry.dispatch(_editor.store).setIsInserterOpened(value);
327
+ };
328
+
329
+ /**
330
+ * Returns an action object used to open/close the list view.
331
+ *
332
+ * @deprecated
333
+ *
334
+ * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.
335
+ */
336
+ exports.setIsInserterOpened = setIsInserterOpened;
337
+ const setIsListViewOpened = isOpen => ({
338
+ registry
339
+ }) => {
340
+ (0, _deprecated.default)("dispatch( 'core/edit-site' ).setIsListViewOpened", {
341
+ since: '6.5',
342
+ alternative: "dispatch( 'core/editor').setIsListViewOpened"
343
+ });
344
+ registry.dispatch(_editor.store).setIsListViewOpened(isOpen);
345
+ };
324
346
 
325
347
  /**
326
348
  * Returns an action object used to update the settings.
@@ -329,6 +351,7 @@ function setIsInserterOpened(value) {
329
351
  *
330
352
  * @return {Object} Action object.
331
353
  */
354
+ exports.setIsListViewOpened = setIsListViewOpened;
332
355
  function updateSettings(settings) {
333
356
  return {
334
357
  type: 'UPDATE_SETTINGS',
@@ -336,33 +359,12 @@ function updateSettings(settings) {
336
359
  };
337
360
  }
338
361
 
339
- /**
340
- * Sets whether the list view panel should be open.
341
- *
342
- * @param {boolean} isOpen If true, opens the list view. If false, closes it.
343
- * It does not toggle the state, but sets it directly.
344
- */
345
- const setIsListViewOpened = isOpen => ({
346
- dispatch,
347
- registry
348
- }) => {
349
- const isDistractionFree = registry.select(_preferences.store).get('core/edit-site', 'distractionFree');
350
- if (isDistractionFree && isOpen) {
351
- dispatch.toggleDistractionFree();
352
- }
353
- dispatch({
354
- type: 'SET_IS_LIST_VIEW_OPENED',
355
- isOpen
356
- });
357
- };
358
-
359
362
  /**
360
363
  * Sets whether the save view panel should be open.
361
364
  *
362
365
  * @param {boolean} isOpen If true, opens the save view. If false, closes it.
363
366
  * It does not toggle the state, but sets it directly.
364
367
  */
365
- exports.setIsListViewOpened = setIsListViewOpened;
366
368
  function setIsSaveViewOpened(isOpen) {
367
369
  return {
368
370
  type: 'SET_IS_SAVE_VIEW_OPENED',
@@ -469,7 +471,7 @@ const openGeneralSidebar = name => ({
469
471
  dispatch,
470
472
  registry
471
473
  }) => {
472
- const isDistractionFree = registry.select(_preferences.store).get('core/edit-site', 'distractionFree');
474
+ const isDistractionFree = registry.select(_preferences.store).get('core', 'distractionFree');
473
475
  if (isDistractionFree) {
474
476
  dispatch.toggleDistractionFree();
475
477
  }
@@ -499,7 +501,7 @@ const switchEditorMode = mode => ({
499
501
  if (mode === 'visual') {
500
502
  (0, _a11y.speak)((0, _i18n.__)('Visual editor selected'), 'assertive');
501
503
  } else if (mode === 'text') {
502
- const isDistractionFree = registry.select(_preferences.store).get('core/edit-site', 'distractionFree');
504
+ const isDistractionFree = registry.select(_preferences.store).get('core', 'distractionFree');
503
505
  if (isDistractionFree) {
504
506
  dispatch.toggleDistractionFree();
505
507
  }
@@ -541,17 +543,17 @@ const toggleDistractionFree = () => ({
541
543
  dispatch,
542
544
  registry
543
545
  }) => {
544
- const isDistractionFree = registry.select(_preferences.store).get('core/edit-site', 'distractionFree');
546
+ const isDistractionFree = registry.select(_preferences.store).get('core', 'distractionFree');
545
547
  if (!isDistractionFree) {
546
548
  registry.batch(() => {
547
- registry.dispatch(_preferences.store).set('core/edit-site', 'fixedToolbar', true);
548
- dispatch.setIsInserterOpened(false);
549
- dispatch.setIsListViewOpened(false);
549
+ registry.dispatch(_preferences.store).set('core', 'fixedToolbar', true);
550
+ registry.dispatch(_editor.store).setIsInserterOpened(false);
551
+ registry.dispatch(_editor.store).setIsListViewOpened(false);
550
552
  dispatch.closeGeneralSidebar();
551
553
  });
552
554
  }
553
555
  registry.batch(() => {
554
- registry.dispatch(_preferences.store).set('core/edit-site', 'distractionFree', !isDistractionFree);
556
+ registry.dispatch(_preferences.store).set('core', 'distractionFree', !isDistractionFree);
555
557
  registry.dispatch(_notices.store).createInfoNotice(isDistractionFree ? (0, _i18n.__)('Distraction free off.') : (0, _i18n.__)('Distraction free on.'), {
556
558
  id: 'core/edit-site/distraction-free-mode/notice',
557
559
  type: 'snackbar'
@@ -1 +1 @@
1
- {"version":3,"names":["_apiFetch","_interopRequireDefault","require","_blocks","_deprecated","_url","_i18n","_notices","_coreData","_interface","_blockEditor","_a11y","_preferences","_htmlEntities","_constants","_isTemplateRevertable","_constants2","toggleFeature","featureName","registry","deprecated","since","alternative","dispatch","preferencesStore","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","version","hint","addTemplate","template","newTemplate","coreStore","saveEntityRecord","TEMPLATE_POST_TYPE","content","editEntityRecord","id","blocks","parse","undoIgnore","postType","exports","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","noticesStore","createSuccessNotice","sprintf","__","decodeEntities","error","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","TEMPLATE_PART_POST_TYPE","setNavigationMenu","navigationMenuId","NAVIGATION_POST_TYPE","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","isDistractionFree","get","toggleDistractionFree","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","isTemplateRevertable","templateEntityConfig","getEntityConfig","fileTemplatePath","addQueryArgs","baseURL","source","fileTemplate","apiFetch","path","serializeBlocks","blocksForSerialization","__unstableSerializeAndClean","edited","getEditedEntityRecord","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","interfaceStore","enableComplementaryArea","editSiteStoreName","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","blockEditorStore","clearSelectedBlock","speak","setHasPageContentFocus","hasPageContentFocus","batch","createInfoNotice"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../utils/constants';\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).toggleFeature( featureName )\",\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative:\n\t\t\t\t\t\"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t\t}\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @return {Object} Action object.\n */\nexport function setTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setTemplate\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @deprecated\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).addTemplate\", {\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t\thint: 'use saveEntityRecord directly',\n\t\t} );\n\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', TEMPLATE_POST_TYPE, template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: newTemplate.id,\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate =\n\t( template ) =>\n\tasync ( { registry } ) => {\n\t\ttry {\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.deleteEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} );\n\n\t\t\tconst lastError = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntityDeleteError(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\t// Depending on how the entity was retrieved it's title might be\n\t\t\t// an object or simple string.\n\t\t\tconst templateTitle =\n\t\t\t\ttypeof template.title === 'string'\n\t\t\t\t\t? template.title\n\t\t\t\t\t: template.title?.rendered;\n\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( templateTitle )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'site-editor-template-deleted-success' }\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while deleting the template.' );\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n * @param {Object} context The entity's context.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId, context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t\tcontext,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @deprecated\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setPage() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setPage\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens or closes the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the list view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the list view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree && isOpen ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\t\tisOpen,\n\t\t} );\n\t};\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core/edit-site', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAC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;EAAEJ;AAAS,CAAC,KAAM;EAC7B,MAAMmE,iBAAiB,GAAGnE,QAAQ,CAChC+B,MAAM,CAAE1B,kBAAiB,CAAC,CAC1B+D,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC;EAC5C,IAAK,CAAED,iBAAiB,EAAG;IAC1BnE,QAAQ,CAAC8G,KAAK,CAAE,MAAM;MACrB9G,QAAQ,CACNI,QAAQ,CAAEC,kBAAiB,CAAC,CAC5BmG,GAAG,CAAE,gBAAgB,EAAE,cAAc,EAAE,IAAK,CAAC;MAC/CpG,QAAQ,CAACyD,mBAAmB,CAAE,KAAM,CAAC;MACrCzD,QAAQ,CAAC6D,mBAAmB,CAAE,KAAM,CAAC;MACrC7D,QAAQ,CAACgG,mBAAmB,CAAC,CAAC;IAC/B,CAAE,CAAC;EACJ;EACApG,QAAQ,CAAC8G,KAAK,CAAE,MAAM;IACrB9G,QAAQ,CACNI,QAAQ,CAAEC,kBAAiB,CAAC,CAC5BmG,GAAG,CACH,gBAAgB,EAChB,iBAAiB,EACjB,CAAErC,iBACH,CAAC;IACFnE,QAAQ,CACNI,QAAQ,CAAEgC,cAAa,CAAC,CACxB2E,gBAAgB,CAChB5C,iBAAiB,GACd,IAAA5B,QAAE,EAAE,uBAAwB,CAAC,GAC7B,IAAAA,QAAE,EAAE,sBAAuB,CAAC,EAC/B;MACClB,EAAE,EAAE,6CAA6C;MACjDZ,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC;AAACiB,OAAA,CAAA2C,qBAAA,GAAAA,qBAAA"}
1
+ {"version":3,"names":["_apiFetch","_interopRequireDefault","require","_blocks","_deprecated","_url","_i18n","_notices","_coreData","_interface","_blockEditor","_editor","_a11y","_preferences","_htmlEntities","_constants","_isTemplateRevertable","_constants2","toggleFeature","featureName","registry","deprecated","since","alternative","dispatch","preferencesStore","toggle","__experimentalSetPreviewDeviceType","deviceType","version","hint","editorStore","setDeviceType","exports","setTemplate","type","addTemplate","template","newTemplate","coreStore","saveEntityRecord","TEMPLATE_POST_TYPE","content","editEntityRecord","id","blocks","parse","undoIgnore","postType","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","noticesStore","createSuccessNotice","sprintf","__","decodeEntities","error","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","TEMPLATE_PART_POST_TYPE","setNavigationMenu","navigationMenuId","NAVIGATION_POST_TYPE","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","setIsListViewOpened","isOpen","updateSettings","settings","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","isTemplateRevertable","templateEntityConfig","getEntityConfig","fileTemplatePath","addQueryArgs","baseURL","source","fileTemplate","apiFetch","path","serializeBlocks","blocksForSerialization","__unstableSerializeAndClean","edited","getEditedEntityRecord","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","isDistractionFree","get","toggleDistractionFree","interfaceStore","enableComplementaryArea","editSiteStoreName","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","blockEditorStore","clearSelectedBlock","speak","setHasPageContentFocus","hasPageContentFocus","batch","createInfoNotice"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { 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":";;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAA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,iBAAkB,CAAC;IACvDhG,QAAQ,CACNI,QAAQ,CAAEkC,cAAa,CAAC,CACxB2E,gBAAgB,CAChBjB,iBAAiB,GACd,IAAAvD,QAAE,EAAE,uBAAwB,CAAC,GAC7B,IAAAA,QAAE,EAAE,sBAAuB,CAAC,EAC/B;MACCjB,EAAE,EAAE,6CAA6C;MACjDT,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC;AAACF,OAAA,CAAAqF,qBAAA,GAAAA,qBAAA"}
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.setEditorCanvasContainerView = exports.setCanvasMode = void 0;
7
7
  var _blockEditor = require("@wordpress/block-editor");
8
8
  var _preferences = require("@wordpress/preferences");
9
+ var _editor = require("@wordpress/editor");
9
10
  /**
10
11
  * WordPress dependencies
11
12
  */
@@ -26,9 +27,12 @@ const setCanvasMode = mode => ({
26
27
  });
27
28
  // Check if the block list view should be open by default.
28
29
  // If `distractionFree` mode is enabled, the block list view should not be open.
29
- if (mode === 'edit' && registry.select(_preferences.store).get('core/edit-site', 'showListViewByDefault') && !registry.select(_preferences.store).get('core/edit-site', 'distractionFree')) {
30
- dispatch.setIsListViewOpened(true);
30
+ if (mode === 'edit' && registry.select(_preferences.store).get('core', 'showListViewByDefault') && !registry.select(_preferences.store).get('core', 'distractionFree')) {
31
+ registry.dispatch(_editor.store).setIsListViewOpened(true);
32
+ } else {
33
+ registry.dispatch(_editor.store).setIsListViewOpened(false);
31
34
  }
35
+ registry.dispatch(_editor.store).setIsInserterOpened(false);
32
36
  };
33
37
 
34
38
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_preferences","setCanvasMode","mode","registry","dispatch","blockEditorStore","__unstableSetEditorMode","type","select","preferencesStore","get","setIsListViewOpened","exports","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\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":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7BD,QAAQ,CAACC,QAAQ,CAAEC,kBAAiB,CAAC,CAACC,uBAAuB,CAAE,MAAO,CAAC;EACvEF,QAAQ,CAAE;IACTG,IAAI,EAAE,iBAAiB;IACvBL;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNK,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,uBAAwB,CAAC,IAClD,CAAEP,QAAQ,CACRK,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC,EAC3C;IACDN,QAAQ,CAACO,mBAAmB,CAAE,IAAK,CAAC;EACrC;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAX,aAAA,GAAAA,aAAA;AAKO,MAAMY,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEV;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTG,IAAI,EAAE,kCAAkC;IACxCO;EACD,CAAE,CAAC;AACJ,CAAC;AAACF,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
1
+ {"version":3,"names":["_blockEditor","require","_preferences","_editor","setCanvasMode","mode","registry","dispatch","blockEditorStore","__unstableSetEditorMode","type","select","preferencesStore","get","editorStore","setIsListViewOpened","setIsInserterOpened","exports","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\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":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACO,MAAMG,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7BD,QAAQ,CAACC,QAAQ,CAAEC,kBAAiB,CAAC,CAACC,uBAAuB,CAAE,MAAO,CAAC;EACvEF,QAAQ,CAAE;IACTG,IAAI,EAAE,iBAAiB;IACvBL;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNK,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,MAAM,EAAE,uBAAwB,CAAC,IACxC,CAAEP,QAAQ,CACRK,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,MAAM,EAAE,iBAAkB,CAAC,EACjC;IACDP,QAAQ,CAACC,QAAQ,CAAEO,aAAY,CAAC,CAACC,mBAAmB,CAAE,IAAK,CAAC;EAC7D,CAAC,MAAM;IACNT,QAAQ,CAACC,QAAQ,CAAEO,aAAY,CAAC,CAACC,mBAAmB,CAAE,KAAM,CAAC;EAC9D;EACAT,QAAQ,CAACC,QAAQ,CAAEO,aAAY,CAAC,CAACE,mBAAmB,CAAE,KAAM,CAAC;AAC9D,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAb,aAAA,GAAAA,aAAA;AAKO,MAAMc,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEZ;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTG,IAAI,EAAE,kCAAkC;IACxCS;EACD,CAAE,CAAC;AACJ,CAAC;AAACF,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
@@ -3,11 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.blockInserterPanel = blockInserterPanel;
7
6
  exports.default = void 0;
8
- exports.deviceType = deviceType;
9
7
  exports.editedPost = editedPost;
10
- exports.listViewPanel = listViewPanel;
11
8
  exports.saveViewPanel = saveViewPanel;
12
9
  exports.settings = settings;
13
10
  var _data = require("@wordpress/data");
@@ -15,22 +12,6 @@ var _data = require("@wordpress/data");
15
12
  * WordPress dependencies
16
13
  */
17
14
 
18
- /**
19
- * Reducer returning the editing canvas device type.
20
- *
21
- * @param {Object} state Current state.
22
- * @param {Object} action Dispatched action.
23
- *
24
- * @return {Object} Updated state.
25
- */
26
- function deviceType(state = 'Desktop', action) {
27
- switch (action.type) {
28
- case 'SET_PREVIEW_DEVICE_TYPE':
29
- return action.deviceType;
30
- }
31
- return state;
32
- }
33
-
34
15
  /**
35
16
  * Reducer returning the settings.
36
17
  *
@@ -76,48 +57,6 @@ function editedPost(state = {}, action) {
76
57
  return state;
77
58
  }
78
59
 
79
- /**
80
- * Reducer to set the block inserter panel open or closed.
81
- *
82
- * Note: this reducer interacts with the navigation and list view panels reducers
83
- * to make sure that only one of the three panels is open at the same time.
84
- *
85
- * @param {boolean|Object} state Current state.
86
- * @param {Object} action Dispatched action.
87
- */
88
- function blockInserterPanel(state = false, action) {
89
- switch (action.type) {
90
- case 'SET_IS_LIST_VIEW_OPENED':
91
- return action.isOpen ? false : state;
92
- case 'SET_IS_INSERTER_OPENED':
93
- return action.value;
94
- case 'SET_CANVAS_MODE':
95
- return false;
96
- }
97
- return state;
98
- }
99
-
100
- /**
101
- * Reducer to set the list view panel open or closed.
102
- *
103
- * Note: this reducer interacts with the navigation and inserter panels reducers
104
- * to make sure that only one of the three panels is open at the same time.
105
- *
106
- * @param {Object} state Current state.
107
- * @param {Object} action Dispatched action.
108
- */
109
- function listViewPanel(state = false, action) {
110
- switch (action.type) {
111
- case 'SET_IS_INSERTER_OPENED':
112
- return action.value ? false : state;
113
- case 'SET_IS_LIST_VIEW_OPENED':
114
- return action.isOpen;
115
- case 'SET_CANVAS_MODE':
116
- return false;
117
- }
118
- return state;
119
- }
120
-
121
60
  /**
122
61
  * Reducer to set the save view panel open or closed.
123
62
  *
@@ -164,11 +103,8 @@ function editorCanvasContainerView(state = undefined, action) {
164
103
  return state;
165
104
  }
166
105
  var _default = (0, _data.combineReducers)({
167
- deviceType,
168
106
  settings,
169
107
  editedPost,
170
- blockInserterPanel,
171
- listViewPanel,
172
108
  saveViewPanel,
173
109
  canvasMode,
174
110
  editorCanvasContainerView
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","_default","combineReducers","exports","default"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tdeviceType,\n\tsettings,\n\teditedPost,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAEC,KAAK,GAAG,SAAS,EAAEC,MAAM,EAAG;EACvD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACF,UAAU;EAC1B;EAEA,OAAOC,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,QAAQA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAA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K;EACd;EACA,OAAOT,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASY,aAAaA,CAAEZ,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACQ,MAAM;IACrB,KAAK,iBAAiB;MACrB,OAAO,KAAK;EACd;EACA,OAAOT,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASa,UAAUA,CAAEb,KAAK,GAAG,MAAM,EAAEC,MAAM,EAAG;EAC7C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAOD,MAAM,CAACa,IAAI;EACpB;EAEA,OAAOd,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASe,yBAAyBA,CAAEf,KAAK,GAAGgB,SAAS,EAAEf,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACgB,IAAI;EACpB;EAEA,OAAOjB,KAAK;AACb;AAAC,IAAAkB,QAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BpB,UAAU;EACVI,QAAQ;EACRC,UAAU;EACVI,kBAAkB;EAClBG,aAAa;EACbC,aAAa;EACbC,UAAU;EACVE;AACD,CAAE,CAAC;AAAAK,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
1
+ {"version":3,"names":["_data","require","settings","state","action","type","editedPost","postType","id","context","saveViewPanel","isOpen","canvasMode","mode","editorCanvasContainerView","undefined","view","_default","combineReducers","exports","default"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the 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":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,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;AACO,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;AACO,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;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